aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aacdec.c
Commit message (Collapse)AuthorAgeFilesLines
* aac: move aacdec.c to aac/aacdec.cLynne2024-04-231-2495/+0
|
* aacdec: move aacdec.h into libavcodec/aacLynne2024-04-231-1/+1
|
* aacdec: merge previously-templated codeLynne2024-04-231-1/+2388
|
* aacdec: move LATM decode functions into a separate fileLynne2024-04-231-314/+1
|
* aacdec: fully detemplate decoder coreLynne2024-04-231-1/+21
|
* aacdec: move prediction to separate filesLynne2024-04-231-65/+0
|
* aacdec: split off channel coupling into a new fileLynne2024-04-231-53/+0
|
* aacdec: deduplicate table initizalizationLynne2024-04-231-5/+0
| | | | All tables now initialized by aac/aacdec_fixed|float
* aacdec: move spectrum decode and dequantization to a new fileLynne2024-04-231-68/+0
|
* avcodec/aacdec_template: Deduplicate common part of aac_decode_init()Andreas Rheinhardt2024-04-231-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacdec_template: Deduplicate AVClass+AVOptionsAndreas Rheinhardt2024-04-231-3/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacdec_template: Deduplicate aac_decode_close()Andreas Rheinhardt2024-04-231-2/+2
| | | | | | | This is possible now that both AAC decoders share the same context. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacdec: Use same AACDecContext for fixed and floatAndreas Rheinhardt2024-04-231-2/+2
| | | | | | | | | | | | | | | | | | Up until now, there was one AACDecContext for the fixed and one for the floating point decoder. These differed mostly in certain arrays which were int for the fixed-point and float for the floating point decoder; there were also differences in corresponding function pointers. Yet in order to deduplicate the enormous amount of currently duplicated code between the float and the fixed-point decoder, one needs common contexts. Given that int and float have the same size on all common systems, this commit replaces these arrays by unions of int arrays and of float arrays. The names of these arrays have been chosen to be compatible with AAC_RENAME(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacsbr: Make ff_aac_sbr_* funcs accept ChannelElement*Andreas Rheinhardt2024-04-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | Each ChannelElement contains exactly one SpectralBandReplication structure; the latter structure contains lots of buffers whose size depend upon USE_FIXED (i.e. AAC_FLOAT arrays). This complicates deduplicating the parts of the AAC decoder that are duplicated between the fixed-point and the floating point decoder. In order to fix this, the SpectralBandReplication structure will be moved from the part of ChannelElement visible to the common code. Therefore the ff_aac_sbr_* functions are ported to accept a ChannelElement*; they will then have to translate that to the corresponding SpectralBandReplication* themselves (which is possible, because there are floating-point and fixed-point versions of these functions). While just at it, also ensure that these functions are properly namespaced. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* aacdec: move aacdec_common to aac/aacdec_tabLynne2024-04-231-1/+1
| | | | | Start to clean up the decoder. Also renames a confusingly named file.
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUTJames Almer2024-03-071-2/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/lpc: Split inline functions into a header of their ownAndreas Rheinhardt2024-03-041-1/+0
| | | | | | | | | And move compute_ref_coefs() to its only user: lpc.c There is no overlap between the users of compute_lpc_coefs() and lpc proper. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacdec: Rename AACContext to AACDecContextAndreas Rheinhardt2024-02-271-5/+5
| | | | | | | | | | It is decoder-only; furthermore, there is already an AACContext in use by libfdk-aacenc. Also make aacdec.h provide the typedef for AACContext; up until now, this has been done by sbr.h. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avocdec/aac: Move decoder-only stuff to new header aacdec.hAndreas Rheinhardt2024-02-271-0/+1
| | | | | | | AACContext is not used by the encoder at all. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacdectab: Deduplicate common decoder tablesAndreas Rheinhardt2023-10-311-4/+4
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* aacdec: convert to lavu/tx and support fixed-point 960-sample decodingLynne2022-11-061-3/+1
| | | | | | | | | | | This patch replaces the transform used in AAC with lavu/tx and removes the limitation on only being able to decode 960-sample files with the float decoder. This commit also removes a whole bunch of unnecessary and slow lifting steps the decoder did to compensate for the poor accuracy of the old integer transformation code. Overall float decoder speedup on Zen 3 for 64kbps: 32%
* avcodec/codec_internal: Avoid deprecation warnings for channel_layoutsAndreas Rheinhardt2022-09-281-6/+2
| | | | | | | | | | | | | | | | | | AVCodec.channel_layouts is deprecated and Clang (unlike GCC) warns when setting this field in a codec definition. Fortunately, Clang (unlike GCC) allows to use FF_DISABLE_DEPRECATION_WARNINGS inside a definition (of an FFCodec), so that one can create simple macros to set AVCodec.channel_layouts that also suppress deprecation warnings for Clang. (Notice that some of the codec definitions were already inside FF_DISABLE/ENABLE_DEPRECATION_WARNINGS (that were not guarded by FF_API_OLD_CHANNEL_LAYOUT); these have been removed. Also notice that setting AVCodec.channel_layouts was not guarded by FF_API_OLD_CHANNEL_LAYOUT either, so testing disabling it it without removing all the codeblocks would not have worked.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-2/+2
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-2/+2
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-2/+2
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-051-1/+1
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-21/+21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-1/+1
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* aac: convert to new channel layout APIAnton Khirnov2022-03-151-0/+6
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Remove the FFT_FIXED_32 defineAndreas Rheinhardt2021-08-051-1/+0
| | | | | | | | Since the removal of the 16-bit FFT said define is unnecessary as FFT_FIXED_32 is always !FFT_FLOAT. But one wouldn't believe it when looking at the code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-2/+2
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/aacdec, aactab: Move kbd tables to their only userAndreas Rheinhardt2020-12-081-0/+2
| | | | | | | | | | | | The floating point kbd tables for 120 and 960 samples are only used by the floating point decoder whereas the fixed point kbd tables for 128 and 1024 samples are only used by the fixed point AAC decoder. So move these tables to their only users. This ensures that they are not accidentally used somewhere else without ensuring that initializing these tables stays thread-safe (as it is now because the only place from where they are initialized is guarded by an AVOnce). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aacdec, sinewin: Move 120 and 960 point sine tables to aacdecAndreas Rheinhardt2020-12-081-0/+3
| | | | | | | | | | | | | The floating point AAC decoder is the only user of these tables, so it makes sense to move them there. Furthermore, initializing the ordinary power-of-two sinetables is currently not thread-safe and if the 120- and 960-point sinetables were not moved, one would have to choose whether to guard initializing these two tables with their own AVOnces or not. Doing so would add unnecessary AVOnces as the AAC decoder already guards initializing its static data by an AVOnce; not doing so would be fragile if a second user of these tables were to be added. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aacdec: Check if we run out of input in read_stream_mux_config()Michael Niedermayer2019-09-241-0/+2
| | | | | | | | Fixes: Infinite loop Fixes: 16920/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5653421289373696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec: Add FF_CODEC_CAP_INIT_CLEANUPMichael Niedermayer2019-08-231-2/+2
| | | | | | | | | Fixes: memleaks Fixes: 16289/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5200695692623872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aacdec: use float_dsp in apply_independent_couplingLynne2019-05-031-3/+1
| | | | Could not be used in apply_dependent_coupling because of alignment issues.
* avcodec/aacdec: log configuration change detailsAman Gupta2018-03-071-2/+2
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'b5f19f7478492307e4b4763aeac3180faf50e17f'James Almer2017-10-301-1/+1
|\ | | | | | | | | | | | | * commit 'b5f19f7478492307e4b4763aeac3180faf50e17f': aac: Split function to parse ADTS header data into public and private part Merged-by: James Almer <jamrial@gmail.com>
| * aac: Split function to parse ADTS header data into public and private partDiego Biurrun2017-05-021-2/+2
| | | | | | | | | | | | This makes the currently semi-public avpriv_aac_parse_header() function private to libavcodec and adds a proper public API function to return the parts of the ADTS header required in libavformat.
* | Merge commit '984736dd9e5b50987a5910e22495304e4a6d975c'James Almer2017-10-031-3/+3
|\| | | | | | | | | | | | | * commit '984736dd9e5b50987a5910e22495304e4a6d975c': lavc: make sure not to return EAGAIN from codecs Merged-by: James Almer <jamrial@gmail.com>
| * lavc: make sure not to return EAGAIN from codecsAnton Khirnov2017-02-251-3/+3
| | | | | | | | | | | | This error is treated specially by the API. CC: libav-stable@libav.org
| * Use avpriv_report_missing_feature() where appropriateDiego Biurrun2016-11-081-2/+1
| |
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-3/+3
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/aacdec: Fix runtime error: signed integer overflow: 2147483520 + 255 ↵Michael Niedermayer2017-05-171-1/+3
| | | | | | | | | | | | | | | | | | cannot be represented in type 'int' Fixes: 1656/clusterfuzz-testcase-minimized-5900404925661184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | imdct15: rename to mdct15 and add a forward transformRostislav Pehlivanov2017-02-141-1/+1
| | | | | | | | | | | | | | Handles strides (needed for Opus transients), does pre-reindexing and folding without needing a copy. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* | aac_latm: Copy whole AudioSpecificConfig when it is sized.Alex Converse2017-02-131-12/+15
| | | | | | | | This preserves sync extensions.
* | aac_latm: Allow unaligned AudioSpecificConfigAlex Converse2017-02-131-11/+15
| | | | | | | | Fixes ticket 4730
* | Move cbrt tables to separate cbrt_data(_fixed).c files.Reimar Döffinger2016-03-131-1/+1
| | | | | | | | | | | | Allows sharing and reusing the data between different files. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'Hendrik Leppkes2016-01-011-2/+3
|\| | | | | | | | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>