summaryrefslogtreecommitdiff
path: root/libavcodec/dxv.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-041-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* 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 <andreas.rheinhardt@outlook.com>
* avcodec/dxv: Constify slice threads' ptr to main contextAndreas Rheinhardt2022-07-311-1/+1
| | | | | | | | Modifying the main context from a slice thread is (usually) a data race, so it must not happen. So only use a pointer to const to access the main context. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dxv: Don't cast const away unnecessarilyAndreas Rheinhardt2022-07-311-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-2/+1
| | | | | | | | | | | 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 <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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 <andreas.rheinhardt@outlook.com>
* 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 <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-6/+6
| | | | | | | | | | | | | | | | 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 <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-1/+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 <andreas.rheinhardt@outlook.com>
* avcodec/thread: Don't use ThreadFrame when unnecessaryAndreas Rheinhardt2022-02-091-6/+5
| | | | | | | | | | | | | | | | | | | | | | | The majority of frame-threaded decoders (mainly the intra-only) need exactly one part of ThreadFrame: The AVFrame. They don't need the owners nor the progress, yet they had to use it because ff_thread_(get|release)_buffer() requires it. This commit changes this and makes these functions work with ordinary AVFrames; the decoders that need the extra fields for progress use ff_thread_(get|release)_ext_buffer() which work exactly as ff_thread_(get|release)_buffer() used to do. This also avoids some unnecessary allocations of progress AVBuffers, namely for H.264 and HEVC film grain frames: These frames are not used for synchronization and therefore don't need a ThreadFrame. Also move the ThreadFrame structure as well as ff_thread_ref_frame() to threadframe.h, the header for frame-threaded decoders with inter-frame dependencies. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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 <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dxv: make prev variable unsignedPaul B Mahol2020-02-221-2/+2
|
* avcodec/dxv: Subtract 12 earlier in dxv_decompress_cocg()Michael Niedermayer2019-10-081-1/+1
| | | | | | | the data_start is after reading 12 bytes and if its subtracted at the very end the intermediate might overflow Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/dxv: Remove redundant seekMichael Niedermayer2019-10-081-1/+0
| | | | | | | This seeks to the position the previous call to dxv_decompress_opcodes() positioned us in case of success Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: Check op_offset in dxv_decompress_yo()Michael Niedermayer2019-09-301-0/+3
| | | | | | | | | Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 'int' Fixes: 17745/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5734628463214592 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/dxv: Check op_offset in both directionsMichael Niedermayer2019-09-241-1/+1
| | | | | | | | Fixes: signed integer overflow: 61 + 2147483647 cannot be represented in type 'int' Fixes: 15311/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5742552826773504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: Initialize tex_funct to NULLMichael Niedermayer2019-07-081-0/+4
| | | | | | | | | Fixes: Various anomalies Fixes: 14493/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5071018000908288 Fixes: 14630/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5714888963391488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: Check op_offset in dxv_decompress_cocg()Michael Niedermayer2019-06-051-0/+3
| | | | | | | | Fixes: signed integer overflow: -2147483648 - 12 cannot be represented in type 'int' Fixes: 14732/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5735273129836544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: Check remaining space in CHECKPOINT()Michael Niedermayer2019-03-281-0/+2
| | | | | | | | Fixes: Timeout (77sec -> 1sec) Fixes: 13407/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5093143018471424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: Correct integer overflow in get_opcodes()Michael Niedermayer2019-03-091-1/+2
| | | | | | | | Fixes: 13099/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5665598896340992 Fixes: signed integer overflow: 2147483647 + 7 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: Check that there is enough data to decompressMichael Niedermayer2018-12-081-0/+6
| | | | | | | | Fixes: Timeout Fixes: 10979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-6178582203203584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: add support for "high" quality modePaul B Mahol2018-04-151-35/+780
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/dxv: Check for end of input in dxv_decompress_dxt5()Michael Niedermayer2017-10-041-0/+2
| | | | | | | | Fixes: Timeout Fixes: 3291/clusterfuzz-testcase-4630024655208448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxv: Check remaining bytes in dxv_decompress_raw()Michael Niedermayer2017-06-041-0/+3
| | | | | | | | Fixes: Timeout Fixes: 2006/clusterfuzz-testcase-minimized-5766515037044736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-291-2/+2
|
* Merge commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50'Clément Bœsch2017-03-241-1/+1
|\ | | | | | | | | | | | | * commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50': Adjust printf conversion specifiers to match variable signedness Merged-by: Clément Bœsch <u@pkh.me>
| * Adjust printf conversion specifiers to match variable signednessDiego Biurrun2016-10-281-1/+1
| |
| * Revert "Don't use expressions with side effects in macro parameters"Martin Storsjö2016-08-021-12/+6
| | | | | | | | | | | | | | | | | | This reverts commit 25bacd0a0c32ae682e6f411b1ac9020aeaabca72. Since 230b1c070, the bytewise AV_W*() macros only expand their argument once, so revert to the more readable version of these. Signed-off-by: Martin Storsjö <martin@martin.st>
| * Don't use expressions with side effects in macro parametersMartin Storsjö2016-07-311-6/+12
| | | | | | | | | | | | | | | | | | AV_WB32 can be implemented as a macro that expands its parameters multiple times (in case AV_HAVE_FAST_UNALIGNED isn't set and the compiler doesn't support GCC attributes); make sure not to read multiple times from the source in this case. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '7ebdffc353f3f0827864e8e3461fdc00cc243b14'Clément Bœsch2017-03-151-6/+10
|\ \ | |/ | | | | | | | | | | * commit '7ebdffc353f3f0827864e8e3461fdc00cc243b14': dxv: Check to make sure we don't overrun buffers on corrupt inputs Merged-by: Clément Bœsch <u@pkh.me>
| * dxv: Check to make sure we don't overrun buffers on corrupt inputsMartin Storsjö2016-07-311-3/+11
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec/dxv: Check idx in dxv_decompress_dxt5()Michael Niedermayer2016-01-051-0/+4
| | | | | | | | | | | | | | | | Fixes potential out of array read No testcase available Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/dxv: Check idx in CHECKPOINT()Michael Niedermayer2016-01-051-0/+8
| | | | | | | | | | | | | | | | | | Fixes out of array read Fixes Ticket5098 Fixes Ticket5099 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'b2417ee6d1ee0c5e9b170a642d73bdf68908966f'Hendrik Leppkes2015-09-261-1/+2
|\ \ | |/ | | | | | | | | | | * commit 'b2417ee6d1ee0c5e9b170a642d73bdf68908966f': dxv: Improve error message Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxv: Improve error messageVittorio Giovara2015-09-241-1/+2
| |
* | Merge commit '1bcd4a476ba45a7fdf59d1701b8f0e274418cc32'Hendrik Leppkes2015-09-261-3/+25
|\ \ | |/ | | | | | | | | | | * commit '1bcd4a476ba45a7fdf59d1701b8f0e274418cc32': dxv: Support RAW intermediate compression Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxv: Support RAW intermediate compressionVittorio Giovara2015-09-241-3/+25
| | | | | | | | | | | | Sample-Id: boombox64.mov Reported-by: Aarni Koskela Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'bbf71d46db3417b43bcbd745cbf235e8e2ff69ae'Hendrik Leppkes2015-09-261-5/+13
|\ \ | |/ | | | | | | | | | | * commit 'bbf71d46db3417b43bcbd745cbf235e8e2ff69ae': dxv: Print texture information after header parsing Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxv: Print texture information after header parsingVittorio Giovara2015-09-241-5/+13
| |
* | Merge commit 'fb2889691cb7720d2680e188eb6036a35afa2392'Hendrik Leppkes2015-09-261-1/+1
|\ \ | |/ | | | | | | | | | | * commit 'fb2889691cb7720d2680e188eb6036a35afa2392': dxv: Support the original first version Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxv: Support the original first versionVittorio Giovara2015-09-241-1/+1
| | | | | | | | | | | | | | | | DXV 1.0 provided DXT1 with LZF only. Sample-Id: Orange-Strings-07_640_DXV.mov Reported-by: Carl Eugen Hoyos Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '588a5619da0d041e55b365f63d0fa9c72bdbd4d3'Hendrik Leppkes2015-09-261-5/+9
|\ \ | |/ | | | | | | | | | | * commit '588a5619da0d041e55b365f63d0fa9c72bdbd4d3': dxv: Parse ancillary encoder information Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxv: Parse ancillary encoder informationVittorio Giovara2015-09-241-5/+9
| | | | | | | | | | Header does not contain the number of channels, but rather the encoder version, so rename the variable, and read the additional byte.
* | avcodec/dxv: remove code that is never reachedPaul B Mahol2015-09-151-2/+0
| | | | | | | | | | | | The function is automatically called. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavc/dxv: Support more real-world old version samples.Carl Eugen Hoyos2015-09-081-1/+1
| |
* | lavc/dxv: Silence "Multiple ff_thread_finish_setup() calls" warnings.Carl Eugen Hoyos2015-09-081-1/+2
| |
* | Merge commit 'c45fcf30cfab687004ed1cdc06ebaa21f4262a0b'Hendrik Leppkes2015-09-071-4/+4
|/ | | | | | | * commit 'c45fcf30cfab687004ed1cdc06ebaa21f4262a0b': DXV decoder Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* DXV decoderVittorio Giovara2015-09-021-0/+461
Support all DXDI and DXD3 normal quality videos.