[libav-devel] [rfc] a replacement decoder

Ronald S. Bultje rsbultje at gmail.com
Wed Nov 2 19:42:48 CET 2011


Hi,

On Wed, Nov 2, 2011 at 11:40 AM, Kostya Shishkov
<kostya.shishkov at gmail.com> wrote:
> On Wed, Nov 02, 2011 at 09:11:16AM -0700, Ronald S. Bultje wrote:
>> Hi,
>>
>> On Wed, Nov 2, 2011 at 8:40 AM, Kostya Shishkov
>> <kostya.shishkov at gmail.com> wrote:
>> [..]
>> > #define AVG_32(dst, src, ref) \
>> >     *((uint32_t *)((dst))) = ((*((uint32_t *)((src))) + *((uint32_t *)((ref)))) >> 1) & 0x7F7F7F7F
>> >
>> > #define AVG_64(dst, src, ref) \
>> >     *((uint64_t *)((dst))) = ((*((uint64_t *)((src))) + *((uint64_t *)((ref)))) >> 1) & 0x7F7F7F7F7F7F7F7F
>>
>> AV_[WR]N{32,64}A() please.
>
> changed everywhere
>
> [...]
>> And again I'd personally prefer static av_always_inline over macros.
>
> Nobody is forbidding you to write it that way, I prefer to leave it as is.
>
>> >         src32 = (const uint32_t *)src;
>> >         dst32 = (uint32_t *)dst;
>> >
>> >         /* convert four pixels at once using softSIMD */
>> >         for (x = 0; x < plane->width >> 2; x++)
>> >             *dst32++ = (*src32++ & 0x7F7F7F7F) << 1;
>>
>> soft-simd? AV_[WR]N32A().
>
> I'd renamed it to more common SWAR (SIMD within a register), an old venerable
> technique. See http://aggregate.org/MAGIC/ for more examples.

That's all I had. Feel free to commit. :-).

Ronald


More information about the libav-devel mailing list