]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavformat/hlsenc: Fix check for presence of webvtt muxer
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:15 +0000 (01:04 +0100)]
avformat/hlsenc: Fix check for presence of webvtt muxer

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix memleaks with repeating parameters
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:13 +0000 (01:04 +0100)]
avformat/hlsenc: Fix memleaks with repeating parameters

When a parameter like e.g. language is contained more than once in the
part of var_stream_map pertaining to a single VariantStream, the later
one just overwrites the pointer to the earlier one, leading to a
memleak. This commit changes this by handling the situation gracefully:
The earlier string is silently freed first, so that the last one wins.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix return value from localtime_r failure
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:12 +0000 (01:04 +0100)]
avformat/hlsenc: Fix return value from localtime_r failure

"If an error is detected, localtime_r() shall return a null pointer
and set errno to indicate the error." Yet in case this happened in
hls_init(), AVERROR(ENOMEM) has been returned.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix potential segfault upon allocation failure
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:09 +0000 (01:04 +0100)]
avformat/hlsenc: Fix potential segfault upon allocation failure

The hls muxer allocates an array of VariantStreams, a structure that
contains pointers to objects that need to be freed on their own. This
means that the number of allocated VariantStreams needs to be correct
when they are freed; yet the number of VariantStreams is set in
update_variant_stream_info() resp. parse_variant_stream_mapstring()
before the allocation has been checked for success, so that upon error
an attempt would be made to free the objects whose pointers are
positioned at position NULL (the location of VariantStreams) +
offsetof(VariantStream, the corresponding pointer).

Furthermore d1fe1344 added another possibility for the first function
to leave an inconsistent state behind: If an allocation of one of the
objects referenced by the VariantStream fails, the VariantStream will be
freed, but the number of allocated VariantStreams isn't reset, leading
to the same problem as above. (This was done in the mistaken belief that
the VariantStreams array would leak otherwise.)

Essentially the same also happens for the number of cc-streams. It has
been fixed, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix leak of options when writing packets
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:07 +0000 (01:04 +0100)]
avformat/hlsenc: Fix leak of options when writing packets

Under certain circumstances hls_write_packet() would add options to an
AVDictionary. Said dictionary was never explicitly freed, instead it was
presumed that these options would be consumed when opening a new
IO-context. This left several possibilities for memleaks:

a) When no new IO-context would be opened at all. This is possible when
using both the flags temp_file and single_file together with a file
output.
b) When an error happens before one actually tries to open the new
IO-context.
c) When the new IO-context does not consume all options.

All three have been fixed; furthermore, the AVDictionary has been put
into a smaller scope (namely the only part of hls_write_packet() where
it is actually used).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix leak of options when initializing muxing fails
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:06 +0000 (01:04 +0100)]
avformat/hlsenc: Fix leak of options when initializing muxing fails

hls_mux_init() currently leaks an AVDictionary if opening a dynamic
buffer fails or if avformat_init_output fails. This has been fixed by
moving the initialization resp. the freeing of the dictionary around:
In the former case to a place after opening the dynamic buffer, in the
latter to a place before the check for initialization failure so that it
is done unconditionally.

Furthermore, the dictionary is now only copied and freed if the options
in it are actually used (namely when in SEGMENT_TYPE_FMP4 mode).

Finally, a similar situation in hls_start() has been fixed, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Only allocate when data is known to be needed
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:05 +0000 (01:04 +0100)]
avformat/hlsenc: Only allocate when data is known to be needed

hls_init() would allocate a buffer, although it is only needed in one of
two branches that follow. This commit moves the allocation to the branch
that actually needs the buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix typo in error message
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:04 +0000 (01:04 +0100)]
avformat/hlsenc: Fix typo in error message

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix leak of child AVFormatContext
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:03 +0000 (01:04 +0100)]
avformat/hlsenc: Fix leak of child AVFormatContext

Before ed897633, the hls muxer would free its child AVFormatContexts
and reset the pointer to these contexts to NULL immediately afterwards;
ed897633 moved the former to later (into a separate function), but kept
the resetting, ensuring that the child context leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agofftools/cmdutils: Fix break command dump for -map option
Jun Zhao [Thu, 12 Dec 2019 08:02:53 +0000 (16:02 +0800)]
fftools/cmdutils: Fix break command dump for -map option

Before this fix, ffmpeg -h full | grep map get the command dump
like:

-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_s  set input stream mapping
                                                               ^
                                                               |
    truncated
after this fix, we can get full option dump.

Found-by: vacingfang <vacingfang@tencent.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavcodec/hevcdec: keep closed captions in sync between multiple thread contexts
James Almer [Fri, 20 Dec 2019 17:05:42 +0000 (14:05 -0300)]
avcodec/hevcdec: keep closed captions in sync between multiple thread contexts

Based on h264 code.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/af_adeclick: implement timeline support
Paul B Mahol [Sat, 21 Dec 2019 19:02:04 +0000 (20:02 +0100)]
avfilter/af_adeclick: implement timeline support

4 years agoavformat/movenc: use iso6 major brand when signed CTS offsets are used in trun boxes
James Almer [Sun, 1 Dec 2019 16:11:28 +0000 (13:11 -0300)]
avformat/movenc: use iso6 major brand when signed CTS offsets are used in trun boxes

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/movenc: ensure we don't write the major brand as a compatible brand more...
James Almer [Sun, 1 Dec 2019 16:10:48 +0000 (13:10 -0300)]
avformat/movenc: ensure we don't write the major brand as a compatible brand more than once

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/movenc: write the major brand also as the first compatible brand
James Almer [Wed, 27 Nov 2019 17:15:34 +0000 (14:15 -0300)]
avformat/movenc: write the major brand also as the first compatible brand

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agofftools/ffmpeg: Reindent after last commit
Nicolas Gaullier [Thu, 19 Dec 2019 16:43:22 +0000 (17:43 +0100)]
fftools/ffmpeg: Reindent after last commit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/icecast: Use AV_DICT_DONT_STRDUP_VAL to save an av_strdup
Andreas Rheinhardt [Sun, 10 Nov 2019 04:07:30 +0000 (05:07 +0100)]
avformat/icecast: Use AV_DICT_DONT_STRDUP_VAL to save an av_strdup

This will probably also fix CID 1452559, a false positive where Coverity
claims a double-free occurs, because it thinks that av_dict_set() frees
its key and value arguments even when the AV_DICT_DONT_STRDUP_* flags
aren't used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agofftools/ffmpeg: Fix forward CPB props in to out
Nicolas Gaullier [Thu, 19 Dec 2019 16:43:21 +0000 (17:43 +0100)]
fftools/ffmpeg: Fix forward CPB props in to out

CPB side_data is copied when stream-copying (see init_output_stream_streamcopy()),
but it shall not be copied when the stream is decoded.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_readeia608: if parity bit check fails, set correct value
Paul B Mahol [Sat, 21 Dec 2019 11:11:38 +0000 (12:11 +0100)]
avfilter/vf_readeia608: if parity bit check fails, set correct value

As described in U.S. Federal Register, Volume 56, Number 114, June 13, 1991, pages 27204-27205.

4 years agoavcodec/h264_sei: fix the size of user data unregistered
Limin Wang [Thu, 19 Dec 2019 05:09:06 +0000 (13:09 +0800)]
avcodec/h264_sei: fix the size of user data unregistered

According to the specifications, the payloadSize includes the 16-byte size of UUID.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agodoc/encoders: correct the description for ts_target_bitrate
Wonkap Jang [Wed, 18 Dec 2019 21:17:00 +0000 (13:17 -0800)]
doc/encoders: correct the description for ts_target_bitrate

ts_target_bitrate is in kbps, not bps. This commit clarifies the unit
and modifies the example to match the description.

Signed-off-by: James Zern <jzern@google.com>
4 years agoavfilter/vf_readeia608: rewrite processing, make extracting more robust
Paul B Mahol [Tue, 17 Dec 2019 18:47:55 +0000 (19:47 +0100)]
avfilter/vf_readeia608: rewrite processing, make extracting more robust

Lots of options are now obsolete.

4 years agoavcodec/hevc_sei: switch to AVBufferRef buffer for a53 caption
Limin Wang [Fri, 20 Dec 2019 01:17:21 +0000 (09:17 +0800)]
avcodec/hevc_sei: switch to AVBufferRef buffer for a53 caption

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/icecast: Free the right buffer on error
Andreas Rheinhardt [Sun, 10 Nov 2019 04:07:29 +0000 (05:07 +0100)]
avformat/icecast: Free the right buffer on error

In case an AVBPrint was not complete, icecast_open() would free some
buffers that have not been allocated yet instead of freeing the data of
the AVBPrint (if they have been allocated). Because this error does not
trigger a jump to the general cleanup section any more, one can moreover
remove a (now unnecessary) initialization of a pointer.

Furthermore, finalizing an AVBPrint can fail (namely when the string
inside the AVBPrint has not been allocated yet) and so this needs to be
checked.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/tls_openssl: don't use libcrypto locking functions with newer OpenSSL versions
James Almer [Wed, 11 Dec 2019 16:11:59 +0000 (13:11 -0300)]
avformat/tls_openssl: don't use libcrypto locking functions with newer OpenSSL versions

They have been removed altogether without a compat implementation, and are
either no-ops or return NULL.
This fixes compiler warnings about checks always evaluating to false, and leaks
of allocated mutexes.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/cbs_av1: add missing valid range of values for num_cb_points and num_cr_points
James Almer [Thu, 12 Dec 2019 01:39:56 +0000 (22:39 -0300)]
avcodec/cbs_av1: add missing valid range of values for num_cb_points and num_cr_points

It is a requirement of bitstream conformance that num_cr_points is less than or equal to 10.
It is a requirement of bitstream conformance that num_cb_points is less than or equal to 10.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agocheckasm: aacpsdsp: Tolerate extra intermediate precision in stereo_interpolate
Martin Storsjö [Wed, 4 Dec 2019 11:04:41 +0000 (13:04 +0200)]
checkasm: aacpsdsp: Tolerate extra intermediate precision in stereo_interpolate

The stereo_interpolate functions add h_step to the values h
BUF_SIZE times. Within the stereo_interpolate C functions, the
values h (h0-h3, h00-h13) are declared as local float variables,
but the compiler is free to keep them in a register with extra
precision.

If the accumulation is rounded to 32 bit float precision after
each step, the less significant bits of h_step end up ignored
and the sum can deviate, affecting the end result more than
the currently set EPS.

By clearing the log2(BUF_SIZE) lower bits of h_step, we make sure
that the accumulation shouldn't differ significantly, regardless
of any extra precision in the accmulating register/variable.

This fixes the aacpsdsp checkasm test when built with clang for
mingw/x86_32.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoffprobe: Fix fate tests for ffprobe in cases where TARGET_PATH differs from the curre...
Martin Storsjö [Mon, 2 Dec 2019 09:16:25 +0000 (11:16 +0200)]
ffprobe: Fix fate tests for ffprobe in cases where TARGET_PATH differs from the current path

In these cases, we must pass the full path of the file to ffprobe
(as the current working dir on the remote system, e.g. when invoked
with "ssh remote ffprobe ..." isn't the wanted one).

The input filename passed to ffprobe is also included in the output,
which is part of the reference test data. Add a new option to
ffprobe to allow overriding what path is printed, to keep the
original relative path in the tests.

An alternative approach could be an option to allow requesting omitting
the file name from the dumped data, and updating the test references
accordingly.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoswscale/aarch64: use multiply accumulate and increase vector factor to 4
Sebastian Pop [Sun, 17 Nov 2019 20:13:13 +0000 (14:13 -0600)]
swscale/aarch64: use multiply accumulate and increase vector factor to 4

This patch implements ff_hscale_8_to_15_neon with NEON fused multiply accumulate
and bumps the vectorization factor from 2 to 4.
The speedup is of 25% on Graviton1 A1 instances based on A-72 cpus:

$ ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf bench=start,scale=1024x1024,bench=stop -f null -
before: t:0.040303 avg:0.040287 max:0.040371 min:0.039214
after:  t:0.032168 avg:0.032215 max:0.033081 min:0.032146

The speedup is of 39% on Graviton2 m6g instances based on Neoverse-N1 cpus:
$ ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf bench=start,scale=1024x1024,bench=stop -f null -
before: t:0.019446 avg:0.019423 max:0.019493 min:0.019181
after:  t:0.014015 avg:0.014096 max:0.015018 min:0.013971

Tested with `make check` on aarch64-linux.

Signed-off-by: Sebastian Pop <spop@amazon.com>
Reviewed-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/h264dec.h: remove unused ff_h264_decode_slice_header
Linjie Fu [Tue, 17 Dec 2019 08:57:33 +0000 (16:57 +0800)]
lavc/h264dec.h: remove unused ff_h264_decode_slice_header

Once removed in 4a9bab3db0d9ec449ebc8b5e823374d1d1df7761.

Introduced again in b25cd7540e7.

Signed-off-by: Linjie Fu <fulinjie@zju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoFATE/hevc.mak: cosmetic for fate-hevc-paired-fields
Linjie Fu [Fri, 13 Dec 2019 17:55:31 +0000 (01:55 +0800)]
FATE/hevc.mak: cosmetic for fate-hevc-paired-fields

Adjust the order of fate-hevc-paired-fields.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoFATE: add test for hevc files with 4 TUDepth(0..4) of cbf_cb/cbf_cr
Linjie Fu [Fri, 13 Dec 2019 17:54:13 +0000 (01:54 +0800)]
FATE: add test for hevc files with 4 TUDepth(0..4) of cbf_cb/cbf_cr

5 cabac states for cbf_cb and cbf_cr are supported according to
Table 9-4.

Add a test for 64x64 4:4:4 8bit HEVC clips with TUDepth = 4, cbf_cr > 0.

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agolavc/hevc_cabac: fix cbf_cb and cbf_cr for transform depth 4
Linjie Fu [Wed, 11 Dec 2019 08:47:38 +0000 (16:47 +0800)]
lavc/hevc_cabac: fix cbf_cb and cbf_cr for transform depth 4

The max transform depth is 5(from 0 to 4), so we need 5 cabac states for
cbf_cb and cbf_cr.

See Table 9-4 for details.

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agovc2enc: zero padding of the coefficient buffer
Lynne [Tue, 17 Dec 2019 14:56:33 +0000 (14:56 +0000)]
vc2enc: zero padding of the coefficient buffer

Wavelet types with large amounts of overreading/writing like 9_7 would
write into the padding at high wavelet depths, which would remain and be
read by the next frame's transform and quickly cause artifacts to appear
for subsequent frames.
This fix affects all frames encoded with a non-power-of-two width, with
the artifacts varying between non-observable to very noticeable,
depending on encoder settings, so reencoding is advisable.

4 years agoavfilter/vf_stack: set framerate to VFR when inputs frame rates differs
Paul B Mahol [Tue, 17 Dec 2019 12:28:27 +0000 (13:28 +0100)]
avfilter/vf_stack: set framerate to VFR when inputs frame rates differs

4 years agofate: Add an option for disabling the 2k/4k tests
Martin Storsjö [Mon, 2 Dec 2019 21:57:11 +0000 (23:57 +0200)]
fate: Add an option for disabling the 2k/4k tests

When testing on a memory limited system, these tests consume a
significant amount of memory and can often fail if testing by running
multiple processes in parallel.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavc/vaapi_encode: grow packet if vaMapBuffer returns multiple buffers
Linjie Fu [Fri, 31 May 2019 00:34:31 +0000 (20:34 -0400)]
lavc/vaapi_encode: grow packet if vaMapBuffer returns multiple buffers

Currently, assigning new buffer for pkt when multiple buffers were returned
from vaMapBuffer will overwrite the previous encoded pkt data and lead
to encode issues.

Iterate through the buf_list first to find out the total buffer size
needed for the pkt, allocate the whole pkt to avoid repeated reallocation
and memcpy, then copy data from each buf to pkt.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoavfilter: Add tonemap vaapi filter for H2S
Xinpeng Sun [Mon, 2 Dec 2019 07:17:29 +0000 (15:17 +0800)]
avfilter: Add tonemap vaapi filter for H2S

It performs HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion
with tone-mapping. It only supports HDR10 as input temporarily.

An example command to use this filter with vaapi codecs:
FFMPEG -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi \
-i INPUT -vf 'tonemap_vaapi=format=p010' -c:v hevc_vaapi -profile 2 OUTPUT

Signed-off-by: Xinpeng Sun <xinpeng.sun@intel.com>
Signed-off-by: Zachary Zhou <zachary.zhou@intel.com>
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
4 years agolavc/allcodecs: Add mpeg4 omx encoder, missed in 0e387232
Carl Eugen Hoyos [Mon, 16 Dec 2019 21:45:34 +0000 (22:45 +0100)]
lavc/allcodecs: Add mpeg4 omx encoder, missed in 0e387232

4 years agolavu/log: Also print the log level for level trace.
Carl Eugen Hoyos [Mon, 16 Dec 2019 12:08:40 +0000 (13:08 +0100)]
lavu/log: Also print the log level for level trace.

4 years agolavc/cbs_h2645_syntax_template: Fix memleak
Andriy Gelman [Fri, 6 Dec 2019 19:22:14 +0000 (14:22 -0500)]
lavc/cbs_h2645_syntax_template: Fix memleak

payload_count is used to track the number of SEI payloads. It is also
used to free the SEIs in cbs_h264_free_sei()/cbs_h265_free_sei().

Currently, payload_count is set after for loop is completed. Hence if
there is an error and the function exits, the payload remains zero
causing a memleak.

This commit keeps track of payload_count inside the for loop to fix the
issue. Note that that the contents of current are initialized with
av_mallocz() so there is no need to zero initialize payload_count.

Found-by: libFuzzer
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoh264_mp4toannexb: Remove unnecessary check
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:13 +0000 (23:19 +0100)]
h264_mp4toannexb: Remove unnecessary check

There can be at most 31 SPS and 255 PPS in the mp4/Matroska extradata.
Given that each has a size of at most 2^16-1, the length of the output
derived from these parameter sets can never overflow an ordinary 32 bit
integer. So use a simple uint32_t instead of uint64_t and replace the
unnecessary check with an av_assert1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/adpcm: Clip predictor for APC
Michael Niedermayer [Thu, 21 Nov 2019 22:02:56 +0000 (23:02 +0100)]
avcodec/adpcm: Clip predictor for APC

Fixes: signed integer overflow: -2147483648 - 13 cannot be represented in type 'int'
Fixes: 18893/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APC_fuzzer-5630760442920960
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/targa: Check colors vs. available space
Michael Niedermayer [Thu, 21 Nov 2019 21:43:01 +0000 (22:43 +0100)]
avcodec/targa: Check colors vs. available space

Fixes: Timeout (37sec -> 52ms)
Fixes: 18892/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TARGA_fuzzer-5739537854889984
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 agotools/target_dec_fuzzer: Adjust threshold for dst
Michael Niedermayer [Sat, 23 Nov 2019 15:36:02 +0000 (16:36 +0100)]
tools/target_dec_fuzzer: Adjust threshold for dst

Fixes: Timeout (400sec -> 14sec)
Fixes: 18989/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5175008116867072
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/dstdec: Use get_ur_golomb_jpegls()
Michael Niedermayer [Mon, 30 Sep 2019 22:43:03 +0000 (00:43 +0200)]
avcodec/dstdec: Use get_ur_golomb_jpegls()

Fixes: shift exponent -4 is negative
Fixes: 17793/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5766088435957760
Fixes: 18989/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5175008116867072
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/wmavoice: Check remaining input in parse_packet_header()
Michael Niedermayer [Sat, 23 Nov 2019 08:18:12 +0000 (09:18 +0100)]
avcodec/wmavoice: Check remaining input in parse_packet_header()

Fixes: Infinite loop
Fixes: 18914/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5731902946541568
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/wmalosslessdec: Fix 2 overflows in mclms
Michael Niedermayer [Wed, 20 Nov 2019 21:05:40 +0000 (22:05 +0100)]
avcodec/wmalosslessdec: Fix 2 overflows in mclms

Fixes: signed integer overflow: 2038337026 + 109343477 cannot be represented in type 'int'
Fixes: 18886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5673660505653248
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/decode: Fix integer overflow in max_samples check
Michael Niedermayer [Wed, 20 Nov 2019 20:13:01 +0000 (21:13 +0100)]
avcodec/decode: Fix integer overflow in max_samples check

Fixes: signed integer overflow: 1677721600 * 32 cannot be represented in type 'int'
Fixes: 18885/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5741242185154560
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/wmaprodec: Fixes integer overflow with 32bit samples
Michael Niedermayer [Wed, 20 Nov 2019 19:34:55 +0000 (20:34 +0100)]
avcodec/wmaprodec: Fixes integer overflow with 32bit samples

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 18860/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAPRO_fuzzer-5755223125786624
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/adpcm: Fix invalid shift in xa_decode()
Michael Niedermayer [Wed, 20 Nov 2019 18:13:09 +0000 (19:13 +0100)]
avcodec/adpcm: Fix invalid shift in xa_decode()

Fixes: left shift of negative value -1
Fixes: 18859/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XA_fuzzer-5748474213040128
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/wmavoice: Add FF_CODEC_CAP_INIT_CLEANUP
Michael Niedermayer [Mon, 18 Nov 2019 13:41:54 +0000 (14:41 +0100)]
avcodec/wmavoice: Add FF_CODEC_CAP_INIT_CLEANUP

Fixes: memleaks
Fixes: 18855/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5687647317524480
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/wmalosslessdec: Fix several integer issues
Michael Niedermayer [Mon, 18 Nov 2019 13:22:57 +0000 (14:22 +0100)]
avcodec/wmalosslessdec: Fix several integer issues

Fixes: shift exponent -1 is negative (and others)
Fixes: 18852/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5660855295541248
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/wmalosslessdec: Check that padding bits is not more than sample bits
Michael Niedermayer [Mon, 18 Nov 2019 11:49:25 +0000 (12:49 +0100)]
avcodec/wmalosslessdec: Check that padding bits is not more than sample bits

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 18817/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5713317180211200
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: Skip overflowing runs in decode_delta_d()
Michael Niedermayer [Mon, 18 Nov 2019 08:45:29 +0000 (09:45 +0100)]
avcodec/iff: Skip overflowing runs in decode_delta_d()

Fixes: Timeout (107sec - 75ms>
Fixes: 18812/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-6295585225441280
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/apedec: Set error on error in ape_decode_value_3860()
Michael Niedermayer [Mon, 18 Nov 2019 07:51:20 +0000 (08:51 +0100)]
avcodec/apedec: Set error on error in ape_decode_value_3860()

Fixes: Timeout (unknown -> 15sec)
Fixes: 18808/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5677586072207360
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/pnm: Check that the header is not truncated
Michael Niedermayer [Sat, 14 Dec 2019 18:19:57 +0000 (19:19 +0100)]
avcodec/pnm: Check that the header is not truncated

Fixes: Ticket8430
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mp3_header_decompress_bsf: Check sample_rate_index
Michael Niedermayer [Fri, 13 Dec 2019 23:37:27 +0000 (00:37 +0100)]
avcodec/mp3_header_decompress_bsf: Check sample_rate_index

Fixes: out of array read
Fixes: 19309/clusterfuzz-testcase-minimized-ffmpeg_BSF_MP3_HEADER_DECOMPRESS_fuzzer-5651002950942720
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>
4 years agoavfilter/x86/vf_interlace: always use unaligned movs
Marton Balint [Fri, 6 Dec 2019 22:01:27 +0000 (23:01 +0100)]
avfilter/x86/vf_interlace: always use unaligned movs

Fixes crashes in command lines such as:

ffmpeg -f lavfi -i testsrc2=704x576:r=50,interlace,pad=720:576:8 -f null none

Related to ticket #6491.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_interlace: do not interlace already interlaced frames
Marton Balint [Fri, 6 Dec 2019 10:02:36 +0000 (11:02 +0100)]
avfilter/vf_interlace: do not interlace already interlaced frames

The filter used to work this way before it was merged into tinterlace.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_tinterlace: add support for bypassing already interlaced frames
Marton Balint [Fri, 6 Dec 2019 10:01:11 +0000 (11:01 +0100)]
avfilter/vf_tinterlace: add support for bypassing already interlaced frames

The old interlace filter worked this way before it was merged with tinterlace.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_interlace: restore lowpass mode constants
Marton Balint [Fri, 6 Dec 2019 09:35:41 +0000 (10:35 +0100)]
avfilter/vf_interlace: restore lowpass mode constants

The documentation still mentions numerical constants in addition to textual
ones. It is also wrong to use distinct modes as flags and it disallows us to
actually use the flags field for real flags in the future.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agolavu/pixfmt: Cosmetics, remove wrong end-of-comment markers.
Carl Eugen Hoyos [Sat, 14 Dec 2019 15:09:41 +0000 (16:09 +0100)]
lavu/pixfmt: Cosmetics, remove wrong end-of-comment markers.

4 years agolavc/pnmdec: Fix 16bit decoding.
Carl Eugen Hoyos [Fri, 13 Dec 2019 18:10:15 +0000 (19:10 +0100)]
lavc/pnmdec: Fix 16bit decoding.

Regression since cdb5479c
Reported by irc user tTh from Mixart-Myrys

4 years agoavcodec/simple_idct_template: fix integer overflow
Paul B Mahol [Fri, 13 Dec 2019 14:21:19 +0000 (15:21 +0100)]
avcodec/simple_idct_template: fix integer overflow

4 years agoavcodec/cbs_av1_syntax_template: Check num_y_points
Michael Niedermayer [Wed, 11 Dec 2019 21:03:50 +0000 (22:03 +0100)]
avcodec/cbs_av1_syntax_template: Check num_y_points

"It is a requirement of bitstream conformance that num_y_points is less than or equal to 14."

Fixes: index 24 out of bounds for type 'uint8_t [24]'
Fixes: 19282/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_FRAME_MERGE_fuzzer-5747424845103104
Note, also needs a23dd33606d5

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: jamrial
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoconvert_from_tensorflow.py: add support when kernel size is 1*1 with one input/output...
Guo, Yejun [Fri, 22 Nov 2019 07:50:04 +0000 (15:50 +0800)]
convert_from_tensorflow.py: add support when kernel size is 1*1 with one input/output channel (gray image)

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agoavfilter/vf_dnn_processing: refine code for better naming
Guo, Yejun [Fri, 22 Nov 2019 07:49:57 +0000 (15:49 +0800)]
avfilter/vf_dnn_processing: refine code for better naming

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agofate/cbs: use the rawvideo muxer for AV1 tests
James Almer [Thu, 12 Dec 2019 01:14:22 +0000 (22:14 -0300)]
fate/cbs: use the rawvideo muxer for AV1 tests

The IVF muxer autoinserts the av1_metadata filter unconditionally, which is
not desirable for these tests.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_datascope: add decimal output
Paul B Mahol [Fri, 13 Dec 2019 11:47:51 +0000 (12:47 +0100)]
avfilter/vf_datascope: add decimal output

4 years agoconfigure: Check for the SetDllDirectory and GetModuleHandle functions
Martin Storsjö [Wed, 11 Dec 2019 20:53:28 +0000 (22:53 +0200)]
configure: Check for the SetDllDirectory and GetModuleHandle functions

These functions aren't available when building for the restricted
UWP/WinRT/WinStore API subsets.

Normally when building in this mode, one is probably only building
the libraries, but being able to build ffmpeg.exe still is useful
(and a ffmpeg.exe targeting these API subsets still can be run
e.g. in wine, for testing).

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agocheckasm: af_afir: Use a dynamic tolerance depending on values
Martin Storsjö [Wed, 11 Dec 2019 09:15:11 +0000 (11:15 +0200)]
checkasm: af_afir: Use a dynamic tolerance depending on values

As the values generated by av_bmg_get can be arbitrarily large
(only the stddev is specified), we can't use a fixed tolerance.
Calculate a dynamic tolerance (like in float_dsp from 38f966b2222db),
based on the individual steps of the calculation.

This fixes running this test with certain seeds, when built with
clang for mingw/x86_32.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavfilter: Fix type in av_log for random_seed in cellauto and life
Michael Niedermayer [Sat, 7 Dec 2019 09:24:04 +0000 (10:24 +0100)]
avfilter: Fix type in av_log for random_seed in cellauto and life

Fixes CID 1456556 / 1456555

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/v210dec: move the stride read after its fully initialized
Michael Niedermayer [Sun, 1 Dec 2019 22:26:47 +0000 (23:26 +0100)]
avcodec/v210dec: move the stride read after its fully initialized

Fixes: out of array read
Fixes: 19129/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_V210_fuzzer-5068171023482880
Maybe fixes: 19130/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_V210_fuzzer-5637264407527424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/utils.c: fix code indentations
Linjie Fu [Wed, 11 Dec 2019 08:52:01 +0000 (16:52 +0800)]
lavc/utils.c: fix code indentations

Introduced since 4b4a02b8.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/mips: simplify the switch code
Linjie Fu [Wed, 11 Dec 2019 08:48:03 +0000 (16:48 +0800)]
lavc/mips: simplify the switch code

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat: Don't free old extradata before ff_alloc/get_extradata
Andreas Rheinhardt [Wed, 11 Dec 2019 11:21:07 +0000 (12:21 +0100)]
avformat: Don't free old extradata before ff_alloc/get_extradata

These functions already free it themselves before they allocate the new
extradata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat: Forward errors where possible
Andreas Rheinhardt [Tue, 10 Dec 2019 21:59:53 +0000 (22:59 +0100)]
avformat: Forward errors where possible

It is not uncommon to find code where the caller thinks to know better
what the return value should be than the callee. E.g. something like
"if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit
changes several instances of this to instead forward the actual error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/rtpdec_hevc: Don't reimplement ff_alloc_extradata
Andreas Rheinhardt [Tue, 10 Dec 2019 21:59:52 +0000 (22:59 +0100)]
avformat/rtpdec_hevc: Don't reimplement ff_alloc_extradata

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/apngdec: Don't free extradata manually
Andreas Rheinhardt [Tue, 10 Dec 2019 21:59:47 +0000 (22:59 +0100)]
avformat/apngdec: Don't free extradata manually

The extradata will be freed automatically when the corresponding stream
gets freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/apngdec: Make sure that extradata is zero-padded
Andreas Rheinhardt [Tue, 10 Dec 2019 21:59:46 +0000 (22:59 +0100)]
avformat/apngdec: Make sure that extradata is zero-padded

Zeroing the padding has been forgotten.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mov: Use ff_alloc_extradata for dvdsub extradata
Andreas Rheinhardt [Tue, 10 Dec 2019 21:59:45 +0000 (22:59 +0100)]
avformat/mov: Use ff_alloc_extradata for dvdsub extradata

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 agolavc/x265: set preferred_transfer_characteristics for HLG
Zhong Li [Wed, 4 Dec 2019 14:24:09 +0000 (14:24 +0000)]
lavc/x265: set preferred_transfer_characteristics for HLG

"HEVC HDR UHDTV Bitstreams using HLG10 shall also contain the
alternative_transfer_characteristics SEI message. The
alternative_transfer_characteristics SEI message shall be inserted on
the HEVC DVB_RAP, and preferred_transfer_characteristics shall be set
equal to "18", indicating Recommendation ITU-R BT. 2100 [45] HLG
system."

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavc/qsvenc: add Tiles encode support for HEVC
Linjie Fu [Tue, 26 Nov 2019 03:56:18 +0000 (11:56 +0800)]
lavc/qsvenc: add Tiles encode support for HEVC

Add -tile_rows and -tile_cols option to specify the number of tile rows
and columns for ICL+ (gen 11) platform.

A tile must wholly contain all the slices within it. Slices cannot cross
tile boundaries. So the slice number would be implicitly resized to the
max(nSlice, nTile).

Example:
    ffmpeg -v verbose -hwaccel qsv -init_hw_device qsv=hw
    -filter_hw_device hw -f rawvideo -s:v 1920x1080 -i ./input.nv12 -vf
    format=nv12,hwupload=extra_hw_frames=64 -c:v hevc_qsv -tile_rows 2
    -tile_cols 2 -slices 4 -y output.h265

Also dump the actual quantity of encoded tiled rows and columns in run
time.

Fix the enhancement #8400.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavf/movenc: cosmetics
Yuki Tsuchiya [Thu, 12 Dec 2019 14:02:04 +0000 (23:02 +0900)]
lavf/movenc: cosmetics

Signed-off-by: Yuki Tsuchiya <Yuki.Tsuchiya@sony.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoChangelog: add entry about MPEG-H 3D Audio support in mp4
James Almer [Thu, 12 Dec 2019 15:03:31 +0000 (12:03 -0300)]
Changelog: add entry about MPEG-H 3D Audio support in mp4

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agolavf/isom: support for demuxing and remuxing of MPEG-H 3D Audio in MP4
Yuki Tsuchiya [Thu, 12 Dec 2019 14:02:03 +0000 (23:02 +0900)]
lavf/isom: support for demuxing and remuxing of MPEG-H 3D Audio in MP4

Implemented according to the specification at https://www.iso.org/standard/69561.html
The 'mhm1' sample entry is registered with MP4RA, which is defined as MHAS encapsulated single stream MPEG-H 3D Audio.
'MHAS' stands for MPEG-H audio stream, which contains encoded audio data and corresponds metadata for decoding.
This patch enables extracting the MHAS bitstream from MP4 and remuxing into MP4.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agolavc: add MPEG-H 3D Audio codec id
Yuki Tsuchiya [Thu, 12 Dec 2019 14:02:02 +0000 (23:02 +0900)]
lavc: add MPEG-H 3D Audio codec id

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agolavc/codec_desc: introduce AV_CODEC_PROP_INTRA_ONLY flag to audio codec
Yuki Tsuchiya [Thu, 12 Dec 2019 14:02:01 +0000 (23:02 +0900)]
lavc/codec_desc: introduce AV_CODEC_PROP_INTRA_ONLY flag to audio codec

Introduce AV_CODEC_PROP_INTRA_ONLY flag to audio codec as well as video codec to support non intra-only audio codec.

Signed-off-by: Yuki Tsuchiya <Yuki.Tsuchiya@sony.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/mlp_parser: mark sync frames as key frames
James Almer [Thu, 12 Dec 2019 12:32:07 +0000 (09:32 -0300)]
avcodec/mlp_parser: mark sync frames as key frames

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agortsp: Use AVERROR() with errno.h error codes for error returns
Martin Storsjö [Wed, 11 Dec 2019 12:13:21 +0000 (14:13 +0200)]
rtsp: Use AVERROR() with errno.h error codes for error returns

This particular function is only required to return nonzero on
errors, but use the common AVERROR() pattern for consistency.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agofate: Fix use of target_path/target_samples
Martin Storsjö [Wed, 11 Dec 2019 20:52:59 +0000 (22:52 +0200)]
fate: Fix use of target_path/target_samples

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agofate: Fix dependencies to sample files to use local paths
Martin Storsjö [Wed, 11 Dec 2019 20:52:50 +0000 (22:52 +0200)]
fate: Fix dependencies to sample files to use local paths

These dependencies are evaluted by make and must be expressed with
the paths as in the local filesystem.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agofate/cbs: update the two film grain cbs_av1 tests
James Almer [Thu, 12 Dec 2019 00:59:07 +0000 (21:59 -0300)]
fate/cbs: update the two film grain cbs_av1 tests

They were missed in the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/cbs_av1: fix array size for ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128
James Almer [Wed, 11 Dec 2019 21:54:38 +0000 (18:54 -0300)]
avcodec/cbs_av1: fix array size for ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128

Taking into account the code

fb(2, ar_coeff_lag);
num_pos_luma = 2 * current->ar_coeff_lag * (current->ar_coeff_lag + 1);
if (current->num_y_points)
    num_pos_chroma = num_pos_luma + 1;
else
    num_pos_chroma = num_pos_luma;

Max value for ar_coeff_lag is 3 (two bits), for num_pos_luma 24, and for
num_pos_chroma 25.

Both ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128 may have up to
num_pos_chroma values.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agofate: Use a oneoff test for the tremolo filter
Martin Storsjö [Mon, 9 Dec 2019 20:57:44 +0000 (22:57 +0200)]
fate: Use a oneoff test for the tremolo filter

The tremolo filter uses floating point internally, and uses
multiplication factors derived from sin(fmod()), neither of
which is bitexact for use with framecrc.

This fixes running this test when built with for mingw/x86_32
with clang.

In this case, a 1 ulp difference in the output from fmod() would
end up in an output from the filter that differs by 1 ulp, but
which makes the lrint() in swresample/audioconvert.c round in a
different direction.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agocheckasm: float_dsp: Scale FLT/DBL_EPSILON sufficiently when comparing
Martin Storsjö [Tue, 10 Dec 2019 12:39:02 +0000 (14:39 +0200)]
checkasm: float_dsp: Scale FLT/DBL_EPSILON sufficiently when comparing

As the values generated by av_bmg_get can be arbitrarily large
(only the stddev is specified), we can't use a fixed tolerance.

This matches what was done for test_vector_dmul_scalar in
38f966b2222db.

This fixes the float_dsp checkasm test for some seeds, when built
with clang for mingw/x86_32.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agonetwork: Define ENOTCONN as WSAENOTCONN if not defined
Martin Storsjö [Wed, 11 Dec 2019 12:18:43 +0000 (14:18 +0200)]
network: Define ENOTCONN as WSAENOTCONN if not defined

This fixes compilation with old mingw.org toolchains, which has got
much fewer errno.h entries.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavcodec/cbs_av1: rename enable_intraintra_compound flag
Fei Wang [Wed, 11 Dec 2019 01:54:54 +0000 (09:54 +0800)]
avcodec/cbs_av1: rename enable_intraintra_compound flag

rename enable_intraintra_compound to enable_interintra_compound,
which keep same as AV1 sepc(v1.0.0-errata1).

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/iff: Use ff_alloc_extradata
Andreas Rheinhardt [Tue, 10 Dec 2019 01:41:45 +0000 (02:41 +0100)]
avformat/iff: Use ff_alloc_extradata

Besides improved readability it also zeroes the padding which has been
forgotten here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>