[FFmpeg-devel] [PATCH] Parsing ALS object type in MPEG-4
Alexander Strange
astrange
Thu Aug 20 18:13:52 CEST 2009
On Aug 20, 2009, at 3:48 AM, Ronald S. Bultje wrote:
> Hi Reimar,
>
> On Thu, Aug 20, 2009 at 2:22 AM, Reimar
> D?ffinger<Reimar.Doeffinger at gmx.de> wrote:
>> On Wed, Aug 19, 2009 at 08:18:19PM -0400, Ronald S. Bultje wrote:
>>> On Wed, Aug 19, 2009 at 8:10 PM, Thilo
>>> Borgmann<thilo.borgmann at googlemail.com> wrote:
>>>>>> + if (get_bits_long(gb, 32) != 0x414C5300)
>>>>> MKBETAG('A','L','S','\0')
>>>> Done.
>>> [..]
>>>> + if (show_bits_long(&gb, 24) != 0x414C53) {
>>>
>>> same here (MKBETAG(0, 'A', 'L', 'S'))?
>>
>> How about AV_RB24("ALS") and AV_RL24("ALS") ?
>
> (Completely irrelevant performance-wise, but ...) do they actually
> expand to the same asm (with a reasonably modern gcc -O3-style
> compiler)? Or is the string part of the generated asm for the second
> case / is the first therefore in fact more efficient?
>
> (I've always preferred the MK*TAG() over string-parsing with the
> assumption that it'd be more efficient...)
>
> Ronald
They're just as efficient for plain-C code, but MKTAG is better if
bswap.h is using asm, since that can't be simplified. That seems to be
about 90% of the effect of that __builtin_bswap patch.
How about changing MKTAG('a','b','c','d') to MKTAG("abcd") and
introducing MK(BE)TAG3 for 24-bit instead of using AV_RB/L for
constants?
More information about the ffmpeg-devel
mailing list