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

Ramiro Polla ramiro.polla
Sun Aug 2 20:01:20 CEST 2009


On Tue, Jul 28, 2009 at 7:49 PM, Michael Niedermayer<michaelni at gmx.at> wrote:
> On Tue, Jul 28, 2009 at 05:51:08PM -0300, Ramiro Polla wrote:
>> 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...
>
> for its the opposite
> clear C code that anyone can understand on its own
> vs.
> a macro with not so clear name one has to look up
>
> (you have an advantage, knowing what your own macro does ...)

Ok, then, that was just my opinion. Patch dropped...

Ramiro Polla



More information about the ffmpeg-devel mailing list