summaryrefslogtreecommitdiff
path: root/libavcodec/fic.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | 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/decoders: Use const uint8_t* to access input packet dataAndreas Rheinhardt2022-07-04
| | | | | | | These packets need not be writable, so we must not modify them. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | 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-05
| | | | | | | | 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-21
| | | | | | | | | | | | | | | | 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-21
| | | | | | | | | | 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/fic: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.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>
* lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bumpAnton Khirnov2021-01-01
| | | | They are not properly namespaced and not intended for public use.
* avcodec/decode: add a flags parameter to ff_reget_buffer()James Almer2019-09-04
| | | | | | | | | | Some decoders may not need a writable buffer in some specific cases, but only a reference to the existing buffer with updated frame properties instead, for the purpose of returning duplicate frames. For this, the FF_REGET_BUFFER_FLAG_READONLY flag is added, which will prevent potential allocations and buffer copies when they are not needed. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/fic: Check input size against minimal frame sizeMichael Niedermayer2019-05-09
| | | | | | | | Fixes: Timeout (22sec ->54ms) Fixes: 14439/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5660988231122944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: Check that there is input left in fic_decode_block()Michael Niedermayer2019-01-31
| | | | | | | | Fixes: Timeout Fixes: 12450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5661984622641152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: use init_get_bits8()Paul B Mahol2018-12-23
|
* avcodec/fic: Fail on invalid slice size/offMichael Niedermayer2018-12-23
| | | | | | | | Fixes: Timeout Fixes: 11486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5677133863583744 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: change class name to more correct onePaul B Mahol2018-09-08
|
* avcodec/fic: Check available input space for cursorMichael Niedermayer2018-05-17
| | | | | | | | Fixes: out of array read Fixes: 6546/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-6317064647081984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: Avoid some magic numbers related to cursorsMichael Niedermayer2018-05-17
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: Fixes signed integer overflowMichael Niedermayer2017-08-20
| | | | | | | | Fixes: runtime error: signed integer overflow: 1037142357 + 1227025305 cannot be represented in type 'int' Fixes: 3024/clusterfuzz-testcase-minimized-5885660323905536 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: Fix multiple runtime error: signed integer overflow: 5793 * ↵Michael Niedermayer2017-05-18
| | | | | | | | | 419752 cannot be represented in type 'int' Fixes: 1669/clusterfuzz-testcase-minimized-5287529198649344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: Check coefficientsMichael Niedermayer2017-05-09
| | | | | | | | Fixes: signed integer overflow: 1258291200 * 2 cannot be represented in type 'int' Fixes: 1413/clusterfuzz-testcase-minimized-5923451770503168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: Fix multiple left shift of negative value -15Michael Niedermayer2017-05-06
| | | | | | | Fixes: 1356/clusterfuzz-testcase-minimized-6008489086287872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fic: set pict_type/key_frame after (instead of during) slice decoding.Ronald S. Bultje2017-03-31
| | | | | This fixes a race condition that was already documented in the source code, and is also reported by tsan in fate-fic-avi.
* lavc/fic: Do not warn about empty cursor.Carl Eugen Hoyos2016-05-01
| | | | Fixes ticket #5174.
* lavc/fic: Be less verbose for invisible cursor outside of video.Carl Eugen Hoyos2016-05-01
|
* lavc/fic: Cosmetics, fix a typo.Carl Eugen Hoyos2016-04-18
| | | | Found by Moritz Barsnick
* avcodec: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
|
* Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * fic: Make warning message more accurateDerek Buitenhuis2014-04-23
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * fic: Remove redundant clipsDerek Buitenhuis2014-04-23
| | | | | | | | | | | | The equations can't overflow or underflow anyway. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * fic: Simplify alpha blendingDerek Buitenhuis2014-04-22
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * fic: Support rendering cursorsDerek Buitenhuis2014-04-22
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * fic: Use proper quantization matrix indexDerek Buitenhuis2014-04-22
| | | | | | | | | | | | | | | | The matrices are not zigzagged. Fixes artefacting. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * avcodec/fic: Fix return value checkMichael Niedermayer2014-04-21
| | | | | | | | | | | | | | | | Fixes part of Ticket3466 Found-by: Andrey_Karpov / PVS-Studio Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * avcodec/fic: clear slice_dataMichael Niedermayer2014-04-21
| | | | | | | | | | | | | | | | Fixes artifacts Fixes use of freed memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * avcodec/fic: fix slice checksMichael Niedermayer2014-04-21
| | | | | | | | | | | | | | fix integer overflows Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec/fic: Add skip_cursor AVOptionMichael Niedermayer2015-06-19
| | | | | | | | | | Previous version reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec: fix clobbered ff_get_buffer()Paul B Mahol2015-02-10
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Silence warnings for fic files with zero-sized cursors.Carl Eugen Hoyos2014-11-03
| | | | | | | | Fixes ticket #4072.
* | avcodec/fic: Check if a frame is available before using itMichael Niedermayer2014-08-22
| | | | | | | | | | | | | | Fixes null pointer dereference Fixes: ficvf.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/fic: avoid 2 additions per idct rowMichael Niedermayer2014-04-23
| | | | | | | | | | | | | | | | | | | | | | before: 5225 decicycles in IDCT, 32756 runs, 12 skips after: 5057 decicycles in IDCT, 32765 runs, 3 skips Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | fic: Support rendering cursorsDerek Buitenhuis2014-04-23
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | fic: Use proper quantization matrix indexDerek Buitenhuis2014-04-22
| | | | | | | | | | | | | | | | The matrices are not zigzagged. Fixes artefacting. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '93e15a323871613fd26f1f1e317029a50b5b24ca'Michael Niedermayer2014-04-21
|\| | | | | | | | | | | | | * commit '93e15a323871613fd26f1f1e317029a50b5b24ca': fic: use correct IDCT Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * fic: use correct IDCTKostya Shishkov2014-04-21
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec/fic: Fix return value checkMichael Niedermayer2014-04-16
| | | | | | | | | | | | Fixes part of Ticket3466 Found-by: Andrey_Karpov / PVS-Studio Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-03-08
|\| | | | | | | | | | | | | * qatar/master: fic: Properly handle skip frames Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * fic: Properly handle skip framesDerek Buitenhuis2014-03-07
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec/fic: clear slice_dataMichael Niedermayer2014-02-15
| | | | | | | | | | | | | | Fixes artifacts Fixes use of freed memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/fic: fix slice checksMichael Niedermayer2014-02-15
| | | | | | | | | | | | fix integer overflows Signed-off-by: Michael Niedermayer <michaelni@gmx.at>