diff mbox series

[FFmpeg-devel,PATCHSET] AAC decoder refactor

Message ID NuwZLzA--3-9@lynne.ee
State New
Headers show
Series [FFmpeg-devel,PATCHSET] AAC decoder refactor | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Lynne April 8, 2024, 7:36 a.m. UTC
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.

Comments

Lynne April 10, 2024, 4:48 p.m. UTC | #1
Apr 8, 2024, 09:36 by dev@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.
Michael Niedermayer April 10, 2024, 6:18 p.m. UTC | #2
On Wed, Apr 10, 2024 at 06:48:26PM +0200, Lynne wrote:
> Apr 8, 2024, 09:36 by dev@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

[...]
Michael Niedermayer April 10, 2024, 9:51 p.m. UTC | #3
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@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

build fails on mips

make -j32 -k
CC	libavcodec/aac/aacdec_float.o
src/libavcodec/aac/aacdec_float.c: In function ‘init’:
src/libavcodec/aac/aacdec_float.c:81:5: error: implicit declaration of function ‘ff_aacdec_init_mips’; did you mean ‘ff_float_dsp_init_mips’? [-Werror=implicit-function-declaration]
     ff_aacdec_init_mips(ac);
     ^~~~~~~~~~~~~~~~~~~
     ff_float_dsp_init_mips
cc1: some warnings being treated as errors
src/ffbuild/common.mak:81: recipe for target 'libavcodec/aac/aacdec_float.o' failed
make: *** [libavcodec/aac/aacdec_float.o] Error 1
make: Target 'all' not remade because of errors.



[...]
Michael Niedermayer April 10, 2024, 9:56 p.m. UTC | #4
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@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

[...]
Lynne April 11, 2024, 5:42 a.m. UTC | #5
Apr 10, 2024, 23:57 by michael@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@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.
Michael Niedermayer April 11, 2024, 10:45 p.m. UTC | #6
On Thu, Apr 11, 2024 at 07:42:37AM +0200, Lynne wrote:
> Apr 10, 2024, 23:57 by michael@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@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.


[...]
Lynne April 12, 2024, 9:11 a.m. UTC | #7
Apr 12, 2024, 00:45 by michael@niedermayer.cc:

> On Thu, Apr 11, 2024 at 07:42:37AM +0200, Lynne wrote:
>
>> Apr 10, 2024, 23:57 by michael@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@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?

Thanks.
Lynne April 21, 2024, 12:39 p.m. UTC | #8
Apr 12, 2024, 11:12 by dev@lynne.ee:

> Apr 12, 2024, 00:45 by michael@niedermayer.cc:
>
>> On Thu, Apr 11, 2024 at 07:42:37AM +0200, Lynne wrote:
>>
>>> Apr 10, 2024, 23:57 by michael@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@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?
>

Ping. I'm probably the only one who'll touch the AAC code in the near
future, but I wouldn't push this branch without a review first.
Michael Niedermayer April 21, 2024, 10:18 p.m. UTC | #9
On Fri, Apr 12, 2024 at 11:11:53AM +0200, Lynne wrote:
> Apr 12, 2024, 00:45 by michael@niedermayer.cc:
> 
> > On Thu, Apr 11, 2024 at 07:42:37AM +0200, Lynne wrote:
> >
> >> Apr 10, 2024, 23:57 by michael@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@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

[...]
Lynne April 22, 2024, 7:20 a.m. UTC | #10
Apr 22, 2024, 00:19 by michael@niedermayer.cc:

> On Fri, Apr 12, 2024 at 11:11:53AM +0200, Lynne wrote:
>
>> Apr 12, 2024, 00:45 by michael@niedermayer.cc:
>>
>> > On Thu, Apr 11, 2024 at 07:42:37AM +0200, Lynne wrote:
>> >
>> >> Apr 10, 2024, 23:57 by michael@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@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
>

Thanks. That sounds good enough for me, really the main
potential issue I see with this is that it changes the way files
are organized to be more like the VVC decoder.
Since no one seems bothered by that, I'll move on with pushing
this tomorrow.
Lynne April 23, 2024, 7:02 a.m. UTC | #11
Apr 22, 2024, 09:20 by dev@lynne.ee:

> Apr 22, 2024, 00:19 by michael@niedermayer.cc:
>
>> On Fri, Apr 12, 2024 at 11:11:53AM +0200, Lynne wrote:
>>
>>> Apr 12, 2024, 00:45 by michael@niedermayer.cc:
>>>
>>> > On Thu, Apr 11, 2024 at 07:42:37AM +0200, Lynne wrote:
>>> >
>>> >> Apr 10, 2024, 23:57 by michael@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@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
>>
>
> Thanks. That sounds good enough for me, really the main
> potential issue I see with this is that it changes the way files
> are organized to be more like the VVC decoder.
> Since no one seems bothered by that, I'll move on with pushing
> this tomorrow.
>

Patchset pushed. Thanks for the reviews and testing,
and for Andreas for the commits he did.

Final savings:
All measurements done on libavcodec/libavcodec.so.61 with a
default configuration after stripping:

x86-64:

clang-18 with -Os
Before: 10601800
After:  10589512

clang-18 with -O3
Before: 15377624
After:  15340760

gcc-14 with -O3
Before: 15377624
After:  15340760

gcc-14 with -Os
Before: 10601800
After:  10589512

aarch64:

gcc-12 with -O3
Before: 12444560
After:  12399504

clang-17 with -O3
Before: 12436368
After:  12399504

Disabling everything but audio encoders and decoders
seems like it saves more, but to keep it far, this is the
default config with everything enabled.
diff mbox series

Patch

From d3dac825a1ea0c82a9a799ff9415a5a8a598d47e Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Thu, 29 Feb 2024 04:52:58 +0100
Subject: [PATCH 01/38] aacdec: move aacdec_common to aac/aacdec_tab

Start to clean up the decoder.
Also renames a confusingly named file.
---
 libavcodec/Makefile                              |  5 +++--
 libavcodec/aac/Makefile                          |  5 +++++
 libavcodec/{aacdec_common.c => aac/aacdec_tab.c} | 11 ++++++-----
 libavcodec/{aacdectab.h => aac/aacdec_tab.h}     |  8 ++++----
 libavcodec/aacdec.c                              |  2 +-
 libavcodec/aacdec_fixed.c                        |  2 +-
 libavcodec/aacsbr_template.c                     |  2 +-
 7 files changed, 21 insertions(+), 14 deletions(-)
 create mode 100644 libavcodec/aac/Makefile
 rename libavcodec/{aacdec_common.c => aac/aacdec_tab.c} (99%)
 rename libavcodec/{aacdectab.h => aac/aacdec_tab.h} (91%)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 708434ac76..71bef865f5 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -63,6 +63,7 @@  OBJS = ac3_parser.o                                                     \
        xiph.o                                                           \
 
 # subsystems
+include $(SRC_PATH)/libavcodec/aac/Makefile
 include $(SRC_PATH)/libavcodec/vvc/Makefile
 -include $(SRC_PATH)/libavcodec/$(ARCH)/vvc/Makefile
 OBJS-$(CONFIG_AANDCTTABLES)            += aandcttab.o
@@ -177,11 +178,11 @@  OBJS-$(CONFIG_WMV2DSP)                 += wmv2dsp.o
 OBJS-$(CONFIG_ZERO12V_DECODER)         += 012v.o
 OBJS-$(CONFIG_A64MULTI_ENCODER)        += a64multienc.o elbg.o
 OBJS-$(CONFIG_A64MULTI5_ENCODER)       += a64multienc.o elbg.o
-OBJS-$(CONFIG_AAC_DECODER)             += aacdec.o aacdec_common.o aactab.o \
+OBJS-$(CONFIG_AAC_DECODER)             += aacdec.o aactab.o \
                                           aacsbr.o aacps_common.o aacps_float.o \
                                           kbdwin.o \
                                           sbrdsp.o aacpsdsp_float.o cbrt_data.o
-OBJS-$(CONFIG_AAC_FIXED_DECODER)       += aacdec_fixed.o aacdec_common.o aactab.o \
+OBJS-$(CONFIG_AAC_FIXED_DECODER)       += aacdec_fixed.o aactab.o \
                                           aacsbr_fixed.o aacps_common.o aacps_fixed.o \
                                           kbdwin.o \
                                           sbrdsp_fixed.o aacpsdsp_fixed.o cbrt_data_fixed.o
diff --git a/libavcodec/aac/Makefile b/libavcodec/aac/Makefile
new file mode 100644
index 0000000000..52facdf4cf
--- /dev/null
+++ b/libavcodec/aac/Makefile
@@ -0,0 +1,5 @@ 
+clean::
+		$(RM) $(CLEANSUFFIXES:%=libavcodec/aac/%)
+
+OBJS-$(CONFIG_AAC_DECODER)          +=  aac/aacdec_tab.o
+OBJS-$(CONFIG_AAC_FIXED_DECODER)    +=  aac/aacdec_tab.o
diff --git a/libavcodec/aacdec_common.c b/libavcodec/aac/aacdec_tab.c
similarity index 99%
rename from libavcodec/aacdec_common.c
rename to libavcodec/aac/aacdec_tab.c
index 145c718047..45a84a9a72 100644
--- a/libavcodec/aacdec_common.c
+++ b/libavcodec/aac/aacdec_tab.c
@@ -25,11 +25,12 @@ 
  * Common code and tables of the AAC fixed- and floating-point decoders
  */
 
-#include "aac.h"
-#include "aacdectab.h"
-#include "aacps.h"
-#include "aactab.h"
-#include "vlc.h"
+#include "aacdec_tab.h"
+
+#include "libavcodec/aac.h"
+#include "libavcodec/aacps.h"
+#include "libavcodec/aactab.h"
+#include "libavcodec/vlc.h"
 
 #include "libavutil/attributes.h"
 #include "libavutil/thread.h"
diff --git a/libavcodec/aacdectab.h b/libavcodec/aac/aacdec_tab.h
similarity index 91%
rename from libavcodec/aacdectab.h
rename to libavcodec/aac/aacdec_tab.h
index 184508f2f3..70e49af202 100644
--- a/libavcodec/aacdectab.h
+++ b/libavcodec/aac/aacdec_tab.h
@@ -25,12 +25,12 @@ 
  * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
  */
 
-#ifndef AVCODEC_AACDECTAB_H
-#define AVCODEC_AACDECTAB_H
+#ifndef AVCODEC_AAC_AACDEC_TAB_H
+#define AVCODEC_AAC_AACDEC_TAB_H
 
 #include <stdint.h>
 
-#include "vlc.h"
+#include "libavcodec/vlc.h"
 
 #include "libavutil/attributes_internal.h"
 #include "libavutil/channel_layout.h"
@@ -52,4 +52,4 @@  extern const int16_t ff_aac_channel_map[3][4][6];
 extern const AVChannelLayout ff_aac_ch_layout[];
 FF_VISIBILITY_POP_HIDDEN
 
-#endif /* AVCODEC_AACDECTAB_H */
+#endif /* AVCODEC_AAC_AACDEC_TAB_H */
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 97e51dd72a..0a9ff1bfaf 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -46,7 +46,7 @@ 
 #include "aac.h"
 #include "aacdec.h"
 #include "aactab.h"
-#include "aacdectab.h"
+#include "aac/aacdec_tab.h"
 #include "adts_header.h"
 #include "cbrt_data.h"
 #include "sbr.h"
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index 305bb0ba9a..681e502e42 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -72,7 +72,7 @@ 
 #include "aac.h"
 #include "aacdec.h"
 #include "aactab.h"
-#include "aacdectab.h"
+#include "aac/aacdec_tab.h"
 #include "adts_header.h"
 #include "cbrt_data.h"
 #include "sbr.h"
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
index cdfaed636b..eadd6fa2d3 100644
--- a/libavcodec/aacsbr_template.c
+++ b/libavcodec/aacsbr_template.c
@@ -33,7 +33,7 @@ 
  */
 
 #include "aacdec.h"
-#include "aacdectab.h"
+#include "aac/aacdec_tab.h"
 #include "avcodec.h"
 #include "libavutil/qsort.h"
 
-- 
2.43.0.381.gb435a96ce8