[FFmpeg-devel] [PATCHSET] AAC decoder refactor

Michael Niedermayer michael at niedermayer.cc
Mon Apr 22 01:18:54 EEST 2024


On Fri, Apr 12, 2024 at 11:11:53AM +0200, Lynne wrote:
> Apr 12, 2024, 00:45 by michael at niedermayer.cc:
> 
> > On Thu, Apr 11, 2024 at 07:42:37AM +0200, Lynne wrote:
> >
> >> Apr 10, 2024, 23:57 by michael at niedermayer.cc:
> >>
> >> > On Wed, Apr 10, 2024 at 08:18:11PM +0200, Michael Niedermayer wrote:
> >> >
> >> >> On Wed, Apr 10, 2024 at 06:48:26PM +0200, Lynne wrote:
> >> >> > Apr 8, 2024, 09:36 by dev at lynne.ee:
> >> >> > 
> >> >> > > The following patchset refactors the AAC decoder step by step,
> >> >> > > removing all large-scale templating and abstracting away typed
> >> >> > > DSP functions from symbol parsing.
> >> >> > >
> >> >> > > This series saves 110Kib of binary data from libavcodec.so
> >> >> > > when compiled with Clang 18 with -O3, after stripping.
> >> >> > >
> >> >> > > The patchset can also be viewed here:
> >> >> > > https://github.com/cyanreg/FFmpeg/tree/aac_cleanup
> >> >> > >
> >> >> > > Fate passes on each step, and I've been running this patchset for
> >> >> > > a week with no issues.
> >> >> > >
> >> >> > > This also prepares the decoder for USAC support.
> >> >> > >
> >> >> > 
> >> >> > I've rebased the linked repo to current git master if anyone
> >> >> > wants to test.
> >> >>
> >> >> thanks, i will try to test it
> >> >>
> >> >
> >> > make fate-source
> >> >
> >> > TEST    source
> >> > --- ./tests/ref/fate/source	2024-04-08 18:26:00.670129617 +0200
> >> > +++ tests/data/fate/source	2024-04-10 23:56:18.032896853 +0200
> >> > @@ -22,6 +22,13 @@
> >> >  compat/djgpp/math.h
> >> >  compat/float/float.h
> >> >  compat/float/limits.h
> >> > +libavcodec/aac/aacdec.h
> >> > +libavcodec/aac/aacdec_fixed_coupling.h
> >> > +libavcodec/aac/aacdec_fixed_dequant.h
> >> > +libavcodec/aac/aacdec_fixed_prediction.h
> >> > +libavcodec/aac/aacdec_float_coupling.h
> >> > +libavcodec/aac/aacdec_float_prediction.h
> >> > +libavcodec/aac/aacdec_latm.h
> >> >  libavcodec/bitstream_template.h
> >> >  tools/decode_simple.h
> >> >  Use of av_clip() where av_clip_uintp2() could be used:
> >> > Test source failed. Look at tests/data/fate/source.err for details.
> >> > tests/Makefile:310: recipe for target 'fate-source' failed
> >> > make: *** [fate-source] Error 1
> >> >
> >>
> >> Thanks for testing. Fixed both issues in the repo.
> >> Was only testing with fate-aac while developing.
> >>
> >
> > mips:
> >
> > make  -k
> > LD	ffmpeg_g
> > libavcodec/libavcodec.a(aacsbr.o): In function `ff_aac_sbr_ctx_alloc_init':
> > aacsbr.c:(.text.unlikely+0x1d4): undefined reference to `ff_aacsbr_func_ptr_init_mips'
> > aacsbr.c:(.text.unlikely+0x200): undefined reference to `ff_aacsbr_func_ptr_init_mips'
> > libavcodec/libavcodec.a(sbrdsp.o): In function `ff_sbrdsp_init':
> > sbrdsp.c:(.text.unlikely+0x10): undefined reference to `ff_sbrdsp_init_mips'
> > sbrdsp.c:(.text.unlikely+0xb4): undefined reference to `ff_sbrdsp_init_mips'
> > libavcodec/libavcodec.a(aacpsdsp_float.o): In function `ff_psdsp_init':
> > aacpsdsp_float.c:(.text.unlikely+0x10): undefined reference to `ff_psdsp_init_mips'
> > aacpsdsp_float.c:(.text.unlikely+0x6c): undefined reference to `ff_psdsp_init_mips'
> > collect2: error: ld returned 1 exit status
> > Makefile:136: recipe for target 'ffmpeg_g' failed
> > make: *** [ffmpeg_g] Error 1
> > LD	ffprobe_g
> > libavcodec/libavcodec.a(aacsbr.o): In function `ff_aac_sbr_ctx_alloc_init':
> > aacsbr.c:(.text.unlikely+0x1d4): undefined reference to `ff_aacsbr_func_ptr_init_mips'
> > aacsbr.c:(.text.unlikely+0x200): undefined reference to `ff_aacsbr_func_ptr_init_mips'
> > libavcodec/libavcodec.a(sbrdsp.o): In function `ff_sbrdsp_init':
> > sbrdsp.c:(.text.unlikely+0x10): undefined reference to `ff_sbrdsp_init_mips'
> > sbrdsp.c:(.text.unlikely+0xb4): undefined reference to `ff_sbrdsp_init_mips'
> > libavcodec/libavcodec.a(aacpsdsp_float.o): In function `ff_psdsp_init':
> > aacpsdsp_float.c:(.text.unlikely+0x10): undefined reference to `ff_psdsp_init_mips'
> > aacpsdsp_float.c:(.text.unlikely+0x6c): undefined reference to `ff_psdsp_init_mips'
> > collect2: error: ld returned 1 exit status
> > Makefile:136: recipe for target 'ffprobe_g' failed
> > make: *** [ffprobe_g] Error 1
> > make: Target 'all' not remade because of errors.
> >
> 
> Fixed. This should be all.
> On the Loongson machine I have access to, I can't compile FFmpeg
> due to missing asm/errno.h kernel header, while on the standard MIPS64
> machine I can access, compilation worked either way.

> Would you mind testing again the new version in the repo?

it works on my qemu based mips. I did give the loongson to anton 2 years ago
so i have no native loongson to test it with

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin
-------------- 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/20240422/68b65a03/attachment.sig>


More information about the ffmpeg-devel mailing list