[FFmpeg-devel] [Patch] Scale filter should use multiples of 2

Daniel G. Taylor dan
Thu Jul 1 16:00:18 CEST 2010


On 06/30/2010 07:40 PM, Stefano Sabatini wrote:
>
>> Index: libavfilter/vf_scale.c
>> ===================================================================
>> --- libavfilter/vf_scale.c	(revision 23891)
>> +++ libavfilter/vf_scale.c	(working copy)
>> @@ -33,7 +33,7 @@
>>       /**
>>        * New dimensions. Special values are:
>>        *   0 = original width/height
>> -     *  -1 = keep original aspect
>> +     *  -x = keep original aspect and make mod-x, e.g. -16 for multiples of 16
>
> Just a question, couldn't this be achieved using parametric values for
> w:h?
>
> I don't want to add code and complexity when all this may be
> accomplished by a more general mechanism.
>
> For example we may have a = w / h
> w'/h' = a = w/h
> h' = w' / a
>
> scale=OUT_W:mod(OUT_W/a, 2)

I suppose that will work (and Michael is right about it being round() 
instead of mod), but doesn't having to parse such values make this 
incredibly more complex? Are there utilities in libav* to make parsing 
that easy?

Also, what other use cases are there for such a system? We can round to 
the nearest multiple, but what else would it do that warrants such a system?

Basically, I don't know how I can do this easily, and writing a bunch of 
code doing it a stupid way seems like a waste of time, so any advice 
would be appreciated if we do want to go this way.

Take care,
-- 
Daniel G. Taylor
http://programmer-art.org/



More information about the ffmpeg-devel mailing list