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

Thilo Borgmann thilo.borgmann
Sat Aug 22 02:13:04 CEST 2009


M?ns Rullg?rd schrieb:
> 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.
> 
Thus I don't need to change it for the patch?

-Thilo



More information about the ffmpeg-devel mailing list