[FFmpeg-devel] [PATCH 1/8] aacdec: move from scalefactor ranged arrays to flat arrays

Lynne dev at lynne.ee
Thu May 16 21:46:21 EEST 2024


On 16/05/2024 20:30, Michael Niedermayer wrote:
> On Thu, May 16, 2024 at 12:08:11PM +0200, Lynne via ffmpeg-devel wrote:
>> AAC uses an unconventional system to send scalefactors
>> (the volume+quantization value for each band).
>> Each window is split into either 1 or 8 blocks (long vs short),
>> and transformed separately from one another, with the coefficients
>> for each being also completely independent. The scalefactors
>> slightly increase from 64 (long) to 128 (short) to accomodate
>> better per-block-per-band volume for each window.
>>
>> To reduce overhead, the codec signals scalefactor sizes in an obtuse way,
>> where each group's scalefactor types are sent via a variable length decoding,
>> with a range.
>> But our decoder was written in a way where those ranges were carried through
>> the entire decoder, and to actually read them you had to use the range.
>>
>> Instead of having a dedicated array with a range for each scalefactor,
>> just let the decoder directly index each scalefactor.
>>
>> This also switches the form of quantized scalefactors to the format
>> the spec uses, where for intensity stereo and regular, scalefactors
>> are stored in a scalefactor - 100 form, rather than as-is.
>>
>> USAC gets rid of the complex scalefactor handling. This commit permits
>> for code sharing between both.
>> ---
>>   libavcodec/aac/Makefile              |   3 +-
>>   libavcodec/aac/aacdec.c              | 100 ++++++++++++---------------
>>   libavcodec/aac/aacdec.h              |   5 +-
>>   libavcodec/aac/aacdec_dsp_template.c |  95 ++++++++++---------------
>>   4 files changed, 85 insertions(+), 118 deletions(-)
>>
>> diff --git a/libavcodec/aac/Makefile b/libavcodec/aac/Makefile
>> index c3e525d373..8b0bfff3e5 100644
>> --- a/libavcodec/aac/Makefile
>> +++ b/libavcodec/aac/Makefile
>> @@ -2,6 +2,7 @@ clean::
>>   		$(RM) $(CLEANSUFFIXES:%=libavcodec/aac/%)
>>   
>>   OBJS-$(CONFIG_AAC_DECODER)          +=  aac/aacdec.o aac/aacdec_tab.o \
>> -                                        aac/aacdec_float.o
>> +                                        aac/aacdec_float.o aac/aacdec_usac.o \
>> +                                        aac/aacdec_ac.o
> 
> AR	libavcodec/libavcodec.a
> ar: libavcodec/aac/aacdec_ac.o: No such file or directory
> make: *** [ffbuild/library.mak:38: libavcodec/libavcodec.a] Error 1

Thanks, a stray git add, fixed in my repo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240516/007fe154/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240516/007fe154/attachment.sig>


More information about the ffmpeg-devel mailing list