summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
...
* avcodec/msmpegenc: Add MSMPEG4EncContext and move ac_stats to itAndreas Rheinhardt2022-02-13
| | | | | | Also avoid the allocation by making it part of the context. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/msmpeg4.h: Move decoder-only parts to a new headerAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/msmpeg4.h: Move encoder-only stuff to a new headerAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmv2.h: Move encoder- and decoder-only parts to new headersAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmv2: Split Wmv2Context into decoder and encoder contextAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmv2: Move initializing abt_scantables to the decoderAndreas Rheinhardt2022-02-13
| | | | | | They are not used by the encoder at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/idctdsp: Constify the permutation parameter of ff_init_scantableAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h261enc: Pass PutBitContext directly in h261_encode_motion()Andreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h261: Move encoder-only stuff to a new headerAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h261: Separate decode and encode contextsAndreas Rheinhardt2022-02-13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Enable private contextsAndreas Rheinhardt2022-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MpegEncContext is used by many different codecs and every one of these uses just a subset of its fields. If one tries to separate this and e.g. add a real MpegContext and extension structures (say MpegDecContext and MpegEncContext), one runs into two difficulties: a) Some code is shared between decoder and encoder of the same format and they therefore use the same contexts, either MpegEncContext itself or identical extensions thereof. The latter is the case for H.261 as well as WMV2. b) In case of slice threading, the generic code can only allocate and initialize the structure it knows about; right now this is an MpegEncContext. If the codec has an even more extensive structure, it is only available for the main thread's MpegEncContext. Fixing this would involve making ff_mpv_common_init() aware of the size the size of slice context to allocate and would be part of separating the main thread's context from the slice contexts in general. This commit only intends to tackle the first issue by adding a pointer to MpegEncContext that codecs can set to a common context so that the aforementioned codecs can use this context (together with the MpegEncContext) in their common code. This will allow to move fields only used by the main thread to more specialized contexts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/exr: Mark decoder as init-threadsafeAndreas Rheinhardt2022-02-13
| | | | | | | This decoder does not initialize any static data in its init function. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/amrwbdec: Mark decoder as init-threadsafeAndreas Rheinhardt2022-02-13
| | | | | | | It performs no initialization of static data in its init function. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/amrnbdec: Mark decoder as init-threadsafeAndreas Rheinhardt2022-02-13
| | | | | | | It performs no initialization of static data during its init function. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp[56]: Mark decoders as init-threadsafeAndreas Rheinhardt2022-02-13
| | | | | | | Nothing with static storage duration is initialized by these codecs. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp56: Avoid functions with only one callerAndreas Rheinhardt2022-02-13
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp6: Avoid code duplication when initializing VP56 contextsAndreas Rheinhardt2022-02-13
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp6: Avoid allocation for alpha_contextAndreas Rheinhardt2022-02-13
| | | | | | Reviewed-by: Peter Ross <pross@xvid.org> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp56: Cleanup generically in case of init failureAndreas Rheinhardt2022-02-13
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp6: Check initializing VP6A contextAndreas Rheinhardt2022-02-13
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/qdmc: switch to fft from lavu/txPaul B Mahol2022-02-12
|
* avcodec/metasound, twinvqdec: Cleanup generically upon init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/g2meet: Cleanup generically on init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/4xm: Cleanup generically on init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cavsdec: Fix error messageAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cavsdec: Mark decoder as init-threadsafeAndreas Rheinhardt2022-02-11
| | | | | | It does not initialize any static data in its .init. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cavsdec: Cleanup generically on init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vorbisenc: Cleanup generically on init-failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/tta: Cleanup generically on init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ralf: Cleanup generically on init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc2enc: Cleanup generically on allocation failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc2enc_dwt: Avoid NULL - 0Andreas Rheinhardt2022-02-11
| | | | | | | It is sane, but UB. It could happen in case of allocation errors in vc2_encode_init(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/proresenc_kostya: Use av_calloc/av_malloc_array()Andreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/proresenc_kostya: Cleanup generically after init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_jpeg: Fix size of huffman symbol table arrayAndreas Rheinhardt2022-02-11
| | | | | | L[i] can be in the range of 0-255, see table B.5 of ITU T.81. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* aarch64: h264dsp: Fix incorrectly indented codeMartin Storsjö2022-02-11
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/pngdec: Cleanup generically on init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp6: return value check for av_malloczJiasheng Jiang2022-02-11
| | | | | | | | | | | | As the potential failure of the av_mallocz(), the 's->alpha_context' could be NULL and be dereferenced later. Therefore, it should be better to check it and deal with it if fails in order to prevent memory leak, same as the av_frame_alloc() in ff_vp56_init(). Fixes: 39a3894ad5 ("lavc/vp6: Implement "slice" threading for VP6A decode") Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
* avcodec/pthread_frame: Properly unref frame in case of decoding failureAndreas Rheinhardt2022-02-09
| | | | | | | | | | Use ff_thread_release_buffer() instead of av_frame_unref(), as the former handles the case of non-thread-safe callbacks properly. (This is possible now that ff_thread_release_buffer() no longer requires a ThreadFrame.) 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-09
| | | | | | | | | | | | | | | | | | | | | | | 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/threadframe: Add ff_thread_(get|release)_ext_buffer()Andreas Rheinhardt2022-02-09
| | | | | | | | | These will be used by the codecs that need allocated progress and is in preparation for no longer using ThreadFrame by the codecs that don't. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/thread: Move ff_thread_(await|report)_progress to new headerAndreas Rheinhardt2022-02-09
| | | | | | | | | | This is in preparation for further commits that will stop using ThreadFrame for frame-threaded codecs that don't use ff_thread_(await|report)_progress(); the API for those codecs having inter-frame depdendencies will live in threadframe.h. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hapdec: Remove always-false checkAndreas Rheinhardt2022-02-09
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pthread_frame: Don't prematurily presume frame-threadingAndreas Rheinhardt2022-02-09
| | | | | | | | | | | Several of our decoders support both frame- as well as slice-threading; in case of the latter avctx->internal->thread_ctx points to a SliceThreadContext, not to a frame-thread PerThreadContext. So only treat avctx->internal->thread_ctx as the latter after having checked that frame-threading is active. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/motion_est: fix indention of ff_get_best_fcode()Michael Niedermayer2022-02-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()Michael Niedermayer2022-02-09
| | | | | | | This codepath seems untested, no testcases change Found-by: <mkver> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeglsdec: Increase range for N in ls_get_code_runterm() by using ↵Michael Niedermayer2022-02-09
| | | | | | | | | | | | unsigned Fixes: left shift of 32768 by 16 places cannot be represented in type 'int' Fixes: Timeout Fixes: 44219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-4679455379947520 Fixes: 44088/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-4885976600674304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp8: Remove always-false checkAndreas Rheinhardt2022-02-09
| | | | | | | | | | Since e9b66175793e5c2af19beefe8e143f6e4901b5df a codec's close function is never ever called for a codec whose init function has not been called; in particular, it is never ever called if the AVCodecContext's private data has not been allocated. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hcadec: Mark decoder as init-threadsafeAndreas Rheinhardt2022-02-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hcadec: Fix memleak upon allocation errorAndreas Rheinhardt2022-02-09
| | | | | | | An AVFloatDSPContext would leak upon av_tx_init() failure. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>