ffmpeg.git
21 hours agoavcodec/noise_bsf: restore dropamount for backwards compatibility master
Gyan Doshi [Fri, 30 Jul 2021 11:38:53 +0000 (17:08 +0530)]
avcodec/noise_bsf: restore dropamount for backwards compatibility

25 hours agoavfilter/avf_showfreqs: switch to TX FFT from avutil
Paul B Mahol [Fri, 30 Jul 2021 07:24:49 +0000 (09:24 +0200)]
avfilter/avf_showfreqs: switch to TX FFT from avutil

36 hours agoavformat/mxfdec: fix frame wrapping detection for J2K essence container
Pierre-Anthony Lemieux [Sun, 18 Jul 2021 18:07:43 +0000 (11:07 -0700)]
avformat/mxfdec: fix frame wrapping detection for J2K essence container

For JPEG 2000 essence, the MXF input format module currently uses the value of
byte 14 of the essence container UL to determine whether the J2K essence is
clip- (byte 14 is 0x02) or frame-wrapped (byte 14 is 0x01). Otherwise it
assumes an unknown wrapping.

Additional wrappings are documented in SMPTE ST422:2019:

0x03: Interlaced Frame, 1 field/KLV
0x04: Interlaced Frame, 2 fields/KLV
0x05: Field-wrapped Picture Element
0x06: Frame-wrapped Picture Element

And these should also be handled as frame wrapped content.

Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
36 hours agopostproc/postprocess: Remove legacy cruft
Andreas Rheinhardt [Fri, 23 Jul 2021 14:24:45 +0000 (16:24 +0200)]
postproc/postprocess: Remove legacy cruft

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
36 hours ago(postproc|swresample)/version: Don't include libavutil/avutil.h
Andreas Rheinhardt [Fri, 23 Jul 2021 14:21:56 +0000 (16:21 +0200)]
(postproc|swresample)/version: Don't include libavutil/avutil.h

Instead only include libavutil/version.h; including avutil.h is a
remnant from the time in which the version was in it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
36 hours agoavutil/error: Include macros.h for MKTAG
Andreas Rheinhardt [Fri, 23 Jul 2021 05:41:54 +0000 (07:41 +0200)]
avutil/error: Include macros.h for MKTAG

Up until now, including error.h alone does not make the AVERROR_* defines
usable, because they just expand to something involving MKTAG, but
without the header providing MKTAG. So include macros.h, the header
providing MKTAG.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
36 hours agoavutil/common, macros: Move several macros from common.h to macros.h
Andreas Rheinhardt [Fri, 23 Jul 2021 16:52:27 +0000 (18:52 +0200)]
avutil/common, macros: Move several macros from common.h to macros.h

common.h currently contains several things: Math macros, UTF-8 macros,
other fundamental macros; furthermore it also contains miscellaneous
math functions and it (directly and indirectly) includes lots of other
headers.

This commit moves the "other fundamental macros" to macros.h which is
a more fitting place.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
36 hours agoavformat/internal: Move ff_read_line_to_bprint_overwrite to avio_internal.h
Andreas Rheinhardt [Fri, 23 Jul 2021 02:01:44 +0000 (04:01 +0200)]
avformat/internal: Move ff_read_line_to_bprint_overwrite to avio_internal.h

It only uses an AVIOContext and an AVBPrint.

When doing so, it turned out that several non-users of
ff_read_line_to_bprint_overwrite() and ff_bprint_to_codecpar_extradata()
relied on libavformat/internal.h to include bprint.h or avstring.h
for them. In order to avoid a repeat of this and in order to reduce
unnecessary dependencies, a forward declaration of struct AVBPrint is
used instead of including bprint.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
36 hours agoavformat/aviobuf: Make ff_read_line_to_bprint() static
Andreas Rheinhardt [Fri, 23 Jul 2021 01:06:26 +0000 (03:06 +0200)]
avformat/aviobuf: Make ff_read_line_to_bprint() static

It is only used in ff_read_line_to_bprint_overwrite().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
40 hours agoavcodec/noise_bsf: add expr support
Gyan Doshi [Sun, 25 Jul 2021 10:01:54 +0000 (15:31 +0530)]
avcodec/noise_bsf: add expr support

2 days agoavcodec/mips: cabac.h provide fallback for wsbh instruction
Jiaxun Yang [Fri, 23 Jul 2021 05:53:44 +0000 (13:53 +0800)]
avcodec/mips: cabac.h provide fallback for wsbh instruction

wsbh is only avilable for MIPS R2+.
Provide a fallback for older processors.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agoavutil/mips: Use $at as MMI macro temporary register
Jiaxun Yang [Fri, 23 Jul 2021 05:53:43 +0000 (13:53 +0800)]
avutil/mips: Use $at as MMI macro temporary register

Some function had exceed 30 inline assembly register oprands limiation
when using LOONGSON2 version of MMI macros. We can avoid that by take
$at, which is register reserved for assembler, as temporary register.

As none of instructions used in these macros is pseudo, it is safe to
utilize $at here.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agoavcodec/mips: Use MMI marcos to replace Loongson3 instructions
Jiaxun Yang [Fri, 23 Jul 2021 05:53:42 +0000 (13:53 +0800)]
avcodec/mips: Use MMI marcos to replace Loongson3 instructions

Loongson3's extention instructions (prefixed with gs) are widely used
in our MMI codebase. However, these instructions are not avilable on
Loongson-2E/F while MMI code should work on these processors.

Previously we introduced mmiutils marcos to provide backward compactbility
but newly commited code didn't follow that. In this patch I revised the
codebase and converted all these instructions into MMI marcos to get
Loongson2 supproted again.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agoavutil/mips: Use MMI_{L, S}QC1 macro in {SAVE, RECOVER}_REG
Jiaxun Yang [Fri, 23 Jul 2021 05:53:41 +0000 (13:53 +0800)]
avutil/mips: Use MMI_{L, S}QC1 macro in {SAVE, RECOVER}_REG

{SAVE,RECOVER}_REG will be available for Loongson2 again,
also comment about the magic.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agoavformat/mov: Remove pointless EOF checks
Andreas Rheinhardt [Sat, 24 Jul 2021 04:14:13 +0000 (06:14 +0200)]
avformat/mov: Remove pointless EOF checks

9888ffb1ce5e0a17f711b01933d504c72ea29d3b added checks for EOF
in loops in the mov demuxer as a precaution against timeouts;
yet there is no I/O in the loop when parsing the STSZ atom
as the values are read from an already read buffer. So remove said
checks.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2 days agoavformat/mov: Fix crash with too big STSZ atoms
Andreas Rheinhardt [Sat, 24 Jul 2021 03:43:12 +0000 (05:43 +0200)]
avformat/mov: Fix crash with too big STSZ atoms

mov_read_stsz() did not ensure that every bit of a buffer is addressable
by an int as is required by the get_bits API, leading to a crash in
ticket #9344. Fix this by restricting the size more thoroughly.

The file from said ticket will then be considered invalid; in the
future, we might read and process the data in chunks to actually support
such files.

Fixes ticket #9344.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2 days agotools/target_dec_fuzzer: Adjust threshold for VP6F
Michael Niedermayer [Sun, 25 Jul 2021 13:21:36 +0000 (15:21 +0200)]
tools/target_dec_fuzzer: Adjust threshold for VP6F

Fixes: Timeout
Fixes: 34791/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP6F_fuzzer-4571038838030336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agotools/target_dec_fuzzer: Adjust the threshold for VP5
Michael Niedermayer [Tue, 20 Jul 2021 15:51:47 +0000 (17:51 +0200)]
tools/target_dec_fuzzer: Adjust the threshold for VP5

Fixes: Timeout
Fixes: 35793/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP5_fuzzer-6492854393372672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agotools/target_dec_fuzzer: Adjust the threshold for VP3
Michael Niedermayer [Tue, 20 Jul 2021 15:46:09 +0000 (17:46 +0200)]
tools/target_dec_fuzzer: Adjust the threshold for VP3

Fixes: Timeout
Fixes: 35855/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-4851183540895744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agoavformat/mov: Fix incorrect overflow detection in mov_read_sidx()
Michael Niedermayer [Wed, 28 Apr 2021 14:53:52 +0000 (16:53 +0200)]
avformat/mov: Fix incorrect overflow detection in mov_read_sidx()

Fixes: signed integer overflow: 9223372036854775807 + 1442840321 cannot be represented in type 'long'
Fixes: 33670/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6644379491106816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agotools/target_dec_fuzzer: Fix extradata duplication
Michael Niedermayer [Sat, 24 Jul 2021 16:18:23 +0000 (18:18 +0200)]
tools/target_dec_fuzzer: Fix extradata duplication

Fixes: out of array access
Fixes: 36340/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5872546875572224.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agolibavcodec/mpeg12dec.c: Switch to init_get_bits8 and checks return value
Thierry Foucu [Tue, 27 Jul 2021 18:25:04 +0000 (11:25 -0700)]
libavcodec/mpeg12dec.c: Switch to init_get_bits8 and checks return value

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavfilter/avf_showcqt: switch to TX FFT from avutil
Paul B Mahol [Tue, 27 Jul 2021 19:16:28 +0000 (21:16 +0200)]
avfilter/avf_showcqt: switch to TX FFT from avutil

3 days agoavfilter/af_afftdn: switch to TX FFT from avutil
Paul B Mahol [Tue, 27 Jul 2021 18:48:40 +0000 (20:48 +0200)]
avfilter/af_afftdn: switch to TX FFT from avutil

3 days agoavfilter/avf_concat: fix EOF timestamp
Paul B Mahol [Sun, 25 Jul 2021 18:09:44 +0000 (20:09 +0200)]
avfilter/avf_concat: fix EOF timestamp

3 days agoqsvenc: Value '0' is not a valid value for parameter GopOptFlag
Haihao Xiang [Thu, 5 Nov 2020 07:08:23 +0000 (15:08 +0800)]
qsvenc: Value '0' is not a valid value for parameter GopOptFlag

The accepted values for GopOptFlag are MFX_GOP_CLOSED (1) and
MFX_GOP_STRICT (2).

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
3 days agoavformat/concat: check the terminating character returned by av_get_token()
James Almer [Tue, 27 Jul 2021 15:00:03 +0000 (12:00 -0300)]
avformat/concat: check the terminating character returned by av_get_token()

Don't attempt to increase the cursor pointer if it was \0.
Fixes invalid reads.

Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
4 days agoavfilter/vf_pseudocolor: add three more presets
Paul B Mahol [Mon, 26 Jul 2021 20:49:02 +0000 (22:49 +0200)]
avfilter/vf_pseudocolor: add three more presets

5 days agoavcodec/h264_sei: honor the Film Grain Characteristics cancel flag
James Almer [Mon, 26 Jul 2021 02:09:00 +0000 (23:09 -0300)]
avcodec/h264_sei: honor the Film Grain Characteristics cancel flag

Film Grain persistence is cancelled when it's true.

Signed-off-by: James Almer <jamrial@gmail.com>
5 days agoavfilter/af_silenceremove: make window also depends on input sample format
Paul B Mahol [Sun, 25 Jul 2021 19:50:31 +0000 (21:50 +0200)]
avfilter/af_silenceremove: make window also depends on input sample format

5 days agoffmpeg: fix order between field order autodetection and override
Jan Ekström [Mon, 19 Jul 2021 20:25:28 +0000 (23:25 +0300)]
ffmpeg: fix order between field order autodetection and override

Having the override before autodetection meant that the overridden
value got overwritten by the autodetected result each time,
effectively disabling the ability to utilize the `-top` option
for override purposes.

Somehow I missed this in fbb44bc51a647862eb05ae3f9d7d49a0be9bed57 ,
even though the lines were within the context. Probably the code
originally being after this logic had something to do with it,
but previously it only touched the avformat context's codecpar,
which did not affect the encoder codec context whatsoever.

Fixes #9320
Fixes #9339

5 days agoavformat/yuv4mpegenc: add support for yuva444p
Paul B Mahol [Sat, 24 Jul 2021 16:07:57 +0000 (18:07 +0200)]
avformat/yuv4mpegenc: add support for yuva444p

5 days agoavfilter/af_silenceremove: add support for more sample formats
Paul B Mahol [Sun, 25 Jul 2021 13:38:33 +0000 (15:38 +0200)]
avfilter/af_silenceremove: add support for more sample formats

5 days agoavfilter/f_ebur128: fix video output regression
Paul B Mahol [Sun, 25 Jul 2021 11:04:03 +0000 (13:04 +0200)]
avfilter/f_ebur128: fix video output regression

5 days agoavfilter/f_ebur128: add all sample rates support
Paul B Mahol [Thu, 4 Mar 2021 13:01:39 +0000 (14:01 +0100)]
avfilter/f_ebur128: add all sample rates support

The magic constants come from the unofficial "ITU-R BS.1770-1 filter
specifications"¹ by Raiden (libebur128) which relies on "Parameter
Quantization in Direct-Form Recursive Audio Filters"² by Brian
Neunaber.

The constants seem to include a quantization bias, for example:
- Vb is supposed to be exactly √Vh in a high shelf filter
- the Pre-filter Gain should likely be 4dB
- Pre Q and RLB Q are respectively very close to √½ and ½

Those are not adjusted to prevent the values from drifting away from
the official specifications.

An alternative to this approach would be to requantize on the fly as
proposed by pbelkner³, where the 48kHz code path would use the exact
specifications constants while derivating constants for other
frequencies.

[1]: https://www.scribd.com/document/49991813/ITU-R-BS-1770-1-filters
[2]: https://www.scribd.com/document/6531763/Direct-Form-Filter-Parameter-Quantization
[3]: https://hydrogenaud.io/index.php?topic=86116.msg740092#msg740092

5 days agoavfilter/af_afwtdn: add forgotten break statement
Paul B Mahol [Sun, 25 Jul 2021 09:47:47 +0000 (11:47 +0200)]
avfilter/af_afwtdn: add forgotten break statement

5 days agoavfilter/vf_threshold: add support for commands
Paul B Mahol [Sun, 25 Jul 2021 09:24:18 +0000 (11:24 +0200)]
avfilter/vf_threshold: add support for commands

6 days agoavfilter/af_anlmdn: add longer names of filter options
Paul B Mahol [Sun, 25 Jul 2021 08:22:42 +0000 (10:22 +0200)]
avfilter/af_anlmdn: add longer names of filter options

6 days agolavfi/signature: fix always true expression
Valerii Zapodovnikov [Mon, 24 May 2021 01:00:24 +0000 (04:00 +0300)]
lavfi/signature: fix always true expression

Otherwise since "==" has higher precedence, mode is never checked.

Reviewed-by: Jai Luthra <me@jailuthra.in>
6 days agoavfilter/vf_pseudocolor: add solar preset
Paul B Mahol [Sat, 24 Jul 2021 21:12:13 +0000 (23:12 +0200)]
avfilter/vf_pseudocolor: add solar preset

Useful to emphasize bandings in video.

6 days agoavfilter/vf_fillborders: add another mode
Paul B Mahol [Sat, 24 Jul 2021 18:20:52 +0000 (20:20 +0200)]
avfilter/vf_fillborders: add another mode

6 days agoavfilter/avf_showspectrum: fix not rendering all channels with fscale=log:mode=separate
Paul B Mahol [Sat, 24 Jul 2021 15:30:58 +0000 (17:30 +0200)]
avfilter/avf_showspectrum: fix not rendering all channels with fscale=log:mode=separate

6 days agoconfigure: remove sofalizer triggering of avcodec dependency
Paul B Mahol [Sat, 24 Jul 2021 15:01:20 +0000 (17:01 +0200)]
configure: remove sofalizer triggering of avcodec dependency

6 days agoavfilter/avf_showspectrum: fix hz scale with legend enabled
Paul B Mahol [Sat, 24 Jul 2021 14:56:51 +0000 (16:56 +0200)]
avfilter/avf_showspectrum: fix hz scale with legend enabled

6 days agoavfilter/avf_showspectrum: switch to TX FFT from avutil
Paul B Mahol [Sat, 24 Jul 2021 12:22:38 +0000 (14:22 +0200)]
avfilter/avf_showspectrum: switch to TX FFT from avutil

6 days agoavfilter/af_headphone: switch to TX FFT from avutil
Paul B Mahol [Sat, 24 Jul 2021 10:17:36 +0000 (12:17 +0200)]
avfilter/af_headphone: switch to TX FFT from avutil

6 days agoavfilter/af_sofalizer: switch to TX FFT from avutil
Paul B Mahol [Sat, 24 Jul 2021 09:26:08 +0000 (11:26 +0200)]
avfilter/af_sofalizer: switch to TX FFT from avutil

6 days agoavfilter: add afwtdn filter
Paul B Mahol [Sun, 31 May 2020 08:22:23 +0000 (10:22 +0200)]
avfilter: add afwtdn filter

7 days agotools/graph2dot: Don't use sizeof(AVFilterGraph), check allocation
Andreas Rheinhardt [Thu, 22 Jul 2021 07:01:27 +0000 (09:01 +0200)]
tools/graph2dot: Don't use sizeof(AVFilterGraph), check allocation

Use avfilter_graph_alloc() instead of av_mallocz(sizeof(AVFilterGraph))
to allocate an AVFilterGraph; this also properly allocates the graph's
internal. The current code just happened to work because it did not
make any use of said internal.

Also check the allocation; this fixes Coverity #1292528.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
7 days agoavcodec/h264_sei: parse and export Film Grain Characteristics SEI messages
James Almer [Fri, 23 Jul 2021 14:06:45 +0000 (11:06 -0300)]
avcodec/h264_sei: parse and export Film Grain Characteristics SEI messages

Signed-off-by: James Almer <jamrial@gmail.com>
7 days agoavutil/film_grain_params: add support for H.274 Film Grain Characteristics
James Almer [Fri, 23 Jul 2021 14:06:31 +0000 (11:06 -0300)]
avutil/film_grain_params: add support for H.274 Film Grain Characteristics

Used by codecs like H.264, HEVC, and VVC.

Signed-off-by: James Almer <jamrial@gmail.com>
7 days agocbs_h264: add support for Film Grain Characteristics SEI messages
James Almer [Fri, 23 Jul 2021 14:05:04 +0000 (11:05 -0300)]
cbs_h264: add support for Film Grain Characteristics SEI messages

Signed-off-by: James Almer <jamrial@gmail.com>
7 days agoavfilter/vf_shufflepixels: Check ff_get_video_buffer()
Andreas Rheinhardt [Thu, 22 Jul 2021 07:24:20 +0000 (09:24 +0200)]
avfilter/vf_shufflepixels: Check ff_get_video_buffer()

There would be a segfault in case of (likely memory allocation) failure.
Fixes Coverity issue #1322338.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
7 days agoavformat/yuv4mpegdec: Use table instead of repeated "else if"
Andreas Rheinhardt [Wed, 21 Jul 2021 11:15:00 +0000 (13:15 +0200)]
avformat/yuv4mpegdec: Use table instead of repeated "else if"

The code savings more than offset the size of the table
(1936B vs 768B with GCC 10.3 at -O3).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
7 days agoavcodec/tableprint_vlc: Fix building with hardcoded tables
Andreas Rheinhardt [Thu, 22 Jul 2021 23:00:13 +0000 (01:00 +0200)]
avcodec/tableprint_vlc: Fix building with hardcoded tables

This has been broken in 25c8507818d8559a6654a5b30a0f8aae11a48181,
because the hacks for headers that are incompatible with building
for the host in libavcodec/tableprint_vlc.h have not been adjusted.

Moving AV_INPUT_BUFFER_PADDING_SIZE to defs.h which is valid for
both the target as well as the host allowed to remove some of the hacks.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agotools/target_dec_fuzzer: Adjust threshold for libvorbis
Michael Niedermayer [Thu, 22 Apr 2021 16:13:38 +0000 (18:13 +0200)]
tools/target_dec_fuzzer: Adjust threshold for libvorbis

Fixes: Timeout
Fixes: 33513/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_fuzzer-6481006635909120

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 days agoavformat/mov: Avoid undefined overflow in time_offset calculation
Michael Niedermayer [Tue, 20 Apr 2021 15:40:56 +0000 (17:40 +0200)]
avformat/mov: Avoid undefined overflow in time_offset calculation

Fixes: signed integer overflow: 8511838621821575200 - -3954125146725285889 cannot be represented in type 'long'
Fixes: 33414/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6610119325515776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 days agoRemove/replace some unnecessary avcodec.h inclusions
Andreas Rheinhardt [Mon, 14 Jun 2021 16:03:55 +0000 (18:03 +0200)]
Remove/replace some unnecessary avcodec.h inclusions

Also remove other unnecessary headers and include headers directly while
at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec/g729postfilter.h: Include acelp_pitch_delay.h
Andreas Rheinhardt [Sun, 13 Jun 2021 13:44:20 +0000 (15:44 +0200)]
avcodec/g729postfilter.h: Include acelp_pitch_delay.h

Needed for PITCH_DELAY_MAX.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec: Remove some unnecessary mpegvideo.h inclusions
Andreas Rheinhardt [Sat, 12 Jun 2021 23:35:01 +0000 (01:35 +0200)]
avcodec: Remove some unnecessary mpegvideo.h inclusions

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoRemove unnecessary avassert.h inclusions
Andreas Rheinhardt [Thu, 22 Jul 2021 13:02:30 +0000 (15:02 +0200)]
Remove unnecessary avassert.h inclusions

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoRemove unnecessary mem.h inclusions
Andreas Rheinhardt [Thu, 22 Jul 2021 12:47:57 +0000 (14:47 +0200)]
Remove unnecessary mem.h inclusions

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoRemove obsolete version.h inclusions
Andreas Rheinhardt [Fri, 11 Jun 2021 19:54:31 +0000 (21:54 +0200)]
Remove obsolete version.h inclusions

These have mostly been added because of FF_API_*; yet when these were
removed, removing the header has been forgotten.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavutil/internal, swresample/audioconvert: Remove cpu.h inclusions
Andreas Rheinhardt [Sat, 12 Jun 2021 21:00:12 +0000 (23:00 +0200)]
avutil/internal, swresample/audioconvert: Remove cpu.h inclusions

These inclusions are not necessary, as cpu.h is already included
wherever it is needed (via direct inclusion or via the arch-specific
headers).
Also remove other unnecessary cpu.h inclusions from ordinary
non-headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec/lossless_videodsp: Improve included headers
Andreas Rheinhardt [Sat, 12 Jun 2021 20:31:53 +0000 (22:31 +0200)]
avcodec/lossless_videodsp: Improve included headers

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec/avcodec: Don't include cpu.h
Andreas Rheinhardt [Sat, 12 Jun 2021 20:10:11 +0000 (22:10 +0200)]
avcodec/avcodec: Don't include cpu.h

It is not used here at all; instead, add it where it is used without
including it or any of the arch-specific CPU headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec/avcodec: Don't include hwcontext.h
Andreas Rheinhardt [Sat, 12 Jun 2021 19:04:28 +0000 (21:04 +0200)]
avcodec/avcodec: Don't include hwcontext.h

It is no longer used directly; but it is still indirectly included via
codec.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec/avcodec: Don't include errno.h
Andreas Rheinhardt [Fri, 11 Jun 2021 23:14:27 +0000 (01:14 +0200)]
avcodec/avcodec: Don't include errno.h

This inclusion has been added before libavutil/error.h was split off
from avcodec.h (in 60c144f700e2e362047b00704abcb694d49e549c).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec/avcodec: Stop including channel_layout.h in avcodec.h
Andreas Rheinhardt [Fri, 11 Jun 2021 23:10:58 +0000 (01:10 +0200)]
avcodec/avcodec: Stop including channel_layout.h in avcodec.h

Also include channel_layout.h directly wherever used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
8 days agoavcodec/avcodec: Stop including bsf.h in avcodec.h
Andreas Rheinhardt [Fri, 11 Jun 2021 21:35:33 +0000 (23:35 +0200)]
avcodec/avcodec: Stop including bsf.h in avcodec.h

Also include bsf.h directly wherever it is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcm_data: Move tables only used by adpcm.c to it
Andreas Rheinhardt [Thu, 17 Jun 2021 01:41:36 +0000 (03:41 +0200)]
avcodec/adpcm_data: Move tables only used by adpcm.c to it

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcm_data: Fix type mismatch for ff_adpcm_afc_coeffs
Andreas Rheinhardt [Thu, 17 Jun 2021 01:34:57 +0000 (03:34 +0200)]
avcodec/adpcm_data: Fix type mismatch for ff_adpcm_afc_coeffs

According to the header it is an array of int16_t, yet it is declared as
uint16_t. Fix this by using int16_t troughout and convert the definition
to use values in the range of int16_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcm: Don't include disabled AVCodecs
Andreas Rheinhardt [Tue, 8 Jun 2021 01:25:43 +0000 (03:25 +0200)]
avcodec/adpcm: Don't include disabled AVCodecs

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcm: Disable dead code
Andreas Rheinhardt [Tue, 8 Jun 2021 16:26:52 +0000 (18:26 +0200)]
avcodec/adpcm: Disable dead code

This change ensures that the linker can drop adpcm_data.o if no decoder
that actually uses anything from there is enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcm: Fix indentation
Andreas Rheinhardt [Tue, 8 Jun 2021 14:52:15 +0000 (16:52 +0200)]
avcodec/adpcm: Fix indentation

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcm: Use smaller scope for some variables
Andreas Rheinhardt [Mon, 7 Jun 2021 23:03:45 +0000 (01:03 +0200)]
avcodec/adpcm: Use smaller scope for some variables

This is to avoid unused variables warnings after the code for
the disabled encoders has been #if'ed away which will happen in
a subsequent commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcmenc: Don't include disabled AVCodecs
Andreas Rheinhardt [Tue, 8 Jun 2021 01:25:43 +0000 (03:25 +0200)]
avcodec/adpcmenc: Don't include disabled AVCodecs

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcmenc: Deduplicate AVClasses
Andreas Rheinhardt [Mon, 7 Jun 2021 14:13:33 +0000 (16:13 +0200)]
avcodec/adpcmenc: Deduplicate AVClasses

The child_class_next API relied on different (de)muxers to use
different AVClasses; yet this API has been replaced by
child_class_iterate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcmenc: #if disabled code away, fix build without ADPCM_ARGO
Andreas Rheinhardt [Tue, 8 Jun 2021 00:36:00 +0000 (02:36 +0200)]
avcodec/adpcmenc: #if disabled code away, fix build without ADPCM_ARGO

The adpcm_argo encoder does not use the data from adpcm_data.c directly;
instead it shares a function with the adpcm_argo decoder that is in
adpcm.c. When all the ADPCM decoders and the adpcm_argo encoder are
disabled, adpcm.c is not compiled; yet the code in adpcmenc.c calling
said function from adpcm.c is still present, leading to link errors.

Fix this by disabling the code belonging to disabled codecs in
adpcmenc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agoavcodec/adpcmenc: Use smaller scope for some variables
Andreas Rheinhardt [Mon, 7 Jun 2021 23:03:45 +0000 (01:03 +0200)]
avcodec/adpcmenc: Use smaller scope for some variables

This is to avoid unused variables warnings if the code for disabled
encoders is #if'ed away which will happen in a subsequent commit.
In case of buf it also avoids shadowing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
9 days agolavfi/dnn_backend_ov: Rename RequestItem to OVRequestItem
Shubhanshu Saxena [Sun, 11 Jul 2021 16:15:02 +0000 (21:45 +0530)]
lavfi/dnn_backend_ov: Rename RequestItem to OVRequestItem

Rename RequestItem to OVRequestItem in the OpenVINO backend
to avoid confusion.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
9 days agolavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ov
Shubhanshu Saxena [Sun, 11 Jul 2021 16:15:01 +0000 (21:45 +0530)]
lavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ov

In cases where the execution inside the function execute_model_ov fails,
the OVRequestItem must be pushed back to the request_queue before returning
the error. In case pushing back fails, release the allocated memory.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
9 days agolavu/kperf: use ff_thread_once()
J. Dekker [Wed, 21 Jul 2021 14:21:34 +0000 (16:21 +0200)]
lavu/kperf: use ff_thread_once()

Signed-off-by: J. Dekker <jdek@itanimul.li>
10 days agodoc/filters: note expr and eval mode support in overlay_cuda
Gyan Doshi [Wed, 21 Jul 2021 07:38:13 +0000 (13:08 +0530)]
doc/filters: note expr and eval mode support in overlay_cuda

Commit 58c908cf94 added support for expressions for x and y parameters.
Also added was option to set eval frequency.

10 days agoavutil/macos_kperf: add missing header guards
James Almer [Tue, 20 Jul 2021 22:01:02 +0000 (19:01 -0300)]
avutil/macos_kperf: add missing header guards

Fixes fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
10 days agolavu/checkasm: add (private) kperf timing for macOS
J. Dekker [Tue, 20 Jul 2021 17:09:22 +0000 (19:09 +0200)]
lavu/checkasm: add (private) kperf timing for macOS

Signed-off-by: J. Dekker <jdek@itanimul.li>
10 days agoavfilter/af_drmeter: Check that there is data
Michael Niedermayer [Sat, 5 Jun 2021 18:28:24 +0000 (20:28 +0200)]
avfilter/af_drmeter: Check that there is data

Fixes: floating point division by 0
Fixes: -nan is outside the range of representable values of type 'int'
Fixes: Ticket8307

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 days agoavfilter/vf_fftdnoiz: Use lrintf() in export_row8()
Michael Niedermayer [Sat, 5 Jun 2021 18:12:08 +0000 (20:12 +0200)]
avfilter/vf_fftdnoiz: Use lrintf() in export_row8()

Fixes: 1.04064e+10 is outside the range of representable values of type 'int'
Fixes: Ticket 8279

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 days agoavfilter/vf_mestimate: Check b_count
Michael Niedermayer [Sat, 5 Jun 2021 18:04:45 +0000 (20:04 +0200)]
avfilter/vf_mestimate: Check b_count

Fixes: left shift of negative value -1
Fixes: Ticket8270

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 days agoavfilter/vf_signature: Initialize all houghspace elements
Jai Luthra [Tue, 13 Jul 2021 07:55:25 +0000 (13:25 +0530)]
avfilter/vf_signature: Initialize all houghspace elements

Co-authored-by: Oscar <oscar_davids@outlook.com>
11 days agolavu/cpu: Use av_cpu_ prefix
Thilo Borgmann [Tue, 20 Jul 2021 07:33:47 +0000 (09:33 +0200)]
lavu/cpu: Use av_cpu_ prefix

11 days agoavformat/gifdec: log loop count
Gyan Doshi [Mon, 19 Jul 2021 10:53:34 +0000 (16:23 +0530)]
avformat/gifdec: log loop count

11 days agofftools/ffmpeg: Fix runlength for strncmp()
Thilo Borgmann [Mon, 19 Jul 2021 19:23:02 +0000 (21:23 +0200)]
fftools/ffmpeg: Fix runlength for strncmp()

11 days agoavdevice/avfoundation: remove first_audio_pts and first_pts
Steven Liu [Mon, 19 Jul 2021 12:03:25 +0000 (20:03 +0800)]
avdevice/avfoundation: remove first_audio_pts and first_pts

Because these two member of AVFContext not be used.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
12 days agoffmpeg: delay readrate enforcement for decoded streams
Gyan Doshi [Mon, 19 Jul 2021 07:24:55 +0000 (12:54 +0530)]
ffmpeg: delay readrate enforcement for decoded streams

Read rate enforcement delayed till first decoded frame is obtained, to
speed up init of output streams.

Thanks to Linjie Fu <linjie.justin.fu@gmail.com> for the initial patch.

12 days agoavformat/argo_brp: use bits_per_coded_sample instead of bits_per_raw_sample
Zane van Iperen [Sat, 17 Jul 2021 23:27:11 +0000 (09:27 +1000)]
avformat/argo_brp: use bits_per_coded_sample instead of bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
12 days agoavcodec/argo: use bits_per_coded_sample instead of bits_per_raw_sample
Zane van Iperen [Sat, 17 Jul 2021 23:18:47 +0000 (09:18 +1000)]
avcodec/argo: use bits_per_coded_sample instead of bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
12 days agoavformat/pp_bnk: don't set bits_per_raw_sample
Zane van Iperen [Sun, 18 Jul 2021 00:42:33 +0000 (10:42 +1000)]
avformat/pp_bnk: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
12 days agoavformat/kvag: don't set bits_per_raw_sample
Zane van Iperen [Sun, 18 Jul 2021 00:41:54 +0000 (10:41 +1000)]
avformat/kvag: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
12 days agoavformat/apm: don't set bits_per_raw_sample
Zane van Iperen [Sun, 18 Jul 2021 00:41:21 +0000 (10:41 +1000)]
avformat/apm: don't set bits_per_raw_sample

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>