[FFmpeg-soc] [soc]: r2530 - aac/aac.c

Robert Swain robert.swain at gmail.com
Sun Jun 22 14:10:15 CEST 2008


2008/6/22 Michael Niedermayer <michaelni at gmx.at>:
> On Sun, Jun 22, 2008 at 12:30:32PM +0200, superdump wrote:
>> Author: superdump
>> Date: Sun Jun 22 12:30:31 2008
>> New Revision: 2530
>>
>> Log:
>> Migrate to new static VLC table initialisation
>>
>>
>> Modified:
>>    aac/aac.c
>>
>> Modified: aac/aac.c
>> ==============================================================================
>> --- aac/aac.c (original)
>> +++ aac/aac.c Sun Jun 22 12:30:31 2008
>> @@ -801,6 +801,62 @@ static int aac_decode_init(AVCodecContex
>>      avccontext->sample_rate = ac->m4ac.sample_rate;
>>      avccontext->frame_size  = 1024;
>>
>> +    if(!books[0].table)
>> +        INIT_VLC_STATIC(&books[0], 6, tmp[0].s/sizeof(tmp[0].a_code[0]),
>> +            tmp[0].a_bits, sizeof(tmp[0].a_bits[0]), sizeof(tmp[0].a_bits[0]),
>> +            tmp[0].a_code, sizeof(tmp[0].a_code[0]), sizeof(tmp[0].a_code[0]),
>> +            144);
>
> what are the if() good for?

To check for existence of the tables? I see there is code within
init_vlc() checking the table size against the allocated size. Would
one check ( if(!books[0].table) ) encompassing all the
INIT_VLC_STATIC() calls be OK?

I wanted to keep this in the loop but as the macro declares a static
variable, within a loop the variable is local to that code block which
breaks the table generation even if the static_size doesn't change.

Also, is there a good way of dealing with situation like this where
the static_size differs for each books[i]? The static_size argument
must be a constant at compile time so I thought of hacking up a macro
but when I discovered the aforementioned static var issue with loops I
gave up and just unrolled the calls.

Rob



More information about the FFmpeg-soc mailing list