[FFmpeg-devel] [PATCH] Add RSHIFT_POS and ROUNDED_DIV_POS

Ramiro Polla ramiro.polla
Tue Jul 28 22:51:08 CEST 2009


On Tue, Jul 28, 2009 at 6:49 AM, Michael Niedermayer<michaelni at gmx.at> wrote:
> On Tue, Jul 28, 2009 at 04:12:03AM -0300, Ramiro Polla wrote:
>> Currently there is RSHIFT(a,b) and ROUNDED_DIV(a,b), which work for
>> both negative and positive values of a. This patch adds variants that
>> only work on positive values of a, so it may be used on variables
>> known to be positive.
>>
>> And another patch uses it in swscale.
>
> I honestly dont see the point,
> the first part is just init where such minor speed change is irrelevant
> and the rest is clearer and less code as pure C s it is

Not such a strong opinion either but I prefer having macros with
somewhat descriptive names for operations like these. swscale is
peppered with a bunch of such operations and some other bit
manipulation tricks...



More information about the ffmpeg-devel mailing list