[FFmpeg-devel] [PATCH] Parsing ALS object type in MPEG-4

Måns Rullgård mans
Fri Aug 21 12:21:56 CEST 2009


Michael Niedermayer <michaelni at gmx.at> writes:

> On Thu, Aug 20, 2009 at 12:13:52PM -0400, Alexander Strange wrote:
>>
>> 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?
>
> if AV_RB/L*() is inefficient it should be fixed by using 
> __builtin_constant_p()

We can do that, but we need to wrap it in a macro to make it
compiler-independent.  The first step is to do a survey of available
methods in different compilers.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list