[FFmpeg-devel] AAC decoder round 5
Fri Aug 8 16:12:49 CEST 2008
2008/8/8 Michael Niedermayer <michaelni at gmx.at>:
> On Thu, Aug 07, 2008 at 11:53:39PM +0100, Robert Swain wrote:
>> 2008/8/7 Michael Niedermayer <michaelni at gmx.at>:
>> >> > [...]
>> >> >> Index: libavcodec/aac.h
>> >> >> ===================================================================
>> >> >> --- libavcodec/aac.h (revision 14624)
>> >> >> +++ libavcodec/aac.h (working copy)
>> >> >> @@ -42,8 +44,63 @@
>> >> >> ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num]), sizeof(ff_aac_spectral_codes[num]), \
>> >> >> size);
>> >> >>
>> >> >> +#define MAX_CHANNELS 64
>> >> >
>> >> > ok as long as its not causing huge arrays, like if there was a use like
>> >> > array[MAX_FRAME][MAX_TAGS][MAX_BANDS][MAX_CHANNELS] ...
>> >> Please define huge.
>> > huge being 10k for the context IMHO, that is if you can safe 10k by
>> > making MAX_CHANNELS a realistic number please do.
>> > if it just safes 500 bytes its not worth it if it makes the code more
>> > complex ...
>> OK, I'll have a check. Are you mainly concerned about the main
>> AACContext rather than the individual channel elements? Of course it's
>> good to minimise them all as long as they don't cause obfuscated code
>> (though it shouldn't hurt to reduce MAX_CHANNELS I wouldn't have
> Iam concerned about all large arrays that are partly unused ...
Struct name Size (bytes)
float gain which is [gain list][window group][scalefactor band]
enum BandType band_type which is [window group][scalefactor band]
int band_type_run_end which is [window group][scalefactor band]
float sf which is [window group][scalefactor band]
float coeffs, saved, ret
ms_mask which is [window group][scalefactor band]
SingleChannelElement * 2
note: each channel element is malloced
float buf_mdct, revers
So, it seems the issue is not MAX_CHANNELS so much as the window group
and scalefactor band arrays. I'm going to check the cases for maximum
number of scalefactor bands per window group as I expect it may be
beneficial to flatten these two indices.
buf_mdct and revers can be made half size when changing to imdct_half
so that should help with AACContext. And maybe coeffs/saved can be
Do you have any other comments?
More information about the ffmpeg-devel