summaryrefslogtreecommitdiff
path: root/libavcodec/adpcm.c
Commit message (Collapse)AuthorAge
* 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>
* avcodec: add decoder for High Voltage Software's ALP ADPCMZane van Iperen2020-03-09
| | | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: Clip step index for ADPCM_IMA_APMMichael Niedermayer2020-03-02
| | | | | | | | | Fixes: out of array access Fixes: 20828/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APM_fuzzer-5712770106654720 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>
* avcodec/adpcm: cosmetics; reindentPaul B Mahol2020-02-21
|
* avcodec: add decoder for Rayman 2's ADPCM variantZane van Iperen2020-02-21
| | | | | | Adds support for the ADPCM variant used in Rayman 2's files. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec: fix pcm zork decoderPaul B Mahol2020-02-16
| | | | Fixes #1939
* avcodec: add decoder for Simon & Schuster Interactive's ADPCM variantZane van Iperen2020-02-06
| | | | | | | | | Adds support for the ADPCM variant used by some Simon & Schuster Interactive games such as Real War, and Real War: Rogue States. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm_argo: simplify and move duplicated logic into a functionZane van Iperen2020-02-02
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add decoder for argonaut games' adpcm codecZane van Iperen2020-01-26
| | | | | | | Adds support for the ADPCM variant used by some Argonaut Games' games, such as 'Croc! Legend of the Gobbos', and 'Croc 2'. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm: Fix undefined left shifts of negative numbersAndreas Rheinhardt2020-01-21
| | | | | | | | Affected the adpcm-afc, adpcm-ea-1, adpcm-ea-2, adpcm-ea-maxis-xa, adpcm-thp and ea-cdata FATE-tests. Also fixes ticket #8487. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: Fix overflow in FFABS() IMA_EA_EACSMichael Niedermayer2020-01-11
| | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 19235/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_EA_EACS_fuzzer-5680878952382464 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 APCMichael Niedermayer2019-12-15
| | | | | | | | Fixes: signed integer overflow: -2147483648 - 13 cannot be represented in type 'int' Fixes: 18893/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APC_fuzzer-5630760442920960 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 invalid shift in xa_decode()Michael Niedermayer2019-12-15
| | | | | | | | Fixes: left shift of negative value -1 Fixes: 18859/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XA_fuzzer-5748474213040128 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 undefined behavior with negative predictions in IMA OKIMichael Niedermayer2019-11-09
| | | | | | | | Fixes: left shift of negative value -30 Fixes: 18392/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_OKI_fuzzer-5631771831435264 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 invalid shifts in ADPCM DTKMichael Niedermayer2019-10-29
| | | | | | | | | Fixes: left shift of negative value -1 Fixes: 18397/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_DTK_fuzzer-5675653487132672 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>
* avcodec/adpcm: Check initial predictor for ADPCM_IMA_EA_EACSMichael Niedermayer2019-10-16
| | | | | | | | Fixes: signed integer overflow: -2147483360 - 631 cannot be represented in type 'int' Fixes: 17701/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_EA_EACS_fuzzer-5711517319692288 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 left shifts in AV_CODEC_ID_ADPCM_EAMichael Niedermayer2019-10-16
| | | | | | | | Fixes: left shift of negative value -1 Fixes: 17683/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_EA_R2_fuzzer-5111690013704192 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: Check number of channels for MTAFMichael Niedermayer2019-09-24
| | | | | | | | | Fixes: out of array access Fixes: 17608/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_MTAF_fuzzer-5074936267276288 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>
* avcodec/adpcm: reindent after last commitPaul B Mahol2019-07-26
|
* avcodec/adpcm: add support for 5.1 ADPCM MSPaul B Mahol2019-07-26
|
* libavcodec: Reduce the size of some arraysAndreas Rheinhardt2019-06-20
| | | | | | | | | | This commit uses smaller types for some static const arrays to reduce their size in case the entries can be represented in the smaller type. The biggest savings came from inv_map_table in vp9.c. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: add ADPCM AGM decoderPaul B Mahol2019-04-11
|
* avcodec/adpcm: use assert for codec id instead or error returnMichael Niedermayer2019-01-01
| | | | | | | A unsupported codec_id is a internal error and should not happen Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* adpcm: consume remainder after consuming XA chunksMisty De Meo2018-01-06
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* adpcm: fix clipping for yamahaPaul B Mahol2017-02-15
| | | | | | | According to specification max value allowed is 0x6000. Fixes #5862. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/adpcm: clip step for ADPCM MTAF decoderPaul B Mahol2016-09-15
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>