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

Michael Niedermayer michael at niedermayer.cc
Thu May 16 21:30:02 EEST 2024


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


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240516/0e08c353/attachment.sig>


More information about the ffmpeg-devel mailing list