summaryrefslogtreecommitdiff
path: root/libavcodec/aacdec.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | 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-05
| | | | | | | | | | | 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-05
| | | | | | | | 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-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-21
| | | | | | | | | | 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-15
| | | | | | 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-05
| | | | | | | | 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-27
| | | | | | | | | | 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-08
| | | | | | | | | | | | 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-08
| | | | | | | | | | | | | 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-24
| | | | | | | | 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-23
| | | | | | | | | 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-03
| | | | Could not be used in apply_dependent_coupling because of alignment issues.
* avcodec/aacdec: log configuration change detailsAman Gupta2018-03-07
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'b5f19f7478492307e4b4763aeac3180faf50e17f'James Almer2017-10-30
|\ | | | | | | | | | | | | * 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-02
| | | | | | | | | | | | 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-03
|\| | | | | | | | | | | | | * 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-25
| | | | | | | | | | | | This error is treated specially by the API. CC: libav-stable@libav.org
| * Use avpriv_report_missing_feature() where appropriateDiego Biurrun2016-11-08
| |
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/aacdec: Fix runtime error: signed integer overflow: 2147483520 + 255 ↵Michael Niedermayer2017-05-17
| | | | | | | | | | | | | | | | | | 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-14
| | | | | | | | | | | | | | 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-13
| | | | | | | | This preserves sync extensions.
* | aac_latm: Allow unaligned AudioSpecificConfigAlex Converse2017-02-13
| | | | | | | | Fixes ticket 4730
* | Move cbrt tables to separate cbrt_data(_fixed).c files.Reimar Döffinger2016-03-13
| | | | | | | | | | | | 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-01
|\| | | | | | | | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * aacdec: fix aac_static_table_init() prototypeAnton Khirnov2015-12-07
| |
| * aac: Make codec init run under ff_thread_onceDerek Buitenhuis2015-10-15
| | | | | | | | | | | | This makes AAC init threadsafe. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * aac: Make sure to set err on the failure pathLuca Barbato2015-08-23
| | | | | | | | Bug-Id: CID 1308153
* | aac: Make codec init run under ff_thread_onceDerek Buitenhuis2015-10-15
| | | | | | | | | | | | This makes AAC init threadsafe. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec/aacdec: Fix integer overflow in argument to ↵Michael Niedermayer2015-08-03
| | | | | | | | | | | | decode_audio_specific_config() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-27
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | libavcodec: Implementation of AAC_fixed_decoder (LC-module) [4/4]Jovan Zelincevic2015-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-09
| | | | | | | | | | | | | | Add fixed point implementation 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) [1/4]Jovan Zelincevic2015-07-09
| | | | | | | | | | | | | | Move existing code to the new template files Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/aacdec: Do not return a uninitialized valueMichael Niedermayer2015-06-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'bc76c46943272515805d7ac48ca39f14826d1fed'Michael Niedermayer2015-06-08
|\| | | | | | | | | | | | | | | | | | | | | * commit 'bc76c46943272515805d7ac48ca39f14826d1fed': aac: Wait to know the channels before allocating frame Conflicts: libavcodec/aacdec.c See: 676a395ab903cac623c5d6ddd0928c789e08a59e Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aac: Wait to know the channels before allocating frameLuca Barbato2015-06-07
| | | | | | | | | | | | | | | | The channel configuration can be delivered only by the PCE, try to parse it first and not try to decode until a channel configuration is set. CC: libav-stable@libav.org
* | Merge commit 'a188108ebf28ebac9d2b8fc7d5b391aef45698b3'Michael Niedermayer2015-06-08
|\| | | | | | | | | | | | | * commit 'a188108ebf28ebac9d2b8fc7d5b391aef45698b3': aac: Support channel configurations 11 and 12 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aac: Support channel configurations 11 and 12Sebastian Dröge2015-06-07
| | | | | | | | | | | | | | | | | | | | | | These are defined in ISO/IEC 14496-3:2009/PDAM 4 for 6.1 and 7.1. It also defines another 7.1 layout with configuration 14, that one is not added here for now. 11: 3/3.1 FC FL+FR BL+BR BC LFE 12: 3/2/2.1 FC FL+FR SiL+SiR BL+BR LFE Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '677c804aa3a78d61b21e6423165a252846c20f0e'Michael Niedermayer2015-06-08
|\| | | | | | | | | | | | | | | * commit '677c804aa3a78d61b21e6423165a252846c20f0e': aac: correctly map 7.1ch-wide AAC from FDK AAC encoder Sample: FDK_7.1ch_wide.aac Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aac: correctly map 7.1ch-wide AAC from FDK AAC encodernu7742015-06-07
| | | | | | | | | | | | | | | | | | | | FDK AAC encoder outputs SCE(front)+CPE(front)+CPE(back)+CPE(back) on MODE_7_1_REAR_SURROUND configuration. Since decoder couldn't properly map 4 back channels, decoding failed unless -request_channel_layout 0x8000000000000000 has been specified. Now we treat first CPE(back) as CPE(side) on channel mapping. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '0289f81241e720452b5a77713488d54d3ec252d7'Michael Niedermayer2015-06-03
|\| | | | | | | | | | | | | | | | | | | | | * commit '0289f81241e720452b5a77713488d54d3ec252d7': aac: Correctly map multichannel ADTS AAC with non-zero channel_config + PCE Conflicts: libavcodec/aacdec.c Sample: 5.1ch_PCE_issue.aac Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aac: Correctly map multichannel ADTS AAC with non-zero channel_config + PCEnu7742015-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The decoder assigns channels using default channel configuration for 5.1ch when it parses an ADTS frame header using consecutive channel ids. When a PCE comes, it reassigns channels using PCE configuration using directly the ids provided. They can be arbitrary. Always use consecutive channel ids to avoid decoding glitches due spurious reconfigurations due the channel ids mismatch between the two otherwise-identical channel maps. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * aacdec: consistently use avctx for logging in decode_eld_specific_configAndreas Cadhalpun2015-04-19
| | | | | | | | | | | | ac may be NULL and then accessing ac->avctx results in a segmentation fault. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | aacdec: remove a duplicated lineAndreas Cadhalpun2015-05-13
| | | | | | | | | | | | | | got_frame_ptr is set again after the if block. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>