Commit Graph

103103 Commits

Author SHA1 Message Date
Andreas Rheinhardt
610658c146 postproc/postprocess: Remove legacy cruft
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-29 22:02:06 +02:00
Andreas Rheinhardt
21e732b919 (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>
2021-07-29 22:02:05 +02:00
Andreas Rheinhardt
5088c7c733 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>
2021-07-29 22:02:05 +02:00
Andreas Rheinhardt
2dd8acbe80 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>
2021-07-29 22:02:05 +02:00
Andreas Rheinhardt
fd101c9c3b 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>
2021-07-29 22:02:05 +02:00
Andreas Rheinhardt
642b202567 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>
2021-07-29 22:02:05 +02:00
Gyan Doshi
23da5caf09 avcodec/noise_bsf: add expr support 2021-07-29 22:05:11 +05:30
Jiaxun Yang
2323d3a923 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>
2021-07-28 23:31:48 +02:00
Jiaxun Yang
a1cd62883f 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>
2021-07-28 23:31:48 +02:00
Jiaxun Yang
1042039ccd 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>
2021-07-28 23:31:48 +02:00
Jiaxun Yang
b868272d7e 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>
2021-07-28 23:31:48 +02:00
Andreas Rheinhardt
65f9a8e4b8 avformat/mov: Remove pointless EOF checks
9888ffb1ce 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>
2021-07-28 22:26:54 +02:00
Andreas Rheinhardt
c2d853c1aa 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>
2021-07-28 22:26:54 +02:00
Michael Niedermayer
f0ed8de1d6 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>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
46e8778300 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>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
cce928e941 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>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
200406d930 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>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
54b798638e 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>
2021-07-28 19:15:26 +02:00
Thierry Foucu
fc300613be libavcodec/mpeg12dec.c: Switch to init_get_bits8 and checks return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 19:15:26 +02:00
Paul B Mahol
0068b3d0f0 avfilter/avf_showcqt: switch to TX FFT from avutil 2021-07-27 21:16:28 +02:00
Paul B Mahol
925d41ebd4 avfilter/af_afftdn: switch to TX FFT from avutil 2021-07-27 20:48:40 +02:00
Paul B Mahol
51c22f6621 avfilter/avf_concat: fix EOF timestamp 2021-07-27 20:19:52 +02:00
Haihao Xiang
f2feb31b78 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>
2021-07-27 23:48:53 +08:00
James Almer
487dfa9f04 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>
2021-07-27 12:13:32 -03:00
Paul B Mahol
bc5faacc3f avfilter/vf_pseudocolor: add three more presets 2021-07-26 22:49:02 +02:00
James Almer
f7958d0883 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>
2021-07-25 23:54:10 -03:00
Paul B Mahol
da6975f022 avfilter/af_silenceremove: make window also depends on input sample format 2021-07-25 22:48:25 +02:00
Jan Ekström
4c694093be 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 fbb44bc51a ,
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
2021-07-25 22:40:49 +03:00
Paul B Mahol
a1f7d25cef avformat/yuv4mpegenc: add support for yuva444p 2021-07-25 17:08:35 +02:00
Paul B Mahol
d08deb11d2 avfilter/af_silenceremove: add support for more sample formats 2021-07-25 16:42:58 +02:00
Paul B Mahol
6f0f7bc7fe avfilter/f_ebur128: fix video output regression 2021-07-25 13:16:58 +02:00
Paul B Mahol
274112c88d 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
2021-07-25 12:15:29 +02:00
Paul B Mahol
a2a7547b2f avfilter/af_afwtdn: add forgotten break statement 2021-07-25 11:47:47 +02:00
Paul B Mahol
207e9b1760 avfilter/vf_threshold: add support for commands 2021-07-25 11:24:18 +02:00
Paul B Mahol
6210cc8c7e avfilter/af_anlmdn: add longer names of filter options 2021-07-25 10:23:30 +02:00
Valerii Zapodovnikov
fdd45ebf55 lavfi/signature: fix always true expression
Otherwise since "==" has higher precedence, mode is never checked.

Reviewed-by: Jai Luthra <me@jailuthra.in>
2021-07-25 05:10:33 +05:30
Paul B Mahol
6fcb082b7a avfilter/vf_pseudocolor: add solar preset
Useful to emphasize bandings in video.
2021-07-24 23:12:13 +02:00
Paul B Mahol
d5c76450f8 avfilter/vf_fillborders: add another mode 2021-07-24 20:23:58 +02:00
Paul B Mahol
94c90b3261 avfilter/avf_showspectrum: fix not rendering all channels with fscale=log:mode=separate 2021-07-24 17:30:58 +02:00
Paul B Mahol
60e2348e27 configure: remove sofalizer triggering of avcodec dependency 2021-07-24 17:01:20 +02:00
Paul B Mahol
e5c860cd29 avfilter/avf_showspectrum: fix hz scale with legend enabled 2021-07-24 16:56:51 +02:00
Paul B Mahol
014ace8f98 avfilter/avf_showspectrum: switch to TX FFT from avutil 2021-07-24 16:49:53 +02:00
Paul B Mahol
88b6342c2b avfilter/af_headphone: switch to TX FFT from avutil 2021-07-24 12:24:40 +02:00
Paul B Mahol
f6aeb94d72 avfilter/af_sofalizer: switch to TX FFT from avutil 2021-07-24 12:24:40 +02:00
Paul B Mahol
6846d48fa6 avfilter: add afwtdn filter 2021-07-24 12:24:40 +02:00
Andreas Rheinhardt
c253b180cb 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>
2021-07-24 05:35:10 +02:00
James Almer
4ff73add5d avcodec/h264_sei: parse and export Film Grain Characteristics SEI messages
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-23 11:06:45 -03:00
James Almer
e3b5ff17c2 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>
2021-07-23 11:06:31 -03:00
James Almer
41d1dba4d2 cbs_h264: add support for Film Grain Characteristics SEI messages
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-23 11:05:04 -03:00
Andreas Rheinhardt
c4042fc1e3 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>
2021-07-23 15:06:21 +02:00