[FFmpeg-devel] [PATCHSET] AAC decoder refactor

Lynne dev at lynne.ee
Mon Apr 8 10:36:11 EEST 2024


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0038-aacdec-initialize-float-fixed-SBR-tables-only-when-e.patch
Type: text/x-diff
Size: 6125 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0037-aacsbr-constify-the-only-SBR-table.patch
Type: text/x-diff
Size: 9296 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0036-aacdec-remove-AAC-specific-MIPS-optimizations.patch
Type: text/x-diff
Size: 132961 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0035-aac-move-aacdec.c-to-aac-aacdec.c.patch
Type: text/x-diff
Size: 190067 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0034-aacdec-move-aacdec.h-into-libavcodec-aac.patch
Type: text/x-diff
Size: 4912 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0033-aacdec-merge-previously-templated-code.patch
Type: text/x-diff
Size: 178192 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0005.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0032-aacdec-move-LATM-decode-functions-into-a-separate-fi.patch
Type: text/x-diff
Size: 24022 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0006.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0031-aacdec-fully-detemplate-decoder-core.patch
Type: text/x-diff
Size: 17664 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0007.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0030-aacdec-move-fixed-float-DSP-initialization-to-templa.patch
Type: text/x-diff
Size: 5855 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0008.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0029-aacdec-reuse-TNS-and-LTP-tables-between-fixed-and-fl.patch
Type: text/x-diff
Size: 5025 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0009.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0028-aacdec-move-prediction-to-separate-files.patch
Type: text/x-diff
Size: 21780 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0010.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0027-aacdec-move-CCE-decoding-to-a-separate-templated-fil.patch
Type: text/x-diff
Size: 11697 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0011.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0026-aacdec-move-fixed-point-clipping-to-a-separate-funct.patch
Type: text/x-diff
Size: 3894 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0012.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0025-aacdec-split-off-channel-coupling-into-a-new-file.patch
Type: text/x-diff
Size: 21542 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0013.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0024-aacdec-deduplicate-table-initizalization.patch
Type: text/x-diff
Size: 3515 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0014.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0023-aacdec-move-spectrum-decode-and-dequantization-to-a-.patch
Type: text/x-diff
Size: 45486 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0015.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0022-aacdec-remove-unnecessary-decode_spectrum_and_dequan.patch
Type: text/x-diff
Size: 2470 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0016.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0021-aacdec-template-LTP-windowing-separately.patch
Type: text/x-diff
Size: 8062 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0017.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0020-aacdec-template-windowing-and-transforms-separately.patch
Type: text/x-diff
Size: 27080 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0018.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0019-aacdec-duplicate-table-initialization.patch
Type: text/x-diff
Size: 4812 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0019.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0018-aacdec-template-LTP-application-separately.patch
Type: text/x-diff
Size: 13950 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0020.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0017-aacdec-template-TNS-application-separately.patch
Type: text/x-diff
Size: 9618 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0021.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0016-aacdec-template-intensity-stereo-application-separat.patch
Type: text/x-diff
Size: 6275 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0022.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0015-aacdec-template-mid-side-stereo-application-separate.patch
Type: text/x-diff
Size: 4530 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0023.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0014-aacdec-template-scalefactor-dequantization-separatel.patch
Type: text/x-diff
Size: 10891 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0024.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0013-aacdec-switch-ify-scalefactor-decoding.patch
Type: text/x-diff
Size: 2540 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0025.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0012-aacdec-give-spectrum-dequant-decode-SCE-rather-than-.patch
Type: text/x-diff
Size: 2075 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0026.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0011-aacdec-separate-out-scalefactor-dequantization-from-.patch
Type: text/x-diff
Size: 6595 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0027.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-aacdec-add-a-decoder-DSP-structure.patch
Type: text/x-diff
Size: 2478 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0028.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-avcodec-aacdec_template-Deduplicate-common-part-of-a.patch
Type: text/x-diff
Size: 7028 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0029.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-avcodec-aacdec_template-Deduplicate-AVClass-AVOption.patch
Type: text/x-diff
Size: 7687 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0030.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-avcodec-aacdec_template-Deduplicate-aac_decode_close.patch
Type: text/x-diff
Size: 9100 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0031.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-avcodec-aacdec-Use-same-AACDecContext-for-fixed-and-.patch
Type: text/x-diff
Size: 26279 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0032.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-avcodec-aacdec-PredictorState-array-out-of-SingleCha.patch
Type: text/x-diff
Size: 6471 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0033.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-avcodec-aacdec-Always-include-AV-Fixed-Float-DSPCont.patch
Type: text/x-diff
Size: 1778 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0034.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-avcodec-aacdec-Split-SBR-context-from-ChannelElement.patch
Type: text/x-diff
Size: 5883 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0035.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-avcodec-aacsbr-Make-ff_aac_sbr_-funcs-accept-Channel.patch
Type: text/x-diff
Size: 9366 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0036.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-aacdec-move-aacdec_common-to-aac-aacdec_tab.patch
Type: text/x-diff
Size: 5398 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240408/efa2d90a/attachment-0037.patch>


More information about the ffmpeg-devel mailing list