summaryrefslogtreecommitdiffstats
path: root/libavcodec/adpcm.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/adpcm: export ff_adpcm_ima_qt_expand_nibbleManuel Lauss2025-08-201-9/+9
| | | | | | For use in the LucasArts VIMA decoder, where it is used as a subvariant. Signed-off-by: Manuel Lauss <[email protected]>
* avcodec/adpcm: squelch uninitialized variable warningsPeter Ross2025-07-101-0/+4
| | | | | | Fixes CID1655273 and CID1655274. Signed-off-by: Marvin Scholz <[email protected]>
* avcodec/adpcm: Sanyo LD-ADPCM decoderPeter Ross2025-07-041-0/+200
|
* avcodec/adpcm: Use av_unreachable() instead of av_assert0()Andreas Rheinhardt2025-05-211-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/codec_internal, all: Use macros to set deprecated AVCodec fieldsAndreas Rheinhardt2025-03-101-1/+1
| | | | | | | | | | | | | | The aim of this is twofold: a) Clang warns when setting a deprecated field in a definition and because several of the widely set AVCodec fields are deprecated, one gets several hundred warnings from Clang for an ordinary build. Yet fortunately Clang (unlike GCC) allows to disable deprecation warnings inside a definition, so that one can create simple macros to set these fields that also suppress deprecation warnings for Clang. This has already been done in fdff1b9cbfd8cf5a9810c29efa4baf13a4786742 for AVCodec.channel_layouts. b) Using macros will allow to easily migrate these fields to internal ones. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec: add ADPCM IMA XBOX decoderPaul B Mahol2024-12-221-0/+41
|
* avcodec/adpcm: adpcm_dtk is stereo onlyJames Almer2024-08-131-0/+3
| | | | | | Fixes ticket #11133 Signed-off-by: James Almer <[email protected]>
* avcodec/adpcm: only process right samples when decoding stereoPeter Ross2024-07-301-6/+8
| | | | Fixes Coverity issue #1610760.
* avcodec/adpcm: Remove setting min_channel to value it is already set toMichael Niedermayer2024-07-281-4/+0
| | | | | Reviewed-by: Peter Ross <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/adpcm: Mono ADPCM for EA WVE Filesaaron2024-07-231-12/+32
| | | | Reviewed-by: Peter Ross <[email protected]>
* avcodec: use the renamed av_zero_extendJames Almer2024-06-131-1/+1
| | | | Signed-off-by: James Almer <[email protected]>
* avcodec/adpcm: Fix integer overflow in intermediate in ADPCM_XMDMichael Niedermayer2023-05-061-2/+2
| | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 2140143616 + 254665816 cannot be represented in type 'int' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XMD_fuzzer-6690181676924928 As a sideeffect this simplifies the equation, the high bits are different after this but only the low 16bits are stored and used in later steps. Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec: add ADPCM XMD decoderPaul B Mahol2023-01-301-0/+44
|
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/internal: Move ff_get_buffer() to decode.hAndreas Rheinhardt2022-08-271-1/+1
| | | | | | | | | 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 <[email protected]>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+0
| | | | | | | | | | | 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 <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | 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 <[email protected]>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-051-2/+1
| | | | | | | | 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 <[email protected]>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-7/+7
| | | | | | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-0/+1
| | | | | | | | | | 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 <[email protected]>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-161-0/+3
| | | | | | | | 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ö <[email protected]>
* adpcm: convert to new channel layout APIAnton Khirnov2022-03-151-73/+78
| | | | | | Signed-off-by: Vittorio Giovara <[email protected]> Signed-off-by: Anton Khirnov <[email protected]> Signed-off-by: James Almer <[email protected]>
* avcodec/adpcm_data: Move tables only used by adpcm.c to itAndreas Rheinhardt2021-07-221-7/+134
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/adpcm: Don't include disabled AVCodecsAndreas Rheinhardt2021-07-221-48/+56
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/adpcm: Disable dead codeAndreas Rheinhardt2021-07-221-104/+108
| | | | | | | 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 <[email protected]>
* avcodec/adpcm: Fix indentationAndreas Rheinhardt2021-07-221-38/+38
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/adpcm: Use smaller scope for some variablesAndreas Rheinhardt2021-07-221-123/+118
| | | | | | | | 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 <[email protected]>
* Revert "avcodec/adpcm: Set vqa_version before use in init"Michael Niedermayer2021-05-131-2/+0
| | | | | | | Redundant with ff946633a30e15415974c3f0ec7751c04eb91701. Found-by: Andreas Rheinhardt <[email protected]> This reverts commit 7a403da0cb8e5fe308fe307b7ed219110f7021e0.
* avcodec/adpcm: Set vqa_version before use in initMichael Niedermayer2021-05-121-0/+2
| | | | | | | | 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 <[email protected]>
* avcodec/adpcm_psx: ignore unknown flag bitsZane van Iperen2021-05-121-1/+1
| | | | | | As per documentation. Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_psx: always fetch next byte irregardless of flagZane van Iperen2021-05-121-7/+7
| | | | | | | | | 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 <[email protected]>
* avcodec: Implement Acorn Replay IMA ADPCM decoderCameron Cawley2021-05-091-0/+19
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_ima_apm: cosmeticsZane van Iperen2021-04-281-7/+5
| | | | | Reviewed-by: Andreas Rheinhardt <[email protected]> Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_ima_apm: remove old extradata formatZane van Iperen2021-04-281-5/+0
| | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Zane van Iperen <[email protected]>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | 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 <[email protected]> Signed-off-by: James Almer <[email protected]>
* avcodec/adpcm: Fixes output from Westwood ADPCM.Aidan Richmond2021-04-261-3/+3
| | | | | | | | Fixes bug #9198 Reviewed-by: Andreas Rheinhardt <[email protected]> Signed-off-by: Aidan Richmond <[email protected]> Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm: init from extradata before setting sample formatsZane van Iperen2021-04-251-2/+2
| | | | | | | | | Fixes a crash when decoding VQA files. Regression since c012f9b265e172de9c240c9dfab8665936fa3e83. Reported-by: Andreas Rheinhardt <[email protected]> Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm: refactor init/flush codeZane van Iperen2021-04-101-42/+29
| | | | | | | | | | | 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 <[email protected]>
* avcodec/adpcm_ima_cunning: reset state on flushZane van Iperen2021-03-251-0/+1
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_ima_alp: reset state on flushZane van Iperen2021-03-251-0/+1
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_ima_ssi: reset state on flushZane van Iperen2021-03-251-0/+1
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_argo: reset state on flushZane van Iperen2021-03-251-0/+7
| | | | | | | Commit 003b5c800fef909fa84dd2fae43d66bd434d3f7e introduced seeking in argo_asf, but this was missed, leading to non-deterministic output. Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_aica: reset state in flush callbackZane van Iperen2021-03-251-5/+5
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_zork: reset state in flush callbackZane van Iperen2021-03-251-8/+16
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm: add comment to has_status fieldZane van Iperen2021-03-251-1/+1
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_ima_cunning: reindentZane van Iperen2021-03-191-5/+5
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_ima_cunning: support stereoZane van Iperen2021-03-191-4/+7
| | | | | | | Changes the sample format to S16P, but was only ever mono so it affects nothing. Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm: Mark decoders as init-threadsafeAndreas Rheinhardt2020-12-041-0/+1
| | | | | | | They don't modify any global state Reviewed-by: Anton Khirnov <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/adpcm_ima_amv: document header formatZane van Iperen2020-11-091-0/+10
| | | | Signed-off-by: Zane van Iperen <[email protected]>
* avcodec/adpcm_ima_amv: use coded sample countZane van Iperen2020-11-091-1/+18
| | | | Signed-off-by: Zane van Iperen <[email protected]>