summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
Commit message (Collapse)AuthorAge
* avcodec/ac3: Move non-(de|en)coder-only parts out of ac3.hAndreas Rheinhardt2022-05-15
| | | | | | | | | | Move AC3HeaderInfo into ac3_parser_internal.h and the rest into a new header ac3defs.h. This also breaks an include cycle of ac3.h and ac3tab.h (the latter now only needs ac3defs.h). 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>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* ac3: convert to new channel layout APIVittorio Giovara2022-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/ac3tab: Unavpriv ac3_channel_layout_tabAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | | It is small (16 B) and therefore the overhead of exporting it more than outweighs the size savings from not having duplicated symbols: When the symbol is no longer avpriv, one saves twice the size of the string containing the symbols name (2x30 byte), two entries in .dynsym (24 bytes each on x64), one entry in the importing libraries .got and .rela.dyn (8 + 24 bytes on x64) and two entries for the symbol version (2 bytes each) and one hash value in the exporting library (4 bytes). (The exact numbers are of course different for other platforms (e.g. when using dlls), but given that the strings saved alone more than outweigh the array size it can be presumed that this is beneficial for all platforms.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3dec: Make decoders init-threadsafeAndreas Rheinhardt2021-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3dec: Check operations that can failAndreas Rheinhardt2021-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3: Explicitly return to discard large amounts of nonsense bytesMichael Niedermayer2019-02-07
| | | | | | | | | | | Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570) Fixes: Timeout Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264 Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984 Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Optimize frame start searchMichael Niedermayer2019-01-16
| | | | | | | | | | | | | Fixes: Timeout Fixes: 11619/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 Fixes: 11620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5711996515778560 Fixes: 11658/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5701006524940288 Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 20338 ms After: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 11825 ms Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/ac3dec.c: Avoid unspecific -1 error codeMichael Niedermayer2019-01-01
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ac3dec: always skip junk bytes before sync bytesPaul B Mahol2018-11-30
| | | | Fixes #7278.
* avcodec/ac3dec: Fix shift signedness in mask creationMichael Niedermayer2018-09-22
| | | | | | | | Fixes: 9924/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5473421772193792 Fixes: left shift of 1 by 63 places cannot be represented in type 'long long' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/eac3dec: Check that channel_map does not contain more than ↵Michael Niedermayer2018-09-22
| | | | | | EAC3_MAX_CHANNELS Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Check channel_map indexMichael Niedermayer2018-07-04
| | | | | | | | Fixes: out of array read Fixes: 8924/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5851861780267008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Check that the number of channels with dependant streams is ↵Michael Niedermayer2018-05-27
| | | | | | | | | | | valid Fixes: left shift of 1 by 63 places cannot be represented in type 'long long' Fixes: out of array access Fixes: 7284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5767914968842240 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Fix null pointer dereference in ac3_decode_frame()Michael Niedermayer2018-05-27
| | | | | | | | Fixes: index 8 out of bounds for type 'uint8_t *[8]' Fixes: 7273/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-6296497667702784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3dec: Use frame_size if superframe_size is 0Michael Niedermayer2018-05-26
| | | | | | | | | | Fixes: Infinite loop Fixes: 7669/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4689042185650176 Fixes: 7670/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_fuzzer-4706306762997760 Fixes: 7672/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-4702108499574784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3: fix out of array access introduced previouslyPaul B Mahol2018-03-30
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/eac3: add support for dependent streamPaul B Mahol2018-03-29
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Merge commit '50a1c66cf6ab7eb683daaa9e2da3869fa3a54609'James Almer2017-10-27
|\ | | | | | | | | | | | | | | | | | | | | * commit '50a1c66cf6ab7eb683daaa9e2da3869fa3a54609': ac3_parser: add a public function for parsing the data required by the demuxer avpriv_ac3_parse_header() is left in place but without the GetBitContext parameter, as the mov muxer requires a lot more fields than just bitstream_id and frame_size from the AC3HeaderInfo struct. Merged-by: James Almer <jamrial@gmail.com>
| * ac3_parser: add a public function for parsing the data required by the demuxerAnton Khirnov2017-04-12
| | | | | | | | | | | | Make the current semi-public avpriv_ac3_parse_header() private to lavc. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/ac3dec: Fix: runtime error: index -1 out of bounds for type ↵Michael Niedermayer2017-05-14
| | | | | | | | | | | | | | | | | | | | | | 'INTFLOAT [2]' It seems dual mono with a LFE channel is not forbidden Fixes: 1570/clusterfuzz-testcase-minimized-6455337349545984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3dec: Keep track of band structureMichael Niedermayer2017-05-13
| | | | | | | | | | | | | | | | | | It is needed in some corner cases that seem not to be forbidden Fixes: out of array index Fixes: 1538/clusterfuzz-testcase-minimized-4696904925446144 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: do not use AVFrame accessorMuhammad Faiz2017-04-23
| | | | | | | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* | Merge commit 'b57e38f52cc3f31a27105c28887d57cd6812c3eb'Clément Bœsch2017-03-22
|\| | | | | | | | | | | | | * commit 'b57e38f52cc3f31a27105c28887d57cd6812c3eb': ac3dsp: x86: Replace inline asm for in-decoder downmixing with standalone asm Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dsp: x86: Replace inline asm for in-decoder downmixing with standalone asmJustin Ruggles2016-10-01
| | | | | | | | | | | | | | | | | | Adds a wrapper function for downmixing which detects channel count changes and updates the selected downmix function accordingly. Simplification and porting to current x86inc infrastructure by Diego Biurrun. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '43717469f9daa402f6acb48997255827a56034e9'Clément Bœsch2017-03-22
|\| | | | | | | | | | | | | * commit '43717469f9daa402f6acb48997255827a56034e9': ac3dsp: Reverse matrix in/out order in downmix() Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dsp: Reverse matrix in/out order in downmix()Justin Ruggles2016-10-01
| | | | | | | | | | | | | | Also use (float **) instead of (float (*)[2]). This matches the matrix layout in libavresample so we can reuse assembly code between the two. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '8495d84f0101464b15517860db33e8605586d87e'Clément Bœsch2017-03-15
|\| | | | | | | | | | | | | * commit '8495d84f0101464b15517860db33e8605586d87e': ac3dec: Add some inline hints Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Add some inline hintsLuca Barbato2016-07-29
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '3db51bf671defd47f2ec5ab67b11fb7730fb5e5a'Clément Bœsch2017-03-15
|\| | | | | | | | | | | | | * commit '3db51bf671defd47f2ec5ab67b11fb7730fb5e5a': ac3dec: Simplify skipping Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Simplify skippingLuca Barbato2016-07-29
| | | | | | | | | | | | skip_bits_long() can skip up to 32-bit ranges. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'f0ccc65bc9ab9ddf1366066395564c71bcc825ee'Clément Bœsch2017-03-15
|\| | | | | | | | | | | | | * commit 'f0ccc65bc9ab9ddf1366066395564c71bcc825ee': ac3dec: Split coupling-specific code from decode_audio_block() Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Split coupling-specific code from decode_audio_block()Luca Barbato2016-07-29
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'a5ebe5d1217942238c641c83b24ef1106e53934a'Clément Bœsch2017-03-15
|\| | | | | | | | | | | | | * commit 'a5ebe5d1217942238c641c83b24ef1106e53934a': ac3dec: Split spx-specific code from decode_audio_block() Merged-by: Clément Bœsch <u@pkh.me>
| * ac3dec: Split spx-specific code from decode_audio_block()Luca Barbato2016-07-29
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/ac3dec: add consistent noise generation option.Jonathan Campbell2017-01-22
| | | | | | | | | | | | | | use av_lfg_init_from_data() to seed AC-3 dithering from the AC-3 frame data to make it consistent given the same AC-3 frame, if option is set. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3dec: Check expaccMichael Niedermayer2016-11-03
| | | | | | | | | | | | | | | | | | | | this is somewhat a magic number, which can be understood from reading section "7.1.2 Exponent Strategy" of the ac3 specification, in short: Three exponents each represented as number 0-4 are grouped together and base-5 encoded, so the maximal correct value is 25*4 + 5*4 + 4 = 124. Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/(e)ac3: Fix target_level for EAC3.Nikolas Bowe2016-09-15
| | | | | | | | | | | | | | | | | | | | | | Currently when using target_level with EAC3 it produces silence. This small patch fixes target_level for decoding EAC3. Example: ffmpeg -y -i /tmp/test.wav -acodec eac3 -dialnorm -14 -ac 6 -b:a 384000 /tmp/test.m2ts ffmpeg -y -target_level -24 -i /tmp/test.m2ts -acodec pcm_s16le -f matroska /tmp/out.mkv ffplay /tmp/out.mkv Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '33275a0de05e9bc321f2537a2a67921fab81624f'Derek Buitenhuis2016-05-08
|\| | | | | | | | | | | | | * commit '33275a0de05e9bc321f2537a2a67921fab81624f': ac3dec: change logging of skipped E-AC-3 substreams. Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * ac3dec: change logging of skipped E-AC-3 substreams.Tim Walker2016-04-02
| | | | | | | | | | | | | | | | | | Change log level from warning to debug: the E-AC-3 "core" substream can be successfully decoded without the additional and dependent substreams, and their presence is already indicated via avpriv_request_sample in ff_eac3_parse_header. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3Michael Niedermayer2016-04-25
| | | | | | | | | | | | Fixes Ticket5319 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3dec: Print the value of out of range exponentsMichael Niedermayer2015-12-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/ac3: always use hardcoded tablesGanesh Ajjanagadde2015-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The table in question is a 253 byte one. In fact, it turns out that dynamic generation of the table results in an increased binary size. Code compiled with GCC 5.2.0, x86-64 (size in bytes), before and after patch: old: 62321064 libavcodec/libavcodec.so.57 new: 62320536 libavcodec/libavcodec.so.57 Thus, it always make sense to statically allocate this. Tested with FATE with/without --enable-hardcoded-tables. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avcodec: drop 2 suffix from avpriv_ac3_parse_header2Andreas Cadhalpun2015-10-22
| | | | | | | | | | | | | | avpriv_ac3_parse_header was removed in commit 3dfb643. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit 'dc70c19476e76f1118df73b5d97cc76f0e5f6f6c'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit 'dc70c19476e76f1118df73b5d97cc76f0e5f6f6c': lavc: Drop deprecated request_channels related functions Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Drop deprecated request_channels related functionsVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 04/2011.
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * 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>