aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* avcodec/h263dec, mpeg12dec: Remove redundant writesAndreas Rheinhardt2021-04-122-2/+0
| | | | | | ff_mpv_decode_init() already sets MpegEncContext.codec_id. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rv34: Move dsp init code to rv30/rv40Andreas Rheinhardt2021-04-123-9/+2
| | | | | | It avoids both runtime and compile-time checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mvi: Check audio_data_size to be non negativeMichael Niedermayer2021-04-111-7/+7
| | | | | | | | Fixes: left shift of negative value -224 Fixes: 32144/clusterfuzz-testcase-minimized-ffmpeg_dem_MVI_fuzzer-4971479323246592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavfi/qsvvpp: support async depthFei Wang2021-04-114-90/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Async depth will allow qsv filter cache few frames, and avoid force switch and end filter task frame by frame. This change will improve performance for some multi-task case, for example 1:N transcode( decode + vpp + encode) with all QSV plugins. Performance data test on my Coffee Lake Desktop(i7-8700K) by using the following 1:8 transcode test case improvement: 1. Fps improved from 55 to 130. 2. Render/Video usage improved from ~61%/~38% to ~100%/~70%.(Data get from intel_gpu_top) test CMD: ffmpeg -v verbose -init_hw_device qsv=hw:/dev/dri/renderD128 -filter_hw_device \ hw -hwaccel qsv -hwaccel_output_format qsv -c:v h264_qsv -i 1920x1080.264 \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - Signed-off-by: Fei Wang <fei.w.wang@intel.com> Reviewed-by: Linjie Fu <linjie.justin.fu@gmail.com> Signed-off-by: Zhong Li <zhongli_dev@126.com>
* avformat/rawenc: perform stream checks for mp2 muxerGyan Doshi2021-04-111-0/+1
|
* avformat/img2dec: set r_frame_rate in addition to avg_frame_rateJan Ekström2021-04-111-1/+1
| | | | | | | | | Apparently for various image sequences libavformat/utils.c can calculate rather fancy r_frame_rate values, such as `186/1921`, and since ffmpeg.c utilizes r_frame_rate for the filter chain time base, this can quite deteriorate the output frame timing - even though the user has requested the image sequence to be interpreted at a specific, constant frame rate.
* avfilter/overlay_cuda: check av_buffer_ref resultTimo Rothenpieler2021-04-111-0/+4
|
* avfilter/vf_v360: unbreak fov_from_dfov() for (d)fisheye when width != heightPaul B Mahol2021-04-111-6/+6
| | | | Based on patch by Daniel Playfair Cal.
* avfilter/overlay_cuda: hold explicit reference to hw_device_ctxTimo Rothenpieler2021-04-111-1/+7
|
* avcodec/nvenc: add support for gbrp rgb inputTimo Rothenpieler2021-04-112-11/+21
|
* doc/muxers: add entries for raw muxersGyan Doshi2021-04-111-0/+172
|
* avfilter/vf_v360: allow user to control fov for equirectagular formatPaul B Mahol2021-04-111-11/+103
| | | | It may be useful to use different values from typical 360/180 deg.
* doc/protocols: update rtsp optionsAndriy Gelman2021-04-101-1/+10
| | | | | | Define listen_timeout and user_agent. Set timeout and user-agent to deprecated. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/adpcm: refactor init/flush codeZane van Iperen2021-04-101-42/+29
| | | | | | | | | | | Most of the codecs just need everything zeroed. Those that don't are either handled inline during decode, or pull state from extradata. Move state reset/init functionality into adpcm_flush(), and invoke it from adpcm_decode_init(). Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_swf: remove memory allocation during trellis encodingZane van Iperen2021-04-101-3/+4
| | | | | | | The block size is hardcoded, so the buffer size is always known. Statically allocate the buffer on the stack. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/matroskaenc: Fix leak when writing attachment without filenameAndreas Rheinhardt2021-04-101-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Deprecate bframe opts for encoders not supporting themAndreas Rheinhardt2021-04-105-3/+15
| | | | | | | | | | | MPEG-1/2/4 are the only mpegvideo based encoders that support bframes; yet even the encoders not supporting bframes have options that only make sense for an encoder that supports bframes; setting any of these options for such an encoder has no impact on the encoded outcome (but setting b_strategy to two slows down encoding considerably). So deprecate these options. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Deprecate duplicate matrix opt for unsupported codecsAndreas Rheinhardt2021-04-105-1/+9
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Deprecate a53cc option for encoders != MPEG-2Andreas Rheinhardt2021-04-105-1/+11
| | | | | | | The MPEG-2 encoder is the only mpegvideo-based encoder that supports embedding a53 side data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Deprecate mpeg_quant option for codecs != MPEG-4Andreas Rheinhardt2021-04-106-4/+31
| | | | | | | | | | | | | | mpeg_quant may only be set for MPEG-4 and MPEG-2, yet for the latter it is no option as the code acts as if it were always set. So deprecate the option for all codecs for which it makes no sense. Furthermore, given that the code already errors out if the option is set for a codec that doesn't support it we can restrict the range of the option for all these codecs without breaking something. This means that the checks for whether mpeg_quant is set for these codecs can be removed as soon as AVCodecContext.mpeg_quant is removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Combine identical checksAndreas Rheinhardt2021-04-101-9/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12enc: Perform size/level/profile checks earlierAndreas Rheinhardt2021-04-101-22/+22
| | | | | | | This has the advantage that one does not waste some allocations if one errors out because of these checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12enc: Move MPEG-1/2 dimension checks to mpeg12encAndreas Rheinhardt2021-04-102-14/+8
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Remove redundant time_base checkAndreas Rheinhardt2021-04-101-5/+0
| | | | | | This check is dead as ff_encode_preinit() has an even stricter check. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Don't needlessly copy stringAndreas Rheinhardt2021-04-101-3/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Don't write string that is never usedAndreas Rheinhardt2021-04-101-2/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Avoid allocations when configuring output filtersAndreas Rheinhardt2021-04-101-58/+41
| | | | | | Use an AVBPrint to handle the (typically short) strings involved here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegenc: Include all supported pix_fmts in mpegenc pix_fmtsAndreas Rheinhardt2021-04-107-55/+40
| | | | | | | | | | | | | | | Currently said list contains only the pixel formats that are always supported irrespective of the range and the value of strict_std_compliance. This makes the MJPEG encoder an outlier as all other codecs put all potentially supported pixel formats into said list and error out if the chosen pixel format is unsupported. This commit brings it therefore in line with the other encoders. The behaviour of fftools/ffmpeg_filter.c has been preserved. A more informed decision would be possible if colour range were available at this point, but it isn't. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ljpegenc: Allow full range yuv420p, yuv422p, yuv444p by defaultAndreas Rheinhardt2021-04-101-2/+3
| | | | | | | | | | | | | The documentation for AV_PIX_FMT_YUVJ420P reads: "planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range" Yet the LJPEG encoder only accepts full scale yuv420p when strictness is set to unofficial or lower; with default strictness it emits a nonsense error message that says that limit range YUV is unofficial. This has been changed to allow full range yuv420p, yuv422p and yuv444p irrespective of the level of strictness. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Remove redundant pixel format checksAndreas Rheinhardt2021-04-101-23/+0
| | | | | | | | | | | All encoders using ff_mpv_encode_init() already have pix_fmts set so that the pixel format is already checked in ff_encode_preinit(). The one exception to this is MJPEG whose check remains. (Btw: The AVCodec.pix_fmts check for AMV is stricter than the check in ff_mpv_encode_init().) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegenc: Remove dependency of AMV encoder on mjpegenc_huffmanAndreas Rheinhardt2021-04-102-5/+7
| | | | | | | | | Using optimal Huffman tables is not supported for AMV and always disabled by ff_mpv_encode_init(); therefore one can build the AMV encoder without mjpegenc_huffman if one adds the necessary compile-time checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Make AMV encoder usable without MJPEG encoderAndreas Rheinhardt2021-04-101-8/+13
| | | | | | | Up until now the relevant checks all checked for the existence of the MJPEG encoder only. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/proresenc_kostya: Remove harmful checkAndreas Rheinhardt2021-04-101-5/+0
| | | | | | | | | | | | | | | | The ProRes encoder allocates huge worst-case buffers just to be safe; and for huge resolutions (8k in this case) these can be so big that the number of bits does no longer fit into a (signed 32-bit) int; this means that one must no longer use the parts of the PutBits API that deal with bit counters. Yet proresenc_kostya did it, namely for a check about whether we are already beyond the end. Yet this check is unnecessary nowadays, because the PutBits API comes with automatic checks (with a log message and a av_assert2() in put_bits() and an av_assert0() in flush_put_bits()), so this is unnecessary. So simply remove the check. Fixes ticket #9173. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Changelog: Add new <next> line after 4.4Michael Niedermayer2021-04-091-0/+3
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Changelog: replace <next> by 4.4Michael Niedermayer2021-04-091-1/+1
| | | | | Found-by: <jamrial> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/pngdec: always create a copy for APNG_DISPOSE_OP_BACKGROUNDAnton Khirnov2021-04-081-7/+11
| | | | | | | | | | | | Calling av_frame_make_writable() from decoders is tricky, especially when frame threading is used. It is much simpler and safer to just make a private copy of the frame. This is not expected to have a major performance impact, since APNG_DISPOSE_OP_BACKGROUND is not used often and av_frame_make_writable() would typically make a copy anyway. Found-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/msp2dec: Check available space in RLE decoderMichael Niedermayer2021-04-081-0/+1
| | | | | | | | Fixes: out of array read Fixes: 32968/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSP2_fuzzer-5315296027082752 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/webvttenc: Fix use of uninitialized variableAndreas Rheinhardt2021-04-081-1/+1
| | | | | | | Happened in 9168a1c0e67b5c31727b12329b6f52d2bb5e0a14. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Don't segfault on unorthodox mpeg_quantAndreas Rheinhardt2021-04-081-1/+1
| | | | | | | | | | | | | The (deprecated) field AVCodecContext.mpeg_quant has no range restriction; MpegEncContext.mpeg_quant is restricted to 0..1. If the former is set, the latter is overwritten with it without checking the range. This can trigger an av_assert2() with the MPEG-4 encoder when writing said field. Fix this by just setting MpegEncContext.mpeg_quant to 1 if AVCodecContext.mpeg_quant is set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/encode: Fix check for allowed LJPEG pixel formatsAndreas Rheinhardt2021-04-081-1/+1
| | | | | | | | | | | | | | | The pix_fmts of the LJPEG encoder already contain all supported pixel formats (including the ones only supported when strictness is unofficial or less); yet the check in ff_encode_preinit() ignored this list in case strictness is unofficial or less. But the encoder presumed that it is always applied and blacklists some of the entries in pix_fmts when strictness is > unofficial. The result is that if one uses an entry not on that list and sets strictness to unofficial, said entry passes both checks and this can lead to segfaults lateron (e.g. when using gray). Fix this by removing the exception for LJPEG in ff_encode_preinit(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rmdec: Don't rely on unspecified order of evaluationAndreas Rheinhardt2021-04-081-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rmdec: Fix memleaks upon read_header failureAndreas Rheinhardt2021-04-081-16/+22
| | | | | | | | | | | | | | | | | | | | For both the RealMedia as well as the IVR demuxer (which share the same context) each AVStream's priv_data contains an AVPacket that might contain data (even when reading the header) and therefore needs to be unreferenced. Up until now, this has not always been done: The RealMedia demuxer didn't do it when allocating a new stream's priv_data failed although there might be other streams with packets to unreference. (The reason for this was that until recently rm_read_close() couldn't handle an AVStream without priv_data, so one had to choose between a potential crash and a memleak.) The IVR demuxer meanwhile never ever called read_close so that the data already contained in packets leaks upon error. This patch fixes both demuxers by adding the appropriate cleanup code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: copy average framerate for streamcopy, when knownAnton Khirnov2021-04-081-1/+5
|
* lavf: do not derive timebase from avg_frame_rateAnton Khirnov2021-04-081-3/+0
| | | | | | avg_frame_rate is the _average_ framerate, its presence does not guarantee that the stream is CFR, so it should not be used for setting the timebase.
* fftools/ffmpeg: when framerate is set, prefer its inverse as output timebaseAnton Khirnov2021-04-081-2/+6
| | | | | Codec timebase is not well-defined for streamcopy, so it should only be used as the last resort.
* lavf/movenc: use framerate correctly in mov_write_tmcd_tagAnton Khirnov2021-04-081-3/+3
| | | | Current code uses its inverse.
* lavc: postpone FF_API_AVCTX_TIMEBASEAnton Khirnov2021-04-081-3/+3
| | | | | There are still several decoders setting it and the situation is non-trivial to resolve.
* lavf: postpone removal of FF_API_COMPUTE_PKT_FIELDS2Anton Khirnov2021-04-082-7/+7
| | | | | The infrastructure to fully handle generating timestamps e.g. for raw video streamcopy is still not present.
* lavf/webvttenc: fix avio_printf argument types after bumpAnton Khirnov2021-04-081-4/+13
| | | | Field precision supplied with the '*' specification must be an int.
* lavf/matroskaenc: fix avio_printf argument types after bumpAnton Khirnov2021-04-081-2/+11
| | | | | | Field precision supplied with the '*' specification must be an int. Also, make sure converting those fields to int does not overflow.