Commit Graph

96480 Commits

Author SHA1 Message Date
Derek Buitenhuis a2d3511154 lavc/ffv1: Properly check that the 4th and 5th quant tables are zeroes
Currently, the decoder checks the 128th value of the 4th quant table during
while deriving the context on each sample, in order to speed itself up. This
is due to relying on the behavior of FFmpeg's FFV1 encoder, in which if that
value is zero, the entire 4th and 5th quant tables are assumed to be entirely
zero.

This does not match the FFV1 spec, which has no such restriction, and after
some discussion, it was decided to fix FFmpeg to abide by the spec, rather
than change the spec.

We will now check whether the 4th and 5th quant tables are zero properly,
by checking the 128th valye of both tables (which means they are zero due
to the way they're coded in the bitstream).

For further context, the FFV1 issue in question is located at:

    https://github.com/FFmpeg/FFV1/issues/169

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-01-06 00:06:03 +00:00
Ulrich Spörlein 60d599e217 libavformat: fix spelling in ID3v1 genres and extend the list of Winamp extensions.
Sources include various lists on the Internet, as well as the current
Wikipedia page at
https://en.wikipedia.org/w/index.php?title=List_of_ID3v1_Genres&oldid=896774343
but most importantly the list as used by taglib at
3e60e339a4 (diff-f86455366624350770f41b4940925dde)

Further patches to harmonize the spelling have been sent to taglib and
libid3tag. See also https://github.com/taglib/taglib/pull/942/

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-05 20:31:42 +01:00
Michael Niedermayer b0a718923b avcodec/pgssubdec: Free subtitle on error
Fixes: Assertion failure
Fixes: 19753/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGSSUB_fuzzer-5688461843759104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-05 20:31:42 +01:00
Gyan Doshi 8aa3c09c1b doc/volume: correct placement of replaygain_noclip
In the merge commit 878f8b0d26, entry for replaygain_noclip
was placed in commands, which it is not, instead of among
the options.
2020-01-05 21:46:08 +05:30
Paul B Mahol e26d66daaa avfilter/af_dynaudnorm: use already available pointer
Instead of dereferencing same thing again.
2020-01-05 10:22:57 +01:00
Paul B Mahol 1187dbb7e9 avfilter/af_dynaudnorm: move channels variable setup first 2020-01-05 10:20:27 +01:00
Gyan Doshi 5d82c078ea ffmpeg: don't force source-tracked keyframes for duplicates
Prevents a run of consecutive duplicate frames from all being encoded
as keyframes, when force_key_frames is set to source.
2020-01-05 12:01:46 +05:30
Gyan Doshi fa3ad7bbc6 ffmpeg: remove premature rescaling of forced_keyframe times
The user-set forced KF times are parsed *after* this deleted
loop and rescaled right after parsing.
2020-01-05 10:55:36 +05:30
Gyan Doshi fa677750de doc/ffmpeg: document value source for -force_key_frames
Also clarify behaviour in case of specified timestamps
2020-01-05 10:53:46 +05:30
Sebastian Pop c3a17ffff6 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>
2020-01-04 20:59:31 +01:00
Limin Wang ebbc976ae6 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>
2020-01-04 20:59:31 +01:00
Carl Eugen Hoyos f7c945abc0 doc: Fix a typo. 2020-01-04 20:58:10 +01:00
Jun Zhao 304eaa63a9 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>
2020-01-04 19:37:39 +01:00
Paul B Mahol 389865352d 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.
2020-01-04 19:34:50 +01:00
Paul B Mahol c8253cb332 avfilter/af_dynaudnorm: implement threshold option 2020-01-04 18:17:32 +01:00
Paul B Mahol 6a1305e8b7 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.
2020-01-04 10:27:46 +01:00
Jun Zhao 3c8da7b982 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>
2020-01-04 09:05:23 +08:00
Jun Zhao c8e72a6494 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>
2020-01-04 09:05:09 +08:00
Jun Zhao cf9c9a9db9 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>
2020-01-04 09:04:58 +08:00
Jun Zhao 0099f71502 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>
2020-01-04 09:03:30 +08:00
Marton Balint 944203270d 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>
2020-01-03 18:13:22 +01:00
Marton Balint 2b7097ef27 avdevice/decklink_dec: remove -bm_v210 option
Deprecated since Sep 28, 2017.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 18:13:22 +01:00
Marton Balint 78a233e6e9 avdevice/decklink_dec: remove the @mode syntax
Deprecated since March 28, 2017.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 18:13:22 +01:00
Marton Balint d111a41f9d 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>
2020-01-03 11:23:55 +01:00
Marton Balint beb7f93b23 avformat/img2enc: minor simplification
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 11:23:55 +01:00
Marton Balint 57df8839e1 avformat/img2enc: cleanup IO contexts on error
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 11:23:55 +01:00
Marton Balint 43d5ddb4b5 avformat/img2enc: reindent after last commit
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 11:23:55 +01:00
Marton Balint 04e36fc4e1 avformat/img2enc: factorize piped write_packet
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 11:23:55 +01:00
Marton Balint b693b06b22 avformat/img2enc: factorize writing fully muxed file
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 11:23:55 +01:00
Marton Balint bc17b831dd doc/muxers: fix order of options and examples for image2 muxer
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-03 11:23:55 +01:00
Paul B Mahol 81172b5e3a avfilter/af_dynaudnorm: fix previous commit
We still need to analyze frame for amplification at EOF.
2020-01-02 17:24:01 +01:00
Paul B Mahol ed02563ce0 avfilter/af_dynaudnorm: do not enqueue flush buffers 2020-01-02 16:28:38 +01:00
Zhong Li 12c4d00c10 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 9cb150c9ab

Should also fix ticket #8442.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-01-02 13:29:46 +01:00
Timo Rothenpieler d4996a600c avcodec/nvdec_mpeg12: set field flags 2020-01-02 13:15:27 +01:00
Marton Balint e47a954631 avcodec/librav1e: use AV_OPT_TYPE_DICT for rav1e-params
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 21:22:11 +01:00
Marton Balint a613d042e7 avcodec/libxavs2: use AV_OPT_TYPE_DICT for xavs2-params
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 21:22:11 +01:00
Marton Balint 91f64ea4c5 avcodec/libx265: use AV_OPT_TYPE_DICT for x265-params
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 21:22:09 +01:00
Marton Balint dfea6d2e50 avcodec/libx264: use AV_OPT_TYPE_DICT for x264-params
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 20:41:34 +01:00
Marton Balint 9ac1066dc6 avcodec/libvpxenc: use AV_OPT_TYPE_DICT for ts-parameters
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 20:41:34 +01:00
Marton Balint 710e9f3f18 avformat/tee: use AV_OPT_TYPE_DICT for fifo_options
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 20:41:34 +01:00
Marton Balint 7c3125133f avformat/segment: use AV_OPT_TYPE_DICT for segment_format_options
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 20:41:34 +01:00
Marton Balint 5d35a6e8e2 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>
2020-01-01 20:41:34 +01:00
Marton Balint f20bdbff6d avformat/fifo: use AV_OPT_TYPE_DICT for format_opts
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 20:41:34 +01:00
Marton Balint 59172164f3 avformat/dashenc: use AV_OPT_TYPE_DICT for format_options
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-01 20:41:34 +01:00
James Almer 3670a10c2d avcodec/libx265: export encoded frame stats
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 66b6005301894823052b437a950003ffbe3ba6de)
2020-01-01 13:50:39 -03:00
James Almer 278a91f8fe 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>
2020-01-01 13:48:02 -03:00
James Almer 3c22436ddf 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>
2020-01-01 13:25:18 -03:00
Andreas Rheinhardt 40d9cbdc22 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>
2020-01-01 16:38:28 +01:00
Andreas Rheinhardt 34e3810b04 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>
2020-01-01 16:38:28 +01:00
Andreas Rheinhardt 2968da7d9e 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>
2020-01-01 16:38:28 +01:00