summaryrefslogtreecommitdiff
path: root/libavcodec/adpcm.c
Commit message (Collapse)AuthorAge
* avcodec/adpcm_data: Move tables only used by adpcm.c to itAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Don't include disabled AVCodecsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Disable dead codeAndreas Rheinhardt2021-07-22
| | | | | | | This change ensures that the linker can drop adpcm_data.o if no decoder that actually uses anything from there is enabled. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Fix indentationAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/adpcm: Use smaller scope for some variablesAndreas Rheinhardt2021-07-22
| | | | | | | | This is to avoid unused variables warnings after the code for the disabled encoders has been #if'ed away which will happen in a subsequent commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "avcodec/adpcm: Set vqa_version before use in init"Michael Niedermayer2021-05-13
| | | | | | | Redundant with ff946633a30e15415974c3f0ec7751c04eb91701. Found-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> This reverts commit 7a403da0cb8e5fe308fe307b7ed219110f7021e0.
* avcodec/adpcm: Set vqa_version before use in initMichael Niedermayer2021-05-12
| | | | | | | | Fixes: null pointer dereference Fixes: 33172/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_WS_fuzzer-5200164273913856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm_psx: ignore unknown flag bitsZane van Iperen2021-05-12
| | | | | | As per documentation. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_psx: always fetch next byte irregardless of flagZane van Iperen2021-05-12
| | | | | | | | | Even though all samples are meant to be zero (if flag == 0x07), doesn't mean that they aren't there. See No$PSX docs [1]. [1]: https://problemkaputt.de/psx-spx.htm#spuadpcmsamples Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec: Implement Acorn Replay IMA ADPCM decoderCameron Cawley2021-05-09
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_apm: cosmeticsZane van Iperen2021-04-28
| | | | | Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_apm: remove old extradata formatZane van Iperen2021-04-28
| | | | | | | | | | | | Was added in error very early on, passing in only the required fields. Later, the muxer and demuxer were changed to pass the entire APMState struct as extradata. Technically a breaking change, but this was only around for a *very* short time before it was updated, Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.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/adpcm: Fixes output from Westwood ADPCM.Aidan Richmond2021-04-26
| | | | | | | | Fixes bug #9198 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Aidan Richmond <aidan.is@hotmail.co.uk> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: init from extradata before setting sample formatsZane van Iperen2021-04-25
| | | | | | | | | Fixes a crash when decoding VQA files. Regression since c012f9b265e172de9c240c9dfab8665936fa3e83. Reported-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: refactor init/flush codeZane van Iperen2021-04-10
| | | | | | | | | | | Most of the codecs just need everything zeroed. Those that don't are either handled inline during decode, or pull state from extradata. Move state reset/init functionality into adpcm_flush(), and invoke it from adpcm_decode_init(). Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_cunning: reset state on flushZane van Iperen2021-03-25
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_alp: reset state on flushZane van Iperen2021-03-25
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_ssi: reset state on flushZane van Iperen2021-03-25
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_argo: reset state on flushZane van Iperen2021-03-25
| | | | | | | Commit 003b5c800fef909fa84dd2fae43d66bd434d3f7e introduced seeking in argo_asf, but this was missed, leading to non-deterministic output. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_aica: reset state in flush callbackZane van Iperen2021-03-25
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_zork: reset state in flush callbackZane van Iperen2021-03-25
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: add comment to has_status fieldZane van Iperen2021-03-25
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_cunning: reindentZane van Iperen2021-03-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_cunning: support stereoZane van Iperen2021-03-19
| | | | | | | Changes the sample format to S16P, but was only ever mono so it affects nothing. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: Mark decoders as init-threadsafeAndreas Rheinhardt2020-12-04
| | | | | | | They don't modify any global state Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/adpcm_ima_amv: document header formatZane van Iperen2020-11-09
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_amv: use coded sample countZane van Iperen2020-11-09
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_amv: restrict to 1 channelZane van Iperen2020-11-09
| | | | | | The format doesn't allow for anything else. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* Revert "avcodec/adpcm_swf: support decoding multiple fixed-sized blocks at once"Zane van Iperen2020-11-07
| | | | | | | | | | | | | | Is incorrect behaviour. Was covering for an encoder bug where it produced frames of the wrong size. This reverts commit e9dd73d30d09043446ac6dd7b8ad31e557873852. Fixes: out of array write Fixes: 26821/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_SWF_fuzzer-5764465137811456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_swf: support decoding multiple fixed-sized blocks at onceZane van Iperen2020-10-21
| | | | | | For incoming packets from WAV. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: Check channels before use for ADPCM_PSXMichael Niedermayer2020-10-20
| | | | | | | | | Fixes: division by zero Fixes: 26293/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5176665237618688 Fixes: 26331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5632330364092416 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc, lavf: Remove newlines from calls to avpriv_request_sample().Carl Eugen Hoyos2020-10-11
|
* avcodec/adpcm: Check block align for AV_CODEC_ID_ADPCM_PSXMichael Niedermayer2020-10-11
| | | | | | | | | Regression since: ca49476ace90ddebc5f92d9d82297f77e528c21e Fixes: out of array write Fixes: 25786/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5704869380620288 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm_{psx,argo}: add missing indentZane van Iperen2020-09-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_argo: support decoding multiple framesZane van Iperen2020-09-19
| | | | | | Increases decode speed significantly. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: take into account block_align when decoding ADPCM_PSXPaul B Mahol2020-09-12
| | | | Should reduce decoding overhead.
* avcodec: add ADPCM IMA MOFLEX decoderPaul B Mahol2020-09-03
|
* avcodec/adpcm_argo: add ff_adpcm_argo_expand_nibble() and cleanup parametersZane van Iperen2020-08-07
| | | | | | Replaces adpcm_argo_expand_nibble(). Preparation for the encoder. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_argo: fix incorrect documentationZane van Iperen2020-08-04
| | | | | | Flag bit was in the wrong place. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_apm: support new extradata formatZane van Iperen2020-06-26
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: XA: Check shift similar to filterMichael Niedermayer2020-06-07
| | | | | | | | Fixes: negative shift Fixes: 22499/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XA_fuzzer-5765452130418688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: Fix integer overflow in ADPCM THPMichael Niedermayer2020-05-13
| | | | | | | | | | The reference (thp.txt) uses floats so wrap around would seem incorrect. Fixes: signed integer overflow: 1073741824 + 1073741824 cannot be represented in type 'int' Fixes: 20658/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_THP_fuzzer-5646302555930624 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: Clip predictor for IMA_APMMichael Niedermayer2020-05-11
| | | | | | | | Fixes: signed integer overflow: -2147483647 - 61436 cannot be represented in type 'int' Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APM_fuzzer-5092176004644864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add support for Cunning Developments' ADPCMZane van Iperen2020-04-24
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: update get_nb_samples() docZane van Iperen2020-04-20
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm_ima_{apc, ssi, oki}: replace while() with for()Zane van Iperen2020-04-20
| | | | | | | Per discussion at https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/260854.html Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: remove unused shift parameter from adpcm_ima_qt_expand_nibble()Zane van Iperen2020-04-11
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec: add ADPCM IMA MTF decoderPaul B Mahol2020-03-17
|
* avcodec/adpcm: Fix invalid shift in AV_CODEC_ID_ADPCM_PSXMichael Niedermayer2020-03-11
| | | | | | | | Fixes: left shift of negative value -1 Fixes: 20859/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5720391507247104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>