]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agoavformat/mxfenc: add Coding Equations and Color Primaries to local tags
Marton Balint [Mon, 25 Jan 2021 21:04:05 +0000 (22:04 +0100)]
avformat/mxfenc: add Coding Equations and Color Primaries to local tags

Fixes ticket #9079.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavcodec/h261dec: Make VLC smaller
Andreas Rheinhardt [Tue, 29 Dec 2020 21:09:10 +0000 (22:09 +0100)]
avcodec/h261dec: Make VLC smaller

The VLC for the macroblock address increment uses nine bits;
yet there is no code with this length: All codes are either shorter or
longer. So one can make the table smaller without changing the amount of
codes that need more than one round of parsing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoRevert "mpeg4videodec: raise an error if sprite_trajectory.table is NULL"
Andreas Rheinhardt [Sat, 23 Jan 2021 16:52:52 +0000 (17:52 +0100)]
Revert "mpeg4videodec: raise an error if sprite_trajectory.table is NULL"

This reverts commit 6ac0e7818399a57e4684202bac79f35b3561ad1e.

The mpeg4video parser can reach code that presumes that a certain VLC
has been initialized; yet Libav did not ensure this and Libav bug #1012
[1] is about an ensuing crash.

Instead of fixing the root cause a simple check for whether said VLC
has already been initialized was added; said check is inherently racy.

The proper fix is of course to ensure that the VLC is initialized and
commit 7c76eaeca2791261d3f4f5c98c95f44abdbd879a already ensured this,
so there was no need to merge 6ac0e7818399a57e4684202bac79f35b3561ad1e
at all. This commit therefore reverts said commit.

[1]: https://bugzilla.libav.org/show_bug.cgi?id=1012

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/url: Reorder elements of URLProtocol to make it smaller
Andreas Rheinhardt [Sun, 24 Jan 2021 11:19:03 +0000 (12:19 +0100)]
avformat/url: Reorder elements of URLProtocol to make it smaller

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/avidec: Simplify compile-time check for DV demuxer
Andreas Rheinhardt [Tue, 26 Jan 2021 13:18:11 +0000 (14:18 +0100)]
avformat/avidec: Simplify compile-time check for DV demuxer

1b373b41d940e3058cdfb3d17703e23ed665353c made it a bit harder to find
out that a call to avpriv_dv_produce_packet is dead when the DV demuxer
is disabled; too hard for GCC on -O0. So simplify the check a bit.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter: add colortemperature filter
Paul B Mahol [Mon, 25 Jan 2021 19:22:14 +0000 (20:22 +0100)]
avfilter: add colortemperature filter

3 years agoavfilter: add kirsch video filter
Paul B Mahol [Sat, 23 Jan 2021 13:54:51 +0000 (14:54 +0100)]
avfilter: add kirsch video filter

3 years agodoc/filters: mention that shear filter supports commands
Paul B Mahol [Wed, 27 Jan 2021 10:40:05 +0000 (11:40 +0100)]
doc/filters: mention that shear filter supports commands

3 years agolibavutil/frame.h: correct typo for AVFilmGrainParams in comment
Guo, Yejun [Wed, 27 Jan 2021 05:13:12 +0000 (13:13 +0800)]
libavutil/frame.h: correct typo for AVFilmGrainParams in comment

3 years agoavcodec/sei: add Parameter Sets Inclusion Indication enum value
James Almer [Fri, 22 Jan 2021 19:30:51 +0000 (16:30 -0300)]
avcodec/sei: add Parameter Sets Inclusion Indication enum value

Defined in H.274, it shares the same value as Active Parameter Sets from the
H.265 spec.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavfilter/vf_colorchannelmixer: extend pl option functionality
Paul B Mahol [Tue, 26 Jan 2021 23:33:56 +0000 (00:33 +0100)]
avfilter/vf_colorchannelmixer: extend pl option functionality

3 years agoavfilter/vf_lenscorrection: remove unused elements
Paul B Mahol [Tue, 26 Jan 2021 19:05:01 +0000 (20:05 +0100)]
avfilter/vf_lenscorrection: remove unused elements

3 years agoavfilter/vf_lenscorrection: reduce overhead calling execute for every plane
Paul B Mahol [Tue, 26 Jan 2021 19:02:41 +0000 (20:02 +0100)]
avfilter/vf_lenscorrection: reduce overhead calling execute for every plane

3 years agoavfilter/vf_lenscorrection: add support for commands
Paul B Mahol [Tue, 26 Jan 2021 18:43:03 +0000 (19:43 +0100)]
avfilter/vf_lenscorrection: add support for commands

3 years agoavcodec/cri: Fix whitespace issue in unpack_10bit()
Michael Niedermayer [Tue, 26 Jan 2021 18:52:10 +0000 (19:52 +0100)]
avcodec/cri: Fix whitespace issue in unpack_10bit()

Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/realtextdec: Avoid undefined overflow in the end of read_ts()
Michael Niedermayer [Sat, 16 Jan 2021 22:37:41 +0000 (23:37 +0100)]
avformat/realtextdec: Avoid undefined overflow in the end of read_ts()

Fixes: signed integer overflow: 234080282628234040 * 100 cannot be represented in type 'long long'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_REALTEXT_fuzzer-6649867065753600
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/nutdec: Fix integer overflow in count computation
Michael Niedermayer [Sat, 16 Jan 2021 21:44:33 +0000 (22:44 +0100)]
avformat/nutdec: Fix integer overflow in count computation

Note, the value is checked a few lines later already

Fixes: signed integer overflow: -440402016 - 1879048064 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6603876618469376
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mvi: Use 64bit for testing dimensions
Michael Niedermayer [Sat, 16 Jan 2021 21:20:37 +0000 (22:20 +0100)]
avformat/mvi: Use 64bit for testing dimensions

Fixes: signed integer overflow: 65535 * 65535 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MVI_fuzzer-6649291124899840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Check dts in update_initial_timestamps() more
Michael Niedermayer [Sat, 16 Jan 2021 21:05:53 +0000 (22:05 +0100)]
avformat/utils: Check dts in update_initial_timestamps() more

Fixes: signed integer overflow: -9223372036853488158 - 90000000 cannot be represented in type 'long long'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MPSUB_fuzzer-6696625298866176
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mpsubdec: Use av_sat_add/sub64() in fracval handling
Michael Niedermayer [Sat, 16 Jan 2021 20:48:57 +0000 (21:48 +0100)]
avformat/mpsubdec: Use av_sat_add/sub64() in fracval handling

Fixes: signed integer overflow: 9223372036850000000 + 9000000 cannot be represented in type 'long long'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MPSUB_fuzzer-665448017480908
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvdec: Check for avio_read() failure in amf_get_string()
Michael Niedermayer [Tue, 26 Jan 2021 16:41:28 +0000 (17:41 +0100)]
avformat/flvdec: Check for avio_read() failure in amf_get_string()

Suggested-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvdec: Check for nesting depth in amf_skip_tag()
Michael Niedermayer [Sat, 23 Jan 2021 21:00:40 +0000 (22:00 +0100)]
avformat/flvdec: Check for nesting depth in amf_skip_tag()

Fixes: out of array access
Fixes: 29440/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5985279812960256.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvdec: Check for nesting depth in amf_parse_object()
Michael Niedermayer [Sat, 23 Jan 2021 20:20:57 +0000 (21:20 +0100)]
avformat/flvdec: Check for nesting depth in amf_parse_object()

Fixes: out of array access
Fixes: 29202/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5112845840809984
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/apedec: Use FFABSU() in do_apply_filter()
Michael Niedermayer [Wed, 20 Jan 2021 23:07:46 +0000 (00:07 +0100)]
avcodec/apedec: Use FFABSU() in do_apply_filter()

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 29053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4814432697974784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/common: Add FFABSU() for a signed -> unsigned ABS
Michael Niedermayer [Sat, 23 Jan 2021 15:22:33 +0000 (16:22 +0100)]
avutil/common: Add FFABSU() for a signed -> unsigned ABS

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/vf_unsharp: Remove unnecessary ;
Andreas Rheinhardt [Sun, 24 Jan 2021 21:26:06 +0000 (22:26 +0100)]
avfilter/vf_unsharp: Remove unnecessary ;

A macro that expands to a function definition might look like a
declaration, but it isn't and therefore an extra ';' at the end is
unnecessary and actually invalid (both GCC and Clang warn about this
when using -pedantic).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolavc: shedule old encoding/decoding API for removal
Anton Khirnov [Mon, 25 Jan 2021 11:03:44 +0000 (12:03 +0100)]
lavc: shedule old encoding/decoding API for removal

It has been deprecated for 4 years and certain new codecs do not work
with it.

Also include AVCodecContext.refcounted_frames, as it has no effect with
the new API.

3 years agolavc/decode: move unrefcount_frame() right before its only caller
Anton Khirnov [Mon, 25 Jan 2021 10:55:32 +0000 (11:55 +0100)]
lavc/decode: move unrefcount_frame() right before its only caller

Will make wrapping it in deprecation guards simpler.

3 years agotools/target_dec_fuzzer: use non-obsolete decoding API
Anton Khirnov [Sat, 12 Dec 2020 15:38:10 +0000 (16:38 +0100)]
tools/target_dec_fuzzer: use non-obsolete decoding API

3 years agoavcodec/mpeg4videodec: Fix indentation
Andreas Rheinhardt [Sat, 23 Jan 2021 16:24:33 +0000 (17:24 +0100)]
avcodec/mpeg4videodec: Fix indentation

It was wrong since e03bf251d8784f4d1df2c22381c902087e151e31.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpeg4videodec: Move code around to avoid forward declaration
Andreas Rheinhardt [Sat, 23 Jan 2021 16:19:00 +0000 (17:19 +0100)]
avcodec/mpeg4videodec: Move code around to avoid forward declaration

Also fix the indentation of decode_studio_vol_header while at it;
it was wrong since 177133a0f4b41b3c98b9cbc7f8f45755412c537b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/sp5x: Remove unused quant tables
Andreas Rheinhardt [Sat, 23 Jan 2021 15:54:51 +0000 (16:54 +0100)]
avcodec/sp5x: Remove unused quant tables

Only the fifth one is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/exif: Avoid allocation for small buffer
Andreas Rheinhardt [Sat, 23 Jan 2021 14:44:50 +0000 (15:44 +0100)]
avcodec/exif: Avoid allocation for small buffer

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/amrnbdata: Remove unused array
Andreas Rheinhardt [Sat, 23 Jan 2021 13:45:24 +0000 (14:45 +0100)]
avcodec/amrnbdata: Remove unused array

Always unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/ilbcdata: Remove unused array
Andreas Rheinhardt [Sat, 23 Jan 2021 13:29:52 +0000 (14:29 +0100)]
avcodec/ilbcdata: Remove unused array

Never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/atrac3plus_data: Remove unused arrays
Andreas Rheinhardt [Sat, 23 Jan 2021 13:28:21 +0000 (14:28 +0100)]
avcodec/atrac3plus_data: Remove unused arrays

Forgotten in 58fc810d42fde26ed6c1f2996122e98ab7005849.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dnxhd: Make ff_dxnhd_get_cid_table return a pointer, not index
Andreas Rheinhardt [Fri, 22 Jan 2021 21:47:27 +0000 (22:47 +0100)]
avcodec/dnxhd: Make ff_dxnhd_get_cid_table return a pointer, not index

All callers only use the index into ff_dnxhd_cid_table to get a pointer
to the desired entry.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter: add shear video filter
Paul B Mahol [Sat, 23 Jan 2021 10:21:47 +0000 (11:21 +0100)]
avfilter: add shear video filter

3 years agoavdevice/dshow: Add namespace prefix to the remaining global symbols
James Almer [Thu, 21 Jan 2021 22:45:48 +0000 (19:45 -0300)]
avdevice/dshow: Add namespace prefix to the remaining global symbols

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec: deprecate AVCodecContext.debug_mv
James Almer [Sun, 24 Jan 2021 23:45:18 +0000 (20:45 -0300)]
avcodec: deprecate AVCodecContext.debug_mv

It's been unused for almost three years now.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec: remove long dead debug_mv code
James Almer [Sun, 24 Jan 2021 22:34:56 +0000 (19:34 -0300)]
avcodec: remove long dead debug_mv code

FF_API_DEBUG_MV has been zero since ffmpeg 4.0

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/dolby_e: split decoder and parser more thoroughly
James Almer [Mon, 25 Jan 2021 14:29:27 +0000 (11:29 -0300)]
avcodec/dolby_e: split decoder and parser more thoroughly

Neither module should depend on the other.

Move shared functions to its own file for this purpose, and ensure
source files are compiled only when the required modules are enabled.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agofate/hlsenc: rework the ffprobe dependency of hls-fmp4_ac3
James Almer [Sun, 24 Jan 2021 21:33:23 +0000 (18:33 -0300)]
fate/hlsenc: rework the ffprobe dependency of hls-fmp4_ac3

Add it to the existing FATE_SAMPLES_FFMPEG_FFPROBE list of ffprobe dependant
tests instead.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/h263data, ituh263*: Make initializing RL inter table thread-safe
Andreas Rheinhardt [Wed, 2 Dec 2020 02:26:41 +0000 (03:26 +0100)]
avcodec/h263data, ituh263*: Make initializing RL inter table thread-safe

Up until now, ff_h263_rl_inter was initialized by both ituh263dec and
ituh263enc; this is an obstacle in making the codecs that use this code
init-threadsafe.

This obstacle is eliminated by only initializing this RLTable from
a single place that is guarded by a dedicated AVOnce.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/ituh263enc: Remove unused function parameter
Andreas Rheinhardt [Wed, 2 Dec 2020 00:08:32 +0000 (01:08 +0100)]
avcodec/ituh263enc: Remove unused function parameter

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/ituh263dec: Don't initialize unused parts of RLTable
Andreas Rheinhardt [Wed, 9 Dec 2020 17:09:00 +0000 (18:09 +0100)]
avcodec/ituh263dec: Don't initialize unused parts of RLTable

The RLTable ff_rl_intra_aic is only used by ituh263dec and ituh263enc;
the former only uses the RLTable's VLC, the latter only index_run,
max_level and max_run. Yet ituh263dec also initializes the latter.
This commit stops doing so.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/h261enc: Make encoder init-threadsafe
Andreas Rheinhardt [Wed, 9 Dec 2020 12:13:33 +0000 (13:13 +0100)]
avcodec/h261enc: Make encoder init-threadsafe

This is easy now that the H.261 encoder is the only user that
initializes the non-VLC parts of ff_h261_rl_tcoeff.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/h261dec: Reindentation
Andreas Rheinhardt [Mon, 23 Nov 2020 02:34:49 +0000 (03:34 +0100)]
avcodec/h261dec: Reindentation

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/h261dec: Make decoder init-threadsafe
Andreas Rheinhardt [Mon, 23 Nov 2020 02:34:23 +0000 (03:34 +0100)]
avcodec/h261dec: Make decoder init-threadsafe

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/h261dec: Don't initialize unused part of RLTable
Andreas Rheinhardt [Wed, 9 Dec 2020 11:54:12 +0000 (12:54 +0100)]
avcodec/h261dec: Don't initialize unused part of RLTable

The H.261 decoder only uses an RLTable's VLC table, yet it also
initializes its index_run, max_level and max_run. This commit stops
doing so; it will also simplify making this decoder init-threadsafe,
as the H.261 decoder and encoder now initialize disjoint parts of their
common RLTable.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpegvideo_enc: Make mpv_encode_defaults thread-safe
Andreas Rheinhardt [Wed, 9 Dec 2020 03:24:44 +0000 (04:24 +0100)]
avcodec/mpegvideo_enc: Make mpv_encode_defaults thread-safe

This is a prerequisite for making any encoder that uses
ff_mpv_encode_init() init-threadsafe; it already makes the AMV,
the MJPEG and the MPEG-1/2 encoders init-threadsafe.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/msmpeg4dec: Reuse identical MV VLC
Andreas Rheinhardt [Wed, 9 Dec 2020 01:47:48 +0000 (02:47 +0100)]
avcodec/msmpeg4dec: Reuse identical MV VLC

msmpeg4dec and ituh263dec both create VLCs with identical parameters out
of ff_mvtab. Given that ff_msmpeg4_decode_init() always (indirectly) calls
ff_h263_decode_init_vlc(), the VLC initialized by the latter can be
directly used by msmpeg4dec. Doing so saves a bit more than 2KB from the
.bss segment as well as the code to initialize a VLC.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/msmpeg4dec: Reuse identical RL VLCs
Andreas Rheinhardt [Wed, 9 Dec 2020 00:41:31 +0000 (01:41 +0100)]
avcodec/msmpeg4dec: Reuse identical RL VLCs

Some of the RLTables used by msmpeg4dec actually coincide with other
RLTables: ff_rl_table[5] coincides with ff_h263_rl_inter (and
ff_rl_table[2] with ff_mpeg4_rl_intra). Given that ff_h263_rl_inter is
always initialized before msmpeg4dec's RLTables are initialized, one can
just reuse the VLC tables by copying the pointers; after all, there are
no ownership issues for static data. This saves 70912B from the .bss
segment, translating into actual memory savings when this decoder is
actually used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/ituh263dec: Don't initialize unused RL VLCs
Andreas Rheinhardt [Wed, 9 Dec 2020 00:11:40 +0000 (01:11 +0100)]
avcodec/ituh263dec: Don't initialize unused RL VLCs

The ff_rl_intra_aic RLTable is only used by ituh263dec and ituh263enc;
the former is the only user of its RL VLC tables. It uses only the very
first one of these VLC tables, but up until now all 32 are initialized,
wasting 68696B from the .bss segment (or that amount of memory if this
decoder has actually been used). This commit changes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpeg4videodec: Don't initialize unused RL VLCs
Andreas Rheinhardt [Tue, 8 Dec 2020 22:32:35 +0000 (23:32 +0100)]
avcodec/mpeg4videodec: Don't initialize unused RL VLCs

The RLTables whose VLC tables are only used for intra blocks only use
the very first VLC table; yet all 32 have been initialized. This commit
stops this by switching to INIT_FIRST_VLC_RL. This saves 201624B from
the .bss segment; in case the decoder is actually used, this translates
into less memory used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/msmpeg4dec: Don't initialize unused RL VLCs
Andreas Rheinhardt [Tue, 8 Dec 2020 22:08:56 +0000 (23:08 +0100)]
avcodec/msmpeg4dec: Don't initialize unused RL VLCs

For the RLTables ff_rl_table[0..2] only the very first VLC is only ever
used, so it makes no sense to create 32 of them. This saves 285200B from
the .bss segment; this amount of memory is actually saved when this
decoder is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/h261dec: Don't initialize unused VLCs
Andreas Rheinhardt [Tue, 8 Dec 2020 21:51:25 +0000 (22:51 +0100)]
avcodec/h261dec: Don't initialize unused VLCs

The H.261 decoder uses only the very first VLC of ff_h261_rl_tcoeff,
so only initialize this one. Saves 68448B from the .bss segment; in case
the decoder is actually used, this amount of memory is saved.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/rl: Allow to create only a few VLC tables
Andreas Rheinhardt [Tue, 8 Dec 2020 21:38:05 +0000 (22:38 +0100)]
avcodec/rl: Allow to create only a few VLC tables

It is not uncommon that only the first one is used; this is similar to
ff_init_2d_vlc_rl().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpeg12enc, speedhqenc: Avoid redundant copies of tables
Andreas Rheinhardt [Tue, 8 Dec 2020 20:28:25 +0000 (21:28 +0100)]
avcodec/mpeg12enc, speedhqenc: Avoid redundant copies of tables

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dolby_e: Split decoder/parser files
Nicolas Gaullier [Mon, 25 Jan 2021 12:11:37 +0000 (13:11 +0100)]
avcodec/dolby_e: Split decoder/parser files

3 years agoavcodec/dolby_e: Add a parser
Nicolas Gaullier [Mon, 25 Jan 2021 12:11:36 +0000 (13:11 +0100)]
avcodec/dolby_e: Add a parser

3 years agoavfilter/vf_lenscorrection: allow to change colors of unmapped pixels
Paul B Mahol [Mon, 25 Jan 2021 11:28:28 +0000 (12:28 +0100)]
avfilter/vf_lenscorrection: allow to change colors of unmapped pixels

3 years agoavfilter/vf_lenscorrection: add >8 depth support
Paul B Mahol [Mon, 25 Jan 2021 11:01:49 +0000 (12:01 +0100)]
avfilter/vf_lenscorrection: add >8 depth support

3 years agoavfilter/vf_lenscorrection: fix far edges with nearest interpolation
Paul B Mahol [Mon, 25 Jan 2021 10:38:58 +0000 (11:38 +0100)]
avfilter/vf_lenscorrection: fix far edges with nearest interpolation

3 years agolavf/http: treat 308 as 301
Robin Cooksey [Wed, 13 Jan 2021 15:27:50 +0000 (15:27 +0000)]
lavf/http: treat 308 as 301

FFmpeg does not support POST, so there is no difference between a
308 and 301 request (see [RFC7538] section 3).

Signed-off-by: Josh Dekker <josh@itanimul.li>
3 years agocheckasm: add hevc_pel tests
Josh Dekker [Thu, 7 Jan 2021 12:10:20 +0000 (13:10 +0100)]
checkasm: add hevc_pel tests

Co-authored-by: Niklas Haas <git@haasn.xyz>
Signed-off-by: Josh Dekker <josh@itanimul.li>
3 years agoconfigure: add fallback to $arch in msvc assembler check.
Reimar Döffinger [Sat, 23 Jan 2021 12:52:41 +0000 (13:52 +0100)]
configure: add fallback to $arch in msvc assembler check.

Setting the defaults for $arch happens only later, so
the current code would not set AS correctly if --arch
was not specified on the command-line.
Fix it by adding an explicit fallback to $arch_default.

Signed-off-by: Josh Dekker <josh@itanimul.li>
3 years agoavformat/asfdec_o: Check for EOF in asf_read_marker()
Michael Niedermayer [Tue, 19 Jan 2021 23:00:27 +0000 (00:00 +0100)]
avformat/asfdec_o: Check for EOF in asf_read_marker()

Fixes: Timeout
Fixes: 26460/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5710884393189376
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter: add epx pixel art scaler
Paul B Mahol [Fri, 22 Jan 2021 18:54:52 +0000 (19:54 +0100)]
avfilter: add epx pixel art scaler

3 years agoavfilter/vf_lenscorrection: add support for more 8-bit formats
Paul B Mahol [Sun, 24 Jan 2021 23:43:31 +0000 (00:43 +0100)]
avfilter/vf_lenscorrection: add support for more 8-bit formats

3 years agoavfilter/vf_lenscorrection: add timeline support
Paul B Mahol [Sun, 24 Jan 2021 23:38:41 +0000 (00:38 +0100)]
avfilter/vf_lenscorrection: add timeline support

3 years agoavfilter/vf_lenscorrection: add bilinear interpolation
Paul B Mahol [Sun, 24 Jan 2021 22:43:11 +0000 (23:43 +0100)]
avfilter/vf_lenscorrection: add bilinear interpolation

3 years agoavfilter/vf_lenscorrection: simplify options
Paul B Mahol [Sun, 24 Jan 2021 11:18:09 +0000 (12:18 +0100)]
avfilter/vf_lenscorrection: simplify options

3 years agoavcodec/tiff_common: Remove declarations of inexistent functions
Andreas Rheinhardt [Sat, 23 Jan 2021 14:27:57 +0000 (15:27 +0100)]
avcodec/tiff_common: Remove declarations of inexistent functions

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/vp8data: Remove unused array
Andreas Rheinhardt [Sat, 23 Jan 2021 13:33:59 +0000 (14:33 +0100)]
avcodec/vp8data: Remove unused array

Unused since 748f921ad1997a464fb8963d0ba2c5bb5e036b1b.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_nnedi: Fix segfault when prescreening is disabled
Andreas Rheinhardt [Sun, 24 Jan 2021 20:56:36 +0000 (21:56 +0100)]
avfilter/vf_nnedi: Fix segfault when prescreening is disabled

Since c737f6edcef74a64f4d0ebcefa970bd31266d512 prescreening is
nevertheless run because of a wrong check: "if (s->prescreen > 0)".
s->prescreen is an array of two function pointers that is contained in
the context and comparing it with 0 (i.e. NULL) is actually undefined
behaviour, because NULL and s->prescreen do not point to the same
object (NULL after all never points to any object). Nevertheless both
Clang as well as GCC compile this to code that treat s->prescreen > 0 as
true, leading to segfaults, because the code then tries to access the
-1th member of an array.

This commit fixes the check as well as another such check a few lines
below.

(Found via compiler warnings enabled by -pedantic:
"ordered comparison between pointer and zero is an extension".)

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolsws/ppc/yuv2rgb: Fix transparency converting from yuv->rgb32.
Carl Eugen Hoyos [Sat, 23 Jan 2021 18:33:13 +0000 (19:33 +0100)]
lsws/ppc/yuv2rgb: Fix transparency converting from yuv->rgb32.

Based on 68363b69 by Reimar Döffinger.

Fixes ticket #9077.

3 years agotests/fate/fits: Add a todo for a 64bit test.
Carl Eugen Hoyos [Sun, 24 Jan 2021 16:13:19 +0000 (17:13 +0100)]
tests/fate/fits: Add a todo for a 64bit test.

The test should currently fail on big endian but passes because of the
unsuitable input file.

3 years agotests/fate/hlsenc: ffprobe is needed for hls-fmp4_ac3.
Carl Eugen Hoyos [Sun, 24 Jan 2021 16:12:05 +0000 (17:12 +0100)]
tests/fate/hlsenc: ffprobe is needed for hls-fmp4_ac3.

3 years agoavfilter/avfilter: Remove AVFilterLink.flags
Andreas Rheinhardt [Sun, 24 Jan 2021 11:21:14 +0000 (12:21 +0100)]
avfilter/avfilter: Remove AVFilterLink.flags

It is a private field that is unused since
44f660e7e75b856eafa5f7e7cc6e633de5d01b5d.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/rtpdec: Constify RTPDynamicProtocolHandlers
Andreas Rheinhardt [Wed, 30 Dec 2020 12:39:09 +0000 (13:39 +0100)]
avformat/rtpdec: Constify RTPDynamicProtocolHandlers

Also constify the list of pointers to said RTPDynamicProtocolHandlers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/rtpdec: Remove next pointer from Protocol Handlers
Andreas Rheinhardt [Wed, 30 Dec 2020 12:31:46 +0000 (13:31 +0100)]
avformat/rtpdec: Remove next pointer from Protocol Handlers

Forgotten in 61974537610d82bd35b6e3ac91ccd270c6bdc711 (notice that
RTPDynamicProtocolHandler is not a public struct, so one can remove
the linked-list pointer immediately (unlike in most other patches of
this kind)).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/hlsenc: EXT-X-I-FRAMES-ONLY requires version 4 or higher
Zhao Zhili [Fri, 15 Jan 2021 16:47:41 +0000 (00:47 +0800)]
avformat/hlsenc: EXT-X-I-FRAMES-ONLY requires version 4 or higher

3 years agoavformat/hls: change sequence number type to int64_t
Zhao Zhili [Sat, 16 Jan 2021 03:40:36 +0000 (11:40 +0800)]
avformat/hls: change sequence number type to int64_t

Fix atoi() overflow for large EXT-X-MEDIA-SEQUENCE.

The spec says the type of sequence number is uint64_t. Use int64_t
here since current implementation requires it to be signed integer,
and hlsenc use int64_t too.

3 years agoavfilter/vf_waveform: flat_pix_fmts never used
Peter Ross [Tue, 5 Jan 2021 02:54:53 +0000 (13:54 +1100)]
avfilter/vf_waveform: flat_pix_fmts never used

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dvenc: dv100_weight_shift never used
Peter Ross [Tue, 5 Jan 2021 02:54:22 +0000 (13:54 +1100)]
avcodec/dvenc: dv100_weight_shift never used

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_colorchannelmixer: add option to preserve lightness
Paul B Mahol [Sat, 23 Jan 2021 21:01:46 +0000 (22:01 +0100)]
avfilter/vf_colorchannelmixer: add option to preserve lightness

3 years agoavcodec/flashsv2enc: factorize updating block dimensions
Marton Balint [Tue, 6 Oct 2020 23:39:43 +0000 (01:39 +0200)]
avcodec/flashsv2enc: factorize updating block dimensions

The patch changes the init function to initialize block dimensions to fixed
64x64 instead of the previously used image width/height based value.

This should not cause any actual change in behaviour because block dimensions
are recalculated on every keyframe in optimum_block_width() and
optimum_block_height() functions and in the current code the result is always
64x64 regardless of the image dimensions used.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/swf: add support for reading and writing VP6A and Flash Screen Video codecs
Marton Balint [Wed, 7 Oct 2020 20:21:27 +0000 (22:21 +0200)]
avformat/swf: add support for reading and writing VP6A and Flash Screen Video codecs

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/swfenc: add support for muxing png images
Marton Balint [Sat, 28 Sep 2019 20:58:52 +0000 (22:58 +0200)]
avformat/swfenc: add support for muxing png images

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/swfenc: fix generation of FileAttributes tag
Marton Balint [Sat, 28 Sep 2019 21:05:21 +0000 (23:05 +0200)]
avformat/swfenc: fix generation of FileAttributes tag

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavfilter/af_astats: fix possible crash because of undefined float to integer rounding
Marton Balint [Sun, 10 Jan 2021 23:12:39 +0000 (00:12 +0100)]
avfilter/af_astats: fix possible crash because of undefined float to integer rounding

Fixes ticket #9049.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoRevert "avutil/timecode: fix sscanf format string with garbage at the end"
Marton Balint [Sat, 16 Jan 2021 08:42:01 +0000 (09:42 +0100)]
Revert "avutil/timecode: fix sscanf format string with garbage at the end"

This reverts commit 6696a07ac62bfec49dd488510a719367918b9f7a.

It is wrong to restrict timecodes to always contain leading zeros or for hours
or frames to be 2 chars only.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoqsv: dump more info in error, debug and verbose mode
Haihao Xiang [Tue, 5 Jan 2021 07:02:56 +0000 (15:02 +0800)]
qsv: dump more info in error, debug and verbose mode

Dump iopattern mode and the SDK error/warning desciptions for qsv based
filters and iopattern mode for qsvenc

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com
3 years agolavf/qsv: Add functions to print mfx iopattern, warning and error
Haihao Xiang [Tue, 5 Jan 2021 07:02:55 +0000 (15:02 +0800)]
lavf/qsv: Add functions to print mfx iopattern, warning and error

It is a copy of the relevant part in lavc/qsv but use different function
names to avoid multiple definition when linking lavc and lavf statically.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com
3 years agoavcodec/qsvdec: refact, remove duplicate code for plugin loading
Xu Guangxin [Tue, 5 Jan 2021 02:43:42 +0000 (10:43 +0800)]
avcodec/qsvdec: refact, remove duplicate code for plugin loading

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
3 years agoavcodec/qsvdec: refact, move qsvdec_other.c to qsvdec.c
Xu Guangxin [Tue, 5 Jan 2021 02:43:41 +0000 (10:43 +0800)]
avcodec/qsvdec: refact, move qsvdec_other.c to qsvdec.c

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
3 years agoavcodec/qsvdec: refact, move qsvdec_h2645.c to qsvdec.c
Xu Guangxin [Tue, 5 Jan 2021 02:43:40 +0000 (10:43 +0800)]
avcodec/qsvdec: refact, move qsvdec_h2645.c to qsvdec.c

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
3 years agoavcodec/qsvdec_h2645: refact, use DEFINE_QSV_DECODER to remove duplicate code
Xu Guangxin [Tue, 5 Jan 2021 02:43:39 +0000 (10:43 +0800)]
avcodec/qsvdec_h2645: refact, use DEFINE_QSV_DECODER to remove duplicate code

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
3 years agoavcodec/qsvdec_other: refact, use DEFINE_QSV_DECODER to remove duplicate code
Xu Guangxin [Tue, 5 Jan 2021 02:43:38 +0000 (10:43 +0800)]
avcodec/qsvdec_other: refact, use DEFINE_QSV_DECODER to remove duplicate code

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>