1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

109777 Commits

Author SHA1 Message Date
Paul B Mahol
7e1d474021 avfilter/af_compand: simplify frame allocation 2023-02-08 18:56:57 +01:00
Paul B Mahol
068ad04908 avfilter/af_compensationdelay: simplify frame allocation 2023-02-08 18:56:56 +01:00
Tomas Härdin
a678b0c252 sws/utils.c: Do not uselessly call initFilter() when unscaling 2023-02-08 15:53:55 +01:00
Leo Izen
5cf0bc4236
avcodec/pngenc: avoid writing cICP when inappropriate
We parse the fallback cHRM on decode and correctly determine that we
have BT.709 primaries, but unknown TRC. This causes us to write cICP
where we shouldn't. Primaries without transfer can be handled entirely
by cHRM, so we should only write cICP if we actually know the transfer
function.

Additionally, we should avoid writing cICP if there's an ICC profile
because the spec says decoders must prioritize cICP over the ICC
profile.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-02-08 08:50:34 -05:00
Paul B Mahol
c56f5be678 avcodec/wavarc: fix 16bit 0CPY mode 2023-02-07 20:58:59 +01:00
Paul B Mahol
93a9ee7afd avfilter/af_pan: fix regression introduced with switch to new channel layout API
Fixes #10168
2023-02-07 18:28:57 +01:00
Paul B Mahol
df4ab69cfa avcodec/wavarc: add support for 0CPY 2023-02-07 17:13:11 +01:00
Paul B Mahol
0c7af7b954 avcodec/bonk: properly handle some other errors 2023-02-07 17:13:11 +01:00
Paul B Mahol
5dba4b217c avcodec/wavarc: properly handle invalid data 2023-02-07 17:13:10 +01:00
Niklas Haas
62dfa54688 avfilter/vf_libplacebo: fix format query
We need to construct the output format list separatedly from the input
format list, because we need to adhere to two extra requirements:

1. Big-endian output formats are always unsupported (runtime error)
2. Combining 'vulkan' with an explicit out_format that is not supported
   by the vulkan frame allocation code is illegal and will crash (abort)

As a free side benefit, this rewrite fixes a possible memory leak in the
`fail` path that was present in the old code.

Signed-off-by: Niklas Haas <git@haasn.dev>
2023-02-07 15:11:49 +01:00
Haihao Xiang
58d6426870 lavfi/vf_vpp_qsv: add support for new scaling modes
The new modes work on new platforms and are avaialable only for oneVPL.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-07 09:51:37 +08:00
Haihao Xiang
36016c5596 lavfi/vf_vpp_qsv: support UYVY in system memory
It only works on Linux

$ ffmpeg -loglevel verbose -init_hw_device qsv=intel -f lavfi -i \
yuvtestsrc -vf "format=uyvy422,vpp_qsv=format=nv12" -f null -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-07 09:51:37 +08:00
Haihao Xiang
f1355ec9f6 lavu/hwcontext_qsv: add support for UYVY
The SDK supports UYVY from version 1.17, and VPP may support UYVY
input on Linux [1]

$ ffmpeg -loglevel verbose -init_hw_device qsv=intel -f lavfi -i \
yuvtestsrc -vf \
"format=uyvy422,hwupload=extra_hw_frames=32,vpp_qsv=format=nv12" \
-f null -

[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/samples/readme-vpp_linux.md

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-07 09:51:37 +08:00
Paul B Mahol
3b3a321fed avcodec/wavarc: remove invalid shifts 2023-02-06 20:29:44 +01:00
Leo Izen
0009348306
avcodec/libjxl: add #ifdef guards for libjxl >= 0.8.0 features
Since many distributions ship libjxl 0.7.0 still, we'd still prefer to
compile against that, but don't want to lose the features that require
libjxl 0.8.0 or greater. For this reason I've added preprocessor #ifdef
guards around the features that aren't necessarily in libjxl 0.7.0.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-02-06 13:05:39 -05:00
Paul B Mahol
c5aeb8f4db avcodec/wavarc: really fix bits per sample detection 2023-02-06 18:27:45 +01:00
Paul B Mahol
64b242d030 avcodec/wavarc: fix 8bit decoding 2023-02-06 18:09:11 +01:00
Paul B Mahol
d7c2da1f8d avcodec/wavarc: check that nb_samples is valid 2023-02-06 16:37:20 +01:00
Anton Khirnov
bdc76f467f lavu/frame: deprecate reordered_opaque
It is only used in libavcodec, where it's been superseded by
AV_CODEC_CAP_COPY_OPAQUE.
2023-02-04 13:40:20 +01:00
Anton Khirnov
d02340b9e3 lavc/decode: allow using AV_CODEC_FLAG_COPY_OPAQUE for decoding
Use it to propagate AVPacket.opaque[_ref] to corresponding AVFrame
fields. This is a more convenient alternative to reordered_opaque.
2023-02-04 13:14:20 +01:00
Anton Khirnov
82da22066c lavc: deprecate CrystalHD decoders
The hardware is old and not relevant today. The decoders also have many
special quirks and are effectively unmaintained.
2023-02-04 13:12:28 +01:00
Paul B Mahol
4b922218e9 avformat/lafdec: check for not supported bpp 2023-02-04 09:40:34 +01:00
Paul B Mahol
332a4d798d avformat/lafdec: error out on partial packet header read 2023-02-04 09:40:34 +01:00
Paul B Mahol
4e3e70c19d avformat: add WavArc demuxer 2023-02-04 09:37:19 +01:00
Paul B Mahol
651da91915 avcodec: add WavArc decoder 2023-02-04 09:36:01 +01:00
Jan Ekström
9a820ec8b1 ffmpeg: add video heartbeat capability to fix_sub_duration
Splits the currently handled subtitle at random access point
packets that can be configured to follow a specific output stream.
Currently only subtitle streams which are directly mapped into the
same output in which the heartbeat stream resides are affected.

This way the subtitle - which is known to be shown at this time
can be split and passed to muxer before its full duration is
yet known. This is also a drawback, as this essentially outputs
multiple subtitles from a single input subtitle that continues
over multiple random access points. Thus this feature should not
be utilized in cases where subtitle output latency does not matter.

Co-authored-by: Andrzej Nadachowski <andrzej.nadachowski@24i.com>
Co-authored-by: Bernard Boulay <bernard.boulay@24i.com>

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2023-02-03 16:17:29 +02:00
Jan Ekström
746d27455b ffmpeg: move decoded frame counter from after post-processing to decode
This way we can call process_subtitles without causing the decoded
frame counter to get bumped.

Additionally, this now takes into mention all of the decoded
subtitle frames without fix_sub_duration latency/buffering, or filtering
out decoded reset/end subtitles without any rendered rectangles, which
matches the original intent in 4754345027
.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2023-02-03 12:21:02 +02:00
Jan Ekström
fcc50674de ffmpeg: refactor post-decoding steps for subtitles into a function
This enables us to later call this when generating additional
subtitles for splitting purposes.

Co-authored-by: Andrzej Nadachowski <andrzej.nadachowski@24i.com>

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2023-02-03 12:21:02 +02:00
Haihao Xiang
b92028346c lavfi/deinterlace_qsv: re-use VPPContext for deinterlace_qsv filter
QSVDeintContext and VPPContext have the same base context, and all
features in deinterlace_qsv are implemented in vpp_qsv filter,  so
deinterlace_qsv can be taken as a special case of vpp_qsv filter, and we
may use VPPContext with a different option array, preinit callback and
support pixel formats to implement deinterlace_qsv, then remove
QSVDeintContext.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-03 10:27:58 +08:00
Haihao Xiang
a48c95d3c9 lavfi/deinterlace_qsv: simplify deinterlace_qsv filter
Like what we did for scale_qsv filter, we use QSVVPPContext as a base
context to manage MFX session for deinterlace_qsv filter.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-03 10:27:58 +08:00
Haihao Xiang
077e634965 lavfi/vpp_qsv: add rate option
This is used to control the output at frame rate or field rate when
deinterlace is expected and framerate is not specified.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-03 10:27:57 +08:00
Anton Khirnov
7d49fef8b4 lavc/vaapi_encode: fix propagating durations and opaques
input_image is freed by the time the output packet is constructed, so we
need to store copies in VAAPIEncodePicture.
2023-02-02 10:42:39 +08:00
Michael Niedermayer
f4b4e16641
libavformat/lafdec: free data
Fixes: memleak

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-02-01 20:23:37 +01:00
Michael Niedermayer
ad95d9c855
avformat/lafdec: Check if all data was read
Fixes: OOM
Fixes: 54572/clusterfuzz-testcase-minimized-ffmpeg_dem_LAF_fuzzer-4974038870523904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-02-01 20:23:37 +01:00
Michael Niedermayer
35871c26d2
tools/target_dec_fuzzer: Adjust threshold for BONK
The decoder is quite slow with max n taps
Fixes: Timeout
Fixes: 54063/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5087362407596032

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-02-01 20:23:36 +01:00
Lynne
bbe95f7353
x86: replace explicit REP_RETs with RETs
From x86inc:
> On AMD cpus <=K10, an ordinary ret is slow if it immediately follows either
> a branch or a branch target. So switch to a 2-byte form of ret in that case.
> We can automatically detect "follows a branch", but not a branch target.
> (SSSE3 is a sufficient condition to know that your cpu doesn't have this problem.)

x86inc can automatically determine whether to use REP_RET rather than
REP in most of these cases, so impact is minimal. Additionally, a few
REP_RETs were used unnecessary, despite the return being nowhere near a
branch.

The only CPUs affected were AMD K10s, made between 2007 and 2011, 16
years ago and 12 years ago, respectively.

In the future, everyone involved with x86inc should consider dropping
REP_RETs altogether.
2023-02-01 04:23:55 +01:00
Paul B Mahol
fc9a3b584d avcodec/mlpdec: parse and use substream info bits 2023-01-31 18:45:22 +01:00
Paul B Mahol
00994e8be1 avcodec: add media100_to_mjpegb bitstream filter and use it 2023-01-31 17:06:29 +01:00
Leo Izen
fb823161a8
avcodec/libjxl: respect AVCodecContext->bits_per_raw_sample
libjxl only accepts 16-bit buffers with its API, but it can
accept 9-bit to 15-bit input via a 16-bit buffer, provided the flag
is set declaring the buffer to be of the respective significant depth.

Likewise, it can only provide pixel data on decode as a 16-bit buffer
(if higher than 8) but does provide the metadata tagging the actual bit
depth.

This commit causes libjxlenc.c and libjxldec.c to respect this metadata
and tag/read it accordingly from AVCodecContext->bits_per_raw_sample.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-01-31 10:39:48 -05:00
Cameron Gutman
669ff26bc2 avcodec/mfenc: fix double-free on init failure
mfenc sets FF_CODEC_CAP_INIT_CLEANUP, so calling mf_close() on
failure inside mf_init() results in a double-free.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-01-31 14:39:25 +02:00
Martin Storsjö
431f6260ac mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists
Only warn if the advanced_editlist option is enabled (it is enabled
by default though) so we don't print one warning for each track, and
demote the warning to AV_LOG_LEVEL_VERBOSE; this message does get
generated whenever parsing a fragmented MP4 file, regardless of
whether the file actually uses multiple edits or not.

Later when parsing the mov structures, the demuxer does warn if
the file did contain multiple edits which would require the
advanced_editlist option enabled for decoding correctly.

Adjust the warning message for the case when the file seemed like it
actually would have needed handling of advanced edit lists, to
reflect the fact that it doesn't help to try set the option as
it has been automatically disabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-01-31 14:29:08 +02:00
Martin Storsjö
01f58f3646 lavu/video_enc_params: Avoid relying on an undefined C construct
The construct of using offsetof on a (potentially anonymous) struct
defined within the offsetof expression, while supported by all
current compilers, has been declared explicitly undefined by the
C standards committee [1].

Clang recently got a change to identify this as an issue [2];
initially it was treated as a hard error, but it was soon after
softened into a warning under the -Wgnu-offsetof-extensions option
(not enabled automatically as part of -Wall though).

Nevertheless - in this particular case, it's trivial to fix the
code not to rely on the construct that the standards committee has
explicitly called out as undefined.

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm
[2] https://reviews.llvm.org/D133574

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-01-31 14:22:54 +02:00
Anton Khirnov
806ecace91 fftools/ffmpeg: support input frame params in encoding stats 2023-01-31 09:09:23 +01:00
Anton Khirnov
61afbc2376 fftools/ffmpeg: use correct IO context for -enc_stats_post 2023-01-31 09:09:11 +01:00
Anton Khirnov
5c36f4ef84 lavu/opt: use AV_DICT_MULTIKEY in av_opt_set_dict2()
If the dictionary provided on input contains multiple entries for an
option (relevant for flags modifying the previous value with '+' or
'-') and the option is not found in the target object, only the last
entry would be returned to the caller.

Pass AV_DICT_MULTIKEY to av_dict_set() to make sure all such entries are
returned.
2023-01-31 09:08:03 +01:00
Anton Khirnov
e3a99041b8 lavc: add null codecs
They discard all input without ever returning any output. Useful for
development.
2023-01-31 09:00:56 +01:00
Paul B Mahol
229f3259f8 doc/general_contents: sync with available decoders and demuxers 2023-01-30 21:42:39 +01:00
Paul B Mahol
fa42575ffa avformat: add XMD demuxer 2023-01-30 21:02:48 +01:00
Paul B Mahol
280e6e93fc avcodec: add ADPCM XMD decoder 2023-01-30 20:57:37 +01:00
Niklas Haas
9bfdd8524e avfilter/vf_libplacebo: suppress cast warning
This warning was introduced when ee65039 removed the cast.
2023-01-30 20:34:55 +01:00