summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
Commit message (Collapse)AuthorAge
* avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* definesAndreas Rheinhardt2023-09-07
| | | | | | | | | These defines are also used in other contexts than just AVCodecContext ones, e.g. in libavformat. Furthermore, given that these defines are public, the AV-prefix is the right one, so deprecate (and not just move) the FF-macros. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Rename ff_kbd_window_init() as it will be needed from outside ↵Michael Niedermayer2023-07-22
| | | | | | libavcodec Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/eac3dec: add detection of Atmos spatial extension profileMarth642023-03-02
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* lavc/ac3dec: fail when the sample rate is unsetAnton Khirnov2023-01-10
|
* ac3: convert to lavu/txLynne2022-11-06
|
* avcodec/ac3dec: split off code discarding garbage at the beginning of a packetJames Almer2022-10-26
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/ac3dsp: Remove unused parameterAndreas Rheinhardt2022-09-29
| | | | | | Forgotten in fd98594a8831ce037a495b6d7e090bd8f81e83a1. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/fmtconvert: Remove unused AVCodecContext parameterAndreas Rheinhardt2022-09-21
| | | | | | | Unused since d74a8cb7e42f703be5796eeb485f06af710ae8ca. Reviewed-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3dec: add downmix support for mono and stereo for eac3 7.1Paul B Mahol2022-09-21
|
* avcodec/internal: Move ff_side_data_update_matrix_encoding to decode.hAndreas Rheinhardt2022-08-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_get_buffer() to decode.hAndreas Rheinhardt2022-08-27
| | | | | | | | | Only used by decoders (encoders have ff_encode_alloc_frame()). Also clean up the other headers a bit while removing now redundant internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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>