]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoswscale/aarch64: use multiply accumulate and shift-right narrow
Sebastian Pop [Mon, 9 Dec 2019 14:25:01 +0000 (14:25 +0000)]
swscale/aarch64: use multiply accumulate and shift-right narrow

This patch rewrites the innermost loop of ff_yuv2planeX_8_neon to avoid zips and
horizontal adds by using fused multiply adds. The patch also uses ld1r to load
one element and replicate it across all lanes of the vector. The patch also
improves the clipping code by removing the shift right instructions and
performing the shift with the shift-right narrow instructions.

I see 8% difference on an m6g instance with neoverse-n1 CPUs:
$ ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf bench=start,scale=1024x1024,bench=stop -f null -
before: t:0.014015 avg:0.014096 max:0.015018 min:0.013971
after:  t:0.012985 avg:0.013013 max:0.013996 min:0.012818

Tested with `make check` on aarch64-linux.

Signed-off-by: Sebastian Pop <spop@amazon.com>
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/bsf: replace ctx->internal-> with bsfi-> for better readability
Limin Wang [Mon, 16 Dec 2019 05:01:49 +0000 (13:01 +0800)]
avcodec/bsf: replace ctx->internal-> with bsfi-> for better readability

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc: Fix a typo.
Carl Eugen Hoyos [Sat, 4 Jan 2020 19:58:10 +0000 (20:58 +0100)]
doc: Fix a typo.

4 years agolavfi/buffersrc: Remove redundant free after ff_filter_frame() failure
Jun Zhao [Wed, 1 Jan 2020 05:22:13 +0000 (13:22 +0800)]
lavfi/buffersrc: Remove redundant free after ff_filter_frame() failure

ff_filter_frame() always frees the frame in case of error, so we don't
need to free the frame after ff_filter_frame() fails.

Fix CID 1457230.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavfilter/af_dynaudnorm: fix another clipping with custom peak value
Paul B Mahol [Sat, 4 Jan 2020 18:10:06 +0000 (19:10 +0100)]
avfilter/af_dynaudnorm: fix another clipping with custom peak value

This always happened at start with alternative boundary mode disabled.
The clipping only occurred if starting samples where high enough.

4 years agoavfilter/af_dynaudnorm: implement threshold option
Paul B Mahol [Sat, 4 Jan 2020 17:17:32 +0000 (18:17 +0100)]
avfilter/af_dynaudnorm: implement threshold option

4 years agoavfilter/af_dynaudnorm: do not clip audio
Paul B Mahol [Sat, 4 Jan 2020 09:27:46 +0000 (10:27 +0100)]
avfilter/af_dynaudnorm: do not clip audio

Clipping can happen when smoothed gain is higher than maximum
allowed gain factor for current frame and peak value option is
set to enough low value.

4 years agolibavutil/opt: fix memory leak after av_dict_parse_string fail
Jun Zhao [Wed, 1 Jan 2020 04:35:31 +0000 (12:35 +0800)]
libavutil/opt: fix memory leak after av_dict_parse_string fail

In case of failure, all the successfully set entries are stored in
*pm. We need to manually free the created dictionary to avoid
memory leak.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/coreimage: fix memory leak after av_dict_parse_string fail
Jun Zhao [Wed, 1 Jan 2020 04:27:18 +0000 (12:27 +0800)]
lavfi/coreimage: fix memory leak after av_dict_parse_string fail

In case of failure, all the successfully set entries are stored in
*pm. We need to manually free the created dictionary to avoid
memory leak.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavc/libkvazaar: fix memory leak after av_dict_parse_string fail
Jun Zhao [Wed, 1 Jan 2020 04:09:52 +0000 (12:09 +0800)]
lavc/libkvazaar: fix memory leak after av_dict_parse_string fail

In case of failure, all the successfully set entries are stored in
*pm. We need to manually free the created dictionary to avoid
memory leak.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavc/bsf: fix memory leak after av_dict_parse_string fail
Jun Zhao [Wed, 1 Jan 2020 04:06:47 +0000 (12:06 +0800)]
lavc/bsf: fix memory leak after av_dict_parse_string fail

In case of failure, all the successfully set entries are stored in
*pm. We need to manually free the created dictionary to avoid
memory leak.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavdevice/decklink: deprecate the -list_devices option
Marton Balint [Wed, 21 Aug 2019 21:02:51 +0000 (23:02 +0200)]
avdevice/decklink: deprecate the -list_devices option

The user should use ffmpeg -sources decklink or ffmpeg -sinks decklink instead.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavdevice/decklink_dec: remove -bm_v210 option
Marton Balint [Wed, 21 Aug 2019 20:52:10 +0000 (22:52 +0200)]
avdevice/decklink_dec: remove -bm_v210 option

Deprecated since Sep 28, 2017.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavdevice/decklink_dec: remove the @mode syntax
Marton Balint [Wed, 21 Aug 2019 20:40:11 +0000 (22:40 +0200)]
avdevice/decklink_dec: remove the @mode syntax

Deprecated since March 28, 2017.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/img2enc: fix writing multiple streams in write_muxed_file
Marton Balint [Thu, 26 Dec 2019 22:33:26 +0000 (23:33 +0100)]
avformat/img2enc: fix writing multiple streams in write_muxed_file

Maybe we should just reject multiple streams for the image2 muxer instead?

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/img2enc: minor simplification
Marton Balint [Thu, 26 Dec 2019 21:58:45 +0000 (22:58 +0100)]
avformat/img2enc: minor simplification

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/img2enc: cleanup IO contexts on error
Marton Balint [Thu, 26 Dec 2019 20:08:22 +0000 (21:08 +0100)]
avformat/img2enc: cleanup IO contexts on error

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/img2enc: reindent after last commit
Marton Balint [Thu, 26 Dec 2019 19:54:14 +0000 (20:54 +0100)]
avformat/img2enc: reindent after last commit

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/img2enc: factorize piped write_packet
Marton Balint [Thu, 26 Dec 2019 19:51:19 +0000 (20:51 +0100)]
avformat/img2enc: factorize piped write_packet

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/img2enc: factorize writing fully muxed file
Marton Balint [Thu, 26 Dec 2019 18:57:04 +0000 (19:57 +0100)]
avformat/img2enc: factorize writing fully muxed file

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agodoc/muxers: fix order of options and examples for image2 muxer
Marton Balint [Thu, 26 Dec 2019 23:34:11 +0000 (00:34 +0100)]
doc/muxers: fix order of options and examples for image2 muxer

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/af_dynaudnorm: fix previous commit
Paul B Mahol [Thu, 2 Jan 2020 16:24:01 +0000 (17:24 +0100)]
avfilter/af_dynaudnorm: fix previous commit

We still need to analyze frame for amplification at EOF.

4 years agoavfilter/af_dynaudnorm: do not enqueue flush buffers
Paul B Mahol [Thu, 2 Jan 2020 15:22:47 +0000 (16:22 +0100)]
avfilter/af_dynaudnorm: do not enqueue flush buffers

4 years agoavcodec/mpeg12dec: always submit the first field to hwaccel
Zhong Li [Mon, 23 Oct 2017 07:43:30 +0000 (15:43 +0800)]
avcodec/mpeg12dec: always submit the first field to hwaccel

Though this patch to fix ticket #6668, I belive it
is unnecessary to set SLICE_FLAG_ALLOW_FIELD flag to other
hwaccels(dxva, vdpau, etc). Please also refer the orginal comment
of 9cb150c9ab520eba5636bbcf925db6a70e67f3e5

Should also fix ticket #8442.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agoavcodec/nvdec_mpeg12: set field flags
Timo Rothenpieler [Thu, 2 Jan 2020 12:15:27 +0000 (13:15 +0100)]
avcodec/nvdec_mpeg12: set field flags

4 years agoavcodec/librav1e: use AV_OPT_TYPE_DICT for rav1e-params
Marton Balint [Wed, 25 Dec 2019 00:55:25 +0000 (01:55 +0100)]
avcodec/librav1e: use AV_OPT_TYPE_DICT for rav1e-params

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/libxavs2: use AV_OPT_TYPE_DICT for xavs2-params
Marton Balint [Wed, 25 Dec 2019 00:13:48 +0000 (01:13 +0100)]
avcodec/libxavs2: use AV_OPT_TYPE_DICT for xavs2-params

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/libx265: use AV_OPT_TYPE_DICT for x265-params
Marton Balint [Wed, 25 Dec 2019 00:50:36 +0000 (01:50 +0100)]
avcodec/libx265: use AV_OPT_TYPE_DICT for x265-params

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/libx264: use AV_OPT_TYPE_DICT for x264-params
Marton Balint [Wed, 25 Dec 2019 00:46:37 +0000 (01:46 +0100)]
avcodec/libx264: use AV_OPT_TYPE_DICT for x264-params

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/libvpxenc: use AV_OPT_TYPE_DICT for ts-parameters
Marton Balint [Wed, 25 Dec 2019 01:02:30 +0000 (02:02 +0100)]
avcodec/libvpxenc: use AV_OPT_TYPE_DICT for ts-parameters

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/tee: use AV_OPT_TYPE_DICT for fifo_options
Marton Balint [Wed, 25 Dec 2019 10:32:48 +0000 (11:32 +0100)]
avformat/tee: use AV_OPT_TYPE_DICT for fifo_options

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/segment: use AV_OPT_TYPE_DICT for segment_format_options
Marton Balint [Tue, 24 Dec 2019 23:48:00 +0000 (00:48 +0100)]
avformat/segment: use AV_OPT_TYPE_DICT for segment_format_options

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/hlsenc: use AV_OPT_TYPE_DICT for hls_ts_options
Marton Balint [Sun, 22 Dec 2019 22:50:18 +0000 (23:50 +0100)]
avformat/hlsenc: use AV_OPT_TYPE_DICT for hls_ts_options

Simplifies code and avoids memory leaks.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/fifo: use AV_OPT_TYPE_DICT for format_opts
Marton Balint [Wed, 25 Dec 2019 01:13:22 +0000 (02:13 +0100)]
avformat/fifo: use AV_OPT_TYPE_DICT for format_opts

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/dashenc: use AV_OPT_TYPE_DICT for format_options
Marton Balint [Tue, 24 Dec 2019 23:58:24 +0000 (00:58 +0100)]
avformat/dashenc: use AV_OPT_TYPE_DICT for format_options

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/libx265: export encoded frame stats
James Almer [Sat, 28 Dec 2019 16:34:19 +0000 (13:34 -0300)]
avcodec/libx265: export encoded frame stats

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 66b6005301894823052b437a950003ffbe3ba6de)

4 years agoavcodec/libx265: add a qp option and apply the relevant global AVCodecContext setting...
James Almer [Wed, 14 Aug 2019 01:09:34 +0000 (22:09 -0300)]
avcodec/libx265: add a qp option and apply the relevant global AVCodecContext settings to the encoder context

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/libx265: apply some global AVCodecContext settings to the encoder context
James Almer [Wed, 14 Aug 2019 01:07:08 +0000 (22:07 -0300)]
avcodec/libx265: apply some global AVCodecContext settings to the encoder context

There's no reason to ignore them if set.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/matroskadec: Use AV_DICT_DONT_STRDUP_VAL to save av_strdup
Andreas Rheinhardt [Sun, 10 Nov 2019 04:07:31 +0000 (05:07 +0100)]
avformat/matroskadec: Use AV_DICT_DONT_STRDUP_VAL to save av_strdup

This will likely also fix CID 1452562, a false positive resulting from
Coverity thinking that av_dict_set() automatically frees its key and
value parameters (even without the AV_DICT_DONT_STRDUP_* flags).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/matroskaenc: Check return value of ff_isom_write_hvcc()
Andreas Rheinhardt [Wed, 1 Jan 2020 00:58:22 +0000 (01:58 +0100)]
avformat/matroskaenc: Check return value of ff_isom_write_hvcc()

The Matroska muxer currently does not check the return value of
ff_isom_write_hvcc(), the function used to write mp4-style
HEVC-extradata as Matroska also uses it. This was intentionally done in
7a5356c72 to allow remuxing from mpeg-ts.

But if ff_isom_write_hvcc() fails, it has not output anything and the
file ends up without CodecPrivate and, if the input was Annex B, with
Annex B data, which is against the spec. So check the return value
again.

The underlying issue of not having extradata seems to have been fixed by
the introduction of the extract_extradata bitstream filter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/matroskaenc: Adapt documentation of put_ebml_num
Andreas Rheinhardt [Wed, 1 Jan 2020 00:58:21 +0000 (01:58 +0100)]
avformat/matroskaenc: Adapt documentation of put_ebml_num

to its actual behaviour: That it uses the least amount of bytes unless
overridden.

The current documentation leaves it undefined how many bytes will be used
when no number to use has been given explicitly. But several estimates
(used to write EBML Master elements with a small length field) require
this number to be the least amount of bytes to work. Therefore change
the documentation; and remove a comment about writing length fields
indicating "unkown length". It has been outdated since 0580a122.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mpeg: Remove secondary packet for reading VobSub
Andreas Rheinhardt [Tue, 8 Oct 2019 05:41:14 +0000 (07:41 +0200)]
avformat/mpeg: Remove secondary packet for reading VobSub

When vobsub_read_packet() reads a packet, it uses a dedicated AVPacket
to get the subtitle timing and position from an FFDemuxSubtitlesQueue
(which has been filled with this data during reading the idx file in
vobsub_read_header); afterwards the actual subtitle data is read into
the packet destined for output and the timing and position are copied
to this packet. Afterwards, the local packet is unreferenced.

This can be simplified: Simply use the output packet to get the timing
and position from the FFDemuxSubtitlesQueue. The packet's size will be
zero afterwards, so that it can be directly used to read the actual
subtitle data. This makes copying the packet fields as well as
unreferencing the local packet unecessary and also removes an instance
of usage of sizeof(AVPacket) in libavformat.

The only difference is that the returned packet will already be flagged
as a keyframe. This currently only happens in compute_pkt_fields().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agocompat/avisynth: Fix unicode compilation.
Matt Oliver [Mon, 30 Dec 2019 16:00:40 +0000 (03:00 +1100)]
compat/avisynth: Fix unicode compilation.

Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/af_dynaudnorm: do not hang forever if only EOF is received
Paul B Mahol [Wed, 1 Jan 2020 12:35:31 +0000 (13:35 +0100)]
avfilter/af_dynaudnorm: do not hang forever if only EOF is received

4 years agoavfilter/af_dynaudnorm: do not error out if even filter size was given
Paul B Mahol [Wed, 1 Jan 2020 12:11:52 +0000 (13:11 +0100)]
avfilter/af_dynaudnorm: do not error out if even filter size was given

Instead issue a warning and make filter size odd number.

4 years agolavf/libsrt: add version guard for srt encryption control
Jun Zhao [Wed, 25 Dec 2019 13:22:09 +0000 (21:22 +0800)]
lavf/libsrt: add version guard for srt encryption control

add version guard for srt encryption control. and use
SRTO_STRICTENC(53) for compatibility.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoconfigure: bump year
Gyan Doshi [Wed, 1 Jan 2020 06:44:30 +0000 (12:14 +0530)]
configure: bump year

4 years agoavcodec: Replace get_bits_long() by get_bits() where possible
Michael Niedermayer [Sun, 24 Nov 2019 14:31:14 +0000 (15:31 +0100)]
avcodec: Replace get_bits_long() by get_bits() where possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/oggparsetheora: Replace get_bits_long() by get_bits() where possible
Michael Niedermayer [Sun, 24 Nov 2019 14:30:51 +0000 (15:30 +0100)]
avformat/oggparsetheora: Replace get_bits_long() by get_bits() where possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/oggparseflac: Replace skip_bits_long() by skip_bits() where possible
Michael Niedermayer [Sun, 24 Nov 2019 14:17:12 +0000 (15:17 +0100)]
avformat/oggparseflac: Replace skip_bits_long() by skip_bits() where possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec: Replace skip_bits_long() by skip_bits() where possible
Michael Niedermayer [Sun, 24 Nov 2019 14:05:24 +0000 (15:05 +0100)]
avcodec: Replace skip_bits_long() by skip_bits() where possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec: Replace show_bits_long() by show_bits() where possible
Michael Niedermayer [Sun, 24 Nov 2019 14:05:24 +0000 (15:05 +0100)]
avcodec: Replace show_bits_long() by show_bits() where possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ffwavesynth: Fix undefined overflow in wavesynth_synth_sample()
Michael Niedermayer [Mon, 25 Nov 2019 20:50:57 +0000 (21:50 +0100)]
avcodec/ffwavesynth: Fix undefined overflow in wavesynth_synth_sample()

Fixes: signed integer overflow: 2147464192 + 21176 cannot be represented in type 'int'
Fixes: 19042/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5719828090585088
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/cook: Use 3 stage VLC decoding for channel_coupling
Michael Niedermayer [Mon, 25 Nov 2019 20:39:48 +0000 (21:39 +0100)]
avcodec/cook: Use 3 stage VLC decoding for channel_coupling

Fixes: shift exponent -1 is negative
Fixes: out of array read
Fixes: 19028/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5759766471376896
Fixes: 19037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5734106625474560
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/options_table: err_detect compliant and aggressive should also enable the...
Michael Niedermayer [Fri, 29 Nov 2019 22:32:24 +0000 (23:32 +0100)]
avcodec/options_table: err_detect compliant and aggressive should also enable the weaker checks

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/options_table: err_detect compliant and aggressive should also enable the...
Michael Niedermayer [Fri, 29 Nov 2019 22:32:24 +0000 (23:32 +0100)]
avformat/options_table: err_detect compliant and aggressive should also enable the weaker checks

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/wmalosslessdec: Fixes undefined overflow in dequantization in decode_subframe()
Michael Niedermayer [Fri, 29 Nov 2019 21:45:07 +0000 (22:45 +0100)]
avcodec/wmalosslessdec: Fixes undefined overflow in dequantization in decode_subframe()

Fixes: signed integer overflow: 47875596 * 45 cannot be represented in type 'int'
Fixes: 19082/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5687766512041984
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/sonic: Check e in get_symbol()
Michael Niedermayer [Mon, 21 Oct 2019 21:22:05 +0000 (23:22 +0200)]
avcodec/sonic: Check e in get_symbol()

Fixes: signed integer overflow: 1721520852 + 1721520852 cannot be represented in type 'int'
Fixes: 18346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5709623893426176
Fixes: 18753/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5663299131932672
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/twinvqdec: Correct overflow in block align check
Michael Niedermayer [Tue, 3 Dec 2019 18:48:46 +0000 (19:48 +0100)]
avcodec/twinvqdec: Correct overflow in block align check

Fixes: signed integer overflow: 538976288 * 8 cannot be represented in type 'int'
Fixes: 19126/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TWINVQ_fuzzer-5687464110325760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/h264_ps: Provide more details with "Truncated VUI" Message
Michael Niedermayer [Sun, 15 Dec 2019 18:00:21 +0000 (19:00 +0100)]
avcodec/h264_ps: Provide more details with "Truncated VUI" Message

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agofftools/ffmpeg_filter: remove sws_param option from buffersrc
Zhao Zhili [Wed, 4 Dec 2019 13:41:46 +0000 (21:41 +0800)]
fftools/ffmpeg_filter: remove sws_param option from buffersrc

The option is deprecated and ignored by buffersrc.

4 years agotools/target_dec_fuzzer: Stop negative block_align and sampling rate
Michael Niedermayer [Sat, 28 Dec 2019 19:16:24 +0000 (20:16 +0100)]
tools/target_dec_fuzzer: Stop negative block_align and sampling rate

These are checked for early in avcodec_open2() and do not really test the decoder
but instead waste resources which could be better spend fuzzing the actual decoder

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/utils: remove access of AV_SAMPLE_FMT_NB
Zhao Zhili [Mon, 30 Dec 2019 13:54:18 +0000 (21:54 +0800)]
avcodec/utils: remove access of AV_SAMPLE_FMT_NB

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoswscale/utils: remove access of AV_PIX_FMT_NB
Zhao Zhili [Mon, 30 Dec 2019 13:54:16 +0000 (21:54 +0800)]
swscale/utils: remove access of AV_PIX_FMT_NB

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavdevice/xcbgrab: capture the full desktop if video_size is not specified
Marton Balint [Sat, 28 Dec 2019 00:15:34 +0000 (01:15 +0100)]
avdevice/xcbgrab: capture the full desktop if video_size is not specified

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavdevice/xcbgrab: fix packet timestamps
Marton Balint [Sat, 28 Dec 2019 00:12:28 +0000 (01:12 +0100)]
avdevice/xcbgrab: fix packet timestamps

Since 648b8cca6c56a4fa1760efc72dfe1363a5c6e31e and
c991e9cd91845044e93a9c89dd25b48ae707461b timestamps were not set properly.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_histogram: add envelope to thistogram filter
Paul B Mahol [Mon, 30 Dec 2019 16:21:35 +0000 (17:21 +0100)]
avfilter/vf_histogram: add envelope to thistogram filter

4 years agoavfilter/buffersrc: deprecate sws_param option
Zhao Zhili [Mon, 30 Dec 2019 05:01:38 +0000 (13:01 +0800)]
avfilter/buffersrc: deprecate sws_param option

4 years agoavfilter/af_crystalizer: add support for commands
Paul B Mahol [Sun, 29 Dec 2019 14:31:11 +0000 (15:31 +0100)]
avfilter/af_crystalizer: add support for commands

4 years agoavfilter/af_crystalizer: add timeline support
Paul B Mahol [Sun, 29 Dec 2019 14:28:53 +0000 (15:28 +0100)]
avfilter/af_crystalizer: add timeline support

4 years agoavfilter/vf_waveform: add support for 12bit yuva formats
Paul B Mahol [Sun, 29 Dec 2019 11:18:44 +0000 (12:18 +0100)]
avfilter/vf_waveform: add support for 12bit yuva formats

4 years agoavfilter/vf_vectorscope: add support for 12bit yuva formats
Paul B Mahol [Sun, 29 Dec 2019 11:13:21 +0000 (12:13 +0100)]
avfilter/vf_vectorscope: add support for 12bit yuva formats

4 years agoavfilter/vf_histogram: add support for 12bit yuva formats
Paul B Mahol [Sun, 29 Dec 2019 11:09:21 +0000 (12:09 +0100)]
avfilter/vf_histogram: add support for 12bit yuva formats

4 years agoavfilter/vf_histogram: reindent after previous commit
Paul B Mahol [Thu, 26 Dec 2019 20:22:26 +0000 (21:22 +0100)]
avfilter/vf_histogram: reindent after previous commit

4 years agoavfilter: add thistogram video filter
Paul B Mahol [Thu, 26 Dec 2019 10:38:53 +0000 (11:38 +0100)]
avfilter: add thistogram video filter

4 years agolavc/qsv: remove the unused funtion ff_qsv_profile_to_mfx()
Zhong Li [Sat, 28 Dec 2019 14:58:02 +0000 (22:58 +0800)]
lavc/qsv: remove the unused funtion ff_qsv_profile_to_mfx()

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavc/qsvdec: disable gpu copy when not supported
Zhong Li [Sat, 28 Dec 2019 14:28:45 +0000 (22:28 +0800)]
lavc/qsvdec: disable gpu copy when not supported

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavc/qsvdec: fix the error retrun code in ff_qsv_get_continuous_buffer()
Zhong Li [Sat, 28 Dec 2019 14:22:07 +0000 (22:22 +0800)]
lavc/qsvdec: fix the error retrun code in ff_qsv_get_continuous_buffer()

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agoavformat/matroskadec: Fix lzo decompression
Andreas Rheinhardt [Sat, 28 Dec 2019 02:40:33 +0000 (03:40 +0100)]
avformat/matroskadec: Fix lzo decompression

When a Matroska Block is only stored in compressed form, the size of
the uncompressed block is not explicitly coded and therefore not known
before decompressing it. Therefore the demuxer uses a guess for the
uncompressed size: The first guess is three times the compressed size
and if this is not enough, it is repeatedly incremented by a factor of
three. But when this happens with lzo, the decompression is neither
resumed nor started again. Instead when av_lzo1x_decode indicates that x
bytes of input data could not be decoded, because the output buffer is
already full, the first (not the last) x bytes of the input buffer are
resent for decoding in the next try; they overwrite already decoded
data.

This commit fixes this by instead restarting the decompression anew,
just with a bigger buffer.

This seems to be a regression since 935ec5a1.

A FATE-test for this has been added.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agofate/matroska: Add test for ProRes and bz2 compression
Andreas Rheinhardt [Sat, 28 Dec 2019 02:40:32 +0000 (03:40 +0100)]
fate/matroska: Add test for ProRes and bz2 compression

This test tests that demuxing ProRes that is muxed like it should be in
Matroska (i.e. with the first header ("icpf") atom stripped away) works;
it also tests bz2 decompression as well as the handling of
unknown-length clusters.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_vectorscope: use av_clip_uint8()
James Almer [Sun, 29 Dec 2019 01:38:52 +0000 (22:38 -0300)]
avfilter/vf_vectorscope: use av_clip_uint8()

Fixes fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_waveform: implement tint options
Paul B Mahol [Sat, 28 Dec 2019 18:50:33 +0000 (19:50 +0100)]
avfilter/vf_waveform: implement tint options

4 years agoavfilter/vf_vectorscope: improve tint output for gbrp formats
Paul B Mahol [Sat, 28 Dec 2019 19:25:37 +0000 (20:25 +0100)]
avfilter/vf_vectorscope: improve tint output for gbrp formats

4 years agofftools/ffmpeg_opt: Add a missing closing brackets.
Carl Eugen Hoyos [Sat, 28 Dec 2019 19:11:01 +0000 (20:11 +0100)]
fftools/ffmpeg_opt: Add a missing closing brackets.

Fixes ticket #8447.

4 years agoavfilter/vf_vectorscope: rename gray mode to tint mode
Paul B Mahol [Sat, 28 Dec 2019 12:27:46 +0000 (13:27 +0100)]
avfilter/vf_vectorscope: rename gray mode to tint mode

4 years agoavfilter/vf_vectorscope: add invert graticule
Paul B Mahol [Sat, 28 Dec 2019 11:31:04 +0000 (12:31 +0100)]
avfilter/vf_vectorscope: add invert graticule

4 years agoavfilter/vf_vectorscope: use enum for graticule items
Paul B Mahol [Sat, 28 Dec 2019 10:08:22 +0000 (11:08 +0100)]
avfilter/vf_vectorscope: use enum for graticule items

4 years agoavfilter/vf_geq: Add support for reading sample sums and means of rectangles
Michael Niedermayer [Fri, 6 Dec 2019 12:49:15 +0000 (13:49 +0100)]
avfilter/vf_geq: Add support for reading sample sums and means of rectangles

This allows integrating box blur style filters in geq.

Without this computing the mean of an area in geq would have been excessivly slow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_geq: Add NB_PLANES
Michael Niedermayer [Fri, 6 Dec 2019 12:11:59 +0000 (13:11 +0100)]
avfilter/vf_geq: Add NB_PLANES

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()
Michael Niedermayer [Fri, 6 Dec 2019 16:18:16 +0000 (17:18 +0100)]
avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1dec: Fix "return -1" cases
Michael Niedermayer [Mon, 16 Dec 2019 23:04:23 +0000 (00:04 +0100)]
avcodec/vc1dec: Fix "return -1" cases

Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1dec: Free sprite_output_frame on error
Michael Niedermayer [Mon, 16 Dec 2019 22:31:22 +0000 (23:31 +0100)]
avcodec/vc1dec: Free sprite_output_frame on error

Fixes: memleaks
Fixes: 19471/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5688035714269184
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_geq: Relicense to LGPL
Michael Niedermayer [Mon, 16 Dec 2019 22:17:11 +0000 (23:17 +0100)]
avfilter/vf_geq: Relicense to LGPL

All authors who have code in this under GPL agreed.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/atrac9dec: Clamp band_ext_data to max that can be read if skipped.
Michael Niedermayer [Mon, 16 Dec 2019 23:19:42 +0000 (00:19 +0100)]
avcodec/atrac9dec: Clamp band_ext_data to max that can be read if skipped.

Fixes: out of array read
Fixes: 19327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5679823087468544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/agm: Include block size in the MV check for flags == 3
Michael Niedermayer [Mon, 16 Dec 2019 22:09:04 +0000 (23:09 +0100)]
avcodec/agm: Include block size in the MV check for flags == 3

Fixes: out of array read
Fixes: 19331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5644115983466496
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/wmadec: Keep track of exponent initialization per channel
Michael Niedermayer [Sat, 30 Nov 2019 15:46:46 +0000 (16:46 +0100)]
avcodec/wmadec: Keep track of exponent initialization per channel

Fixes: division by 0
Fixes: 19123/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5655493121146880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/iff: Check that video_size is large enough for the read parameters
Michael Niedermayer [Sat, 30 Nov 2019 11:22:25 +0000 (12:22 +0100)]
avcodec/iff: Check that video_size is large enough for the read parameters

video is allocated before parameters like bpp are read.

Fixes: out of array access
Fixes: 19084/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5718556033679360
Fixes: 19465/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5759908398235648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/v4l2_m2m_enc: Check encoder pix_fmt matches pix_fmt on device
Andriy Gelman [Fri, 27 Dec 2019 23:38:35 +0000 (18:38 -0500)]
avcodec/v4l2_m2m_enc: Check encoder pix_fmt matches pix_fmt on device

Fixes #8079

During initialization of a v4l2m2m device, the configured pix_fmt can be
different to the pix_fmt of the encoder (i.e. avctx->pix_fmt).

For example on the Odroid XU4:
./ffmpeg -f lavfi -i yuvtestsrc -codec:v h264_v4l2m2m out.h264

will configure the v4l2 encoder to pix_fmt nv21, whereas the input
frames will be yuv444p.

This commit checks that the configured v4l2 pix_fmt on device is the
same as avctx->pix_fmt. If they are different the initialization fails
and an error is returned. Tested on RPI4 and Odroid XU4.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavutil/tests/opt: add av_opt_get/av_opt_set tests
Marton Balint [Wed, 25 Dec 2019 20:07:41 +0000 (21:07 +0100)]
avutil/tests/opt: add av_opt_get/av_opt_set tests

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavutil/tests/opt: add tests for AV_OPT_TYPE_DICT
Marton Balint [Wed, 25 Dec 2019 18:35:34 +0000 (19:35 +0100)]
avutil/tests/opt: add tests for AV_OPT_TYPE_DICT

Signed-off-by: Marton Balint <cus@passwd.hu>