- Jan 04, 2022
-
-
Andreas Rheinhardt authored
This is possible if CONFIG_SMALL is not true. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
Whether lowres is in use or not is inlined in mpv_reconstruct_mb_internal(), so one can use the fact that lowres is always zero during encoding to evaluate the checks for whether one is encoding or not at compile-time when one is in lowres mode. Also reorder the main check to check for whether it is an encoder first to shortcircuit it in the common case of a decoder. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
It doesn't exist. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
The very first check in this if-else if-else if construct is "if (s->encoding ||", i.e. in case of the WMV2 encoder the else branches are never executed. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
This function is quite small (96B with GCC 11.2 on x64 Ubuntu 21.10 at -O3), making it more economical to duplicate it into libavformat instead of exporting it as avpriv: Doing so saves 2x24B in .dynsim, 2x16B in .dynstr, 2x2B .gnu.version, 24B in .rela.plt, 16B in .plt, 16B in .plt.sec (if enabled), 4B .gnu.hash; besides the actual duplicated code this also adds 2x8B .eh_frame_hdr and 24B .eh_frame. In other words: Duplicating is neutral size-wise (it is also presumed neutral for other systems). Given that it avoids the runtime overhead of dynamic symbols, it is advantageouos to duplicate the function. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
- Dec 17, 2021
-
-
Andreas Rheinhardt authored
Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
Reduces the amount of allocations and frees. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
ff_mpeg_update_thread_context() is only used by decoders. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
Only used there and only by the main thread. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
- Sep 29, 2021
-
-
Limin Wang authored
Signed-off-by:
Limin Wang <lance.lmwang@gmail.com>
-
- Sep 19, 2021
-
-
Anton Khirnov authored
It is supported only by a few decoders (h263, h263p, mpeg(1|2|)video and mpeg4) and is entirely redundant with parsers. Furthermore, using it leads to missing frames, as flushing the decoder at the end does not work properly. Co-authored-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
- Apr 07, 2021
-
-
Andreas Rheinhardt authored
The RealVideo 3.0 and 4.0 decoders call ff_mpv_common_init() only during their init function and not during decode_frame(); when the size of the frame changes, they call ff_mpv_common_frame_size_change(). Yet upon error, said function calls ff_mpv_common_end() which frees the whole MpegEncContext and not only those parts that ff_mpv_common_frame_size_change() reinits. As a result, the context will never be usable again; worse, because decode_frame() contains no check for whether the context is initialized or not, it is presumed that it is initialized, leading to segfaults. Basically the same happens if rv34_decoder_realloc() fails. This commit fixes this by only resetting the parts that ff_mpv_common_frame_size_change() changes upon error and by actually checking whether the context is in need of reinitialization in ff_rv34_decode_frame(). Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Andreas Rheinhardt authored
Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Andreas Rheinhardt authored
When slice-threading is used, ff_mpv_common_init() duplicates the first MpegEncContext and allocates some buffers for each MpegEncContext (the first as well as the copies). But the count of allocated MpegEncContexts is not updated until after everything has been allocated and if an error happens after the first one has been allocated, only the first one is freed; the others leak. This commit fixes this: The count is now set before the copies are allocated. Furthermore, the copies are now created and initialized before the first MpegEncContext, so that the buffers exclusively owned by each MpegEncContext are still NULL in the src MpegEncContext so that no double-free happens upon allocation failure. Given that this effectively touches every line of the init code, it has also been factored out in a function of its own in order to remove code duplication with the same code in ff_mpv_common_frame_size_change() (which was never called when using more than one slice (and if it were, there would be potential double-frees)). Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Andreas Rheinhardt authored
This mostly reverts commit 4b2863ff. Said commit removed the freeing code from ff_mpv_common_init(), ff_mpv_common_frame_size_change() and ff_mpeg_framesize_alloc() and instead added the FF_CODEC_CAP_INIT_CLEANUP to several codecs that use ff_mpv_common_init(). This introduced several bugs: a) Several decoders using ff_mpv_common_init() in their init function were forgotten: This affected FLV, Intel H.263, RealVideo 3.0 and V4.0 as well as VC-1/WMV3. b) ff_mpv_common_init() is not only called from the init function of codecs, it is also called from AVCodec.decode functions. If an error happens after an allocation has succeeded, it can lead to memleaks; furthermore, it is now possible for the MpegEncContext to be marked as initialized even when ff_mpv_common_init() returns an error and this can lead to segfaults because decoders that call ff_mpv_common_init() when decoding a frame can mistakenly think that the MpegEncContext has been properly initialized. This can e.g. happen with H.261 or MPEG-4. c) Removing code for freeing from ff_mpeg_framesize_alloc() (which can't be called from any init function) can lead to segfaults because the check for whether it needs to allocate consists of checking whether the first of the buffers allocated there has been allocated. This part has already been fixed in 76cea1d2. d) ff_mpv_common_frame_size_change() can also not be reached from any AVCodec.init function; yet the changes can e.g. lead to segfaults with decoders using ff_h263_decode_frame() upon allocation failure, because the MpegEncContext will upon return be flagged as both initialized and not in need of reinitialization (granted, the fact that ff_h263_decode_frame() clears context_reinit before the context has been reinited is a bug in itself). With the earlier version, the context would be cleaned upon failure and it would be attempted to initialize the context again in the next call to ff_h263_decode_frame(). While a) could be fixed by adding the missing FF_CODEC_CAP_INIT_CLEANUP, keeping the current approach would entail adding cleanup code to several other places because of b). Therefore ff_mpv_common_init() is again made to clean up after itself; the changes to the wmv2 decoder and the SVQ1 encoder have not been reverted: The former fixed a memleak, the latter allowed to remove cleanup code. Fixes: double free Fixes: ff_free_picture_tables.mp4 Fixes: ff_mpeg_update_thread_context.mp4 Fixes: decode_colskip.mp4 Fixes: memset.mp4 Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- Mar 31, 2021
-
-
Michael Niedermayer authored
Fixes: out of array access Fixes: 31201/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4627865612189696.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
- Jan 01, 2021
-
-
Anton Khirnov authored
Do it only when requested with the AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS flag. Drop previous code using the long-deprecated AV_FRAME_DATA_QP_TABLE* API. Temporarily disable fate-filter-pp, fate-filter-pp7, fate-filter-spp. They will be reenabled once these filters are converted in following commits.
-
- Dec 31, 2020
-
-
Andreas Rheinhardt authored
mbintra_table will be memset to 1 a few lines after its allocation. Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Andreas Rheinhardt authored
These two are always called directly after each other (with the exception of the calls in mpeg_decode_init() where some irrelevant modifications of the avctx (which could just as well be done before ff_mpv_decode_defaults(), because it doesn't have a pointer to the AVCodecContext at all and therefore can't see these modifications at all) are performed in between), so merge ff_mpv_decode_defaults() in ff_mpv_decode_init(). Reviewed-by:
Anton Khirnov <anton@khirnov.net> Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- Jun 14, 2020
-
-
Limin Wang authored
Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
Limin Wang <lance.lmwang@gmail.com>
-
- Jun 12, 2020
-
-
Limin Wang authored
Signed-off-by:
Limin Wang <lance.lmwang@gmail.com>
-
Limin Wang authored
Signed-off-by:
Limin Wang <lance.lmwang@gmail.com>
-
Limin Wang authored
Signed-off-by:
Limin Wang <lance.lmwang@gmail.com>
-
- May 09, 2020
-
-
Limin Wang authored
Signed-off-by:
Limin Wang <lance.lmwang@gmail.com>
-
Limin Wang authored
Signed-off-by:
Limin Wang <lance.lmwang@gmail.com>
-
- Mar 16, 2020
-
-
Anton Khirnov authored
It is always 0.
-
- Mar 14, 2020
-
-
Andreas Rheinhardt authored
as well as includes of libavutil/timer.h. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
- Dec 14, 2018
-
-
Andriy Gelman authored
Fixes #7410. The value of sub-pixel precision for me/mc can change during an Intra frame. In multi-threaded decoding this change is not propagated to other frame threads causing decoding artifacts. This patch initializes the sub-pixel precision parameter from previous thread, which fixes the issue. Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
- Aug 25, 2018
-
-
Kieran Kunhya authored
-
- May 30, 2018
-
-
Michael Niedermayer authored
These 2 fields are not always the same, it is simpler to always use the same field for detecting studio profile Fixes: null pointer dereference Fixes: ffmpeg_crash_3.avi Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
- Apr 02, 2018
-
-
Kieran Kunhya authored
This is a profile supporting > 8-bit video and has a higher quality DCT
-
- Dec 11, 2017
-
-
Kieran Kunhya authored
-
- Nov 07, 2017
-
-
Martin Vignali authored
Signed-off-by:
James Almer <jamrial@gmail.com>
-
- Nov 06, 2017
-
-
Martin Vignali authored
Replace them with av_pix_fmt_get_chroma_sub_sample. Signed-off-by:
James Almer <jamrial@gmail.com>
-
- Oct 23, 2017
-
-
James Almer authored
Deprecated in 08/2014. Signed-off-by:
James Almer <jamrial@gmail.com>
-
- Oct 04, 2017
-
-
Zhong Li authored
It is to fix https://trac.ffmpeg.org/ticket/6677 . Actucally it is a regression of commit 99e07a44 which always inserts a dummy frame when decode the first key field picture. Signed-off-by:
Zhong Li <zhong.li@intel.com> Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
- Aug 25, 2017
-
-
James Almer authored
Signed-off-by:
James Almer <jamrial@gmail.com>
-