[FFmpeg-devel] [PATCH] avoid using fixed size integers in AC3 code

Justin Ruggles justinruggles
Tue Sep 25 01:47:02 CEST 2007


Michael Niedermayer wrote:
> Hi
> 
> On Sun, Sep 23, 2007 at 10:08:30PM -0400, Justin Ruggles wrote:
>> $subject
>>
>> This was discussed already in the E-AC3 patch thread.
> 
> yes, now if i would only remember any details ...

Hmm...I guess my memory is getting bad.  I looked back and I had 
misinterpreted your review, then corrected myself.  anyway... I still 
don't understand why it's preferable to use fixed size integers for some 
variables but not for others when it's not necessary.

> 
> [...]
>> @@ -170,11 +170,11 @@
>>      int   endmant[AC3_MAX_CHANNELS];        ///< end frequency bin
>>      AC3BitAllocParameters bit_alloc_params; ///< bit allocation parameters
>>  
>> -    int8_t  dexps[AC3_MAX_CHANNELS][256];   ///< decoded exponents
>> -    uint8_t bap[AC3_MAX_CHANNELS][256];     ///< bit allocation pointers
>> -    int16_t psd[AC3_MAX_CHANNELS][256];     ///< scaled exponents
>> -    int16_t bndpsd[AC3_MAX_CHANNELS][50];   ///< interpolated exponents
>> -    int16_t mask[AC3_MAX_CHANNELS][50];     ///< masking curve values
>> +    int dexps[AC3_MAX_CHANNELS][256];       ///< decoded exponents
>> +    int bap[AC3_MAX_CHANNELS][256];         ///< bit allocation pointers
>> +    int psd[AC3_MAX_CHANNELS][256];         ///< scaled exponents
>> +    int bndpsd[AC3_MAX_CHANNELS][50];       ///< interpolated exponents
>> +    int mask[AC3_MAX_CHANNELS][50];         ///< masking curve values
> 
> why!? this significantly insreases the size of the context, also it
> makes SIMD optimizations using these impossible

Am I missing something here?  That would mean that we should make 
everything fixed size in case we want to optimize it someday.  Correct 
me if I'm wrong, but I thought FFmpeg's general guideline was to use 
generic integers when possible (except for tables which increase binary 
size).

-Justin




More information about the ffmpeg-devel mailing list