summaryrefslogtreecommitdiff
path: root/libavcodec/dxtory.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/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-3/+2
| | | | | | | | 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/+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 <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/thread: Don't use ThreadFrame when unnecessaryAndreas Rheinhardt2022-02-091-10/+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>
* all: Remove unnecessary libavcodec/internal.h inclusionsAndreas Rheinhardt2022-02-081-1/+0
| | | | 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/dxtory: Fix undefined shift with negative linesizeMichael Niedermayer2021-02-281-2/+2
| | | | | | | | | Fixes: left shift of negative value -128 Fixes: 30746/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5906271469436928 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/dxtory: Fix negative stride shift in dx2_decode_slice_420()Michael Niedermayer2020-10-041-1/+1
| | | | | | | | | Fixes: left shift of negative value -640 Fixes: 26044/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5631057602543616 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/dxtory: Fix negative shift in dx2_decode_slice_410()Michael Niedermayer2020-09-261-1/+1
| | | | | | | | | Fixes: left shift of negative value -768 Fixes: 25574/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-6012596027916288 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/dxtory: Fix negative shift in dxtory_decode_v1_410()Michael Niedermayer2020-09-261-4/+4
| | | | | | | | | Fixes: left shift of negative value -256 Fixes: 25460/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5073252341514240 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/dxtory: Fix get_raw_size() for YUVMichael Niedermayer2020-09-261-2/+2
| | | | | | | | | Fixes: out of array read Fixes: 25455/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-6327985731534848 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/dxtory: add frame threads supportPaul B Mahol2020-09-051-6/+12
|
* avcodec/dxtory: add missed rgb555/rgb565 formats for vflip casePaul B Mahol2020-09-051-0/+2
|
* avcodec/dxtory: support subsampled formats with non-aligned sizePaul B Mahol2020-09-051-19/+178
| | | | Also unbreak decoding after 6e1a167c556
* avcodec/dxtory: add support for vertically flipped framesPaul B Mahol2020-09-031-31/+113
|
* avcodec/dxtory: Check slice_size against minimum in dxtory_decode_v2()Michael Niedermayer2019-04-241-2/+8
| | | | | | | | Fixes: Timeout (33sec -> 16 milli sec) Fixes: 14181/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5681840708386816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxtory: Check slice sizes before allocating imageMichael Niedermayer2019-03-251-1/+9
| | | | | | | | Fixes: Timeout (26sec -> 2sec) Fixes: 13612/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5676845977042944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxtory: Remove code that corrupts dimensionsMichael Niedermayer2018-02-201-5/+1
| | | | | | | | | | Fixes: Timeout Fixes: 5796/clusterfuzz-testcase-minimized-5206729085157376 Does someone have a valid sample that triggers this path ? Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dxtory: Fix bits left checksMichael Niedermayer2018-01-231-5/+5
| | | | | | | | Fixes: Timeout Fixes: 4863/clusterfuzz-testcase-6347354178322432 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '7a2b2b6a92c4b528ecb640790eca0aa790d858f4'Clément Bœsch2017-03-271-3/+3
|\ | | | | | | | | | | | | * commit '7a2b2b6a92c4b528ecb640790eca0aa790d858f4': dxtory: Drop nonsense ISO C printf conversion specifiers for standard types Merged-by: Clément Bœsch <u@pkh.me>
| * dxtory: Drop nonsense ISO C printf conversion specifiers for standard typesDiego Biurrun2016-10-281-3/+3
| |
* | Merge commit 'b668662939de3a02454cfc9ba3e6d10b87527a40'Clément Bœsch2016-06-291-2/+3
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'b668662939de3a02454cfc9ba3e6d10b87527a40': get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes The merge commit also includes changes for libavcodec/interplayacm.c and libavcodec/truemotion2rt.c Merged-by: Clément Bœsch <clement@stupeflix.com>
| * get_bits: Move BITSTREAM_READER_LE definition before all relevant #includesDiego Biurrun2016-06-071-2/+3
| | | | | | | | | | | | | | This avoids the danger that get_bits.h might get indirectly #included before BITSTREAM_READER_LE is defined. Also sort headers into canonical order where appropriate.
| * Mark tables used only within their files as staticDiego Biurrun2016-03-301-3/+3
| |
* | avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()Michael Niedermayer2015-11-151-1/+1
| | | | | | | | | | | | Fixes potential out of array read Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()Michael Niedermayer2015-11-151-1/+1
| | | | | | | | | | | | | | | | Fixes out of array read Fixes: c50c4aa6cefda71b19a31ea12302980c/asan_heap-oob_12be5fd_7011_33ebd015a74976215934add72b9c8352.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'd0f7e4a57fbffa0efb204d4274c3dd56fbfff946'Hendrik Leppkes2015-09-081-239/+164
|\ \ | |/ | | | | | | | | | | * commit 'd0f7e4a57fbffa0efb204d4274c3dd56fbfff946': dxtory: Unify and rework the decoding routines Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxtory: Unify and rework the decoding routinesLuca Barbato2015-09-061-239/+165
| | | | | | | | | | | | | | Do not make many assumption on the dimension of the slices and just try to decode additional lines if there is enough data left. Decodes all the samples kindly provided by ultramage.
* | Merge commit 'a7e6fbd90e62d3320b1e26d8209fc0f55ee5b0be'Hendrik Leppkes2015-09-081-65/+37
|\ \ | |/ | | | | | | | | | | * commit 'a7e6fbd90e62d3320b1e26d8209fc0f55ee5b0be': dxtory: Factorize the buffer loading Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxtory: Factorize the buffer loadingLuca Barbato2015-09-041-65/+37
| | | | | | | | And the checks nearby it.
* | Merge commit '6a6bc43f5f79587b8936334cc0b3a6616f4807ac'Hendrik Leppkes2015-09-081-76/+49
|\ \ | |/ | | | | | | | | | | * commit '6a6bc43f5f79587b8936334cc0b3a6616f4807ac': dxtory: Factorize slice size checks Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dxtory: Factorize slice size checksLuca Barbato2015-09-041-76/+48
| | | | | | | | They are always the same.
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-1/+1
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/dxtory: use init_get_bits8()Paul B Mahol2015-02-141-5/+10
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/dxtory: Use LL instead of L number suffixMichael Niedermayer2015-02-011-3/+3
| | | | | | | | | | | | | | This is probably unneeded and normal int would be fine, but its safer to use LL and this isnt speed relevant Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dxtory: use unaligned copy for unaligned addressesMichael Niedermayer2014-10-301-4/+4
| | | | | | | | | | | | | | Fixes undefined behavior Fixes: asan_heap-oob_112c6b3_13_012.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dxtory: remove unused variablesMichael Niedermayer2014-09-261-4/+2
| | | | | | | | | | Found-by: Benoit Fouet <benoit.fouet@free.fr> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dxtory: Support dxtory-2.0.127.aviMichael Niedermayer2014-09-251-6/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'cc8163e1a3601a56f722a4720516e860bf1c6198'Michael Niedermayer2014-03-221-16/+19
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cc8163e1a3601a56f722a4720516e860bf1c6198': avcodec: more correct printf specifiers Conflicts: libavcodec/4xm.c libavcodec/alsdec.c libavcodec/dfa.c libavcodec/h264_ps.c libavcodec/jpeg2000dec.c libavcodec/lagarith.c libavcodec/mpeg12dec.c libavcodec/rv10.c libavcodec/svq3.c libavcodec/wmaprodec.c libavcodec/xwddec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: more correct printf specifiersDiego Biurrun2014-03-221-16/+19
| |
* | avcodec/dxtory: fix src size checksMichael Niedermayer2014-02-161-4/+4
| | | | | | | | | | | | | | | | Fixes integer overflow Fixes out of array read Fixes: d104661bb59b202df7671fb19a00ca6c-asan_heap-oob_d6429d_5066_cov_1729501105_dxtory_mic.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-01-251-0/+113
|\ \ | |/ | | | | | | | | | | | | | | | | * qatar/master: dxtory: compressed RGB555/RGB565 decoding support Conflicts: libavcodec/dxtory.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dxtory: compressed RGB555/RGB565 decoding supportKostya Shishkov2014-01-241-0/+113
| |
* | Merge commit '0e1ad2f591b87e944550c15b54e54f8189743289'Michael Niedermayer2014-01-251-11/+418
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '0e1ad2f591b87e944550c15b54e54f8189743289': dxtory: add more compressed and uncompressed modes Conflicts: libavcodec/dxtory.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dxtory: add more compressed and uncompressed modesKostya Shishkov2014-01-241-11/+418
| |
* | Merge commit '025fd76e1a2623c858d8c686a73cc30980a314b0'Michael Niedermayer2014-01-211-1/+1
|\ \ | |/ | | | | | | | | | | * commit '025fd76e1a2623c858d8c686a73cc30980a314b0': dxtory: change error code for unexpected slice configuration Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dxtory: change error code for unexpected slice configurationKostya Shishkov2014-01-211-1/+1
| |