summaryrefslogtreecommitdiff
path: root/libavcodec/aacdec_fixed.c
Commit message (Collapse)AuthorAgeFilesLines
* aacdec: convert to lavu/tx and support fixed-point 960-sample decodingLynne2022-11-061-2/+3
| | | | | | | | | | | 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-3/+1
| | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | 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/aacdec_fixed: add missing priv_classJames Almer2022-08-011-0/+1
| | | | | | This enables the same input options as the float decoder. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+1
| | | | | | | | | | | 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-1/+1
| | | | | | | | | | | 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: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-10/+10
| | | | | | | | | | | | | | | | 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/+3
| | | | | | 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-1/+1
| | | | | | | | | | 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_fixed: Move fixed-point sinewin tables to its only userAndreas Rheinhardt2021-02-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | The fixed-point AAC decoder is the only user of the fixed-point sinewin tables from sinewin; and it only uses a few of them (about 10% when counting by size). This means that guarding initializing these tables by an AVOnce (as done in 3719122065863f701026632f610175980d42b05a) is unnecessary for them. Furthermore the array of pointers to the individual arrays is also unneeded. Therefore this commit moves these tables directly into aacdec_fixed.c; this is done by ridding the original sinewin.h and sinewin_tablegen.h headers completely of any fixed-point code at the cost of a bit of duplicated code (the alternative is an ugly ifdef-mess). This saves about 58KB from the binary when using hardcoded tables (as these tables are hardcoded in this scenario); when not using hardcoded tables, most of these savings only affect the .bss segment, but the rest (< 1KB) contains relocations (i.e. savings in .data.rel.ro). Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/aacdec, aactab: Move kbd tables to their only userAndreas Rheinhardt2020-12-081-0/+3
| | | | | | | | | | | | 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_fixed: Limit index in vector_pow43()Michael Niedermayer2020-10-181-2/+2
| | | | | | | | Fixes: out of array access Fixes: 26087/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5724825462767616 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_fixed: Add FF_CODEC_CAP_INIT_CLEANUPMichael Niedermayer2019-09-241-1/+1
| | | | | | | | Fixes: memleaks Fixes: 16788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5649873898045440 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_fixed: Handle more extreem cases in noise_scale()Michael Niedermayer2019-06-041-4/+9
| | | | | | | | | Its unclear if these cases have any relevance in real files Fixes: shift exponent -2 is negative Fixes: 14489/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5681941631729664 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: ssign seems always -1 in noise_scale(), simplifyMichael Niedermayer2019-06-041-4/+4
|
* avcodec/aacdec_fixed: Fix undefined shift in noise_scale()Michael Niedermayer2019-04-251-1/+1
| | | | | | | Fixes: 13655/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5120559430500352 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_fixed: Provide context to av_log()Michael Niedermayer2019-01-011-2/+2
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: Fix undefined integer overflow in ↵Michael Niedermayer2018-06-151-1/+1
| | | | | | | | | | apply_independent_coupling_fixed() Fixes: signed integer overflow: 1195517 * 2048 cannot be represented in type 'int' Fixes: 8636/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-4695836326887424 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_fixed: use 64bit to avoid overflow in rounding in ↵Michael Niedermayer2018-05-271-1/+1
| | | | | | | | | | apply_dependent_coupling_fixed() Fixes: signed integer overflow: -2141499320 + -14469590 cannot be represented in type 'int' Fixes: 7351/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-6351214791884800 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_fixed: Fix integer overflow in apply_independent_coupling_fixed()Michael Niedermayer2018-04-021-1/+1
| | | | | | | | I was not able to reproduce this, this fix is based on just the fuzzer log. Fixes: 4959/clusterfuzz-testcase-minimized-6035350934781952 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_fixed: Fix undefined shiftMichael Niedermayer2017-11-131-1/+1
| | | | | | | | Fixes: runtime error: left shift of negative value -801112064 Fixes: 3492/clusterfuzz-testcase-minimized-5784775283441664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg 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>
* avcodec/aacdec_fixed: Fix integer overflow in apply_dependent_coupling_fixed()Michael Niedermayer2017-10-301-1/+1
| | | | | | | | Fixes: runtime error: signed integer overflow: 623487 * 536870912 cannot be represented in type 'int' Fixes: 3594/clusterfuzz-testcase-minimized-4650622935629824 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_fixed: Fix integer overflow in predict()Michael Niedermayer2017-10-301-2/+2
| | | | | | | | Fixes: runtime error: signed integer overflow: -2110708110 + -82837504 cannot be represented in type 'int' Fixes: 3547/clusterfuzz-testcase-minimized-6009386439802880 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_fixed: fix invalid shift in predict()Michael Niedermayer2017-08-051-2/+6
| | | | | | | | Fixes: runtime error: shift exponent -2 is negative Fixes: 2818/clusterfuzz-testcase-minimized-5062943676825600 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_fixed: fix: left shift of negative value -1Michael Niedermayer2017-07-241-1/+1
| | | | | | | Fixes: 2699/clusterfuzz-testcase-minimized-5631303862976512 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_fixed: Check s for being too smallMichael Niedermayer2017-06-191-2/+3
| | | | | | | | Fixes: runtime error: shift exponent -8 is negative Fixes: 2286/clusterfuzz-testcase-minimized-5711764169687040 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_fixed: Fix runtime error: left shift of negative value -1297616Michael Niedermayer2017-06-111-1/+1
| | | | | | | Fixes: 2195/clusterfuzz-testcase-minimized-4736721533009920 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_fixed: Fix runtime error: left shift of 1 by 31 places cannot ↵Michael Niedermayer2017-05-281-2/+2
| | | | | | | | | be represented in type 'int' Fixes: 1878/clusterfuzz-testcase-minimized-6441918630199296 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_fixed: Fix multiple runtime error: shift exponent 127 is too ↵Michael Niedermayer2017-05-281-1/+3
| | | | | | | | | large for 32-bit type 'int' Fixes: 1851/clusterfuzz-testcase-minimized-5692607495667712 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_fixed: Fix runtime error: signed integer overflow: ↵Michael Niedermayer2017-05-251-1/+1
| | | | | | | | | -2147483648 * -1 cannot be represented in type 'int' Fixes: 1825/clusterfuzz-testcase-minimized-6002833050566656 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_fixed: Fix multiple runtime error: shift exponent 127 is too ↵Michael Niedermayer2017-05-231-1/+3
| | | | | | | | | large for 32-bit type 'int' Fixes: 1762/clusterfuzz-testcase-minimized-5150981081792512 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_fixed: Fix runtime error: shift exponent 34 is too large for ↵Michael Niedermayer2017-05-211-1/+5
| | | | | | | | | 32-bit type 'int' Fixes: 1721/clusterfuzz-testcase-minimized-4719352135811072 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_fixed: Fix runtime error: left shift of negative value -1Michael Niedermayer2017-05-131-5/+5
| | | | | | | Fixes: 1535/clusterfuzz-testcase-minimized-5826695535788032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: Fix multiple shift exponent 33 is too large for 32-bit ↵Michael Niedermayer2017-05-111-1/+5
| | | | | | | | | type 'int' Fixes: 1471/clusterfuzz-testcase-minimized-6376460543590400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: Fix various integer overflowsMichael Niedermayer2017-05-111-1/+1
| | | | | | | Fixes: 1377/clusterfuzz-testcase-minimized-5487049807233024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Move cbrt tables to separate cbrt_data(_fixed).c files.Reimar Döffinger2016-03-131-3/+3
| | | | | | 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-0/+2
| | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* aac: Make codec init run under ff_thread_onceDerek Buitenhuis2015-10-151-0/+1
| | | | | | This makes AAC init threadsafe. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* aacdec_fixed: Make exp2tab static constTimothy Gu2015-08-221-1/+1
|
* Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec: Implementation of AAC_fixed_decoder (LC-module) [4/4]Jovan Zelincevic2015-07-091-1/+0
| | | | | | | | | | | | | | | | | | | Build system modified There are several warnings occurring during build after this patch is applied. The cause of most of these warnings is in that some definitions needed here are logical part of sbr module and are added in later patches. When this patches are applied these warnings stop occurring. The only warning that is added here and is not fixed with later patches is warning that warns that type mismatch for table ff_aac_eld_window_480. The reason for this warning is in that ER AAC ELD 480 is not integrated in to the fixed point implementation at this moment and there is no fixed point version of this table. Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavcodec: Implementation of AAC_fixed_decoder (LC-module) [3/4]Djordje Pesut2015-07-091-0/+444
Add fixed point implementation Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>