Compare commits

...

6294 Commits

Author SHA1 Message Date
Michael Niedermayer
894da5ca7d Changelog: include last 3 fixes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-20 02:43:51 +01:00
Zhao Zhili
4c788cb200 avutil/common: cast GET_BYTE/GET_16BIT returned value
In case of GET_BYTE/GET_16BIT return signed value.

(cherry picked from commit 0ae8df5f2c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-20 02:32:05 +01:00
Zhao Zhili
9c4d3a7add avfilter/vf_drawtext: fix call GET_UTF8 with invalid argument
For GET_UTF8(val, GET_BYTE, ERROR), val has type of uint32_t,
GET_BYTE must return an unsigned integer, otherwise signed
extension happened due to val= (GET_BYTE), and GET_UTF8 went to
the error path.

This bug incidentally cancelled the bug where hb_buffer_add_utf8
was being called with incorrect argument, allowing drawtext to
function correctly on x86 and macOS ARM, which defined char as
signed. However, on Linux and Android ARM environments, because
char is unsigned by default, GET_UTF8 now returns the correct
return, which unexpectedly revealed issue #20906.

(cherry picked from commit a5cc0e5c9e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-20 02:31:47 +01:00
Zhao Zhili
b5fb8749b9 avfilter/vf_drawtext: fix incorrect text length
From the doc of HarfBuzz, what hb_buffer_add_utf8 needs is the
number of bytes, not Unicode character:
hb_buffer_add_utf8(buf, text, strlen(text), 0, strlen(text));

Fix issue #20906.

(cherry picked from commit 9bc3c572ea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-20 02:30:46 +01:00
Michael Niedermayer
946407193a Update for 8.0.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 03:51:22 +01:00
Michael Niedermayer
27def36203 avfilter/vf_drawtext: Account for bbox text seperator
Fixes: out of array access
no test case

Found-by: Joshua Rogers <joshua@joshua.hu> with ZeroPath
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ad956ff076)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:03 +01:00
Michael Niedermayer
6777ab8e88 avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size
Fixes: out of array access
no testcase

Found-by: Joshua Rogers <joshua@joshua.hu> with ZeroPath
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 41a9c6ec5f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:03 +01:00
Michael Niedermayer
0831f98933 avcodec/rv60dec: Clear blk_info
Fixes: use of uninitialized memory
Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5103986067963904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 729d0379ab)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:02 +01:00
Michael Niedermayer
719171a375 avformat/whip: Fix rtp_ctx->streams access
Fixes: out of array access
No testcase

Found-by: Joshua Rogers <joshua@joshua.hu> with ZeroPath
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c199b3d48f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:02 +01:00
Michael Niedermayer
6157fafd8a avcodec/utvideodec: Set B for the width= 1 case in restore_median_planar_il()
Fixes: use of uninitialized memory
Fixes: 439878388/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-5635866203848704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 59db32b433)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:02 +01:00
Michael Niedermayer
6a1bb9c09f avcodec/osq: Fix 32bit sample overflow
Fixes: signed integer overflow: 2147483565 + 128 cannot be represented in type 'int'
Fixes: 428055715/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6358069900804096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 08816b9376)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:02 +01:00
Michael Niedermayer
58efabb076 avformat/rtpdec_rfc4175: Only change PayloadContext on success
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c03e49dd1d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:02 +01:00
Michael Niedermayer
b833558b76 avformat/rtpdec_rfc4175: Check dimensions
Fixes: out of array access
Fixes: zeropath/int_overflow_in_rtpdec_rfc4175

Found-by: Joshua Rogers <joshua@joshua.hu>
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d4e0d5ed48)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:01 +01:00
Michael Niedermayer
c1b57e2102 avformat/rtpdec_rfc4175: Fix memleak of sampling
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit af3dee3132)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:01 +01:00
Michael Niedermayer
cfc6fe6400 avformat/http: Fix off by 1 error
Fixes: out of array access
Fixes: zeropath/off-by-one-one-byte

Found-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b518c027a0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:01 +01:00
Michael Niedermayer
915272f5c7 avcodec/exr: spelling
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d80f8f3651)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:01 +01:00
oblivionsage
5a6e2b0ab1 avcodec/rv60dec: add upper bound check for qp
The quantization parameter (qp) can exceed 63 when the base value
from frame header (0-63) is combined with the offset from slice data
(up to +2), resulting in qp=65. This causes out-of-bounds access to
the rv60_qp_to_idx[64] array in decode_cbp8(), decode_cbp16(), and
get_c4x4_set().

Fixes: Out-of-bounds read
Signed-off-by: oblivionsage <cookieandcream560@gmail.com>

No testsample is available

This is related to 61cbcaf93f and clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5160167345291264
which fixed rv60_qp_to_idx[qp + 32] out of array access
These 2 checks are not redundant and neither covers the cases of the other

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8abeb879df)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:01 +01:00
veygax
a048a80554 avcodec/exr: use tile dimensions in pxr24 UINT case
update the switch statement for EXR_UINT in pxr24_uncompress to
correctly use the tile width td->xsize instead of using the full window
width s->xdelta. s->delta is larger than td->xsize which lead to two
buffer overflows when interacting with the ptr variable in the same
switch statement.

Fixes: out of bounds read and write
Found-by: veygax's insomnia network (INSOMNIA-1)
Signed-off-by: veygax <veyga@veygax.dev>
(cherry picked from commit 162f75b5e6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:01 +01:00
Michael Niedermayer
68e61becf9 avcodec/exr: Simple check for available channels
The existing is_luma check is fragile as depending on the order
of channels it can be set or reset

No testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6e8cf0377f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:00 +01:00
Michael Niedermayer
bc680e230c avformat/sctp: Check size in sctp_write()
Fixes: out of array access
No testcase

Found-by: Joshua Rogers <joshua@joshua.hu> with ZeroPath
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5b98cea4bf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:00 +01:00
Michael Niedermayer
89c5d8bdab avformat/rtmpproto: consider command line argument lengths
Fixes: out of array access
Fixes: zeropath/rtmp-2025-10

Found-by: Joshua Rogers <joshua@joshua.hu>
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 83e0298de2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:00 +01:00
Michael Niedermayer
bb680a9d53 avformat/rtmpproto_ Check tcurl and flashver length
Fixes: out of array accesses

Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a64e037429)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:00 +01:00
Michael Niedermayer
dd062bfaf3 avcodec/g723_1enc: Make min_err 64bit
This is intending to fix the case described in https://lists.ffmpeg.org/archives/list/ffmpeg-devel@ffmpeg.org/thread/AAZ7GJPPUJI5SCVTDGJ6QL7UUEP56WOM/
Where FCBParam optim is used uninitialized

a min_err of 1<<30, allows the struct to be never initilialized as all
err (which is int32_t) can be larger than min_err. By increasing min_err
above the int32_t range this is no longer possible

Untested, as i do not have the testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>i
(cherry picked from commit 909af3a571)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:00 +01:00
Michael Niedermayer
a130ed479b avcodec/vlc: Clear val8/16 in vlc_multi_gen() by av_mallocz()
Fixes: use of uninitialized memory
Fixes: 427814450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_DEC_fuzzer-646512196065689
Fixes: 445961558/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-5515158672965632

the multi vlc code will otherwise return uninitialized data. Now one can argue that this data should
not be used, but on errors this data can remain ...

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d8ffec5bf9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:05:00 +01:00
Michael Niedermayer
8b42ed314a avformat/rtpenc_h264_hevc: Check space for nal_length_size in ff_rtp_send_h264_hevc()
Fixes: memcpy with negative size
Fixes: momo_trip-poc/input

Reported-by: Momoko Shiraishi <shiraishi@os.is.s.u-tokyo.ac.jp>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d03483bd26)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:59 +01:00
Michael Niedermayer
67ed7fddac avcodec/ffv1enc: Consider variation in slice sizes
When splitting a 5 lines image in 2 slices one will be 3 lines and thus need more space

Fixes: Assertion sc->slice_coding_mode == 0 failed at libavcodec/ffv1enc.c:1668
Fixes: 422811239/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-4933405139861504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 388e6fb3be)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:59 +01:00
Michael Niedermayer
71ecb3d626 libavcodec/cbs_apv_syntax_template: limit tile to 2gb
We do not support larger tiles as we use signed int
Alternatively we can check this in apv_decode_tile_component() or init_get_bits*()
or support bitstreams above 2gb length

Fixes: init_get_bits() failure later
Fixes: 421817631/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4957386534354944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4666c1eed3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:59 +01:00
Michael Niedermayer
dcf7f9b70c swscale/output: Fix unsigned cast position in yuv2*
Fixes: signed overflow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 566e9032b1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:59 +01:00
Michael Niedermayer
716cf25eb8 swscale/output: Fix integer overflow in yuv2ya16_X_c_template()
Found-by: colod colod <colodcolod7@gmail.com>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0c6b7f9483)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:59 +01:00
Michael Niedermayer
aad0a7d8f6 avcodec/exr: Check that DWA has 3 channels
The implementation hardcodes access to 3 channels, so we need to check that
Fixes: out of array access
Fixes: BIGSLEEP-445394503-crash.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7896cc67c1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:58 +01:00
Michael Niedermayer
1cac745f2d avcodec/exr: check ac_size
Fixes: out of array read
Fixes: dwa_uncompress.py.crash.exr

The code will read from the ac data even if ac_size is 0, thus that case
is not implemented and we ask for a sample and error out cleanly

Found-by: Google Big Sleep

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8e078826da)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:58 +01:00
Michael Niedermayer
ac0a59de51 avcodec/exr: Round dc_w/h up
Without rounding them up there are too few dc coeffs for the blocks.
We do not know if this way of handling odd dimensions is correct, as we have
no such DWA sample.
thus we ask the user for a sample if she encounters such a file

Fixes: out of array access
Fixes: BIGSLEEP-445392027-crash.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c911e00011)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:58 +01:00
Michael Niedermayer
9f6c98a32e avcodec/mjpegdec: Explain buf_size/width/height check
Suggested-by: Ramiro

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 61b6877637)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:58 +01:00
Michael Niedermayer
a7f9caa662 configure: strip non numeric trailer from gcc version
Fixes: ../configure: 7820: [: Illegal number: 13-win32

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b1cbc7c8ff)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:58 +01:00
Michael Niedermayer
8674f8c3cd avformat/dhav: Fix off by length of read element error
Fixes: out of array read
Fixes: BIGSLEEP-445383648
Fixes: crash_input_1/2/3.dhav

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 55e71768cf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:58 +01:00
Andreas Rheinhardt
bb0e3e7a7c avformat/aviobuf: Keep checksum_ptr consistent in avio_seek()
Otherwise it might be > buf_ptr in which case ffio_get_checksum()
could segfault (s->buf_ptr - s->checksum_ptr would be negative
which would be converted to something very big when converted
to unsigned for the update_checksum callback).

Fixes ticket #11233.

Reported-by: Du4t
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 987c955cd7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:57 +01:00
Zhao Zhili
277384f039 doc/examples/vaapi_encode: fix invalid check on fwrite
enc_pkt->size is 0 after av_packet_unref, which makes the check invalid.

Fix regression from 3e4bfff2.

Co-Authored-by: Jin Bo <jinbo@loongson.cn>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit 09856e4e48)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:57 +01:00
Andrey Semashev
4a73c79ad5 avcodec/librsvgdec: fix compilation with librsvg 2.50.3
This fixes compilation with librsvg 2.50.3: error: viewport undeclared

This was a regression since commit
86ed68420d.

Fixes #10722.

Reviewed-by: Leo Izen <leo.izen@gmail.com>
(cherry picked from commit 9ee7796c54)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:57 +01:00
Cameron Gutman
7d741cc3b4 avcodec/mfenc: fix memory leak with D3D11 input surfaces
Fixes: d56522c6eb ("avcodec/mfenc: add support for D3D11 input surfaces")
Signed-off-by: Cameron Gutman <aicommander@gmail.com>
(cherry picked from commit b2910ec92e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:57 +01:00
Niklas Haas
520570dbeb swscale/graph: fix double-free when legacy pass fails initializing
If this function returns an error after ff_sws_graph_add_pass() has been
called, and the pass->free callback is therefore already set up to free the
context, the graph will end up freed twice: once by the pass->free callback
(during ff_sws_graph_free()), and once before that by failure path of the
caller (e.g. add_legacy_sws_pass(), or init_legacy_subpass() itself for
cascaded contexts.)

The solution is to redefine the ownership of SwsGraph to pass clearly from
the caller of add_legacy_sws_pass() to init_legacy_subpass(), which can then
deal with appropriately freeing the context conditional on whether or not the
pass was already registered in the pass list.

Reported-by: 김영민 <kunshim@naver.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
(cherry picked from commit 4ede75b5f4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-19 02:04:57 +01:00
Desmond Liu
8e8c1f498d libavformat/udp: Fix call to recvfrom(2)
Last parameter to recvfrom() is not initialized, causing
recvfrom() to randomly return EINVAL. Issue was introduced in
af04a27893.

(cherry picked from commit 4348bde2d2)
2025-11-19 00:58:21 +00:00
Carl Hetherington via ffmpeg-devel
5630394ebf avfilter/f_ebur128: Fix incorrect ebur128 peak calculation.
Since 3b26b782ee it would only look at the
first channel.

Signed-off-by: Carl Hetherington <cth@carlh.net>
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
(cherry picked from commit 1eb2cbd865)
2025-11-18 08:56:57 +01:00
Brad Smith
cb570f824d avformat/udp: fix warning about unused varible
libavformat/udp.c:283:9: warning: unused variable 'i' [-Wunused-variable]

Signed-off-by: Brad Smith <brad@comstyle.com>
(cherry picked from commit db0b86a4ad)
2025-11-16 21:13:46 -05:00
James Almer
2790dd608c avdevice/lavfi: stop setting deprecated buffersink options
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit b478037423)
2025-11-13 21:05:12 -03:00
Gyan Doshi
22d0f10943 configure: unbreak glslang build
Don't unconditionally link to libSPVRemapper which was removed in 16.0 in 3a7f787
2025-11-12 21:23:34 +01:00
Ramiro Polla
44bfe0da61 swscale/range_convert: fix truncation bias in range conversion
384fe39623 introduced a regression in the
range conversion offset calculation, resulting in a slight green tint
in full-range RGB to YUV conversions of grayscale values.

The offset being calculated was not taking into consideration a bias
needed for correctly rounding the result from the multiplication stage,
leading to a truncated value.

Fixes issue #11646.

(cherry picked from commit 4bee010844)
2025-11-06 21:57:08 +01:00
Bin Peng
b660192fb8 lavc/aarch64: Fix addp overflow in ff_pred16x16_plane_neon_10
The mismatch between neon and C functions can be reproduced
using the following bitstream and command line on aarch64 devices.

wget https://streams.videolan.org/ffmpeg/incoming/replay_intra_pred_16x16.h264
 ./ffmpeg -cpuflags 0  -threads 1 -i replay_intra_pred_16x16.h264  -f framemd5 -y md5_ref
 ./ffmpeg              -threads 1 -i replay_intra_pred_16x16.h264 -f framemd5 -y md5_neon

Signed-off-by: Bin Peng <pengbin@visionular.com>
(cherry picked from commit 3115c0c0e6)
2025-11-03 15:53:36 +02:00
James Almer
71007e6c12 avcodec/mlpdec: don't depend on context channel layout when setting substream masks
If avctx->ch_layout is unset (as it's allowed and even expeced by the
AV_CODEC_CAP_CHANNEL_CONF flag), the code setting substream masks will fail for
stereo and mono layouts unless a downmix channel was requested.
Fix this by deriving the mask with coded values only.

Fixes issue #20764.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 530ca627a3)
2025-10-28 13:39:37 -03:00
James Almer
24205bc657 avformat/demux: pass new extradata to the parser
The parser API doesn't work with packets, only raw data, so in order for it to
be made aware of new extradata propagated through packet side data we need to
pass it in some other form, namely, replacing the main extradata and ensuring
it will be parsed by restarting the parser.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-10-28 11:45:10 -03:00
Vittorio Palmisano
7cbc26267b avfilter/af_whisper: fix srt index
The srt index should be incremented for each segment.

(cherry picked from commit 9970dc32bf)
2025-10-20 12:46:16 +08:00
Vittorio Palmisano
d8049e01d7 avfilter/af_whisper: fix int64 printf format
Use PRId64 for printing int64_t values in the SRT output.

(cherry picked from commit f18b1e2389)
2025-10-20 12:46:04 +08:00
Vittorio Palmisano
adc819773b avfilter/af_whisper: fix srt file format
The SRT file format requires commas in the time string, not periods.

(cherry picked from commit 73d411c399)
2025-10-20 12:45:51 +08:00
Gyan Doshi
b784c3eb6d avfilter/whisper: correct option formatting
(cherry picked from commit 7df9271272)
2025-10-20 12:45:40 +08:00
Zhao Zhili
bb65f51fce avfilter/af_whisper: fix broken output for multibyte character
text + 1 can break a multibyte character, e.g., Chinese in UTF-8.
There is no space at the beginning in this case.

(cherry picked from commit 1d06e8ddcd)
2025-10-20 12:45:27 +08:00
Marvin Scholz
d1f31a829d avformat/rtsp: fix leading space in RTSP reason
When parsing the RTSP message reason, the whole remainder
after parsing the status code was used, which would lead to
a leading space in the parsed reason string.

(cherry picked from commit e63e040f0c)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-10-16 15:57:19 +02:00
Marvin Scholz
1e56c51d3b avformat/rtsp: do not log invalid values
When reading fails the first time, ch would be uninitialized and
printed in the log message. Instead check for an error early and
log it properly.

(cherry picked from commit 2ed47ab725)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-10-16 15:57:19 +02:00
Marvin Scholz
45fcd5567a avformat/http: Handle IPv6 Zone ID in hostname
When using a literal IPv6 address as hostname, it can contain a Zone ID
especially in the case of link-local addresses. Sending this to the
server in the Host header is not useful to the server and in some cases
servers refuse such requests.

To prevent any such issues, strip the Zone ID from the address if it's
an IPv6 address. This also removes it for the Cookies lookup.

Based on a patch by: Daniel N Pettersson <danielnp@axis.com>

(cherry picked from commit 5cb6d2221a)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-10-16 15:57:19 +02:00
James Almer
558994b051 avformat/dump: fix log level passed to av_log when printing stream group side data
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 2e1d702cfc)
2025-10-15 20:31:21 -03:00
James Almer
dd00a614e1 avcodec/hevc/sei: don't attempt to use stale values in HEVCSEITDRDI
Invalidate the whole struct on SEI reset.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 8e01bff774)
2025-10-09 12:15:41 -03:00
James Almer
046a8293e1 avcodec/hevc/sei: prevent storing a potentially bogus num_ref_displays value in HEVCSEITDRDI
Fixes: 439711052/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4956250308935680
Fixes: out of array access

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d448d6d1a0)
2025-10-09 12:15:41 -03:00
James Almer
d961a634fb avcodec/hevc/refs: don't unconditionally discard non-IRAP frames if no IRAP frame was seen before
Should fix issue #20661

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 4377affc28)
2025-10-09 12:15:41 -03:00
Brad Smith
d8605a6b55 libavutil/arm: Rename the HWCAP defines
Rename the HWCAP defines to use the same naming scheme as AArch64 and PPC.

(cherry picked from commit ced4a6ebc9)
Signed-off-by: Brad Smith <brad@comstyle.com>
2025-09-24 19:55:16 -04:00
Brad Smith
c9b8e5999b libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
- FreBSD/OpenBSD have elf_aux_info() on arm
- Wrap AT_HWCAP as the value is different for BSD vs Linux (16 vs 25)

(cherry picked from commit cdae5c3639)
Signed-off-by: Brad Smith <brad@comstyle.com>
2025-09-24 19:53:04 -04:00
Patrick Wang
b9adbf0fcc fftools/ffmpeg: fix gracefully shutdown
d119ae2fd8 removed the loop-breaking condition
received_sigterm.
Thus, signals no longer gracefully shutdown ffmpeg.

Fixes: #10834

Signed-off-by: Patrick Wang <mail6543210@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d7173e982e)
2025-09-22 22:46:25 +02:00
James Almer
e322e2e5d9 avcodec/decode: sync initial_pict_type and intra_only_flag with thread worker's avctx
Regression since 5acbdd2264, which removed
setting both values from PerThreadContext.
Given the pthread code calls ff_decode_receive_frame_internal() on the frame,
any value set before it will be overwritten, so instead sync each thread's
DecodeContext and let ff_decode_receive_frame_internal() handle these values.

Fixes issue #20534.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 26f4230082)
2025-09-16 15:55:22 -03:00
James Almer
61c50407fd avcodec/x86/pngdsp: add missing emms at the end of add_png_paeth_prediction
Fixes unpredictable behavior with floats.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 57a29f2e7d)
2025-09-15 23:42:58 -03:00
Zhao Zhili
b9dd25b80a avcodec/videotoolboxenc: ensure bitrate is set in low_delay mode
VideoToolbox doesn't support automatic bitrate in low delay mode.
Check bitrate and show error message so user knows what's going
wrong.

(cherry picked from commit c1dc2e2b7c)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-09-15 12:25:00 +00:00
Cameron Gutman
0ca188e0d6 avcodec/videotoolboxenc: allow low latency RC with HEVC
It is supported only for H.264 on Intel Macs, but it can be used with
both H.264 and HEVC on Apple Silicon.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
(cherry picked from commit d87210745e)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-09-15 12:25:00 +00:00
Zhao Zhili
d3265e15ee avcodec/videotoolboxenc: support global_quality without qscale
(cherry picked from commit fc45127bcc)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-09-15 12:25:00 +00:00
Zhao Zhili
a2179be5e9 avcodec/videotoolboxenc: fix the loss of precision when calculating quality
(cherry picked from commit 73750489a6)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-09-15 12:25:00 +00:00
James Almer
4f8b3891ee fftools/ffmpeg_demux: ensure the display_rotation option is honored
If requested, it should have priotity over any coded value.
Fixes ticket #11649.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 70a6ad6c74)
2025-09-11 23:24:00 -03:00
James Almer
e0a971a8fa avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix
Otherwise, the user requested priority of packet side data will be ignored.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-11 23:23:54 -03:00
James Almer
7cc24cee16 avutil/tests/aes_ctr: extend the test to cover payloads smaller than a block
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 799c133273)
2025-09-11 18:38:36 -03:00
James Almer
e4e57bef31 avutil/aes_ctr: reintroduce the block offset state
Wrongly removed in fe73b84879, it's required for
calls with a payload smaller than a full block.

Fixes issue #20474.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 335ba4a649)
2025-09-11 18:38:36 -03:00
James Almer
08a81b090b avfilter/vf_lcevc: support LCEVCdec version 4
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-25 10:42:12 -03:00
James Almer
1c9d70c4af avcodec/lcevcdec: support LCEVCdec version 4
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-25 10:41:50 -03:00
Damiano Galassi
e219c8f77b movenc: ensure chapters track extradata is not null and populated
fix a regression introduced in 4eca8df,
writing chapters failed if chapters where
not available before mov_write_header().

(cherry picked from commit b2f5bc7fd3)
2025-08-24 10:32:33 -03:00
Michael Niedermayer
140fd653ae Changelog: Remove "version <next>"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:57:24 +02:00
Michael Niedermayer
09f15530e5 RELEASE_NOTES: Based on the version from 5.1
Name suggested by 3 people on ML

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:15:31 +02:00
Manuel Lauss
af310e68db avcodec/sanm: fix issues with FTCH offset hack
Just add an extra x/y offset parameter pair to process_frame_obj(),
and store the size of the data to FTCH in a separate context member.
The only valid sizes for FTCH are 6 and 12, reject any other.
Finally, if a FOBJ uses codecs37 and above, enforce it to be subversion 2,
to use the simpler STOR/FTCH method.

Fixes BIGSLEEP-440183164/process_ftch.anim

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d311382c38)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:07:20 +02:00
Michael Niedermayer
c3747e011e avcodec/sanm: Eliminate reference into reallocated frame
AFAIK the original decoder uses the frame buffers in very strange ways
our implementation seems to mimic that and that results in the
bitstream input to point into a frame buffer while code then
parses that and potentially reallocates the frame buffer
leaving pointers hanging into dealllocated space

This simply uses a temporary buffer

Fixes: Writing into freed buffers
Fixes: BIGSLEEP-440183164/old_codec21.anim
Fixes: BIGSLEEP-440183164/old_codec4.anim

Found-by: Google Big Sleep

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c41a70b6bb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:07:20 +02:00
Michael Niedermayer
f258c9a8e5 avcodec/sanm: Replace impossible bitstream check by assert
the space left and size have already been cross checked by the caller

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d4e28917af)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:07:19 +02:00
Marvin Scholz
a6c578ef65 avformat/hlsproto: explicitly deprecate it
This makes it more clear that it will be removed in a future release.
2025-08-22 00:28:33 +02:00
Mark Thompson
efa64c2acc hwcontext_vulkan: Fix build with older Vulkan headers
(cherry picked from commit 4a42e5a1e2)
2025-08-22 04:44:19 +09:00
Mark Thompson
9c5f654e44 hwcontext_vulkan: Fix build
(cherry picked from commit 19473362fc)
2025-08-22 04:44:19 +09:00
Mark Thompson
5494973d28 cbs_vp9: Fix VP9 passthrough
Don't overwrite the bitstream values when updating the top-level loop
filter and segmentation state, instead do the update separately at the
end of the frame parsing.

This also reverts the change to the passthrough tests which made them
have output not matching the input.

(cherry picked from commit 26a2a76346)
2025-08-22 04:44:19 +09:00
Benjamin Cheng
15cb74fc68 vulkan_vp9: Read segment and lf data from cbs
The previous change 26a2a76346 broke Vulkan decoding because the lf and
segmentation values contained within VP9RawFrameHeader can no longer be
updated.

Read the propogated values from the CBS instead.

(cherry picked from commit 7bfaa6d662)
2025-08-22 04:42:30 +09:00
vytskalt
9ddd245b09 hwcontext_vulkan: transfer EXCLUSIVE images to correct queue families
(cherry picked from commit a6b5a382dd)
2025-08-22 04:42:30 +09:00
Lynne
c1a7f4040a lavfi/bwdif_vulkan: fix typo in temp_diff assignment
Thanks to Niklas Haas for pointing this out.

(cherry picked from commit 451e6bed43)
2025-08-22 04:42:30 +09:00
Kacper Michajłow
17f4cc0992 avcodec/vulkan_encode_av1: use CODEC_PIXFMTS to define pix_fmts
Fixes deprecation warnings.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit b7a3c426ea)
2025-08-22 04:42:30 +09:00
Niklas Haas
eeff85f15d avutil/hwcontext_vulkan: also re-query dprops in device_init()
This can be unset if using an externally provided device, as in this case
device_create() never gets called.

(cherry picked from commit 881224b213)
2025-08-22 04:42:30 +09:00
Michael Niedermayer
bc88c1d62e Prepare for 8.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 21:51:04 +02:00
Lynne
3b8fe34a30 aacdec_usac: use RefStruct to track unfinished extension buffers
Extensions in AAC USAC can be stored across multiple frames (mainly to keep CBR compliance).
This means that we need to reallocate a buffer when new data is received, accumulate the bitstream data,
and so on until the end of extension flag is signalled and the extension can be decoded.

This is made more complicated by the way in which the AAC channel layout switching is performed.
After decades of evolution, our AAC decoder evolved to double-buffer its entire configuration.
All changes are buffered, verified, and applied, on a per-frame basis if required, in often
random order.

Since we allocate the extension data on heap, this means that if configuration is applied,
in order to avoid double-freeing, we have to keep track of what we've allocated.

It should be noted that extensions which are spread in multiple frames are generally rare,
so an optimization to introduce av_refstruct_realloc() wouldn't generally be useful across the codebase.
Therefore, a copy is good enough for now.

Thanks to Michael Niedermayer for additional fixing.

Fixes: double free
Fixes: 393523547/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6740617236905984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
(cherry picked from commit c05fc27dd3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:52 +02:00
Michael Niedermayer
ac8cbf2ad7 avcode: Use av_fast_realloc() in ff_lzf_uncompress()
Fixes: 438961582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5850827739955200
Fixes: mixed up realloc() functions

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Co-Authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 0a5046c099)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:52 +02:00
Michael Niedermayer
30b308f7a8 avcodec/dxv: Check coded_height, to avoid invalid av_clip()
Fixes: assertion failure
Fixes: 438961582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5850827739955200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cdee519d40)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:51 +02:00
Michael Niedermayer
afc8c20946 avcodec/aac/aacdec: dont allow ff_aac_output_configure() allocating a new frame if it has no frame
Fixes: null pointer dereference
Fixes: crash_test.mp4

Found-by: Intel PSIRT
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fcf180d9ea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:51 +02:00
Michael Niedermayer
debbeb006b avformat/lrcdec: Fix fate-sub-lrc-ms-remux on x86-32
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0243cf89b1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:51 +02:00
Michael Niedermayer
8c117d7fec swscale/swscale_internal: Use more precisse gamma
Avoids failure of xyz12 fate tests on mingw and linux x86-32

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ca20d42cd7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:50 +02:00
Michael Niedermayer
5f8cb575e8 avcodec/sanm: Check w,h,left,top
The setup code fow w,h,left,top is complex, the code using it also falls in
at least 2 different classes, one using left/top the other not.

To ensure no out of array access happens we add this clear check.

Fixes: out of array access
Fixes: 439261995/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5383455572819968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 134fbfd1dc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:50 +02:00
James Almer
abf123b744 avformat/mov: don't use an allocated array for sample_size with HEIF images
The array is only ever needed for streams where each sample entry may have a
different value. Given that for non animated HEIF there's a single value that
applies to the image, use the field defined for that.

Fixes: NULL pointer dereference
Fixes: 437528618/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6537287645331456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit a28e01a6c1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:50 +02:00
Michael Niedermayer
e97babf6bc avcodec/rv60dec: clear pu_info
pu_info is read uninitialized on damaged input and at that point the following codepath is dependant
on the uninitialized data. In one of these pathes out of array accesses happen.
None of this is replicatable

Less uninitialized data also should result in more reproducable reports

Fixes: Use of uninitialized memory
Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5103986067963904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 50affd2b09)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:49 +02:00
Kacper Michajłow
9bc89a2605 avformat/tls_openssl: use ascii - (0x2D) instead of 0x2010 hyphen
Too much AI is bad for you...

Fixes: 167e343bbe
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit 3a8b3dfeca)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:49 +02:00
Michael Niedermayer
ac5ff0ae89 avcodec/utvideodec: Clear plane_start array
in pack mode the array is passed into decode_plane() without being initialized or used

Fixes: use of uninitialized memory
Fixes: 438780119/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-5464037027807232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2a22972db3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:48 +02:00
Oliver Chang
a2e445918e avcodec/prores_raw: Fix heap buffer overflow
When dimensions differ from context, those were updated using
ff_set_dimensions, however this overwrote the aligned coded_width and
coded_height that were set before, leading to a buffer overflow when
writing the frame data.

Fixes: OssFuzz 438771336
Fixes: Heap-buffer-overflow

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
(cherry picked from commit c9e93df4ee)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:48 +02:00
Michael Niedermayer
34c39367aa .forgejo/CODEOWNERS: remove reference to secret apparently uncommited code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7d606ef0cc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:48 +02:00
Michael Niedermayer
3cab009519 fftools/ffmpeg_mux_init: Use 64bit for score computation in map_auto_video()
Fixes: signed integer overflow: 10 * 1952737655 cannot be represented in type 'int'
Fixes: PoC_avi_demux

Found-by: 2ourc3 (Salim LARGO)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cdbb5f1b93)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:47 +02:00
Michael Niedermayer
3e05b89590 tools/merge-all-source-plugins: Fix merge_internal() return code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b5b306ca31)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:47 +02:00
Michael Niedermayer
4a3e5ea8d2 tools: Split the list of source plugins out of "merge-all-source-plugins"
(cherry picked from commit fd31df4306)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:47 +02:00
Jiasheng Jiang
263e819aa4 libavfilter/dnn/dnn_backend_tf: Remove redundant av_freep() to avoid double free
Remove redundant av_freep() to avoid double free since task will be freed in dnn_free_model_tf() after the success of ff_queue_push_back().

Fixes: af052f9066 ("lavfi/dnn: fix mem leak in TF backend error handle")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
(cherry picked from commit b8d5f65b9e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:46 +02:00
Michael Niedermayer
23655160ea avcodec/dxv: Use av_fast_realloc() for op_data
makes things consistent

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 373bd80b16)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:46 +02:00
Michael Niedermayer
f2507dba3b avcodec/dxv: Use av_fast_realloc() and clear all new space
The code writing in the buffer has a wide range of error checks
which simply leave it partly uninitialized.

Initializing it on allocation ensures no sensitive data leaks and that
bugs are more reliably reproduceable

Fixes: use of uninitialized memory
Fixes: 435225510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-4521918634196992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a0b793737)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:46 +02:00
Michael Niedermayer
da3f5273fc avcodec/dxv: Clear ctex
same issue as with tex

Fixes: 431665305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5339599339847680
Fixes: use of uninitialized memory

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4e5f25c0a5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:45 +02:00
Michael Niedermayer
6049800a10 avcodec/dxv: Check that we initialize op_data
Fixes: 431665305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5339599339847680
Fixes: use of uninitialized memory

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6a8c41dcac)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:45 +02:00
Michael Niedermayer
e726f7af17 avcodec/sanm: Check mv in codec48_block()
Fixes: out of array read
Fixes: 436943287/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5011037029203968

This issue did oddly enough, not replicate

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d5bdb0b705)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:45 +02:00
Michael Niedermayer
de76fb27a6 avcodec/exr: Check for pixel type consistency in DWA
Fixes: out of array access
Fixes: BIGSLEEP-436511754/testcase.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0469d68acb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:44 +02:00
Kacper Michajłow
995d329cf9 avcodec/d3d12va_encode: fix label followed by a declaration warning
Fixes: d3d12va_encode.c: warning: label followed by a declaration is a
       C23 extension

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit ac6db22e37)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:44 +02:00
Kacper Michajłow
81dcb67813 avcodec/libvorbisdec: avoid overflow when assinging sample rate from long to int
Fixes: 416134551/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_DEC_fuzzer-6096101407260672
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit 2287a19abb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:44 +02:00
Kacper Michajłow
bde02336a4 avcodec/g726: init missing sample rate
Fixes: 416134551/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_G726_DEC_fuzzer-5695764455292928
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit c2f7dae70d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:43 +02:00
Kacper Michajłow
6b1f994e43 avformat/lrcdec: limit input timestamp range to avoid overflows
Fixes: clusterfuzz-testcase-ffmpeg_dem_LRC_fuzzer-5226140131459072
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit c74bc74398)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:43 +02:00
Michael Niedermayer
5051753833 avcodec/scpr3: Clear clr
clr is passing into decode_run_p() its not used when not set
but this possibly triggers msan (it doesnt locally)

Fixes?: use of uninintialized memory
Fixes?: 436997807/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-6253316466606080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3542260376)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:42 +02:00
Michael Niedermayer
a676267a2c avcodec/ilbcdec: Clear cbvec when used with create_augmented_vector()
Fixes: use of uninitialized memory
Fixes: 42538134/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-6322020827070464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9686fdd729)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:42 +02:00
Kacper Michajłow
bd55bf8300 avformat/mov: clear old name from infe
heif_items are reused and to avoid leaking memory or using stale name,
clear it first.

Fixes: 432505829/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6654363487764480
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit 3bf8bf965f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:42 +02:00
Leon Grutters
64c71cbe4e doc/community.texi: fix spelling error
Fixes: 262d41c804 ("all: fix typos found by codespell")
Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
(cherry picked from commit 777408d149)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:41 +02:00
Michael Niedermayer
2feaad5cb9 tools/merge-all-source-plugins: set version
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:41 +02:00
wangbin
048f6f4bd5 configure: fix -L flags for lld-link 2025-08-15 20:22:51 +02:00
Kacper Michajłow
4558ad6a77 avcodec/Makefile: add missing dependency for prores raw decoder (again)
proresdata.o is also needed, missed in a9e7b5aa07

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 21:08:15 +02:00
Kacper Michajłow
937d9ed849 avcodec/Makefile: add missing dependency for prores raw decoder
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 07:54:51 -04:00
James Almer
13b161cd24 avcodec/cbs_apv: store derived tile information in a per frame basis
If a single fragment contains more than one frame unit, the tile information stored
in the private context will only correspond to one of them.

Fixes: crash (out of array access)
Fixes: 435489659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-6194885205229568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 4b39d776c3)
2025-08-12 19:13:06 -03:00
Michael Niedermayer
7c92f740ee avcodec/apv_decode: make apv_format_table consistent with the code and check it
Fixes: writing in a null pointer
Fixes: 435278398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4566392923029504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cfce595572)
2025-08-12 19:13:06 -03:00
Marton Balint
057b94649f swscale/swscale_unscaled: use 8 line alignment for planarCopyWrapper with dithering
Dithering relies on a 8 line dithering table and the code always uses it from
the beginning. So in order to make dithering independent from height of the
slices used we must enforce a 8 line alignment.

Fixes issue #20071.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit b61e510e75)
2025-08-13 00:02:59 +02:00
Martin Storsjö
26da3d0069 fate: Fix the sub-mcc tests on Windows in eastern time zones
Previously, these tests failed when running on Windows, if the
system is configured with a time zone east of Greenwich, i.e.
with a positive GMT offset.

The muxer converts the creation_date given by the user using
av_parse_time to unix time, as a time_t. The creation_date is
interpreted as a local time, i.e. according to the current time
zone. (This time_t value is then converted back to a broken out
local time form with localtime_r.)

The given reference date/time, "1970-01-01T00:00:00", is the
origin point for unix time, corresponding to time_t zero. However
when interpreted as local time, this doesn't map to exactly zero.
Time zones east of Greenwich reached this time a number of hours
before the point of zero time_t - so the corresponding time_t
value essentially is minus the GMT offset, in seconds.

Windows mktime returns an error, returning (time_t)-1, when given
such a "struct tm", while e.g. glibc mktime happily returns a
negative time_t. av_parse_time doesn't check the return value of
mktime for potential errors.

This is observable with the following test snippet:

    struct tm tm = { 0 };
    tm.tm_year = 70;
    tm.tm_isdst = -1;
    tm.tm_mday = 1;
    tm.tm_hour = 0;
    time_t t = mktime(&tm);
    printf("%d-%02d-%02d %02d:%02d:%02d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
    printf("t %d\n", (int)t);

By varying the value of tm_hour and the system time zone, one
can observe that Windows mktime returns -1 for all time_t values
that would have been negative.

This range limit is also documented by Microsoft in detail at
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64.

To avoid the issue, pick a different, arbitrary reference time,
which should have a nonnegative time_t for all time zones.

(cherry picked from commit 13139d6d83)
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-08-12 13:45:57 +03:00
Leo Izen
a8fdfddedb avcodec/vp9: fix leaked cbs fragment AVBufferRef
When this function returns, the fragment is never reset, so
current_frag->data_ref is never unref-ed, which ends up leaking it.
We call ff_cbs_fragment_reset to release the reference on its buffer.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-10 21:05:43 -04:00
Jacob Lifshay
89849ca92a tests/fate/subtitles: add test for smpte436m_to_eia608 bsf
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:35 -04:00
Jacob Lifshay
370cff8b33 lavc/bsf/smpte436m_to_eia608: fix memory leak -- forgot to free input av_packet
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:26 -04:00
Jacob Lifshay
9fd3869212 lavc/bsf/eia608_to_smpte436m: fix memory leak -- forgot to free input av_packet
reported in https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20024#issuecomment-2405

Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:15 -04:00
Jacob Lifshay
0a167141d0 tests/fate/subtitles: fix mcc test input file paths
they use tests/ref/fate/sub-mcc-remux as input,
so prefix them with $(SRC_PATH) so building works
when not in the source directory.

Fixes: #20183
Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:07 -04:00
Michael Niedermayer
7eaa0f799a Bump versions for release/8.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 17:30:39 +02:00
Michael Niedermayer
f4f263aad0 Changelog: Add 8.0 marker
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 17:26:13 +02:00
Michael Niedermayer
519d406ce9 doc/APIchanges: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 17:26:13 +02:00
Michael Niedermayer
d6fe3786cd avcodec/jpeg2000dec: Make sure the 4 extra bytes allocated are initialized
Fixes: use of uninitialized memory
Fixes: 429130590/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_DEC_fuzzer-5736930522497024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 14:25:47 +00:00
Vittorio Palmisano
6d9f0b662f libavfilter: add af_whisper codeowner 2025-08-09 15:21:40 +02:00
Lynne
a9fb323e88 vulkan: temporarily disable threading for ASIC-based hwaccels
The issue is that a race condition exists between threads locking
frames, which results in cyclic loops and deadlocks.

Compute-based implementations are not affected.

Fixes #20169
2025-08-09 15:07:56 +09:00
Timo Rothenpieler
5621eee672 avformat/tls: switch on peer certificate verification by default 2025-08-09 00:38:17 +00:00
Wu Jianhua
abf87f09cb forgejo/CODEOWNERS: add myself to d3d12va
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 21:51:15 +00:00
Wu Jianhua
b8230bfa7f mailmap: add entry for myself
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 21:51:15 +00:00
Wu Jianhua
ac3c1128cf MAINTAINERS: add myself as hwcontext_d3d12va maintainer
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 21:51:15 +00:00
Vittorio Palmisano
13ce36fef9 libavfilter: Whisper audio filter
It adds a new audio filter for running audio transcriptions with the whisper model.
Documentation and examples are included into the patch.
2025-08-08 21:59:56 +02:00
Wu Jianhua
2eaf044e2f CODEOWNERS: Add myself for VVC
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 17:51:52 +00:00
Nuo Mi
7773d734e5 CODEOWNERS: Add myself for VVC
Signed-off-by: Nuo Mi <nuomi2021@gmail.com>
2025-08-08 17:51:52 +00:00
Wu Jianhua
dff08a3d2a fate/vvc: add vvc-conformance-FIELD_A_4
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua
6d391cb2da fate/vvc: add vvc-conformance-ACT_A_3
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua
6e100b7963 fate/vvc: add vvc-conformance-10b422_L_5
This commit added 10b422_L_5 for testing palette mode.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua
de15422064 avcodec/vvc/dec: fix typo and also output log when the checksum is correct
It's helpful for developers and the same as the hevcdec.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua
8c9a2f40ad avcodec/h274: fix hash verification on BE
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua
77b9b9420b avcodec/vvc/ctu: should use the width and height of the start component
This commit fixed decoding the DUAL_TREE_CHROMA palette coding unit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Muhammad Faiz
35ea458354 avfilter/avf_showcqt: fix unbounded index when copying to fft_data
When timeclamp and/or fps are low, j can be negative.

Fix Ticket11640
2025-08-08 18:47:44 +02:00
Timo Rothenpieler
aac1cddbeb forgejo/CODEOWNER: forgejo uses regex to match paths 2025-08-08 18:14:58 +02:00
James Almer
1cde49ed82 avutil/hwcontext_vulkan: use uint64_t specifier in an av_log() call
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-08 15:24:57 +00:00
James Almer
88bec585bc avcodec/vulkan_encode_av1: use size_t specifier in an av_log() call
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-08 15:24:57 +00:00
James Almer
9212963093 avcodec/vulkan_encode_av1: remove unused variables
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-08 15:24:57 +00:00
Lynne
d132b63dd9 vulkan_encode_av1: properly give an FPS value for ff_av1_guess_level 2025-08-08 15:07:33 +00:00
Lynne
6f97c9384b configure: enable Vulkan VP9 decoding and AV1 encoding if the headers support it 2025-08-08 15:07:33 +00:00
Lynne
eb9e000584 vulkan_decode: add ifdefs around VP9 definitions and privatize profile struct
The struct is not referenced anywhere else.
2025-08-08 15:07:33 +00:00
Benjamin Cheng
f7a5128109 vulkan_av1: Fix frame threading
Basically do the same thing that was done for VP9, and remove the
vestigial frame_id_alloc_mask in the context.
2025-08-08 14:45:58 +00:00
Benjamin Cheng
4042609dcf vulkan_vp9: Fix frame threading
The original cleanup of frame_id_alloc_mask was done in free_frame_priv
which may be called after the start_frame for the next few frames,
causing the frame_id slots to be exhausted. Instead, decide the in-use
frame_id slots by checking the frame_id present in the DPB as we need it.
2025-08-08 14:45:58 +00:00
David Rosca
814dd634e0 lavc/vaapi_encode_av1: Fix ref_order_hint value for second slot
We always use two slots, even when only one L0 reference is supported
by the driver. However we still need to set the correct value for the
ref_order_hint of the second slot.

Fixes regression from bf9f921ef7 ("avcodec/hw_base_encode: restrict size of next_prev")
2025-08-08 13:14:07 +00:00
nyanmisaka
523134587a lavu/hwcontext_vaapi: drop a redundant check
vaapi_get_image_format() will be called in vaapi_map_frame().

So it's a double check, drop it to avoid redundancy.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-08-08 12:53:39 +00:00
nyanmisaka
eb9070aba4 lavu/hwcontext_vaapi: fix a race mapping to allow CSC to YUV420P
There's a race condition for YUV420P when mapping from pix_fmt
to VA fourcc, both I420 and YV12 could be found by pix_fmt.

Currently, vaapi_get_image_format() iterates over the query results
of pix_fmt and returns the first matching result in the order
declared in the driver. This may result in an incorrect image_format.

Now use fourcc to find the image_format.

Fixes:
ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i INPUT \
-vf scale_vaapi=format=yuv420p,hwmap,format=yuv420p \
-vframes 1 -f rawvideo -y yuv420p.yuv

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-08-08 12:53:39 +00:00
Michael Niedermayer
d643a5ba08 avcodec/aac/aacdec_usac: Limit sfo from noise offset to be above -200
Fixes: out of array read
Fixes: 397731127/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5577772965101568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-08 14:21:50 +02:00
Michael Niedermayer
01a1b99fc2 avcodec/aacsbr_template: Check ilb
Fixes: index 50 out of bounds for type 'INTFLOAT [40][2]'
Fixes: 401661737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4866055713652736

Someone knowing AAC well should review this, there is likely a nicer fix

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-08 14:21:36 +02:00
David Rosca
069daca9e0 vulkan_encode_av1: Fix uninitialized return value in write_extra_headers 2025-08-08 12:18:24 +00:00
David Rosca
db6fd82651 vulkan_encode_av1: Fix setting QP
Use the "qp" param instead of "global_quality" to match H264/5.
2025-08-08 12:00:16 +00:00
Niklas Haas
6862ec704a avfilter/vf_libplaceb: use TS2T() macro 2025-08-08 11:29:27 +00:00
Niklas Haas
d69ccbfc18 avfilter/vf_libplacebo: use the first visible input for metadata
Instead of undconditionally using the first input. This covers the case of
one layer fully obscuring another layer, in which case that should become
the new "base" layer.
2025-08-08 11:29:27 +00:00
Niklas Haas
62893fb94e avfilter/vf_libplacebo: flush render cache when input is invisible
This prevents leaking stale metadata from previous frames, for example if
an overlay temporarily obscures this input and then un-obscures it again. It
is worth pointing out that this does change the semantics subtly, because of
the smoothing period on detected HDR metadata, but I argue that the new
behavior is an improvement, as it will avoid leaking past metadata that is
definitely no longer relevant after an image is unobscured.
2025-08-08 11:29:27 +00:00
Niklas Haas
3091bca3ed avfilter/vf_libplacebo: skip rendering fully invisible planes
Sometimes, one input fully obscures another. In this case, we can skip
actually rendering any input below the obscuring one.

The reason I don't simply start the main render loop at `idx_start` will
become apparent in the following commit.

We can't use pl_frame_is_cropped() on this dummy frame, but we need to
determine the reference frame before we can map the real output, so to
resolve this conflict, we just reimplement the crop detection logic using
the output link dimensions.
2025-08-08 11:29:27 +00:00
Niklas Haas
6627c8ea4b avfilter/vf_libplacebo: skip empty inputs
It is possible for pl_queue_update() to return PL_QUEUE_OK, but to generate
an empty frame mix. This happens if the first frame of that input is in the
future.

In this case, we should skip an input as not active, similar to inputs that
have already reached EOF.
2025-08-08 11:29:27 +00:00
Niklas Haas
e57874768a avfilter/vf_libplacebo: simplify unnecessary indirection
in->idx is equal to the array index by definition, so just use the loop
index directly.
2025-08-08 11:29:27 +00:00
Niklas Haas
4125495849 avfilter/vf_libplacebo: whitelist properties on linear blend tex
Instead of copying over the entire target and changing a few fields,
set the entire struct to a whitelist of safe properties that we want to
persist on the intermediate texture.

In particular, this avoids leaking irrelevant state related to the
acquire/release callbacks, e.g., which can otherwise cause deadlocks
when the same vulkan frame is attempted to be acquired twice.
2025-08-08 11:29:27 +00:00
Lynne
4898a6400e Changelog: add entries for ProRes RAW decoder and ProRes RAW Vulkan hwaccel 2025-08-08 19:47:06 +09:00
Lynne
404de96e36 Changelog: add entries for AV1 Vulkan encoder and Vulkan VP9 hwaccel 2025-08-08 19:46:45 +09:00
Jacob Lifshay
14a95ab471 lavf: add mcc muxer
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
ceb9688fee lavf/mccdec: clean up, add support for mcc 2.0 features, and add SMPTE_436M_ANC output stream
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
a18d5a766d lavf/mxfenc: support EIA-608/708 streams by using eia608_to_smpte436m bsf
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
0271d0423a lavc: add eia608_to_smpte436m bitstream filter
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
aa5b9db7bd lavc: add smpte436m_to_eia608 bitstream filter
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
1c85a3832a lavc: add API for manipulating SMPTE-436M VBI/ANC data
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:42 -07:00
Jacob Lifshay
a566fcb9dc lavf: mxf [de]muxer now uses AV_CODEC_ID_SMPTE_436M_ANC instead of ..._NONE
this makes it easier to match against when using that format from other parts of ffmpeg.

Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:04:40 -07:00
Jacob Lifshay
f4ff379bae lavc: add AV_CODEC_ID_SMPTE_436M_ANC
This creates a new codec id for mxf vbi_vanc_smpte_436M streams.
This makes it easier to use from other [de]muxers and bitstream filters.

It's just the data in Table 7 (starts on page 13) of:
https://pub.smpte.org/latest/st436/s436m-2006.pdf

Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 03:02:57 -07:00
Jacob Lifshay
c421da385f forgejo/pre-commit/config: ensure .forgejo/pre-commit/ignored-words.txt is sorted
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 02:58:59 -07:00
Jacob Lifshay
880f82e2d2 forgejo/pre-commit/ignored-words: sort words
They were not sorted before, sort using: LC_ALL=C sort --ignore-case
since that's what file-contents-sorter (added in next commit) supports.

Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-08 02:58:59 -07:00
Benjamin Cheng
70cebba490 vulkan_encode: Remove unneeded VkImageUsageFlags
There is no point where we need to have the SAMPLED usage on the DPB
resource, and the ENCODE_DST usage does not mean anything.
2025-08-08 09:32:06 +00:00
Lynne
75aeffb1c6 lavc: add a ProRes RAW Vulkan hwaccel
This commit adds a ProRes RAW hardware implementation written in Vulkan.
Both version 0 and version 1 streams are supported.
The implementation is highly parallelized, with 512 invocations dispatched
per every tile, with generally 4k tiles on a 5.8k stream.

Thanks to unlord for the 8-point iDCT.

Benchmark for a generic 5.8k RAW HQ file:
6900XT: 63fps
7900XTX: 84fps
6000 Ada: 120fps
Intel: 9fps
2025-08-08 18:29:41 +09:00
Lynne
589b3ed943 lavc: add a ProRes RAW decoder 2025-08-08 18:29:41 +09:00
Lynne
5674879db5 proresdsp: add idct_put_bayer
This commit adds a 12-bit DCT function to directly write to Bayer
images. Will be used in the following commit.
2025-08-08 18:29:40 +09:00
Lynne
b2928971e8 lavc: add an av1_vulkan encoder
This commit adds a Vulkan AV1 encoder, using the native acceleration API.
2025-08-08 18:29:40 +09:00
Lynne
2caf23e7c4 vp9: add Vulkan VP9 hwaccel 2025-08-08 18:29:40 +09:00
Lynne
c0bf1382a7 lavc/vp9dec: use cbs_vp9 to parse the frame header 2025-08-08 18:29:39 +09:00
Zhao Zhili
7f150dc4b7 configure: Fix build with MSVC
The copyright message of cl.exe doesn't always begin with Microsoft,
e.g., when local is Chinese.

Fix regression since 53da090ab7.
2025-08-07 21:16:40 +00:00
Michael Niedermayer
85a2beaa81 avcodec/ffv1: Clear state on alloc
Fixes: use of uninitialized memory
Fixes: 428969823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-5909681623334912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:45:04 +00:00
Michael Niedermayer
27a541bb4c avcodec/utvideodec: Set B for the width= 1 case
Fixes: use of uninitialized meory
Fixes: 428034093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-6195630160805888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:45:04 +00:00
Michael Niedermayer
70fc46d185 avcodec/ffv1: Clear state on alloc
Fixes: use of uninitialized memory
Fixes: 428969823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-5909681623334912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:44:59 +00:00
Michael Niedermayer
032dfe8584 avcodec/utvideodec: Set B for the width= 1 case
Fixes: use of uninitialized meory
Fixes: 428034093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-6195630160805888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 19:44:59 +00:00
Sean McGovern
218a4fe28e CODEOWNERS: add myself for lib{avcodec,avutil,swscale}/ppc/ 2025-08-07 14:03:33 -04:00
Lynne
83b36f5410 lavc: bump minor version and add APIChanges entry for ProRes RAW 2025-08-08 01:06:11 +09:00
Lynne
5ff2886e9a lavc: add a ProRes RAW parser
Simple parser that only parses frame information.
This helps avoid requiring the software decoder on init to decode a
single frame, since the decoder can be quite slow.
2025-08-08 01:06:11 +09:00
Lynne
4ad35d78c9 lavc: add codec ID and profiles for ProRes RAW 2025-08-08 01:06:11 +09:00
Lynne
b8c92e2893 scale_vulkan: add support for basic Debayering 2025-08-08 01:06:11 +09:00
Lynne
bc327222e5 scale_vulkan: refactor shader initialization 2025-08-08 01:06:11 +09:00
Lynne
1f72bf5ec8 vulkan: add support for 16-bit RGGB Bayer pixfmt 2025-08-08 01:06:11 +09:00
Michael Niedermayer
01a292c7e3 avcodec/jpeg2000dec: implement cdef remapping during pixel format matching
Fixes: out of array access
Fixes: poc.jp2

Found-by: Andy Nguyen <theflow@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:56 +00:00
Michael Niedermayer
104d6846c1 avcodec/jpeg2000dec: move cdef default check into get_siz()
This way cdef is at its final value earlier

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:56 +00:00
Michael Niedermayer
f45da79b2c avcodec/exr: Dont access outside xsize/ysize
Fixes: out of array access
Fixes: BIGSLEEP-436510316/dwa_uncompress_write.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:35 +00:00
Michael Niedermayer
0d9c003d76 avcodec/exr: Check rle_raw_data and surroundings
Fixes: out of array read

Fixes: BIGSLEEP-436510153/dwa_uncompress_read.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 14:47:35 +00:00
Frank Plowman
8173ae547a CODEOWNERS: Add myself for VVC 2025-08-07 14:18:42 +00:00
Kacper Michajłow
ea56fe60ac avutil/avassert: use __builtin_assume if available
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-07 13:13:40 +00:00
Kacper Michajłow
fa458c7243 avformat/hls: fix handle_init_section_args callback type
Fixes: utils.c:524:9: runtime error: call to function
       handle_init_section_args through pointer to incorrect function type
       'void (*)(void *, const char *, int, char **, int *)'

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-07 07:36:33 +00:00
Kacper Michajłow
56e0a883c1 avutil/tx: zero whole array, not only one element
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-07 07:36:33 +00:00
Jiasheng Jiang
c64cff64a2 examples: Add check and replace av_free() to avoid potential memory errors
Add check for the return value of av_packet_alloc() to avoid potential NULL pointer dereference.
Moreover, replace redundant av_free() with fprintf().

Fixes: 9a38184a14 ("examples/decode_audio: allocate the packet dynamically")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:45 +02:00
Jiasheng Jiang
446cfbfb74 libavcodec/tests/snowenc: Add av_free() to avoid memory leak
Add av_free() to free s.temp_dwt_buffer and s.temp_idwt_buffer at the end of the function to avoid memory leak.

Fixes: 5d48e4eafa ("Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196'")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:44 +02:00
Jiasheng Jiang
a25462482c libavfilter/af_firequalizer: Add check for av_malloc_array()
Add check for the return value of av_malloc_array() to avoid potential NULL pointer dereference.

Fixes: d3be186ed1 ("avfilter/firequalizer: add dumpfile and dumpscale option")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:44 +02:00
Jiasheng Jiang
39592f2bab examples: Add proper deallocations to avoid potential memory leaks
Add proper deallocations in the error paths to avoid potential memory leaks.

Fixes: e7dfaf16a4 ("libavfilter: example audio filtering program")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:44 +02:00
Jiasheng Jiang
8b4e6ccb13 libavcodec/videotoolbox_vp9: Move av_malloc() to avoid memory leak
Move av_malloc() after the check for subsampling to avoid memory leak if subsampling < 0 and av_malloc() succeeds.

Fixes: a41a2efc85 ("lavc/videotoolbox: add VP9 hardware acceleration")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:43 +02:00
Maryla Ustarroz-Calonge
d5040b5560 avcodec/itut35: rename some provider codes
In general, a provider code corresponds to a company/organization, and
the name should be that of the company, not of a given feature.
The feature is signalled in the "provider oriented code".

The exception is HDR Vivid, where the code 0x0004 indicates the HDR Vivid
feature itself rather than CUVA (China UHD Video Industry Alliance),
according to the UHD World Associations 'HDR Video Technology Part 2-1
Application Guide to System Integration' document.

ITU_T_T35_PROVIDER_CODE_CUVA -> ITU_T_T35_PROVIDER_CODE_HDR_VIVID
ITU_T_T35_PROVIDER_CODE_LCEVC-> ITU_T_T35_PROVIDER_CODE_VNOVA
ITU_T_T35_PROVIDER_CODE_SMTPE -> ITU_T_T35_PROVIDER_CODE_SAMSUNG

Signed-off-by: Maryla Ustarroz-Calonge <maryla@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:43 +02:00
Maryla Ustarroz-Calonge
a3ec70b2cf avcodec/itut35: always check the provider code and country code together
ITU-T T.35 provider codes are attributed by national bodies and it's
possible to have collisions across countries. This is why the country code
must always be checked as well.

Use if statements rather than nested switches which would be unreadable.

Signed-off-by: Maryla Ustarroz-Calonge <maryla@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:43 +02:00
Maryla Ustarroz-Calonge
088ace3b6c avcodec/libdav1d: move itut-t35 parsing to a separate function
This is in preparation to change the switch statement to if/else.

Signed-off-by: Maryla Ustarroz-Calonge <maryla@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-07 03:07:42 +02:00
Michael Niedermayer
46892d0c7c Revert "forgejo/lint_commit_msg: add script for commit message linting"
This should be done by fate.
This script already blocks security fixes (https://code.ffmpeg.org/FFmpeg/FFmpeg/actions/runs/1046/jobs/0)

IMHO its not good
1. to add commit message formating rules, never discussed or agreed
2. to expect developers to push commits trial and error style, make fate
   can test this already and tell the devlopers before pushing, saving him
   time

This reverts commit cc6ad703b4.
2025-08-06 22:58:11 +00:00
Michael Niedermayer
ca5b873a8f .forgejo/CODEOWNERS: Add myself for a more libavutil bits which i know well
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-06 22:07:52 +00:00
Sean McGovern
10f1ff7dc2 configure: add POWER9 & 10 cpus
IBM introduced POWER9 in 2017 and likewise POWER10 in 2020.
2025-08-06 21:53:25 +00:00
Niklas Haas
ac59fc542f avfilter/vf_thumbnail: fix buffer overflow for odd sized HBD inputs
This histogram index was not correctly downshifted to 8-bit.
2025-08-06 21:25:46 +00:00
Kacper Michajłow
09cb2d41d1 avcodec/mpc8: init avctx->sample_rate
Fixes frame validation.

Fixes: 416134551/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC8_fuzzer-5765557242888192
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-06 21:04:56 +00:00
Kacper Michajłow
fb862976df avcodec/cbs_h266_syntax_template: fix out of bounds access
current->num_tile_columns is not updated in the loop, so the existing
check was not working. Check current index instead and break. This also
simplifies duplicated log.

Fixes: 435225531/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-6639684232216576
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-06 20:58:57 +00:00
Kacper Michajłow
75f30b4d3e avcodec/vvc/ctu: check coeff before multiply
ff_vvc_palette_escape_val() can return AVERROR in which case the
coeff*scale will overflow.

Fixes: runtime error: signed integer overflow: -1094995529 * 6528 cannot
       be represented in type 'int'
Fixes: 435225406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5118570024730624
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-06 20:16:03 +00:00
Wu Jianhua
df5199c63f avformat/Makefile: fix error unresolved external symbol ff_dtls_protocol
Introduced by 307983b292

Use the following command line to reproduce the issue:
./configure --toolchain=msvc --disable-asm --enable-ffmpeg \
--disable-everything --enable-decoder=vvc --enable-parser=vvc \
--enable-demuxer='vvc,mpegts' --enable-protocol='file,pipe' \
--enable-encoder='rawvideo,wrapped_avframe' \
--enable-muxer='rawvideo,md5,null'

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-07 01:17:14 +08:00
James Almer
2681eede9c avformat/mov: set primary extradata based on the first Sample only if it's not already in place
If the first Sample references the first stsd entry, then setting it here is
redundant.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-06 10:37:01 -03:00
Gyan Doshi
399c766d2a forgejo/CODEOWNERS: add myself to docs 2025-08-06 19:04:52 +05:30
Michael Niedermayer
31bad42d54 .forgejo/CODEOWNERS: add myself to a few things
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-06 12:07:22 +00:00
Jiawei
1464930696 configure: don't disable '-ftree-vectorize' on GCC >= 13 on major architectures
This changes configure to stop disabling -ftree-vectorize on
GCC versions 13 and newer, on major architectures.

Background:
- Original `-fno-tree-vectorize` was added in 2009 in commit
  973859f523 to avoid compiler errors.
- Re-enabled in 2016 in commit cb8646af24 but caused failures due
  to inline CABAC assembly issues and was disabled again in
  fd6dbc5385.
- Commit 182663a58a in 2023 fixed the inline CABAC assembly issues.
- Recent versions of GCC, in particular 13 and newer, seem to
  generally work reliably with respect to vectorization, although bugs
  have been observed on Loongarch.

Cautiously allow the GCC default of having vectorization enabled,
on major architectures where we expect to see enough testing. If
further issues are observed, they should be reported and noted here in
configure, so the workarounds can be scoped and version limited.
2025-08-06 11:05:05 +03:00
Michael Niedermayer
3b0ab68414 avcodec/motion_est: Remove double protection from init_ref()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-06 03:27:01 +00:00
Kacper Michajłow
bc012ac918 configure: treat unrecognized flags as errors on MSVC
This is important for feature checking to work correctly.

It can happen that an unrecognized flag passes the compile test with
only a warning, while failing in preprocessor-only check with an error.
This causes all test_cpp calls to fail and silently produces arguably
broken MSVC builds. Also, all check_* functions don't work as expected,
because they assume the check passed, even though there was a warning.

Additionally, this brings the behavior in line with GCC/Clang based
builds, failing early on unrecognized flags instead of silently
continuing with warnings in the log.

The /options:strict option is available starting in Visual Studio 2022
version 17.0. Because of that, we cannot use check_cflags alone, as it
would add this flag for older MSVC versions and produce warnings. So, we
need to manually perform a version check. A bit of a chicken and egg
problem.

Perform the version check before adding extra flags from the user to
ensure we don't silently fail the preprocessor check due to invalid
flags on older MSVC versions. Note that behavior differs depending on
whether we are compiling or only preprocessing.

This fixes silent different between handling:

`cl.exe -P foo c.c`
    c1: fatal error C1083: Cannot open source file: 'foo': No such file
    or directory

`cl.exe -c foo c.c`
    cl : Command line warning D9024 : unrecognized source file type
    'foo', object file assumed

Where -P fails, while -c throws warnings only. Of course `foo` is
completely bogus here, but depends on the flags or configuration this
may be unsupported argument. Or even some converted path from MSYS when
run inside it. The objective is to always error out instead of silently
hiding this.

Use check_cflags even after the _MSC_FULL_VER check, for non-MSVC
compilers. For example Clang-CL impersonate MSVC, but does not support
-options:strict flag currently.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 18:31:05 +02:00
Kacper Michajłow
50408c55ac configure: filter link flags separately for MSVC
This avoids adding flags that cl.exe doesn't understand.

Fixes cases where external libraries pkg-config file adds `-L` to the
cflags, strip it before passing to cl.exe.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 18:31:04 +02:00
Kacper Michajłow
5b3d6c0460 configure: don't use dangling temp file state
There was implicit assumption that the $TMPC file is empty when doing
--cpu=host checks. This breaks if any check is done before that.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 18:31:04 +02:00
Russell Greene
e0440eb392 hwcontext_vulkan: fix exporting multi-plane DRM modifiers
Previously, it was assumed that `drmFormatModifierPlaneCount` was one
for all modifiers when exporting, which is not always the case, in
particular for AMD GPUs and maybe others.

Fetch the number of memory planes and fill the structs appropriately in this situation.

The encoded stream is still bad in the case whre modifers are involved,
but I think this patch still stands on its own and I suspect that may be a driver bug.

A potential improvement that could be make is to cache the format
information, so we can avoid the two GetPhysicalDeviceFormatProperties2
calls for each export, as well as the allocation. I doubt this is very
expensive, but seemed worth noting.

v2 changes: query the format properties with the test image created in
`vulkan_frames_init` to avoid allocating space for the query during
export

Signed-off-by: Russell Greene <russellgreene8@gmail.com>
2025-08-05 23:53:58 +09:00
David Rosca
cc126afc91 vulkan_encode_h264/5: Fix uninitialized return value in write_extra_headers 2025-08-05 23:52:15 +09:00
Lynne
2c3315b04c lavc/vulkan/common: sign-ify lengths
This makes left_bits return useful data rather than overflowing, and
also saves some 64-bit integer operations, which is still always a plus sadly.
2025-08-05 23:51:21 +09:00
Lynne
50756b88d5 hwcontext_vulkan: enable uniformBufferStandardLayout 2025-08-05 23:51:21 +09:00
Lynne
53826f1815 hwcontext_vulkan: temporarily disable host_image_copy
NVIDIA's support for it is a disaster.
Of no benefit to other vendors.

NVIDIA are working on fixing it, but it may take time.
2025-08-05 23:51:21 +09:00
Lynne
d3288013ab vf_libplacebo: add support for specifying a LUT for the input
This makes it possible to apply Adobe .cube files to inputs.
2025-08-05 23:51:13 +09:00
Steven Liu
7838648be2 tests/fate/hlsenc: add testcase of hls fragment mp4 named cmfa
Add allow extension name cmfa and cmfv test, this testcase only
cover fragment mp4 named cmfa.

ticket description in ticket/11526
2025-08-05 11:47:11 +00:00
James Almer
8be539b022 avformat/iff: fix EOF check
The check to return on EOF should not be inside a block that will not be entered after reaching EOF.
Should fix "libavcodec/bytestream.h:144:27: runtime error: applying zero offset to null pointer".

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-05 00:24:08 -03:00
Kacper Michajłow
c24b9b4b73 tools/target_fuzzer: don't spam stderr
Printing dummy logs during fuzzing can significantly slow the process
and blow the size of logs, making them both unredable and huge.

Keep the loggging commented-out for easy local restore if needed.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:54 +02:00
Kacper Michajłow
8b5db38dc6 avcodec/qcelpdec: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:54 +02:00
Kacper Michajłow
7f5db34f3b avcodec/qcelpdec: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
8f0c146733 avcodec/evrcdec: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
4718974055 avcodec/dsicinaudio: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
96ab006566 avformat/ffmetadec: don't compare undefined string
Fixes use-of-uninitialized-value when bp.len == 0.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
efeddd1b8b forgejo/workflows: sort file list for cache hash
Makes find output consistent.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 21:49:56 +00:00
Michael Niedermayer
f3c3a6ecfb avformat/hls: add cmfv/cmfa exceptions
Fixes: Ticket11526

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 20:04:29 +00:00
Kimapr
ecef5f9e1f avformat/libopenmpt: fix seeking weirdness
- proper pts for packets. leaving it blank leaves it up for guessing,
  but the guess doesn't take seeking into account, causing weirdness.

- clamp to 0 when seeking to negative ts. libopenmpt docs are unclear on
  this but not doing this causes an immediate EOF when seeking backwards
  to the beginning in mpv.

- only set song duration and packet pts when they are non-negative and
  in int64 range. NaNs count as out of range. this isn't a fix for any
  specific issue but might be helpful still, and shouldn't break
  anything.
2025-08-04 19:51:59 +00:00
Ronan Waide
09828e7fe2 avcodec/dvbsubenc: add a min_bpp option to work around some decoders
As noted in the code in several places, some DVB subtitle decoders
don't handle 2bpp color. This patch adds a min_bpp option which
sets a lower bound on the number of bits-per-pixel in the color
tables. It defaults to 4 to avoid the problematic 2bpp decoders.

Signed-off-by: Ronan Waide <waider@waider.ie>
2025-08-04 19:45:45 +01:00
Marton Balint
a84d060aa1 avformat/internal: retire ff_get_frame_filename
It no longer has any users.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Marton Balint
c31df899d9 avformat/img2enc: use a AVBPrint buffer for generating the filename
This removes all path length limits from img2enc.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Marton Balint
ec64d9b73b avformat/utils: add ff_bprint_get_frame_filename
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Marton Balint
7410e29f5d avformat/img2enc: allocate temp and target filename dynamically
To avoid truncation of filename with additional .tmp extension.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Yalda
9b0cc80dc2 forgejo/ISSUE_TEMPLATE: create Issue ticket template based on TRAC form
This is based on the previously used, simple TRAC form
with new description language.

We can iterate on it to improve as needed.

Signed-off-by: Yalda <marth64@proxyid.net>
2025-08-04 16:15:27 +00:00
Martin Storsjö
1ea63b1786 forgejo/CODEOWNERS: Add myself for arm/aarch64 assembly 2025-08-04 13:39:47 +03:00
Leon Grutters
9a32b86307 avcodec/webvttdec: strip classes
If a supported tag has a class, e.g "<i.bold>" it is ignored entirely;
so for example "<i.bold>Hello</i>" would be converted to "Hello{\i0}"
instead of the intended "{\i1}Hello{\i0}".

Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
2025-08-04 09:12:17 +00:00
Peter Ross
09c372a323 tests/fate/audio: Sanyo LD-ADPCM test case 2025-08-04 08:01:24 +00:00
Peter Ross
9cd5743a3d tests/fate/video: LEAD MCMP test case 2025-08-04 08:01:24 +00:00
Peter Ross
4a1d664ae9 tests/fate/demux: IFF ANIM test case 2025-08-04 08:01:24 +00:00
Peter Ross
02bb64849a tests/fate/audio: G.728 test case 2025-08-04 08:01:24 +00:00
Gyan Doshi
00be24c2d7 doc/bitstream_filters: correct variable use in examples
Time has to be expressed as timestamp x time base

Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2025-08-04 12:21:19 +05:30
Lynne
c78195788d forgejo/CODEOWNERS: fix alphabetical order
Oops.
2025-08-04 15:24:27 +09:00
Kacper Michajłow
193938e640 tests/fate/subtitles: add test for LRC with ms -> ms conversion
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
Kacper Michajłow
670c1b9266 avformat/lrcenc: add precision option
Allows to output LRC with more precision than standard centiseconds.
Time base is determined by number of requested digits.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
Kacper Michajłow
a29aeee37e tests/fate/subtitles: add test for LRC with milliseconds timestamp
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
Kacper Michajłow
bc3cc0a6af avformat/lrcdec: support arbitrary precision timestamp
Apparently files with milliseconds exist in the wild. And since it cost
nothing to support arbitrary number of digits, extend format to support
that.

Depending on number of digits, the time base of fractional part is
changing. Most LRCs use 2 digits and centiseconds base, but subs with 3
digits and miliseconds exist too.

Set internal time base to AV_TIME_BASE, which in parcitice allows to
hold microseconds with 6 digits. Totally artificial, but who knows maybe
someone wants that.

Fixes: #11677

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
James Almer
e916f55c91 forgejo/CODEOWNERS: add missing handle to new entries
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-04 00:10:43 -03:00
James Almer
cae8c4587a forgejo/CODEOWNERS: add myself for iamf
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-04 00:02:56 -03:00
Lynne
ceaa8ed96b forgejo/CODEOWNERS: add a CODEOWNERS file to automatically add reviewers
This helps with finding reviews.
2025-08-04 11:49:01 +09:00
Kacper Michajłow
c447fab16c forgejo/workflows: run fate with assert level 2
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 02:27:23 +00:00
Jiasheng Jiang
55d234b433 libavcodec/tests/motion: Add check for avcodec_alloc_context3()
Add check for the return value of avcodec_alloc_context3() to avoid potential NULL pointer dereference.

Fixes: 5d48e4eafa ("Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196'")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:45 +02:00
Jiasheng Jiang
9ca58424de examples: Add av_freep to avoid potential memory leak
Add av_freep() to free avio_ctx_buffer if avio_alloc_context fails
to avoid potential memory leak.

Fixes: 5fc4dea39c ("examples: add avio_reading.c example")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00
Jiasheng Jiang
ab040e2565 avcodec/tests/avpacket: Add av_packet_free() to avoid memory leak
Add av_packet_free() to free avpkt_clone and avpkt in the error paths to avoid potential memory leak.

Fixes: da3c69a5a9 ("Added test for libavcodec/avpacket.c")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00
Jiasheng Jiang
008679ec16 avcodec/tests/avpacket: Add av_free() to avoid memory leak
Add av_free() to free extra_data if av_packet_add_side_data() fails.

Fixes: da3c69a5a9 ("Added test for libavcodec/avpacket.c")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00
James Almer
3f58c9df14 avfilter/x86/vf_bwdif: use the correct preprocessor check
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 19:26:18 -03:00
Niklas Haas
7f00e24d70 vf_bwdif: add AVX512 implementation
I also tried replacing some of the instructions by more elaborate ones
using masks, but I found no performance gain significant enough to be worth
maintaining two code paths, so this implementation merely replaces the AVX2
implementation by drop-in AVX512 equivalents.

bwdif8_c:                                             6362.2 ( 1.00x)
bwdif8_sse2:                                          1004.9 ( 6.33x)
bwdif8_ssse3:                                          946.0 ( 6.73x)
bwdif8_avx2:                                           477.9 (13.31x)
bwdif8_avx512:                                         273.3 (23.28x)

bwdif10_c:                                            6341.5 ( 1.00x)
bwdif10_sse2:                                          872.4 ( 7.27x)
bwdif10_ssse3:                                         803.4 ( 7.89x)
bwdif10_avx2:                                          416.7 (15.22x)
bwdif10_avx512:                                        224.3 (28.27x)

Realtime test at 3840x2160 yuv420p:

avx2:   frame=20000 fps=3370 q=-0.0 Lsize=N/A time=00:06:40.00 bitrate=N/A speed=67.4x elapsed=0:00:05.93
avx512: frame=20000 fps=5077 q=-0.0 Lsize=N/A time=00:06:40.00 bitrate=N/A speed= 102x elapsed=0:00:03.93

The use of this function is gated behind avx512icl so that it doesn't
downclock on Skylake.
2025-08-03 22:13:51 +00:00
Leon Grutters
586a1cd088 avformat/webvttdec,webvttenc: update documentation
The previous links lead to a 404 page as that page doesn't exist anymore.

Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
2025-08-03 21:24:38 +00:00
Kacper Michajłow
cc6ad703b4 forgejo/lint_commit_msg: add script for commit message linting
Based on mpv's script, under LGPL. https://github.com/mpv-player/mpv

Co-authored-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-03 20:45:12 +00:00
Marton Balint
d5f7a428b1 avcodec/dvbsubenc: fix 256 color rle decoding
The end of 8-bit/pixel_code_string() is signalled with two zero bytes, so we
should read those from the buffer instead of one. We keep supporting though our
own buggy encoder which only put one zero byte there.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-03 21:33:29 +02:00
Marton Balint
aeb6ea51f5 avcodec/dvbsubdec: convert dvbsub_read_8bit_string to bytestream reader
No change in functionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-03 21:33:29 +02:00
Marton Balint
74f470c05c avcodec/dvbsubenc: fix end of 8-bit/pixel-code-string
Fixes ticket #11606.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-03 21:33:29 +02:00
James Almer
3e859d933e avformat/mov: item names can be NULL in infe boxes
Fixes assertions after 11a5333980.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 16:28:19 -03:00
Kacper Michajłow
5c95e8e3a6 avcodec/srtenc: don't produce SRT files with mixed line endings
Initially, avcodec/srtenc.c was outputting CRLF [1]. Later, a real SRT
muxer was added [2], which outputs LF. The original srtenc.c was
converted to use the muxer [3], changing its output to LF, except for
newline characters within subtitle text.

Fix this to avoid producing SRT files with mixed line endings.

[1] 8e43b6fed9
[2] 9e63c30daa
[3] 55180b3299

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-03 17:27:35 +00:00
James Almer
5bd7003e81 avformat/mov: move AVC-Intra extradata generation to earlier in the stsd parsing process
This will ensure it will be stored in the stream's private context, so it can
be fetched and replaced as required.

Fixes a regression since eefa6de7d5.
Fixes avc-intra-panasonic-AG-HPX301E.mov

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 16:06:43 +00:00
James Almer
999e3e9bf8 avformat/mov: don't set stsc_count for item streams before the array is allocated
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 13:00:03 -03:00
James Almer
89187a84d3 avformat/mov: free streams earlier on error when parsing infe boxes
Fixes clusterfuzz-testcase-minimized-fuzzer_loadfile-5365661771825152.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 13:00:03 -03:00
James Almer
11a5333980 avformat/mov: free AVBPrint on error when parsing infe boxes
Should fix memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-03 13:00:03 -03:00
Michael Niedermayer
44864dbbb9 avcodec/vqavideo; Check bytestream2_get_buffer() reading next_codebook_buffer
Fixes: use of uninintilaized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6235973619351552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
Michael Niedermayer
7e9e7cb3b6 avcodec/iff: Clear ham_buf
Fixes: use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-6651797156724736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
Michael Niedermayer
715df4b1ff avcodec/imc: Clear padding of buf16
Fixes: use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IAC_fuzzer-6685890556788736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
Michael Niedermayer
ea3851bebf avcodec/cri: Check bytestream2_get_buffer() for end
Fixes: use of uninintialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-5910856640823296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
Michael Niedermayer
d9bf3c141b avcodec/cri: Factor read_len out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
Michael Niedermayer
610d368d9b avcodec/lzf: Check for input space
Fixes: use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-5597015691296768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
Michael Niedermayer
1687daa93c avcodec/fits: Clear naxis
Fixes: Use of uninitialized memory
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_DEC_fuzzer-5602250833854464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 13:19:25 +00:00
Timo Rothenpieler
16d663d371 forgejo/workflows: add pre-commit based linting 2025-08-03 13:48:47 +02:00
Timo Rothenpieler
262d41c804 all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
Timo Rothenpieler
8d439b2483 all: fix whitespace/new-line issues 2025-08-03 13:48:47 +02:00
Michael Niedermayer
ce0a655f85 avformat/dashdec: Allocate space for appended "/"
Fixes: writing 1 byte over the end of the array
Fixes: BIGSLEEP-433502298/test.xml

Found-by: Google Big Sleep

A prettier solution is welcome!
A testcase exists only for the baseurl case

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-03 00:31:12 +02:00
Kacper Michajłow
ff52147f59 avutil/hwcontext_qsv: fix format specifier for HRESULT
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-02 22:25:28 +00:00
Kacper Michajłow
1a9924d794 avcodec/amfenc: remove unused variables
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-02 22:25:28 +00:00
Kacper Michajłow
a27c329487 avcodec/ffv1: align function declaration with definition
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-02 22:25:28 +00:00
Peter Ross
518d9f0dd4 avcodec/g728dec: align static arrays to 32-byte boundary
fixes crash observed on x86_64-apple-darwin23.6.0 / clang-1500.3.9.4

Signed-off-by: Peter Ross <pross@xvid.org>
2025-08-02 21:36:36 +00:00
Michael Niedermayer
aca41d3d93 swscale/output: Fix all bilinear integer overflows
Ticket11686 hinted at one of these overflows
this fixes them all

Issue in line 1325/1326 found by HAORAN FANG <xfanghaoran@gmail.com>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-02 16:26:33 +00:00
Michael Niedermayer
c44d237d80 swscale/output: Fix integer overflow with lum/chr/alpha filter
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-02 16:26:33 +00:00
Frank Plowman
f82748d5e0 lavc/vvc: Mark SPS used if multiple CLVSSs use it
Consider the following sequence of NALUs (with some PPSs etc. omitted
for brevity):
1. SPS (ID=0, content=A)
2. IDR (SPS=0)
3. IDR (SPS=0)
4. SPS (ID=0, content=B)
5. TRAIL (SPS=0)

When decode_sps is called for NALU 3., ps->sps_id_used is cleared as
IDRs are one way of forming a CLVSS.  Then, old_sps is non-NULL
containing the result of calling decode_sps for NALU 2.  We haven't
received any SPSs between NALUs 2. and 3., therefore old_sps and rsps
are identical and the function returns.  The issue is that, at this
point, ps->sps_id_used is still zero despite the SPS being used for IDR
3.  This results in the check for conflicting SPSs not working properly
when decode_sps is called for NALU 5., allowing prediction between
pictures with different SPSs and probably all sorts of other
shenanigans.

Patch addresses the problem outlined above by also setting
ps->sps_id_used in the early return case.
2025-08-02 15:04:39 +00:00
vytskalt
2e19e74a29 hwcontext_vulkan: transfer exclusive images to correct queue family in drm->vulkan mapping 2025-08-02 11:02:59 +03:00
averne
bf79148cbb avcodec/proresenc_anatoliy: Remove support for grayscale flag
This results in the encoder producing empty scans for chroma planes,
which is illegal according to the ProRes SMPTE document.
2025-08-02 06:11:39 +00:00
averne
a49108fd29 avcodec/proresdec: Remove grayscale hack
This was introduced in commit 9c43703, to support a codec "extension"
in the prores_aw encoder.
This removes the chroma fill loop, and instead performs the inverse
transform on null coefficients, which achieves the same result and
fixes an off-by-one in the chroma values produced.

Updated test to reflect this change.
2025-08-02 06:11:39 +00:00
James Almer
2b522f537f avformat/mov: add extra sanity checks before setting the primary extradata
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-01 19:35:43 +00:00
Timo Rothenpieler
c6b3aae0ee avfilter/vf_scale_d3d11: remove unused variable 2025-08-01 20:49:57 +02:00
Timo Rothenpieler
6115f03939 avcodec/mfenc: remove unused variables 2025-08-01 20:49:57 +02:00
Timo Rothenpieler
e5275dbc96 avcodec/mfenc: fix compilation on modern gcc/clang 2025-08-01 20:49:57 +02:00
Timo Rothenpieler
18174cbae8 forgejo/workflows: add compile-only test for win64 2025-08-01 20:49:57 +02:00
James Almer
9aed7383bd avformat/movenc: look for the Intra profile flag before assuming a stream is AVC-Intra
Fixes issue #20018.

Note that Codec Descriptors are not written for all these ai** codec tags, and no
considerations were ever made to ensure parameter sets are present in muxed packets.
Their usage may result in unplayable files if parameter sets are only available
in extradata (Default behavior for x264 encoding when combined with this muxer).

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-01 14:53:17 +00:00
Michael Niedermayer
ab73bd94a3 avcodec/sanm: Checks related to negative left/top
Fixes: 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5466731806261248
Fixes: out of array access

Reviewed-by: Manuel Lauss <manuel.lauss@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-01 16:39:07 +02:00
Michael Niedermayer
b849ac006b avcodec/mpegvideo_dec: Fix lowres=3 field select interlaced mpeg4 frame
Fixes: out of array read in the chroma plane
Fixes: 428034092/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_DEC_fuzzer-5582608941776896.test

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-01 01:41:26 +02:00
Timo Rothenpieler
2d64d1129f forgejo/workflows: only upload cache if key changed 2025-07-31 22:57:35 +00:00
Kacper Michajłow
901e23675b forgejo/workflows: enable gpl, nonfree and memory poisoning
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-31 22:03:20 +00:00
Dash Santosh
1e5488951b avcodec/mfenc: propagate error codes properly 2025-07-31 21:07:51 +00:00
Dash Santosh
bd18a6a9e0 avfilter/scale_d3d11: cleanup return path using fail label 2025-07-31 21:07:51 +00:00
Dash Santosh
d56522c6eb avcodec/mfenc: add support for D3D11 input surfaces
Adds D3D11 input surface support to the MediaFoundation encoder (mfenc),
allowing direct encoding of GPU frames without readback to system memory.
This improves performance and compatibility when used alongside scale_d3d11.

Signed-off-by: Dash Santosh <dash.sathyanarayanan@multicorewareinc.com>
2025-07-31 21:07:51 +00:00
Dash Santosh
96821211c2 avfilter: add scale_d3d11 filter
This commit introduces a new hardware-accelerated video filter, scale_d3d11,
which performs scaling and format conversion using Direct3D 11. The filter enables
efficient GPU-based scaling and pixel format conversion (p010 to nv12), reducing
CPU overhead and latency in video pipelines.
2025-07-31 21:07:51 +00:00
Dale Curtis
2ddc3cbd98 avcodec/flacdsp: Fix integer-overflow in flac_lpc_33_c
This fix copies a couple of casts from surrounding functions.
See https://crbug.com/432528781 for stack trace details.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-31 20:25:15 +02:00
Dariusz Frankiewicz
9d8469e431 avcodec/apv: align APV color format support with latest liboapv version
Signed-off-by: Dariusz Frankiewicz <d.frankiewic@samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-31 20:24:40 +02:00
Niklas Haas
03b9180fe3 avfilter/avfiltergraph: add logging for filter formats
There is no convenient way, from the command line, to figure out which
formats a filter actually supports. This commit changes that by adding a
log output, at debug level, to simply print the list of formats each filter
advertises on its links, before any negotiation.

Furthermore, we can use the exact same helper function to also print out the
corresponding filter links when there is an error during format negotiation.

We need to use AV_BRINT_SIZE_UNLIMITED because the default format list for
filters like vf_scale is about 1700 characters long, significantly larger than
the the 1 kB default buffer.
2025-07-31 12:35:32 +00:00
sfan5
1a61db9797 avformat/file: add missing null check in Android content resolver
openFileDescriptor() can return null in certain error conditions.

Signed-off-by: sfan5 <sfan5@live.de>
Reviewed-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-07-31 19:54:58 +08:00
Zhao Zhili
2a49d05d1a avfilter/vf_vibrance: Update default value of rlum/blum
Fix #9195

It looks like vf_vibrance.c is similar to
https://github.com/zachsaw/RenderScripts/blob/master/RenderScripts/ImageProcessingShaders/SweetFX/Vibrance.hlsl
and
https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/Vibrance.frag
Originall written by Christian Cann Schuldt Jensen ~ CeeJay.dk.

They use same matrix coeff.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-07-31 19:51:23 +08:00
Niklas Haas
b7946098b1 swscale/alphablend: don't overread alpha plane on subsampled odd size
This function overreads the input plane for odd dimensions, because the
chroma plane is always rounded up, which means (xy << subsample) + 1 exceeds
the actual alpha plane size.

To verify:
  valgrind ffmpeg -pix_fmt yuva420p -f lavfi -i color -vf \
  "scale=1x1,format=yuva420p,scale=alphablend=uniform_color,format=yuv420p \
  -vframes 1 -f null -

Fixes: https://trac.ffmpeg.org/ticket/11692
2025-07-31 11:32:20 +00:00
Vittorio Giovara
119d127d05 lavu/spherical: Add support for Spherical Immersive type 2025-07-31 10:58:36 +02:00
Vittorio Giovara
c275f3bfa1 mov: Export frame packing information from pack box 2025-07-31 10:49:27 +02:00
zhaozhenghang
eade338656 libavformat/mov.c: Fix "statement will never be executed" warning
That occurs when H261, H263, and MPEG4 decoders are disabled.

Signed-off-by: zhaozhenghang <15083277223@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-07-31 11:13:04 +08:00
James Almer
1cbf7fc434 tests/fate/mov: add a test muxing multiple stsd entries
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-30 16:48:14 -03:00
James Almer
4eca8df8b8 avformat/movenc: support writing more than one STSD entry per track
If a packet contains new extradata within a side data entry, save for
specific cases it means the coded stream changed. If ignored, upon
demuxing every packet from then onwards may be undecodable.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-30 16:48:14 -03:00
James Almer
306448756b avformat/movenc: allow storing more than one extradata buffer per track
This is in preparation for a following change

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-30 16:48:14 -03:00
James Almer
eefa6de7d5 avformat/mov: export the correct initial extratada from samples with multiple stsd
The first sample in the stsc box may not refer to the first stsd entry.
This is the case in h264/thezerotheorem-cut.mp4, and as such the
fate-h264_redundant_pps-side_data test is updated accordingly.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-30 16:48:14 -03:00
Martin Storsjö
a4a3b3bf54 fate: Add a missing ffprobe dependency for fate-filter-select-ffprobe
This fixes doing "make fate" without having done a plain "make"
before.
2025-07-30 19:33:30 +00:00
Kacper Michajłow
daee46ed7e Revert "avformat/tls_openssl: properly get new BIO index"
BIO_get_new_index() is static counter meant to get index for custom bio
type definition. As we can read in the documentation:

> Note that BIO_get_new_index() can only be used 127 times before it
> returns an error.

We cannot call it repeatedly, because it will fail eventually.

To my understanding the index is not needed in our use and we could
safely use BIO_TYPE_NONE. Documentation states:

> type can be set to either BIO_TYPE_NONE or via BIO_get_new_index() if
> a unique type is required for searching (See BIO_find_type(3))

We don't use any search related functions.

This reverts commit 816dad231f.
Fixes: https://github.com/mpv-player/mpv/issues/16589

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-30 02:56:12 +02:00
Michael Niedermayer
f09c834a7d avcodec/cbs_apv_syntax_template: Check tile_data_size
Fixes: heap-buffer-overflow
Fixes: 418421333/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-6592025183191040
Fixes: 418804929/clusterfuzz-testcase-minimized-ffmpeg_BSF_APV_METADATA_fuzzer-5773904646045696
Fixes: 420737045/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-5535272169439232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-30 01:18:03 +02:00
Michael Niedermayer
ebcdba4c6b avformat/subfile: Initialize end on all cases
Fixes: use of uninitialized variable
Regression since: e29016a9de

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-30 01:18:03 +02:00
Michael Niedermayer
3ccd7d8c8e avcodec/sanm: Check decoded_size for old_codec48
Fixes: writing over the end of the array
Fixes: BIGSLEEP-434637586/payload

Regression since: b22ce90d42

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-30 01:18:02 +02:00
Araz Iusubov
5f24c50890 amfenc: Fix for full PA queue
Fixes AMF_INPUT_FULL errors with pre-analysis (PA) enabled.
Added wait and poll encoder output to free up internal buffers
before submitting new frames.
Improves stability and performance by accounting for encoder and
analysis stage queue limits (incl. lookahead buffering).

Reproduce:
ffmpeg.exe -y -r 60 -f lavfi -i testsrc=rate=60:size=3840x2160
-t 10 -pix_fmt yuv420p -an -c:v av1_amf -preset:v high_quality
-profile:v main -quality:v high_quality -usage:v high_quality
2025-07-29 23:38:16 +02:00
Araz Iusubov
cd33219558 avutil/hwcontext_amf: add device cache size
This change improves pipeline stability and reduces
dynamic GPU surface allocations when using AMF with copy_frame = 1.
This optimization has no negative effect.
2025-07-29 23:38:08 +02:00
Marton Balint
0cc46f1f59 avfilter/af_afade: rework crossfade activate logic
The new logic should be easier to follow.

It also uses ff_inlink_consume_frame() for all simple passthrough operations
making custom get_audio_buffer callback unnecessary.

Fate changes are because the new logic does not repacketize input audio up
until the crossfade. Content is the same.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-29 22:10:05 +02:00
Marton Balint
84d831ec58 avfilter/af_afade: fix check_input for empty streams
Use ff_outlink_get_status directly to get pending EOF state.

Fixes assertion failure with:
ffmpeg -lavfi "sine=f=1000:d=2[a];sine=f=440:d=2,atrim=end=0[b];[a][b]acrossfade=d=1" -f framecrc -
ffmpeg -lavfi "sine=f=1000:d=2,atrim=end=0[a];sine=f=440:d=2[b];[a][b]acrossfade=d=1" -f framecrc -

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-29 22:10:05 +02:00
Marton Balint
4be21b9399 avfilter/af_afade: factorize functions generating frames
No change in functionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-29 22:10:05 +02:00
Marton Balint
944329f8fd avfilter/trim: consume all available frames and avoid activate reschedule
There is no benefit in delaying processing all available frames.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-29 22:10:05 +02:00
Frank Plowman
7c5319e692 lavc/vvc: Add max parameter to kth_order_egk_decode
Prior to this patch, kth_order_egk_decode could read arbitrarily
large values which then overflowed and caused various issues.
Patch fixes this by making kth_order_egk_decode falliable,
requiring the caller to specify an upper bound and returning an
error if the read value would exceed that bound.

This patch resolves the same issue as
eb52251c0a, but I think this is the proper
fix as it also addresses issues with syntax elements besides
ff_vvc_num_signalled_palette_entries.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-07-28 20:46:10 +01:00
Frank Plowman
ce172bc362 lavc/vvc: Don't discard palette_subblock_data return code
Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-07-28 20:45:45 +01:00
Michael Niedermayer
a408b74977 avformat/dhav: Remove end_ prefix from variable names
The end_ prefix is confusing and may have contributed the mixup
fixed in the previous commit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 19:29:52 +02:00
Michael Niedermayer
33ae6cda71 avformat/dhav: fix reference point mixup
Fixes: reading the duration from before the start of the allocated buffer.

Regression since: 36ec9217e6

Fixes: BIGSLEEP-433513232/test

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 19:29:52 +02:00
Andreas Rheinhardt
15cec71665 checkasm/h264dsp: Fix stack-buffer-overflow, effective-type violations
Also ensure that the dst buffers are not too big
(they had the right size for >8 bit depths and were therefore
too big for eight bit, letting potential buffer overflows
in the eight bit version go undetected).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 19:29:51 +02:00
Michael Niedermayer
3afae0f440 avcodec/sanm: Check w, h for subversion < 2
Fixes: 410609432/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-4935159201988608
Fixes: out of array access

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 19:28:13 +02:00
Michael Niedermayer
1b12e919cf avformat/mxg: clear AV_INPUT_BUFFER_PADDING_SIZE
Fixes: use of uninitialized memory
Fixes: 427532813/clusterfuzz-testcase-minimized-ffmpeg_dem_MXG_fuzzer-5661938917113856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:38 +02:00
Michael Niedermayer
a45755e302 avcodec/dxvenc: Clear width to linesize not linesize to linesize
Fixes: use of uninitialized memory
Fixes: 422217206/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-4786889444098048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:38 +02:00
Michael Niedermayer
909229b880 avcodec/shorten: Clear the additionally allocated space on realloc
Fixes: use of uninitialized memory
Fixes: 421954767/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-515682786246656

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:38 +02:00
Michael Niedermayer
1b7a327b3a avformat/vqf: Ensure that comm_chunk is fully read
Fixes: use of uninitialized memory
Fixes: 412125811/clusterfuzz-testcase-minimized-ffmpeg_dem_VQF_fuzzer-6253774274887680

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:37 +02:00
Michael Niedermayer
c6cb3ab7ff avformat/mxfdec: Ensure klv->key is initialized
Fixes: read of uninitialized memory
Fixes: 391916474/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4935250956845056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:37 +02:00
Michael Niedermayer
8b16e1ddd9 avformat/mov: make sure file_checksum is fully initialized
Fixes: use of uninitialized memory
Fixes: 394990189/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6431722199908352

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:37 +02:00
Michael Niedermayer
7a21c37f75 avcodec/hevc/hevcdec: Clean sao_pixel_buffer_v on allocation
Fixes: use of uninitialized memory
Fixes: 378102648/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5896308499480576

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:36 +02:00
Michael Niedermayer
fa197924a6 avformat/asfdec_f: Check amount of value read
Fixes: use of uninitialized memory
Fixes: 403675492/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_fuzzer-4754281823797248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:41:36 +02:00
Michael Niedermayer
23c60ce742 tools/target_dec_fuzzer: Set ALS max order to 15 (ALS simple profile)
Fixes: Timeout
Fixes: 429645375/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5377900448907264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:27:52 +02:00
Michael Niedermayer
0887d2e291 avcodec/alsdec: Allow the user to set a maximum prediction order
The only offical profile i could find (ALS simple profile) has a max of 15 while the bitstream allows 1023
which is very slow.

We do have a fate sample with 1023

Fixes: Timeout
Fixes: 429645375/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5377900448907264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:27:52 +02:00
Artem Smorodin
0a108a37e1 avformat/hlsenc: limit segments count to search duplicated segments filenames
This linear search has a complexity of O(n). When ffmpeg attempts to parse a playlist containing approximately 100,000 segments, it effectively causes a hang for several minutes.

This patch limits the allowed size for duplicate searches to a reasonable value. Now it takes between 0.5 and a few seconds (tested on different devices) instead of several minutes.

Signed-off-by: Artem Smorodin <artem.smorodin@dacast.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:27:51 +02:00
David McElroy
4b6f6af384 avformat/movenc: fix HEVC fmp4 HLS init segment for Apple playback
HEVC fmp4 HLS video produced by ffmpeg is currently unplayable on Apple
software (Safari, QuickTime, AVFoundation).

This is caused by an empty sdtp atom being erroneously written to the
fmp4 init segment. The `has_disposable` flag can be set for a track
with B-frames, but the init segment contains no actual frames
(track->entry == 0). Writing an sdtp atom in this case is incorrect
and causes Apple's parsers to reject the file.

This patch fixes the issue by ensuring the sdtp atom is only written
if track->entry is non-zero.

A similar patch was proposed in November 2023 by Jay Zhang,
but it was never merged.

Link: https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2023-November/317173.html
Co-authored-by: Jay Zhang <wangyoucao577@gmail.com>
Signed-off-by: David McElroy <david@mcelroy.online>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-28 17:27:51 +02:00
Niklas Haas
dc8e753f32 avfilter/vf_libplacebo: composite multiple inputs in linear light
This gives vastly improved blending results than when blending directly in
the desired output colorspace. Overridable by the existing "disable_linear"
option.

This is functionally similar to combining multiple "libplacebo" filters,
but does not rely on the existence of a Vulkan filter link, so it can be used
without performance penalty in all circumstances. It's also enabled by
default, without requiring special action from the user.
2025-07-28 10:59:48 +02:00
Niklas Haas
603334a043 avfilter/vf_premultiply: use correct premultiplication formula
The previous formula was introduced without justification in 6e713841e8,
and the only thing Paul had to say about it over IRC was that it was copied
from an unspecified source on the internet.

I decided to do some testing and came to the conclusion that this term not
only produces "illegal" files, but also lowers PSNR score, over the naive
implementation without this extra term.

Here are the results of a round-trip test, using allrgb/allyuv (respectively)
as the input, and fade=alpha=yes:n=256 to cycle through every possible alpha
value, comparing the round-trip output against the input:

Before patch:
  PSNR r:26.677431 g:26.677431 b:26.677431 a:inf average:27.926818 min:6.012093 max:55.400791
  PSNR y:26.677431 u:21.101981 v:21.101981 a:inf average:23.548981 min:9.013835 max:53.182303 (full)
  PSNR y:27.348055 u:21.101981 v:21.101981 a:inf average:23.625238 min:9.554991 max:45.652221 (limited)

After patch:
  PSNR r:27.321996 g:27.321996 b:27.321996 a:inf average:28.571384 min:6.012093 max:52.424553
  PSNR y:27.321996 u:23.187879 v:23.187879 a:inf average:25.431773 min:9.013835 max:50.199232 (full)
  PSNR y:27.868544 u:23.187879 v:23.187879 a:inf average:25.515660 min:9.554991 max:45.078298 (limited)

It's worth pointing out that previous version sometimes artificially inflates
PSNR by producing values that are too high (i.e. RGB > A), such as for the
input pair (R = 255, A = 2) which should give R = 2, but actually gives R = 3
under the old logic.

As a second evaluation without this shortcoming, here is a comparison against
the reference value computed with a floating point format:

Before patch:
  PSNR r:53.600599 g:53.957833 b:53.540948 a:inf average:54.945316 min:50.508901 max:inf (premul only)
  PSNR r:30.734183 g:30.734183 b:30.734183 a:inf average:31.983570 min:12.058264 max:inf (round-trip)

After patch:
  PSNR r:61.751104 g:65.239091 b:61.339191 a:inf average:63.710714 min:55.441130 max:inf (premul only)
  PSNR r:32.611851 g:32.611851 b:32.611851 a:inf average:33.861238 min:12.058264 max:inf (round-trip)
2025-07-28 10:56:10 +02:00
Kacper Michajłow
e74dbb02eb avcodec/dovi_rpudec: skip unknown ext blocks instead of erroring out
Should allow for forward compatibility with newer versions.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-27 12:16:00 +00:00
Kacper Michajłow
ef167512ab avcodec/dovi_rpudec: parse RPU forward, don't try to find end
Instead of scanning backwards for the end of RPU payload, parse it and
report if we didn't land at the terminator byte.

Current expectation was that we can have additional zero bytes after RPU
payload, which were skipped to find playload end. That's not always the
case. So loosen this requirement.

This fixes files where there is additional non-zeroed padding after the
end of the RPU in NALU.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-27 14:09:46 +02:00
Kacper Michajłow
bf640b53db avcodec/hevc/hevcdec: handle rpu_buf allocation failure correctly
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-27 14:09:46 +02:00
Timo Rothenpieler
29368ccb48 forgejo/workflows: use explicit token with issue write permission 2025-07-26 19:36:56 +02:00
Zhao Zhili
631bb6c6e8 avformat/mxfenc: Ensure frame offset in valid range
Fix assert failure.
Fix #11666.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-07-26 21:04:57 +08:00
Timo Rothenpieler
dc0ac81bbe avcodec/cuviddec: fix wrong 10bit 420 format in cuvid_handle_video_sequence 2025-07-26 14:42:33 +02:00
Timo Rothenpieler
a56da996ce avcodec/cuviddec: also reflect new pix_fmts in cuvid_handle_video_sequence 2025-07-26 14:42:05 +02:00
Timo Rothenpieler
2513f3d604 forgejo/workflows: add issue/PR auto labeler 2025-07-26 14:36:04 +02:00
Kacper Michajłow
e29016a9de avformat/subfile: clip seek offset
Fixes: signed integer overflow: 9223372036854737920 + 1649410 cannot be
represented in type 'int64_t'

Fixes OSS-Fuzz: 410100610

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 22:00:02 +02:00
Kacper Michajłow
d12863a693 avformat/rtmpproto: guard usage of undefined functions with preprocessor
The asumption is that DCE will remove references to those functions.
However some compilers with certain instrumentation enabled doesn't DCE
those at all, resulting in linking failure. Tested with cl.exe -RTCu -RTCs.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:18:17 +02:00
Kacper Michajłow
40b56c6536 avcodec/x86/vc1: guard usage of undefined functions with preprocessor
The asumption is that DCE will remove references to those functions.
However some compilers with certain instrumentation enabled doesn't DCE
those at all, resulting in linking failure. Tested with cl.exe -RTCu -RTCs.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
9658d4425e avcodec/x86/fdct: guard usage of undefined functions with preprocessor
The asumption is that DCE will remove references to those functions.
However some compilers with certain instrumentation enabled doesn't DCE
those at all, resulting in linking failure. Tested with cl.exe -RTCu -RTCs.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
6bc23ab352 avcodec/d3d12va_encode_hevc: remove unused variable
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
62e2af358d avcodec/d3d12va_encode: don't return uninitialized value on error
When CreateEvent fails, err was not initialized.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
7d9b21601c avcodec/d3d12va_encode: don't write garbage when there is no header
When codec->write_sequence_header is not defined, bit_len was undefined,
and while data bufer was zeroed we could just overread it. Do nothing
when we don't have anything to write.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
a1588c875a avcodec/d3d12va_encode: use correct none flag
NFC, it's still 0, but correct enum type so compilers won't complain.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
c1ccd4bb22 avcodec/d3d12va_decode: remove unused variable
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
a9b9636046 avformat/vivo: fix sscanf specifer for double
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
c6ea6ac39b avformat/os_support: check invalid socket value correctly on Windows
SOCKET defined in winsock2.h is unsigned and invalid value is defined as
INVALID_SOCKET. Check this explicity to avoid compiler warnings.

See: https://learn.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:16 +02:00
Kacper Michajłow
d6b72d1d26 avformat/options_table: supress implicit conversion warnings
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-25 21:10:13 +02:00
James Almer
45810daf4d avfilter/af_channelmap: always set out_channel in the map
Fixes use-of-uninitialized-value.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-25 00:18:07 -03:00
Leo Izen
829680f96a avcodec/jpegxl_parser: add sanity check for frame size
If a frame size is absolutely massive, this can spin the parser as it
attempts to decode a permuted TOC. We add a sanity check here for eight
times the size of the image for an internal frame to prevent malicious
bitstreams from slowing the parser down to a crawl.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-23 06:22:16 -04:00
James Almer
3f2b452a22 avcodec/opus/silk: don't assume stereo when calling silk_decode_frame()
Fixes use-of-uninitialized-value under MSAN.

Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 22:16:25 -03:00
Timo Rothenpieler
33e326ae02 forgejo/workflows: add initial rudimentary CI
It runs basic fate with no special dependencies enabled on x86_64 and
aarch64.
2025-07-22 20:06:20 +02:00
Kacper Michajłow
c64f6812eb configure: suppress Wmicrosoft-enum-forward-reference
Clang-CL complains about fwd references of enums, but we do use it
everywhere, so ignore this.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-22 19:56:34 +02:00
Kacper Michajłow
22da57c444 swscale/lut3d: remove unused function
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-22 19:56:34 +02:00
Kacper Michajłow
29d274afe7 avformat/udp: avoid warning about always false comparison
socklen_t underlying type can be signed or unsigned depending on
platform. This is fine, just cast it to size_t before comparison.

Fixes: warning: result of comparison of unsigned expression < 0 is
       always false [-Wtautological-unsigned-zero-compare]

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-22 19:56:34 +02:00
Kacper Michajłow
ce04877f1f avutil/hmac: avoid calling functions through pointer of invalid type
Add type removed function wrappers to resolve UB of calling function
through pointer to incorrect function type.

Fixes: FATE-{hmac,srtp}
Fixes: call to function av_md5_init through pointer to incorrect
       function type 'void (*)(void *)' and similar for others.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-22 19:56:34 +02:00
Kacper Michajłow
6f88b90f6c avutil/avstring: shrink allocation from av_get_token to fit token
av_get_token() allocates an output buffer with the same size as the
input. Generally, this is harmless, but when the input string is large
and consists of many small tokens, calling av_get_token() repeatedly to
extract all tokens will significantly amplify memory allocations.

To fix this, after obtaining the return value, simply realloc the buffer
to the actual size needed for output string.

Fixes OOM when parsing filter graph string.
Fixes OSS-Fuzz: 394983446

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-22 19:56:34 +02:00
James Almer
86670fec9c avcodec/ffv1dec: don't check chroma_planes for f->colorspace > 0
It's RGB, so check instead if it's packed or planar.

Fixes: libavcodec/ffv1dec.c:461:43: runtime error: applying zero offset to null pointer
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 12:37:31 -03:00
James Almer
da18c2a373 avfilter: use the getters for xGA font data arrays
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 09:47:18 -03:00
James Almer
cb9742af76 avcodec: use the getters for xGA font data arrays
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 09:47:18 -03:00
James Almer
c6c8063186 avutil/xga_font_data: add getters to access the shared arrays
And stop exposing the arrays on the next major bump.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 09:47:18 -03:00
James Almer
e835738b70 avcodec/cbs_apv: add missing READ/WRITE preprocessor checks
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 09:47:18 -03:00
James Almer
b0159af6bc avfilter/f_metadata: use the return value of vsnprintf() to write the argument list
Should fix use-of-uninitialized-value under MSAN.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 09:47:18 -03:00
James Almer
87cc213748 avformat/hevc: don't print parameter_set_id for any NALU
It's not a value stored in the hvcC structure.
Fixes use of uninitialized variable errors under sanitizer when the input extradata is
already hvcC formatted, given we don't parse parameter sets for those.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 09:47:18 -03:00
James Almer
48ef4caac2 avcodec/ffv1dec: don't add offsets to more NULL pointers
Fixes: libavcodec/ffv1dec.c:453:43: runtime error: applying zero offset to null pointer
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-22 09:47:17 -03:00
Marvin Scholz
080dc4cf54 avformat/tls_openssl: load default verify locations
When no explicit CAs file is set, load the default locations,
else there is no way for verification to succeed.

This matches the behavior of other TLS backends.
2025-07-22 02:43:54 +02:00
Marvin Scholz
f4befeb767 avformat/tls_openssl: verify setting hostname for SNI 2025-07-22 02:43:54 +02:00
Daniel N Pettersson
e56fd2af1a avformat/tls_openssl: add hostname for verification
When verification is enabled (using -tls_verify 1) now
the hostname will be verified properly too, while before
only other aspects of the certificate were checked.

Co-Authored-By: Marvin Scholz <epirat07@gmail.com>
2025-07-22 02:43:54 +02:00
Bernat Arlandis
3cd4fa9b89 libtheoraenc: Add encoding speed level option
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-22 01:35:01 +02:00
Jacob Lifshay
157d3b007e lavu: add av_scanf_format() and use it on av_sscanf()
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-22 01:35:01 +02:00
James Almer
a01dc3aa27 avfilter/x86/vf_colordetect: add missing preprocessor checks
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-21 18:03:22 -03:00
James Almer
c62813a057 avfilter/x86/vf_colordetect: make the AVX512 functions run only on ICL targets or newer
For detect_range, the usage of vpbroadcast{b,w} requires the AVX512BW extension, and for
detect_alpha we don't want ZMM instructions downclocking old CPUs.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-21 17:25:28 -03:00
James Almer
b9287fde10 Changelog: add entry for vf_colorfilter addition
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-21 17:04:45 -03:00
James Almer
550ec9b7e6 avfilter/version: bump version after vf_colordetect addition
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-21 17:04:45 -03:00
James Almer
70fc4e5909 avfilter/x86/vf_colordetect_init: don't enable ASM functions on targets where it's known they will be slower
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-21 16:58:51 -03:00
James Almer
fdca209f1f avfilter/x86/vf_colordetect: don't use rax to return a 32bit integer
Fixes compilation on x86_32 targets

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-21 16:58:36 -03:00
James Almer
14f4478354 avfilter/x86/vf_colordetect: fix use of AVX512 instruction in AVX2 function on non Unix64 targets
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-21 16:52:46 -03:00
Niklas Haas
f944a70fcc tests/checkasm: add check for vf_colordetect 2025-07-21 18:10:26 +02:00
Niklas Haas
8b647b3f8a avfilter/vf_colordetect: add x86 SIMD implementation
alphadetect8_full_c:                                  5658.2 ( 1.00x)
alphadetect8_full_avx2:                                215.1 (26.31x)
alphadetect8_full_avx512:                              133.5 (42.40x)
alphadetect8_limited_c:                               7391.5 ( 1.00x)
alphadetect8_limited_avx2:                             649.3 (11.38x)
alphadetect8_limited_avx512:                           330.5 (22.36x)
alphadetect16_full_c:                                 3027.4 ( 1.00x)
alphadetect16_full_avx2:                               209.4 (14.46x)
alphadetect16_full_avx512:                             141.4 (21.41x)
alphadetect16_limited_c:                              3880.9 ( 1.00x)
alphadetect16_limited_avx2:                            734.9 ( 5.28x)
alphadetect16_limited_avx512:                          349.2 (11.11x)
rangedetect8_c:                                       5854.2 ( 1.00x)
rangedetect8_avx2:                                     138.9 (42.15x)
rangedetect8_avx512:                                   106.2 (55.12x)
rangedetect16_c:                                      4122.0 ( 1.00x)
rangedetect16_avx2:                                    138.6 (29.74x)
rangedetect16_avx512:                                  104.1 (39.60x)
2025-07-21 18:10:25 +02:00
Niklas Haas
545f721b44 avfilter/vf_colordetect: add new color range detection filter
This filter can detect various properties about the image, including
whether or not there are out-of-range values, or whether the input appears
to use straight or premultiplied alpha.

Of course, these can only be heuristics, with "undetermined" as the base
case. While we can definitely prove the existence of full range or
straight alpha colors, we can never infer the opposite.
2025-07-21 18:10:25 +02:00
Michael Niedermayer
8cdb47e47a avformat/concatdec: Clip duration in one more case in get_best_effort_duration()
Fixes: signed integer overflow: 40000 - -9223372036854770000 cannot be represented in type 'long'
Fixes: 427262541/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-4831506940100608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-21 01:27:23 +02:00
Michael Niedermayer
749aaf2744 avcodec/smacker: cleanup on bet buffer failure
Fixes: memleak (of vlc)
Fixes: 430343927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-5265858979233792

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-20 01:05:24 +02:00
Michael Niedermayer
051e0d7744 avcodec/ffv1dec: Check k in get_vlc_symbol()
The true problem happens in several previous get_vlc_symbol()
but checking that is more expensive (involving FFABS())
here its just a simple check between 2 variables we have.

Fixes: Assertion log >= k failed at libavcodec/golomb.h:406
Fixes: 429296194/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_DEC_fuzzer-4691594622337024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-20 01:05:23 +02:00
Michael Niedermayer
c0f1c3e185 avcodec/ivi: Check luma/chroma mb_size
Fixes: shift exponent -1 is negative
Fixes: 429011224/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5031059358285824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-20 01:05:23 +02:00
Michael Niedermayer
2d72bf6fe0 avcodec/cfhd: Check idwt_buf size before allocation
Fixes: OOM
Fixes: 428760799/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_DEC_fuzzer-5685176435015680

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-20 01:05:23 +02:00
Jiasheng Jiang
f7a6965308 fftools/cmdutils: Add av_freep() to avoid memory leak
Add av_freep() to free new_elem to avoid memory leak.

Fixes: 3ca1e31e63 ("fftools/cmdutils: Atomically add elements to list of pointers, fix crash")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-20 01:05:22 +02:00
James Almer
85ac589211 avformat/apv: use memset to zero initialize frame_info
Don't rely on implicit zeroing.
Should fix fate failures on msvc targets.

Found-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-19 20:01:57 -03:00
James Almer
722a2170e8 avfilter/vf_curves: don't add offsets to NULL pointers
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-19 00:07:45 -03:00
James Almer
11032d819d swscale/swscale_unscaled: don't add offsets to more NULL pointers
Continuation of af9b43455a.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 21:35:26 -03:00
Kacper Michajłow
6302ff1fd9 avfilter/vaf_spectrumsynth: don't use uninitialized variable as scale
scale was never initialized. av_tx_init() will use default scale if we
pass NULL.

Fixes: b3117f376d
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:36:25 +02:00
Kacper Michajłow
806186e9ad avcodec/sonic: move code closer to use to avoid unused warnings
Put decoding and encoding code into thier respective #if blocks.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:36:25 +02:00
Kacper Michajłow
39e11fa700 avcodec/sonic: remove dead code
This was in else branch of `#if 1` since ever. No need to keep dead code
like that, if anyone needs it they can get it from git history.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:36:25 +02:00
Kacper Michajłow
bf2bb119a7 configure: remove ossfuzz sanitizer flags
In OSS-Fuzz build environment flags are handled by CFLAGS and LDFLAGS.
In local build use --toolchain=clang-fuzz-asan-ubsan or similar
combination depending on requested sanitizers.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:36:25 +02:00
Kacper Michajłow
e1665fd71d configure: add -fuzz support to --toolchain
libFuzzer is linked only for fuzzing targets.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:36:19 +02:00
Kacper Michajłow
c6ce05cec3 configure: allow -ubsan in toolchain
It's is commonly called UBSAN after all.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:32:05 +02:00
Kacper Michajłow
1bed76cdcd configure: add -fno-omit-frame-pointer when sanitizers are used
All sanitizers give better reports with frame pointers. And skip adding
-fomit-frame-pointer.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:32:05 +02:00
Kacper Michajłow
85ae10575b configure: allow multiple sanitizers in --toolchain
For example this allows: --toolchain=clang-asan-usan.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-19 00:32:05 +02:00
James Almer
36b8c200fb avformat/hevc: don't print parameter_set_id for SEI NALUs
The field is unset for those.

Fixes use of uninitialized variable errors under sanitizer.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 17:41:41 -03:00
James Almer
ade02f992c tests/fate/mov: add a test for HEIF files with multiple thumbnails
As well as entries in iloc and iinf being not being stored in the same order.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 16:00:54 -03:00
James Almer
85f2911891 avfilter/x86/vf_blackdetect: add missing preprocessor check
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 15:17:02 -03:00
James Almer
e32264a1e1 avformat/mov: don't assume iloc and iinf entries for each item_id will be in the same order
Nothing forbids them to be in any order the muxer desires.

Fixes demuxing heif samples generated by S1II.

Tested-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 14:57:09 -03:00
James Almer
3cd5672bfe fate/lavf-container: add test for APV in MP4
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 14:55:34 -03:00
Dawid Kozinski
8baa691e5f avformat/mov_muxer: Extended MOV muxer to handle APV video content
- Changes in mov_write_video_tag function to handle APV elementary stream
- Provided structure APVDecoderConfigurationRecord that specifies the decoder configuration information for APV video content

Co-Authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 14:54:36 -03:00
James Almer
585a8d5357 avcodec/motion_est: don't add offsets to NULL pointers
Fixes: libavcodec/motion_est.c:94:31: runtime error: applying zero offset to null pointer
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 14:23:10 -03:00
James Almer
af9b43455a swscale/swscale_unscaled: don't add offsets to NULL pointers
Fixes: libswscale/swscale_unscaled.c:916:20: runtime error: applying zero offset to null pointer
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 14:23:10 -03:00
James Almer
ee4ff3f706 avfilter/x86/vf_blackdetect_init: don't enable the ASM functions on targets where it's known they will be slower
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 13:05:44 -03:00
James Almer
f263192f0e avfilter/x86/vf_blackdetect: don't use rax to return a 32bit integer
Fixes compilation on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-18 13:05:44 -03:00
Zhao Zhili
a218cafe4d avfilter/vf_blackdetect: Fix header guard
Fix fate-source failure.
2025-07-18 13:44:51 +02:00
Niklas Haas
bfab026298 tests/checkasm: add test for vf_blackdetect 2025-07-18 10:47:31 +02:00
Niklas Haas
75cd42c48a avfilter/vf_blackdetect: add AVX2 SIMD version
Requested by a user. Even with autovectorization enabled, the compiler
performs a quite poor job of optimizing this function, due to not being
able to take advantage of the pmaxub + pcmpeqb trick for counting the number
of pixels less than or equal-to a threshold.

blackdetect8_c:                                       4625.0 ( 1.00x)
blackdetect8_avx2:                                     155.1 (29.83x)
blackdetect16_c:                                      2529.4 ( 1.00x)
blackdetect16_avx2:                                    163.6 (15.46x)
2025-07-18 10:47:31 +02:00
Zhao Zhili
fa0080bf2e avcodec/ohenc: Add h264/hevc OpenHarmony encoders 2025-07-18 14:45:13 +08:00
Zhao Zhili
e7f44f8cd8 avcodec/ohdec: Add h264/hevc OpenHarmony decoders 2025-07-18 14:45:13 +08:00
Zhao Zhili
fbda5ffb95 avutil/hwcontext: Add ohcodec device and pixel format
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-07-18 14:44:39 +08:00
wangbin
7b13d17b6d avdevice/android_camera: Set image linesize aligment to 1
Can't read alignment from packet, codecpar or decoded frame linesizes, so don't
set it. My test device redmi k60 produces images in 4624x3472, not 32 aligned

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-07-18 10:37:53 +08:00
Eric Joyner
291ec0faf3 avformat/mov: Enable jpeg streams in HEIF MOVContext
Nikon HEIFs from a camera or NX studio include a small jpeg thumbnail in addition to
the expected HEVC thumbnails; allowing jpegs allows all thumbnails to
have an associated stream for Nikon HEIF files.

With this, Nikon HEIFs can finally be decoded without failing and the
thumbnails can be extracted into their own files.

Signed-off-by: Eric Joyner <erj@erj.cc>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-17 21:54:03 -03:00
Eric Joyner
fb163eb28b avformat/mov: Support multiple thumbnails in HEIF
Prevents ffmpeg/ffprobe from erroring out when reading an HEIF that
contains multiple hvcC thumbnails (e.g. from a Nikon Z6III camera).

Before, move_read_iref_thmb() would always override the stored
thmb_item_id in the MOVContext with each new read thumbnail, causing a
stream and item_id mismatch later in mov_parse_heif_items(), resulting
in the "HEIF thumbnail doesn't reference a stream" error message.

To solve this,

- Turn thmb_item_id into an array of IDs because multiple thumbnails can
  exist
- Change check in mov_parse_heif_items() to compare against all stored
  thumbnail IDs to see if any item missing a stream is in the list of
  thumbnail IDs.

Signed-off-by: Eric Joyner <erj@erj.cc>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-17 21:54:03 -03:00
Jack Lau
25e710c61e avformat/whip: force NONBLOCK for rtp
We need to ensure rtp sets NONBLOCK since the dtls
handshake has potentially overriden the sockets mode.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-17 14:33:47 +02:00
Timo Rothenpieler
e6d2c67cd0 avformat/tls_openssl: avoid unusual inline-if style 2025-07-17 14:06:07 +02:00
Jack Lau
abb274b154 avformat/tls_openssl: make tls and dtls use one close function
Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-17 14:04:32 +02:00
Niklas Haas
bc8d06d541 avfilter/vf_thumbnail: unroll and use multiple histograms
This naive hist[p[x]]++ loop suffers badly when there are large regions of
identical values in the image, because of store-to-load forwarding delay.

Splitting up the histogram into four "parallel" histograms and processing
them one at a time speeds things up significantly, about 40% on my end.
2025-07-17 12:33:59 +02:00
Niklas Haas
e44a1aaeec avfilter/x86/scene_sad: add high bit depth AVX2/AVX512 version
Since psadbw only exists for 8-bits, we have to emulate it for 16-bit
inputs. The simplest sequence is to use a normal subtraction, which is safe
as long as the inputs do not exceed 32767 - so limit this implementation
to 15-bit inputs and below.

For 16-bit inputs, we could in theory instead use a pminw / pmaxw to ensure
the resulting difference does not overflow, but this is slower, and also
breaks the subsequent use of pmaddwd, so I opted to skip 16-bit SIMD for
now.

scene_sad10_c:                                      114175.6 ( 1.00x)
scene_sad10_avx2:                                     9617.7 (11.87x)
scene_sad10_avx512:                                   5208.8 (21.92x)
scene_sad12_c:                                      114537.8 ( 1.00x)
scene_sad12_avx2:                                     9614.0 (11.91x)
scene_sad12_avx512:                                   5186.3 (22.08x)
scene_sad14_c:                                      114113.9 ( 1.00x)
scene_sad14_avx2:                                     9612.9 (11.87x)
scene_sad14_avx512:                                   5186.0 (22.00x)
scene_sad15_c:                                      114108.9 ( 1.00x)
scene_sad15_avx2:                                     9612.3 (11.87x)
scene_sad15_avx512:                                   5186.4 (22.00x)
scene_sad16_c:                                      114136.0 ( 1.00x)
2025-07-17 12:26:06 +02:00
Niklas Haas
91f2d146d4 avfilter/x86/scene_sad: add AVX512 implementation
Trivial to add, but a lot faster (on my machine).

scene_sad8_c:                                       114476.4 ( 1.00x)
scene_sad8_sse2:                                      8644.3 (13.24x)
scene_sad8_avx2:                                      4520.1 (25.33x)
scene_sad8_avx512:                                    3153.0 (36.31x)
2025-07-17 12:26:06 +02:00
Niklas Haas
9251af058a tests/checkasm: add scene_sad checkasm test 2025-07-17 12:26:05 +02:00
Niklas Haas
dc61b74c1d avfilter/scene_sad: pass true depth to ff_scene_sad_get_fn()
I need to be able to distinguish between 10/12/14 and 16 bit depths, for
overflow reasons.
2025-07-17 12:26:05 +02:00
Jack Lau
e6af82c498 avformat/tls_openssl: remove all redundant "TLS: " in log with AVClass
Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-17 02:35:11 +02:00
Jack Lau
dda91b87e8 avformat/tls_openssl: replace 1 with TLS_ST_OK to be more clear
Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-17 02:35:07 +02:00
Jack Lau
7bd3bdbd62 avformat/whip: free udp socket after dtls free
the SSL_shutdown in tls_close need call the url_bio_bwrite
so we should keep udp still alive

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-17 02:35:01 +02:00
Timo Rothenpieler
95eae5dd50 avformat/tls_openssl: unset nonblock flag on correct URLContext during dtls handshake
The internal BIO functions do not in fact look at this flag, only the outer
tls_read and tls_write functions do.
2025-07-17 02:20:34 +02:00
Jack Lau
7afe1167e5 avformat/tls_openssl: set tlsext host name after init ssl
Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-17 02:04:38 +02:00
Kacper Michajłow
2869cce163 configure: add -Wl when linker is called indirectly
It's possible to call linker indirectly through driver like Clang. In
which cases linker args has to be prefixed with -Wl.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-17 00:28:21 +02:00
Kacper Michajłow
ec51162bb6 checkasm/swscale: fix function prototypes
This aligns declared function types in checkasm with real definition.

Fixes FATE: checkasm-{sw_rgb,sw_scale,sw_yuv2rgb,sw_yuv2yuv}

Fixes: runtime error: call to function <func> through pointer to incorrect function type
Fixes: c1a0e65763

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-07-17 00:28:21 +02:00
Timo Rothenpieler
9015d595a1 avformat/flvdec: don't skip backwards or over EOF
Skipping backwards (and even forwards) resets the EOF flag, and can thus
lead to infinite looping if the conditions are just right.

Fixes: Infinite loop
Fixes: 427538726/clusterfuzz-testcase-minimized-ffmpeg_dem_FLV_fuzzer-6582567304495104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-16 19:05:51 +02:00
Timo Rothenpieler
483e509169 avformat/tls_openssl: automatically generate self-signed certificate when none is provided in listen mode 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
454f161b4b avformat/tls_openssl: make generating fingerprints optional 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
40ce64eae7 avformat/tls_openssl: don't expose deprecated EC_KEY outside of its function 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
5339db2cf4 avformat/tls_openssl: properly free generated/read keys and certificates 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
49badc8689 avformat/tls_openssl: don't enable read_ahead in dtls mode
OpenSSL docs say:
These functions have no impact when used with DTLS.
2025-07-16 18:46:55 +02:00
Timo Rothenpieler
31abcc1505 avformar/tls_openssl: use correct info callback in DTLS mode 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
5edbfc4bae avformat/tls_openssl: clean up peer verify logic in dtls mode 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
95fd0840fe avformat/tls_openssl: don't hardcode ciphers and curves for dtls 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
f3355a1fff avformat/tls_openssl: properly limit written size to data mtu 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
576f44016a avformat/tls_openssl: set default MTU if none is set 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
b6e808d28b avformat/tls_openssl: initialize DTLS context with correct method 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
db0adbbd3f avformat/tls_openssl: don't abort if dtls has no key/cert set 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
951013e603 avformat/tls_openssl: force dtls handshake to be blocking
There is no sensible way to handle this otherwise anyway, one just has
to loop over this function until it succeeds.
2025-07-16 18:46:55 +02:00
Timo Rothenpieler
87b09f3931 avformat/tls_openssl: set dtls remote addr in listen mode
Taken from the first received packet, which will signify the now
permanent peer of this DTLS "connection".
2025-07-16 18:46:55 +02:00
James Almer
9c55f22ef2 avcodec/ffv1dec: don't add offsets to NULL pointers
Fixes: libavcodec/ffv1dec.c:452:43: runtime error: applying zero offset to null pointer
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-15 10:24:09 -03:00
James Almer
307983b292 avformat/tls_schannel: add check for Windows 10 only types and defines
Old Mingw-w64 releases provided by some distros seemingly don't have them, so
check for them and disable the dtls protocol if unavailable.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-15 10:24:08 -03:00
Niklas Haas
053a113ad8 avutil/hwcontext_vulkan: don't over-map buffers with prior padding
If the image data is not at the start of the buffer allocation, such as
when the buffer has padding before the image data, this function maps too
much memory, since src_data + src_buf->size exceeds the buffer size.

Fix this by subtracting the difference between the buffer start and the
provided image data pointer from the size of the memory range to map.

An easy way to reproduce this issue is using the vf_pad filter, which
allocates image data buffers with a nonzero offset whenever padding is
requested before the start of the image data.
2025-07-15 12:46:11 +02:00
Lynne
bedfb6eca4 aacenc_tns: clamp filter direction energy measurement
The issue is that:

float en[2];
...
tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
for (g = 0; g < tns->n_filt[w]; g++) {
    tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];

When using the AAC Main profile, n_filt = 3, and slant is by
default 2 (normal long frames), g can go above 1.

en is the evolution of energy in the frequency domain for every
band at the given window. E.g. whether the energy is concentrated
at the top of each band, or the bottom.

For 2-pole filters, its straightforward.
For 3-pole filters, we need more than 2 measurements.

This commit properly implements support for 3-pole filters, by measuring
the band energy across three areas.

Do note that even xHE-AAC caps n_filt to 2, and only AAC Main allows
n_filt == 3.

Fixes https://trac.ffmpeg.org/ticket/11418
2025-07-15 16:27:31 +09:00
Kacper Michajłow
e9cd280dfe MAINTAINERS: add myself
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-15 00:59:46 +02:00
Marton Balint
fba1913d5a tests/fate: add fate test for excessive frame buffering when using filters
Based on the command line of ticket #10959.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:05:11 +02:00
Marton Balint
7d54fad868 fftools/ffmpeg: add support for setting maximum buffered frames in a filtergraph
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:05:11 +02:00
Marton Balint
b24155cae1 avfilter/avfilter: add AVFilterGraph->max_buffered_frames to limit buffered frames
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:05:10 +02:00
Marton Balint
71468e85ae avfilter/framequeue: add support for limiting and tracking buffered frames in the queues
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:03:36 +02:00
Jiasheng Jiang
35a6de137a libavcodec/alsdec.c: Add check for av_malloc_array() and av_calloc()
Add check for the return value of av_malloc_array() and av_calloc()
to avoid potential NULL pointer dereference.

Fixes: dcfd24b10c ("avcodec/alsdec: Implement floating point sample data decoding")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-12 20:35:18 +02:00
Niklas Haas
0a5ae743ef avfilter/vf_thumbnail: switch to query_func2
Instead of enumerating a static list of planar formats to support, walk
through the format list and enable all supported formats.

As of writing, this generates the following format list:
- gbrap
- gbrap10le
- gbrap12le
- gbrap14le
- gbrap16le
- gbrp
- gbrp10le
- gbrp12le
- gbrp14le
- gbrp16le
- gbrp9le
- gray
- gray10le
- gray12le
- gray14le
- gray16le
- gray9le
- ya16le
- ya8
- yuv410p
- yuv411p
- yuv420p
- yuv420p10le
- yuv420p12le
- yuv420p14le
- yuv420p16le
- yuv420p9le
- yuv422p
- yuv422p10le
- yuv422p12le
- yuv422p14le
- yuv422p16le
- yuv422p9le
- yuv440p
- yuv440p10le
- yuv440p12le
- yuv444p
- yuv444p10le
- yuv444p12le
- yuv444p14le
- yuv444p16le
- yuv444p9le
- yuva420p
- yuva420p10le
- yuva420p16le
- yuva420p9le
- yuva422p
- yuva422p10le
- yuva422p12le
- yuva422p16le
- yuva422p9le
- yuva444p
- yuva444p10le
- yuva444p12le
- yuva444p16le
- yuva444p9le
- yuvj411p
- yuvj420p
- yuvj422p
- yuvj440p
- yuvj444p
2025-07-12 12:52:33 +02:00
Niklas Haas
cf18b280f0 avfilter/vf_thumbnail: support more planar formats
This adds support for high bit depth formats, as well as formats with fewer
than 3 planes. The implementation for HBD is the same as for 8 bit formats,
just right shifted to 8 bits.

It's worth pointing out that this also works for HDR formats (and even DV),
because the underlying implementation is just trying to minimize the histogram
difference. If anything, using a HDR format will result in a *more* accurate
detection, because HDR formats tend to be more perceptually uniform.
2025-07-12 12:52:33 +02:00
Timo Rothenpieler
3ce348063c avcodec/nvdec: switch to proper pixfmts on next major bump 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
8304a1abc7 avcodec/nvenc: add support for new 10 bit MSB pixel formats 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
02a7c85753 swscale: add support for new 10/12 bit MSB formats 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
e93de9948d avutils/pixfmt: add YUV444/GBRP 10 and 12 bit MSB formats 2025-07-11 17:49:58 +02:00
Jorge Estrada
cd91469114 avfilter/overlay_cuda: add timeline editing support
Enables timeline editing options for overlay_cuda similar to what overlay allows

Example overlaying an image on a video between 30 to 60 seconds:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i sample-video.mp4 -i sample-image.jpg
-filter_complex "[1:v]hwupload_cuda[image],[0:v]scale_npp=format=yuv420p[video],[video][image]overlay_cuda=enable='between(t,30,60)'"
-c:v h264_nvenc -c:a copy -y overlay-output-gpu.mp4

Signed-off-by: Jorge Estrada <jestrada.list@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-11 17:49:58 +02:00
Timo Rothenpieler
9b6638e125 avformat/tls_schannel: fix non-blocking write breaking TLS sessions 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
9cd86c431b avformat/tls_schannel: add option to load server certificate from store 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
90fa9636ef avformat/tls_schannel: add DTLS support 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
6af099522e avformat/tls: make passing an external socket universal 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
2604c86c1f avformat/udp: add function to set remote address directly 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
585cae13fa avformat/udp: separate rx and tx fifo 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
af04a27893 avformat/udp: make recv addr of each packet available 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
2c7e117fe0 avformat/tls: move whip specific init out of generic tls code 2025-07-11 17:49:57 +02:00
Marvin Scholz
7c91ae9419 avformat/rtsp: check copy_tls_opts_dict
Properly check av_dict_set return values and propagate them to
the caller so they can be handled.
2025-07-11 16:32:05 +02:00
Marvin Scholz
c4e8ac3d0e avformat/rtsp: use av_unreachable 2025-07-11 16:32:05 +02:00
Marvin Scholz
c425951c05 avformat/rtsp: fix misleading indentation 2025-07-11 16:32:05 +02:00
Andreas Rheinhardt
fadadb56e6 avcodec/mpegvideo_dec: Avoid implicit NULL + offset
Happens since 4fc874ef08
when this code is called via error resilience.
Also do the same for wmv2dec.c.
Fixes the vsynth_{1,2,3,_lena}-mpeg4-error and wmv2-drm-dec FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:36 +02:00
Andreas Rheinhardt
9139edfdd3 avcodec/opus/dec: Simplify resetting AVAudioFifo
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:27 +02:00
Andreas Rheinhardt
66f29ae9b6 avcodec/opus/dec: Don't call function multiple times in FFMAX
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:21 +02:00
Andreas Rheinhardt
faf0d81309 avcodec/opus/dec: Remove unused parameters
The parameters here are not only unused, but buf_size's value
is actually wrong when flushing (it comes from the subpacket
of the last packet sent and is therefore outdated).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:14 +02:00
Andreas Rheinhardt
ba2c9acedb avcodec/get_bits: Remove GetBitContext.buffer_end
It is unused. Furthermore, this automatically fixes the issue
that init_get_bits() failure would lead to NULL + 0 (when
setting buffer_end) which is UB before C23. This happened
in the fic-avi and fic-avi-skip_cursor FATE-tests.

This saved 7296B of .text here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Andreas Rheinhardt
367cf961ea avcodec/get_bits: Add get_bits_bytesize()
And use it to avoid accesses to GetBitContext.buffer_end.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Andreas Rheinhardt
d20a4ef93c avcodec/vvc/dec: Don't use GetBit-API when byte-aligned
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Andreas Rheinhardt
d19b88f570 avcodec/bytestream: Add const where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Kacper Michajłow
3334bdc6e7 avformat/scd: ensure SCD_MIN_HEADER_SIZE bytes are read
Instead of accessing unintialized data when input is shorter than
expected size.

Fixes use of uninitialized value in MSAN build.
Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-11 01:23:58 +02:00
James Almer
1787fade20 fftools/ffmpeg_demux: don't flag timestamps as unreliable if they are generated
Regardless of the source being an AVFMT_NOTIMESTAMPS format, if the timestamps
are generated like when using the use_wallclock_as_timestamps demuxer option,
then they are reliable.

Fixes ticket #11268

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-10 11:13:36 -03:00
Marvin Scholz
82aeee3c19 avformat/rtsp: fix leak of options dict on error
Fix CID 1655306

Reviewed-by: Kieran Kunhya <kierank@obe.tv>
2025-07-10 13:16:08 +02:00
Peter Ross
853ad9e77e avcodec/adpcm: squelch uninitialized variable warnings
Fixes CID1655273 and CID1655274.

Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-07-10 13:01:15 +02:00
Desmond Liu
060fc4e3a5 doc/scaler.texi: add missing gamma option
Add missing 'gamma correct scaling' option to documentation.

Signed-off-by: Desmond Liu <desmond.liu@netint.ca>
2025-07-08 16:05:22 +05:30
Marvin Scholz
0dedef1557 avformat/tls: rename accidentally changed options
These were accidentally renamed back to the old names in
ba9817df9d

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-08 00:16:21 +02:00
Marvin Scholz
50cae8ad76 Changelog: mention dropping OpenSSL < 1.1.0 2025-07-07 20:53:54 +02:00
Dawid Kozinski
219f234e07 avformat/mov: add support for APV streams
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-07 13:37:24 -03:00
Marvin Scholz
934e1c23b0 APIchanges: Add entry for AV_PKT_DATA_RTCP_SR 2025-07-07 17:19:44 +02:00
Marvin Scholz
eca477da52 avcodec: bump minor after adding AV_PKT_DATA_RTCP_SR 2025-07-07 17:18:48 +02:00
Marvin Scholz
d2828ab284 avformat: rtsp: export AV_PKT_DATA_RTCP_SR 2025-07-07 16:33:48 +02:00
Marvin Scholz
73d77693c5 avcodec: add AV_PKT_DATA_RTCP_SR side data type 2025-07-07 16:33:48 +02:00
Marvin Scholz
74aa710879 lavf: add and use AVRTCPSenderReport struct
This will be used in a future commit to expose the SR as side-data.
2025-07-07 16:14:02 +02:00
Marvin Scholz
e0abe0a02a lavf/rtpdec: fix RTCP SR packet length check
The minimum valid packet length is 28, given that the length includes
the packet header.

This didn't cause any issues so far as the code did not care about the
last two fields in the SR section, but will be relevant in a future
commit.
2025-07-07 16:14:02 +02:00
Marvin Scholz
019ca5f013 avformat/tls_openssl: use SSL_CTX_set_min_proto_version
Using SSL_CTX_set_options to disallow specific versions is
discouraged by the documentation, which recommends to use
SSL_CTX_set_min_proto_version instead.
2025-07-07 01:52:47 +02:00
Marvin Scholz
fb38d8759b avformat/tls_openssl: use TLS_[client|server]_method
SSLv23_*_method was just a define for these anyway since OpenSSL 1.1.0
and the old functions are deprecated.
2025-07-07 01:52:47 +02:00
Marvin Scholz
aaffa9bc72 avformat/tls_openssl: remove unnecessary checks
Calling av_free with NULL is a no-op so this check is not needed.
2025-07-07 01:52:46 +02:00
Marvin Scholz
3abc8d507b avformat/tls_openssl: remove leftover comment 2025-07-07 01:52:46 +02:00
Marvin Scholz
816dad231f avformat/tls_openssl: properly get new BIO index
As noted in the OpenSSL documentation, BIO_get_new_index must be
used to get a new BIO index. This is ORd with the proper type flag
BIO_TYPE_SOURCE_SINK.
2025-07-07 01:52:46 +02:00
Marvin Scholz
1702becd64 avformat/tls_openssl: remove now unnecessary define
This was used previously when multiple OpenSSL versions were supported
that required this to be handled differently.
2025-07-07 01:52:46 +02:00
Marvin Scholz
f0913b3f16 avformat: tls: drop support for OpenSSL < 1.1.0 2025-07-07 01:52:46 +02:00
Marvin Scholz
f256487cd8 configure: require at least OpenSSL 1.1.0
Given that OPENSSL_init_ssl was introduced in 1.1.0 means we can rely on
that to ensure we have at least 1.1.0.
2025-07-07 01:52:46 +02:00
Daniel N Pettersson
e1ef33d361 avformat/rtsp: add TLS options
Add TLS options to RTSP for when TLS is used for the lower protocol.

Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Co-authored-by: Marvin Scholz <epirat07@gmail.com>
2025-07-07 01:45:10 +02:00
Marvin Scholz
ba9817df9d avformat/tls: move common client options into their own define
Used in a future commit to not duplicate options.
2025-07-07 01:45:07 +02:00
Marvin Scholz
d9eb63724e avutil/hwcontext_videotoolbox: fix unused variable warning
Resolves an unused variable warning when targeting a recent appleOS
version.
2025-07-07 01:33:18 +02:00
Michael Niedermayer
eb52251c0a avcodec/vvc/ctu: Check ff_vvc_num_signalled_palette_entries
Fixes: index 107 out of bounds for type 'uint16_t const[63]'
Fixes: 421336912/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6436225806565376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-06 19:25:47 +02:00
Michael Niedermayer
9d1e4feece avcodec/vvc/ctu: Check palette_escape_val
Fixes: integer overflow
Fixes: 418314174/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4871731867353088

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-06 19:24:52 +02:00
Michael Niedermayer
38ead08815 swscale/output: Fix integer overflows in yuv2rgba64_1_c_template()
Fixes: signed integer overflow: -132524 * 16525 cannot be represented in type 'int'
Fixes: 414862270/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4869083202125824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-06 19:24:07 +02:00
Michael Niedermayer
67559760c6 avcodec/psd: Move frame allocation after RLE processing
Fixes: Timeout
Fixes: 410609448/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PSD_fuzzer-6267226128973824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-06 19:23:56 +02:00
Michael Niedermayer
b2858d462d avcodec/apv_dsp: Avoid UB overflow in dequant
Fixes: signed integer overflow: 33632416 * 64 cannot be represented in type 'int'
Fixes: 421817631/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4957386534354944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-06 19:20:24 +02:00
Michael Niedermayer
af3852e22c avcodec/smacker: Check input before allocation
Fixes: Timeout
Fixes: 421650030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-6144441767493632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-06 19:20:19 +02:00
Michael Niedermayer
9899c8c00b avcodec/smacker: Move buffer allocation to later
Reduces allocations on random input
Fixes: 421650030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-6144441767493632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-06 19:20:17 +02:00
Nicolas Gaullier
6b028859d9 fate/seek: fix missing mpeg4video parser dependency
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:50 +02:00
Nicolas Gaullier
81b1cd3ce2 fate/all: fix missing some mov demuxer dependencies
In aac/aac-fixed, also remove unnecessary aac demuxer dependency.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:49 +02:00
Nicolas Gaullier
57a0412830 fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies
When CMD is crc/framecrc, always use the macros CRC/FRAMECRC, even if it
includes unnecessary requirements for rawvideo/pcm_s16le encoders (as
actually noticed in a comment of the Makefile).

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:49 +02:00
Nicolas Gaullier
e2c7f7804d fate/all: add missing file protocol dependencies
First, always require file protocol when FATE suite is used.
Then, add missing dependencies while removing duplicates.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:49 +02:00
Nicolas Gaullier
1ece56ddbb fate/all: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:48 +02:00
Nicolas Gaullier
7de40387e7 fate/hevc: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:48 +02:00
Nicolas Gaullier
b4c9587589 fate/pcm: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:48 +02:00
Nicolas Gaullier
ae31b66028 fate/mpeg4: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:47 +02:00
Nicolas Gaullier
5fe4434cb9 fate/hlsenc: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:47 +02:00
Nicolas Gaullier
64198e0820 fate/cover-art: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:47 +02:00
Nicolas Gaullier
daea361d88 fate/ac3: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:46 +02:00
Nicolas Gaullier
fbcfa24ec0 fate/audio: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:46 +02:00
Nicolas Gaullier
af40eb2ef7 fate/aac: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:45 +02:00
Nicolas Gaullier
ee29f2f455 fate/vorbis: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:45 +02:00
Nicolas Gaullier
c1fa833d1c fate/lavf-container: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:45 +02:00
Nicolas Gaullier
9876a515e2 fate/gapless: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:44 +02:00
Nicolas Gaullier
0b7b53a154 fate/mov: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:44 +02:00
Nicolas Gaullier
ee78de046a fate/all: switch-fix mov muxer dependency to mp4 muxer dependency
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:44 +02:00
Nicolas Gaullier
a0cf4c7d2d fate/demux: fix multiple dependencies
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:43 +02:00
Nicolas Gaullier
9f7e9d5e7e fate/all: add missing dependencies for extradata bsf
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:43 +02:00
Nicolas Gaullier
0ab09a6b8f tests/Makefile: make easier to check for multiple dependencies
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:43 +02:00
Lidong Yan
a4a71b5e9d avfilter/asrc_sinc: fix leak in config_input()
In config_input(), fir_to_phase() allocates memory in h[longer], which
would leak if av_calloc() to s->coeffs failed. lpf() allocates memory
in h[0] and h[1], which would leak if fir_to_phase() failed. To fix
this leak, add av_free(h[longer]) in as cleanup code, and replace
return AVERROR* with goto cleanup to prevent from leaks.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:10:36 +02:00
Kacper Michajłow
5f62e2de98 fftools/cmdutils: don't try to load arguments from file if not needed
CLI option parser checks if argument exists when needed, but in this
case only OPT_TYPE_BOOL where checked, so OPT_TYPE_FUNC without argument
where trying to load a file from `arg` which is NULL in this case.

Fixes crash on `ffmpeg -/version`

Fixes: 6d17991b7e
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:05:56 +02:00
Ken McGaugh
30043cc167 avformat/mov: allowing custom udta atoms to pass through their values correctly when export_all option specified.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:05:56 +02:00
Kacper Michajłow
3b6ec5abb5 avcodec/opus: don't materialize buf pointer from null
Fixes: avcodec/opus/dec.c: runtime error: applying non-zero offset 10 to null pointer

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-05 21:05:39 +02:00
Marvin Scholz
05094c1749 fftools/textformat: remove unreachable code in tf_mermaid
Integer writing is impossible here as the first branch was dead code,
so remove it completely.

Fix CID 1646948

Reviewed-by: softworkz <softworkz@hotmail.com>
2025-07-05 02:35:00 +02:00
Timo Rothenpieler
bf5f3f1f2e avcodec/nvdec: fix 10bit output pixel formats
Fixes #11655
2025-07-04 17:20:57 +02:00
Peter Ross
0fe9f25e76 avcodec/adpcm: Sanyo LD-ADPCM decoder 2025-07-04 17:07:53 +10:00
Jorge Estrada
ad0a44028d avfilter: add pad_cuda filter
This patch adds the pad_cuda video filter. A filter similar to the existing pad filter but accelerated by CUDA.

The filter shares the same options as the software pad filter.

Example usage:
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf "pad_cuda=w=iw+100:h=ih+100:x=-1:y=-1:color=red" out.mp4

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-04 01:32:27 +02:00
Michael Niedermayer
ecbe3e7366 avcodec/rv60dec: Check ofs for overflows
Fixes: signed integer overflow: 30 + 2147483647 cannot be represented in type 'int'
Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-6568264620900352

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:05:31 +02:00
Lidong Yan
e68599f551 avformat/rtpdec_asf: fix leak in ff_wms_parse_sdp_a_line()
In ff_wms_parse_sdp_a_line(), it allocates memory in buf, but doesn't
free buf when avformat_alloc_context() failed. Add av_free(buf) before
return to prevent from leak.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:05:27 +02:00
Lidong Yan
98afcd3da7 avcodec/sunrast: fix leak in sunrast_decode_frame()
In sunrast_decode_frame(), we use av_malloc_array() allocates memory
to ptr and ptr2. However if buf_end - buf < 1, this function returns
error code without freeing this memory thus cause a leak. Add av_freep()
before return.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:05:14 +02:00
Lidong Yan
7ed5a7094f avformat/rtpdec_latm: fix leak in parse_fmtp_config()
av_mallocz() allocates memory in config, but we forget to free it
if init_get_bits() failed. Replace return ret with goto end.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:04:57 +02:00
Timo Rothenpieler
ba984355fe avformat/whip: fix format string for printing size_t 2025-07-03 22:51:15 +02:00
Timo Rothenpieler
3f7e0fddee avformat/tls: clean up new whip options 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
4a4a566d6e avformat/tls: remove unused fingerprint option 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
043d3fef8a avformat/tls_openssl: use existing context handle 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
2e72924ad1 avformat/tls: fix udp init 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
23c70e3740 avformat/udp: don't override 0 localport 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
492aef2d94 avformat/tls: don't use http_proxy for udp sockets 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
311742eb5a avformat/tls: use non protocol specific error message 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
058b226313 avformat/whip: remove redundant WHIP: prefix from all logging 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
b92130293e avformat/whip: don't leak options dict 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
8f3ecc9db0 avformat/whip: use av_dict_set_int for int 2025-07-03 22:18:10 +02:00
Timo Rothenpieler
cdc03240fe avformat/Makefile: don't hardcode openssl for whip muxer 2025-07-03 22:18:10 +02:00
Marton Balint
42bcbdd456 fftools/ffmpeg_filter: always reap all available frames before requesting new ones
alfilter_graph_request_oldest() might return EAGAIN and produce a frame on not
the oldest sink.

Fixes ticket #11597.
Fixes excessive frame buffering in #10959.
Fixes excessive frame buffering in #11366.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
af189e424b avfilter/f_select: port to activate
Multi-input or multi-output filters should use activate now.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
223c2b03da avfilter/buffersink: keep requesting frames if one activation of the graph does not provide one
A frame graph activation might not produce a frame in the requested sink, so
keep on requesting a frame there unless we encounter a filter activation with
buffersrc empty error.

This makes av_buffersink_get_frame(_flags) work according to its documentation
which claims that EAGAIN is only returned if additional frames must be inserted
into the graph.

Fate changes are because audio frames will have different sizes at segment
boundaries, but content is the same.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
d41bac1333 avfilter: signal an empty buffersrc with an explicit activate error code
No change in functionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
eea6f0e32e tests/fate/filter-audio: add anullsink test
Tests ticket #11624 with a slight modification.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
44546751db avfilter/avfilter: make filter_activate_default request frames on behalf of sinks
Sinks without an activate callback have no means to request frames in their
input, therefore the default activate callback should do it for them.

Fixes ticket #11624.
Fixes ticket #10988.
Fixes ticket #10990.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
4440e499ba avfilter/avfilter: always forward request frame in filter_activate_default
Even if all inputs are blocked an activate callback should request a frame on
some if its inputs if a frame is requested on any of its outputs.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
a85835bfb8 fate/filter-video: add ffprobe test for dual output select filter
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
Marton Balint
a736ac72bb avfilter/avfilter: fix forwarding EOF for simple API filters in filter_activate_default
EOF only need to be forwarded back if all outputs have reached EOF.

Fixes infinte loop with ffprobe -f lavfi -i "smptebars=d=1,select=n=2:e=1[out0][out1]"
Regression since d9e41ead82.

Fixes ticket #10959.
Fixes ticket #11366.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:53 +02:00
Marton Balint
29e696c9c0 avfilter/filters: simplify FF_FILTER_FORWARD_WANTED_ANY
The status check is unneeded because an outlink with a nonzero status should
always return 0 for ff_outlink_frame_wanted(). Also use unsigned for index
because nb_outputs is unsigned as well.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:53 +02:00
Marton Balint
f3b7aa6c22 avfilter: factorize requesting an input frame from multi output filters
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:53 +02:00
Andreas Rheinhardt
01ffe103e5 avcodec/rv34: Fix spelling mistake
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
Andreas Rheinhardt
fa02dea036 avcodec/rv34: Don't report progress unnecessarily
ff_mpv_frame_end() already does it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
Andreas Rheinhardt
abc54c25be avcodec/mpegvideo: Move loop_filter to {H263Dec,MPVEnc,VC1}Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
Andreas Rheinhardt
60f51bdaac avcodec/mpegvideo: Move partitioned_frame to {H263Dec,MPVEnc}Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
Andreas Rheinhardt
0984724d1e avcodec/mpeg_er: Allow to skip setting partitioned_frame, p[pb]_time
Instead of setting these unconditionally (they are always zero
for H.261, MPEG-1/2, RV30/40, VC-1), add a variant of
ff_mpeg_er_frame_start() that sets them and remove setting them
from ff_mpeg_er_frame_start(). Also pass these values via parameters
instead of reading them from the MPVContext itself.
This will allow to move them from MPVContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
3c06d87c93 avcodec/mpegvideo: Move fields to {H263Dec,MPVEnc}Context when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
00ea78f426 avcodec/flvdec: Binarize h263_flv
It used to be a tri-state encoding both whether to use FLV picture
headers and whether to use the FLV way of encoding escape values,
but the former is now unnecessary due to the switch to a function
pointer for reading the header. So binarize h263_flv.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
532ae5dc7d avcodec/ituh263enc: Inline value of h263_flv
It is always two when we encode FLV1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
c660f45f8e avcodec/h263dec: Use function ptr for decode_picture_header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
3b6d1a6ee1 avcodec/msmpeg4dec: Move ff_msmpeg4_decode_init() down
Will avoid a forward declaration lateron.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
502a6ea123 avcodec/mpegvideo: Move SLICE_* defs to h263dec.h, h261dec.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
2089d39735 avcodec/mpegvideo: Move mb_skip_run to {RV34Dec,MPVEnc}Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
d5fa282936 avcodec/mpeg12dec: Put mb_skip_run on the stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
9f42725d75 avcodec/mpegvideo: Move mb_num_left to {H263,RV34}DecContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
7db6267b30 avcodec/mpegvideo: Move fields only used by H.263 decoders to H263DecCtx
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
f1c56c08ed avcodec/mpeg12dec: Don't use MPVContext.block
Instead add the necessary blocks directly into Mpeg12SliceContext.
This allows to completely remove MPVContext.block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
e40b0ebb2e avcodec/mpeg12dec: Move MpegEncContext.gb to Mpeg12SliceContext
It was its last user.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
27d785746c avcodec/mpegvideo: Add missing headers
These files currently rely on implicit inclusions of avassert.h
and/or mathops.h via get_bits.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
3a96a3c949 avcodec/mpeg12dec: Add Mpeg12SliceContext
This is in preparation for removing the GetBitContext
from MPVContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
8a4accc24d avcodec/h263dec: Stop using MpegEncContext.gb
Add a GetBitContext to H263DecContext instead. This is in preparation
for removing MpegEncContext.gb.
Also move last_resync_gb to H263DecContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
77add26918 avcodec/h263dec: Don't use MpegEncContext.block
Instead add the necessary blocks directly to H263DecContext
(only six are needed, not 12 as ff_mpv_common_init()
currently allocates).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
b2be342ab6 avcodec/h263dec: Remove redundant block parameter from decode_mb
With the exception of mpeg4_decode_studio_mb(), all decode_mb
functions implicitly presumed that the block provided as
argument coincides with MpegEncContext.block (they zeroed the latter
and then used the former to decode the block); mpeg4_decode_studio_mb()
meanwhile did not use the provided block at all (it uses blocks of
int32_t). So remove said parameter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
Andreas Rheinhardt
584d50c5f3 avcodec/h263dec: Add H263DecContext
This is in preparation for moving the fields only used
by H.263-based decoders from MPVContext to H263DecContext.
For now only the decode_mb function pointer has been moved
(to be able to switch said callback to use an H263DecContext*).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:23 +02:00
Andreas Rheinhardt
3f5c2043cc avcodec/mpegvideo: Move dct_precision to Mpeg4DecContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
758c8dffc9 avcodec/{h263,mpeg4video}dec: Pass MPVContext*, not Mpeg4DecContext*
The code in h263dec.c is not supposed to know that the MPEG-4
decoder uses an Mpeg4DecContext as private context at all
(said context is only exposed in a header so that hardware
accelerations can access it and for the parser to use).
Passing an MPVContext* directly also allows to remove
the indirection via AVCodecContext.priv_data.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
91e9578025 avcodec/mpeg4videodec: Avoid unnecessary indirections
This basically reverts d4967c04e0.
Said commit was based on the false premise that it would
be an aliasing violation to upcast a pointer to structure
to a pointer to a bigger structure containing the original
structure as its first element, but this is just not true.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
273de7f60c avcodec/mpegvideo: Move unrestricted_mv to MotionEstContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
05510dac6b avcodec/mpegvideo: Move flipflop_rounding to {MSMPEG4Dec,MPVEnc}Context
Forgotten in 9964212545.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
ee81e28469 avcodec/mpeg12dec: Deduplicate variables
This situation was created in merge commit
71d008ebe4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
94cfbf0238 avcodec/vc1: Don't use MpegEncContext.block
Instead add the necessary blocks directly to VC1Context
(only six are needed, not 12 as ff_mpv_common_init()
currently allocates).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
fe2dbb12b0 avcodec/vc1: Stop using MpegEncContext.gb
Add a GetBitContext to VC1Context instead. This is in preparation
for removing MpegEncContext.gb.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
aa4a5b1e33 avcodec/intrax8: Don't pretend to need more than one int16_t[64]
Intrax8 needs only a single block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
25e4baeed4 avcodec/rv34: Don't use MpegEncContext.block
These decoders only need a single 4x4 block; put it in RV34DecContext.
This is in preparation for removing MpegEncContext.block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
0e6d59871f avcodec/rv34: Don't use MpegEncContext.gb
This is in preparation for removing MpegEncContext.gb.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
86ee71f4e9 avcodec/mpeg12dec: Remove unused function parameter
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
b38f23663e avcodec/mpeg12dec: Put GetBitContext on the stack where advantageous
This is in preparation for no longer using MpegEncContext.gb.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
21c88b29f7 avcodec/h261dec: Don't use MpegEncContext.block
Instead put it into H261DecContext. This is in preparation
for removing MpegEncContext.block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
80ed868296 avcodec/h261dec: Stop using MpegEncContext.gb
This is in preparation for removing said field from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
fabbe79170 avcodec/mpegvideodec: Remove size expectation from ff_mpv_reconstruct_mb
In the common case of decoding 420 content, only six blocks are used
and it makes perfect sense for the caller to only have that many.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
4fc874ef08 avcodec/mpeg_er: Don't use MpegEncContext.block
It is unused (because unquantizing/the idct has been disabled)
apart from FF_DEBUG_DCT_COEFF debug code which makes no sense
when this function is called via error resilience. So pass a NULL
as block when calling ff_mpv_reconstruct_mb() from mpeg_er_decode_mb()
and disable the debug code in this scenario.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
8cff637cf0 avcodec/mpegvideo_dec: Reindent after the previous commit
Also use dedicated variables for the accesses.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
261d8eb5dd avcodec/mpegvideo_dec: Factor debugging dct coefficients out
This allows to hint to the compiler that the branch is likely
not taken by marking the factored out function as av_cold.
It is also in preparation for further commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
0723fcce51 avcodec/mpegvideo: Add MPVContext typedef
MpegEncContext is also used for decoding, so it is a misnomer.
This commit therefore adds MPVContext as typedef for it in order
to gradually switch the code to the new name (in line with
MPVEncContext).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
3b87a480fe avcodec/mpegvideoenc: Allocate blocks as part of MPVEncContext
This avoids mpegvideo.c having to deal with the fact that
the encoders use two sets of blocks and is in preparation
for not allocating blocks at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
1c258b5581 avcodec/ituh263dec: Only initialize ff_h263_rl_inter when needed
The H.263 decoder itself does not need max_run/max_level
of this RLTable, only the MPEG-4 decoder does.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
8a3566498e avcodec/ituh263enc: Simplify creating LUT
Only very few combinations (2x102) of 16384 correspond to
valid codes; so just initialize all codes via memset
and then set the few valid codes explicitly instead of initializing
everything in the same way.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
ba79fff6d5 avcodec/rl: Avoid branch in index lookup
This uses the same logic as the MPEG-1/2 and SpeedHQ encoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
baccb96fce avcodec/ituh263dec: Use correct logcontext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:34:51 +02:00
Andreas Rheinhardt
725563a731 avcodec/wmaprodec: Avoid branch for setting block_align
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:21:55 +02:00
Andreas Rheinhardt
66acbb92a3 avcodec/wma: Remove redundant nb_channels check
Already checked generically as none of the codecs here
have the AV_CODEC_CAP_CHANNEL_CONF set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:21:55 +02:00
Andreas Rheinhardt
12777f30a8 avcodec/wma,wmaprodec: Remove always-false checks
None of the codecs used here has the AV_CODEC_CAP_CHANNEL_CONF
cap set, so the sample rate is checked generically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:21:55 +02:00
Andreas Rheinhardt
73646259a0 avcodec/avcodec: Check sample_rate generically
Check that all audio codecs except decoders with the
AV_CODEC_CAP_CHANNEL_CONF flag have a positive sample rate set.

Fixes: AVERROR_BUG return
Fixes: 413997604/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HCA_fuzzer-5188382613635072

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:21:55 +02:00
Andreas Rheinhardt
82fa6b450d avcodec/dfpwmenc: Remove write-only context member
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:18:55 +02:00
Andreas Rheinhardt
11d3af0d7f avcodec/dfpwmenc: Correctly pad input
Before this patch, the DFPWM1a encoder was marked as supporting
variable frame sizes. The DFPWM1a format converts eight bytes
of input into one output byte and so it simply padded the number
of data output by
frame->nb_samples * frame->ch_layout.nb_channels / 8 +
(frame->nb_samples % 8 > 0 ? 1 : 0)
This has several bugs:
a) The additional byte leads to eight additional input byte being
read; this can read into the frame's padding, i.e. the data can
be uninitialized.
b) The criterion for whether one should pad is wrong:
nb_samples * nb_channels should be tested for divisibility by eight.
c) The created frames can be undecodable (at least with our decoder):
Our decoder requires the number of bits per frame to divisible by
the number of channels, yet the above approach does not guarantee this.
d) The padding will be added in the middle of the stream (potentially
for every packet).

This commit fixes all of this by removing the variable frame size cap
and using AVCodecInternal.pad_samples to pad the last frame so that
nb_samples * nb_channels is always a multiple of eight.
The lavf-dfpwm FATE-test was affected by a). The frames originated from
lavfi and were part of an audio frame pool, so that the padding
contained data from an earlier (bigger) frame. Now the last frame is
properly filled with silence.

Reported-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:18:55 +02:00
Andreas Rheinhardt
e813e1e940 avcodec/fic: Postpone duplicating AVFrame buffer
This avoids duplicating the AVFrames in case of skip frames
or in case of errors.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:29 +02:00
Andreas Rheinhardt
45920251d9 avcodec/fic: Ensure skip frames have up-to-date props
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:29 +02:00
Andreas Rheinhardt
8bed944dda avcodec/fic: Don't prematurely claim to have decoded a frame
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:29 +02:00
Andreas Rheinhardt
4c69f302a9 avcodec/fic: Remove redundant logmessage
ff_reget_buffer() emits its own logmessage on error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:28 +02:00
Andreas Rheinhardt
12ae987a6a avcodec/fic: Don't copy frame unnecessarily
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:28 +02:00
Andreas Rheinhardt
d6986e1fcd avcodec/fic: Avoid implicit av_frame_free()+av_frame_alloc()
Use av_frame_replace() instead. Also remove the error message:
It was highly misleading (as if av_frame_clone() duplicated
the AVFrame data buffers instead of just creating a new reference).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:28 +02:00
Andreas Rheinhardt
5d5e922088 avcodec/fic: Avoid copying cursor unnecessarily
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:28 +02:00
Andreas Rheinhardt
2845013154 tests/fate/screen: Add test for skipping cursor with FIC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 19:42:28 +02:00
Andreas Rheinhardt
2db60f90df swresample/rematrix: Constify
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 18:17:56 +02:00
Andreas Rheinhardt
589f1e5cc7 swresample/rematrix: Use correct function pointer types for calls
Calling a function via a different function pointer type is
undefined behavior (C11, 6.3.2.3 8); two pointer parameters
of different type are not equivalent in this regard, although
it happens to work in practice; the current code relies on this.

This patch brings the code in line with the spec. This fixes the
following FATE-tests when run with Clang-UBSan:
ac3-fixed-encode-2 audiomatch-afconvert-{16000,44100}-mono-he-{adts,m4a}
audiomatch-dolby-44100-mono-he-mp4 filter-metadata-avf-aphase-meter-mono
filter-pan-{downmix1,downmix2,mono2,stereo2,stereo3,stereo4,upmix1,upmix2}
lavf-dv_{pal,ntsc} matroska-encoding-delay
The error was something like
src/libswresample/rematrix.c:621:17: runtime error: call to function sum2_float through pointer to incorrect function type 'void (*)(void *, const void *, const void *, void *, int, int, int)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 18:17:56 +02:00
Andreas Rheinhardt
bdb4cd44e2 avcodec/ffv1enc: Use dummies to avoid UB pointer arithmetic
Fixes the following FATE-tests when run under Clang-UBSan:
ffmpeg-loopback-decoding, lavf-mxf_ffv1,
vsynth{1,2,3,_lena}-ffv1-v{0,2}, vsynth1-ffv{1,2,3,_lena},
vsynth{1,2,3,_lena}-ffv1-v3-yuv{420p,422p10,444p16}

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 18:17:56 +02:00
Andreas Rheinhardt
134c1d81a4 avcodec/indeo3: Constify ref_block in decode_cell_data()
Also use smaller scope while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 18:17:56 +02:00
Andreas Rheinhardt
41d86b5be5 avcodec/indeo3: Consistently use ptrdiff_t for strides
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 18:17:56 +02:00
Andreas Rheinhardt
7574c55761 avcodec/indeo3: Fix UB pointer arithmetic
Fixes the following error when running with Clang-UBSan:
src/libavcodec/indeo3.c:556:26: runtime error: applying non-zero offset 2560 to null pointer
This fixes the indeo3-2 FATE test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 18:17:56 +02:00
James Almer
11d1b71c31 doc/APIchanges: add missing entries for the recent changes
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-01 23:28:24 -03:00
Diego de Souza
5083f4ad8e avcodec/nvenc: add MV-HEVC encoding support
Added support for MV-HEVC encoding for stereoscopic videos (2 views
only). Compatible with the framepack filter when using the
AV_STEREO3D_FRAMESEQUENCE format.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
2025-07-01 22:47:47 +02:00
James Almer
9c2028b806 avcodec/hevc/hevcdec: export 3D Reference Displays side data
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-01 22:47:34 +02:00
James Almer
dbe347f074 avfilter/vf_showinfo: add support for 3D Reference Displays Information side data
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-01 22:46:22 +02:00
James Almer
2122f04496 avformat/dump: add support for 3D Reference Displays Information side data
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-01 22:46:22 +02:00
James Almer
39d5a998bd avcodec/packet: add a 3D Reference Displays Information side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-01 22:46:19 +02:00
James Almer
b2e4b0e282 avutil/frame: add a 3D Reference Displays Information side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-01 22:42:53 +02:00
James Almer
80a05bea4f avutil: add an API to handle 3D Reference Displays Information
As defined in section G.14.3.2.3 of ITU-T H.265, it's required for proper
signaling of MV-HEVC.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-01 22:41:56 +02:00
Peter Ross
3b9dbda49b tools/pktdumper: dump extradata buffers 2025-07-01 16:45:08 +10:00
Derek Buitenhuis
5bcff199d9 doc: Remove libav-merge.txt
It not longer exists.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2025-06-30 15:00:49 +01:00
Derek Buitenhuis
b58cca5a27 tools: Remove libav-merge-next-commit
Libav is no longer extant.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2025-06-30 15:00:34 +01:00
Michael Niedermayer
cfd1f81e7d avcodec/speexdec: consider differing frame sizes in remaining space check
Fixes: talk109-q5.spx
Regression since: f6986e75be

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-28 23:54:40 +02:00
Nicolas Gaullier
89ec66d61b libavcodec/tests: fix gitignore hashtable
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-28 23:54:40 +02:00
Lidong Yan
a17596f55b avfilter/vf_lut3d: fix leak if allocate_3dlut failed
In parse_cinespace(), memory allocated in in_prelut[] and out_prelut[]
would leak if allocate_3dlut() failed. Replace return ret with goto end
to free memory before return error code.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-28 23:54:40 +02:00
Lidong Yan
40a3d35da6 avcodec/vorbisenc: fix leak if av_mallocz failed
In put_main_header(), av_mallocz() allocates memory to local variable
buffer, buffer leaks if av_mallocz() to *out failed. Add av_free(buffer)
before return error code.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-28 23:54:39 +02:00
Marvin Scholz
7d38486975 avcodec/vvc/refs: remove early return
The ret value is checked later on again, so this check
is redundant and would cause the frame to not be unrefd on
failure as well.

So remove this check and add one before av_frame_remove_side_data
to ensure it is not called with an invalid frame.

Fix CID 1648350

Reviewed-by: Frank Plowman <post@frankplowman.com>
2025-06-28 15:16:45 +02:00
Dawid Kozinski
6e8bd5dd25 avformat/apvdec: add framerate option
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-27 22:32:51 -03:00
Pavel Koshevoy
59a6660625 avformat/demux: Fix segfault due to avcodec_open2 failure
Fixes 'ffprobe 1_poc.mp4' segfault introduced with
commit 0021484d05

codec_close should not assume that the codec_id did not change.
2025-06-27 19:31:26 -06:00
Nicolas Gaullier
18c62245d7 fftools/textformat: renamings in print_unit_int for consistency (cosmetic)
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Reviewed-by: softworkz <softworkz@hotmail.com>
2025-06-27 00:24:35 +02:00
Nicolas Gaullier
2b25a66238 fftools/textformat: fix print 64 bit integers
Regression in ffprobe since textformat introduction
in d7a3f68fea.

Fixes #11638

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: softworkz <softworkz@hotmail.com>
2025-06-27 00:23:57 +02:00
Marvin Scholz
5c1e10d995 fftools/textformat: do not return early
This would make the goto dead code and also would not properly
call avtext_context_close.

Fix CID 1646939

Reviewed-by: softworkz <softworkz@hotmail.com>
2025-06-26 23:40:42 +02:00
Marvin Scholz
564a0784bb fftools/textformat: remove noop free
The tctx->hash was freed already right before.

Reviewed-by: softworkz <softworkz@hotmail.com>
2025-06-26 23:40:42 +02:00
Marvin Scholz
8430b8f9a9 fftools/textformat: narrow variable scopes
Reviewed-by: softworkz <softworkz@hotmail.com>
2025-06-26 23:40:42 +02:00
Marvin Scholz
7771a4eecb fftools/textformat: remove leftover comments in mermaid_print_value
Remove some leftover commented code and an extraneous semicolon.

Reviewed-by: softworkz <softworkz@hotmail.com>
2025-06-26 23:23:35 +02:00
Marvin Scholz
0578d4ad2f fftools/textformat: exit early in mermaid_print_value
Doesn't change the logic, instead of exiting in each of the two
branches below, just exit before.

Reviewed-by: softworkz <softworkz@hotmail.com>
2025-06-26 23:23:35 +02:00
Frank Plowman
540a2497d2 lavc/vvc: Fix condition for using default scaling factor
Add handling here for
sps_scaling_matrix_for_alternative_colour_space_disabled_flag.

Also add parentheses to make behaviour a little more explicit,
where &&'s precedence over || was relied on previously.

Reported-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-06-27 06:06:14 +09:00
Steven Liu
f8a9d9473b avformat/whip: check the exchange sdp url is start with http
Make sure the WHIP protocol performs the SDP offer/answer
exchange with the WebRTC peer over HTTP.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Reviewed-by: Jack Lau <jacklau1222@qq.com>
2025-06-26 22:20:07 +02:00
Steven Liu
87808e38a8 avformat/whip: Remove unnecessary pkt checks
h264_annexb_insert_sps_pps (called after write_packet)
reorganizes PPS, SPS, and IDR packets in H.264 streams.
Since write_packet already validates pkt,
redundant null checks in h264_annexb_insert_sps_pps can be removed.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
2025-06-26 21:46:18 +02:00
James Almer
1abc25cd23 avformat/iamf_parser: remove unreachable code
expanded_loudspeaker_layout is only present and read on the first layer.

Fixes Coverity issue #1655173.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-26 16:33:04 -03:00
Lynne
bd75fad85f hwcontext_vulkan: fix issues with importing a device
The previous fix just used a local variable for the memory properties,
which did not fix this issue.
2025-06-27 03:09:27 +09:00
Marvin Scholz
f744584f71 avformat/tee: fix multiple bsfs in tee
Since 155508c6e9 specifying multiple
bsfs for different streams was broken:

"[bsfs/a=h264_metadata:bsfs/v=h264_metadata]out.mp4|..."

This incorrectly only parsed the first bsfs specification. The reason
for this is that the dictionary is modified in the iterator, hence
invalidating the iterator. The simplest fix for this is to simply
iterate from the beginning in each loop given that the previous entry
is removed.
2025-06-26 17:35:46 +02:00
Dmitrii Ovchinnikov
64fce7202c acvodec/amfenc: Enable use of AMF Surface in multiple encoders
Fixes the behavior of AMF encoders when the same AMF surface is passed
to multiple encoder objects.
for example when using -filter_complex
2025-06-26 13:48:26 +02:00
nyanmisaka
b2c0d37be5 avcodec/amfdec: Add VP9 AMF decoder 2025-06-26 13:48:15 +02:00
Peter Ross
09cd38e9d5 avcodec/rv60dec: drop unused sum variable in read_slice_sizes
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Peter Ross <pross@xvid.org>
2025-06-26 18:01:03 +10:00
Michael Niedermayer
0ffe97d9b9 avformat/mov: Check that sample_count is allocated in mov_parse_heif_items()
Fixes: NULL pointer dereference
Fixes: 416811958/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5425269114732544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-26 00:40:49 +02:00
James Almer
36c8eef42c avformat/iamfdec: remove unused variables after recent changes
Fixes -Wunused-but-set-variable warnings

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 20:15:20 -03:00
James Almer
61773e761e avformat/iamf_writer: fix layout checks when demixing_info is not present
Fixes -Wtautological-overlap-compare warnings

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 19:49:18 -03:00
James Almer
cbb72e6ab6 avformat/iamf_writer: use named constants in more places
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
38f9fbe30d avformat/iamf_writer: reindent after previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
75c514e468 avformat/iamf_writer: add extra constrains for Parameter Sets in Audio Elements
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
a3a7b8edc9 avformat/iamf_writer: factor out getting loudspeaker_layout values
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
cd2461e627 avformat/iamf: fix setting channel layout for Scalable layers
The way streams are coded in an IAMF struct follows a scalable model where the
channel layouts for each layer may not match the channel order our API can
represent in a Native order layout.

For example, an audio element may have six coded streams in the form of two
stereo streams, followed by two mono streams, and then by another two stereo
streams, for a total of 10 channels, and define for them four scalable layers
with loudspeaker_layout values "Stereo", "5.1ch", "5.1.2ch", and "5.1.4ch".
The first layer references the first stream, and each following layer will
reference all previous streams plus extra ones.
In this case, the "5.1ch" layer will reference four streams (the first two
stereo and the two mono) to encompass six channels, which does not match out
native layout 5.1(side) given that FC and LFE come after FL+FR but before
SL+SR, and here, they are at the end.

For this reason, we need to build Custom order layouts that properly represent
what we're exporting.

----
Before:

  Stream group #0:0[0x12c]: IAMF Audio Element:
    Layer 0: stereo
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
    Layer 1: 5.1(side)
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
      Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent)
    Layer 2: 5.1.2
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
      Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
    Layer 3: 5.1.4
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
      Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent)

----
AFter:

  Stream group #0:0[0x12c]: IAMF Audio Element:
    Layer 0: stereo
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
    Layer 1: 6 channels (FL+FR+SL+SR+FC+LFE)
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
      Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent)
    Layer 2: 8 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR)
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
      Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
    Layer 3: 10 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR+TBL+TBR)
      Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default)
      Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent)
      Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent)
      Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent)

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
e5f23a3c5e tests/iamf: rename BACK to SIDE filterchain labels in the 5.1.4 iamf tests
Cosmetic change to reflect the actual channels used in the layouts.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
534eb7260a tests/iamf: reorder muxed streams
Follows the proper order defined by the spec, even if mostly cosmetic, and is
also preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
13e81dbd27 avformat/iamf_parse: try to retype the channel layout for ambisonics_mode == 0
In most cases, the channel ids will match the standard Ambisonic Order, saving us the
need to use a custom order layout.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
9b5abbf387 avformat/iamf_writer: ensure each layer's channel layout contains all channels from the previous one
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
James Almer
a7beac704b avformat/iamf_parse: prevent overreads in update_extradata
Fixes: libavcodec/put_bits.h:232:32: runtime error: shift exponent -19 is negative
Fixes: Assertion n>=0 && n<=32 failed at ./libavcodec/get_bits.h:406
Fixes: 398527871/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6602025714647040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-24 14:41:43 -03:00
Niklas Haas
f67ca10f2e avfilter/f_ebur128: properly propagate true peak
After 3b26b782ee, `ebur128->true_peak` was only set to the maximum of the
current "true peak per frame" values, when it should report the true peak for
the entire stream.

Fixes: 3b26b782ee
2025-06-24 12:12:37 +02:00
Lynne
60fc0288ae hwcontext_vulkan: fix 85c0364b70
The issue is that by moving the mprops loading later, we inadvertently
broke some earlier dependencies.
2025-06-24 16:42:43 +09:00
Andreas Rheinhardt
88fee7046a avcodec/g728dec: Remove AVCodec.sample_fmts
It is unnecessary for decoders (they just set
AVCodecContext.sample_fmt). This also fixes a warning
with Clang (because sample_fmts is set directly,
not via CODEC_SAMPLEFMTS).

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-23 21:45:17 +02:00
Lynne
11428896db hwcontext_vulkan: add workaround for broken Nvidia drivers 2025-06-24 02:30:01 +09:00
Lynne
85c0364b70 hwcontext_vulkan: move ReBAR check into a new function and use it later
The issue is that vulkan_device_create_internal() is only called for
devices that lavu creates by itself.
For external devices, this was never done.

This also solves some mid-function declaration warnings.
2025-06-24 02:30:01 +09:00
Michael Niedermayer
5b1301004b avformat/iff: Check nb_channels == 0 in CHNL
Fixes: division by 0
Fixes: 418396712/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6104388018176000
Fixes: 418478219/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4569544410857472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 16:31:58 +02:00
Michael Niedermayer
f06474faf8 tools/target_dec_fuzzer: adjust threshold for VP8
Fixes: Timeout
Fixes: 416589179/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP8_fuzzer-5432788428062720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 16:29:34 +02:00
Michael Niedermayer
a8c21a7158 Add FUNDING.json
We have been contacted by Monet du Plessis of the etherium foundation and
Natascha Buck (Grants at the Better Internet Foundation)

"The Ethereum Foundation is thrilled to inform you that your contribution to
 open-source software development through your work on ffmpeg
 https://github.com/FFmpeg/FFmpeg  has been recognized and rewarded by the
 Devcon team! Your project played a fundamental role in the success of Devcon
 <http://devcon.org/>, helping to create a more meaningful experience for
 the Ethereum community. In collaboration with Drips Network
 <https://www.drips.network/>, we are pleased to award you $2,240.00 in
 appreciation of your efforts and to support your continued efforts in
 open-source development."

To be able to claim donations through the drips network we need to
specify a wallet to do so in FUNDING.json

This will also allow FFmpeg to receive future funding and donations
through the drips network.

The specified wallet is a safe wallet backed by a ledger hw wallet.
We can later change who controls the safe wallet. (For example it
could be passed on to the SPI treasurer)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 14:48:40 +02:00
Michael Niedermayer
6e5f47f6d3 tools/target_dec_fuzzer: Adjust RV60 threshold
Fixes: Timeout
Fixes: 410324670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5697706586865664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 14:36:07 +02:00
Michael Niedermayer
f8e30d9eeb avcodec/osq: Request a coding mode 2 sample
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 14:28:56 +02:00
Michael Niedermayer
a5f861d335 avcodec/osq: Switch back to av_ceil_log2()
This returns to code closer to prior 56c334d732
The prior fixes should limit the sum and avoid the need for double argument log2()

Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:406
Fixes: 410109093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6550900028276736

No testcases except fuzzers

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 14:28:55 +02:00
Michael Niedermayer
b587afcb65 avcodec/osq: Add note about update_stats() count
It seems this is basically unused and unfinished code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 14:28:55 +02:00
Michael Niedermayer
c909ef31be avcodec/osq: Fix signed integer overflow in update_stats()
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 410109093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6550900028276736

Note, none of the available osq files uses update_stats(), this change may fix or break
files using coding_mode == 2. The code prior looks wrong though

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 14:28:55 +02:00
Pavel Roslyy
983a3b17e4 libavcodec/hcadec: fix header parsing after 'comp' section
Need to skip 2 more bytes because comp sections are 12 bytes long.
Fixes decryption since ciph_type is now being set.

Signed-off-by: Pavel Roslyy <roslypav@gmail.com>
2025-06-23 14:28:54 +02:00
Timothee
c94a419e32 avfilter/codecview: Enable QP visualization for H.264
The codecviewfilter, when used with qp=1, did not display quantization parameter values for H.264 streams because the QP table extraction was restricted to MPEG-2 video.

This patch enables H.264 support by updating ff_qp_table_extractto accept AV_VIDEO_ENC_PARAMS_H264. This allows for correct QP overlay on H.264 video

Signed-off-by: Timothee <timothee.informatique@regaud-chapuy.fr>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-23 13:40:52 +02:00
Peter Ross
e6298e0759 avformat/rtp: G.728 muxing and demuxing 2025-06-23 17:19:18 +10:00
Peter Ross
5a8c2b2b50 avformat/aiff: G.728 muxing and demuxing 2025-06-23 17:19:18 +10:00
Peter Ross
dee4edfa63 avformat/riff: G.728 muxing and demuxing 2025-06-23 17:19:18 +10:00
Peter Ross
52f62468aa avformat/g728dec: raw G.728 demuxer 2025-06-23 17:19:18 +10:00
Peter Ross
a107340035 avcodec/g728dec: G.728 decoder 2025-06-23 17:16:42 +10:00
Peter Ross
a3c900a0c4 avcodec/lpc_functions: compute_lpc_coefs: add starting lpc order and err cache parameters 2025-06-23 17:11:09 +10:00
Peter Ross
a0b9d61faf avcodec/g728_template: make hist parameter constant 2025-06-23 17:11:07 +10:00
Peter Ross
93368029e3 avcodec/g728_template: do_hybrid_window() template
intended for use by RealAudio 2.0 (28.8k) and G.728 decoders.
2025-06-23 17:11:03 +10:00
James Almer
b1172b8cc6 avcodec/mss2dsp: use FF_PTR_ADD to add offsets to a pointer
Fixes: libavcodec/mss2dsp.c:59:14: runtime error: applying zero offset to null pointer

Tested-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-22 17:50:26 -03:00
James Almer
f789d60e11 avformat/mov: add more sanity checks when reading clap boxes
If the apperture window is bigger than the canvas, then the clap box is invalid
and there's no point calculating cropping values.

Fixes: libavformat/mov.c:1295:14: runtime error: -256 is outside the range of representable values of type 'unsigned long'

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-22 10:30:03 -03:00
James Almer
dbe94e1110 avfilter/x86/f_ebur128: replace AVX2 instruction with AVX equivalent
Using vpbroadcastq in an AVX function will result in SIGILL errors on pre
Haswell/Zen processors.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-22 09:31:44 -03:00
Niklas Haas
27590d8653 avutil/hwcontext_vulkan: disable host transfers if ReBAR is disabled
This feature fundamentally relies on host-visible VRAM, which restricts the
set of available memory types to (typically) host-visible device-local ones.

When resizable BAR is disabled, this memory type is usually limited to
e.g. 256 MiB in size, which is just plain insufficient for allocation of
general purpose GPU images, causing OOM errors on even the simplest of
commands.

The easiest solution is to disable host transfers entirely on machines
without host-addressable VRAM. In theory, we could try and recover the use
of host transfers for images which are *not* restricted to device-local
memory types, but this is rarely the case in practice, and the effort
required would exceed the benefit, especially since ReBAR is a standard
feature on all platforms recent enough to have Vulkan drivers, and only
occasionally disabled in the UEFI for by default for some hare-brained
notion of "backwards compatibiility" with ancient software.
2025-06-22 12:13:09 +02:00
Peter Ross
baad40bdd1 avcodec/mips: fix build failure when specific decoder/encoder enabled
acelp_kelvin, g729, qcelp, sipr and wmavoice decoders all depend upon
mips/{acelp_filters_mips,celp_filters_mips,acelp_vectors_mips}.o when
arch is mips.

g723_1 depends on mips/{celp_filters_mips,acelp_vectors_mips}.o.

comfortnoise, evrc, ra144 and ra288 depend on mips/celp_filters_mips.o.
2025-06-22 09:15:56 +10:00
Peter Ross
b49c4d1034 configure: h264_vulkan_encoder depends on atsc_a53 2025-06-22 09:15:56 +10:00
Peter Ross
08943c82c6 configure: cbs_apv depends on cbs 2025-06-22 09:15:56 +10:00
Andreas Rheinhardt
34953e195f avcodec/mpeg4videoenc: Fix data race when using AC prediction
The check for whether we can use the fast path to process
AC coefficients used the qscale value belonging to a different
slice; this worked in practice, because the predicted AC values
are zero in this case, so it does not matter whether we use
the fast or the slow path.

Fix this by checking for first_slice_line instead. This fixes all
the races in the encoding part of the vsynth*-mpeg4-thread tests
(and fixes them if no frame threading is in use for the decoding part).

(The left prediction check may use data from a different slice, too,
but said slice is always processed by the same thread, so that no race
can happen. Given that out-of-slice AC values are zero, it does not
matter whether we use the fast path or the slow path either.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
5cdce56a79 avcodec/mpegvideo: Reduce stack usage when copying MpegEncContext
(GCC did not perform this on its own; Clang did.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
f8c0ac9984 avcodec/ituh263enc: Simplify encoding umotion vectors
There is no need to use two loops.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
689cde75ee avcodec/mpeg4video: Move ff_mpeg4_pred_dc() to decoder
Only used by the decoder now that the encoder solves
out-of-slice predictions by setting the out-of-slice
values appropriately.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
56fd45d2a9 avcodec/{ituh263,mpeg4video}enc: Simplify out-of-slice DC prediction
Now that every slice (and therefore every thread) uses its own
DC array, one can simply set the out-of-slice DC values to its
expected values (this is not possible for the decoders due
to error resilience).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
c84a03d752 avcodec/mpegvideo: Allocate dc_val for each encoder slice
This fixes data races (which are UB) in the MPEG-4 and H.263+
encoder when predicting DC values; these encoders unconditionally
read values from the line above the current line and only check
lateron (via first_slice_line) whether said prediction can be used
at all. It will also allow to remove said checks (by setting the
entries to 1024 upon opening a new slice).

The vsynth{1,2,3,_lena}-mpeg4-thread FATE tests were affected by this:
https://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-tsan-slices&time=20250613002615

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
eb597d9a1e avcodec/vc1: Only keep mb_type[0]
The chroma mb_type[1] and mb_type[2] pointers are unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
81ab1106c8 avcodec/mpegvideo: Only keep MpegEncContext.dc_val[0]
The chroma dc_val pointers are mostly unused (accesses use
dc_val[0] and block_index), so remove them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
c4fd33a951 avcodec/mpegvideo: Zero-init mbintra_table
Up until now, they are marked as dirty (filled with 1), meaning that
the entries are in need of a reset via ff_clean_intra_table_entries();
but actually, the entries are initialized to the state that
ff_clean_intra_table_entries() produces, so they can be marked
as non-dirty (i.e. filled with 0).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
c4ebe55f94 avcodec/mpegvideo: Allocate ac_val jointly
They are currently allocated separately per slice; allocating them
jointly allows to avoid saving them in ff_update_duplicate_context().

The way it is done also avoids allocating ac_val for encoders that
don't need it (e.g. H.263 or H.263+ with AIC).

This entailed moving setting nb_slices to ff_mpv_init_context_frame()
which is called from ff_mpv_common_frame_size_change(). The resultant
nb_slices will always be one when called from a decoder using
ff_mpv_common_frame_size_change().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
dba1061ba4 avcodec/mpegvideo: Only use a single ac_val pointer
The chroma pointers ac_val[1] and ac_val[2] are no longer used anywhere.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
4aca6b19ac avcodec/mpeg4video: Don't use ac_val[1], ac_val[2] when cleaning buffers
This is in preparation for removing removing ac_val[1]
and ac_val[2]. ff_mpeg4_clean_buffers() was the last user of them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
b2661569b1 avcodec/mpegvideo: Combine stores
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
70ce68d021 avcodec/mpegvideo: Don't reset AC values of upper-left luma block
Said block will only be referenced by blocks from the same macroblock,
which will read the new AC values instead of the reset values
from this function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
dcd7408c92 avcodec/mpegvideo: Provide alignment hint to compiler
The underlying element type has always a size of 32B,
so that the pointer is always at least 16B aligned.
Clang uses this to upgrade the (inlined) memset to
aligned stores. GCC doesn't (it does it only when
the alignment hint is provided via __builtin_assume_aligned).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
32cbadcd74 avcodec/mpegvideo: Avoid {a,d}c_val[{1,2}]
These are already mostly unused; not using them here is in
preparation for removing them altogether. Use block_index[4..5]
instead for addressing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
13527b39bb avcodec/mpegvideo: Redo resetting intra table entry
All callers check the corresponding entry of MpegEncContext.mbintra_table
and if set (indicating that the intra tables might have been written to
when decodeing a intra MB, so that they are "dirty"), call
ff_clean_intra_table_entries(), which resets them to default values
and resets the mbintra_table entry. Move resetting to the callers
(via an inline function that also performs the checks). This currently
has the advantage that the additional load of the mbintra_table ptr
can be avoided. It will also allow to simplify
ff_clean_intra_table_entries() (by using block_index[4] and [5]).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
514e5ea0db avcodec/flvenc: Move ff_flv2_encode_ac_esc() to ituh263enc.c
This is the only place where it is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
61d34c2b8e avcodec/flvenc: Combine writing bits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
7643269ec2 avcodec/ituh263enc: Simplify AIC handling
Namely with block_index and block_wrap.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
950137a7c8 avcodec/ituh263dec: Simplify AIC handling
Possible by using block_index.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
822be72f0a avcodec/mpegvideo_enc: Simplify allocating non-slice buffers
Allocate them before the slice contexts, so that they are automatically
copied to the slice contexts. This avoids having to set them in a loop.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
8f92885b1f avcodec/mpegvideo: Defer init of enc slice ctxs in ff_mpv_common_init()
This will allow to perform initializations between ff_mpv_common_init()
and ff_mpv_init_duplicate_contexts() that will be automatically
copied to the slice contexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
85692e5da1 avcodec/mpegvideo: Don't zero unnecessarily
The whole dc_val array is initialized (to 1024) immediately
after the allocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
b4e7135986 avcodec/mpegvideo: Don't reset thread_context ptrs unnecessarily
They are freed with av_freep(), so the pointers are already consistent.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
6f84160b82 configure: Relax snowenc->mpegvideoenc dependency
It only needs mpegvideoencdsp, motion_est.o and ratecontrol.o.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
da22ee281e configure: Relax diracdec->mpegvideoenc dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
8764b21048 configure: Relax svq1enc->mpegvideoenc dependency
It only needs mpegvideoencdsp, motion_est.o and
some H.263 specific parts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
9b409ea1e6 configure: Factor mpegvideoencdsp out of mpegvideoenc
This will allow to relax the dependency on mpegvideoenc
for several codecs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
2583c7abcf avcodec/svq1enc: Don't initialize unneeded block_index
The motion estimation code only uses block_index[0..3],
so only initialize that (just like estimate_motion_thread()
in mpegvideo_enc.c).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
83ddf99267 avcodec/svq1enc: Set MpegEncContext.avctx only once
It is already set during init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
4b7f1595cc avcodec/svq1enc: Remove write-only c_block_{width,height}
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
58a222f561 avcodec/svq1enc: Stop calling ff_mpv_common_init()
It is not really needed, as none of the buffers allocated
in ff_mpv_common_init() are used lateron; in fact, ff_mpv_common_init()
is called with MpegEncContext.width and height equal to zero
(as well as encoding equal to zero, so that the error resilience
parts are initialized...), so that all the buffers are too small
anyway.

The call to ff_mpv_common_init() has been added in commit
f6774f905f in order to allocate
{current,last,new}_picture.f (an AVFrame). Yet this is unnecessary
since 7814dd77aa.

The only task that ff_mpv_common_init() does that may be used
is initializing the HpelDSPContext embedded in the MpegEncContext.
In fact, it was not initialized before
f6774f905f and not initializing
it passes FATE, yet I can't prove that it is indeed unnecessary.
Therefore it is still initialized and used instead of
SVQ1EncContext.hdsp.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
fbb8e605ed avcodec/svq1enc: Allocate motion_val{8,16} during init
It only depends upon the dimensions (which do not change).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:52 +02:00
Andreas Rheinhardt
1fe08d629a avcodec/svq1enc: Don't free scratchbuf upon error
Forgotten in 65015003f5c4b83a8202abfa7420ccf37cde6ce3;
after said commit, freeing scratchbuf on error in svq1_encode_frame()
could lead to segfaults lateron, because the buffer will not
be allocated again.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
109bf099d5 avcodec/motion_est: Fix indentation
Forgotten after 919e749772.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
5b1e805653 avcodec/mpegvideo_enc: Remove always-true branch
Always-true since 1c40a17922
which made 4863671d88 superfluous.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
00926669f7 avcodec/mpeg_er: Mark ff_mpeg_er_init() as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
01d6235fae avcodec/rv10: Avoid indirection when reading VLC codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
c2e5f7466d avcodec/mpeg12dec: Don't store block_last_index unnecessarily
Given that the MPEG-1/2 decoders unquantize the blocks
on their own, block_last_index is only used to signal
to ff_mpv_reconstruct_mb() whether a block is skipped
or not; but this is only checked for inter macroblocks,
so it is unnecessary to set block_last_index for intra
macroblocks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
069329ec02 avcodec/ituh263enc: Fix indentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
a2272aff76 avcodec/ituh263enc: Don't use array unnecessarily
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
d95041dffe avcodec/ituh263dec: Remove redundant store
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
5507da21e6 avcodec/ituh263dec: Don't process unnecessarily many coefficients
Overriding the number of coefficients is only necessary if
ac_pred is in used, not for h263_aic alone (for which only
the DC coefficient is predicted) as it is done here.

And since d50635cd24
the H.263 unquantize-intra functions override the number of
coefficients in case of ac_pred, so we don't have to do this here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
ea4b9a121d avcodec/rv10: Perform RV20 check only for RV20
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
f5fc31acec avcodec/rv10: Perform RV20 initialization during init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Andreas Rheinhardt
8e0f064a11 avcodec/mpeg4videodec: Don't zero blocks twice
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-21 22:08:51 +02:00
Alexander Strasser
204d03c803 configure: Fix a regression when probing link.exe
The version ident is printed on stdout for link.exe and redirecting
stdout to /dev/null will cause the output of link.exe to be paged.

This caused configure to hang for some configurations and by
extension some FATE clients. You might want to check if you run
affected configurations automated in FATE clients or similar setups.

Fixes: 45a30e0361
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-21 22:37:44 +03:00
Marton Balint
32153fac84 avfilter/af_aresample: rework activate logic to follow the advised flow more strictly
This should prevent the possibility of audio data accumulating.

The commit also cleans up and simplifies the code a bit so all frame producers
(filter_frame(), flush_frame()) functions follow similar logic as
ff_inlink_consume_frame() for the return code.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-06-21 20:24:57 +02:00
Marton Balint
a21429e134 avfilter/af_aresample: make aresample return FFERROR_NOT_READY when no progress can be made
FF_FILTER_FORWARD_WANTED() already sets the ready status as needed.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-06-21 20:24:57 +02:00
Marton Balint
ffcdd2cdc1 avfilter/af_aresample: merge request_frame into activate function
No functional change.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-06-21 20:24:57 +02:00
Marton Balint
28a7b9c863 avfilter/split: consume all frames before forwarding inlink status
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-06-21 20:24:30 +02:00
Marton Balint
606efaa2cf fftools/ffmpeg_filter: simplify control flow in read_frames
No functional change.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-06-21 20:24:30 +02:00
Niklas Haas
daef348574 avfilter/x86/f_ebur128: implement AVX peak calculation
Stereo only, for simplicity. Slightly faster than the C code.
2025-06-21 17:28:39 +02:00
Niklas Haas
3b26b782ee avfilter/f_ebur128: move peak detection to reusable DSP function
True peak and sample peak share almost the same logic. Define this logic in
a separate function for reusability, and so we can write SIMD versions.
2025-06-21 17:21:58 +02:00
Niklas Haas
4c046517e7 avfilter/f_ebur128: move variable declarations to usage site
This is actually allowed by non-ancient versions of C.
2025-06-21 17:21:58 +02:00
Niklas Haas
f362bacd27 avfilter/f_ebur128: lift sample peak calculation out of main loop
This is substantially faster (~55%) than the transposed loop, and also
avoids an unnecessary macro.
2025-06-21 17:21:58 +02:00
Niklas Haas
229393d8dc avfilter/f_ebur128: move true peak calculation out of main loop
Easier to read, less convoluted, and ~30% faster. Most importantly, this
avoids repeating the redundant recalculation of the true peak on every
single sample, by moving the FIND_PEAK() loop out of the main loop. (Note
that FIND_PEAK() does not depend on the current sample index at all, so
there is no reason for it to ever be recomputed here)
2025-06-21 17:21:58 +02:00
Niklas Haas
a96175e76f avfilter/f_ebur128: remove pointless macro
This macro is not shortening the code nor aiding readability.
2025-06-21 17:21:58 +02:00
Niklas Haas
53e03ec8af avfilter/x86/f_ebur128: add x86 AVX implementation
Processes two channels in parallel, using 128-bit XMM registers.

In theory, we could go up to YMM registers to process 4 channels, but this is
not a gain except for relatively high channel counts (e.g. 7.1), and also
complicates the sample load/store operations considerably.

I decided to only add an AVX variant, since the C code is not substantially
slower enough to justify a separate function just for ancient CPUs.
2025-06-21 17:21:36 +02:00
Niklas Haas
deab15e76a avfilter/f_ebur128: split off C implementation to separate function
I decided to separate out the peak measurement loop to avoid bloating
the signature, and since it's only conditionally used.
2025-06-21 17:19:50 +02:00
Niklas Haas
c7d2b0a7a1 avfilter/f_ebur128: move weights and cache to EBUR128DSPContext 2025-06-21 17:19:50 +02:00
Niklas Haas
1da0a70b09 avfilter/f_ebur128: use a single packed array for the integrator cache
Instead of having a planar array for each channel, use a single packed array.
This will help processing multiple channels in parallel, as we can directly
load all channels' data in a single load instruction.

Also improves memory locality of data, as the loop order is:

for (samples) {
    for (channels) {
        process sample
    }
}
2025-06-21 17:19:50 +02:00
Niklas Haas
2679e687ec avfilter/f_ebur128: use structs for biquad weights
Simplifies the code a bit. In particular, the copy to the stack is marginally
faster.
2025-06-21 17:19:50 +02:00
Niklas Haas
2d9435d76f avfilter/f_ebur128: simplify sample cache array
We don't need an X sample cache anymore, and we also can simplify the
access macro slightly.
2025-06-21 17:19:50 +02:00
Niklas Haas
c5f3033a86 avfilter/f_ebur128: use transformed direct form II
Instead of direct form I. See af_biquads.c for math. Also eliminate
an unnecessary indirection.
2025-06-21 17:19:50 +02:00
Jack Lau
8aa6df663e avformat/whip: replace AV_OPT_FLAG_DECODING_PARAM to ENCODING
Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-21 12:57:19 +08:00
Jack Lau
214248e2d6 avformat/whip: mark as experimental
This patch doesn't effect WHIP usage via command, as WHIP always
needs to be explicitly specified

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-21 12:05:13 +08:00
Jack Lau
177b92df2b avformat/tls_openssl: fix warnings when openssl is lower version
api doc: https://docs.openssl.org/1.0.2/man3/BIO_s_mem

In higher versions (openssl 1.0.2 and higher),
the function signature is BIO *BIO_new_mem_buf(const void *buf, int len),
so passing a const string doesn't cause an warnings.
However, in lower versions of OpenSSL,
the function signature becomes BIO *BIO_new_mem_buf(void *buf, int len),
which leads to warnings.

OpenSSL guarantees that it will not modify the string,
so it's safe to cast the pem_str to (void *) to avoid this warning.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-21 12:01:14 +08:00
James Almer
64e6f5d5fa avformat/mov: set array entry count after the array is allocated in heif_add_stream()
Ensures no bogus values being preserved after returning.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-20 13:25:15 -03:00
Niklas Haas
7039a37e35 avfilter/vf_libplacebo: add reset_sar option
This was requested by users of `vf_libplacebo`, to mirror the existing
option on the other `vf_scale_*` family of filters. While we have
`vf_normalize`, it was not as useful in the event that the content
stretching was actually desired.

Bridges an important usability gap between `vf_scale` and `vf_libplacebo`
that made mixing and matching the filters needlessly difficult.
2025-06-20 15:13:25 +02:00
Niklas Haas
c0698840c4 avfilter/vf_libplacebo: correctly update SAR to reflect scaled result
This aligns the behavior of vf_libplacebo with other filters in the
vf_scale family, that forward any change in the SAR as a result of
changing the output resolution to the output frame / link, and updates
the ff_scale_adjust_dimensions() call to continue working as intended.

The new behavior reflects the documentation of vf_libplacebo, which
described this behavior despite that not being the way the filter worked
up to this point.

As an aside, also fixes a bug where the AVFrame SAR was inconsistent
with the AVFilterLink SAR when the s->nb_inputs > 1 condition was met.
2025-06-20 15:13:25 +02:00
Niklas Haas
f883b7cf93 avfilter/vf_libplacebo: list AV_PIX_FMT_VULKAN first
Under normal circumstances, this change does not affect anything, as the vast
majority of filters either support only vulkan or only software formats.
However, when a filter supports both (such as vf_libplacebo itself, and
possibly vf_scale in the future), linking together two such filter instances
without an explicit format will default matching the input format, resulting
in a redundant round trip through host RAM.

This change bumps up AV_PIX_FMT_VULKAN to the first entry in the format list,
ensuring that it gets preferred whenever possible.
2025-06-20 15:13:25 +02:00
Zhao Zhili
88ac69631e wasm/hevc: Add sao_edge_filter
hevc_sao_edge_8_8_c:                                   124.5 ( 1.00x)
hevc_sao_edge_8_8_simd128:                              18.1 ( 6.89x)
hevc_sao_edge_16_8_c:                                  478.6 ( 1.00x)
hevc_sao_edge_16_8_simd128:                             48.9 ( 9.79x)
hevc_sao_edge_32_8_c:                                 2021.1 ( 1.00x)
hevc_sao_edge_32_8_simd128:                            187.4 (10.79x)
hevc_sao_edge_48_8_c:                                 4295.5 ( 1.00x)
hevc_sao_edge_48_8_simd128:                            397.4 (10.81x)
hevc_sao_edge_64_8_c:                                 7245.5 ( 1.00x)
hevc_sao_edge_64_8_simd128:                            709.5 (10.21x)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-20 21:09:39 +08:00
Zhao Zhili
fe45f5537b wasm/hevc: Add sao_band_filter
hevc_sao_band_8_8_c:                                    63.0 ( 1.00x)
hevc_sao_band_8_8_simd128:                              10.4 ( 6.06x)
hevc_sao_band_16_8_c:                                  230.4 ( 1.00x)
hevc_sao_band_16_8_simd128:                             22.9 (10.07x)
hevc_sao_band_32_8_c:                                  900.4 ( 1.00x)
hevc_sao_band_32_8_simd128:                             81.5 (11.05x)
hevc_sao_band_48_8_c:                                 2009.1 ( 1.00x)
hevc_sao_band_48_8_simd128:                            170.2 (11.80x)
hevc_sao_band_64_8_c:                                 3535.0 ( 1.00x)
hevc_sao_band_64_8_simd128:                            297.5 (11.88x)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-20 21:09:17 +08:00
Zhao Zhili
9c7b019284 fftools/ffplay_renderer: Use new vulkan queue API
Fixes deprecation warning.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-20 20:39:15 +08:00
Martin Storsjö
45a30e0361 configure: Make MSVC version grabbing more robust
When running plain "cl", to get the MSVC version, it prints the
version header on stderr, while the usage instructions are printed
on stdout. Usually, the version on stderr gets flushed first,
so "head -n1" gets the line it expects, but some times (in particular
when running MSVC wrapped in wine), it can get the usage line
first.

Redirect stdout to /dev/null, so we only grab the version among
the lines printed to stderr. This should make the version number
grabbing more robust.

At least all relevant versions of MSVC seem to print this specifically
to stderr, not stdout (so we don't risk to miss it); checked down
to MSVC 2010.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-19 23:24:18 +03:00
Lidong Yan
ee1f79b0fa avformat/sbgdec: fix leak in sbg_read_header()
In sbg_read_header(), if avformat_new_stream() failed, it returns
without cleanup, which may cause memory leaks. Replace return statement
with goto so that we would first clean up then return.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-17 11:27:28 -03:00
Dawid Kozinski
8087777e66 avcodec/liboapvenc: set the encoder output to OAPV_CFG_VAL_AU_BS_FMT_NONE format
The only AU without bitstream format.

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-17 10:03:10 -03:00
Dawid Kozinski
5d380e4431 configure: Update liboapv version requirement
Changed the minimum required version of liboapv from 0.1.13 to 0.1.13.1

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-17 10:02:44 -03:00
Kacper Michajłow
53da090ab7 configure: fix Microsoft tools detection
LLVM tools print installation path upon execution. If one uses LLVM
tools bundled with Microsoft Visual Studio installation, they would be
incorrectly detected as Microsoft's ones.

Microsoft tools can have localized names, so a more specific string
check is not feasible, but luckily we can test if "Microsoft" is at the
beginning of the line, as it is always the case.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-17 11:51:33 +03:00
Peter Ross
38073187bd avcodec/tests/dct: add CONFIG_PRORES_DECODER guard
Only enable the proresdsp check when the prores decoder is enabled.

This fixes fate when configuring with --disable-everything
2025-06-17 16:41:14 +10:00
Peter Ross
2663d97336 configure: add celp_math component
libavcodec/tests/celp_math depends on libavcodec/celp_math.o

This fixes fate when configuring with --disable-everything
2025-06-17 16:39:36 +10:00
Lynne
e5bb448543 vulkan: maintain compatibility with old headers
Previous patch to fix these issues was incomplete.
2025-06-17 13:26:13 +09:00
Andreas Rheinhardt
d71c863132 fate/video: Add media100 test
Tests both the Media 100 decoder (using the media100_to_mjpegb BSF
implicitly) as well as using said BSF, followed by the MJPEGB decoder.

(We currently hit a bug when remuxing: The demuxer treats compressorname
as encoded in a Mac character encoding (Mac OS Roman?) and converts
it to UTF-8, yet the muxer just writes it.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:35:13 +02:00
Andreas Rheinhardt
ecd7c9244d avcodec/amfdec,rkmppdec: Use correct extradata with BSFs
Otherwise the extradata used would be ISOBMFF if the input is
even though we use the *_mp4toannexb BSFs to convert it to
annex B to feed it to the actual decoder.

(The mediacodec decoders also use said BSFs, yet they process
the extradata in a way that works even when using the ISOBMFF
extradata; in fact, using the converted extradata would break
their check for whether to warn for missing extradata for
the ISOBMFF without-in-band-header profiles.

Furthermore, there are several users of the *_mp4toannexb BSFs
that don't ever touch extradata. They have not been touched.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:35:13 +02:00
Andreas Rheinhardt
9102a90a95 Revert "avcodec/decode: Fix avcodec parameters when bsfs are enable by decoder"
This reverts commit 1c17061397.

The commit intended to provide certain codecs using *_mp4toannexb
bitstream filters with updated (annex B) extradata (even when
the user-supplied one was ISOBMFF), yet BSFs are allowed to change
way more. The media100_to_mjpegb BSF used by the media100 decoder
changes the codec id; the commit being reverted therefore changed
AVCodecContext.codec_id which is an API violation and broke
media100 decoding with the FFmpeg cli tool.

This commit also made changes from the internal BSF externally
visible. extradata is documented to be "owned by the codec and
freed in avcodec_free_context()" which does not include replacing
it with something else in avcodec_open2() and may surprise users
who think that AVCodecContext.extradata is immutable before
avcodec_free_context(). It also incurred a memdup which is completely
unnecessary for most decoders.

Therefore this commit is reverted. The problem it tried to solve
will be solved differently in the next commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:35:13 +02:00
Andreas Rheinhardt
730ffc5d35 avfilter/vf_overlay: Hoist calculations out of loop
Also use const where appropriate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
Andreas Rheinhardt
a4b3474de6 avfilter/vf_overlay: Keep dst_step in bytes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
Andreas Rheinhardt
48427b012d avfilter/vf_overlay: Use correct alpha when > 8 bits
When chroma subsampling is in use, the filter averages
the corresponding (non subsampled) alpha values to get
the actual alpha value. When vertical subsampling is
in use, the next line is accessed via a[src->linesize[3]],
yet a is an uint16_t* for >8 bit formats and linesize
is always in bytes, so that this actually uses the second
line below the current one. This is fixed in this commit.

No FATE test needed updates, because the filter-overlay-yuv420p10
and filter-overlay-yuv444p10 tests use a yuv420p test file
that has constant opacity after conversion to yuva.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
Andreas Rheinhardt
b3edc84872 avfilter/vf_overlay: Pass variable type directly in macro
Improves readability.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
Andreas Rheinhardt
ca51a0fef7 avfilter/vf_overlay: Avoid converting stride to uint16_t and back
Just keep the pointers for the beginning of a line uint8_t*
and use uint16_t* to do the actual processing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
Andreas Rheinhardt
eeb82a4406 avfilter/vf_overlay: Don't perform UB pointer arithmetic
This happens when the pixel format of the output does not
have an alpha channel. It leads to FATE failures with
the ffmpeg-filter_colorkey, filter-overlay-dvdsub-2397
filter-overlay,
filter-overlay_{gbrp_gbrap,nv12,nv21,yuv420,yuv420_yuva420,
yuv420p10,yuv422_yuva422,yuv422p10,yuv444_yuva444,yuv444p10}
and sub2video tests when using Clang UBSan.

Fix this by only performing the pointer arithmetic when
it is going to be used. This can be checked via variables
that compile-time constants due to inlining, so that the
checks are free. Given that the pointer is potentially
used as a function argument, the compiler could elide
the calculation, but not it can. The size of .text decreased
by 1632B with GCC 14 and by 1392B with Clang 19 (both -O3).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
Andreas Rheinhardt
0ae55affa3 avformat/dhav: Check reading data
Prevents potential use of uninitialized data.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:30:30 +02:00
Andreas Rheinhardt
e3ba364c5e avformat/dhav: Fix check for seekability
AVIOContext.seekable is a bitfield. Also check for seekability
earlier.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:30:30 +02:00
Zhao Zhili
93987c03ec avfilter/vf_libplacebo: Use new vulkan queue API
Fixes deprecation warning.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 20:46:10 +02:00
Niklas Haas
04ceabe2ba avfilter/vf_scale: set correct AVFrame SAR if reset_sar=1
This otherwise generates an inconsistency between the frame state and the
link state, since the link state is set to 1:1 explicitly when `reset_sar`
is enabled, but this line of code unconditionally overwrote the output
frame SAR with the value that would be computed in the absence of `reset_sar`.

cf. vf_scale_cuda, which does this correctly
2025-06-16 20:44:52 +02:00
Zhao Zhili
e6fb8f373e doc/encoders: Document mediacodec wrapper
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:57:06 +08:00
Zhao Zhili
808c6853e1 avcodec/mediacodecenc: Fix typo in VP9 option description
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:55:59 +08:00
Zhao Zhili
920071355d avformat/movenc: Fix editlist with hybrid_fragmented
The segment_duration must not be set to zero when writing the moov
atom for the second time. This is related to edit lists in standard
MP4 files.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:55:04 +08:00
Zhao Zhili
98c281152c avcodec/mediacodecdec: replace memset with direct zero init
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:53:09 +08:00
Lidong Yan
b65fece0aa avformat/rtmpproto: fix rmtp packet leak in gen_connect()
In libavformat/rtmpproto.c:gen_connect(), if check on string length
or check on codec fourcc failed, ff_rtmp_packet_create() allocated
data in pkt would leak. Add ff_rtmp_packet_destory before return error
code.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-16 01:31:45 +02:00
Tristan Matthews
0d9f680b69 checkasm: h264dsp: test luma_dc_dequant
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-16 01:31:45 +02:00
Tristan Matthews
5ea3adfcf9 checkasm: add checkasm_check_dctcoef
This is useful for tests that compare dctcoefs which will be either 2 bytes or
4 bytes, depending on bitdepth.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-16 01:31:44 +02:00
Jack Lau
8fc91ea936 avformat/hls: fix typo in Range header comment (chore)
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:23:37 -05:00
Marth64
f8c8e1f39d avformat/dvdvideodec: fix seeking on multi-angle discs
When seeking on multi-angle titles, libdvdnav does not lock on
to the correct sectors initially as it seeks to find the right NAV packet.

This manifests itself as two bugs:
(1) When seeking on the first angle in a multi-angle segment,
frames from another angle will appear (for example in intro
or credits scenes). This issue is present in VLC also.

(2) When seeking during a segment on angle n+1, the demuxer
cannot deduce the right position from dvdnav and does not allow
seeking within the segment (due to it maintaining a strict state).

Correct the issue by switching to angle 1 before doing the seek
operation, and skipping 3 VOBUs (NAV packet led segments) ahead
where dvdnav will have positioned itself correctly.

Reported-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:22:23 -05:00
Marth64
693703bcdb avformat/dvdvideodec: remove unused has_cc field
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:22:17 -05:00
Marth64
f66ae1ba24 avformat/dump: lowercase 'Start' prefix for start offset
Just applying some UX polish.
This is to match the lowercase trend of attributes in
the dump string (and similar to chapters).

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:22:10 -05:00
Clément Péron
90424a4475 various: fix typos
usefull -> useful
seperately -> separately
reciever -> receiver

Signed-off-by: Clément Péron <peron.clem@gmail.com>
2025-06-15 21:00:38 +05:30
Clément Péron
52441bd4cd avformat/rtpdec: explicit timestamp wraparound handling
Change delta_timestamp to int32_t and add explicit cast to handle
RTP timestamp wraparound correctly. This fixes implementation-defined
behavior when computing negative timestamp differences due to 32-bit
wraparound.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-14 23:41:38 +02:00
Ethan Halsall
3f1f9db7f5 avfilter/vf_mcdeint: add yuv444p support to mcdeint
Signed-off-by: Ethan Halsall <ethanhalsall11@augustana.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-14 23:41:38 +02:00
Martin Storsjö
fb65ecbc9b avutil: Fix linking x86 asm constants with Clang in MSVC mode
This fixes building with Clang in MSVC mode, for x86, which was
broken in 6e49b86996 (in Nov 2024);
previously it failed with undefined symbols for the constants
defined with DECLARE_ASM_CONST, accessed via inline assembly.

Before 57861911a3, there was an
    #elif defined(__GNUC__) || defined(__clang__)
case before the
    #elif defined(_MSC_VER)
case for defining DECLARE_ASM_CONST, which included av_used.
(This case included the explicit "defined(__clang__)" since
f637046d3134a331e4b5a7243ac3dfb92735b8a5.)

After 57861911a3, it used the
generic definition of DECLARE_ASM_CONST that also included
av_used - which also worked for Clang in MSVC mode. But after
6e49b86996, Clang in MSVC mode
ended up using the MSVC specific variant which lacked the
av_used declaration, causing linker errors due to undefined
symbols.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-13 11:36:20 +03:00
Jun Zhao
58f3d8a461 avutil/hwcontext_videotoolbox: fix color primaries check
Fix incorrect enum value used in color primaries check by replacing
AVCOL_SPC_UNSPECIFIED with AVCOL_PRI_UNSPECIFIED.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-06-13 08:41:53 +08:00
Zhao Zhili
f3bf535696 avcodec/libx264: Remove unnecessary include
eval is for av_strtod, which wasn't been used by libx264 now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-12 23:07:13 +08:00
Marvin Scholz
9ad6dca28c avcodec/vvc: parse all SEI messages
While the current code iterated over the messages, it always returned
in the first iteration. Instead keep iterating and warn for failure to
parse. At time of writing, none of the parsing functions seems to
actually return an error, ever.

Fix CID 1648348
2025-06-12 21:17:07 +08:00
Marvin Scholz
3d7668dae1 avcodec/vvc/dec: fix possible null-pointer dereference
When checking for filmgrain here, needs_fg can be true even when
film_grain_characteristics is NULL (when aom_film_grain.enable is true),
therefore this check could end up dereferencing film_grain_characteristics
even though it is NULL.

Fix CID 1648347
2025-06-12 21:16:46 +08:00
Kacper Michajłow
26807592e1 avformat/internal: add missing __clang__ check
Clang x86_64-pc-windows-msvc doesn't define __GNUC__.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-12 14:17:38 +03:00
Kacper Michajłow
43dc443446 avutil/intmath: use AV_HAS_BUILTIN to detect builtin availability
Fixes use of bultins on clang x86_64-pc-windows-msvc which does not
define any __GNUC__. Also on other targets __GNUC__ is defined to 4 by
default, so any feature testing based on version is not really valid.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-12 14:17:37 +03:00
Marvin Scholz
f019dd69f0 ffmpeg_demux: init resume_warn variable
Fixes an uninitialized read introduced with
6232f416b1

Fix CID 1643162 Uninitialized scalar variable
2025-06-11 19:32:05 +02:00
Marvin Scholz
089e69dfe4 lavfi/f_sendcmd: clear Command on alloc failure
If the command array failed to allocate, the current parsed
Command has to be cleared, else memory allocated for it
would be leaked.

Fix CID 1638635
2025-06-11 19:26:22 +02:00
Marvin Scholz
2c3ac6e0fa lavfi/f_sendcmd: add helper to clear Command
Makes clearing the Command more explicit and
consistent.
2025-06-11 19:26:22 +02:00
Marvin Scholz
93255f1c48 avformat/sdp: add framerate entry
This also updates fate-lavf-mov_rtphint as there the SDP
is included in the muxed file.
2025-06-11 19:19:50 +02:00
Erik Linge
e8199f95d6 avformat/rtpdec_jpeg: Set width and heigh codec parameters
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-06-11 19:19:50 +02:00
Erik Linge
c917f28c49 avformat/rtsp: parse framerate in sdp
Co-authored-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-06-11 19:19:50 +02:00
Marvin Scholz
2dcd9c5aac doc: use av_dict_iterate in documentation example 2025-06-11 19:19:50 +02:00
Lynne
922a1ca989 vulkan: maintain compatibility with older headers 2025-06-12 00:17:29 +09:00
Lynne
3ac7d70291 hwcontext_vulkan: fix image copy
The patch was applied by mistake in an unfinished form.
This fixes the build and lets the code run.
2025-06-11 14:33:01 +09:00
averne
9e93163268 vulkan/ffv1dec: fix FFVkSPIRVCompiler leak 2025-06-11 13:30:07 +09:00
averne
f604d1093f vulkan/ffv1dec: fix leak in FFVulkanDecodeShared 2025-06-11 13:30:07 +09:00
averne
ba52d7802e vulkan: fix leak in FFVkExecPool 2025-06-11 13:30:07 +09:00
Lynne
a9b2c10eee hwcontext_vulkan: use host image copy 2025-06-11 01:20:18 +09:00
Lynne
f531c91170 hwcontext_vulkan: add a setting to limit queues
If its a problem, you'll likely want to set it to 1 than more fine-grained
control, which you can already do via the API.
2025-06-10 22:26:14 +09:00
Lynne
26d17709e7 hwcontext_vulkan: minimize queue allocation on NVIDIA
On NVIDIA, there's a global maximum limit of approximately 112 queues,
which means it takes ONLY 7 total programs using the maximum amount of
queues to cause the driver to error out/*segfault* during initialization.

Also, each queue takes about 30ms to allocate, which quickly adds up.

This reduces the queues allocate to the minimum that we would be happy
with. Its not worth limiting decode/encode queues as they're generally
not a lot, and do help.
2025-06-10 22:26:14 +09:00
Lynne
b5262bccdb hwcontext_vulkan: do not use optical flow queueus by default
We don't use them, and on NVIDIA, each queue takes around 30ms
to allocate, and the driver has a global limit of ONLY 112 queues.
2025-06-10 22:26:09 +09:00
Leo Izen
5fea5e3e11 configure: rename POSIX ioctl check
Commit 00b64fca55 introduced configure
detection for HAVE_POSIX_IOCTL but unfortunately this conflicts with
v4l-utils version 1.30, which itself checks for #ifdef HAVE_POSIX_IOCTL
in a public header and erroneously determines it to be true because we
define this to be 0.

Since this is only used for avdevice/v4l2, we rename this to something
else, namely ioctl_posix, simply to prevent the name conflict with the
file /usr/include/libv4l2.h at least until they can upstream a fix on
their end.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-06-08 19:42:56 -04:00
nyanmisaka
ebcf2dcb2c avformat/movenc: handle EAC-3 extension bits for Atmos
Based on a patch by nyanmisaka.
Fixes commit #9996.

Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-08 18:39:35 -03:00
James Almer
117343c0ba avcodec/ac3_parser: handle more header bits in ff_ac3_parse_header()
Based on a patch by nyanmisaka.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-08 18:39:17 -03:00
James Almer
efbcd31206 avcodec/ac3_parser: use a padded buffer in av_ac3_parse_header()
The GetBitContext API requires the buffer to be padded, and the documentation for
av_ac3_parse_header() does not specify it, so use a temporary local buffer.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-08 18:36:09 -03:00
Araz Iusubov
49e52ca24f avcodec/d3d12va_encode: fix l0 reference count limit
Prevents potential null pointer dereference when querying
MaxL1ReferencesForB from codec-specific support structures
during GOP structure initialization.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-06-08 21:24:25 +08:00
Derek Buitenhuis
be46370941 avformat/dhav: Add missed free for end_buffer
Accidentally left out of 36ec9217e6.

Found-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2025-06-08 12:58:22 +01:00
James Almer
b7fc195e7a avutil/x86/intmath: remove inline asm implementations for clip functions
GCC/Clang is smart enough to emit minss/maxss the same way as these functions.
The only theoretical benefit was in x86_32, where x87 floats are used, but the
penalty of making the clipping opaque to the compiler's scheduler plus moving
values from mmx regs to xmm and back will offset any potential speedup.
x86_32 builds targetting anything made in the last two decades and a half
should use -msse -mfp=sse anyway.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-07 21:14:55 -03:00
Clément Péron
8a9cbf99a5 libavformat/rtpdec: Fix RTP timestamp wraparound in Producer Reference Time
The rtp_set_prft() function incorrectly calculates the timestamp delta
when RTP timestamps wrap around the 32-bit boundary. The current code:

    delta_timestamp = (int64_t)timestamp - (int64_t)s->last_rtcp_timestamp;

treats both timestamps as large positive values, causing wraparound to
produce a large negative delta instead of the correct small positive delta.

For example, with a 90kHz video clock:
- last_rtcp_timestamp = 0xFFFFFF00 (near wraparound)
- timestamp = 0x00000100 (after wraparound)
- Current result: delta ≈ -4.3 billion ticks ≈ -47,721 seconds
- Expected result: delta ≈ +512 ticks ≈ +0.006 seconds

This causes prft->wallclock to jump backward by approximately:
- 90kHz video: ~47,721 seconds (~13.25 hours)
- 48kHz audio: ~89,478 seconds (~24.9 hours)
- 8kHz audio: ~536,871 seconds (~6.2 days)

Fix by casting the subtraction result to int32_t, which correctly
handles wraparound through modular arithmetic:

    delta_timestamp = (int32_t)(timestamp - s->last_rtcp_timestamp);

This ensures the delta is always in the range [-2^31, 2^31-1], making
wraparound produce the correct small positive values.

Fixes timing jumps in applications that rely on Producer Reference Time
for media synchronization.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-08 02:07:23 +02:00
Michael Niedermayer
869e288b3a avformat/framecrcenc: List types and checksums for for side data
This allows detecting changes and regressions in side data related code, same as what
framecrc does for before already for packet data itself.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-07 20:00:12 +02:00
Michael Niedermayer
21fd1b5ba5 avformat/dhav: Do not evaluate avio_size() multiple times
Code like FFMIN(MAX_DURATION_BUFFER_SIZE, avio_size(s->pb)) is not safe
as FFMIN() is a macro and avio_size() is thus evaluated multiple
times

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-07 19:36:49 +02:00
Jack Lau
4611ed5cc3 avformat/tls_openssl: fix build error when openssl version < 3
add the missing data structure pkey in the tls_context
properly set this pkey and free it

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-07 14:36:58 +02:00
Kacper Michajłow
d811966ba6 tools/target_dem_fuzzer: remove unused fuzz_tag
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-07 14:33:27 +02:00
Kacper Michajłow
dc9794d340 tools/target_dem_fuzzer: make fuzz data pointer constant
Mostly to avoid warnings.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-07 14:33:26 +02:00
Kacper Michajłow
ccfea9696f tools/target_dec_fuzzer: suppress Wunused-function
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-07 14:33:26 +02:00
softworkz
0c12265b05 MAINTAINERS: Add myself for graph printing
..and resources

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-07 14:32:25 +02:00
Frank Plowman
81370fd796 lavc/vvc: Fix unchecked return code and shadowing
Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-06-07 19:26:11 +08:00
Frank Plowman
1998879868 MAINTAINERS: Add myself as vvc maintainer
My OpenPGP key is available at

https://keys.openpgp.org/vks/v1/by-fingerprint/34E248D6B7DF476970C7330403A84C6A098F2C6B

and

https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x34e248d6b7df476970c7330403a84c6a098f2c6b
Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-06-07 19:20:12 +08:00
Wu Jianhua
a0118d6d07 MAINTAINERS: add myself as vvc maintainer
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-06-07 19:20:12 +08:00
Zhao Zhili
a5dc56fcd6 avformat/format: make experimental flag works for muxer
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-07 15:59:06 +08:00
Zhao Zhili
153cdf3142 avformat/whip: Constify arguments in is_rtp_rtcp/is_rtcp
Fix warning of -Wincompatible-pointer-types-discards-qualifiers.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-07 15:58:21 +08:00
Zhao Zhili
1af6881ba1 avformat/tls: Fix integer overflow with option mtu
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-07 15:58:21 +08:00
Manuel Lauss
d9797544b4 avcodec/sanm: codec31/32 support
codec31/32 are similar to codec1/3 (RLE coding) but with two 4-bit pixels
per byte; they are only used in the Sega-CD release of Rebel Assault 1.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-06-06 22:07:15 +02:00
Manuel Lauss
b7662ddd15 avcodec/sanm: fix codec33/34 tile generator
Some of the calculated values were wrong and/or assigned
to the wrong pixel of the 4x4 block.
Found during testing with Rebel Assault Sega-CD release.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-06-06 22:07:11 +02:00
Manuel Lauss
c064390736 avcodec/sanm: remove codec4 block smoothing
it has a bug and its effects aren't that noticeable, esp. with
the smoothing applied to the whole picture by modern video display
engines.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-06-06 22:07:04 +02:00
Andreas Rheinhardt
834bedf312 avutil/frame: Fix av_realloc_array() argument order
This is not a real bug, but mostly cosmetic. Fixes ticket #11620.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 17:21:37 +02:00
Andreas Rheinhardt
81adbd2d3d avcodec/huffman: Combine allocations
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 17:21:37 +02:00
Andreas Rheinhardt
d0a27e01a6 avcodec/aacpsy: Remove always-true checks
Possible since 03cf101645.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 17:21:37 +02:00
Andreas Rheinhardt
f0e1a315a1 avcodec/iirfilter: Remove iirfilter, psy-preprocessing
The iirfilter is only used in its test tool since
01ecb7172b which
stopped using it in AAC, its only user.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 17:21:31 +02:00
Andreas Rheinhardt
28c0a189b6 avcodec/psymodel: Use av_memdup() where appropriate
Also "fixes" the inverted order of arguments in the av_malloc_array()
calls and therefore part of ticket #11620.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 16:27:12 +02:00
Andreas Rheinhardt
2f5f2c013c avutil/frame: Use av_memdup() for duplicating extended data array
Just do it like av_frame_replace().
Also "fixes" the swapped order or arguments to av_malloc_array()
(the first is supposed to be the number of elements, the second
the size of an element) and therefore part of ticket #11620.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 16:27:12 +02:00
Andreas Rheinhardt
abebdb1bdb avutil/frame: Always return error upon error
(I don't know whether this can be triggered for a file with
nonnegative channel count, given that src's extended data can't
have been allocated in this case.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 16:27:12 +02:00
Andreas Rheinhardt
4bd1ce31fc avcodec/libaomenc: Avoid code duplication when setting options
(Some more options could be set via this method
if the order in which the options are applied doesn't matter.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 16:26:35 +02:00
Andreas Rheinhardt
3cb37c0e71 tests/fate-run: Remove intermediate files from enc-external tests
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-06 16:21:47 +02:00
Michael Niedermayer
453ae55d63 tests/fate/mov: Add bitexact for fate-mov-mp4-frag-flush
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-06 15:15:08 +02:00
Dmitrii Ovchinnikov
38379168ed avutil/hwcontext_amf: fix error logging on amf_init_from_device. 2025-06-06 13:42:18 +02:00
Dmitrii Ovchinnikov
39ab61bd75 avutil/hwcontext_amf: add support for d3d12va initialisation 2025-06-06 13:40:01 +02:00
Dmitrii Ovchinnikov
64b79f98ac amfenc: Update the min version to 1.4.36.0 for AMF SDK. 2025-06-06 13:39:46 +02:00
James Almer
17729aa80c avformat/movenc: fix writing reserved bits in EC3SpecificBox
As described in section F.6.1 from ETSI TS 102 366.

Found-by: nyanmisaka
Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-05 21:49:11 -03:00
Emma Worley
a4c1a5b084 lavc/dxvenc: fix big-endian issues in dxv_compress_dxt1
We were using a mix of pointers to local variables read via AV_RL32/64 and
pointers directly to the texture buffer as keys to interact with the lookback
hashtables. On big-endian systems, these produced different values. This change
makes all hashtable interactions use direct pointers to the texture buffer and
only invokves AV_RL32 in the event of a lookback hashtable miss.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-04 09:53:37 -07:00
Andreas Rheinhardt
3be9b3f156 avcodec/hashtable: Remove null statement
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:32:29 +02:00
Andreas Rheinhardt
a2c3d99478 avcodec/hashtable: Only free buffer if there is buffer to free
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:32:11 +02:00
Andreas Rheinhardt
06958c731e avcodec/hashtable: Mark alloc,free functions as av_cold
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:31:51 +02:00
Andreas Rheinhardt
12a43975d1 avcodec/hashtable: Combine allocations
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:17:37 +02:00
Andreas Rheinhardt
2e45d2f7d3 avcodec/hashtable: Check for overflow
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:13:55 +02:00
Andreas Rheinhardt
1e6fdafce0 avcodec/hashtable: Only align complete entries
It is unnecessary to align both key and val, as they are only accessed
via memcpy()/memcmp(), which has no alignment requirements.
We only need to ensure that that the entries as a whole
are suitable aligned for the probe sequence length.

Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:12:48 +02:00
Andreas Rheinhardt
140fc655f7 tests/fate/libavcodec: Run hashtable test
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:12:19 +02:00
Andreas Rheinhardt
2fc310b2f2 avcodec/hashtable: Zero-initialize hashtable
Otherwise ff_hashtable_freep() would try to free uninitialized
pointers upon allocation error (which happens in the corresponding
test tool).

Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 15:11:48 +02:00
Andreas Rheinhardt
7927ac63ef avcodec/Makefile: Only compile hashtable.o when needed
Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-04 14:56:54 +02:00
Niklas Haas
6ad95be306 avfilter/vf_blackdetect_vulkan: fix black region reporting
The old logic failed to take into account files that ended on ablack
region. The new logic matches the vf_blackdetect behavior.
2025-06-04 12:24:04 +02:00
Jack Lau
167e343bbe avformat/whip: Add WHIP muxer support for subsecond latency streaming
0. WHIP Version 3.
1. The WHIP muxer has been renamed and refined,
    with improved logging context and error messages for SSL, DTLS, and RTC.
2. Magic numbers have been replaced with macros and extracted to functions,
    and log levels have been altered for better clarity.
3. DTLS curve list has been updated,
    and SRTP profile names have been refined for FFmpeg and OpenSSL.
4. ICE STUN magic number has been refined,
    and RTP payload types have been updated based on Chrome's definition.
5. Fixed frame size has been refined to rtc->audio_par->frame_size,
    and h264_mp4toannexb is now used to convert MP4/ISOM to annexb.
6. OPUS timestamp issue has been addressed,
    and marker setting has been corrected after utilizing BSF.
7. DTLS handshake and ICE handling have been optimized for improved performance,
    with a single handshake timeout and server role to prevent ARQ.
8. Consolidated ICE request/response handling and DTLS handshake into a single function,
    and fixed OpenSSL build errors to work with Pion.
9. Merge TLS & DTLS implementation, shared BIO callbacks, read, write,
    print_ssl_error, openssl_init_ca_key_cert,
    init_bio_method function and shared same data structure
10. Modify configure that whip is enabled only dtls is
    enabled(just support openssl for now) to fix build error

Co-authored-by: winlin <winlinvip@gmail.com>
Co-authored-by: yangrtc <yangrtc@aliyun.com>
Co-authored-by: cloudwebrtc <duanweiwei1982@gmail.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: Steven Liu <lq@chinaffmpeg.org>
Co-authored-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2025-06-04 11:17:07 +08:00
Emma Worley
d4556c98f0 lavc/dxvenc: improve compatibility with Resolume products
Improves compatibility with Resolume products by adding an additional
hashtable for DXT color+LUT combinations, and padding the DXT texture
dimensions to the next largest multiple of 16. Produces identical
packets to Resolume Alley in manual tests.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-02 20:51:34 -07:00
Emma Worley
2de0d095b8 lavc/dxvenc: migrate DXT1 encoder to lavc hashtable
Offers a modest performance gain due to the switch from naive linear
probling to robin hood.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-02 20:51:31 -07:00
Emma Worley
6fdb54ddee lavc/hashtable: create generic robin hood hash table
Adds a generic hash table with the DXV encoder as an initial use case.

Signed-off-by: Emma Worley <emma@emma.gg>
2025-06-02 20:51:27 -07:00
Emma Worley
854b8690a6 Add myself to MAINTAINERS for dxv/dxvenc
Signed-off-by: Emma Worley <emma@emma.gg>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-03 01:48:13 +02:00
Ramiro Polla
afb91360ea fftools/Makefile: clean files from fftools/{graph,textformat}/ 2025-06-03 01:07:15 +02:00
Andreas Rheinhardt
93e53e253a avcodec/vc1dsp: Fix vc1op_pixels_func semantics
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:43:10 +02:00
Andreas Rheinhardt
09aeeeb663 avcodec/hpeldsp_init: Detemplatize
Since a51279bbde,
hpeldsp_rnd_template.c was only included once and
one of the two functions in rnd_template.c was
only enabled once.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:42:53 +02:00
Andreas Rheinhardt
83b3469142 avcodec/x86/hpeldsp_init: Use ff_avg_pixels16_mmxext
avg_pixels_tab[0][0] does the same as avg_no_rnd_pixels_tab[0].

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:41:51 +02:00
Andreas Rheinhardt
6d45668801 avcodec/hpeldsp: Remove duplicate pel functions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:41:44 +02:00
Andreas Rheinhardt
2d5f5e8726 avcodec/ac3dec: Deduplicate tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
dbd2ca3580 avcodec/ac3{dec,enc}: Deduplicate gain levels table
(I don't know why the encoder only uses eight of the nine values.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
11723b3526 avcodec/ac3: Move gain value defines to ac3defs.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
20caa5cf2d avcodec/ac3dec: Deduplicate mantissas and their init code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
9416ffd8b8 avcodec/ac3dec: Hardcode tables to save space
The code to initialize the ungrouped bap mantissa tables
(bap 3 or 5) takes more bytes of .text than the tables itself;
they have therefore been hardcoded.

For GCC (14, -O3, albeit in an av_cold function), the initialization
code takes 99B each for the fixed and floating point decoders
(the code is currently duplicated), whereas the hardcoded tables
only take 96B. For Clang 19 it were 374B each (I don't now what
Clang was doing there).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:37:41 +02:00
Andreas Rheinhardt
fa45e20029 tests/fate/mov: Fix fate-mov-mp4-frag-flush requirements
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 13:35:23 +02:00
Andreas Rheinhardt
688f3944ce fftools/graph/graphprint: Remove redundant avio_flush()
The AVIOContext will be automatically flushed upon closure.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:49:02 +02:00
Andreas Rheinhardt
e3b0320745 fftools/ffprobe: Fix indentation
Forgotten after d76b0c4a35.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:48:29 +02:00
Andreas Rheinhardt
5c5c7dff2b fftools/ffprobe: Factor writing common side data types out
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:48:18 +02:00
Andreas Rheinhardt
6f452ad1ac fftools/textformat/avtextformat: Fix races when initializing formatters
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:47:33 +02:00
Andreas Rheinhardt
4947e56974 fftools/resources/resman: Use proper logcontext
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:47:16 +02:00
Andreas Rheinhardt
6d5e18b2f3 fftools/resources/resman: Use assert for always-false condition
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:46:46 +02:00
Andreas Rheinhardt
06cd9086c3 fftools/resources/resman: Don't alloc ResourceManager, fix race
The resman_ctx pointer was accessed outside of its guarding
mutex.

Also make the ResourceManager static.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:45:18 +02:00
Andreas Rheinhardt
b4c5397642 fftools/textformat/avtextformat: Avoid relocations
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:45:13 +02:00
Andreas Rheinhardt
0742239289 fftools/graph/graphprint: Fix races when initializing graphprint
Setting print_graphs_format (in case no -print_graphs_format
option was specified) is racy, as is using av_strtok()
to split it. Both have been removed.

Notice that using av_strtok() was destructive: In the absence
of races the options would only have been applied for the
first initialization.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-02 00:44:44 +02:00
James Almer
6ede1e3fbf fftools/ffmpeg_filter: make InputFilterPriv and OutputFilterPriv private again
As the names imply, they are structs meant to be internal and private to the
filter handling code. If a field is required in other modules, then it can
be moved to the public facing structs, which is done in this commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-01 14:12:50 -03:00
James Almer
1f034714f6 fftools/ffmpeg_filter: make FilterGraphPriv private again
As the name implies, it's a struct meant to be internal and private to the
filter handling code. If a field is required in other modules, then it can
be moved to the public facing struct, which is done in this commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-01 14:12:50 -03:00
Zhao Zhili
8ea2b993fd avformat/movenc: Reduce loop iterations in mov_flush_fragment
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-01 16:37:00 +08:00
Zhao Zhili
56cf1c084d avformat/movenc: Fix flush fragment
The follow cmd output corrupted file before the patch:

ffmpeg -f lavfi -i color=blue,trim=duration=0.04 \
	-f lavfi -i anullsrc,atrim=duration=2 \
	-movflags +empty_moov+hybrid_fragmented \
	-frag_duration 1000000 \
	-frag_interleave 1 \
	output.mp4

1. first_track is the first track with track->entry != 0. As in the
command above, video track (track index 0) has a single frame. When
flush the second fragment, first_track is 1, the audio track.

2. write_moof = i == first_track, so write_moof is false for i = 0.

3. When mov->frag_interleave != 0, mov->mdat_buf != NULL, because
it contains audio data. So avio_write is called before write_moof,
that is, the data write before moof, and mov_finish_fragment
executed with wrong mdat_start.

4. With normal fmp4 output, the error isn't obvious. With
hybrid_fragmented, ffplay output.mp4 shows a lot of error messages.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-01 16:36:54 +08:00
Zhao Zhili
3d9b284ad1 tests: Add fate-hevc-color-reserved
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-01 16:35:23 +08:00
Zhao Zhili
64116800be tests/fate/hevc: Fix dependancy for hevc-alpha
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-01 16:35:23 +08:00
Zhao Zhili
9a19ba4067 tests/fate/cbs: Add hevc metadata set color test
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-01 16:35:23 +08:00
Zhao Zhili
c80002aa81 avcodec/h2645_vui: Ensure color primaries/trc/space isn't reserved value
Fix error reported by swscaler:
Unsupported input (Operation not supported): fmt:yuv420p csp:unknown prim:reserved trc:bt709 -> fmt:yuv420p csp:bt709 prim:reserved trc:bt709

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-01 16:35:23 +08:00
Gabriel Hege
6c291232cf avformat/movenc: fix VVC encoding with leading pictures
The default behavior for VVenC (since v1.10.0) is to create an IDR with
leading pictures for the first picture in decoding order (POC 32). This
leads to FFmpeg generating an edit list with an empty entry, skipping
the leading pictures.

This patch fixes the calculation for the start_pts, while the DTS is
negative (as produced by vvenc).

Signed-off-by: Gabriel Hege <g+ffmpeg@hege.cc>
2025-05-31 09:47:50 +08:00
Wu Jianhua
a02e880e35 avcodec/vvc/sei: add decode_mastering_display_colour_volume
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
f6d2f38530 avcodec/vvc/sei: add decode_ambient_viewing_environment
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
761f75db74 avcodec/vvc: support fields
passed files:
    FIELD_A_Panasonic_4.bit
    FIELD_B_Panasonic_2.bit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
870fa133af avcodec/vvc/sei: add decode_frame_field_info
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
299544bd0c avcodec/h274: add H274SEIFrameFieldInfo struct
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
33d511b581 avcodec/cbs_sei_syntax_template: add sei message frame_field_information
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
97137e38c1 avcodec/vvc/sei: add decode_content_light_level_info
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
40bc5e119e avcodec/vvc/sei: add decode_display_orientation
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
d140648c31 avcodec/cbs_sei_syntax_template: add sei message sei_display_orientation
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
23e9912315 avcodec/vvcdec: verify picture hash
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
9620c95edb avcodec/h274: add ff_h274_hash functions
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
8dfc24cdce avcodec/vvc/sei: add decode_decoded_picture_hash
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
942cf59e9d avcodec/h274: add H274SEIPictureHash struct
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
312f8ef2ca avcodec/vvc/dec: support removing film grain params from side data
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
a8d949bd96 avcodec/vvc/dec: support applying film grain by the decoder
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
1608d60001 avcodec/vvc/dec: export sei to the frame when the frame starts
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
1c87e3625a avcodec/vvc/sei: add decode_film_grain_characteristics
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
ab5df96cef avcodec/vvc: support decoding prefix and suffix nal units
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
bf3a7291db avcodec/cbs_sei_syntax_template: add sei message film_grain_characteristics
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Wu Jianhua
e618f7d5cf avcodec/cbs_h2645: add cbs_sei_h274_types
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-31 09:35:54 +08:00
Michael Niedermayer
848ceb1329 Revert "ogg/vorbis: implement header packet skip in chained ogg bitstreams."
non flat extradata is problematic and was missed by reviewers

Found-by: Andreas Rheinhardt
This reverts commit 574f634e49.
2025-05-31 03:18:26 +02:00
Andreas Rheinhardt
0435cd5a62 avfilter/x86/vf_spp: Remove permutation-specific code
The MMX requantize functions have the MMX permutation
(i.e. FF_IDCT_PERM_SIMPLE) hardcoded and therefore
check for the used permutation (namely via a CRC).
Yet this is very ugly and could even lead to misdetection;
furthermore, since d7246ea9f2
the permutation used here is de-facto and since
bfb28b5ce8 definitely
impossible on x64, making this code dead on x64.
So remove it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-31 01:31:09 +02:00
Andreas Rheinhardt
23761c7acd avcodec/asvenc,dvenc: Optimize unaligned checks away if possible
For certain arches (AARCH64, x86, generic) get_pixels and
get_pixels_unaligned always coincide for 8 bit input.
In these cases it is possible to avoid checks for unaligned
input in asvenc, dvenc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-31 01:28:51 +02:00
Andreas Rheinhardt
fbf5cfaed5 avcodec/pixblockdsp: Fix get_pixels alignment documentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-31 01:28:35 +02:00
Andreas Rheinhardt
17d5f30dd5 avcodec/pixblockdsp: Pass bits_per_raw_sample directly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-31 01:27:09 +02:00
Andreas Rheinhardt
20ddada2a3 avcodec/pixblockdsp: Improve 8 vs 16 bit check
Before this commit, the input in get_pixels and get_pixels_unaligned
has been treated inconsistenly:
- The generic code treated 9, 10, 12 and 14 bits as 16bit input
(these bits correspond to what FFmpeg's dsputils supported),
everything with <= 8 bits as 8 bit and everything else as 8 bit
when used via AVDCT (which exposes these functions and purports
to support up to 14 bits).
- AARCH64, ARM, PPC and RISC-V, x86 ignore this AVDCT special case.
- RISC-V also ignored the restriction to 9, 10, 12 and 14 for its
16bit check and treated everything > 8 bits as 16bit.
- The mmi MIPS code treats everything as 8 bit when used via
AVDCT (this is certainly broken); otherwise it checks for <= 8 bits.
The msa MIPS code behaves like the generic code.

This commit changes this to treat 9..16 bits as 16 bit input,
everything else as 8 bit (the former because it makes sense,
the latter to preserve the behaviour for external users*).

*: The only internal user of AVDCT (the spp filter) always
uses 8, 9 or 10 bits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-31 01:25:27 +02:00
Andreas Rheinhardt
61a70e8e9e avcodec/dvenc: Check for unaligned pointers, strides
Fixes segfaults on systems where PixblockDSPContext.get_pixels
really requires to be properly aligned (e.g. ARMv7).
Before this commit input created by
-filter_complex nullsrc=s=740x576:r=25,format=yuv420p,crop=w=720:x=2
led to crashes.

(The unaligned strides are in violation of the AVFrame.linesize
documentation, unaligned pointers itself do not seem to be
prohibited for encoders.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-31 01:12:47 +02:00
Kacper Michajłow
1a7e802c8f avformat/demux: use io_close2 when closing avfromat
It's not valid to call avio_close() on context that has not been open
with avio_open().

This fixes use of custom IO. (io_open / io_close2 callbacks)

Note that by default io_close2 is set to io_close2_default() which calls
avio_close(), so default case will work the same as before.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-31 00:08:25 +02:00
Romain Beauxis
5030564376 libavformat/oggdec.h: Change paket function documentation to return 1 on header packets only.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-30 22:07:11 +02:00
Romain Beauxis
574f634e49 ogg/vorbis: implement header packet skip in chained ogg bitstreams.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-30 22:07:10 +02:00
Romain Beauxis
c9cc61d620 ogg/vorbis: factor out header processing logic.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-30 22:07:10 +02:00
Romain Beauxis
ba3d4c2ba2 libavformat/oggdec.{c, h}: Add new_extradata, use it to pass extradata to the next decoded packet.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-30 22:07:10 +02:00
Michael Niedermayer
791a333a0e avcodec/hevc/hevcdec: Check num_entry_point_offsets
The code uses int, unsigned int and uint16_t to store num_entry_point_offsets
This limits it to the smallest of the 3.
Alternatively uint16_t can be changed and then a larger limit used.
A Check will still be needed.

Fixes: 391974932/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5966648879677440
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-30 22:07:09 +02:00
Michael Niedermayer
f6986e75be avcodec/speexdec: Pass and check remaining packets to decode functions
Fixes: out of array access
Fixes: 394638693/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-4868142996455424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-30 22:07:09 +02:00
Michael Niedermayer
67040773dc avcodec/ffv1enc_template: Fix remaining space check
Fixes: Assertion sc->slice_coding_mode == 0 failed at libavcodec/ffv1enc.c:1667
Fixes: 408838118/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-6493138204295168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-30 22:07:09 +02:00
Andreas Rheinhardt
27c5e4b39a avcodec/libaomenc: Increase code locality
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-30 19:35:32 +02:00
Andreas Rheinhardt
1b5a291dcc avcodec/dovi_rpuenc: Use av_unreachable() instead of av_assert0(0)
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-30 19:35:27 +02:00
Andreas Rheinhardt
0adfe15829 avcodec/dovi_rpuenc: Use av_cold for ff_dovi_configure init functions
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-30 19:35:21 +02:00
Andreas Rheinhardt
8d45dc858e avcodec/dovi_rpuenc: Avoid intermediate codec par in ff_dovi_configure()
It invalidates (removes by duplicates)  AVCodecContext.extradata
and AVCodecContext.coded_side_data which is quite surprising
and leads to bugs like #11617 where an AVCPBProperties
is used after it has been freed in ff_dovi_configure().

Reported-by: Ayose
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-30 19:35:06 +02:00
Lynne
ab37c7e49f ffv1enc: do not hardcode 1024 slices
Instead use a field where possible and the defined constant when not.

Tested by using 4096 slices.
2025-05-30 01:45:58 +09:00
Andreas Rheinhardt
75960ac270 avcodec/asvenc: Fix crash with unaligned pointers/linesizes
This happens on systems where get_pixels really needs
to be properly aligned, like ARMV7 or RISC-V. For these
systems, 0401ca714a caused
a bus error for the vsynth3-asv[12] tests, because
the stride in these tests is unaligned. See e.g.
https://fate.ffmpeg.org/report.cgi?slot=armv7-linux-gcc-13&time=20250527020548
https://fate.ffmpeg.org/report.cgi?slot=rv64gcvb-linux-gnu-gcc&time=20250527001827

It can also happen (even before said commit) if the pointers
itself are unaligned, e.g. by using the crop filter:
ffmpeg -filter_complex nullsrc=s=740x576:r=25,format=yuv420p,crop=w=720:x=2 \
-c:v asv2 -f null -

The alignment requirements for the frames passed to encoders are
mostly undocumented; the only thing I could find is the documentation
of AVFrame.linesize: "For video the linesizes should be multiples
of the CPUs alignment preference". This means that the FFmpeg cli
violates our API.

Yet as the above command line shows, it can also happen with
unaligned pointers and there does not seem to be a prohibition
of this, so we need to handle this case. This commit does so
by using get_pixels_unaligned when needed.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-29 08:00:21 +02:00
Niklas Haas
9568e40aeb avutil/vf_scdet_vulkan: add new filter
Carbon copy of vf_scdet.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-05-28 12:21:27 +02:00
Niklas Haas
0894cfb168 avfilter/blackdetect_vulkan: add hw accelerated blackdetect filter
Like vf_blackdetect but better, faster, stronger, harder.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-05-28 12:21:27 +02:00
Niklas Haas
7e783fac5b avfilter/vf_blackdetect: add alpha option
Check the alpha plane for (almost) transparent frames, instead of checking
the luma channel for almost black frames.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-05-28 12:21:27 +02:00
Niklas Haas
02f45a7f3f avfilter/vf_gblur_vulkan: omit unnecessary buffer usage flag
Implied internally now when needed.
2025-05-28 12:21:27 +02:00
Niklas Haas
0a4cdf8822 avutil/vulkan: automatically enable shader device address usage bit
We require this internally when using descriptor buffers, so it makes sense
to enable it internally, also.
2025-05-28 12:21:20 +02:00
Niklas Haas
c2521c0cd2 avutil/vulkan: add YUVA pixel formats support
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-05-28 12:14:54 +02:00
Andreas Rheinhardt
96d4bcbcd8 avformat/matroskaenc: Use native id V_FFV1 instead of V_MS/VFW/FOURCC
Up until now, our muxer wrote FFV1 in video-for-windows
compatibility mode out of concern for old demuxers that
only support that (whereas the demuxer accepts V_FFV1).
This commit switches to using native mode, because
a) V_FFV1 is around long enough so that old demuxers
should not be an issue (support in FFmpeg has been added
in commit 9ae762da7e
in March 2017/FFmpeg 3.3),
b) using native mode uses fewer bytes for the CodecPrivate,
c) the VfW extradata is zero-padded to an even length
if necessary, but our demuxer forgot to undo the padding
until very recently (92e310eb82),
so that there are many versions of our demuxer around that
are buggy wrt VFW, but not V_FFV1.
This affects the FFV1 extradata checksums, specifically
the (experimental) version 4 files with error check version 2*
as created by
ffmpeg -i ../fate-suite/mpeg2/sony-ct3.bs -c:v ffv1 \
-slices 16 -frames 1 -level 4 -strict experimental ffv1.mkv
VFW files like the above created by this muxer before this patch
would not work with an old demuxer.

*: Without error check version 2, the CRC for the whole extradata
is zero, which is not changed by appending a zero byte.

Reviewed-by: compn <ff@hawaiiantel.net>
Reviewed-by: Dave Rice <dave@dericed.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-28 02:42:36 +02:00
Andreas Rheinhardt
8a936b8726 avformat/matroska: Support JPEG2000 for demuxing
Legal since commit 1cd0a9be4b2d1e7c60184ec68404e00e46e3123e
(Jan 4) in the Cellar Matroska specification git repo.
We still hold out on muxing it due to compatibility with
old demuxers.

Reviewed-by: compn <ff@hawaiiantel.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-28 02:09:28 +02:00
softworkz
b7d44dde3b fftools/tf_mermaid: Add missing uninit and fix leaks
- merge forgotten uninit from work branch
- add set_str() function to free before overwriting
- fix some other leaks

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-28 01:02:55 +02:00
softworkz
a0ac89e46c fftools/graphprint: Fix memory leaks
- uninit resource manager
- free strings before overwriting
- unref hw_frames_context

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-28 01:02:55 +02:00
softworkz
75a5e0959f fftools/ffmpeg: Free print_graph option variables
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-28 01:02:55 +02:00
softworkz
aa38270630 fftools/makefile: Remove resources from ffprobe
Even though it doesn't have any effect, that line is not needed (yet).

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-28 01:02:55 +02:00
Timo Rothenpieler
af94383124 ffbuild: correctly silence and tag new css/html steps
Reviewed-by: softworkz <softworkz@hotmail.com>
2025-05-28 01:02:55 +02:00
Timo Rothenpieler
4cb42551d4 fftools/resources: add missing extensions to .gitignore
Reviewed-by: softworkz <softworkz@hotmail.com>
2025-05-28 01:02:55 +02:00
Andreas Rheinhardt
92e310eb82 avformat/matroskadec: Fix VfW extradata size
The structure is padded to an even length with an internal
size field to indicate the real size.
The matroska-matroska-display-metadata test (writing FFV1
in VFW mode) was affected by this.
It should also fix ticket #11613.

Reviewed-by: compn <ff@hawaiiantel.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-27 22:07:35 +02:00
Lynne
bf6d3dc339 ffv1enc_vulkan: allow slicecrc=2
For parity with the software encoder.
2025-05-27 21:50:35 +09:00
Andreas Rheinhardt
54c865fbec swscale/utils: Fix potential race when initializing xyz tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-27 13:49:26 +02:00
Andreas Rheinhardt
1c78db8ffc avcodec/vc2enc: Use LUT to avoid repeated av_log2()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-27 13:49:26 +02:00
Andreas Rheinhardt
a6bcc773b5 avcodec/ffv1enc: Fix explicitly set -slicecrc 2
crcref needs to be set properly iff ec is two, regardless
of whether it has been explicitly set by the user or set
by default based on level/version.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-27 13:45:21 +02:00
Lynne
3cbe3418b2 vulkan_ffv1: fix golomb coding for non-RGB streams
The run_index is reset on each plane, unlike with RGB, where
its reset once per slice.
2025-05-27 06:40:33 +09:00
Lynne
c395ad7c2c vulkan_ffv1: small cleanup for golomb
Split up computation of the offset in the same way that
the range coder version does it.
2025-05-27 06:40:29 +09:00
Michael Niedermayer
9d229440ac Makefile: Split ALLFFLIBS
This matches other lists and reduces conflicts between patches

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-26 20:33:10 +02:00
Gyan Doshi
c79bce92b8 avformat/movenc: disallow buggy flags combination
Use of hybrid_fragmented and faststart together can result in files with
loss of sync and bitstream parsing errors upon playback.
2025-05-26 22:44:17 +05:30
Henrik Gramner
eda0ac7e5f avcodec/x86/vp9: Add AVX-512ICL for 16x16 and 32x32 10bpc inverse transforms 2025-05-26 15:26:11 +02:00
Coia Prant
df967d095a configure: Use MSYSTEM_CARCH for default arch on msys2
On msys2, `uname -m` returns the architecture of the base msys2
layer. On Windows on arm64, the base msys2 layer itself is still
x86_64 only, even if running with e.g. the clangarm64 where the
windows native applications are built as aarch64.

If MSYSTEM_CARCH is set, use this instead of `uname -m` for
the default architecture. This gives the correct behaviour
for the clangarm64 environments. It also gives the correct
default for the 32 bit x86 environments such as `mingw32`.

(On `mingw32`, the fact that `uname -m` returned `x86_64`
hasn't been an issue, as both that and `i686` gets normalized
into `x86` internally in ffmpeg's configure.)

Signed-off-by: Coia Prant <coiaprant@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-05-26 14:46:29 +03:00
Andreas Rheinhardt
43a69886b2 avcodec/mpeg4videodec: Use union to save space
At most one of block32 and dpcm_macroblock is used at any given time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 05:03:43 +02:00
Andreas Rheinhardt
ac1e6d2171 avcodec/mpegvideo: Remove h263_plus
It is only used to indicate to ff_h263_show_pict_info()
that we are decoding H.263+; pass this information
via a function parameter instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 05:03:29 +02:00
Andreas Rheinhardt
da5c2a419b avcodec/ituh263enc: Don't use h263_plus field
It is equal to codec_id == AV_CODEC_ID_H263P, check for that instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 05:03:15 +02:00
Andreas Rheinhardt
8987c29390 avcodec/mpegvideo: Check h263_aic, not h263_plus for allocating dc_val
This means that these buffers won't be allocated any more
for H.263+ with AIC disabled.
Also remove setting h263_plus for the RV20 encoder,
as it has only been done to force allocating dc_val.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:59:11 +02:00
Andreas Rheinhardt
ed73675832 avcodec/mpegvideo: Move mpeg_quant to {Mpeg4Dec,MPVEnc}Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:58:42 +02:00
Andreas Rheinhardt
778c0a48fa avcodec/mpegvideo_dec: Simplify check for unquantizing inter blocks
Just ensure that dct_unquantize_inter is set iff it is used
and check for the function pointer instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:53:32 +02:00
Andreas Rheinhardt
f2c04fd587 avcodec/mpegvideo_dec: Document which codecs take which codepath
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:52:57 +02:00
Andreas Rheinhardt
2e8a3e6645 avcodec/idctdsp: Only try to initialize xvid idct if it is used
This allows to remove checks from ff_xvid_idct_init()
(and also the AVCodecContext* parameter).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:50:34 +02:00
Andreas Rheinhardt
6349a3324d avcodec/xvididct: Remove always-true checks
ff_xvid_idct_init() is now only called from ff_idctdsp_init()
and only if idct_algo is FF_IDCT_XVID.
This also implies that it is unnecessary to initalize
the permutation on our own.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:50:23 +02:00
Andreas Rheinhardt
eb5d900f87 avcodec/mpeg4videodec: Remove unnecessary ff_xvid_idct_init()
It is unnecessary: If the dst context is not already initialized,
then it will be initialized by memcpy(dst, src, sizeof(*dst),
which already initializes the IDCT to the desired one, potentially
followed by ff_mpv_common_init(), which does not touch the IDCT.

(This call has been added in f89d76c10355242c39b08f253c1d1524f45ef778;
the aforementioned copying took place back then, too, but
ff_mpv_common_init() reinitialized the IDCT to a non-xvid one,
therefore the initialization here has been added to fix
multithreaded decoding.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:47:02 +02:00
Andreas Rheinhardt
6af1bcb180 avcodec/mpeg4videoenc: Use smaller scope for variable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:46:56 +02:00
Andreas Rheinhardt
7267e4dab8 avcodec/mpeg4videoenc: Split writing blocks into intra and inter
These are sufficiently different to warrant their own functions;
in particular, the earlier code had two callsites for the actual
"write block" function, one for intra and one for inter, yet
the "write block" function nevertheless performed a check
(that the compiler can't optimize away) for whether the current
MB is intra or not.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:24:16 +02:00
Andreas Rheinhardt
f7bd2a5af8 avcodec/mpeg4videoenc: Remove no-output code
While it offers modest speedups compared to the ordinary code,
removing it completely offers even bigger speedups; and given
that these speedups also exist in the ordinary mode, they are
even more important. The no-output code has a 7.8% performance
improvement (based on benchmarking mpeg4_encode_mb()), yet
removing the no-output code resulted in a 9.4% improvement.

Furthermore, the no-output code was broken for the majority of
its existence (until 9207dc3b0d)
and no one complained, so it is likely not used at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:23:56 +02:00
Andreas Rheinhardt
2a59cb0c82 avcodec/mpeg4video: Nuke ff_mpeg4_init_rl_intra()
The MPEG-4 decoder can now initialize ff_mpeg4_rl_intra
directly given that the MPEG-4 encoder no longer wants
it performed, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:22:11 +02:00
Andreas Rheinhardt
d75a398d00 avcodec/mpeg4videoenc: Simplify creating LUT
There four cases for the LUT entry: An ordinary entry
or one of three escaping methods. Three of these methods
are only rarely possible --they correspond to the 102
codes of the underlying VLC and so only 102 of 16384 entries
are possible.

The earlier code would nevertheless try them all for every
LUT entry and use the best one; the new code meanwhile only
uses one method (the fallback one (i.e. the worst)) for them all
and only processes the 102 valid entries afterwards.

The implementation used also means that index_run, max_level
and max_run of the RLTable are no longer needed; the earlier
code would initialize said static tables although they are only
used for a short time to initialize something else.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:21:34 +02:00
Andreas Rheinhardt
295abb1fdc avcodec/mpegvideo_enc: Reduce stack usage
Multiple PutBitContexts are used when encoding partitioned
frames. When there are multiple candidates for macroblock types,
multiple states (namely the state before encoding the current MB,
the best state among the ones already tried and the current one)
need to be kept; duplicates of the PutBitContexts are among this
state. The temporary buffers for them are kept on the stack
in encode_thread() and their size is quite generous (MAX_MB_SIZE
- 3000 bytes). This commit uses tighter bounds, bringing the
size of the pb2 buffer down to 15 bytes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:02:58 +02:00
Andreas Rheinhardt
f887a2b006 avcodec/mpeg4videodec: Don't initialize unused parts of RLTables
The reversible VLC tables use a simpler escaping method
than the ordinary VLCs: It does not use max_run, max_level etc.
and therefore one does not need to initialize these at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:02:41 +02:00
Andreas Rheinhardt
a0a136e57b avcodec/h263dec: Move calculating gob_index to {intel,itu}h263dec.c
This avoids checks for whether it should be calculated at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:02:32 +02:00
Andreas Rheinhardt
9918741967 avcodec/mpegvideo_enc: Set gob_index once during init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 04:00:08 +02:00
Andreas Rheinhardt
7ae20272b7 avcodec/pcm: Use av_unreachable() for unreachable code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 03:38:37 +02:00
Andreas Rheinhardt
0d73ce4bc4 avcodec/h263dec: Use av_unreachable() for unreachable code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 03:38:37 +02:00
Andreas Rheinhardt
ded08d0b1b avcodec/msmpeg4dec: Use av_unreachable() for unreachable code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 03:38:37 +02:00
Andreas Rheinhardt
ef95a8d7b5 avcodec/mpegvideo_enc: Use av_unreachable() for unreachable code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 03:38:37 +02:00
Andreas Rheinhardt
a5ff6ea32d avcodec/asvenc: Simplify writing extradata
It is confusing, because the AV_RL32("ASUS") already
returns an endian-independent value, so converting
it via av_le2ne32() makes no real sense: one would need
to transform the native value to le and write it as
a natie endian uint32_t for it to make sense (the current
code only works because le2ne32 and ne2le32 are the same
for both endianness that we care about). Or one can just
use AV_RL32 and create the number via MKTAG().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 03:37:09 +02:00
Andreas Rheinhardt
05a5e2b576 avcodec/asvenc: Combine writing bits
Removes implicit checks for "do I need to output the buffer now?".
Codesize with Clang 19 with -O3 decreased from 7136B to 6108B
(although asv2_put_level() is now inlined).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 03:37:09 +02:00
Andreas Rheinhardt
0401ca714a avcodec/asvenc: Don't waste bits encoding non-visible part
Up until now, the encoder replicated all the border pixels
for incomplete 16x16 macroblocks. In case the available width
or height is <= 8, some of the luma blocks of the MB
do not correspond to actual input, so that we should encode
them using the least amount of bits. Zeroing the block coefficients
(as this commit does) achieves this, replicating the pixels
and performing an FDCT does not.

This commit also removes the frame copying code for insufficiently
aligned dimensions.

The vsynth3-asv[12] FATE tests use a 34x34 input file and are
therefore affected by this. As the ref updates show, the size
and checksum of the encoded changes, yet the decoded output
stays the same.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-26 03:37:09 +02:00
Frank Plowman
ae0f71a387 lavc/h2645_parse: More descriptive NALU header error
Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-05-25 09:54:42 +08:00
Frank Plowman
0382291811 lavc/vvc: Fix divide-by-zero in LMCS param derivation
Add three missing requirements on bitstream conformance from 7.4.3.19 of
H.266 (V3).  Issue found using fuzzing.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-05-25 09:35:21 +08:00
Frank Plowman
670089304a lavc/vvc: Avoid UB in DB strength derivation for PLT CUs
When called for palette-predicted CUs, boundary_strength could cause
undefined behaviour due to accessing uninitialised motion information.
The spec doesn't include this, but in the reference software it seems
the deblock strength is always set to 0 for palette CUs due to some
implementation details: perhaps this is a spec issue?

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-05-24 21:50:46 +08:00
Frank Plowman
a18b2c2696 lavc/vvc: Detect subpic overlaps at CTU level
In d5dbcc00d8, it was hoped that detection
of subpicture overlaps could be performed at the tile level, so as to
avoid introducing per-CTU checks. Unfortunately since that patch,
fuzzing has indicated there are some structures involving
pps_subpic_one_or_more_tiles_slice where tile-level checking is not
sufficient.  Performing the check at the CTU level should (touch wood)
be the be-all and and-all of this, as CTUs are the lowest common
denominator of the picture partitioning.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-05-24 10:57:20 +08:00
Nuo Mi
363a7a34f6 lavc/vvc/plt: validate run and signalled_entries
Fixes a crash triggered by a fuzzed clip:
https://github.com/ffvvc/tests/tree/main/fuzz/passed/000256.bit

Reproduce with:
ffmpeg -i 000256.bit -f null -
2025-05-24 10:36:19 +08:00
Maxime Gervais
cbdb5e2477 ffv1enc_vulkan: fix array overflow 2025-05-24 02:28:13 +09:00
Lynne
56b85b689d aacdec_ac: fix signed overflow in ff_aac_ac_update_context()
The issue is that state->cur[] is 8-bits, but a+b+1 can overflow
before being clipped to 0xF in the following line, causing an incorrect
state to be saved for the next symbol.

This solves numerous bitstream desyncs, particularly when coefficients
with magnitude greater than 127 are sent.
2025-05-24 02:19:18 +09:00
Andreas Rheinhardt
8c509ba491 tests/fate/ac3: Make ac3-fixed-encode-2 bitexact across arches
Don't use a 7.1 EAC3 input file for which our decoder is not
bitexact; instead just use the asynth-44100-8.wav file
which (as a 7.1 file) exhibits the same issue fixed by
1b3f4842c1.
(Either the encoder or the resampler are still not completely
bitexact, so we limit the number of frames output.)

Also switch to a framecrc test so that the output channel layout
is directly contained in the ref file.

Reviewed-by: James Almer <jamrial@gmail.com>
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-23 14:06:26 +02:00
Niklas Haas
559317cc13 avfilter/vf_libplacebo: add shader_cache option
Useful to speed up shader compilation. May significantly lower startup
times, in particular with large or complex shaders.

Sponsored-by: nxtedition
2025-05-23 14:05:16 +02:00
Niklas Haas
4f623b4c59 avfilter/vf_libplacebo: implement rotation option
Flipping can already be accomplished by setting the crop_w/h expressions to
their negative values, so together these options can implement any of the
common frame orientations.
2025-05-23 14:02:45 +02:00
Marcos Del Sol Vives via ffmpeg-devel
a79720e10f avformat/matroskadec: Accept WebVTT subtitles with empty cues
Fixes: #11493
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-23 00:43:33 +02:00
Kacper Michajłow
9c6c653a46 avformat/imfdec: inherit opaque from parent AVFormatContext
io_open and io_close2 callbacks may use opaque pointer stored in the
context. They are already inherited, so opaque should also be passed
through.

Fixes IMF playback in mpv.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-23 00:43:32 +02:00
James Almer
622a72b5ea tests/fate/ac3: add a second ac3_fixed encoder test
Exercising the lavfi filtergraph codepath to choose the best output layout.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-22 19:38:26 -03:00
Paul B Mahol
1b3f4842c1 avfilter/avfiltergraph: fix regression in picking channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-22 19:38:11 -03:00
James Almer
8eae65dc5c avcodec/lcevcdec: don't try to write to output frames directly
The buffer references may not be writable at this point, as the decoder
calls get_buffer2() with the AV_GET_BUFFER_FLAG_REF flag.

Fixes races as reported by tsan, producing correct output regardless of
threading choices.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-22 19:28:35 -03:00
Ramiro Polla
d028cf03b8 swscale/swscale_unscaled: fix planarRgbToplanarRgbWrapper() for formats with bpc between 9-14 bits
Currently, planarRgbToplanarRgbWrapper() always sets the alpha value to 255,
without taking the bit depth into consideration.

This commit restricts the alpha value to the bit depth.
2025-05-23 00:07:56 +02:00
Ramiro Polla
748e960e04 swscale/swscale_unscaled: fix packed16togbra16() for formats with bpc between 9-14 bits
Currently, packed16togbra16() always sets the alpha value to 0xFFFF,
without taking the bit depth into consideration.

This causes a bug on x86, which can be reproduced with:
./libswscale/tests/swscale -unscaled 1 -src xyz12le -dst gbrap12be

The problem arises in ff_hscale14to15_4_ssse3(), in the conversion
from gbrap12be to yuva444p, which comes after the conversion from
xyz12le to gbrap12be.

It has something to do with pmaddwd not working on unsigned values.
There is some code to deal with 0xFFFF if the input has a bit depth of
16, but not for bit depths < 16.
We could fix ff_hscale14to15_4_ssse3() to also work correctly with
0xFFFF on bit depths < 16, or we could just not write 0xFFFF there in
the first place, which is what this commit does.
2025-05-23 00:01:04 +02:00
Ramiro Polla
0c1d87d1e6 swscale/swscale_unscaled: fix packed30togbra10() for formats with bpc between 9-14 bits
Currently, packed30togbra10() always sets the alpha value to 0xFFFF,
without taking the bit depth into consideration.

This commit restricts the alpha value to the bit depth.
2025-05-23 00:00:05 +02:00
Ramiro Polla
a16c053a33 swscale/swscale_unscaled: fix planarCopyWrapper() for yuv444p => yuva444p
Currently, planarCopyWrapper() assumes that src[3] must be NULL when
the source format has no alpha plane.

This commit updates the condition for filling the alpha plane based on
the number of components available in the source format as well.
2025-05-22 23:59:39 +02:00
Ramiro Polla
db5e0e2ef9 build: remove unused SLIBOBJS variable
The SLIBOBJS variable was introduced in 56572787ae but is no longer used.
Another variable, SHLIBOBJS, was introduced after SLIBOBJS, in 20b0d24c2f.
The functionality from SLIBOBJS was effectively migrated to SHLIBOBJS in b77fff47d0.

No code has used SLIBOBJS since.

This commit removes all remaining references to SLIBOBJS from the build system.
2025-05-22 23:59:03 +02:00
Tristan Matthews
9b9a287872 doc/examples/qsv_decode: use av_err2str
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-05-22 22:26:30 +02:00
Tristan Matthews
e93a43b511 doc/examples/filter_audio: use av_err2str
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-05-22 22:26:30 +02:00
Lynne
977d1a24bc vulkan/ffv1: fix sync issue in cached bitstream reader/writer
The issue is that there is an explicit lack of synchronization as only the very
first invocation writes symbols and updates the state, which other invocations
then store.
2025-05-23 05:23:44 +09:00
Erik Linge
b9b44e15b5 rtpdec: Set bitrate for pcm-mulaw audio
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Co-authored-by: Marvin Scholz <epirat07@gmail.com>
2025-05-22 22:11:37 +02:00
Erik Linge
f566392f66 libavformat/rtpdec_opus: add fmtp parsing of sprop-maxcapturerate
Co-authored-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-05-22 22:11:37 +02:00
Jonathan Baudanza
2a180c7150 libavformat/rtpdec_opus: Set duration field on Opus AVPacket
This commit will properly set the duration field of Opus AVPackets.
Currently, duration is set to 0 on Opus packets from the RTP demuxer.

The Ogg muxer depends on the duration field to properly compute the page granule
value. Without a proper duration, the granule will be wrong, and result in
negative pts values in ogg files.

See oggenc.c:657 (ogg_write_packet_internal)

This commit calculates using the opus_duration function, which was copied
from oggparseopus.c

I moved this functionality and the existing opus extradata functionality
(added by me in 6c24f2b) into a new rtpdec_opus.c file.

Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-05-22 22:10:46 +02:00
Justin Ruggles
36ec9217e6 avformat/dhav: fix backward scanning for get_duration and optimize seeking
The backwards scanning done for incomplete final packets should not
assume a specific alignment at the end of the file. Truncated files
result in hundreds of thousands of seeks if the final packet does not
fall on a specific byte boundary, which can be extremely slow.
For example, with HTTP, each backwards seek results in a separate
HTTP request.

This changes the scanning to check for the end tag 1 byte at a time
and buffers the last 1 MiB to avoid additional seek operations.

Co-authored-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Justin Ruggles <justinr@vimeo.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2025-05-22 16:11:16 +01:00
Andreas Rheinhardt
c8b09fb0ac avutil/refstruct: Remove redundant check
We now require C11.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-22 15:12:54 +02:00
Niklas Haas
4099d53759 avfilter/vf_interlace_vulkan: fix FPS and PTS calculation
ol->frame_rate is 0/0, so we need to calcalute the correct value based on
the il->frame_rate instead. Also adjust the time base, PTS and frame_duration
values accordingly. (Logic taken from vf_tinterlace.c)
2025-05-21 16:10:55 +02:00
Dmitrii Ovchinnikov
f1b3e51950 avcodec/amfenc_h264: improve B-frame usability and simplify options
- Query GPU caps for B-frame support and warn if unsupported.
- Make `-max_b_frames` optional
- Drop explicit `-pa_lookahead_buffer_depth` requirement in
adaptive mode.
2025-05-21 15:42:30 +02:00
Andreas Rheinhardt
2a5ee83442 avcodec/atrac3: Use av_unreachable() instead of av_assert1(0)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
328ba54efa avcodec/4xm: Use av_unreachable() instead of av_assert0(0)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
5653e0b1fa avcodec/mjpegenc_common: Use av_unreachable() instead of av_assert0(0)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
85fb3453f8 avcodec/adpcm: Use av_unreachable() instead of av_assert0()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
0bdb69119a avcodec/vp9: Replace av_assert(0) by av_unreachable()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
2282a3740b avcodec/rv20enc: Use av_assert1() instead of av_assert0()
There is really no good reason to perform these checks in
release builds.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
a35917268d avcodec/mpegvideo encs: Add put_bits_assume_flushed() to encode_header
This allows the compiler to remove the implicit "Do I need to output
the PutBitContext buffer here?" checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
5d0e8fa4bb avcodec/vlc: Make assert check more strict
The earlier code allowed callers to use arbitrary values as
symbols_size as long as no symbols were present.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
ef58de7fdc avcodec/mpegvideo_{dec,motion}: Mark unreachable code as unreachable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
57696f7c2b avcodec/wmaenc: Use av_unreachable() instead of av_assert0(0)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:52 +02:00
Andreas Rheinhardt
831a0d0c6b avcodec/speedhqenc: Use av_unreachable() for unreachable condition
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:46 +02:00
Andreas Rheinhardt
2df9c8da72 avcodec/e?ac3enc: Inform compiler about PutBitContext being blank
This turned out to be very beneficial: For GCC 13, the codesize
of ac3_output_frame_header went down from 4522B to 1247B and
from 10762B to 9298B for eac3_output_frame_header. For Clang 17,
the numbers went down from 3923B to 2477B and from 8338B to 6548B
(always with -O3).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:25 +02:00
Andreas Rheinhardt
4484e9b373 avcodec/put_bits: Allow to mark places where PutBitContext is flushed
This will allow the compiler to optimize the "is the cache full?"
branches away from some put_bits().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:25 +02:00
Andreas Rheinhardt
988e319b40 avcodec/dolby_e_parse: Use av_unreachable instead of av_assert0(0)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:25 +02:00
Andreas Rheinhardt
22e6e4e914 avcodec/utvideoenc: Remove always-false pixel format check
Mark it as unreachable instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:02:10 +02:00
Andreas Rheinhardt
d7d1379d06 avcodec/vlc: Make code more readable with av_unreachable()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:01:43 +02:00
Andreas Rheinhardt
fc520ccb07 avcodec/pcm-dvdenc: Mark unreachable default cases as unreachable
Fixes a Clang warning when asserts are disabled:
"variable 'quant' is used uninitialized whenever switch default is taken
[-Wsometimes-uninitialized]"

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 12:01:30 +02:00
Andreas Rheinhardt
7a27357636 avcodec/mpeg4videodec: Mark impossible switch case as unreachable
Alternative to 8fc649b931.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 11:36:09 +02:00
Andreas Rheinhardt
b5824a6dab avcodec/proresenc_anatoliy: Mark impossible case as unreachable
Alternative fix for fix Coverity issue 1440385 (instead of
6106177ad6).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 11:35:31 +02:00
Andreas Rheinhardt
fc9e2a92c1 avcodec/amrwbdec: Mark default switch as unreachable
Alternative fix for Coverity issue #1473499
instead of a3bb269db9.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 11:16:25 +02:00
Andreas Rheinhardt
004cc60f0e avutil/avassert: Add av_unreachable() and av_assume() macros
Useful to let the compiler and static analyzers know that
something is unreachable without adding an av_assert
(which would be either dead for the compiler or add runtime
overhead) for this.
The implementation used here enforces the use of a message
to provide a reason why a particular code is supposed to be
unreachable.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 10:45:23 +02:00
Andreas Rheinhardt
b6f84cd72a avcodec/svq3: Improve returning last picture
Use av_frame_move_ref() instead of av_frame_ref().
This allows to remove the separate variable for whether
we have already returned the delayed last pic. It also
makes stream looping work when looping multiple times;
previously the delayed pic was only output the first time,
because last_frame_output was never reset.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:52 +02:00
Andreas Rheinhardt
b98128898a tests/fate/qt: Use passthrough fps_mode for svq3-watermark
The file has buggy timestamps (it uses B-frames, yet pts==dts)
and therefore the last frame is currently discarded by FFmpeg cli.
Using -fps_mode passthrough avoids this and provides coverage
of the SVQ3 draining logic.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:52 +02:00
Andreas Rheinhardt
f362a19096 avcodec/svq3: Allocate picture buffers during init
Also allocate them jointly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:52 +02:00
Andreas Rheinhardt
b8ec4f7b20 avcodec/svq3: Allocate motion_val jointly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:52 +02:00
Andreas Rheinhardt
eacde6ee7b avcodec/svq3: Deduplicate allocating dummy frame
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:52 +02:00
Andreas Rheinhardt
cb54eca41a avcodec/svq3: Improve returned error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:52 +02:00
Andreas Rheinhardt
0468b866ca avcodec/svq3: Factor out decoding extradata
Reduces indentation and avoids an extra variable for whether
a sequence header has been found.
It also fixes potential undefined behaviour:
NULL + 0 is undefined and happens when no extradata is available.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:52 +02:00
Andreas Rheinhardt
0b3dae6c63 avcodec/mpeg12enc: Combine put_bits()
This is a 16bit field in the spec, so using a single
put_bits() to write it is more natural.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:22 +02:00
Andreas Rheinhardt
f5f890fee4 avcodec/mpeg12dec: Remove nonsense comment
Everything in mpeg12dec.c is about decoding.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:10:05 +02:00
Andreas Rheinhardt
562192e283 avcodec/mpeg12dec: Remove redundant save_width/height
These have been added in 29644cb504
in 2007 at a time when the MPEG-1/2 parser just set
the AVCodecContext's dimensions when encountering a sequence header,
so that the checks for the coded dimensions didn't trigger.
Yet this is no more and so we can simply remove these redundant checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:09:55 +02:00
Andreas Rheinhardt
56497671dd avcodec/mpeg12dec: Set save_chroma_format also for VCR2
Otherwise the MpegEncContext would be unnecessarily reinitialized
once (this does not affect the output for an intra-only variant
like VCR2) in mpeg_decode_postinit().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 03:09:45 +02:00
Andreas Rheinhardt
a1e4be5740 avcodec/mpegvideo_dec: Move ff_mpv_report_decode_progress() to h263dec.c
It is its only user. Also make it static and call it
before ff_mpeg_draw_horiz_band().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 02:54:22 +02:00
Andreas Rheinhardt
e12cbf6095 avcodec/tests/avcodec: Check only frame-mt decoders set update_thread_ctx
Possible since 554b52b1b3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 02:44:15 +02:00
Andreas Rheinhardt
a6f7b32085 avcodec/ratecontrol: Fix wrong sizeof expression
Fixes Coverity issue #1644200.
Introduced in 89a8033fc9.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 02:44:06 +02:00
Andreas Rheinhardt
36af32f9e5 avcodec/tests/.gitignore: Add apv test tool
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 02:43:22 +02:00
Andreas Rheinhardt
bd63c374d2 avformat/avformat: Remove outdated io_close2 documentation
The io_close callback has been removed in
d6799ee0e4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 02:43:08 +02:00
Andreas Rheinhardt
66f5323652 avcodec/rv60dec: Avoid branch when decoding cbp16
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-21 02:41:55 +02:00
Timo Rothenpieler
d5a9f7bdd4 avcodec/cuviddec: only flush cuvid when output queue is empty 2025-05-21 01:16:19 +02:00
Timo Rothenpieler
431e2cae87 avcodec/cuviddec: print error when queueing frames fails 2025-05-21 01:15:29 +02:00
Lynne
842fa198e9 hwcontext_vulkan: fix build with old Vulkan header versions 2025-05-21 03:11:07 +09:00
Shiyou Yin
f414038779 configure: identify loong64 for loongarch
dpkg-architecture set DEB_HOST_ARCH_CPU as loong64 on loongarch.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-05-20 21:19:53 +08:00
Zhao Zhili
1249776641 Makefile: Remove postproc from ALLFFLIBS
Fix
ld: warning: search path 'libpostproc' not found

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-05-20 21:17:43 +08:00
Zhao Zhili
4f7bc62c66 avformat/allformats: Move avisynth and dvdvideo under external libraries group
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-05-20 21:17:28 +08:00
Lynne
eabb62813e hwcontext_vulkan: only try exporting DMABUF memory on !WIN32 and only for DMABUF tiling 2025-05-20 19:53:02 +09:00
Lynne
7c3c5c8052 hwcontext_vulkan: correct image transfer usage flags
By pure coincidence, BUFFER and IMAGE flags were equal for those
two usage types.
2025-05-20 19:53:02 +09:00
Lynne
435db9bb49 vulkan: enable VK_KHR_shader_subgroup_rotate
Yet another thing that should've been always present.
2025-05-20 19:53:02 +09:00
Lynne
7b45d9c5fd vulkan_ffv1: pipe through slice decoding status 2025-05-20 19:53:02 +09:00
Lynne
cb8f4b675d vulkan/ffv1: unify encode and decode get/put primitives
This simply makes a get_rac/put_rac_internal variant that can be
reused.
2025-05-20 19:53:02 +09:00
Lynne
7576410af7 ffv1enc_vulkan: implement RCT search for level >= 4 2025-05-20 19:53:01 +09:00
Lynne
0156680f09 ffv1enc_vulkan: implement the cached EC writer from the decoder
This gives a 35% speedup on AMD and 50% on Nvidia.
2025-05-20 19:53:01 +09:00
Lynne
a24ea37228 vulkan_ffv1: fix PCM + cached symbol reader
writeout_rgb requires that all subgroups are active.
2025-05-20 19:53:01 +09:00
Lynne
f69db914ce ffv1enc_vulkan: use ff_get_encode_buffer
We used to create our own buffer, but still used the DR1 flag,
which is not how it's supposed to work.

Instead, use ff_get_encode_buffer, and either host-map the buffer
before copying each slice via GPU transfers, or just copy each
slice manually if that fails or is unavailable.
2025-05-20 19:53:01 +09:00
Lynne
8a2d921627 ffv1_common: minor RGB optimization 2025-05-20 19:53:01 +09:00
Lynne
bd41838b60 ffv1enc_vulkan: switch to 2-line cache, unify prediction code 2025-05-20 19:53:01 +09:00
Lynne
52595025c5 ffv1enc_vulkan: minor EC optimizations 2025-05-20 19:53:01 +09:00
Lynne
7c0a8c07ce ffv1enc_vulkan: unify EC code between setup and encode 2025-05-20 19:53:00 +09:00
Lynne
69f83bafd1 ffv1enc_vulkan: get rid of temporary data for the setup shader 2025-05-20 19:53:00 +09:00
Lynne
a4078abd73 vulkan/ffv1: synchronize get_pred implementations between encoder and decoder 2025-05-20 19:53:00 +09:00
Lynne
ebbc7ff650 ffv1enc_vulkan: merge all encoder variants into one file
Makes it easier to work with, despite the heavy ifdeffery.
2025-05-20 19:52:55 +09:00
Henrik Gramner
fd18ae88ae avcodec/x86/vp9: Add AVX-512ICL for 16x16 and 32x32 8bpc inverse transforms 2025-05-19 15:56:27 +02:00
Ramiro Polla
b6803bf104 aarch64: increase default alignment for functions and constants
Use 16-byte alignment (align=4) instead of 4-byte (align=2) in the function and
const macros. This improves instruction fetch and NEON load performance on
modern AArch64 CPUs.
2025-05-19 13:20:51 +02:00
Gyan Doshi
c55d65ac0a configure: correct liboapv feature support
Only encoding support has been added for liboapv
2025-05-19 15:21:33 +05:30
Romain Beauxis
9c5ed57f94 ogg/opus: implement header packet skip in chained ogg bitstreams. 2025-05-19 07:24:05 +02:00
Romain Beauxis
2fb6416dd0 ogg/flac: implement header packet skip in chained ogg bitstreams. 2025-05-19 07:24:05 +02:00
Andreas Rheinhardt
bd2dcfaed4 tests/fate/matroska: Add container cropping test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-19 03:21:27 +02:00
James Almer
95c43c6d0e tests/fate/pixfmt: fix definition of 16bit tests
No effect as is, but without this change, new additions to FATE_PIXFMT_16-*
will not work.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-18 19:54:32 -03:00
James Almer
9fadd6ddad doc: add htmlxref.cnf
Silences warnings like

filters.texi:256: warning: no htmlxref.cnf entry found for `ffmpeg-utils'

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-18 19:54:09 -03:00
Pavel Koshevoy
0021484d05 avformat/mpegts: update stream info when PMT ES stream_type changes
I have several .ts captures where video and audio codec changes even
though the PMT version does not change and the PIDs stay the same.
This happens during transition to/from slate (mpeg2 video and audio)
to network broadcast (hevc video and eac3 audio in private PES).

I've updated fate ts-demux expected results.
2025-05-18 08:57:31 -06:00
Mark Thompson
20502ba92a ffmpeg: Don't print graphs if there are no outputs yet
Avoids writing an empty json blob in setup error cases.
2025-05-18 15:17:41 +01:00
Mark Thompson
c18d1b63ab fftools/graphprint: Fix leak of graph section header string 2025-05-18 15:17:41 +01:00
Mark Thompson
2070cc138b fftools/graphprint: Fix leak of graphprint object 2025-05-18 15:17:41 +01:00
Niklas Haas
06cee0c681 doc: add swscale rewrite design document
This should hopefully serve as a better introduction to my new swscale
redesign than hunting down random commit message monologues.
2025-05-18 15:00:58 +02:00
Niklas Haas
6072e27e9a swscale/graph: prefer bools to ints
This is more consistent with the rest of the newly added code, which
universally switched to using bools for boolean values.
2025-05-18 15:00:45 +02:00
Niklas Haas
d95944786e swscale/graph: move vshift() and shift_img() to shared header
I need to reuse these inside `ops.c`.
2025-05-18 14:39:57 +02:00
Niklas Haas
bc9696bff8 swscale/graph: make noop loop more robust
The current loop only works if the input and output have the same number
of planes. However, with the new scaling logic, we can also optimize into a
noop the case where the input has extra unneeded planes.

For the memcpy fallback to work in these cases we have to instead check if
the *output* pointer is set, rather than the input pointer.
2025-05-18 14:37:33 +02:00
Niklas Haas
51e912466f swscale/graph: expose ff_sws_graph_add_pass
So we can move pass-adding business logic outside of graph.c.
2025-05-18 14:37:33 +02:00
Niklas Haas
f297ebf97a tests/swscale: improve colorization of speedup
The old limits were a bit too tightly clustered around 1.0. Make the
value range much more generous, and also introduce a new highlight
for speedups above 10.0 (order of magnitude improvement).
2025-05-18 14:37:33 +02:00
Kacper Michajłow
eb6dc952cb avcodec/libzvbi-teletextdec: change new lines to \n in ASS header
Fixes remaining \r\n is ASS header after 57c545090d.

Fixes AVERROR_BUG error during init as this decoder expected `\r\n` in
default ASS header. strstr(..., "\r\n[Events]\r\n") failed after changes
in 57c545090d.

Fixes ticket #11545.

Fixes: 57c545090d
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-17 21:27:29 +02:00
Kacper Michajłow
597186b153 avcodec/libaribcaption: change new lines to \n in ASS header
Fixes remaining \r\n is ASS header after 57c545090d.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-17 21:27:29 +02:00
Kacper Michajłow
0105ff554b avcodec/libaribb24: change new lines to \n in ASS header
Fixes remaining \r\n is ASS header after 57c545090d.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-17 21:27:29 +02:00
Andreas Rheinhardt
b5f26c4dd8 avcodec/utvideoenc: Don't advertise unsupported option
Also return an better error code if it is set numerically.
(This option was added in 2862b63783
when an AVCodecContext generic option was moved to
a codec private one without realizing that not every
generic one is valid for every encoder.)

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-17 15:06:00 +02:00
Mark Thompson
88f2ccdf16 cbs_apv: Fix memory leak on metadata parse failure
Buffers are allocated inside some metadata types, so we must ensure
that the object is visible to the free function before a parse failure.

Found by libFuzzer.
2025-05-17 11:23:36 +01:00
Wu Jianhua
a65d028fb1 Changelog: VVC supports all content of SCC
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:24:01 +08:00
Wu Jianhua
fd5d754b2a avcodec/vvc: add adaptive color transform support
passed files:
    ACT_A_Kwai_3.bit
    ACT_B_Kwai_3.bit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
0e4c0db317 avcodec/vvc/intra: refact out lmcs_scale_chroma and add_residual
prepare for adaptive color transform

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
ff1ecc7eb3 avcodec/vvc/intra: make lmcs_scale_chroma inplace
prepare for adaptive color transform

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
d2e7ca684c avcodec/vvc/intra: refact, predict jcbcr to tb->coeffs
prepare for adaptive color transform

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
86e96a1c02 avcodec/vvc/intra: fix scaling process for transform coefficients
See 8.7.3 Scaling process for transform coefficients

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
fef573f30b avcodec/vvc/dsp: add adaptive_color_transform
See 8.7.4.6 Residual modification process for blocks using colour space conversion

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
8bdad76c00 avcodec/vvc/dsp: update the interface of pred_residual_joint for joint cbcr residual functionality
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
d00a249dbf avcodec/vvc/ctu: fix derive_chroma_intra_pred_mode
See 8.4.3 Derivation process for chroma intra prediction mode

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
c58357edc2 avcodec/vvc/ctu: read act_enabled_flag for adaptive color transform
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
b9c5fb0d00 avcodec/vvc/cabac: add ff_vvc_cu_act_enabled_flag
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
70a2d0d756 avcodec/vvc/intra: add palette coding decoder
Introduction at https://ieeexplore.ieee.org/document/9408666

passed files:
    10b422_G_Sony_5.bit
    10b422_H_Sony_5.bit
    10b422_I_Sony_5.bit
    10b422_J_Sony_5.bit
    10b422_K_Sony_5.bit
    10b422_L_Sony_5.bit
    8b422_G_Sony_5.bit
    8b422_H_Sony_5.bit
    8b422_I_Sony_5.bit
    8b422_J_Sony_5.bit
    8b422_K_Sony_5.bit
    8b422_L_Sony_5.bit
    8b444_A_Kwai_2.bit
    8b444_B_Kwai_2.bit
    PALETTE_A_Alibaba_2.bit
    PALETTE_B_Alibaba_2.bit
    PALETTE_C_Alibaba_2.bit
    PALETTE_D_Alibaba_2.bit
    PALETTE_E_Alibaba_2.bit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
95473fae9b avcodec/vvc/filter: skip deblocking filter for palette
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
26215b8c83 avcodec/vvc/ctu: add palette support
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
fd85f83608 avcodec/vvc/intra: add ff_vvc_palette_derive_scale
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
3ecf8f8766 avcodec/vvc/ctu: refact out intra_data
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
d0f9151eb0 avcodec/vvc: refact, save pf and ciip_flag in ff_vvc_set_intra_mvf
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
75e5fb6e37 avcodec/vvc: refact out ep_init and ep_init_wpp
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
cfea9b88a5 avcodec/vvc/ctu: refact out ff_vvc_channel_range
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
d80041f123 avcodec/vvc: add VVC_MAX_NUM_PALETTE_PREDICTOR_SIZE
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
89ba1bb255 avcodec/vvc/cabac: add palette support
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
a7320efa2b avcodec/vvc/cabac: add 9.3.3.7 Fixed-length binarization process
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Wu Jianhua
02fe29fa39 avcodec/vvc/cabac: add 9.3.3.5 k-th order Exp - Golomb binarization process
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-05-17 09:22:40 +08:00
Marton Balint
fe97bf8752 tests/fate/probe: add test for dts in wav
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-16 20:43:58 +02:00
Marton Balint
a6a510c1d9 tests/fate/probe: add test for pcm misdetected as mp3 in wav
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-16 20:43:58 +02:00
Marton Balint
0d6ef6f545 fftools/textformat: correctly propagate uninit error codes
This allows catching IO errors occuring at file close.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-16 20:43:58 +02:00
Marton Balint
a124c9a580 Revert "fftools/textformat/avtextformat: Make close functions return void"
This reverts commit 7684243fbe and
a888975a3c.
2025-05-16 20:43:58 +02:00
Nuo Mi
87b0561c88 build: fix windows build issue introduced by 45bea45
We defined CR to 2 in libavcodec/vvc/dec.h, but the CR used by _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY winnt.h
reorder the header will avoid the issue.
2025-05-16 20:30:46 +08:00
Andreas Rheinhardt
45daaf2caa avcodec/mpeg12enc: Fix writing closed captions
Broken in 6e225123d8, because
ff_copy_bits() expects the amount of bits, not bytes to write.
And because it relies on the buffer to be padded, using
side_data->size * 8 is not possible. So partially revert
said commit.

Fixes ticket #11591.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 12:20:18 +02:00
softworkz
79e2a845cd Revert "fftools/graphprint: Now, make it a Killer-Feature!"
This reverts commit 1f2b8d7238.
2025-05-16 10:37:29 +02:00
Andreas Rheinhardt
505510acda avcodec/mpegvideo: Move parent to MPVEncContext
This is more type-safe and avoids having parent contexts
when unnecessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
bc81a797c4 avcodec/mpeg4videodec: Move setting has_b_frames to mpeg4video_parser.c
ff_h263_decode_frame() already does it generically for the decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
2865ebd1fb avcodec/mpeg4videodec,h263dec: Only set skipped_last_frame for !vop_coded
This is more in line with the spec and avoids a branch.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
c37fb99abb avcodec/h263dec: Always output next, not current pic when flushing
It is the last picture in display order.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
2d4d7df10c avcodec/mpeg4videodec: Keep skipped_last_frame in sync between threads
Otherwise the output may depend upon the number of frame threads used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
dfb4477191 avcodec/mpeg4videodec: Don't set chroma matrices unnecessarily
Only the studio profile uses chroma_inter/intra matrices;
the ordinary profile has only inter/intra matrices.
And our code (namely the MPEG-2 unquantize functions)
only use these two matrices (the MPEG-2 decoder unquantizes
on its own while parsing).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
bd6e6495ae avcodec/mpegvideo: Move clear_context() to mpeg4videodec.c
There is only one source of dirty MpegEncContexts:
update_mpvctx() (which copies an MpegEncContext
over another one in order to initialize it). So only clear
these contexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
839155324e avcodec/mpegvideo_dec: Move memcpy'ing ctx to mpeg4videodec.c
When the destination MpegEncContext in ff_mpeg_update_thread_context()
is not initialized, the source MpegEncContext is simply copied
over it before (potentially) calling ff_mpv_common_init().
This leads to data races when this code is executed which is why
it should be replaced with only copying the necessary fields
(this is for future commits).

Given that the RV30 and RV40 decoders always call said function
with an already initialized MpegEncContext (they use context_reinit
in case of frame size changes), they don't need this ugly
initialization (and are therefore race-free). This means that
this code can be moved to the only decoder that actually needs it:
MPEG-4. This commit does so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
65015003f5 avcodec/svq1enc: Allocate buffers during init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
88ce3dade6 avcodec/svq1enc: Remove always-false check
The pixel format has already been checked generically
via CODEC_PIXFMTS.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
53a012145a avcodec/mpeg12dec: Reinit upon chroma_format change
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
1f0af6b592 avcodec/mpeg12dec: Don't reinit upon aspect ratio change
The spec indeed does not allow the aspect ratio to change
within a video sequence, but this does not imply that we
must reinitialize the decoder if only the aspect ratio changes,
as this value does not affect the decoding process at all.
Moreover, our reinitialization is a bit buggy: If there is
frame reordering, then the not yet output next P-frame is
simply discarded upon reinit. With this patch this no longer
happens when only the aspect ratio changes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
554b52b1b3 avcodec/mpeg12dec: Remove disabled frame-threading code
The MPEG-1 decoder has an update_thread_context function set,
yet it was never enabled (missing AV_CODEC_CAP_FRAME_THREADS
flag). So remove it and also the ff_thread_finish_setup() call
as well as the progress reporting.

(Simply setting the flag would not be enough. The main problems
are:
a) The update_thread_context function relies on memcpy'ing
the whole context instead of only copying the necessary fields.
This leads to data races which is undefined behaviour.
(Btw: The check for whether the non-MpegEncContext fields
of Mpeg1Context should be copied has been broken in
7f0efe232475d7a704924a3cb308281973e8add3.)
b) Even an AVBufferRef* is simply copied, without creating a new
reference.
c) Copying the whole context happens only during init; when parameters
change lateron, the change is not propagated to the next thread.
This affects at least the quant matrix (for MPEG-1).
d) The MPEG-1/2 decoders are made to decode both MPEG-1 and MPEG-2.
When MPEG-2 is decoded, another complication arises: In case of
coded fields, both fields can be in one AVPacket or they can be
in separate AVPackets. One would need to parse enough of the data
to be able to determine whether the next thread needs to start
a new frame or decode the second field of the current frame;
for this one would need to either postpone calling
ff_thread_finish_setup() for coded slices altogether or implement
some form of ff_h2645_packet_split().
One would also need a second ThreadProgress to signal progress
of each field.
e) One would need to reenable waiting in ff_mpv_reconstruct_mb()
for MPEG-1/2 (and H.261).
f) Probably lots of other stuff for invalid input that I am currently
not thinking about.
If this were done, nothing from the current update_thread_context
would remain, so one can just nuke it altogether.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
763b7ceb31 avcodec/rv34: Simplify updating thread context
Call ff_mpeg_update_thread_context() first and
update the RV34 buffers if it indicates a reinitialization.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
1d5f660ff6 avcodec/mpegvideo_dec: Notify users of reinit
Namely of reinititialization performed by
ff_mpeg_update_thread_context(), so that they can simply
update their own dimension-based buffers accordingly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
2f971c7fda avcodec/ituh263dec: Fix indentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
f82a75333a avcodec/mpegvideo: Move [fb]_code to Mpeg4Dec and MPVEncContext
It is only used by the MPEG-4 decoder and the encoders.
Notice that this field is a per-frame property and therefore
does not need to by synced in mpeg4_update_thread_context().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
545724f61e avcodec/mpeg4video: Pass parameters directly
Namely in ff_mpeg4_get_video_packet_prefix_length().
This will allow to move [fb]_code from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
4e2bac279d avcodec/vc1: Remove unused topleft,bottomright fields
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
728ef2245c avcodec/vc1: Remove write-only qs_last
Write-only since 9cc74c9f6e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
6ce86c9c11 avcodec/mpeg4videodec: Permute quant matrices directly upon IDCT reinit
When switching to the XviD IDCT, the IDCT permutation can change.
Given that we already permute the quant matrices when parsing
them, they need to be permuted, too. Up until now this has not been
done; instead the header has been parsed again in the expectation
that the currently active quant matrix is contained in this header.

This expectation is wrong; it is for example wrong when the VOL
header is only available via extradata (such a file can be easily
created from xvid_vlc_trac7411.h263 (in the FATE suite) via the
remove_extra BSF). It could also be wrong if the XviD user data
is only available in a subsequent packet.

This commit therefore switches to permuting the relevant matrices
directly. It also stops parsing the header a second time
when switching to the XviD IDCT.

(I wonder whether ff_mpv_idct_init() should take alternate_scan
into account when initializing permutated_intra_h_scantable
as the decoder does. Does the MPEG-4 encoder use a wrong scantable
in this case?)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
ca36689b39 avcodec/mpeg4videodec: Set [yd]c_scale_table during init
It does not change lateron.
(If we were to add short header support later, it would involve
a branch in mpeg4_decode_block() anyway and we would then
hardcode the dc_scaler value of eight there; the *_scale_tables
would stay the same.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
476c70164e avcodec/mpeg_er: Don't zero ThreadFrame* unnecessarily
We never set the ThreadFrame*, because mpegvideo uses
ThreadProgress instead of ThreadFrames. Furthermore,
it is unnecessary because the ERPicture has just been zeroed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
Andreas Rheinhardt
3792cf52af avcodec/{x86,mips}/xvididct_init: Remove redundant checks
ff_xvid_idct_init() already checks in case of high_bit_depth,
lowres or an incompatible idct_algo.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
softworkz
1f2b8d7238 fftools/graphprint: Now, make it a Killer-Feature!
remember this: -sg   <= means Show Graph

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:11:08 +02:00
softworkz
45926bc09a fftools/graphprint: Add execution graph printing
The key benefits are:

- Different to other graph printing methods, this is outputting:
  - all graphs with runtime state
    (including auto-inserted filters)
  - each graph with its inputs and outputs
  - all filters with their in- and output pads
  - all connections between all input- and output pads
  - for each connection:
    - the runtime-negotiated format and media type
    - the hw context
    - if video hw context, both: hw pixfmt + sw pixfmt
- Output can either be printed to stdout or written to specified file
- Output is machine-readable
- Use the same output implementation as ffprobe, supporting multiple
  formats

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:09:17 +02:00
softworkz
50fcc0ce5f fftools/ffmpeg_mux: Make ms_from_ost() inline
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:08:05 +02:00
softworkz
517a805565 fftools/resources: Add resource manager files with build-time compression
Compression requires zlib to be available, otherwise resources will
be included uncompressed - in either case via BIN2C.

It can also be disabled via

./configure --disable-resource-compression

Size figures:

graph.css         7752
graph.css.min     6655 (css is always minified)
graph.html        2153

No Compression

graph.css.c      40026
graph.css.o       9344 (6688)
graph.html.c     13016
graph.html.o      4848 (2186)

With Compression

graph.css.c      10206
graph.css.o       4368 (1718)
graph.html.c      5725
graph.html.o      3632 (971)

Numbers in brackets: .rodata size from 'size -Ax -d *.o'

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:08:05 +02:00
softworkz
e2f39671ae avfilter/avfilter: Add avfilter_link_get_hw_frames_ctx()
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
34bb7f5d87 fftools/ffmpeg_filter: Move some declaration to new header file
to allow filtergraph printing to access the information.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
b71b444a3a fftools/textformat: Add flags param to function avtext_print_integer()
Make this function work analog to avtext_print_string() which already
has a flags parameter.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
bb3a14489e fftools/tf_internal: Use av_default_item_name
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
cee7b8a051 fftools/textformat: Introduce common header and deduplicate code
Also change writer_printf signature in AVTextWriter to use va_list,
so that it can be called by the new function writer_printf()
in tf_internal.h.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
e4830b8c5e fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open()
This allows future addition of options without
changes to the signature of avtext_context_open().

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
4ff90f05c7 fftools/avtextformat: Re-use BPrint in loop
Instead of initializing a new BPrint in case of UTF decode error,
re-use the same BPrint struct and just clear it
for each iteration.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
d225928703 fftools/textformat: Rename name param to key for API consistency
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
4baeb9ffe9 fftools/textformat: Remove unused print_rational() pointer from AVTextFormatter
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
5f90eea8a8 fftools/textformat: Apply quality improvements
Perform multiple improvements to increase code robustness.
In particular:
- favor unsigned counters for loops
- add missing checks
- avoid possible leaks
- move variable declarations to inner scopes when feasible
- provide explicit type-casting when needed

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
softworkz
8f42d90413 fftools/textformat: Apply formatting and whitespace changes
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
Michael Niedermayer
f51c385a8e tools/merge-all-source-plugins: Check that there are no uncommited changes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 16:19:59 +02:00
Michael Niedermayer
a06b86a09b tools/merge-all-source-plugins: Try merging a tag or branch matching the current version
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 16:19:58 +02:00
Michael Niedermayer
12b853530a Add tools/merge-all-source-plugins
Simple script to merge all source plugins.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 12:17:04 +02:00
Michael Niedermayer
23592f942d swscale/output: fix integer overflow in yuv2rgba64_full_1_c_template()
Fixes: signed integer overflow: -293650 * 16525 cannot be represented in type 'int'
Fixes: 408304111/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4762210299871232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:58 +02:00
Michael Niedermayer
05f8c8c4c2 avformat/matroskadec: check that channels fit in signed 32bit int
Fixes: signed integer overflow: -1384566925600903168 * 16 cannot be represented in type 'long'
Fixes: 407069502/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-5159255372267520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:57 +02:00
Michael Niedermayer
8e6db875af avcodec/takdec: Check remaining space for first predictors
Fixes: Timeout
Fixes: 403673829/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5498240154009600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:57 +02:00
Michael Niedermayer
4a9d907b5e avcodec/4xm: Check frame_4cc before allocation
Fixes: Timeout
Fixes: 403402798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5012819292782592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:57 +02:00
Michael Niedermayer
8168ebdcc5 tools/target_dec_fuzzer: Adjust threshold for WEBP
Fixes: Timeout
Fixes: 403345121/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-6408323910139904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:56 +02:00
Michael Niedermayer
c06f5b3ab9 avcodec/svq3: Check there are bits left before decompression
Fixes: out of array read
Fixes: 402587670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-6343867775647744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:56 +02:00
Michael Niedermayer
fd0a792766 avcodec/sonic: Check num_taps
The encoder uses max 128 taps, which is quiet a lot already
If work is done to improve sonic, it will be more radical than changing the taps

Fixes: Timeout
Fixes: 402539974/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-6122944271286272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:56 +02:00
Michael Niedermayer
d28bec8c4d avformat/imf_cpl: fix indention after previous commit 2025-05-15 03:03:55 +02:00
Michael Niedermayer
39800d78b0 avformat/imf_cpl: do not continue looping forever
Fixes: infinite loop
Fixes: 401658595/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5756875014733824
Regression since: 61fa1e14e4

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:55 +02:00
Michael Niedermayer
9fc2702f6f avformat/mov: reject negative ELST durations
Fixes: multiple integer overflows
Fixes: 401016767/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6242067591790592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:55 +02:00
Michael Niedermayer
76e29bb8bf avcodec/dnxuc_parser: Use ff_parse_close()
Fixes: buffer leak
Fixes: 398894512/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6716597473705984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:54 +02:00
Michael Niedermayer
6a47046981 avformat/avidec: Ignore duplicate GAB2
Fixes: memleak
Fixes: 398401912/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-4669849976766464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:54 +02:00
Michael Niedermayer
1a5ed492e5 MAINTAINERS: Add entry for samples-request
This is based on discussion with the GA and its simply the people
who have done or tried to do some uploads recently.

Everyone who has a shell account on ffmpeg.org should have powers to
upload samples.

CC: compn <compn@ffmpeg.org>
CC: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:54 +02:00
Romain Beauxis
a9d39d6eb9 libavformat/oggdec.{c, h}: Implement packet skip on packet return value of 1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:53 +02:00
Romain Beauxis
6d54af6599 libavformat/oggdec.h: Document packet function return value.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:53 +02:00
Andreas Rheinhardt
0d7172a9ff avcodec/cbs: Avoid branch
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:51:34 +02:00
Andreas Rheinhardt
f71d0f0559 avcodec/apv_parser: Mark close as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:51:34 +02:00
Andreas Rheinhardt
d794ecd9d2 avcodec/vulkan_encode_hevc: Fix memleak on error
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:51:28 +02:00
Andreas Rheinhardt
70fa44dfa8 avcodec/vulkan_encode_h264: Fix memleak on error
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:26:07 +02:00
Andreas Rheinhardt
b18aaf209f fftools/ffmpeg_dec: Always receive frames from decoder
Up until now if avcodec_send_packet() returned an error,
no attempt to receive a frame from the decoder would be made.
Instead the decoder was presumed to be drained, so that more
packets could be sent to it. Yet this need not be so:
It can happen that a packet would decode to multiple frames
and that decoding the first of these (the one that is decoded
during the avcodec_send_packet() call) returns an error,
in which case the decoder is not yet ready to receive more
input as the remaining parts of the packet have not been decoded
yet. In this case, an AERROR_BUG is triggered.

This happens in ticket #11553 with VP9 (which uses a BSF
to split VP9 superframes and is therefore affected by this).

Fix this by always calling avcodec_receive_frame() unless
xerror is set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:23:41 +02:00
Andreas Rheinhardt
8588770367 avformat/av1dec: Avoid branch for setting position
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:20:46 +02:00
Andreas Rheinhardt
c914fd2977 avformat/av1dec: Remove redundant avio_tell()
AV1DemuxContext.temporal_unit_size is zero after reading the header,
so the position set when reading the header will not be used at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:20:46 +02:00
Timo Rothenpieler
889e7f2c5c compat/cuda: add device side printf function 2025-05-14 22:08:33 +02:00
James Almer
3f94201324 avformat/iamf_parse: increase PutBytes buffer when writing AAC extradata
We may write up to 43 bits, so 5 bytes is not enough.

Fixes: Assertion n>=0 && n<=32 failed at ./libavcodec/get_bits.h:406
Fixes: 398527871/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6602025714647040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-14 10:32:23 -03:00
Nuo Mi
3004835850 checkasm: hevc sao, use checkasm_check_padded 2025-05-14 20:55:39 +08:00
Nuo Mi
5150d26e0a checkasm: hevc sao_edge, benchmarking inside the width loop is meaningless 2025-05-14 20:55:39 +08:00
Shaun Loo
45bea45c7b checkasm: add vvc_sao
This is a part of Google Summer of Code 2023

AVX2:
 - vvc_sao.sao_band [OK]
 - vvc_sao.sao_edge [OK]
checkasm: all 54 tests passed
vvc_sao_band_8_8_c:                                    157.4 ( 1.00x)
vvc_sao_band_8_8_avx2:                                  30.7 ( 5.12x)
vvc_sao_band_8_10_c:                                   119.4 ( 1.00x)
vvc_sao_band_8_10_avx2:                                 29.2 ( 4.09x)
vvc_sao_band_8_12_c:                                   144.6 ( 1.00x)
vvc_sao_band_8_12_avx2:                                 30.0 ( 4.82x)
vvc_sao_band_16_8_c:                                   446.5 ( 1.00x)
vvc_sao_band_16_8_avx2:                                103.3 ( 4.32x)
vvc_sao_band_16_10_c:                                  399.2 ( 1.00x)
vvc_sao_band_16_10_avx2:                                64.3 ( 6.21x)
vvc_sao_band_16_12_c:                                  472.9 ( 1.00x)
vvc_sao_band_16_12_avx2:                                56.5 ( 8.37x)
vvc_sao_band_32_8_c:                                  2430.9 ( 1.00x)
vvc_sao_band_32_8_avx2:                                203.3 (11.96x)
vvc_sao_band_32_10_c:                                 1405.7 ( 1.00x)
vvc_sao_band_32_10_avx2:                               208.5 ( 6.74x)
vvc_sao_band_32_12_c:                                 2054.3 ( 1.00x)
vvc_sao_band_32_12_avx2:                               213.0 ( 9.64x)
vvc_sao_band_48_8_c:                                  3835.4 ( 1.00x)
vvc_sao_band_48_8_avx2:                                604.2 ( 6.35x)
vvc_sao_band_48_10_c:                                 3624.6 ( 1.00x)
vvc_sao_band_48_10_avx2:                               468.8 ( 7.73x)
vvc_sao_band_48_12_c:                                 3752.4 ( 1.00x)
vvc_sao_band_48_12_avx2:                               477.5 ( 7.86x)
vvc_sao_band_64_8_c:                                  6061.1 ( 1.00x)
vvc_sao_band_64_8_avx2:                                803.9 ( 7.54x)
vvc_sao_band_64_10_c:                                 6142.5 ( 1.00x)
vvc_sao_band_64_10_avx2:                               827.3 ( 7.43x)
vvc_sao_band_64_12_c:                                 6106.6 ( 1.00x)
vvc_sao_band_64_12_avx2:                               839.9 ( 7.27x)
vvc_sao_band_80_8_c:                                  9478.0 ( 1.00x)
vvc_sao_band_80_8_avx2:                               1516.7 ( 6.25x)
vvc_sao_band_80_10_c:                                10300.5 ( 1.00x)
vvc_sao_band_80_10_avx2:                              1298.7 ( 7.93x)
vvc_sao_band_80_12_c:                                 8941.1 ( 1.00x)
vvc_sao_band_80_12_avx2:                              1315.3 ( 6.80x)
vvc_sao_band_96_8_c:                                 13351.5 ( 1.00x)
vvc_sao_band_96_8_avx2:                               1815.4 ( 7.35x)
vvc_sao_band_96_10_c:                                13197.5 ( 1.00x)
vvc_sao_band_96_10_avx2:                              1872.4 ( 7.05x)
vvc_sao_band_96_12_c:                                11969.0 ( 1.00x)
vvc_sao_band_96_12_avx2:                              1895.8 ( 6.31x)
vvc_sao_band_112_8_c:                                19936.9 ( 1.00x)
vvc_sao_band_112_8_avx2:                              2802.3 ( 7.11x)
vvc_sao_band_112_10_c:                               19534.9 ( 1.00x)
vvc_sao_band_112_10_avx2:                             2635.0 ( 7.41x)
vvc_sao_band_112_12_c:                               16520.6 ( 1.00x)
vvc_sao_band_112_12_avx2:                             2591.8 ( 6.37x)
vvc_sao_band_128_8_c:                                25967.5 ( 1.00x)
vvc_sao_band_128_8_avx2:                              3155.3 ( 8.23x)
vvc_sao_band_128_10_c:                               24002.6 ( 1.00x)
vvc_sao_band_128_10_avx2:                             3374.6 ( 7.11x)
vvc_sao_band_128_12_c:                               20829.4 ( 1.00x)
vvc_sao_band_128_12_avx2:                             3377.0 ( 6.17x)
vvc_sao_edge_8_8_c:                                    174.6 ( 1.00x)
vvc_sao_edge_8_8_avx2:                                  37.0 ( 4.72x)
vvc_sao_edge_8_10_c:                                   174.4 ( 1.00x)
vvc_sao_edge_8_10_avx2:                                 58.5 ( 2.98x)
vvc_sao_edge_8_12_c:                                   171.1 ( 1.00x)
vvc_sao_edge_8_12_avx2:                                 58.5 ( 2.93x)
vvc_sao_edge_16_8_c:                                   677.7 ( 1.00x)
vvc_sao_edge_16_8_avx2:                                 72.2 ( 9.39x)
vvc_sao_edge_16_10_c:                                  724.8 ( 1.00x)
vvc_sao_edge_16_10_avx2:                               106.4 ( 6.81x)
vvc_sao_edge_16_12_c:                                  647.0 ( 1.00x)
vvc_sao_edge_16_12_avx2:                               106.6 ( 6.07x)
vvc_sao_edge_32_8_c:                                  3001.8 ( 1.00x)
vvc_sao_edge_32_8_avx2:                                157.6 (19.04x)
vvc_sao_edge_32_10_c:                                 3071.1 ( 1.00x)
vvc_sao_edge_32_10_avx2:                               404.2 ( 7.60x)
vvc_sao_edge_32_12_c:                                 2698.6 ( 1.00x)
vvc_sao_edge_32_12_avx2:                               398.8 ( 6.77x)
vvc_sao_edge_48_8_c:                                  6557.7 ( 1.00x)
vvc_sao_edge_48_8_avx2:                                380.1 (17.25x)
vvc_sao_edge_48_10_c:                                 6319.9 ( 1.00x)
vvc_sao_edge_48_10_avx2:                               896.3 ( 7.05x)
vvc_sao_edge_48_12_c:                                 6306.4 ( 1.00x)
vvc_sao_edge_48_12_avx2:                               885.5 ( 7.12x)
vvc_sao_edge_64_8_c:                                 11510.7 ( 1.00x)
vvc_sao_edge_64_8_avx2:                                504.1 (22.84x)
vvc_sao_edge_64_10_c:                                10917.4 ( 1.00x)
vvc_sao_edge_64_10_avx2:                              1608.3 ( 6.79x)
vvc_sao_edge_64_12_c:                                11499.8 ( 1.00x)
vvc_sao_edge_64_12_avx2:                              1586.4 ( 7.25x)
vvc_sao_edge_80_8_c:                                 18193.2 ( 1.00x)
vvc_sao_edge_80_8_avx2:                                930.2 (19.56x)
vvc_sao_edge_80_10_c:                                17984.3 ( 1.00x)
vvc_sao_edge_80_10_avx2:                              2420.9 ( 7.43x)
vvc_sao_edge_80_12_c:                                18289.4 ( 1.00x)
vvc_sao_edge_80_12_avx2:                              2412.1 ( 7.58x)
vvc_sao_edge_96_8_c:                                 26361.8 ( 1.00x)
vvc_sao_edge_96_8_avx2:                               1118.4 (23.57x)
vvc_sao_edge_96_10_c:                                26162.2 ( 1.00x)
vvc_sao_edge_96_10_avx2:                              3666.9 ( 7.13x)
vvc_sao_edge_96_12_c:                                25926.6 ( 1.00x)
vvc_sao_edge_96_12_avx2:                              3433.9 ( 7.55x)
vvc_sao_edge_112_8_c:                                36562.9 ( 1.00x)
vvc_sao_edge_112_8_avx2:                              1741.0 (21.00x)
vvc_sao_edge_112_10_c:                               38126.4 ( 1.00x)
vvc_sao_edge_112_10_avx2:                             5153.3 ( 7.40x)
vvc_sao_edge_112_12_c:                               36345.7 ( 1.00x)
vvc_sao_edge_112_12_avx2:                             4684.9 ( 7.76x)
vvc_sao_edge_128_8_c:                                46379.8 ( 1.00x)
vvc_sao_edge_128_8_avx2:                              2012.4 (23.05x)
vvc_sao_edge_128_10_c:                               47029.5 ( 1.00x)
vvc_sao_edge_128_10_avx2:                             6162.2 ( 7.63x)
vvc_sao_edge_128_12_c:                               49647.3 ( 1.00x)
vvc_sao_edge_128_12_avx2:                             6127.1 ( 8.10x)

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2025-05-14 20:55:39 +08:00
Shaun Loo
bed1769957 x86/vvcdec: sao, add avx2 support
This is a part of Google Summer of Code 2023

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2025-05-14 20:55:39 +08:00
Shaun Loo
69f63c6210 x86/hevcdec: refact, remove duplicate code in HEVC_SAO_{BAND, EDGE}_FILTER
This is a part of Google Summer of Code 2023

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2025-05-14 20:55:39 +08:00
Shaun Loo
dbd859a186 x86/hevcdec: sao, refact out h26x macros
This is a part of Google Summer of Code 2023

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2025-05-14 20:55:39 +08:00
Nuo Mi
62f3d7e027 x86/vvcdec: misc, reordered functions in dsp_init for improved readability 2025-05-14 20:55:39 +08:00
James Almer
038314bc6b avcodec/exr: reindent after the previous change
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-14 00:17:02 -03:00
Mark Thompson
527d5eaec7 apv_decode: Discard invalid run codes earlier
Caught by ubsan - would cause an invalid shift in constructing the
run value.
2025-05-13 20:52:35 +01:00
Mark Thompson
1753d41d4e fate: Add test for APV 400-10 profile
Same setup as the 422-10 profile test, using the same content.  FFmpeg
decoder output is identical to the reference decoder output.
2025-05-13 19:38:08 +01:00
Mark Thompson
1ad57a847e lavc: Add unit test for APV entropy decode 2025-05-13 19:37:53 +01:00
Mark Thompson
a3c8fba5da apv_decode: Multisymbol entropy decode 2025-05-13 19:37:49 +01:00
Michael Niedermayer
9980a0b9b1 avformat/iamfdec: Check side_substream_id before use
Fixes: poc-iamf-2025-04

Found-by: 苏童 <220235212@seu.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-13 00:26:24 +02:00
Michael Niedermayer
74fd2c3ddb avcodec/h264_mb: Fix tmp_cr for arm
When decoding a bitstream with weighted-bipred enabled,
the results on ARM and x86 platforms may differ.

The reason for the inconsistency is that the value of
STRIDE_ALIGN differs between platforms. And STRIDE_ALIGN
is set to the buffer stride of temporary buffers for U
and V components in mc_part_weighted.

If the buffer stride is 32 or 64 (as on x86 platforms),
the U and V pixels can be interleaved row by row without
overlapping, resulting in correct output.
However, on ARM platforms where the stride is 16,
the V component did overwrite part of the U component's pixels,
leading to incorrect predicted pixels.

The bug can be reproduced by the following bitstream.

https://trac.ffmpeg.org/attachment/ticket/11357/inter_weighted_bipred2.264

Fixes: ticket 11357
Commit-msg-mostly-by: Bin Peng <pengbin@visionular.com>
Reviewed-by: Bin Peng <pengbin@visionular.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-13 00:20:23 +02:00
Michael Niedermayer
fd5a3c5fed avcodec/vorbisdec: Dont treat overread as error
This differs from libvorbis by
stddev:    2.44 PSNR: 88.58 MAXDIFF:   41 bytes:   834304/   834304
for the file from the ticket

Fixes: Ticket11427

Regression since: dc89cf804a

This is a similar solution to what james proposed earlier in
[FFmpeg-devel] [PATCH] avcodec/vorbisdec: don't abort on EOD when decoding residuals

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-13 00:08:02 +02:00
xiongweixiao
8ce32a7cbb lavf: vvc_probe: lower probe score for invalid SPS/PPS/IRAP order to avoid misdetection of mp3 as VVC
The current vvc_probe function checks for SPS, PPS, and IRAP NAL units but does not enforce their detection order. This can lead to false positives when PPS or IRAP appear before SPS, causing malformed or non-compliant bitstreams to be incorrectly identified as valid VVC streams.

This commit modifies the logic to use boolean flags and enforces the correct detection sequence: SPS must be detected before PPS, and PPS before IRAP. This ensures more accurate probing and prevents invalid bitstreams from being misidentified.

For streams with wrong ordering a lower score is returned

This change addresses issues reported in:
- https://trac.ffmpeg.org/ticket/11496
- https://trac.ffmpeg.org/ticket/11087

Signed-off-by: xiongweixiao <xiongweixiaoxxw@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-12 11:07:35 +02:00
Zhao Zhili
1cda5fe3fd avformat/hls: Return error code when read key file failed
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-05-12 13:03:18 +08:00
Marton Balint
4014784b62 fftools/ffmpeg: move elapsed time counter to the end of the status line
Elapsed time is much less important than the actual progress, and I am guessing
several ffmpeg CLI frontends use the existing status line for showing progress,
so putting a new field in the beginning is less optimal anyway.

Related to ticket #11582.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-11 18:41:55 +02:00
Marton Balint
ce01c7fb58 avformat/wavdec: increase requested probe score for codec probe
Codec probing was primarily added to the wav demuxer to support DTS-in-wav
files, but DTS probing functions return AVPROBE_SCORE_EXTENSION+1, so we can be
a bit more strict with the required score.

This fixes MP3 misdetections for some wav files.

Fixes ticket #11581.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-05-11 18:41:55 +02:00
Michael Niedermayer
4e5523c985 avcodec/hevc/ps: Fix dependant layer id check
Fixes: shift exponent 49 is too large for 32-bit type 'int'
Fixes: 398060145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5023082406543360

Reviewed-by: James Almer <jamrial@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-09 22:27:04 +02:00
Michael Niedermayer
9230c93cc9 avcodec/rv60dec: inter also fails with qp >= 32
Fixes: out of array read in decode_cu_16x16()
Fixes: 398049430/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5525836849807360

Reviewed-by: Peter Ross <pross@xvid.org>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-09 22:27:04 +02:00
Michael Niedermayer
ce1fd73d63 avformat/iff: Check nb_channels == 0 in MHDR
Fixes: division by 0
Fixes: 395163171/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-542604339373670

Reviewed-by: Peter Ross <pross@xvid.org>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-09 22:27:04 +02:00
Michael Niedermayer
43926e026d avcodec/mmvideo: fix palette index
Fixes: 391935573/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MMVIDEO_fuzzer-4655048979709952
Fixes: out of array access

Reviewed-by: Peter Ross <pross@xvid.org>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-09 22:26:51 +02:00
Marvin Scholz
aeea2defe4 avformat/apvdec: remove unused variable 2025-05-09 12:17:09 -04:00
Manuel Lauss
37064b2d16 avcodec/sanm: support "StarWars - Making Magic" video
Videos of "StarWars - Making Magic" consist of 640x480 codec3 frames
which establish a background, and a 320x240 codec48 video put on top
at random left/top offsets.

To support this, a new default buffer "fbuf", which holds the final
image to be presented, is added, since codec37/47/48 need their 2/3 buffers
to be private to themselves.  The decoded result is then copied to the fbuf,
honoring the left/top offsets if required.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-05-09 07:29:15 +02:00
Manuel Lauss
9369ebf238 avcodec/sanm: recognize common FOBJ sizes
Change the size detection a bit to recognize common video sizes,
as the FOBJ codecs>=37 cannot always be trusted, since they can
be embedded in a larger frame.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-05-09 07:29:13 +02:00
Manuel Lauss
7f0b7b0496 avcodec/sanm: ignore codec48 compression type 6
Some videos of "StarWars - Making Magic" have this subcompression
type: data just consists of the 16 byte codec48 header; the DOS player
and the c48 decoder in the "Mysteries of the Sith" game engine ignore it.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-05-09 07:29:08 +02:00
James Almer
244ad944e9 avcodec/liboapvenc: remove 4:4:4 support until it's properly handled
liboapv will seemingly encode correct 4:4:4 output, but report profile_idc 33, which
is specifically the profile value for 4:2:2 10bit.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-07 21:40:08 -03:00
Michael Niedermayer
1b643e3f65 tests/fate/filter-video: Fix dependancy for codecview
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-07 15:35:48 +02:00
Michael Niedermayer
8c920c4c39 Remove libpostproc
Libpostproc will be available as source plugin at
https://github.com/michaelni/FFmpeg/tree/sourceplugin-libpostproc
OR
https://github.com/michaelni/libpostproc

whatever turns out more convenient to maintain

For the upcoming 8.0 release, libpostproc will be included, so as not to
cause delays or inconveniences

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-07 15:35:47 +02:00
Max Rudolph
9537d91e8f avformat/cinedec: add support for additional Bayer CFA patterns for Phantom CINE file format
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-07 15:35:47 +02:00
Link Mauve
d5f4a55123 avutil/hwcontext_vulkan: Query the correct format
In the call to vkGetPhysicalDeviceImageFormatProperties2(), we were
previously requesting the properties of the first fallback format (e.g.
VK_FORMAT_R8_UNORM for VK_FORMAT_G8_B8R8_2PLANE_420_UNORM) instead of
the actual format in use.

We don’t do anything with it afterwards, but there is no reason to keep
querying the wrong format.
2025-05-07 15:16:58 +02:00
Tobias Rapp
0f751d3836 avfilter/vf_setparams: Fix chroma_location being cleared
Fix chroma_location being cleared by setrange and setfield filters.
This was forgotten in 201f1cba15.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2025-05-07 10:52:44 +02:00
James Almer
2b6303762f tests/fate/cbs: add tests for APV
Ensure bitexact passthrough using the apv_metadata bsf.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 18:05:38 -03:00
Michael Niedermayer
c644720e68 postproc/tests/.gitignore: Add temptest
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-05 19:13:29 +02:00
Michael Niedermayer
e5640e67d0 libpostproc/tests: Factor ff_chksum() out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-05 19:13:29 +02:00
Mark Thompson
9bf54cdb19 cbs_apv: Check tile component sizes
It was possible for the buffer pointers for the last tile to go over the
end of the unit buffer leading to a read overflow during decode of the
macroblock layer.  Check all tile component sizes to prevent this case
and also catch related tile size mismatch errors earlier.
2025-05-05 17:22:57 +01:00
Mark Thompson
ea457e54e1 apv_entropy: Improve robustness to bitstream errors 2025-05-05 17:22:57 +01:00
Mark Thompson
2aa2095bb4 cbs_apv: Better constrain tile_width/height_in_mbs
The maximum number of tile columns/rows adds an extra constraint on
the minimum tile width/height for large frames (over 5120 width or
2560 height).
2025-05-05 17:22:57 +01:00
Mark Thompson
1a9a2bafc8 apv_decode: Improve reporting of decode errors
Halt tile component decoding at the first entropy error (this will be a
desync and is not recoverable).  If any tile components contain errors
then discard the frame unless the output-corrupt flag is set.

Also fixes CID 1646764, which is the error case where the tile component
is too large for get_bits to handle.
2025-05-05 17:22:57 +01:00
Mark Thompson
5acd2145a4 apv_decode: Fix memory leak on decode error 2025-05-05 17:22:57 +01:00
Mark Thompson
135acc8e61 cbs_apv: Always restore tracing state on split fragment error
Fixes CID 1646769.
2025-05-05 17:22:57 +01:00
James Almer
a9557c1f26 avcodec/apv_decode: build the lut table only once
No reason to build the exact same table once per decoding thread.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 13:19:29 -03:00
James Almer
0af1d69959 avcodec/hevc/hevcdec: move the slice header buffer overread check up in the function
Abort as soon as we're done reading the slice header instead of running extra checks
that assume slice data may follow.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 12:55:03 -03:00
James Almer
d34c738435 avcodec/hevc/hevcdec: ensure a bit was read when checking for alignment_bit_equal_to_one
Prevents printing bogus errors about the value being 0, when in fact we
overread the available slice buffer.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-05 12:55:03 -03:00
Andreas Rheinhardt
62f7b43b53 tests/api/api-dump-stream-meta-test: Fix leaks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-05 17:03:39 +02:00
Martin Storsjö
f4e72eb5a3 configure: Enable -fno-common for Darwin targets, avoid linker warnings
Since GCC 10 and llvm.org Clang 11, -fno-common is the default.
However Apple's Xcode Clang hasn't followed suit yet, and still
defaults to -fcommon.

Compiling with -fcommon causes uninitialized global variables to
be treated as "common" (which allows multiple object files to have
similar definitions).

Common variables seem to have the issue that their intended alignment
isn't signaled, so the linker assumes that they may need alignment
according to their full size.

With large global tables, this can lead to linker warnings like
this, with Xcode 16.3:

    ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 0x4000 because it exceeds segment maximum alignment

This can be reproduced with a small snippet like this:

    char table[16385];
    int main(int argc, char* argv[]) { return 0; }

Compiling with -fno-common avoids this issue and warning, and
matches the default behaviour of other compilers. (Compiling with
-fno-common also avoids the risk of accidentally accepting
duplicate definitions of global variables, as long as they are
uninitialized.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-05-05 11:35:11 +03:00
James Almer
a0349d64fd avformat/apvdec: also look for an au_info PBU during probing
If present, an Access unit information PBU must be the first in an AU.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:26:57 -03:00
James Almer
d08c5527cf avcodec/exr: add support for half-float DWAA/B compression
Fixes ticket #11555.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:22:28 -03:00
James Almer
0cabfdc8bc avcodec/apv_parser: use an AVBufferRef to avoid data copying
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:22:14 -03:00
James Almer
4bfe9c5663 avcodec/cbs: add an AVBufferRef input argument to ff_cbs_read()
To allow taking a reference from an existing buffer outside of AVPackets.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:22:14 -03:00
Dawid Kozinski
fab691edaf avcodec: add APV encoder using liboapv
Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:21:35 -03:00
Michael Niedermayer
7faa560f1a postproc/tests/blocktest: Test several filter combinations
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:27 +02:00
Michael Niedermayer
fc3035e3c4 postproc/tests/blocktest: initialize qp array randomly to for testing
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:26 +02:00
Michael Niedermayer
71e25beb5c postproc/tests/blocktest: use dimensions
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:26 +02:00
Michael Niedermayer
fd9adbdbfb postproc/postprocess_template: fix dering with a 16x16 image
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:26 +02:00
Michael Niedermayer
d153b00534 postproc/tests/stripetest: use dimensions
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:25 +02:00
Michael Niedermayer
917c15435a libpostproc: check minimum size
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:25 +02:00
Michael Niedermayer
26bbca84de postproc/tests: Add test for temporal denoise
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:25 +02:00
Michael Niedermayer
75be669ca1 avformat/hls: Fix flash1.bogulus.cfd support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:24 +02:00
Michael Niedermayer
f99f223eb1 avformat/hls: Split allowed_segment_extensions off allowed_extensions
This allows the user to set only the one that is needed to ALL or a
specific "wrong" extension like html

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-03 18:48:24 +02:00
softworkz
1dbc5675c1 fftools/ffprobe: Disable stderr buffering on Windows
An identical call exists in ffmpeg.c

With POSIX/glibc, stderr is already unbuffered (or line-buffered when
a terminal is connected), but not in case of MSVCRT.
Explicitly calling setvbuf() like in this commit, makes the Windows
runtime behave like POSIX, giving the same “print immediately” behavior.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:58:08 +02:00
softworkz
b322640b4f fftools/ffmpeg: Log exit code on exit
When viewing logs, there are situations where it is not entirely
clear whether ffmpeg CLI has exited gracefully. The two primary cases
are

- A crash/segfault has occured
  Windows for example doesn't output any message to the calling shell
- The process has been terminated (e.g. killed externally)

Printing a message on exit provides a reliable indication that the
process has exited normally.
Printing the exit code is useful as it usually remains invisible
and unnoticed by users running FFmpeg from a shell.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:57:27 +02:00
softworkz
26429eee22 libavformat/asfdec: Fix regression bug when reading image attachments
Commit c8140fe732 had introduced
a check for value_len > UINT16_MAX.
As a consequence, attached images of sizes larger than UINT16_MAX
could no longer be read.

This is a minimal fix of the regression, avoiding the controversies
of my earlier submission regarding int type handling in asfdec.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:57:15 +02:00
softworkz
1a083a4d90 fftools/ffmpeg: Include elapsed-time in print_report()
It's a highly useful metric, both at runtime and when viewing logs.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:57:01 +02:00
softworkz
7a05f57250 avutil/opt: Print default option value for AV_OPT_TYPE_INT64
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:56:46 +02:00
softworkz
3a93fadac1 avformat/dump: Stream start offsets: change precision and label
- Change precision to 6 digits to align with other printed times
- Change label to just "Start"
- Add 's' unit to format 'start' value for consistency

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-03 07:56:04 +02:00
James Almer
33d0d1c672 avformat/apvdec: don't fill container level fields with codec level info
This is a raw demuxer, it should not read codec level information and export it
as container level information.
The generic demux code will use the recently introduced parser to take care of
that.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 22:42:41 -03:00
James Almer
c4ea4abec2 avcodec: add an APV parser
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 22:42:34 -03:00
James Almer
8ebccdf2a4 avformat/av1dec: fix setting AVPacket->pos in Annex-B demuxer
This demuxers reads encapsulation bytes before reading codec data into the
output packets, so take such offset into consideration.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 14:24:04 -03:00
Lynne
707c04fe06 ffv1enc_vulkan: support 8 and 16-bit 2-plane YUV formats
This adds support for all 8-bit and 16-bit 2-plane formats.
P010 and others require more work as the data's LSB-padded.
2025-05-01 09:34:44 +02:00
Lynne
33a4d36101 hwcontext_vulkan: support AV_PIX_FMT_GBRP
Support was partially added previously in vulkan.c, but now it's fully
supported.
2025-05-01 09:34:44 +02:00
Lynne
9c0349cca1 aacdec_usac: correct Mps212 parsing location
It gets parsed after SBR, even if there is no SBR.
2025-05-01 09:34:39 +02:00
James Almer
e80f32f3bd avcodec/cbs_apv: don't return an error when reading empty buffers
The output will be a fragment with zero units, which is a lot more user friendly
than making them think something went wrong, as it already happens with cbs_av1.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-30 19:15:19 -03:00
Mark Thompson
a8bae9b18d fate: Add test for APV 422-10 profile
Bitstream generated using the reference encoder, then edited to fix the
colour description and an extra metadata block added.  FFmpeg decoder
output is identical to the reference decoder output.

The content used is the first three frames of "Waterfall" from the SVT
Open Content Video Test Suite 2022.  This is copyright Sveriges
Television AB and is used under the Creative Commons Attribution 4.0
International License.
2025-04-30 22:57:56 +01:00
Mark Thompson
585455f7b3 apv_decode: Replace division with shift
The compiler can't see that this should be a shift and generates a real
division which is slow enough to appear in profiles on its own.
2025-04-30 22:57:56 +01:00
Andreas Rheinhardt
0b588bfb51 avcodec/apv_dsp: Fix left-shift of negative value
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:38:21 +02:00
Andreas Rheinhardt
c681d8e8a8 avformat/apvdec: Remove inappropriate INIT_CLEANUP flag
The init-cleanup flag makes no sense for a demuxer without
a read_close() function.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:34:47 +02:00
Andreas Rheinhardt
f98c63e417 avformat/apvdec: Fix seeking
pkt->pos pointed to the actual packet data, not to the start
of the access unit.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:34:28 +02:00
Andreas Rheinhardt
8279d02cf1 avformat/apvdec: Check before access
The signature check would segfault in case the packet could not
be allocated or if nothing could be read.
Furthermore, read_packet callbacks are supposed to return zero
on success, yet the current code returned the size of the packet.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:33:39 +02:00
Andreas Rheinhardt
0a12b84d3b avformat/apvdec: Use ffio_read_size()
Fixes potential use of uninitialized data.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-30 23:32:55 +02:00
Michael Niedermayer
48c0dba23b avformat/hls: Fix Youtube AAC
Fixes: Ticket11435
Fixes: yt-dlp -f 234+270 https://www.youtube.com/live/l8PMl7tUDIE

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-30 00:06:17 +02:00
Romain Beauxis
2431fd0b27 tests: Add stream dump test API util, use it to dump stream data for chained ogg/{vorbis, opus, flac} streams.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-30 00:03:00 +02:00
Michael Niedermayer
d82016c730 avformat/hls: add fmp4 to allowed_extensions
Fixes: yt-dlp/issues/12700

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:24 +02:00
Michael Niedermayer
68644994fd avformat/hls: Add ec3 to allowed_extensions
Fixes part of Ticket11435
Fixes: Elisa Viihde (Finnish online recording service)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:24 +02:00
Michael Niedermayer
0da6ddfc01 avformat/hls: Point user to how to easily contribute a fix for missing extensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:23 +02:00
Michael Niedermayer
2352145e41 avformat/hls: Add cmfv and cmfa to allowed_extensions
Fixes: www.nicovideo.jp
Fixes: Ticket11526
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:23 +02:00
Shiyou Yin
ab8e160f71 avcodec: Fix fate-checkasm-hevc_pel failed on LA.
Some loop counters were initialized incorrectly.
This patch enhances the handling of loop iterations and residual parts.

Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-29 22:59:23 +02:00
Gyan Doshi
d9bd8e9eb1 doc/ffprobe: remove entry for show_format_entry
The option was removed in 1dd6363581.
2025-04-29 14:42:01 +05:30
Zhao Zhili
9187f40e92 avformat/http: Ensure same protocol in ff_http_do_new_request2
This can happen for HLS with AES-128 at the middle of m3u8, so old
protocol is https while new protocol is crypt+https.

And change the log level from ERROR to INFO when protocol/host/port
don't match. User should prepared for this function to fail and
retry with new connection.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-29 15:25:46 +08:00
Zhao Zhili
bb0c4649fb avformat/hls: Fix get key file error
The offset and end_offset options are meant for segment, not for key.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-29 15:25:41 +08:00
Zhao Zhili
25812d3033 avcodec/bsf/h264_mp4toannexb: Fix mixed bitstream format
This bsf converts AV_PKT_DATA_NEW_EXTRADATA side data in avcc format
to in-band annexb format. However, the side data wasn't been removed
and copied from input packet to output packet. So the output packet
has mixed bitstream format. We don't support mixed bitstream format.
For example, h264_metadata report error in the following case:

ffmpeg -i foo.flv \
  -bsf:v "h264_mp4toannexb,h264_metadata" \
  -c copy -f null

This patch removed NEW_EXTRADATA side data after process.

This patch also add a check so only NEW_EXTRADATA in avcc format is
processed. NEW_EXTRADATA in annexb format is copied to output as is.

Reported-by: jiangjie <jiangjie618@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-29 15:25:08 +08:00
Zhao Zhili
26752368f0 aarch64/h26x: Add put_hevc_pel_bi_w_pixels
On rpi5 (A76):

put_hevc_pel_bi_w_pixels4_8_c:                          90.0 ( 1.00x)
put_hevc_pel_bi_w_pixels4_8_neon:                       34.1 ( 2.64x)
put_hevc_pel_bi_w_pixels6_8_c:                         188.3 ( 1.00x)
put_hevc_pel_bi_w_pixels6_8_neon:                       73.5 ( 2.56x)
put_hevc_pel_bi_w_pixels8_8_c:                         327.1 ( 1.00x)
put_hevc_pel_bi_w_pixels8_8_neon:                       75.8 ( 4.32x)
put_hevc_pel_bi_w_pixels12_8_c:                        728.8 ( 1.00x)
put_hevc_pel_bi_w_pixels12_8_neon:                     186.1 ( 3.92x)
put_hevc_pel_bi_w_pixels16_8_c:                       1288.1 ( 1.00x)
put_hevc_pel_bi_w_pixels16_8_neon:                     268.5 ( 4.80x)
put_hevc_pel_bi_w_pixels24_8_c:                       2855.5 ( 1.00x)
put_hevc_pel_bi_w_pixels24_8_neon:                     723.8 ( 3.95x)
put_hevc_pel_bi_w_pixels32_8_c:                       5095.3 ( 1.00x)
put_hevc_pel_bi_w_pixels32_8_neon:                    1165.0 ( 4.37x)
put_hevc_pel_bi_w_pixels48_8_c:                      11521.5 ( 1.00x)
put_hevc_pel_bi_w_pixels48_8_neon:                    2856.0 ( 4.03x)
put_hevc_pel_bi_w_pixels64_8_c:                      21020.5 ( 1.00x)
put_hevc_pel_bi_w_pixels64_8_neon:                    4699.1 ( 4.47x)

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-29 15:24:14 +08:00
Zhao Zhili
39786f8cd5 aarch64/h26x: optimize sao_band_filter
int8_t[] is enough for offset_table of 8 bit streams.

On rpi5:
                             Before               After
hevc_sao_band_8_8_c:          252.3 ( 1.00x)     252.3 ( 1.00x)
hevc_sao_band_8_8_neon:        95.8 ( 2.63x)      61.0 ( 4.57x)
hevc_sao_band_16_8_c:         875.2 ( 1.00x)     864.9 ( 1.00x)
hevc_sao_band_16_8_neon:      317.5 ( 2.76x)     150.0 ( 6.26x)
hevc_sao_band_32_8_c:        3853.5 ( 1.00x)    3871.6 ( 1.00x)
hevc_sao_band_32_8_neon:     1222.3 ( 3.15x)     550.6 ( 7.39)
hevc_sao_band_48_8_c:        8203.6 ( 1.00x)    8182.6 ( 1.00x)
hevc_sao_band_48_8_neon:     2685.7 ( 3.05x)    1185.8 ( 7.36x)
hevc_sao_band_64_8_c:       14023.0 ( 1.00x)   14038.9 ( 1.00x)
hevc_sao_band_64_8_neon:     4783.2 ( 2.93x)    2078.4 ( 7.15x)

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-29 15:11:45 +08:00
Zhao Zhili
ca964ba139 avformat/mov: Reduce seek when interleaved_read is disabled
Don't select sample with small dts when interleaved_read is disabled.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-29 14:35:09 +08:00
Andreas Rheinhardt
d11d4277f9 postproc/tests: Add test tools to .gitignore
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-28 16:56:44 +02:00
Andreas Rheinhardt
fcc562693e avcodec/apv_decode: Remove redundant log message
ff_thread_get_buffer() already emits its own logmessage.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-27 23:00:10 +02:00
Andreas Rheinhardt
e2fcf234e4 avcodec/apv_decode: Fix shadowing
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-27 23:00:07 +02:00
Andreas Rheinhardt
431c0f305d avformat/apvenc: Add AVFMT_NOTIMESTAMPS flag
This is a raw format.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-27 23:00:02 +02:00
Andreas Rheinhardt
aa50d2eca2 avformat/apvenc: Remove unused header
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-27 22:59:59 +02:00
Andreas Rheinhardt
7fd796c600 avformat/apvenc: Only allow APV
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-27 22:59:40 +02:00
Mark Thompson
8ea11dcd84 Changelog, doc: Add entries for new APV features 2025-04-27 15:52:30 +01:00
Mark Thompson
b511c767d0 lavf: APV muxer 2025-04-27 15:52:30 +01:00
Mark Thompson
de42e06b5b lavc: APV metadata bitstream filter 2025-04-27 15:52:30 +01:00
Mark Thompson
d03c99441d lavc/apv: AVX2 transquant for x86-64
Typical checkasm result on Alder Lake:

decode_transquant_8_c:                                 464.2 ( 1.00x)
decode_transquant_8_avx2:                               86.2 ( 5.38x)
decode_transquant_10_c:                                481.6 ( 1.00x)
decode_transquant_10_avx2:                              83.5 ( 5.77x)
2025-04-27 15:52:30 +01:00
Mark Thompson
483cadf8d7 lavc: APV decoder 2025-04-27 15:52:30 +01:00
Mark Thompson
324330a11e lavf: APV demuxer
Demuxes raw streams as defined in draft spec section 10.2.
2025-04-27 15:52:30 +01:00
Mark Thompson
821717c3fe lavc/cbs: APV support 2025-04-27 15:52:30 +01:00
Mark Thompson
0c79a091e4 lavc: APV codec ID and descriptor 2025-04-27 15:52:30 +01:00
Michael Niedermayer
fb36f170de avcodec/ffv1enc: Eliminate fabs()
Fixes: warning: using floating point absolute value function 'fabs' when argument is of integer type
No change in output
Changing variables to float worsens compression significantly

Found-by: ePirat
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-27 05:04:35 +02:00
Michael Niedermayer
716c3986c6 fate: add stripetest
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-27 05:04:34 +02:00
Michael Niedermayer
342869ad7c tests: Add libpostproc blocktest
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-27 05:04:34 +02:00
Michael Niedermayer
142eb90f07 postproc/postprocess_template: fix handling of first row of dering_C
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-27 05:04:34 +02:00
Michael Niedermayer
0118f392be postproc/postprocess_template: Fix reading uninitialized pixels in dering_C()
This issue was found through the new blocktest

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-27 05:04:19 +02:00
James Almer
8bb682d454 avcodec/x86/constants: add pd_64
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-25 23:20:58 -03:00
Andreas Rheinhardt
6dd83fab44 avformat: Use ffio_read_size() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:22:20 +02:00
Andreas Rheinhardt
122f86d859 avcodec/magicyuv: Simplify check for RGB
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:38 +02:00
Andreas Rheinhardt
7c7e161437 avcodec/magicyuv: Set properties via AVPixFmtDescriptor
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:38 +02:00
Andreas Rheinhardt
c33f16db1b avcodec/webp: Avoid loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:38 +02:00
Andreas Rheinhardt
e0a05456cd avcodec/webp: Combine allocations
Or avoid them altogether for the small stage-one VLC.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
1fc0ee484f avcodec/webp: Check before allocations
Avoids freeing lateron.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
e0df21b8c3 avcodec/webp: Switch to ff_vlc_init_from_lengths()
The earlier code would traverse over the code lengths
mutliple times (namely max_length + 1 times - once to get
the maximum length and once for each max_length to assign
codes) before calling ff_vlc_init_sparse() (which may traverse
them twice and sort them). The new code only traverses them once
(+ the one time in ff_vlc_init_from_lengths()).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
d60445258c avcodec/webp: Check more directly for invalid codes
Don't rely on invalid codes leading to get_vlc2() returning
-1, which then gets converted to an uint8_t, i.e. to 255
and runs afoul of a length check later. After all, get_vlc2()
could be changed to return something else which may
be valid when cast to uint8_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
6676038b23 avcodec/cbs: Use put_bits63()
It is better when BUF_BITS == 64 (i.e. on x64), because
the underlying put_bits can then handle 0..63 bits naturally.
It does not worsen the code when BUF_BITS != 64, because
the compiler can optimize this to the same code as now
(due to the assert).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
a2acb46a6e avcodec/vp6: Forward error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
be7495c32c avcodec/vp6: Use fewer number of bits in run VLCs
Given that these trees have only nine elements and are complete,
their depth is <= eight.

Also remove the now unused FF_HUFFMAN_BITS constant.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
e946ba64bf avcodec/vp6: Don't reload unnecessarily often in get_vlc2()
The VLC trees used here have very few different codes
and are therefore guaranteed to not be very deep: The AC/DC
VLCs have 12 elements and therefore a depth <= 11 whereas
the run VLCs have only nine elements and therefore a depth <= 8.
This allows to reduce the worst-case number of reloads for
reading a VLC code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
57b7783c22 avcodec/vp6: Don't initialize unused VLC tables
There are only 2*3*4 VLC trees for decoding Huffman encoded
AC coefficients; see section 13.3.2 of the spec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
3e21df2353 avcodec/huffman: Switch to ff_vlc_init_from_lengths()
Avoids having to create the codes ourselves.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 23:01:37 +02:00
Andreas Rheinhardt
e73c59c6c3 tools/target_dec_fuzzer: Assert on AVERROR_BUG
This will bring these bugs to our attention.

Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 12:35:48 +02:00
Andreas Rheinhardt
40544b4854 avcodec/ftr: Replace AVERROR_BUG that can be triggered
Return AVERROR_DECODER_NOT_FOUND.
(This can be triggered because this decoder tries to be
generic and work with multiple underlying AAC decoders,
so that there is no configure dependency for any decoder.)

Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 12:35:45 +02:00
Andreas Rheinhardt
0279eb9c93 avcodec/imm5: Reference H.264/HEVC decoders directly
This is simpler and allows to fuzz them -- up until now,
the linker did not see the dependency and fuzzing them
returned AVERROR_BUG during init.
It took just a few seconds here to run into an assert
due to a return value of AVERROR(EAGAIN) in the decode
callback...

Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 12:35:40 +02:00
Andreas Rheinhardt
0d9b0015ba tools/target_dec_fuzzer: Remove mjpeg hack
ff_mjpeg_decoder is now referenced directly by the relevant
decoders, so that the linker sees the dependency and
just does the desired thing. So remove the hack.

(Btw: The preprocessor does not do string comparisons, instead
undefined tokens in #if checks evaluate to 0, making the check
true regardless of the actual codec fuzzed (and leading to
linker errors if the mjpeg decoder is disabled).)

Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 12:35:28 +02:00
Andreas Rheinhardt
289cb3beff avcodec/cri,tdsc,tiff: Use ff_mjpeg_decoder directly
This is simpler than calling avcodec_find_decoder().
Notice that av_codec_init_static() has already been called
by the time we reach these decoders' init functions,
so it is not necessary to call avcodec_find_decoder()
for it (which doesn't do anything for the mjpeg decoder
anyway).

Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-25 12:31:54 +02:00
James Almer
25b0a8e295 avcodec/h264_slice: insert LCEVC side data before get_buffer() call
Otherwise it will not be taken into account or applied at all.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-23 09:41:03 -03:00
Lynne
37bd915042 vulkan: use _KHR suffix for push descriptor properties struct ID 2025-04-23 01:46:37 +02:00
Erik Linge
09a83e095d rtpdec_mpeg4: Add fmtp parsing of bitrate value
According to RFC 6416 the audio stream sender can pass the data rate
for the audio bitstream as "bitrate=" media format parameter.

Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-04-22 21:09:10 +02:00
Marvin Scholz
cacc68f3b5 ffbuild: fix include path for uninstalled .pc files 2025-04-22 21:04:36 +02:00
Marvin Scholz
0ea83e65aa avfilter/drawutils: narrow variable scopes 2025-04-22 20:59:16 +02:00
Marvin Scholz
d0bcf62597 tools/aviocat: use av_err2str
There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.
2025-04-22 20:45:57 +02:00
Marvin Scholz
da38b2fcd2 tools/sidxindex: use av_err2str
There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.
2025-04-22 20:45:57 +02:00
Marvin Scholz
a903d6dade tools/ismindex: use av_err2str
There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.
2025-04-22 20:45:57 +02:00
Marvin Scholz
b781f1836e tests: lavfi/drawutils: use av_err2str
There is no need to explicitly specify the buffer, as it
is only ever passed to printf, so av_err2str can be used.
2025-04-22 20:45:57 +02:00
Marvin Scholz
d7d103c34c lavfi/vf_xpsnr: use av_err2str
There is no need to explicitly specify the buffer, as it
is only ever passed to av_log, so av_err2str can be used.
2025-04-22 20:45:57 +02:00
Marvin Scholz
cd96d2ed6a avformat/crypto: use av_err2str
There is no need to explicitly specify the buffer, as it
is only ever passed to av_log, so av_err2str can be used.
2025-04-22 20:45:57 +02:00
Marvin Scholz
8129474b93 avformat/dashdec: use av_err2str
There is no need to explicitly specify the buffer, as it
is only ever passed to av_log, so av_err2str can be used.
2025-04-22 20:45:57 +02:00
Lynne
3bb2b8aff4 hwcontext_vulkan: enable subgroupSizeControl
We already use this feature for setting the subgroup size,
but this feature was not enabled.

Fixes a validation warning.
2025-04-22 13:43:20 +02:00
Lynne
96ddce1b3c vulkan: move OPT_CHAIN out of hwcontext_vulkan
This allows for it to be shared.
Technically, implementations should not give drivers structs
that the drivers are not familiar with.
2025-04-22 13:43:19 +02:00
Lynne
cee34e0a55 vulkan: check that the max number of push descriptors is not exceeded
Just correctness. We don't exceed this on any known hardware, but
its better to check.
If we do, we simply fall back to regular descriptors.
2025-04-22 13:43:19 +02:00
Lynne
5098b1a345 vulkan: move feature<->usage mapping code outside of hwcontext_vulkan.c
Allows for it to be reused. In particular, for a future patch to make
vulkan hwaccels output DMABUF-backed VkImages.
2025-04-22 13:43:17 +02:00
James Almer
b6c2498a59 avformat/takdec.c: return proper error codes for avio_read() failures
Suggested-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-21 14:08:23 -03:00
Thierry Foucu
1d244c641b libavformat/takdec.c: Fix msan error
Make sure we are reading 16 bytes for the MD5

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-21 14:08:23 -03:00
Andreas Rheinhardt
df824211c2 avcodec/vc2enc: Improve error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-21 17:02:44 +02:00
Andreas Rheinhardt
494061a49a avcodec/vp8: Maintain consistency of frame pointers
Right now it is possible for the pointer for the current frame to
be set in the context even when it could not be properly set up;
this does not influence the ordinary ref frames, but only
VP8Context.prev_frame. And since this code has been ported to the
ProgressFrame API in d48d7bc434,
this leads to segfaults, because the ProgressFrame API is less
forgiving than the ThreadFrame API (waiting on an uninitialized
ProgressFrame segfaults, waiting on an uninitialized ThreadFrame
is a no-op (the code behaves as if frame-threading is not in use)).

Fix this by maintaining the consistency of the frame pointers
in the context (by setting them later).

Fixes: NULL pointer dereference
Fixes: 68192/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP8_fuzzer-6180311026171904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-21 16:43:39 +02:00
softworkz
9e1162bdf1 avutil/hwcontext: Add item_name function for AVHWDeviceContext
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-21 00:19:20 +02:00
softworkz
bf1579c904 avutil/log,hwcontext: Add AV_CLASS_CATEGORY_HWDEVICE
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-21 00:19:11 +02:00
Andreas Rheinhardt
3cf21217b5 avcodec/dvbsubenc: Check nb_colors before using it
Avoids a potential overflow when multiplying nb_colors by 6.
Also make the nb_colors check a bit more strict.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:08:01 +02:00
Andreas Rheinhardt
3acc3b0b50 avcodec/dvbsubenc: Sanity check num_rects
It is written as region_id which is a single byte.
Also fixes a potential (defined) overflow in the num_rects * 6
multiplication later; this has been found by 김승호 <kimsho98@naver.com>.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:07:48 +02:00
Andreas Rheinhardt
bad3f308d3 avcodec/magicyuvenc: Hoist check out of loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
d42ba1384a avcodec/magicyuvenc: Avoid excessive logmessages
AVERROR(ENOMEM) is enough.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
cf288000e5 avcodec/magicyuvenc: Switch to unchecked bytestream2 API
We have already calculated the size of the packet
and therefore don't need to rely on these implicit checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
1ab50cced5 avcodec/magicyuvenc: Calculate proper packet size in advance
This can be easily done because we have a count of the number of
values and the length of the associated codes. This allows
to switch to ff_get_encode_buffer() and thereby avoids an implicit
intermediate buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
9c69e94354 avcodec/magicyuvenc: Avoid PutBitContext for byte-aligned writes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
3a90bbe4b7 avcodec/magicyuvenc: Simplify padding slice
Do it before writing the actual slice to be able to use
a single AV_WN32().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
e8b97b74dd avcodec/magicyuvenc: Avoid intermediate buffer
Given that we can calculate the size of each slice in advance,
we can determine the position in the output packet where it
needs to be put and can therefore avoid the intermediate buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
6e6e4e0e7b avcodec/magicyuvenc: Check in advance whether to encode a slice raw
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
05bda9d3df avcodec/magicyuvenc: Store slice width and height
Avoids rederiving it every time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
4e0a29d2f6 avcodec/magicyuvenc: Only keep in Slice what is used
Namely the number of counts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
a6c2c463c7 avcodec/magicyuvenc: Fix Huffman element probabilities
The earlier code only used the counts from the last slice.
The two FATE tests using slices show compression improvements
due to this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
0e4d513f99 avcodec/magicyuvenc: Restrict number of slice-planes to 256
Every frame contains an array of uint8_t with values
0..(s->planes * s->nb_slices - 1), so this needs to fit
into an uint8_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
01bb7421a0 fate/vcodec: Add MagicYUV tests
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Andreas Rheinhardt
685f658524 avcodec/magicyuvenc: Fix setting nb_slices
Do not derive it via av_cpu_count() in case AVCodecContext.slices
is unset. Instead default to AVCodecContext.thread_num instead
(which is one in case frame-threading is used and gives the actual
number of slice threads for slice threading).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-20 22:04:36 +02:00
Niklas Haas
853e66a072 doc/filters: fix "ewa_lanczos" filter description 2025-04-20 14:32:18 +02:00
llyyr
db0e4eb845 avcodec/vulkan_{av1, h264, hevc}: demote per frame logs to AV_LOG_DEBUG
Matches vaapi and software decoding behavior

Signed-off-by: llyyr <llyyr.public@gmail.com>
2025-04-20 06:45:27 +02:00
Lynne
7cd1edeaa4 vulkan: drop bgr_workaround
Vulkan's main issue around using BGR is simple.
The letters in the shader don't match up (rgba in shader, bgra in format).
So of course, rather than allowing "bgra" or other permutations of
formats in the shader, they went the nuclear option and spent months writing
an extension to get rid of the need to have a format in the shader to begin
with.

All this to solve a problem that should never have existed to begin with.
This fixes BGRA images since enabling WithoutFormat, as the GPU now remaps
without your involvement.
2025-04-19 18:45:13 +02:00
softworkz
5fc424c27c ffmpeg/repo: Add dot-folders in the repository root to .gitignore
Those are often used by IDEs and FFmpeg doesn't have
any such folders in the repo.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:29:12 +02:00
softworkz
02d7384ed5 avformat/dump: Print stream start offsets for input streams
Seeing the offset of video and audio streams to each other is often
a useful metric in diagnosing and understanding issues with playback
or transcoding.
This commit adds those offsets to the stream info print.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:05:30 +02:00
softworkz
edd28770be avcodec/dvbsubdec: Fix conditions for fallback to default resolution
The previous code expected a segment of type CLUT definition to exist
in order to accept a set of segments to be complete.
This was an incorrect assumption as the presence of a CLUT segment
is not mandatory.
(version 1.6.1 of the spec is probably a bit more clear about this
than earlier versions: https://www.etsi.org/deliver/etsi_en/
300700_300799/300743/01.06.01_20/en_300743v010601a.pdf)

The incorrect condition prevented proper fallback to using the default
resolution for the decoding context.

This also adds variables and moves the fallback check to the outside
for better clarity.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:04:31 +02:00
softworkz
fcc50c41ce avformat/hls demuxer: Add WebVTT subtitle support
This add support for WebVTT subtitles in HLS streams.
Just like for separate audio streams, it supports all available
WebVTT streams in all renditions.
No new options are added, it just works and provides subtitles streams
like any other demuxer.
The code prevents downloading subtitle segments which are farther
in the future than the main segments, to avoid loading hundreds
of subtitle segments in advance.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:02:24 +02:00
Lynne
ec3f3457fd vulkan_decode: add STORAGE flag to output images
In filtering, and SDR encoding, we use storage images.
This fixes using Vulkan filters on Intel.
Tested not to break anything on the three major vendors.
2025-04-19 10:59:16 +02:00
Lynne
ca6392e0a7 vulkan: always enable ReadWithoutFormat/WriteWithoutFormat
This implements support for reading and writing storage images with
no format.
The issue is that we define our images as arrays, and arrays can
only have a single type, which means that f.ex. NV12 needs two
different images, R8 and RG8.

The only driver known not to advertise support for the extension
as a whole is Intel, because they have parial support for odd formats
we never use. Therefore, just always enable it by default.
2025-04-19 10:59:11 +02:00
Andreas Rheinhardt
ff9f3fb607 avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort entries by length
It is unnecessary, as we already have the entries sorted by
probability and therefore implicitly by length. All we need
on top of that to build the tree is the number of entries
of a given length.
Doing so gives a 3.6% speedup of ff_mjpeg_encode_huffman_close()
here; it also saves about 640B of .text here.

The new code puts values with higher probability to the left
of the tree. The old code did not and therefore
the FATE checksums needed to be updated. Due to MJPEG's
0xFF unescaping file sizes as well as file checksums
needed to be updated; the decoded picture hashes stayed
the same. Given that codes on the left of the tree have
on average fewer bits set than codes on the right, the
file sizes mostly improve (all except vsynth3-mjpeg-444).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-18 08:40:17 +02:00
Andreas Rheinhardt
c8ce9de5a0 avcodec/tests/mjpegenc_huffman: Also test length counts
This is better than just testing that the tree is not overdetermined.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-18 08:40:10 +02:00
Andreas Rheinhardt
7684243fbe fftools/textformat/avtextformat: Remove unused variable
Forgotten in a888975a3c.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-17 01:49:04 +02:00
Lynne
bb3ce284d7 vulkan: use a single command buffer per command buffer pool
We violated the spec, which, despite the actual command buffer pool
*not* being involved in any functions which require external synchronization
of the pool, *require* external synchronization even if only the
command buffers are used.

This also has the effect of *significantly* speeding up execution
in case command buffers are contended.
2025-04-16 23:38:16 +02:00
Lynne
36c6c66deb vulkan/rangecoder: minor cleanup 2025-04-16 23:38:16 +02:00
Frank Plowman
d220fa6189 fate/vvc: Add vvc-wpp-single-slice-pic
A sample with a particular partitioning structure that could not be read
correctly before 26c5d8cf5d

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-16 13:42:25 -03:00
Leo Izen
b09501031a avcodec/libjxlenc: prevent color encoding from being set twice
We currently populate the color encoding bundle and then check to see
if there's an ICC profile to attach, and set the color encoding bundle
in either case. The ICC profile overrides the color encoding bundle, so
we should not calculate enum-based color encoding if we have an ICC
profile present. Fixes several unnecessary warnings from being emitted.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-04-16 10:10:01 -04:00
Sean McGovern
afe6c1238a libpostproc: update APIChanges and version for "deprecate the AMD 3DNow"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:59:15 +02:00
Zhao Zhili
6995372ea2 doc/filters: Fix video size of mptestsrc
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 19:33:55 +08:00
Michael Niedermayer
058d49b168 Revert "lavf/id3v2dec: support multiple values and TIPL frames"
see: Re: [FFmpeg-devel] [PATCH 2/2] avformat/id3v2: Check that decode_str() did advance

but in short, first our API since 16years says we dont have multiple values per key
(which it supports since 9 years only)

and it causes some problems for ffprobe apparently.
I do believe the original patch is the correct direction but it requires
more changes. So revert this until other things are in place and until
we have a consensus.

This reverts commit 80b77e8e8d.
2025-04-16 13:09:05 +02:00
Jack Lau via ffmpeg-devel
cf7dfddee4 avformat/rtpdec_mpeg4: add need_parsing for rtsp AAC
fix ticket #11531

the rtsp aac did not marked keyframe which cannot easy copy to output.
because f265f9c9d0 commit change the AAC props to match xHE-AAC.
in some formats like MOV, need_parsing is set, so AAC can be still parsed be keyframe
but rtsp did not, so this patch add it

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:04 +02:00
Michael Niedermayer
935a52c887 avcodec/ffv1enc: Use version 3 by default (CRCs by default)
Version 3 is since 2013 (FFmpeg 2.1) non experimental so should be widely supported

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:04 +02:00
Jerome Martinez
0c28059b81 avcodec/ffv1enc: avoid repeating the same warning forever
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:04 +02:00
Sean McGovern
c818c67991 libpostproc: deprecate the AMD 3DNow! define
It was left unreferenced in 1f0948272a.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:03 +02:00
Michael Niedermayer
1946b7875c avformat/id3v2: Print the unknown encoding
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:03 +02:00
Michael Niedermayer
979608dde7 configure: Clearer documentation for "disable-safe-bitstream-reader"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:03 +02:00
Arthur Grillo
2fedb29780 avformat/fifo: Check for keyframe video type before stop dropping
The current behavior when using restart_with_keyframe is that it will
recover if it also encounters any audio packet, as they are flagged as a
keyframe.

The expectation is that packets are dropped until the next _video_
keyframe.

To fix that, check if exists a video stream, if it exists check the
packet stream codec type, only letting it recover when it is a video
one. If there is no video stream, resume to the original behavior, not
checking the codec type.

Fixes ticket: #11467

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:02 +02:00
Link Mauve
50910c32c5 tools: Fix deprecation warning in patcheck
GNU apparently deprecated their egrep alias, replace it with 'grep -E'
to avoid getting flooded with deprecation warnings.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:02 +02:00
Andreas Rheinhardt
a888975a3c fftools/textformat/avtextformat: Make close functions return void
Just like normal close functions.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:13:13 +02:00
Andreas Rheinhardt
37635d31cb fftools/textformat/avtextformat: Add missing AVERROR()
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:13:03 +02:00
Andreas Rheinhardt
f873734f84 fftools/textformat/avtextformat: Initialize stuff earlier
avtext_context_close() calls av_opt_free() on an AVTextFormatContext
as well as av_bprint_finalize() on the containing section_pbuf
AvBPrints, yet it can happen that the AVBPrints have not been
initialized (only zeroed) and that av_opt_set_defaults() has
not been called. This works, but it is not really documented to do so.
So ensure that the options and the AVBPrints have been initialized
when avtext_context_close() is called.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:54 +02:00
Andreas Rheinhardt
50ef4b2a6b fftools/textformat/avtextformat: Fix segfault upon allocation error
Would happen if an AVTextFormatContext's private context
could not be allocated.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:48 +02:00
Andreas Rheinhardt
7ee7632cb8 fftools/textformat/avtextformat: Fix segfault upon allocation error
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:41 +02:00
Andreas Rheinhardt
b9450583bc textformat/tw_avio: Remove close_on_uninit param from create_file
avtextwriter_create_file() creates an AVIOContext whose pointer
resides in its private context. If it were not always closed on
uninit, the AVIOContext would leak, so it makes no sense
to have this parameter.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:09 +02:00
Andreas Rheinhardt
f73badbf47 fftools/textformat/tw_avio: Use avio_closep()
Avoids leaving dangling pointers behind.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:05 +02:00
Andreas Rheinhardt
79fa31d159 fftools/textformat/tw_avio: Don't flush unnecessarily
avio_close() automatically flushes the AVIOContext.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:11:58 +02:00
Andreas Rheinhardt
395c91347f fftools/textformat/tw_avio: Remove unused private class
This AVTextWriter does not have any options.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:11:52 +02:00
Andreas Rheinhardt
c9dc6ca02b fftools/textformat: Use "", not <> for lavu headers
Also remove unused headers.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:11:45 +02:00
Andreas Rheinhardt
2ab1021264 fftools/textformat/avtextformat: Simplify avtext_print_rational()
Use snprintf() directly instead of initializing an AVBPrint
just for this.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:05:58 +02:00
James Almer
0e59675698 avutil/hwcontext_vulkan: use the typedef'd name for the expect_assume struct
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-15 16:52:51 -03:00
James Almer
f29475a89e avutil/hwcontext_vulkan: check if expect_assume is supported by the header
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-15 16:44:45 -03:00
Nicolas George
0040d7e608 lavfi/src_movie: set pkt_timebase
Fix “Could not update timestamps for skipped samples” warning
and associated misfeature.
2025-04-15 15:49:38 +02:00
Felicia Lim
2229b74127 avformat/movenc: fix setting elst/stss for IAMF with Opus 2025-04-14 17:25:39 -03:00
Felicia Lim
d36883f119 avformat/iamf_writer: fix setting skip_samples and discard_padding for OPUS 2025-04-14 17:25:34 -03:00
Andreas Rheinhardt
3b2a9410ef avcodec/decode: Only use ff_progress_frame_get_buffer() with blank input
All users (namely HEVC) that use ff_progress_frame_alloc()
should just use ff_thread_get_buffer(). Using
ff_progress_frame_get_buffer() is not a must; it is merely
a convenience wrapper.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-14 10:15:08 +02:00
Lynne
29b85cd4b8 vulkan_ffv1: add cached symbol reader for AMD
Speeds up everything on AMD by 3x.
This uses 32 local invocations to load state into cache, as well
as to do the RCT faster.
2025-04-14 06:10:43 +02:00
Lynne
e040c087c7 vulkan: add support for expect/assume
This commit adds support for compiler hints.
While on AMD these are not used/needed, Nvidia benefits from them, and gives
a sizeable 10% speedup on 4k.
2025-04-14 06:10:43 +02:00
Lynne
985a26be28 vulkan_ffv1: shortcut +-1 coeffs in symbol reading
Slightly faster, and allows for further optimizations.
2025-04-14 06:10:43 +02:00
Lynne
4d561e6a1e vulkan_ffv1: remove need for scratch data during setup
This saves on some VRAM, but mainly allows for a more unified path.
2025-04-14 06:10:43 +02:00
Lynne
8ceabb677c vulkan_ffv1: externalize extended lookup check
8% speedup on nvidia on 4k.
2025-04-14 06:10:43 +02:00
Lynne
77f777d925 ffv1/vulkan: redo context count tracking and quant_table_idx management
This commit also makes it possible for the encoder to choose a different
quantization table on a per-slice basis, as well as adding this capability
to the decoder.

Also, this commit fully fixes decoding of context=1 encoded files.
2025-04-14 06:10:42 +02:00
Lynne
66b8c92df2 vulkan_ffv1: cache only 2 lines when decoding RGB
This reduces the intermediate VRAM used for RGB decoding by a
factor of 100x for 6k video.
This also speeds the decoder up by 16% for 4k RGB24 and 31% for 6k video.

This is equivalent to what the software decoder does, but with less pointers.
2025-04-14 06:10:42 +02:00
Lynne
72953477a4 vulkan_ffv1: fix left-2 sample addressing
Typo.
Not enough to fix context=1, but its a start.
2025-04-14 06:10:42 +02:00
Lynne
694ebe890c vulkan_ffv1: improve buffer barrier correctness for slice state
This is likely a nanooptimization, but its more correct.
2025-04-14 06:10:42 +02:00
Lynne
6111aef533 vulkan_ffv1: fix reset shader dependencies
Without a barrier upfront, the reset shader may read data fields not
yet set by the setup shader.
2025-04-14 06:10:42 +02:00
Lynne
b72ada0a96 vulkan_ffv1: fallback to upload if mapping packet fails, fix fallback
The commit which added support for host mapping accidentally broke the
original, upload route.
For drivers without host-mapping (very few), fix it.
2025-04-14 06:10:42 +02:00
Lynne
45d7abf6d9 vulkan_ffv1: init overread/corrupt fields
Forgotten.
2025-04-14 06:10:42 +02:00
Lynne
1f09b55c94 vulkan_ffv1: allocate just as much memory for slice state as needed
Rather than always using the maximum allowed slices, just use the number
of slices present in this frame.
2025-04-14 06:10:41 +02:00
Lynne
fc960dafef vulkan_ffv1: optimize symbol reader
This was the fastest variant tested.
2025-04-14 06:10:41 +02:00
Lynne
defebd74c0 vulkan_ffv1: slightly optimize the range decoder
GPUs have cmovs as standard.
2025-04-14 06:10:41 +02:00
Lynne
d7772da728 vulkan_ffv1: remove unused define
Leftover debug macro.
2025-04-14 06:10:41 +02:00
Lynne
d077e00f3e vulkan_ffv1: enable acceleration on Intel
Fixed by previous commit.
2025-04-14 06:10:41 +02:00
Lynne
a1137f9214 hwcontext_vulkan: disable descriptor buffer extension on Intel
Temporary workaround. Will be replaced with a version check once a fix is
in the works and a known next version for Mesa with a fix is known.
2025-04-14 06:10:41 +02:00
Lynne
79ff1f21c4 vulkan_decode: only create sequence params in end_frame
We tried to create sequence params in both start_frame and end_frame.
This was redundant.

Just always create them in end_frame.
2025-04-14 06:10:40 +02:00
Lynne
4f64df2928 vulkan: remove unused field from exec pools
This used to be involved in a mechanism to switch between queue indices,
but since the rewrite of the rewrite of the rewrite, it was rewritten out.
2025-04-14 06:10:40 +02:00
Lynne
11911aef46 vulkan_shaderc/glslang: print full shaders on TRACE rather than VERBOSE
Way too spammy.
2025-04-14 06:10:40 +02:00
Lynne
7b0156201b vulkan: fix logging level when erroring upon creating shader module 2025-04-14 06:10:34 +02:00
Andreas Rheinhardt
75d5672b4b avcodec/mpegaudioenc: Rename MPA_encode_* -> mpa_encode_*
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
7915e2a095 avcodec/mpegaudioenc: Move PutBitContext to stack
Avoids keeping dangling pointers in the context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
62e1abcf0d avcodec/mpegaudioenc: Don't pad one bit at a time
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
87f3e20931 avcodec/mpegaudioenc: Avoid intermediate buffer
We know the final size before encoding, so we can switch to
ff_get_encode_buffer() which avoids an implicit memcpy().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
6f7ebeff70 avcodec/mpegaudioenc: Combine writing scale factors
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
db75955d60 avcodec/mpegaudioenc_{fixed,float}: Merge encoders
Most of the encoders is the same. So deduplicate them.
This reduces code size from 22410B to 12637B here.
The data in mpegaudiotab.h is also automatically deduplicated.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
13a0d0ade1 avcodec/mpegaudioenc_template: Remove always-false branch
The sample rates here have already been checked generically
via CODEC_SAMPLERATES().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
66310f8a22 avformat/asf_tags: Deduplicate tags
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
413905bff2 avcodec/opus/tab: Deduplicate arrays
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
35fcdb2132 swscale/x86/rgb2rgb: Deduplicate ASM constants
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
044bfc7785 avcodec/aac{enc,}tab: Deduplicate swb tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
ab1bc2f745 avcodec/aacenc: Remove always-false check
The sample rates have already been checked generically
via AVCodec.supported_samplerates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:49:21 +02:00
Andreas Rheinhardt
516bcfc169 avutil/aes: Use #if checks instead of if (ARCH_X86)
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:47:32 +02:00
Andreas Rheinhardt
f81ace52f8 avutil/aes: Make aes_init_static() av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:47:26 +02:00
Andreas Rheinhardt
c8c4e55b2b avcodec/motionpixels: Avoid av_unused
Easily possible now that -Wdeclaration-after-statement is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 22:47:26 +02:00
Andreas Rheinhardt
bf327ac676 avcodec/hq_hqa: Check size before initializing GetByteContext
Enables the compiler to optimize the buf_size assert
in bytestream2_init() away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:49:26 +02:00
Andreas Rheinhardt
16943876f8 avcodec/hq_hqa: Remove implicit always-false checks
This decoder has explicit checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:48:11 +02:00
Andreas Rheinhardt
c39e23cc91 avcodec/hq_hqa: Check available date before allocating frame
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:26:37 +02:00
Andreas Rheinhardt
c1f124f3f0 avcodec/hq_hqa: Use ff_vlc_init_from_lengths()
This allows to avoid the codes table; furthermore, given
that the runs fit into seven bits and level into nine,
one can put them into one int16_t and use as symbols table
in ff_vlc_init_from_lengths().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:26:37 +02:00
Andreas Rheinhardt
9c0d6145c9 avcodec/hq_hqa: Include implicit +1 run in RL VLC table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:25:43 +02:00
Andreas Rheinhardt
ce0074f97b avcodec/hq_hqa: Use RL-VLC table
This moves indirections to init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:25:29 +02:00
Andreas Rheinhardt
18309fba3c avcodec/hq_hqadata: Avoid relocations
Initialize a list of 128 pointers at decoder init
instead of using a const list of pointers (which
will be initialized at runtime when libavcodec
is loaded when using pic code with Elf); the former
takes only 128 bytes (+ a bit of initialization code),
the latter 1KiB on 64 bit systems (+3KiB on x64 elf
for relocation information).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:24:39 +02:00
Andreas Rheinhardt
c12108cdaa avcodec/hq_hqa: Don't zero in small chunks, don't zero twice
Up until now, hq_decode_block() zeroed every block (of 128 bytes)
before decoding a block; yet this is suboptimal for all modes,
because all modes need to reset all the blocks they use anyway
and so it should be done in one go for all blocks.

For the alpha mode (where blocks need not be coded) all blocks
are zeroed initially anyway, because decode_block() might not
be doing it, so zeroing there again for the coded blocks is
a waste.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:22:49 +02:00
Andreas Rheinhardt
12c9ffa569 avcodec/hq: Include alpha in cbp VLC table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:21:29 +02:00
Andreas Rheinhardt
e38616c4ac avcodec/hq{xvlc,_hqadata}: Deduplicate and hardcode cbp table
This table is so small (32 elements amounting to 128 bytes)
that it is more efficient size-wise to hardcode it instead
of initializing it at runtime.

Also stop duplicating it in hq_hqa.o and hqx.o.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:14:51 +02:00
Andreas Rheinhardt
30996b7195 avcodec/avcodec: Remove always-false check
avcodec_free_context() only calls ff_codec_close() if there
is an AVCodecContext and avcodec_open2() unconditionally
dereferences the AVCodecContext*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:58 +02:00
Andreas Rheinhardt
cf1c52c5c6 avcodec/h261dec: Set pict_type during init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:58 +02:00
Andreas Rheinhardt
88d8150de7 avcodec/h261dec: Export key frame information
Implements ticket #8343.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:58 +02:00
Andreas Rheinhardt
6a202c3431 avcodec/asvenc: Use tighter MAX_MB_SIZE constant
Also document the constant.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:58:12 +02:00
Andreas Rheinhardt
9bb617b3e7 avcodec/asvenc: Don't use FF_INPUT_BUFFER_MIN_SIZE
ASV-1/2 does not really have a header and so using
FF_INPUT_BUFFER_MIN_SIZE is wasteful as well as ugly
(such bounds should be codec-specific).

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-12 09:57:13 +02:00
Dmitrii Ovchinnikov
b02985b12c avcodec/amfenc_av1: Add B-frame QP control 2025-04-11 12:21:37 +02:00
Zhao Zhili
f702cf422a avcodec/mediacodecdec: Reset optional fields when parse format
Parse format can be called multiple times, e.g., when resolution
changed. If getInt32 fails, optional member variables will retain
their previously set values without modification. This can be a
big problem for new resolution with old crop info.

This patch reset optional fields to zero when getInt32 failed.
2025-04-11 17:26:15 +08:00
softworkz
93ae305ce1 fftools/ffprobe: Rename AVTextFormatContext variables (w => tfc)
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-11 03:06:48 +02:00
softworkz
15e99b2398 fftools/ffprobe: Rename writer_print_section_* and WriterContext
separated for better clarity of the preceding commit

Signed-off-by: softworkz <softworkz@hotmail.com>
ren
2025-04-11 03:06:47 +02:00
softworkz
d7a3f68fea fftools/ffprobe: Change to use textformat api
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-11 03:06:47 +02:00
softworkz
97d680d450 fftools/textformat: Extract and generalize textformat api from ffprobe.c
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-11 03:06:47 +02:00
James Almer
d79e4f6d0b tests/fate/checkasm: add the aes test
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-10 12:03:52 -03:00
James Almer
a039726c2a avutil/x86/aes: remove a few branches
The rounds value is constant and can be one of three hardcoded values, so
instead of checking it on every loop, just split the function into three
different implementations for each value.

Before:
aes_decrypt_128_aesni:                                  93.8 (47.58x)
aes_decrypt_192_aesni:                                 106.9 (49.30x)
aes_decrypt_256_aesni:                                 109.8 (56.50x)
aes_encrypt_128_aesni:                                  93.2 (47.70x)
aes_encrypt_192_aesni:                                 111.1 (48.36x)
aes_encrypt_256_aesni:                                 113.6 (56.27x)

After:
aes_decrypt_128_aesni:                                  71.5 (63.31x)
aes_decrypt_192_aesni:                                  96.8 (55.64x)
aes_decrypt_256_aesni:                                 106.1 (58.51x)
aes_encrypt_128_aesni:                                  81.3 (55.92x)
aes_encrypt_192_aesni:                                  91.2 (59.78x)
aes_encrypt_256_aesni:                                 109.0 (58.26x)

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-10 12:02:34 -03:00
Martin Storsjö
4d4b301e4a checkasm: hevc_pel: Use helpers for checking for writes out of bounds
This allows catching whether the functions write outside of
the designated rectangle, and if run with "checkasm -v", it also
prints out on which side of the rectangle the overwrite was.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-10 13:30:18 +03:00
Michael Niedermayer
f6cd9bfa82 doc/encoders: Document png pred
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-10 03:01:34 +02:00
Michael Niedermayer
fbf002dbd2 avcodec/pngenc: set default prediction method to PAETH
this is a good compromise between speed and compression

-rw-r----- 1 michael michael 180987 Feb  6 14:29 lena-def.png
-rw-r----- 1 michael michael 128430 Feb  6 14:36 lena-pavg.png
-rw-r----- 1 michael michael 126269 Feb  6 14:36 lena-pmixed.png
-rw-r----- 1 michael michael 180987 Feb  6 14:35 lena-pnone.png
-rw-r----- 1 michael michael 127758 Feb  6 14:35 lena-ppaeth.png

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-10 03:01:33 +02:00
Michael Niedermayer
e47a3c7d62 doc/encoders: Document compression_level for PNG
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-10 03:01:33 +02:00
Michael Niedermayer
c6a889f3e0 avcodec/osq: avoid undefined negation
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: 390646659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-5040277374435328

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-10 03:01:33 +02:00
Michael Niedermayer
d16a058dbc swscale/swscale: Do not crash on floats
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int'
Fixes: division by zero
Fixes: 391981061/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6691017763389440
Fixes: 392929028/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5142088307507200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-10 03:01:32 +02:00
Michael Niedermayer
ce538ef97a swscale/output: Fix integer overflow in yuv2gbrp_full_X_c()
Fixes: signed integer overflow: 1966895953 + 210305024 cannot be represented in type 'int'
Fixes: 391921975/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5916798905548800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-10 03:01:32 +02:00
Jerome Martinez
3aec1f87c9 avcodec/ffv1enc: permit 1024 slices
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-10 03:01:32 +02:00
averne
00c50a29ab avcodec/nvdec_vc1: add marker insertion logic
This mirrors existing code in d3dxx and dxva hwaccels

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-04-09 21:08:55 +02:00
Andreas Rheinhardt
d073d0d3bb avcodec/dovi_rpuenc: Constify dv_levels
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
1267273663 avcodec/m[jx]pegdec: Simplify freeing frame
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
7ddcd55d51 tests/fate/vcodec: Test "default" Huffman tables, too
Since 45eeb1f785
optimal Huffman tables are the default (without slice-threading).
This made the fate-vsynth*-mjpeg-{trell-,}-huffman tests
identical to their corresponding tests without "-huffman".

This is of course wasteful, so switch the two tests with
"-huffman" counterparts back to the default tables.
Also use one of these tests to test slice threaded encoding.
It has so far been untested.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
31d5686c39 avocdec/mjpegenc_huffman: Avoid redundant loop
There is no point in iterating over the list twice.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
7ad16a4410 avcodec/mjpegenc_huffman: Make ff_mjpegenc_huffman_compute_bits() static
Only used here and in a test tool.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
a2136d545c avcodec/aacenc_is: Make ff_aac_is_encoding_err() static
Possible since 9b11fefb88.
Also remove a now always-zero parameter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
d78cb537a2 avcodec/x86/hevcdsp: Move to x86/hevc
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
05ae73ac90 avcodec/x86/hevcdsp: Move macro to dsp_init.c
It belongs to the [EQ]PEL_LINKS macros.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
35aee3ca95 avcodec/x86/hevc/dsp_init: Reindent after the previous commits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
6875f495d9 avcodec/x86/hevc/dsp_init: Make ff_hevc_put_bi_[eq]?pel* funcs static
Given that there are actually ASM functions of this type,
one can't simply remove the ff_ prefix from the definitions
and declare them as static. Yet one can do nearly that
if one keeps the ff_ prefix and removes the declarations
for the (now static) functions defined in dsp_init.c
from hevcdsp.h and if one defines the functions in the correct
order (smaller width first) so that no forward declarations
are necessary (which was already true).

The new declarations avoid nested macros to simplify things.
It nevertheless turned out to be beneficial line-wise.

(It would be possible to avoid most of these declarations:
It is legal to repeat a function declaration without static
if the first declaration declared a function as static.
So if the macros simply declared all the functions that
they call, one could avoid declarations for the functions
that are called. While this is legal C, it unfortuntaly
clashes with GCC's -Wredundant-decls (which configure enables)
and it is also ugly, as these macro definitions would
provide declarations used in ff_hevc_dsp_init_x86().)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
9211abfe7e avcodec/x86/hevc/dsp_init: Make ff_hevc_put_[eq]?pel_* static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
3f1aacff1c avcodec/x86/hevc/dsp_init: Make ff_hevc_put_uni_[qe]?pel* funcs static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
c34d77317e avcodec/x86/hevc/dsp_init: Make ff_hevc_put_bi_w_* functions static
They are always C wrappers around other functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
0cd67da909 avcodec/x86/hevc/dsp_init: Make ff_hevc_put_uni_w_* functions static
These are always C functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
977d65ae17 avcodec/x86/hevc/mc: Remove unused functions
Saved 11536B here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
d72a9af528 avcodec/celp_math: Mark ff_celp_math_init() as av_cold
Also do the same for ff_celp_math_init_mips().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
77b147d3a2 avcodec/lsp: Make ff_acelp_lsp2lpc() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
2c65d3be81 avcodec/celp_math: Reuse ff_scalarproduct_float_c()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
159b482835 avcodec/x86/vvc/dsp_init: Make avg wrappers static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
5c619da0ed avcodec/x86/vvc/dsp_init: Make alf wrappers static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
ed37a8f75a avcodec/x86/vvc/dsp_init: Make ff_vvc_apply_bdof_##bd##_avx2 static
These wrappers around ff_vvc_apply_bdof_avx2() are only used in
dsp_init.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
Andreas Rheinhardt
9ba6f99a62 avcodec/x86/vvc/dsp_init: Make put wrappers static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
James Almer
aeed747f41 avutil/aes: use pthread_once to fill the static tables
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-09 08:44:50 -03:00
Andreas Rheinhardt
890b8da1ce configure: Allow mixing declarations and statements
This C90 rule forces us to use a too big scope and should
therefore be dropped. Given that we already require C11,
all supported compilers can handle mixed declarations
and statements just fine.

Reviewed-by: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 11:45:21 +02:00
Andreas Rheinhardt
830fab6891 avutil/tests/channel_layout: Improve enum range check
Both GCC and Clang use unsigned as underlying type of
an enum with no negative enumeration constants, making
checks like "layout->order >= 0" here tautologically true.
Clang warns about this. Combine both range checks
by casting to unsigned to suppress this warning.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 11:45:14 +02:00
averne
02eda84bf2 avcodec/h264: fix reference reordering
Fixes hardware decoders depending on long_term_pic_idx.
Relevant ITU conformance test vectors: MR6_BT_B, MR8_BT_B

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-08 20:44:35 +08:00
James Almer
1e5c65f539 avutil/dict: fix memleak in av_dict_set()
Regression since 19e9a203b7.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-07 23:38:09 -03:00
Michael Niedermayer
f3f1a48a07 APIChanges & version bump for AV_DICT_DEDUP
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:46:05 +02:00
Michael Niedermayer
89df6d4068 avcodec/ffv1enc: Fix remap > 0 with gbrp12, that is non float
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:43 +02:00
Michael Niedermayer
175cd4ced0 avcodec/ffv1enc: avoid slices larger than 360x288 if no value is specified
This improves speed by providing more independent things for more CPUs

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:43 +02:00
Michael Niedermayer
1b04fb385c avcodec/ffv1enc: Remove 65536 pixel per slice limit for remap
About 1% better compression with large slices

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:42 +02:00
Michael Niedermayer
feceed9222 avcodec/ffv1: Store slices*planes with the minimum bits needed after remap
This also means that if a plane*slice has only 1 color nothing
is stored after the remap table

This also corrects the RCT offset to the exact value after remap
not a fixed 65536

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:42 +02:00
rcombs
80b77e8e8d lavf/id3v2dec: support multiple values and TIPL frames
Fixes https://trac.ffmpeg.org/ticket/6949

Ordinary text frames in ID3v2 are allowed to have multiple
(null-separated) values. This technically isn't allowed in TXXX,
but it's used in practice by Picard, and supporting it is harmless.

TIPL/IPL (Involved People List) and TMCL (Musician Credits List) work
similarly to TXXX, but alternate key-value-key-value.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:42 +02:00
rcombs
172e7ca668 lavf/metadata: support duplicate keys in ff_metadata_conv
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:41 +02:00
rcombs
19e9a203b7 lavu/dict: add AV_DICT_DEDUP
This is useful when multiple metadata inputs may set the same value
(e.g. both a container-specific header and an ID3 tag).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:35 +02:00
Rodger Combs
779cbc2b97 checkasm: add tests for AES
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-06 11:02:10 -03:00
James Almer
a35b4e8d29 avutil/x86/aes: ignore the upper bits in count
The argument is an int.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-06 11:02:09 -03:00
James Almer
3f30ae823e avutil/aes_ctr: simplify incrementing the counter
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
James Almer
fe73b84879 avutil/aes_ctr: simplify and optimize av_aes_ctr_crypt()
Process data in chunks of four or eight bytes, depending on host, instead of
one at a time.

before:
55561 decicycles in av_aes_ctr_crypt

after:
52204 decicycles in av_aes_ctr_crypt

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
Rodger Combs
2ea3c51795 lavu/aes: add x86 AESNI optimizations
crypto_bench comparison for AES-128-ECB:

lavu_aesni AES-128-ECB  size: 1048576  runs:   1024  time:    0.596 +- 0.081
lavu_c     AES-128-ECB  size: 1048576  runs:   1024  time:   17.007 +- 2.131
crypto     AES-128-ECB  size: 1048576  runs:   1024  time:    0.612 +- 1.857
gcrypt     AES-128-ECB  size: 1048576  runs:   1024  time:    1.123 +- 0.224
tomcrypt   AES-128-ECB  size: 1048576  runs:   1024  time:    9.038 +- 0.790

Improved-By: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
James Almer
2daaafafc6 avutil/tests/aes_ctr: also randomize the encryption key
And not just the IV.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
James Almer
462d35dc72 avutil/tests/aes_ctr: reindent after the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
James Almer
19085287b4 avutil/tests/aes_ctr: also check the encrypted buffer
The test in its current form is just ensuring the plain text output is the same
as the plain text input, not bothering to check if anything was done with the
latter. av_aes_ctr_crypt() could be a simple memcpy under the hood and this
test would still succeed.

To check the integrity of the encrypted buffer, both the IV and the key need to
be fixed. As such, and in order to not remove the existing randomization of the
input IV, do two runs, one with random initialization data, and one with static
data.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
James Almer
0a34f009aa avutil/tests/aes_ctr: test more than a single block worth of data
This should exercise the implementation more thoroughly after an upcoming
change.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:39 -03:00
Araz Iusubov
ccf073e772 avcodec/d3d12va_decode: enable reference-only mode
The Reference-Only feature in DirectX 12 is a memory optimization
technique designed for video decoding scenarios.
This feature requires that reference resources must be allocated with
the D3D12_RESOURCE_FLAG_VIDEO_DECODE_REFERENCE_ONLY resource flag.
Reference textures must also be separated from output textures.
This feature is not supported in the current version of ffmpeg.
Since AMD GPU uses this feature in Direct 12 decoder,
ffmpeg does not support AMD GPU Direct 12 decoding.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-04-05 11:57:49 +08:00
Michael Niedermayer
37a319fb95 avcodec/ffv1enc: Consider 2s x s slice configurations
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:42 +02:00
Michael Niedermayer
2d9c9dae14 avcodec/ffv1dec: Limit size of fltmap* to pixel number
This reduces needed memory and also removes the 65536 maximum for remap
on the decoder side

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:42 +02:00
Michael Niedermayer
06c00f9355 avcodec/ffv1: Only allocate fltmap* and bitmap when needed
This reduces memory requirements

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:42 +02:00
Michael Niedermayer
b67cf79683 avcodec/ffv1: Allocate unit only when needed and only as large as needed
That is instead of a fixed 65536, we now allocate only as many as there
are pixels.
We also allocate only for the encoder and only when remapping is enabled
and only for 32bit per sample

This should reduce memory consumption, the 2nd array will be
dealt with in a future commit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:41 +02:00
Michael Niedermayer
f1235f4bc1 avcodec/ffv1enc: run1start variables should fit in 32bit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:41 +02:00
James Almer
4ebc1f06e9 avcodec: remove remaining references to avcodec_close()
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-04 14:03:21 -03:00
Zhao Zhili
1c17061397 avcodec/decode: Fix avcodec parameters when bsfs are enable by decoder
BSF can update extradata, e.g., vvc_mp4toannexb. If we don't copy
bsf->par_out back to avcodec context, decoder can get extradata in
mp4 format, while packets are in annexb format.
2025-04-05 00:28:20 +08:00
Dmitrii Ovchinnikov
c05ed36b56 libavcodec/amfenc: Setting the VBAQ property before the init call. 2025-04-04 17:57:49 +02:00
Martin Storsjö
8284ba2a21 configure: Check for AVCaptureSession as dependency to avfoundation
This class is unavailable on tvOS before 17.0 (and macOS before 10.7
and iOS before 4.0, but those are fairly ancient). This makes sure
that we don't try to build the avfoundation indevice for such
OSes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-04 17:12:34 +03:00
Martin Storsjö
69bab4e74f avfoundation: Fix compilation for OSes other than macOS and iOS
E.g. tvOS doesn't have devicesWithMediaType.

In principle, we could probably disable building the whole
input device on such OSes, but that would either require
testing explicitly for the OS type in configure (which we don't
do anywhere so far), or test for individual objective C methods.

This approach allows the code to compile, but no input devices
will be found at runtime.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-04 17:12:33 +03:00
Niklas Haas
46762c8b82 avfilter/vf_libplacebo: don't explode on zero FPS information
While technically not specifiad as valid by the AVFilterLink documentation,
it is currently possible to get an FPS of zero from various sources inside
libavfilter (notably vf_buffersrc).

Avoid a division by zero and resulting infinity when this happens.
2025-04-03 17:17:42 +02:00
Chris Hodges
68b105341c avformat: Fix AV1 RTP wrong log condition
Fixed warning about OBU count being wrong, which can only be
determined when the number of OBUs in the header is non-zero,
not the other way round.

Signed-off-by: Chris Hodges <chris.hodges@axis.com>
2025-04-03 16:08:41 +02:00
Andreas Rheinhardt
1722f08acf avutil/Makefile: Only include half2float, float2half when needed
They are not needed for shared builds (and because --gc-sections
is not the default for shared builds, they were included by default
included in libavutil since bf22c4cc3e).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
52d766e5c2 avcodec/vdpau: Only include mpegvideodec.h when used
mpegvideodec.h includes mpegvideodata.h which in turn contains
a "static const uint8_t *const ff_mpeg1_dc_scale_table =
ff_mpeg12_dc_scale_table[0]"; yet if mpegvideo is disabled,
ff_mpeg12_dc_scale_table is not available, yet a non-optimizing
compiler (like GCC with -O0) may emit ff_mpeg1_dc_scale_table
and therefore a reference to ff_mpeg12_dc_scale_table nevertheless.

Fix this by only including mpegvideodec.h if it is needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
1479c2ec27 doc/{in,out}devs: Remove documentation for removed devices
Namely bktr, opengl and sdl2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
265e0d3e24 avfilter/palette: Remove unused ff_srgb_u8_to_linear_int()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
3693acb855 avcodec/x86/h26x/h265dsp: Remove unused functions
The ff_h2656_put_{uni_,}8tap_hv{32,64,128}_8_avx2
and ff_h2656_put_{uni_,}4tap_hv{64,128}_8_avx2
functions were unused and have been removed.
This saved 3712B of .text here.

(ff_h2656_put_{uni_,}4tap_hv32_8_avx2 are now only
called from exactly one callsite (in
ff_hevc_put_{uni_,}epel_hv32_8_avx2) and could be inlined.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
2e962fb080 avcodec/vulkan_video: Remove unused ff_vk_h26[45]_profile_to_av()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
664aef361a avcodec/aactab: Remove unused arrays
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
f5007a07d8 avcodec/aac/aacdec_lpd: Remove dead code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
2b9b4dde93 avcodec/aac/aacdec_lpd: Make ff_aac_lpd_mode_tab static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
132a55fd7c postproc/postprocess_template: Use immediate instead of memory load
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
5e947cc320 postproc/postprocess: Remove unused b02
The line which appears to be using it was always commented out
(since it has been added in 70c5ae870b).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
435be31ef5 swscale/csputils: Remove unused ff_sws_matrix3x3_rmul()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
4d2e38b376 avutil/hwcontext_vulkan: Remove unused variable
Forgotten in 8c7b00ba3a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
Andreas Rheinhardt
9d543273fe fftools/ffprobe: Fix hypothetical stack buffer overflow
It can't really happen, because no currently used pixel format
has a name exceeding the size of the buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:51 +02:00
Kacper Michajłow
2a2b5aec5b tools/target_swr_fuzzer: fix memory leak on av_samples_fill_arrays() error
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:07 +02:00
Michael Niedermayer
d5ad860cd8 tests/checkasm/checkasm.c: Assert that aligned_w/h do not overflow
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:07 +02:00
Michael Niedermayer
4aeaee1f4e avcodec/ffv1enc: replace the remaining log2() by magic
big secret, reading a float as the corresponding integer is a good
approximation of log2() for numbers not too close to 1.0. At the same
time it maintains strict monotonicity

this reduces run time from 19sec to 17sec for the slowest of my testcases
(with default remap_optimizer 3)

Compression is about the same:

-rw-r----- 1 michael michael  497603370 Mar 30 15:23 float-303503-fixed-40-optim-3-1log2F.nut
-rw-r----- 1 michael michael  497603374 Mar 28 11:27 float-303503-fixed-40-optim-3b.nut
-rw-r----- 1 michael michael  549938852 Mar 28 11:27 float-303503-float16-40-optim-3b.nut
-rw-r----- 1 michael michael  549938857 Mar 30 15:23 float-303503-float16-40-optim-3-1log2F.nut
-rw-r----- 1 michael michael 1150827841 Mar 28 11:28 float-303503-float-40-optim-3b.nut
-rw-r----- 1 michael michael 1150832913 Mar 30 15:22 float-303503-float-40-optim-3ref-log2F2.nut

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:07 +02:00
Michael Niedermayer
98c1788370 avcodec/ffv1enc: replace 3 double precision log2() by 1 single precision log2()
This makes the remap finding heuristic much faster

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:06 +02:00
Michael Niedermayer
b4d165c68f doc: replace http/git by https urls
These are more secure

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:57:46 +02:00
Jun Zhao
efa0c6252f fftools/cmdutils: fix error message for "ffmpeg -init_hw_device list"
When running 'ffmpeg -init_hw_device list' to display available hardware
devices, it incorrectly shows an error message:
"Failed to set value 'list' for option 'init_hw_device': Immediate exit requested"

This is a regression introduced by commit a50f90f1c2. The command is
actually working as intended - it should exit after listing devices, but
shouldn't display an error message.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-04-03 06:29:12 +08:00
Jun Zhao
976c16109b doc/ffmpeg: document videotoolbox in -hwaccel option
Add videotoolbox to the list of supported hardware acceleration methods
in the -hwaccel option documentation. This option allows users to utilize
Apple's VideoToolbox framework for hardware-accelerated video decoding
on macOS and iOS devices.

The videotoolbox acceleration has been supported for a while, but was
missing from the documentation.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-04-03 06:28:51 +08:00
James Almer
d1f2f8eee0 tests/filter-video: add rgbtestsrc tests for gbrap
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-02 09:32:08 -03:00
James Almer
67c4891311 tests/filter-video: add yuvtestsrc tests for yuva444p
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-02 09:32:08 -03:00
James Almer
cd1ec359c4 avfilter/vsrc_testsrc: also fill alpha planes with a test pattern in {rgb,yuv}testsrc
And add support for more formats.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-02 09:32:08 -03:00
Andreas Rheinhardt
ca48e7bb70 avcodec/sbcdsp_data: Make data static
This data is only used by sbcdsp.c, so delete sbcdsp_data.h,
make a header out of sbcdsp_data.c and make the data contained
therein static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:46 +02:00
Andreas Rheinhardt
0ce8868878 avcodec/hevc/hevcdec: Use bitfield instead of array of flags
It is simpler, avoids several loops and also makes GCC no longer
emit bogus -Wstringop-overflow= warnings.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:38 +02:00
Andreas Rheinhardt
ffa56f73a9 avcodec/ac3dec: Read spx flags at once, not one bit at a time
Doing so gets rid of a stupid GCC -Wstringop-overflow= warning
(GCC somehow believes that fbw_channels can be 7 with the old
form of the code, so that channel_uses_spx[7] would be written
to, but now it no longer believes so).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:30 +02:00
Andreas Rheinhardt
2204efc2a6 avcodec/dct: Make declarations and definitions match
GCC considers declarations using a parameter of pointer
type (or equivalently a parameter using an array of unspecified
dimensions) to be inconsistent with a declaration using
a known-length array type and emits a -Warray-parameter warning
for several ff_j_rev_dct* functions for this.

This patch makes the declarations match the actual definitions
to suppress these (IMO nonsensical) warnings.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:24 +02:00
Cameron Gutman
839b41991d avcodec/nvenc: unify CBR filler data insertion for all codecs
Previously, AV1 used filler data with CBR by default while H.264
and HEVC may or may not depending on driver version. Make this
consistent by using not filler data in CBR mode for all codecs.

Since there are valid reasons to use CBR with or without filler,
also add a cbr_padding option to allow users to override this.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-04-01 19:13:38 +02:00
Martin Storsjö
c1a2da72cc checkasm: vp8dsp: Use checkasm_check_padded in check_mc
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:34:53 +03:00
Martin Storsjö
b863b81500 checkasm: Implement helpers for defining and checking padded rects
This backports similar functionality from dav1d, from commits
35d1d011fda4a92bcaf42d30ed137583b27d7f6d and
d130da9c315d5a1d3968d278bbee2238ad9051e7.

This allows detecting writes out of bounds, on all 4 sides of
the intended destination rectangle.

The bounds checking also can optionally allow small overwrites
(up to a specified alignment), while still checking for larger
overwrites past the intended allowed region.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:34:51 +03:00
Martin Storsjö
37c664a253 checkasm: Make checkasm_fail_func return whether we should print verbosely
This makes it easier to implement custom error printouts in tests.

This is a port of dav1d's commit
13a7d78655f8747c2cd01e8a48d44dcc7f60a8e5 into ffmpeg's checkasm.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:34:48 +03:00
Kieran Kunhya
4db571e516 checkasm/v210enc.c: Use checkasm_check()
This gives more informative printouts if the tests fail,
if checkasm is run with "-v".

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:31:58 +03:00
Martin Storsjö
d8ae11365c configure: Check for an actual function in VideoToolbox
This makes sure to disable VideoToolbox if building with an SDK
that does contain VideoToolbox, but targeting an older version of
the OS where it is unavailable. Previously, we would enable
VideoToolbox as long as the framework itself was found, which only
require the framework to exist in the SDK.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:31 +03:00
Martin Storsjö
d7d6e9ae69 videotoolboxenc: Add an iOS version condition for VTCopySupportedPropertyDictionaryForEncoder
This fixes building for iOS versions older than 11.0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:29 +03:00
Martin Storsjö
19a4719f3b libavfilter: metal: Fix the version condition for iOS
MTLDevice supportsFamily is available since iOS 13, not 11, see
https://developer.apple.com/documentation/metal/mtldevice/supportsfamily(_:)?language=objc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:26 +03:00
Martin Storsjö
1129957ae2 configure: Add a dependency for the audiotoolbox outdev
The audiotoolbox outdev uses APIs that only are available on macOS,
not on iOS or tvOS. Check for them in configure, and make sure the
outdev is disabled otherwise.

This allows building for iOS without explicitly having to disable
the audiotoolbox outdev.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:23 +03:00
Andreas Rheinhardt
4da84d5c2b swscale/swscale_unscaled: Actually use X2->RGBA64 conversions
The conversion functions were added in
e7382b4d01, yet they were never
really enabled. Found via -ffunction-sections and --gc-sections.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-31 21:45:20 +02:00
Andreas Rheinhardt
581a6a042c doc/encoders: Move FFV1 encoder to video encoder section
It is not an audio encoder.

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-31 21:44:58 +02:00
Niklas Haas
256a38101f tests/checkasm: fix wrong summation of bench time
This was changed 8 years ago with the introduction of the linux-perf path,
with seemingly no justification at the time. Likely a developer oversight
from testing.

This bug not only made --runs completely ineffective, but also meant that we
didn't actually correctly filter out outliers.

Fixes: e0d56f097f
2025-03-31 15:27:24 +02:00
Danil Iashchenko
1015ea2ba1 doc/filters: add thumbnail_cuda entry
Also update thumbnail_cuda filter description.
2025-03-31 18:48:01 +05:30
Niklas Haas
3e32dc8b08 tests/swscale: allow setting log verbosity
Helpful for debugging the new swscale code, since it dumps the
operations list in verbose logging mode.
2025-03-31 12:19:26 +02:00
Niklas Haas
92a57f1cfd tests/swscale: constrain reference SSIM for low bit depth formats
Sometimes, the reference SSIM is significantly higher than the
SSIM level expected for the test. This is the case when the source format
has a much lower bit depth than the destination format. In this case, the fact
that legacy swscale does not accurately preserve the source dither pattern
gives it an unfair advantage in a direct comparison, leading to false
positives.

For example, conversion like rgb4 -> rgb565 should be lossless, but swscale
low passes / downscales the input chroma, throwing away massive amounts of
detail. This gives it a higher SSIM score since the lowpassed result removes
some of the dither noise that was present in the source.
2025-03-31 12:19:26 +02:00
Niklas Haas
8fc9808f18 tests/swscale: calculate theoretical expected SSIM
We can calculate with some confidence the theoretical expected SSIM
from an "ideal" conversion, by computing the reference SSIM level
for an image dithered with uniformly distributed quatization noise.

This gives us an additional safety net to check for regressions even in
the absence of a reference to compare against.
2025-03-31 12:19:26 +02:00
Niklas Haas
9549daa996 tests/swscale: remove stray whitespace in scanf format 2025-03-31 12:19:24 +02:00
Niklas Haas
a22faeb992 tests/swscale: check supported inputs for legacy swscale separately
The new code path supports more formats, so we can't test them all
against the legacy implementation.
2025-03-31 12:19:08 +02:00
Niklas Haas
e1736d0d0b tests/swscale: print performance stats on exit 2025-03-31 12:19:08 +02:00
Niklas Haas
6c12b1535a tests/swscale: switch from MSE to SSIM
And bias it towards Y. This is much better at ignoring errors due to differing
dither patterns, and rewards algorithms that lower luma noise at the cost of
higher chroma noise.

The (0.8, 0.1, 0.1) weights for YCbCr are taken from the paper:
  "Understanding SSIM" by Jim Nilsson and Tomas Akenine-Möller
  (https://arxiv.org/abs/2006.13846)
2025-03-31 12:19:07 +02:00
Niklas Haas
1707e81073 tests/swscale: use yuva444p as reference
Instead of the lossy yuva420p. This does change the results compared to the
status quo, but is more reflective of the actual strength of a conversion,
since it will faithfully measure the round-trip error from subsampling and
upsampling.
2025-03-31 12:18:35 +02:00
Niklas Haas
f438f3f8cd tests/swscale: print speedup numbers in color 2025-03-31 12:18:35 +02:00
Niklas Haas
995986e512 tests/swscale: allow testing only unscaled convertors
I need this to be able to test the new unscaled conversion code more quickly.
We re-order the flags order to make 0 the first entry, so we don't set any
flags when performing unscaled tests.
2025-03-31 12:18:35 +02:00
Niklas Haas
d467ceaa9b tests/swscale: use hex format for flags values 2025-03-31 12:18:11 +02:00
Niklas Haas
0e2742a693 tests/swscale: allow choosing specific flags and dither mode
So I can quickly iterate on the new swscale code.
2025-03-31 12:16:10 +02:00
Andreas Rheinhardt
35c091f4b7 avformat/rtpenc: Check dimensions during init
Also fixes a -Wdeclaration-after-statement warning.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-31 08:04:05 +02:00
Michael Niedermayer
1d2c391005 avcodec/ffv1enc: Add -remap_optimizer option
This allows tuning how much effort (time) the encoder spends on
optimizing the remap table

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:20 +02:00
Michael Niedermayer
f765085115 avcodec/ffv1enc: Eliminate RemapEncoderState
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:20 +02:00
Michael Niedermayer
3faee894fc avcodec/ffv1enc: Eliminate copy_state
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:19 +02:00
Michael Niedermayer
2f0500f22c avcodec/ffv1enc: Better heuristic for selecting mul values.
This increases the search space from the hardcoded 17 tables
to ~ 23^512 tables

The mul_count choice is chosen by bruteforce

All testcases tried, improve

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:19 +02:00
Andreas Rheinhardt
948a78365b avcodec/dxa: Remove set-but-unused variable
Forgotten in 6e80ec9dc5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-30 21:31:16 +02:00
Tristan Matthews
c14b837ded speexdec: fix framesize for ultra-wideband
This matches how the libspeex decoder is calculating frame size (except in clamp form).

Fixes #11495

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-30 12:19:43 -03:00
Gyan Doshi
64087171f6 configure: add option to select use of response files 2025-03-30 17:22:10 +05:30
Andreas Rheinhardt
f47c8bca2c fftools/ffprobe: Make pix_fmt output bitexact
It is currently not due to endianness. This forced to add
workarounds with sed in fate/mxf.mak (which are removed
in this commit).
This is supposed to fix the enhanced-flv-hevc-hdr10 test
on big endian systems.

Reviewed-by: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-30 08:24:39 +02:00
Koushik Dutta
2657e1679e avformat/rtpenc: Add flag AVFMT_NODIMENSIONS.
Not all rtp formats require the video dimensions to be available
up front. H264 and HEVC will send them as stream parameters.
The flag is restrictive and prevents RTP repacketization
without parsing the codec information out of the stream.

This change checks to see if the codec parameters are available
on the rtp formats that need it.

Signed-off-by: Koushik Dutta <koushd@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-29 22:49:57 +01:00
Andreas Rheinhardt
5fac8d062d avcodec/ituh263enc: Add necessary #if checks for FLV encoder
Fixes compilation in case where the FLV encoder is disabled
with any other H.263 based encoder enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:48:34 +01:00
Andreas Rheinhardt
d3b940b0ff avcodec/rv10: Make logmessage endian-independent
Also fix a potential effective-type violation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:47:11 +01:00
Andreas Rheinhardt
13f06df4e1 avcodec/rv10: Remove pointless casts
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:45:48 +01:00
Andreas Rheinhardt
116fd73143 avcodec/mpegvideo: Don't set [bf]_code for non-MPEG-4 decoders
It is only used by encoders and the MPEG-4 decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:44:22 +01:00
Andreas Rheinhardt
8e070e1a75 avcodec/snowenc: Don't allocate obmc_scratchpad separately
Put it into SnowEncContext instead. Also use the proper type
(it is only used as IDWTELEM aka short).

(The allocation code allocated it in units of uint32_t,
yet it was never used in this way. I made the array so big
that the size (in bytes) does not change.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:42:55 +01:00
Andreas Rheinhardt
f80a939a2e avcodec/motion_est: Put map, me_map into MotionEstContext
They have a fixed size and given that nowadays
MotionEstContext is no longer in any decoder's private context,
it is not wasteful to just put it into there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:41:19 +01:00
Andreas Rheinhardt
526c401490 fate/vcodec: Test non-default b_strategy
With this modification the test would have caught the regression
introduced in 72bf3d3c12.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:39:55 +01:00
Andreas Rheinhardt
074d8343d6 avcodec/mpegvideo_enc: Don't use unnecessarily much stack
encode_thread() puts two MPVEncContexts (2*6516B here)
on the stack and zeroes one of them in order to
temporarily store the variables that get changed
during encoding a macroblock (when there is more than
one candidate type for a macroblock). This is wasteful
and therefore this commit adds a small (328B here) structure
to store exactly the fields that actually need to be backed
up. Then one can extend MPVEncContext without fearing
too use up to much stack.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:38:30 +01:00
Andreas Rheinhardt
f8360ed629 avcodec/mpegvideo_enc: Pass data_partitioning directly
This avoids having to store it in the backup MPVEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:37:04 +01:00
Andreas Rheinhardt
1422f0057c avcodec/x86/mpegvideoenc_template: Remove remnants of MMX
Forgotten in 7284ab789d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:30:15 +01:00
llyyr
8c7b00ba3a avutil/hwcontext_vulkan: stop checking for deprecated and removed flag
AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY was deprecated in e0f2d2e702
and removed in 09a5760299

Fixes: e0f2d2e702
Fixes: 09a5760299
2025-03-29 00:40:48 +01:00
James Almer
b6bcc1c3c2 avcodec/exr: deprecate gamma and apply_trc options
Decoders should not modify sample values, as that's the job of a library like swscale.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:44:38 -03:00
James Almer
b338d1b35b libs: bump major version for all libraries
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:44:34 -03:00
Andreas Rheinhardt
aaf3cd9ddb avcodec/raw: Duplicate raw_pix_fmt_tags into fourcc2pixfmt tool
Do this instead of exporting raw_pix_fmt_tags
via avpriv_get_raw_pix_fmt_tags().

For shared builds this will lead to an increase in the
combined size of the lavc and fourcc2pixfmt binaries
(because the overhead of exporting avpriv_get_raw_pix_fmt_tags()
is dwarfed by the size of the array), but given that
fourcc2pixfmt is a test tool that is not widely distributed
it does not really matter. For static builds the opposite
is true (the rest of lavc/raw.o is no longer pulled into
the test tool and the getter can be removed, too).

This patch has the additional benefit of removing
struct PixelFormatTag from the ABI.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-28 14:33:31 -03:00
Andreas Rheinhardt
0ccf385e13 avutil/float_dsp: Unavpriv avpriv_scalarproduct_float_c()
Not worth the overhead of exporting it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
Andreas Rheinhardt
c389d9ac78 avutil/dict: Unavpriv avpriv_dict_set_timestamp()
And move it to lavf, its only user.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
Andreas Rheinhardt
b306683d12 avutil/frame: Port AVFrame.private_ref to RefStruct API
This is possible without deprecation period, because said field
is documented as only for our libav* libraries and not the general
public.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
d6b215052b avutil/version_major: postpone some deprecations until the next bump
They are too recent.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
97609725f8 avutil: remove deprecated FF_API_H274_FILM_GRAIN_VCS
Deprecated since 2024-03-23.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
09a5760299 avutil: remove deprecated FF_API_VULKAN_CONTIGUOUS_MEMORY
Deprecated since 2023-05-28.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
6e80ec9dc5 avutil: remove deprecated FF_API_PALETTE_HAS_CHANGED
Deprecated since 2023-05-18.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
1061689ad8 avutil: remove deprecated FF_API_FRAME_KEY
Deprecated since 2023-05-04.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
8af3331883 avutil: remove deprecated FF_API_INTERLACED_FRAME
Deprecated since 2023-05-04.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
ebd6d07ab9 avutil: remove deprecated FF_API_FRAME_PKT
Deprecated since 2023-03-20.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00
James Almer
10f199cfa5 avutil: remove deprecated FF_API_HDR_VIVID_THREE_SPLINE
Deprecated since 2023-03-17.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
a9d9f46e9a avfilter/version_major: postpone some deprecations until the next bump
They are too recent.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
379632bb97 avfilter: remove deprecated FF_API_LINK_PUBLIC
Deprecated since 2024-03-08.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
ef8bf6ca24 avformat/version_major: postpone some deprecations until the next bump
They are either too recent, or are not trivial to remove.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
b2564b0ab8 avformat: remove deprecated FF_API_GET_DUR_ESTIMATE_METHOD
Deprecated since 2024-03-06.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
ec8e796b42 avformat: remove deprecated FF_API_AVSTREAM_SIDE_DATA
Deprecated since 2023-10-06.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
c153238275 avformat: remove deprecated FF_API_ALLOW_FLUSH
Deprecated since 2023-10-02.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
3fd10e0cf3 avformat: remove deprecated FF_API_LAVF_SHORTEST
Deprecated since 2023-09-18.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
8a7ce397bc avdevice/version_major: postpone some deprecations until the next bump
They are too recent.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
17b31065f0 avdevice: remove deprecated FF_API_SDL2_DEVICE
Deprecated since 2024-02-28.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
9283c5251f avdevice: remove deprecated FF_API_OPENGL_DEVICE
Deprecated since 2024-02-28.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
a5064a72ff avdevice: remove deprecated FF_API_BKTR_DEVICE
Deprecated since 2024-02-02.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
b439ea4320 avcodec/version_major: postpone some deprecations until the next bump
They are either too recent, or need more work before they can be removed.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
bd58a68dbc avcodec: remove deprecated FF_API_QUALITY_FACTOR
Deprecated since 2024-03-29.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
638690b872 avcodec: remove deprecated FF_API_VDPAU_ALLOC_GET_SET
Deprecated since 2024-03-07.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
fbaa8c3a7d avcodec: remove deprecated FF_API_BUFFER_MIN_SIZE
Deprecated since 2024-02-20.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
0d48da2db0 avcodec: remove deprecated FF_API_AVCODEC_CLOSE
Deprecated since 2024-02-09.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
8224327698 avcodec: remove deprecated FF_API_FF_PROFILE_LEVEL
Deprecated since 2023-09-06.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
84c64e079c avcodec: remove deprecated FF_API_AVFFT
Deprecated since 2023-09-01.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
5828624246 avcodec: remove deprecated FF_API_DROPCHANGED
Deprecated since 2023-07-15.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
7d07723db5 avcodec: remove deprecated FF_API_TICKS_PER_FRAME
Deprecated since 2023-05-15.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
James Almer
c29a1cbd03 avcodec: remove deprecated FF_API_SUBFRAMES
Deprecated since 2023-05-15.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:06 -03:00
Michael Niedermayer
bddb9c232d avcodec/raw: Add GBR(A)PF16/32LE/BE
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-28 15:23:28 +01:00
Michael Niedermayer
5bf6d9c3e3 avformat/nut: Add GBR(A)PF16/32LE/BE
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-28 15:23:28 +01:00
Michael Niedermayer
226fcc7258 avcodec/ffv1enc: Store run1start_mul_index instead of computing
There is a special case I missed, its simpler to just store

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-27 22:02:51 +01:00
Michael Niedermayer
f334eadd36 avcodec/ffv1enc: Fix off by 1 in assert
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-27 22:02:46 +01:00
Michael Niedermayer
d4a23e6640 avcodec/ffv1enc: Fix end handling
This also produces smaller files

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-27 22:02:42 +01:00
Michael Niedermayer
430065a97b avcodec/ffv1dec: Fix end handling
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-27 22:02:36 +01:00
Michael Niedermayer
ffd537bcc2 avcodec/ffv1enc: Eliminate encode_mul()
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-27 21:50:14 +01:00
Lynne
8804ae158b vulkan_functions: add note to update ff_vk_extensions_to_mask
Otherwise, the extension looks like its enabled, but isn't
actually used by anything.
2025-03-27 17:22:12 +01:00
Lynne
5595068be5 vulkan_loader: remap video_maintenance2 in ff_vk_extensions_to_mask
This was broken.
2025-03-27 17:22:11 +01:00
Lynne
193610d9ba vulkan_decode: allow using NULL offsets/nb_slices in ff_vk_decode_add_slice()
For codecs like VP9 which use a single slice.
2025-03-27 17:22:11 +01:00
Lynne
5fc4acae9c vulkan_decode: allow using NULL sequence_params when decoding
The function had some checks to allow for this, but as it always tried
to dereference a bufferref, it wasn't fully ready.
2025-03-27 17:22:11 +01:00
Lynne
4dadf71dce lavu/vulkan: skip adding NULL buffers as deps in ff_vk_exec_add_dep_buf
Allows for cleaner code.
2025-03-27 17:22:07 +01:00
Andreas Rheinhardt
2ac2485c1f avcodec/mjpegenc: Don't allocate unnecessarily much memory
We need to allocate space for 64 coefficients per block;
24dbc4c2e8 wanted to
perform the calculation 64*sizeof(MJpegHuffmanCode)
at compile time, yet in the end did it in a way that
made it allocate 64 times as much memory as needed.

Reported-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-27 13:41:06 +01:00
Andreas Rheinhardt
114fccc4a5 avcodec/mpegvideo_enc: Set b-frame chain length properly
Fixes a regression caused by my desire to use loop-scope
for iterators in 72bf3d3c12.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-27 03:16:18 +01:00
Andreas Rheinhardt
4e806b3266 avcodec/mpeg4videodec: Actually check av_buffer_replace()
Forgotten in 4f2becc2dc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-27 03:16:18 +01:00
Martin Storsjö
d256118b7e videotoolbox: Fix building with older SDKs
The kVTVideoDecoderReferenceMissingErr constant was only added
in the macOS 12 and iOS 15 SDKs. Use a hardcoded value instead
of the named constant, to fix building with older SDKs
after c6214b0d69.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-26 22:33:16 +02:00
Andreas Rheinhardt
e5a33c898a avcodec/mpegvideo: Only keep the actually used unquantize funcs
For all encoders and all decoders except MPEG-4 the unquantize
functions to use don't change at all and therefore needn't be
kept in the context. So discard them after setting them;
for MPEG-4, the functions get assigned on a per-frame basis.

Decoders not using any unquantize functions (H.261, MPEG-1/2)
as well as decoders that only call ff_mpv_reconstruct_mb()
through error resilience (RV30/40, the VC-1 family) don't have
the remaining pointers set at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:17:00 +01:00
Andreas Rheinhardt
917652d7c8 avcodec/ppc/mpegvideo_altivec: Don't process coeffs as scalars
block_last_index and nCoeffs is an optimization designed
to avoid processing unnecessarily many coefficients; yet
it would be legal to always process all coefficients
(all coefficients beyond nCoeffs are zero anyway and
zeros are always unquantized to zeros). Therefore
one does not need a scalar tail.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:16:35 +01:00
Andreas Rheinhardt
46c5466dd8 avcodec/ppc/mpegvideo_altivec: Don't process unnecessarily many coeffs
Use the same number as the C version.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:16:11 +01:00
Andreas Rheinhardt
b96ba44432 avcodec/ppc/mpegvideo_altivec: Set unquantize functions unconditionally
Don't do it depending upon dct_algo, as this is not supposed
to influence the unquantize function selection.
(This check originated in 05c4072b45
where it was used for the dct_quantize function only.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:15:46 +01:00
Andreas Rheinhardt
b2866b7216 avcodec/ppc/mpegvideo_altivec: Use correct inter scantable
This affected the WMV1/2 encoders (but not when running FATE because
the encoding part uses the fastint dct, so this code isn't used
then anyway).

It did not affect anything else, because a) only WMV1/2 use different
scantables, b) ff_msmpeg4_decode_block() (and therefore the WMV1
decoder) already unquantize inter macroblocks as they are parsed
c) the WMV2 decoder does not use the unquantize functions for inter
macroblocks at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:15:22 +01:00
Andreas Rheinhardt
63864545cd avcodec/mpegvideo: Move unquantize functions into a file of their own
This is in preparation for only keeping the actually used
unquantize functions in MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:14:49 +01:00
Andreas Rheinhardt
34b624d98c avcodec/error_resilience: Avoid me_cmp.h inclusion
Use spell out what me_cmp_func means.
Avoids inclusions in the H.264 decoder as well as all
mpegvideo decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:14:15 +01:00
Andreas Rheinhardt
b29ae29ee7 avcodec/h261dec: Set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
This decoder sets the AVCodecContext fields even when a frame
is skipped.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:13:50 +01:00
Andreas Rheinhardt
46a2d03b75 avcodec/mpegvideo_enc: Use better variable name
Also fixes shadowing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:13:24 +01:00
Andreas Rheinhardt
d5fba4aef9 avcodec/mpegvideo_enc: Defer initialization of mb-pos dependent vars
Only set them after mb_x and mb_y are known which happens
only after the call to ff_h261_reorder_mb_index().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:12:58 +01:00
Andreas Rheinhardt
854a3ed547 avcodec/motion_est: Reset scene_change score, MB variance stats
Reset them in ff_me_init_pic(). It is the appropriate place for it
and allows to remove resetting code from multiple places
(e.g. mpegvideo_enc.c resetted it in two different places
(one for the main slice context, one for all the others)).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:12:30 +01:00
Andreas Rheinhardt
479dac17f8 avcodec/mpegvideo_enc: Move code to initialize variables immediately
Also avoid casts and parentheses.
(This is only possible now because ff_update_duplicate_context()
no longer touches the PutBitContext.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:12:04 +01:00
Andreas Rheinhardt
6e45f7f535 avcodec/mpegvideo: Move MotionEstContext to MPVEncContext
All that is necessary to do so is perform ff_me_init_pic()
on every slice.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:11:32 +01:00
Andreas Rheinhardt
35fecd3e68 avcodec/motion_est: Move ff_h263_round_chroma() to h263.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:11:00 +01:00
Andreas Rheinhardt
ec6c8e5273 avcodec/mpegvideoenc: Constify vlc length pointees
These pointers point to static tables which must not be modified
by anyone after they have been initialized. So constify the pointees.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:10:31 +01:00
Andreas Rheinhardt
8b15979a4b avcodec/mpegvideo_enc: Don't reset statistics twice
This happens currently for the non-main slice contexts.
But these variables get reset at the start of encode_thread()
anyway for all slices, so this is unnecessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:10:06 +01:00
Andreas Rheinhardt
d66e9cb0d2 avcodec/mpegvideo_enc: Move lambda, lambda2 to MPVEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:09:33 +01:00
Andreas Rheinhardt
6ebc810e6f avcodec/mpeg12enc, speedhqenc: Optimize writing escape codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:09:10 +01:00
Andreas Rheinhardt
a064d34a32 avcodec/mpegvideoenc: Add MPVEncContext
Many of the fields of MpegEncContext (which is also used by decoders)
are actually only used by encoders. Therefore this commit adds
a new encoder-only structure and moves all of the encoder-only
fields to it except for those which require more explicit
synchronisation between the main slice context and the other
slice contexts. This synchronisation is currently mainly provided
by ff_update_thread_context() which simply copies most of
the main slice context over the other slice contexts. Fields
which are moved to the new MPVEncContext no longer participate
in this (which is desired, because it is horrible and for the
fields b) below wasteful) which means that some fields can only
be moved when explicit synchronisation code is added in later commits.

More explicitly, this commit moves the following fields:
a) Fields not copied by ff_update_duplicate_context():
dct_error_sum and dct_count; the former does not need synchronisation,
the latter is synchronised in merge_context_after_encode().
b) Fields which do not change after initialisation (these fields
could also be put into MPVMainEncContext at the cost of
an indirection to access them): lambda_table, adaptive_quant,
{luma,chroma}_elim_threshold, new_pic, fdsp, mpvencdsp, pdsp,
{p,b_forw,b_back,b_bidir_forw,b_bidir_back,b_direct,b_field}_mv_table,
[pb]_field_select_table, mb_{type,var,mean}, mc_mb_var, {min,max}_qcoeff,
{inter,intra}_quant_bias, ac_esc_length, the *_vlc_length fields,
the q_{intra,inter,chroma_intra}_matrix{,16}, dct_offset, mb_info,
mjpeg_ctx, rtp_mode, rtp_payload_size, encode_mb, all function
pointers, mpv_flags, quantizer_noise_shaping,
frame_reconstruction_bitfield, error_rate and intra_penalty.
c) Fields which are already (re)set explicitly: The PutBitContexts
pb, tex_pb, pb2; dquant, skipdct, encoding_error, the statistics
fields {mv,i_tex,p_tex,misc,last}_bits and i_count; last_mv_dir,
esc_pos (reset when writing the header).
d) Fields which are only used by encoders not supporting slice
threading for which synchronisation doesn't matter: esc3_level_length
and the remaining mb_info fields.
e) coded_score: This field is only really used when FF_MPV_FLAG_CBP_RD
is set (which implies trellis) and even then it is only used for
non-intra blocks. For these blocks dct_quantize_trellis_c() either
sets coded_score[n] or returns a last_non_zero value of -1
in which case coded_score will be reset in encode_mb_internal().
Therefore no old values are ever used.

The MotionEstContext has not been moved yet.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 04:08:33 +01:00
Andreas Rheinhardt
d74d1707a6 avcodec/motion_est: Don't use MpegEncContext.avctx
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:47:55 +01:00
Andreas Rheinhardt
6a42abe561 avcodec/mpegvideo: Move motion_est to MotionEstContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:47:22 +01:00
Andreas Rheinhardt
913322a267 avcodec/mpegvideo: Move me_pre, me_penalty_compensation to MPVMainEncCtx
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:46:49 +01:00
Andreas Rheinhardt
0e333a5451 avcodec/mpeg4videoenc: Move initializations before ff_mpv_encode_init()
This avoids relying on ff_update_duplicate_context() to copy
these fields to the slice contexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:46:24 +01:00
Andreas Rheinhardt
8397351221 avcodec/mpegvideo_enc: Call ff_mpv_common_init() later
Namely after the main slice context has already been initialized,
so that this initialized state is directly copied to the newly
created slice contexts without relying on it being copied
by ff_update_duplicate_context(). This is in preparation for further
commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:45:57 +01:00
Andreas Rheinhardt
a2ba5b8242 avcodec/mpegvideoenc: Remove declaration of inexistent function
ff_MPV_encode_init_x86() has been renamed to ff_dct_encode_init_x86()
in 6b33e91899 in FFmpeg; libav renamed
it to ff_mpv_encode_init_x86() in commit
6b33e91899. This hasn't been noticed
in c1df467d73 when merging.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:45:27 +01:00
Andreas Rheinhardt
363fe86115 avcodec/{h261,ituh263}enc: Don't set ptr_lastgob unnecessarily
It will be overwritten later in encode_thread() anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:45:02 +01:00
Andreas Rheinhardt
fa630b481c avcodec/mpegvideo: Move last-pic information to MPVMainEncContext
last_pict_type, last_non_b_pict_type and last_lambda_for
are only used by the encoder's main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:44:30 +01:00
Andreas Rheinhardt
f293f95632 avcodec/mpegvideo: Support custom slice context sizes
This is in preparation for adding a special slice context for
the encoders and moving all the encoder-specific fields to it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:43:58 +01:00
Andreas Rheinhardt
1b537de8d4 avcodec/mpegvideo: Move noise_reduction to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:43:25 +01:00
Andreas Rheinhardt
f2ba0676b6 avcodec/mpegvideo_enc: Move allocating remaining buffers to init_buffers
Also allocate mb_type, mc_mb_var, mb_var and mb_mean jointly
while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:41:52 +01:00
Andreas Rheinhardt
a1f18b195e avcodec/mpegvideo_enc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:41:26 +01:00
Andreas Rheinhardt
9f43de06fa avcodec/mpegvideo_enc: Don't allocate B-frame bufs without B frames
(Checking in the same way for intra_only is not straightforward,
because at least p_mv_table is written to even in intra_only
mode.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:41:00 +01:00
Andreas Rheinhardt
7b5fb2e4ff avcodec/mpegvideo: Move encoder-only base arrays to MPVMainEncContext
Also allocate them jointly (thereby reducing the number of base
arrays considerably) and already set them on all slice contexts;
don't rely on ff_update_duplicate_context().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:40:27 +01:00
Andreas Rheinhardt
a5a2fc04ee avcodec/mpegvideo: Move allocating encoder buffers to mpegvideoenc.c
dct_error_sum and me.map are allocated per slice-context
and therefore their allocation has not been moved to
mpegvideoenc.c in 0154fb43e3.

This commit changes this by allocating them jointly and
moving said allocations to mpegvideo_enc.c like the other
encoder-only buffers.
The buffers are suitably aligned to ensure that no false
sharing occurs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:39:58 +01:00
Andreas Rheinhardt
9964212545 avcodec/mpegvideo: Move MSMPEG4 fields to MSMPEG4 contexts
Several fields are not used by any generic code and can therefore
be moved to more specialized contexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:39:25 +01:00
Andreas Rheinhardt
967f8a924e avcodec/msmpeg4enc: Avoid using MVTable
Switch to using the length+symbol table combination that is
also used by the decoder and remove MVTable as well as
the old tables altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:39:01 +01:00
Andreas Rheinhardt
3d9a581ec1 avcodec/msmpeg4dec: Avoid lookups when decoding motion vector
Up until now, the decoder uses VLCs to determine whether
this is an escape element or an index in two separate tables
giving the x and y components of the motion vector.
Given that both these components fit into an int16_t and therefore
into a VLCElem's symbol one can simply use a symbol table
to avoid the latter lookups.

This necessitated to combine the two tables for x and y components.
While just at it, also switch to ff_vlc_init_tables_from_lengths().
This will allow to get rid of the code tables (about 4KiB) once
the encoder has been ported, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:38:36 +01:00
Andreas Rheinhardt
82a856e2e9 avcodec/msmpeg4enc: Use LUT to write motion vectors
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:38:11 +01:00
Andreas Rheinhardt
6d47d569d7 avcodec/mpegvideo: Move bit_rate field to MSMP4DecContext
Also make it an int as that is all MSMP4 needs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:37:39 +01:00
Andreas Rheinhardt
f733cfca28 avcodec/msmpeg4dec: Add MSMPEG4DecContext
This is in preparation for further commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:37:14 +01:00
Andreas Rheinhardt
0a9f58a7a1 avcodec/mpeg12dec: Add bit_rate field to Mpeg1Context
Use it instead of MpegEncContext.bit_rate which will be removed soon.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:36:49 +01:00
Andreas Rheinhardt
9f469e244e avcodec/mpegvideoenc: Add bit_rate to MPVMainEncContext
Use it instead of the MpegEncContext field which will
be removed soon.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:36:20 +01:00
Andreas Rheinhardt
bceeb35857 avcodec/mpegvideo: Move vbv_delay_pos to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:35:47 +01:00
Andreas Rheinhardt
bf4dedd6b5 avcodec/mpegvideo: Move MPVPicture arrays to MPVMainEncContext
Also avoid allocations while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:35:16 +01:00
Andreas Rheinhardt
72bf3d3c12 avcodec/mpegvideo: Move max_b_frames to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:34:44 +01:00
Andreas Rheinhardt
6e02882656 avcodec/mpegvideo: Add pointer to main context to slice contexts
It is a pointer to const to allow the slice threads to inspect
values without modifying them; also make it a simple cast
for codecs that don't support slice threading.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:34:12 +01:00
Andreas Rheinhardt
78391f20c8 avcodec/mjpegenc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:33:48 +01:00
Andreas Rheinhardt
5affd0221e avcodec/mpegvideo_enc: Use func ptr for encoding macroblocks
It gets rid of a switch (with accompanying CONFIG_*_ENCODER checks);
for MJPEG, it even lets one perform the check for whether one is
really encoding or only recording the macroblock once during init.

Furthermore, the switch actually contained lots of dead code --
it is compiled three times (for different pixel formats: 420, 422, 444),
yet most encoders only support 420. The approach used here automatically
fixes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:33:15 +01:00
Andreas Rheinhardt
2f73a197a1 avcodec/mjpegenc: Move mjpeg_encode_init() down
Will avoid a forward declaration later.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:32:51 +01:00
Andreas Rheinhardt
5308eeae5c avcodec/speedhqenc: Remove declaration of non-existent function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:32:26 +01:00
Andreas Rheinhardt
7751b0cbed avcodec/mpegvideo: Move fcode_tab to MPVMainEncContext
Only used by the main encoding thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:31:55 +01:00
Andreas Rheinhardt
ecba58311c avcodec/mpegvideo_enc: Use function ptr for encode_picture_header
This gets rid of a switch and (in case of FMT_H263) several
ifs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:31:26 +01:00
Andreas Rheinhardt
b2393a5ab1 avcodec/wmv2enc: Move wmv2_encode_init() down
Will avoid forward declarations later.
While just at it, forward ff_mpv_encode_init() errors.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:31:02 +01:00
Andreas Rheinhardt
e308292a31 avcodec/speedhqenc: Move speedhq_encode_init() down
Will avoid forward declarations later.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:30:38 +01:00
Andreas Rheinhardt
6b6b34df35 avcodec/mpegvideo: Move header_bits to MPVMainEncContext
The header is always written by the main thread, so it is
not surprising that header_bits can be moved to MPVMainEncContext
as well.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:30:07 +01:00
Andreas Rheinhardt
b038c7af0c avcodec/mpegvideo: Move macroblock-variance stats to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:29:35 +01:00
Andreas Rheinhardt
553fc3a764 avcodec/mpegvideoenc: Disable scenechange threshold opt for MJPEG, AMV
It makes no sense for them. Also do the same for the mv0 flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:29:07 +01:00
Andreas Rheinhardt
d1fd8665fb avcodec/mpegvideo: Move ratecontrol-adjacent fields to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:17:52 +01:00
Andreas Rheinhardt
b710698571 avcodec/mpegvideo: Move sequence-level properties to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:16:03 +01:00
Andreas Rheinhardt
d9dea7088d avcodec/mpegvideo_enc: Move MPEG-4 specific check to mpeg4videoenc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:15:37 +01:00
Andreas Rheinhardt
fca1ac2cba avcodec/mpeg4videoenc: Add Mpeg4EncContext and move time_increment_bits
It is only ever used by the main encoder thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:15:05 +01:00
Andreas Rheinhardt
e8a8a13128 avutil/slicethread: Mark avpriv_slicethread_{create,free} as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:14:41 +01:00
Andreas Rheinhardt
f9fe1e07ad avutil/slicethread: Remove NULL pointer check when freeing
avpriv_slicethread_free() is one of our functions that takes
a pointer to a pointer and resets the pointer when done.
It is legal for such functions to be passed a pointer to a NULL
pointer, yet passing a NULL pointer would be insane and should
not be tolerated.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:14:17 +01:00
Andreas Rheinhardt
7d1bf0ac7a avcodec/pthread_slice: Return error on error
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:13:53 +01:00
Andreas Rheinhardt
c82101c9ce avcodec/pthread_slice: Remove MPEG-1 height hack
This is no longer necessary given that the MPEG-1 encoder
now adapts the size of the last slice to ensure that
no slice header has an invalid slice_start_code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:13:29 +01:00
Andreas Rheinhardt
4eb86951fc avcodec/mpeg12enc: Don't write invalid MPEG-1 slice headers
The valid values for slice_start_code are 0x1..0xAF, which implies
that one can't start a slice with row nb > 174 (zero-based).
This problem can be encountered with files of sufficient height
(more than 2800 pixels) either by using the slice option or by
imposing an RTP payload limit.

Fix this by making the last slice start on the maximum allowed
slice row if necessary and divide the first 174 rows to the remaining
slices. This will impede parallelism both in the decoder and encoder,
but that is unavoidable.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:13:04 +01:00
Andreas Rheinhardt
6ecdbcc454 avcodec/mpeg12enc: Merge ff_mpeg1_encode_init() into ordinary init
Everything except setting the dc_scale_tables can be done
before calling ff_mpv_encode_init(); setting the dc_scale_tables
unfortunately still has to be performed via a (now inlined)
callback performed by ff_mpv_encode_init() as it relies
on intra_dc_precision having been sanitized.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:12:38 +01:00
Andreas Rheinhardt
34557b1d30 avcodec/mpeg12enc: Move encode_init() to the end of the file
Will avoid forward declarations later.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:12:14 +01:00
Andreas Rheinhardt
edebd1d9a4 avcodec/mpegvideo_enc: Only set fcode_tab if unset
This is in preparation for merging ff_mpeg1_encode_init()
into the MPEG-1/2 encoder's init function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:11:49 +01:00
Andreas Rheinhardt
24dbc4c2e8 avcodec/mjpegenc: Simplify allocating huffman table
Reuse the already computed value of macroblocks; use an array
instead of a switch, evaluate 64 * sizeof(MJpegHuffmanCode)
at compile-time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:11:26 +01:00
Andreas Rheinhardt
dcd4daee8c avcodec/mjpegenc: Make mjpeg_encode_init() call ff_mpv_encode_init()
Right now, ff_mpv_encode_init() is set as FFCodec.init and
calls ff_speedhq_encode_init(). The opposite is more natural,
avoids a non-static function and allows to reuse e.g.
slice_context_count instead of duplicating the logic from
ff_mpv_common_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:11:00 +01:00
Andreas Rheinhardt
9928b9e9fa avcodec/speedhqenc: Avoid indirection
Namely use avctx directly instead of s->avctx. While just at it,
also move the switch to the other checks involving avctx.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:10:37 +01:00
Andreas Rheinhardt
565e57ea87 avcodec/speedhqenc: Make speedhq_encode_init() call ff_mpv_encode_init()
Right now, ff_mpv_encode_init() is set as FFCodec.init and
calls ff_speedhq_encode_init(). The opposite is more natural
and avoids a non-static function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:10:12 +01:00
Andreas Rheinhardt
c757f948d1 avcodec/mpegvideo: Don't initialize [yc]_dc_scale_table by default
Only the H.263-based decoders as well as the encoders need it;
so move it to ff_h263_decode_init() as well as ff_mpv_encode_init().
Also for the latter make it only set these tables if none are
already set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:09:47 +01:00
Andreas Rheinhardt
b7ee7994cc avcodec/h261enc: Make h261_encode_init() call ff_mpv_encode_init()
Right now, ff_mpv_encode_init() is set as FFCodec.init and
calls ff_h261_encode_init(). The opposite is more natural
and avoids a non-static function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:09:23 +01:00
Andreas Rheinhardt
3275d788ec avcodec/mpegvideo: Move frame_skip_* fields to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:08:52 +01:00
Andreas Rheinhardt
4d79175b9a avcodec/mpegvideo_enc: Precalculate which frames to reconstruct
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:08:22 +01:00
Andreas Rheinhardt
d8c7925e32 avcodec/mpegvideoenc: Move ratecontrol to MPVMainEncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:07:52 +01:00
Andreas Rheinhardt
bb0a72b100 avcodec/mpegvideoenc: Move tmp bframes to MPVMainEncContext
Also move b_frame_strategy and b_sensitivity and brd_scale;
they are all only used by an encoder's main thread when
b_frame_strategy == 2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:07:22 +01:00
Andreas Rheinhardt
f507f26e47 avcodec/mpegvideoenc: Add MPVMainEncContext
This is in preparation for moving all the elements from
MpegEncContext that are only used by the main encoder thread
to MPVMainEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:06:54 +01:00
Andreas Rheinhardt
ad4f6a3d6e avcodec/mpegvideo(_enc)?: Mark init, close functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-26 03:06:10 +01:00
James Almer
08e334e462 avformat/movenccenc: add support for CENC AV1 encryption
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-25 20:59:18 -03:00
James Almer
5631704d83 avcodec/cbs: allow fine tunning selection of features
Core framework and AV1 only for now.
This will be useful in an upcoming commit, where CBS will be utilized by
a module outside libavcodec.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-25 20:38:29 -03:00
James Almer
3e0b38ed7f avcodec/cbs_av1: also store a pointer to the start of the tile group data
This will be useful a following commit, where the offset of the Tile Group
inside a Frame OBU needs to be known.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-25 11:09:16 -03:00
softworkz
d435b641a2 MAINTAINERS: Add myself
will move to specific areas once they are there.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:38:21 +01:00
Michael Niedermayer
8af28d2eb1 avcodec/ffv1enc: Eliminate index_stack and delta_stack
This reduces stack space requirements my 1.5 mb and should fix fate

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:38:20 +01:00
Michael Niedermayer
051fd03f6c avcodec/ffv1enc: Heuristic to select fixed in float multipliers
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:32:14 +01:00
Michael Niedermayer
a33908d051 avcodec/ffv1enc: Factorize s.last_val update out
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:32:14 +01:00
Michael Niedermayer
836add03a8 avcodec/ffv1enc: Simplify last_val update
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:32:11 +01:00
Michael Niedermayer
4b24c5ba69 avcodec/ffv1enc: introduce step to simplify code
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:31:08 +01:00
Michael Niedermayer
e9cfed35a5 avcodec/ffv1enc: eliminate if()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:24:13 +01:00
Michael Niedermayer
522fc389e8 avcodec/ffv1dec: replace literal 65535 by what it is
should make the code easier to understand

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:24:13 +01:00
Michael Niedermayer
5ca14b23f1 avcodec/ffv1dec: compute end instead of hardcoding it and test for fltmap correctly
A step toward supporting remap for integer formats less than 16 bit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:24:12 +01:00
Michael Niedermayer
3813559660 avcodec/ffv1enc: remap table size is 1<<bits_per_raw_sample not fixed 65536
not a bugfix as this path was only used for float16 but it makes sense
to allow using this for integers too

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:24:12 +01:00
Michael Niedermayer
e619b0d817 avcodec/ffv1enc: remap mode 2 is for floats only
(you could use it for others but it makes no sense)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-25 11:24:12 +01:00
Gyan Doshi
8b2372cac7 ffmpeg-filter: check for initialized graph
Don't drop frame if graph hasn't been initialized yet!
2025-03-25 01:06:03 +05:30
James Almer
044664ac3b avcodec/ffv1enc: remove mixed declarations and code
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-24 16:34:24 -03:00
James Almer
a4cf0979a4 avcodec/ffv1enc: update missing Unit accesses inside av_assert2
Fixes compilation with assert-level=2.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-24 16:32:47 -03:00
James Almer
702239bc50 avcodec/ffv1enc: reduce stack usage
Fixes failures in some systems since 171060d5dc.
This can be further improved by only allocating the arrays when needed.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-24 13:55:56 -03:00
James Almer
fee5b0a383 fftools/ffmpeg_filter: ensure ifp is set before dereferencing it
Fixes segfaults since cbbc927a67.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-24 10:10:19 -03:00
Michael Niedermayer
5dcf566f69 avcodec/ffv1: Implement 2D RLE for remap
ATM this performs as well or better as any other algorithm tried.
Its simple for the decoder.
On the encoder side complexity depends on how parameters are
chosen. But with a fixed mul_count of 1 and basic heuristic
it performs as well as any more complex choice i tried so far.

The encoder code here is flexible and allows mul_count > 1
and also can easily be used to exactly test various parameters.

With mul_count=512 we can gain another 6% in remap table size
for fixed point in float data. (this is not implemented in this
patch though)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-24 13:46:59 +01:00
Michael Niedermayer
0538b4c569 avcodec/ffv1dec: remove unused var 2025-03-24 13:46:58 +01:00
Michael Niedermayer
e19496fe71 avcodec/ffv1enc: remap allows using rice golomb with more bits
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-24 13:46:58 +01:00
Michael Niedermayer
171060d5dc avcodec/ffv1: 32-bit float sample support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-24 13:46:58 +01:00
Michael Niedermayer
62c7d08947 avcodec/ffv1: Fix remap ordering
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-24 13:46:57 +01:00
Gyan Doshi
cbbc927a67 ffmpeg: add per-stream input option drop_changed
This is a replacement in ffmpeg for the deprecated avcodec flag AV_CODEC_FLAG_DROPCHANGED.

This option is meant to be used when the filtergraph should not be
reinited upon input parameter changes as that leads to loss of state
in the filtergraph potentially leading to broken or aborted output,
e.g. inserting of silence with first_pts specified in aresample.

Generally useful to avoid corrupted yet decodable packets in live
streaming inputs.

This option when enabled takes precedence over reinit_filters
2025-03-24 16:18:17 +05:30
Gyan Doshi
323cb8c61e ffmpeg_demux: set default for readrate_catchup to be 5% faster
The existing default value is the same as the primary readrate.
This maintains the flow rate as best as possible but does not
reduce the lag. This new value allows catchup to gradually happen
without overwhelming the receiver.

Addresses a concern brought up in #11469
2025-03-24 16:17:47 +05:30
Gyan Doshi
6fb1bbd73c avfilter/scale: remove duplicate block
Added in bb80445813
2025-03-24 16:17:13 +05:30
Zhao Zhili
51b61ec35d avcodec/libuavs3d: pixel format should be native endian
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-24 14:54:46 +08:00
Zhao Zhili
2a189d44b5 avcodec/avs3_parser: pixel format should be native endian
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-24 14:54:40 +08:00
Zhao Zhili
1731eba20d avformat/mov: generalize sgpd_sync index lookup
The function has a nal_unit_type parameter but unused before.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-24 14:53:41 +08:00
Zhao Zhili
c6214b0d69 avcodec/vt: Don't restart decoder when confronted with ReferenceMissingErr
Otherwise the decoder may enter an loop of repeated state resets.
This can happen for streams with CRA but no IDR.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-24 14:53:27 +08:00
Shreesh Adiga
26f2f03e0d swscale/x86/rgb2rgb: optimize AVX2 version of uyvytoyuv422
Currently the AVX2 version of uyvytoyuv422 in the SIMD loop does the following:
4 vinsertq to have interleaving of the vector lanes during load from memory.
4 vperm2i128 inside 4 RSHIFT_COPY calls to achieve the desired layout.

This patch replaces the above 8 instructions with 2 vpermq and
2 vpermd with a vector register similar to AVX512ICL version.

Observed the following numbers on various microarchitectures:

On AMD Zen3 laptop:
Before:
uyvytoyuv422_c:                                      51979.7 ( 1.00x)
uyvytoyuv422_sse2:                                    5410.5 ( 9.61x)
uyvytoyuv422_avx:                                     4642.7 (11.20x)
uyvytoyuv422_avx2:                                    4249.0 (12.23x)

After:
uyvytoyuv422_c:                                      51659.8 ( 1.00x)
uyvytoyuv422_sse2:                                    5420.8 ( 9.53x)
uyvytoyuv422_avx:                                     4651.2 (11.11x)
uyvytoyuv422_avx2:                                    3953.8 (13.07x)

On Intel Macbook Pro 2019:
Before:
uyvytoyuv422_c:                                     185014.4 ( 1.00x)
uyvytoyuv422_sse2:                                   22800.4 ( 8.11x)
uyvytoyuv422_avx:                                    19796.9 ( 9.35x)
uyvytoyuv422_avx2:                                   13141.9 (14.08x)

After:
uyvytoyuv422_c:                                     185093.4 ( 1.00x)
uyvytoyuv422_sse2:                                   22795.4 ( 8.12x)
uyvytoyuv422_avx:                                    19791.9 ( 9.35x)
uyvytoyuv422_avx2:                                   12043.1 (15.37x)

On AMD Zen4 desktop:
Before:
uyvytoyuv422_c:                                      29105.0 ( 1.00x)
uyvytoyuv422_sse2:                                    3888.0 ( 7.49x)
uyvytoyuv422_avx:                                     3374.2 ( 8.63x)
uyvytoyuv422_avx2:                                    2649.8 (10.98x)
uyvytoyuv422_avx512icl:                               1615.0 (18.02x)

After:
uyvytoyuv422_c:                                      29093.4 ( 1.00x)
uyvytoyuv422_sse2:                                    3874.4 ( 7.51x)
uyvytoyuv422_avx:                                     3371.6 ( 8.63x)
uyvytoyuv422_avx2:                                    2174.6 (13.38x)
uyvytoyuv422_avx512icl:                               1625.1 (17.90x)

Signed-off-by: Shreesh Adiga <16567adigashreesh@gmail.com>
2025-03-23 15:25:48 +00:00
Andreas Rheinhardt
fc44ccd981 configure: Add EXR decoder->bswapdsp dependency
Needed on BE systems.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-23 14:14:43 +01:00
Andreas Rheinhardt
9f0970ee35 tests/checkasm/videodsp: Don't use declare_func_emms
It allows the callee to clobber the MMX state,
yet since 1e3dc705df this is no longer
done. So use the stricter declare_func instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-22 03:45:03 +01:00
Andreas Rheinhardt
c94143350f avutil/libm: Only include intfloat.h when needed
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-22 03:35:28 +01:00
Evgeny Pavlov
079110238a avcodec/amfenc: add smart access video option
This commit adds option for enabling SmartAccess Video (SAV)
in AMF encoders. SAV is an AMD hardware-specific feature which
enables the parallelization of encode and decode streams across
multiple Video Codec Engine (VCN) hardware instances.
2025-03-21 17:36:23 +01:00
Dmitrii Ovchinnikov
5b460bde8b libavutil/hwcontext_amf: add format validation in transfer_data functions 2025-03-21 17:36:13 +01:00
Andreas Rheinhardt
e5d62e20c8 avdevice/sdl2: Suppress macro redefinition warning
SDL2's headers #define HAVE_PTHREAD_SETNAME_NP (to one here);
we also have a config define which leads the compiler to
warn about this when the values are distinct (as they are here).
Suppress this warning by including config.h before SDL.h.
The latter will then redefine our define which doesn't matter
and which does not lead to warnings because compilers don't warn
about system headers by default (depending upon -Wsystem-headers).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-21 04:30:09 +01:00
Andreas Rheinhardt
94fd222235 avcodec/mathtables: Fix inaccurate macro name
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-21 04:30:09 +01:00
Andreas Rheinhardt
65154ba994 swscale/tests/swscale: Fix potential buffer overflow
The field width in a %s directive gives the amount of characters
to read from the input and not the size of the receiving buffer;
the latter must be of course also have space for the trailing \0
which has been forgotten here. The commit adds it (and fixes a
-Wfortify-source warning from Clang).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-21 04:30:09 +01:00
Andreas Rheinhardt
dff498fddf avutil/csp: Improve enum range comparisons
The underlying integer type of an enumeration is
implementation-defined (see C11, 6.7.2.2 (4)); GCC defaults
to unsigned if there are no negative values like for all enums
from pixfmt.h except enum AVPixelFormat.

This means that tests like "if (csp >= AVCOL_SPC_NB)" for
invalid colorspaces need not work as expected (namely if
enum AVColorSpace is signed). It also means that testing
for such an enum variable to be >= 0 may be tautologically
true. Clang emits a -Wtautological-unsigned-enum-zero-compare
warning for this.

Fix both of these issues by casting to unsigned.
Also do the same in libswscale/format.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-21 04:30:09 +01:00
James Almer
0ce405afb8 avfilter/vf_zscale: add support for grayscale formats
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-20 14:02:29 -03:00
James Almer
c3522716ff avfilter/vf_zscale: add support for half precision float RGB formats
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-20 14:02:29 -03:00
Leon Grutters
76f09ab647 avcodec/webvttdec: update documentation
The previous link lead to a 404 page as that page doesn't exist anymore.

Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 09:52:24 +01:00
Andreas Rheinhardt
b857bf942c avcodec/hevc/hevcdec: Simplify access to luma plane
It is always set and does not use subsampling.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
Andreas Rheinhardt
4505257372 avcodec/proresenc_kostya: Don't cast const away needlessly
The parameter passed here is unused, so just pass NULL.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
Andreas Rheinhardt
d76ae08048 avcodec/svq1enc: Don't add to NULL
It is undefined behavior. Pass a dummy buffer instead.
Fixes "runtime error: applying non-zero offset 1024 to null pointer".
affected the SVQ1 vsynth FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
Andreas Rheinhardt
02c16b48c5 avcodec/snow: Don't add to NULL
It is undefined behavior.
Fixes "runtime error: applying non-zero offset 8 to null pointer".
Fixes the Snow vsynth FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
Andreas Rheinhardt
fbcc943b22 avcodec/h261enc: Don't use (size_t)-1
Fixes "runtime error: addition of unsigned offset to 0x765a09523a90
overflowed to 0x765a09523a8e". This fixes all H.261 tests when run
under UBsan.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-20 07:10:17 +01:00
Manuel Lauss
950ad969fb avcodec/sanm: codec20 decoder
codec20 is raw uncompressed image data.

It exists in Rebel Assault 1 as a special format for STOR/FTCH
and is used again in the Full Throttle Remaster from 2017.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 21:02:56 +01:00
Manuel Lauss
fd6bfaab55 avcodec/sanm: ignore codec45
Codec45 is used in some RA2 videos on top of codec37.

It consists of 2 tables (768 and 32768 bytes), and datapackets
like codec2 (delta-x, delta-y) with a pixel counter instead of a color value.
It then reads the 4 surrounding pixels, looks up 3 separate values
for each in table1, adds them together to form an index into
table2 for a new pixel value, in a row.

The data coming in gets the x/y coordinates out of the visible
area very quickly (2-3 iterations); I don't see any visual
difference between the ffmpeg-produced frames and ones captured
with dosbox from rebel assault 2, which leads me to believe this
codec never worked as intended.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 21:02:54 +01:00
Manuel Lauss
b48bd23321 avcodec/sanm: implement STOR/FTCH for ANIMv1
Handle STOR/FTCH the same way the RA1 game engine does:
On STOR, save the next following FOBJ (not the decoded image)
in a buffer; decode it on FTCH.
The RA1 codecs and the fobj handler now take an explicit
GetByteContext in order to be able to replay stored data.

Used extensively by Rebel Assault 1 for e.g. backgrounds and
the cockpit overlay.

For ANIMv2 keep the current system to store the decoded image, as
replaying a FOBJ would not work with codecs37/47/48 due to sequence
violations.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 21:02:39 +01:00
Manuel Lauss
8a04526080 avcodec/sanm: codec37: reimplement comp4
Compression 4 code 0 means copy from delta buffer without mv,
AND start of a skip run.  This gets rid of the extra case and column
index manipulation and implements this as it is implemented in the
original game exe, i.e. as a special case for after mv copy.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
Manuel Lauss
fb951b26fd avcodec/sanm: codec4/5/33/34 decoder
This codec works on 4x4 pixel tiles, which can be generated and read
from the datastream.  They're both identical, codec5 misses a tile
index to skip the current tile.
Codecs33/34 are the same as 4/5 but with a different tileset generator.
Used only in Rebel Assault 1.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
Manuel Lauss
e1fd6bc8b4 avcodec/sanm: codec21 decoder
similar to codec23, this one alternatingly skips and writes bytes.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
Manuel Lauss
77b5a0c134 avcodec/sanm: codec23 decoder
This codec alternatingly skips and changes existing pixels.
A second 16bit parameter in the FOBJ header indicates how to do
the pixel changes: either by specifying a LUT in the codec datastream
or by adding a constant value to the pixel.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
Manuel Lauss
968ffbe64a avcodec/sanm: codec2 decoder
this codec consists of 4 byte packets: 2bytes delta-x, 1 byte delta-y
and 1 byte color to put at that spot.
Used in Rebel Assault 1 only.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:47 +01:00
Manuel Lauss
aa2f2befaa avcodec/sanm: fix codec3
codec3 is codec1 which writes zero values instead of skipping them.
This fixes a lot of RA1 videos.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
Manuel Lauss
fd9b92b216 avcodec/sanm: better ANIMv1 engine support
- clear the front buffer with color 0 on the first FOBJ.
  Fixes a lot of Rebel Assault 1 videos and Rebel Assault 2 space
  scenes (e.g. 08PLAY.SAN which consists only of codec1/2/21 objects
  which only ever touch parts of the buffer).
- for ANIMv1 (Rebel Assault 1): set palette index 0 to all zeroes.
  This fixes a lot of stray colors in e.g L1HANGAR.ANM, L2INTRO.ANM,
  space scenes.
- Esp in RA1, there are a lot of FRME objects which don't contain
  any video data (prebuffering some audio only). Account for that.
- In RA1 L2PLAY.ANM there are a few unaligned FOBJs, handle this
  in a generic way.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
Manuel Lauss
93b0ca26ac avcodec/sanm: better frame size detection for old codecs
The size of the video frame (FOBJ) of the old codecs (ANIMv0/1/2) can
very reliably be determined:
- ANIMv0/1 (=Rebel Assault 1) uses a 384x242 internal buffer for
  everything.  The codec parameters only describe the size and offset
  of the specific FOBJ on that buffer.
- ANIMv2 titles usually use one of the fullscreen codecs (37/47/48)
  as first FOBJ, and their dimensions can generally be trusted.
- RA2 uses 424x260 as internal buffer, use that if encountered:
  08PLAY.SAN does not use codec37 so we need to guess using the
  codec coordinates.
- ignore sizes smaller than 2x2 or larger than 800x600.
- some game videos have an initial fobj with either 1x1 or -1x-1
  pixels in size, ignore them with a warning (Full Throttle
  and the Rebel Assault 2 xxRETRY.SAN videos).

Once a known/valid dimension set has been discovered, use it and
don't change it for subsequent FOBJs, rather clamp the large frame
to the determined dimensions.

Tested with RA1, RA2, Full Throttle, Dig, Outlaws, SotE and MotS
videos.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
Manuel Lauss
f6c6ba95fd avcodec/sanm: FOBJ left/top are signed values
The left/top parameters of a FOBJ are signed values.  Adjust
codec1 code accordingly to not draw outside the buffer area.
Rebel Assault 1 makes heavy use of this.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
Manuel Lauss
a48dd03fd9 avcodec/sanm: disable left/top for fullscreen codecs
The block-based codecs 37/47/48 work on the full frame, and there's no
existing LucasArts game video that uses left/top offsets for these,
as it doesn't make sense. Ignore the left/top parameters for these codecs.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2025-03-19 20:58:46 +01:00
James Almer
f7e6070c51 avutil/tests/pixfmt_best: add more semi planar format tests
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-19 09:34:10 -03:00
James Almer
b8dc875249 swscale/output: add support for NV20
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-19 09:34:05 -03:00
James Almer
2f856b488b swscale/input: add support for NV20
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-19 09:31:29 -03:00
Jack Lau
1502551dd3 avformat/hlsenc: fix CODECS Attribute hard code in hevc EXT-X-STREAM-INF
fix ticket: 10786

parse the SPS from extradata and
get profile_compatibility, tier, constraints which was been hard code before.
HEVC CODECS Attribute reference to: ISO/IEC14496-15

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2025-03-19 19:20:50 +08:00
Gyan Doshi
b75b568b3d configure: improve ar test for response files 2025-03-19 15:41:52 +05:30
Andreas Rheinhardt
c0b7f817a4 avcodec/Makefile: Skip ffv1_vulkan.h in checkheaders
unless vulkan is actually enabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-18 23:06:55 +01:00
James Almer
bf22c4cc3e avutil: only duplicate hal2float and float2half in shared builds
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-18 17:21:23 -03:00
Andreas Rheinhardt
81c50c33b6 avcodec/Makefile: Only compile executor when VVC decoder is enabled
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-18 13:45:41 +01:00
Andreas Rheinhardt
6bd4e8bf76 avcodec/vvc/Makefile: Move VVC decoder->h2645data dep to lavc/Makefile
If h2645data.c were changed in a way that makes it rely on another
object file, all components that need h2645data.o would need to be
updated. And given that the VVC decoder->h2645data.o dependency is
currently hidden in a separate Makefile, it would likely be forgotten.
So move it to the libavcodec/Makefile.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-18 13:45:20 +01:00
Gyan Doshi
740d400965 ffbuild: use response files only if ar accepts them 2025-03-18 15:35:30 +05:30
Timo Rothenpieler
2de14c3e03 avcodec/tableprint_vlc: fix build with --enable-hardcoded-tables
Fixes #11518
2025-03-18 01:21:17 +01:00
Timo Rothenpieler
d54afd4d61 avcodec/Makefile: fix build of exr decoder in odd configs
Fixes #11519
2025-03-18 01:14:38 +01:00
Manuel Lauss
46da5605b2 MAINTAINERS: add Manuel Lauss as sanm.c/smush.c Maintainer
As requested by Michael Niedermayer.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:33:36 +01:00
Michael Niedermayer
2471b22023 avcodec/ffv1dec: Fix a YUVA issue with remaping
Untested

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:12 +01:00
Michael Niedermayer
276854e183 avcodec/ffv1: Add GRAYF16 support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:12 +01:00
Michael Niedermayer
b57f71f716 avcodec/ffv1: Add YAF16 support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:12 +01:00
Michael Niedermayer
d7fa6a388b avcodec/ffv1: fix remap without chroma planes
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:11 +01:00
Michael Niedermayer
a8892c5400 avcodec/ffv1: implement remap for encode/decode_plane()
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:11 +01:00
Michael Niedermayer
efdf7512a5 gitattributes: End merge conflicts in Changelog
Similar could be done with other lists that generally are appended to

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-17 15:26:10 +01:00
Zhao Zhili
94beaf4872 avcodec/videotoolboxenc: Add AYUV as a candidate pix_fmt for HEVC alpha
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-17 20:10:55 +08:00
Niklas Haas
5b9356f18e swscale/swscale_unscaled: avoid nv12 <-> nv21 bug
This is not handled by the planar copy wrapper, so exclude it.
2025-03-17 11:40:05 +01:00
Niklas Haas
8ab40ca984 swscale: fix gray -> grayf32 SIGFPE
swscale internals don't distinguish between 16-bit and higher bit depth
output formats internally when it comes to the choice of intermediate
representation.

Clamping this value both prevents a SIGFPE and also aligns the check
with reality.
2025-03-17 11:40:05 +01:00
Gyan Doshi
9e857e1f8a ffbuild: read library linker objects from a file
The linker command can exceed the maximum argument limit on MinGW,
especially for libavcodec.

The objects list is now stored in a file and passed to the linker.
2025-03-17 15:45:53 +05:30
Lynne
6bad55eb17 ffv1: add a Vulkan-based decoder
This patch adds a fully-featured level 3 and 4 decoder for FFv1,
supporting Golomb and all Range coding variants, all pixel formats,
and all features, except for the newly added floating-point formats.

On a 6000 Ada, for 3840x2160 bgr0 content at 50Mbps (standard desktop
recording), it is able to do 400fps.
An Alder Lake with 24 threads can barely do 100fps.
2025-03-17 08:51:23 +01:00
Lynne
caff29dbb1 FFHWAccel: add buffer_ref argument to start_frame
This commit adds a reference to the buffer as an argument to
start_frame, and adapts all existing code.

This allows for asynchronous hardware accelerators to skip
copying packet data by referencing it.
2025-03-17 08:51:23 +01:00
Lynne
23eb499b28 ffv1dec: add support for hwaccels
This commit adds support for hardware accelerated decoding to
the decoder.
The previous commits already refactored the decoder, this commit
simply adds calls to hooks to decode.
2025-03-17 08:49:16 +01:00
Lynne
53ff9005b5 vulkan: add support for AV_PIX_FMT_GBRAP32 2025-03-17 08:49:15 +01:00
Lynne
4de023f953 vulkan: add ff_vk_exec_add_dep_wait_sem()
This adds a function which adds a regular timeline semaphore
as a wait-only dependency.
2025-03-17 08:49:15 +01:00
Lynne
f2a0bdd6b1 vulkan: unify handling of BGR and simplify ffv1_rct 2025-03-17 08:49:15 +01:00
Lynne
dd7cc557af ffv1enc_vulkan: clip micro_version to 3 for level 4
This unbreaks level 4 encoding.
2025-03-17 08:49:14 +01:00
Lynne
b2ebe9884e ffv1enc_vulkan: refactor code to support sharing with decoder
The shaders were written to support sharing, but needed slight
tweaking.
2025-03-17 08:49:14 +01:00
Lynne
d3d2e254eb av1dec: update hwaccel decode_params on AV1_OBU_SEQUENCE_HEADER
Previously, the callback was only called on init. This makes it
get called on every frame.

We should switch to VK_KHR_video_maintenance2 and provide all params
upfront, but almost nothing supports it yet.
2025-03-17 08:49:14 +01:00
Lynne
82864c2111 vulkan_hevc: use VK_KHR_video_maintenance2 if available 2025-03-17 08:49:13 +01:00
Lynne
53f156bccc vulkan_h264: use VK_KHR_video_maintenance2 if available
This avoids having to copy and update the entire SPS/PPS stack.
2025-03-17 08:49:13 +01:00
Lynne
9a78ebc11a vulkan_av1: use VK_KHR_video_maintenance2 if available 2025-03-17 08:49:12 +01:00
Lynne
31176b16ac vulkan_decode: use VK_KHR_video_maintenance2 if available 2025-03-17 08:49:12 +01:00
Lynne
67eb01b458 hwcontext_vulkan: enable VK_KHR_video_maintenance2
Enables some fixes for the video specifications, and a new feature.
2025-03-17 08:49:12 +01:00
Lynne
e15e85b869 vulkan_decode: adjust number of async contexts created
This caps the number of contexts we create based on thread count.
This saves VRAM and filters out cases where more async is of lesser
benefit.
2025-03-17 08:49:11 +01:00
Lynne
4495802bdb vulkan_decode: support multiple image views
Enables non-monochrome video decoding using all our existing functions
in the context of an SDR decoder.
2025-03-17 08:49:11 +01:00
Lynne
491b65e343 vulkan_decode: support software-defined decoders 2025-03-17 08:49:11 +01:00
Lynne
bbb06f1ffc vulkan: workaround BGR storage image undefined behaviour 2025-03-17 08:49:10 +01:00
Lynne
3c09aadcf4 hwcontext_vulkan: allow using concurrent access images with more than 5 queues
This limit was not bumped when the queue family rewrite happened.

Fixes validation issues on nvidia.
2025-03-17 08:49:10 +01:00
Lynne
6c9affb3e6 hwcontext_vulkan: fix downloads; use the common host map function to map frame data
This commit uses the recently exported code for host mapping images back
where it was exported from.

The function also had broken download code for image downloading since its
recent refactor.
2025-03-17 08:49:09 +01:00
Lynne
a5b90caacd vulkan: copy host-mapping buffer code from hwcontext
This is useful elsewhere.
2025-03-17 08:49:09 +01:00
Lynne
ed6ee32846 vulkan: add ff_vk_create_imageview 2025-03-17 08:49:09 +01:00
Lynne
7046e65e37 vulkan: rename ff_vk_set_descriptor_image to ff_vk_shader_update_img 2025-03-17 08:49:08 +01:00
Lynne
49af9746e8 pixfmt: add AV_PIX_FMT_GBRAP32
This commit adds a 32-bit *integer* planar RGBA format.
Vulkan FFv1 decoding is best performed on separate planes, rather than
packed RGBA (i.e. RGBA128), hence this is useful as an intermediate format.
2025-03-17 08:49:04 +01:00
Danil Iashchenko
a1c6ca1683 doc/filters: Shift CUDA-based filters to own section. 2025-03-17 12:38:51 +05:30
Andreas Rheinhardt
5ad86d5fbc avcodec: Mark init and close functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 04:33:11 +01:00
Marvin Scholz
81ca85a087 configure: allow mixed declarations and code for Objective-C
Mixing declarations and code is quite common in Objective-C (as can be
seen by the number of warnings we have for this in Objective-C files)
and forcing to not do it usually results in worse code, with unnecessary
widely scoped variables, which in turn makes variable shadowing and
accidentally using the wrong variable more common and harder to notice.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-17 10:59:26 +08:00
Marvin Scholz
163e5fd84d configure: fix passing Objective-C flags
Passing Objective-C flags from configure to the Makefiles was broken, as
configure incorrectly used the OBJCCFLAGS instead of OBJCFLAGS variable
which was then later overwritten in the common.mak:

  OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)

The fix for this is simple, analogous to how it is handled for CFLAGS,
use OBJCFLAGS here so that the flags are properly included in the
aforementioned OBJCCFLAGS definition.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-17 10:57:29 +08:00
Andreas Rheinhardt
3ad00ebf2c avcodec/mpeg12dec: Don't assert on thread_count
Nothing in this decoder would break if the generic code were to be
changed to allow slice "threading" with only one thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:46:00 +01:00
Andreas Rheinhardt
2742de0e4a avcodec/mpeg12dec: Use saturated addition when combining error_count
Fixes undefined integer overflows. The overflows could always
happen, yet before 4d8b706b1d
it was not undefined because the code implicitly used atomic
types, for which signed integer overflow is defined.

Reported-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:46:00 +01:00
Andreas Rheinhardt
60f49f4d92 avcodec/qdm2: Use explicit overread checks instead of implicit ones
If there were not enough data, checksum_size would be read
as zero (due to the implicit checks of the bytestream2 API)
and run into a "data block size invalid" error. Erroring out
earlier via "not enough extradata" is better.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
be7642b198 avcodec/qdm2, vorbisdec: Use compile-time const max_depth in get_vlc2
It makes no sense to try to be exact with max depth
in get_vlc2(): It will mean that the compiler emits code
for all three stages of parsing and runtime checks for
whether max_depth is big enough to parse the next stage
when a not yet complete code has been encountered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
c228ae2b40 avcodec/cfhd: Use smaller scope where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
32fba0bce5 avcodec/cfhd: Move GetBitContext from context to stack
Its lifetime is extremely limited.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
8a2e84dc96 avcodec/hqx: Simplify deriving AC table index
It can be simply encoded in the quant coefficients itself
as they are so small.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
2f4f96f1ac avcodec/hqx: Combine checks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
02b5aee879 avcodec/hqx: Don't zero in small chunks, don't zero twice
Up until now, decode_block() zeroed every block (of 128 bytes)
before decoding a block; yet this is suboptimal for all modes,
because all modes need to reset all the blocks they use anyway
and so it should be done in one go for all blocks.

For the alpha modes (where blocks need not be coded) all blocks
are zeroed initially anyway, because decode_block() might not
be doing it, so zeroing there again for the coded blocks is
a waste.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
7d70fb3530 avcodec/hqx: Combine memsets
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
997b33f64c avcodec/hqxvlc: Make dc9, dc10 VLC tables static
It allows to share them between frame threads.
dc11 can unfortunately not be made static without increasing
LOCALBUF_ELEMS in vlc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
004367a0a3 avcodec/hqx: Cache pointer to used dc table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
5dd83ecfb2 avcodec/hqxvlc: Make cbp_vlc static
This is trivial as well as beneficial because frame threads
now use the same table, saving cache/memory.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
c9d87f4a85 avcodec/hqx: Include hqxvlc directly
This avoids having to expose HQXContext in a header
and allows to make several symbols static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
09411fef3d avcodec/hqxvlc: Include implicit +1 run in RL VLC tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
abffd9313d avcodec/hqxvlc: Avoid hardcoded RL VLC table
hqxvlc.c contains sort-of run-length VLCs in hardcoded form;
they amount to 26688 elements, taking 104KiB. These tables contain
many duplicated entries (they are partially created via a RPT_1024
macro). There are actually only 3039 different codes in all tables
combined, making this very wasteful.

This commit changes this by extracting the underlying entries
and creating a (static) RL-VLC. This only costs 3*3039 bytes
of .rodata. The resulting table needs only 15630 entries,
because our VLC init code uses smaller subtables when possible
(for an incomplete code, the negative of the length stored in
the VLC code is the number of bits the subtable uses; the hardcoded
tables uses a worst-case per table value).

Using GET_RL_VLC also gets rid of an unnecessary reload in case
a code is too long to be parsed in the first stage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
49d15dfc35 avcodec/rl: Avoid temporary stack VLC array during RL VLC init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
3869862b00 avcodec/mpeg12: Avoid temporary stack VLC array during RL VLC init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
0facdafd1e avcodec/vlc: Merge VLCElem and RL_VLC_ELEM
It will simplify creating RL-VLCs (which until now used
a stack-based VLC as temporary buffer).

Notice that there would be another option to merge them, namely:
struct VLCElem {
    union {
        VLCBaseType sym;
        int16_t level;
    };
    int8_t len;
    uint8_t run;
};

The main difference to the current patch is that this would change
the type of the length field of VLCElem to int8_t from int16_t.
It turns out that that this would entail additional sign extensions
on ppc, see https://godbolt.org/z/behWYEYE7. I have therefore refrained
from doing so, although it would make the patch simpler.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:26:07 +01:00
Andreas Rheinhardt
54d582e749 avcodec/pcm: Avoid AVCodec.sample_fmts for decoders
These fields are meant to be for encoders; just use a local
table in pcm_decode_init() to convert from AVCodecID to AVSampleFormat
and also use it to provide sample_size.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:19:12 +01:00
Andreas Rheinhardt
05ab776210 avcodec/pcm: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:18:15 +01:00
Andreas Rheinhardt
c6d7436508 avcodec/pcm: Use dedicated init function for F16LE, F24LE
This avoids a switch and allows to simply use
a dedicated private context for them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:18:14 +01:00
Andreas Rheinhardt
e76daf6279 avcodec/pcm: Don't allocate LUT when unused
Instead use a dedicated context for the few decoders that
use the LUT. Also use a dedicated init function for them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:11:47 +01:00
Andreas Rheinhardt
f2168f4d86 avcodec/pcm: Remove duplication from FFCodec define macros
Also align it in preparation of a slightly longer macro.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 03:05:39 +01:00
Andreas Rheinhardt
485e5388e9 avcodec/pcm: Cache sample_size value
No need to go through two switches per packet.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 02:58:09 +01:00
Andreas Rheinhardt
5247090b0d avcodec/pcm: Remove always-false check
All codecs here have a valid sample size at this point.
This check has (presumably) been added for DVD PCM,
but even for them the check was always-true after
381e195b46 (and the DVD
code was later moved out altogether). So just remove
this check and the leftover DVD comment.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-17 02:57:35 +01:00
James Almer
1eafbf8203 avcodec/exrdec: restore applying color transfer characteristics for float16 samples
Regression since 0e917389fe.
This change also reverts commit 431805c096.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-16 11:38:13 -03:00
Andreas Rheinhardt
b5be0c0aa9 avcodec/eamad: Don't store transient macroblock indices in context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
f6366cb5ea avcodec/eamad: Optimize processing escape codes
Said escape code is only six bits long, so that one has at least 25 - 6
bits in the bitstream reader's cache after reading it; therefore the
whole following 16 bits (containing the actual code) are already in the
bitstream reader's cache, making it unnecessary to reload the cache.

This is the eamad analogue of fe9bc1cc45.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
2e5f01e064 avcodec/mdec: Don't update cache unnecessarily
It won't be used anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
9aeb6940a2 avcodec/mdec: Optimize processing escape codes
Said escape code is only six bits long, so that one has at least 25 - 6
bits in the bitstream reader's cache after reading it; therefore the
whole following 16 bits (containing the actual code) are already in the
bitstream reader's cache, making it unnecessary to reload the cache.

This is the mdec analogue of fe9bc1cc45.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
de562e8069 avcodec/mdec: Remove write-only block_last_index
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
461b86fe7d avcodec/intrax8: Stop setting write-only block_last_index
These values are only used by the mpegvideo unquantize functions,
yet these are not active when intrax is in use. Furthermore,
given that ff_intrax8_decode_picture() decodes multiple
macroblocks in a given call, it makes no sense to return
any value (that was in practice the maximum of the indices
of all the macroblocks decoded).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
1a564c1aff avcodec/vc1_block: Stop setting write-only block_last_index
It is only used by the mpegvideo unquantize functions which
this decoder does not use at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
594b97e433 avcodec/mpegvideo_dec: Mark init, flush, close functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
Andreas Rheinhardt
248a6578a3 avcodec/msmpeg4enc: Inline constant
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
James Almer
c88614662c avcodec/d3d12va_encode: use the correct specifier to log size_t values
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 21:06:33 -03:00
James Almer
3f57063c58 avcodec/ffv1dec: set the FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability
Will prevent decoding frame data during probing.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 18:43:18 -03:00
James Almer
63fa1f52b9 swscale/swscale_unscaled: make the fast planar copy path work with more formats
dst_depth - src_depth where the result is 6 or 7 in a high bd path means this
is only executed for 16 -> 10 and 16 -> 9.
This patch makes this path general, supporting arbitrary formats as long as
dst_depth > src_depth > 8.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 18:43:18 -03:00
James Almer
819dec697a swscale/swscale_unscaled: account for semi planar formats with data in the msb
Fixes fate failures introduced by recent tests that exercise the faulty code.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 18:43:18 -03:00
Frank Plowman
26c5d8cf5d lavc/vvc: Fix NumEntryPoints derivation
If pps_single_slice_per_subpic_flag is 1,
slice_{width,height}_in_tiles are undefined and we must instead get the
dimensions of the slice by referring to the corresponding subpicture.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-03-15 10:46:32 +08:00
Andreas Rheinhardt
2da40904f3 avcodec/x86/hevc/dsp_init: Rename ff_hevc_put_hevc->ff_hevc_put
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-15 02:30:56 +01:00
Andreas Rheinhardt
44ed8f61d7 avcodec/aom_film_grain: Cast const away to suppress compiler warning
av_frame_side_data_add() typically takes ownership of
the provided AVBufferRef reference and therefore
uses a parameter of type AVBufferRef**; yet with
the AV_FRAME_SIDE_DATA_FLAG_NEW_REF, it creates
new references instead, without touching the given
reference. Therefore it is safe to cast const away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-15 02:30:56 +01:00
Niklas Haas
ae84aa775f swscale/utils: split off format code into new file
utils.c is getting quite crowded, and I need a new place to dump a lot of
format handling code for the ongoing rewrite. Rather than bloating this file
even more, start splitting format handling helpers off into a new file.

This also renames the existing utils.h header, which didn't really contain
anything except the SwsFormat definition anyway (the prototypes for what should
have been in utils.h are all still in the legacy swscale_internal.h).
2025-03-14 19:50:44 +01:00
Andreas Rheinhardt
e4c8e80a2e avcodec/x86/constants: Move constants only used by cavsdsp to it
And make them static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-14 11:42:41 +01:00
Michael Niedermayer
437cbd25e0 avcodec/ffv1: Implement jeromes idea of making remap flip optional
This also makes remap optional (which is a good idea even if we decide to keep flip fixed)

Effect on compression (using 2 rawlsb, golomb rice, large context model with ACES_OT_VWG_SampleFrames

-rw-r----- 1 michael michael 499101306 Mär 11 14:58 float-303503-try3d-m2.nut
-rw-r----- 1 michael michael 503700199 Mär 11 14:57 float-303503-try3d-m1.nut
-rw-r----- 1 michael michael 518150578 Mär 11 14:57 float-303503-try3d-m0.nut
(the test above used the rawlsb patch, which is not applied yet)

Reviewed-by: Jerome Martinez <jerome@mediaarea.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:04:25 +01:00
Michael Niedermayer
dcf6142794 avcodec/ffv1enc: add space for the remap table to max_size
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:59 +01:00
Michael Niedermayer
a90ff81287 avcodec/ffv1enc: Factor set_micro_version() out of ff_ffv1_write_extradata()
and call it from ff_ffv1_encode_init()

setting micro version from code writing the extradata is messy, this should
be cleaner

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:59 +01:00
softworkz
e0aedeb72e avformat/webvttdec: Add webvtt extension and MIME type
The webvtt extension is sometimes used in HLS playlists.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:59 +01:00
softworkz
0978fea7fa avcodec/vlc: Reduce debug logging
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:58 +01:00
James Almer
52eb0e18db avfilter/vsrc_testsrc: use aligned macros for writing
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-13 15:00:10 -03:00
James Almer
c3b60e0df7 tests/fate/pixfmt: add conversion tests with semi planar YUV formats
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-13 15:00:10 -03:00
James Almer
228713ef5d swscale/input: add support for UYYVYY411
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-13 15:00:05 -03:00
wang-bin
154c00514d lavc/videotoolboxenc: add hevc main42210 and p210
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-13 18:34:22 +08:00
Andreas Rheinhardt
958c46800e avcodec/mjpegenc: Reconstify mjpeg encoder
It has been deconstified in 2c2dfd9149
because the FFCodec is touched in av_codec_init_static because
of its get_supported_config callback. Yet this is easily remedied:
Only call get_supported_config to set pix_fmts if the codec does
not already have it set.

This also fixes a mismatch between the declaration of ff_mjpeg_encoder
in allcodecs.c and the definition in mjpegenc.c. Said mismatch is
actually undefined behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:20:06 +01:00
Andreas Rheinhardt
ed1b76cdb7 avcodec/allcodecs: Don't wrap supported_framerates
Only two encoders (the native MPEG-1/2 ones) provide
supported_framerates and they don't implement the
get_supported_config callback. It is highly unlikely that
any codec will set supported_framerates dynamically at all,
so remove the code querying for frame rates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:20:06 +01:00
Andreas Rheinhardt
bfbceb7d55 avcodec/tests/avcodec: Silence deprecation warnings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:20:05 +01:00
Andreas Rheinhardt
c8be309719 avcodec/codec_internal: Add inlined version of av_codec_is_(de|en)coder
These functions check whether the AVCodec* is NULL, but this
has already been checked at a lot of places in our codebase,
so that it boils down to checking the is_decoder flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:16:27 +01:00
Andreas Rheinhardt
47d7c6cd15 avcodec/codec_internal: Add dedicated is_decoder flag to FFCodec
Allows to simplify av_codec_is_decoder() and av_codec_is_encoder().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:16:27 +01:00
Andreas Rheinhardt
3e19e5062c avcodec/decode: Move is_open check to avcodec_receive_frame()
It also applies to scenarios where ff_encode_receive_frame()
is used. Also remove the redundant av_codec_is_decoder().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:16:27 +01:00
Timo Rothenpieler
fed6612415 avcodec/cuviddec: use pre-existing chroma format information
Fixes #11505
2025-03-13 01:47:02 +01:00
Timo Rothenpieler
4c7d0f88f5 avcodec/Makefile: remove redundant object
It's already listed in OBJS-$(CONFIG_JNI), which should cover all cases
STLIBOBJS does and more.
2025-03-13 01:28:50 +01:00
Andreas Rheinhardt
34aa8449b8 avcodec/pthread*: Mark init, free, flush functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 17:00:24 +01:00
Andreas Rheinhardt
8abac5898b avcodec/sbcdec_data: Merge data into header
sbcdec_data.h is only included by sbcdec.c, so this won't
cause the data to be included multiple times in the binary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 17:00:24 +01:00
Andreas Rheinhardt
a6c58450da all: Fix doxy comments wrongly designated as trailing ///<
The ///< or /**< form of doxygen comments are only to be used
when the documentation follows the member and the comment
block starts on the same line as the member. This commit
fixes wrong uses of them; in particular, this fixes the comment
for mb_height in H.264 SPS's structure which was wrongly added
to mb_width.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 17:00:24 +01:00
Andreas Rheinhardt
e99faf28d5 avcodec/vc2enc: Avoid excessive inlining
There is no reason to inline put_vc2_ue_uint() everywhere;
only one call site is actually hot: The one in encode_subband()
(which accounts for 35735040 of 35739495 calls to said function
in a FATE run). Uninline all the others.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 16:58:53 +01:00
Andreas Rheinhardt
fcd5df5904 fftools/ffmpeg_opt: Remove unused alt_bsf
Forgotten in 6325aede08.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 16:58:16 +01:00
Zhao Zhili
0f7d77fc42 avformat/flvdec: Use appropriate error code
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:07:20 +08:00
Zhao Zhili
fa5a100ed2 avformat/flvdec: Fix error handling of parse_video_color_info
Some error should not be ignored.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:07:09 +08:00
Zhao Zhili
291fdc96ab avformat/flvdec: Use float for FLVMasteringMeta
The precision should be enough for primaries and luminance.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:04:00 +08:00
Zhao Zhili
888f5ea72b avformat/flvdec: Use appropriate types in FLVMetaVideoColor
This also reduce memory usage.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:03:56 +08:00
Zhao Zhili
f0cf122cf4 avformat/flvdec: Remove one level of indentation
Also remove the condition of AMF_DATA_TYPE_BOOL when parse color
info. There is no AMF_DATA_TYPE_BOOL type in color info.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:03:38 +08:00
Zhao Zhili
4f53ecf114 avformat/flvdec: Put FLVMetaVideoColor inside FLVContext directly
1. Rename metaVideoColor to meta_color_info
2. Allocated FLVMetaVideoColor together with FLVContext
3. Improve the use of meta_color_info_flag. Do a sequence of strcmp
only if meta_color_info_flag is FLV_COLOR_INFO_FLAG_PARSING.
4. Check return value of amf_parse_object().

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:03:15 +08:00
Zhao Zhili
f34294897f avformat/flvdec: Fix use sizeof(AVMasteringDisplayMetadata)
sizeof AVMasteringDisplayMetadata isn't part of ABI.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
2025-03-12 16:02:12 +08:00
Zhao Zhili
7b81676be4 tests: Add enhanced-flv-hevc-hdr10 for demux and mux HDR color info
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:01:20 +08:00
Andreas Rheinhardt
74412bd108 avcodec/snow: Remove ff_snow_release_buffer()
Pointless after 7e41f95dce.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 07:29:40 +01:00
Andreas Rheinhardt
b0af322654 avcodec/vc2enc: Use LUT to assemble interleaved golomb code
Up until now, the encoder processed only one bit at a time.
With this patch, it is eight bits.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 07:27:48 +01:00
Michael Niedermayer
0b097ed9f1 avcodec/ffv1enc_template: Be a bit more verbose on error
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:02 +01:00
Michael Niedermayer
a8a83e06f9 avcodec/ffv1: Fix remap and float with golomb rice
Sponsored-by: Sovereign Tech Fund
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:02 +01:00
Michael Niedermayer
99f0f6e401 avcodec/ffv1enc: Fix slice coding mode 1 with rgb frames
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:01 +01:00
Nil Fons Miret
9899da8175 libavfilter: guard against ff_draw_init/ff_draw_init2 failures
The return value of ff_draw_init and ff_draw_init2 are not checked in
most usages. However, if they return an error, they don't get to the
point where they set the attributes of the FFDrawContext. These
functions are typically used in conjunction with ff_draw_color, which
checks draw->desc->flags, causing a null pointer dereference.

Signed-off-by: Nil Fons Miret <nilf@netflix.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:01 +01:00
Lynne
bdc07f372a hwcontext_vulkan: add support for mapping multiplane images into CUDA
This patch refactors the CUDA import code to allow for Vulkan images
with multiple planes to be mapped.

Currently, a driver bug exists which causes NV12 images to be mapped
incorrectly when the memory being mapped contains both planes, the
issue has been reported to NVIDIA.
yuv420p does work correctly, however.

This is still an improvement, as the code used to crash when trying to
map the memory, unless disable_multiplane=1 was given as an option.
2025-03-11 13:42:19 +01:00
Brad Smith
49c8f33262 lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2
v2: test for function if AltiVec is enabled instead of with AltiVec and without VSX
2025-03-11 00:31:47 -04:00
Andreas Rheinhardt
6a7a77023e avcodec/dvdsubenc: Remove pointless wrapper
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-11 04:37:21 +01:00
Andreas Rheinhardt
ede2b391cc avcodec/put_bits: Add and use put_bits63()
When using a 64bit PutBitContext (i.e. on x64), put_bits_no_assert()
can naturally write up to 63 bits. So one can avoid treating the
cases <32bits, 32 bits and <63 bits differently.

As it turns out, no user actually wants to write 64 bit at once
(maybe except testprograms).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-11 04:37:21 +01:00
Andreas Rheinhardt
512e597932 avcodec/vc2enc: Simplify writing dirac golomb codes
The earlier code used a loop to determine the number of bits used
and called ff_log2() on a power of two (and it would be easy to
keep track of the exponent of said power-of-two); neither GCC nor
Clang optimized the loop away or avoided the ff_log2().
This patch replaces the loop and the log2 with a single av_log2().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-11 04:37:21 +01:00
Andreas Rheinhardt
27c82af2fe avutil/vulkan: Remove unused ff_vk_create_avbuf()
Unused since aea4d4b423.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-11 04:35:53 +01:00
Andreas Rheinhardt
e499c85999 avutil/refstruct: Fix documentation
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-11 04:35:06 +01:00
James Almer
04d7a6d3db avcodec/exr: use luma+alpha float pixel formats
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-10 10:15:42 -03:00
James Almer
468577d1a5 swscale/input: add support for YAF16 and YAF32
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-10 10:15:42 -03:00
James Almer
61fc9b6fee avutil/pixfmt: add YAF16 and YAF32 pixel formats
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-10 10:15:42 -03:00
James Almer
5f5ab22639 avfilter/vsrc_testsrc: add support for semi planar formats to yuvtestsrc
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-10 10:15:33 -03:00
Martin Storsjö
73f4668ef8 swscale: aarch64: Simplify the assignment of lumToYV12
We normally don't need else statements here; the common pattern
is to assign lower level SIMD implementations first, then
conditionally reassign higher level ones afterwards, if supported.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-10 14:03:58 +02:00
Andreas Rheinhardt
87e5da9067 avcodec/wmaenc: Don't unnecessarily reset AVPacket.size
The packet is unreferenced generically lateron anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 04:52:31 +01:00
Andreas Rheinhardt
196ee9fc86 avcodec/wma: Mark ff_wma_end() as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 04:52:15 +01:00
Andreas Rheinhardt
b98beb3704 all: Use put_bytes_output() instead of put_bits_ptr - pb->buf
Avoids accessing internals of PutBitContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 04:51:57 +01:00
Andreas Rheinhardt
0971fcf0a0 avcodec/codec_internal, all: Use macros to set deprecated AVCodec fields
The aim of this is twofold: a) Clang warns when setting a deprecated
field in a definition and because several of the widely set
AVCodec fields are deprecated, one gets several hundred warnings
from Clang for an ordinary build. Yet fortunately Clang (unlike GCC)
allows to disable deprecation warnings inside a definition, so
that one can create simple macros to set these fields that also suppress
deprecation warnings for Clang. This has already been done in
fdff1b9cbf for AVCodec.channel_layouts.
b) Using macros will allow to easily migrate these fields to internal ones.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 00:57:23 +01:00
Andreas Rheinhardt
0349ae3ec4 avcodec/vp8: Remove always-false hwaccel checks for VP7
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 00:51:04 +01:00
Andreas Rheinhardt
a41baa743d avcodec/vp8: Move VPx specific functions inside #if CONFIG_VPx block
where appropriate. Avoids including ff_vp8_decode_frame()
when the VP8 decoder is disabled.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 00:50:57 +01:00
Andreas Rheinhardt
4040dc0782 avcodec/vp8: Move codec-specific init code out of common init
While just at it, also move the init functions inside
the #if CONFIG_VP?_DECODER (to avoid linking failures).
While just at it, also declare these init functions
as av_cold and uninline the remaining common init function.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 00:50:49 +01:00
Andreas Rheinhardt
b6602a17e1 avcodec/vp8: Fix wrong #endif comment
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 00:50:24 +01:00
Frank Plowman
20a6eb1ca3 lavc/vvc: Stricter bound on pps_exp_slice_height_in_ctus_minus1
When pps_num_exp_slices_in_tile[i] is nonzero, the ith tile is made up
of pps_num_exp_slices_in_tile[i] slices stacked atop one another, where
the height of the jth slice in the ith tile is given by
pps_exp_slice_height_in_ctus_minus1[i][j].  The sum of the heights of
the slices in the tile should not exceed the height of the tile itself.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-03-09 21:35:53 +08:00
Andreas Rheinhardt
e934fd96c1 avcodec/snow: Remove outdated assert
It comes from a time before frames were refcounted; it has indeed been
added in a follow-up commit to c13e490dce:
"codec_release_buffer: fix handling of non user buffers". This type
of check is obsolete now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-09 04:23:40 +01:00
Andreas Rheinhardt
d7820a2b6f avcodec/sbcenc: Don't use deprecated AVCodec.supported_samplerates
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-09 04:20:52 +01:00
Andreas Rheinhardt
1b6f37ac13 avcodec/sbcenc: Mark sbc_encode_init() as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-09 04:20:52 +01:00
Michael Niedermayer
1bce40cb73 avcodec/ffv1: Use dual run coder for fltmap
This improves compression by 0.1% overall and 44% for the changed table
I tried several other things but so far this is the best
compromise between complexity and compression

This can also be extended to 32 and 64bit floats

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-08 20:55:39 +01:00
Michael Niedermayer
9bad2634ee avcodec/ffv1: Store remap flag per slice
This allows switching it on conditionally and also for non float,
it may improve compression for RGB data that was paletted
or other synthetic images

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-08 20:55:38 +01:00
Michael Niedermayer
4a0c285dfe avcodec/ffv1: flip half of float16 and Compactify floats
float16 (and more so float32) have many odd values
half the values are negative, many are larger than "1.0"
and many values are very close to 0.

Storing the 16bits as is, looses compression because of the mixture
of dense and sparse regions and also many completely unused ones.

This simply remaps the 65536 values so no unused values remain
This improves compression by about 1.5% for the ACES_OT_VWG_SampleFrames testset
(this testset contains all kind of funny values including many images
 with negative rgb values)

The space needed for the map is insignificant compared to the
compression gained

This patch also flips half the float range as it can be done
using the same table.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-08 20:55:38 +01:00
Michael Niedermayer
c1b330bf24 avcodec/ffv1: Basic float16 support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-08 20:55:38 +01:00
Manuel Lauss
114e9864e1 avcodec/sanm: ignore unknown codecs in FOBJs
Don't error out, just ignore unknown codec numbers and pretend
decode succeeded.  This is useful for older LucasArts titles
which stack a lot of different FOBJs with different codecs into
a single frame.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-08 20:55:37 +01:00
Andreas Rheinhardt
f641c6846a avutil/log: Set AVClass* in av_expr_eval()
Otherwise it is possible for av_log() to receive a non-NULL object
with a NULL AVClass pointer; the default log callback handles it
gracefully, yet this is probably an API violation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-08 01:05:47 +01:00
Andreas Rheinhardt
39286d97f2 avcodec: Don't log to private context
While it is save for these codecs (they all have private contexts),
it is customary to always use the AVCodecContext for logging.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-08 01:05:46 +01:00
Andreas Rheinhardt
e6d07e45e0 avcodec/{h263,ituh263,msmpeg4,snow}dec: Use proper logcontext
The logging functions here can be reached by codecs without
private class, so that the log callback will receive a non-NULL
object whose AVClass pointer is NULL. Although the default log
callback handles this gracefully, it is probably an API violation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-08 01:05:46 +01:00
Andreas Rheinhardt
ce1cec673e avcodec/mpeg12dec: Use CHROMA_* defines
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
8940a6153f avcodec/mjpegenc: Constify parent ctx in encode_block()
Said parent is shared between all slice contexts and encode_block()
can be run concurrently by slice threads, so the parent context
must not be (and is not) modified. So constify the pointers.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
60cae5019a avcodec/mjpegenc_common: Constify ff_mjpeg_encode_{dc,picture_header}()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
5689d9c0f4 avcodec/mjpegenc: Don't use ff_ prefix for static functions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
455ca92b31 avcodec/mjpegenc: Use forward decl for MpegEncContext, MJpegHuffmanCode
Avoids an indirect inclusion of mpegvideo.h in mjpegenc_common.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
85138c1434 avcodec/mpegvideo_enc, motion_est: Pre-center fcode_tab
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
c709a3d424 avcodec/mpegvideo: Move vbv_delay to Mpeg1Context
Only used there and only by the main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
6e225123d8 avcodec/mpeg12enc: Simplify writing bits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
d5db4ee30c avcodec/mjpegenc: Don't log to private context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
6cdcf15e0a avcodec/mjpegenc: Remove nonsensical AMV options
Both these options are unsupported and silently ignored for AMV;
so it is better to not offer them at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
fc158f3d40 avcodec/speedhqenc: Inline ff_speedhq_mb_y_order_to_mb()
It is an extremely simple function that is only called once,
so it should be inlined.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
49c38761f1 avcodec/speedhqenc: Don't log to the private context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
e117faddbf avcodec/mpegvideo: Mark ff_mpv_common_defaults() as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
89a8033fc9 avcodec/mpegvideo: Move temp ratecontrol bufs to RateControlContext
Also only allocate them when they are needed (namely iff
adaptive quant is true) and allocate them jointly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
6844e96116 avcodec/mpegvideo: Move ratecontrol-only options to RateControlContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
1ec1f1e236 avcodec/mpegvideo_enc: Move H.263 specific check to ituh263enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:03 +01:00
Andreas Rheinhardt
c3ab7362dd avcodec/mpegvideo_enc: Move vbv_delay warning to mpeg12enc.c
It is MPEG-1/2 only.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
137060d586 avcodec/mpegvideo_enc: Move q_scale_type check to mpeg12enc.c
The MPEG-2 encoder is the only encoder supporting q_scale_type.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
0c4b091bd6 avcodec/mpegvideo_enc: Move q_matrix init to init_matrices()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
726adfafc6 avcodec/mpegvideo_enc: Don't init matrices unnecessarily for MJPEG
The MJPEG initialization happens later.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
41451b4eef avcodec/mpegvideo_enc: Only allocate inter matrices when needed
Also allocate them jointly with intra matrices when needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
a43124452f avcodec/mpegvideo_enc: Factor checks out of loop
Also move this code to init_matrices().

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
7223363ccb avcodec/mpegvideo_enc: Set chroma_intra_matrix for SpeedHQ
Used with trellis; notice that inter_matrix is unused for
(intra-only) SpeedHQ, so it is irrelevant that its value changes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
daff2df1a0 avcodec/mpegvideo_enc: Only allocate chroma intra matrices when needed
Also start factoring the matrix-init code out into a function
of its own to declutter ff_mpv_encode_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
70359de69f avcodec/mpeg4video: Move IS_3IV1 macro to mpeg4videodec.c
Also add parentheses around the replacement to make it safer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
5df8c86b24 avcodec/mpeg4video: Split ff_mpeg4_pred_dc()
It currently does two things: a) Get a prediction for the dc
and the dc direction and b) process said prediction. Processing
the prediction differs for encoding (getting a diff) and decoding
(getting the level via diff+prediction). So having a common function
performing b) makes no sense.

Even worse, there is a decoding mode where the dc coefficient (diff)
is not coded specially and therefore unavailable before entering
the block decoding loop, so that one can only perform a). Before
this commit, the decoder simply called ff_mpeg4_pred_dc() twice;
the results of the b) part of the call before the loop were ignored
(but the compiler could not elide them because they involved error
messages) and a) was also performed twice.

This commit changes this by splitting b) out of ff_mpeg4_pred_dc()
and moving this code to decoder and encoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
c050269eda avcodec/mpeg4videodec: Bail out earlier when parsing
The scantables are unused for the parser (and in fact
the IDCT permutation used has not been initialized at all).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
f5f2c37a52 avcodec/ituh263dec: Reorder branches
(To perform this optimization a compiler would have to look
at both ff_rv_decode_dc() and av_log(). The latter seems very
unlikely.)

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
17ff442adb avcodec/flvenc: Remove redundant setting of dc_scale_tables
h263_aic is always zero for FLV and ff_mpeg1_dc_scale_table
is already the default dc_scale table for both y and c.
h263_aic is also always zero for the FLV decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
9e5a1b8693 avcodec/ituh263enc: Use memset where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
607bc17b52 avcodec/ituh263enc: Make SVQ1+Snowenc stop calling ff_h263_encode_init()
They only do it for the mv_penalty table. Factor initializating
the static tables out into a function of its own; also move
everything not needed by SVQ1 or Snow behind #if CONFIG_H263_ENCODER
(this involved moving ff_h263_encode_motion() which is used
by svq1enc).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
9ca97756ac avcodec/ituh263enc: Combine branches
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
f67e5bf2cc avcodec/ituh263enc: Remove redundant setting of dc_scale_tables
ff_mpeg1_dc_scale_table is already the default dc_scale table
for both y and c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
94f364289b avcodec/ituh263enc: Move MPEG-4 fcode_tab to mpeg4videoenc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
3977abc89f avcodec/mpegutils: Move MAX_FCODE to mpegvideoenc.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
9479ee5038 avcodec/mpegvideo_enc: Move default_mv_penalty to h261enc.c
MPEG-1/2 and the H.263-based encoders overwrite the default later
and SpeedHQ and MJPEG-based encoders are intra-only and don't
need a mv_penalty table at all. So only H.261 uses this table.

Also add a comment to explain why it exists and is non-const.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
a02fb1a4f4 avcodec/h261: Use forward-declaration for MpegEncContext
Avoids an indirect inclusion of mpegvideo.h in h261data.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
7abc9c5e3d avcodec/h261dec: Don't call ff_set_qscale()
Most of what it does is unneeded for H.261.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
0c7e34856d avcodec/mpeg12dec: Mark flush as cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
4d8b706b1d avcodec/mpeg12dec: Don't count errors from first thread twice
Compilers can not perform this optimization on their own
given that they don't know that the different thread_context
pointers don't alias.
Also avoid using sequentially consistent operations with
atomics when only a single thread accesses them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
094c2e7f5b avcodec/vc1dec: Don't initialize unused parts of ScanTable
The VC-1 decoders don't need ScanTable.raster_end as
they don't call any of the unquantize functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
38e8eefc9c avcodec/vc1_block: Inline y_dc_scale_table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
8aa08c9fa0 avcodec/vc1_block, vc1dec: Don't use c_dc_scale(_table)?
It coincides with the luma values.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Andreas Rheinhardt
3defca7eae avcodec/rv34: Make ff_rv34_get_start_offset() honor its name
Up until now, it only returned the number of bits for the
start offset, but not the start offset; the GetBitContext
passed to it was unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-07 15:19:02 +01:00
Krzysztof Pyrkosz
f9b8f30680 avcodec/aarch64/vvc: Optimize vvc_avg{8, 10, 12}
This patch replaces integer widening with halving addition, and
multi-step "emulated" rounding shift with a single asm instruction doing
exactly that.

Benchmarks before and after:
A78
avg_8_64x64_neon:                                     2686.2 ( 6.12x)
avg_8_128x128_neon:                                  10734.2 ( 5.88x)
avg_10_64x64_neon:                                    2536.8 ( 5.40x)
avg_10_128x128_neon:                                 10079.0 ( 5.22x)
avg_12_64x64_neon:                                    2548.2 ( 5.38x)
avg_12_128x128_neon:                                 10133.8 ( 5.19x)

avg_8_64x64_neon:                                      897.8 (18.26x)
avg_8_128x128_neon:                                   3608.5 (17.37x)
avg_10_32x32_neon:                                     444.2 ( 8.51x)
avg_10_64x64_neon:                                    1711.8 ( 8.00x)
avg_12_64x64_neon:                                    1706.2 ( 8.02x)
avg_12_128x128_neon:                                  7010.0 ( 7.46x)

A72
avg_8_64x64_neon:                                     5823.4 ( 3.88x)
avg_8_128x128_neon:                                  17430.5 ( 4.73x)
avg_10_64x64_neon:                                    5228.1 ( 3.71x)
avg_10_128x128_neon:                                 16722.2 ( 4.17x)
avg_12_64x64_neon:                                    5379.1 ( 3.51x)
avg_12_128x128_neon:                                 16715.7 ( 4.17x)

avg_8_64x64_neon:                                     2006.5 (10.61x)
avg_8_128x128_neon:                                   9158.7 ( 8.96x)
avg_10_64x64_neon:                                    3357.7 ( 5.60x)
avg_10_128x128_neon:                                 12411.7 ( 5.56x)
avg_12_64x64_neon:                                    3317.5 ( 5.67x)
avg_12_128x128_neon:                                 12358.5 ( 5.58x)

A53
avg_8_64x64_neon:                                     8327.8 ( 5.18x)
avg_8_128x128_neon:                                  31631.3 ( 5.34x)
avg_10_64x64_neon:                                    8783.5 ( 4.98x)
avg_10_128x128_neon:                                 32617.0 ( 5.25x)
avg_12_64x64_neon:                                    8686.0 ( 5.06x)
avg_12_128x128_neon:                                 32487.5 ( 5.25x)

avg_8_64x64_neon:                                     6032.3 ( 7.17x)
avg_8_128x128_neon:                                  22008.5 ( 7.69x)
avg_10_64x64_neon:                                    7738.0 ( 5.68x)
avg_10_128x128_neon:                                 27813.8 ( 6.14x)
avg_12_64x64_neon:                                    7844.5 ( 5.60x)
avg_12_128x128_neon:                                 26999.5 ( 6.34x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-07 15:51:20 +02:00
Dmitrii Ovchinnikov
7225e307be Added support for direct RGB input to AMF encoder 2025-03-06 15:38:58 +01:00
Dmitrii Ovchinnikov
c7ff7345eb Enable 10-bit output for RGB input in AMF HEVC and AV1
encoders
2025-03-06 15:38:03 +01:00
Brad Smith
30a8641465 lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang
Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.
2025-03-06 14:21:38 +01:00
Dale Curtis
696ea1c223 Don't attempt to parse ADTS from USAC packets.
It's not possible to put USAC into ADTS due to exceeding the
field size (4 bits) for ADTS profile. As such cases where
the frame starts with 0xfff shouldn't be checked.

This ensures the sample at https://crbug.com/396190942 is
properly detected as USAC content.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
2025-03-06 00:31:20 +01:00
Andreas Rheinhardt
72cff47be7 avcodec/exr: Fix potential effective-type violation
Storing the values via a union of an uint32_t and a float makes
said union the effective type of the destination. This means that
it may only be read via such a union which is of course not what
our users do/expect. So store the values via AV_WN32A instead
which disables effective type analysis (for compilers that perform it).

This also fixes a -Wdeclaration-after-statement warning
introduced in 0e917389fe.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-05 17:59:40 +01:00
Andreas Rheinhardt
431805c096 avcodec/exr: Remove write-only gamma_table
Forgotten in 0e917389fe.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-05 17:59:24 +01:00
James Almer
5560a20d77 avcodec/exr: use the correct step value for plane pointers
Fixes a regression since 0e917389fe.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-05 12:59:34 -03:00
Michael Niedermayer
0e917389fe avcodec/exr: do not output 32bit floats when a file stores 16bit floats
exr should not do a internal pixel format convert

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-05 03:29:25 +01:00
Andreas Rheinhardt
56cfbe3c9f avformat/mpegenc, mpegts. mxfenc: Mark (de)muxers declarations as internal
Otherwise compilers might emit code that presumes there to be
a GOT which can't be fixed by the linker.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-05 00:24:54 +01:00
Andreas Rheinhardt
57f184221d avutil/attributes_internal: Add EXTERN macro for extern+hidden
This is inspired by the equivalent dav1d attribute introduced
by Henrik Gramner in e4c4af02f3de5e6cea6f81272a2981c0fa7bae28.
Also already use it to beautify declarations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-05 00:24:54 +01:00
Andreas Rheinhardt
19e907cd72 avcodec: Remove leftover alpha declarations
Forgotten in cdd139d760.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-05 00:06:52 +01:00
Andreas Rheinhardt
883120aaf0 avcodec/mpeg12dec: Use proper logcontext
When used with the "mpegvideo" or "mpeg1video" decoder (which do not
have a private class) this would lead to the log callback receiving
a non-NULL object with a NULL AVClass pointer. The default log callback
handles this gracefully, yet it is probably an API violation.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-05 00:04:04 +01:00
Andreas Rheinhardt
9e2773034b avformat/rtp_av1: Add necessary headers
Also use a void* instead of an AVFormatContext as logctx in parse_leb.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 15:34:38 +01:00
Andreas Rheinhardt
f76195ff65 avcodec/vc1dec: Don't initialize inter_scantable
It is unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 13:00:14 +01:00
Andreas Rheinhardt
ca56526d7f avcodec/mpegvideo_enc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 13:00:14 +01:00
Andreas Rheinhardt
772df65356 avcodec/mpegvideo_enc: Don't do unnecessary work for AMV
Up until now, the initialization of AMV's matrices happened
after the initialization for MJPEG matrices, overwriting
the earlier data. This commit changes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 13:00:13 +01:00
Andreas Rheinhardt
8d87162254 avcodec/mpeg12dec: Really disable scratchpad allocations
ba341be095 disabled them for
the main thread only, not the slice threads.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 13:00:13 +01:00
Andreas Rheinhardt
4f2becc2dc avcodec/mpeg4videodec: Avoid copying packed bitstream data
This is possible because the packet is reference-counted
and because we never combine the data from several packets.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:58:30 +01:00
Andreas Rheinhardt
e3ebc1073e avcodec/mpegvideo: Move bitstream_buffer to mpeg4videodec
This is possible by moving the code using it to open a GetBitContext
from h263dec.c to mpeg4videodec.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:58:30 +01:00
Andreas Rheinhardt
e4470a8e30 avcodec/h263dec: Don't call ff_thread_finish_setup() unnecessarily
All hwaccels for MPEG-4/H.263 are run serially even when frame-threading
is in use. Therefore there is no gain in calling
ff_thread_finish_setup() in this case right before outputting
the frame.

Removing this call also allows to revert commit
39a5c0ac06.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:58:30 +01:00
Andreas Rheinhardt
79d6657e13 avcodec/mpeg12dec: Don't initialize unused parts of ScanTable
The MPEG-1/2 decoders don't need ScanTable.raster_end
(as the coefficients are unquantized as they are parsed).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:58:30 +01:00
Andreas Rheinhardt
e6657d499a avcodec/h26[134]dec: Always report the buffer to be completely consumed
It is pointless to try to report the true number because
decode_simple_internal() always treats the buffer as
completely consumed for video codecs anyway.
(Apart from that: The h263dec code would report to only
have consumed the header data in case decoding is aborted
due to skip_frame which makes no sense.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:58:30 +01:00
Andreas Rheinhardt
78b26225ba avcodec/mpeg4videoenc: Remove dead FF_BUG_MS code
Added in 59fa3f96f4,
yet avctx->workaround_bugs is never copied to
MpegEncContext.workaround_bugs, so this code is dead
(it seems that this was true even when it was added).
Furthermore, workaround_bugs is flagged as decoder-only,
so just remove the code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:58:30 +01:00
Andreas Rheinhardt
1adc84136e avcodec/vc1: Add max_b_frames field to VC1Context
Don't reuse MpegEncContext.max_b_frames, which is supposed
to be encoder-only.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:56:35 +01:00
Andreas Rheinhardt
9202179754 avcodec/mpegvideo_dec: Move syncing DivX-stuff to mpeg4videodec.c
It is only used by MPEG-4 (and is used in h263dec.c and can therefore
not just be moved to Mpeg4DecContext...).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:50 +01:00
Andreas Rheinhardt
4c0960e968 avcodec/mpegvideo_dec: Don't sync max_b_frames
Only the VC-1 decoder (which does not use frame-threading)
and encoders use it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:50 +01:00
Andreas Rheinhardt
592d75dbeb avcodec/rv34: Don't update block_index unnecessarily
It is unused by RV30 and RV40.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:50 +01:00
Andreas Rheinhardt
ab38ff9161 avcodec/mips/mpegvideo_mmi: Don't check alternate_scan unnecessarily
Forgotten in 4f7aeffd8c.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:15 +01:00
Andreas Rheinhardt
2de9168b56 avcodec/msmpeg4dec: Remove redundant check
Since d50635cd24 the
dct_unquantize_h263_intra functions have set the number of
coefficients to 63 in case of ac_pred, so ff_msmpeg4_decode_block()
doesn't have to bump it on its own.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:15 +01:00
Andreas Rheinhardt
18fc118f65 avcodec/msmpeg4dec: Avoid branch
A non-LTO-compiler can't optimize this away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:15 +01:00
Andreas Rheinhardt
4912a2d88e avcodec/msmpeg4dec: Don't process unnecessarily many coefficients
This code has been added in f5957f3fe2
when support for WMV1 has been added. It was needed for decoding
inter macroblocks, as WMV1 uses a different scantable and
the ScanTable and ScanTable.raster_end was not yet introduced
(the H263 unquantize function instead used a hardcoded version
of ff_zigzag_direct's raster_end). In other words,
there is no reason to continue to do so for WMV1 inter blocks.
(Apart from that: WMV1 inter blocks don't use
dct_unquantize_h263_inter any more, as unquantizing happens
when parsing the block via specialized RL VLC tables.)

It is also not needed for WMV1/2 intra blocks (for non-ac_pred
it uses the correct ScanTable used by the h263 unquantize
intra function; for ac_pred, the number is overridden)
as well as for WMV2 inter-blocks (raster_end is not really
used in this case; the ordinary ScanTable is used in case
abt_type is zero, otherwise there are two different ScanTables
and block_last_index is overridden in wmv2dec.c).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:15 +01:00
Andreas Rheinhardt
db8546dff7 avcodec/mpeg12dec: Remove write-only assignments
This decoder unquantizes while parsing blocks
and does not use dct_unquantize_mpeg1_intra
(which uses *_dc_scale) at all.

repeat_field was unused since
e0a3d744a0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:53:15 +01:00
Andreas Rheinhardt
3474475e58 avcodec/h261dec: Inline constant
The value here has been set in ff_set_qscale() from
ff_mpeg1_dc_scale_table, all of whose entries are 8.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:51:54 +01:00
Andreas Rheinhardt
9c16d54a16 avcodec/h261dec: Remove dead check
H.261 does not have non-reference frames.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:51:54 +01:00
Andreas Rheinhardt
a5d590963c tests/fate/vcodec: Test H.261 loop-filter
Increases coverage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:51:54 +01:00
Andreas Rheinhardt
57ade06ffe tests/fate/vcodec: Test using mpeg2-quantizers for MPEG-4
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:51:54 +01:00
Andreas Rheinhardt
c960b42efc tests/fate/vcodec: Test alternate_scan
Encoding was untested before this.
Notice that the filesize degradation is partially due to
mpegvideo no longer using progressive_sequence and
progressive_frame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:51:54 +01:00
Andreas Rheinhardt
a885351ad0 avcodec/vc1dec: Reenable debug-info output for field pictures
Effectively reverts c59b5e3d1e.
This is possible now that ff_print_debug_info2() uses
the MPVPicture dimensions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:51:54 +01:00
Andreas Rheinhardt
973c7a0c65 avcodec/mpegvideo_dec: Use picture-dimensions in ff_print_debug_info()
It will allow to avoid the special case for VC-1 field pictures.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:51:54 +01:00
Andreas Rheinhardt
d4fd475005 avcodec/motion_est: Avoid branches for put(_no_rnd) selection
MotionEstContext contains pointers (to function pointers) that
have been set on a per-frame basis depending upon no_rounding
in ff_me_init_pic() to avoid branches like these. Also makes
MotionEstContext more independent of MpegEncContext.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:45:33 +01:00
Andreas Rheinhardt
b3ba961df6 avcodec/mpegvideo_enc: Add AV_CODEC_CAP_DR1
The mpegvideo-based encoders do one uncommon thing with
the packet's data given by ff_alloc_packet(): They potentially
reallocate it. But this only affects the internal buffer
and is not user-facing at all, so one can nevertheless
use the AV_CODEC_CAP_DR1 for them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:45:33 +01:00
Andreas Rheinhardt
ab768b88e0 avcodec/mpegvideo_enc: Don't set qscale_table value prematurely
When there are multiple candidates for macroblock type, the encoder
tries them all. In order to do so, it keeps several sets of states
containing the variables that get modified when encoding
the macroblock and in the end uses the best of these.

Yet one variable was set, but not included in this state:
The current macroblock's qscale value in the current picture's
qscale_table. This may currently be set multiple times in
mpv_reconstruct_mb(), yet it is read when adaptive_quant is true.
Currently, the value read can be the value set by the last attempt
to write the current macroblock and not the initial value.

Fix this by only setting the qscale_table value in one place
outside of mpv_reconstruct_mb() (where it does not belong at all).

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-04 12:44:18 +01:00
Zhao Zhili
3e9777dc75 aarch64/hevcdsp_idct_neon: Add implementation for idct dc 12
Reduce binary size at the same time. The performance compared to clang -O3
is the same.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-04 17:01:58 +08:00
Zhao Zhili
5977bff569 aarch64/hevcdsp_idct_neon: Optimize idct dc
clang does better than the assembly code before the patch, especially
for small size:

hevc_idct_4x4_dc_8_c:                                   11.2 ( 1.00x)
hevc_idct_4x4_dc_8_neon:                                15.5 ( 0.73x)
hevc_idct_4x4_dc_10_c:                                  12.0 ( 1.00x)
hevc_idct_4x4_dc_10_neon:                               15.2 ( 0.79x)
hevc_idct_8x8_dc_8_c:                                   13.2 ( 1.00x)
hevc_idct_8x8_dc_8_neon:                                18.2 ( 0.73x)
hevc_idct_8x8_dc_10_c:                                  13.5 ( 1.00x)
hevc_idct_8x8_dc_10_neon:                               17.2 ( 0.78x)
hevc_idct_16x16_dc_8_c:                                 41.8 ( 1.00x)
hevc_idct_16x16_dc_8_neon:                              37.8 ( 1.11x)
hevc_idct_16x16_dc_10_c:                                41.8 ( 1.00x)
hevc_idct_16x16_dc_10_neon:                             37.8 ( 1.11x)
hevc_idct_32x32_dc_8_c:                                130.2 ( 1.00x)
hevc_idct_32x32_dc_8_neon:                             132.2 ( 0.98x)
hevc_idct_32x32_dc_10_c:                               130.2 ( 1.00x)
hevc_idct_32x32_dc_10_neon:                            132.2 ( 0.98x)

This patch basically clone what the compiler does, so the performance
is the same.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-04 17:01:58 +08:00
Zhao Zhili
5a32496962 avcodec/libuavs3d: process extradata
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-04 17:01:58 +08:00
Zhao Zhili
2d7966aee1 avformat/isom_tags: Add tag for AVS3
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-04 17:01:58 +08:00
Zhao Zhili
a053516e64 avformat/movenc: Add AVS3 support
'avs3' is registered at mp4ra.org. The Avs3ConfigurationBox 'av3c'
inside 'avs3' hasn't been registered yet, but is specified by the
AVS3 spec.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-04 17:01:58 +08:00
Krzysztof Pyrkosz
71a91485fa avcodec/aarch64/vvc: Optimize NEON version of vvc_dmvr
This patch replaces blocks of instructions performing rounding and
widening shifts with one-liners achieving the same result.

Before and after on A78
dmvr_8_12x20_neon:                                      86.2 ( 6.90x)
dmvr_8_20x12_neon:                                      94.8 ( 5.93x)
dmvr_8_20x20_neon:                                     141.5 ( 6.50x)
dmvr_12_12x20_neon:                                    158.0 ( 3.76x)
dmvr_12_20x12_neon:                                    151.2 ( 3.73x)
dmvr_12_20x20_neon:                                    247.2 ( 3.71x)
dmvr_hv_8_12x20_neon:                                  423.2 ( 3.75x)
dmvr_hv_8_20x12_neon:                                  434.0 ( 3.69x)
dmvr_hv_8_20x20_neon:                                  706.0 ( 3.69x)

dmvr_8_12x20_neon:                                      77.2 ( 7.70x)
dmvr_8_20x12_neon:                                      66.5 ( 8.49x)
dmvr_8_20x20_neon:                                      92.2 ( 9.90x)
dmvr_12_12x20_neon:                                     80.2 ( 7.38x)
dmvr_12_20x12_neon:                                     58.2 ( 9.59x)
dmvr_12_20x20_neon:                                     90.0 (10.15x)
dmvr_hv_8_12x20_neon:                                  369.0 ( 4.34x)
dmvr_hv_8_20x12_neon:                                  355.8 ( 4.49x)
dmvr_hv_8_20x20_neon:                                  574.2 ( 4.51x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-04 10:35:31 +02:00
Krzysztof Pyrkosz
d765e5f043 swscale/aarch64: dotprod implementation of rgba32_to_Y
The idea is to split the 16 bit coefficients into lower and upper half,
invoke udot for the lower half, shift by 8, and follow by udot for the
upper half.

Benchmark on A78:
bgra_to_y_128_c:                                       682.0 ( 1.00x)
bgra_to_y_128_neon:                                    181.2 ( 3.76x)
bgra_to_y_128_dotprod:                                 117.8 ( 5.79x)
bgra_to_y_1080_c:                                     5742.5 ( 1.00x)
bgra_to_y_1080_neon:                                  1472.5 ( 3.90x)
bgra_to_y_1080_dotprod:                                906.5 ( 6.33x)
bgra_to_y_1920_c:                                    10194.0 ( 1.00x)
bgra_to_y_1920_neon:                                  2589.8 ( 3.94x)
bgra_to_y_1920_dotprod:                               1573.8 ( 6.48x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-04 10:16:44 +02:00
Viraaj Raulgaonkar
081c865867 avformat/riffdec: change declaration of ff_get_wav_header()
Change the type of logctx from void* to AVFormatContext*. This is in
preparation for the next commit.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-04 02:07:01 +01:00
James Almer
25c439296b avformat/mov: fix overflow in corrected_dts calculation
Fixes: Integer-overflow
Fixes: 400093647/clusterfuzz-testcase-minimized-media_metadata_parser_fuzzer-4794341562187776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-03 18:10:10 -03:00
James Almer
01f63ef0b4 fftools/ffmpeg_filter: also remove display matrix side data from buffered frames
Some frames may be buffered before a complex filtergraph can be configured.
This change ensures the side data removal in the cases where autorotation is
enabled also applies to them.

Fixes ticket #11487

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-03 18:10:10 -03:00
James Almer
848576b4df fftools/ffmpeg_dec: remove side data copy block
It's no longer needed now that lavc handles this.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-03 18:10:10 -03:00
James Almer
603334e86f avcodec/decode: inject missing global side data to output frames
ff_decode_frame_props() injects global side data passed by the caller (Usually
coming from the container) but ignores the global side data the decoder
gathered from the bitstream itself.
This commit amends this.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-03 18:10:10 -03:00
James Almer
964d28e83c avutil/frame: move side data helpers to a new file
Should reduce clutter in frame.c, plus allow us to make opaque changes to
side data handling.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-03 18:10:10 -03:00
Lynne
8631990f22 vulkan: take refs of frames using the regular buffer ref path
This simplifies the code, reduces allocations, and critically, does
not store references of frames, along with references to hw_frames_ctx.
The issue was that storing refs to frames while transferring stored
refs to hw_frames_ctx of frames, and so created a circular dependency,
which caused the Vulkan device to never be terminated.

This only stores what it strictly needs as a dependency, and enables
the frames context to be freed, even while doing asynchronous transfers.
2025-03-03 19:43:57 +01:00
Leandro Santiago
d21ed2298e avfilter/dnn_detect: fail on filter if mandatory anchor option is missing
It prevents the filter of running in case such option is missing,
failing early, during init() instead of simply logging an error
during runtime.

Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2025-03-03 18:30:18 +08:00
Leandro Santiago
90fbb40da5 avfilter/dnn: do not manually parse anchors filter option
Instead, rely on AV_OPT_TYPE_FLAG_ARRAY, which will automatically
perform the parsing.

Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2025-03-03 18:29:33 +08:00
Timo Rothenpieler
5c5be37daf avcodec/nvenc: factor out mastering display data into its own function 2025-03-02 18:43:53 +01:00
Timo Rothenpieler
e567dca12f avcodec/nvenc: add time code writing for h264 2025-03-02 18:43:53 +01:00
Timo Rothenpieler
31ca6c1bfe avcodec/utils: use new ff_timecode_set_smpte function 2025-03-02 18:43:53 +01:00
Timo Rothenpieler
9d5d51bd12 avutil/timecode: add ff_timecode_set_smpte 2025-03-02 18:43:08 +01:00
Frank Plowman
600ad36949 lavc/vvc: Fix pps_single_slice_picture
Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-03-02 20:42:13 +08:00
Nuo Mi
dede00f003 lavc/vvcdec: fix undefined reference to ff_h2645_pixel_aspect
This issue was introduced by commit bb8e95b650

Reproduce steps:
./configure --enable-ffmpeg --disable-everything --enable-decoder=vvc --enable-parser=vvc --enable-demuxer=vvc --enable-protocol=file,pipe --enable-encoder=rawvideo,wrapped_avframe --enable-muxer=rawvideo,md5,null && make -j
2025-03-02 16:16:39 +08:00
Krzysztof Pyrkosz
e8d4c55987 avcodec/aarch64/ac3dsp_neon.S: Optimize ac3_sum_square_butterfly_int32_neon
Instead of calculating a^2, b^2, (a+b)^2 and (a-b)^2, calculate only
a^2, b^2 and 2*a*b in each iteration and derive the latter parts from
these three at the end.

Before and after:

A78
ac3_sum_square_bufferfly_int32_neon:                   484.8 ( 2.00x)
ac3_sum_square_bufferfly_int32_neon:                   468.2 ( 2.08x)

A72
ac3_sum_square_bufferfly_int32_neon:                   793.6 ( 1.26x)
ac3_sum_square_bufferfly_int32_neon:                   527.3 ( 1.92x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-02 01:17:53 +02:00
Krzysztof Pyrkosz
38929b824b swscale/aarch64: Refactor hscale_16_to_15__fs_4
This patch removes the use of stack for temporary state and replaces
interleaved ld4 loads with ld1.

Before/after:

A78
hscale_16_to_15__fs_4_dstW_8_neon:                      86.8 ( 1.72x)
hscale_16_to_15__fs_4_dstW_24_neon:                    147.5 ( 2.73x)
hscale_16_to_15__fs_4_dstW_128_neon:                   614.0 ( 3.14x)
hscale_16_to_15__fs_4_dstW_144_neon:                   680.5 ( 3.18x)
hscale_16_to_15__fs_4_dstW_256_neon:                  1193.2 ( 3.19x)
hscale_16_to_15__fs_4_dstW_512_neon:                  2305.0 ( 3.27x)

hscale_16_to_15__fs_4_dstW_8_neon:                      86.0 ( 1.74x)
hscale_16_to_15__fs_4_dstW_24_neon:                    106.8 ( 3.78x)
hscale_16_to_15__fs_4_dstW_128_neon:                   404.0 ( 4.81x)
hscale_16_to_15__fs_4_dstW_144_neon:                   451.8 ( 4.80x)
hscale_16_to_15__fs_4_dstW_256_neon:                   760.5 ( 5.06x)
hscale_16_to_15__fs_4_dstW_512_neon:                  1520.0 ( 5.01x)

A72
hscale_16_to_15__fs_4_dstW_8_neon:                     156.8 ( 1.52x)
hscale_16_to_15__fs_4_dstW_24_neon:                    217.8 ( 2.52x)
hscale_16_to_15__fs_4_dstW_128_neon:                   906.8 ( 2.90x)
hscale_16_to_15__fs_4_dstW_144_neon:                  1014.5 ( 2.91x)
hscale_16_to_15__fs_4_dstW_256_neon:                  1751.5 ( 2.96x)
hscale_16_to_15__fs_4_dstW_512_neon:                  3469.3 ( 2.97x)

hscale_16_to_15__fs_4_dstW_8_neon:                     151.2 ( 1.54x)
hscale_16_to_15__fs_4_dstW_24_neon:                    173.4 ( 3.15x)
hscale_16_to_15__fs_4_dstW_128_neon:                   660.0 ( 3.98x)
hscale_16_to_15__fs_4_dstW_144_neon:                   735.7 ( 4.00x)
hscale_16_to_15__fs_4_dstW_256_neon:                  1273.5 ( 4.09x)
hscale_16_to_15__fs_4_dstW_512_neon:                  2488.2 ( 4.16x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-02 01:17:29 +02:00
Adam Lackorzynski
76b1810017 libswscale/arm/swscale_unscaled: Fix function prototype
Constify dstStrice argument of rgbx_to_nv12_neon_16_wrapper to be
compatible with other functions as used in function assignment.

Signed-off-by: Adam Lackorzynski <adam@l4re.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-03-02 01:10:38 +02:00
Lynne
0245e9382c lavu: bump minor and add APIChanges entry for new GRAY32 pixfmts 2025-03-01 20:16:00 +01:00
Lynne
0ef678f5c5 APIChanges: add entry for new AMD AMF pixfmt 2025-03-01 20:16:00 +01:00
Lynne
a73760da53 APIChanges: add entries for new planar GBR and float gray pixfmts
Was not done when the patches were pushed.
2025-03-01 20:15:59 +01:00
Lynne
ded6772359 fate-sws-pixdesc-query: update ref for new pixfmts 2025-03-01 20:15:59 +01:00
Lynne
e41b45509b fate-imgutils: update reference for new pixel formats 2025-03-01 20:15:55 +01:00
Lynne
629e8a2425 vulkan: add support for AV_PIX_FMT_GRAY32 2025-03-01 13:11:13 +01:00
Lynne
300b82c3ea pixfmt: add AV_PIX_FMT_GRAY32
This is a useful format for high-precision intermediates.
2025-03-01 13:11:12 +01:00
Michael Niedermayer
469b7a0ee4 doc/developer: Better {} style rule
This makes developer.texi consistent with tools/patcheck

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-01 02:47:33 +01:00
softworkz
ace9f03a6c avformat/hls: Partially revert "reduce default max reload to 3"
(setting to 100 as a reasonable compromise)

The change has caused regressions for many users and consumers.
Playlist reloads only happen when a playlist doesn't indicate that it
has ended (via #EXT-X-ENDLIST), which means that the addition of future
segments is still expected.
It is well possible that an HLS server is temporarily unable to serve
further segments but resumes after some time, either indicating a
discontinuity or even by fully catching up.
With a segment length of 3s, a max_reload value of 1000 corresponds to
a duration of 50 minutes which appears to be a reasonable default.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-01 02:47:20 +01:00
Martin Storsjö
b137347278 aarch64: Fix a few misindented lines
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-28 23:23:09 +02:00
IndecisiveTurtle
b37ce9b016 libavutil/vulkan: Expose ff_vk_set_descriptor_image
Useful when creating a descriptor array of separate images
2025-02-28 13:44:49 +01:00
Krzysztof Pyrkosz via ffmpeg-devel
9993a64d7b avutil/aarch64/tx_float_neon.S: clean up FFT4_X2 2025-02-28 13:42:54 +01:00
Lynne
bb87d19cd9 ffv1enc_vulkan: disable autodetection of async_depth
The issue is that this could consume gigabytes of VRAM at higher
resolutions for not that much of a speedup.
Automatic detection was not a good idea as we can't know how much
VRAM is actually free.
Just remove it.
2025-02-27 19:08:42 +01:00
Lynne
85d81dcfd6 hwcontext_vulkan: enable read/write without storage
BGR formats in Vulkan cannot be used in storage images, as the
pixel labels on storage images are always ordered as RGB, and
swizzling is not an option due to old hardware limitations.
This means that you must always use an RGB format and manually
swizzle when reading or writing to BGR images, or simply not use
a format in the shader itself.
This adds support for the latter.
2025-02-27 19:06:41 +01:00
Niklas Haas
651bfd0dad avfilter/vf_libplacebo: set correct alpha mode before blending
&pl_alpha_overlay expects straight alpha, but the alpha output may be
premultiplied as a result of the target alpha mode (or in the absence of an
alpha channel). Fix it by requesting independent alpha explicitly when
blending.
2025-02-27 18:58:19 +01:00
Niklas Haas
c85879c601 avfilter/vf_libplacebo: set colorspace properties on all inputs
There is no reason to only do this on the first input. It doesn't actually
matter for now given that we don't constrain the color space list, but it
may matter when that changes.

Signed-off-by: Niklas Haas <git@haasn.dev>
2025-02-27 18:56:49 +01:00
Niklas Haas
d48745ba1c avfilter/vf_libplacebo: allow differing formats per input
Each input is entirely independent and can have varying pixel formats,
color spaces, etc. To accomplish this, we need to make a full copy of the
format list for each subsequent input, rather than sharing the same ref.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-02-27 18:56:49 +01:00
Niklas Haas
6602b88df6 avfilter/vf_libplacebo: switch to new background API
Fixes a deprecation warning, and also fixes a bug where the depredated
skip_target_clearing option was not correctly mapped to the new API inside
libplacebo upstream.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
2025-02-27 18:56:49 +01:00
Niklas Haas
05302767ac avfilter/vf_liplacebo: properly initialize variable
Signed-off-by: Niklas Haas <git@haasn.dev>
2025-02-27 18:56:24 +01:00
Niklas Haas
5944c4b20a avfilter/vf_libplacebo: remove deprecated options
These were removed upstream and no longer have had any effect for
a while now.

Signed-off-by: Niklas Haas <git@haasn.dev>
2025-02-27 18:56:19 +01:00
Niklas Haas
27814dc3b6 avfilter/libplacebo: add option for outputting separate fields
cf. the other deinterlacing-aware filters.
2025-02-27 18:55:33 +01:00
Niklas Haas
83c1b34964 avfilter/libplacebo: strip interlaced flag when deinterlacing 2025-02-27 18:55:33 +01:00
Niklas Haas
123cccb621 avfilter/libplacebo: only mark frame fields when deinterlacing
Avoids an unnecessary copy of the frame in the frame queue when not
deinterlacing anyways.
2025-02-27 18:55:33 +01:00
Niklas Haas
794cba812e avfilter/libplacebo: add deinterlacing options
These were introduced in libplacebo API version 220. We actually already
map the field by default, but deinterlacing was never enabled unless the user
explicitly forced it using extra_ops.
2025-02-27 18:55:33 +01:00
Niklas Haas
58875417af configure: align libplacebo version check with reality
This filter already failed to compile on older versions, because of an
unconditional use of an API introduced in API version 220. Nobody noticed
this, so I conclude that it's safe to bump the required version by now.
2025-02-27 18:55:33 +01:00
Niklas Haas
e23c79ebfc avfilter/vf_libplacebo: switch to AV_OPT_TYPE_COLOR 2025-02-27 18:51:41 +01:00
Andreas Rheinhardt
e71b3ebaa5 avcodec/lcevcdec: Use proper include
External libraries are not components and so their CONFIG_ define
is in config.h.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:39:15 +01:00
Andreas Rheinhardt
deee2fb52d avcodec/proresdec: Reuse permutation
The ProresDSPContext already contains the idct_permutation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
e7ca57d857 avcodec/simple_idct: Move ProRes-only code to proresdsp.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
37cf9c5325 avcodec/simple_idct_template: Move function to its declaration
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
f1a4787f76 avcodec/proresdsp: Make put_pixels truely ptrdiff_t compatible
It currently uses an intermediate int which wouldn't work
if linesize exceeded the range of int and inhibits compiler
optimizations. Also switch to pointer arithmetic and use
smaller scope.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
802e4f4a53 avcodec/proresdec: Disable HWAccel at compile-time when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
57d892bd7b avcodec/prores{dec,dsp}: Remove always-false checks
avctx->bits_per_raw_sample is always 10 or 12 here;
the checks have been added in preparation for making
bits_per_raw_sample user-settable via an AVOption,
but this never happened.

While just at it, also set unpack_alpha earlier
(where bits_per_raw_sample is set).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
90ed5ddf66 avcodec/proresdec: Deduplicate debug message
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
fa39f07a29 avcodec/get_bits: Remove LONG_BITSTREAM_READER
No longer used anywhere.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
8ad2daec58 avcodec/proresdec: Don't use LONG_BITSTREAM_READER
Using LONG_BITSTREAM_READER means that every get_bits() call
uses an AV_RB64() to ensure that cache always contains 32 valid bits
(as opposed to the ordinary 25 guaranteed by reading 32 bits);
yet this is unnecessary when unpacking alpha. So only use these
64bit reads where necessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
ee1408cd66 avcodec/flacdsp: Remove leftover encoding function pointers
Forgotten in 6c4595190e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
90d9e2a26c avcodec/intrax8dsp: Copy several bytes at once
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Andreas Rheinhardt
6f31b05389 avcodec/intrax8dsp: Constify DSP functions
Also add restrict where possible.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-27 15:30:12 +01:00
Timo Rothenpieler
99e2af4e78 avcodec/cuviddec: correctly handle buffer size and status when deinterlacing 2025-02-26 20:56:10 +01:00
Chris Hodges
330c8f8b93 avformat: add AV1 RTP depacketizer and packetizer
Add RTP packetizer and depacketizer according to (most)
of the official AV1 RTP specification. This enables
streaming via RTSP between ffmpeg and ffmpeg and has
also been tested to work with AV1 RTSP streams via
GStreamer.

It also adds the required SDP attributes for AV1.

AV1 RTP encoding is marked as experimental due to
draft specification status, debug amount reduced
and other changes suggested by Tristan.

Added optional code for searching the sequence
header to determine the first packet for broken
AV1 encoders / parsers.

Stops depacketizing on corruption until next keyframe,
no longer prematurely issues packet on decoding if
temporal unit was not complete yet.

Change-Id: I90f5c5b9d577908a0d713606706b5654fde5f910
Signed-off-by: Chris Hodges <chrishod@axis.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2025-02-26 12:32:22 -05:00
Lynne
b3d73df80d aacenc: remove ANMR coder
If there's ever a rework of the AAC encoder, it won't start from here.
The codec, with all its oddities and tweaks needed to acheive good quality
has strayed far from the academic work upon which this coder was based on.
Its been 20 years since this paper was released, and no known existing
implementations, open-source or proprietary that we know of, are based on it.
2025-02-26 17:12:08 +01:00
Lynne
9383533770 aacenc: remove support for AAC LTP profile
The LTP profile of AAC is... terrible.
It was an early 90's attempt at bridging the gap between speech
codecs and general purpose codecs. It did so by trying to exploit the fact
that most speech patterns are regular.

Unfortunately, it went about it the same way as AAC Main, by taking
the previous frame's samples, modifying them through an LPC filter,
transforming them back using a forward MDCT, putting the output
coefficients back into the current frame, and using delta coding.
But once again, they ignored basic mathematics and MDCT leakage.
Thankfully, because AAC LTP is meant to operate at very low bitrates,
the extreme quantization results in most leakage being irrelevant.

Unfortunately, the result is that the output sounds pretty much
terrible regardless of whether LTP is enabled or not.

This was the first attempt at trying to couple speech coding into AAC.
No, the second attempt did not succeed either.
Nnnneither did the third. Or fourth.

For the fifth one, they literally just jammed a speech codec into AAC
with USAC once they saw Opus do it.

Just drop support for encoding AAC LTP. It was always experimental
to begin with.
2025-02-26 17:12:08 +01:00
Lynne
9b11fefb88 aacenc: remove support for AAC Main profile
The Main profile of AAC is... terrible.
It enables the use of delta coding across coefficients of two frames
to try to increase compression, and it enabled one more pole for TNS
filters.

What the AAC authors failed to take into account were basic
mathematics, as MDCT leakage (e.g. the spread of each frequency when
represented in a discrete spectrum) is significant in most audio codecs.
This leads to huge variations between each frame, basically rendering
prediction completely pointless.

In fact, enabling AAC-Main prediction does not, in general, even recoup
the metadata losses from signalling the profile and prediction properties
in the first place. So you lose efficiency by using AAC Main.

The rumor is that it was put in the AAC spec for patent reasons, though
patent-wise, it has about as much use as a patent for a bicycle designed
for use by snakes.

The only other thing AAC Main changes is it permits 3-pole TNS filters.
When AAC's bands are absolutely tiny, except for very high frequency bands,
where you're likely to use PNS instead.

Just get rid of it.
2025-02-26 17:12:04 +01:00
Peter Zebühr
e24920375c Make mime-type award a bonus probe score
This changes the default behaviour of ffmpeg where content-type headers
on an input gives an absolut probe score (of 75) to instead give a bonus
score (of 30). This gives the probe a better chance to arrive at the
correct format by (hopefully) giving a large enough bonus to push edge
cases in the right direction (MPEG-PS vs MP3, I am looking at you) while
also not adversly punishing clearer cases (raw ADTS marked as
"audio/mpeg" for example).

This patch was regression tested against 20 million recent podcast
submissions (after content-type propagation was added to
original-storage), and 50k Juno vodcasts submissions (dito). No adverse
effects observed (but the bonus may still need tweaking if other edge
cases are detected in production).
2025-02-26 14:52:34 +01:00
Ulrik Mikaelsson
5a526fdad0 avformat/mp3dec: Subtract known padding from duration
When an Info-tag is present, marking initial and trailing samples as
padding, those samples should not be included in the calculation of track
duration.

This solves a surprising user experience where converting a WAV->MP3->WAV,
ffprobe will show the duration of the mp3 as slightly longer than both the
input and the output.

As a result, the estimated duration and imprecise seek-results of some
FATE-tests have been updated.
2025-02-26 14:52:34 +01:00
ekir
da5353cf05 GOL-1361: Remove invalid CTTS sample_offset check
We checked in this places:
* In 8.6.1.3 of ISO/IEC 14496-12 about the CTTS box
* In Apples MOV spec: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-SW19
2025-02-26 14:52:34 +01:00
Jonathan Murray
98d97bb33b rtmp: Set correct message stream id when writing as server
rtmp_write is used both for writing outputs as a server. The
rt->listen flag determines which mode we're running in.

Previously, when running as a server, the message stream id would
always be set to 0 for media/metadata messages. This is surprising
given that we have both responded to "createStream()" with a value
of 1 and sent a "Stream Begin 1" to the client. Furthermore, some
client libraries (Red5) seem to trip up on receiving
"@setDataFrame" on stream 0 (and may be correct to assume that
this message would be sent on stream 1).
2025-02-26 14:52:34 +01:00
Ulrik
95314cd7c5 avformat/flacdec: Return correct error-codes on read-failure
Forward errors from `avio_read` directly. When `avio_read` sees EOF before
expected bytes can be read, consistently return `AVERROR_INVALIDDATA`

We used to return `AVERROR(AVERROR_INVALIDDATA)` when failing to read
metadata block headers. `AVERROR_INVALIDDATA` is already negative, so
wrapping in `AVERROR` leads to double-negation.

We used to return `AVERROR(EIO)` when failing to read extended metadata.
However, many times, the IO-layer is not at fault, the input data is simply
corrupted (truncated), so we return `AVERROR_INVALIDDATA` here as well.

---

Tomas: changed to use AVERROR_EOF
2025-02-26 14:52:34 +01:00
Jonathan Murray
399234ee2a libavcodec/wmadec: Return AVERROR_INVALIDDATA on decoding errors
WMA files that fail to decode due to incoherent block lengths and
frame lengths currently result in a "Operation not permitted".
After this change, they will instead result in "Invalid data found
when processing input".

Several other error cases are also changed from returning -1.

As we change the error propagation logic in wma_decode_frame and
wma_decode_superframe, previous occurrences of returning
AVERROR_INVALIDDATA are also affected by this. This includes
"total_gain overread" and a "channel exponents_initialized" check.

---

Tomas: changed some -1's to AVERROR_INVALIDDATA
2025-02-26 14:52:15 +01:00
Ulrik
1306e5c7d3 avformat/http: Return EIO for prematurely broken connection
Currently, a prematurely broken connection normally leads to the same
EOF, as a completed successful transfer. However, enabling reconnect
changes this logic, and leads to the return of EIO.

This patch unifies that logic, leading to the return of EIO for premature
disconnect, regardless of setting of "reconnect".
2025-02-26 14:52:15 +01:00
Zhao Zhili
584c41a4ac avcodec/ffv1_parser: Rename close to ffv1_close
This fixed wasm checkasm failure

$ wasm-tools validate tests/checkasm/checkasm
error: wasisdk://v25.0/build/sysroot/wasi-libc-wasm32-wasip1-threads/libc-top-half/musl/src/stdio/__stdio_close.c:24:9 function `__stdio_close` failed to validate

Caused by:
    0: func 4581 failed to validate
    1: type mismatch: expected i32 but nothing on stack (at offset 0x43b770)

Since close is declared as static function, it's more like a bug
in wasi sdk, but we can workaround it easily.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: James Almer <jamrial@gmail.com>
2025-02-26 17:41:10 +08:00
James Almer
8e6032990c fftools/ffmpeg_dec: don't try to copy side data from the decoder if it already exists in the output frame
We can't use AV_FRAME_SIDE_DATA_FLAG_REPLACE here because the side data already in the
frame should have priority over the global one, so just ensure we don't copy any if
it already exists.

Fixes ticket #11468.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-25 19:51:18 -03:00
Zhao Zhili
d161604625 tests: Add fate-hevc-alpha
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-25 11:40:33 +08:00
Frank Plowman
a37f634383 tools: Add binaries to .gitignore
Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-25 02:03:58 +01:00
Michael Niedermayer
4ff1d1f3d6 add tools/compare-cvelists.sh
This compares the MITRE CVE list with our webpage security list and
produces a diff, so people can investigate, fix, backport and correct
differences

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-24 15:39:03 +01:00
Andreas Rheinhardt
37348e1b20 fftools/ffprobe: Switch to AVMutex
This removes several #if checks. While just at it, also switch
to static mutex initialization.
This commit does not enable -show_log for builds without threads
though.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-24 15:09:54 +01:00
Gyan Doshi
6232f416b1 ffmpeg_demux: add option readrate_catchup
At present, if reading from a readrate-limited input is stalled,
then upon resumption, ffmpeg will read the input without any
throttle till the average readrate matches the specified readrate.

This new option allows to set a speed limit when reading is resumed
until the average readrate matches the primary readrate.

Fixes #11469
2025-02-24 15:16:59 +05:30
Gyan Doshi
a060b4d9a9 fftools: notify user of flags upon loglevel parse failure 2025-02-24 15:15:53 +05:30
Pavel Koshevoy
5021764413 avformat/mov: (v4) fix get_eia608_packet
The problem is reproducible with "Test for Quicktime 608 CC file.mov"
from https://samples.ffmpeg.org/MPEG2/subcc/

ffmpeg -i "Test for Quicktime 608 CC file.mov" -map 0 -c copy -y remuxed.mov

See https://trac.ffmpeg.org/ticket/11470
2025-02-23 09:43:56 -07:00
Frank Plowman
d5dbcc00d8 lavc/vvc: Ensure subpictures don't overlap
This is essentially a re-implementation of
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20241005223955.54158-1-post@frankplowman.com/

That patch was not applied last time.  Instead we opted to identify
issues which could be caused by invalid subpicture layouts and remedy
those issues where they manifest, either through error detection or code
hardening.  This was primarily implemented in the set
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=13381.

This has worked to some degree, however issues with subpicture layouts
continue to crop up from the fuzzer and I've fixed a number of bugs
related to subpicture layouts since then.  I think it's best to return
to the initial plan and simply check if the subpicture layout is valid
initially.

This implementation is also lighter than the first time -- by doing a
bit more logic in pps_subpic_less_than_one_tile_slice, we are able to
store a tile_in_subpic map rather than a ctu_in_subpic map.  This
reduces the size of the map to the point it becomes possible to allocate
it on the stack.  Similar to 8bd66a8c95,
the layout is also validated in the slice map construction code, rather
than in the CBS, which avoids duplicating some logic.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-02-23 21:39:42 +08:00
Frank Plowman
93aae172ea lavc/vvc: Fix slice map construction for small subpics
In the case pps_subpic_less_than_one_tile_slice is called, the
subpicture is smaller than the tile and so there are multiple
subpictures in the tile.  Of course, then, not all the
subpictures can start in the top-left corner as the code before the
patch does.  Patch fixes this, so each subpicture starts at the
signalled location as is specified in section 6.5.1 of H.266(V3).

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-02-23 21:39:42 +08:00
James Almer
87d7b8ff4b fate/demux: add a test for Theora in OGG
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-23 00:13:35 -03:00
Andreas Rheinhardt
8f2af8fda6 avcodec/mpegvideo_{dec,enc}: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-23 02:01:18 +01:00
Andreas Rheinhardt
b05ec7fec9 avcodec/mpv_reconstruct_mb_template: Merge template into its users
A large part of this template is decoder-only. This makes
the complexity of the IS_ENCODER-checks not worth it.
So simply merge the template into both its users.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-23 02:01:18 +01:00
Andreas Rheinhardt
fc64b2ee5d avcodec/mpegvideo_enc: Don't reset intra buffers in mpv_reconstruct_mb()
It is not part of reconstructing the macroblock.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-23 02:01:18 +01:00
Andreas Rheinhardt
5826166836 avcodec/h263dec: Clean intra tables in decoder, not ff_mpv_reconstruct_mb
This is a more appropriate place than a function designed
to reconstruct a macroblock. It furthermore limits these checks
to the codecs that actually need it (and removes it from e.g.
RV10 and RV20 -- the latter actually uses these buffers, but
only for intra-frames, so they don't need to be cleaned
manually).

This furthermore means that ff_mpv_reconstruct_mb() and therefore
also the error-resilience code no longer needs block_index set.
This fixes a crash caused by 65d5ccb808
when ff_mpv_reconstruct_mb() is called by VC-1 code without
block_index being initialized properly (VC-1 uses and initializes
block_index itself normally).

Fixes: 69814/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-4868081575329792
Fixes: heap-buffer-overflow

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-23 02:01:08 +01:00
Andreas Rheinhardt
58f9e497dc avcodec/mpeg12enc: Move resetting last_dc to encoder
The MPEG-1/2 encoders are the only non-intra-only mpegvideo
encoders that want last_dc reset when encoding non-intra macroblocks.
Therefore move resetting it to mpeg12enc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-23 01:08:45 +01:00
Andreas Rheinhardt
9a46c0160f avcodec/mpeg12dec: Move resetting last_dc to decoder
Only the MPEG-1/2, MSMPEG4V1, MPEG-4 and RV.10 decoders use last_dc
at all. Of these, RV.10 only uses it for intra frames; it does not
need these predictors reset in ff_mpv_reconstruct_mb(). MSMPEG4V1
has h263_pred set, so that last_dc is already not reset in
ff_mpv_reconstruct_mb() (instead it is reset at the beginning
of every line). MPEG-4 also has h263_pred set (and uses last_dc only
for the intra-only studio profile and needs them reset to sligthly
different values anyway).

So only the MPEG-1/2 decoders need these values reset. So move
resetting them there. This avoids resetting them unnecessarily
for FLV1, H.261, H.263I, RV.10, RV.20 and H.263(+)
(for the latter it depends upon whether h263_aic is in use).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-23 01:08:45 +01:00
Andreas Rheinhardt
ebf0d34281 avcodec/h261enc: Use LUT to write motion vector differences
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-23 01:08:45 +01:00
Gyan Doshi
d1ed5c06e3 avcodec/libsvtav1: unbreak build with latest svtav1
SVT-AV1 made a change in their public API in 988e930c but without a
version bump or any other accessible marker, thus breaking ffmpeg build
with current versions of SVT-AV1.

They have finally bumped versions a month later, so check added.
2025-02-22 18:57:53 +05:30
Frank Plowman
392aa9daf2 lavc/vvc: Fix derivation of inverse LMCS idx
The clamping of idxYInv from H.266(V3) section 8.8.2.3 was missing.
This could lead to OOB reads from lmcs->pivot or input_pivot.

I also changed the derivation of the forward LMCS idx to use a shift
rather than a division for speed and as this is actually how the
variable is declared in the specification (8.7.5.2).

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-02-22 12:02:59 +08:00
Nuo Mi
bb8e95b650 lavc/vvcdec: export stream level VUI information
Previously, VUI information was not exposed.
If the container lacks HDR metadata, HDR videos appear washed out

Command: mp4box -add hdr.mp4#video:colr=nclc,1,1,1 -new new.mp4 && ffprobe new.mp4
Before: Stream #0:0[0x1](und): Video: vvc (vvc1 / 0x31637676), yuv420p10le(bt709), 1920x1080, 12164 kb/s, 50 fps, 50 tbr, 90k tbn (default)
After:  Stream #0:0[0x1](und): Video: vvc (vvc1 / 0x31637676), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 1920x1080 [SAR 1:1 DAR 16:9], 12164 kb/s, 50 fps, 50 tbr, 90k tbn (default)

Reported-by: Barry Warburton <blwarburton@gmail.com>
2025-02-22 11:29:58 +08:00
Nuo Mi
2d9433f25b lavc/vvcdec: refact, set AVCodecContext->has_b_frames in sps_export_stream_params 2025-02-22 11:29:58 +08:00
Lynne
2066c5526d gblur_vulkan: simplify buffer content writing
Before .buf_elems, users had to manually print to a string if they
wanted a non-fixed number of elements in an array.

Since we're printing everything to the shaders manually anyway, use
the new mechanism.
2025-02-21 03:19:21 +01:00
Lynne
f774a9376a vulkan: add .buf_elems to FFVulkanDescriptorSet
This enables users to specify a number that would be appended to
the buf_content string.
Saves users from needing to manually print to a string.

An earlier commit tried doing this via .elems, but it was
faulty, as this also incremented the total number of descriptors
in the descriptor set.
2025-02-21 03:19:20 +01:00
Lynne
89704f07bb lavc/vulkan: add a u8vec2buf buffer type
Useful, since it doesn't have alignment limitations.
2025-02-21 03:19:20 +01:00
Lynne
684171c9f7 overlay_vulkan: remove unused variable
Forgotten to be removed after the recent port to imageLoad()
2025-02-21 03:19:19 +01:00
Lynne
b6bf568a44 vulkan: don't query video queue properties unless the extension is enabled
Fixes validation errors.
2025-02-21 03:19:19 +01:00
Lynne
542a567d50 ffv1enc_vulkan: support default range coder tables
This adds support for default range coder tables, rather than
only custom ones. Its two lines, as the same code can be used
for both thanks to ffv1enc.c setting f->state_transition properly.
2025-02-21 03:19:19 +01:00
Lynne
5cf4f145ad ffv1dec: set f->state_transition for default range coder table
The table is only set when f->ac is set to CUSTOM. Setting it
for default range coder tables simplifies hardware accelerator code.
2025-02-21 03:19:14 +01:00
Zhao Zhili
bc1a3bfd2c avcodec/hevc: Add support for output_corrupt/showall flags
Also handle gradual decoding refresh stream.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-20 11:39:52 +08:00
Zhao Zhili
b6652115de avcodec/hevc: Parse recovery point SEI
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-20 11:33:50 +08:00
James Almer
5470d024e1 avformat/iamf_parse: ensure there's at most one of each parameter types in audio elements
Should prevent potential memory leaks on invalid files.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-19 19:51:21 -03:00
James Almer
0526535cd5 avformat/iamf_parse: add missing constrains for num_parameters in audio_element_oub()
Fixes ticket #11475.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-19 19:51:21 -03:00
James Almer
6e26f57f67 avformat/demux: don't discard empty Theora packets
Theora signals "Output last frame again" with an empty packet.

Finishes fixing ticket #11451.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-19 19:51:21 -03:00
James Almer
84d85e7ad4 avformat/oggenc: don't discard empty packets with no side data
Theora signals "Output last frame again" with an empty packet.
To keep the behaviour of 18f24527eb of ignoring side data only packets, as
generated by the FLAC encoder to propagate updated extradata, also check for
pkt->side_data_size to choose wheter to mux the paket or not.

Fixes part of ticket #11451.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-19 19:51:21 -03:00
James Almer
261ec6c35e avformat/mov: further ensure mov_build_index isn't run twice
If sc->tts_count is not 0, then the sample index has already been built.

Fixes: Null-dereference READ
Fixes: 396192874/clusterfuzz-testcase-minimized-audio_decoder_fuzzer-4589309789143040

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-19 19:51:21 -03:00
James Almer
7e84865cff avcodec/codec_internal: remove unnecessary avcodec.h include
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-19 19:50:05 -03:00
Niklas Haas
cd81f08491 avfilter/libplacebo: use a transparent default fillcolor
This will leave the background transparent when the target format
contains an alpha channel, without affecting the behavior on formats
without one.
2025-02-19 18:33:21 +01:00
Shreesh Adiga
e18f87ed9f swscale/x86/rgb2rgb: add AVX512ICL version of uyvytoyuv422
The scalar loop is replaced with masked AVX512 instructions.
For extracting the Y from UYVY, vperm2b is used instead of
various AND and packuswb.

Instead of loading the vectors with interleaved lanes as done
in AVX2 version, normal load is used. At the end of packuswb,
for U and V, an extra permute operation is done to get the
required layout.

AMD 7950x Zen 4 benchmark data:
uyvytoyuv422_c:                                      29105.0 ( 1.00x)
uyvytoyuv422_sse2:                                    3888.0 ( 7.49x)
uyvytoyuv422_avx:                                     3374.2 ( 8.63x)
uyvytoyuv422_avx2:                                    2649.8 (10.98x)
uyvytoyuv422_avx512icl:                               1615.0 (18.02x)

Signed-off-by: Shreesh Adiga <16567adigashreesh@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-18 12:43:57 -03:00
Lynne
08e37fa082 overlay_vulkan: port to imageLoad() 2025-02-18 10:44:56 +01:00
Lynne
2b8d38cbc1 blend_vulkan: port to imageLoad() 2025-02-18 10:44:56 +01:00
Lynne
379cfd1855 transpose_vulkan: port to imageLoad() 2025-02-18 10:44:55 +01:00
Lynne
b02f9157b8 gblur_vulkan: port to imageLoad() 2025-02-18 10:44:55 +01:00
Lynne
4d3e540fa4 flip_vulkan: port to imageLoad() 2025-02-18 10:44:54 +01:00
Lynne
a535639620 nlmeans_vulkan: switch to imageLoad() 2025-02-18 10:44:54 +01:00
Lynne
9c4a26d9b0 avgblur_vulkan: fix duplicated variable error when planes=0 2025-02-18 10:44:54 +01:00
Lynne
389fb36f92 avgblur_vulkan: port to imageLoad() 2025-02-18 10:44:53 +01:00
Lynne
779763181f bwdif_vulkan: convert to storage images
texture() uses bilinear scaling; imageLoad() accesses the image directly.
The reason why texture() was used throughout Vulkan filters is that
back when they were written, they were targetting old Intel hardware,
which had a texel cache only for sampled images.

These days, GPUs have a generic cache that doesn't care what source it
gets populated with. Additionally, bypassing the sampling circuitry saves
us some performance.

Finally, all the old texture() code had an issue where unnormalized
coordinates were used, but an offset of 0.5 was not added, hence each
pixel ended up being interpolated. This fixes this.
2025-02-18 10:44:53 +01:00
Lynne
042ed96d0a vulkan_filter: use GENERAL image layout when no sampler is given
This allows using the generic filter code with STORAGE image inputs.
2025-02-18 10:44:53 +01:00
Lynne
1029f51285 vulkan: fix crash in ff_vk_shader_free
The issue is if a shader fails to compile, shd->desc_layout would
not exist, but nb_descriptor_sets would.
2025-02-18 10:44:49 +01:00
Niklas Haas
4dc2ae69e7 avfilter/interlace_vulkan: add interlace_vulkan filter
This is a Vulkan-accelerated version of the existing interlace filter.
2025-02-17 17:16:25 +01:00
James Almer
0e7c2a6287 fftools/ffmpeg: use an int for nb_threads
Removes unnecessary allocations.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-17 09:40:13 -03:00
Krzysztof Pyrkosz
b92577405b swscale/aarch64/rgb2rgb_neon: Implemented {yuyv, uyvy}toyuv{420, 422}
A78:
uyvytoyuv420_neon:                                    6112.5 ( 6.96x)
uyvytoyuv422_neon:                                    6696.0 ( 6.32x)
yuyvtoyuv420_neon:                                    6113.0 ( 6.95x)
yuyvtoyuv422_neon:                                    6695.2 ( 6.31x)

A72:
uyvytoyuv420_neon:                                    9512.1 ( 6.09x)
uyvytoyuv422_neon:                                    9766.8 ( 6.32x)
yuyvtoyuv420_neon:                                    9639.1 ( 6.00x)
yuyvtoyuv422_neon:                                    9779.0 ( 6.03x)

A53:
uyvytoyuv420_neon:                                   12720.1 ( 9.10x)
uyvytoyuv422_neon:                                   14282.9 ( 6.71x)
yuyvtoyuv420_neon:                                   12637.4 ( 9.15x)
yuyvtoyuv422_neon:                                   14127.6 ( 6.77x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-17 11:39:42 +02:00
Krzysztof Pyrkosz
64107e22f5 swscale/aarch64/rgb24toyv12: skip early right shift by 2
It's a minor improvement that shaves off 5-8% from the execution time.
Instead of shifting by 2 right away and by 7 soon after, shift by 9 one
time.

Times before and after:

A78:
rgb24toyv12_16_200_neon:                              5366.8 ( 3.62x)
rgb24toyv12_128_60_neon:                             13574.0 ( 3.34x)
rgb24toyv12_512_16_neon:                             14463.8 ( 3.33x)
rgb24toyv12_1920_4_neon:                             13508.2 ( 3.34x)
rgb24toyv12_1920_4_negstride_neon:                   13525.0 ( 3.34x)

rgb24toyv12_16_200_neon:                              5293.8 ( 3.66x)
rgb24toyv12_128_60_neon:                             12955.0 ( 3.50x)
rgb24toyv12_512_16_neon:                             13784.0 ( 3.50x)
rgb24toyv12_1920_4_neon:                             12900.8 ( 3.49x)
rgb24toyv12_1920_4_negstride_neon:                   12902.8 ( 3.49x)

A72:
rgb24toyv12_16_200_neon:                              9695.8 ( 2.50x)
rgb24toyv12_128_60_neon:                             20286.6 ( 2.70x)
rgb24toyv12_512_16_neon:                             22276.6 ( 2.57x)
rgb24toyv12_1920_4_neon:                             19154.1 ( 2.77x)
rgb24toyv12_1920_4_negstride_neon:                   19055.1 ( 2.78x)

rgb24toyv12_16_200_neon:                              9214.8 ( 2.65x)
rgb24toyv12_128_60_neon:                             20731.5 ( 2.65x)
rgb24toyv12_512_16_neon:                             21145.0 ( 2.70x)
rgb24toyv12_1920_4_neon:                             17586.5 ( 2.99x)
rgb24toyv12_1920_4_negstride_neon:                   17571.0 ( 2.98x)

A53:
rgb24toyv12_16_200_neon:                             12880.4 ( 3.76x)
rgb24toyv12_128_60_neon:                             27776.3 ( 3.94x)
rgb24toyv12_512_16_neon:                             29411.3 ( 3.94x)
rgb24toyv12_1920_4_neon:                             27253.1 ( 3.98x)
rgb24toyv12_1920_4_negstride_neon:                   27474.3 ( 3.95x)

rgb24toyv12_16_200_neon:                             12196.3 ( 3.95x)
rgb24toyv12_128_60_neon:                             26943.1 ( 4.07x)
rgb24toyv12_512_16_neon:                             28642.3 ( 4.07x)
rgb24toyv12_1920_4_neon:                             26676.6 ( 4.08x)
rgb24toyv12_1920_4_negstride_neon:                   26713.8 ( 4.07x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-17 10:49:41 +02:00
Zhao Zhili
88d9ecaa7b avutil/frame: Fix direct pointer compare between different array
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-17 15:09:52 +08:00
Zhao Zhili
f926b60455 avcodec/hevc: Add alpha layer support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-17 15:09:41 +08:00
Zhao Zhili
d367016d3c avcodec/hevc/ps: Add basic HEVC_SCALABILITY_AUXILIARY support
Only implementing what's needed for HEVC with alpha.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-17 15:08:42 +08:00
Zhao Zhili
d3220ed818 avcodec/hevc: Rewrite scalability_mask_flag parse in decode_vps_ext
Remove a for loop and make it easy to extend to support other types
of scalability. Move ScalabilityMask to hevc header file so it can
be used in hevc decoder.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-17 15:08:33 +08:00
Michael Niedermayer
01f74bfaa2 avcodec/rv60dec: Initialize slice gb with actually allocated size
Fixes: out of array access
Fixes: 385170375/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-4710055187906560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:43 +01:00
Michael Niedermayer
8668957ef6 avformat/iff: Check that we have a stream in read_dst_frame()
Fixes: null pointer dereference
Fixes: 385644864/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4551049565765632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:42 +01:00
Michael Niedermayer
464fb861b1 avcodec/aac/aacdec_lpd: Limit get_unary()
The limit is based on later code storing 32bits

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 393164866/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4606798354513920

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:42 +01:00
Michael Niedermayer
41cd72d76e avcodec/aac/aacdec_usac: Simplify decode_usac_scale_factors()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:42 +01:00
Michael Niedermayer
d1be369af6 avcodec/aac/aacdec: Clear SFO on error
types and SFO become confused for a USAC stream

Fixes: out of array access
Fixes: 383854203/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4996677847547904.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:41 +01:00
Michael Niedermayer
251d43aef0 avformat/mlvdec: fix size checks
Fixes: heap-buffer-overflow
Fixes: 391962476/clusterfuzz-testcase-minimized-ffmpeg_dem_MLV_fuzzer-5746746587676672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:41 +01:00
Michael Niedermayer
1afbc40875 avformat/wavdec: Fix overflow of intermediate in block_align check
Fixes: signed integer overflow: -251517880 * 32 cannot be represented in type 'int'
Fixes: 385224934/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-4909298151915520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:41 +01:00
softworkz
9fd23f712a fftools/opt_common: add time and datetime log flags
This commit adds two logging flags: 'time' and 'datetime'.

Usage:

ffmpeg -loglevel +time

or

ffmpeg -loglevel +datetime

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:40 +01:00
softworkz
c79cdae377 avutil/log: support logging of date and time information
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-16 15:41:40 +01:00
Frank Plowman
e417f939da lavc/vvc: Set fc->ref to NULL at top of decode_nal_units
In the fail: block of decode_nal_units, a check as to whether fc->ref is
nonzero is used.  Before this patch, fc->ref was set to NULL in
frame_context_setup.  The issue is that, by the time frame_context_setup
is called, falliable functions (namely slices_realloc and
ff_vvc_decode_frame_ps) have already been called.  Therefore, there
could arise a situation in which the fc->ref test of decode_nal_units'
fail: block is performed while fc->ref has an invalid value.  This seems
to be particularly prevalent in situations where the FrameContexts are
being reused.  The patch resolves the issue by moving the assignment of
fc->ref to NULL to the very top of decode_nal_units, before any falliable
functions are called.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-02-16 11:54:55 +08:00
Michael Niedermayer
a50d36b5fd avcodec/vvc/refs: Check content_ref in set_pict_type()
Fixes: 390565846/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4990028521996288
Fixes: Null pointer dereference

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-15 11:25:12 +08:00
Araz Iusubov
3698570442 avcodec/amfenc: Fix max rate control log message 2025-02-14 17:21:11 +01:00
James Almer
75ade2dd49 avcodec/hevc_mp4toannexb: prepend extradata before the leading PS for an IRAP
Parameter sets may be coded in the packet before an IRAP (as is the case for
the hev1 ISO-BMFF brand), and they should have priority as they may override
the extradata ones.
As such, prepend the extradata PS NALUs to the packet PS NALUs if they are
present before an IRAP, instead of prepending them to the IRAP slice.

Should fix ticket #11458.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-14 00:21:19 -03:00
Martin Storsjö
19a2d26177 random_seed: Improve behaviour with small timer increments with high precision timers
On a Zen 5, on Ubuntu 24.04 (with CLOCKS_PER_SEC 1000000), the
value of clock() in this loop increments by 0 most of the time,
and when it does increment, it usually increments by 1 compared
to the previous round.

Due to the "last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) >= t"
expression, we only manage to take one step forward in this loop
(incrementing i) if clock() increments by 2, while it incremented
by 0 in the previous iteration (last_td).

This is similar to the change done in
c4152fc42e, to speed it up on
systems with very small CLOCKS_PER_SEC. However in this case,
CLOCKS_PER_SEC is still very large, but the machine is fast enough
to hit every clock increment repeatedly.

For this case, use the number of repetitions of each timer value
as entropy source; require a change in the number of repetitions
in order to proceed to the next buffer index.

This helps the fate-random-seed test to actually terminate within
a reasonable time on such a system (where it previously could hang,
running for many minutes).

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-13 11:41:51 +02:00
Martin Storsjö
b053f1173d random_seed: Reorder if clauses for gathering entropy
Make it easier to add more cases.

This should be a pure refactoring, with no functional changes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-13 11:41:47 +02:00
James Almer
dc7964a862 avcodec/version: bump micro after the previous change
Useful to know if a given library build has the flush() callback or not.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-12 21:09:52 -03:00
James Almer
045a8b15b1 avcodec/ac3dec: add a flush callback for the ac3 and eac3 decoders
Fixes ticket #10732

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-12 19:12:22 -03:00
James Almer
a9e8586e3f avcodec/ac3dec: move some fields up in AC3DecodeContext
Needed for the following commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-12 19:12:13 -03:00
James Almer
22aa71d4da avcodec/libtheora: fix setting keyframe_mask
t_info.keyframe_granule_shift is set to the library default of 6, which is ok
for gop sizes up to 63. Since there's apparently no way to query the updated
value after having forced a gop value with TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
calculate it manually instead.

Fixes ticket #11454.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-12 18:53:25 -03:00
James Almer
eb3d507b7f avdevice/alsa: simplify passing ff_alsa_open a channel layout
This also ensures the layout set during the indev init is used instead of the
blank one in st->codecpar.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-12 18:49:07 -03:00
Rémi Bernon
d62fd6e9c8 avformat/mov: Store trak > udta metadata on each stream
Some files keep extra metadata such as 'name' fields within udta, and
it is useful for Wine to access them with the "export_all" option so
they can then be exposed to Windows applications.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-11 15:22:59 +02:00
Dennis Sädtler
78ff3782af lavc/videotoolboxenc: Add spatial_aq option
Added in macOS 15 "Sequoia".

Signed-off-by: Dennis Sädtler <dennis@obsproject.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-11 11:33:27 +02:00
Ronald S. Bultje
586de322ab threadprogress: reorder instructions to fix race.
Fixes #11456.
2025-02-10 11:00:07 -05:00
Gyan Doshi
7ee4936e0a avfilter/vpp_amf: add option reset_sar
4b77a0a681 added a new consumer of ff_scale_adjust_dimensions
which was recently modified to allow for square pixel output.

This commit extends the new option to vpp_amf, and unbreaks the building
of vf_amf_common.c
2025-02-10 19:59:26 +05:30
Timo Rothenpieler
d6a364e7c3 avfilter/vf_amf_common: fix build
AMF was forgotten in a28dc06869
2025-02-10 14:32:25 +01:00
Krzysztof Pyrkosz
9fb97215df avcodec/aarch64/opusdsp_neon: Simplify opus_postfilter_neon
This change removes one extra floating point operation and simplifies
load operations at the beginning of the loop by using dedicated register
for each of the 5 pointers and interleaving it with calculations. The
first case seems to be a bit slower, but the performance increase is
substantial in the other two.

A78 before:
postfilter_15_neon:                                   1684.8 ( 4.23x)
postfilter_512_neon:                                  1395.5 ( 5.10x)
postfilter_1022_neon:                                 1357.0 ( 5.25x)

After:
postfilter_15_neon:                                   1742.2 ( 4.09x)
postfilter_512_neon:                                  1169.8 ( 6.09x)
postfilter_1022_neon:                                 1160.0 ( 6.12x)

A72 before:
postfilter_15_neon:                                   3144.8 ( 2.39x)
postfilter_512_neon:                                  3141.2 ( 2.39x)
postfilter_1022_neon:                                 3230.0 ( 2.33x)

After:
postfilter_15_neon:                                   2847.8 ( 2.64x)
postfilter_512_neon:                                  2877.8 ( 2.61x)
postfilter_1022_neon:                                 2837.2 ( 2.65x)

x13s before:
postfilter_15_neon:                                   1615.4 ( 2.61x)
postfilter_512_neon:                                   963.1 ( 4.39x)
postfilter_1022_neon:                                  963.6 ( 4.39x)

After:
postfilter_15_neon:                                   1749.6 ( 2.41x)
postfilter_512_neon:                                   707.1 ( 5.97x)
postfilter_1022_neon:                                  706.1 ( 5.99x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-10 14:55:16 +02:00
Martin Storsjö
e75a0f3c75 checkasm: aacencdsp: Actually test nonzero values in quant_bands
Previously, we read elements from ff_aac_pow34sf_tab; however
that table is initialized to zero; one needs to call
ff_aac_float_common_init() to make sure that the table is
initialized.

However, given the range of the input values, a large number of
entries in ff_aac_pow34sf_tab would give results outside of the
range for signed 32 bit integers. As the largest aac_cb_maxval
entry is 16, it seems more reasonable to produce values within
an order of mangitude of that value.

(When hitting INT_MIN, implementations may end up with different
results depending on whether the value is negated as a float or
as an int. This corner case is irrelevant in practice as this
is way outside of the expected value range here.)

Coincidentally, this fixes linking checkasm with Apple's older
linker. (In Xcode 15, Apple switched to a new linker. The one in
older toolchains seems to have a bug where it won't figure out to
load object files from a static library, if the only symbol
referenced in the object file is a "common" symbol, i.e. one for
a zero-initialized variable. This issue can also be reproduced with
newer Apple toolchains by passing -Wl,-ld_classic to the linker.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-10 14:03:25 +02:00
Martin Storsjö
8b3e0061e1 x86: aacencdsp: Fix negating signed values in aac_quantize_bands
Previously, we would do OR with the sign bit, forcing the output
to a negative value, while we want to negate it, by inverting the
sign bit.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-10 14:03:24 +02:00
Gyan Doshi
a28dc06869 avfilter/scale*: add option reset_sar
For anamorphic videos, enabling this option leads to adjustment of
output dimensions to obtain square pixels when the user requests
proportional scaling through either of the w/h expressions or
force_original_aspect_ratio.

Output SAR is always reset to 1.

Option added to scale, scale_cuda, scale_npp & scale_vaapi.

libplacebo already has a similar option with different semantics,
scale_vt and scale_vulkan don't implement force_oar, so for these
three filters, I've made minimal changes needed to not break building
or change output.
2025-02-10 16:25:23 +05:30
Scott Theisen
e838e6cbe2 avformat/mpeg: demux ivtv captions
The packets start 'IVT0' or 'ivt0'
('I' = 0x49, 'i' = 0x69).

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-02-09 20:28:11 -06:00
Scott Theisen
9fb806fa57 avcodec: add AV_CODEC_ID_IVTV_VBI
IVTV, a Linux driver for TV tuners, and V4L2 utilize
a coding named after IVTV to carry sliced VBI data
in MPEG streams produced by tuner cards with
VBI capture capability and an MPEG-2 encoder SoC.

IVTV or V4L2 driver will transport the coded data into a
MPEG-PS private stream ("IVTV") that can be captured
from the card alongside the video/audio.

The data could include:
EIA-608, Teletext, WSS (PAL widescreen signaling),
or VPS (PAL VCR signaling).

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-02-09 20:27:49 -06:00
Marth64
0ae5b1bfcc avcodec/hw_base_encode: log the readable error message on failure
Currently, if there is a hardware encode failure, the numeric
error code will be printed making it somewhat hard to get to
the root cause of the issue. Print the readable message generated
by av_err2str() instead.

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-02-09 20:27:49 -06:00
Leo Izen
3fca5877d0 avcodec/pngdec: avoid hard failure on illegal sBIT chunks
If a malformed chunk like sBIT appears but otherwise the stream
is still parseable, we should print a warning and skip it rather
than failing with an error.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-02-09 19:06:42 -05:00
James Almer
43be8d0728 avformat/mov: check for tts_count before deferencing tts_data
Fixes ticket #11460.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-07 23:00:34 -03:00
Peter Ross
16f9cfcf4b avcodec/leaddec: support format 0x1006
Fixes ticket #10658.
2025-02-08 10:59:05 +11:00
James Almer
a8f2374507 avformat/mov: add an offset to IAMF streams
Using audio_substream_id for AVStream ids is not ideal give that in containers
like mp4, the IAMF structure is opaque to the outside and other streams may
share such id values.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-07 19:44:13 -03:00
James Almer
268d0b6527 swscale/graph: copy scaler_params to the legacy subpass context
Fixes ticket #11448.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-07 13:17:37 -03:00
dank074
e945142df3 avformat/unix: set is_streamed to true
Currently when a Unix Domain Socket is used as input there is a loss
of data when data is consumed from the stream. Setting is_streamed to
true fixes this, since the unix domain socket is now treated like a
consumable stream.

Fixes: #9346
Signed-off-by: dank074 <torresefrain10@gmail.com>
Reviewed-by: Leo Izen <leo.izen@gmail.com>
2025-02-07 10:13:50 -05:00
Kacper Michajłow
f00a08c0ce avutil/hwcontext_amf: fix crash on uninit after init failed
amf_device_create() calls amf_device_uninit() on errors, but if things
were not initialized it will null deref amf_ctx->factory.

Fixes: https://github.com/mpv-player/mpv/issues/15814

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-02-07 13:30:01 +01:00
Krzysztof Pyrkosz
c85a748979 swscale/aarch64/rgb2rgb: Implemented NEON shuf routines
The key idea is to pass the pre-generated tables to the TBL instruction
and churn through the data 16 bytes at a time. The remaining 4 elements
are handled with a specialized block located at the end of the routine.

The 3210 variant can be implemented using rev32, but surprisingly it is
slower than the generic TBL on A78, but much faster on A72.

There may be some room for improvement. Possibly instead of handling
last 8 and then 4 bytes separately, we can load these 4 into {v0.s}[2]
and process along with the last 8 bytes.

Speeds measured with checkasm --test=sw_rgb --bench --runs=10 | grep shuf

- A78
shuffle_bytes_0321_c:                                   75.5 ( 1.00x)
shuffle_bytes_0321_neon:                                26.5 ( 2.85x)
shuffle_bytes_1203_c:                                  136.2 ( 1.00x)
shuffle_bytes_1203_neon:                                27.2 ( 5.00x)
shuffle_bytes_1230_c:                                  135.5 ( 1.00x)
shuffle_bytes_1230_neon:                                28.0 ( 4.84x)
shuffle_bytes_2013_c:                                  138.8 ( 1.00x)
shuffle_bytes_2013_neon:                                22.0 ( 6.31x)
shuffle_bytes_2103_c:                                   76.5 ( 1.00x)
shuffle_bytes_2103_neon:                                20.5 ( 3.73x)
shuffle_bytes_2130_c:                                  137.5 ( 1.00x)
shuffle_bytes_2130_neon:                                28.0 ( 4.91x)
shuffle_bytes_3012_c:                                  138.2 ( 1.00x)
shuffle_bytes_3012_neon:                                21.5 ( 6.43x)
shuffle_bytes_3102_c:                                  138.2 ( 1.00x)
shuffle_bytes_3102_neon:                                27.2 ( 5.07x)
shuffle_bytes_3210_c:                                  138.0 ( 1.00x)
shuffle_bytes_3210_neon:                                22.0 ( 6.27x)

shuf3210 using rev32
shuffle_bytes_3210_c:                                  139.0 ( 1.00x)
shuffle_bytes_3210_neon:                                28.5 ( 4.88x)

- A72
shuffle_bytes_0321_c:                                  120.0 ( 1.00x)
shuffle_bytes_0321_neon:                                36.0 ( 3.33x)
shuffle_bytes_1203_c:                                  188.2 ( 1.00x)
shuffle_bytes_1203_neon:                                37.8 ( 4.99x)
shuffle_bytes_1230_c:                                  195.0 ( 1.00x)
shuffle_bytes_1230_neon:                                36.0 ( 5.42x)
shuffle_bytes_2013_c:                                  195.8 ( 1.00x)
shuffle_bytes_2013_neon:                                43.5 ( 4.50x)
shuffle_bytes_2103_c:                                  117.2 ( 1.00x)
shuffle_bytes_2103_neon:                                53.5 ( 2.19x)
shuffle_bytes_2130_c:                                  203.2 ( 1.00x)
shuffle_bytes_2130_neon:                                37.8 ( 5.38x)
shuffle_bytes_3012_c:                                  183.8 ( 1.00x)
shuffle_bytes_3012_neon:                                46.8 ( 3.93x)
shuffle_bytes_3102_c:                                  180.8 ( 1.00x)
shuffle_bytes_3102_neon:                                37.8 ( 4.79x)
shuffle_bytes_3210_c:                                  195.8 ( 1.00x)
shuffle_bytes_3210_neon:                                37.8 ( 5.19x)

shuf3210 using rev32
shuffle_bytes_3210_c:                                  194.8 ( 1.00x)
shuffle_bytes_3210_neon:                                30.8 ( 6.33x)

- x13s:
shuffle_bytes_0321_c:                                   49.4 ( 1.00x)
shuffle_bytes_0321_neon:                                18.1 ( 2.72x)
shuffle_bytes_1203_c:                                   98.4 ( 1.00x)
shuffle_bytes_1203_neon:                                18.4 ( 5.35x)
shuffle_bytes_1230_c:                                   97.4 ( 1.00x)
shuffle_bytes_1230_neon:                                19.1 ( 5.09x)
shuffle_bytes_2013_c:                                  101.4 ( 1.00x)
shuffle_bytes_2013_neon:                                16.9 ( 6.01x)
shuffle_bytes_2103_c:                                   53.9 ( 1.00x)
shuffle_bytes_2103_neon:                                13.9 ( 3.88x)
shuffle_bytes_2130_c:                                  100.9 ( 1.00x)
shuffle_bytes_2130_neon:                                19.1 ( 5.27x)
shuffle_bytes_3012_c:                                   97.4 ( 1.00x)
shuffle_bytes_3012_neon:                                17.1 ( 5.69x)
shuffle_bytes_3102_c:                                  100.9 ( 1.00x)
shuffle_bytes_3102_neon:                                19.1 ( 5.27x)
shuffle_bytes_3210_c:                                  100.6 ( 1.00x)
shuffle_bytes_3210_neon:                                16.9 ( 5.96x)

shuf3210 using rev32
shuffle_bytes_3210_c:                                  100.6 ( 1.00x)
shuffle_bytes_3210_neon:                                18.6 ( 5.40x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-07 12:54:55 +02:00
Krzysztof Pyrkosz
e25a19fc7c swscale/aarch64/output.S: refactor ff_yuv2plane1_8_neon
The benchmarks (before vs after) were gathered using
./tests/checkasm/checkasm --test=sw_scale --bench --runs=6 | grep yuv2yuv1

A78 before:
yuv2yuv1_0_512_accurate_c:                            2039.5 ( 1.00x)
yuv2yuv1_0_512_accurate_neon:                          385.5 ( 5.29x)
yuv2yuv1_0_512_approximate_c:                         2110.5 ( 1.00x)
yuv2yuv1_0_512_approximate_neon:                       385.5 ( 5.47x)
yuv2yuv1_3_512_accurate_c:                            2061.2 ( 1.00x)
yuv2yuv1_3_512_accurate_neon:                          381.2 ( 5.41x)
yuv2yuv1_3_512_approximate_c:                         2099.2 ( 1.00x)
yuv2yuv1_3_512_approximate_neon:                       381.2 ( 5.51x)
yuv2yuv1_8_512_accurate_c:                            2054.2 ( 1.00x)
yuv2yuv1_8_512_accurate_neon:                          385.5 ( 5.33x)
yuv2yuv1_8_512_approximate_c:                         2112.2 ( 1.00x)
yuv2yuv1_8_512_approximate_neon:                       385.5 ( 5.48x)
yuv2yuv1_11_512_accurate_c:                           2036.0 ( 1.00x)
yuv2yuv1_11_512_accurate_neon:                         381.2 ( 5.34x)
yuv2yuv1_11_512_approximate_c:                        2115.0 ( 1.00x)
yuv2yuv1_11_512_approximate_neon:                      381.2 ( 5.55x)
yuv2yuv1_16_512_accurate_c:                           2066.5 ( 1.00x)
yuv2yuv1_16_512_accurate_neon:                         385.5 ( 5.36x)
yuv2yuv1_16_512_approximate_c:                        2100.8 ( 1.00x)
yuv2yuv1_16_512_approximate_neon:                      385.5 ( 5.45x)
yuv2yuv1_19_512_accurate_c:                           2059.8 ( 1.00x)
yuv2yuv1_19_512_accurate_neon:                         381.2 ( 5.40x)
yuv2yuv1_19_512_approximate_c:                        2102.8 ( 1.00x)
yuv2yuv1_19_512_approximate_neon:                      381.2 ( 5.52x)

After:
yuv2yuv1_0_512_accurate_c:                            2206.0 ( 1.00x)
yuv2yuv1_0_512_accurate_neon:                          139.2 (15.84x)
yuv2yuv1_0_512_approximate_c:                         2050.0 ( 1.00x)
yuv2yuv1_0_512_approximate_neon:                       139.2 (14.72x)
yuv2yuv1_3_512_accurate_c:                            2205.2 ( 1.00x)
yuv2yuv1_3_512_accurate_neon:                          138.0 (15.98x)
yuv2yuv1_3_512_approximate_c:                         2052.5 ( 1.00x)
yuv2yuv1_3_512_approximate_neon:                       138.0 (14.87x)
yuv2yuv1_8_512_accurate_c:                            2171.0 ( 1.00x)
yuv2yuv1_8_512_accurate_neon:                          139.2 (15.59x)
yuv2yuv1_8_512_approximate_c:                         2064.2 ( 1.00x)
yuv2yuv1_8_512_approximate_neon:                       139.2 (14.82x)
yuv2yuv1_11_512_accurate_c:                           2164.8 ( 1.00x)
yuv2yuv1_11_512_accurate_neon:                         138.0 (15.69x)
yuv2yuv1_11_512_approximate_c:                        2048.8 ( 1.00x)
yuv2yuv1_11_512_approximate_neon:                      138.0 (14.85x)
yuv2yuv1_16_512_accurate_c:                           2154.5 ( 1.00x)
yuv2yuv1_16_512_accurate_neon:                         139.2 (15.47x)
yuv2yuv1_16_512_approximate_c:                        2047.2 ( 1.00x)
yuv2yuv1_16_512_approximate_neon:                      139.2 (14.70x)
yuv2yuv1_19_512_accurate_c:                           2144.5 ( 1.00x)
yuv2yuv1_19_512_accurate_neon:                         138.0 (15.54x)
yuv2yuv1_19_512_approximate_c:                        2046.0 ( 1.00x)
yuv2yuv1_19_512_approximate_neon:                      138.0 (14.83x)

A72 before:
yuv2yuv1_0_512_accurate_c:                            3779.8 ( 1.00x)
yuv2yuv1_0_512_accurate_neon:                          527.8 ( 7.16x)
yuv2yuv1_0_512_approximate_c:                         4128.2 ( 1.00x)
yuv2yuv1_0_512_approximate_neon:                       528.2 ( 7.81x)
yuv2yuv1_3_512_accurate_c:                            3836.2 ( 1.00x)
yuv2yuv1_3_512_accurate_neon:                          527.0 ( 7.28x)
yuv2yuv1_3_512_approximate_c:                         3991.0 ( 1.00x)
yuv2yuv1_3_512_approximate_neon:                       526.8 ( 7.58x)
yuv2yuv1_8_512_accurate_c:                            3732.8 ( 1.00x)
yuv2yuv1_8_512_accurate_neon:                          525.5 ( 7.10x)
yuv2yuv1_8_512_approximate_c:                         4060.0 ( 1.00x)
yuv2yuv1_8_512_approximate_neon:                       527.0 ( 7.70x)
yuv2yuv1_11_512_accurate_c:                           3836.2 ( 1.00x)
yuv2yuv1_11_512_accurate_neon:                         530.0 ( 7.24x)
yuv2yuv1_11_512_approximate_c:                        4014.0 ( 1.00x)
yuv2yuv1_11_512_approximate_neon:                      530.0 ( 7.57x)
yuv2yuv1_16_512_accurate_c:                           3726.2 ( 1.00x)
yuv2yuv1_16_512_accurate_neon:                         525.5 ( 7.09x)
yuv2yuv1_16_512_approximate_c:                        4114.2 ( 1.00x)
yuv2yuv1_16_512_approximate_neon:                      526.2 ( 7.82x)
yuv2yuv1_19_512_accurate_c:                           3812.2 ( 1.00x)
yuv2yuv1_19_512_accurate_neon:                         530.0 ( 7.19x)
yuv2yuv1_19_512_approximate_c:                        4012.2 ( 1.00x)
yuv2yuv1_19_512_approximate_neon:                      530.0 ( 7.57x)

After:
yuv2yuv1_0_512_accurate_c:                            3716.8 ( 1.00x)
yuv2yuv1_0_512_accurate_neon:                          215.1 (17.28x)
yuv2yuv1_0_512_approximate_c:                         3877.8 ( 1.00x)
yuv2yuv1_0_512_approximate_neon:                       222.8 (17.40x)
yuv2yuv1_3_512_accurate_c:                            3717.1 ( 1.00x)
yuv2yuv1_3_512_accurate_neon:                          217.8 (17.06x)
yuv2yuv1_3_512_approximate_c:                         3801.6 ( 1.00x)
yuv2yuv1_3_512_approximate_neon:                       220.3 (17.25x)
yuv2yuv1_8_512_accurate_c:                            3716.6 ( 1.00x)
yuv2yuv1_8_512_accurate_neon:                          213.8 (17.38x)
yuv2yuv1_8_512_approximate_c:                         3831.8 ( 1.00x)
yuv2yuv1_8_512_approximate_neon:                       218.1 (17.57x)
yuv2yuv1_11_512_accurate_c:                           3717.1 ( 1.00x)
yuv2yuv1_11_512_accurate_neon:                         219.1 (16.97x)
yuv2yuv1_11_512_approximate_c:                        3801.6 ( 1.00x)
yuv2yuv1_11_512_approximate_neon:                      216.1 (17.59x)
yuv2yuv1_16_512_accurate_c:                           3716.6 ( 1.00x)
yuv2yuv1_16_512_accurate_neon:                         213.6 (17.40x)
yuv2yuv1_16_512_approximate_c:                        3831.6 ( 1.00x)
yuv2yuv1_16_512_approximate_neon:                      215.1 (17.82x)
yuv2yuv1_19_512_accurate_c:                           3717.1 ( 1.00x)
yuv2yuv1_19_512_accurate_neon:                         223.8 (16.61x)
yuv2yuv1_19_512_approximate_c:                        3801.6 ( 1.00x)
yuv2yuv1_19_512_approximate_neon:                      219.1 (17.35x)

x13s before:
yuv2yuv1_0_512_accurate_c:                            1435.1 ( 1.00x)
yuv2yuv1_0_512_accurate_neon:                          221.1 ( 6.49x)
yuv2yuv1_0_512_approximate_c:                         1405.4 ( 1.00x)
yuv2yuv1_0_512_approximate_neon:                       219.1 ( 6.41x)
yuv2yuv1_3_512_accurate_c:                            1418.6 ( 1.00x)
yuv2yuv1_3_512_accurate_neon:                          215.9 ( 6.57x)
yuv2yuv1_3_512_approximate_c:                         1405.9 ( 1.00x)
yuv2yuv1_3_512_approximate_neon:                       224.1 ( 6.27x)
yuv2yuv1_8_512_accurate_c:                            1433.9 ( 1.00x)
yuv2yuv1_8_512_accurate_neon:                          218.6 ( 6.56x)
yuv2yuv1_8_512_approximate_c:                         1412.9 ( 1.00x)
yuv2yuv1_8_512_approximate_neon:                       218.9 ( 6.46x)
yuv2yuv1_11_512_accurate_c:                           1449.1 ( 1.00x)
yuv2yuv1_11_512_accurate_neon:                         217.6 ( 6.66x)
yuv2yuv1_11_512_approximate_c:                        1410.9 ( 1.00x)
yuv2yuv1_11_512_approximate_neon:                      221.1 ( 6.38x)
yuv2yuv1_16_512_accurate_c:                           1402.1 ( 1.00x)
yuv2yuv1_16_512_accurate_neon:                         214.6 ( 6.53x)
yuv2yuv1_16_512_approximate_c:                        1422.4 ( 1.00x)
yuv2yuv1_16_512_approximate_neon:                      222.9 ( 6.38x)
yuv2yuv1_19_512_accurate_c:                           1421.6 ( 1.00x)
yuv2yuv1_19_512_accurate_neon:                         217.4 ( 6.54x)
yuv2yuv1_19_512_approximate_c:                        1421.6 ( 1.00x)
yuv2yuv1_19_512_approximate_neon:                      221.4 ( 6.42x)

After:
yuv2yuv1_0_512_accurate_c:                            1413.6 ( 1.00x)
yuv2yuv1_0_512_accurate_neon:                           80.6 (17.53x)
yuv2yuv1_0_512_approximate_c:                         1455.6 ( 1.00x)
yuv2yuv1_0_512_approximate_neon:                        80.6 (18.05x)
yuv2yuv1_3_512_accurate_c:                            1429.1 ( 1.00x)
yuv2yuv1_3_512_accurate_neon:                           77.4 (18.47x)
yuv2yuv1_3_512_approximate_c:                         1462.6 ( 1.00x)
yuv2yuv1_3_512_approximate_neon:                        80.6 (18.14x)
yuv2yuv1_8_512_accurate_c:                            1425.4 ( 1.00x)
yuv2yuv1_8_512_accurate_neon:                           77.9 (18.30x)
yuv2yuv1_8_512_approximate_c:                         1436.6 ( 1.00x)
yuv2yuv1_8_512_approximate_neon:                        80.9 (17.76x)
yuv2yuv1_11_512_accurate_c:                           1429.4 ( 1.00x)
yuv2yuv1_11_512_accurate_neon:                          76.1 (18.78x)
yuv2yuv1_11_512_approximate_c:                        1447.1 ( 1.00x)
yuv2yuv1_11_512_approximate_neon:                       78.4 (18.46x)
yuv2yuv1_16_512_accurate_c:                           1439.9 ( 1.00x)
yuv2yuv1_16_512_accurate_neon:                          77.6 (18.55x)
yuv2yuv1_16_512_approximate_c:                        1422.1 ( 1.00x)
yuv2yuv1_16_512_approximate_neon:                       78.1 (18.20x)
yuv2yuv1_19_512_accurate_c:                           1447.1 ( 1.00x)
yuv2yuv1_19_512_accurate_neon:                          78.1 (18.52x)
yuv2yuv1_19_512_approximate_c:                        1474.4 ( 1.00x)
yuv2yuv1_19_512_approximate_neon:                       78.1 (18.87x)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-07 12:05:06 +02:00
Michael Niedermayer
8a6ad9eab2 avformat/mxfdec: Check edit unit for overflow in mxf_set_current_edit_unit()
Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long'
Fixes: 392672068/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6232335892152320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-06 22:04:12 +01:00
Michael Niedermayer
cef3422b48 avformat/hls: Fix twitter
Allow mp4 with all mpegts extensions

Fixes: Ticket11435
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-06 22:04:11 +01:00
Kacper Michajłow
c17774a9ae avformat/mov: fix eof check in mov_read_iinf()
This fix ensures that the loop stops early on EOF. The issue occurs
because mov_read_infe() performs a version check and skips unsupported
versions. The problem is that seeking within the stream clears the EOF
flag, causing avio_feof() to not function as expected. This is resolved
by moving the EOF check after reading the size and type, ensuring the
EOF flag is set when necessary.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-06 22:04:11 +01:00
Patrice Dumas
4d9cdf82ee doc/t2h: Support texinfo 7.1 and 7.2 pretest
Here is a proposed patch for portability of doc/t2h.pm for GNU Texinfo
7.1 and 7.1.90 (7.2 pretest).  I tested against 7.1 and 7.1.90 (7.2
pretest).  There is a difference in the headings compared to the website
version, maybe related to FA_ICONS not being set the same, but the
result seems correct.

I also renamed $element to $output_unit in ffmpeg_heading_command as in
new equivalent makeinfo/texi2any code the $element variable is the
$command variable in ffmpeg_heading_command, which is very confusing.  I
left as is the $command variable to have a patch easier to read, but it
could make sense to rename $command as $element later on.

The patch could also have effects with Texinfo 7.0, since some of the
changes are for that version, but that probably never show up because it
is for situations that may not exist in ffmpeg manuals (for example
@node without sectioning command), or because the code is robust to some
missing information (case of $heading_level in ffmpeg_heading_command
that was not set, as far as I can tell).

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 18:00:34 -03:00
Steven Zhou
d1fa9cf4b4 avfilter/drawtext: fix memory leak when using "reinit" runtime command
Free AVOption in drawtext private context when freeing old copy of drawtext
private context during processing of "reinit" runtime command.

Signed-off-by: Steven Zhou <steven.zhou@netint.ca>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 17:41:12 -03:00
James Almer
19045957af avcodec/ffv1enc_vulkan: add missing arguent to ff_ffv1_common_init()
Missed in 3d3ce9647f.

Found-by: kasper93
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 17:03:25 -03:00
James Almer
dc9e0ca447 fate/libswresample: add a test downmixing with a custom order layout
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 13:51:23 -03:00
James Almer
e504247db6 avcodec: add a ffv1 parser
Only setting frame and stream properties. No packetization is performed.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 13:48:47 -03:00
James Almer
3d3ce9647f avcodec/ffv1: split off and share frame header parsing code
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 13:46:58 -03:00
Gyan Doshi
6da82b4485 avfilter/xpsnr: avoid division by zero
The ref input may have its frame rate unset, which would then lead to
SIGFPE. So fall back to the main link frame rate. If that too is unset,
default to 0.

Related to #11428
2025-02-06 16:06:20 +05:30
Lynne
779a3187a8 ffv1dec: fix threaded decode failures
Fixes 7187eadf8c

The issue is that while avctx->pix_fmt is synchronized between
threads, f->pix_fmt was not.

Fixes fate-vsynth1-ffv1-2pass10 with THREADS=2.
2025-02-06 06:57:07 +01:00
Tomas Härdin
9729444c7d lavf/mxfenc: Return AVERROR(EINVAL) in mxf_write_jpeg2000_subdesc() is pixfmt not set 2025-02-05 15:48:22 +01:00
Tomas Härdin
0202c7cc2e lavf/mxfenc: Make write_desc return int
This enables returning AVERRORs
2025-02-05 15:48:22 +01:00
James Almer
b9c99baced libswresample/rematrix: add support for custom order channel layouts
Limited to the same channels as a native layout, but not constrained by channel ordering.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-05 09:51:08 -03:00
James Almer
e52701d173 swresample/rematrix: split filling the matrix array into its own function
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 23:21:07 -03:00
Michael Niedermayer
33679f5325 avcodec/vvc/refs: fix negative pps_scaling_win offsets
The spec seems to allow these to  be negative

Fixes: left shift of negative value -15
Fixes: 392687035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6559804532785152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-05 01:35:57 +01:00
James Almer
a750bcb237 avfilter/Makefile: add missing SKIPHEADERS for AMF
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 16:35:06 -03:00
James Almer
84ad9146e2 avutil/Makefile: fix SKIPHEADERS for AMF
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 16:34:51 -03:00
James Almer
1fbe9deee3 avcodec/nvenc: add support for writing mastering metadata SEI messages
Including Mastering Display and Content Light Level.
Requires SDK 13.0, and only supports HEVC and AV1.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 14:28:19 -03:00
James Almer
a8595dae0f doc/ffmpeg: update example command line for IAMF muxing
Missed in 8f6a1a06a6.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 13:48:11 -03:00
James Almer
873204e6e4 avcodec/nvenc: add compile time check for outputRecoveryPointSEI for HEVC
Fixes compilation when using API headers older than 12.0

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 10:39:27 -03:00
Zhao Zhili
4307008b9a avformat/matroskaenc: log unsupported subtitle codec name
It's more user friendly than codec ID.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Marth64 <marth64@proxyid.net>
2025-02-04 13:42:43 +08:00
Dmitrii Ovchinnikov
88a8ba5c99 avcodec/amfenc: redesign to use hwcontext_amf.
Co-authored-by: Evgeny Pavlov <lucenticus@gmail.com>
v3: cleanup code
2025-02-04 00:14:14 +01:00
Evgeny Pavlov
1f94cc4588 doc/filters: Add documentation for AMF filters
Signed-off-by: Evgeny Pavlov <lucenticus@gmail.com>
2025-02-04 00:14:14 +01:00
Evgeny Pavlov
4b77a0a681 avfilter/scale_amf: Add AMF VPP & super resolution filters
This commit adds two AMF filters: vpp_amf & sr_amf.
Both filters are using AMF hardware acceleration.
vpp_amf supports simple scaling algorithms & color conversion.
sr_amf supports advanced scaling algorithms such as FSR & can
be used for upscaling only.
2025-02-04 00:14:14 +01:00
Evgeny Pavlov
fbfde33230 avcodec: add amfdec.
Added AMF based h264, hevc, av1 decoders.
Co-authored-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
v2: added encoder reinitialisation
v3: use AMF_SURFACE_UNKNOWN to int decoder(ctx->output_format before)
2025-02-04 00:14:14 +01:00
Dmitrii Ovchinnikov
9e7242579e avutil: add hwcontext_amf.
Adds  hwcontext_amf, enabling a shared AMF context for encoders,
decoders, and AMF-based filters, without copy to the host memory.
Code also was tested in HandBrake.

Benefits:
 - Optimizations for direct video memory access from CPU
 - Significant performance boost in full AMF pipelines with filters
 - Integration of GPU filters like VPP, Super Resolution, and
    Compression Artefact Removal(in future plans)
 - VCN power management control for decoders.
 - Ability to specify which VCN instance to use for decoding
   (like for encoder)
 - AMD will soon introduce full AMF API for multimedia accelerator MA35D
   - With AMF API, integration will be much easier:
      GPU and the accelerator will have the same API
   - including encoder, decoder, scaler, color converter,
      Windows and Linux.
   Learn more:
      https://www.amd.com/en/products/accelerators/alveo/ma35d.html

Changes by versions:
v2: Header file cleanup.
v3: Removed an unnecessary class.
v4: code cleanup and improved error handling
v5: Fixes related to HandBrake integration.
v6: Sequential filters error and memory leak have been fixed.
2025-02-04 00:14:14 +01:00
Zhao Zhili
1c5961e4b4 avformat/seek: Remove always true condition
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-04 01:24:23 +08:00
Zhao Zhili
ef3ffd8c5c avformat/seek: Remove dead code
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Marth64 <marth64@proxyid.net>
2025-02-04 01:22:57 +08:00
Zhao Zhili
1438f6997d avcodec/nvenc: Enable recovery point SEI for intra refresh mode
Otherwise all frames can be dropped after seek without the
output_corrupt/showall flags.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-04 01:21:26 +08:00
James Almer
4a0e1cfc6f avcodec/speexdec: fix frame_size for mode == 2
Should match the non-extradata path now, and fix ticket #11078.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-03 13:23:30 -03:00
James Almer
49726a922f avfilter/vf_scale: remove global side data when it no longer applies after scaling
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-03 11:05:59 -03:00
James Almer
db7ff13574 avfilter/avfilter: remove accidental loop index variable reset
Fixes ticket #11442.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-03 11:05:59 -03:00
Shreesh Adiga
59f9dbaa31 swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
On a AMD 7950x Zen 4

shuffle_bytes_0321_c:                                   56.5 ( 1.00x)
shuffle_bytes_0321_ssse3:                               15.2 ( 3.70x)
shuffle_bytes_0321_avx2:                                10.2 ( 5.51x)
shuffle_bytes_0321_avx512icl:                            9.2 ( 6.11x)
shuffle_bytes_1230_c:                                   84.5 ( 1.00x)
shuffle_bytes_1230_ssse3:                               14.2 ( 5.93x)
shuffle_bytes_1230_avx2:                                15.2 ( 5.54x)
shuffle_bytes_1230_avx512icl:                           11.2 ( 7.51x)
shuffle_bytes_2103_c:                                   48.5 ( 1.00x)
shuffle_bytes_2103_ssse3:                               21.2 ( 2.28x)
shuffle_bytes_2103_avx2:                                13.8 ( 3.53x)
shuffle_bytes_2103_avx512icl:                            9.2 ( 5.24x)
shuffle_bytes_3012_c:                                   84.5 ( 1.00x)
shuffle_bytes_3012_ssse3:                               14.2 ( 5.93x)
shuffle_bytes_3012_avx2:                                16.2 ( 5.20x)
shuffle_bytes_3012_avx512icl:                           10.2 ( 8.24x)
shuffle_bytes_3210_c:                                   89.2 ( 1.00x)
shuffle_bytes_3210_ssse3:                               24.2 ( 3.68x)
shuffle_bytes_3210_avx2:                                16.2 ( 5.49x)
shuffle_bytes_3210_avx512icl:                            9.2 ( 9.65x)

Signed-off-by: Shreesh Adiga <16567adigashreesh@gmail.com>
2025-02-03 10:16:44 -03:00
Dale Curtis
957eb2323a avcodec/h264dec: make slice header parse errors fatal under AV_EF_EXPLODE
This fixes timeout issues and seems like it was intended
since the line emits an error log.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-02-02 21:38:19 -06:00
Scott Theisen
33daef5f49 avcodec/mpeg12dec: rename 0x0502 CC format
The format is used by at least Dish Network, but is not
defined in any DVB standard, so remove references to DVB.

This is a simple rename, no functional change.

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-02-02 21:38:19 -06:00
Timo Rothenpieler
b37606e562 avcodec/nvenc: finalize SDK 13.0 support 2025-02-02 20:02:16 +01:00
Timo Rothenpieler
89b37b4dcb avcodec/nvenc: use encoder level options for qmin/qmax
AV1 uses a vastly different range than what the global options permit,
and also for the other codecs the range of the global options is at
least misaligned.

Fixes #11365
2025-02-02 20:02:16 +01:00
Diego de Souza
a583f7e2fd avcodec/nvenc: add Temporal Filtering for AV1 and H.264 in NVENC
This commit extends the support for Temporal Filtering in NVENC for
AV1 and H.264 codecs. For natural videos with noise, NVENC temporal
filtering improves video coding efficiency by 4-5%.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:12 +01:00
Diego de Souza
ed80e55586 avcodec/nvenc: add UHQ to AV1 for NVENC
This commit adds support for Ultra High Quality mode for AV1 on
NVIDIA GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:08 +01:00
Diego de Souza
2cfef29f97 avcodec/nvenc: add 4:2:2 encoding and H.264 10-bit support
This commit adds support for 4:2:2 encoding for HEVC and H.264 on
NVIDIA Blackwell GPUs. Additionally, it supports 10-bit encoding
for H.264 on Blackwell GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:04 +01:00
Diego de Souza
7e9655800d avcodec/cuviddec: add HEVC/H.264 4:2:2 and H.264 10-bit support
This commit adds support for 4:2:2 decoding for HEVC and H.264 on
NVIDIA Blackwell GPUs for cuviddec. Moreover, it supports 10-bit
decoding for H.264 on Blackwell GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:00 +01:00
Diego de Souza
30e6effff9 avcodec/nvdec: add 4:2:2 decoding and 10-bit support
This commit adds support for 4:2:2 decoding for HEVC and H.264 on
NVIDIA Blackwell GPUs. Additionally, it supports 10-bit decoding
for H.264 on Blackwell GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:01:56 +01:00
Diego de Souza
7454a07d58 avutil/hwcontext_cuda: add 4:2:2 pixel format support
This commit adds support for 4:2:2 pixel formats, namely NV16 and
P216 for NVIDIA GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:01:51 +01:00
Andreas Rheinhardt
452d6738b5 fftools/ffmpeg_opt: Remove audio_drift_threshold
Forgotten in 5a04aae821.

Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:03:32 +01:00
Andreas Rheinhardt
10047fea1c avutil/cpu: Disable ff_getauxval() on x86
Not used there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:03:20 +01:00
Andreas Rheinhardt
4afe61ea6c swscale/x86/swscale: Make M24 variables static
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:03:13 +01:00
Andreas Rheinhardt
3797e9239e swscale/x86/swscale: Move some constants to rgb2rgb.c
ff_w1111 and ff_bgr2(Y|UV)Offset are only used there
(and only on x86-32 since caaec2ea95).
Also make them static.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:00:07 +01:00
Michael Niedermayer
0113e30806 libavformat/hls: Be more restrictive on mpegts extensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-02 02:42:03 +01:00
Michael Niedermayer
9e12572933 avformat/hls: .ts is always ok even if its a mov/mp4
Maybe fixes: 11435

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-02 02:42:02 +01:00
Marton Balint
9b5a4c0aea avcodec/libxvid: add check for invalid intra/inter matrix values
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-02-01 21:10:20 +01:00
James Almer
c6194b50b1 avdevice/alsa_dec: add a ch_layout option
Missed in ffc4fd3cc2, which after
e78173557d broke setting channel count.

Should fix ticket #11434.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-01 01:12:17 -03:00
Michael Niedermayer
0fe33c99a2 avcodec/h263dec: Check against previous dimensions instead of coded
Fixes: out of array access
Fixes: crash-a41ef3db699013f669b076f02f36942925f5a98c

Found-by: Kacper Michajlow <kasper93@gmail.com>
Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-31 23:10:03 +01:00
Michael Niedermayer
d845533130 avformat/hls: Print input format in error message
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-31 23:10:02 +01:00
Gyan Doshi
221816456a doc/filters: fix typo in format filter
The inline example for option color_ranges used 'color_spaces'

Fixes #11441
2025-01-31 23:15:40 +05:30
Leo Izen
0225fe857d avcodec/jpegxl_parse{,r}: fix integer overflow for some malformed files
If there's a very large ISOBMFF box that needs to be skipped, it can
cause an overflow for ctx->skip. There's already a safeguard to return
quickly if ctx->skip > bufsize, so changing ctx->skip to int64_t will
allow this to happen even if ctx->skip would overflow a signed int.

Several other members are also changed to int64_t to avoid this problem
in other possible scenarios.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Kacper Michajlow <kasper93@gmail.com>
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6085331937460224
2025-01-30 13:46:26 -05:00
Vitaly Buka
c5287178b4 avcodec/hevc/hevcdec: Don't add to null pointer
`POS(1,` and `POS(2,` may trigger UBSAN report:
"runtime error: applying non-zero offset 304 to null pointer"

Looks like values are not used without `chroma_format_idc`,
so maybe there is no other issues than the UB.

Can't reproduce with "fate".

Signed-off-by: Vitaly Buka <vitalybuka@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-30 11:35:10 -03:00
James Almer
02958ab715 avformat/mov: fix overflow in drift timestamp calculation
Fixes: signed integer overflow: 7803923888585309955 - -3407677434275325337 cannot be represented in type 'int64_t' (aka 'long')
Fixes: 377736723/clusterfuzz-testcase-minimized-media_pipeline_integration_fuzzer-5052449500889088

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-30 10:56:59 -03:00
Gyan Doshi
1911a6ec26 ffmpeg_demux: don't print input error for AVERROR_EXIT
This error code is for expected exits, like after listing options for a
device.
2025-01-30 16:12:05 +05:30
Kacper Michajłow
4ba9ae7742 avformat/vqf: fix memory leak in add_metadata()
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-01-29 21:57:10 +02:00
Nuo Mi
ca3550948c lavc/vvcdec: ensure slices contain nonzero CTUs
fixes https://github.com/ffvvc/tests/tree/main/fuzz/passed/000323.bit

Co-authored-by: Frank Plowman <post@frankplowman.com>
2025-01-29 18:22:41 +08:00
Nuo Mi
974d4a8f0a lavc/vvcdec: remove unneeded VVCContext->pix_fmt
AVCodecContext->sw_pix_fmt is used to hold the software pixel format.

Co-authored-by: Frank Plowman <post@frankplowman.com>
2025-01-29 18:22:41 +08:00
Nuo Mi
61ff0fac35 lavc/vvcdec: remove unneeded set_output_format
Downstream can determine the format from the output frame format

Co-authored-by: Frank Plowman <post@frankplowman.com>
2025-01-29 18:22:41 +08:00
Leo Izen
3380c0d27d avutil/frame: check return value for cropping offsets
This function can return AVERROR_BUG in theory if something
went wrong, but so can the caller, so we should propagate that
error message upward in that case.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-01-28 16:09:56 -05:00
Jan Ekström
4401e4b606 avformat/id3v2: add image/webp for WebP attached pictures
Found out to have been utilized via a user reporting an attached
image not being available in a player utilizing avformat's demuxing
capabilities.
2025-01-28 21:57:35 +02:00
James Almer
a649b2a831 avutil/downmix_info: check for side data allocation success before zeroing it
Fixes coverity #1641638.

Marvin Scholz <epirat07@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-28 15:26:00 -03:00
James Almer
7a16bfa7c9 tests/checkasm/sw_rgb: increase plane array buffers
Fixes stack-buffer-overflow errors running under asan.

Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-28 15:26:00 -03:00
Martin Storsjö
8f4819ce01 rtmpproto: Avoid rare crashes in the fail: codepath in rtmp_open
When running the cleanup in rtmp_close on failures in rtmp_open,
we can in rare cases end up using rt->playpath, assuming that it
is still set.

The crash could happen if we hit the fail codepath in rtmp_open
while publishing (rt->is_input == 0) with rt->state set to
a value > STATE_FCPUBLISH.

This would normally not happen while publishing; either we have
an error (and rt->state <= STATE_FCPUBLISH) or we reach
rt->state = STATE_PUBLISHING, and then we also return successfully
from rtmp_open.

The unexpected combination of states could happen if the server
responds with e.g. "NetStream.Play.Stop" while expecting
"NetStream.Publish.Start"; this sets rt->state to STATE_STOPPED,
which also fulfills the condition "> STATE_FCPUBLISH".

We don't need to free the rt->playpath/tcurl/flashver strings here;
they're handled via AVOption, and thus are freed automatically when
the protocol instance is freed (that's why they aren't freed
manually within the rtmp_close function either).

We also don't need to free the AVDictionary with options; it's
owned by the caller.

A smaller fix would be to just call rtmp_close before freeing
the strings and dictionary, but as we don't need to free them
at all, let's remove that redundant code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-28 19:56:39 +02:00
Martin Storsjö
3cd4e8470a configure: Improve the check for the rsync --contimeout option
Traditionally, macOS has shipped an old version of rsync that lacked
support for this option, hence this check (added in
a8b3f0c5cf).

However, in macOS 15.x, Apple have switched to providing rsync as a
different tool, openrsync. The version of openrsync in at least
macOS 15.2 does include "[--contimeout]" (note the lack of "=" after
the option), in the output of "rsync --help", but when used, the tool
errors out with "rsync: --contimeout=60: unknown option". So apparently
the tool erroenously lists the option as supported, while it really
isn't.

The original rsync tool (with a new enough version) prints
"--contimeout=SECONDS" in the output of "rsync --help".

It is unclear which version of openrsync Apple are shipping; the latest
upstream openrsync from OpenBSD does support the option and includes
"[--contimeout=seconds]" in the output of "--help", and older versions
don't seem to include the option as listed at all.

Therefore, check for "--conntimeout=" with the "=", this should
properly detect both new enough rsync and openrsync.

This fixes running "fate-rsync" on macOS 15.x.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-28 19:55:45 +02:00
James Almer
85a327d9d0 avfilter/buffersrc: remove unused variable
Added by mistake in 7a025e1cb5.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-28 10:01:17 -03:00
Krzysztof Pyrkosz
83e4b068d9 avcodec/aarch64/aacencdsp: NEON implementation
This patch supplies handwritten NEON code for AAC.

The benchmarks below were collected by invoking these two commands on
each of my boards, A78, A72 and Thinkpad x13s:
1) ./tests/checkasm/checkasm --test=aacencdsp --bench --runs=12
2) ./ffmpeg -y -t 10:00 -f lavfi -i sine /tmp/foo.aac (the first line is
speed without the patch, second, with)

- A78
abs_pow34_c:                                          4161.5 ( 1.00x)
abs_pow34_neon:                                       3586.2 ( 1.16x)
quant_bands_signed_c:                                 5548.0 ( 1.00x)
quant_bands_signed_neon:                              1126.8 ( 4.92x)
quant_bands_unsigned_c:                               3979.2 ( 1.00x)
quant_bands_unsigned_neon:                             800.2 ( 4.97x)

size=    5251KiB time=00:10:00.00 bitrate=  71.7kbits/s speed=71.6x
size=    5251KiB time=00:10:00.00 bitrate=  71.7kbits/s speed=82.3x

- A72
abs_pow34_c:                                         15362.2 ( 1.00x)
abs_pow34_neon:                                      15382.5 ( 1.00x)
quant_bands_signed_c:                                 9926.5 ( 1.00x)
quant_bands_signed_neon:                              2467.8 ( 4.02x)
quant_bands_unsigned_c:                               5469.8 ( 1.00x)
quant_bands_unsigned_neon:                            2089.5 ( 2.62x)

size=    5251KiB time=00:10:00.00 bitrate=  71.7kbits/s speed=34.3x
size=    5251KiB time=00:10:00.00 bitrate=  71.7kbits/s speed=37.8

- x13s
abs_pow34_c:                                          2413.4 ( 1.00x)
abs_pow34_neon:                                       1796.2 ( 1.34x)
quant_bands_signed_c:                                 2968.9 ( 1.00x)
quant_bands_signed_neon:                               675.6 ( 4.39x)
quant_bands_unsigned_c:                               2311.9 ( 1.00x)
quant_bands_unsigned_neon:                             477.1 ( 4.85x)

size=    5251KiB time=00:10:00.00 bitrate=  71.7kbits/s speed= 135x
size=    5251KiB time=00:10:00.00 bitrate=  71.7kbits/s speed= 159x

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-28 10:44:40 +02:00
Gyan Doshi
959b799c8d avfilter/setpts: add option strip_fps to decide framerate handling
In f121d95, the outlink framerate was unconditionally unset.
This breaks/bloats outputs from CFR muxers unless the user explicitly
sets a sane framerate. And the most common invocation for setpts seen in
workflows, our docs and across the web is `PTS-STARTPTS` or others of the
general form `PTS+constant` which preserves the input framerate.

Default value is false, which restores old behaviour.

Fixes #11428
2025-01-27 15:40:09 +05:30
James Almer
f632ab53d9 fftools/ffmpeg_filter: remove accidental variable shadowing
Fixes potential uses of uninitialized variables in case of alloc failure.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-26 20:53:11 -03:00
James Almer
712140be75 doc/APIChanges: fix library name for a recent entry
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
4f9afbb1b2 fftools/ffmpeg_filter: reinitialize the filterchain if downmix metadata changed between frames
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
6a282cdf7e avfilter/af_aresample: propagate downmix metadata to swresample if present
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
ea3c3b42df avutil/frame: add a side data prop to signal channel layout dependent types
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
0bed1b8953 avutil/downmix_info: zero the allocated buffer
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
e61b9d4094 fftools/ffmpeg: propagate decoded_side_data from decoded streams to the filterchain
Global side data as exported by a decoder may no longer apply if a filter in
the chain altered the frames in some form, like changing color, dimensions,
or channel layout information.
After this change, any such changes in side data will be taken into account by
the encoder futher in the process.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
6707d970c0 avfilter/buffersink: add av_buffersink_get_side_data()
This will be used to get global side data that was propagated through the
filterchain.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
7a025e1cb5 avfilter/buffersrc: add a side_data field
This will be used to propagate global side data through the filterchain.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
ef1cb1c9c8 avfilter/avfilter: add a side_data field to AVFilterLink
This will be used to propagate global side data through the filterchain.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
Michael Niedermayer
91d96dc8dd avformat/hls: Be more picky on extensions
This blocks disallowed extensions from probing
It also requires all available segments to have matching extensions to the format
mpegts is treated independent of the extension

It is recommended to set the whitelists correctly
instead of depending on extensions, but this should help a bit,
and this is easier to backport

Fixes: CVE-2023-6602 II. HLS Force TTY Demuxer
Fixes: CVE-2023-6602 IV. HLS XBIN Demuxer DoS Amplification

The other parts of CVE-2023-6602 have been fixed by prior commits

Found-by: Harvey Phillips of Amazon Element55 (element55)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-26 01:12:28 +01:00
Michael Niedermayer
c733e2b5ed Revert "avformat/mpegts: Add standard extension so hls can check in extension_picky mode"
The next commit implements the hls fix in a way that doesnt need this

This reverts commit 54897da7ce.
2025-01-26 01:12:28 +01:00
Manuel Lauss
d68d311bcd avcodec/sanm: codec37 buffers are private
codec37 operates on 2 buffers, which must be considered private to
the codec and must therefore not be changed by subsequent FOBJs.

Let codec37 therefore operate on frm1/2 instead of frm0/2, but copy
the decoded image to frm0 where other codecs operate on.

Fixes artifacts encountered in Full Throttle "dazed.san" and also
in a lot of Rebel Assault II gameplay videos: these videos consist of
frames with an initial codec37 FOBJ image to set the stage, and
optional codec1-23 FOBJs overlaid on top of that image.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-26 01:10:52 +01:00
Sean McGovern
4322be512b avcodec/svq1enc: restrict Altivec acceleration to big-endian POWER configurations
This was disabled in da60b99a88 and then
accidentally re-enabled in 172b0e2e88.

The code in question was never properly adapted for litte-endian mode.

refs: trac/10955
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-26 01:10:52 +01:00
Marton Balint
ec4d3dc5b9 avcodec/mpegvideo_enc: use 64bit multiplication in dct_quantize_trellis_c and dct_quantize_c
Fixes corruption with:

ffmpeg -t 1 -filter_complex "sine=f=21,showwaves=scale=cbrt:mode=line:colors=white:draw=full" -c:v mpeg2video -non_linear_quant 1 -qmin 1 -qmax 1 -cpuflags 0 out.mpg

or

ffmpeg -t 1 -filter_complex "sine=f=21,showwaves=scale=cbrt:mode=line:colors=white:draw=full" -c:v mpeg2video -non_linear_quant 1 -qmin 1 -qmax 1 -trellis 1 out.mpg

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-25 20:10:41 +01:00
Marton Balint
ed26812337 avcodec/mpegvideo_enc: fix qmat value comments
The comments supposed to track the possible value of the qmat and qmat16
matrices, but they were not updated properly in the long history of the
mpegvideo encoder. Also they wrongly assumed the usage of built-in quantizer
matrices and linear quantization.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-25 20:10:41 +01:00
Marton Balint
7d9f373984 avcodec/mpegvideo_enc: add checks for custom inter/intra/chroma matrices
Make the checker functions available for all codecs.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-25 20:10:41 +01:00
sunyuechi
a0a89efd07 Fix the tail handling in R-V V sad
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2025-01-25 09:37:45 +02:00
James Almer
e20ee9f9ae swscale/swscale: don't reject scaling when color parameters are not supported but conversion is not required
Values in csp, prim, trc, etc, are irrelevant if there's no conversion needed.

Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-22 12:15:18 -03:00
James Almer
abdc20727c swscale/swscale: combine the input/output checks in sws_frame_setup()
Cosmetic change in preparation for the next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-22 12:14:57 -03:00
Michael Niedermayer
6ecc96f4d0 avformat/mxfdec: Check avio_read() success in mxf_decrypt_triplet()
Fixes: Use of uninitialized memory
Fixes: 71444/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5448597561212928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:11 +01:00
Michael Niedermayer
90ff3ae976 tools/target_swr_fuzzer: do not use negative numbers of samples
Fixes: signed integer overflow: -277109688 * 8 cannot be represented in type 'int'
Fixes: 376118159/clusterfuzz-testcase-minimized-ffmpeg_SWR_fuzzer-5884436320681984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:10 +01:00
Michael Niedermayer
ef71552cf9 avcodec/huffyuvdec: Initialize whole output for decode_gray_bitstream()
Fixes: use of uninitialized memory
Fixes: 375286238/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-6352546854141952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:10 +01:00
Michael Niedermayer
aec2933344 avformat/iamf_reader: Initialize padding and check read in ff_iamf_read_packet()
Fixes: Use of uninitialized memory
Fixes: 377642312/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4554550985424896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:10 +01:00
Michael Niedermayer
788abe0d25 avformat/ipmovie: Check signature_buffer read
Fixes: use of uninitilaized data
Fixes: 385167047/clusterfuzz-testcase-minimized-ffmpeg_dem_IPMOVIE_fuzzer-5941477505564672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:09 +01:00
Michael Niedermayer
17b019c517 avformat/wtvdec: Initialize buf
ff_parse_mpeg2_descriptor() reads over what is initialized
Fixes: use of uninitialized memory
Fixes: 383825645/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5144130618982400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:09 +01:00
Michael Niedermayer
e81d410242 avcodec/cbs_vp9: Initialize VP9RawSuperframeIndex
Fixes: use-of-uninitialized-value
Fixes: 70907/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_METADATA_fuzzer-6339363208757248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:09 +01:00
Michael Niedermayer
49fa3f6c5b avformat/vqf: Propagate errors from add_metadata()
Suggested-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:08 +01:00
Michael Niedermayer
c43dbecbda avformat/vqf: Check avio_read() in add_metadata()
Fixes: use of uninitialized data
Fixes: 383825642/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5380168801124352

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 22:55:08 +01:00
Michael Niedermayer
54897da7ce avformat/mpegts: Add standard extension so hls can check in extension_picky mode
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 21:06:14 +01:00
Michael Niedermayer
665b0cf3bf swscale: 16bit planar float input support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 21:06:14 +01:00
Michael Niedermayer
62c98cdd54 avcodec/ffv1enc: Fix RCT for GBR colorspace
It performs better when its less buggy

Compression changes for rgb_scanline_half_piz_dw_t08 (using float16 with remaping) from
56086 byte to 34371
(with a single slice its 28122 byte)

prior remap it was 188186 bytes

ACES_OT_VWG_SampleFrames/ACES_OT_VWG_SampleFrames improves too but only by a fraction of a percent

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 21:06:13 +01:00
Michael Niedermayer
497b205ad5 avcodec/ffv1enc: dont reset version
resetting the version causes any previously set values to be disregarded

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 21:06:13 +01:00
Michael Niedermayer
0c237d6e8a avcodec/ffv1: simplify version checks with combined_version
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 21:06:13 +01:00
Michael Niedermayer
c0769e9213 libavutil/pixfmt: 16bit float support
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-21 21:06:12 +01:00
Lynne
5e4a510cce ffv1dec: move slice decoding into a separate function
This simply movies all slice decoding code from decode_frame
to decode_slices; nothing more.
2025-01-22 00:09:38 +09:00
Lynne
f75812e054 ffv1dec: move header parsing into a separate function 2025-01-22 00:09:38 +09:00
Lynne
d987feae2a ffv1dec: move slice start finding into a function
This also cleans up and gives the code some much needed comments.
2025-01-22 00:09:37 +09:00
Lynne
7187eadf8c ffv1dec: use dedicated pix_fmt field and call ff_get_format
Adding support for hwaccels means that avctx->pix_fmt will indicate
hardware formats.
2025-01-22 00:09:37 +09:00
Lynne
5c59e6ce19 vulkan: enable using .elems field for buffer content definitions
This avoids needing to snprintf when the buffer only contains an array of a struct,
while letting the validation layers detect errors more reliably.
2025-01-22 00:09:32 +09:00
Lingyi Kong
504df09c34 avcodec/h264: fix stride calculation in slice_table for multi-slice field video deblocking
fix for https://trac.ffmpeg.org/ticket/11360
A new fate test case is added to validate the fix, the smaple file is located at https://trac.ffmpeg.org/attachment/ticket/11360/slice2_field_aurora4.264.

Signed-off-by: Lingyi Kong <konglingyi@visionular.com>
2025-01-20 08:50:01 +00:00
James Almer
bb033e6910 avcodec/ac3dec: only export matrix encoding and downmix info side data when necessary
Don't export a matrix encoding side data when there's none signaled.
And if downmixing was handled by the decoder itself, then the downmix info does
not apply to the frame.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-19 15:14:18 -03:00
James Almer
4563cf95ca avcodec/ac3dec: don't override existing downmix coefficient with default ones
With this, if the eac3 dependent frame doesn't have coded downmix values when
parsed by ff_eac3_parse_header(), it will inherit the coded ones from the core
ac3 frame instead of ignoring them.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-19 15:14:18 -03:00
Zhao Zhili
ea381285e7 avcodec/vvc: Add support for output_corrupt/showall flags 2025-01-19 13:30:13 +08:00
James Almer
a328b219ed fate/tests/flvenc: add missing ffprobe dependency to fate-enhanced-flv-multitrack
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-18 18:20:52 -03:00
Timo Rothenpieler
a3e506455e avformat/flvdec: correctly skip command frame for enhanced flv 2025-01-18 21:57:02 +01:00
Timo Rothenpieler
ced9fddec0 avformat/flvdec: implement support for parsing ModEx data 2025-01-18 21:57:02 +01:00
Michael Niedermayer
4c96d6bf75 avformat/dashdec: Check whitelist
Fixes: CVE-2023-6602, V. DASH Playlist SSRF

Found-by: Harvey Phillips of Amazon Element55 (element55)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:27 +01:00
Michael Niedermayer
c6c54943d1 avutil/avstring: dont mess with NULL pointers in av_match_list()
Fixes: applying zero offset to null pointer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:26 +01:00
Stefan Pöschel
2ac2ebcd76 doc/protocols: fix/improve RTP documentation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:26 +01:00
Manuel Lauss
9a794897c3 avcodec/sanm: simplify codec37 subcodec 3/4 path
A flag in the codec header determines whether opcodes 0xfd/0xfe
are to be treated as special or not.  The current code has 2
implementations of the same decoding scheme, with one treating
the 2 opcodes as special, the other not.
Collapse them into a single implementation and treat these opcode
according to the flag.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:25 +01:00
Manuel Lauss
fff7737b3d avcodec/sanm: implement codec37 subcodec1
RLE-compressed stream of motion vector indices and a special opcode
to fill a block with data from the source stream.

It is used in the LucasArts "Full Throttle" blink*.san animations.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Fixes: Ticket5753
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:25 +01:00
James Almer
c08d300481 avformat/avformat: also clear FFFormatContext packet queue when closing a muxer
packet_buffer is used in mux.c, and if a muxing process fails at a point where
packets remained in said queue, they will leak.

Fixes ticket #11419

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-17 10:10:51 -03:00
Zhao Zhili
4f3c9f2f03 avcodec/mediacodecenc: Support config qp range
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-01-15 15:05:50 +08:00
Zhao Zhili
ff00037368 avcodec/cuviddec: Fix missing HW_CONFIG_METHOD_HW_FRAMES_CTX flag
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-01-15 15:05:45 +08:00
Zhao Zhili
d157e1f16b avcodec/bit_depth_template: Remove empty macro INIT_CLIP
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-01-15 15:05:37 +08:00
Michael Niedermayer
66e9888bf4 avfilter/vf_v360: Fix NULL pointer use
Fixes: applying zero offset to null pointer
partly Fixes: verysmall.flv

Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:46 +01:00
Michael Niedermayer
827c073154 avcodec/mpegvideo_enc: Check FLV1 resolution limits
Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com>
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:46 +01:00
Michael Niedermayer
402824e9e9 avcodec/ffv1enc: Fix handling of 32bit unsigned symbols
This may be needed for floats

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:45 +01:00
Michael Niedermayer
afbc3a1b23 avformat/mov: perform sanity checks for heif before index building
Fixes: undefined NULL pointer use
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-6363211175493632

This performs equivalent sanity checks as are done in mov_read_trak()
before mov_build_index()

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:45 +01:00
Michael Niedermayer
16b3d3e3eb avformat/mov: Factorize sanity check out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:45 +01:00
yuanhecai
858acd8d02 loongarch: fixes fate-checkasm-sw_rgb failure
The reason for the failure is that the function yuv2rgb_1_c_template was modified
in 095f8038fa. The corresponding functional test
was added in c601bb8df5. The code on loongarch was
not updated in a timely manner, resulting in the error.

Signed-off-by: yuanhecai <yuanhecai@loongson.cn>
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-15 01:27:36 +01:00
James Almer
fd1772b747 avformat/mov: fix potential unsigned underflow in loop condition
if sc->tts_count is 0, this condition will wrap around to UINT_MAX and the
code will try to dereference a NULL pointer.

Fixes ticket #11417

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-13 19:27:00 -03:00
Nuo Mi
8eb1d76e14 lavc/vvc/refs: export keyframe and picture type in output frames
fixes https://trac.ffmpeg.org/ticket/11406

Co-authored-by: Ruben Gonzalez <rgonzalez@fluendo.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-13 18:05:06 -03:00
James Almer
d5873be583 avformat/iamf_parse: add missing av_free() call on failure path
Fixes ticket #11416

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-13 17:28:22 -03:00
Jun Zhao
b88fc4e098 lavc/ac3dsp: fix R-V HAVE_RVV scope issue
fix R-V HAVE_RVV scope issue

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-01-13 23:58:54 +08:00
Jun Zhao
8ded602eda ffbuild/bin2c: misc fix
close input file if open output fail/read errors.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-01-13 23:58:36 +08:00
Lynne
851a84650e hwcontext_vulkan: check if semaphores are exportable before enabling exporting
lavapipe recently added support for external_semaphore_fd, but only for syncfiles,
not for opaque file descriptors.

The code is written to allow using syncfiles later on.

Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12422
2025-01-13 10:44:30 +09:00
Andreas Rheinhardt
5a72266d49 tests/checkasm/sw_rgb: Fix leaks
Also use loop-scope for variables where appropriate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
e540381f91 avfilter/vf_xpsnr: Avoid array only one of whose elements is used
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
7822beed85 avfilter/vf_xpsnr: Fix leaks
This filter uses the AVBuffer API to allocate buffers that are never
shared at all and frees them via av_freep() (actually, it passes
pointers to AVBufferRefs to av_freep, so that only the AVBuffer
structures are freed at all (because AVBufferRef has a AVBuffer* as its
first member), not the AVBufferRef and not the underlying buffers;
and due to a wrong check the AVBuffers corresponding
to buf_org[c] with c>0 were never freed at all). This is a violation
of the AVBuffer API and causes a memleak. Fix this by avoiding the
AVBuffer API altogether.
(The FATE tests don't catch this, because they use piping to awk,
so that the error code from ffmpeg is ignored.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
7ab7d9c3c0 avfilter/avfilter: Add FFFilter, hide internals of AVFilter
This patch is analogous to 20f9727018:
It hides the internal part of AVFilter by adding a new internal
structure FFFilter (declared in filters.h) that has an AVFilter
as its first member; the internal part of AVFilter is moved to
this new structure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
9bbab3255b avfilter/vf_overlay: Remove spec-incompliant ';'
Fixes warnings with -pedantic with GCC and Clang.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
Andreas Rheinhardt
4cf445c75d tests/ref/fate/png-icc-parse: Add lossless flag to ref file
Forgotten in 8a29b4e38d
(this test depends on lcms2 and is therefore disabled by default).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
4973bb661e swscale/cms,graph,lut3d: Use ff_-prefix, don't export internal functions
Symbols with the sws_* prefix are exported.

Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
0bc1d2fac4 avcodec/aac/aacdec: Fix -Wdeclaration-after-statement
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
b239eefeb5 avcodec/sga: Silence -Wunused-but-set-variable warnings
The variables are used, but only inside an av_assert1().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
Andreas Rheinhardt
7a5d6690fc avcodec/aac_ac3_parser: Remove unused variable
Added in 64bb91fd3b, never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:39 +01:00
James Almer
5f6e43f77d tests/fate/lavf-container: fix dependencies for lavf_container_fate tests
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-12 11:13:35 -03:00
James Almer
df50370e1b avformat/matroska: add support for VVC streams
As defined in https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec_specs.md#v_mpegiisovvc

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-12 11:13:31 -03:00
Frank Plowman
8bd66a8c95 lavc/vvc: Check slice structure
The criteria for slice structure validity is similar to that of
subpicture structure validity that we saw not too long ago [1].
The relationship between tiles and slices must satisfy the following
properties:

* Exhaustivity.  All tiles in a picture must belong to a slice.  The
  tiles cover the picture, so this implies the slices must cover the
  picture.
* Mutual exclusivity.  No tile may belong to more than one slice, i.e.
  slices may not overlap.

In most cases these properties are guaranteed by the syntax.  There is
one noticable exception however: when pps_tile_idx_delta_present_flag is
equal to one, each slice is associated with a syntax element
pps_tile_idx_delta_val[i] which "specifies the difference between the
tile index of the tile containing the first CTU in the ( i + 1 )-th
rectangular slice and the tile index of the tile containing the first
CTU in the i-th rectangular slice" [2].  When these syntax elements are
present, the i-th slice can begin anywhere and the usual guarantees
provided by the syntax are lost.

The patch detects slice structures which violate either of the two
properties above, and are therefore invalid, while building the
slice map.  Should the slice map be determined to be invalid, an
AVERROR_INVALIDDATA is returned.  This prevents issues including
segmentation faults when trying to decode,  invalid bitstreams.

[1]: https://ffmpeg.org//pipermail/ffmpeg-devel/2024-October/334470.html
[2]: H.266 (V3) Section 7.4.3.5, Picture parameter set RBSP semantics

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-01-12 13:15:06 +08:00
Peter Ross
2202dcfc0f avformat/iff: ignore FVER tag when not processing DSD/DST files
Fixes ticket #10030.
2025-01-12 11:14:16 +11:00
Peter Ross
ba22d6a24f avformat/wtvenc: do not output negative 'third timestamp' field
Fixes ticket #3659.
2025-01-12 11:07:57 +11:00
Peter Ross
330470ef24 avformat/mlvdec: skip over some other known block types 2025-01-12 10:55:47 +11:00
Peter Ross
45c30bc51e avformat/mlvdec: process VERS block 2025-01-12 10:55:44 +11:00
Peter Ross
86dd15fd0d avformat/mlvdec: demux LJ92 huffman comressed frames
A minimal DNG header is added to each LJ92 compressed frame, allowing
thme to be decoded by the TIFF decoder. The TIFF decoder is responsible
for setting up the MJPEG decoder, signalling the correct s->bayer flag,
and setting pix_fmt.

The LJ92 compressed frames can be muxed out to DNG files, and manipulated
in DNG software. Tested with darktable and rawtherapee.

Contributor: South East <8billion.people@gmail.com>
2025-01-12 10:55:39 +11:00
Leo Izen
f651ca3a68 avutil/frame.h: improve documentation for AV_FRAME_FLAG_LOSSLESS
It should be more clear what this flag is indicating with a more
verbose comment documenting it.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Reviewed-by: Marth64 <marth64@proxyid.net>
2025-01-11 10:31:00 -05:00
Timo Rothenpieler
b76053d8bf avformat/flvdec: add support for legacy HEVC files 2025-01-10 21:55:23 +01:00
James Almer
5cd49e1bfd avcodec/hevc/hevcdec: use av_frame_side_data_add() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-10 15:02:31 -03:00
James Almer
f635f19537 avcodec/aom_film_grain: use av_frame_side_data_add() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-10 15:02:31 -03:00
James Almer
42e72d5c8b avutil/frame: add AV_FRAME_SIDE_DATA_FLAG_NEW_REF
The flag is documented but did not exist. So introduce it as it can be
useful.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-10 15:02:22 -03:00
James Almer
7f9c7f9849 avcodec/jpeg2000dec: clear array length when freeing it
Fixes NULL pointer dereferences.
Fixes ticket #11393.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-10 14:56:03 -03:00
James Almer
292c1df7c1 avformat/mov: merge stts and ctts arrays into one
Should reduce memory usage as well as remove code duplication.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-10 10:39:00 -03:00
James Almer
d7180a3f92 avcodec/vvc/dec: print thread debug logs only if DEBUG is defined
Makes the output of a normal decoding process with loglevel debug a lot less
verbose.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-10 10:23:57 -03:00
Jonathan Baudanza
c0fbb6d5b7 avformat/rtpdec: int overflow in start_time_realtime
This was previously adjusted by me in 6b3f9c2e92.
Unfortunately, I traded one integer overflow bug for
another.

Currently, NTP timestamps that exceed INT64_MAX
(~Jan 20, 1968) will cause an overflow when passed
to av_rescale.

This patch replaces av_rescale, which operates on
int64_t, with ff_parse_ntp_time, which operates on
uint64_t. This will give the correct values for
timestamps back around the NTP epoch and present day
timestamps.

Fixes ticket #11388.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-10 12:09:27 +02:00
Michael Niedermayer
251de1791e avcodec/vc1dec: Clear block_index in vc1_decode_reset()
Fixes: 377965565/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-4504434689769472
Fixes: out of array access

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:27 +01:00
Michael Niedermayer
3f029bfb7f avcodec/aacsbr_template: Clear n_q on error
Fixes: index 5 out of bounds for type 'uint8_t [5]'
Fixes: 377748135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5167109774049280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:27 +01:00
Michael Niedermayer
695b7c71d9 tools/target_dec_fuzzer: Adjust threshold for MSCC
Fixes: Timeout
Fixes: 377574369/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSCC_fuzzer-4924697608781824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:26 +01:00
Michael Niedermayer
4485a0fd77 avformat/iamf_parse: Check output_channel_count
Fixes: -nan is outside the range of representable values of type 'int'
Fixes: 377072730/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6545416570601472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:26 +01:00
Michael Niedermayer
70514ff0ec tools/target_dec_fuzzer: Adjust threshold for VP6
Fixes: Timeout (would need 62sec)
Fixes: 376731123/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP6_fuzzer-5926437896388608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:26 +01:00
Michael Niedermayer
f7cc023f06 avformat/mxfdec: Check edit_unit for being larger than signed 64bit
Fixes: signed integer overflow: 2 * -4962931467012268000 cannot be represented in type 'long'
Fixes: 376496313/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4921469185884160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:25 +01:00
Michael Niedermayer
4bd9b5f520 tools/target_dec_fuzzer: Adjust threshold for TDSC
Fixes: Timeout
Fixes: 376320337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TDSC_fuzzer-6259585758855168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:25 +01:00
Michael Niedermayer
0f511b4518 avcodec/osq: Fixes several undefined overflows in do_decode()
Fixes: signed integer overflow: 1239596184 + 2119376059 cannot be represented in type 'int'
Fixes: 376136844/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6581164455821312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:25 +01:00
Michael Niedermayer
56faee21c1 swscale/output: Fix undefined overflow in yuv2rgba64_full_X_c_template()
Fixes: signed integer overflow: -1082982400 + -1195645138 cannot be represented in type 'int'
Fixes: 376136843/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4791844321427456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:24 +01:00
Michael Niedermayer
b5b6391d64 avfilter/af_pan: Fix sscanf() use
Fixes: Memory Data Leak

Found-by: Simcha Kosman <simcha.kosman@cyberark.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:24 +01:00
Michael Niedermayer
9ffa127aa6 avfilter/vf_grayworld: Use the correct pointer for av_log()
Fixes: crash

Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com>
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:24 +01:00
Michael Niedermayer
b72de49295 avfilter/vf_addroi: Add missing NULL termination to addroi_var_names[]()
Fixes: out of array read

Found-by: Elias Myllymäki <elias.myllymaki04p@gmail.com>
Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-08 23:23:23 +01:00
Frank Plowman
cb60b29ac5 fate/vvc: Add vvc-frames-with-ltr.vvc
This sample is rather difficult, containing a lot of subtle edge cases
which revealed errors in the VVC decoder.  It covers 88.4% of lines in
libavcodec/vvc and brings the line coverage of the entire VVC fate suite
from 96.3% to 97.2%.

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-08 10:10:06 -03:00
Marth64
910e5a275d avformat/avformat.h: elaborate documentation for avformat_open_input() on error condition
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-01-08 00:14:13 -06:00
Scott Theisen
8ad2d1919f libavcodec/mpeg12dec: append CC data to a53_buf_ref
In mpeg_decode_a53_cc() only the A/53 part 4 CC data ("GA94") is saved between
frames. The other formats incorrectly created a larger buffer than they use
since a705bcd763 because they did not append to
the previous data.

The a53_buf_ref is added to the frame in mpeg_field_start() which will only be
called in decode_chunks() if not all of the picture data slices are skipped.

For these formats, utilize the data added to the buffer in case frames are skipped
(concatenating the CC data until a frame can be exported), in a similar fashion to
the A/53 part 4 logic.

Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-01-08 00:03:47 -06:00
Marth64
9305a1edca avcodec/mpeg12dec: fix range for cc_format option
After support was added for DVB 0502 Closed Caption coding,
the cc_format option's range was never updated so user
cannot select this coding as a forced formatting choice.

Fix the range of the option by ending it with the new coding type.

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-01-07 23:54:35 -06:00
NyanMaths
1215fefcb8 avformat/ipfsgateway: fix capitalizaton mistake
Fix the incorrect capitalization of the project name in a comment.
The project is named FFmpeg, not FFMpeg.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-01-07 17:47:15 -05:00
James Almer
692ce2503e avformat/flvdec: initialize ret in flv_read_packet() to AVERROR_BUG
This will ensure any future goto leave that may be added doesn't accidentally forget to
set ret to some proper value.

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-07 16:09:49 -03:00
Timo Rothenpieler
af74fe7139 avformat/flvdec: don't leak extradata pointer on realloc failure 2025-01-07 19:20:30 +01:00
Timo Rothenpieler
9201f872b1 avformat/flvdec: properly free mt_extradata 2025-01-07 19:07:43 +01:00
Alessandro Ros
9fe66c7fcb avformat/flvenc: fix missing sequence start with MP3 tracks
When muxing to FLV/RTMP a MP3 track with an ID greater than zero,
enhanced RTMP has to be used, and a sequence start should preceed track
data.

This is already implemented (see line 823 of flvenc.c) but the code is
never reached due to a too-strict condition before it. This patch fixes
the issue.

Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-01-07 18:38:11 +01:00
Timo Rothenpieler
b32a1a69a4 avformat/flvenc: properly handle writing mpeg4 extradata 2025-01-07 18:30:23 +01:00
Timo Rothenpieler
4c2b769e53 avformat/flvdec: clean up variable initialization spacing 2025-01-07 18:18:38 +01:00
Timo Rothenpieler
0ed3446738 avformat/flvdec: fix potential premature return on audio MultichannelConfig 2025-01-07 18:18:02 +01:00
Timo Rothenpieler
e9de794d7f avformat/flvdec: add missing track_size decrement 2025-01-07 17:57:52 +01:00
Koushik Dutta
252fc2e047 avfilter/scale_vulkan: add dynamic crop region and aspect ratio match
The scale_vulkan filter initializes the shader once, with the crop
region set by the original frame. However, subsequent frames may
specify a different crop region than the first frame. This change
updates the cropping to match the behavior present on the other
hardware frame scale filters.

The scale filter should also allow negative values
that respect aspect ratio, similar to other scale filters.

Signed-off-by: Koushik Dutta <koushd@gmail.com>
2025-01-07 08:34:59 +09:00
Marton Balint
19c95ecbff avcodec: deprecate AVCodecContext properties
These properties are unreliable because they depend on the frames decoded so
far, users should check directly the presence of the decoded AVFrame side data
or AVFrame flags.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-05 22:25:29 +01:00
Marton Balint
8a29b4e38d fftools/ffprobe: print lossless frame flag
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-05 22:23:16 +01:00
Marton Balint
74e04b8921 avcodec: set AV_FRAME_FLAG_LOSSLESS where supported
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-05 22:23:16 +01:00
Marton Balint
2d91f89445 avcodec/frame: add AV_FRAME_FLAG_LOSSLESS
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-05 22:23:15 +01:00
Frank Plowman
539cea3183 lavc/vvc: Fix race condition for MVs cropped to subpic
When the current subpicture has sps_subpic_treated_as_pic_flag equal to
1, motion vectors are cropped such that they cannot point to other
subpictures.  This was accounted for in the prediction logic, but not
in pred_get_y, which is used by the scheduling logic to determine which
parts of the reference pictures must have been reconstructed before
inter prediction of a subsequent frame may begin.  Consequently, where a
motion vector pointed to a location significantly above the current
subpicture, there was the possibility of a race condition.  Patch fixes
this by cropping the motion vector to the current subpicture in
pred_get_y.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-01-05 20:25:29 +08:00
Chris Warrington
f80af3657f avcodec/vvc decode: ALF filtering without CC-ALF
When a stream has ALF filtering enabled but not CC-ALF, the CC-ALF set indexes alf->ctb_cc_idc are being read uninitialized during ALF filtering.

This change initializes alf->ctb_cc_idc whenever ALF is enabled.

Ref. https://trac.ffmpeg.org/ticket/11325
2025-01-05 18:00:18 +08:00
James Almer
2919767750 Revert "avformat/dump: print only the actual streams in a tile grid group"
Indexes in tile_grid->offsets were fixed in the previous commit, but just in case,
make sure to not overread the streams array.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-05 00:32:07 -03:00
James Almer
bf0786d9bd avformat/mov: fix setting tile grid stream offsets when a stream is referenced more than once
The amount of tiles does not necessarely need to match the amount of streams referenced
in the grid, as there could be duplicates.
Don't silently ignore EEXIST return codes from avformat_stream_group_add_stream() and
instead store the index of the duplicate stream.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-05 00:31:58 -03:00
James Almer
cd174c7c7c avfilter/aeval: don't leak the strdup'd expression string
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-04 20:45:10 -03:00
James Almer
e262411f32 avfilter/aeval: tighten the check for empty expression
Fixes ticket #11395

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-04 20:45:10 -03:00
Leandro Santiago
9d9ac8e2ca avfilter/vf_dnn_detect: fix loading anchors when labels file is set
References https://trac.ffmpeg.org/ticket/11387

Defining anchors is needed, even when a filename with the labels is set.
The issue was identified when using yolov4-tiny model using openvino.

More information about how to reproduce the bug can be found on the trac
issue referenced by this commit.

Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
2025-01-04 20:12:12 +08:00
Leo Izen
07e54f9b5c avformat/jpegxl_anim_dec: use new animated JPEG XL codec ID
A new codec ID has been added to avcodec for animated JPEG XL, so
we should use that in the animated JPEG XL demuxer.

Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-01-03 19:37:36 -05:00
Leo Izen
f3c4082645 avcodec/libjxl: add animated JPEG XL encoder
libjxl supports animated encoding, so we add a wrapper to the
library using the receive_packet callback method.

This code was based largely on a patch sent by Zsolt Vadász,
although it was updated to use more recent coding practices
and many of the leaks and issues were fixed.

Reviewed-by: Marth64 <marth64@proxyid.net>
Co-authored-by: Zsolt Vadász <zsolt_vadasz@protonmail.com>
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-01-03 19:37:28 -05:00
Janne Grunau
060464105b vp9: recon: Use emulated edge to prevent buffer overflows
The arm/aarch64 horizontal filter reads one additional pixel beyond what
the filter uses. This can become an issue if the application does not
allocate larger buffers than what's required for the pixel data. If the
motion vector points to the bottom right edge of the picture this
becomes a read buffer overflow. This triggers segfaults in Firefox for
video resolutions which result in a page aligned picture size like
1280x640.
Prevent this by using emulated edge in this case.

Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1881185
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2025-01-03 17:53:49 -05:00
Janne Grunau
f366256215 arm: vp9mc: Load only 12 pixels in the 4 pixel wide horizontal filter
This reduces the amount the horizontal filters read beyond the filter
width to a consistent 1 pixel. The data is not used so this is usually
not noticeable. It becomes a problem when the application allocates
frame buffers only for the aligned picture size and the end of it is at
a page boundary. This happens for picture sizes which are a multiple of
the page size like 1280x640. The frame buffer allocation is based on
its most likely done via mmap + MAP_ANONYMOUS so start and end of the
buffer are page aligned and the previous and next page are not
necessarily mapped.
This mirrors the aarch64 change.

Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2025-01-03 17:53:48 -05:00
Janne Grunau
430c38f698 aarch64: vp9mc: Load only 12 pixels in the 4 pixel wide horizontal filter
This reduces the amount the horizontal filters read beyond the filter
width to a consistent 1 pixel. The data is not used so this is usually
not noticeable. It becomes a problem when the application allocates
frame buffers only for the aligned picture size and the end of it is at
a page boundary. This happens for picture sizes which are a multiple of
the page size like 1280x640. The frame buffer allocation is based on
its most likely done via mmap + MAP_ANONYMOUS so start and end of the
buffer are page aligned and the previous and next page are not
necessarily mapped.
Under these conditions like seen by Firefox a read beyond the end of the
buffer results in a segfault.
After the over-read is reduced to a single pixel it's reasonable to use
VP9's emulated edge motion compensation for this.

Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1881185
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2025-01-03 17:53:46 -05:00
James Almer
2f4ec16836 avcodec/opus/parser: remove duplicate failure path code
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 18:23:07 -03:00
James Almer
37155d68ec avcodec/opus/parser: set duration when complete frames are fed
Fixes a regression since 873a34c129.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 18:22:02 -03:00
James Almer
4bf784c0e5 avformat/dump: print only the actual streams in a tile grid group
The amount of tiles does not necessarely need to match the amount of streams.

Fixes ticket #11389.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:34:03 -03:00
James Almer
c187dd88de avcodec/opus/parser: reindent after the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:34:01 -03:00
James Almer
873a34c129 avcodec/opus/parser: set sample rate
Ensures it's set on scenarios where a parser is requested but no decoder is
present.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:33:31 -03:00
James Almer
fb59995b88 avformat/flvdec: set Opus sample rate
Fixes parsing Opus streams when no opus decoder is present.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:31:20 -03:00
James Almer
547408ce1d avformat/iamfdec: swap back and side streams if both are present
Layouts with both pairs (7.1, 7.1.2, etc) in IAMF that follow the definition in
ITU-R BS.2051-3 for Systems I and J also follow its ordering. This means side
comes before back, which is the inverse of how it's defined in AVChannel.

To workaround this without having to use custom order channel layouts, swap the
stream ids in the input IAMF structure, so packets for one are mapped to the
other.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
c089c158d6 avformat/iamf: document the expandable channel layouts
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
8f6a1a06a6 avformat/iamf: use the correct layouts for Sound Systems B and C
They have the side channels, not back, as defined in ITU-R - BS.2051-3

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
3fa70c03e4 avformat/iamf_writer: be more verbose when reporting an input layout is invalid
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:13 -03:00
James Almer
aba9fafee7 avutil/channel_layout: fix definition of 5.1.4 layout
It's meant to have the side channels, as defined in Sound System D from
ITU-R - BS.2051-3

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:12 -03:00
James Almer
da9dcaba69 avutil/channel_layout: add a 5.1.2 layout using side channels
And rename the existing 5.1.2 to explicitly state it contains back channels.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:12 -03:00
Lynne
551041e384 vulkan_decode: remove informative queries
We queried the decoder whether it was able to decode sucessfully, but
since we operated asynchronously, we weren't able to do anything with
this information but let the user know decoding failed for the previous
frame(s).

Since we parse the slice headers ourselves and we're reasonably sure we
can decode before actually starting to decode, this was rarely triggered
on corrupt data, and hardware's understanding of whether there was an error
or not is vague.

There's also a semantic problem with our use of the queries - if there's
a seek, we flush, but what happens to the queries is vague according to
the spec. Most hardware dealt fine, since queries are nothing more than
GPU memory with integers stored. But with Intel, they seem to be more of
a register to which a driver must keep track of, leading to issues if there's
been a reset (seek) and we query the previous submission before the seek.

Just get rid of them. The query code is still used in encoding.

This fixes seeking with HEVC and AV1 on Intel.
2025-01-03 14:53:41 +09:00
Lynne
e7b474783c ffv1enc_vulkan: allow setting the number of slices via -slices
Falls back to the exact same code the software encoder uses.
2025-01-03 14:53:41 +09:00
Lynne
d9b773c22f hwcontext_vulkan: add VK_EXT_layer_settings to optional instance extensions
The issue is that some compilers complain if a struct or array
is empty.

This extension does nothing by default, and can be useful, so just add it
to keep the array non-empty.
2025-01-03 14:53:37 +09:00
Manuel Lauss
b22ce90d42 avcodec/sanm: SMUSH codec48 decoder
Adds a decoder for the SMUSH codec48 video encoding, as is used by
the LucasArts game "Mysteries of the Sith".

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-03 00:00:10 +01:00
James Almer
dd5696c197 avfilter/buffersrc: make channel_layout a CHLAYOUT type AVOption
The string type is a remnant of the old channel layout API implementation.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-02 12:11:08 -03:00
Joe Schiffler
0457aaf0d3 configure: Include quotes around pkg_version
In some MSYS environments it can happen that the 3 argument syntax
for pkg-config library specifications fails because somehow the
expansion of pkg_version ends up with a redirection we guess.

To avoid failures like in the referenced build[2], we quote it
so the whole module including operators will be expanded into
a single shell word and the single argument syntax for specifying
the library for pkg-config will be used.

The single argument syntax seems to be supported by the original
pkg-config from the beginning more than 20 years[3].

In the pkgconf implementation single argument syntax was supported
pretty much from the beginning as well. The multiple argument syntax
we used until this change, was not supported until a change[4] more
than 10 years ago.

References
----------

1. Build passing with quotes:
   https://github.com/JoeSchiff/pyav-ffmpeg/actions/runs/12358403929
2. Build failing without quotes:
   https://github.com/JoeSchiff/pyav-ffmpeg/actions/runs/12360472377
3. Earliest commit of the current pkg-config Git repo already mentions the single argument syntax:
   2ac96cbcc7 (124c0becfe68b1ef671f49ed2b9d24779ace126f_0_162)
4. pkgconf gets support for 3 argument syntax (pkgconf --exists liba = 1.2.3):
   793de6a06c

Commit-message-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Joe Schiffler <joeschiffler3@gmail.com>
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2025-01-02 09:23:00 +01:00
James Almer
041a6c3614 avfilter/buffersink: don't leak the reallocated channel layouts array
And ensure the last element is the zeroed terminator.

Fixes ticket #11392.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-01 19:42:11 -03:00
Michael Niedermayer
f7900a5609 avformat/demux: Check packet duration
Fixes: signed integer overflow: 24320 + 9223372036854775573 cannot be represented in type 'long'
Fixes: 71001/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-5644785744936960

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:46 +01:00
Michael Niedermayer
b9b4c9ebf0 avcodec/get_buffer: Use av_buffer_mallocz() for audio same as its done for video
Fixes: Use of uninintialized value
Fixes: 70993/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6378949754552320
Fixes: 71104/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5001538727116800

For the AAC/USAC/SBR code which reads uninitialized memory, it would be good, if it did not
a fix for that is welcome!

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:46 +01:00
Michael Niedermayer
3f0b95bb17 avformat/jpegxl_anim_dec: clear buffer padding
Fixes: use of uninitialized value
Fixes: 70992/clusterfuzz-testcase-minimized-ffmpeg_dem_IMAGE2_fuzzer-5735819170611200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:46 +01:00
Michael Niedermayer
9578c135d0 avformat/rmdec: check that buf if completely filled
Fixes: use of uninitialized value
Fixes: 70988/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5298245077630976

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:45 +01:00
Michael Niedermayer
9de721de70 avcodec/cfhdenc: Clear dwt_tmp
This occurs on a 32x32 input

Fixes: use of uninitialized value
Fixes: 70897/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5960860961406976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 21:33:45 +01:00
Michael Niedermayer
7eeeda703b avcodec/hapdec: Clear tex buffer
The code following makes no attempt to initialize all of the buffer

Fixes: use of uninitialized value
Fixes: 70980/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5329909059223552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 20:31:08 +01:00
Michael Niedermayer
4c62cbcae2 avformat/mxfdec: Check that key was read sucessfull
Fixes: use of uninitialized value
Fixes: 70932/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4870202133643264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-01 20:31:07 +01:00
Lynne
d3aa99a4f4 configure: update copyright year
On 01/01/2025 19:05, Peter Ross wrote:
> FFmpeg turns 25 this year.
2025-01-01 20:15:25 +09:00
Michael Niedermayer
eab65379bf avformat/rpl: Fix check for negative values
Fixes: signed integer overflow: 10 * -1923267925333400000 cannot be represented in type 'int64_t' (aka 'long')
Fixes: 378891963/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5714338935013376
Found-by: ossfuzz
Reported-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-31 19:15:19 +01:00
James Almer
1446e37d3d avfilter/buffersrc: check for valid sample rate
A sample rate <= 0 is invalid.

Fixes an assert in ffmpeg_enc.c that assumed a valid sample rate would be set.
Fixes ticket #11385.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:54:12 -03:00
James Almer
658a645e18 tests/checkasm/sw_rgb: remove bogus value truncation in check_yuv2packed1()
Fixes out of array accesses.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:53:18 -03:00
James Almer
15b16d58df avcodec/ac3dec: set preferred_stereo_downmix using the relevant coded value
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
James Almer
9d16c64134 avcodec/ac3dec_float: fix range for dmix_mode
Value 3 is used to signal "Dolby Pro Logic II" by some encoders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
James Almer
376bb8481a avcodec/ac3dec_float: define the downmix related options as exported and read-only
They are not user settable options.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
James Almer
61519a6e98 avcodec/ac3dec: set ltrt_center_mix and ltrt_surround_mix using the relevant coded values
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-31 11:30:09 -03:00
Michael Niedermayer
bb85423142 avformat/mlvdec: Check avio_read()
Fixes: use-of-uninitialized-value
Fixes: 383170476/clusterfuzz-testcase-minimized-ffmpeg_dem_MLV_fuzzer-4696002884337664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-31 04:56:26 +01:00
Michael Niedermayer
53db351654 avformat/mxfdec: Check llen addition for overflow
Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long'
Fixes: 377971441/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4966030696316928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-31 04:56:26 +01:00
Michael Niedermayer
ae81beb351 avcodec/aac/aacdec: Free channel layout
Fixes: 371445194/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5981081124274176
Fixes: memleak

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-31 04:56:25 +01:00
James Almer
d1d9b0813a avcodec/libdav1d: clear the buffered Dav1dData on decoding failure
Should ensure avcodec_send_packet() doesn't return EAGAIN in scenarios where it's not
meant to (e.g., ffmpeg_dec.c where avcodec_receive_frame() is called in a loop to drain
all produced frames before trying to submit more packets).

Fixes ticket #11377.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-30 20:38:00 -03:00
Timo Rothenpieler
5f38c82536 avformat: bump version for enhanced flv 2024-12-27 20:24:23 +01:00
Timo Rothenpieler
770f0a2434 avformat/flvdec: propagate av_packet_add_side_data failure 2024-12-27 20:24:23 +01:00
Timo Rothenpieler
741e49c56f avformat/flvenc: prevent writing legacy codecs into extended video tracks 2024-12-27 20:24:23 +01:00
Timo Rothenpieler
64043d7b18 fate/flvenc: add test for multitrack flv 2024-12-27 20:24:23 +01:00
Timo Rothenpieler
e3836d1d05 avformat/rtmpproto: reserve enough space for statusmsg 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
e2a8ece352 avformat/flvdec: support all multi-track modes 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
da32990e83 avformat/flvdec: stop shadowing local variables 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
f8dc4d94fd avformat/rtmpproto: add more enhanced rtmp codecs 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
25faaa311a avformat/flvdec: add support for reading multi track audio 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
bbf1f3cf6f avformat/flvenc: add support for writing multi track audio 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
67b5fb4b59 avformat/flvdec: parse enhanced rtmp multichannel info 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
3db28fb067 avformat/flvenc: write enhanced rtmp multichannel info for audio with more than two channels 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
63613fe915 avformat/flvenc: refactor fourcc writing 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
2f72dc33ff avformat/flvdec: add enhanced audio codecs 2024-12-27 20:24:22 +01:00
Timo Rothenpieler
70067c829b avformat/flvenc: remove !size check for audio packets
At least flac finishes every stream with an empty side-data only packet,
that would trigger an assertion/error were these checks still in place.
2024-12-27 20:24:22 +01:00
Dennis Sädtler
466a400b94 avformat/flvdec: add support for demuxing multi-track FLV
Based on enhanced-rtmp v2 spec published by Veovera:
https://veovera.github.io/enhanced-rtmp/docs/enhanced/enhanced-rtmp-v2

Signed-off-by: Dennis Sädtler <dennis@obsproject.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-12-27 20:24:09 +01:00
Dennis Sädtler
d8d0175d3a avformat/flvenc: implement support for multi-track video
Based on enhanced-rtmp v2 spec published by Veovera:
https://veovera.github.io/enhanced-rtmp/docs/enhanced/enhanced-rtmp-v2

This implementation maintains some backwards compatibility by only
writing the track information for track indices > 0. This means that
older FFmpeg versions - and possibly other software - can still read the
first video track properly and skip over unsupported packets.

Signed-off-by: Dennis Sädtler <dennis@obsproject.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-12-27 20:22:19 +01:00
James Almer
cedd9151f8 avformat/iamf_writer: ensure the stream groups are not empty
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-27 16:17:51 -03:00
Niklas Haas
59258fb90e swscale/utils: lazily allocate XYZ tables on CONFIG_SMALL
This has the downside of requiring these tables to be recomputed on every
init, but saves ~270 kB of static data.

Signed-off-by: Niklas Haas <git@haasn.dev>
2024-12-26 20:31:36 +01:00
Niklas Haas
60bfafcd8a swscale/utils: add return code to fill_xyztables()
Needed for lazy allocation of XYZ tables.

Signed-off-by: Niklas Haas <git@haasn.dev>
2024-12-26 20:31:36 +01:00
Niklas Haas
af6d52eec6 swscale: use 16-bit intermediate precision for RGB/XYZ conversion
The current logic uses 12-bit linear light math, which is woefully insufficient
and leads to nasty postarization artifacts. This patch simply switches the
internal logic to 16-bit precision.

This raises the memory requirement of these tables from 32 kB to 272 kB.

All relevant FATE tests updated for improved accuracy.

Fixes: #4829
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-26 20:31:36 +01:00
James Almer
3e6d89cd97 avcodec/cbs_h2645: revert accidental change
This was erroneously included in 7e778586e7.

Reported-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-26 15:46:44 -03:00
Niklas Haas
8cf2d97280 swscale/unscaled: add pal8 -> gbr(a)p special converter
Fixes: #9520
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-26 19:29:18 +01:00
James Almer
7e778586e7 avcodec/libx265: ignore user set alpha x265-param
It makes no difference when the input has an alpha plane, and may end up in
crashes or undefined behavior if it doesn't.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-26 13:41:28 -03:00
James Almer
6ffbc22b53 doc/ffmpeg.texi: replace use of uncommon unicode characters
Addresses ticket #11372

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-26 13:41:28 -03:00
Gyan Doshi
fe04b93afa ffmpeg_sched: return better error code
The existing code of 'No space left on device' leaves end users confused
since the issue isn't of disk space.
2024-12-26 15:45:00 +05:30
Pradeep Kumar Goudagunta
aa20294b31 fftools/ffmpeg_opt: Fix precedence issue in abs_start_seek calculation
This patch corrects a C operator precedence issue in fftools/ffmpeg_opt.c
where the abs_start_seek calculation did not yield the expected result
due to incorrect placement of parentheses.
2024-12-26 15:44:18 +05:30
Marth64
3778b1f6f1 avformat/dashdec: reformat and lowercase get_Fragment()
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-24 16:36:05 -06:00
Eugene Zemtsov
7c9bde1d0d avformat/mov: fix crash when trying to get a fragment time for a non-existing fragment
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-24 15:36:30 -06:00
Marth64
8e8260aabf avcodec/cbs_av1: fix variable shadowing in cbs_av1_split_fragment()
header is previously declared as an int argument then
shadowed in the scope of the loop as a AV1RawOBUHeader.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-24 15:36:17 -06:00
Michael Niedermayer
954d55c2a4 avformat/mov: dereference pointer after null check
Fixes: null pointer dereference
Fixes: 383397479/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4776829338058752

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:52 +01:00
Michael Niedermayer
9327093079 avcodec/utils: Fix block align overflow for ADPCM_IMA_WAV
Fixes: signed integer overflow: 529008646 * 8 cannot be represented in type 'int'
Fixes: 383379145/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6674045107503104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:52 +01:00
Michael Niedermayer
361d24e6d9 avformat/matroskadec: Check pre_ns for overflow
Fixes: signed integer overflow: -3483479120376300096 - 7442323944145700864 cannot be represented in type 'long'
Fixes: 383187489/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4561470580391936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:51 +01:00
Michael Niedermayer
8f4eb0fe03 tools/target_dec_fuzzer: Adjust threshold for EACMV
Fixes: Timeout
Fixes: 382988735/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EACMV_fuzzer-5278721465974784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:51 +01:00
Michael Niedermayer
fe1aeb499b tools/target_dec_fuzzer: Adjust threshold for SGA
Fixes: Timeout
Fixes: 382804863/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGA_fuzzer-5652795669151744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:51 +01:00
Michael Niedermayer
e7230bc503 tools/target_dec_fuzzer: Adjust threshold for MVC1
Fixes: Timeout
Fixes: 378231213/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVC1_fuzzer-6640960500465664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:50 +01:00
Michael Niedermayer
e8c94e31da avformat/mov: free stream_info when the surrounding array is freed
Fixes: memleak
Fixes: 378408474/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5699368121860096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:50 +01:00
Michael Niedermayer
61ff3047c5 avcodec/rv60dec: Check NEXT/LAST availability
Fixes: NULL ptr use
Fixes: 378634700/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5008344043028480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:50 +01:00
Michael Niedermayer
2336fc44ac avcodec/rv60dec: Use get_bits_long()
Fixes: 378634700/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5008344043028480
Fixes: assertion failure

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:55:18 +01:00
Michael Niedermayer
34c06f5284 avcodec/escape130: move get_buffer down
This way the (slow) allocation of an image is done after various additional checks

Fixes: Timeout
Fixes: 379418967/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE130_fuzzer-6507383574036480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:46:47 +01:00
Michael Niedermayer
89efc6c97c tools/target_dec_fuzzer: Adjust Threshold for indeo5
Fixes: 379768251/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5981329084186624
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:46:47 +01:00
Michael Niedermayer
6ba33b50f5 avutil/timecode: Avoid fps overflow in av_timecode_get_smpte_from_framenum()
Fix from c94875471e

Found-by: Youngjae Choi <youngjaechoi@korea.ac.kr>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-24 02:45:13 +01:00
James Almer
f1ddba24a0 avutil/frame: add missing size dependent prop to LCEVC payload side data
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-23 17:39:57 -03:00
Niklas Haas
d23f443dfc avfilter/vf_lut*: strip color volume metadata
These filters, in general, will apply some arbitrary color volume
transformation. Strip corresponding metadata to be conservative/safe.
2024-12-23 14:23:13 +01:00
Niklas Haas
eecdc25d4b avfilter/vf_colorspace: strip color volume metadata 2024-12-23 14:23:13 +01:00
Niklas Haas
0d468730bc avfilter/vf_libplacebo: update metadata stripping logic
Switches to av_frame_side_data_remove_by_props(), covering a number of
cases that we previously ignored. Additionally, stop stripping metadata
when merely changing colorspace or color range, since these do not
affect the actual color volume of the image data, only the encoding.
2024-12-23 14:23:13 +01:00
Niklas Haas
d1eadc43b9 avfilter/vf_zscale: strip metadata on change
Required for both size changes and color volume changes (as a result of
changing primaries/transfer).
2024-12-23 14:23:13 +01:00
Niklas Haas
f22965b882 avfilter/vf_scale*: strip metadata on size change 2024-12-23 14:23:13 +01:00
Niklas Haas
b88944a8aa avutil/frame: add av_frame_side_data_remove_by_props()
As discussed in the previous commit, we often need a convenient way of
stripping all side data related to a certain aspect of the frame. This helper
accomplishes just that.

I considered also adding a way to match only side data matching *all*
properties, but I think this is sufficiently useless in practise to not warrant
inclusion in the API.
2024-12-23 14:22:56 +01:00
Niklas Haas
3428a8d830 avutil/frame: add AV_SIDE_DATA_PROP_{SIZE,COLOR}_DEPENDENT
Many filters modify certain aspects of frame data, e.g. through resizing
(vf_*scale* family), color volume mapping (vf_lut*, vf_tonemap*), or
possibly others.

When this happens, we should strip all frame side data that will no
longer be correct/relevant after the operation. For example, changing
the image size should invalidate AV_FRAME_DATA_PANSCAN because the crop
window (given in pixels) no longer corresponds to the actual image size.
For another example, tone-mapping filters (e.g. from HDR to SDR) should
strip all of the dynamic HDR related metadata.

Since there are a lot of different side data types that are affected by such
operations, it makes sense to establish this information in a common, easily
accessible way. The existing side data properties enum is a perfect fit for
this.
2024-12-23 13:33:33 +01:00
Niklas Haas
01084f3d16 avutil/frame: add AVSideDataDescriptor for AV_FRAME_DATA_VIDEO_HINT
This entry was seemingly missing.
2024-12-23 13:32:48 +01:00
Niklas Haas
5ca5bbd462 swscale/options: add -sws_dither none alias
While this one was technically supported on account of the generic options
code allowing "none" as a valid alias for 0, not having it listed here meant
it never showed up in e.g. the -h output, and is also inconsistent with other
places in the code that generally add an explicit alias with appropriate
documentation. Reduces user confusion at negligible cost.

Fixes: #9192
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 12:47:10 +01:00
Niklas Haas
253b8977c0 swscale: remove primaries/trc change warning
This is now supported when using the new API.
2024-12-23 12:33:43 +01:00
Niklas Haas
6da940e118 swscale/graph: allow dynamically updating HDR metadata
Without triggering a full graph reinit.
2024-12-23 12:33:43 +01:00
Niklas Haas
efff80c8f6 swscale/graph: add color mapping pass
This leverages the previously introduced color management subsystem in order
to adapt between transfer functions and color spaces, as well as for HDR tone
mapping.

Take special care to handle grayscale formats without a colorspace
gracefully.
2024-12-23 12:33:43 +01:00
Niklas Haas
a57fe519b6 swscale/lut3d: add 3DLUT dispatch system
This is a lightweight wrapper around the underlying color management system,
whose job it is merely to manage the 3DLUT state and apply them to the frame
data. This is where we might add platform-specific optimizations in the future.

I also plan on adding support for more pixel formats in the future. In
particular, we could support YUV or XYZ input formats directly using only
negligible additional code in the 3DLUT setup functions. This would eliminate
the major source of slowdown, which is currently the roundtrip to RGBA64.
2024-12-23 12:33:43 +01:00
Niklas Haas
dddf536d3d swscale/cms: add color management subsystem
The underlying color mapping logic was ported as straightforwardly as possible
from libplacebo, although the API and glue code has been very heavily
refactored / rewritten. In particular, the generalization of gamut mapping
methods is replaced by a single ICC intent selection, and constants have been
hard-coded.

To minimize the amount of overall operations, this gamut mapping LUT now embeds
a direct end-to-end transformation to the output color space; something that
libplacebo does in shaders, but which is prohibitively expensive in software.

In order to preserve compatibility with dynamic tone mapping without severely
regressing performance, we add the ability to generate a pair of "split" LUTS,
one for encoding the input and output to the perceptual color space, and a
third to embed the tone mapping operation. Additionally, this intermediate
space could be used for additional subjective effect (e.g. changing
saturation or brightness).

The big downside of the new approach is that generating a static color mapping
LUT is now fairly slow, as the chromaticity lobe peaks have to be recomputed
for every single RGB value, since correlated RGB colors are not necessarily
aligned in ICh space. Generating a split 3DLUT significantly alleviates this
problem because the expensive step is done as part of the IPT input LUT, which
can share the same hue peak calculation at least for all input intensities.
2024-12-23 12:33:43 +01:00
Niklas Haas
2e674780b7 swscale/csputils: add internal colorspace math helpers
Logic is, for the most part, a straight port of similar logic in
liplacebo's colorspace.c, with some general edits and refactors.
2024-12-23 12:33:43 +01:00
Niklas Haas
01ce9d7963 avfilter/vf_scale: strip metadata when changing colorspace
This is no longer relevant after a change in color space.
2024-12-23 12:33:43 +01:00
Niklas Haas
4315cc943a avfilter/vf_scale: make options alignment consistent (cosmetic) 2024-12-23 12:33:43 +01:00
Niklas Haas
b7a2333357 avfilter/vf_scale: add colorspace and transfer property options
In the long run, it would be ideal if we could add these to the avfilter
negotiation as well, but for now, this is a good start.
2024-12-23 12:33:43 +01:00
Niklas Haas
45f0a7ad33 swscale: add ICC intent enum and option
This setting can be used to infuence the type of tone and gamut mapping used
internally when color space conversions are required. As discussed at VDD'24,
the default was set to relative colorimetric clipping, which is approximately
associative, surjective and idempotent. As such, it roundtrips well, although
it is strictly speaking not associative on out-of-gamut colors.
2024-12-23 12:33:43 +01:00
Niklas Haas
7b7c32322d swscale/utils: fix XYZ primaries tagging
Swscale currently handles XYZ by embedding a forced conversion to
BT.709 RGB with a hardcoded matrix. This is not ideal, but to preserve the
status quo and avoid any unexpected changes in behavior, this patch merely
fixes the inferred primaries tag to match the reality.

In the future, I would like to handle XYZ properly, via direct conversion
to the target colorspace (or possibly simply by using a more fitting
RGB intermediate like SMPTE428), but for now just keep the status quo.
2024-12-23 12:33:43 +01:00
Niklas Haas
1f0c500784 swscale/utils: add helper function to infer colorspace metadata
Logic is loosely on equivalent decisions in libplacebo. The basic idea is to try
and be a bit conservative by treating AVCOL_*_UNSPECIFIED as a no-op, unless the
other primaries set are non-standard / wide-gamut or HDR. This helps avoid
unintended or unexpected colorspace conversions, while forcing it in cases where
we are almost certain it is needed. The major departure from libplacebo semantics
is that we no default to a 1000:1 contrast ration for SDR displays, instead modelling
them as idealized devices with an infinite contrast ratio.

In either case, setting SWS_STRICT overrides this behavior in favor of always
requiring explicit colorspace metadata.
2024-12-23 12:33:43 +01:00
Niklas Haas
9084d581e8 swscale/utils: read dynamic HDR10+ metadata from AVFrame
Logic ported from libplacebo's AVFrame helpers. The basic idea is to use the
provided MaxRGB/MaxSCL values to infer what the actual luminance would have
been, which HDR10+ metadata does not provide directly. It's worth pointing out
that this gives us an *upper* bound on the true maximum luminance, so any
error in the estimation cannot result in clipping.
2024-12-23 12:33:43 +01:00
Niklas Haas
7432fa19cd swscale/utils: read HDR mastering metadata from AVFrame 2024-12-23 12:33:43 +01:00
Niklas Haas
5b21b7f52c swscale/utils: set static/implied HDR metadata
Provide default values for the fields added in the previous commit.
2024-12-23 12:33:43 +01:00
Niklas Haas
a8d01dff9a swscale/utils: add HDR metadata to SwsFormat
Only add the condensed values that we actually care about. Group them into
a new struct to make it easier to discard or replace this metadata.

Define a special comparison function that does not choke on undefined/unknown
metadata.
2024-12-23 12:33:43 +01:00
Niklas Haas
b9dfe8138e swscale/utils: check for supported color transfers
We will use the av_csp_itu_eotf() functions to decode these internally, so
check this function to see if it succeeds.
2024-12-23 12:33:43 +01:00
Niklas Haas
6c9218d748 swscale/unscaled: allow semiplanar copies
As fixed in the previous commit, this enables semipacked range and
bit depth conversions. Previously these would go through the general
purpose path.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:32:02 +01:00
Niklas Haas
77db7f9b87 swscale/unscaled: correctly copy semiplanar formats
This fixes multiple bugs with semiplanar formats like NV12. Not only do these
false positive the grayscale format checks (because dst[2] in NULL), but they
also copied an incorrect number of pixels.

Fixes conversions such as nv12 -> nv12, gray8 -> nv12, nv20le -> nv20be, etc.

Fixes: #11239
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:31:58 +01:00
Niklas Haas
c6bf7f6645 swscale/unscaled: correctly round yuv2yuv when not dithering
We should at least bias towards the nearest integer, instead of always
rounding down, when not dithering. This is a bit more correct.

The FATE changes are only in the cases where sws_dither was explicitly set
to "none", which is exactly as expected.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:29:22 +01:00
Niklas Haas
a9ae2cc14d checkasm/sw_rgb: add alpToYV12 check
Mirroring lumToYV12 and chrToYV12.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:59 +01:00
Niklas Haas
c601bb8df5 checkasm/sw_rgb: add tests for yuv2packed{1,2,X}
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:58 +01:00
Niklas Haas
57bbdb4fb1 checkasm/sw_scale: add test for yuv2nv12cX
Mirroring yuv2yuvX.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:58 +01:00
Niklas Haas
fe9bf7cd52 checkasm/sw_scale: add assertion for hscale assumption
This code only checks hcScale. In practice this is not an issue because
the function pointers should always be identical to hyScale for the same
filter size.

Add an assertion just to make sure this assumption never regresses.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-23 11:20:58 +01:00
Scott Theisen
9da1d2e66a libavcodec/v4l2_buffers.c: set AVFrame interlaced flags
Originally from:
669955c6cb

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-12-23 16:16:16 +08:00
Lynne
1b8cd00da6 configure: add option to statically link to libvulkan
This may be useful in weird setups and on platforms where
static linking to libvulkan is supported.

libplacebo also has this fallback.
2024-12-23 04:25:09 +09:00
Lynne
8fbecfd1a0 vulkan_decode: add queue_flags field to specify queue used 2024-12-23 04:25:09 +09:00
Lynne
2e06b84e27 vulkan: do not reinvent a queue context struct
We recently introduced a public field which was a superset
of the queue context we used to have.

Switch to using it entirely.

This also allows us to get rid of the NIH function which was
valid only for video queues.
2024-12-23 04:25:09 +09:00
Lynne
157cd820ad vulkan: remove pointless mutex locks
This code was simply incorrect through and through. It did not
protect what actually has to be protected in a multi-threaded setup.
Perhaps it was used to silence threading errors?

Either way, remove it, and document the correct way to use execution
pools in a threaded environment.
2024-12-23 04:25:09 +09:00
Lynne
7239be07be vulkan_decode: use a single execution pool
Originally, the decoder had a single execution pool, with one
execution context per thread. Execution pools were always intended
to be thread-safe, as long as there were enough execution contexts
in the pool to satisfy all threads.

Due to synchronization issues, the threading part was removed at some
point, and, for decoding, each thread had its own execution pool.
Having a single execution pool per context is hacky, not to mention
wasteful.
Most importantly, we *cannot* associate single shaders across multiple
execution pools for a single application. This means that we cannot
use shaders to either apply film grain, or use this framework for
software-defined decoders.

The recent commits added threading capabilities back to the execution
pool, and the number of contexts in each pool was increased. This was
done with the assumption that the execution pool was singular, which
it was not. This led to increased parallelism and number of frames
in flight, which is taxing on memory.

This commit finally restores proper threading behaviour.
The validation layer has isses that are reported and addressed in the
earlier commit.
2024-12-23 04:25:08 +09:00
Lynne
4ca2b86ed5 hwcontext_vulkan: disable validation layer threading warnings
The layer is buggy currently:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/9045
2024-12-23 04:25:08 +09:00
Lynne
18af3a1db2 hwcontext_vulkan: do not enable portability subset by default
It doesn't make sense to, and could result in the implementation
picking emulation layers.
2024-12-23 04:25:01 +09:00
Benjamin Cheng
bf9f921ef7 avcodec/hw_base_encode: restrict size of next_prev
Some drivers are more strict about the size of the reference lists given
(i.e. VAOn12 [1]). The next_prev list is used to handle multiple "L0"
references in AV1 encode. Restrict the size of next_prev based on the
value of ref_l0 when the GOP structure is initialized.

[1] https://github.com/intel/cartwheel-ffmpeg/issues/278

v2: fix indentation issues
2024-12-23 04:24:54 +09:00
Nuo Mi
0a6388d1da avcodec/hevcdec: remove hevc prefix for x86 asm files 2024-12-22 21:00:06 +08:00
Nuo Mi
8d27256a74 avcodec/vvcdec: remove vvc prefix for x86 and riscv 2024-12-22 21:00:06 +08:00
Peter Ross
350ebef112 avformat/iff: remove surplus if statement
Fixes CID 1636854
2024-12-22 06:24:49 -05:00
Peter Ross
b2cba76d4f avformat/riff: map 0069 twocc to ADPCM IMA XBOX decoder 2024-12-22 16:08:33 +11:00
Paul B Mahol
c3083b3266 avcodec: add ADPCM IMA XBOX decoder 2024-12-22 16:08:33 +11:00
Niklas Haas
095f8038fa swscale/output: fix bilinear yuv2rgb chroma interpolation
These functions were divided into two special cases; one assuming that
uvalpha == 0, and the other assuming that uvalpha == 2048. This worked fine
for simple 2x chroma upscaling but broke for e.g. yuv410p, non-centered chroma,
or other special cases that involved non-aligned chroma filters.

Fix it by instead dividing this check into two cases, a uvalpha==0 fast path
and a uvalpha>0 general path. Instead of (A+B)/2 the general path now multiplies
in the true uvalpha weight.

I tried preserving the old fast path for the case of uvalpha == 2048, but this
was significantly slower in practise versus having just one general path.
However, we still need a uvalpha == 0 path for the unscaled case.

Fixes: ticket #5083
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-21 10:57:54 +01:00
sunyuechi
6b31e42c47 lavc/riscv: vset macro for simplify if-else 2024-12-21 12:03:45 +08:00
Zhao Zhili
952508ae05 aarch64/vvc: Add apply_bdof
Test on rpi 5 with gcc 12:

apply_bdof_8_8x16_c:                                  7315.2 ( 1.00x)
apply_bdof_8_8x16_neon:                               1876.8 ( 3.90x)
apply_bdof_8_16x8_c:                                  7170.5 ( 1.00x)
apply_bdof_8_16x8_neon:                               1752.8 ( 4.09x)
apply_bdof_8_16x16_c:                                14695.2 ( 1.00x)
apply_bdof_8_16x16_neon:                              3490.5 ( 4.21x)
apply_bdof_10_8x16_c:                                 7371.5 ( 1.00x)
apply_bdof_10_8x16_neon:                              1863.8 ( 3.96x)
apply_bdof_10_16x8_c:                                 7172.0 ( 1.00x)
apply_bdof_10_16x8_neon:                              1766.0 ( 4.06x)
apply_bdof_10_16x16_c:                               14551.5 ( 1.00x)
apply_bdof_10_16x16_neon:                             3576.0 ( 4.07x)
apply_bdof_12_8x16_c:                                 7236.5 ( 1.00x)
apply_bdof_12_8x16_neon:                              1863.8 ( 3.88x)
apply_bdof_12_16x8_c:                                 7316.5 ( 1.00x)
apply_bdof_12_16x8_neon:                              1758.8 ( 4.16x)
apply_bdof_12_16x16_c:                               14691.2 ( 1.00x)
apply_bdof_12_16x16_neon:                             3480.5 ( 4.22x)
2024-12-21 11:54:44 +08:00
Peter Ross
7aeae8d1ae avcodec/Makefile: include aom_film_grain.o file for h264_sei component
h264_sei depends on h2645_sei, which in turn depends on aom_film_grain for
ff_aom_uninit_film_grain_params()
2024-12-21 11:38:57 +11:00
Peter Ross
6bf9252807 avformat/Makefile: include object files for image_vbn_pipe demuxer 2024-12-21 11:38:48 +11:00
Peter Ross
c90e0777da avformat/iff: SndAnim decoding
Fixes ticket #5553.
2024-12-20 20:40:12 +11:00
James Almer
4e2b9df48c avformat/isom: use more of the existing channel layout bitmap defines
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-19 22:06:22 -03:00
James Almer
76049d1c45 avformat/iamf_writer: fix setting num_samples_per_frame for OPUS
As per section 3.11.1 of the IAMF spec, the sample rate used in Codec Config
for Opus shall be 48kHz, regardless of the original sample rate used during
encoding.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-19 22:06:22 -03:00
Dmitrii Ovchinnikov
95217872ad avcodec/amfenc: B-Frame support for av1_amf encoder. 2024-12-20 00:43:52 +01:00
Dmitrii Ovchinnikov
c037eb8424 amfenc: Update the min version to 1.4.35.0 for AMF SDK. 2024-12-20 00:43:42 +01:00
Cameron Gutman
a40cbf9792 avcodec/amfenc: Implement async_depth option
This option, which is also available on other FFmpeg hardware encoders,
allows the user to trade throughput for reduced output latency. This is
useful for ultra low latency applications like game streaming.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2024-12-20 00:43:30 +01:00
Peter Ross
494c961379 avformat/Makefile: add iso_writer golomb_tab from shared library dependency 2024-12-19 10:42:29 +11:00
Niklas Haas
b38f6f9990 tests/swscale: allow nonzero positive return codes from sws_scale_frame()
See previous commit.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-18 17:30:48 +01:00
Niklas Haas
e05a1bb879 swscale: fix documentation of sws_scale_frame()
Since its introduction, this function has claimed to return 0 on success, yet
never actually did so (until the introduction of the new graph based API). It
always returned the number of scaled lines, and continues to do so.

To avoid confusion, but also avoid regressing possible clients that relied on
the existing semantics, simply update the documentation to reflect the actual
behavior. Remain ambiguous about the exact interpretation of the return value
on account of the unfortunate difference in behavior between the legacy and
new scaling APIs.

Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-18 17:30:48 +01:00
Niklas Haas
2df655bc2c swscale/utils: fix sws_getCachedContext check
This logic was inverted, but || was not replaced by &&.

Fixes: ed5dd67562
Fixes: ticket #11353
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-18 17:30:26 +01:00
Martin Storsjö
d1e37eb0cd avutil/mem_internal: Don't include stdalign.h on MSVC
It's currently actually not used in MSVC builds, since
6e49b86996.

Older versions of MSVC (or, in particular, older versions of UCRT)
don't have stdalign.h; it's available since WinSDK 10.0.20348.0;
such a new enough version has been installed by default only since
MSVC 2022 17.4 and newer.

With this change, ffmpeg can still be built with MSVC 2019 16.8
(v19.28).

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-18 16:03:06 +02:00
Martin Storsjö
2bb00ef59c aarch64: vvc: Fix building the dmvr_hv assembly with older MSVC versions
Explicitly use ldur for unaligned offsets; newer versions of
armasm64 implicitly convert ldr to ldur as necessary, but older
versions require it explicitly written out.

This fixes these build errors:

    ffmpeg\libavcodec\aarch64\vvc\inter.o.asm(2039) :
     error A2518: operand 2: Memory offset must be aligned
            ldr             s5, [x1, #1]
    ffmpeg\libavcodec\aarch64\vvc\inter.o.asm(2250) :
     error A2518: operand 2: Memory offset must be aligned
            ldr             d7, [x1, #2]

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-18 13:45:09 +02:00
Peter Ross
8272d34377 configure: add iso_writer golomb dependency
since commit fce0622d0b, libavformat/hevc.c
depends on golomb vlc tables.
2024-12-18 16:30:47 +11:00
David Rosca
d0facac679 lavc/vaapi_encode_h265: Use surface alignment
This is needed to correctly set conformance window crop with Mesa AMD.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-12-17 21:36:05 +01:00
David Rosca
bcfbf2bac8 lavc/vaapi_encode: Query surface alignment
It needs to create temporary config to query surface attribute.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-12-17 21:36:01 +01:00
Bin Peng
72a3656e84 lavc/aarch64: Fix ff_pred16x16_plane_neon_10
Fix test failure on aarch64:
./tests/checkasm/checkasm --test=h264pred 367840

Signed-off-by: Peng Bin <pengbin@visionular.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-17 14:50:29 +02:00
Bin Peng
decc9e643c lavc/aarch64: Fix ff_pred8x8_plane_neon_10
Fix test failure on aarch64:
./tests/checkasm/checkasm --test=h264pred 479612

The mismatch between neon and C functions can also be reproduced using the following bitstream and command line.

wget https://streams.videolan.org/ffmpeg/incoming/intra8x8pred_10bit.264
 ./ffmpeg -cpuflags 0  -threads 1 -i intra8x8pred_10bit.264  -f framemd5 -y md5_ref
 ./ffmpeg              -threads 1 -i intra8x8pred_10bit.264  -f framemd5 -y md5_neon

Signed-off-by: Bin Peng <pengbin@visionular.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-17 14:50:29 +02:00
Zhao Zhili
7b0bd6c4a7 avutil/vulkan_glslang: Fix build failure
compile_only isn't available until 13.1.0. Let default initialization set
it to zero, so the code works with version before and after 13.1.0.
2024-12-17 19:28:35 +09:00
Rémi Denis-Courmont
bd226fdd74 lavc/h264dsp: R-V V intra loop filter
As with the inter loop filter, performance metrics seem to be biased in
favour of the C implementation because checkasm inputs almost always
fall in the no-op case.

h264_h_loop_filter_chroma_intra_8bpp_c:                 82.8 ( 1.00x)
h264_h_loop_filter_chroma_intra_8bpp_rvv_i32:           72.6 ( 1.14x)
h264_h_loop_filter_chroma_mbaff_intra_8bpp_c:           41.1 ( 1.00x)
h264_h_loop_filter_chroma_mbaff_intra_8bpp_rvv_i32:     72.6 ( 0.57x)
h264_h_loop_filter_luma_intra_8bpp_c:                  166.1 ( 1.00x)
h264_h_loop_filter_luma_intra_8bpp_rvv_i32:            395.4 ( 0.42x)
h264_h_loop_filter_luma_mbaff_intra_8bpp_c:             93.3 ( 1.00x)
h264_h_loop_filter_luma_mbaff_intra_8bpp_rvv_i32:      395.4 ( 0.24x)
h264_v_loop_filter_chroma_intra_8bpp_c:                134.8 ( 1.00x)
h264_v_loop_filter_chroma_intra_8bpp_rvv_i32:           51.6 ( 2.61x)
h264_v_loop_filter_luma_intra_8bpp_c:                  468.1 ( 1.00x)
h264_v_loop_filter_luma_intra_8bpp_rvv_i32:            134.8 ( 3.47x)
2024-12-17 09:00:28 +02:00
sunyuechi
16d4945e9a lavc/vvc_mc R-V V sad
k230               banana_f3
sad_8x16_c:                 387.7 ( 1.00x)    394.9 ( 1.00x)
sad_8x16_rvv_i32:           109.7 ( 3.53x)    103.5 ( 3.82x)
sad_16x8_c:                 378.2 ( 1.00x)    384.7 ( 1.00x)
sad_16x8_rvv_i32:            82.0 ( 4.61x)    61.7 ( 6.24x)
sad_16x16_c:                748.7 ( 1.00x)    759.7 ( 1.00x)
sad_16x16_rvv_i32:          128.5 ( 5.83x)    113.7 ( 6.68x)
2024-12-17 09:21:20 +08:00
sunyuechi
b3f7440298 lavc/hevc: R-V V put_pixels(pow2)
k230               banana_f3
put_hevc_pel_pixels4_8_c:               61.6 ( 1.00x)    69.5 ( 1.00x)
put_hevc_pel_pixels4_8_rvv_i32:         24.6 ( 2.50x)    28.0 ( 2.48x)
put_hevc_pel_pixels8_8_c:              209.8 ( 1.00x)    215.5 ( 1.00x)
put_hevc_pel_pixels8_8_rvv_i32:         52.6 ( 3.99x)    38.2 ( 5.64x)
put_hevc_pel_pixels16_8_c:             839.4 ( 1.00x)    830.0 ( 1.00x)
put_hevc_pel_pixels16_8_rvv_i32:       126.6 ( 6.63x)    90.5 ( 9.17x)
put_hevc_pel_pixels32_8_c:            3246.6 ( 1.00x)    3246.7 ( 1.00x)
put_hevc_pel_pixels32_8_rvv_i32:       311.6 (10.42x)    257.0 (12.63x)
put_hevc_pel_pixels64_8_c:           12894.6 ( 1.00x)    12892.7 ( 1.00x)
put_hevc_pel_pixels64_8_rvv_i32:      1135.8 (11.35x)    778.0 (16.57x)
2024-12-17 09:21:20 +08:00
sunyuechi
dad062c4f8 lavc/vvc_mc: R-V V put_pixels
k230               banana_f3
put_chroma_pixels_8_4x4_c:                              63.5 ( 1.00x)    59.2 ( 1.00x)
put_chroma_pixels_8_4x4_rvv_i32:                        26.5 ( 2.39x)    28.0 ( 2.12x)
put_chroma_pixels_8_8x8_c:                             211.8 ( 1.00x)    215.5 ( 1.00x)
put_chroma_pixels_8_8x8_rvv_i32:                        54.3 ( 3.90x)    48.8 ( 4.42x)
put_chroma_pixels_8_16x16_c:                           841.3 ( 1.00x)    830.0 ( 1.00x)
put_chroma_pixels_8_16x16_rvv_i32:                     137.5 ( 6.12x)    121.8 ( 6.82x)
put_chroma_pixels_8_32x32_c:                          3248.8 ( 1.00x)    3288.2 ( 1.00x)
put_chroma_pixels_8_32x32_rvv_i32:                     350.5 ( 9.27x)    288.5 (11.40x)
put_chroma_pixels_8_64x64_c:                         12998.3 ( 1.00x)    12976.2 ( 1.00x)
put_chroma_pixels_8_64x64_rvv_i32:                    1100.5 (11.81x)    924.0 (14.04x)
put_chroma_pixels_8_128x128_c:                       54284.0 ( 1.00x)    52654.5 ( 1.00x)
put_chroma_pixels_8_128x128_rvv_i32:                  7192.8 ( 7.55x)    2934.2 (17.94x)
put_luma_pixels_8_4x4_c:                                63.5 ( 1.00x)    69.5 ( 1.00x)
put_luma_pixels_8_4x4_rvv_i32:                          26.5 ( 2.39x)    28.0 ( 2.48x)
put_luma_pixels_8_8x8_c:                               211.5 ( 1.00x)    225.8 ( 1.00x)
put_luma_pixels_8_8x8_rvv_i32:                          54.3 ( 3.90x)    38.5 ( 5.86x)
put_luma_pixels_8_16x16_c:                             850.5 ( 1.00x)    830.0 ( 1.00x)
put_luma_pixels_8_16x16_rvv_i32:                       137.5 ( 6.18x)    100.8 ( 8.24x)
put_luma_pixels_8_32x32_c:                            3248.8 ( 1.00x)    3257.2 ( 1.00x)
put_luma_pixels_8_32x32_rvv_i32:                       341.3 ( 9.52x)    246.8 (13.20x)
put_luma_pixels_8_64x64_c:                           13007.5 ( 1.00x)    13038.8 ( 1.00x)
put_luma_pixels_8_64x64_rvv_i32:                      1119.0 (11.62x)    684.2 (19.06x)
put_luma_pixels_8_128x128_c:                         54219.3 ( 1.00x)    52060.8 ( 1.00x)
put_luma_pixels_8_128x128_rvv_i32:                    6813.5 ( 7.96x)    2548.8 (20.43x)
2024-12-17 09:21:20 +08:00
sunyuechi
9288196c0d lavc/riscv: Move VVC macro to h26x 2024-12-17 09:21:20 +08:00
sunyuechi
89df9c4404 lavc/vvc_mc: R-V V dmvr
k230               banana_f3
dmvr_8_12x20_c:                       619.3 ( 1.00x)    624.1 ( 1.00x)
dmvr_8_12x20_rvv_i32:                 128.6 ( 4.82x)    103.4 ( 6.04x)
dmvr_8_20x12_c:                       610.0 ( 1.00x)    665.6 ( 1.00x)
dmvr_8_20x12_rvv_i32:                 137.6 ( 4.44x)    92.9 ( 7.17x)
dmvr_8_20x20_c:                      1008.0 ( 1.00x)    1082.7 ( 1.00x)
dmvr_8_20x20_rvv_i32:                 221.1 ( 4.56x)    155.4 ( 6.97x)
dmvr_h_8_12x20_c:                    2008.0 ( 1.00x)    2009.7 ( 1.00x)
dmvr_h_8_12x20_rvv_i32:               239.6 ( 8.38x)    186.7 (10.77x)
dmvr_h_8_20x12_c:                    1989.5 ( 1.00x)    2009.4 ( 1.00x)
dmvr_h_8_20x12_rvv_i32:               230.3 ( 8.64x)    155.4 (12.93x)
dmvr_h_8_20x20_c:                    3304.1 ( 1.00x)    3342.9 ( 1.00x)
dmvr_h_8_20x20_rvv_i32:               378.3 ( 8.73x)    248.9 (13.43x)
dmvr_hv_8_12x20_c:                   3609.8 ( 1.00x)    3603.4 ( 1.00x)
dmvr_hv_8_12x20_rvv_i32:              369.1 ( 9.78x)    322.1 (11.19x)
dmvr_hv_8_20x12_c:                   3628.3 ( 1.00x)    3624.2 ( 1.00x)
dmvr_hv_8_20x12_rvv_i32:              322.8 (11.24x)    238.7 (15.19x)
dmvr_hv_8_20x20_c:                   5933.8 ( 1.00x)    5936.6 ( 1.00x)
dmvr_hv_8_20x20_rvv_i32:              526.5 (11.27x)    374.1 (15.87x)
dmvr_v_8_12x20_c:                    2156.3 ( 1.00x)    2155.4 ( 1.00x)
dmvr_v_8_12x20_rvv_i32:               239.6 ( 9.00x)    176.2 (12.24x)
dmvr_v_8_20x12_c:                    2137.6 ( 1.00x)    2165.9 ( 1.00x)
dmvr_v_8_20x12_rvv_i32:               230.3 ( 9.28x)    155.2 (13.96x)
dmvr_v_8_20x20_c:                    4183.8 ( 1.00x)    3592.9 ( 1.00x)
dmvr_v_8_20x20_rvv_i32:               369.3 (11.33x)    249.2 (14.42x)
2024-12-17 09:21:20 +08:00
sunyuechi
b86766d610 Update R-V V vvc_mc vset to support more lengths 2024-12-17 09:21:20 +08:00
Tong Wu
715a35dadb d3d12va_encode_hevc: use base to init VPS/SPS/PPS
This commit uses hw_base_encode_h265 to generate the VPS/SPS/PPS.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-12-16 22:07:12 +08:00
Niklas Haas
ce457bfccd swscale/slice: fix init of 32 bpc planes
In input.c and output.c and many other places, swscale follows the rule of using
15-bit intermediate if output bpc is <= 8, and 19-bit (inside int32_t)
intermediate otherwise. See e.g. the comments on hyScale() on
swscale_internal.h. These are also the coefficients that yuv2gbrpf32_full_X_c()
is using.

In contrast to this, the plane init code in slice.c (function fill_ones) is
assuming that we use 35-bit intermediates (inside 64-bit integers) for this
case, seemingly added by commit b4967fc71c with
no further justification.

This causes a mismatch whenever the implicitly initialized plane contents leak
out to the output, e.g. when converting from grayscale to RGB.

Fixes: ticket #10716
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-16 12:21:55 +01:00
Anton Khirnov
d2096679d5 compat/w32pthreads: change pthread_t into pointer to malloced struct
pthread_t is currently defined as a struct, which gets placed into
caller's memory and filled by pthread_create() (which accepts a
pthread_t*).

The problem with this approach is that pthread_join() accepts pthread_t
itself rather than a pointer to it, so it gets a _copy_ of this
structure. This causes non-deterministic failures of pthread_join() to
produce the correct return value - depending on whether the thread
already finished before pthread_join() is called (and thus the copy
contains the correct value), or not (then it contains 0).

Change the definition of pthread_t into a pointer to a struct, that gets
malloced by pthread_create() and freed by pthread_join().

Fixes random failures of fate-ffmpeg-error-rate-fail on Windows after
433cf391f5.

See also [1] for an alternative approach that does not require dynamic
allocation, but relies on an assumption that the pthread_t value
remains in a fixed memory location.

[1] 23829dd2b2

Reviewed-By: Martin Storsjö <martin@martin.st>
2024-12-16 09:43:19 +01:00
Timo Rothenpieler
17e4746687 avcodec/libx265: add alpha layer encoding support 2024-12-16 00:50:52 +01:00
Timo Rothenpieler
fce0622d0b avformat/hevc: add support for writing alpha layer 2024-12-16 00:50:52 +01:00
James Almer
fb5e8ea971 avformat/iamf_parse: fix setting duration for the last subblock in a parameter definition
When subblock durations are constant, the last block may be smaller and the
value needs to be calculated.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-15 20:41:05 -03:00
James Almer
d38fc25519 avformat/iamf_parse: add checks to parameter definition durations
Section 3.6.1 of the IAMF spec states "When constant_subblock_duration is equal to 0, the summation of all
subblock_duration in this parameter block SHALL be equal to duration.".

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-15 20:37:39 -03:00
Anton Khirnov
8ad34e97b6 fftools/sync_queue: switch from AVFifo+ObjPool to AVContainerFifo
Remove now-unused objpool.
2024-12-15 14:05:34 +01:00
Anton Khirnov
8e0cceffa0 fftools/thread_queue: switch from AVFifo+ObjPool to AVContainerFifo
The queue needs to track each frame/packet's stream index, this is
achieved by maintaining a parallel AVFifo instance for that purpose.
This is simpler than implementing custom AVContainerFifo callbacks.
2024-12-15 14:05:34 +01:00
Anton Khirnov
2ac34d0854 lavc/packet: add API for an AVPacket-based AVContainerFifo 2024-12-15 14:05:33 +01:00
Anton Khirnov
2e956d9c0f lavc/container_fifo: move to lavu and make public
This can be useful in other places, e.g. it can replace objpool in
fftools.

The API is modified in the following nontrivial ways:
* opaque pointers can be passed through to all user callbacks
* read and write were previously separate callbacks in order to
  accomodate the caller wishing to write a new reference to the FIFO and
  keep the original one; the two callbacks are now merged into one, and
  a flags argument is added that allows to request such behaviour on a
  per-call basis
* new peek and drain functions
2024-12-15 14:05:15 +01:00
Anton Khirnov
56ba57b672 lavc/refstruct: move to lavu and make public
It is highly versatile and generally useful.
2024-12-15 14:03:47 +01:00
Anton Khirnov
183c59b473 lavc: improve AVCodecContext.extradata/subtitle_header documentation
Mention they are always owned and freed by the codec, except when using
deprecated avcodec_close().

Reported-By: DEATH on IRC
2024-12-15 14:02:40 +01:00
Kacper Michajłow
92deed9732 avutil/file: fix av_file_map file mapping on Windows
This makes the behavior of av_file_map() the same on Windows as it is on
other platforms. The file is opened as read-only, but the mapping is
copy-on-write, allowing the user to write to the memory pages returned
by av_file_map().

This commit fixes libavutil\tests\file.c test, which would crash when
trying to write to a read-only memory page.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-12-15 14:02:29 +01:00
Marth64
90af8e07b0 fftools/ffprobe: add analyze_frames option for CC and grain detection
Currently, ffprobe has two stream-level fields that do not work,
closed_captions and film_grain).

Their value is always 0 because ffprobe cannot access the internal
codec properties when it is setting up its stream contexts.

In this commit, add the new option -analyze_frames to ffprobe,
allowing the user to read frames up to the interval they have defined
and fill these fields based on what is exposed in AVPacketSideData.

Additionally, in the same commit, don't write these fields to
the output unless analyze_frames is enabled. Finally, fix the
FATE test refs accordingly and update the docs.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-13 22:41:31 -06:00
Marth64
8291aedf1a avformat/mov: don't reallocate extradata when converting dvdsub palette
After introduction of ff_dvdclut_palette_extradata_cat() to convert
DVD subtitle palettes from YUV to RGB, a leak is introduced because
of the call to ff_alloc_extradata(). This is not necessary, instead
we should free the extradata because ff_bprint_to_codecpar_extradata()
will finalize the bprint'ed string to the codecpar and set the length.

Fixes leak introduced in 3b0e6c0ecc.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-13 22:41:18 -06:00
James Almer
b164dea68c fate/iamf: add a test for expanded layouts
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:36:10 -03:00
James Almer
2d33f66f9a avformat/iamfdec: don't set individual streams as dependent
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:36:10 -03:00
James Almer
cc9843dc33 avformat/iamf_writer: add support for expanded channel layouts
Defined in Immersive Audio Model and Formats 1.1.0, sections 3.6.2 and 3.7.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:36:10 -03:00
James Almer
d255f90242 avformat/iamf_parse: add support for expanded channel layouts
Defined in Immersive Audio Model and Formats 1.1.0, sections 3.6.2 and 3.7.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:36:10 -03:00
James Almer
21d3dab31c avutil/channel_layout: simplify the 22.2 layout definition
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:36:10 -03:00
James Almer
6eb4bf04e9 avutil/channel_layout: add a 9.1.6 layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:35:47 -03:00
Martin Storsjö
eb79c316c7 fate: Add a dependency on ffprobe for fate-flcl1905
This fixes occasional failed tests, if doing "make fate" without a
regular "make" or "make all" inbetween.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-13 09:48:17 +02:00
Michael Niedermayer
a518b5540d avcodec/aac/aacdec_usac: Dont leave type at a invalid value
Fixes: Assertion 0 failed at libavcodec/aac/aacdec_usac.c:1646
Fixes: 70541/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5190889543106560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-11 21:56:13 +01:00
Michael Niedermayer
682d710bcb avcodec/aac/aacdec_usac: Clean ics2->max_sfb when first SCE fails
Fixes: out of array access
Fixes: 70734/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4741427068731392
Fixes: 383194070/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5302387708854272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-11 21:55:40 +01:00
Martin Storsjö
1e76bd2f39 fate: Add a target for listing failed tests
If running tests with "make -j<N> fate", the execution will stop
after the first failing test. To get an overview of the whole
test suite, one rather would run "make -k -j<N> fate", which then
again buries the results about what tests actually failed further
up in the console log.

Add a target so one can run "make fate-list-failing", to see a list
of all tests that failed the last time they were executed.

Also add a companion target "fate-clear-reports" which removes all
the old test reports. (When executing a subset of tests, the report
files of all tests that aren't executed stay untouched. This also
allows getting rid of reports for tests that no longer are present
in the testsuite.)

Co-authored-by: Alexander Strasser <eclipse7@gmx.net>

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-11 14:10:22 +02:00
Martin Storsjö
4b524649ff checkasm: Print benchmarks of C-only functions
This corresponds to commit 9278a14cf406f8edb5052c42b83750112bf5b515
in dav1d.

Omitting the C-only functions doesn't speed up benchmarking
anyway (as those has to be benchmarked before we know if we have
any corresponding assembly functions), and being able to benchmark
those functions without corresponding assembly can be valuable in
a number of cases.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-11 10:51:15 +02:00
Niklas Haas
ee903c4786 tests/swscale: fix sscanf return value check
We only parse 12 values, so this check always failed. Regression caused by
a change to the print format.

Fixes: 59c39a79ca
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-11 09:10:45 +01:00
Peter Ross
8cab5bdc69 configure: add leaddec blockdsp dependency 2024-12-11 07:52:25 +11:00
Peter Ross
983ec12a99 avcodec/leaddec: support format 0x6
Fixes ticket #10657.
2024-12-11 07:52:22 +11:00
sunyuechi
2dc864eb4e lavc/rv40dsp: fix RISC-V chroma_mc
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-12-10 11:24:45 -05:00
sunyuechi
82da769492 checkasm/rv40dsp: cover more cases
Co-Authored-By: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-12-10 11:24:45 -05:00
Zhao Zhili
40feba5f77 aarch64/vvc: Fix clip in alf
Fix test failure:
./tests/checkasm/checkasm --test=vvc_alf 3607569773
2024-12-10 21:00:47 +08:00
Zhao Zhili
91436638de aarch64/vvc: Use faster clip operation
Replace sqxtn+smin+smax by sqxtun+umin.
2024-12-10 21:00:47 +08:00
Zhao Zhili
bfed5f6b7d aarch64/vvc: Reuse ff_vvc_put_pel_pixels for chroma 2024-12-10 21:00:47 +08:00
Frank Plowman
8629306627 lavc/vvc: Fix scaling matrix DC coef derivation
In 7.4.3.20 of H.266 (V3), there are two similarly-named variables:
scalingMatrixDcPred and ScalingMatrixDcRec.  The old code set
ScalingMatrixDcRec, rather than scalingMatrixDcPred, in the first two
branches of the conditions on scaling_list_copy_mode_flag[id] and
aps->scaling_list_pred_mode_flag[id].  This could lead to decode
mismatches in sequences with explicitly-signalled scaling lists.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-12-10 20:26:12 +08:00
Martin Storsjö
47b1e1bd84 checkasm: vvc: Use checkasm_check for printing failing output
Share the checkasm_check_pixel macro from hevc_pel in checkasm.h,
to allow other tests to use the same. (To use it in other tests,
those tests need to have a similar setup for high bitdepth pixels,
with a local variable named "bit_depth".)

This simplifies the code for checking the output, and can print
the failing output (including a map of matching/mismatching
elements) if checkasm is run with the -v/--verbose option.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-10 11:26:09 +02:00
Zhao Zhili
4a2fb1781c avcodec/mediacodecenc: Check fifo write result and simplify fifo operation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
2024-12-10 15:16:07 +08:00
Leo Izen
c1e3d55f99 avcodec/png{dec,enc}: update mDCV and cLLI chunk capitalization
The PNGv3 Specification Draft [1] has changed the capitalization
of mDCV and cLLI chunks (formerly mDCv and cLLi). This patch updates
FFmpeg to work with the new chunk names while retaining decode-side
compatibility with files created using the old names.

[1]: https://w3c.github.io/png/

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-12-09 15:16:59 -05:00
Manuel Lauss
d21134313f avformat/smush: read ANIMv2 a/v parameters
SMUSH ANIM files with subversion 2 provide additional fields for
framerate and samplerate, use them if available, otherwise
default to 12 fps which is the default for almost all ANIMv2
since 1995.

Fixes the too-fast playback of test files from LucasArts games
released 1995-1997.  It was not noticed since Audio for
those isn't decoded by ffmpeg.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-12-09 02:05:18 +01:00
Marth64
3b0e6c0ecc avformat/mov: use dvdclut for YUV to RGB conversion of DVD subtitle palettes
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-08 16:30:17 -06:00
James Almer
e2953fedf9 avformat/hevc: also print NALU ids
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-08 19:13:34 -03:00
James Almer
68ee3faf48 avformat/hevc: add a log context to ff_isom_write_{hvcc,lhvc}
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-08 19:12:19 -03:00
llyyr
550c662a1f avformat/mpegts: correctly skip TP_extra_header in m2ts
instead of just resyncing and skipping a bunch of TS packets, leading to
a loss of frames.

Before this, a stray byte with the value of 0x47 in TP_extra_header
would throw off the detection of where TS packets start.

A typical file that could cause issues would look like this:

    00000300: 238f 4780 4750 1110 0000 01e0 0000 84c0
                   ^^   ^^
The first four bytes here are TP_extra_header and the actual TS packet
starts at offset 0x304

FFmpeg would try to read a packet at 0x300 but since nothing skips the
4 byte TP_extra_header, find that the first byte is not 0x47 and
immediately go into mpegts_resync, and incorrectly detect the stray 0x47
in the TP_extra_header at 0x302 as the new sync byte.

Fix this by correctly skipping the first 4 bytes if the source packet
is 192 bytes.

Signed-off-by: llyyr <llyyr.public@gmail.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2024-12-08 10:54:26 +01:00
Osamu Watanabe
c893dcce31 avcodec/jpeg2000: Fix undefined behaviour in left shift operations
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-12-07 15:41:30 -08:00
Paul B Mahol
8050a7955e avformat/mm: fix packets pts generation and add seek support
Signed-off-by: Peter Ross <pross@xvid.org>
2024-12-08 09:32:35 +11:00
Kacper Michajłow
7902702762 avfilter/af_ashowinfo: fix scaling factor of replaygain peak values
Commit 8542f9c4f1 changed replaygain peak
values to use 100k instead of UINT32_MAX as peak, with possibility of
overflow. af_ashowinfo was never updated to reflect this, so we update
it now.

Fixes: 8542f9c4f1
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2024-12-07 12:03:53 -05:00
Hendrik Leppkes
5215ec677c avutil/tests/color_utils: reduce accuracy threshold to pass to 1e-7
Fixes FATE on a variety of configurations due to accuracy problems in
floating point math. Most constants tested against here are not even
specified with 7 decimal digits.

Reviewed-by: Niklas Haas <git@haasn.dev>
2024-12-07 14:51:49 +01:00
Frank Plowman
34c6ad0a07 lavc/vvc: Use a bitfield to store MIP information
Reduces memory consumption by ~4MB for 1080p video with a maximum delay
of 16 frames by packing various information related to MIP:
* intra_mip_flag, 1 bit
* intra_mip_transposed_flag, 1 bit
* intra_mip_mode, 4 bits
Into a single byte.

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-12-07 17:37:45 +08:00
Gyan Doshi
914f89dbc6 avformat/movenc: log stream index for invalid pkt duration 2024-12-07 10:07:35 +05:30
Zhao Zhili
018ec4fe5f tests/checkasm: Simplify logic for WASI signal handling
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Martin Storsjö <martin@martin.st>
2024-12-06 10:48:11 +08:00
Ramiro Polla
ca889b1328 swscale/aarch64: add neon {lum,chr}ConvertRange16
aarch64 A55:
chrRangeFromJpeg16_1920_c:    32684.2
chrRangeFromJpeg16_1920_neon:  8431.2 (3.88x)
chrRangeToJpeg16_1920_c:      24996.8
chrRangeToJpeg16_1920_neon:    9395.0 (2.66x)
lumRangeFromJpeg16_1920_c:    17305.2
lumRangeFromJpeg16_1920_neon:  4586.5 (3.77x)
lumRangeToJpeg16_1920_c:      21144.8
lumRangeToJpeg16_1920_neon:    5069.8 (4.17x)

aarch64 A76:
chrRangeFromJpeg16_1920_c:    11523.8
chrRangeFromJpeg16_1920_neon:  3367.5 (3.42x)
chrRangeToJpeg16_1920_c:      11655.2
chrRangeToJpeg16_1920_neon:    4087.2 (2.85x)
lumRangeFromJpeg16_1920_c:     5762.0
lumRangeFromJpeg16_1920_neon:  1815.8 (3.17x)
lumRangeToJpeg16_1920_c:       5946.2
lumRangeToJpeg16_1920_neon:    2148.2 (2.77x)
2024-12-05 21:10:29 +01:00
Ramiro Polla
87052c0933 swscale/x86: add sse4 and avx2 {lum,chr}ConvertRange16
chrRangeFromJpeg16_1920_c:    3153.9
chrRangeFromJpeg16_1920_sse4: 1770.0 (1.78x)
chrRangeFromJpeg16_1920_avx2:  891.5 (3.54x)
chrRangeToJpeg16_1920_c:      3165.0
chrRangeToJpeg16_1920_sse4:   1953.2 (1.62x)
chrRangeToJpeg16_1920_avx2:    973.0 (3.25x)
lumRangeFromJpeg16_1920_c:    1298.5
lumRangeFromJpeg16_1920_sse4:  886.5 (1.46x)
lumRangeFromJpeg16_1920_avx2:  447.7 (2.90x)
lumRangeToJpeg16_1920_c:      1905.0
lumRangeToJpeg16_1920_sse4:    993.0 (1.92x)
lumRangeToJpeg16_1920_avx2:    498.9 (3.82x)
2024-12-05 21:10:29 +01:00
Ramiro Polla
6fe4a4ffb6 swscale/aarch64/range_convert: update neon range_convert functions to new API
aarch64 A55:
chrRangeFromJpeg8_1920_c:    28835.2 (1.00x)
chrRangeFromJpeg8_1920_neon:  5313.9 (5.43x)  5308.4 (5.43x)
chrRangeToJpeg8_1920_c:      23074.7 (1.00x)
chrRangeToJpeg8_1920_neon:    5551.3 (4.16x)  5549.2 (4.16x)
lumRangeFromJpeg8_1920_c:    15389.7 (1.00x)
lumRangeFromJpeg8_1920_neon:  3152.3 (4.88x)  3147.7 (4.89x)
lumRangeToJpeg8_1920_c:      19227.8 (1.00x)
lumRangeToJpeg8_1920_neon:    3628.7 (5.30x)  3630.2 (5.30x)

aarch64 A76:
chrRangeFromJpeg8_1920_c:    6324.4 (1.00x)
chrRangeFromJpeg8_1920_neon: 2344.5 (2.70x) 2304.2 (2.74x)
chrRangeToJpeg8_1920_c:      9656.0 (1.00x)
chrRangeToJpeg8_1920_neon:   2824.2 (3.42x) 2794.2 (3.46x)
lumRangeFromJpeg8_1920_c:    4422.0 (1.00x)
lumRangeFromJpeg8_1920_neon: 1104.5 (4.00x) 1106.2 (4.00x)
lumRangeToJpeg8_1920_c:      5949.1 (1.00x)
lumRangeToJpeg8_1920_neon:   1329.8 (4.47x) 1328.2 (4.48x)
2024-12-05 21:10:29 +01:00
Ramiro Polla
be108ebcf4 swscale/x86/range_convert: update sse2 and avx2 range_convert functions to new API
chrRangeFromJpeg8_1920_c:    2127.4 (1.00x)
chrRangeFromJpeg8_1920_sse2:  816.0 (2.61x)  813.5 (2.62x)
chrRangeFromJpeg8_1920_avx2:  408.9 (5.20x)  405.4 (5.25x)
chrRangeToJpeg8_1920_c:      3166.9 (1.00x)
chrRangeToJpeg8_1920_sse2:    815.0 (3.89x)  815.0 (3.89x)
chrRangeToJpeg8_1920_avx2:    404.5 (7.83x)  405.5 (7.81x)
lumRangeFromJpeg8_1920_c:    1263.0 (1.00x)
lumRangeFromJpeg8_1920_sse2:  411.0 (3.07x)  413.2 (3.06x)
lumRangeFromJpeg8_1920_avx2:  200.5 (6.30x)  201.9 (6.26x)
lumRangeToJpeg8_1920_c:      1886.8 (1.00x)
lumRangeToJpeg8_1920_sse2:    412.0 (4.58x)  408.9 (4.61x)
lumRangeToJpeg8_1920_avx2:    208.5 (9.05x)  205.7 (9.17x)
2024-12-05 21:10:29 +01:00
Ramiro Polla
384fe39623 swscale/range_convert: fix mpeg ranges in yuv range conversion for non-8-bit pixel formats
There is an issue with the constants used in YUV to YUV range conversion,
where the upper bound is not respected when converting to mpeg range.

With this commit, the constants are calculated at runtime, depending on
the bit depth. This approach also allows us to more easily understand how
the constants are derived.

For bit depths <= 14, the number of fixed point bits has been set to 14
for all conversions, to simplify the code.
For bit depths > 14, the number of fixed points bits has been raised and
set to 18, to allow for the conversion to be accurate enough for the mpeg
range to be respected.

The convert functions now take the conversion constants (coeff and offset)
as function arguments.
For bit depths <= 14, coeff is unsigned 16-bit and offset is 32-bit.
For bit depths > 14, coeff is unsigned 32-bit and offset is 64-bit.

x86_64:
chrRangeFromJpeg8_1920_c:    2127.4   2125.0  (1.00x)
chrRangeFromJpeg16_1920_c:   2325.2   2127.2  (1.09x)
chrRangeToJpeg8_1920_c:      3166.9   3168.7  (1.00x)
chrRangeToJpeg16_1920_c:     2152.4   3164.8  (0.68x)
lumRangeFromJpeg8_1920_c:    1263.0   1302.5  (0.97x)
lumRangeFromJpeg16_1920_c:   1080.5   1299.2  (0.83x)
lumRangeToJpeg8_1920_c:      1886.8   2112.2  (0.89x)
lumRangeToJpeg16_1920_c:     1077.0   1906.5  (0.56x)

aarch64 A55:
chrRangeFromJpeg8_1920_c:   28835.2  28835.6  (1.00x)
chrRangeFromJpeg16_1920_c:  28839.8  32680.8  (0.88x)
chrRangeToJpeg8_1920_c:     23074.7  23075.4  (1.00x)
chrRangeToJpeg16_1920_c:    17318.9  24996.0  (0.69x)
lumRangeFromJpeg8_1920_c:   15389.7  15384.5  (1.00x)
lumRangeFromJpeg16_1920_c:  15388.2  17306.7  (0.89x)
lumRangeToJpeg8_1920_c:     19227.8  19226.6  (1.00x)
lumRangeToJpeg16_1920_c:    15387.0  21146.3  (0.73x)

aarch64 A76:
chrRangeFromJpeg8_1920_c:    6324.4   6268.1  (1.01x)
chrRangeFromJpeg16_1920_c:   6339.9  11521.5  (0.55x)
chrRangeToJpeg8_1920_c:      9656.0   9612.8  (1.00x)
chrRangeToJpeg16_1920_c:     6340.4  11651.8  (0.54x)
lumRangeFromJpeg8_1920_c:    4422.0   4420.8  (1.00x)
lumRangeFromJpeg16_1920_c:   4420.9   5762.0  (0.77x)
lumRangeToJpeg8_1920_c:      5949.1   5977.5  (1.00x)
lumRangeToJpeg16_1920_c:     4446.8   5946.2  (0.75x)

NOTE: all simd optimizations for range_convert have been disabled.
      they will be re-enabled when they are fixed for each architecture.

NOTE2: the same issue still exists in rgb2yuv conversions, which is not
       addressed in this commit.
2024-12-05 21:10:29 +01:00
Ramiro Polla
58bcdeb742 swscale/aarch64/range_convert: saturate output instead of limiting input
aarch64 A55:
chrRangeFromJpeg8_1920_c:    28836.2 (1.00x)
chrRangeFromJpeg8_1920_neon:  5312.6 (5.43x)  5313.9 (5.43x)
chrRangeToJpeg8_1920_c:      44196.2 (1.00x)
chrRangeToJpeg8_1920_neon:    6034.6 (7.32x)  5551.3 (7.96x)
lumRangeFromJpeg8_1920_c:    15388.5 (1.00x)
lumRangeFromJpeg8_1920_neon:  3150.7 (4.88x)  3152.3 (4.88x)
lumRangeToJpeg8_1920_c:      23069.7 (1.00x)
lumRangeToJpeg8_1920_neon:    3873.2 (5.96x)  3628.7 (6.36x)

aarch64 A76:
chrRangeFromJpeg8_1920_c:     6334.7 (1.00x)
chrRangeFromJpeg8_1920_neon:  2264.5 (2.80x)  2344.5 (2.70x)
chrRangeToJpeg8_1920_c:      11474.5 (1.00x)
chrRangeToJpeg8_1920_neon:    2646.5 (4.34x)  2824.2 (4.06x)
lumRangeFromJpeg8_1920_c:     4453.2 (1.00x)
lumRangeFromJpeg8_1920_neon:  1104.8 (4.03x)  1104.5 (4.03x)
lumRangeToJpeg8_1920_c:       6645.0 (1.00x)
lumRangeToJpeg8_1920_neon:    1310.5 (5.07x)  1329.8 (5.00x)
2024-12-05 21:10:29 +01:00
Ramiro Polla
2d1358a84d swscale/range_convert: saturate output instead of limiting input
For bit depths <= 14, the result is saturated to 15 bits.
For bit depths > 14, the result is saturated to 19 bits.

x86_64:
chrRangeFromJpeg8_1920_c:    2126.5   2127.4  (1.00x)
chrRangeFromJpeg16_1920_c:   2331.4   2325.2  (1.00x)
chrRangeToJpeg8_1920_c:      3163.0   3166.9  (1.00x)
chrRangeToJpeg16_1920_c:     3163.7   2152.4  (1.47x)
lumRangeFromJpeg8_1920_c:    1262.2   1263.0  (1.00x)
lumRangeFromJpeg16_1920_c:   1079.5   1080.5  (1.00x)
lumRangeToJpeg8_1920_c:      1860.5   1886.8  (0.99x)
lumRangeToJpeg16_1920_c:     1910.2   1077.0  (1.77x)

aarch64 A55:
chrRangeFromJpeg8_1920_c:   28836.2  28835.2  (1.00x)
chrRangeFromJpeg16_1920_c:  28840.1  28839.8  (1.00x)
chrRangeToJpeg8_1920_c:     44196.2  23074.7  (1.92x)
chrRangeToJpeg16_1920_c:    36527.3  17318.9  (2.11x)
lumRangeFromJpeg8_1920_c:   15388.5  15389.7  (1.00x)
lumRangeFromJpeg16_1920_c:  15389.3  15388.2  (1.00x)
lumRangeToJpeg8_1920_c:     23069.7  19227.8  (1.20x)
lumRangeToJpeg16_1920_c:    19227.8  15387.0  (1.25x)

aarch64 A76:
chrRangeFromJpeg8_1920_c:    6334.7   6324.4  (1.00x)
chrRangeFromJpeg16_1920_c:   6336.0   6339.9  (1.00x)
chrRangeToJpeg8_1920_c:     11474.5   9656.0  (1.19x)
chrRangeToJpeg16_1920_c:     9640.5   6340.4  (1.52x)
lumRangeFromJpeg8_1920_c:    4453.2   4422.0  (1.01x)
lumRangeFromJpeg16_1920_c:   4414.2   4420.9  (1.00x)
lumRangeToJpeg8_1920_c:      6645.0   5949.1  (1.12x)
lumRangeToJpeg16_1920_c:     6005.2   4446.8  (1.35x)

NOTE: all simd optimizations for range_convert have been disabled
      except for x86, which already had the same behaviour.
      they will be re-enabled when they are fixed for each architecture.
2024-12-05 21:10:29 +01:00
Ramiro Polla
536a44e8dc checkasm/sw_range_convert: test negative input values 2024-12-05 21:10:29 +01:00
Malek Assaad
6a108d4759 avformat/mov: add support for pssh box
* Enable PSSH box writing to mov & moof.
* Enable senc, saio & saiz writing to moof when writing fragments.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-05 14:22:16 -03:00
Niklas Haas
7b73ea501d avutil/tests/color_utils: add tests for av_csp_itu_eotf 2024-12-05 12:27:33 +01:00
Niklas Haas
06f084468e avutil/csp: add EOTF function definitions
The existing av_csp_trc_func_from_id() mostly implements the OETF, except for
PQ. As such, we are currently missing a precise definition of an ITU-R EOTF.
Introduce the new functions av_csp_itu_eotf() and av_csp_itu_eotf_inv(), to fill
this void. Note that this is not possible in all cases, e.g. AVCOL_TRC_LOG which
has no corresponding EOTF definition in any ITU-R standard.

Note that we cannot implement the proper HLG and SMPTE 428 OOTFs without access
to all three color channels, because they are not independent per channel. As a
result, we need to define them on double[3] instead of double (*func)(double).
2024-12-05 12:27:32 +01:00
Niklas Haas
bf0a6c4111 avutil/csp: add av_csp_trc_inv_from_id()
Mathematical inverse of av_csp_trc_from_id(), plus testing to make sure it
roundtrips correctly with the corresponding TRC.
2024-12-05 12:26:49 +01:00
Niklas Haas
28f217780b avutil/tests/color_utils: clean up slightly (cosmetic)
Rewrite this test slightly to fix the formatting, improve the readability of
the output, and eliminate some unnecessary branching.
2024-12-05 11:51:18 +01:00
Niklas Haas
feb5982f43 avutil/csp: eliminate redundant branch 2024-12-05 11:51:18 +01:00
Niklas Haas
ec0489e35c avutil/csp: fix documentation of av_csp_trc_function
This explanation was inaccurate and highly misleading. The new wording is taken
more or less directly from ITU-T H.273, and also matches my understanding of
these functions.
2024-12-05 11:51:18 +01:00
Niklas Haas
2f95bc3cb3 swscale/utils: disable full_chr_h_input optimization for odd width
The basic problem here is that the rgb*ToUV_half_* functions hard-code a
bilinear downsample from src[i] + src[i+1], with no bounds check on the i+1
access.

Due to the signature of the function, we cannot easily plumb the "true" width
into the function body to perform a bounds check. Similarly, we cannot easily
pre-pad the input because it is typically reading from the (const) input
frame, which would require a full memcpy to pad. Either of these solutions are
more trouble than the feature is worth, so just disable it on odd input sizes.

Fixes: use of uninitialized value
Fixes: ticket #11265
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-04 11:38:47 +01:00
Niklas Haas
79452d382f swscale/graph: fix memleak of cascaded graphs
Just free them directly and discard the parent context.

Fixes: bf738412e8
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: Sovereign Tech Fund
2024-12-04 11:38:30 +01:00
Zhao Zhili
40302cc35b avcodec/hevc: Add wasm simd128 idct
Benchmark with wasmtime:
wasmtime checkasm --test=hevc_idct --benchmark

hevc_idct_4x4_8_c:                                      20.8 ( 1.00x)
hevc_idct_4x4_8_simd128:                                10.2 ( 2.02x)
hevc_idct_4x4_10_c:                                     21.0 ( 1.00x)
hevc_idct_4x4_10_simd128:                               10.2 ( 2.05x)
hevc_idct_8x8_8_c:                                     198.0 ( 1.00x)
hevc_idct_8x8_8_simd128:                                41.5 ( 4.77x)
hevc_idct_8x8_10_c:                                    197.8 ( 1.00x)
hevc_idct_8x8_10_simd128:                               41.8 ( 4.74x)
hevc_idct_16x16_8_c:                                  1385.2 ( 1.00x)
hevc_idct_16x16_8_simd128:                             291.8 ( 4.75x)
hevc_idct_16x16_10_c:                                 1375.0 ( 1.00x)
hevc_idct_16x16_10_simd128:                            281.2 ( 4.89x)
hevc_idct_32x32_8_c:                                 13479.0 ( 1.00x)
hevc_idct_32x32_8_simd128:                            1541.5 ( 8.74x)
hevc_idct_32x32_10_c:                                13448.0 ( 1.00x)
hevc_idct_32x32_10_simd128:                           1541.5 ( 8.72x)

Decoding test:

1. Without the optimization:
$ wasmtime --wasi threads --dir=/ ./ffmpeg -cpuflags 0 -i 265.mp4 -an -t 120 -f null - -benchmark
frame= 2880 fps= 94 q=-0.0 Lsize=N/A time=00:02:00.00 bitrate=N/A speed=3.92x

2. With the optimization:
$ wasmtime --wasi threads --dir=/ ./ffmpeg -i 265.mp4 -an -t 120 -f null - -benchmark
frame= 2880 fps=110 q=-0.0 Lsize=N/A time=00:02:00.00 bitrate=N/A speed=4.58x

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-12-04 16:43:07 +08:00
Zhao Zhili
ea3d21c349 tests/checkasm: Add partial support for wasm
WASI mssing signal and siglongjmp support. This patch workaround
build error and add simd128 flag. Please note that many tests use
large array on stack, so you need to increase the stack size when
build checkasm, e.g., --extra-ldflags='-Wl,-z,stack-size=10485760'

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-12-04 16:43:07 +08:00
Zhao Zhili
2dc55f5993 configure: Add wasm as a fake arch
And add wasm simd128 flag, so we can add simd128 optimizations.
It can be enabled by put -msimd128 to extra cflags. There is
no runtime detection on simd128 support yet. I think that needs to
be done with JavaScript.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-12-04 16:43:06 +08:00
Michael Niedermayer
7c1e732ad2 avcodec/webp: Check ref_x/y
Fixes: 70991/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-5544067620995072
Fixes: use of uninintailized value

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-04 04:23:49 +01:00
Michael Niedermayer
4482218440 avcodec/ilbcdec: Initialize tempbuff2
Fixes: Use of uninitialized value
Fixes: 71350/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-6322020827070464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-04 04:23:49 +01:00
Michael Niedermayer
61cbcaf93f avcodec/rv60dec: Check qp for intra
The rv60_qp_to_idx table only supports qp up to 31 on intra

Fixes: global-buffer-overflow
Fixes: 377543818/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5160167345291264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-04 04:23:49 +01:00
Michael Niedermayer
559d435fa3 avcodec/ffv1enc: Add enum for qtable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-04 04:23:48 +01:00
Michael Niedermayer
d32dcc07a7 swscale/swscale_unscaled: Fix odd height with nv24_to_yuv420p_chroma()
Fixes: out of array read
Fixes: 71726/clusterfuzz-testcase-ffmpeg_SWS_fuzzer-5876893532880896
Fixes: 377735917/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6686071112400896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Approved-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-04 04:23:48 +01:00
Scott Theisen
5ba63f0ef1 avformat/mpegts: is_pes_stream() use switch case
also add STREAM_TYPE_PRIVATE_SECTION since a private_section() is not a
PES_packet().

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-12-03 23:09:58 +01:00
Scott Theisen
1259760825 avformat/mpegts*: reduce use of magic numbers
Note ISO/IEC 13818-1 defines an Extension_descriptor with descriptor_tag value
0x3f (63), so I kept the DVB comment.

I don't know what defines stream_type value 0x8a as DTS.

I don't have any Blu-ray standards so I don't know where those stream_type
values are defined.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-12-03 23:09:57 +01:00
Frank Plowman
56419fd096 lavc/vvc: Fix overflow in MVD derivation
H.266 (V3) section 7.4.12.8: "The value of lMvd[ compIdx ] shall be in
the range of −2^{17} to 2^{17} − 1, inclusive."

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-12-03 10:22:55 +08:00
Frank Plowman
499896ca2f lavc/vvc: Fix derivation of LmcsMaxBinIdx
Per H.266 (V3) section 7.4.3.19, LmcsMaxBinIdx is set equal to
15 - lmcs_delta_max_bin_idx.  The previous code instead had it equal to
15 - lmcs_min_bin_idx.  This could cause decoder mismatches.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-12-03 10:22:55 +08:00
Frank Plowman
699322519c lavc/vvc: Store MIP information over entire CU area
Previously, the code only stored the MIP mode and transpose flag in the
relevant tables at the top-left corner of the CU.  This information ends
up being retrieved in ff_vvc_intra_pred_* not based on the CU position
but instead the transform unit position (specifically, using the x0 and
y0 from get_luma_predict_unit).  There might be multiple transform units
in a CU, hence the top-left corner of the transform unit might not
coincide with the top-left corner of the CU.  Consequently, we need to
store the MIP information at all positions in the CU, not only its
top-left corner, as we already do for the MIP flag.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-12-03 10:20:51 +08:00
Frank Plowman
7399d9f374 lavc/vvc: Don't check motion estimation region for IBC
The final parameter of check_available determines whether the motion
estimation region constraints imposed in section 8.5.2.3 of H.266 (V3)
on MVP candidates apply to the current candidate or not.  In the case of
IBC spatial merge candidates they do not, as their availability is
dependent only on the criteria described in sections 8.6.2.3 and 6.4.4,
which do not include this constraint on the motion estimation region.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-12-03 10:20:51 +08:00
Frank Plowman
9221cb0443 lavc/vvc: Use second definition of MinQtLog2SizeIntraC if relevant
MinQtLog2SizeIntraC is usually (eq. (51) from VVCv3) defined as

sps_log2_diff_min_qt_min_cb_intra_slice_chroma + MinCbLog2SizeY

However, in the case ph_log2_diff_min_qt_min_cb_intra_slice_chroma is
present, it is instead (eq. (83) from VVCv3) defined as

ph_log2_diff_min_qt_min_cb_intra_slice_chroma + MinCbLog2SizeY

When ph_log2_diff_max_bt_min_qt_intra_slice_chroma and
ph_log2_diff_max_tt_min_qt_intra_slice_chroma are present, so is
ph_log2_diff_min_qt_min_cb_intra_slice_chroma, and so we should use the
second definition of MinQtLog2SizeIntraC, rather than the first, when
calculating the bounds for these syntax elements.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-12-03 10:20:51 +08:00
Alexander Strasser
a280e2e646 avcodec/cbs_h266: Fix typo
Introduced in commit 98698ed3c2

Fixes: CID1635788 CID1635789
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2024-12-03 10:19:34 +08:00
James Almer
cb27e478f7 doc/codecs: add missing enhancements value for export_side_data
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-02 12:53:54 -03:00
James Almer
d2c90abab7 doc/filters: add an entry for vf_lcevc
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-02 12:53:54 -03:00
Zhao Zhili
6e49b86996 avutil/mem_internal: Don't use alignas for MSVC
MSVC messed up standard C features, again.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: James Almer <jamrial@gmail.com>
2024-12-02 20:37:47 +08:00
Michael Niedermayer
4fc43e45f9 avcodec/hevc/hevcdec: initialize qp_y_tab
This does not replicate on my setup, thus this is a blind fix based on ossfuzz trace

Fixes: use of uninitialized value
Fixes: 71747/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5427736120721408

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:49 +01:00
Michael Niedermayer
f52b9d0583 avformat/qcp: Check for read failure in header
Fixes: Use of uninitialized value
Fixes: 71551/clusterfuzz-testcase-minimized-ffmpeg_dem_QCP_fuzzer-4647386712965120

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:48 +01:00
Michael Niedermayer
4949e34d96 avcodec/eatgq: Check bytestream2_get_buffer() for failure
Fixes: Use of uninitialized memory
Fixes: 71546/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EATGQ_fuzzer-5607656650244096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:48 +01:00
Michael Niedermayer
cdce6a8b97 avcodec/eatgq: move array to where it is used
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:48 +01:00
Michael Niedermayer
7e020f2141 avformat/dxa: check bpc
Fixes: integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 373971762/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-4880491112103936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:47 +01:00
Michael Niedermayer
aeec39f3c1 swscale/slice: clear allocated memory in alloc_lines()
Fixes: use of uninitialized memory in hScale16To15_c()
Fixes: 373924007/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5841199968092160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:47 +01:00
Michael Niedermayer
b2da4c33e3 avcodec/rangecoder: eliminate main branch from renorm_encoder()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:47 +01:00
Michael Niedermayer
18922f4ae3 avcodec/rangecoder: Remove unneeded outstanding byte mask
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:46 +01:00
Michael Niedermayer
70fa8bd38c avcodec/rangecoder: Avoid checking for the first byte on every renormalization
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:46 +01:00
Michael Niedermayer
832649986c avcodec/rangecoder: Move refill check out of refill() function
If the function is not inlined, this is more efficient. Also
it allows calling refill() without the check

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:46 +01:00
Michael Niedermayer
c314a68d04 avcodec/rangecoder: Do not loop renormalization
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:45 +01:00
Michael Niedermayer
360e7cafd0 avcodec/h2645_parse: Ignore NAL with nuh_layer_id == 63
Comply with "For purposes other than determining the amount of data in the decoding units
of the bitstream, decoders shall ignore all data that follow the value 63 for nuh_layer_id in a NAL unit"
Rec. ITU-T H.265 v8 (08/2021)	Page 67

Fixes: index 63 out of bounds for type 'const int8_t[63]' (aka 'const signed char[63]')
Fixes: clusterfuzz-testcase-fuzzer_loadfile-5109286752026624
Reported-by: Kacper Michajlow <kasper93@gmail.com>
Found-by: ossfuzz
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:45 +01:00
Michael Niedermayer
c250a903a7 doc/encoders: very basic FFv1 documentation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:44 +01:00
Sean McGovern
b9eaf6e05c swscale/ppc: disable YUV2RGB AltiVec acceleration
The FATE test 'checkasm-sw_yuv2rgb' currently fails on this platform,
in both little- and big-endian configurations with AltiVec enabled.

Disable it for the time being.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 02:51:39 +01:00
Michael Niedermayer
4cc1495aca avformat/iamf_parse: reject ambisonics mode > 1
ambisonics mode > 1 does not initialize any layer but layer 0
is unconditionally dereferenced

Fixes: poc-2024-11
Fixes: null pointer dereference
Found-by: 苏童 <220235212@seu.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 02:51:38 +01:00
Marth64
1c2c70fe4d doc/demuxers/dvdvideo: seeking is supported, remove outdated statement
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-01 13:49:01 -06:00
Marth64
e256761def avformat/dvdvideodec: check return code of ff_dvdclut_yuv_to_rgb()
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-01 13:48:51 -06:00
Marth64
a5a899bfcb avformat/dvdvideodec: fix missing last chapter marker due to off-by-one
When using fast chapter marker calculation (default), the last
marker is inadverdently ignored due to an off-by-one.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-01 13:48:45 -06:00
Frank Plowman
1e3dc705df lavc/x86/videodsp: Drop MMX usage
Remove the MMX versions of these functions and modify the SSE
implementations to avoid using MMX registers.

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-12-01 13:26:34 +08:00
Nuo Mi
4de67e8746 avcodec/vvcdec: return error if CTU size > 128
The v3 spec reserves CTU size 256. Currently, we use an uint8_t* table to hold cb_width and cb_height.
If a CTU size of 256 is not split, cb_width and cb_height will overflow to 0.
To avoid switching to uint16_t, rejecting CTU size 256 provides a simple solution.
2024-11-30 09:58:59 +08:00
Nuo Mi
eb67e60cb0 avcodec/vvcdec: schedule next stage only if the current stage reports no error
If the current stage reports an error, some variables may not be correctly initialized.
Scheduling the next stage could lead to the use of uninitialized variables.
2024-11-30 09:58:59 +08:00
Nuo Mi
4ec767abcc avcodec/vvcdec: misc, reformat inter_data() 2024-11-30 09:58:59 +08:00
Nuo Mi
ba89c5b989 avcodec/vvcdec: inter_data, check the return value from hls_merge_data
Reported-by: Frank Plowman <post@frankplowman.com>
2024-11-30 09:58:59 +08:00
Nuo Mi
98698ed3c2 avcodec/cbs_h266: stricter validation for subpicture's max width and height
Co-authored-by: Frank Plowman <post@frankplowman.com>
2024-11-30 09:58:59 +08:00
Nuo Mi
e06515b092 avcodec/cbs_h266: improve readability in subpicture parser 2024-11-30 09:58:59 +08:00
Nuo Mi
5c5a08ecb5 avcodec/vvcdec: ensure every CTU belongs to a slice
According to section 6.3.3 "Spatial or component-wise partitionings,"
CTUs should fully cover slices with no overlaps, gaps, or additions.
No overlaps are ensured by task_init_parse.
No gaps and no additions are ensured by this patch.

Co-authored-by: Frank Plowman <post@frankplowman.com>
2024-11-30 09:58:59 +08:00
Nuo Mi
46006529a1 avcodec/cbs_h266: check subpicture slices number
According to section 6.3.3, 'Spatial or component-wise partitionings,'
Subpictures must cover the entire picture.
Therefore, the total number of subpicture slices should equal the number of picture slices

Co-authored-by: Frank Plowman <post@frankplowman.com>
2024-11-30 09:58:59 +08:00
Marton Balint
4100a2da29 tests/fate/filter-audio: add aloop test
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:59:56 +01:00
Marton Balint
f5948543f4 fate: revert previous frequency adjustments of the sine filter
With more precise frequency support in the sine filter, several fate tests will
change.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:16:22 +01:00
Marton Balint
8d6f3bcb96 avfilter/asrc_sine: increase frequency accuracy
Previously the delta phase was fixed point fractional with 2^32 fractions,
which caused inaccuracies in the output frequency, unless the input
frequency*2^32 was divisable by the sample rate.

This patch improves frequency accuracy by tracking subfractions of the delta
phase fractions. For this we are using a denominator which is a multiple of the
sample rate, making sure that integer frequencies are always accurately
represented.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:16:22 +01:00
Marton Balint
06247ae746 avfilter/asrc_sine: factorize sampling to a separate context
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:16:22 +01:00
Marton Balint
6189cb47fc fate: adjust frequencies of the sine filter
The filter currently uses inaccurate frequencies, this is in preparation for
fixing that, by using numbers that will map to the equivalent value in the
future code.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-29 21:15:22 +01:00
Zhao Zhili
59057aa807 avutil/mem_internal: local align should always work
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-29 12:33:03 +08:00
Zhao Zhili
57861911a3 avutil/mem_internal: define DECLARE_ALIGNED as C11's alignas
alignas is portable than compiler's specific __attribute__. It do
have a limitation, that alignas don't support specify aligment on
the declarations of struct (it works for specify alignment on struct
fields), which only used by avcodec/cavs, and is removed now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-29 12:32:57 +08:00
Zhao Zhili
fe2c9746de avcodec/cavs: Limit align requirement to variable than type
There are another three cavs_vector variables, ff_cavs_dir_mv,
ff_cavs_intra_mv and un_mv. They don't need align to 8.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-29 12:32:50 +08:00
Zhao Zhili
82c208b653 avfilter/textutils: Add missing time_internal.h
This fix build error on Windows with MSVC. We need time_internal.h
for gmtime_r and localtime_r.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-29 12:30:48 +08:00
Michael Niedermayer
f57f2a356d doc/infra: List at what companies the name servers are hosted and who provides the servers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-28 23:19:00 +01:00
Michael Niedermayer
e531b3ff27 MAINTAINERS: Lauri is still available but is really low on time nowadays
CC: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-28 23:19:00 +01:00
Anton Khirnov
3bfb6061fb tools/general_assembly: exclude Derek from GA emails
At his own request, he can remove the entry whenever he likes.
2024-11-28 15:51:37 +01:00
Anton Khirnov
9cb8928d69 tools/general_assembly: add a mechanism for excluding people from GA list
To be used at their own request, when they do not wish to receive vote
emails.
2024-11-28 15:51:37 +01:00
Manuel Lauss
a786dd4889 libavcodec/sanm: codec47: apply top offset also to diff buffers
SAN FRME objects specify width/height as well as offsets from top/left.
These offsets need to be taken into account for the diff buffers
as well.  Fixes playback of all SAN videos of "Shadows of the Empire",
which have a constant top offset of 60 (640x272 video on a 640x480 window)
and show tons of ghosting and block artifacts.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-11-28 14:39:19 +01:00
Manuel Lauss
dc98e7989d libavcodec/sanm: clear codec47 diff buffers with specific color
The codec47 header provides colors to use to clear the
2 difference buffers. This fixes artifacts (black hair, faces) in
Curse of Monkey Island "CURSERNG.SAN" video.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-11-28 14:39:06 +01:00
Manuel Lauss
85fec8d90f libavcodec/sanm: fix XPAL handling
Outlaws' RAE.SAN file did not properly fade out in certain scenes,
but simply turned to black as soon as the first XPAL chunk with
the apply command was encountered.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-11-28 14:31:20 +01:00
Manuel Lauss
1e2a72ae1d libavcodec/sanm: add codec47 interpolation table support
Some codec47 frames come with an interpolation table:
Combining 2 adjacent pixels into a 16bit value, this value can
then be used as index into the interpolation table to get a new
pixel value.  This is used for subcodec 1, which encodes a key-
frame at half width and height, and makes these frame less blocky
appearing.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-11-28 14:31:15 +01:00
Nicolas Gaullier
44d32c8a23 avcodec/ac3dec: fix build when eac3 decoder is disabled
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-11-28 14:15:50 +01:00
gnattu via ffmpeg-devel
248832dd5b avcodec/bsf/dovi_rpu: remove EL when stripping dovi metadata
When RPU is removed EL should also be removed. This only applies to
HEVC as AV1 based Profile 10 does not support EL at all.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-11-28 14:15:50 +01:00
Fei Wang
bc991ca048 lavfi/qsvvpp: Copy frame props before modify it
The changes to output frame props in query_frame overlapped since
578ac59887. Move the copy frame props before the changes.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-28 11:13:25 +08:00
IndecisiveTurtle
351fd8460a vulkan/common: Add put_bytes_count 2024-11-28 10:03:01 +09:00
IndecisiveTurtle
e3ac63b213 vulkan/common: Use u32vec2 buffer type instead of u64
According to the GL_EXT_buffer_reference spec alignment
"must be a power of two and be greater than or equal to the largest scalar/component type in the block."

This means by using u32vec2 we can drop the requirement alignment from 8 bytes to 4 bytes
and save a pack64 call in reverse8 (though I assume in most ISAs that compiles to nothing)

Allows the vc2 vulkan encoder to function without setting PB_UNALIGNED
2024-11-28 09:31:43 +09:00
IndecisiveTurtle
f794ed48c0 vulkan/common: Fix off-by-one error in flush_put_bits
If caller wrote a divisible by eight number of bits it would write an extra byte.
Also increment by to_write instead of BUF_BYTES which overly pads the bitstream.
2024-11-28 09:31:43 +09:00
Ramiro Polla
4e1a91112d tests/fate/filter-video: don't convert owdenoise test to mpeg range 2024-11-28 00:58:21 +01:00
Lynne
187fd52864 vulkan: fix use of atomics for the current context index
The code used to use atomic, but over time, this got broken.
This commit also remmoves the is-the-last-submission-ready
shortcut, which rarely did anything.
There's also value in relying on the fact that contexts
always carry their frames in a strictly incremental order
with no gaps.
2024-11-28 01:29:21 +09:00
Lynne
41f65b7326 vulkan_decode: ensure there's at least one context per decode thread
Otherwise, what may happen is that 2 threads will both write
into the same context.
2024-11-28 01:29:21 +09:00
Lynne
a5e6860a89 vulkan_decode: fix counting for parallelism
ff_vk_exec_pool_init used to multiply the number by
the number of queues, but that got changed, yet this use
of the function was not updated.
2024-11-28 01:29:15 +09:00
Scott Theisen
78c4d6c136 libavcodec/mpeg12dec.c: support DVB CC format 0x0502 in user_data
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-26 19:50:59 -06:00
Marth64
084d3515ca avformat/libssh: fix credential variables typo
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-26 19:50:49 -06:00
Lynne
d4966f0a74 ffv1enc_vulkan: limit parallelism based on VRAM, fallback to host memory 2024-11-26 14:14:16 +01:00
Lynne
5effac3b02 ffv1enc: expose ff_ffv1_encode_buffer_size
The function is quite important to ensure that the output
is always going to be sufficient, and it can change version to
version, so exposing it makes sense.
2024-11-26 14:14:15 +01:00
Lynne
d8f301cdf2 ffv1enc_vulkan: switch to receive_packet
This allows the encoder to fully saturate all queues the GPU
has, giving a good 10% in certain cases and resolutions.

This also improves error resilience if an allocation fails,
and properly cleans up after itself if it does.
2024-11-26 14:14:15 +01:00
Lynne
4fefc6e80c ffv1enc_vulkan: remove arbitrary limitation of the number of slices 2024-11-26 14:14:15 +01:00
Lynne
ce8a070cf3 vulkan: only wait for fences on uninit if the context had a submission
This fixes a potential deadlock on exit.
2024-11-26 14:14:14 +01:00
Lynne
86e552506d vulkan: zero out AVBufferRef in case of failure
This resulted in uninit errors and was never caught as
we generally did not use massive allocations before.
2024-11-26 14:14:14 +01:00
Lynne
f582de8f34 vulkan: only apply shortcut for next context selection if selection has a submission 2024-11-26 14:14:14 +01:00
Lynne
8ac49ae9e0 vulkan: add opaque field to execution contexts
Helps keep track of what dispatch happened where.
2024-11-26 14:14:14 +01:00
Lynne
d485420237 hwcontext_vulkan: take disable_multiplane into account when checking for formats 2024-11-26 14:14:13 +01:00
Lynne
cf0961a527 hwcontext_vulkan: require storage properties to claim formats as supported
This function dates back a long time ago, before vkfmt_from_pixfmt2.
When it was converted over, the thought was that this was far too
restrictive to demand storage images for each format.
With the new clever function, it makes sure to check that the compatible
subformats a format can be used as support storage capabilities.

This gets rid of fake support for RGB48/RGB96 which some implementations
offer but don't support using as storage images.
2024-11-26 14:14:13 +01:00
Lynne
f65e51293a hwcontext_vulkan: add support for AV_PIX_FMT_GBRAP10/12/14 2024-11-26 14:14:13 +01:00
Lynne
7c52dda55f hwcontext_vulkan: add support for AV_PIX_FMT_GBRP12/14/16 2024-11-26 14:14:12 +01:00
Lynne
08fb505a66 hwcontext_vulkan: add support for AV_PIX_FMT_GRAY10/12/14 2024-11-26 14:14:07 +01:00
Koushik Dutta
ac3f69a4b9 avfilter/scale_vt: implement frame crop
The crop filter has no effect on scale_vt:

-vf crop=100:100,scale_vt=300x300

Hardware frames (AV_PIX_FMT_FLAG_HWACCEL) are expected to use the crop_* properties,
as seen in the implementation vf_crop.c.

Signed-off-by: Koushik Dutta <koushd@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-26 11:54:28 +08:00
Koushik Dutta
352333543c avfilter/scale_vt: implement negative width/height aspect ratio sizing
Signed-off-by: Koushik Dutta <koushd@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-26 11:26:38 +08:00
Sean McGovern
7104818066 libavcodec: various: remove empty directories originally for legacy DSP code
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-26 11:26:11 +08:00
Marton Balint
1402a2ac3b avcodec/dnxuc_parser: rework DNXUC parser
The current parser does things which a parser should not, like skipping parts
of the packet header, but it does not actually able to packetize a raw DNXUC
bitstream.

Rework the parser logic to work similar to other parsers and be able to
correctly packetize raw DNXUC bitstreams.

Bump minor version because the DNXUC codec packet format changes with this.
Normally this would be a breaking change, but in this particular case it should
not cause any issues in practice because the DNXUC codec is relatively new and
we never added a decoder for it.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-25 22:16:34 +01:00
Marton Balint
aea63ea7f5 avformat/framecrc: add AVFMT_NODIMENSIONS flag
Framecrc does not need frame dimensions to work correctly.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-25 22:16:34 +01:00
J. Dekker
d89fbfd4df avcodec: deprecate sonic
This is an experimental and research codec of which ffmpeg is the only
encoder and decoder, development has stalled since 2013 and these files
don't exist in the wild.

Deprecate the encoders to be removed next major bump, decoders to be
removed one bump afterwards. We also disable the the encoders by default
in configure, the decoders should be disabled by default next bump.

Signed-off-by: J. Dekker <jdek@itanimul.li>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2024-11-25 14:34:55 -05:00
James Almer
19f7dae81a avformat/mov: add missing stts array syncing in mov_build_index
Also fix checks for sc->stts_count that assume it may not be in sync with
sample count.
Missed in 865c73c86f. Fixes parsing durations in
some cases.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-25 14:40:15 -03:00
James Almer
0e07a70611 avcodec/ac3dec: fix downmix logic for eac3
Ensure downmixed is only set once during init, as it used to be.

Fixes a regression since acbb2777e2.
Fixes ticket #11321

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-25 14:40:15 -03:00
Rémi Denis-Courmont
f8e91ab05f lavc/h264idct: fix compilation for RV32IMA 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
f2b945147d lavc/vp8dsp: fix compilation for RV32IMA 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
d3acffae7a lavc/pixblockdsp: fix compilation for RV32IMA 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
63922ba5dc lavu/float_dsp: fix compilation with RISC-V ILP32 ABI 2024-11-25 19:29:21 +02:00
Rémi Denis-Courmont
da1ab7940e riscv: remove unnecessary #include's 2024-11-25 19:29:21 +02:00
Marvin Scholz
51a20517d2 doc: add styles for good/bad code examples
Makes it easier to immediately see if the code examples given in the
style documentation are good or bad examples, making it harder to
accidentally confuse a bad example for a good one.
2024-11-25 17:17:57 +01:00
Marvin Scholz
9cdd3cbe9b doc/developer: add examples to clarify code style
Given the frequency that new developers, myself included, get the
code style wrong, it is useful to add some examples to clarify how
things should be done.
2024-11-25 17:17:56 +01:00
Marvin Scholz
83c1c622a5 MAINTAINERS: Add myself as Darwin maintainer
I do some development and usage of FFmpeg regularly on macOS and sent
some patches to fix issues specific to Darwin in the past so I think it
makes sense to add myself as maintainer so people know they can ping me
if required, for Darwin specific issues/testing.

I have both Intel and Apple Silicon (aarch64) machines as well as older
Macs for testing on older macOS versions if necessary.
2024-11-25 17:16:39 +01:00
Marvin Scholz
6b9f4f36f7 swscale/internal: fix typo in loongarch specific code
Regression from 2d077f9acd
2024-11-25 17:15:00 +01:00
Niklas Haas
bcbf3a5630 avfilter/vf_scale: fix off-by-one in loop bounds
Results in over-read of the array. Fortunately, the excess element was
never actually used, but it still triggers ASAN (and could in theory trigger
a segfault).

Fixes: 04ce01df0b
2024-11-25 14:40:49 +01:00
Leo Izen
3c3bf6c109 MAINTAINERS: list csp.c and csp.h maintainers
Ronald S. Bultje wrote most of the code before there was a refactor
and condense (which I mostly wrote). As such, listing both him and myself
as maintainers of csp.h and csp.h, which previously had no maintainer
listed at all (after conferring on IRC).

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-11-25 07:13:44 -05:00
Niklas Haas
04ce01df0b avfilter/vf_scale: switch to new swscale API
Most logic from this filter has been co-opted into swscale itself,
allowing the resulting filter to be substantially simpler as it no
longer has to worry about context initialization, interlacing, etc.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:54 +01:00
Niklas Haas
3edd1e42b9 tests/swscale: add a benchmarking mode
With the ability to set the thread count as well. This benchmark includes
the constant overhead of context initialization.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:54 +01:00
Niklas Haas
59c39a79ca tests/swscale: rewrite on top of new API
This rewrite cleans up the code to use AVFrames and the new swscale API. The
log format has also been simplified and expanded to account for the new
options. (Not yet implemented)

The self testing code path has also been expanded to test the new swscale
implementation against the old one, to serve as an unchanging reference. This
does not accomplish much yet, but serves as a framework for future work.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:54 +01:00
Niklas Haas
2a091d4f2e swscale: introduce new, dynamic scaling API
As part of a larger, ongoing effort to modernize and partially rewrite
libswscale, it was decided and generally agreed upon to introduce a new
public API for libswscale. This API is designed to be less stateful, more
explicitly defined, and considerably easier to use than the existing one.

Most of the API work has been already accomplished in the previous commits,
this commit merely introduces the ability to use sws_scale_frame()
dynamically, without prior sws_init_context() calls. Instead, the new API
takes frame properties from the frames themselves, and the implementation is
based on the new SwsGraph API, which we simply reinitialize as needed.

This high-level wrapper also recreates the logic that used to live inside
vf_scale for scaling interlaced frames, enabling it to be reused more easily
by end users.

Finally, this function is designed to simply copy refs directly when nothing
needs to be done, substantially improving throughput of the noop fast path.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:50 +01:00
Niklas Haas
bf738412e8 swscale/graph: add new high-level scaler dispatch mechanism
This interface has been designed from the ground up to serve as a new
framework for dispatching various scaling operations at a high level. This
will eventually replace the old ad-hoc system of using cascaded contexts,
as well as allowing us to plug in more dynamic scaling passes requiring
intermediate steps, such as colorspace conversions, etc.

The starter implementation merely piggybacks off the existing sws_init() and
sws_scale(), functions, though it does bring the immediate improvement of
splitting up cascaded functions and pre/post conversion functions into
separate filter passes, which allows them to e.g. be executed in parallel
even when the main scaler is required to be single threaded. Additionally,
a dedicated (multi-threaded) noop memcpy pass substantially improves
throughput of that fast path.

Follow-up commits will eventually expand this to move all of the scaling
decision logic into the graph init function, and also eliminate some of the
current special cases.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:02:16 +01:00
Niklas Haas
c461dcf291 swscale/internal: expose sws_init_single_context() internally
Used by the graph API swscale wrapper, for now.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:02:16 +01:00
Niklas Haas
fb16964009 swscale: organize and better document flags
Group them into an enum rather than random #defines, and document their
behavior a bit more obviously.

Of particular note, I discovered that SWS_DIRECT_BGR is not referenced
anywhere else in the code base. As such, I have moved it to the deprecated
section, alongside SWS_ERROR_DIFFUSION.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:02:12 +01:00
Niklas Haas
6a91a165fd swscale: eliminate redundant SwsInternal accesses
This is a purely cosmetic commit aimed at replacing accesses to
SwsInternal.opts by direct access to SwsContext wherever convenient.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 10:59:52 +01:00
Niklas Haas
ed5dd67562 swscale: expose SwsContext publicly
Following in the footsteps of the work in the previous commit, it's now
relatively straightforward to expose the options struct publicly as
SwsContext. This is a step towards making this more user friendly, as
well as following API conventions established elsewhere.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 10:59:49 +01:00
Peter Ross
4472dec51d avformat/mm: add fallthrough comment
Fixes CID 1634888
2024-11-25 17:58:30 +11:00
Anton Khirnov
433cf391f5 fftools/ffmpeg_sched: signal the main thread when a task fails
Avoids a useless -stats_period wait before exiting.

Reported-by: names_are_hard
2024-11-25 05:26:49 +01:00
Anton Khirnov
785ffe67c8 fftools/ffmpeg_sched: rename mux_done_{lock,cond} into finish_*
Their semantics will be changed in the following commit to not be
limited to muxing.
2024-11-25 05:26:49 +01:00
Michael Niedermayer
224b62489d MAINTAINERS: Remove Guillaume Poirier and Romain Dolbeau
Guillaume no longer has a PPC
Romain has no time

CC: Guillaume POIRIER <poirierg@gmail.com>
CC: Romain Dolbeau <romain@dolbeau.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-25 03:13:33 +01:00
Michael Niedermayer
6d8285633d avcodec/mjpegdec: Disallow progressive bayer images
Fixes: Null pointer dereference
Fixes: sample1.dng
Found-by: South East <8billion.people@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-25 03:13:33 +01:00
Michael Niedermayer
84569b6c22 avformat/icodec: fix integer overflow with nb_pal
Fixes: runtime error: signed integer overflow
Fixes: 42536949/clusterfuzz-testcase-minimized-fuzzer_loadfile-6199846684393472
Found-by: ossfuzz
Reported-by: Kacper Michajlow
Tested-by: Kacper Michajlow
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-25 03:13:33 +01:00
James Almer
40bd6d8355 avcodec/codec_desc: remove Intra Only prop for AAC
xHE-AAC is a profile where some frames depend on other key frames, named IPF.
By setting the codec as Intra Only, all frames output by decoders and all
packets output by encoders/demuxers will be unconditionally flaged as
keyframes, which is incorrect.

Should fix ticket #11272.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:38:15 -03:00
James Almer
8d2d2519e0 avcodec/mediacodecdec: set set keyframe flag in output frames
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:38:15 -03:00
James Almer
99f87251e0 avcodec/libfdk-aacenc: set keyframe in output packets
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:38:04 -03:00
James Almer
281b7fc02e avcodec/libfdk-aacdec: set keyframe flag and profile in output frames
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:50 -03:00
James Almer
495c891e39 avcodec/audiotoolboxnec: set set keyframe flag in output packets
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:36 -03:00
James Almer
d3dd14bf5b avcodec/audiotoolboxdec: set set keyframe flag in output frames
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:36 -03:00
James Almer
ffdace5ad4 avcodec/aacenc: set keyframe flag in output packets
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:32 -03:00
James Almer
faea08b722 avcodec/aac/aacdec: set keyframe flag in output frames
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:26 -03:00
James Almer
64bb91fd3b avcodec/aac_parser: set key_frame and profile
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:24 -03:00
James Almer
8ddbc26ded avformat/mov: don't unconditionally set all audio packets in fragments as key frames
Some audio codecs, like TrueHD, have non key frames.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:24 -03:00
James Almer
f656c00bd9 avformat/matroskadec: set all frames in a keyframe simple box as keyframes
And not just the first, as it was being done for lacing. The spec states that the
flag applies to everything inside the simple box.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:26:17 -03:00
James Almer
f938b2b3f5 avformat/test/movenc: set audio packets as key frames
Don't depend on the generic code setting this.
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:14:11 -03:00
James Almer
23a1c021f2 avformat/movenc: write stss boxes for xHE-AAC
This is in preparation for a following change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:14:11 -03:00
James Almer
4e6d31755b avformat/spdifdec: parse headers for audio codecs
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-24 20:14:11 -03:00
Marvin Scholz
ecb7232bac avfilter: fix unused variable warning
The ctxi_dst variable is unused outside of the av_assert1,
causing an unused variable warning. The simplest solution
for this is to avoid the intermediate variable here.
2024-11-24 22:11:12 +01:00
James Almer
ecc7d5db9c avformat/movenc: don't disable edit lists when writing CMAF output
They are needed for audio tracks with priming samples, where negative CTS
offsets can't be used.

Fixes ticket #11031.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 20:50:05 -03:00
Darren Mo
865c73c86f avformat/mov: Populate packet duration using stts atom instead of guessing
Fixes tickets #7855 and #11312.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 20:50:05 -03:00
James Almer
b328bf8f7e avformat/mov: rename MOVCtts.duration to offset
The value is a timestamp offset, not a duration.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 20:50:05 -03:00
Scott Theisen
0dceced45c avformat/mpegts: add DVB descriptor_tag values already in use
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-22 21:11:18 +01:00
James Almer
46c6ca3ed1 avcodec/libfdk-aacenc: export CPB properties
Needed to signal the muxer that the stream is VBR.

Finishes fixing ticket #11303.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:57:03 -03:00
James Almer
944212acad avformat/movenc: don't write a calculated avgBitrate when the provided one is unset
avgBitrate == 0 is used to signal a VBR track, so if that value is propagated by an
encoder, don't overwrite it with a calculated value based on track size.

Part of a fix for ticket #11303.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:57:03 -03:00
James Almer
5813e5aa34 avformat/hevc: fix writing hvcC when no arrays are provided in hvcC-formatted input
Don't reject extradata with missing PS NALUs if array_completeness is not
requested.

Fixes a regression since a696b28886.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:52:31 -03:00
James Almer
f0051604c7 avformat/movenc: don't write PS NALUs in hvcC for codec tag hvc1
array_completeness shall be 1 for those tracks.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:49:32 -03:00
Pavel Koshevoy
46cb7b8d9d avutil/frame: also align data pointers in av_frame_get_buffer()
This avoids unpleasant surprises to av_frame_get_buffer callers
that explicitly specified 64-byte alignment and didn't get
AVFrame.data pointers that are 64-byte aligned.

For example, see https://github.com/sekrit-twc/zimg/issues/212

Although the zscale issue has already been resolved by other means
it would still be prudent to improve the behavior of av_frame_get_buffer
to fix any unknown and future instances of similar issues.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
James Almer
ea91d978e3 avutil/frame: fix setting plane_padding
STRIDE_ALIGN is a lavc define and is not necessarely 32. And align may be <= 0 at the
point plane_padding is being set.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
James Almer
09122bd15c avutil/frame: use size_t for total_size in get_video_buffer()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
Niklas Haas
2d077f9acd swscale/internal: group user-facing options together
This is a preliminary step to separating these into a new struct. This
commit contains no functional changes, it is a pure search-and-replace.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-21 12:49:56 +01:00
Niklas Haas
10d1be2621 swscale/internal: use static_assert for enforcing offsets
Instead of sprinkling av_assert0 into random init functions.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-21 12:47:43 +01:00
Niklas Haas
55d5eae411 swscale/options: cosmetic changes
Reorganize the list, fix whitespace, make indentation consistent, and
rename some descriptions for clarity, consistency or informativeness.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-21 12:47:14 +01:00
Peter Ross
f298507323 avcodec/mm: decode raw chunk type and skip unknown audio chunk type 2024-11-21 19:41:12 +11:00
Peter Ross
66124bc368 avcodec/mm: don't fail if x offset exceeds frame width 2024-11-21 19:41:12 +11:00
Peter Ross
63ea1660fa avcodec/mm: decode partial palette 2024-11-21 19:41:12 +11:00
Peter Ross
ac2442f0a7 avcodec/mm: set audio pts proportionally to audio offset 2024-11-21 19:41:12 +11:00
Marth64
3528bfed45 avformat/smoothstreamingenc: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block.

Reviewed-by: ePirat <epirat07@gmail.com>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-20 23:36:13 -06:00
Scott Theisen
be784e95ac avformat/mpegts: add support for ATSC E-AC-3 streams
ATSC A/52:2018 Digital Audio Compression (AC-3, E-AC-3), Annex G
defines stream_type 0x87 for E-AC-3 bit streams.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-21 00:59:09 +01:00
Michael Niedermayer
7051825b01 doc/developer: Document relationship between git accounts and MAINTAINERS
This should have been documented long ago and i thought it was

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:14 +01:00
Michael Niedermayer
edc4855f77 doc/infra: Document trac backup system
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:13 +01:00
Michael Niedermayer
8a21d8baf9 doc/infra: clarify domain name servers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:13 +01:00
Richard Mitic
67c2f80d2c libaformat/mp3dec: Register the MIME type "audio/mpeg" to the mp3 decoder.
Some mp3 files look surprisingly like mpeg PS streams. In order for us
to hint to ffmpeg that the file really is mp3, we can deliver it with a
mime type. The mp3 probe therefore needs to have a mime type registered,
(which is previously did not).
2024-11-20 15:48:19 +01:00
Zhao Zhili
05e079c948 avcodec/mediacodecenc: add async mode support
It has better performance than poll in a loop.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:23:51 +08:00
Zhao Zhili
9aacbfb6ca avcodec/mediacodec_wrapper: add async mode support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:23:13 +08:00
Zhao Zhili
fa2ff5effc avcodec/mediacodecenc: Add operating_rate option
For example, with
./ffmpeg -operating_rate 400 -hwaccel mediacodec -i test.mp4 -an \
  -c:v h264_mediacodec -operating_rate 400 -b:v 5M -f null -
The transcoding speed is 254 FPS.
Without -operating_rate on dec/enc, the speed is 148 FPS.
With -operating_rate on decoder only, the speed is 239 FPS.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:22:58 +08:00
Zhao Zhili
46ad1abd36 avcodec/mediacodecdec: Add operating_rate option
The codec wants to know whether the usecase is realtime playback
or full-speed transcoding, or playback at a higher speed. The codec
runs faster when operating_rate higher than framerate.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:20:59 +08:00
Zhao Zhili
a8375346eb fftools/ffplay_renderer: Fix a typo
The typo has no real effect except confusing.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reported-by: Chen Haibo
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-11-20 19:17:37 +08:00
Lynne
aad40fed33 vulkan: fix sw_frame_deps counter
The code used as a basis was the buffer dependency code, where the
counter was incremented after each buffer, but for the sw_frame dep
API, we only support adding individual frames at a time.
2024-11-20 05:47:41 +01:00
Lynne
4d3e96c90c lavc/vulkan/common: fix reverse4's incorrect swizzle
The function is responsible for converting little to big endian.
It had an incorrect swizzle for the last 2 bytes.
2024-11-20 05:23:36 +01:00
Lynne
9691ac6af2 ffv1enc_vulkan: increase max outstanding byte count to 16bit
The issue is that at higher resolutions, the outstanding byte counter
overflowed in case the image had a lot of blank areas.
2024-11-20 05:23:35 +01:00
Lynne
ebf5264c93 ffv1enc_vulkan: fix PCM encoding
This line was mysteriously deleted.
2024-11-20 05:23:35 +01:00
Lynne
eb536d97a0 ffv1enc_vulkan: support buffers larger than 4GiB
Unlike the software FFv1 encoder, none of our buffers are allocated by
FFmpeg, which supports at most 4GiB large allocations.

For really large sizes, the maximum size of the buffer can exceed 4GiB,
which the software encoder optimistically tries to allocate as 4GiB
in the hopes that the encoder will compress to under that amount.

We can just let Vulkan allocate us a larger buffer, and switch to
64-bit offsets.
2024-11-20 05:23:05 +01:00
Leandro Santiago
69cbda5770 lavfi/vf_drawtext: fix memory management when destroying font face
Ref https://trac.ffmpeg.org/ticket/11152

According to harfbuzz docs, hb_ft_font_set_funcs() does not need to be
called, as, quoted:

```
An #hb_font_t object created with hb_ft_font_create()
is preconfigured for FreeType font functions and does not
require this function to be used.
```

Using this function seems to cause memory management issues between
harfbuzz and freetype, and could be eliminated.

This commit also call hb_ft_font_changed() when the underlying FC_Face
changes size, as stated on hardbuzz:

```
HarfBuzz also provides a utility function called hb_ft_font_changed() that you should call
whenever you have altered the properties of your underlying FT_Face, as well as a hb_ft_get_face()
that you can call on an hb_font_t font object to fetch its underlying FT_Face.
```

Finally, the execution order between hb_font_destroy() and
hb_buffer_destroy() is flipped to match the order of creation of
the respective objects.

Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-19 23:50:49 +01:00
James Almer
9d8f7bf4b8 tests/checkasm/diracdsp: fix alignment for src and ombc_weight buffers
They are supposed to be 16 byte aligned, not 8.
Should fix crashes in some systems.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-19 12:32:49 -03:00
Eugene Zemtsov
e9c3698ed2 avcodec/decode: Fix incorrect enum type used in side_data_map()
It's AVPacketSideDataType, not AVFrameSideDataType.

Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-18 15:55:57 -06:00
James Almer
d6b39373a2 avcodec/ffv1enc: restore header writing behavior for version > 1
Broken by accident in a6c58353ac.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-18 18:21:54 -03:00
Brad Smith
f3eca3f387 libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv
libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv

FreeBSD/OpenBSD riscv have elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-11-18 22:09:07 +02:00
Rémi Denis-Courmont
607d4cca8e riscv/h264dsp: remove spurious instruction 2024-11-18 22:02:19 +02:00
Lynne
66093c5b94 ffv1enc_vulkan: restrict number of execution contexts to 1
This only leads to wasting memory in a single-threaded operation.
Limit this to 1 for now and leave a comment.
2024-11-18 20:04:24 +01:00
Rémi Denis-Courmont
b75dff0e20 lavc/h264dsp: fix R-V V weight_pixels pointer arithmetic
As of 459a1512f1,
the code is unrolled to process two rows per iteration.
The output cursor thus needs to be incremented by twice the
stride, which is taken care of with SH1ADD. However the original
ADD from the original implemetation was incorrectly left over.
2024-11-18 20:04:58 +02:00
Rémi Denis-Courmont
e29432e6bb lavu/riscv: fix compilation without Vector support
The half-baked assembler in Clang 16 and earlier can't process our
RISC-V assembler. This adds yet another work around that.

If you must use Clang, please use version 17 or later.
2024-11-18 20:04:38 +02:00
Lynne
970d57988d lavc: bump minor version for FFv1 Vulkan encoder 2024-11-18 08:00:26 +01:00
Lynne
ed2391d341 ffv1enc: add a Vulkan encoder
This commit implements a standard, compliant, version 3 and version 4
FFv1 encoder, entirely in Vulkan. The encoder is written in standard
GLSL and requires a Vulkan 1.3 supporting GPU with the BDA extension.

The encoder can use any amount of slices, but nominally, should use
32x32 slices (1024 in total) to maximize parallelism.

All features are supported, as well as all pixel formats.
This includes:
 - Rice
 - Range coding with a custom quantization table
 - PCM encoding

CRC calculation is also massively parallelized on the GPU.

Encoding of unaligned dimensions on subsampled data requires
version 4, or requires oversizing the image to 64-pixel alignment
and cropping out the padding via container flags.

Performance-wise, this makes 1080p real-time screen capture possible
at 60fps on even modest GPUs.
2024-11-18 07:54:22 +01:00
Lynne
a6c58353ac ffv1enc: move slice allocation out of generic encode init 2024-11-18 07:54:22 +01:00
Lynne
12ea1cde57 ffv1enc: move plane info init into a separate function 2024-11-18 07:54:21 +01:00
Lynne
f4b5068c3b ffv1enc: expose ff_ffv1_write_extradata 2024-11-18 07:54:21 +01:00
Lynne
a13ef376da ffv1enc: split off encoder initialization into a separate function 2024-11-18 07:54:21 +01:00
Lynne
91a4f1539f .gitignore: add exclusions for shader .c files 2024-11-18 07:54:21 +01:00
Lynne
d0ab49e3e7 hwcontext_vulkan: add the mapped software frame as an upload dependency
We do uploads asynchronously, and we map the software frames in
order to avoid 2-stage copying. However, whilst we added a dependency
upon the mapped buffers, we did not add the original frame backing
those buffers as a dependency.

This caused issues on RADV, particularly with RGB images.
2024-11-18 07:54:20 +01:00
Lynne
1876026f83 vulkan: add ff_vk_exec_add_dep_sw_frame
Some software frames may be mapped, and we'd like to have
them as proper dependencies.
2024-11-18 07:54:20 +01:00
Lynne
c918b42dcd vulkan: retrieve Vulkan 1.1 properties
Required to know the subgroup size.
2024-11-18 07:45:46 +01:00
Lynne
16fa710340 vulkan: fix printing descriptors to shader for shaders with no descriptors 2024-11-18 07:45:46 +01:00
Lynne
a516b2da22 vulkan: add support for 10-bit planar RGB 2024-11-18 07:45:46 +01:00
Lynne
eb8f3b8460 hwcontext_vulkan: fix planar RGB images
They were non-working for quite a while.
2024-11-18 07:45:41 +01:00
Rémi Denis-Courmont
bbb0fdedb7 lavc/h264idct: fix RISC-V group multiplier
After the branch, the expected SEW/LMUL ratio is 1 byte/vector.
So we have to set the same ratio before branching (QEMU does not care,
but real hardware does).
2024-11-17 16:35:27 +02:00
tangsha
8a5b74f98b delete unused variable ret 2024-11-17 20:56:41 +08:00
Rémi Denis-Courmont
1912c86af6 sws/range_convert: fix RISC-V chrFromJpeg 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont
55aa81d5cc checkasm: add RISC-V vector width to arch info 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont
42dd1f1cf1 tests/cpu: print the RISC-V Vector length 2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont
fd8cbfec3d lavc/vp8dsp: remove RISC-V table alignment
These values are bytes and need not be aligned.
2024-11-17 11:28:21 +02:00
Rémi Denis-Courmont
690c015758 lavc/h264dsp: remove RISC-V table alignment
These values are bytes and need not be aligned.
2024-11-17 11:28:21 +02:00
Marth64
1d55f54846 avformat/dvdvideodec: don't allow seeking beyond dvdnav reported duration
There is no reason to accept timestamp values beyond what dvdnav
reported as the duration of the title.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
0912407b9d avformat/dvdvideodec: discard duplicate or partial AC3 samples
Some DVD muxers signal segments to start with duplicate audio samples
when starting extraction from a chapter marker or terminate seamless PGs
on partial audio samples (causing corrupt AC3 frames). Clean up after
these muxers by tracking frames with duplicate PTS and eliminating
partial AC3 frames.

This results in smoother chapter extraction and overall seeking experience,
with linear PTS and AC3 delay within 32ms (1 frame) away from the video.

The issue was not apparent until the flushing pattern was replaced with
a full subdemux reset, as the flushing dropped the frames prematurely,
along side others, as such they were never present to begin with.
2024-11-16 14:40:51 -06:00
Marth64
f2f238c3a4 avformat/dvdvideodec: drop packets with unset PTS or DTS
The packets effectively serve no purpose and we are already
dropping packets with PTS less than 0. This also creates
for a smoother seeking experience after the subdemuxer
reset fix.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
3656379d92 avformat/dvdvideodec: remove unnecessary need_parsing argument
The value is always AVSTREAM_PARSE_HEADERS.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
a2c57e27d6 avformat/dvdvideodec: open subdemuxer after initializing IFO headers
It is wasteful to open the subdemuxer if an error occurs while
initializing streams or reading IFO headers.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
60434b483c avformat/dvdvideodec: remove auto value for menu_lu option
The "auto" mode serves no functional purpose except for logging
a message and setting the value to 1. The documentation clearly
explains what the option is for.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
4a03e95ff4 avformat/dvdvideodec: default menu_vts option to 1 and clarify description
Menu 0 is the VIDEO_TS root menu, which does not appear to be used
commonly for menu segments. Instead, default to the menu of VTS 1.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
afc152f564 avformat/dvdvideodec: check the length of a NAV packet when reading titles
Some discs present titles with bogus NAV packets. We apply this check
for menus and for title MPEG blocks, but we should also apply it
for NAV packets during title demuxing.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
a1ae66c827 avformat/dvdvideodec: reset the subdemuxer on discontinuity instead of flushing
DVDs naturally consist of segmented MPEG-PS blobs within a VOB
(i.e. VOBs are not linear). NAV packs set the segment boundaries.
When switching between segments, discontinuities occur and thus
the subdemuxer needs to be reset. The current approach to manage
this is by invoking ff_read_frame_flush() on the subdemuxer context,
via a callback function which is invoked during the menu or dvdnav
block functions. The same subdemuxer context is used throughout
the demux, with a stretched PTS wrap bits value (64) + disabled
overflow correction, and then flushed on each segment. Eventually,
a play_end context variable is set to declare EOF.

However, this approach causes frame drops. The block read flushes the
demuxer before the frame read is complete, causing frames to drop
on discontinuity. The play_end signal likewise ends playback before
the frame read is complete, causing frames to drop at end of the title.
To compound the issue, the PTS wrap bits value of 64 is wrong;
the VOBU limit is actually 32 and the overflow correction should work.

Instead, EOF the MPEG-PS subdemuxer organically when each VOB segment
ends, and re-open it if needed with the offset after the full frame read
is complete. In doing so, correct the PTS wrap behavior to 32 bits and
remove the play_end/segment_started signals and callback pattern.

Note that the timestamps as reported by the NAV packets are known as
"PTMs", so the fields storing the time prior to adjustment are renamed
accordingly. This makes it more clear when we are offsetting the
NAV packet reported timestamps versus what we present as a demuxer.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
1964faa568 avformat/dvdvideodec: simplify dvdvideo_read_packet()
The function has a few branches where it discards frames via
FFERROR_REDO; consolidate is via a goto block to simplify the
function and improve readability. Logging still maintains
all the relevant details for the reason of the discard.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
c1e4b6c676 avformat/dvdvideodec: enable chapter calculation for menus
Menus are generally segmented by cell, so use them as the
marker delimiters. Requires preindex option to be enabled.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
b38ca20bf2 avformat/dvdvideodec: standardize the NAV packet event signal
This consolidates the FFERROR_REDO handling of NAV packets to
dvdvideo_subdemux_read_data(), is a pre-requisite to calculating
chapter markers for menus, and a pre-requisite to fixing the
frame desync issue when the subdemuxer is flushed.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
6bbaa7db49 avformat/dvdvideodec: move memcpy below missed NAV packet warning
Readability improvement; the warning can be bundled beneath
the preceding validations rather than awkwardly between the memcpy
and return.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
e1ace1d314 avformat/dvdvideodec: remove "auto" value for -pg option, default to 1
The default "auto" mode is effectively useless; the reasonable
default use case is to use the first PG (segment) of the
selected PGC for both menus and standard titles. Just
default the value to 1, since the option is irrelevant
unless -pgc is also set.

Note that this should not break users using this advanced option.
The "auto" mode errored and asked for a PG number regardless
for non-menus, and for menus the mode simply defaulted to 1.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
39c662f541 avformat/dvdvideodec: measure duration of the current menu VOBU in state
This will be a pre-requisite to calculating chapter markers
for menus.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
94346edbbf avformat/dvdvideodec: fix menu PGC number off-by-one in state
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marth64
3ad96243d7 avformat/dvdvideodec: remove unused headers
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
Marton Balint
d884606ce0 avutil/rational: never return greater num/den than the maximum allowed in av_d2q
This reverts 887d74c47e, because it ignores the
maximum allowed numerator/denominator. Even if the result was rounded to zero
or infinity, it should not be cause to ignore the maximum allowed number, this
"feature" is unintuitive and undocumented.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-16 20:58:49 +01:00
Marton Balint
25efe34e6f avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate 2024-11-16 20:58:49 +01:00
Marton Balint
e9af7b7b5d avutil/opt: do no rely on av_d2q returning higher num/den than allowed when parsing rational opts
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-16 20:58:49 +01:00
Rémi Denis-Courmont
c3051d94a7 lavc/h264dsp: move RISC-V fn pointers to .data.rel.ro
This should fix PIC builds.
2024-11-16 16:04:24 +02:00
Michael Niedermayer
0b8c9cf5b4 avformat/movenc: Fix ffv1 support
Fixes: Ticket9975

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-16 13:24:16 +01:00
Michael Niedermayer
a5c0ed2122 avcodec/ffv1: Support >8bit rice golomb
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-16 13:24:16 +01:00
Michael Niedermayer
967e5e8f6f avcodec/ffv1: Support slice coding mode 1 with golomb rice
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-16 13:24:15 +01:00
Peter Ross
6ccd16dda2 configure: add rv60 decoder golomb dependency
Fixes standalone compilation of the rv60 decoder.
2024-11-16 19:08:39 +11:00
Peter Ross
7b3bc4a45b avcodec/rv60: consistent indentation 2024-11-16 19:08:39 +11:00
Peter Ross
f7e7d63cbc avcodec/rv60: simplify fill_mv_skip_cand 2024-11-16 19:08:39 +11:00
Peter Ross
566b737a7a avcodec/rv60: loosen fill_mv_skip_cand top right and bottom left criteria
Fixes ticket #11293.
2024-11-16 19:08:39 +11:00
Marth64
7332b1700e avformat/sapdec: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-15 20:18:12 -06:00
Kyosuke Kawakami
a5f0daf843 avcodec/x86/diracdsp_init: remove unused macro
PIXFUNC macro is unused since d29a9c2aa6.

Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:46:05 -05:00
Kyosuke Kawakami
61aa532e22 avcodec/x86/diracdsp: migrate last remaining MMX function to SSE2
The add_dirac_obmc8_mmx function was the only MMX function left. This
patch migrates it to SSE2.

Here are the checkasm benchmark results:

diracdsp.add_dirac_obmc_8_c:    2299.1 ( 1.00x)
diracdsp.add_dirac_obmc_8_mmx:   237.6 ( 9.68x)
diracdsp.add_dirac_obmc_8_sse2:  109.1 (21.07x)

Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:45:52 -05:00
Kyosuke Kawakami
8f683ee417 avcodec/x86/diracdsp: cast stride argument
Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:45:34 -05:00
Kyosuke Kawakami
0e5e37d32c avcodec/x86/diracdsp: fix wrong register load/use count
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:45:14 -05:00
Kyosuke Kawakami
711290f9a3 checkasm/diracdsp: test add_dirac_obmc
Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2024-11-15 13:44:53 -05:00
Michael Niedermayer
07904231cb doc/infra: Document gitolite
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-14 21:50:51 +01:00
James Almer
322b240cea avcodec/hevc/sei: remove unnecessary inline function
It's a pointless indirection.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:49:52 -03:00
James Almer
2d3281b9dd avcodec/hevc/sei: remove unused inline function
It's also a pointless indirection.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:49:52 -03:00
James Almer
66014c79ab avcodec/h2645_sei: move some common SEI syncing code to ff_h2645_sei_ctx_replace()
Instead of duplicating it across all supported decoders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:49:52 -03:00
James Almer
edc7b67508 avformat/iamf: use the new Binaural channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
James Almer
20af68b63a avutil/channel_layout: add Binaural channels and layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
Leo Izen
18883fbcab avcodec/jpegxl_parser: fix reading lz77-pair as initial entropy symbol
The JPEG XL parser has an entropy decoder inside, which supports LZ77
length-distance pairs. If the first symbol from the entropy stream is an
LZ77 pair, the bitstream is invalid, so we should abort immediately rather
than attempt to read it anyway (which would read from the uninitialized
starting window).

Reported-by: Kacper Michajłow <kasper93@gmail.com>
Found-by: ossfuzz
Fixes: 368725676/clusterfuzz-testcase-minimized-fuzzer_protocol_file-6022251122589696-cut
Fixes: 42537758/clusterfuzz-testcase-minimized-fuzzer_protocol_file-5818969469026304-cut
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-11-13 10:26:28 -05:00
Ronald S. Bultje
a5dabfc9c0 enc_recon_frame_test: don't print an error on EOF.
Before:
$ make tools/enc_recon_frame_test
$ tools/enc_recon_frame_test ~/Movies/cif/bus_cif.y4m libx264 'tune=psnr'
Error submitting a frame for encoding

After:
All 150 encoded frames match
2024-11-13 09:26:22 -05:00
compn
e35587250c doc/infra: add reddit sub, facebook page and wikipedia 2024-11-13 08:04:13 +10:00
compn
455db6fe10 MAINTAINERS: remove arpi 2024-11-13 02:15:59 +10:00
James Almer
e7bdaadce6 avformat/mov: check that items are allocated before accessing them
Fixes NULL pointer dereferences introduced in 2e338152a2

Fixes: clusterfuzz-testcase-fuzzer_loadfile-4753810267897856
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6042587212873728
Fixes: clusterfuzz-testcase-minimized-fuzzer_loadfile-6536211629408256

Reported-by: kasper93
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-12 12:23:32 -03:00
Marton Balint
fe18ed3f2a avfilter/f_loop: fix aloop activate logic
The logic did not follow the documented behaviour and that caused skipping of
some audio in the loop and in the leftover buffer.

Example command line which should produce a smooth sine wave for the whole
duration of the output:

ffmpeg -f lavfi -i "sine=r=48000:f=480:d=4" -af "aloop=loop=4:start=48000:size=48000" out.wav

Fixes ticket #11283.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-11 21:56:34 +01:00
Marton Balint
b33a594160 avfilter/f_loop: fix length of aloop leftover buffer
If the audio loop stops inside an audio frame, the leftover buffer contains the
end of the frame, which is not looped. The length supposed to be the part which
was not written to the loop buffer, so we need to drain exactly that number of
bytes from the leftover buffer.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-11 21:56:34 +01:00
James Almer
97c5cc3a5c Revert "avcodec/h2645_sei: fix parsing AOM grain provider_oriented_code"
This reverts commit 24141a7140.
It was a change made by looking at an old spec version.
2024-11-11 17:11:15 -03:00
James Almer
e33b162c7d avcodec/h2645_sei: use the RefStruct API for film_grain_characteristics
And ensure the buffer is synced between threads.
Based on a patch by Dale Curtis <dalecurtis@chromium.org>

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:15 -03:00
James Almer
fd4a2c9b02 avcodec/aom_film_grain: allocate film grain metadata dynamically
This removes the ABI breaking use of sizeof(AVFilmGrainParams), and achieves the
same size reduction to decoder structs as 08b1bffa49.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:15 -03:00
James Almer
24141a7140 avcodec/h2645_sei: fix parsing AOM grain provider_oriented_code
The value is 16 bits big endian, not a single byte.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 16:10:10 -03:00
James Almer
91b6ba653e Revert "avcodec/h2645: allocate film grain metadata dynamically"
AVFilmGrainAFGS1Params, the offending struct, is using sizeof(AVFilmGrainParams)
when it should not. This change also forgot to make the necessary changes to the
frame threading sync code.
Both of these will be fixed by the following commit.

H274FilmGrainDatabase will be handled later.

This reverts commit 08b1bffa49.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 15:26:21 -03:00
James Almer
9ec042c1aa avcodec/x86/vvc: add prototypes for OF functions
And wrap the implemtation in preprocessor checks.
Should fix ticket #11282.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-11 19:34:11 +08:00
Frank Plowman
1e5f24d1a6 lavc/vvc: Remove floating point logic
This was the only floating point logic in the native VVC decoder.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-11-11 19:31:00 +08:00
Zhao Zhili
994368be8f x86/vvc: Fix build error for arch x86_32
There were static functions which built for x86_32, but the simd
functions they reference only available for x86_64.
2024-11-11 19:30:09 +08:00
Nuo Mi
c49001e338 avcodec/cbs_h266: Fix regression in DVB clip introduced by 93281630a7
This commit introduced a regression to VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_mosaic.ts.

Root Cause:
The AV_CEIL_RSHIFT(a, b) macro uses bit tricks that work only when -a is a negative value.
However, due to integer promotion rules, this behavior does not extend to the unsigned int type.

See "6.3.1.1 Boolean, characters, and integers" in the "ISO/IEC 9899" for details.

Reported-by: Frank Plowman <post@frankplowman.com>
2024-11-11 19:30:09 +08:00
Michael Niedermayer
96d45c3b21 avformat/vividas: Check avio_read() for failure
Fixes: use of uninitialized value (untested)
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5505802505355264

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:06 +01:00
Michael Niedermayer
e30d957a9b avformat/ilbc: Check avio_read() for failure
Fixes: use of uninitialized value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-6656646223298560-cut

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:06 +01:00
Michael Niedermayer
898f6582eb avformat/nistspheredec: Clear buffer
Fixes: use-of-uninitialized-value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-6515855798632448-cut

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:05 +01:00
Michael Niedermayer
bf8e43083f avformat/mccdec: Initialize and check rate.den
Fixes: Assertion c > 0 failed at libavutil/mathematics.c:61
Fixes: use-of-uninitialized-value
Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-5939605805793280

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:05 +01:00
Michael Niedermayer
beca13a42e avformat/rpl: check channels
Fixes: 42537199/clusterfuzz-testcase-minimized-fuzzer_loadfile_direct-5447162658357248
Fixes: runtime error: signed integer overflow: -3330498059201358222 * 4 cannot be represented in type 'int64_t' (aka 'long')

Found-by: ossfuzz
Reported-by: Kacper Michajlow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-11 01:28:05 +01:00
compn
b16102ab1c doc/infra: add more information and accounts 2024-11-11 10:26:35 +10:00
James Almer
2b1bf3e228 fate/pixfmt: reintroduce scale filter dependency for some tests
Removed by mistake in 271aea60a4.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-10 20:22:22 -03:00
James Almer
92b849df13 avformat/mov: reindent after previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-10 12:04:53 -03:00
James Almer
2e338152a2 avformat/mov: use an array of pointers for heif_item
Pointers to specific entries in the array are stored in other structs, so
in the scenario where heif_item was reallocated when parsing an iloc box after
and iinf one, the pointers may end up referencing freed memory.

Fixes use-after-free with such samples.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-10 12:04:53 -03:00
vectronic
7f51cf75c6 avformat/hls: improve comment
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2024-11-10 11:20:08 +08:00
vectronic
380a518c43 avformat/mov: if pos has been reset, clear fragments and indexes and search for next root
fixes https://trac.ffmpeg.org/ticket/7359

Signed-off-by: vectronic <hello.vectronic@gmail.com>
2024-11-10 11:20:01 +08:00
Peter Ross
2f34b159b4 avcodec/eatgq: decode motion vector macroblocks
Signed-off-by: Peter Ross <pross@xvid.org>
2024-11-10 12:31:19 +11:00
James Almer
10c02deccb avfilter/vf_zscale: extend the configuration log message with color space info
And print it in DEBUG level, not TRACE, as it's useful information.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:57 -03:00
James Almer
5c8268ac56 avfilter/vf_zscale: remove unecessary argument from realign_frame
Possible since the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
James Almer
c8e5c684b3 avfilter/vf_zscale: align the frame buffers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
Pavel Koshevoy
00cf3df03f lavfi/vf_zscale: fix call to av_pix_fmt_count_planes
realign_frame called av_pix_fmt_count_planes with incorrect parameter.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
Pavel Koshevoy
7b302f4db7 lavfi/vf_zscale: fix tmp buffer ptr alignment for zimg_filter_graph_process
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
James Almer
f15fc27db5 avfilter/framepool: align the frame buffers
And not just the linesizes. Use the extra align bytes allocated for this purpose.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-09 19:33:56 -03:00
Marth64
6d5a0998b6 doc/bitstream_filters: elaborate on h264_redundant_pps
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-09 10:02:34 -06:00
Anton Khirnov
13129f1af4 lavc: deprecate the omx encoders
They have not been relevant for a long time, and support for this API is
also being dropped from other projects.
2024-11-09 02:46:17 +01:00
Anton Khirnov
9e68b26765 Document stream specifier syntax change from 46cbe4ab5c
Fixes #11248.
2024-11-09 02:45:58 +01:00
Anton Khirnov
3e9b0f7c01 lavfi/vf_libplacebo: eliminate LibplaceboInput.link
Setting it was broken in 8160178dfc, since
links are not yet set up during init. It is also redundant, as the
struct also stores the input index.

Reported-By: llyyr <llyyr.public@gmail.com>
2024-11-09 02:45:58 +01:00
Peter Ross
2bbbf36fe2 avcodec/rv60: set populate_ipred src parameter to const 2024-11-09 08:50:59 +11:00
Peter Ross
006718c475 avcodec/rv60: align calc_sel_qp with reference decoder
Fixes ticket #11290.
2024-11-09 08:50:59 +11:00
Peter Ross
c8c6319ce1 avcodec/rv60: prevent decode_cu_r deadlock
Fixes ticket #11289 (deadlock).
2024-11-09 08:50:59 +11:00
Peter Ross
4d4d171afb avcodec/rv60: prevent decode_cu_r segfault
Fixes ticket #11289 (crash).
2024-11-09 08:50:59 +11:00
Peter Ross
923f45430c avcodec/rv60: check init_get_bits8 return value
Fixes CID 1634471
2024-11-09 08:50:58 +11:00
Peter Ross
d51a920556 avcodec/rv60: negative qp guard
Fixes CID 1634472
2024-11-09 08:50:58 +11:00
Osamu Watanabe
82467b635e avcodec/jpeg2000: Improve FF_DWT97_INT to pass ISO/IEC 15444-4 conformance tests
Fixes https://trac.ffmpeg.org/ticket/10123

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-11-08 08:30:07 -08:00
James Almer
3330b733d3 fate/pixfmt: disable dithering in the scale filter
Should fix fate failures across different systems.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-08 09:19:06 -03:00
Tomas Härdin
733d891bdf lavf/mxfenc: Use nb_components, not av_pix_fmt_count_planes()
Also check that pix_desc != NULL, thanks James Almer

This fixes https://trac.ffmpeg.org/ticket/11267
2024-11-08 10:52:04 +01:00
compn
f4ba5b083c doc/git-howto: remove outdated line about gitolite 2024-11-08 15:59:13 +10:00
Marth64
11c703be31 avcodec/mpeg12dec: set FF_CODEC_PROPERTY_CLOSED_CAPTIONS in mpeg_set_cc_format()
When Closed Captions are discovered, this method is always invoked.
Therefore, use it to set the property instead of repeating the statement.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-07 21:27:04 -06:00
James Almer
2eb9c35010 x86/swscale: disable AVX2 yuv2nv12cX functions if accurate_rnd is requested
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-07 11:16:42 -03:00
Araz Iusubov
f63f164125 avcodec/amfenc: GOP size check
Fix for the error with an invalid GOP size parameter.
2024-11-07 15:11:10 +01:00
James Almer
4047b887fc swscale/swscale_unscaled: add more unscaled planar RGB to planar RGB coverage
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:45:47 -03:00
James Almer
c5ebd56500 swscale/swscale_unscaled: add unscaled XV{36,48}LE <-> XV{36,48}BE
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:45:47 -03:00
James Almer
271aea60a4 fate/pixfmts: extend the high bit depth test
Also test 8bit formats, and try bitdepth conversion paths.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:44:25 -03:00
James Almer
c8438546ff avfilter/vsrc_testsrc: add support for RGB48/RGBA64
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:34:32 -03:00
James Almer
e7382b4d01 swscale/swscale_unscaled: add unscaled x2rgb10le to packed RGB
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:34:32 -03:00
James Almer
ae8ef645ec swscale/swscale_unscaled: add unscaled x2rgb10le to planar RGB
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-06 17:34:31 -03:00
Cameron Gutman
8503c64aa8 avcodec/amfenc: add support for QueryOutput wait
Enable waiting in QueryOutput() based on driver support to reduce
unnecessary delays.

Fix for issue #10622

Co-authored-by: Araz Iusubov <Primeadvice@gmail.com>
2024-11-06 19:38:36 +01:00
Araz Iusubov
eedcf939d8 avcodec/amfenc: Color information update
Processing of transfer characteristic SMPTE2084 and 8-bit depth added
on AMF side and will appear in one of upcoming releases.
2024-11-06 19:38:11 +01:00
Leandro Santiago
fd0cacc472 fftools/ffplay: fix crash when vk renderer is null
When vulkan rendering is requested by the user and fails, ffplay should
exit graciously instead of crash due to a null pointer deref.

Signed-off-by: Leandro Santiago <leandrosansilva@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-06 16:34:02 +08:00
Kacper Michajłow
7b20985d8d avcodec/jpegxl_parser: check entropy_decoder_read_symbol return value
Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2024-11-05 08:44:43 -05:00
Fei Wang
c845a07302 libavutil/hwcontext_{d3d11va, dxva2}: Support Y212/XV36 pixel format
Use DXGI/D3DFMT 16bit pixel format to compatible with 12bit Y212/XV36
since there is no 12bit pixel defined in D3D11/D3D9.

Fix cmdline on Windows:

$ ffmpeg.exe -hwaccel qsv -init_hw_device qsv:hw,child_device_type=
{d3d11, dxva2} -i input_12bit.bin -f null -

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-05 10:28:03 +08:00
Michael Niedermayer
df00705e00 INSTALL: explain the circular dependency issue and solution
Sponsored-by: Sovereign Tech Fund
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-03 19:35:23 +01:00
Michael Niedermayer
ebffb8b68e avcodec/ffv1enc: Tighter maxsize
This allows using smaller buffers

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-03 19:20:40 +01:00
Peter Ross
2d81eaa37b fate/rv60: add test 2024-11-03 10:53:15 +11:00
Peter Ross
33802e7c32 avcodec/rv60: RealVideo 6.0 decoder
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2024-11-03 10:53:15 +11:00
Peter Ross
ae8295417a avformat/rmdec: support RMHD file format
Signed-off-by: Peter Ross <pross@xvid.org>
2024-11-03 10:53:15 +11:00
Sean McGovern
c325f9c619 libavutil/ppc: defines involving bit shifts should be unsigned
Otherwise, these can overflow at the boundaries of the integer type.

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-11-03 22:05:06 -05:00
James Almer
40878dfb11 fate/pixfmts: test conversion of high bitdepth formats
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
5f5421ec66 swscale/swscale: prevent integer overflow in chrRangeToJpeg16_c
Same as it's done in lumRangeToJpeg16_c(). Plenty of allowed input values can
overflow here.

Fixes: src/libswscale/swscale.c:198:47: runtime error: signed integer overflow: 475328 * 4663 cannot be represented in type 'int'
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
c029a2f7dd swscale/swscale_unscaled: add unscaled rgb to planar rgba
The fate test reference changes are due to the conversion being a simple
lossless deinterleave, instead of going through a RGB -> YUV -> RGB roundtrip.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
5ccc3f0fca swscale/swscale_unscaled: add unscaled hbd planar RGB to x2rgb10le
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
febc9e8162 swscale/output: add full chroma interpolation support for x2rgb10
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
430bec8666 fate/filter-video: add more rgbtestsrc tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
165f124129 vsrc_testsrc: add support for x2rgb10le to rgbtestsrc
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
78ba06928a swscale/x86/rgb2rgb: add optimized versions of the remaining shuffle_bytes functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
James Almer
a686d34fea swscale/swscale_unscaled: add unscaled conversion for AYUV/VUYA/UYVA
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-02 15:01:31 -03:00
Brad Smith
d6b2d08fc7 libavutil/ppc: Include the hardware feature flags like the other archs
Also include the hardware feature flags like the other archs do and
clean up the code a bit.

Tested on Linux POWER9.

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-11-03 03:27:39 -05:00
Timo Rothenpieler
d724584d68 avcodec/nvenc: set bitstreamRestrictionFlag when neccesary
This mimics the behaviour of libx264 for setting this flag.

Fixes #11131
2024-11-01 17:59:27 +01:00
Koushik Dutta
0cdcbab9e9 avfilter/scale_cuda: frame crop support
The crop filter has no effect on scale_cuda:

-vf crop=100:100,scale_cuda=100x100

Hardware frames (AV_PIX_FMT_FLAG_HWACCEL) are expected to use the crop_* properties,
as seen in the implementation vf_crop.c.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-11-01 17:10:34 +01:00
Zhao Zhili
1864025458 fate/vvc: Add a sample which lose frames before 5c66a3
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-01 16:59:48 +08:00
Fei Wang
e726fdeb05 lavc/vaapi_dec: Add VVC decoder
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Fei Wang
4dc18c78cd lavc/vvc_dec: Add hardware decode API
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Fei Wang
a94aa2d61e lavc/vvc_ps: Add alf raw syntax into VVCALF
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Fei Wang
15a75e8e04 lavc/vvc_refs: Define VVC_FRAME_FLAG* to h header
So that hardware decoder can use the flags too.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Fei Wang
6bb5dc2ae7 lavc/cbs_h266: Add NumSlicesInTile to H266RawPPS
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Fei Wang
e543a22c38 lavc/cbs_h266: Add SliceTopLeftTileIdx to H266RawPPS
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Fei Wang
f42978fe29 lavc/vaapi_decode: Use a more meaningful variable name
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Fei Wang
1d8c31d5e2 lavc/vaapi_dec: Create VA parameters dynamically
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Peter Ross
87068b9600 fate/vp60-interlace: add test 2024-10-31 17:49:48 +11:00
Peter Ross
492a3b4b89 avcodec/vp56: decode interlace content
Modification of patch submitted by Aurelien Jacobs (November 2007).

Fixes ticket #5581 and #5582.
2024-10-31 17:49:48 +11:00
Thomas Guillem
44a0a0c050 avcodec/decode: clean-up if get_hw_frames_parameters fails
Fixes the following assert:

[00007f1df83d17e0] vaapi generic error: avcodec_get_hw_frames_parameters failed: -22
Assertion p_dst->hwaccel_threadsafe || (!dst->hwaccel && !dst->internal->hwaccel_priv_data) failed at libavcodec/pthread_frame.c:349

Reproduced from VLC with VAAPI, when fallbacking from hw to sw.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-30 21:31:17 +08:00
James Almer
bb57b78013 avutil/hwcontext_vulkan: add missing packed YUV444 format mappings
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-27 14:50:57 -03:00
Pierre-Anthony Lemieux
839f6d38a0 jpeg2000dec: fix tile-part header state reset
Fixes https://trac.ffmpeg.org/ticket/11266
2024-10-27 10:26:00 -07:00
Ramiro Polla
562524587e checkasm/sw_range_convert: indent after previous couple of commits 2024-10-27 13:20:56 +01:00
Ramiro Polla
031d98790e checkasm/sw_range_convert: test all supported bit depths
This commit also reduces the number of times ff_sws_init_scale() gets
called (only once per bit depth), and the number of times randomize_buffers()
gets called (only if the function must be checked).

Benchmarks are only performed on bit depths 8 and 16 (since they are
different functions, and not only different constants).
2024-10-27 13:20:56 +01:00
Ramiro Polla
2c44393c01 checkasm/sw_range_convert: only run benchmarks on largest input width 2024-10-27 13:20:56 +01:00
Ramiro Polla
e308d09fba checkasm/sw_range_convert: reduce number of input sizes tested
Reduce input sizes to 8 (to test that the function works with widths
smaller than the vector length) and 1920 (raising the largest input
size to improve benchmark results).
2024-10-27 13:20:56 +01:00
Ramiro Polla
d1acd68d73 checkasm/sw_range_convert: use YUV pixel formats instead of YUVJ
We are already setting the range, so we can use regular YUV pixel
formats instead of YUVJ.
2024-10-27 13:20:56 +01:00
Ramiro Polla
a8ef1fac0d checkasm: use FF_ARRAY_ELEMS instead of hardcoding size of arrays 2024-10-27 13:20:56 +01:00
Ramiro Polla
8b30daedf7 swscale/range_convert: indent after previous commit 2024-10-27 13:20:56 +01:00
Ramiro Polla
f7ee0195df swscale/range_convert: drop redundant conditionals from arch-specific init functions
These conditions are already checked for in the main init function.
2024-10-27 13:20:56 +01:00
Ramiro Polla
7728b3357d swscale/range_convert: call arch-specific init functions from main init function
This commit also fixes the issue that the call to ff_sws_init_range_convert()
from sws_init_swscale() was not setting up the arch-specific optimizations.
2024-10-27 13:20:56 +01:00
Marton Balint
9b0128aa76 avutil/wchar_filename: re-introduce explicit cast of void* to char*
Fixes compile error on windows with decklink:

In file included from ./libavformat/os_support.h:175,
                 from ./libavformat/internal.h:30,
                 from libavdevice/decklink_common.cpp:25:
./libavutil/wchar_filename.h: In function 'int wchartocp(unsigned int, const wchar_t*, char**)':
./libavutil/wchar_filename.h:59:32: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
   59 |     *filename = av_malloc_array(num_chars, sizeof **filename);
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                |
      |                                void*

Regression since e9e8bea2e7.

Fixes ticket #11103.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-10-27 09:37:46 +01:00
Zhao Zhili
78525bc36b tests/fate-run: Fix pixdesc failure
-u and -q doesn't work together for diff on macOS.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-27 11:40:00 +08:00
Zhao Zhili
7fe9d12f25 avcodec/mediacodecdec_common: Workaround MTK broken crop implementation
MediaTek SOC return broken crop info, e.g.,
width: int32(3840) height: int32(2160) crop: Rect(0, 0, 318, 238)

It will notify the right crop info with infoOutputFormatChanged, but
too late.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-27 11:35:13 +08:00
Zhao Zhili
0ee18ff23d avcodec/mediacodecenc: Extract configOBUs from AV1CodecConfigurationRecord
MediaCodec can generate AV1CodecConfigurationRecord, which shouldn't
be put into packet->data. Skip four bytes and extract configOBUs
if it exist.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-27 11:35:05 +08:00
Zhao Zhili
0552238570 fftools/ffplay: use swapchain_colorspace_hint to get better HDR support
For example, the default surface configuration on macOS is:
VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_PASS_THROUGH_EXT

With HDR10 content and swapchain_colorspace_hint, the surface
configuration updated to:
VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_HDR10_ST2084_EXT

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-27 11:34:01 +08:00
James Almer
fe21944656 avutil/hwcontext_d3d11va: drop duplicate pixfmt entry
Added by accident in ca71b0b807.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 09:26:36 -03:00
James Almer
ca71b0b807 libavutil/hwcontext_d3d11va: use the XV48 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:55 -03:00
James Almer
dad3d9800d libavutil/hwcontext_dxva2: use the XV48 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:55 -03:00
James Almer
42b748f738 avfilter/vsrc_testsrc: add support for XV48
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:55 -03:00
James Almer
707e2184ca avformat/riff: map Y416 fourcc to RAWVIDEO decoder
As defined in https://learn.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats#422-formats

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:55 -03:00
James Almer
a67ba3c132 swscale/output: add XV48 output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:50 -03:00
James Almer
2f13f74791 swscale/input: add XV48 input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:29 -03:00
James Almer
e02a3b40a5 avutil/pixfmt: add XV48 pixel format
Much like XV30 and XV36 in d75c4693fe,
XV48 is added to support 16bit 4:4:4 as defined by Microsoft.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:23 -03:00
James Almer
e1bacfb523 libavutil/hwcontext_d3d11va: use the Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-25 23:57:16 -03:00
James Almer
c76d92b2e0 libavutil/hwcontext_dxva2: use the Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-25 23:57:14 -03:00
James Almer
faec8763e8 avformat/riff: map Y210 and Y216 fourcc to RAWVIDEO decoder
As defined in https://learn.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats#422-formats

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-25 19:41:07 -03:00
Michael Niedermayer
db7b4fc89f avformat/mpegts: Initialize predefined_SLConfigDescriptor_seen
Fixes: use of uninitialized variable
Fixes: 368729566/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTS_fuzzer-6044501804646400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-25 22:46:40 +02:00
Michael Niedermayer
23088a5ff2 avformat/mxfdec: Fix overflow in midpoint computation
Fixes: signed integer overflow: 4611686016549392399 + 9223372033098784800 cannot be represented in type 'long long'
Fixes: 368503277/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5928227458056192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-25 22:46:40 +02:00
Michael Niedermayer
3fe3014405 swscale/output: used unsigned for bit accumulation
Fixes: Integer overflow
Fixes: 368725672/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5009093023563776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-25 22:46:39 +02:00
Michael Niedermayer
14f5d67be3 swscale/rgb2rgb_template: Fix ff_rgb24toyv12_c() with odd height
Fixes: out of array access
Fixes: 368143798/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6475823425585152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-25 22:46:39 +02:00
Dale Curtis
08b1bffa49 avcodec/h2645: allocate film grain metadata dynamically
Film grain support adds a huge amount of overhead to the H264Context
structure for a feature that is rarely used. On low end devices or
pages that have lots of media this bloats memory usage rapidly.

This changes the static film grain metadata allocations to be dynamic
which reduces the H264Context size from 851808 bytes to 53444 bytes.

Bug: https://crbug.com/359358875
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-25 01:02:35 +02:00
Michael Niedermayer
2c71366d3b avcodec/ffv1: Implement new slice tiling
This fixes corner cases (requires version 4 or a spec update)

Fixes: Ticket5548

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-24 23:01:14 +02:00
Michael Niedermayer
d147b3d7ec avcodec/rangecoder: only perform renorm check/loop for callers that need it
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-24 23:01:14 +02:00
Niklas Haas
67adb30322 swscale: rename SwsContext to SwsInternal
And preserve the public SwsContext as separate name. The motivation here
is that I want to turn SwsContext into a public struct, while keeping the
internal implementation hidden. Additionally, I also want to be able to
use multiple internal implementations, e.g. for GPU devices.

This commit does not include any functional changes. For the most part, it is
a simple rename. The only complications arise from the public facing API
functions, which preserve their current type (and hence require an additional
unwrapping step internally), and the checkasm test framework, which directly
accesses SwsInternal.

For consistency, the affected functions that need to maintain a distionction
have generally been changed to refer to the SwsContext as *sws, and the
SwsInternal as *c.

In an upcoming commit, I will provide a backing definition for the public
SwsContext, and update `sws_internal()` to dereference the internal struct
instead of merely casting it.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-24 22:50:00 +02:00
Soma Lucz
153a6dc8fa doc/ffmpeg: improve -disposition, -stats, and -progress documentation
-disposition:
Clarify the meaning of the default value, and how the '+' and '-'
prefixes work. Add more examples.

-stats:
Clarify that it appears as an "info"-level log.

-progress:
Add info about the "progress" key's value being "continue" or "end".
Add an example of logging to stdout.

Signed-off-by: Soma Lucz <luczsoma@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-24 10:45:04 +02:00
James Almer
ae0ab5b7ce avcodec/vulkan_video: add mapping for AV_PIX_FMT_Y216
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 20:06:03 -03:00
James Almer
5c622d4cc1 avutil/hwcontext_vulkan: add support for AV_PIX_FMT_Y216
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 20:06:03 -03:00
James Almer
e46a506ae0 avcodec/vulkan_video: add proper maps for XV3{0,6}
Forgotten after fd8b0dcfed.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 20:06:03 -03:00
Niklas Haas
f1f54d2f82 swscale/x86: use dedicated int for self-modifying MMX dstW
I want to pull options out of SwsInternal, so we need to make this field
a dedicated int that gets updated as appropriate in ff_swscale().

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:12:23 +02:00
Niklas Haas
b03c758600 swscale: add sws_is_noop()
Exactly what it says on the tin.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:06:55 +02:00
Niklas Haas
5e50a56b9c swscale: add new frame testing API
Replacing the old sws_isSupported* API with a more consistent family
of functions that follows the same signature and naming convention,
including a placeholder for testing the color space parameters that
we don't currently implement conversions for.

These functions also perform some extra basic sanity checking.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:06:16 +02:00
Niklas Haas
e2637a083a swscale/utils: add SwsFormat abstraction and helpers
Groups together all relevant color metadata from an AVFrame. While we could
use AVFrame directly, keeping it a separate struct has three advantages:

1. Functions accepting an SwsFormat will definitely not care about the
   data pointers.
2. It clearly separates sanitized and raw metadata, since the function to
   construct an SwsFormat from an AVFrame will also sanitize.
3. It's slightly more lightweight to pass around.

Move these into a new header file "utils.h" to avoid crowding
swscale_internal.h even more, and also to solve a circular dependency issue
down the line.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:04:06 +02:00
Niklas Haas
87baf9ab2c swscale: add sws_free_context()
Merely a convenience wrapper around sws_freeContext(). The name change is for
parity with the other sws_* functions.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:04:04 +02:00
Niklas Haas
3bf12beae9 swscale: slightly reorder header
I want to start grouping "legacy" functions which I tend to deprecate
together, away from the new ones.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:01:09 +02:00
Niklas Haas
fbfea1c644 swscale: publicly typedef struct SwsContext
Slightly more convenient, especially for the upcoming refactor which will
turn SwsContext into a public struct.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-23 23:00:54 +02:00
James Almer
b520d95467 swscale/output: add Y216LE output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 14:11:35 -03:00
James Almer
7756cd98ac swscale/input: add Y216LE input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 14:11:23 -03:00
James Almer
f462ba05f5 avutil/pixfmt: add Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 14:11:16 -03:00
Lynne
9eb7e8d2a4 vulkan: move alignment of host-visible allocations outside of ff_vk_alloc_mem
The issue is that if dedicated allocation is used, VkBufferCreateInfo.size
and the actual allocated size mismatched, which is a validation error.
2024-10-23 08:14:10 +02:00
Emily
3565903c63 fate/ffmpeg: add samples dependency to fate-ffmpeg-spec-disposition
This test utilizes an MPEG-TS sample from FATE suite, yet was
marked as not requiring samples.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
2024-10-21 21:19:33 +03:00
James Almer
8d940a07d1 avutil/pixdesc: fix alpha offset for X2{RGB,BGR}10BE
fixes fate-pixelutils

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 10:24:03 -03:00
James Almer
60b8f0d004 fate/filter-video: make fate-filter-pixdesc compare the hashed output with and without pixdesctest filtering
This helps detecting inconsistencies in swscale input/output code and
a av_read_image_line()/av_write_image_line() pass.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer
0bb53948ac swscale/swscale_unscaled: clear the low bits in planar8ToP01xleWrapper
This makes the unscaled output of p010le and p016le match the generic path.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer
dfd7acf3ed avfilter/vf_pixdesctest: also take into account undefined alpha components
Ensure those bits are copied, which will result in the output being the same as
the input, where swscale set them to the equivalent of fully opaque.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer
8debc5aa41 avfilter/vsrc_testsrc: use the alpha component information for XV3{0,6} and V30X
And add a few more tests to ensure all the pixfmts affected by this change
are tested.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:58 -03:00
James Almer
8f1de9ccd9 avutil/pixdesc: add alpha component information to pixfmts with reserved but undefined alpha bits
This can be useful to simplify certain processes that need to know how many
reserved bits there are and where they are placed, even if they are ultimately
unused, as will be shown in the next commit.
For any other case where the user simply looks at nb_components components, it
will make no difference.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:50 -03:00
James Almer
72f8f76d45 avutil/pixdesc: ensure the component being read or writen to is valid
If depth is 0, then the component is invalid/unset.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:43:45 -03:00
Tomas Härdin
baa23e40c1 lavf/mxfdec: Set a scan direction explicitly
This prevents a theoretical case where seeks to a gap in an index can cause an infinite loop
2024-10-21 11:14:24 +02:00
Nuo Mi
b611410569 avcodec/vvc/thread: Check frame to be non NULL
Fixes: NULL pointer dereference
Fixes: 71303/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4875859050168320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reported-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-20 20:36:15 +08:00
arch1t3cht
72e5381123 avfilter/vf_subtitles: Respect YCbCr Matrix header
As specified in libass's ass_types.h, the colors or ASS_Images
should be converted to YCbCr using the matrix/range specified in
the track's YCbCrMatrix field (unless that field is set to YCBCR_NONE,
and defaulting to TV.601 if the header is missing).

This does not affect any subtitles generated or transcoded by ffmpeg,
since these contain a 'YCbCrMatrix: None' header.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: rcombs <rcombs@rcombs.me>
2024-10-19 11:08:34 -05:00
Marvin Scholz
c98810ab47 avcodec/hw_base_encode: fix use after free on close
The way the linked list of images was freed caused a
use after free, by accessing pic->next after pic was
already freed.

Regression from 48a1a12968

Fix CID1633236
2024-10-18 11:18:41 +02:00
Lynne
dfaade76db vulkan: move buffer allocation av_log message
Its more useful when buffers are allocated, not in the
pool.
2024-10-18 11:18:35 +02:00
James Almer
1edc748eff avformat/movenc: explicitly support V30XLE and not the host native endian version
Should fix fate-vsynth*-v410 on BE targets.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 21:20:27 -03:00
James Almer
6cf4186d1b fate/vcodec: update reference files for v410 vsynth tests
Forgotten in 601a347946.

Found-by: ramiro
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 17:04:57 -03:00
James Almer
f0e6296dde swscale/output: fix alpha endianness in XV36
Mistakenly written in native endianness in 42098f9266.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 12:18:35 -03:00
James Almer
062fcacc8f avfilter/vsrc_testsrc: fill the xv30le alpha bits
As with other pixel formats, set the undefined alpha bits to opaque.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:59:30 -03:00
James Almer
601a347946 swscale/output: fill the xv30le alpha bits
As with other pixel formats, set the undefined alpha bits to opaque.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:59:24 -03:00
James Almer
5601c5bb2e avfilter/vsrc_testsrc: add support for XV36 and AYUV64
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer
08c632ec0f swscale/output: add AYUV64BE output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer
5a699c8db9 swscale/input: add AYUV64BE input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer
42098f9266 swscale/output: add X36VBE output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer
e012a7a24a swscale/input: add X36VBE input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer
2137346324 swscale/output: fill all the xv36le alpha bits
The format is 10 bit per component, not 8.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-17 11:57:36 -03:00
James Almer
e1d1ba4cbc tests/checkasm/sw_rgb: don't write random data past the end of the buffer
Should fix fate-checkasm-sw_rgb under gcc-ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-10-17 13:08:39 +02:00
Ramiro Polla
d2ed52dc02 avdevice/dshow: fix unused variable warning
The acaps variable was used outside of the #if DSHOWDEBUG block with
a1c4929f, but it is no longer used outside of the block since f125c504.
2024-10-17 13:04:17 +02:00
Anton Khirnov
c034213083 lavfi/vsrc_perlin: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
e0aa644978 lavfi/vsrc_life: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
2094a7256c lavfi/vsrc_life: avoid modifying the context in query_formats()
It is supposed to be free of side effects. Do it in init instead.
2024-10-17 11:00:35 +02:00
Anton Khirnov
d08feb9003 lavfi/vf_zscale: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
6bff95be03 lavfi/vf_weave: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
ab01f0522b lavfi/vf_vpp_qsv: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
e5b530f137 lavfi/vf_vmafmotion: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
73c863fad8 lavfi/vf_v360: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
223327d51a lavfi/vf_untile: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
5d0fbd7145 lavfi/vf_transpose: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
ef4913e30d lavfi/vf_tpad: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
ce5aa74045 lavfi/vf_tile: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
14ece0bf58 lavfi/vf_telecine: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
a18418f39d lavfi/vf_swapuv: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
06292d34de lavfi/vf_swaprect: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
05aad90c69 lavfi/vf_subtitles: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
6ed357ce77 lavfi/vf_stereo3d: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
bdaaddb65c lavfi/vf_stack: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
e2f4c69779 lavfi/vf_shuffleplanes: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
965e9b646e lavfi/vf_showpalette: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
a96244df77 lavfi/vf_setparams: convert to query_func2() 2024-10-17 11:00:35 +02:00
Anton Khirnov
242ee7b0a2 fftools/ffmpeg_sched: be smarter about flushing the pre-muxing queues
These per-stream FIFOs hold the packets before every stream is
initialized and the header can be written. Once that happens, current
code will flush each stream's queue one after the other. However, in
case we buffered a lot of data for multiple streams, this may cause the
muxer to overflow max_interleave_delta, resulting in worse interleaving
than necessary.

Change the code to interleave packets from all the queues by DTS.
2024-10-17 10:57:18 +02:00
Anton Khirnov
6d6bd86f2b fftools/opt_common: stop accessing a private field
Stops printing the 'C' flag in -filters output, but it carries no
actionable information anyway.
2024-10-17 10:56:33 +02:00
Anton Khirnov
e79ac9312f fftools/ffmpeg_filter: use proper logging contexts 2024-10-17 10:56:30 +02:00
Anton Khirnov
ad50254ee1 fftools/ffmpeg_demux: use proper logging contexts everywhere 2024-10-17 10:52:02 +02:00
James Almer
e206e72b83 Revert "tests/fate: disable compression for zlib-based codecs"
This made the output non binary reproducible across different versions of
zlib.
This reverts commit bce5855afb.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-16 17:38:57 -03:00
Michael Niedermayer
d0927ed0a8 libavcodec/ffv1enc: Add option to select the quantization table
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-16 21:41:19 +02:00
Michael Niedermayer
81a360a5ed avcodec/ffv1: add a named constant for the quant table size
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-16 21:41:19 +02:00
Michael Niedermayer
2542e9296c avcodec/ffv1: RCT is only possible with RGB
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-16 21:41:18 +02:00
Anton Khirnov
31b5b3badc lavu/opt: deprecate av_opt_ptr()
It has no more internal callers, and we do not want to support direct
pointer access via AVOptions, as that constrains AVOption API
extensions.
2024-10-16 16:46:29 +02:00
Anton Khirnov
86460a0342 lavf/flvdec: replace a private option with a field in FFFormatContext
The demuxer's 'missing_streams' private option is used to communicate
information from the demuxer to avformat_find_stream_info(). However,
that is not only unnecessarily complicated, it also leaks internal
information to users, e.g. this option appears in the results of the
fate-flv-demux test.

Use a new field in FFFormatContext to communicate this information
instead.
2024-10-16 16:46:29 +02:00
Anton Khirnov
31da5222a4 lavf: replace FFFormatContext.prefer_codec_framerate with FF_INFMT_FLAG
There is no reason for this to be a dynamic property, as the only
demuxer using this sets it unconditionally.
2024-10-16 16:46:29 +02:00
Anton Khirnov
12e5116872 lavf: deprecate av_format_inject_global_side_data()
This function would otherwise fail to build on the next major bump, as
inject_global_side_data is marked for removal.

It should also never be needed, as there is now a mechanism for
supplying global side data to decoders directly.
2024-10-16 16:46:25 +02:00
Anton Khirnov
cb80ec0b6c lavf: move demuxing-specific fields from FFFormatContext to FormatContextInternal 2024-10-16 16:29:12 +02:00
Anton Khirnov
6d05e7e314 lavf: move muxing-specific fields from FFFormatContext to FormatContextInternal 2024-10-16 16:29:12 +02:00
Anton Khirnov
772911d3a8 lavf: add new struct for data private to generic layer
Trivial for now, will become more useful in future commits, as many
fields from FFFormatContext should not be visible to individual
(de)muxers.
2024-10-16 16:29:12 +02:00
Anton Khirnov
461a359abc lavf: add a header for generic-layer interfaces
Analogous to what was previously done in avcodec and avfilter.
2024-10-16 16:29:12 +02:00
Anton Khirnov
de49452bc1 lavf/internal: remove a prototype for non-existent function
ff_stream_side_data_copy() has been gone since
5432d2aaca
2024-10-16 16:29:12 +02:00
James Almer
1f7268a44d avcodec/vulkan_encode_h265: use the proper printf specifier for size_t
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-16 10:15:43 -03:00
James Almer
a61517598f avcodec/vulkan_encode_h264: use the proper printf specifier for size_t
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-16 10:14:48 -03:00
James Almer
cb2f5cf400 fate/vcodec: add a test for v410 pixel format raw video
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-16 10:05:55 -03:00
James Almer
03a88e56e0 fate/vcodec: stop using the deprecated v408 codec
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-16 10:05:55 -03:00
James Almer
5d07ec04f2 fate/vcodec: stop using the deprecated v308 codec
stddev and PSNR values change by the removal of format conversion and because
of the added sws_flags. Either or will have the same effect even on their own.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-16 10:05:55 -03:00
Nuo Mi
a144e7b92e avcodec/vvcdec: remove unused tb_pos_x0 and tb_pos_y0
This change will save approximately 531 MB for an 8K clip when processed with 16 threads.
The calculation is as follows:
7680 * 4320 * sizeof(int) * 2 * 2 * 16 / (4 * 4).
2024-10-16 20:28:09 +08:00
Nuo Mi
2e936f2c11 avcodec/vvdec: refact, ff_vvc_deblock_bs use CodingUnit/TransformUnit instead of fc->tabs
perf result for:
"perf record -F 99 ./ffmpeg_g -i  Tango2_3840x2160_60_10_420_27_LD.266 -f null -"

before: 5.24%
1.87%  ffmpeg_g  [.] vvc_deblock_bs_chroma
1.72%  ffmpeg_g  [.] ff_vvc_deblock_bs
1.65%  ffmpeg_g  [.] vvc_deblock_bs_luma

after: 3.48%
1.84%  ffmpeg_g  [.] vvc_deblock_bs_chroma
1.64%  ffmpeg_g  [.] ff_vvc_deblock_bs + vvc_deblock_bs_luma(inlined)
2024-10-16 20:28:09 +08:00
Nuo Mi
d78b43ecf8 avcodec/vvcdec: misc, move pcmf from min_tu_tl_init to min_cb_nz_tl_init
pcmf are cu level flags
2024-10-16 20:28:09 +08:00
Nuo Mi
634780f3cf avcodec/vvcdec: refact out deblock boundary strength stage
The deblock boundary strength stage utilizes ~5% of CPU resources for 8K clips.
It's worth considering it as a standalone stage. This stage has been relocated
to follow the parser process, allowing us to reuse CUs and TUs before releasing them.
2024-10-16 20:28:09 +08:00
David Rosca
48a1a12968 hw_base_encode: Free pictures on close
Fixes leaking recon surfaces with VAAPI.
2024-10-16 12:48:18 +02:00
Lynne
931d45d4d6 vulkan: do not create imageviews with video encode/decode usage
This function is only used for filtering and generic compute.
The issue is that a view inherits the usage flags from the image
by default, and the spec says the view format must be compatible
with the usage. VkImageViewUsageCreateInfo allows us to filter out
the indeded uses of the imageview.

Pffff.
2024-10-16 12:48:16 +02:00
Lynne
4b128de44a vulkan: enable selecting a compatible representation of format
When using **integer** images inside shaders, it turns out
that conversion doesn't automatically happen, but we need to
explicitly use the imageviews to get the image exposed as
a suitable representation for the shader.

Finally enables bitexact image representations.
2024-10-16 12:48:15 +02:00
Lynne
76e8afa8a6 hwcontext_vulkan: always enable MUTABLE creation flag
We need it even for something as simple as bitexact opening
of images.
2024-10-16 12:48:13 +02:00
Lynne
98f6d43146 vulkan: keep track of mapped memory in the buffer structure
Can/could be useful to know which buffers are mapped.
2024-10-15 17:45:20 +02:00
Lynne
4d19be287f libavfilter/Makefile: add a makefile for Vulkan shaders 2024-10-15 17:45:20 +02:00
Lynne
4e861ad8e0 libavcodec/Makefile: add a makefile for Vulkan shaders 2024-10-15 17:45:19 +02:00
Lynne
3afdfe830f vulkan: add support for AV_PIX_FMT_RGB96 2024-10-15 17:45:19 +02:00
Lynne
903f7f053a vulkan: add support for AV_PIX_FMT_RGBA128 2024-10-15 17:45:18 +02:00
Lynne
2336e68565 lavu: bump minor and add APIChanges entries for new 32bpc pixfmts 2024-10-15 17:45:18 +02:00
Lynne
4f387a1c4e lavu/pixfmt: add AV_PIX_FMT_RGB96 2024-10-15 17:45:17 +02:00
Lynne
281bba1d26 lavu/pixfmt: add AV_PIX_FMT_RGBA128
This format is useful for doing certain lossless transforms on images,
RCT in particular, which require you to escalate the size from 16 to
32 bits to avoid overflows.

APIchanges will be done alongside when comitting.
2024-10-15 17:45:12 +02:00
Anton Khirnov
9ce63e65d6 lavc/avcodec: fix global/private option precendence
Broken after 7753a9d627. Apply only the
whitelist early, and the rest with a single call to av_opt_set_dict2()
with AV_OPT_SEARCH_CHILDREN, which should be equivalent to the original
behaviour.

Reported-by: Cameron Gutman <aicommander@gmail.com>
2024-10-15 10:40:15 +02:00
Anton Khirnov
c961a72926 lavfi/vf_scale: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
4d69398dda lavfi/vf_remap: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
dcd5a51e0a lavfi/vf_mergeplanes: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
989bc256a3 lavfi/vf_mergeplanes: remove redundant assignment
It is already done in init.
2024-10-15 10:39:14 +02:00
Anton Khirnov
c19f3fe61b lavfi/vf_quirc: use FILTER_PIXFMTS_ARRAY() instead of query_formats() 2024-10-15 10:39:14 +02:00
Anton Khirnov
d83d8a1643 lavfi/vf_premultiply: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
4faf6c6f0d lavfi/vf_paletteuse: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
18e43c2d39 lavfi/vf_palettegen: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
c8344737b6 lavfi/vf_pad: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
64035fe206 lavfi/vf_overlay_qsv: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
0c86bc32aa lavfi/vf_overlay: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
d50a63b04e lavfi/vf_noise: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
271ec2ab28 lavfi/vf_mix: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
4b2580c184 lavfi/vf_lut2: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
57e81f36a4 lavfi/vf_lut: switch to query_func2() 2024-10-15 10:39:14 +02:00
Anton Khirnov
92981320b3 lavfi/vf_libplacebo: convert to query_func2()
Drop a redundant error message for out_format, as it is already
validated in init.
2024-10-15 10:39:14 +02:00
Anton Khirnov
8160178dfc lavfi/vf_libplacebo: move vulkan initialization to init
avfilter API requires all the filter parameters, including hw context
(if present) to be available during init, so that is the proper place to
perform such setup.
2024-10-15 10:39:14 +02:00
Anton Khirnov
c4822228b0 lavfi/vf_il: switch to query_func2() 2024-10-15 10:39:13 +02:00
Anton Khirnov
6929fc8845 lavfi/vf_hwupload_cuda: switch to query_func2() 2024-10-15 10:39:13 +02:00
Anton Khirnov
848256677d lavfi/vf_hwupload: switch to query_func2() 2024-10-15 10:39:13 +02:00
Anton Khirnov
036336296c lavfi/vf_hwupload: validate the hw device in init
Rather than query_formats(). Init is a more appropriate place, as
query_formats() is supposed to be free of side-effects.
2024-10-15 10:39:13 +02:00
Anton Khirnov
01458a0c8f lavfi/vf_hwdownload: switch to query_func2() 2024-10-15 10:39:13 +02:00
Anton Khirnov
6db8279325 lavfi/vf_hflip: switch to query_func2() 2024-10-15 10:39:13 +02:00
Anton Khirnov
d26ef934f3 lavfi/vf_frei0r: switch to query_func2() 2024-10-15 10:39:13 +02:00
Anton Khirnov
9e2a231236 fftools/ffmpeg_filter: treat apad filter as a source
Ideally lavfi should have a dedicated API for detecting this.

Fixes #11168 and #11061
2024-10-15 10:38:48 +02:00
Anton Khirnov
79c47dfd25 lavc/hevcdec: unbreak WPP/progress2 code
The "progress2" API in pthread_slice.c currently associates a progress
value with a thread rather than a job, relying on the broken assumption
that a job's thread number is equal to its job number modulo thread
count.

This removes this API entirely, and changes hevcdec to use a
ThreadProgress-based implementation that associates a
mutex/cond/progress value with every job.

Fixes races and deadlocks in hevdec with slice threading, e.g. some of
those mentioned in #11221.
2024-10-15 10:37:44 +02:00
Martin Schitter
c50f79a0dc doc/APIchanges: add missing entry for adding RGBF16
The missing APIchanges entry requested by A.Khirnov.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-15 10:36:54 +02:00
Martin Storsjö
38d08f5c45 configure: Only try to use the -no_warn_duplicate_libraries flag on Darwin
While we only add the flag if the linker seems to support it,
it turns out that ld.bfd had a bug where the flag is accidentally
accepted, and the flag produces an output file named
"_warn_duplicate_libraries".

The ld.bfd bug was fixed in binutils 2.36, in
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=3991c7acb29aa8d7d52150695eb3efa03a08dd50.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-15 09:53:14 +03:00
Michael Niedermayer
c1edec3a24 avcodec/ffv1enc: Fix RCT with RGB64
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-14 22:32:48 +02:00
Michael Niedermayer
10e5af15bf avcodec/ffv1dec: Fix end computation with ec=2
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-14 22:31:26 +02:00
Michael Niedermayer
8e52b15258 avcodec/ffv1enc: Move slice termination into threads
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-14 22:29:33 +02:00
Michael Niedermayer
d9269fcacf avcodec/ffv1enc: allow manually specifying the crc type
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-14 22:27:30 +02:00
Martin Schitter
d73b73af5e swscale/input: add input support for RGBF16
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-14 20:46:24 +02:00
Martin Schitter
c993a91bea avutil: add RGBF16 pix_fmt
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-14 20:46:24 +02:00
Martin Schitter
c72a5c486a swscale/input: add input support for RGBF32
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-14 20:46:23 +02:00
James Almer
fd8b0dcfed avutil/hwcontext_vulkan: add proper maps for XV3{0,6}
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-14 15:12:49 -03:00
Ramiro Polla
bce5855afb tests/fate: disable compression for zlib-based codecs
FATE results differ when using the original zlib and zlib-ng.

Since we don't need to test the result from zlib itself, this commit
disables compression on tests for zlib-based codecs, which ends up
giving the same results with both libraries.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-14 13:59:31 -03:00
Ramiro Polla
3661d1982d avcodec/flashsvenc: add compression_level option
This allows setting the compression level used by zlib.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-14 13:59:26 -03:00
James Almer
3827233187 avfilter/vsrc_testsrc: add missing alpha plane define
"A" was never being defined if yuvtestsrc was enabled but rgbtestsrc disabled.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-14 12:03:24 -03:00
James Almer
4f0514df62 fate/filter-video: add tests for packed YUV in yuvtestsrc
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-14 10:37:21 -03:00
James Almer
f2853002dd avfilter/vsrc_testsrc: add support for packed YUV formats in yuvtestsrc
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-13 20:54:07 -03:00
James Almer
667e22e85d avfilter/vsdc_testsrc: simplify yuvtest_fill_picture
Copy what's done for rgbtest_fill_picture.
It will be useful for the following commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-13 20:54:07 -03:00
James Almer
e347b4ff31 avformat/riff: map Y410 fourcc to RAWVIDEO decoder
md5 values change because the nut container now reports rawvideo as encoder
and Y410 as codec type instead of the bogus RGB[15].

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-13 20:44:09 -03:00
Alexander Strasser
b0ea76c9d1 lavc/dnxuc_parser: Use av_fourcc2str instead of av_fourcc_make_string
The documentation of av_fourcc_make_string states the passed in
buffer must be of at least the size of AV_FOURCC_MAX_STRING_SIZE .

Using av_fourcc2str uses the correct buffer size and moves the
buffer into a nested scope while also being shorter.

Fixes: CID 1632380
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2024-10-13 22:57:51 +02:00
Marth64
f46415f373 avformat/hlsenc: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block.

Signed-off-by: Marth64 <marth64@proxyid.net>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-10-13 23:04:20 +08:00
Marth64
95bb47de7d avformat/dashdec: format open_demux_for_component()
Signed-off-by: Marth64 <marth64@proxyid.net>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-10-13 23:03:21 +08:00
Marth64
7acc2ebd5d avformat/dashdec: check return code of avcodec_parameters_copy()
Signed-off-by: Marth64 <marth64@proxyid.net>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-10-13 23:03:19 +08:00
Marth64
6ee7555a90 avformat/dashdec: return ret directly in open_demux_for_component()
Signed-off-by: Marth64 <marth64@proxyid.net>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-10-13 23:03:15 +08:00
Jonathan Baecker
e6e9cb3ce7 libavformat/hlsplaylist: add subtitle_varname for naming subtitle streams
If 'sname:*' is set in the var_stream_map variable, use it as
the NAME attribute for subtitles. This improves the naming of
subtitle streams in HTML players, providing clearer and more
descriptive labels for users.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-10-13 23:01:59 +08:00
Jonathan Baecker
c7cf0df494 avformat/hlsenc: Respect omit_endlist flag in subtitle playlists
Ensure that when the `-hls_flags omit_endlist` option is set,
the `#EXT-X-ENDLIST` tag is also omitted from the `stream_vtt.m3u8`
subtitle playlist. This maintains consistency with the behavior
in other playlists when `omit_endlist` is specified.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-10-13 23:01:03 +08:00
Jonathan Baecker
425c323420 avformat/hlsenc: Respect append_list flag in subtitle
Ensure that when the `-hls_flags append_list` option is set,
that *.vtt files in stream_vtt.m3u8 are correctly updated.
This fixes https://trac.ffmpeg.org/ticket/11208

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-10-13 22:59:22 +08:00
Nicolas Gaullier
de976eaf30 avfilter/framesync: fix forward EOF pts
Note1: when the EOF pts is not accurate enough, the last frame
can be dropped by vf_fps with default rounding.

Note2: vf_scale use framesync since e82a3997cd,
so this is a very commonplace scenario.

For example:
./ffprobe -f lavfi testsrc=d=1,scale,fps -of flat \
  -count_frames -show_entries stream=nb_read_frames

Before:
streams.stream.0.nb_read_frames="24"

After:
streams.stream.0.nb_read_frames="25"

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-13 13:54:03 +02:00
asivery
31a63e4e01 avformat/oma: Demux oma-encapsulated AAC audio
Signed-off-by: asivery <asivery@protonmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-13 13:43:39 +02:00
Thomas Guillory
37863b92b7 libavfilter/vf_overlay: fix the displayed flags in CLI documentation
When displaying help for overlay filter in CLI, the flags for x and y
parameters don't have the T flag. However these two parameters do have
the capability to be set at runtime, as implemented in commit
d2752ef061. This commit fixes the CLI documentation.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-13 13:43:06 +02:00
vipyne
f5403e5f1e configure: suggest installing nasm before using --disable-x86asm
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-13 13:28:49 +02:00
Marvin Scholz
7e1d72589e avfilter/af_afftdn: use av_assert0 for unreachable assert
This is unreachable anyway so performance is not an issue here. Allows
guiding the compiler in all build modes to not emit a spurious warning
here:

  warning: variable 'mag' is used uninitialized whenever switch default is taken
2024-10-13 02:15:31 +02:00
James Almer
02306cbfee avcodec: deprecate v410 de/encoder
The V30X pixel format was recently added, so this lavc workaround is no longer
needed.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
3c64d614c7 avcodec: deprecate v308 de/encoder
The vyu444 pixel format was recently added, so this lavc workaround is no longer
needed.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
e2427a4223 avcodec: deprecate v408 de/encoder
The uyva pixel format was recently added, so this lavc workaround is no longer
needed.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
c5cf98d77e avformat/movenc: add support for V30X pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
12fc358249 avformat/movenc: add support for VYU444 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
d6b08e0c0f avformat/movenc: add support for UYVA pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
de923595fd avcodec/videotoolbox: choose AYUV pixel format when ideal
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
d41e5b0fc7 avutil/hwcontext_videotoolbox: add support for AYUV pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:14 -03:00
James Almer
8b208362ae avformat/riff: map v410 fourcc to RAWVIDEO decoder
There's no need to keep using a custom decoder for this pixel format.
md5 values change because the nut container now reports rawvideo as encoder.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:10 -03:00
James Almer
f6878a9b09 avformat/riff: map v308 fourcc to RAWVIDEO decoder
There's no need to keep using a custom decoder for this pixel format.
md5 values change because the nut container now reports rawvideo as encoder.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:21:06 -03:00
James Almer
b9653e3d3c avformat/riff: map v408 fourcc to RAWVIDEO decoder
There's no need to keep using a custom decoder for this pixel format.
md5 values change because the nut container now reports rawvideo as encoder.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:20:58 -03:00
James Almer
1f9a44a7fc avformat/riff: map y408 fourcc to RAWVIDEO decoder
md5 values change because the nut container now reports rawvideo as encoder.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 11:20:22 -03:00
James Almer
cd04ebe033 swscale/output: add V30X output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 10:08:29 -03:00
James Almer
57db8e0571 swscale/output: add VYU444 output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 10:08:29 -03:00
James Almer
eac9af382a swscale/output: add UYVA output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 10:08:29 -03:00
James Almer
6cd52c1080 swscale/output: add AYUV output support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 10:06:09 -03:00
James Almer
5f1bf3cd65 swscale/output: add missing yuv2packed1 and yuv2packed2 support for VUY{X,A}
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-12 09:56:23 -03:00
Rémi Denis-Courmont
1eb026dd8b riscv/vvc: fix UNDEF whilst initialising DSP
The current triggers an illegal instruction if the CPU does not support
vectors.
2024-10-12 09:23:33 +03:00
Ingo Brückl
5557c673ea avcodec/vaapi_encode: fix compilation without CONFIG_VAAPI_1
This adds VAAPIEncodeContext *ctx that has been removed
in aa82340b0c.

Signed-off-by: Ingo Brückl <ib@oddnet.de>
2024-10-12 09:10:30 +08:00
Lynne
0e19b05375 vulkan: fix layout qualifiers for 32-bit RGBA float storage reps
r8
r16/r16f
r32f

Sure, GLSL. Makes sense.
2024-10-12 00:38:49 +02:00
Lynne
8c47cf9eea hwcontext_vulkan: enable shaderBufferInt64Atomics if supported 2024-10-11 23:54:23 +02:00
Lynne
168e8ae9bf hwcontext_vulkan: add support for AV_PIX_FMT_RGBF32 2024-10-11 23:54:23 +02:00
Lynne
d55a351741 hwcontext_vulkan: add support for AV_PIX_FMT_RGBAF32 2024-10-11 23:54:22 +02:00
Lynne
1addd0fdca vulkan: use correct signed image type for storage images
Using signed or unsigned integer formats/layouts requires that
"uimage" or "iimage" are used.
2024-10-11 23:54:22 +02:00
Lynne
c982376076 vulkan: extend ff_vk_shader_rep_fmt to be useful for bitexactness
The original either reported 8 or 16-bit conversion from the
original, rather than being able to return the actual original.

This makes it usable in a situation where preserving exactness
is required.
2024-10-11 23:54:18 +02:00
James Almer
bd6283342c avcodec/hevc/ps: add a range check for sps_max_sub_layers
It can't be higher than vps_max_sub_layers.

Do this while keeping the workaround for qsvenc_hevc calling ff_hevc_parse_sps()
without a vps_list, as in some cases it needs to parse an sps to generate a fake
vps derived from it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-11 16:17:48 -03:00
James Almer
3290692d18 avcodec/hevc/ps: return a proper error code when we don't support parsing an sps
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-11 16:10:45 -03:00
James Almer
1cead90292 avutil/pixdesc: use a bigger variable type when writing bitstream formats
Fixes fate-imgutils and fate-pixelutils under gcc-usan after
29ea34728f.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-10 16:03:22 -03:00
Michael Niedermayer
7bb283aa7b avcodec/ffv1: Implement CRC with non zero initial and final value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-10 19:34:10 +02:00
Michael Niedermayer
b7ff66a358 avcodec/ffv1enc: Prevent generation of files with broken slices
Fixes: Ticket5548

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-10 19:34:09 +02:00
Anton Khirnov
0f5592cfc7 fftools/ffmpeg: supply hw device context to probe-filtergraphs
I.e. those that are only used to figure out input/output counts, since
some filters might expect a valid hw device in init and refuse to
initalize otherwise.

This requires complex filtergraphs to be created in a separate step
after parsing global options, after all hw devices are guaranteed to
exist.
2024-10-10 09:09:29 +02:00
Anton Khirnov
84c2ca6fa0 fftools/ffmpeg_filter: do not leak graph_desc on fg_create() failure
fg_create() is passed a malloced string and assumed to always take
ownership of it.
2024-10-10 09:09:29 +02:00
Anton Khirnov
181c204145 fftools/ffmpeg_opt: add a struct to be passed as opaque to global-option handlers
Will be useful in following commits.
2024-10-10 09:09:29 +02:00
Anton Khirnov
840b95bcc2 fftools/cmdutils: do not treat single '-' as an option in locate_option()
Fixes early parsing of trailing -v/-loglevel while using '-' to output
to stdout.
2024-10-10 09:09:29 +02:00
Anton Khirnov
e56d676050 fftools/cmdutils: group related calls together
For readability only, should have no functional effect.
2024-10-10 09:09:29 +02:00
Michael Niedermayer
c4122406f6 avformat/matroskadec: Check desc_bytes so bits fit in 64bit
Likely a tighter check can be done

Fixes: signed integer overflow: 3305606804154370442 * 8 cannot be represented in type 'long'
Fixes: 70449/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4771166007918592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-09 21:26:47 +02:00
Michael Niedermayer
057b8c2066 avformat/mov: Avoid overflow in dts
This basically ignores the overflow without undefined behavior, alternatively we could detect and error out

Fixes: signed integer overflow: 6310596683470275584 + 7660622966157213696 cannot be represented in type 'long'
Fixes: 70433/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5483347233538048
Fixes: 369662284/clusterfuzz-testcase-minimized-media_metadata_parser_fuzzer-5327368763670528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-09 21:26:46 +02:00
Martin Schitter
6701534102 libavcodec/dnxuc_parser: DNxUncompressed essence parser
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-09 18:19:25 +02:00
Martin Schitter
3cb648d569 libavformat/mxf: Add ULs for DNxUncompressed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-09 18:19:25 +02:00
Martin Schitter
887726a7aa libavcodec/: Add ID and desc for DNxUncompressed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-09 18:19:18 +02:00
Min Chen
37842f2caa avcodec/mfenc: add support for AV1 MF encoders
Signed-off-by: Dash Santosh <dash.sathyanarayanan@multicorewareinc.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-09 16:30:37 +03:00
Martin Storsjö
6668268e16 checkasm: lls: Use relative tolerances rather than absolute ones
Depending on the magnitude of the output values, the potential
errors can be larger.

This fixes errors in the lls tests on x86_32 for some seeds,
observed with GCC 11 (on Ubuntu 22.04, with the distro compiler,
with -m32).

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-09 15:52:56 +03:00
Martin Storsjö
77e6293735 arm: Consistently use proper interworking function returns
Use "bx lr", or "pop {lr}", which do proper mode switching
between thumb and arm modes. A plain "mov pc, lr" does not switch
from thumb mode to arm mode (while in arm mode, it does switch
mode for a thumb caller).

This is normally not an issue, as CONFIG_THUMB only is enabled if
the C compiler defaults to thumb; but stick to patterns that can
do mode switching if needed, for consistency.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-09 15:52:51 +03:00
Niklas Haas
ec9985b54f swscale/internal: constify and expose ff_swscale()
Used as an intermediate entry point for the new swscale context. The extra
constification is a consistency measure, as I want to move the memcpy of
stride and plane pointers to the functions that actually need to mutate them.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-09 13:18:08 +02:00
Niklas Haas
403a20b2e6 swscale/rgb2xyz: expose these functions internally
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-09 13:17:17 +02:00
Niklas Haas
775de8c19d swscale/rgb2xyz: follow convention on image pointers and strides
Instead of taking an int16_t pointer and a stride in halfwords, follow the
usual convention of treating all planes and strides as byte-addressed.

This does not have any immediate effect but makes these functions more
reusable without unintended "gotchas".

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-09 13:14:57 +02:00
Niklas Haas
9d8f5141cf swscale/rgb2xyz: add explicit width parameter
This fixes an 11-year-old bug in the rgb2xyz functions, when used with a
negative stride. The current loop bounds turned it into a no-op.

Additionally, this increases performance on highly cropped images, whose
stride may be substantially higher than the effective width.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-09 13:14:57 +02:00
Niklas Haas
ea228fc415 swscale/rgb2xyz: minor style fixes
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-09 13:14:57 +02:00
James Almer
04612351ab swscale/input: add V30X input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 22:26:07 -03:00
James Almer
ea05edc9e0 swscale/input: add VYU444 input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 22:24:47 -03:00
James Almer
ec7f5e314d swscale/input: add UYVA input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 22:24:47 -03:00
James Almer
bb37d3c33e swscale/input: add AYUV input support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 22:24:47 -03:00
Lynne
80a0567a2f vulkan: fix ImageView flexible array struct allocation
Same as the previous commit, the compiler may insert padding.
Thanks to Marvin Scholz for pointing this out.
2024-10-09 02:39:34 +02:00
Marvin Scholz
f5e2914a89 libavutil/vulkan: fix flexible array struct allocation
The flexible array member struct can have padding added by
the compiler which was not taken into account properly, which
could lead to a heap buffer overflow.
2024-10-09 02:36:12 +02:00
jinbo
e6ecc1e757 swscale: Fix conflicting types for loongarch
Build breaks after c1a0e65763

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-09 01:55:50 +02:00
Martin Schitter
6a735e3388 RELEASE: update release number after release/7.1 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-09 01:55:50 +02:00
Lynne
4ad4f8101a hwcontext_vulkan: set hwctx->device_features
This was forgotten during the recent device feature refactor.
2024-10-09 01:01:32 +02:00
Lynne
31def0c3ce hwcontext_vulkan: remove redundant hostQueryReset setting
Its set just a few lines earlier.
2024-10-09 01:01:32 +02:00
Lynne
b8d1b4358b vulkan: add a #define when printf debugging is enabled 2024-10-09 01:01:31 +02:00
Lynne
204558cee8 configure: explicitly disable spirv_compiler
spirv_compiler is an undeclared variable that was spontaneously
enabled if libshaderc or libglslang were detected, and served as
a way to enable filters.

However, it being undeclared had the effect that it was neither
considered explicitly disabled nor enabled if libshaderc or
libglslang were detected.

The only category we have which explicitly disables variables
is EXTERNAL_LIBRARY_LIST, however, spirv_compiler is not a real
external library, and making it present there would report its
detection on ./configure.
2024-10-09 00:59:33 +02:00
Lynne
57b7e96b04 configure: add spirv_compiler to avfilter_suggest as well
If someone were to enable libglslang/libshaderc, and then disable
all Vulkan filters, they would have the same issue as the earlier
fix for libavcodec.
2024-10-09 00:59:27 +02:00
James Almer
29ea34728f avutil/pixfmt: add V30X pixel format
This maps to the 444YpCbCr10 pixel format as defined by Apple.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 19:45:10 -03:00
James Almer
1f9424e0b1 avutil/pixfmt: add VYU444 pixel format
This maps to the 444YpCbCr8 pixel format as defined by Apple, which is ordered
Cr Y' Cb.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 14:10:07 -03:00
James Almer
dc3ef53819 avutil/pixfmt: add UYVA pixel format
This maps to the 4444YpCbCrA8 pixel format as defined by Apple, which is ordered
Cb Y' Cr A.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 14:10:07 -03:00
James Almer
263108a504 avutil/pixfmt: add AYUV pixel format
This maps to the 4444AYpCbCr8 pixel format as defined by Apple, which is ordered
A Y’ Cb Cr.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 14:10:07 -03:00
James Almer
2e79690a70 avutil/pixfmt: extend the VUY{A,X} description
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-08 14:10:07 -03:00
Niklas Haas
477445722c swscale/ppc: fix altivec build failure
Fixes: c1a0e65763
2024-10-08 16:45:36 +02:00
Martin Storsjö
b9145fcab2 swscale: Fix aarch64 and i386 compilation failures
This unbreaks builds after c1a0e65763,
which broke with errors like

src/libswscale/aarch64/rgb2rgb.c:66:25: error: incompatible function pointer types assigning to 'void (*)(const uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int, int, int, int, const int32_t *)' (aka 'void (*)(const unsigned char *, unsigned char *, unsigned char *, unsigned char *, int, int, int, int, int, const int *)') from 'void (const uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int, int, int, int, int32_t *)' (aka 'void (const unsigned char *, unsigned char *, unsigned char *, unsigned char *, int, int, int, int, int, int *)') [-Wincompatible-function-pointer-types]
   66 |         ff_rgb24toyv12  = rgb24toyv12;
      |                         ^ ~~~~~~~~~~~

and

src/libswscale/aarch64/swscale_unscaled.c:213:29: error: incompatible function pointer types assigning to 'SwsFunc' (aka 'int (*)(struct SwsContext *, const unsigned char *const *, const int *, int, int, unsigned char *const *, const int *)') from 'int (SwsContext *, const uint8_t *const *, const int *, int, int, const uint8_t **, const int *)' (aka 'int (struct SwsContext *, const unsigned char *const *, const int *, int, int, const unsigned char **, const int *)') [-Wincompatible-function-pointer-types]
  213 |         c->convert_unscaled = nv24_to_yuv420p_neon_wrapper;
      |                             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-08 09:29:07 +03:00
Niklas Haas
73b3344edd swscale/input: parametrize ff_sws_init_input_funcs() pointers
Following the precedent set by ff_sws_init_output_funcs().

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
20b350b284 swscale/internal: add typedefs for input reading functions
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
b90d522d2c swscale/internal: forward typedef SwsContext
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
c1a0e65763 swscale/internal: constify SwsFunc
I want to move away from having random leaf processing functions mutate
plane pointers, and while we're at it, we might as well make the strides
and tables const as well.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
286bdc9cdc swscale/internal: turn cascaded_tmp into an array
Slightly more convenient to access from the new wrapping code.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
61369484f6 swscale/internal: expose ff_update_palette() internally
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
aee19ee431 swscale/internal: rename NB_SWS_DITHER for consistency
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
41ce370b65 tests/swscale: fix minor typos
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-10-07 19:51:34 +02:00
Niklas Haas
bed919efaa avfilter/src_movie: configure correct YUV attributes
Missed by the YUV negotiation series.
2024-10-07 19:51:34 +02:00
James Almer
362586fcad avfilter/vf_xpsnr: remove duplicated DSP infranstructure
Fully reuse the existing one from vf_psnr, instead of halfways.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-07 09:33:52 -03:00
Anton Khirnov
496b8d7a13 fftools/ffmpeg_filter: stop setting a no-op option 2024-10-07 10:53:13 +02:00
Anton Khirnov
26ae8d1891 lavfi/avfilter: drop ff_ prefixes from static functions 2024-10-07 10:53:13 +02:00
Anton Khirnov
d3739dcbec lavfi/avfilter: make ff_inlink_evaluate_timeline_at_frame() static
It is not used outside of avfilter.c
2024-10-07 10:53:13 +02:00
Anton Khirnov
6647e57dcb lavfi/avfilter: document AVFilterContext.is_disabled as private
Ideally there should be three parts to the filter context - public,
private to the filter, and private to generic code, but only the first
and the last of these exist currently. Until the second is implemented,
this is better than nothing.
2024-10-07 10:53:13 +02:00
Anton Khirnov
4472bddb18 lavfi/avfilter: move AVFilterContext.command_queue to FFFilterContext
It is private to generic filtering code.
2024-10-07 10:53:09 +02:00
Anton Khirnov
71f176e3ce lavfi/avfilter: move AVFilterContext.{enable,var_values} to FFFilterContext
They are private to generic filtering code.
2024-10-07 10:52:48 +02:00
Anton Khirnov
b1247e7c1f lavfi/avfilter: move AVFilterContext.ready to FFFilterContext
This field is private to the generic filtering code.
2024-10-07 10:47:18 +02:00
Anton Khirnov
e0eec71a13 lavfi/vf_geq: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
a81061b911 lavfi/vf_hwmap: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
eb0c9670b4 lavfi/vf_format: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
cfbb6e9f5d lavfi/vf_fieldorder: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
977059718b lavfi/vf_fieldmatch: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
4863570d49 lavfi/vf_fieldhint: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
637b242ec3 lavfi/vf_feedback: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
4011304102 lavfi/vf_fade: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
2161abaecf lavfi/vf_elbg: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
f59c1b8a0c lavfi/vf_edgedetect: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
87a619c549 lavfi/vf_drawtext: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
9ebdaa6c7d lavfi/vf_detelecine: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
f8574da8e5 lavfi/vf_deband: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
eff406f5dd lavfi/vf_datascope: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
a92052cb97 lavfi/vf_crop: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
da8cc791e2 lavfi/vf_copy: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
bc418fd872 lavfi/vf_colorspace: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
631e5bcdc7 lavfi/vf_ciescope: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
95c9c1c2be lavfi/vf_boxblur: switch to query_func2() 2024-10-07 10:46:43 +02:00
Anton Khirnov
7ab1ddbaf3 lavfi/vf_alphamerge: switch to query_func2()
Simplify the implementation by using the fact that ff_set_common_*()
will ignore those links on which the formats have already been set.
2024-10-07 10:46:43 +02:00
Anton Khirnov
a2881814b8 doc/ffmpeg.texi: add a diagram for the loopback decoder example 2024-10-07 10:45:10 +02:00
Anton Khirnov
794308c61b doc/ffmpeg: rewrite the detailed description chapter
Split it into sections that describe in detail
* the components of the transcoding pipeline
* the main features it handles, in order of complexity
    * streamcopy
    * transcoding
    * filtering

Replace the current confusing/misleading diagrams with new ones that
actually reflect the program components and data flow between them.
2024-10-07 10:45:07 +02:00
Lynne via ffmpeg-devel
f339169f35 configure: add spirv_compiler to avcodec_suggest
893f3fde4c made libavcodec link to libshaderc/libglslang, though
no codecs depend on it at this immediate moment.

This was merged largely as a coordination effort to synchronize three
different developers' repositories to allow them to send patches without
overlapping functionality in between.

This line can be removed once the first component to depend on spirv_compiler
lands, but leaving it in is fine too.
2024-10-06 21:11:05 +02:00
James Almer
a77365d864 configure: include liblcevc_dec ldflags in avcodec_extralibs
This is more in line with other optional libraries, instead of littering avcodec_suggest.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-06 10:42:15 -03:00
Lynne
6871fd3170 vulkan: always enable GL_EXT_control_flow_attributes 2024-10-06 07:13:04 +02:00
Lynne
8c250da8f3 vulkan: always enable GL_EXT_shader_explicit_arithmetic_types
Implicit types were a mistake.
lowp/mediump/highp was a sin.
2024-10-06 07:12:59 +02:00
Lynne
9391d4ccc5 lavu/vulkan_spirv: use correct inclusion guards
Forgot to change them after moving the file over from libavfilter.
2024-10-06 06:04:36 +02:00
IndecisiveTurtle
f456522e32 avcodec/vulkan: Add support for generating GLSL strings from comp shaders 2024-10-06 01:32:51 +02:00
IndecisiveTurtle
d80676117a libavutil/vulkan: Prevent crash on shaders with no descriptors
Needed to prevent crashes on vc2 vulkan encoder patch
2024-10-06 01:32:50 +02:00
Lynne
969c271a5a x86/lpc: remove HAVE_AVX2_EXTERNAL checks 2024-10-06 01:32:49 +02:00
Lynne
892f64ad9b x86/tx_float: remove HAVE_AVX2_EXTERNAL checks
It'll always be enabled.
Thanks, nasm.
2024-10-06 01:32:49 +02:00
Lynne
b17a240c8d Revert "x86/tx_float: set all operands for shufps"
This reverts commit 74f5fb6db8.
2024-10-06 01:32:49 +02:00
Lynne
24c5a58e55 Revert "x86/tx_float: add missing check for AVX2"
This reverts commit f4097e4c1f.
2024-10-06 01:32:48 +02:00
Lynne
bf643f989b Revert "x86/tx_float: add missing preprocessor wrapper for AVX2 functions"
This reverts commit 750f378bec.
2024-10-06 01:32:48 +02:00
Lynne
b890482d05 Revert "x86/tx_float: change a condition in a preprocessor check"
This reverts commit 0d8f43c74d.
2024-10-06 01:32:47 +02:00
Lynne
2f888fb99e configure: drop yasm support
We started defauling to nasm 8 years ago.
We are still compatible with yasm 0.8.0, released in 2009. **15 years ago**.
The time has more than come to remove support for it.

Maintaining compatibility started cutting into writing new code long ago.
We still can't have 2-argument instructions, preprocessor booleans, and all
AVX2 code must still be wrapped in ifdefs. Newly added code often breaks this.
2024-10-06 01:32:47 +02:00
Lynne
73d2cb1c2b nlmeans_vulkan: remove unused forward declaration 2024-10-06 01:32:46 +02:00
Lynne
e3d3ee516a bwdif_vulkan: split off main shader code as a separate file
The code to support this was still there, may as well use it.
2024-10-06 01:32:46 +02:00
Lynne
6756136c92 libavfilter/Makefile: fix tag for Vulkan .comp files 2024-10-06 01:32:46 +02:00
Lynne
4a557baaa1 vulkan_encode: do not align DPB buffer size
Per subsection B stroke 165 of Chapter 56,
drivers are required to do the aligning, not users.
2024-10-06 01:21:45 +02:00
Lynne
893f3fde4c lavc/vulkan: add SPIR-V compilation support
This is the same as with libavfilter.

We will need SPIR-V compilation for at least three different things,
like the VC-2 encoder and decoder, AV1 film grain synthesis for
hardware with no support for it, and possibly other codecs.
2024-10-06 01:21:44 +02:00
Lynne
0a1f8107bb vulkan: move SPIR-V compilation code to libavutil
The code is not currently used by libavutil, its just where our
common Vulkan code is.
Since SPIR-V compilation will be needed by lavc, move it, rather
than having lavc including lavfi.
2024-10-06 01:21:44 +02:00
Lynne
fcd1cdcb7b lavc/vulkan: remove redundant header 2024-10-06 01:21:43 +02:00
Lynne
4c88186d5d lavfi/vulkan: remove redundant header 2024-10-06 01:21:41 +02:00
James Almer
57d7ba4c4f avcodec/aac/aacdec: add a missing wrapper to an AAC USAC function call
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-05 18:07:34 -03:00
James Almer
e907bf677a avformat/mov: split off lcevc stream group initialization to its own function
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-05 14:36:28 -03:00
James Almer
d5eb0e7fb3 avformat/mov: split off heif item initialization to its own function
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-05 14:36:28 -03:00
James Almer
cdda4c4d50 avcodec/packet: fix doxy references in AVPacketSideData
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-05 14:36:04 -03:00
James Almer
4a098eabf9 avcodec/hevc/ps: print a more accurate message when parsing an SPS for an unsupported layer
With multilayer001.heic:

Before:
[hevc @ ...] Scalability type 2 not supported
[hevc @ ...] Ignoring unsupported VPS extension
[hevc @ ...] The following bit-depths are currently specified: 8, 9, 10 and 12 bits, chroma_format_idc is 0, depth is 0

After:
[hevc @ ...] Scalability type 2 not supported
[hevc @ ...] Ignoring unsupported VPS extension
[hevc @ ...] SPS 1 references an unsupported VPS extension. Ignoring

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-05 14:36:04 -03:00
James Almer
32e34692fb avcodec/hevc/ps: print the correct unsupported scalability value found
With multilayer001.heic, which signals Spatial scalability:

Before:
[hevc @ ...] Scalability type 1 not supported
[hevc @ ...] Ignoring unsupported VPS extension

After:
[hevc @ ...] Scalability type 2 not supported
[hevc @ ...] Ignoring unsupported VPS extension

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-05 14:36:04 -03:00
Gyan Doshi
099f88b864 avcodec/libx265: unbreak build for X265_BUILD >= 213
Earlier, x265 made an API change to support alpha and
other multiple layer pictures. We added guards to accommodate
that in 1f801dfdb5

They have now reverted that API change in
https://bitbucket.org/multicoreware/x265_git/commits/78e5b703b1

Updated our wrapper guards to unbreak build again.
2024-10-05 20:18:47 +05:30
Martin Storsjö
2705c0bd81 configure: Enable -Wno-implicit-const-int-float-conversion if available
This silences a lot of compile warnings (around 160 instances at least), when
compiling with Clang.

These warnings look like this:

    libavformat/http.c:176:133: warning: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
      176 |     { "end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D },
          |     ~                                                                                                                               ^~~~~~~~~

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-04 22:57:51 +03:00
Martin Storsjö
5c4ede6b4f libavcodec: x86: Remove an explicit include of config.asm
This file is never included explicitly anywhere else, it's only
included implicitly by passing -Pconfig.asm on the command line.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-04 22:57:38 +03:00
Martin Storsjö
a27f3c590f av1dec: Don't crash if decoding of some frames have failed
If decoding with hwaccel, but decoding fails, these pointers
are null at this point.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-04 22:57:03 +03:00
Nuo Mi
846fbc395b avcodec/vvc: simplify priority logical to improve performance for 4K/8K
For 4K/8K video processing, it's possible to have over 1,000 tasks pending on the executor.
In such cases, O(n) and O(log(n)) insertion times are too costly.
Reducing this to O(1) will significantly decrease the time spent in critical sections

clip                                                        | before | after  | delta
------------------------------------------------------------|--------|--------|-------
VVC_HDR_UHDTV2_OpenGOP_7680x4320_50fps_HLG10.bit            |    24  |   27   |  12.5%
VVC_HDR_UHDTV2_OpenGOP_7680x4320_50fps_HLG10_HighBitrate.bit|    12  |   17   |  41.7%
tears_of_steel_4k_8M_8bit_2000.vvc                          |    34  |  102   | 200.0%
VVC_UHDTV1_OpenGOP_3840x2160_60fps_HLG10.bit                |   126  |  128   |   1.6%
RitualDance_1920x1080_60_10_420_37_RA.266                   |   350  |  378   |   8.0%
NovosobornayaSquare_1920x1080.bin                           |   341  |  369   |   8.2%
Tango2_3840x2160_60_10_420_27_LD.266                        |    69  |   70   |   1.4%
RitualDance_1920x1080_60_10_420_32_LD.266                   |   243  |  259   |   6.6%
Chimera_8bit_1080P_1000_frames.vvc                          |   420  |  392   |  -6.7%
BQTerrace_1920x1080_60_10_420_22_RA.vvc                     |   148  |  144   |  -2.7%
2024-10-04 21:58:42 +08:00
Nuo Mi
40a14ef970 avcodec/executor: remove unused ready callback
Due to the nature of multithreading, using a "ready check" mechanism may introduce a deadlock. For example:

Suppose all tasks have been submitted to the executor, and the last thread checks the entire list and finds
no ready tasks. It then goes to sleep, waiting for a new task. However, for some multithreading-related reason,
a task becomes ready after the check. Since no other thread is aware of this and no new tasks are being added to
the executor, a deadlock occurs.

In VVC, this function is unnecessary because we use a scoreboard. All tasks submitted to the executor are ready tasks.
2024-10-04 21:58:42 +08:00
Nuo Mi
8446e27bf3 avcodec: make a local copy of executor
We still need several refactors to improve the current VVC decoder's performance,
which will frequently break the API/ABI. To mitigate this, we've copied the executor from
avutil to avcodec. Once the API/ABI is stable, we will move this class back to avutil
2024-10-04 21:58:42 +08:00
Marvin Scholz
f25c9cc213 fftools: log unconnected filter output label 2024-10-04 14:27:20 +02:00
Marvin Scholz
5beeb3a1f9 fftools: do not access out of bounds filtergraph
The log message was logged for `filtergraphs[j]` which would cause a
heap buffer overflow in certain circumstances.

Correctly it should be logged for the current filtergraph, so just
use `fg` here.
2024-10-04 14:27:20 +02:00
Lynne
ac092c6707 hwcontext_vulkan: guard all uses of new spec defines and fix stray bracket
This fixes compilation with less recent Vulkan headers.
2024-10-04 10:41:03 +02:00
Lynne
a304cbeb8d vulkan: add profiling debug setting
This simply keeps all shader optimizations, but allows debug
data to be generated.
2024-10-04 10:10:46 +02:00
Lynne
832947be02 vulkan: don't enable GL_EXT_buffer_reference by default
Only nlmeans_vulkan uses it.
2024-10-04 10:10:45 +02:00
Lynne
2bb0b6dd2c vulkan_shaderc: add more stages, target Vulkan 1.3 and only output debug if needed 2024-10-04 10:10:45 +02:00
Lynne
a2a983e1d0 vulkan_glslang: add more stages, target Vulkan 1.3 and output debug info 2024-10-04 10:10:45 +02:00
Lynne
0bc4e03322 lavfi/*vulkan: forward FFVulkanContext to SPIR-V compilers
We need to know what extensions are supported.
2024-10-04 10:10:44 +02:00
Lynne
356d1cc8ff vulkan: parse instance list and add the DEBUG_UTILS extension
Required to let users know whether debugging is active.
2024-10-04 10:10:44 +02:00
Lynne
e3676d96cb hwcontext_vulkan: move device feature struct setup to a new function 2024-10-04 10:10:43 +02:00
Lynne
535e5eb7f3 hwcontext_vulkan: enable VK_KHR_shader_relaxed_extended_instruction 2024-10-04 10:10:43 +02:00
Lynne
0d5bfd0b21 vulkan_functions: change extension type to a typedef uint64_t
We were getting a bit too close for comfort to the 32-bit limit
on enums.
2024-10-04 10:10:42 +02:00
Lynne
d80f9f55c8 vulkan: always enable GL_EXT_scalar_block_layout
This makes std430 (which we use everywhere already) fully match C
layout.
Extension was made mandatory in 1.2.
2024-10-04 10:10:42 +02:00
Lynne
37d5cb84e8 vulkan: check if current buffer has finished execution before picking another
This saves resources, as dependencies are freed/reclaimed with a lower latency,
and provies a speedup.
2024-10-04 10:10:42 +02:00
Lynne
877c5a9692 vulkan: use shader objects if supported
Shader objects finally allow completely independent shaders.
2024-10-04 10:10:41 +02:00
Lynne
d233d9902f vulkan: move shader data execution state to execution pools
This finally permits using fully compiled shaders across
multiple execution contexts.
2024-10-04 10:10:41 +02:00
Lynne
0a37d5a3b1 vulkan: merge FFVkSPIRVShader and FFVkPipeline into FFVkShader
Pipelines are just shaders. There's no reason to treat them
differently.
This also lets us implement shader objects and is an overall
cleanup.
2024-10-04 10:10:36 +02:00
Anton Khirnov
aad4d5745d lavfi/vsrc_testsrc: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
28bde4a141 lavfi/vaf_spectrumsynth: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
3824ee2faf lavfi/vf_stack_{vaapi,qsv}: replace query_formats with a pixfmt list 2024-10-04 10:03:34 +02:00
Anton Khirnov
014a4214a9 lavfi/src_movie: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
55c99fb9c4 lavfi/src_avsynctest: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
534eef2ace lavfi/qrencode: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
f10986a5ec lavfi/f_streamselect: drop useless query_formats() callback
It achieves the same effect as ff_default_query_formats(), which gets
called implicitly.
2024-10-04 10:03:34 +02:00
Anton Khirnov
a6f579544a lavfi/f_select: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-10-04 10:03:34 +02:00
Anton Khirnov
9e1184b122 lavfi/f_graphmonitor: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
60192367a8 lavfi/f_ebur128: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-10-04 10:03:34 +02:00
Anton Khirnov
4e66d0c5d0 lavfi/f_drawgraph: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
670530a927 lavfi/buffersrc: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
a7fe27f964 lavfi/buffersrc: validate hw context presence in video_init()
That is the more appropriate place for it than query_formats().
2024-10-04 10:03:34 +02:00
Anton Khirnov
2fa142f7c0 lavfi/buffersink: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
b8bf2f4e17 lavfi/buffersink: move channel layout parsing to init
That is a more appropriate place for this, and will also be useful in
future commits.
2024-10-04 10:03:34 +02:00
Anton Khirnov
2aad37ffb5 lavfi/buffersink: move the option sanity check to init
Options are set before init, so that is the appropriate place to
validate them.
2024-10-04 10:03:34 +02:00
Zhao Zhili
eff9ed7bff avcodec/mediacodecenc: Fix access of uninitialized value
When crop is skipped, av_strlcatf will access `str` which isn't
initialized properly.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-04 15:43:57 +08:00
Michael Niedermayer
556c767786 avcodec/ffv1enc: Correct error message about unsupported version
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-03 22:05:46 +02:00
James Almer
358fdf3083 avfilter: add missing build deps to msad filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:44:49 -03:00
James Almer
b094c47ab2 fate/mov: add a test for heic images with cropping and rotation metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
650ce61745 avformat/mov: don't abort on invalid clap box data
Unless explode is requested.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
7573f02840 avformat/mov: get heif image mirroring from imir box
Complements 76eb3e5ff3.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
f225e6f3c6 avformat/mov: parse clap boxes that reference heif items
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
ba6eeb2c65 avformat/mov: parse colr boxes that reference tile grids
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
58c265d956 avformat/mov: factorize getting the current item
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
Tobias Rapp
c8cc58a13d avcodec/dxva2: Fix compilation with Mingw-w64
Adds missing ifdef guards to function prototypes depending on definitions from
dxva.h which are not available in Mingw-w64 version 4.0. The configure script
already checks for HEVC/VP9 types in dxva.h.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-10-02 17:28:30 +02:00
Martin Storsjö
a7449e4cbb libavcodec: Makefile: Move the librsvg entry to the right section
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:25:34 +03:00
Martin Storsjö
04a59bcac4 libavutil: Makefile: Fix alphabetical order for the film_grain_params files
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:25:14 +03:00
Martin Storsjö
4d204aa29b videotoolbox: Fix indentation of old existing code
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:24:17 +03:00
Jan Ekström
f9c5c5358c avcodec/videotoolbox: add AV1 hardware acceleration
Use AV1DecContext's current_obu to access the original OBUs, and
feed them to videotoolbox, rather than the bare slice data passed
via decode_slice.

This requires a small addition to AV1DecContext, for keeping track
of the current range of OBUs that belong to the current frame.

Co-authored-by: Ruslan Chernenko <ractyfree@gmail.com>
Co-authored-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:19:27 +03:00
Michael Niedermayer
7151081e33 avcodec/ffv1: Store and reuse sx/sy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-01 19:22:35 +02:00
Michael Niedermayer
7d514655bf avcodec/ffv1enc: Slice combination is unsupported
We always write minimal slices, the size calculation is wrong in some
corner cases but as its always 1x1 (minus1) we can for now just hard-code it

This helps with ticket 5548

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-01 19:22:35 +02:00
Michael Niedermayer
417b163c00 avcodec/ffv1enc: 2Pass mode is not possible with golomb coding
"Fixes" Ticket7063

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-01 19:22:35 +02:00
Tomas Härdin
25d605d080 lavf/mxfdec: Remove a call to avio_tell() in klv_read_packet() 2024-10-01 18:57:19 +02:00
Tomas Härdin
649ac17efd lavf/mxfdec: Speed up mxf_edit_unit_absolute_offset()
This involves computing the approximate location of the desired index table segment and linearly searching from there.
2024-10-01 18:57:19 +02:00
Tomas Härdin
e3fa469a55 lavf/mxfdec: Speed up klv_read_packet() 2024-10-01 18:57:19 +02:00
Anton Khirnov
262e6f8430 lavfi/avfilter: export AVFilter initialization state
This will allow the AVOption code to detect setting non-runtime options
after the filter has been initialized.
2024-10-01 09:57:58 +02:00
Anton Khirnov
0548ab2e42 lavu/log,opt: detect setting non-runtime options post-init
Add a mechanism to AVClass to allow objects to signal their state to
generic code. When an object flags itself with the 'initialized' state,
print an error (and fail, after the next major bump) if the caller
attempts to set non-runtime options.
2024-10-01 09:57:57 +02:00
Anton Khirnov
3785b27b76 lavu/opt: consolidate common prologue for av_opt_set*()
The options-setting functions share several operations at their
beginnings - locating the option and the object to operate on, handling
the read-only and deprecated flags, and constructing the pointer to the
target value. Some of the functions also do not perform some of the
checks, although they should. E.g. a deprecation warning is currently
only printed for av_opt_set().

Introduce a prologue function that is called from every av_opt_set*()
and performs all these common initialization operations.
2024-10-01 09:57:41 +02:00
Anton Khirnov
0d09645cfe lavu/opt: combine option type size+name into a single descriptor
Makes it easier to handle options generically and will be useful in
future commits.
2024-10-01 09:57:41 +02:00
Anton Khirnov
041d992060 lavu/class: improve AVClass doxy 2024-10-01 09:57:41 +02:00
Zhao Zhili
240c16bbc6 avcodec/vvc: Don't use large array on stack
tmp_array in dmvr_hv takes 33024 bytes on stack, which can be
dangerous.
2024-10-01 11:30:22 +08:00
Zhao Zhili
5988a2729b aarch64/vvc: Add dmvr
dmvr_8_12x20_c:                                          1.5 ( 1.00x)
dmvr_8_12x20_neon:                                       0.2 ( 6.56x)
dmvr_8_20x12_c:                                          1.0 ( 1.00x)
dmvr_8_20x12_neon:                                       0.2 ( 4.33x)
dmvr_8_20x20_c:                                          1.7 ( 1.00x)
dmvr_8_20x20_neon:                                       0.5 ( 3.63x)
dmvr_12_12x20_c:                                         2.2 ( 1.00x)
dmvr_12_12x20_neon:                                      0.5 ( 4.68x)
dmvr_12_20x12_c:                                         2.0 ( 1.00x)
dmvr_12_20x12_neon:                                      0.5 ( 4.16x)
dmvr_12_20x20_c:                                         3.7 ( 1.00x)
dmvr_12_20x20_neon:                                      0.7 ( 5.14x)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-01 10:28:54 +08:00
Zhao Zhili
bcd65ebd8f aarch64/vvc: Add dmvr_hv
dmvr_hv_8_12x20_c:                                       8.0 ( 1.00x)
dmvr_hv_8_12x20_neon:                                    1.2 ( 6.62x)
dmvr_hv_8_20x12_c:                                       8.0 ( 1.00x)
dmvr_hv_8_20x12_neon:                                    0.9 ( 8.37x)
dmvr_hv_8_20x20_c:                                      12.9 ( 1.00x)
dmvr_hv_8_20x20_neon:                                    1.7 ( 7.62x)
dmvr_hv_10_12x20_c:                                      7.0 ( 1.00x)
dmvr_hv_10_12x20_neon:                                   1.7 ( 4.09x)
dmvr_hv_10_20x12_c:                                      7.0 ( 1.00x)
dmvr_hv_10_20x12_neon:                                   1.7 ( 4.09x)
dmvr_hv_10_20x20_c:                                     11.2 ( 1.00x)
dmvr_hv_10_20x20_neon:                                   2.7 ( 4.15x)
dmvr_hv_12_12x20_c:                                      6.5 ( 1.00x)
dmvr_hv_12_12x20_neon:                                   1.7 ( 3.79x)
dmvr_hv_12_20x12_c:                                      6.5 ( 1.00x)
dmvr_hv_12_20x12_neon:                                   1.7 ( 3.79x)
dmvr_hv_12_20x20_c:                                     10.2 ( 1.00x)
dmvr_hv_12_20x20_neon:                                   2.2 ( 4.64x)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-01 10:28:54 +08:00
Zhao Zhili
0ba9e8d0d4 aarch64/vvc: Add w_avg
w_avg_8_2x2_c:                                           0.0 ( 0.00x)
w_avg_8_2x2_neon:                                        0.0 ( 0.00x)
w_avg_8_4x4_c:                                           0.2 ( 1.00x)
w_avg_8_4x4_neon:                                        0.0 ( 0.00x)
w_avg_8_8x8_c:                                           1.2 ( 1.00x)
w_avg_8_8x8_neon:                                        0.2 ( 5.00x)
w_avg_8_16x16_c:                                         4.2 ( 1.00x)
w_avg_8_16x16_neon:                                      0.8 ( 5.67x)
w_avg_8_32x32_c:                                        16.2 ( 1.00x)
w_avg_8_32x32_neon:                                      2.5 ( 6.50x)
w_avg_8_64x64_c:                                        64.5 ( 1.00x)
w_avg_8_64x64_neon:                                      9.0 ( 7.17x)
w_avg_8_128x128_c:                                     269.5 ( 1.00x)
w_avg_8_128x128_neon:                                   35.5 ( 7.59x)
w_avg_10_2x2_c:                                          0.2 ( 1.00x)
w_avg_10_2x2_neon:                                       0.2 ( 1.00x)
w_avg_10_4x4_c:                                          0.2 ( 1.00x)
w_avg_10_4x4_neon:                                       0.2 ( 1.00x)
w_avg_10_8x8_c:                                          1.0 ( 1.00x)
w_avg_10_8x8_neon:                                       0.2 ( 4.00x)
w_avg_10_16x16_c:                                        4.2 ( 1.00x)
w_avg_10_16x16_neon:                                     0.8 ( 5.67x)
w_avg_10_32x32_c:                                       16.2 ( 1.00x)
w_avg_10_32x32_neon:                                     2.5 ( 6.50x)
w_avg_10_64x64_c:                                       66.2 ( 1.00x)
w_avg_10_64x64_neon:                                    10.0 ( 6.62x)
w_avg_10_128x128_c:                                    277.8 ( 1.00x)
w_avg_10_128x128_neon:                                  39.8 ( 6.99x)
w_avg_12_2x2_c:                                          0.0 ( 0.00x)
w_avg_12_2x2_neon:                                       0.2 ( 0.00x)
w_avg_12_4x4_c:                                          0.2 ( 1.00x)
w_avg_12_4x4_neon:                                       0.0 ( 0.00x)
w_avg_12_8x8_c:                                          1.2 ( 1.00x)
w_avg_12_8x8_neon:                                       0.5 ( 2.50x)
w_avg_12_16x16_c:                                        4.8 ( 1.00x)
w_avg_12_16x16_neon:                                     0.8 ( 6.33x)
w_avg_12_32x32_c:                                       17.0 ( 1.00x)
w_avg_12_32x32_neon:                                     2.8 ( 6.18x)
w_avg_12_64x64_c:                                       64.0 ( 1.00x)
w_avg_12_64x64_neon:                                    10.0 ( 6.40x)
w_avg_12_128x128_c:                                    269.2 ( 1.00x)
w_avg_12_128x128_neon:                                  42.0 ( 6.41x)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-01 10:28:54 +08:00
James Almer
76eb3e5ff3 avformat/mov: get heif image rotation from irot box
Based on a patch by Hacene Bouaroua.
Fixes ticket #11171.

Co-authored-by: Hacene Bouaroua <hbouaroua@freebox.fr>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-30 14:37:27 -03:00
James Almer
50d1b89fa0 avformat/avformat: add side data to AVStreamGroupTileGrid
Will be used to export certain information present in HEIF samples, like
rotation metadata, ICC profiles, and potentially others.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-30 14:36:24 -03:00
James Almer
04182b5549 avformat/mov: don't return the latest stream when an item stream is expected
Otherwise, things like ICC profiles as read from the colr box meant for an item
with no stream (like a grid) may end up being added to the wrong stream.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-30 10:59:05 -03:00
James Almer
6057cd8aee fate/filter-audio: add missing aresample filter dependency to fate-filter-crazychannels
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-30 09:07:54 -03:00
James Almer
b622714573 fate/hevc: add missing scale filter dependency to fate-hevc-mv-switch
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-30 09:07:54 -03:00
James Almer
b1a7b0411a fate/vcodec: add missing scale filter dependency to ffv1-2pass10 vsynth tests
Also, add sws_flags matching other similar tests while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-30 09:07:54 -03:00
Jonathan Baecker
f3d2624bfa avformat/hlsenc: Fix missing EXT-X-DISCONTINUITY tag in subtitle streams
The EXT-X-DISCONTINUITY tag was not being added to subtitle streams,
causing synchronization issues.i
This patch ensures that the tag is applied consistently across video and subtitle streams.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-30 19:22:25 +08:00
Anton Khirnov
faa366003b fftools/ffmpeg_mux_init: consolidate connecting source to mux stream 2024-09-30 09:29:18 +02:00
Anton Khirnov
ba06c7b08f fftools/ffmpeg_mux_init: move the ost_get_filters() call to ost_bind_filter()
That is a more appropriate place for it.
2024-09-30 09:29:18 +02:00
Anton Khirnov
71916aa107 fftools/ffmpeg_mux_init: move the check for filtering+streamcopy
To streamcopy_init().

This will allow to simplify the control flow in ost_add() by moving the
ost_get_filters() call (which previously had to handle both encoding and
streamcopy streams) to ost_bind_filter() (which is only called for
audio/video encoding).

Also, return EINVAL rather than ENOSYS, as trying to combine filtering
with streamcopy is a parameter error.
2024-09-30 09:29:18 +02:00
Anton Khirnov
e83b5b2cc8 fftools/ffmpeg_mux_init: do not export forced_keyframes_const_names[]
It is only used in this file.
2024-09-30 09:29:18 +02:00
Anton Khirnov
c27b1e6c59 fftools/ffmpeg: drop unused OSTFinished 2024-09-30 09:29:18 +02:00
Anton Khirnov
64f3feb849 fftools/ffmpeg_mux: move OutputStream.enc_ctx to Encoder
The encoding AVCodecContext is a part of the encoder, and so should live
there.
2024-09-30 09:29:18 +02:00
Anton Khirnov
434377a764 fftools/ffmpeg_enc: split Encoder into a private and public part
Similar to what was previously done for other components, e.g. decoders
(see 3b84140a1b).

Start by moving {samples,frames}_encoded into the public struct.
2024-09-30 09:29:18 +02:00
Anton Khirnov
f295b4d8a0 fftools/ffmpeg_demux: drop ist_output_add()
It is now a trivial wrapper over ist_use(), so export that directly.
2024-09-30 09:29:18 +02:00
Anton Khirnov
8e805b9c3c fftools/ffmpeg_demux: drop InputStream.[nb_]outputs
It is write-only after d119ae2fd8.
2024-09-30 09:29:18 +02:00
Anton Khirnov
df9b80d21a lavu: deprecate av_opt_set_int_list() and related infrastructure
It has no more users and is replaced by array-type options.
2024-09-30 09:14:04 +02:00
Anton Khirnov
b97ccc537d fftools/ffplay: switch to new buffersink options 2024-09-30 09:14:04 +02:00
Anton Khirnov
b150fdd500 doc/examples/decode_filter_video: switch to new buffersink options 2024-09-30 09:10:20 +02:00
Anton Khirnov
0dbd59242a doc/examples/decode_filter_audio: switch to new buffersink options
Use a mix of av_opt_set() and av_opt_set_array() to demonstrate
different ways the options can be set.
2024-09-30 09:10:20 +02:00
Anton Khirnov
1efcdbc54d lavfi/buffersink: add array-type options to replace "int-list" ones
"int-list" options are a hack that provides rudimentary support for
array-type options by treating them as byte arrays (i.e.
AV_OPT_TYPE_BINARY). Since we now have proper array-type options, they
should replace "int-list" everywhere (which happens to be just
buffersink).
2024-09-30 09:10:19 +02:00
Marth64
9d3cdf8fa6 MAINTAINERS: update myself for dvdvideo, rcwtdec, rcwtenc
I plan to look after and test them for the forseeable future.
I am not a committer but do care for these muxers/demuxers.

Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-29 17:38:12 +02:00
Zhao Zhili
f56a54387b avformat/img2enc: Fix integer truncation when frame_pts is enabled
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-09-29 20:46:42 +08:00
Zhao Zhili
a2d9663241 avformat/internal: Add ff_get_frame_filename
It's similar to av_get_frame_filename2 but with int64_t number
support. Make av_get_frame_filename* a wrapper over
ff_get_frame_filename.

Co-authored-by: Filip Mašić <shoutplenty@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-09-29 20:46:09 +08:00
Marvin Scholz
8e76c99301 avdevice/decklink_dec: fix leaks on error
In case of errors in this function, the allocated context
was not properly freed in several cases.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-29 10:12:41 +02:00
Marvin Scholz
7554346cb5 avdevice/decklink_dec: fix leak on error
In the early return when both draw_bars and signal_loss_action
options are used, the context allocated previously was not
properly freed.

Introduced in 9bcb86b0fa

Fixes CID1619296

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-29 10:12:41 +02:00
Brad Smith
6ec6b07900 ppc: Recognize the PPC VSX and Power8 CPU flags
Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-28 18:50:08 -04:00
Niklas Haas
2f77ecc6bc avcodec/riscv: add h264 qpel
Benched on K230 for VLEN 128, SpaceMIT for VLEN 256. Variants for 4
width have no speedup for VLEN 256 vs VLEN 128 on available hardware,
so were disabled.

                        C      RVV128          C     RVV256
avg_h264_qpel_4_mc00_8  33.9   33.6   (1.01x)
avg_h264_qpel_4_mc01_8  218.8  89.1   (2.46x)
avg_h264_qpel_4_mc02_8  218.8  79.8   (2.74x)
avg_h264_qpel_4_mc03_8  218.8  89.1   (2.46x)
avg_h264_qpel_4_mc10_8  172.3  126.1  (1.37x)
avg_h264_qpel_4_mc11_8  339.1  190.8  (1.78x)
avg_h264_qpel_4_mc12_8  533.6  357.6  (1.49x)
avg_h264_qpel_4_mc13_8  348.4  190.8  (1.83x)
avg_h264_qpel_4_mc20_8  144.8  116.8  (1.24x)
avg_h264_qpel_4_mc21_8  478.1  385.6  (1.24x)
avg_h264_qpel_4_mc22_8  348.4  283.6  (1.23x)
avg_h264_qpel_4_mc23_8  478.1  394.6  (1.21x)
avg_h264_qpel_4_mc30_8  172.6  126.1  (1.37x)
avg_h264_qpel_4_mc31_8  339.4  191.1  (1.78x)
avg_h264_qpel_4_mc32_8  542.9  357.6  (1.52x)
avg_h264_qpel_4_mc33_8  339.4  191.1  (1.78x)
avg_h264_qpel_8_mc00_8  116.8  42.9   (2.72x)  123.6  50.6   (2.44x)
avg_h264_qpel_8_mc01_8  774.4  163.1  (4.75x)  779.8  165.1  (4.72x)
avg_h264_qpel_8_mc02_8  774.4  154.1  (5.03x)  779.8  144.3  (5.40x)
avg_h264_qpel_8_mc03_8  774.4  163.3  (4.74x)  779.8  165.3  (4.72x)
avg_h264_qpel_8_mc10_8  617.1  237.3  (2.60x)  613.1  227.6  (2.69x)
avg_h264_qpel_8_mc11_8  1209.3 376.4  (3.21x)  1206.8 363.1  (3.32x)
avg_h264_qpel_8_mc12_8  1913.3 598.6  (3.20x)  1894.3 561.1  (3.38x)
avg_h264_qpel_8_mc13_8  1218.6 376.4  (3.24x)  1217.1 363.1  (3.35x)
avg_h264_qpel_8_mc20_8  524.4  228.1  (2.30x)  519.3  227.6  (2.28x)
avg_h264_qpel_8_mc21_8  1709.6 681.9  (2.51x)  1707.1 644.3  (2.65x)
avg_h264_qpel_8_mc22_8  1274.3 459.6  (2.77x)  1279.8 436.1  (2.93x)
avg_h264_qpel_8_mc23_8  1700.3 672.6  (2.53x)  1706.8 644.6  (2.65x)
avg_h264_qpel_8_mc30_8  607.6  246.6  (2.46x)  623.6  238.1  (2.62x)
avg_h264_qpel_8_mc31_8  1209.6 376.4  (3.21x)  1206.8 363.1  (3.32x)
avg_h264_qpel_8_mc32_8  1904.1 607.9  (3.13x)  1894.3 571.3  (3.32x)
avg_h264_qpel_8_mc33_8  1209.6 376.1  (3.22x)  1206.8 363.1  (3.32x)
avg_h264_qpel_16_mc00_8 431.9  89.1   (4.85x)  436.1  71.3   (6.12x)
avg_h264_qpel_16_mc01_8 2894.6 376.1  (7.70x)  2842.3 300.6  (9.46x)
avg_h264_qpel_16_mc02_8 2987.3 348.4  (8.57x)  2967.3 290.1  (10.23x)
avg_h264_qpel_16_mc03_8 2885.3 376.4  (7.67x)  2842.3 300.6  (9.46x)
avg_h264_qpel_16_mc10_8 2404.1 524.4  (4.58x)  2404.8 456.8  (5.26x)
avg_h264_qpel_16_mc11_8 4709.4 811.6  (5.80x)  4675.6 706.8  (6.62x)
avg_h264_qpel_16_mc12_8 7477.9 1274.3 (5.87x)  7436.1 1061.1 (7.01x)
avg_h264_qpel_16_mc13_8 4718.6 820.6  (5.75x)  4655.1 706.8  (6.59x)
avg_h264_qpel_16_mc20_8 2052.1 487.1  (4.21x)  2071.3 446.3  (4.64x)
avg_h264_qpel_16_mc21_8 7440.6 1422.6 (5.23x)  6727.8 1217.3 (5.53x)
avg_h264_qpel_16_mc22_8 5051.9 950.4  (5.32x)  5071.6 790.3  (6.42x)
avg_h264_qpel_16_mc23_8 6764.9 1422.3 (4.76x)  6748.6 1217.3 (5.54x)
avg_h264_qpel_16_mc30_8 2413.1 524.4  (4.60x)  2415.1 467.3  (5.17x)
avg_h264_qpel_16_mc31_8 4681.6 839.1  (5.58x)  4675.6 727.6  (6.43x)
avg_h264_qpel_16_mc32_8 8579.6 1292.8 (6.64x)  7436.3 1071.3 (6.94x)
avg_h264_qpel_16_mc33_8 5375.9 829.9  (6.48x)  4665.3 717.3  (6.50x)
put_h264_qpel_4_mc00_8  24.4   24.4   (1.00x)
put_h264_qpel_4_mc01_8  987.4  79.8   (12.37x)
put_h264_qpel_4_mc02_8  190.8  79.8   (2.39x)
put_h264_qpel_4_mc03_8  209.6  89.1   (2.35x)
put_h264_qpel_4_mc10_8  163.3  117.1  (1.39x)
put_h264_qpel_4_mc11_8  339.4  181.6  (1.87x)
put_h264_qpel_4_mc12_8  533.6  348.4  (1.53x)
put_h264_qpel_4_mc13_8  339.4  190.8  (1.78x)
put_h264_qpel_4_mc20_8  126.3  116.8  (1.08x)
put_h264_qpel_4_mc21_8  468.9  376.1  (1.25x)
put_h264_qpel_4_mc22_8  330.1  274.4  (1.20x)
put_h264_qpel_4_mc23_8  468.9  376.1  (1.25x)
put_h264_qpel_4_mc30_8  163.3  126.3  (1.29x)
put_h264_qpel_4_mc31_8  339.1  191.1  (1.77x)
put_h264_qpel_4_mc32_8  533.6  348.4  (1.53x)
put_h264_qpel_4_mc33_8  339.4  181.8  (1.87x)
put_h264_qpel_8_mc00_8  98.6   33.6   (2.93x)  92.3   40.1   (2.30x)
put_h264_qpel_8_mc01_8  737.1  153.8  (4.79x)  738.1  144.3  (5.12x)
put_h264_qpel_8_mc02_8  663.1  135.3  (4.90x)  665.1  134.1  (4.96x)
put_h264_qpel_8_mc03_8  737.4  154.1  (4.79x)  1508.8 144.3  (10.46x)
put_h264_qpel_8_mc10_8  598.4  237.1  (2.52x)  592.3  227.6  (2.60x)
put_h264_qpel_8_mc11_8  1172.3 357.9  (3.28x)  1175.6 342.3  (3.43x)
put_h264_qpel_8_mc12_8  1867.1 589.1  (3.17x)  1863.1 561.1  (3.32x)
put_h264_qpel_8_mc13_8  1172.6 366.9  (3.20x)  1175.6 352.8  (3.33x)
put_h264_qpel_8_mc20_8  450.4  218.8  (2.06x)  446.3  206.8  (2.16x)
put_h264_qpel_8_mc21_8  1672.3 663.1  (2.52x)  1675.6 633.8  (2.64x)
put_h264_qpel_8_mc22_8  1144.6 1200.1 (0.95x)  1144.3 425.6  (2.69x)
put_h264_qpel_8_mc23_8  1672.6 672.4  (2.49x)  1665.3 634.1  (2.63x)
put_h264_qpel_8_mc30_8  598.6  237.3  (2.52x)  613.1  227.6  (2.69x)
put_h264_qpel_8_mc31_8  1172.3 376.1  (3.12x)  1175.6 352.6  (3.33x)
put_h264_qpel_8_mc32_8  1857.8 598.6  (3.10x)  1863.1 561.1  (3.32x)
put_h264_qpel_8_mc33_8  1172.3 376.1  (3.12x)  1175.6 352.8  (3.33x)
put_h264_qpel_16_mc00_8 320.6  61.4   (5.22x)  321.3  60.8   (5.28x)
put_h264_qpel_16_mc01_8 2774.3 339.1  (8.18x)  2759.1 279.8  (9.86x)
put_h264_qpel_16_mc02_8 2589.1 320.6  (8.08x)  2571.6 269.3  (9.55x)
put_h264_qpel_16_mc03_8 2774.3 339.4  (8.17x)  2738.1 290.1  (9.44x)
put_h264_qpel_16_mc10_8 2274.3 487.4  (4.67x)  2290.1 436.1  (5.25x)
put_h264_qpel_16_mc11_8 5237.1 792.9  (6.60x)  4529.8 685.8  (6.61x)
put_h264_qpel_16_mc12_8 7357.6 1255.8 (5.86x)  7352.8 1040.1 (7.07x)
put_h264_qpel_16_mc13_8 4579.9 792.9  (5.78x)  4571.6 686.1  (6.66x)
put_h264_qpel_16_mc20_8 1802.1 459.6  (3.92x)  1800.6 425.6  (4.23x)
put_h264_qpel_16_mc21_8 6644.6 2246.6 (2.96x)  6644.3 1196.6 (5.55x)
put_h264_qpel_16_mc22_8 4589.1 913.4  (5.02x)  4592.3 769.3  (5.97x)
put_h264_qpel_16_mc23_8 6644.6 1394.6 (4.76x)  6634.1 1196.6 (5.54x)
put_h264_qpel_16_mc30_8 2274.3 496.6  (4.58x)  2290.1 456.8  (5.01x)
put_h264_qpel_16_mc31_8 5255.6 802.1  (6.55x)  4550.8 706.8  (6.44x)
put_h264_qpel_16_mc32_8 7376.1 1265.1 (5.83x)  7352.8 1050.6 (7.00x)
put_h264_qpel_16_mc33_8 4579.9 802.1  (5.71x)  4561.1 696.3  (6.55x)

Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-09-28 18:35:35 +02:00
Anton Khirnov
505fea34e5 lavu/opt: avoid accidentally propagating spurious errors
An error from read_number() is non-fatal here and should not be
forwarded.
2024-09-28 17:04:33 +02:00
Anton Khirnov
9b764e9b49 lavu/opt: add missing 'else' 2024-09-28 17:04:33 +02:00
Anton Khirnov
ca860d8d07 lavfi: clarify the behaviour of avfilter_graph_create_filter()
Mention explicitly that no options can be set manually when using this
function.
2024-09-28 17:04:33 +02:00
Anton Khirnov
d3f76dbca1 lavd/lavfi: stop using avfilter_graph_create_filter() incorrectly
See previous commits for details.
2024-09-28 17:04:33 +02:00
Anton Khirnov
577708a70a fftools/ffplay: stop using avfilter_graph_create_filter() incorrectly
This function creates AND initializes a filter, so setting any filter
options after it is wrong. It happens to work when the filter's init
function does not touch the options in question, but is forbidden by the
API and is not guaranteed to remain functional.

Instead, use avfilter_graph_alloc_filter(), followed by setting the
options, and avfilter_init_dict().
2024-09-28 17:04:33 +02:00
Anton Khirnov
f6f0e05815 doc/examples/transcode: handle audio encoder frame size restrictions 2024-09-28 17:04:33 +02:00
Anton Khirnov
6b402cdbf4 lavfi/buffersink: allow av_buffersink_set_frame_size() to be called earlier
The function currently writes directly into the input link, which
requires it to be called after the filter has been linked. However, the
documentation does not mention this restriction and the natural place to
call av_buffersink_set_frame_size() during the options-setting stage,
that is before filter init (and so before the input link exists).
2024-09-28 17:04:33 +02:00
Anton Khirnov
cde307c783 doc/examples/transcode: switch to avcodec_get_supported_config() 2024-09-28 17:04:33 +02:00
Anton Khirnov
d18d119b8f doc/examples/transcode: stop using avfilter_graph_create_filter() incorrectly
See previous commits for details.
2024-09-28 17:04:33 +02:00
Anton Khirnov
87faa8aeba doc/examples/decode_filter_video: stop using avfilter_graph_create_filter() incorrectly
See previous commits for details.
2024-09-28 17:04:33 +02:00
Anton Khirnov
27564f9020 doc/examples/decode_filter_audio: stop using avfilter_graph_create_filter() incorrectly
See previous commit for details.
2024-09-28 17:04:33 +02:00
Anton Khirnov
53c71777e1 fftools/ffmpeg_filter: stop using avfilter_graph_create_filter() incorrectly
This function creates AND initializes a filter, so setting any filter
options after it is wrong. It happens to work when the filter's init
function does not touch the options in question, but is forbidden by the
API and is not guaranteed to remain functional.

Instead, use avfilter_graph_alloc_filter(), followed by setting the
options, and avfilter_init_dict().
2024-09-28 17:04:33 +02:00
Cameron Gutman
4ffd586e34 avcodec/amfenc: Add support for on-demand key frames
v2: Use forced_idr option instead of AV_FRAME_FLAG_KEY
Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2024-09-28 16:01:39 +02:00
Cameron Gutman
e3ae57b0de avcodec/amfenc: Update supported HEVC color ranges
We properly set AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE since fb4dd4b6f4.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2024-09-28 16:01:18 +02:00
Cameron Gutman
4cbb997e15 avcodec/amfenc: Fix inverted loop filter option
The AMF HEVC encoder takes a bool option for whether deblocking filter
should be _disabled_ instead of whether it should _enabled_ like the
AMF H.264 encoder does. The logic was accidentally copied from H.264 to
HEVC without negating the bool value, so the deblocking filter was
actually disabled when AV_CODEC_FLAG_LOOP_FILTER was set.

Before this patch:
------------------
no flags set => deblocking filter on
flags +loop  => deblocking filter off
flags -loop  => deblocking filter on

After this patch:
-----------------
no flags set => deblocking filter on
flags +loop  => deblocking filter on
flags -loop  => deblocking filter off

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2024-09-28 16:01:00 +02:00
Anton Khirnov
8a951ef5e1 lavfi/avf_showwaves: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
fadd1dda8a lavfi/avf_showvolume: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
197a619371 lavfi/avf_showspectrum: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
d4efdbd029 lavfi/avf_showspatial: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
d7fde5694d lavfi/avf_showfreqs: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
423eccadd6 lavfi/avf_showcwt: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
70a16a18ca lavfi/avf_showcqt: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
d36c368bf3 lavfi/avf_concat: switch to query_func2() 2024-09-28 09:53:11 +02:00
Anton Khirnov
a36cea452f lavfi/avf_avectorscope: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
55c1cb847c lavfi/avf_aphasemeter: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
88f3893148 lavfi/avf_ahistogram: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
6320301182 lavfi/avf_abitscope: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
0c2a5890ac lavfi/avf_a3dscope: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
c1d7814dca lavfi/*_vaapi: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
194e1ca03f lavfi/asrc_sine: convert to query_func2() 2024-09-28 09:53:11 +02:00
Anton Khirnov
ec01d80f2e lavfi/asrc_sinc: convert to query_func2() 2024-09-28 09:53:11 +02:00
Anton Khirnov
66c9457387 lavfi/asrc_hilbert: convert to query_func2() 2024-09-28 09:53:11 +02:00
Anton Khirnov
21d2be1088 lavfi/asrc_flite: convert to query_func2() 2024-09-28 09:53:11 +02:00
Anton Khirnov
9335af9acc lavfi/asrc_anullsrc: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic
code.
2024-09-28 09:53:11 +02:00
Anton Khirnov
5b3212e5f7 lavfi/asrc_anoisesrc: convert to query_func2() 2024-09-28 09:53:11 +02:00
Anton Khirnov
242dab2ccd lavfi/asrc_afirsrc: convert to query_func2() 2024-09-28 09:53:11 +02:00
Anton Khirnov
47f87409e3 lavfi/asrc_afdelaysrc: convert to query_func2() 2024-09-28 09:53:11 +02:00
James Almer
01c47dd235 avformat/dump: don't print streams withing a group twice
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-27 19:44:18 -03:00
James Almer
9d265a9677 avformat/dump: reduce indentation when printing streams within a group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-27 19:43:47 -03:00
James Almer
545de54e3e avformat/dump: always print non-tile streams in tile grid groups
This ensures streams in the group that don't belong in the grid are printed with
the default log level.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-27 14:36:10 -03:00
Gyan Doshi
2b689261c5 MAINTAINERS: remove libopenjpeg decoder entry
The decoder wrapper was removed in 60ccb3fe78
2024-09-27 18:56:01 +05:30
Martin Storsjö
bd22d7e601 configure: Silence Xcode warnings about duplicate libraries
Since Xcode 15, macOS developer tools use a new linker. The new
linker by default warns for duplicate -l options. As this is a
known and expected thing, not to be considered an issue, ask for
the warning to be silenced.

This silences linker warnings like this:

    ld: warning: ignoring duplicate libraries: '-lc++', '-lcrypto', '-lm', '-logg', '-lpthread', '-lssl', '-lvorbis', '-lvpx', '-lz'

The linker can also warn about duplicate -rpath options, and there's
currently no option to silence those warnings.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 13:42:42 +03:00
Lynne
81c6e6c9ee vulkan_encode_h265: fix rate control VBV values
The values written were placeholder values.
2024-09-27 09:55:44 +02:00
Lynne
934be0ff50 vulkan_encode_h264: fix rate control VBV values
The values must be in milliseconds, not bytes.
2024-09-27 09:55:39 +02:00
Martin Storsjö
fd1ea75c93 libavutil: Fix building libavutil/tests/cpu for aarch64 without SVE
This adds a condition that was missed in
b1ee2af843, fixing compilation on
toolchains that don't support SVE.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 09:02:10 +03:00
Martin Storsjö
c65a294f79 checkasm: Print the SVE vector length at startup
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 00:06:55 +03:00
Martin Storsjö
b1ee2af843 aarch64: Print the SVE vector length in libavutil/tests/cpu.c
This makes this aspect more visible in test logs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 00:06:30 +03:00
Martin Storsjö
e6eabb7ce7 aarch64: Add CPU feature flags for SVE and SVE2
Add code for detecting the feature on Linux and Windows.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 00:04:30 +03:00
Martin Storsjö
e6e56fd7a7 configure: Add detection of assembler support for SVE/SVE2
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 00:03:04 +03:00
Martin Storsjö
067abbfe9d aarch64: Detect I8MM on Windows via SVE-I8MM
There's no direct processor feature constant for I8MM alone, but
there is a flag for SVE-I8MM (added in WinSDK 10.0.26100 and
recent versions of mingw-w64). If SVE-I8MM is available, we can
assume that I8MM is available.

While HW supporting these features isn't yet commonly running
Windows, this at least allows detecting and running the I8MM codepaths
in Windows builds in Wine (possibly running in QEMU).

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 00:02:48 +03:00
James Almer
d55ab2ba9b avutil/iamf: fix doxygen
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-26 16:42:45 -03:00
Anton Khirnov
d103b61cd8 fftools/ffmpeg_filter: remove remaining OutputStream usage in init_simple_filtergraph()
With this, nothing in ffmpeg_filter acesses OutputStream anymore, thus
there are no more direct ties between filtering and muxing.

Rename init_simple_filtergraph() to fg_create_simple() for consistency.
2024-09-26 18:29:40 +02:00
Anton Khirnov
72cd0c20da fftools/ffmpeg_filter: drop the OutputStream parameter to ofilter_bind_ost()
It is no longer used for anything besides a sanity-checking assert.
Rename the function to ofilter_bind_enc(), as it no longer has any
assumptions about the target being an output stream.
2024-09-26 18:29:40 +02:00
Anton Khirnov
addc29f67a fftools/ffmpeg_filter: stop accessing OutputStream.[max_]frame_rate
Pass them to ofilter_bind_ost() via OutputFilterOptions, as is done for
most other data it needs. OutputStream.[max_]frame_rate/force_fps are no
longer used outside of ffmpeg_mux*, and so can be made private.

This is a step toward decoupling encoders from muxers.
2024-09-26 18:29:40 +02:00
Anton Khirnov
ac578ccb8e fftools/ffmpeg_filter: drop a redundant check
OutputFilterOptions.frame_rates are always NULL if the conditional is
true.
2024-09-26 18:29:40 +02:00
Anton Khirnov
cefc7d1ff4 fftools/ffmpeg_filter: clarify error message 2024-09-26 18:29:38 +02:00
Anton Khirnov
e3e66b14af fftools/ffmpeg_enc: don't write frame rate/SAR to AVStream directly
Have the muxer code read them out of the encoder context in
of_stream_init() instead.

This is a step towards decoupling encoders from muxers.
2024-09-26 18:25:21 +02:00
Anton Khirnov
7f7fe2a10b fftools/ffmpeg_enc: move set_encoder_id() to ffmpeg_mux_init
This code uses no encoder properties or state besides its name, and is
mostly muxer logic, and thus belongs more properly into the muxer.

The results of several test change due to different metadata tag order
(the "encoder" tag is now set first).
2024-09-26 18:25:21 +02:00
Anton Khirnov
6525fe4e77 fftools/ffmpeg_enc: remove unnecessary pointer references from enc_open() 2024-09-26 18:25:21 +02:00
Anton Khirnov
78038d51c5 fftools/ffmpeg_enc: do not set output stream codec parameters directly
Have the muxer code read them out of the encoder context in
of_stream_init() instead.

OutputStream.par_in no longer needs to be public, so can be moved to
MuxStream.

This is a step towards decoupling encoders from muxers.
2024-09-26 18:25:21 +02:00
Anton Khirnov
238f439992 fftools/ffmpeg_enc: do not set AVStream timebase directly
Instead, pass the encoder context to of_stream_init() and have the muxer
take the timebase from there. Note that the muxer can currently access
the codec context directly, but that will change in future commits.

This is a step towards decoupling encoders from muxers.
2024-09-26 18:25:21 +02:00
Anton Khirnov
1ebd521a4e fftools/ffmpeg_enc: stop using OutputStream in hw_device_setup_for_encode()
The only variable accessed from it is AVCodecContext, which we can
pass directly.

Also, this function currently logs into the AVCodecContext, which is
wrong. Log to Encoder instead.
2024-09-26 18:25:21 +02:00
Anton Khirnov
70f7bbeade fftools/ffmpeg_enc: add an AVClass to Encoder
Log decoder messages to the encoder rather than OutputStream.

This is a step towards decoupling encoders from muxers, similarly to
what was previously done to decoders and demuxers.
2024-09-26 18:25:21 +02:00
Anton Khirnov
78170120ca doc/ffmpeg: improve wording in the description section 2024-09-26 18:25:21 +02:00
Martin Storsjö
a3ec1f8c6c aarch64: h26x: Fix the indentation of one function
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-26 13:42:11 +03:00
Martin Storsjö
157ce21939 checkasm/sw_rgb: Revert test additions from e18b46d95f
The unaligned width test cases fail on i386; we have an assembly
function of rgb24toyv12 which is enabled only within
"#if ARCH_X86_32 && HAVE_7REGS", which seems to fail these new
test cases for unaligned widths.

As that assembly function has existed for a long time in that form,
the issue probably isn't very recent, thus skip testing these cases
for now.

Once the assembly function has been fixed, these test cases can
be readded.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-26 13:16:56 +03:00
Marvin Scholz
f43916e217 ffbuild: add METALCC and METALLIB to BRIEF 2024-09-26 01:54:15 +02:00
Marvin Scholz
10b3edbe24 avfilter/vf_coreimage: silence AVFrame deprecation warnings
Deprecation warning need to be disabled here as we set deprecated
fields.
2024-09-26 00:34:36 +02:00
Marvin Scholz
799503f4bb avfilter/vf_coreimage: simplify list_filters code
Use fast-enumeration and get rid of unnecessary intermediate variables.
2024-09-26 00:33:14 +02:00
Marvin Scholz
8d674e604c avfilter/yadif_videotoolbox: remove unused variable 2024-09-26 00:18:54 +02:00
Marvin Scholz
399bf3f040 avdevice/avfoundation: remove write-only variable
The block_buffer was only ever written to but then never used in the
following code, making it unnecessary.

Fixes a "variable 'block_buffer' set but not used" compiler warning.
2024-09-26 00:17:24 +02:00
Marvin Scholz
7857ba97ac lavfi/metal: simplify fallback
Instead of using a fallback variable, just do an early return.
2024-09-26 00:02:36 +02:00
Michael Niedermayer
ea6734e1fa tests/fate/vcodec: Add 10bit 2pass FFv1 test
(this covers ticket5405)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-25 19:45:29 +02:00
Michael Niedermayer
a9c83e43f2 avcodec/ffv1enc: Fix >8bit context size
Fixes: Ticket5405

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-25 19:45:28 +02:00
Michael Niedermayer
747e1a26af avcodec/ffv1dec: Blow up if user asks for explosion
Fixes: Ticket8403

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-25 19:45:28 +02:00
James Almer
8b4e32f30b tests/fate/mov: fix rules for some tests
This was broken in 2fb2cd5c79 and
74553f0026, making a simple make fate-mov fail
and most of the test not run with a simple make fate.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-24 21:09:28 -03:00
James Almer
fd6cc18d60 avfilter/vf_showinfo: add missing break to ViewID case
Missed in 6940a6de2f.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-24 16:08:29 -03:00
James Almer
feef692881 avcodec/hevc/sei: num_ref_displays can be up to 32
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-24 15:11:57 -03:00
James Almer
b8e74aa1cb avcodec/cbs_h265: num_ref_displays can be up to 32
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-24 15:11:57 -03:00
James Almer
853c165386 avcodec/cbs_h265: fix valid range for {left,right}_view_id
view_id_len in VPS is 4 bits, so view_id values can be up to 15 bits long.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-24 15:11:57 -03:00
Rémi Denis-Courmont
6611bf5484 lavc/h264dsp: optimise R-V V biweight for shorter heights
T-Head C908:
h264_biweight2_8_c:                                    313.7 ( 1.00x)
h264_biweight2_8_rvv_i32:              before          239.5 ( 1.23x)
h264_biweight2_8_rvv_i32:              after            72.7 ( 4.31x)
h264_biweight4_8_c:                                    582.0 ( 1.00x)
h264_biweight4_8_rvv_i32:              before          471.0 ( 1.16x)
h264_biweight4_8_rvv_i32:              after            91.5 ( 6.36x)
h264_biweight8_8_c:                                   1110.0 ( 1.00x)
h264_biweight8_8_rvv_i32:              before          943.3 ( 1.10x)
h264_biweight8_8_rvv_i64:              after           147.0 ( 7.55x)

SpacemiT X60:
h264_biweight2_8_c:                                    311.4 ( 1.00x)
h264_biweight2_8_rvv_i32:              before          363.1 ( 0.83x)
h264_biweight2_8_rvv_i32:              after           103.1 ( 3.02x)
h264_biweight4_8_c:                                    571.9 ( 1.00x)
h264_biweight4_8_rvv_i32:              before          717.4 ( 0.78x)
h264_biweight4_8_rvv_i32:              after            71.8 ( 7.96x)
h264_biweight8_8_c:                                   1103.1 ( 1.00x)
h264_biweight8_8_rvv_i32:              before         1415.2 ( 0.76x)
h264_biweight8_8_rvv_i64:              ater             92.8 (11.88x)
2024-09-24 20:04:51 +03:00
Rémi Denis-Courmont
459a1512f1 lavc/h264dsp: unroll R-V V weight16
As VLSE128.V does not exist, we have no other way to deal with latency.

T-Head C908:
h264_weight16_8_c:                                     989.4 ( 1.00x)
h264_weight16_8_rvv_i32:                               193.2 ( 5.12x)

SpacemiT X60:
h264_weight16_8_c:                                     874.1 ( 1.00x)
h264_weight16_8_rvv_i32:                               196.9 ( 4.44x)
2024-09-24 20:04:51 +03:00
Rémi Denis-Courmont
4936bb2508 lavc/h264dsp: optimise R-V V weight for shorter heights
The height is a power of two of up to 16 rows. The current code was
optimised for large sample counts.

T-Head C908:
h264_weight2_8_c:                                      211.7 ( 1.00x)
h264_weight2_8_rvv_i32:                   before       184.0 ( 1.15x)
h264_weight2_8_rvv_i32:                   after         54.2 ( 3.90x)
h264_weight4_8_c:                                      285.7 ( 1.00x)
h264_weight4_8_rvv_i32:                   before       341.2 ( 0.86x)
h264_weight4_8_rvv_i32:                   after         82.2 ( 3.47x)
h264_weight8_8_c:                                      498.7 ( 1.00x)
h264_weight8_8_rvv_i32:                   before       683.7 ( 0.73x)
h264_weight8_8_rvv_i64:                   after        128.5 ( 3.95x)
h264_weight16_8_c:                                     878.2 ( 1.00x)
h264_weight16_8_rvv_i32:                  unchanged    239.5 ( 3.67x)

SpacemiT X60:
h264_weight2_8_c:                                      207.2 ( 1.00x)
h264_weight2_8_rvv_i32:                   before       259.6 ( 0.80x)
h264_weight2_8_rvv_i32:                   after         82.2 ( 2.52x)
h264_weight4_8_c:                                      290.8 ( 1.00x)
h264_weight4_8_rvv_i32:                   before       509.6 ( 0.57x)
h264_weight4_8_rvv_i32:                   after         61.5 ( 4.73x)
h264_weight8_8_c:                                      498.8 ( 1.00x)
h264_weight8_8_rvv_i32:                   before      1019.8 ( 0.49x)
h264_weight8_8_rvv_i64:                   after         71.8 ( 6.95x)
h264_weight16_8_c:                                     874.0 ( 1.00x)
h264_weight16_8_rvv_i32:                  unchanged    249.0 ( 3.51x)
2024-09-24 20:04:51 +03:00
sunyuechi
ba7d0d5fc3 lavc/vvc_mc: R-V V avg w_avg
C908   X60
avg_8_2x2_c                                        :    1.2    1.0
avg_8_2x2_rvv_i32                                  :    0.7    0.7
avg_8_2x4_c                                        :    2.0    2.2
avg_8_2x4_rvv_i32                                  :    1.2    1.2
avg_8_2x8_c                                        :    3.7    4.0
avg_8_2x8_rvv_i32                                  :    1.7    1.5
avg_8_2x16_c                                       :    7.2    7.7
avg_8_2x16_rvv_i32                                 :    3.0    2.7
avg_8_2x32_c                                       :   14.2   15.2
avg_8_2x32_rvv_i32                                 :    5.5    5.0
avg_8_2x64_c                                       :   51.0   43.7
avg_8_2x64_rvv_i32                                 :   39.2   29.7
avg_8_2x128_c                                      :  100.5   79.2
avg_8_2x128_rvv_i32                                :   79.7   68.2
avg_8_4x2_c                                        :    1.7    2.0
avg_8_4x2_rvv_i32                                  :    1.0    0.7
avg_8_4x4_c                                        :    3.5    3.7
avg_8_4x4_rvv_i32                                  :    1.2    1.2
avg_8_4x8_c                                        :    6.7    7.0
avg_8_4x8_rvv_i32                                  :    1.7    1.5
avg_8_4x16_c                                       :   13.5   14.0
avg_8_4x16_rvv_i32                                 :    3.0    2.7
avg_8_4x32_c                                       :   26.2   27.7
avg_8_4x32_rvv_i32                                 :    5.5    4.7
avg_8_4x64_c                                       :   73.0   73.7
avg_8_4x64_rvv_i32                                 :   39.0   32.5
avg_8_4x128_c                                      :  143.0  137.2
avg_8_4x128_rvv_i32                                :   72.7   68.0
avg_8_8x2_c                                        :    3.5    3.5
avg_8_8x2_rvv_i32                                  :    1.0    0.7
avg_8_8x4_c                                        :    6.2    6.5
avg_8_8x4_rvv_i32                                  :    1.5    1.0
avg_8_8x8_c                                        :   12.7   13.2
avg_8_8x8_rvv_i32                                  :    2.0    1.5
avg_8_8x16_c                                       :   25.0   26.5
avg_8_8x16_rvv_i32                                 :    3.2    2.7
avg_8_8x32_c                                       :   50.0   52.7
avg_8_8x32_rvv_i32                                 :    6.2    5.0
avg_8_8x64_c                                       :  118.7  122.5
avg_8_8x64_rvv_i32                                 :   40.2   31.5
avg_8_8x128_c                                      :  236.7  220.2
avg_8_8x128_rvv_i32                                :   85.2   67.7
avg_8_16x2_c                                       :    6.2    6.7
avg_8_16x2_rvv_i32                                 :    1.2    0.7
avg_8_16x4_c                                       :   12.5   13.0
avg_8_16x4_rvv_i32                                 :    1.7    1.0
avg_8_16x8_c                                       :   24.5   26.0
avg_8_16x8_rvv_i32                                 :    3.0    1.7
avg_8_16x16_c                                      :   49.0   51.5
avg_8_16x16_rvv_i32                                :    5.5    3.0
avg_8_16x32_c                                      :   97.5  102.5
avg_8_16x32_rvv_i32                                :   10.5    5.5
avg_8_16x64_c                                      :  213.7  222.0
avg_8_16x64_rvv_i32                                :   48.5   34.2
avg_8_16x128_c                                     :  434.7  420.0
avg_8_16x128_rvv_i32                               :   97.7   74.0
avg_8_32x2_c                                       :   12.2   12.7
avg_8_32x2_rvv_i32                                 :    1.5    1.0
avg_8_32x4_c                                       :   24.5   25.5
avg_8_32x4_rvv_i32                                 :    3.0    1.7
avg_8_32x8_c                                       :   48.5   50.7
avg_8_32x8_rvv_i32                                 :    5.2    2.7
avg_8_32x16_c                                      :   96.7  101.2
avg_8_32x16_rvv_i32                                :   10.2    5.0
avg_8_32x32_c                                      :  192.7  202.2
avg_8_32x32_rvv_i32                                :   19.7    9.5
avg_8_32x64_c                                      :  427.5  426.5
avg_8_32x64_rvv_i32                                :   64.2   18.2
avg_8_32x128_c                                     :  816.5  821.0
avg_8_32x128_rvv_i32                               :  135.2   75.5
avg_8_64x2_c                                       :   24.0   25.2
avg_8_64x2_rvv_i32                                 :    2.7    1.5
avg_8_64x4_c                                       :   48.2   50.5
avg_8_64x4_rvv_i32                                 :    5.0    2.7
avg_8_64x8_c                                       :   96.0  100.7
avg_8_64x8_rvv_i32                                 :    9.7    4.5
avg_8_64x16_c                                      :  207.7  201.2
avg_8_64x16_rvv_i32                                :   19.0    9.0
avg_8_64x32_c                                      :  383.2  402.0
avg_8_64x32_rvv_i32                                :   37.5   17.5
avg_8_64x64_c                                      :  837.2  828.7
avg_8_64x64_rvv_i32                                :   84.7   35.5
avg_8_64x128_c                                     : 1640.7 1640.2
avg_8_64x128_rvv_i32                               :  206.0  153.0
avg_8_128x2_c                                      :   48.7   51.0
avg_8_128x2_rvv_i32                                :    5.2    2.7
avg_8_128x4_c                                      :   96.7  101.5
avg_8_128x4_rvv_i32                                :   10.2    5.0
avg_8_128x8_c                                      :  192.2  202.0
avg_8_128x8_rvv_i32                                :   19.7    9.2
avg_8_128x16_c                                     :  400.7  403.2
avg_8_128x16_rvv_i32                               :   38.7   18.5
avg_8_128x32_c                                     :  786.7  805.7
avg_8_128x32_rvv_i32                               :   77.0   36.2
avg_8_128x64_c                                     : 1615.5 1655.5
avg_8_128x64_rvv_i32                               :  189.7   80.7
avg_8_128x128_c                                    : 3182.0 3238.0
avg_8_128x128_rvv_i32                              :  397.5  308.5
w_avg_8_2x2_c                                      :    1.7    1.2
w_avg_8_2x2_rvv_i32                                :    1.2    1.0
w_avg_8_2x4_c                                      :    2.7    2.7
w_avg_8_2x4_rvv_i32                                :    1.7    1.5
w_avg_8_2x8_c                                      :   21.7    4.7
w_avg_8_2x8_rvv_i32                                :    2.7    2.5
w_avg_8_2x16_c                                     :    9.5    9.2
w_avg_8_2x16_rvv_i32                               :    4.7    4.2
w_avg_8_2x32_c                                     :   19.0   18.7
w_avg_8_2x32_rvv_i32                               :    9.0    8.0
w_avg_8_2x64_c                                     :   62.0   50.2
w_avg_8_2x64_rvv_i32                               :   47.7   33.5
w_avg_8_2x128_c                                    :  116.7   87.7
w_avg_8_2x128_rvv_i32                              :   80.0   69.5
w_avg_8_4x2_c                                      :    2.5    2.5
w_avg_8_4x2_rvv_i32                                :    1.2    1.0
w_avg_8_4x4_c                                      :    4.7    4.5
w_avg_8_4x4_rvv_i32                                :    1.7    1.7
w_avg_8_4x8_c                                      :    9.0    8.7
w_avg_8_4x8_rvv_i32                                :    2.7    2.5
w_avg_8_4x16_c                                     :   17.7   17.5
w_avg_8_4x16_rvv_i32                               :    4.7    4.2
w_avg_8_4x32_c                                     :   35.0   35.0
w_avg_8_4x32_rvv_i32                               :    9.0    8.0
w_avg_8_4x64_c                                     :  100.5   84.5
w_avg_8_4x64_rvv_i32                               :   42.2   33.7
w_avg_8_4x128_c                                    :  203.5  151.2
w_avg_8_4x128_rvv_i32                              :   83.0   69.5
w_avg_8_8x2_c                                      :    4.5    4.5
w_avg_8_8x2_rvv_i32                                :    1.2    1.2
w_avg_8_8x4_c                                      :    8.7    8.7
w_avg_8_8x4_rvv_i32                                :    2.0    1.7
w_avg_8_8x8_c                                      :   17.0   17.0
w_avg_8_8x8_rvv_i32                                :    3.2    2.5
w_avg_8_8x16_c                                     :   34.0   33.5
w_avg_8_8x16_rvv_i32                               :    5.5    4.2
w_avg_8_8x32_c                                     :   86.0   67.5
w_avg_8_8x32_rvv_i32                               :   10.5    8.0
w_avg_8_8x64_c                                     :  187.2  149.5
w_avg_8_8x64_rvv_i32                               :   45.0   35.5
w_avg_8_8x128_c                                    :  342.7  290.0
w_avg_8_8x128_rvv_i32                              :  108.7   70.2
w_avg_8_16x2_c                                     :    8.5    8.2
w_avg_8_16x2_rvv_i32                               :    2.0    1.2
w_avg_8_16x4_c                                     :   16.7   16.7
w_avg_8_16x4_rvv_i32                               :    3.0    1.7
w_avg_8_16x8_c                                     :   33.2   33.5
w_avg_8_16x8_rvv_i32                               :    5.5    3.0
w_avg_8_16x16_c                                    :   66.2   66.7
w_avg_8_16x16_rvv_i32                              :   10.5    5.0
w_avg_8_16x32_c                                    :  132.5  131.0
w_avg_8_16x32_rvv_i32                              :   20.0    9.7
w_avg_8_16x64_c                                    :  340.0  283.5
w_avg_8_16x64_rvv_i32                              :   60.5   37.2
w_avg_8_16x128_c                                   :  641.2  597.5
w_avg_8_16x128_rvv_i32                             :  118.7   77.7
w_avg_8_32x2_c                                     :   16.5   16.7
w_avg_8_32x2_rvv_i32                               :    3.2    1.7
w_avg_8_32x4_c                                     :   33.2   33.2
w_avg_8_32x4_rvv_i32                               :    5.5    2.7
w_avg_8_32x8_c                                     :   66.0   62.5
w_avg_8_32x8_rvv_i32                               :   10.5    5.0
w_avg_8_32x16_c                                    :  131.5  132.0
w_avg_8_32x16_rvv_i32                              :   20.2    9.5
w_avg_8_32x32_c                                    :  261.7  272.0
w_avg_8_32x32_rvv_i32                              :   39.7   18.0
w_avg_8_32x64_c                                    :  575.2  545.5
w_avg_8_32x64_rvv_i32                              :  105.5   58.7
w_avg_8_32x128_c                                   : 1154.2 1088.0
w_avg_8_32x128_rvv_i32                             :  207.0   98.0
w_avg_8_64x2_c                                     :   33.0   33.0
w_avg_8_64x2_rvv_i32                               :    6.2    2.7
w_avg_8_64x4_c                                     :   65.5   66.0
w_avg_8_64x4_rvv_i32                               :   11.5    5.0
w_avg_8_64x8_c                                     :  131.2  132.5
w_avg_8_64x8_rvv_i32                               :   22.5    9.5
w_avg_8_64x16_c                                    :  268.2  262.5
w_avg_8_64x16_rvv_i32                              :   44.2   18.0
w_avg_8_64x32_c                                    :  561.5  528.7
w_avg_8_64x32_rvv_i32                              :   88.0   35.2
w_avg_8_64x64_c                                    : 1136.2 1124.0
w_avg_8_64x64_rvv_i32                              :  222.0   82.2
w_avg_8_64x128_c                                   : 2345.0 2312.7
w_avg_8_64x128_rvv_i32                             :  423.0  190.5
w_avg_8_128x2_c                                    :   65.7   66.5
w_avg_8_128x2_rvv_i32                              :   11.2    5.5
w_avg_8_128x4_c                                    :  131.2  132.2
w_avg_8_128x4_rvv_i32                              :   22.0   10.2
w_avg_8_128x8_c                                    :  263.5  312.0
w_avg_8_128x8_rvv_i32                              :   43.2   19.7
w_avg_8_128x16_c                                   :  528.7  526.2
w_avg_8_128x16_rvv_i32                             :   85.5   39.5
w_avg_8_128x32_c                                   : 1067.7 1062.7
w_avg_8_128x32_rvv_i32                             :  171.7   78.2
w_avg_8_128x64_c                                   : 2234.7 2168.7
w_avg_8_128x64_rvv_i32                             :  400.0  159.0
w_avg_8_128x128_c                                  : 4752.5 4295.0
w_avg_8_128x128_rvv_i32                            :  757.7  365.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-09-24 20:04:51 +03:00
Anton Khirnov
9dc0edd454 tests/fate/hevc: use bitexact scaling flags for fate-hevc-mv-switch
Makes the results consistent across platforms.
2024-09-24 18:21:32 +02:00
Michael Niedermayer
f7d709fed8 doc/APIchanges: Add 7.1 Cut line
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:49:29 +02:00
Michael Niedermayer
2af5e7f50d Changelog: Add version <next>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:11:27 +02:00
Michael Niedermayer
38e224c2ba */version.h: bump after release/7.1 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:10:35 +02:00
Michael Niedermayer
e1094ac45d */version.h: bump minor versions for release/7.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:07:30 +02:00
Michael Niedermayer
27c6f5f6d2 Changelog: Mark for 7.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:05:48 +02:00
Michael Niedermayer
10d8b6f17c doc/APIchanges: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:05:28 +02:00
Michael Niedermayer
56bef2fd58 avcodec/xan: Add basic input size check
Fixes: Timeout
Fixes: 71739/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XAN_WC3_fuzzer-6170301405134848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpe
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:20 +02:00
Michael Niedermayer
03050a0d90 avcodec/vble: Allocate buffer later
Fixes: Timeout
Fixes: 71727/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VBLE_fuzzer-6126342574243840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:19 +02:00
Michael Niedermayer
5f471b500c avcodec/sgirledec: Check input length
Fixes: Timeout
Fixes: 71712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGIRLE_fuzzer-5763700835811328

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:19 +02:00
Michael Niedermayer
8367d7e184 avcodec/imm4: Check input size
Fixes: Timeout
Fixes: 71324/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IMM4_fuzzer-5388489435185152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:19 +02:00
Michael Niedermayer
050b5e85cb avcodec/svq3: Check for minimum size input
Fixes: Timeout
Fixes: 71295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-4999941125111808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:18 +02:00
Michael Niedermayer
6190e82647 tools/target_swr_fuzzer: Limit the number of samples
Fixes: OOM and Timeout
Fixes: 71254/clusterfuzz-testcase-minimized-ffmpeg_SWR_fuzzer-5941896977907712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:18 +02:00
Michael Niedermayer
5ded752241 tools/target_dec_fuzzer: Add threshold for SRGC
Fixes: Timeout
Fixes: 71234/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SRGC_fuzzer-5098445864501248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:18 +02:00
Michael Niedermayer
c3a1cbbf5d avcodec/eacmv: Check input size for intra frames
Fixes: Timeout
Fixes: 71135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EACMV_fuzzer-6251879028293632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:17 +02:00
Michael Niedermayer
9a823fbcfa tools/target_dec_fuzzer: Adapt threshold for RASC
Fixes: Timeout
Fixes: 71108/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-4799330484027392

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:17 +02:00
Michael Niedermayer
74385dd496 avcodec/encode: Check bitrate
Fixes: -1.80923e+19 is outside the range of representable values of type 'long'
Fixes: 71103/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6542773681979392

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:17 +02:00
Michael Niedermayer
36924fa306 avcodec/aac/aacdec: use correct index in deallocation
Fixes: memleak
Fixes: 71084/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5857751899635712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:16 +02:00
Michael Niedermayer
9d25b9665e avcodec/cbs_h266_syntax_template: Check bit depth with range extension
Fixes: shift exponent 62 is too large for 32-bit type 'int'
Fixes: 71020/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6444916325023744
Fixes: 71285/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4761971281428480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:16 +02:00
Michael Niedermayer
e9f588af95 avcodec/osq: use unsigned for decorrelation
Fixes: signed integer overflow: 1205469696 + 1901074655 cannot be represented in type 'int'
Fixes: 70773/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-5419594888577024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:16 +02:00
Michael Niedermayer
f27c8b04d3 avcodec/jfdctint_template: use unsigned z* in row_fdct()
Fixes: signed integer overflow: 856827136 + 2123580416 cannot be represented in type 'int'
Fixes: 70772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_KS_fuzzer-5180569961431040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:15 +02:00
Michael Niedermayer
fde8637fda avformat/asf: Check picsize
Fixes: signed integer overflow: 1073750247 * 2 cannot be represented in type 'int'
Fixes: 70722/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5447231587549184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:15 +02:00
Michael Niedermayer
ad35eaf848 avcodec/osq: Treat sum = 0 as k = 0
We have no valid sample that triggers this so we do not know if this would decode
correctly, but -inf is not the correct k value

Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:423
Fixes: -inf is outside the range of representable values of type 'int'
Fixes: 70709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6223623839350784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2024-09-24 15:37:15 +02:00
Michael Niedermayer
f2aba7bd9f MAINTAINERS: Fix typo in web repository
Found-by: Martin Schitter

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 15:37:14 +02:00
Martin Storsjö
b4d9fa6cb9 compat: Fix the fallback definition of stdc_trailing_zeros
While shifting "value" to left, we would iterate through all bits
of an unsigned long long, while we only expect to count through
"size * CHAR_BIT" bits; instead shift bits to the right and just
count the trailing zeros.

This fixes fate with MSVC.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-24 14:00:27 +03:00
Zhao Zhili
e18b46d95f swscale/aarch64: Fix rgb24toyv12 only works with aligned width
Since c0666d8b, rgb24toyv12 is broken for width non-aligned to 16.
Add a simple wrapper to handle the non-aligned part.

Co-authored-by: johzzy <hellojinqiang@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-09-24 10:24:14 +08:00
James Almer
0dd6f1d5bf avformat/mov: fix setting index of LCEVC enhancement stream
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 23:11:12 -03:00
James Almer
cc73bf02ba doc/general_contents: add missing reference to LCEVC
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 13:42:19 -03:00
Anton Khirnov
ce5f571e96 tests/fate/hevc: add a test for selecting view by position
Using a real-world iPhone-recorded file.
2024-09-23 17:15:02 +02:00
Anton Khirnov
eca95dc38f tests/fate/hevc: add a test for switching between single and multi-view 2024-09-23 17:15:02 +02:00
Anton Khirnov
b15af98f6e tests/fate/hevc: add a test for nontrivial values of nuh_layer_id
Typical files use 0 for the base layer and 1 for the secondary one, but
any value for the secondary layer should be supported.
2024-09-23 17:15:02 +02:00
Anton Khirnov
7d4c15cafb tests/fate/hevc: add MV-HEVC conformance sample tests
Only those that can be decoded with our implementation, so excluding
* C and D - independent layers
* G, H, I - more than 2 layers

Frame hashes verified against the reference implementation from
https://hevc.hhi.fraunhofer.de/svn/svn_3DVCSoftware/
2024-09-23 17:15:02 +02:00
Anton Khirnov
da420ac6e1 fftools/ffmpeg: add support for multiview video
This extends the syntax for specifying input streams in -map and complex
filtergraph labels, to allow selecting a view by view ID, index, or
position. The corresponding decoder is then set up to decode the
appropriate view and send frames for that view to the correct
filtergraph input(s).
2024-09-23 17:15:02 +02:00
Anton Khirnov
68c198fae2 fftools/ffmpeg_sched: allow decoders to have multiple outputs
Will be useful for multilayer video.
2024-09-23 17:15:02 +02:00
James Almer
aef221b22a avcodec/hevc/refs: export Stereo 3D side data
Use the 3D Reference Displays Info SEI message to link a view_id with
an eye.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 17:15:02 +02:00
Anton Khirnov
14746871e1 lavc/hevcdec: implement decoding MV-HEVC
At most two layers are supported.

Aspects of this work were sponsored by Vimeo and Meta.
2024-09-23 17:15:02 +02:00
Anton Khirnov
0fde9c609f lavc/decode: merge stereo3d information from decoder with packet side data
The HEVC decoder will start setting stereoscopic view position (left or
right) based on 3D Reference Displays Info SEI message in future
commits. This information should be merged with container-derived
stereo3D side data.
2024-09-23 17:12:17 +02:00
Anton Khirnov
327080c088 lavc/decode: make sure side data mapping does not produce duplicates
Also, deduplicate the code performing the mapping.
2024-09-23 17:12:15 +02:00
Anton Khirnov
bcbe999077 lavc/decode: clear side data in reget_buffer()
Otherwise it may accumulate when e.g. global side data is repeatedly
copied to the frame with in each subsequent reget_buffer() call.
2024-09-23 17:11:40 +02:00
Anton Khirnov
e19551d165 lavc/decode: do not clear the frame discard flag in ff_decode_frame_props_from_pkt()
Only do it in reget_buffer().

The purpose of this clearing this flag is to prevent it for
unintentionally persisting across multiple invocations of this function
on one frame, however that is only a problem if the frame is not
unreffed between uses, which is only the case with reget_buffer().

In other cases the caller may legitimately want to set the discard flag
and should have the option of doing so.
2024-09-23 17:11:40 +02:00
Anton Khirnov
75914b5822 lavc/hevc/hevcdec: implement MV-HEVC inter-layer prediction
The per-frame reference picture set contains two more lists -
INTER_LAYER[01]. Assuming at most two layers, INTER_LAYER1 is always
empty, but is added anyway for completeness.

When inter-layer prediction is enabled, INTER_LAYER0 for the
second-layer frame will contain the base-layer frame from the same
access unit, if it exists.

The new lists are then used in per-slice reference picture set
construction as per F.8.3.4 "Decoding process for reference picture
lists construction".
2024-09-23 17:11:40 +02:00
Anton Khirnov
02a9435cb0 lavc/hevcdec: implement slice header parsing for nuh_layer_id>0
Cf. F.7.3.6.1 "General slice segment header syntax"
2024-09-23 17:11:40 +02:00
Anton Khirnov
a811ab74f0 lavc/hevc/parser: only split packets on NALUs with nuh_layer_id=0
A packet should contain a full access unit, which for multilayer video
should contain all the layers.
2024-09-23 17:11:40 +02:00
Anton Khirnov
52ce2d2a04 lavc/hevcdec/parse: process NALUs with nuh_layer_id>0
Otherwise parameter sets from extradata with nuh_layer_id>0 would be
ignored. Needed for upcoming MV-HEVC support.
2024-09-23 17:11:40 +02:00
Anton Khirnov
81e9afa6c2 lavc/hevc/ps: reindent 2024-09-23 17:11:40 +02:00
Anton Khirnov
7d245866b8 lavc/hevc/ps: implement SPS parsing for nuh_layer_id>0
Cf. F.7.3.2.2 "Sequence parameter set RBSP syntax", which extends normal
SPS parsing with special clauses depending on MultiLayerExtSpsFlag.
2024-09-23 17:11:40 +02:00
Anton Khirnov
4359467ad6 lavc/hevc/ps: drop a warning for sps_multilayer_extension_flag
SPS multilayer extension contains a single flag that we are free to
ignore, no reason to print a warning.
2024-09-23 17:11:40 +02:00
Niklas Haas
7351e067bc lavc/hevc_ps: parse VPS extension
Only implementing what's needed for MV-HEVC with two views.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:11:40 +02:00
James Almer
efa9d3deca avcodec/hevc/sei: add support for 3D Reference Displays Information SEI
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:11:40 +02:00
Anton Khirnov
299d9115d4 lavfi/f_select: allow selection based on view ID
Can be used together with the split filter to decompose multiview video
into individual views.
2024-09-23 17:11:40 +02:00
Anton Khirnov
6940a6de2f lavu/frame: add side data storing view ID for multi-view video 2024-09-23 17:11:38 +02:00
Rémi Denis-Courmont
a7505ec562 compat: add a fallback implementation of C23 stdbit.h
Header contents taken from VLC commit 7a970a33329c9836d169727ddbaf49a33240d587.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:08:46 +02:00
Anton Khirnov
8c185ef4e7 compat: drop gcc, suncc, and pthreads stdatomic emulation
Since we now require a C11-compliant compiler, there should be no
supported configurations where any of these is used.
2024-09-23 17:08:46 +02:00
Jonathan Baudanza
6b3f9c2e92 avformat/rtpdec: fix integer overflow in start_time_realtime calculation
I encountered this problem with NTP timestamps that are extremely old,
like from January, 1990.

Although RFC3550 suggests that the timestamps in the RTCP packets use
the actual wallclock, some implementations use other clocks, such as
the CLOCK_MONOTONIC on linux.

I'm my case, I'm dealing with packets from mediasoup.

Without this patch, start_time_realtime shows up in the distance future
instead of around Jan 1900.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:08:33 +02:00
James Almer
660e7e6a0e avcodec: add LCEVC decoding support via LCEVCdec
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:20:47 -03:00
James Almer
6147385393 avcodec: add an export_side_data flag to export picture enhancement layers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:07:37 -03:00
James Almer
d250cc02e2 avcodec/hevc/refs: ensure LCEVC SEI payloads are exported as frame side data before get_buffer() calls
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:05:34 -03:00
James Almer
dbbf9a5ff7 avcodec/decode: split ProgressFrame allocator into two functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:05:34 -03:00
James Almer
a48eba0021 fftools/ffmpeg_filter: ensure that the inserted filters exist
If not, report it as a bug. avfilter_graph_create_filter() will return ENOMEM if the
passed filter argument is NULL, which is misleading.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 09:02:23 -03:00
James Almer
aeb64d6fa5 configure: add missing filter dependencies to ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 09:02:23 -03:00
Víctor Manuel Jáquez Leal
2bcc124e1a vulkan_encode: set the quality level in session parameters
While running this command

./ffmpeg_g -loglevel debug -hwaccel vulkan -init_hw_device vulkan=vk:0,debug=1 -hwaccel_output_format vulkan -i input.y4m -vf 'format=nv12,hwupload' -c:v h264_vulkan -quality 2 output.mp4 -y

It hit this validation error:

Validation Error: [ VUID-vkCmdEncodeVideoKHR-None-08318 ] Object 0: handle =
0x8f000000008f, type = VK_OBJECT_TYPE_VIDEO_SESSION_KHR; Object 1: handle =
0xfd00000000fd, type = VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR;
| MessageID = 0x5dc3dd39
| vkCmdEncodeVideoKHR(): The currently configured encode quality level (2) for
VkVideoSessionKHR 0x8f000000008f[] does not match the encode quality level (0)
VkVideoSessionParametersKHR 0xfd00000000fd[] was created with. The Vulkan spec
states: The bound video session parameters object must have been created with
the currently set video encode quality level for the bound video session at the
time the command is executed on the
device (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdEncodeVideoKHR-None-08318)

This patch adds a new function helper for creating session parameters, which
also sets the quality level and it's called by the H.264 and H.265 Vulkan
encoders.
2024-09-23 13:42:34 +02:00
Lynne
39c640e1d6 nlmeans_vulkan: split up descriptor sets, rename buffer offset vars 2024-09-23 13:42:34 +02:00
Lynne
bc36fe6f1f vulkan: use push descriptors where possible
Push descriptors are in theory slightly faster, but come with
limitations for which we have to check.

Either way, they're not difficult to implement, so even though
no one should be using peasant-tier descriptors, do it anyway.
2024-09-23 13:41:07 +02:00
Lynne
8a7af4aa49 vulkan: add support for regular descriptor pools
This permits:
 - The use of Vulkan filtering on many more devices
 - Better debugging due to lack of descriptor buffer support in layers

Much of the changes here are due to a requirement that updates to
descriptors must happen between the command buffer being waited on,
and the pipeline not being bound.

We routinely did it the other way around, by updating only after
we bind the pipeline.
2024-09-23 13:40:38 +02:00
Lynne
3d75ba7495 vulkan: separate out descriptor layouts from sets
Just avoids a single temporary allocation.
2024-09-23 13:40:38 +02:00
Lynne
2942ca802a hwcontext_vulkan: forward debug_mode to check_extensions() for devices
This allows disabling of certain extensions when debug mode is turned on.
2024-09-23 13:40:37 +02:00
Lynne
b5184c5d45 hwcontext_vulkan: add the PROFILE_INDEPENDENT only when needed 2024-09-23 13:40:36 +02:00
Lynne
a577d313b2 hwcontext_vulkan: add support for implicit DRM synchronization
More recent kernel versions allow for users to extract a sync_file
handle from a DMA-BUF, which can then be imported into Vulkan as a
binary semaphore.

This finally allows for synchronization between Vulkan and DMA-BUF
images, such as those from screen capture software, or VAAPI,
avoiding any corruption artifacts.

This is done fully asynchronously, where we use the kernel's
given binary semaphores as a dependency to increment the image's
usual VkSemaphores we allocate. The old imported binary semaphores
are cleaned up after execution as usual.

In the future, hwcontext_drm should receive support for explicitly
synchronized images as well, which would make the synchronization
more robust and portable.
2024-09-22 02:11:08 +02:00
Lynne
2395444c80 vulkan: add ff_vk_exec_add_dep_bool_sem
This function simply takes in a binary semaphore as a dependency
to an execution.
2024-09-22 02:11:08 +02:00
Lynne
c4048013e5 vulkan: flexibly allocate temporary imageviews
No reason to allocate 16 when 3 will do.
2024-09-22 02:11:07 +02:00
Lynne
1445102e68 hwcontext_vulkan: fix VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask
fmt_props.usage was initialized to 0 as create_info.usage was set later.
2024-09-22 02:11:04 +02:00
Brad Smith
2bf588f273 libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc
Modern Linux has getauxval() and FreeBSD/OpenBSD ppc have elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-21 03:11:22 -04:00
Marvin Scholz
9e1682761f avcodec/cbs_h266: Fix copy paste mistake
The us macro expect the range_max here, which seems should be
MAX_UINT_BITS(hlen) here.

Fix CID1618757 Copy-paste error
2024-09-20 22:32:54 +02:00
James Almer
2eef902d38 avcodec/bsf/dts2pts: don't zero the node buffers when allocating them
It's unnecessary as the entire struct is written to immediately after it's
allocated.
Restores the behavior prior to fec6a8df31.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 23:23:14 -03:00
Marvin Scholz
720ae6b3f7 avcodec/vaapi_encode_h265: fix missing slice_block_cols assignment
Instead of assigning to unit_opts.slice_block_cols, the slice_block_cols
value from the context was incorrectly assigned to slice_block_rows.

Regression from 12f158ca8f

Fixes CID1619479 Unused value

Reviewed-by: Fei Wang <fei.w.wang@intel.com>
2024-09-20 09:30:11 +08:00
Marvin Scholz
4858a8ee2f configure: do not use interval regexp operators with awk
Some awk implementations like mawk (used on Ubuntu) do not support
these.
2024-09-20 02:50:01 +02:00
Marvin Scholz
ed633a1312 MAINTAINERS: add myself as vf_xfade_vulkan maintainer 2024-09-19 21:28:11 +02:00
James Almer
dc11c12b64 avfilter: add an LCEVC decoding filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:06:05 -03:00
James Almer
df609af8e4 avcodec/packet: add an LCEVC enhancement data payload side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:26 -03:00
James Almer
5fa9c4e596 avformat/mov: support for LCEVC tracks
Co-authored-by: V-Nova Team <systems@v-nova.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:24 -03:00
James Almer
ba0ef0860f avformat: add an LCEVC stream group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:02 -03:00
James Almer
5896318229 avcodec/codec_id: add an LCEVC codec id for raw LCEVC data
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:02 -03:00
James Almer
9cea2410a1 avcodec/h2645_sei: export raw LCEVC metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:00 -03:00
James Almer
90d12c24c5 avutil/frame: add an LCEVC enhancement data payload side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 08:45:48 -03:00
Gyan Doshi
0d5b68c27c ffmpeg_mux_init: correct log suggestion
The option is enc_time_base, not enc_timebase
2024-09-19 15:35:15 +05:30
Fei Wang
5211ad1acd lavc/vaapi_encode: Fix potential use of uninitialized value
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-19 12:01:28 +08:00
Fei Wang
061c86a717 lavc/vaapi_encode_av1: Fix encode fail since 9db68ed0
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-19 12:01:18 +08:00
Michael Niedermayer
6be3786c82 avformat/mxfdec: Check timecode for overflow
Fixes: signed integer overflow: 9223372036840103968 + 538976288 cannot be represented in type 'long'
Fixes: 70604/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4844090340999168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:43:22 +02:00
Michael Niedermayer
5a96aa435a avformat/mxfdec: More offset_temp checks
Fixes: signed integer overflow: 9223372036854775807 - -1927491430256034080 cannot be represented in type 'long'
Fixes: 70607/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5282235077951488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:39:21 +02:00
Michael Niedermayer
176db9db6e avformat/flvdec: Free metaVideoColor
Fixes: memeleak
Fixes: 70659/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-4539872627458048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:24:27 +02:00
Michael Niedermayer
bd80c97391 swscale/output: Fix undefined integer overflow in yuv2rgba64_2_c_template()
Fixes: signed integer overflow: -1082982400 + -1083218484 cannot be represented in type 'int'
Fixes: 70657/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6707819712675840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:24:26 +02:00
Michael Niedermayer
44c5641ae8 swscale/swscale: Use unsigned operation to avoid undefined behavior
I have not checked that the constant is correct, this just fixes the undefined behavior

Fixes: signed integer overflow: -646656 * 3517 cannot be represented in type 'int
Fixes: 70559/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5209368631508992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:10:38 +02:00
Michael Niedermayer
6df9a0292c avcodec/vc2enc: basic sanity check on slice_max_bytes
Fixes: left shift of 896021632 by 3 places cannot be represented in type 'int'
Fixes: 70544/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC2_fuzzer-6685593652756480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:10:32 +02:00
Tomas Härdin
665bf46ac2 lavf/mxfdec: Handle KLV fill 2024-09-18 21:43:06 +02:00
Tomas Härdin
8f2ba4333d lavf/mxfdec: Switch to mxf_metadata_read_table loop to FF_ARRAY_ELEMS, skip if read == NULL 2024-09-18 21:43:06 +02:00
Marvin Scholz
7091da7129 configure: correctly set sanitizer toolchain compilers
Previously only the C compiler was set, which would lead to
confusing situations where even though clang-asan was selected,
it would still use g++ for C++ code, failing because configure
does not support mixing compilers in this way (which is a separate
issue not addressed by this commit).
2024-09-18 15:24:12 +02:00
Marvin Scholz
910bf33879 configure: fix symbol prefix detection
The symbol prefix check would incorrectly detect a bogus prefix in
circumstances where sanitizers instrument the build, like when
configuring with the clang-asan toolchain where it would detect the
prefix as __odr_asan_gen_, which is obviously wrong.

To fix this, adjust the prefix detection to only detect a
one-character prefix, which is the only case that matters
anywhere right now.
2024-09-18 15:24:12 +02:00
Anton Khirnov
0c9fe2b232 fftools/cmdutils: extend stream specifiers to match by disposition 2024-09-18 11:01:02 +02:00
Lynne
8875da347a hwcontext_vulkan: consider encode DBPs as always independent 2024-09-18 05:59:46 +02:00
Lynne
32d47166c8 hwcontext_vulkan: fix p->img_qfs
The array was tied to our old queue API, which meant that if users
set it, it was never set.
2024-09-18 05:59:41 +02:00
Lynne
0aa4ac0faf lavc: bump minor and add Changelog entry for the Vulkan H265 encoder 2024-09-17 21:12:32 +02:00
Lynne
4b4f0b68f8 lavc: add hevc_vulkan hardware encoder
This commit adds a Vulkan hardware HEVC encoder, with full support
of the spec - I, P, and B-frames.
2024-09-17 21:12:32 +02:00
Dave Airlie
b4283f93e1 cbs_h265: add raw filler encoding 2024-09-17 21:12:31 +02:00
Lynne
12f158ca8f hw_base_encode_h265: split off SPS/PPS/VPS generation from VAAPI
This commit splits off the base unit generation from VAAPI to allow
sharing with other encoders.
2024-09-17 21:11:06 +02:00
James Almer
1c706cec46 avformat/mov_chan: add extra checks to channel description count
Make sure it's not zero, and equal or bigger than number of channels

Fixes: Timeout / DOS
Fixes: 67143/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-4858720481771520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-17 15:41:45 -03:00
James Almer
fec6a8df31 avcodec/bsf/dts2pts: use a RefStruct pool to allocate nodes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-16 16:45:00 -03:00
James Almer
99ec7a8ced fate/h264: add a test for the dts2pts bsf
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-16 16:45:00 -03:00
Lynne
ceb471cfde lavc: bump minor version and add changelog for h264_vulkan 2024-09-16 14:04:06 +02:00
Lynne
f85d94730c lavc: add h264_vulkan hardware encoder
This commit adds the first Vulkan hardware encoder.

Currently, P, and **B**-frames are supported. This marks the
first implementation to support both.

The encoder has feature-parity with VAAPI.
2024-09-16 14:04:06 +02:00
Lynne
37243b2a08 lavc: add Vulkan video encoding base code
This commit adds the common Vulkan video encoding framework.
It makes full use of the asynchronous features of our new common
hardware encoding code, and of Vulkan.
The code is able to handle anything from H264 to AV1 and MJPEG.
2024-09-16 14:04:05 +02:00
Lynne
0fa6f33875 hwcontext_vulkan: add support for x2bgr10 and proper DRM mappings for 10-bit images
This allows mapping of 10-bit DRM images.
2024-09-16 14:03:56 +02:00
Steven Liu
76ff97cef5 tests/fate/cbs: make cbs-vvc test depends prerequisites correct
the VVC test cases cbs-vvc should prerequisites
VVC{demuxer, parser, metadata_bsf, muser}

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:45 +08:00
Steven Liu
6832134b7e tests/fate/cbs: refine depend prerequisites for cbs-hevc-discard test
add h264_metadata_bsf and file protocol for cbs-hevc-discard test cases

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:39 +08:00
Steven Liu
75fbff1170 tests/fate/demux: refine depend prerequisites for fate-mov-mp3-demux
fix fate error when --disable-everything --samples=fate-suite/ --enable-demuxer=mov

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:32 +08:00
Steven Liu
09580383c6 tests/fate/cbs: refine depend prerequisites for cbs-h264-discard test
add h264_metadata and file protocol for cbs-h264-discard test

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:25 +08:00
Steven Liu
eb20eff903 tests/fate/seek: check seek opertation with mov demuxer and file protocol
fix error at fate-seek-* when
configure with --disable-everything --samples=fate-suite/ --enable-demuxer=mov

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:17 +08:00
Steven Liu
2fb2cd5c79 tests/fate/mov: check mov and framemd5 has enabled when test
fix error st fate-mov-neg-firstpts-discard when
--disable-everything --samples=fate-suite

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:08 +08:00
Steven Liu
f3fc7af9fd tests/fate/matroska: check the demuxer and decoder allyes before fate-matroska-side-data-pref-codec
fix error message when use --disable-everything --samples=fate-suite/

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:12:00 +08:00
Steven Liu
8f100a66a1 tests/fate/audio: set flcl1905 test case with depend formats,decoder,protocol
move fate-flcl1905 with depend on test case,
because there will get an error when disable-everything with fate-suite samples.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:11:52 +08:00
Steven Liu
74553f0026 tests/fate/mov: check mov formats build status be for make test
fix make fate error when make fate with --disable-everything,
should check the mov build into ffmpeg status  before test mov functions.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:11:44 +08:00
Steven Liu
7df89cc1ec tests/fate/libavcodec: add mjpeg encoder depend for fate-libavcodec-huffman
fix make fate failed problem, because fate libavcodec-avcodec need mjpeg encoder
when fate-libavcodec-huffman

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2024-09-16 10:11:28 +08:00
Anton Khirnov
00f5a34c9a fftools/cmdutils: tighten condition for media type stream specifiers
Require the character indicating media type to be followed by a
non-alphanumeric character (or end of string).

Needed by future syntax extensions.
2024-09-15 22:21:17 +02:00
Marth64
8707c8660d avformat/dvdvideodec: implement seeking
Player applications can now enjoy seeking while playing back
a title. Accuracy is at the mercy of what libdvdnav exposes,
which is currently dvdnav_time_search().

Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-15 13:53:00 +02:00
sfan5
e66f977494 lavf/tls_mbedtls: restrict TLSv1.3 verification workaround to affected version
Now that mbedTLS 3.6.1 is released we know that only 3.6.0 contains this regression.

ref: c28e5b597e
Signed-off-by: sfan5 <sfan5@live.de>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-15 13:50:18 +02:00
Zhao Zhili
5c66a3ab51 avcodec/vvc: Fix output and unref a frame which isn't decoding yet
ff_vvc_output_frame is called before actually decoding. It's possible
for ff_vvc_output_frame to select current frame to output. If current
frame is nonref frame, it will be released by ff_vvc_unref_frame.

Fix this by always marking the current frame with
VVC_FRAME_FLAG_SHORT_REF, as is done by the HEVC decoder.
2024-09-15 16:42:14 +08:00
Zhao Zhili
3f84d1d1fb aarch64/vvc: Add avg
avg_8_2x2_c:                                             0.2 ( 1.00x)
avg_8_2x2_neon:                                          0.2 ( 1.00x)
avg_8_4x4_c:                                             0.2 ( 1.00x)
avg_8_4x4_neon:                                          0.2 ( 1.00x)
avg_8_8x8_c:                                             0.9 ( 1.00x)
avg_8_8x8_neon:                                          0.2 ( 5.29x)
avg_8_16x16_c:                                           3.7 ( 1.00x)
avg_8_16x16_neon:                                        0.7 ( 5.44x)
avg_8_32x32_c:                                          14.9 ( 1.00x)
avg_8_32x32_neon:                                        1.7 ( 8.91x)
avg_8_64x64_c:                                          59.7 ( 1.00x)
avg_8_64x64_neon:                                        6.9 ( 8.62x)
avg_8_128x128_c:                                       254.7 ( 1.00x)
avg_8_128x128_neon:                                     26.9 ( 9.46x)
avg_10_2x2_c:                                            0.2 ( 1.00x)
avg_10_2x2_neon:                                         0.2 ( 1.00x)
avg_10_4x4_c:                                            0.2 ( 1.00x)
avg_10_4x4_neon:                                         0.2 ( 1.00x)
avg_10_8x8_c:                                            0.9 ( 1.00x)
avg_10_8x8_neon:                                         0.2 ( 5.29x)
avg_10_16x16_c:                                          3.4 ( 1.00x)
avg_10_16x16_neon:                                       0.4 ( 8.06x)
avg_10_32x32_c:                                         13.9 ( 1.00x)
avg_10_32x32_neon:                                       1.9 ( 7.23x)
avg_10_64x64_c:                                         54.2 ( 1.00x)
avg_10_64x64_neon:                                       8.4 ( 6.43x)
avg_10_128x128_c:                                      232.4 ( 1.00x)
avg_10_128x128_neon:                                    30.9 ( 7.52x)
avg_12_2x2_c:                                            0.0 ( 0.00x)
avg_12_2x2_neon:                                         0.2 ( 0.00x)
avg_12_4x4_c:                                            0.4 ( 1.00x)
avg_12_4x4_neon:                                         0.2 ( 2.43x)
avg_12_8x8_c:                                            0.7 ( 1.00x)
avg_12_8x8_neon:                                         0.2 ( 3.86x)
avg_12_16x16_c:                                          3.7 ( 1.00x)
avg_12_16x16_neon:                                       0.4 ( 8.65x)
avg_12_32x32_c:                                         13.7 ( 1.00x)
avg_12_32x32_neon:                                       2.2 ( 6.29x)
avg_12_64x64_c:                                         53.9 ( 1.00x)
avg_12_64x64_neon:                                       7.7 ( 7.03x)
avg_12_128x128_c:                                      270.9 ( 1.00x)
avg_12_128x128_neon:                                    30.4 ( 8.90x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
1be5a2374f aarch64/vvc: Add put_epel_hv
On Apple M1:

put_chroma_hv_8_4x4_c:                                   1.7 ( 1.00x)
put_chroma_hv_8_4x4_neon:                                0.2 ( 7.67x)
put_chroma_hv_8_8x8_c:                                   5.5 ( 1.00x)
put_chroma_hv_8_8x8_neon:                                0.5 (11.53x)
put_chroma_hv_8_16x16_c:                                18.5 ( 1.00x)
put_chroma_hv_8_16x16_neon:                              1.5 (12.53x)
put_chroma_hv_8_32x32_c:                                72.5 ( 1.00x)
put_chroma_hv_8_32x32_neon:                              4.7 (15.34x)
put_chroma_hv_8_64x64_c:                               274.0 ( 1.00x)
put_chroma_hv_8_64x64_neon:                             18.5 (14.83x)
put_chroma_hv_8_128x128_c:                            1058.7 ( 1.00x)
put_chroma_hv_8_128x128_neon:                           75.2 (14.07x)

On Android Pixel 8 Pro:

put_chroma_hv_8_4x4_c:                                   1.2 ( 1.00x)
put_chroma_hv_8_4x4_neon:                                0.0 ( 0.00x)
put_chroma_hv_8_4x4_i8mm:                                0.2 ( 5.00x)
put_chroma_hv_8_8x8_c:                                   4.0 ( 1.00x)
put_chroma_hv_8_8x8_neon:                                0.5 ( 8.00x)
put_chroma_hv_8_8x8_i8mm:                                0.5 ( 8.00x)
put_chroma_hv_8_16x16_c:                                15.2 ( 1.00x)
put_chroma_hv_8_16x16_neon:                              2.5 ( 6.10x)
put_chroma_hv_8_16x16_i8mm:                              2.2 ( 6.78x)
put_chroma_hv_8_32x32_c:                                61.0 ( 1.00x)
put_chroma_hv_8_32x32_neon:                              9.8 ( 6.26x)
put_chroma_hv_8_32x32_i8mm:                              8.5 ( 7.18x)
put_chroma_hv_8_64x64_c:                               229.5 ( 1.00x)
put_chroma_hv_8_64x64_neon:                             38.5 ( 5.96x)
put_chroma_hv_8_64x64_i8mm:                             34.0 ( 6.75x)
put_chroma_hv_8_128x128_c:                             919.8 ( 1.00x)
put_chroma_hv_8_128x128_neon:                          154.5 ( 5.95x)
put_chroma_hv_8_128x128_i8mm:                          140.0 ( 6.57x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
0dcf204e5d aarch64/vvc: Add put_epel_h i8mm
put_chroma_h_8_4x4_c:                                    0.4 ( 1.00x)
put_chroma_h_8_4x4_neon:                                 0.0 ( 0.00x)
put_chroma_h_8_4x4_i8mm:                                 0.1 ( 2.67x)
put_chroma_h_8_8x8_c:                                    1.6 ( 1.00x)
put_chroma_h_8_8x8_neon:                                 0.1 (11.00x)
put_chroma_h_8_8x8_i8mm:                                 0.1 (11.00x)
put_chroma_h_8_16x16_c:                                  6.9 ( 1.00x)
put_chroma_h_8_16x16_neon:                               1.1 ( 6.00x)
put_chroma_h_8_16x16_i8mm:                               0.7 (10.62x)
put_chroma_h_8_32x32_c:                                 27.6 ( 1.00x)
put_chroma_h_8_32x32_neon:                               4.7 ( 5.95x)
put_chroma_h_8_32x32_i8mm:                               4.4 ( 6.28x)
put_chroma_h_8_64x64_c:                                116.2 ( 1.00x)
put_chroma_h_8_64x64_neon:                              19.1 ( 6.07x)
put_chroma_h_8_64x64_i8mm:                              17.1 ( 6.77x)
put_chroma_h_8_128x128_c:                              466.6 ( 1.00x)
put_chroma_h_8_128x128_neon:                            81.4 ( 5.73x)
put_chroma_h_8_128x128_i8mm:                            71.7 ( 6.51x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
41a1885f7a aarch64/vvc: Add put_epel_h
put_chroma_h_8_4x4_c:                                    0.2 ( 1.00x)
put_chroma_h_8_4x4_neon:                                 0.2 ( 1.00x)
put_chroma_h_8_8x8_c:                                    0.8 ( 1.00x)
put_chroma_h_8_8x8_neon:                                 0.2 ( 3.00x)
put_chroma_h_8_16x16_c:                                  3.8 ( 1.00x)
put_chroma_h_8_16x16_neon:                               0.8 ( 5.00x)
put_chroma_h_8_32x32_c:                                 12.5 ( 1.00x)
put_chroma_h_8_32x32_neon:                               2.2 ( 5.56x)
put_chroma_h_8_64x64_c:                                 47.0 ( 1.00x)
put_chroma_h_8_64x64_neon:                               8.8 ( 5.37x)
put_chroma_h_8_128x128_c:                              200.2 ( 1.00x)
put_chroma_h_8_128x128_neon:                            31.8 ( 6.31x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
260e1b4b62 aarch64/vvc: Add sad
sad_8x16_c:                                              0.8 ( 1.00x)
sad_8x16_neon:                                           0.2 ( 3.00x)
sad_16x8_c:                                              0.5 ( 1.00x)
sad_16x8_neon:                                           0.2 ( 2.00x)
sad_16x16_c:                                             1.5 ( 1.00x)
sad_16x16_neon:                                          0.2 ( 6.00x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
5ac6925803 aarch64/vvc: Add put_qpel_hv
With Apple M1 (no i8mm):

put_luma_hv_8_4x4_c:                                     2.2 ( 1.00x)
put_luma_hv_8_4x4_neon:                                  0.8 ( 3.00x)
put_luma_hv_8_8x8_c:                                     7.0 ( 1.00x)
put_luma_hv_8_8x8_neon:                                  0.8 ( 9.33x)
put_luma_hv_8_16x16_c:                                  22.8 ( 1.00x)
put_luma_hv_8_16x16_neon:                                2.5 ( 9.10x)
put_luma_hv_8_32x32_c:                                  84.8 ( 1.00x)
put_luma_hv_8_32x32_neon:                                9.5 ( 8.92x)
put_luma_hv_8_64x64_c:                                 333.0 ( 1.00x)
put_luma_hv_8_64x64_neon:                               35.5 ( 9.38x)
put_luma_hv_8_128x128_c:                              1294.5 ( 1.00x)
put_luma_hv_8_128x128_neon:                            137.8 ( 9.40x)

With Pixel 8 Pro:

put_luma_hv_8_4x4_c:                                     5.0 ( 1.00x)
put_luma_hv_8_4x4_neon:                                  0.8 ( 6.67x)
put_luma_hv_8_4x4_i8mm:                                  0.2 (20.00x)
put_luma_hv_8_8x8_c:                                    13.2 ( 1.00x)
put_luma_hv_8_8x8_neon:                                  1.2 (10.60x)
put_luma_hv_8_8x8_i8mm:                                  1.2 (10.60x)
put_luma_hv_8_16x16_c:                                  44.2 ( 1.00x)
put_luma_hv_8_16x16_neon:                                4.5 ( 9.83x)
put_luma_hv_8_16x16_i8mm:                                4.2 (10.41x)
put_luma_hv_8_32x32_c:                                 160.8 ( 1.00x)
put_luma_hv_8_32x32_neon:                               17.5 ( 9.19x)
put_luma_hv_8_32x32_i8mm:                               16.0 (10.05x)
put_luma_hv_8_64x64_c:                                 611.2 ( 1.00x)
put_luma_hv_8_64x64_neon:                               68.0 ( 8.99x)
put_luma_hv_8_64x64_i8mm:                               62.2 ( 9.82x)
put_luma_hv_8_128x128_c:                              2384.8 ( 1.00x)
put_luma_hv_8_128x128_neon:                            268.8 ( 8.87x)
put_luma_hv_8_128x128_i8mm:                            245.8 ( 9.70x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
a0b52afd32 aarch64/vvc: Add put_qpel_vx
put_luma_v_8_4x4_c:                                      1.0 ( 1.00x)
put_luma_v_8_4x4_neon:                                   0.0 ( 0.00x)
put_luma_v_8_8x8_c:                                      3.5 ( 1.00x)
put_luma_v_8_8x8_neon:                                   0.5 ( 7.00x)
put_luma_v_8_16x16_c:                                   13.8 ( 1.00x)
put_luma_v_8_16x16_neon:                                 1.2 (11.00x)
put_luma_v_8_32x32_c:                                   54.2 ( 1.00x)
put_luma_v_8_32x32_neon:                                 5.0 (10.85x)
put_luma_v_8_64x64_c:                                  217.5 ( 1.00x)
put_luma_v_8_64x64_neon:                                18.8 (11.60x)
put_luma_v_8_128x128_c:                                886.2 ( 1.00x)
put_luma_v_8_128x128_neon:                              74.0 (11.98x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
b051bc7cb8 aarch64/h26x: Remove duplicate b.eq instruction
b.eq is added by calc_all after each calc.
2024-09-14 16:36:34 +08:00
Zhao Zhili
11443cc9b1 avcodec/hevc: ff_hevc_(qpel/epel)_filters are signed type 2024-09-14 16:36:34 +08:00
Zhao Zhili
9f6c8eb412 aarch64/vvc: Add put_qpel_hx i8mm
Benchmark on Android pixel 8 with -fno-vectorize

put_luma_h_8_4x4_c:                                      0.2 ( 1.00x)
put_luma_h_8_4x4_neon:                                   0.2 ( 1.00x)
put_luma_h_8_4x4_i8mm:                                   0.0 ( 0.00x)
put_luma_h_8_8x8_c:                                      1.5 ( 1.00x)
put_luma_h_8_8x8_neon:                                   0.5 ( 3.00x)
put_luma_h_8_8x8_i8mm:                                   0.5 ( 3.00x)
put_luma_h_8_16x16_c:                                    6.2 ( 1.00x)
put_luma_h_8_16x16_neon:                                 2.0 ( 3.12x)
put_luma_h_8_16x16_i8mm:                                 1.5 ( 4.17x)
put_luma_h_8_32x32_c:                                   25.5 ( 1.00x)
put_luma_h_8_32x32_neon:                                 9.0 ( 2.83x)
put_luma_h_8_32x32_i8mm:                                 6.8 ( 3.78x)
put_luma_h_8_64x64_c:                                   99.8 ( 1.00x)
put_luma_h_8_64x64_neon:                                35.2 ( 2.83x)
put_luma_h_8_64x64_i8mm:                                27.2 ( 3.66x)
put_luma_h_8_128x128_c:                                422.0 ( 1.00x)
put_luma_h_8_128x128_neon:                             138.5 ( 3.05x)
put_luma_h_8_128x128_i8mm:                             109.2 ( 3.86x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
25448d1716 aarch64/vvc: Add put_pel/put_pel_uni/put_pel_uni_w
put_luma_pixels_8_4x4_c:                                 0.2 ( 1.00x)
put_luma_pixels_8_4x4_neon:                              0.2 ( 1.00x)
put_luma_pixels_8_8x8_c:                                 0.7 ( 1.00x)
put_luma_pixels_8_8x8_neon:                              0.2 ( 3.22x)
put_luma_pixels_8_16x16_c:                               2.2 ( 1.00x)
put_luma_pixels_8_16x16_neon:                            0.2 ( 9.89x)
put_luma_pixels_8_32x32_c:                               8.2 ( 1.00x)
put_luma_pixels_8_32x32_neon:                            1.2 ( 6.71x)
put_luma_pixels_8_64x64_c:                              33.7 ( 1.00x)
put_luma_pixels_8_64x64_neon:                            2.5 (13.63x)
put_luma_pixels_8_128x128_c:                           145.5 ( 1.00x)
put_luma_pixels_8_128x128_neon:                         10.2 (14.23x)
put_uni_pixels_luma_8_4x4_c:                             0.5 ( 1.00x)
put_uni_pixels_luma_8_4x4_neon:                          0.0 ( 0.00x)
put_uni_pixels_luma_8_8x8_c:                             0.5 ( 1.00x)
put_uni_pixels_luma_8_8x8_neon:                          0.2 ( 2.11x)
put_uni_pixels_luma_8_16x16_c:                           1.2 ( 1.00x)
put_uni_pixels_luma_8_16x16_neon:                        0.2 ( 5.44x)
put_uni_pixels_luma_8_32x32_c:                           3.0 ( 1.00x)
put_uni_pixels_luma_8_32x32_neon:                        0.5 ( 6.26x)
put_uni_pixels_luma_8_64x64_c:                           3.0 ( 1.00x)
put_uni_pixels_luma_8_64x64_neon:                        1.7 ( 1.72x)
put_uni_pixels_luma_8_128x128_c:                         6.5 ( 1.00x)
put_uni_pixels_luma_8_128x128_neon:                      6.5 ( 1.00x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
20f2bf5530 aarch64/vvc: Add put_qpel_h_* and put_qpel_uni_h_*
Just share hevc implementation.

checkasm --test=vvc_mc --benchmark:

put_luma_h_8_4x4_c:                                      0.2 ( 1.00x)
put_luma_h_8_4x4_neon:                                   0.2 ( 1.00x)
put_luma_h_8_8x8_c:                                      1.0 ( 1.00x)
put_luma_h_8_8x8_neon:                                   0.2 ( 4.33x)
put_luma_h_8_16x16_c:                                    3.2 ( 1.00x)
put_luma_h_8_16x16_neon:                                 1.2 ( 2.63x)
put_luma_h_8_32x32_c:                                   13.7 ( 1.00x)
put_luma_h_8_32x32_neon:                                 4.0 ( 3.45x)
put_luma_h_8_64x64_c:                                   48.2 ( 1.00x)
put_luma_h_8_64x64_neon:                                15.7 ( 3.07x)
put_luma_h_8_128x128_c:                                203.5 ( 1.00x)
put_luma_h_8_128x128_neon:                              62.0 ( 3.28x)
put_uni_h_luma_8_4x4_c:                                  0.2 ( 1.00x)
put_uni_h_luma_8_4x4_neon:                               0.2 ( 1.00x)
put_uni_h_luma_8_8x8_c:                                  1.5 ( 1.00x)
put_uni_h_luma_8_8x8_neon:                               0.2 ( 6.56x)
put_uni_h_luma_8_16x16_c:                                5.7 ( 1.00x)
put_uni_h_luma_8_16x16_neon:                             1.2 ( 4.67x)
put_uni_h_luma_8_32x32_c:                               24.0 ( 1.00x)
put_uni_h_luma_8_32x32_neon:                             4.7 ( 5.07x)
put_uni_h_luma_8_64x64_c:                               90.0 ( 1.00x)
put_uni_h_luma_8_64x64_neon:                            17.0 ( 5.30x)
put_uni_h_luma_8_128x128_c:                            357.7 ( 1.00x)
put_uni_h_luma_8_128x128_neon:                          67.5 ( 5.30x)
2024-09-14 16:36:34 +08:00
Zhao Zhili
46f07ce7d1 aarch64/hevc: Move epel/qpel to h26x directory
So vvc can reuse the implementation.
2024-09-14 16:36:34 +08:00
Zhao Zhili
8beafb5656 aarch64/hevc: Simplify function prototypes by macro 2024-09-14 16:36:34 +08:00
jiangjie
f606872ed0 avformat/dashdec: The segments in dash file doesn't read completely when segment's size and duration is very small.
If the segment is very small, avformat_find_stream_info
will read all audio/video data in this segment.
cur->is_restart_needed is set to 0 later in dash_read_packet,
and no chance to be set to 1 again in the read_data function.

Reproduction:
ffmpeg -f lavfi -i mandelbrot -f lavfi -i anullsrc -c:v vp8 \
 -g 5 -r 5 -c:a libopus -use_template 0 -seg_duration 1 \
 -t 15 -y test_720.mpd
ffprobe -show_packets test_720.mpd
2024-09-14 11:42:09 +08:00
Marvin Scholz
6229e4ac42 avformat/mxfdec: narrow variable scopes 2024-09-13 19:48:15 +02:00
Marvin Scholz
f5107e79ce avformat/mxfdec: fix variable shadowing 2024-09-13 19:48:08 +02:00
Marvin Scholz
dd002f1588 fftools/ffmpeg_demux: narrow variable scope 2024-09-13 19:41:23 +02:00
Marvin Scholz
0753d17664 avcodec/libx264: fix variable shadowing 2024-09-13 19:40:46 +02:00
Marvin Scholz
0f87ff0db4 avcodec/g2meet: fix variable shadowing 2024-09-13 19:39:58 +02:00
Marvin Scholz
fd4f7d0d14 avcodec/mjpegdec: fix variable shadowing 2024-09-13 19:39:19 +02:00
Marvin Scholz
3ebc68d25d fftools/ffmpeg_mux_init: fix variable shadowing 2024-09-13 19:38:40 +02:00
Marvin Scholz
25f0fff9ec fftools/ffmpeg_demux: fix variable shadowing 2024-09-13 19:37:40 +02:00
Marvin Scholz
c59a073abe lavfi/af_channelmap: fix channelmap_init error handling
The channelmap_init function was returning success even on error after
7dc81d33c2 due to shadowing of the
outer ret variable.

Fixes CID1619297 Logically dead code
2024-09-13 19:12:58 +02:00
Anton Khirnov
c079ebdc57 tests/fate/hevc: add a periodic intra refresh decode test
Would trigger #10887 before it was fixed, sample cut from the one
attached to the bug.
2024-09-13 12:10:11 +02:00
Anton Khirnov
536bb98888 lavc/hevcdec: set per-CTB filter parameters for WPP
Fixes #10887
2024-09-13 12:10:11 +02:00
Anton Khirnov
21ef80f3d9 lavc/hevcdec: remove a duplicate variable
In hls_decode_entry_wpp(), self_id is always identical to thread.
2024-09-13 12:10:11 +02:00
Anton Khirnov
b88c88f920 Changelog: elaborate on what YUVJ is
Not all changelog readers may be familiar with it.
2024-09-13 11:56:53 +02:00
Anton Khirnov
b53800691c lavc/hevcdec: set output frame pkt_dts
pkt_dts needs to be set manually when using the receive_frame() callback, so
it was unset after 2fdecbb239.

Fixes PTS guessing for certain files with broken timestamps. Cf.
https://github.com/mpv-player/mpv/issues/14806

Reported-by: llyyr <llyyr.public@gmail.com>
2024-09-13 11:56:53 +02:00
Marvin Scholz
bb91425eb8 fftools/ffmpeg_mux_init: remove unused variable
This dict is declared and freed but nothing is ever written to it.
2024-09-13 00:31:19 +02:00
Marvin Scholz
0c84b977a9 avdevice/jack: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:30:48 +02:00
Marvin Scholz
5dfc547f25 avutil/file: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:29:10 +02:00
Marvin Scholz
074bf9faf7 avformat/crypto: fix variable shadowing 2024-09-13 00:27:35 +02:00
Marvin Scholz
24711b00c6 avformat/network: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:26:53 +02:00
Marvin Scholz
e7126d9648 lavfi/vf_signature: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:26:23 +02:00
Marvin Scholz
8fac5beaf8 lavfi/f_metadata: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:24:47 +02:00
Marvin Scholz
59244a0c50 lavfi/vf_ssim: narrow variable scopes 2024-09-13 00:24:20 +02:00
Marvin Scholz
3f8061afe8 lavfi/vf_ssim: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:23:00 +02:00
Marvin Scholz
bd3038b28c lavfi/vf_vmafmotion: fix variable shadowing 2024-09-13 00:22:29 +02:00
Marvin Scholz
e93f20c017 lavfi/vf_vmafmotion: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:21:23 +02:00
Marvin Scholz
29d7ed089e lavfi/vf_psnr: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
2024-09-13 00:21:02 +02:00
Marvin Scholz
4c6d07dd28 fftools/cmdutils: fix variable shadowing 2024-09-13 00:20:12 +02:00
Marvin Scholz
bbde886b63 lavfi/vf_ssim360: fix variable shadowing 2024-09-13 00:19:46 +02:00
Marvin Scholz
c6ab95d009 lavfi/vf_ssim360: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed
to av_log, so av_err2str can be used.
2024-09-13 00:19:20 +02:00
Marvin Scholz
990b80c004 fftools/ffmpeg_opt: fix variable shadowing 2024-09-13 00:17:53 +02:00
Niklas Haas
ca77fc2177 avfilter: fix YUV colorspace negotiation for YUVJ
Ironically, despite being introduced to make YUVJ unnecessary, the new
YUV negotiation logic failed to actually negotiate YUVJ formats
themselves correctly, leading to errors when passing YUVJ frames into
a filter graph. (They were effectively treated like RGB or Grayscale
formats, rather than as forced-full-range YUV, and hence did not have
their colorspace matrix correctly negotiated)

Fix this by splitting off the YUVJ check from ff_fmt_is_regular_yuv().
Obviously, we can trivially undo this change again once YUVJ is actually
deleted from the codebase.

Fixes: #11179
2024-09-12 19:13:21 +02:00
Niklas Haas
da80ee21ca tests/fate: force MPEG range for rawvideo tests
The input file is MPEG range, so we should also encode to MPEG range
before comparing against it. This bug was avoided in the past because
YUVJ inputs were automatically converted back to limited range when converting
to a different pixfmt (in the absence of tagging). However, with proper YUV
negotiation in place, the default behavior is to preserve the YUV range
wherever possible. Since `rawvideo` does not signal or care about the YUV
range, we need to explicitly request the desired output range to force a
conversion.

Affects all rawvideo tests, in particular vsynth and owdenoise.
2024-09-12 19:13:21 +02:00
Marvin Scholz
504c1ffcd8 fftools/ffmpeg: remove useless error check
When ret is checked here, it was never assigned anything, making this
check useless, as highlighted by Coverity.

It seems to be a copy paste mistake given that opt_match_per_stream_str
does not return an error code that could be checked and the previous
value assigned to ret is already checked above. So just remove this
check.

Fixes: CID1616292
2024-09-12 05:11:14 +02:00
James Almer
2e91532ead avfilter/af_join: pass the correct input layouts to ff_channel_layouts_ref
Should fix memory leaks show in fate-filter-join and fate-filter-crazychannels.

Reviewed-by: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-11 16:26:55 -03:00
Cameron Gutman
a15d2fdfd9 avcodec/amfenc: Fix AV1 HDR metadata for delayed surfaces
AMF_VIDEO_ENCODER_AV1_INPUT_HDR_METADATA was set above in the normal
input case but forgotten for the same in the delayed surface codepath.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-11 15:45:59 +02:00
Lynne
4646a74d1e lavc/Makefile: only compile hw_base_encode_h264.c when actually needed 2024-09-10 04:59:22 +02:00
Lynne
15c03b79d2 hw_base_encode_h264: remove unused AUD unit structure
Each codec initializes its own AUD structure when needed, which takes 2 lines.
2024-09-10 04:57:29 +02:00
Michael Riedl
9bcb86b0fa avdevice/decklink_dec: extend available actions on signal loss
Deprecate the option 'draw_bars' in favor of the new option 'signal_loss_action',
which controls the behavior when the input signal is not available
(including the behavior previously available through draw_bars).
The default behavior remains unchanged to be backwards compatible.
The new option is more flexible for extending now and in the future.

The new value 'repeat' repeats the last video frame.
This is useful for very short dropouts and was not available before.

Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-09 23:47:49 +02:00
Zhao Zhili
071c499026 avfilter/unsharp: Call function directly rather than via function pointer
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-09-10 00:59:30 +08:00
Anton Khirnov
691e0a1082 lavfi/af_pan: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
b38f4e7f86 lavfi/af_pan: stop modifying private data in query_formats()
It is not supposed to have any side effects, and the modification in
question can just as well be done in filter init.
2024-09-09 17:26:18 +02:00
Anton Khirnov
d0f4c08207 lavfi/af_lv2: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov
363d4a7559 lavfi/af_replaygain: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov
75b2f5a7d3 lavfi/af_sidechaincompress: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
4c4199758c lavfi/af_sofalizer: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov
449f670a14 lavfi/af_stereotools: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
c4d9282a56 lavfi/af_stereowiden: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
d90035c941 lavfi/af_surround: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
2ee4625d4b lavfi/af_virtualbass: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
7887d00ee6 lavfi/af_volume: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
e13592c22d lavfi/af_loudnorm: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:18 +02:00
Anton Khirnov
bfb139bb8d lavfi/af_ladspa: convert to query_func2() 2024-09-09 17:26:18 +02:00
Anton Khirnov
48d9a4d7ca lavfi/af_join: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov
fdc6e31725 lavfi/af_headphone: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov
c9c6f07436 lavfi/af_hdcd: convert to query_func2() 2024-09-09 17:26:17 +02:00
Anton Khirnov
0ec382f494 lavfi/af_haas: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov
408587c836 lavfi/af_extrastereo: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov
7896b95430 lavfi/af_earwax: convert to query_func2() 2024-09-09 17:26:17 +02:00
Anton Khirnov
e37d1efe65 lavfi/af_dialoguenhance: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov
ffbafbfded lavfi/af_crossfeed: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov
84fda7de79 lavfi/af_channelsplit: convert to query_func2()
Also, drop a redundant call that also happens implicitly in generic code.
2024-09-09 17:26:17 +02:00
Anton Khirnov
cfbf10412f tests/fate/filter-audio: add a test for handling more than 64 channels
The test constructs 66 sine waves of different frequencies and joins
them into a 7th order ambisonic layout with extra non-diegetic
stereo. The channels are then shifted circularly with channelmap and
separated into individual streams for muxing with channelsplit.

Note that the last step is necessary because swr is not capable of
interleaving planar to packed for more than 64 channels, which would be
necessary to mux such a stream as PCM.
2024-09-09 17:26:17 +02:00
Anton Khirnov
18d492ff41 lavfi/af_channelsplit: support arbitrary channel layouts
Not just those containing channel values under 64. Also, remove an
arbitrary limitation on channel count.
2024-09-09 17:26:17 +02:00
Anton Khirnov
7dc81d33c2 lavfi/af_channelmap: remove an arbitrary limit on channel count 2024-09-09 17:26:17 +02:00
Brad Smith
a3f79fd22a aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD
FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-09 07:17:49 -04:00
Lynne
1709f3830e fftools/opt_common: add missing newline after printing codecs
This fixes
ffmpeg -help bsf=trace_headers =>

Supported codecs: av1 h264 hevc vvc mjpeg mpeg2video vp8 vp9<no newline>
2024-09-09 13:03:04 +02:00
Marvin Scholz
9556379943 lavfi/avfiltergraph: fix leak on error
Introduced in eddffbedb3

Fixes: CID1618897 Resource leak
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-09 12:27:00 +02:00
Brad Smith
fe4b9ef69f avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()
Initially used for getauxval() but will be used to add support for
other API, such as elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-09 06:20:11 -04:00
Lynne
5e9845f11e vulkan(_decode): fix, simplify and improve queries
The old query code never worked properly, and did some hideous
heuristics to read the status bit, and work that into a return
code.
This is all best left to callers to do, which simplifies
our code a lot.

This also fixes minor validation errors regarding calling queries
which are not in their active state.
2024-09-09 07:05:46 +02:00
Lynne
3415e0533f hwcontext_vulkan: disable more false positive validation checks
Both of these are fundamentally incompatible with video decoding.

The third one can be tracked in the following validation layer issue:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/6627
2024-09-09 07:05:46 +02:00
Lynne
9c65325819 vulkan_decode: use ff_vk_init
This solves the issue of an av_log function being called
with a context with invalid class.

Co-authored-by: Anton Khirnov <anton@khirnov.net>
2024-09-09 07:05:45 +02:00
Lynne
620822c0c5 vulkan: add a ff_vk_init function
This function sets the class correctly, and calls functions
that all users have to call anyway.
2024-09-09 07:05:45 +02:00
Lynne
0ffa967170 hwcontext_vulkan: ask for storage images by default
The issue is that we ask for storage images by default if
available, but because that is gated by the format supporting
storage images, and the check for the format supporting storage
images is gated by the usage, this resulted in a catch-22.
2024-09-09 07:05:45 +02:00
Lynne
eb5088d28c vulkan_filter: require storage images properly, set usage flags explicitly
This caused images to be created without a storage usage, which broke
at least lavapipe.
2024-09-09 07:05:44 +02:00
Lynne
c41ef7f2ff hwcontext_vulkan: add PREP_MODE_GENERAL for non-transfer_dst images
Vulkan filters don't need images which can be transferred into.
2024-09-09 07:05:44 +02:00
Lynne
66e950fcac vulkan_video: move imageview creation and DPB fields to common context
Shared between decoders and encoders.
2024-09-09 07:05:44 +02:00
Lynne
06483d039a vulkan: error out if query is called without being initialized 2024-09-09 07:05:43 +02:00
Lynne
fd86c373c2 vulkan: use correct return codes for query errors 2024-09-09 07:05:43 +02:00
Lynne
0a1f724bf4 vulkan_video: add utilities for H264 level/profile mapping 2024-09-09 07:05:42 +02:00
Lynne
3de73f1262 hw_base_encode: make recon_frames_ref optional
Vulkan supports some stupidly odd hardware, that unfortunately,
most modern GPUs happen to be.
The DPB images for encoders may be required to be preallocated
all at once, and rather than be individual frames, be layers of
a single frame.

As the hw_base_encode code is written with the thought that either
the driver or the device itself supports sane image allocation,
Vulkan does not leave us with this option.

So, in the case that the hardware does not support individual
frames to be used as DPBs, make the DBP frames context optional,
and let the subsystem manage this.
2024-09-09 07:05:42 +02:00
Lynne
e6019ed075 hw_base_encode: allocate DPB image upfront
Vulkan requires this, as it needs to initialize state upfront.
2024-09-09 07:05:42 +02:00
Lynne
034e25e1a4 hw_base_encode: move VAAPI SPS/PPS constructors to a shared file 2024-09-09 07:05:41 +02:00
Lynne
9db68ed042 hw_base_encode: refactor picture allocation/freeing
This commit cleans up and refactors the mess of private state upon
private state that used to be.

Now, FFHWBaseEncodePicture is fully initialized upon call-time,
and, most importantly, this lets APIs which require initialization
data for frames (VkImageViews) to initialize this for both the
input image, and the reconstruction (DPB) image.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-09-09 07:05:24 +02:00
James Almer
fdf8025eb6 avcodec/avcodec: remove usage of __typeof__()
It's non-standard C.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-08 20:33:04 -03:00
Niklas Haas
b4e918221c doc/APIchanges: mention correct version number
Missed while rebasing
2024-09-08 18:07:30 +02:00
Michael Niedermayer
4bc2f90cff MAINTAINERS: remove Aurelien and David from matroska*
Aurelien last activity in git is from 2017, last activity on the ML is from 2018
David last activity in git is from 2011, and ML from 2013

matroska* is actively maintained

CC: Aurelien Jacobs <aurel@gnuage.org>
CC: David Conrad <lessen42@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:39 +02:00
Michael Niedermayer
85aee1dc31 MAINTAINER: iamf is maintained by James
CC: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:39 +02:00
Michael Niedermayer
ec8b5187f9 MAINTAINERS: Add status to icecast
Last icecast threads have Marvin in them so it seems maintained

CC: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:39 +02:00
Michael Niedermayer
49226216b1 MAINTAINERS: Rangecoder looks quite familiar, ill maintain it
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:38 +02:00
Michael Niedermayer
c7083738bd MAINTAINERS: Mark parts from Ludmila as unmaintained
Last i see from Ludmila is from 2015

CC: Ludmila Glinskih <lglinskih@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:38 +02:00
Michael Niedermayer
5d02b0f72e MAINTAINERS: Update fate admin
Timothy has not reacted to any fate admin related mails i can remember
last was handled by timo, prior where probably handled by me

CC: Timothy Gu <timothygu99@gmail.com>
CC: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:38 +02:00
Michael Niedermayer
006ee12a9a MAINTAINERS: Mark parts from Robert as unmaintained
Last mail and commit from Robert seems from 2011, thats 13 years ago

CC: Rob <robert.swain@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:37 +02:00
Christian Helmrich
865cd3c056 avfilter: add XPSNR filter
Add XPSNR video filter
Register new filter xpsnr.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-08 17:51:37 +02:00
Niklas Haas
e6983ed525 Changelog: mention YUV range negotiation 2024-09-08 14:07:59 +02:00
Niklas Haas
8517ff2082 fftools/ffmpeg_filter: remove YUVJ hack
This is no longer needed, since we now correctly negotiate the required
range from the mjpeg encoder via avcodec_get_supported_config().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-08 13:59:29 +02:00
Niklas Haas
a850f80e2c fftools/ffmpeg_filter: propagate codec yuv metadata to filters
To convert between color spaces/ranges, if needed by the codec
properties.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-08 13:59:29 +02:00
Niklas Haas
33d5a4ec4e fftools/ffmpeg_filter: switch to avcodec_get_supported_config()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-08 13:59:29 +02:00
Anton Khirnov
f3e265c690 fftools/ffmpeg_mux_init: factor out binding filters to output streams 2024-09-08 13:59:29 +02:00
Niklas Haas
7d6cd13ccb fftools/ffmpeg_filter: simplify choose_pix_fmts
The only meaningful difference between choose_pix_fmts and the default
code was the inclusion of an extra branch for `keep_pix_fmt` being true.

However, in this case, we either:
1. Force the specific `ofp->format` that we inherited from
   ofilter_bind_ost, or if no format was set:
2. Print an empty format list

Both of these goals can be accomplished by simply moving the decision
logic to ofilter_bind_ost, to avoid setting any format list when
keep_pix_fmt is enabled. This is arguably cleaner as it moves format
selection logic to a single function. In the case of branch 1, nothing
else needs to be done as we already force the format provided in
ofp->format, if any is set. Add an assertion to verify this assumption
just in case.

(Side note: The "choose_*" family of functions are arguably misnomers,
as they should really be called "print_*" - their current behavior is to
print the relevant format lists to the `vf/af_format` filter arguments)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-09-08 13:59:29 +02:00
Niklas Haas
7b0eca1e51 fftools/ffmpeg_mux_init: switch to avcodec_get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas
377652da19 fftools: drop unused/hacky macros
Having macros initialize local variables seems strange to me, and there
are no more current users of these macros. (The one that was commented
out was incorrect anyway, since the macro has changed in the meantime)
2024-09-08 13:59:29 +02:00
Niklas Haas
69b8405482 fftools/opt_common: switch to avcodec_get_supported_config()
While rewriting this macro, I decided to make it a bit more flexible so
it can work for all of the fields (including future fields) in a more
generic way, and to also print the channel layout using an AVBPrint to
avoid hard-coding the assumption that the length is less than 128
characters.
2024-09-08 13:59:29 +02:00
Niklas Haas
4524d527bf avcodec/codec_internal: nuke init_static_data()
All hail get_supported_config()
2024-09-08 13:59:29 +02:00
Niklas Haas
2c2dfd9149 avcodec/mjpegenc: switch to get_supported_config()
This codec's capabilities should be set dynamically based on the value
of strict_std_compliance, when available. This will allow us to finally
get rid of the strictness hack in ffmpeg_filter.c.
2024-09-08 13:59:29 +02:00
Niklas Haas
a577172c99 avcodec/libaomenc: switch to get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas
0977d968e4 avcodec/libvpxenc: switch to get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas
de421cac8b avcodec/libx265: switch to get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas
088108fc7a avcodec/allcodecs: add backcompat for new config API
In order to avoid breaking older clients not yet using the new API, we
need to add backwards compatibility for codecs which have switched from
init_static() to get_supported_config().

This function can be removed entirely once the deprecated static fields
are removed.
2024-09-08 13:59:29 +02:00
Niklas Haas
13cec7bb5f avcodec/encode: switch to avcodec_get_supported_config() 2024-09-08 13:59:29 +02:00
Niklas Haas
3305767560 avcodec: add avcodec_get_supported_config()
This replaces the myriad of existing lists in AVCodec by a unified API
call, allowing us to (ultimately) trim down the sizeof(AVCodec) quite
substantially, while also making this more trivially extensible.

In addition to the already covered lists, add two new entries for color
space and color range, mirroring the newly added negotiable fields in
libavfilter.

Once the deprecation period passes for the existing public fields, the
rough plan is to move the commonly used fields (such as
pix_fmt/sample_fmt) into FFCodec, possibly as a union of audio and video
configuration types, and then implement the rarely used fields with
custom callbacks.
2024-09-08 13:59:25 +02:00
Niklas Haas
703288cec6 avcodec/internal: add FFCodec.color_ranges
I went through all codecs and put them into five basic categories:

1. JPEG range only
2. MPEG range only
3. Explicitly tagged
4. Broken (codec supports both but encoder ignores tags)
5. N/A (headerless or pseudo-formats)

Filters in category 5 remain untouched. The rest gain an explicit
assignment of their supported color ranges, with codecs in category
4 being set to MPEG-only for safety.

It might be considered redundant to distinguish between 0 (category 5)
and MPEG+JPEG (category 3), but in doing so we effectively communicate
that we can guarantee that these tags will be encoded, which is distinct
from the situation where there are some codecs that simply don't have
tagging or implied semantics (e.g. rawvideo).

A full list of codecs follows:

JPEG range only:
 - amv
 - roqvideo

MPEG range only:
 - asv1, asv2
 - avui
 - cfhd
 - cljr
 - dnxhd
 - dvvideo
 - ffv1
 - flv
 - h261, h263, h263p
 - {h263,vp8}_v4l2m2m
 - huffyuv, ffvhuff
 - jpeg2000
 - libopenjpeg
 - libtheora
 - libwebp, libwebp_anim
 - libx262
 - libxavs, libxavs2
 - libxvid
 - mpeg1video, mpeg2video
 - mpeg2_qsv
 - mpeg2_vaapi
 - mpeg4, msmpeg4, msmpeg4v2, wmv1, wmv2
 - mpeg4_omx
 - prores, prores_aw, prores_ks
 - rv10, rv20
 - snow
 - speedhq
 - svq1
 - tiff
 - utvideo

Explicitly tagged (MPEG/JPEG):
 - {av1,h264,hevc}_nvenc
 - {av1,h264,hevc}_vaapi
 - {av1,h264,hevc,vp8,vp9,mpeg4}_mediacodec
 - {av1,h264,hevc,vp9}_qsv
 - h264_amf
 - {h264,hevc,prores}_videotoolbox
 - libaom-av1
 - libkvazaar
 - libopenh264
 - librav1e
 - libsvtav1
 - libvpx, libvpx-vp9
 - libx264
 - libx265
 - ljpeg
 - mjpeg
 - vc2

Broken (encoder ignores tags):
 - {av1,hevc}_amf
 - {h264,hevc,mpeg4}_v4l2m2m
 - h264_omx
 - libxeve
 - magicyuv
 - {vp8,vp9,mjpeg}_vaapi

N/A:
 - ayuv, yuv4, y41p, v308, v210, v410, v408 (headerless)
 - pgmyuv (headerless)
 - rawvideo, bitpacked (headerless)
 - vnull, wrapped_avframe (pseudocodecs)
2024-09-08 13:58:11 +02:00
Marvin Scholz
8a314e3f11 lavu/opt: Fix return of uninitialised value
In one of the failure paths of av_opt_get_array, the ret variable
was accidentally declared again, shadowing the outer one and once when
jumping to the fail label would return the still uninitialised outer
one.

To fix this simply remove the local declaration of ret that shadowed
the outer one.

Introduced in d89930f866

Fixes: CID1618663 Uninitialized scalar variable
2024-09-07 20:42:26 +02:00
Marvin Scholz
b4e64b86ad lavu/opt: av_opt_set_array: fix uninitialised return
In one failure path for av_opt_set_array, the ret variable
was declared again, shadowing the outer one and writing the
return value to the wrong one and then after the goto returning
the uninitialized one instead.

Introduced in 450a3f58ed

Fixes: CID1619242 Uninitialized scalar variable
2024-09-07 20:39:42 +02:00
Timo Rothenpieler
7e35aeda03 lavu/opt: properly initialize av_opt_set_array return value 2024-09-07 20:21:01 +02:00
Ramiro Polla
c0666d8bed swscale/aarch64/rgb2rgb: add neon implementation for rgb24toyv12
A55               A76
rgb24toyv12_16_200_c:     36890.6           17275.5
rgb24toyv12_16_200_neon:  12460.1 ( 2.96x)   5360.8 ( 3.22x)
rgb24toyv12_128_60_c:     83205.1           39884.8
rgb24toyv12_128_60_neon:  27468.4 ( 3.03x)  13552.5 ( 2.94x)
rgb24toyv12_512_16_c:     88111.6           42346.8
rgb24toyv12_512_16_neon:  29126.6 ( 3.03x)  14411.2 ( 2.94x)
rgb24toyv12_1920_4_c:     82068.1           39620.0
rgb24toyv12_1920_4_neon:  27011.6 ( 3.04x)  13492.2 ( 2.94x)
2024-09-06 23:11:13 +02:00
Ramiro Polla
caaec2ea95 swscale/x86/rgb2rgb: disable rgb24toyv12_mmxext for x86_64
The mmxext implementation is slower than the C version in x86_64.

                                m32               m64
rgb24toyv12_16_200_c:       24942.7           14812.6
rgb24toyv12_16_200_mmxext:  17857.2 ( 1.40x)  17400.4 ( 0.85x)
rgb24toyv12_128_60_c:       56892.9           35616.9
rgb24toyv12_128_60_mmxext:  40730.9 ( 1.40x)  39610.4 ( 0.90x)
rgb24toyv12_512_16_c:       58402.7           37209.4
rgb24toyv12_512_16_mmxext:  44842.4 ( 1.30x)  41136.2 ( 0.90x)
rgb24toyv12_1920_4_c:       54827.4           34737.4
rgb24toyv12_1920_4_mmxext:  51169.9 ( 1.07x)  34818.9 ( 1.00x)
2024-09-06 23:06:38 +02:00
Ramiro Polla
e0cc06184c checkasm/sw_rgb: add rgb24toyv12 tests 2024-09-06 23:06:35 +02:00
Ramiro Polla
3604b2403c swscale/rgb2rgb: improve chroma conversion in ff_rgb24toyv12_c
The current code subsamples by dropping 3/4 pixels to calculate the
chroma components. This commit calculates the average of 4 rgb pixels
before calculating the chroma components, putting it in line with the
mmxext implementation.
2024-09-06 23:06:32 +02:00
Ramiro Polla
d8848325a6 swscale/aarch64/rgb2rgb: add deinterleaveBytes neon implementation
A55               A76
deinterleave_bytes_c:             70342.0           34497.5
deinterleave_bytes_neon:          21594.5 ( 3.26x)   5535.2 ( 6.23x)
deinterleave_bytes_aligned_c:     71340.8           34651.2
deinterleave_bytes_aligned_neon:   8616.8 ( 8.28x)   3996.2 ( 8.67x)
2024-09-06 23:05:09 +02:00
Ramiro Polla
c08bb33e41 checkasm/sw_rgb: add deinterleaveBytes 2024-09-06 23:05:06 +02:00
Ramiro Polla
4c824ad391 swscale/x86/rgb2rgb: fix deinterleaveBytes writing past the end of the buffers 2024-09-06 23:05:04 +02:00
Ramiro Polla
f17a6bd200 swscale/x86/rgb2rgb: fix deinterleaveBytes for unaligned dst pointers 2024-09-06 23:05:01 +02:00
Frank Plowman
6df0c5f9f4 lavc/vvc: Remove experimental flag
This reverts commit 110d8549d5.

I have been working through fixing bugs, particularly crashes I've
found using a fuzzer, in the VVC decoder for the past few months.
While I won't claim it is now bug-free, it is considerably more
resilient than it was and I think in a position to have the
experimental flag removed for release 7.1.

Additionally, most of the Main 10 features of VVC which were missing
version of the decoder released in 7.0 have now been implemented.
This includes the most major missing features: IBC, subpictures and RPR.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-09-06 22:14:52 +08:00
Anton Khirnov
eec1a7a6bb lavc/hevc: check framerate num/den to be strictly positive
Rather than just != 0. These values are read as uint32 and can become
negative when cast to int.
2024-09-06 14:09:03 +02:00
Anton Khirnov
fc8df81cb1 lavc/hevcdec: move active SPS from HEVCParamSets to HEVCLayerContext
Currently active SPS is a per-layer property.
2024-09-06 13:59:29 +02:00
Anton Khirnov
9bccc634af lavc/hevcdec: make a HEVCFrame hold a reference to its PPS
ff_hevc_get_ref_list() needs the PPS of a previously decoded frame,
which may be different from the currently active one.
2024-09-06 13:59:29 +02:00
Anton Khirnov
672713761b lavc/hevcdec: move HEVCContext.sao_pixel_buffer_[vh] to HEVCLayerContext
Handle them together with other sps-dependent arrays.

Note that current code only allocates these arrays when hwaccel is not
set, but this is wrong as the relevant code runs BEFORE get_format() is
called and hence before we know whether hwaccel is in use.
2024-09-06 13:59:29 +02:00
Anton Khirnov
6fcf0045cf lavc/hevcdec: move HEVCContext.{tab_mvf,rpl_tab}_pool to HEVCLayerContext
pic_arrays_{init,free}() no longer access HEVCContext
2024-09-06 13:59:29 +02:00
Anton Khirnov
4f87ff7666 lavc/hevcdec: move HEVCContext.{horizontal,vertical}_bs to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
e8baf2fb97 lavc/hevcdec: move HEVCContext.qp_y_tab to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
d5188adba8 lavc/hevcdec: move HEVCContext.tab_slice_address to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
eeb369d24f lavc/hevcdec: move HEVCContext.filter_slice_edges to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
463a85c5a1 lavc/hevcdec: move HEVCContext.is_pcm to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
0704559932 lavc/hevcdec: move HEVCContext.tab_ipm to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
59de042cf6 lavc/hevcdec: move HEVCContext.cbf_luma to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
cf7add8d70 lavc/hevcdec: move HEVCContext.tab_ct_depth to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
1ca4c2a96d lavc/hevcdec: move HEVCContext.skip_flag to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
ed2d25e7f0 lavc/hevcdec: move HEVCContext.deblock to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
3d4294e344 lavc/hevcdec: move HEVCContext.sao to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
747609e967 lavc/hevcdec: move HEVCContext.bs_{width,height} to HEVCLayerContext 2024-09-06 13:59:29 +02:00
Anton Khirnov
c7f0753a6b lavc/hevcdec: move active VPS from HEVCParamSets to HEVCContext
Active VPS is a property of the decoding process, not of the list of
parameter sets.

Check that the VPS can only change in a base layer - while this can
never happen currently (as no other layers can exist in the decoder), it
will become useful when multilayer decoding is supported.
2024-09-06 13:59:29 +02:00
Anton Khirnov
4c0d669b20 lavc/hevcdec: add a per-layer context
Start by moving the DPB to it.

Only one context exists for now, so decoder behaviour should not change
with this commit, but that will change in the future.
2024-09-06 13:59:29 +02:00
Anton Khirnov
c35a51f4bb lavc: add HEVC Multiview Main profile 2024-09-06 13:59:28 +02:00
Anton Khirnov
4cbd1a8a54 MAINTAINERS: add myself for hevc/* 2024-09-06 13:59:04 +02:00
Anton Khirnov
4ef149249a lavu/opt: handle UINT options as the POD they are
Fixes operations on array UINT options.
2024-09-06 13:59:04 +02:00
Anton Khirnov
450a3f58ed lavu/opt: add API for setting array-type option values
Previously one could only replace the entire array with a new one
deserialized from a string. The new API allows inserting, replacing, and
removing arbitrary element ranges.
2024-09-06 13:59:04 +02:00
James Almer
2a6f84718b fate/checkasm/sw_gbrp: don't randomly set internal values
They are set by sws_init_context().
May help with signed integer overflows reported by gcc-usan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 22:19:47 -03:00
James Almer
a49188297f avfilter/af_bs2b: remove unecessary initializer from layouts
Fixes compilation with msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 12:36:04 -03:00
James Almer
d98de855a8 avfilter/af_asr: remove unecessary initializer from layouts
Fixes compilation with msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 12:36:04 -03:00
James Almer
ef6a5c98fb avfilter/af_apulsator: remove unecessary initializer from layouts
Fixes compilation with msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-05 12:35:58 -03:00
Gyan Doshi
3d0d0f68d5 doc/filters: update uspp availability status
The filter was disabled in 95054bfa48 and re-enabled in 771c27119d
2024-09-05 15:47:14 +05:30
Anton Khirnov
f0f1cf2697 lavfi/af_channelmap: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
3045949945 lavfi/af_bs2b: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
96a8a6139e lavfi/af_biquads: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
2e899d3bdf lavfi/af_asr: convert to query_func2()
Also, simplify code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
cf43a02c2c lavfi/af_asetrate: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
b18f7d7e2d lavfi/af_arnndn: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
dfaa339167 lavfi/af_arls: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
814c961a78 lavfi/af_aresample: convert to query_func2() 2024-09-05 10:03:33 +02:00
Anton Khirnov
c24e0df30b lavfi/af_apulsator: convert to query_func2()
Also, simplify code, and drop a redundant call that also happens
implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
6f2adb7967 lavfi/af_anlms: convert to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
e0ab1fcc8c lavfi/af_anequalizer: convert to query_func2()
Also, simplify code and drop redundant calls that also happen implicitly
in generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
6e4affc407 lavfi/af_aiir: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-05 10:03:33 +02:00
Anton Khirnov
f143723095 lavfi/af_agate: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-05 10:03:33 +02:00
Rémi Denis-Courmont
d9f594209f checkasm/riscv: print official extension names 2024-09-04 22:04:11 +03:00
Rémi Denis-Courmont
27d28b68da swscale/rgb2rgb: enable R-V V deinterleaveBytes
T-Head C908:
deinterleave_bytes_c:                               100328.3 ( 1.00x)
deinterleave_bytes_rvv_i32:                          19331.3 ( 5.19x)
deinterleave_bytes_aligned_c:                       100337.5 ( 1.00x)
deinterleave_bytes_aligned_rvv_i32:                  15748.0 ( 6.37x)

SpacemiT X60:
deinterleave_bytes_c:                                95230.6 ( 1.00x)
deinterleave_bytes_rvv_i32:                           9790.3 ( 9.73x)
deinterleave_bytes_aligned_c:                        96564.1 ( 1.00x)
deinterleave_bytes_aligned_rvv_i32:                   7780.1 (12.41x)
2024-09-04 22:04:11 +03:00
Hendrik Leppkes
d4cfbf329c hevc/sei: return INVALIDDATA when a referenced SPS is not available
The code previously returned ENOMEM, despite this not being an
allocation problem, but rather a bitstream problem referring to data not
currently available.

Fixes playback of such streams, as it allows further processing of NAL
units after skipping the broken SEI NAL.
2024-09-04 18:34:47 +02:00
Araz Iusubov
eda3fc6053 avcodec/amfenc: GPU driver version check
Implemented gpu driver check.
10-bit patch works incorrectly on driver version lower than 23.30.
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:41 +02:00
Evgeny Pavlov
9f02408583 avcodec/amfenc: add 10 bit encoding in av1_amf
v2: refactored after review

Signed-off-by: Evgeny Pavlov <lucenticus@gmail.com>
Co-authored-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
Co-authored-by: Araz Iusubov <Primeadvice@gmail.com>
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:28 +02:00
nyanmisaka
628762034d avcodec/amfenc: HDR metadata.
v2: fixes for indentation
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:18 +02:00
Michael Fabian 'Xaymar' Dirks
fb4dd4b6f4 avcodec/amfenc: Fixes the color information in the output.
added 10 bit support for amf hevc.

before:

command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file.mkv -an -c:v h264_amf res.dx11_hw_h264.mkv
output -  Format of input frames context (p010le) is not supported by AMF.
command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv
output -  Format of input frames context (p010le) is not supported by AMF.

after:

command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v h264_amf res.dx11_hw_h264.mkv
output -  10-bit input video is not supported by AMF H264 encoder
command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv
output -  10bit file

v2 - lost line returned in ff_amf_pix_fmts
v3 - fixes after review
v4 - extract duplicated code, fix incorrect processing of 10-bit input for h264
v5 - non-functional changes after review

Co-authored-by: Evgeny Pavlov <lucenticus@gmail.com>
Co-authored-by: Araz Iusubov <Primeadvice@gmail.com>
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-09-04 13:18:09 +02:00
Nicolas Gaullier
ee9ae4e8ba fftools/ffmpeg: Fix honor -r output option with streamcopy
Fix "ost->st->avg_frame_rate = ost->frame_rate" in streamcopy_init()
being reset to input's frame rate a few lines below.
Note that in current code, there are some discrepancies amongst the
muxers. For example, avienc relies on time_base, so it is not affected
by this patch, whereas mxfenc and matroskaenc do use avg_frame_rate,
so this patch fixes -r being honored.

In the updated fate test, the input is (wrongly) probed as 50fps. With
this patch, the correct value (25fps) is successfully forced with -r.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-04 13:01:37 +02:00
Nicolas Gaullier
c14573a4d2 tests: Remove void -time_base overrides when streamcopying to mxf
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-04 13:01:37 +02:00
Nicolas Gaullier
59d2900df7 avformat/mxfenc: Fix guess frame_rate
The time_base was a bad guess.

Currently, fate-time_base test data assumed that overriding the input
time_base would affect the frame_rate, but this behaviour is not
documented, so just fix the fate data now that this is fixed.

Fix regression since 10185e2d4c:
previously, when streamcopying, the time_base was guessed from the
frame_rate considering it is often constant, so guessing the frame_rate
back from the time_base was often not a problem.

To reproduce:
ffmpeg -i fate-suite/mpeg2/dvd_still_frame.vob -an -c copy out.mxf

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-04 13:01:37 +02:00
Fei Wang
0b6d7cd9d9 lavc/qsvenc: Remove duplicate include header file
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-04 12:14:58 +08:00
Fei Wang
36396aff69 doc/av1_qsv: Add missed options
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-04 12:14:57 +08:00
Fei Wang
395d703c91 doc/av1_qsv: Fix typo
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-04 12:14:57 +08:00
Ramiro Polla
3f9b78bd19 avcodec/dnxhdenc: use BlockDSPContext from MpegEncContext
MpegEncContext already has a BlockDSPContext, so we don't need another
one for DNXHDEncContext (which has an MpegEncContext).
2024-09-03 17:47:37 +02:00
Ramiro Polla
4f7aeffd8c avcodec/mpegvideo: remove redundant workaround to recalculate last nonzero coefficient
The x86 optimized dct_quantize only calculates the last nonzero
coefficient correctly if the zigzag scan order is used. For the
alternate scan order, this value is incorrect.

To work around this, the dct_unquantize functions process the entire
block if the alternate scan order is used.

But a second workaround (bb198e198a) was added that recalculates the
last nonzero coefficient after dct_quantize is called if the alternate
scan order is used.

This commit removes the first workaround, which became redundant.
2024-09-03 17:14:24 +02:00
Ramiro Polla
b6f7271fa9 avcodec/x86/mpegvideoenc: remove av_assert2() for variable alignment
It's safe to assume that LOCAL_ALIGNED_16 does indeed align. Otherwise
we would have many more problems...

This assert was added in f8188626 all the way back in 2003.
2024-09-03 17:06:19 +02:00
Nuo Mi
3d2fafa229 avcodec/vvcdec: fix potential deadlock in report_frame_progress
Fixes:
https://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-tsan&time=20240823175808

Reproduction steps:
./configure --enable-memory-poisoning --toolchain=gcc-tsan --disable-stripping && make fate-vvc

Root cause:
We hold the current frame's lock while updating progress for other frames,
which also requires acquiring other frame locks. This could potentially lead to a deadlock.
However, I don't think this will happen in practice because progress updates are one-way, with no cyclic dependencies.
But we need this patch to make FATE happy.
2024-09-03 21:32:27 +08:00
Frank Plowman
54291f4383 lavc/vvc: Fix assertion bound on qPy_{a,b}
Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-09-03 20:57:52 +08:00
Fei Wang
ae9cf903e8 cbs_av1: Copy loop filter and segment parameters of repeat frame from its mapped frame
Implement load/save loop filter and segment parameters defined in
section 7.20 and 7.21 in spec for show_existing_frame frames.

Fixes ticket #11151.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-03 14:03:40 +08:00
Marton Balint
a87a96105e avformat/libzmq: fix check for zmq protocol prefix
Fixes ticket #11134.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-02 22:51:17 +02:00
Marton Balint
90f68f7b2d avformat/mxfdec: disallow generic seek search
If the demuxer does not provide per-stream indexes, the generic seek search can
attempt to read the whole media file from the beginning when seeking. For large
MXF files this can cause huge lockups for a seek after the last timestamp,
which will eventually fail. So let's disable the generic seek for mxf, the
demuxer's own seek code should handle seeking just fine.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-02 22:50:52 +02:00
Stefano Mandelli
24eff5b547 avformat/rtsp: extend the PATH buffer to 2048
Recently, I have been experiencing an increasing number of user that use ffmpeg
to retrive RTSP stream from personal mediaproxies (e.g. MediaMtx) with
authorization based on JWT. The current length of PATH does not permit to
insert the token in the URL failing the authorization with no possibilities to
get the video.

VLC has just modified the RSTP max URL length, and it permits to use token
inside the URL.

For these reasons, I propose this patch to extend the PATH buffer from 1024 to
2048 in order to use tokens and the authorization process based on JWT.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-09-02 22:50:52 +02:00
Anton Khirnov
3f9ca51015 lavc/opus*: move to opus/ subdir 2024-09-02 11:56:53 +02:00
Anton Khirnov
c3fb696311 lavfi/af_aformat: convert to query_func2() 2024-09-02 11:55:22 +02:00
Anton Khirnov
8bc419aeb4 lavfi/af_aformat: change options from strings to arrays
Allows to drop custom parsing code, and also the assumption that
query_formats() is not called more than once.
2024-09-02 11:55:22 +02:00
Anton Khirnov
dc488d832c lavfi/af_afir: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov
584be51334 lavfi/af_adynamicequalizer: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov
079834e645 lavfi/af_acrossover: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov
edf53e15b4 lavfi/af_aap: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov
0f004a0416 lavfi/aeval: convert to query_func2()
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
2024-09-02 11:55:22 +02:00
Anton Khirnov
eddffbedb3 lavfi: add query_func2()
It differs from query_func() in accepting arrays of input/output format
configurations to be filled as callback parameters. This allows to mark
the filter context as const, ensuring it is not modified by this
function, as it is not supposed to have any side effects beyond
returning the supported formats.
2024-09-02 11:55:20 +02:00
James Almer
01f2d95fbf x86/h264_weight: don't do arithmetic right shift of a 32bit values in 64bit registers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-01 15:43:18 -03:00
Ramiro Polla
00b64fca55 configure: improve check for POSIX ioctl
Instead of relying on system #ifdefs which may or may not be correct,
detect the POSIX ioctl signature at configure time.
2024-09-01 18:01:43 +02:00
Ramiro Polla
6aafe61285 avcodec/mpegvideoencdsp: convert stride parameters from int to ptrdiff_t 2024-09-01 13:42:30 +02:00
Dale Curtis
7753a9d627 lavc: Check codec_whitelist early in avcodec_open2()
This ensures that if a codec isn't on codec_whitelist, trying to open it
will not trigger ff_codec_close(), which could invalidate useful
information still present in the context.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-01 12:42:20 +02:00
Matthieu Bouron
0a780d3076 avcodec: add Mediacodec audio decoders support
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-09-01 12:25:56 +02:00
Rémi Denis-Courmont
7d1dda4892 lavc/h264dsp: R-V V loop_filter_chroma
T-Head C908:
h264_v_loop_filter_chroma_8bpp_c:      137.4
h264_v_loop_filter_chroma_8bpp_rvv_i32: 54.2
2024-09-01 10:58:48 +03:00
Rémi Denis-Courmont
3a53656837 lavc/h264dsp: do not write back unmodified rows in R-V V loop filter 2024-09-01 10:52:26 +03:00
Gyan Doshi
b5daaa1503 avfilter/formats: correct error message
The check is for color space, not range.
2024-09-01 10:10:16 +05:30
James Almer
a4228a0ac1 avformat/iamf_parser: use ffio_read_size() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 23:44:13 -03:00
Marvin Scholz
b6a0eab528 avformat/iamf_parse: Fix return of uninitialized value
The ret value here is not yet intialized so the return would return
uninitialized data. What was probably meant to be checked here was the
return value of ffio_read_size, which can return an error.

Introduced in 38bcb3ba7b

Fixes: CID1618758
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 21:21:39 -03:00
Michael Niedermayer
8a2c401625 MAINTAINERS: Add webpage link to our mailing list page
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:10:57 +02:00
Michael Niedermayer
e5f4c6d7b5 MAINTAINERS: Add 2 git repositories
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:10:57 +02:00
Michael Niedermayer
880ef64c12 MAINTAINERS: Add T field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a git repository for an area

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:10:36 +02:00
Michael Niedermayer
01af5a473a MAINTAINERS: Add a profile entry for fate
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:08:28 +02:00
Michael Niedermayer
eabd7e7142 MAINTAINERS: Add P field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying more details than what fits on a single line

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:08:28 +02:00
Michael Niedermayer
bb870a7fcf MAINTAINERS: Add B field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a bug tracker. It would allow a maintainer to
use gitlab, github, or something else to keep track of bugs

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:08:26 +02:00
Michael Niedermayer
e1baf45b12 MAINTAINERS: Add some webpages to some areas
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:07:58 +02:00
Michael Niedermayer
02090abf74 MAINTAINERS: Add W field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a webpage for an area

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 23:07:36 +02:00
Michael Niedermayer
604f5ad0ba MAINTAINERS: Add some Mail aliases / mailing lists (aka how to contact the specific maintainers)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 20:26:45 +02:00
Michael Niedermayer
a0b487c0e3 MAINTAINERS: Add L field based on the linux kernel MAINTAINERs
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

This allows specifying a more specific mailing list, if a specific area has
such a list.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-31 20:26:34 +02:00
James Almer
fa5d3cc653 avformat/iamf_parse: use get_bits_long() to read the remaining AAC extradata bits
The output of put_bits_left() here can be as big as 27, which is a bit
count not supported by get_bits().

Fixes fate-iamf-stereo-demux when using --assert-level=2

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 14:51:32 -03:00
James Almer
9c0e0c0b3f fate/iamf: add a demuxing test for a stereo AAC IAMF sample
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 11:22:08 -03:00
James Almer
38bcb3ba7b avformat/iamf_parse: fix parsing AAC DecoderConfigDescriptor
Use ff_mp4_read_descr() to read both the tags and the vlc value
that comes after it, which was not being taken into account.

Ref: https://github.com/AOMediaCodec/libiamf/issues/119

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 11:11:42 -03:00
James Almer
9d095f127a avformat/isom: make parameters used for loging a pointer to void
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-31 11:11:42 -03:00
Zhao Zhili
4c0372281b aarch64/vvc: Bind h26x/sao filter implementation to vvc
Reviewed-by: Martin Storsjö <martin@martin.st>
2024-08-31 16:07:50 +08:00
Zhao Zhili
8cc10298a7 aarch64/hevc: Move sao to h26x directory
So vvc can reuse the implementation.

Reviewed-by: Martin Storsjö <martin@martin.st>
2024-08-31 16:07:43 +08:00
Frank Plowman
93281630a7 lavc/vvc: Validate explicit subpic locations
Implement the missing requirements from H.266 (V3) p. 106 on the
position and size of subpictures whose dimensions are provided
explicitly.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-08-31 15:06:39 +08:00
Frank Plowman
01701bdcd5 lavc/vvc: Prevent OOB access in subpic_tiles
The previous logic relied on the subpicture boundaries coinciding with
the tile boundaries.  Per 6.3.1 of H.266 (V3), vertical subpicture
boundaries are always tile boundaries however the same cannot be said
for horizontal subpicture boundaries.  Furthermore, it is possible to
construct an illegal bitstream where vertical subpicture boundaries are
not coincident with tile boundaries.  In these cases, the condition of
the while loop would never be satisfied resulting in an OOB read on
col_bd/row_bd.

Patch fixes this issue by replacing != with <, thereby not requiring
subpicture boundaries and tile boundaries to be coincident.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-08-31 15:05:23 +08:00
Nuo Mi
b2eabe0ff2 avcodec/vvcdec: format, fix indent for vvc_deblock_bs 2024-08-31 14:16:19 +08:00
Nuo Mi
7bd22342c3 avcodec/vvcdec: filter, fix uninitialized variables for YUV400 format
fix
==135000== Conditional jump or move depends on uninitialised value(s)
==135000==    at 0x169FF95: vvc_deblock_bs (filter.c:699)
and
==135000== Conditional jump or move depends on uninitialised value(s)
==135000==    at 0x16A2E72: ff_vvc_alf_filter (filter.c:1217)

Reported-by: James Almer <jamrial@gmail.com>
2024-08-31 14:16:19 +08:00
Nuo Mi
7175544c0b checkasm: add vvc_bdof test
apply_bdof_8_8x16_c: 5776.5
apply_bdof_8_8x16_avx2: 396.2
apply_bdof_8_16x8_c: 5722.0
apply_bdof_8_16x8_avx2: 216.0
apply_bdof_8_16x16_c: 11213.2
apply_bdof_8_16x16_avx2: 434.5
apply_bdof_10_8x16_c: 5657.7
apply_bdof_10_8x16_avx2: 1096.0
apply_bdof_10_16x8_c: 5531.7
apply_bdof_10_16x8_avx2: 212.5
apply_bdof_10_16x16_c: 11043.7
apply_bdof_10_16x16_avx2: 1252.7
apply_bdof_12_8x16_c: 5680.0
apply_bdof_12_8x16_avx2: 1096.5
apply_bdof_12_16x8_c: 5646.2
apply_bdof_12_16x8_avx2: 624.5
apply_bdof_12_16x16_c: 11076.0
apply_bdof_12_16x16_avx2: 1241.5
2024-08-31 14:08:54 +08:00
Nuo Mi
15eb10c6de x86/vvcdec: inter, add optical flow avx2 code
BDoF used about 10%–25% of the CPU for some clips.
Here are the FPS for one run; please ignore the negative values, as they may be due to round-to-round variation

clips                                       | before | after | delta
--------------------------------------------|--------|-------|------
RitualDance_1920x1080_60_10_420_37_RA.266   | 310.0  | 363.0 | 14.60%
NovosobornayaSquare_1920x1080.bin           | 322.3  | 339.7 |  5.12%
Tango2_3840x2160_60_10_420_27_LD.266        |  71.0  | 68.7  | -3.35%
RitualDance_1920x1080_60_10_420_32_LD.266   | 250.0  | 245.3 | -1.92%
Chimera_8bit_1080P_1000_frames.vvc          | 359.3  | 422.7 | 15.00%
BQTerrace_1920x1080_60_10_420_22_RA.vvc     | 142.3  | 147.7 |  3.66%

Reviewed-by: James Almer <jamrial@gmail.com>
2024-08-31 14:06:19 +08:00
Nuo Mi
f851abb4b3 avcodec/vvcdec: bdof, do not pad sources and gradients to simplify the code 2024-08-31 13:57:51 +08:00
Nuo Mi
8347def797 avcodec/vvcdec: misc, rename BDOF_BLOCK_SIZE to BDOF_MIN_BLOCK_SIZE 2024-08-31 13:57:51 +08:00
Michael Niedermayer
b730defd52 avcodec/msmpeg4dec: init dc_pred_dir
Its not really used but its passed as a argument and then not used
Fixes: 70965/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSMPEG4V1_fuzzer-5583223747313664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 17:38:30 +02:00
Michael Niedermayer
4e39795c75 avformat/mvdec: Check if name was fully read
Fixes: use of uninitialized value
Fixes: 70901/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-6341913949569024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 17:38:28 +02:00
Michael Niedermayer
5338707930 avcodec/wmavoice: Do not use uninitialized pitch[0]
Fixes: use of uninitialized value
Fixes: 70850/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-4806127362048000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 17:38:24 +02:00
Michael Niedermayer
53066e8cc2 MAINTAINERS: some random updating
Adding level to some of my entries
Adding level to some random entries of other people who i have seen actively maintaining their code
removing some people who have not been active where others where active

For most we will need to contact people and ask if they are still available as maintainers
(but for cases where patches are ignored for many months even with pings sent to the maintainer
 entries should be set to unmaintained)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:56 +02:00
Michael Niedermayer
337e7949da MAINTAINERS: Add a maintaince level field
Text was stolen from the linux kernel
This is thus identical to the kernel just a different more compact format.
I am very happy also to switch the file entirely to the format of the linux kernel maintainer list
if people prefer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:56 +02:00
Michael Niedermayer
815d008681 avformat/argo_brp: Check that ASF chunk header is completely read
Fixes: Use of uninitialized value
Fixes: 71280/clusterfuzz-testcase-minimized-ffmpeg_dem_ARGO_BRP_fuzzer-4692991866896384

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:56 +02:00
Michael Niedermayer
46e3bc2ebd tools/target_swr_fuzzer: Check av_samples_fill_arrays() for failure
Fixes: use of uninitialized value
Fixes: 71242/clusterfuzz-testcase-minimized-ffmpeg_SWR_fuzzer-4905557943713792

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:55 +02:00
Michael Niedermayer
b9c7f50c7d avcodec/notchlc: Check bytes left before reading
Fixes: Use of uninitialized value
Fixes: 71230/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-4624502095413248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:55 +02:00
Michael Niedermayer
01910ca603 avcodec/vc1_block: propagate error codes
Fixes: use of uninitialized value
Fixes: 71228/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-6188476880453632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:55 +02:00
Michael Niedermayer
796ff2d599 avformat/apetag: Check APETAGEX
Fixes: Use of uninitialized value
Fixes: 71074/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5697034877730816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:54 +02:00
Michael Niedermayer
b08776e3ae avcodec/magicyuvenc: better slice height
Fixes: Use of uninitialized value
Fixes: 71072/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_fuzzer-4835252046987264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-28 16:27:54 +02:00
J. Dekker
e758b24396 checkasm: add wildcompares for test & functions
Added:

  --test=<pattern>    Filter tests by glob style pattern.
  --bench[=<pattern>] Run benchmark and optionally filter functions
                      by glob style pattern.

Example:

$ ./tests/checkasm/checkasm --bench=yuva*
[...]
yuva420p_bgr24_8_c:                                     34.5 ( 1.00x)
yuva420p_bgr24_8_ssse3:                                 31.1 ( 1.11x)
yuva420p_bgr24_128_c:                                  310.6 ( 1.00x)
yuva420p_bgr24_128_ssse3:                              178.1 ( 1.74x)
yuva420p_bgr24_1080_c:                                2509.6 ( 1.00x)
yuva420p_bgr24_1080_ssse3:                            1471.5 ( 1.71x)
yuva420p_bgr24_1920_c:                                4462.6 ( 1.00x)
yuva420p_bgr24_1920_ssse3:                            2331.1 ( 1.91x)
[...]

Ported from dav1d.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
J. Dekker
d0986709a8 checkasm: improve print format
Port dav1d's checkasm output format to FFmpeg's checkasm, includes
relative speedups and aligns results.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
J. Dekker
03f26549cd checkasm: print only results to stdout
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
J. Dekker
42528ff835 checkasm: add csv/tsv bench output
When collecting performance information from checkasm it is common
to parse the output for use in graphs to compare vs different
architectures.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-08-28 11:45:46 +02:00
Anton Khirnov
d89930f866 lavu/opt: add API for retrieving array-type option values
Previously one could only convert the entire array to a string, not
access individual elements.
2024-08-27 16:53:16 +02:00
Anton Khirnov
4a5bb84515 lavu/opt: forward av_opt_get_video_rate() to av_opt_get_q()
The two functions are exactly the same.
2024-08-27 16:53:16 +02:00
Anton Khirnov
efe38286d1 lavu/opt: document underlying C types for enum AVOptionType 2024-08-27 16:53:16 +02:00
Ramiro Polla
7e4784e40c avcodec/mpegvideoencdsp: speed up draw_edges_8_c by inlining it for all used edge widths
This commit also restricts w to 4, 8, or 16.

Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz:
                                    before    after
draw_edges_8_1724_4_c:             46796.5   7141.7  ( 6.55x)
draw_edges_8_1724_8_c:             43584.5   7216.5  ( 6.04x)
draw_edges_8_1724_16_c:            47007.2  10080.5  ( 4.66x)
draw_edges_128_407_4_c:            11199.0   4185.0  ( 2.68x)
draw_edges_128_407_8_c:            10660.2   4418.0  ( 2.41x)
draw_edges_128_407_16_c:           11800.2   4634.5  ( 2.55x)
draw_edges_1080_31_4_c:             1356.5    634.7  ( 2.14x)
draw_edges_1080_31_8_c:             1972.0   1430.2  ( 1.38x)
draw_edges_1080_31_16_c:            4621.0   4009.7  ( 1.15x)
draw_edges_1920_4_4_c:               834.5    795.2  ( 1.05x)
draw_edges_1920_4_4_negstride_c:     821.7    802.0  ( 1.02x)
draw_edges_1920_4_8_c:              2782.2   2650.7  ( 1.05x)
draw_edges_1920_4_8_negstride_c:    2724.7   2670.0  ( 1.02x)
draw_edges_1920_4_16_c:             6437.5   6327.7  ( 1.02x)
draw_edges_1920_4_16_negstride_c:   6395.2   6349.5  ( 1.01x)

A55:
                                    before    after
draw_edges_8_1724_4_c:             52540.4  19739.2  ( 2.66x)
draw_edges_8_1724_8_c:             45386.9  19847.4  ( 2.29x)
draw_edges_8_1724_16_c:            51995.4  23284.7  ( 2.23x)
draw_edges_128_407_4_c:            13401.1   6988.2  ( 1.92x)
draw_edges_128_407_8_c:            12218.4   7527.9  ( 1.62x)
draw_edges_128_407_16_c:           13695.9   8207.2  ( 1.67x)
draw_edges_1080_31_4_c:             3702.9   3110.4  ( 1.19x)
draw_edges_1080_31_8_c:             6015.6   5643.2  ( 1.07x)
draw_edges_1080_31_16_c:           12281.9  11901.4  ( 1.03x)
draw_edges_1920_4_4_c:              3957.9   3970.2  ( 1.00x)
draw_edges_1920_4_4_negstride_c:    3964.1   3825.2  ( 1.04x)
draw_edges_1920_4_8_c:              7757.9   7676.4  ( 1.01x)
draw_edges_1920_4_8_negstride_c:    7923.6   7812.4  ( 1.01x)
draw_edges_1920_4_16_c:            14791.6  15143.9  ( 0.98x)
draw_edges_1920_4_16_negstride_c:  14788.6  15163.4  ( 0.98x)

A76:
                                    before   after
draw_edges_8_1724_4_c:             39786.0  4968.5  ( 8.01x)
draw_edges_8_1724_8_c:             32971.5  5069.5  ( 6.50x)
draw_edges_8_1724_16_c:            40056.0  6017.2  ( 6.66x)
draw_edges_128_407_4_c:             9517.2  1210.5  ( 7.86x)
draw_edges_128_407_8_c:             8035.7  1346.2  ( 5.97x)
draw_edges_128_407_16_c:            9946.5  1648.2  ( 6.03x)
draw_edges_1080_31_4_c:             1308.0   660.7  ( 1.98x)
draw_edges_1080_31_8_c:             1785.5  1270.7  ( 1.41x)
draw_edges_1080_31_16_c:            3266.7  2591.5  ( 1.26x)
draw_edges_1920_4_4_c:              1151.0  1090.7  ( 1.06x)
draw_edges_1920_4_4_negstride_c:    1153.7  1096.5  ( 1.05x)
draw_edges_1920_4_8_c:              2220.7  2186.5  ( 1.02x)
draw_edges_1920_4_8_negstride_c:    2218.5  2193.5  ( 1.01x)
draw_edges_1920_4_16_c:             4324.2  4230.0  ( 1.02x)
draw_edges_1920_4_16_negstride_c:   4310.7  4233.0  ( 1.02x)
2024-08-26 12:50:26 +02:00
Ramiro Polla
3bfce2a104 avcodec/x86/mpegvideoencdsp: speed up draw_edges_mmx by using memcpy()
The mmx memory copy code is not nearly as efficient as memcpy(), which
would make draw_edges_mmx much slower than draw_edges_8_c.

Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz:
                                      before    after
draw_edges_8_1724_4_mmx:              8700.5   8751.8  ( 0.99x)
draw_edges_8_1724_8_mmx:             10441.7  10558.0  ( 0.99x)
draw_edges_8_1724_16_mmx:            10660.7  10799.5  ( 0.99x)
draw_edges_128_407_4_mmx:             4202.2   4099.3  ( 1.03x)
draw_edges_128_407_8_mmx:             4579.0   4511.3  ( 1.02x)
draw_edges_128_407_16_mmx:            5479.7   4729.5  ( 1.16x)
draw_edges_1080_31_4_mmx:             1546.7    658.0  ( 2.35x)
draw_edges_1080_31_8_mmx:             2745.5   1442.5  ( 1.90x)
draw_edges_1080_31_16_mmx:           12511.5   4901.0  ( 2.55x)
draw_edges_1920_4_4_mmx:              2659.0    705.0  ( 3.77x)
draw_edges_1920_4_4_negstride_mmx:    2643.0    729.0  ( 3.63x)
draw_edges_1920_4_8_mmx:              7845.0   2819.0  ( 2.78x)
draw_edges_1920_4_8_negstride_mmx:    7777.0   2747.3  ( 2.83x)
draw_edges_1920_4_16_mmx:            24583.7   6358.3  ( 3.87x)
draw_edges_1920_4_16_negstride_mmx:  24589.0   6367.0  ( 3.86x)
2024-08-26 12:50:21 +02:00
Ramiro Polla
9cdcbb639a avcodec/x86/mpegvideoencdsp: fix comment for draw_edges_mmx
Not only w == 8 and w == 16 are supported, but also w == 4.
2024-08-26 12:49:24 +02:00
Ramiro Polla
8c203ea7c7 avcodec/aarch64/mpegvideoencdsp: add dotprod implementation for pix_norm1
A55             A76
pix_norm1_c:        484.3           235.2
pix_norm1_neon:     193.8 ( 2.50x)   44.7 ( 5.26x)
pix_norm1_dotprod:   91.8 ( 5.28x)   21.2 (11.09x)
2024-08-26 12:49:04 +02:00
Ramiro Polla
9f68a3712e avcodec/aarch64/mpegvideoencdsp: add neon implementations for pix_sum and pix_norm1
A55             A76
pix_norm1_c:     478.2           234.2
pix_norm1_neon:  188.2 ( 2.54x)   41.2 ( 5.68x)
pix_sum_c:       304.2           244.0
pix_sum_neon:     77.2 ( 3.94x)   21.5 (11.35x)
2024-08-26 12:48:31 +02:00
Ramiro Polla
834964ce1a checkasm/mpegvideoencdsp: add pix_sum, pix_norm1, and draw_edges 2024-08-26 12:48:09 +02:00
Ramiro Polla
f9074427db avcodec/x86/mpegvideoencdsp: support negative strides in draw_edges_mmx() 2024-08-26 12:44:02 +02:00
Ramiro Polla
98610fe95f fate/checkasm: run the sw_yuv2yuv test 2024-08-26 12:16:40 +02:00
Zhao Zhili
12cdb30e37 avcodec/videotoolboxenc: Fix leaking of supported_props
There are two VTCompressionSessionRef been created, one for generating
extradata, and another for normal encoding. supported_props was been
overwritten without release.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-26 17:09:46 +08:00
Ramiro Polla
420d443600 swscale/aarch64: cosmetics fix (spaces inside curly braces) 2024-08-26 11:07:49 +02:00
Ramiro Polla
52887683e9 swscale/aarch64: add nv24/nv42 to yuv420p unscaled converter
A55               A76
nv24_yuv420p_128_c:       4956.1            1267.0
nv24_yuv420p_128_neon:    3109.1 ( 1.59x)    640.0 ( 1.98x)
nv24_yuv420p_1920_c:     35728.4           11736.2
nv24_yuv420p_1920_neon:   8011.1 ( 4.46x)   2436.0 ( 4.82x)
nv42_yuv420p_128_c:       4956.4            1270.5
nv42_yuv420p_128_neon:    3074.6 ( 1.61x)    639.5 ( 1.99x)
nv42_yuv420p_1920_c:     35685.9           11732.5
nv42_yuv420p_1920_neon:   7995.1 ( 4.46x)   2437.2 ( 4.81x)
2024-08-26 11:04:46 +02:00
Ramiro Polla
88a563ad18 swscale: export ff_copyPlane so it may be used by simd code 2024-08-26 11:04:46 +02:00
Ramiro Polla
a2e01cade8 checkasm/yuv2yuv: add tests for semiplanar unscaled converters 2024-08-26 11:04:46 +02:00
Ramiro Polla
4eb5594295 swscale: add nv24/nv42 to yuv420p unscaled converter 2024-08-26 11:04:46 +02:00
Zhao Zhili
aa14f9fe63 avcodec/mediacodecdec: Skip dequeue buffer in draining state
There is no more packet to queue in draining state.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-26 16:59:07 +08:00
Zhao Zhili
2e370805da avfilter/unsharp: Merge header into .c
It was shared with opencl implementation.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-26 16:58:25 +08:00
Stefan Oltmanns
d42cd5b75b avformat/vapoursynth: load library at runtime
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
2024-08-26 10:30:52 +02:00
Stefan Oltmanns
eac611f1a4 avformat/vapoursynth: Update to API version 4
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
2024-08-26 10:30:50 +02:00
Ramiro Polla
abb4e13a0a avutil/aarch64: add AV_COPY128 and AV_ZERO128 macros 2024-08-26 10:26:59 +02:00
Zhao Zhili
40dda881d6 avcodec/filter_units: Fix extradata and packets can have different bitstream format
Filter init can change extradata from avcc/hvcc to annexb format.
With different passthrough logic, packets can still in avcc/hvcc
format. Use same passthrough logic for init and filter.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-24 00:27:15 +08:00
Zhao Zhili
523189c744 fftools/ffplay: handle flip in display matrix
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-24 00:26:59 +08:00
Gnattu OC
30f090b4f8 avfilter: inherit input color range for videotoolbox filters
The color range should be set to match the input when creating
the VideoToolbox context. Otherwise, the new context will default
to limited range, creates inconsistencies with full range inputs.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-24 00:24:06 +08:00
Martin Storsjö
cfe0a36352 libswscale: aarch64: Fix the indentation of some macro invocations
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-22 14:40:30 +03:00
James Almer
9d15fe77e3 avcodec/container_fifo: add missing stddef.h include
Fixes make checkheaders

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-21 15:12:46 -03:00
James Almer
a754ee0844 avcodec/h2645_parse: replace three bool arguments in ff_h2645_packet_split with a single flags one
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-19 20:23:20 -03:00
James Almer
8060644237 avcodec/shorten: Fix discard of ‘const’ qualifier
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-19 17:40:00 -03:00
Martin Storsjö
507c2a5774 libswscale: arm: Don't assume aligned output in yuv2rgb functions
This fixes failures in recently added checkasm tests.

While the buffers in most cases are aligned, libswscale in general
can't assume the output to be aligned.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-19 23:04:52 +03:00
Anton Khirnov
52471b56ba lavfi: make FFFilterContext private to generic code
Nothing in it needs to be visible to filters.
2024-08-19 21:48:11 +02:00
Anton Khirnov
f19c988911 lavfi/filters: move functions only used by generic code to avfilter_internal.h 2024-08-19 21:48:11 +02:00
Anton Khirnov
6d75d44d90 lavfi: drop internal.h
All that remains in it are things that belong in avfilter_internal.h.

Move them there and remove internal.h
2024-08-19 21:48:04 +02:00
Anton Khirnov
90e4af65e1 lavfi/f_streamselect: remove a no-op ff_filter_config_links() call
It does not do anything when the links are already configured.
2024-08-19 21:45:25 +02:00
Anton Khirnov
a2314308f2 lavfi/inernal: move ff_fmt_is_regular_yuv() declaration to video.h 2024-08-19 21:45:25 +02:00
Anton Khirnov
a83a30e899 lavfi: move ff_parse_{sample_rate,channel_layout}() to audio.[ch]
That is a more appropriate place for those functions.
2024-08-19 21:45:25 +02:00
Anton Khirnov
f4bfdf7893 lavfi: move ff_parse_pixel_format() to vf_format, its only caller
The only thing this function does beyond calling av_get_pix_fmt() is
falling back onto parsing the argument as a number. No other filters
should need to do this.
2024-08-19 21:45:25 +02:00
Anton Khirnov
1afe42852b lavfi/internal: move functions used by filters to filters.h
internal.h currently mixes interfaces intended to be used by filters
with those that should be limited to generic filter- or graph-level
code.
2024-08-19 21:45:25 +02:00
Rémi Denis-Courmont
d8fb44c0aa lavc/mpegvideoencdsp: R-V V add_8x8basis
T-Head C908:
add_8x8basis_c:      440.6
add_8x8basis_rvv_i32: 70.3

SpacemiT X60:
add_8x8basis_c:      436.3
add_8x8basis_rvv_i32: 40.5
2024-08-19 22:41:13 +03:00
Rémi Denis-Courmont
1907dd7f23 lavc/mpegvideoencdsp: R-V V try_8x8basis
T-Head C908:
try_8x8basis_c:       922.5
try_8x8basis_rvv_i32: 135.3

SpacemiT X60:
try_8x8basis_c:       926.1
try_8x8basis_rvv_i32: 103.1
2024-08-19 22:41:13 +03:00
Rémi Denis-Courmont
0fd37c00d7 lavc/mpegvideoencdsp: R-V V pix_norm1
T-Head C908:
pix_norm1_c:       480.2
pix_norm1_rvv_i64: 146.9

SpacemiT X60:
pix_norm1_c:       478.2
pix_norm1_rvv_i64:  92.7
2024-08-19 22:41:13 +03:00
Rémi Denis-Courmont
63d016aea5 lavc/mpegvideoencdsp: R-V V pix_sum
T-Head C908:
pix_sum_c:      332.2
pix_sum_rvv_i64: 91.2

SpacemiT X60:
pix_sum_c:      321.2
pix_sum_rvv_i64: 60.9
2024-08-19 22:41:13 +03:00
Anton Khirnov
631a725670 lavc/hevcdec: call ff_thread_finish_setup() even if hwaccel is in use
Serializing frame threading for non-threadsafe hwaccels is handled at the
generic level, the decoder does not need to care about it.
2024-08-19 21:37:22 +02:00
Anton Khirnov
4b9adb35b6 lavc/hevcdec: simplify output logic
Current code is written around the "simple" decode API's limitation that
a single input packet (AU/coded frame) triggers the output of at most
one output frame. However the spec contains two cases where a coded
frame may cause multiple frames to be output (cf. C.5.2.2.2):
* start of a new sequence
* overflowing sps_max_dec_pic_buffering

The decoder currently contains rather convoluted logic to handle these
cases:
* decode/output/per-frame sequence counters,
* HEVC_FRAME_FLAG_BUMPING
* ff_hevc_bump_frame()
* special clauses in ff_hevc_output_frame()

However, with the receive_frame() API none of that is necessary, as we
can just output multiple frames at once. Previously added ContainerFifo
allows that to be done in a straightforward and efficient manner.
2024-08-19 21:37:22 +02:00
Anton Khirnov
79afc45c03 lavc/hevcdec: use a ContainerFifo to hold frames scheduled for output
Instead of a single AVFrame.

Will be useful in future commits, where we will want to produce multiple
output frames for a single coded frame.
2024-08-19 21:37:22 +02:00
Anton Khirnov
4bda7f288c lavc/videotoolbox: drop HEVC cropping from start_frame rather than end_frame
HEVCContext.output_frame will be removed in following commits.

Reported-By: Max Bykov
2024-08-19 21:37:22 +02:00
Anton Khirnov
6174818252 lavc: add private container FIFO API
It provides a FIFO for "container" objects like AVFrame/AVPacket and
features an integrated FFRefStructPool-based pool to avoid allocating an
freeing them repeatedly.
2024-08-19 21:37:22 +02:00
Anton Khirnov
2fdecbb239 lavc/hevcdec: switch to receive_frame()
Required by following commits, where we will want to output multiple
frames per packet.
2024-08-19 21:37:22 +02:00
sunyuechi
4e7b5ac48f lavc/vp9dsp: R-V V mc bilin hv
C908   X60
vp9_avg_bilin_4hv_8bpp_c                           :   10.7    9.5
vp9_avg_bilin_4hv_8bpp_rvv_i32                     :    4.0    3.5
vp9_avg_bilin_8hv_8bpp_c                           :   38.5   34.2
vp9_avg_bilin_8hv_8bpp_rvv_i32                     :    7.2    6.5
vp9_avg_bilin_16hv_8bpp_c                          :  147.2  130.5
vp9_avg_bilin_16hv_8bpp_rvv_i32                    :   14.5   12.7
vp9_avg_bilin_32hv_8bpp_c                          :  574.2  509.7
vp9_avg_bilin_32hv_8bpp_rvv_i32                    :   42.5   38.0
vp9_avg_bilin_64hv_8bpp_c                          : 2321.2 2017.7
vp9_avg_bilin_64hv_8bpp_rvv_i32                    :  163.5  131.0
vp9_put_bilin_4hv_8bpp_c                           :   10.0    8.7
vp9_put_bilin_4hv_8bpp_rvv_i32                     :    3.5    3.0
vp9_put_bilin_8hv_8bpp_c                           :   35.2   31.2
vp9_put_bilin_8hv_8bpp_rvv_i32                     :    6.5    5.7
vp9_put_bilin_16hv_8bpp_c                          :  134.0  119.0
vp9_put_bilin_16hv_8bpp_rvv_i32                    :   12.7   11.5
vp9_put_bilin_32hv_8bpp_c                          :  538.5  464.2
vp9_put_bilin_32hv_8bpp_rvv_i32                    :   39.7   35.2
vp9_put_bilin_64hv_8bpp_c                          : 2111.7 1833.2
vp9_put_bilin_64hv_8bpp_rvv_i32                    :  138.5  122.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-08-19 22:29:20 +03:00
sunyuechi
9edd2e723b lavc/vp9dsp: R-V V mc bilin h v
C908   X60
vp9_avg_bilin_4h_8bpp_c                            :    5.5    4.7
vp9_avg_bilin_4h_8bpp_rvv_i32                      :    1.7    1.5
vp9_avg_bilin_4v_8bpp_c                            :    5.5    4.7
vp9_avg_bilin_4v_8bpp_rvv_i32                      :    1.5    1.2
vp9_avg_bilin_8h_8bpp_c                            :   20.0   17.7
vp9_avg_bilin_8h_8bpp_rvv_i32                      :    3.0    2.7
vp9_avg_bilin_8v_8bpp_c                            :   20.7   18.7
vp9_avg_bilin_8v_8bpp_rvv_i32                      :    3.0    2.7
vp9_avg_bilin_16h_8bpp_c                           :   78.2   69.7
vp9_avg_bilin_16h_8bpp_rvv_i32                     :    7.0    6.2
vp9_avg_bilin_16v_8bpp_c                           :   98.5   73.2
vp9_avg_bilin_16v_8bpp_rvv_i32                     :    7.0    6.0
vp9_avg_bilin_32h_8bpp_c                           :  325.5  275.5
vp9_avg_bilin_32h_8bpp_rvv_i32                     :   23.0   20.5
vp9_avg_bilin_32v_8bpp_c                           :  342.2  290.0
vp9_avg_bilin_32v_8bpp_rvv_i32                     :   21.7   19.5
vp9_avg_bilin_64h_8bpp_c                           : 1263.7 1095.7
vp9_avg_bilin_64h_8bpp_rvv_i32                     :   91.2   81.2
vp9_avg_bilin_64v_8bpp_c                           : 1331.7 1155.2
vp9_avg_bilin_64v_8bpp_rvv_i32                     :   91.2   81.0
vp9_put_bilin_4h_8bpp_c                            :    4.5    4.0
vp9_put_bilin_4h_8bpp_rvv_i32                      :    1.0    1.0
vp9_put_bilin_4v_8bpp_c                            :    4.7    4.2
vp9_put_bilin_4v_8bpp_rvv_i32                      :    1.0    1.0
vp9_put_bilin_8h_8bpp_c                            :   16.7   15.0
vp9_put_bilin_8h_8bpp_rvv_i32                      :    2.2    2.0
vp9_put_bilin_8v_8bpp_c                            :   17.5   15.7
vp9_put_bilin_8v_8bpp_rvv_i32                      :    2.2    2.0
vp9_put_bilin_16h_8bpp_c                           :   65.2   58.0
vp9_put_bilin_16h_8bpp_rvv_i32                     :    6.0    5.5
vp9_put_bilin_16v_8bpp_c                           :   69.2   61.7
vp9_put_bilin_16v_8bpp_rvv_i32                     :    5.7    5.2
vp9_put_bilin_32h_8bpp_c                           :  273.2  229.0
vp9_put_bilin_32h_8bpp_rvv_i32                     :   19.7   17.7
vp9_put_bilin_32v_8bpp_c                           :  290.5  243.7
vp9_put_bilin_32v_8bpp_rvv_i32                     :   18.7   16.7
vp9_put_bilin_64h_8bpp_c                           : 1040.5  910.5
vp9_put_bilin_64h_8bpp_rvv_i32                     :   82.5   73.0
vp9_put_bilin_64v_8bpp_c                           : 1108.5  971.0
vp9_put_bilin_64v_8bpp_rvv_i32                     :   82.2   73.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-08-19 22:29:20 +03:00
Marvin Scholz
8f36c6f2e7 MAINTAINERS: add CC preference for myself
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-19 17:46:44 +02:00
Michael Niedermayer
7e5410eadb avformat/iamf_parse: clear padding
Fixes: use of uninitialized value
Fixes: 70929/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5931276639469568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:05:40 +02:00
Michael Niedermayer
67947f2a1c avcodec/hevc/ps: use unsigned shift
Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 70726/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6149928703819776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:05:39 +02:00
Michael Niedermayer
043875941f avcodec/cbs_h265_syntax_template:
Fixes: Assertion width > 0 && width <= 32 failed
Fixes: 71012/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6073354744823808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:05:28 +02:00
Michael Niedermayer
8657eb9c3f avcodec/avcodec: Warn about data returned from get_buffer*()
Text based on suggestion by: epirat07@gmail.com
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 23:04:28 +02:00
Dale Curtis
4230379835 avformat/mov: Fix nullptr dereference with invalid encryption metadata.
Found by fuzzer.

Bug: https://crbug.com/356720789
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-18 22:43:55 +02:00
Ramiro Polla
181cd260db swscale/aarch64/yuv2rgb: add neon yuv42{0,2}p -> gbrp unscaled colorspace converters
checkasm --bench on a Raspberry Pi 5 Model B Rev 1.0:
yuv420p_gbrp_128_c: 1243.0
yuv420p_gbrp_128_neon: 453.5
yuv420p_gbrp_1920_c: 18165.5
yuv420p_gbrp_1920_neon: 6700.0
yuv422p_gbrp_128_c: 1463.5
yuv422p_gbrp_128_neon: 471.5
yuv422p_gbrp_1920_c: 21343.7
yuv422p_gbrp_1920_neon: 6743.5
2024-08-18 22:26:17 +02:00
Ramiro Polla
8744764a4c swscale/x86/yuv2rgb: add ssse3 yuv42{0,2}p -> gbrp unscaled colorspace converters
Note: this implementation is limited to x86_64 due to general purpose
      register pressure.

checkasm --bench on an Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz:
yuv420p_gbrp_8_c: 118.5
yuv420p_gbrp_8_ssse3: 93.3
yuv420p_gbrp_128_c: 1068.3
yuv420p_gbrp_128_ssse3: 319.3
yuv420p_gbrp_1080_c: 8841.8
yuv420p_gbrp_1080_ssse3: 2211.8
yuv420p_gbrp_1920_c: 15903.8
yuv420p_gbrp_1920_ssse3: 3814.3
yuv422p_gbrp_8_c: 144.8
yuv422p_gbrp_8_ssse3: 93.8
yuv422p_gbrp_128_c: 1395.8
yuv422p_gbrp_128_ssse3: 313.0
yuv422p_gbrp_1080_c: 11551.5
yuv422p_gbrp_1080_ssse3: 2240.8
yuv422p_gbrp_1920_c: 20585.3
yuv422p_gbrp_1920_ssse3: 5249.5
yuva420p_gbrp_8_c: 117.5
yuva420p_gbrp_8_ssse3: 92.0
yuva420p_gbrp_128_c: 1593.0
yuva420p_gbrp_128_ssse3: 319.3
yuva420p_gbrp_1080_c: 8694.5
yuva420p_gbrp_1080_ssse3: 2186.0
yuva420p_gbrp_1920_c: 15946.5
yuva420p_gbrp_1920_ssse3: 3805.3
2024-08-18 22:26:14 +02:00
Ramiro Polla
4545205a26 swscale/yuv2rgb: add yuv42{0,2}p -> gbrp unscaled colorspace converters 2024-08-18 22:26:11 +02:00
Ramiro Polla
af5adf57e3 swscale/yuv2rgb: prepare YUV2RGBFUNC macro for multi-planar rgb
This will be used in the upcoming yuv42{0,2}p -> gbrp unscaled
colorspace converters.

There is no difference in performance.
2024-08-18 22:26:08 +02:00
Ramiro Polla
24063e7827 swscale/yuv2rgb: prepare LOADCHROMA/PUTFUNC macros for multi-planar rgb
This will be used in the upcoming yuv42{0,2}p -> gbrp unscaled
colorspace converters.

There is no difference in performance.
2024-08-18 22:26:05 +02:00
Ramiro Polla
5c1c0325cd avcodec/aarch64/me_cmp: add dotprod implementations of sse16 and vsse_intra16
checkasm --bench for Raspberry Pi 5 Model B Rev 1.0:
sse_0_c: 241.5
sse_0_neon: 37.2
sse_0_dotprod: 22.2
vsse_4_c: 148.7
vsse_4_neon: 31.0
vsse_4_dotprod: 15.7
2024-08-17 15:31:48 +02:00
Dale Curtis
a31106d849 lavf/demux: don't reallocate a AVCodecContext when closing a non-open codec.
This results in an unnecessary ~800k allocation with H.264. A
nearby callsite uses avcodec_is_open() to avoid this, so do the
same when exiting avformat_find_stream_info().

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-08-17 12:54:41 +02:00
sfan5
c779766b5c avcodec/mediacodecdec: call MediaCodec.stop on close
Usually the MediaCodec context will be released immediately, or it needs to stay
alive due to existing hardware buffers.

However we can free resources early in the case of
hw_buffer_count == 0 && refcount > 1, which can be reproduced by keeping frames
referenced after flushing and closing. mpv currently behaves like this.

Signed-off-by: sfan5 <sfan5@live.de>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-08-17 09:03:05 +02:00
Timo Rothenpieler
817c6a6762 avformat/hlsenc: correctly reset subtitle stream counter per-varstream
Without resetting it, if there was a previous set of varstreams with
subtitles, it would subtract from all the streams, leading to chaos and
segfaults when trying to access for example stream -1.
2024-08-16 20:22:09 +02:00
James Almer
211c88b9d5 avfilter/f_zmq: fix graph argument
Fixes regression since d566a37003.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-16 09:53:22 -03:00
Niklas Haas
7b723ebd5a avcodec/dovi_rpudec: error out on strange RPU formats
Better safe than sorry.
2024-08-16 11:48:02 +02:00
Niklas Haas
3e1b70383e avcodec/dovi_rpuenc: slightly improve profile autodetection
In the absence of an RPU header, we can consult the colorspace tags to
make a more informed guess about whether we're looking at profile 5 or
profile 8.
2024-08-16 11:48:02 +02:00
Niklas Haas
ecea6ed3c9 avcodec/dovi_rpuenc: implement DM metadata compression
This implements limited metadata compression. To be a bit more lenient,
we try and re-order the static extension blocks when testing for an
exact match.

For sanity, and to avoid producing bitstreams we couldn't ourselves
decode, we don't accept partial matches - if some extension blocks
change while others remain static, compression is disabled for the
entire frame.

This shouldn't be an issue in practice because static extension blocks
are stated to remain constant throughout the entire sequence.
2024-08-16 11:48:02 +02:00
Niklas Haas
9824d1539e avcodec/dovi_rpudec: sanitize DM data before decoding
Some DM types do not fill the whole struct, so just clear it entirely
before going filling the decoded values.
2024-08-16 11:48:02 +02:00
Niklas Haas
45f5f4d3da avcodec/dovi_rpudec: implement limited DM decompression
This implements the limited DM metadata compression scheme described in
chapter 9 of the dolby vision bitstream specification.

The spec is a bit unclear about how to handle the presence of static
metadata inside compressed frames; in that it doesn't explicitly forbid
an encoder from repeating redundant metadata. In theory, we would need
to detect this case and then strip the corresponding duplicate metadata
from the existing set of static metadata. However, this is difficult to
implement - esspecially for the case of metadata blocks which may be
internally repeated (e.g. level 10).

That said, the spec states outright that static metadata should be
constant throughout the entire sequence, so a sane bitstream should not
have any static metadata values changing from one frame to the next (at
least up to a keyframe boundary), and therefore they should never be
present in compressed frames. As a consequence, it makes sense to treat
this as an error state regardless. (Ignoring them by default, or
erroring if either AV_EF_EXPLODE or AV_EF_AGGRESSIVE are set)

I was not able to find such samples in the wild (outside of artificially
produced test cases for this exact scenario), so I don't think we need
to worry about it until somebody produces one.
2024-08-16 11:48:02 +02:00
Niklas Haas
1c4d4cc368 avcodec/dovi_rpudec: don't unnecessarily allocate DOVIExt 2024-08-16 11:48:02 +02:00
Niklas Haas
a1f96ae157 avcodec/dovi_rpu: separate static ext blocks
Static and dynamic extension blocks are handled differently by metadata
compression, so we need to separate the extension block array into two.
2024-08-16 11:48:02 +02:00
Niklas Haas
f5d6eb4017 avcodec/dovi_rpu: move ext blocks into dedicated struct
Slightly re-organize the logic around extension blocks in order to allow
expanding the state tracking in a following commit.
2024-08-16 11:48:02 +02:00
Niklas Haas
b3d33f11fa avcodec/bsf/dovi_rpu: add new bitstream filter
This can be used to strip dovi metadata, or enable/disable dovi
metadata compression. Possibly more use cases in the future.
2024-08-16 11:48:02 +02:00
Niklas Haas
07712a0cab avcodec/dovi_rpuenc: add configuration for compression
In particular, validate that the chosen compression level is compatible
with the chosen profile.
2024-08-16 11:48:02 +02:00
Niklas Haas
1917270d32 avcodec/dovi_rpuenc: add ff_dovi_configure_ext()
More flexible version of ff_dovi_configure() which does not require an
AVCodecContext. Usable, for example, inside a bitstream filter.
2024-08-16 11:48:02 +02:00
Niklas Haas
765f29c61e avcodec/dovi_rpu: add ff_dovi_get_metadata()
Provides direct access to the AVDOVIMetadata without having to attach it
to a frame.
2024-08-16 11:48:02 +02:00
Niklas Haas
ae3a78593d avcodec/dovi_rpuenc: add a flag to enable compression
Keyframes must reset the metadata compression state, so we need to
also signal this at rpu generation time.

Default to uncompressed, because encoders cannot generally know if
a given frame will be a keyframe before they finish encoding, but also
cannot retroactively attach the RPU. (Within the confines of current
APIs)
2024-08-16 11:48:02 +02:00
Niklas Haas
b3bc8f8e1e avcodec/dovi_rpuenc: make encapsulation optional
And move the choice of desired container to `flags`. This is needed to
handle differing API requirements (e.g. libx265 requires the NAL RBSP,
but CBS BSF requires the unescaped bytes).
2024-08-16 11:48:02 +02:00
Niklas Haas
1e6fdb89bd avcodec/dovi_rpuenc: add flags to ff_dovi_rpu_generate()
Will be used to control compression, encapsulation etc.
2024-08-16 11:48:02 +02:00
Niklas Haas
c62b364dcb avcodec/dovi_rpuenc: respect dv_md_compression
Limited mode can only ever maintain a single VDR RPU reference, and
furthermore requires vdr_rpu_id == 0. So in practice, it will only ever
use VDR RPU slot 0. All remaining slots get flushed in this case, to
avoid leaking partial state.
2024-08-16 11:48:02 +02:00
Niklas Haas
fd00a56653 avcodec/dovi_rpuenc: eliminate unnecessary loop
This struct itself contains vdr_rpu_id, so we can never match it except
in the case of i == vdr_rpu_id. So just directly use this ID.
2024-08-16 11:48:02 +02:00
Niklas Haas
bf92441d6a avcodec/dovi_rpuenc: also copy ext blocks to dovi ctx
As the comment implies, DOVIContext.ext_blocks should also reflect the
current state after ff_dovi_rpu_generate().

Fluff for now, but will be needed once we start implementing metadata
compression for extension blocks as well.
2024-08-16 11:48:02 +02:00
Niklas Haas
a93801b626 avcodec/dovi_rpudec: implement validation for compression
Add some error checking. I've limited it to AV_EF_CAREFUL and
AV_EF_COMPLIANT for now, because we can technically decode such RPUs
just fine.
2024-08-16 11:48:02 +02:00
Niklas Haas
2a2e0aced2 avutil/dovi_meta: document static vs dynamic ext blocks 2024-08-16 11:48:02 +02:00
Niklas Haas
ae31acd702 fate/scalechroma: switch to standard chroma location
Replace the manually specified chroma location by one using standard
notation, arbitrarily "bottomleft" as it is a less common path.

Required if we want to phase out the use of manual chroma locations.
2024-08-16 11:43:37 +02:00
Niklas Haas
f1071dc634 avfilter/vf_zscale: remove unused fields 2024-08-16 11:43:37 +02:00
Niklas Haas
c8bc6fabd7 avfilter/vf_scale: fix 4:1:0 interlaced chroma pos
The current logic hard-coded a check for v_sub == 1. We can extend this
logic slightly to cover the case of interlaced 4:1:0 (which has v_sub ==
2).

Here is a diagram explaining this scenario (with center-siting):

a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b
      X               X
a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b

a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b
      Y               Y
a   a   a   a   a   a   a   a

b   b   b   b   b   b   b   b

a = even luma rows
b = odd luma rows
X = even chroma sample
Y = odd chroma sample

In progressive mode, the chroma samples sit at (384, 384) respectively.

Relative to the 8x4 grid of even luma samples (a), the X sample sits at:
  h_chr_pos = 384
  v_chr_pos = 192

Relative to the 8x4 grid of odd luma samples (b), the Y sample sits at:
  h_chr_pos = 384
  v_chr_pos = 576

The new code calculates the correct values in all circumstances.
2024-08-16 11:43:37 +02:00
Niklas Haas
15a67c0947 avfilter/vf_scale: add in/out_chroma_loc
Currently, this just functions as a more principled and user-friendly
replacement for the (undocumented and hard to use) *_chr_pos fields.

However, the goal is to automatically infer these values from the input
frames' chroma location, and deprecate the manual use of *_chr_pos
altogether. (Indeed, my plans for an swscale replacement will most
likely also end up limiting the set of legal chroma locations to those
permissible by AVFrame properties)
2024-08-16 11:43:37 +02:00
Niklas Haas
18b9687308 avfilter/swscale: always fix interlaced chroma location
The current logic only fixes it when the user does not explicitly
specify the chroma location. However, this does not make a lot of sense.
Since there is no way to specify this property per-field, it effectively
*prevents* the user from being able to correctly scale interlaced frames
with top-aligned chroma.

It makes more sense to consider the user setting in the progressive case
only, and automatically adapt it to the correct interlaced field
positions, following the details of the MPEG specification.
2024-08-16 11:43:37 +02:00
Niklas Haas
6b40be941a swscale/options: relax src/dst_h/v_chr_pos value range
When dealing with 4x subsampling ratios (log2 == 2), such as can arise
with 4:1:1 or 4:1:0, a value range of 512 is not enough to cover the
range of possible scenarios.

For example, bottom-sited chroma in 4:1:0 would require an offset of 768
(three luma rows). Simply double the limit to 1024. I don't see any
place in initFilter() that would experience overflow as a result of this
change, especially since get_local_pos() right-shifts it by the
subsampling ratio again.
2024-08-16 11:43:37 +02:00
Niklas Haas
5d964df5da avfilter/vf_setparams: remove unnecessary options bounds
AV_OPT_TYPE_CONST does not use min/max, we can leave them as 0.
2024-08-16 11:43:37 +02:00
Niklas Haas
201f1cba15 avfilter/vf_setparams: allow setting chroma location
Shockingly, there isn't currently _any_ filter for overriding this.
2024-08-16 11:43:37 +02:00
Niklas Haas
3e064f52eb swscale: document SWS_FULL_CHR_H_* flags
Based on my best understanding of what they do, given the source code.
2024-08-16 11:43:37 +02:00
Fei Wang
be7ab63552 lavc/qsvdec: Add vvc_mp4toannexb bsf for QSV VVC decoder
Fix error:
$ ffmpeg -hwaccel qsv -i input.mp4 -f null -
..
[vvc_qsv @ 0000026890D966C0] Error decoding stream header: unknown error (-1)
[vvc_qsv @ 0000026890D966C0] Error decoding header

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-16 14:15:04 +08:00
Lynne
a797317ab1 vulkan_filter: don't require the storage flag for the base frames format
We check for whether subformats support storage immediately below.
Those are the ones we require storage for, rather than the base format
itself.

This permits better reuse of AVHWFrame contexts.

The patch also removes an always-false check in the subformat check.
2024-08-16 01:22:17 +02:00
Lynne
b165f144e7 vulkan_filter: allow reusing frame contexts with DRM tiling
There's no reason not to permit this, particularly if a user wants
to manipulate images which will be exported back to DRM.
2024-08-16 01:22:17 +02:00
Lynne
604dfdb44c hwcontext_vulkan: align host mapping size to minImportedHostPointerAlignment
This was left out of the recent rewrite of the system.
2024-08-16 01:22:16 +02:00
Lynne
18d964fc2c vulkan: enable encoding of images if video_maintenance1 is enabled
Vulkan encoding was designed in a very... consolidated way.
You had to know the exact codec and profile that the image was going to
eventually be encoded as at... image creation time. Unfortunately, as good
as our code is, glimpsing into the exact future isn't what its capable of.

video_maintenance1 removed that requirement, which only then made encoding
images practically possible.
2024-08-16 01:22:16 +02:00
Lynne
46c13834b6 hwcontext_vulkan: enable VK_KHR_video_maintenance1
We require it for encoding.
2024-08-16 01:22:15 +02:00
Lynne
97e947a2a7 hwcontext_vulkan: setup extensions before features
The issue is that enabling features requires that the device
extension is supported. The extensions bitfield was set later,
so it was always 0, leading to no features being added.
2024-08-16 01:22:15 +02:00
Lynne
c3cbaf39bb hwcontext_vulkan: don't enable deprecated VK_KHR_sampler_ycbcr_conversion extension
It was added to Vulkan 1.1 a long time ago.
Validation layer will warn if this is enabled.
2024-08-16 01:22:15 +02:00
Lynne
3f65d24075 hwcontext_vulkan: fix user layers, add support for different debug modes
The validation layer option only supported GPU-assisted validation.
This is mutually exclusive with shader debug printfs, so we need to
differentiate between the two.

This also fixes issues with user-given layers, and leaks in case of
errors.
2024-08-16 01:22:14 +02:00
Lynne
869f4aec48 vulkan_decode: use the correct queue family for decoding ops
In 680d969a30, the new API was
used to find a queue family for dispatch, but the found queue
family was not used for decoding, just for dispatching.
2024-08-16 01:22:08 +02:00
Anton Khirnov
d566a37003 lavfi: move AVFilterLink.graph to FilterLink 2024-08-15 19:34:27 +02:00
Anton Khirnov
fb3efef1db lavfi: move AVFilterLink.frame_wanted_out to FilterLinkInternal 2024-08-15 19:34:27 +02:00
Anton Khirnov
42cbf66fff lavfi: move AVFilterLink.{frame,sample}_count_{in,out} to FilterLink 2024-08-15 19:34:27 +02:00
Anton Khirnov
a23d565ea7 lavfi: move AVFilterLink.frame_rate to FilterLink
Co-developed-by: James Almer <jamrial@gmail.com>
2024-08-15 19:34:27 +02:00
Anton Khirnov
d6318a244d lavfi: move AVFilterLink.current_pts(_us) to FilterLink 2024-08-15 19:34:27 +02:00
Anton Khirnov
7f17e0e6dd lavfi: move AVFilterLink.hw_frames_ctx to FilterLink 2024-08-15 19:34:24 +02:00
Anton Khirnov
ce24b5ba8f lavfi/vf_*_cuda: do not access hw contexts before checking they exist
The checks are performed in init_processing_chain().
2024-08-15 19:27:01 +02:00
Anton Khirnov
99ee7a948f lavfi: move AVFilterLink.m{ax,in}_samples to FilterLink
Also, document who sets these fields and when.
2024-08-15 19:27:01 +02:00
Anton Khirnov
54754eec1e lavfi: add a new struct for private link properties
Specifically those that should be visible to filters, but hidden from
API callers. Such properties are currently located at the end of the
public AVFilterLink struct, demarcated by a comment marking them as
private. However it is generally better to hide them explicitly, using
the same pattern already employed in avformat or avcodec.

The new struct is currently trivial, but will become more useful in
following commits.
2024-08-15 19:27:01 +02:00
Anton Khirnov
426e33c758 lavfi: set AVFilterLink.graph on link creation
There is no reason to delay this.
2024-08-15 19:27:01 +02:00
Wu Jianhua
ca5c9e810a avcodec/vvc/dsp: prefix TxType and TxSize with VVC
See https://patchwork.ffmpeg.org/project/ffmpeg/patch/TYSPR06MB64337C4A9ADF5312E6648543AA62A@TYSPR06MB6433.apcprd06.prod.outlook.com/#81892

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-08-15 20:52:14 +08:00
Wu Jianhua
ae1a9cfd52 avcodec/vvc_parser: move avctx->has_b_frames initialization to dec
From Jun Zhao <mypopydev@gmail.com>:
> Should we relocate this to the decoder? Other codecs typically set this
> parameter in the decoder.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-08-15 20:50:24 +08:00
Nuo Mi
80af195804 avcodec/vvcdec: move frame tab memset from the main thread to worker threads
memset tables in the main thread can become a bottleneck for the decoder.
For example, if it takes 1% of the processing time for one core, the maximum achievable FPS will be 100.
Move the memeset to worker threads will fix the issue.
2024-08-15 20:33:57 +08:00
Nuo Mi
daf6fcd816 avcodec/vvcdec: do not zero frame qp table
For luma, qp can only change at the CU level, so the qp tab size is related to the CU.
For chroma, considering the joint CbCr, the QP tab size is related to the TU.
2024-08-15 20:33:57 +08:00
Nuo Mi
ca2caeb21d avcodec/vvcdec: do not zero frame msf mmi table 2024-08-15 20:33:57 +08:00
Nuo Mi
0c7106f618 avcodec/vvcdec: do not zero frame cpm table 2024-08-15 20:33:57 +08:00
Nuo Mi
3e497249eb avcodec/vvcdec: check_available, use && instead of &= for shortcut evaluation 2024-08-15 20:33:57 +08:00
Nuo Mi
4f882c453e avcodec/vvcdec: do not zero frame mvf table 2024-08-15 20:33:57 +08:00
Nuo Mi
93b0d5f9ce avcodec/vvcdec: refact out is_available from is_a0_available 2024-08-15 20:33:57 +08:00
Nuo Mi
e8ac761293 avcodec/vvcdec: split ctu table to zero init and no zero init parts
cus need to init to zero, other parts are not
2024-08-15 20:19:45 +08:00
Nuo Mi
4f60961498 avcodec/vvcdec: remove unnecessary perframe initializations
deblock, sao, alf
skip, imtf, ipm, cqt_depth, cb_pos_x, cb_pos_y, cb_height, cp_mv,
tb_pos_x0, tb_pos_y0, tb_width, tb_height
2024-08-15 20:19:45 +08:00
Nuo Mi
210bf1b154 avcodec/vvcdec: refact, combine bs tab with tu tab 2024-08-15 20:19:45 +08:00
Nuo Mi
bdb79fe60a avcodec/vvcdec: thread, ensure the parse stage gets the highest priority
The parser stage is not parallelizable.
We need to schedule it as soon as possible to create later stages, which are more parallelizable

clips                                       | before | after | delta
--------------------------------------------|--------|-------|------
RitualDance_1920x1080_60_10_420_37_RA.266   | 342.7  | 365.3 |  6.59%
NovosobornayaSquare_1920x1080.bin           | 321.7  | 400   | 24.34%
Tango2_3840x2160_60_10_420_27_LD.266        |  82.3  |  91.7 | 11.42%
RitualDance_1920x1080_60_10_420_32_LD.266   | 323.7  | 319.3 | -1.36%
Chimera_8bit_1080P_1000_frames.vvc          | 364    | 411.3 | 12.99%
BQTerrace_1920x1080_60_10_420_22_RA.vvc     | 162.7  | 185.7 | 14.14%
2024-08-15 20:19:45 +08:00
Nuo Mi
7eb1df44ae checkasm: add tests for vvc dmvr
dmvr_8_12x20_c: 186.2
dmvr_8_12x20_avx2: 25.7
dmvr_8_20x12_c: 181.7
dmvr_8_20x12_avx2: 25.2
dmvr_8_20x20_c: 283.2
dmvr_8_20x20_avx2: 32.0
dmvr_10_12x20_c: 90.0
dmvr_10_12x20_avx2: 15.7
dmvr_10_20x12_c: 41.0
dmvr_10_20x12_avx2: 14.7
dmvr_10_20x20_c: 81.5
dmvr_10_20x20_avx2: 26.7
dmvr_12_12x20_c: 190.7
dmvr_12_12x20_avx2: 20.2
dmvr_12_20x12_c: 187.2
dmvr_12_20x12_avx2: 20.2
dmvr_12_20x20_c: 292.7
dmvr_12_20x20_avx2: 27.2
dmvr_h_8_12x20_c: 317.0
dmvr_h_8_12x20_avx2: 37.0
dmvr_h_8_20x12_c: 340.0
dmvr_h_8_20x12_avx2: 41.0
dmvr_h_8_20x20_c: 540.7
dmvr_h_8_20x20_avx2: 64.0
dmvr_h_10_12x20_c: 322.7
dmvr_h_10_12x20_avx2: 30.7
dmvr_h_10_20x12_c: 344.2
dmvr_h_10_20x12_avx2: 34.0
dmvr_h_10_20x20_c: 529.0
dmvr_h_10_20x20_avx2: 51.5
dmvr_h_12_12x20_c: 326.7
dmvr_h_12_12x20_avx2: 33.5
dmvr_h_12_20x12_c: 331.7
dmvr_h_12_20x12_avx2: 51.2
dmvr_h_12_20x20_c: 534.0
dmvr_h_12_20x20_avx2: 62.7
dmvr_hv_8_12x20_c: 650.0
dmvr_hv_8_12x20_avx2: 57.2
dmvr_hv_8_20x12_c: 676.2
dmvr_hv_8_20x12_avx2: 70.0
dmvr_hv_8_20x20_c: 1068.5
dmvr_hv_8_20x20_avx2: 103.2
dmvr_hv_10_12x20_c: 649.0
dmvr_hv_10_12x20_avx2: 48.2
dmvr_hv_10_20x12_c: 677.7
dmvr_hv_10_20x12_avx2: 59.7
dmvr_hv_10_20x20_c: 1093.5
dmvr_hv_10_20x20_avx2: 91.7
dmvr_hv_12_12x20_c: 660.0
dmvr_hv_12_12x20_avx2: 58.7
dmvr_hv_12_20x12_c: 682.7
dmvr_hv_12_20x12_avx2: 72.0
dmvr_hv_12_20x20_c: 1094.0
dmvr_hv_12_20x20_avx2: 113.2
dmvr_v_8_12x20_c: 325.7
dmvr_v_8_12x20_avx2: 31.2
dmvr_v_8_20x12_c: 326.2
dmvr_v_8_20x12_avx2: 38.5
dmvr_v_8_20x20_c: 538.5
dmvr_v_8_20x20_avx2: 54.2
dmvr_v_10_12x20_c: 318.5
dmvr_v_10_12x20_avx2: 23.7
dmvr_v_10_20x12_c: 330.7
dmvr_v_10_20x12_avx2: 40.5
dmvr_v_10_20x20_c: 567.5
dmvr_v_10_20x20_avx2: 48.0
dmvr_v_12_12x20_c: 335.2
dmvr_v_12_12x20_avx2: 30.0
dmvr_v_12_20x12_c: 330.2
dmvr_v_12_20x12_avx2: 39.5
dmvr_v_12_20x20_c: 535.2
dmvr_v_12_20x20_avx2: 60.0
2024-08-15 20:19:45 +08:00
Nuo Mi
6464c157d5 x86/vvcdec: add dmvr avx2 code
Decoder-Side Motion Vector Refinement is about 4~8% CPU usage for some clips

here is the test result for one time
clips                                     | before| after | delta
------------------------------------------|-------|-------|------
RitualDance_1920x1080_60_10_420_37_RA.266 | 338.7 | 354.3 |4.61%
NovosobornayaSquare_1920x1080.bin         | 320.3 | 329.3 |2.81%
Tango2_3840x2160_60_10_420_27_LD.266      | 83.3  | 83.7  |0.48%
RitualDance_1920x1080_60_10_420_32_LD.266 | 320.7 | 327.3 |2.06%
Chimera_8bit_1080P_1000_frames.vvc        | 360.7 | 381.0 |5.63%
BQTerrace_1920x1080_60_10_420_22_RA.vvc   | 161.7 | 163.0 |0.80%
2024-08-15 20:19:45 +08:00
Nuo Mi
1c17520e79 avcodec/vvcdec: Use av_image_copy_plane for DMVR 10-bit integer pixels
It's no need to shift and interpolate for 10-bit integer pixels,
av_image_copy_plane is enough
2024-08-15 20:19:45 +08:00
eaphone
7897b0beed libavdevice/gdigrab: change hwnd tail check fail logic to !=null
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-15 20:10:33 +08:00
gnattu
a1976e963f avutil/hwcontext_videotoolbox: silence warning for RGB
Hardware frames with RGB colorspace will not have a YCbCrMatrixKey.
Currently, it will spam the console with warning if rgb frame is
uploaded.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-15 20:10:33 +08:00
Araz Iusubov
42a40538f3 avcodec/amfenc: new encoder features support
Implemented:
New usage modes for AV1 encoder.
Latency mode for H264, HEVC and AV1 encoders.
Adaptive Quantization (AQ) mode in AV1 encoder.
Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
2024-08-15 14:01:07 +02:00
Gyan Doshi
1f801dfdb5 lavc/libx265: unbreak build for X265_BUILD >= 210
x265 added support for alpha starting with build 210.
While doing so, x265_encoder_encode() changed its fifth arg to
an array of pointers to x265_picture. This broke building lavc/libx265.c

This patch simply unbreaks the build and maintains existing single-layer
non-alpha encoding support.

Fixes #11130
2024-08-15 15:17:14 +05:30
James Almer
66c05dc031 avformat/iamf_parse: ignore Audio Elements with an unsupported type
Better fix for the NULL pointer dereference from d7f83fc2f4.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-14 23:55:40 -03:00
James Almer
9880fea930 avcodec/snowenc: sign extend a variable before shifting
Fixes "libavcodec/snowenc.c:718:27: runtime error: left shift of 8509032 by 8 places cannot be represented in type 'int'"
as seen in fate-vsynth2-snow-hpel under ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-14 14:52:46 -03:00
Michael Niedermayer
7ad937f0c8 avformat/av1dec: Better fix for 70872/clusterfuzz-testcase-minimized-ffmpeg_dem_OBU_fuzzer-6005782487826432
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 19:05:17 +02:00
Michael Niedermayer
45ee6b1e3d avcodec/apac: Fix discards ‘const’ qualifier
Found-by: courmisch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:49:52 +02:00
vipyne
fc07062a47 doc/mailing-list-faq: remove dead link
https://ffmpeg-archive.org/ is no longer "Nabble"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:25:37 +02:00
Michael Niedermayer
db843c8910 avcodec/alsdec: clear last_acf_mantissa
Fixes: use-of-uninitialized-value
Fixes: 70869/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5476567461986304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:02 +02:00
Michael Niedermayer
de3f6c8888 avcodec/aic: Clear slice_data
Fixes: use-of-uninitialized-value
Fixes: 70865/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AIC_fuzzer-4874102695854080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:01 +02:00
Michael Niedermayer
50471f96c4 avcodec/vc1dec: Clear mb_type_base and ttblk_base
Fixes: two use-of-uninitialized-value
Fixes: 70856/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5539349918187520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:01 +02:00
Michael Niedermayer
e44349ee88 avcodec/shorten: clear padding
Fixes: use-of-uninitialized-value
Fixes: 70854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5533480570650624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:01 +02:00
Michael Niedermayer
66ee75d76c avformat/mpeg: Check an avio_read() for failure
Fixes: use-of-uninitialized-value
Fixes: 70849/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGPS_fuzzer-4684401009557504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:00 +02:00
Michael Niedermayer
8ca072a373 avcodec/apac: Clean padding space
Fixes: use-of-uninitialized-value
Fixes: 70842/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APAC_fuzzer-5758325067677696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:00 +02:00
Michael Niedermayer
cba4e2e40d avcodec/mvha: Clear remaining space after inflate()
Fixes: use-of-uninitialized-value
Fixes: 70838/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-4878509466517504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:21:00 +02:00
Michael Niedermayer
a0f22218f7 bsf/media100_to_mjpegb: Clear output buffer padding
Fixes: use-of-uninitialized-value
Fixes: 70855/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MEDIA100_fuzzer-5537446610141184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:59 +02:00
Michael Niedermayer
d7f83fc2f4 avformat/iamfdec: Check nb_layers before dereferencing layer
Fixes: dereferencing pointers near NULL
Fixes: 70432/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5255672845893632
Fixes: 70877/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5348547432611840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:59 +02:00
Michael Niedermayer
6996e1238e avformat/av1dec: Check bits left before get_leb128()
Fixes: use of uninitialized value
Fixes: 70872/clusterfuzz-testcase-minimized-ffmpeg_dem_OBU_fuzzer-6005782487826432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:58 +02:00
Michael Niedermayer
4dc7dfe65a avformat/segafilm: Set keyframe
Fixes: use of uninitialized value
Fixes: 70871/clusterfuzz-testcase-minimized-ffmpeg_dem_SEGAFILM_fuzzer-5883617752973312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:58 +02:00
Michael Niedermayer
0f4524f07a avcodec/sga: av_assert1 check init_get_bits8()
Related: CID1473562 Unchecked return value
Related: CID1473592 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:58 +02:00
Michael Niedermayer
e40b23c52a tools/target_dec_fuzzer: Check that FFv1 doesnt leave uninitialized memory in its buffers
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-14 18:20:57 +02:00
Jan Garcia via ffmpeg-devel
598f541ba4 fftools/ffmpeg: show video stats in progress output without filters
Since ffmpeg 6.1 video stats are accidentally hidden from streamcopy progress output.
This patch re-enables video stats (like frames=) in the progress output.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-08-14 15:17:58 +02:00
Josh Allmann
374824cbc7 avcodec/h264_mp4toannexb: Prepend SPS/PPS to buffering period SEI
Encoders may emit a buffering period SEI without a corresponding
SPS/PPS if the SPS/PPS is carried out-of-band, eg with avcc.

During Annex B conversion, this may result in the SPS/PPS being
inserted *after* the buffering period SEI but before the IDR NAL.

Since the buffering period SEI references the SPS, the SPS/PPS
needs to come first.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-08-14 13:20:56 +02:00
Ross Burton
654bd47716 libavcodec/arm/mlpdsp_armv5te: fix label format to work with binutils 2.43
binutils 2.43 has stricter validation for labels[1] and results in errors
when building ffmpeg for armv5:

src/libavcodec/arm/mlpdsp_armv5te.S:232: Error: junk at end of line, first unrecognized character is `0'

Remove the leading zero in the "01" label to resolve this error.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-08-13 23:24:13 +03:00
Stephen Hutchinson
ea7375c9e9 avformat/avisynth: move avs_planes* consts into relevant function
These consts are only used in the switch(planar) case located in
avisynth_create_stream_video and nowhere else in the demuxer,
so move them into that function directly.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
Stephen Hutchinson
48d6cd35a2 avformat/avisynth: remove library allocation from global state
As part of this, the mutexes are no longer necessary, and
avisynth_read_close needs to check that avs->avs_library.library
still exists before it attempts to call avisynth_context_destroy
and dlclose.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
Stephen Hutchinson
8f01ce2898 avformat/avisynth: remove mutex lock from avisynth_read_close
Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
Stephen Hutchinson
c0fddbae79 avformat/avisynth: remove atexit() handler
The atexit() handler in the avisynth demuxer was added because
there was a conflict in AvxSynth that arose due to their use
of C++ global objects, particularly in relation to having
added a logging function relying on log4cpp.

This conflict was responsible for causing a segfault on exit.
It did not affect Windows with the (at the time) upstream
AviSynth 2.5 and 2.6, nor does it affect AviSynth+.

Unfortunately, none of this was actually shielded by ifdefs
indicating the fact it was only needed for AvxSynth, so four
years ago when AviSynth+ replaced AvxSynth as the handler
for AviSynth scripts on Unix-like OSes, the fact that the
atexit handler was no longer necessary was overlooked.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2024-08-13 15:09:53 -04:00
James Almer
66592e8b10 swscale/output: don't leave the alpha channel undefined in vuyx and xv36le
It's non-determistic, as shown by poisoning avfilter buffers instead of zeroing them.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-13 14:49:41 -03:00
James Almer
ed618b288f avcodec/rpzaenc: don't use buffer data beyond the end of a row
Fixes use of uninitized data (masked by the default zeroing of image buffers).

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-13 14:49:41 -03:00
James Almer
2b349f2d73 avcodec/adpcm: adpcm_dtk is stereo only
Fixes ticket #11133

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-13 14:49:41 -03:00
Lynne
d138d7a595 vulkan: make sure descriptor buffers are always DEVICE_LOCAL
Implementations are required to list memory heaps in the most optimal
order. But its better to be explicit for this particular allocation.
2024-08-13 19:05:20 +02:00
Anton Khirnov
9e3b5b8a26 fftools/ffmpeg: switch -map parsing to new stream specifier API
Makes optional map handling less hacky, fixes combining optional maps
with metadata matching on tags/values containing the '?' character/

Forward errors from stream specifier parsing, previously the code would
ignore them.
2024-08-13 10:28:54 +02:00
Anton Khirnov
d1bdd89c2f fftools/ffmpeg: use new stream specifier API in opt_match_per_stream*()
Removes a lot of error checking code, as matching cannot fail.
2024-08-13 10:28:54 +02:00
Anton Khirnov
46cbe4ab5c fftools/cmdutils: split stream specifier parsing and matching
This approach has the major advantage that only parsing can fail (due to
a malformed specifier or memory allocation failure). Since parsing is
done generically, while matching is per-option, this will allow to
remove substantial amounts of error checking code in following commits.

The new code also explicitly allows stream specifiers to be followed by
additional characters, which should allow cleaner handling of optional
maps, i.e. -map <stream_specifier>?, which is currently implemented in a
hacky way that breaks when the stream specifier itself contains the '?'
character (this can happen when matching metadata). It will also allow
further extending the syntax, which will be useful in following commits.

This introduces some minor behaviour changes:
* Matching metadata tags now requires the ':' character in keys or
  values to be escaped. Previously it could not be present in keys, and
  would be used verbatim in values. The change is required in order to
  know where the value terminates.
* Multiple stream types in a single specifier are now rejected - such a
  specifier makes no sense.
* Non-existent stream group ID or index is now ignored with a warning
  rather than causing a failure. This is consistent with program
  handling and is required to make matching fail-free.
2024-08-13 10:28:54 +02:00
Anton Khirnov
e1b38680b7 fftools/cmdutils: put stream specifier handling back into cmdutils
Stream specifiers were originally designed exclusively for CLI use and
were not intended to be public API. Handling them in avformat places
major restrictions on how they are used. E.g. if ffmpeg CLI wishes to
override some stream parameters, it has to change the demuxer fields
(since avformat_match_stream_specifier() does not have access to
anything else). However, such fields are supposed to be read-only for
the caller.

Furthermore having this code in avformat restricts extending the
specifier syntax. An example of such an extension will be added in
following commits.
2024-08-13 10:28:54 +02:00
Anton Khirnov
93227a68f1 fftools/ffmpeg: replace remaining uses of MATCH_PER_STREAM_OPT() 2024-08-13 10:28:54 +02:00
Anton Khirnov
e218bde9f9 fftools/ffmpeg: replace MATCH_PER_STREAM_OPT(.., str, ..) with a function
This has multiple advantages:
* The macro has multiple parameters that often have similar or identical
  values, yet very different meanings (one is the name of the
  OptionsContext member where the parsed options are stored, the other
  the name of the variable into which the result is written); this
  change makes each of these explicit.

* The macro returns on failure, which may cause leaks - this was the
  reason for adding MATCH_PER_STREAM_OPT_CLEAN(), also ost_add()
  currently leaks encoder_opts. The new function returns failure to its
  caller, which decides how to deal with it. While that adds a lot of
  error checks/forwards for now, those will be reduced in following
  commits.

* new code is type- and const- correct

Invocations of MATCH_PER_STREAM_OPT() with other types will be converted
in following commits.
2024-08-13 10:28:54 +02:00
James Almer
82085a3e0a avcodec/avcodec_internal: fix type definition for the new functions
Fixes make checkheaders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 23:10:48 -03:00
James Almer
472fbee812 avformat/movenc: don't look at previous track_id as it may not be set
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 11:41:38 -03:00
James Almer
41307ff3e9 avfilter/video: don't zero allocated buffers if memory poisoning is used
Same as in avcodec/get_buffer.c
Should help in debugging use of uninitialized memory.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 11:41:38 -03:00
James Almer
8d700eab85 tests/iamf: match stream group by id in some tests
Increases specifier parsing code coverage a little bit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 11:41:38 -03:00
Anton Khirnov
deee00e2eb lavc/decode: reindent after previous commit 2024-08-12 14:42:20 +02:00
Anton Khirnov
5acbdd2264 lavc: convert frame threading to the receive_frame() pattern
Reorganize the code such that the frame threading code does not call the
decoders directly, but instead calls back into the generic decoding
code. This avoids duplicating the logic that wraps the decoder
invocation and allows receive_frame()-based decoders to use frame
threading.

Further work by Timo Rothenpieler <timo@rothenpieler.org>.
2024-08-12 14:42:20 +02:00
Anton Khirnov
4d209dada7 lavc/decode: reindent 2024-08-12 14:42:20 +02:00
Anton Khirnov
048e978e8e lavc/decode: wrap AV_FRAME_FLAG_DISCARD handling in a loop
Makes sure discarded frames do not cause EAGAIN to be returned during
flushing, which is forbidden.
2024-08-12 14:42:20 +02:00
Anton Khirnov
64743b45b5 lavc/internal: document the precise meaning of AVCodecInternal.draining
Also, set draining=1 in case a bitstream filter returns an
internally-triggered EOF. While no bitstream filters currently inserted
by decoders will do that, that may change in the future and it is better
to cover this case.
2024-08-12 14:42:20 +02:00
Anton Khirnov
d94cfd4900 lavc/thread: move generic-layer API to avcodec_internal.h
thread.h currently contains both API for decoder use and functions
internal to lavc generic layer. Move the latter to avcodec_internal.h,
which is a more appropriate place for them.
2024-08-12 14:42:20 +02:00
Anton Khirnov
8d5efc2182 lavc/ffv1dec: fix races in accessing FFV1SliceContext.slice_damaged
That variable is shared between frame threads in the same defective way
described in the previous commit. Fix it by adding a RefStruct-managed
arrays of flags that is propagated across frame threads in the standard
manner.

Remove now-unused FFV1Context.fsrc
2024-08-12 14:42:20 +02:00
Anton Khirnov
15bdca054f lavc/ffv1dec: drop code handling AV_PIX_FMT_FLAG_PAL
No paletted pixel formats are supported by the decoder.
2024-08-12 14:42:20 +02:00
Michael Niedermayer
43cde54fc1 avdevice/dshow: Initialize 2 pointers
Coverity claims these are used uninitilaized in CID1598561 Uninitialized pointer write and CID1598565 Uninitialized pointer write

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:16 +02:00
Michael Niedermayer
189bc840b0 avcodec/dxva2_*: Initialize dxva_data_ptr
Related: CID1591888 Uninitialized scalar variable
Related: CID1591925 Uninitialized pointer read
Related: CID1591933 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:15 +02:00
Michael Niedermayer
1d6a2aebae avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
Related: CID1591924 Uninitialized scalar variable
Related: CID1591938 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:15 +02:00
Michael Niedermayer
2232c4cc8c avcodec/dxva2: initialize validate
Related: CID1591915 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:15 +02:00
Michael Niedermayer
489c05b9c3 avcodec/dxva2: Initialize ConfigBitstreamRaw
Related: CID1591894 Uninitialized scalar variable
Related: CID1591906 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:14 +02:00
Michael Niedermayer
c8c59e9929 avcodec/dxva2: Initialize dxva_size and check it
Related: CID1591878 Uninitialized scalar variable
Related: CID1591928 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:14 +02:00
Michael Niedermayer
b98125e5a5 avfilter/vf_xfade: Compute w2, h2 with float
Fixes: CID1458148 Result is not floating-point
Fixes: CID1458149 Result is not floating-point
Fixes: CID1458150 Result is not floating-point
Fixes: CID1458151 Result is not floating-point
Fixes: CID1458152 Result is not floating-point
Fixes: CID1458154 Result is not floating-point
Fixes: CID1458155 Result is not floating-point
Fixes: CID1458156 Result is not floating-point

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:14 +02:00
Michael Niedermayer
f802d65de0 avfilter/vf_v360: Assert that vf was initialized
Maybe helps: CID1504571 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer
9229587c2d avfilter/vf_unsharp_opencl: Use AV_VIDEO_MAX_PLANES
Related: CID1423281 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer
e5c0f56ca0 avfilter/vf_tonemap_opencl: Dereference after NULL check
Fixes: CID1437472 Dereference before null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer
22ee55a1da avfilter/af_surround: Check output format
Fixes: CID1516994 Out-of-bounds access
Fixes: CID1516996 Out-of-bounds access
Fixes: CID1516999 Out-of-bounds access

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Michael Niedermayer
43b62b7e0c avfilter/vf_xfade_opencl: Check ff_inlink_consume_frame() for failure
Fixes: CID1458127 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Michael Niedermayer
191a685010 avformat/lmlm4: Eliminate some AVERROR(EIO)
Found by code review related to CID732224 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Michael Niedermayer
239f7e6c71 avformat/lmlm4: Move subtraction after check
This is not a bugfix in code but coverity only, it does look a little nicer though

Fixes: CID732224

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:11 +02:00
Lynne
e25667f9f1 hwcontext_vulkan: ignore false positive validation errors
Issue ref:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/6627
2024-08-11 05:13:18 +02:00
Lynne
ef11a6456d hwcontext_vulkan: do not chain structs of unsupported extensions in vkCreateDevice
Fixes:

vkCreateDevice(): pCreateInfo->pNext<VkPhysicalDeviceOpticalFlowFeaturesNV> includes a
pointer to a VkPhysicalDeviceOpticalFlowFeaturesNV, but when creating VkDevice, the
parent extension (VK_NV_optical_flow) was not included in ppEnabledExtensionNames.
The Vulkan spec states: Each pNext member of any structure (including this one) in
the pNext chain must be either NULL or a pointer to a valid struct for extending
VkDeviceCreateInfo.
2024-08-11 05:13:17 +02:00
Lynne
12080ff040 nlmeans_vulkan: fix uninitialized reads 2024-08-11 05:13:17 +02:00
Lynne
680d969a30 vulkan_decode: port to the new queue family API 2024-08-11 05:13:16 +02:00
Lynne
d6c08a41cb vulkan: load queue families upon loading properties
Avoids the need to call ff_vk_qf_init if manually filling in
a queue family structure.
2024-08-11 05:13:16 +02:00
Lynne
0b25f0bc1d hwcontext_vulkan: correct comment in header 2024-08-11 05:13:16 +02:00
Lynne
1c05661ec4 vulkan_decode: add \n to error message 2024-08-11 05:13:15 +02:00
Lynne
5f0f1f7b7a libavutil: deprecate the old Vulkan queue API, add doc/APIchanges entries 2024-08-11 05:13:15 +02:00
Lynne
83cd77563f vulkan: add support for encode feedback queries 2024-08-11 05:13:15 +02:00
Lynne
2ce0e51503 hwcontext_vulkan: add support for Vulkan encoding 2024-08-11 05:13:14 +02:00
Lynne
ca591e6b50 vulkan_decode: force layered_dpb to 0 when dedicated_dpb is 0
layered_dpb only makes sense when dedicated_dpb is set to 1.
For some mysterious reason, some Nvidia drivers stopped indicating
SEPARATE_REFRENCES, but kept the COINCIDE flag, which broke
the code.
2024-08-11 05:13:14 +02:00
Lynne
8eac11105b vulkan: use allocator callback for buffer creation
This would've let to a segfault if custom allocators were used.
2024-08-11 05:13:13 +02:00
Lynne
55adcb4fc5 hwcontext_vulkan: add support for VK_EXT_shader_object
We'd like to use it eventually, and its already covered by
the minimum version of the headers we require.
2024-08-11 05:13:13 +02:00
Lynne
12f868cab5 vulkan_shaderc: add debug information to shaders 2024-08-11 05:13:13 +02:00
Lynne
c19af16f8d hwcontext_vulkan: enable storageBuffer16BitAccess if available 2024-08-11 05:13:12 +02:00
Lynne
2f7dfb0d15 vulkan_shaderc: fix error reporting for certain errors
The issue is that shaderc_result_get_num_errors may sometime
return 0 even when shaderc_result_get_compilation_status returns
a non-zero error code.
Since we use the result from the former, override the status
if it returned 0.
2024-08-11 05:13:12 +02:00
Lynne
957d34784a hwcontext_vulkan: constify validation layer features table
The struct data seem to get corrupted otherwise.
Possibly a validation layer or libvulkan issue.
2024-08-11 05:13:11 +02:00
Lynne
9e606b33a8 hwcontext_vulkan: add HOST_CACHED flag to transfer buffer
Significantly speeds up downloads on devices without host mapping.
2024-08-11 05:13:11 +02:00
Lynne
aea4d4b423 hwcontext_vulkan: rewrite upload/download
This commit was long overdue. The old transfer dubiously tried to
merge as much code as possible, and had very little in the way
of optimizations, apart from basic host-mapping.

The new code uses buffer pools for any temporary bufflers, and
handles falling back to buffer-based uploads if host-mapping fails.

Roundtrip performance difference:
ffmpeg -init_hw_device "vulkan=vk:0,debug=0,disable_multiplane=1" -f lavfi \
-i color=red:s=3840x2160 -vf hwupload,hwdownload,format=yuv420p -f null -

7900XTX:
Before: 224fps
After: 502fps

Ada, with proprietary drivers:
Before: 29fps
After: 54fps

Alder Lake:
Before: 85fps
After: 108fps

With the host-mapping codepath disabled:
Before: 32fps
After: 51fps
2024-08-11 05:13:11 +02:00
Lynne
81c5d4ea0e hwcontext_vulkan: remove unused struct 2024-08-11 05:13:10 +02:00
Lynne
6757cdb535 vulkan_video: remove NIH pooled buffer implementation
The code predates ff_vk_get_pooled_buffer().
2024-08-11 05:13:10 +02:00
Lynne
a30b7c0158 hwcontext_vulkan: initialize optical flow queues if available
Lets us implement FPS conversion.
2024-08-11 05:13:10 +02:00
Lynne
8790a30882 hwcontext_vulkan: rewrite queue picking system for the new API
This allows us to support different video ops on different queues,
as well as any other arbitrary queues we need.
2024-08-11 05:13:09 +02:00
Lynne
bedfabc437 vulkan: use the new queue family mechanism 2024-08-11 05:13:09 +02:00
Lynne
13489c8a21 hwcontext_vulkan: add a new mechanism to expose used queue families
The issue with the old mechanism is that we had to introduce new
API each time we needed a new queue family, and all the queue families
were functionally fixed to a given purpose.

Nvidia's GPUs are able to handle video encoding and compute on the
same queue, which results in a speedup when pre-processing is required.

Also, this enables us to expose optical flow queues for frame interpolation.
2024-08-11 05:13:03 +02:00
Osamu Watanabe
d88a988d3d avcodec/jpeg2000dec: Fix HT decoding
Fixes incorrect handling of MAGB_P value in Ccap15.
Fixes bugs in HT block decoding.

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-08-10 09:22:51 -07:00
Osamu Watanabe
48b14732d8 avcodec/jpeg2000dec: Add support for placeholder passes
See Rec. ITU-T T.814 | ISO/IEC 15444-15, Annex B.

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-08-10 09:22:44 -07:00
Osamu Watanabe
fe1b196499 avcodec/jpeg2000dec: Add support for CAP and CPF markers
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-08-10 09:20:15 -07:00
Michael Niedermayer
1b8d95da3a tools/target_dec_fuzzer: Use av_buffer_allocz() to avoid missing slices to have unpredictable content
This matches production code which also zeros these buffers

Fixes: use of uninitialized values
Fixes: 70885/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP6F_fuzzer-4610946029387776 (and likely others)

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-10 15:04:46 +02:00
Fei Wang
cda5f5c5ed lavc/qsv: Use vendor id to create device
New kernel driver "xe" will be supported from Lunar Lake instead of
"i915".

"xe" kernel driver:
https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/xe

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-09 13:40:26 +08:00
Fei Wang
eab4a9e9f8 lavu/hwcontext_qsv: Use vendor id to create device
New kernel driver "xe" will be supported from Lunar Lake instead of
"i915".

"xe" kernel driver:
https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/xe

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-09 13:40:26 +08:00
Fei Wang
dbd74ba3c8 lavu/hwcontext_vaapi: Add option to allow to specify vendor id when init hw device
Vendor id will help to select desired device in case of kernel driver is
unknow or unsupported, for vendor may support different kernel driver on
different platforms.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-09 13:40:24 +08:00
Michael Niedermayer
c390234da2 avformat/wtvdec: Check length of read mpeg2_descriptor
Fixes: Use of uninitialized value
Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6286909377150976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 19:10:05 +02:00
Michael Niedermayer
c95ea03104 avformat/wtvdec: clear sectors
The code can leave uninitialized holes in the array.
Fixes: use of uninitialized values
Fixes: 70883/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6698694567591936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 18:24:31 +02:00
Kacper Michajłow
b534e402d8 avformat/mov: ensure required number of bytes is read
Fixes: use-of-uninitialized-value

Found by OSS-Fuzz.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 18:23:39 +02:00
Michael Niedermayer
d2a25dc2bf add tools/target_swr_fuzzer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-08 15:26:52 +02:00
James Almer
94165d1b79 avformat/iamf: use aligned intreadwrite macros where possible
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-07 00:16:21 -03:00
James Almer
49a6e448d7 avformat/movenc: use stream indexes when generating track ids
In some scenarios nb_tracks isn't the same as nb_streams, so a given id may end
up being used for two separate streams.

e.g. when muxing an IAMF track followed by a video track, if the IAMF track
consists of several streams, the video track would end up having an id of 2,
which may also be used by one of the IAMF streams.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-07 00:16:21 -03:00
James Almer
210740b4ed avutil/frame: use the maximum compile time supported alignment for strides
This puts lavu frame buffer allocator helpers in sync with lavc's decoder frame
buffer allocator's STRIDE_ALIGN define.

Remove the comment about av_cpu_max_align() while at it as using it is not
ideal when CPU flags can be changed mid process.

Should fix ticket #11116.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-07 00:16:21 -03:00
Kacper Michajłow
792a9979eb avformat/rtpproto: free ip filters on open error
Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:19 +02:00
Kacper Michajłow
8485f7a378 avformat/srtpproto: pass options to nested protocol
This fixes passing options dict.

Fixes some timeouts found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:19 +02:00
Kacper Michajłow
9876158ee2 avcodec/wmavoice: use av_clipd for double values
Fixes Clang warning.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:18 +02:00
Kacper Michajłow
1165c14444 avcodec/vp9mvs: fix misaligned access when clearing VP9mv
Fixes runtime error: member access within misaligned address
<addr> for type 'av_alias64', which requires 8 byte alignment.

VP9mv is aligned to 4 bytes, so instead doing 8 bytes clear, let's do
2 times 4 bytes.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-07 00:59:18 +02:00
Andreas Rheinhardt
bfcee368e2 avcodec/cbs_sei: Always zero-initialize SEI payload
Fixes: Use-of-uninitialized value
Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-5458626041413632

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-08-06 20:25:23 +02:00
Kacper Michajłow
5dfc0cc841 avcodec/parser: ensure input padding is zeroed
Fixes use of uninitialized value, reported by MSAN.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>

Fixes: 70852/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5179190066872320
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:46 +02:00
Kacper Michajłow
2b5f000d3f avformat/jpegxl_anim_dec: ensure input padding is zeroed
Fixes use of uninitialized value, reported by MSAN.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>

Fixes: 70837/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5089407768526848
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:46 +02:00
Michael Niedermayer
3978e81809 avformat/img2dec: Clear padding data after EOF
Fixes: use-of-uninitialized-value
Fixes: 70852/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5179190066872320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:46 +02:00
Michael Niedermayer
79a1cf30d1 avformat/wavdec: Check if there are 16 bytes before testing them
Fixes: use-of-uninitialized-value
Fixes: 70839/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5212907590189056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-05 23:17:45 +02:00
Rémi Denis-Courmont
e0f9f4d491 lavu/cpu: deprecate RISC-V F, D and zba CPU flags 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont
d1326b6347 lavu/riscv: drop probing for zba CPU capability 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont
210877c5fd sws/riscv: depend on RVB and simplify accordingly 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont
f30e5bf1f5 lavfi/riscv: depend on RVB and simplify accordingly 2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont
616fdeaea3 lavc/riscv: depend on RVB and simplify accordingly
There is no known (real) hardware with V and without the complete B
extension. B was indeed required in the RISC-V application profile from
2022, earlier than V. There should not be any relevant hardware in the
future either.

In practice, different R-V Vector optimisations in FFmpeg already depend on
every constituent of the B extension anyhow, so it would not work well.
2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont
cb31f17ca8 lavu/riscv: depend on RVB and simplify accordingly 2024-08-05 21:16:26 +03:00
Nathan E. Egge
ba88e8174a lavu: Set default FF_TIMER_UNITS to "ns"
Signed-off-by: Nathan E. Egge <unlord@xiph.org>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-08-05 21:16:26 +03:00
Rémi Denis-Courmont
4edfc11a28 lavc/h264dsp: R-V V idct4_add8 (all depths)
These are really just wrappers for idct4_add16intra functions, which are in
turn mostly wrappers for idct4_add and idct4_dc_add functions.

For benchmarks refer to the later two sets.
2024-08-05 21:16:26 +03:00
James Almer
eb3cc508d8 fate/mov: add an IAMF+video muxing test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-04 12:09:40 -03:00
James Almer
5b87869c09 avformat/mov: fix track handling when mixing IAMF and video tracks
Fixes crashes when muxing the two together.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-04 12:09:40 -03:00
Timo Rothenpieler
9a2171318d avcodec/nvenc: fix signedness of timing fields 2024-08-03 20:04:31 +02:00
James Almer
4a56b5f3d8 avcodec/cbs_h265: don't attempt to read 0 length elements in sei_3d_reference_displays_info
Fixes: 70458/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5259339779080192
Fixes: Assertion width > 0 && width <= 32 failed at libavcodec/cbs.c:608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-03 11:59:14 -03:00
Rémi Denis-Courmont
de7f999481 lavc/videodsp: work-around LLVM-as
For some reason, it can't handle the normal syntax for an address operand
without an offset, so add a dummy zero offset.
2024-08-02 21:24:01 +03:00
Rémi Denis-Courmont
677f28b310 lavc/h264dsp: stick R-V V weight to 16-bit precision
T-Head C908 (ns):
h264_weight2_8_c:        1607.8
h264_weight2_8_rvv_i32:   515.0 (before)
h264_weight2_8_rvv_i32:   348.5 (after)
h264_weight4_8_c:        2255.8
h264_weight4_8_rvv_i32:  1015.0 (before)
h264_weight4_8_rvv_i32:   691.0 (after)
h264_weight8_8_c:        3857.5
h264_weight8_8_rvv_i32:  2218.8 (before)
h264_weight8_8_rvv_i32:  1561.3 (after)
h264_weight16_8_c:       7431.5
h264_weight16_8_rvv_i32: 2737.3 (before)
h264_weight16_8_rvv_i32: 1848.3 (after)

SpacemiT X60 (ns):
h264_weight2_8_c:        1624.1
h264_weight2_8_rvv_i32:   352.6 (before)
h264_weight2_8_rvv_i32:   259.3 (after)
h264_weight4_8_c:        2259.3
h264_weight4_8_rvv_i32:   685.8 (before)
h264_weight4_8_rvv_i32:   530.3 (after)
h264_weight8_8_c:        4103.3
h264_weight8_8_rvv_i32:  1581.8 (before)
h264_weight8_8_rvv_i32:  1238.6 (after)
h264_weight16_8_c:       7624.3
h264_weight16_8_rvv_i32: 2738.1 (before)
h264_weight16_8_rvv_i32: 1853.3 (after)
2024-08-02 21:24:01 +03:00
Rémi Denis-Courmont
afd45c7ff7 lavc/h264dsp: stick R-V V biweight to 16-bit
T-Head C908 (ns):
h264_biweight2_8_c:        2414.5
h264_biweight2_8_rvv_i32:   701.8 (before)
h264_biweight2_8_rvv_i32:   468.5 (after)
h264_biweight4_8_c:        4655.3
h264_biweight4_8_rvv_i32:  1377.5 (before)
h264_biweight4_8_rvv_i32:   931.8 (after)
h264_biweight8_8_c:        9701.5
h264_biweight8_8_rvv_i32:  2896.0 (before)
h264_biweight8_8_rvv_i32:  2070.5 (after)
h264_biweight16_8_c:      18025.0
h264_biweight16_8_rvv_i32: 3460.8 (before)
h264_biweight16_8_rvv_i32: 1978.0 (after)

SpacemiT X60 (ns):
h264_biweight2_8_c:        2415.5
h264_biweight2_8_rvv_i32:   478.2 (before)
h264_biweight2_8_rvv_i32:   362.8 (after)
h264_biweight4_8_c:        4655.3
h264_biweight4_8_rvv_i32:   946.7 (before)
h264_biweight4_8_rvv_i32:   727.3 (after)
h264_biweight8_8_c:        9061.8
h264_biweight8_8_rvv_i32:  2071.7 (before)
h264_biweight8_8_rvv_i32:  1685.8 (after)
h264_biweight16_8_c:      18020.5
h264_biweight16_8_rvv_i32: 3457.2 (before)
h264_biweight16_8_rvv_i32: 1935.8 (after)
2024-08-02 21:24:01 +03:00
Zhao Zhili
670ff6c7ce avcodec/nvenc: rework on DTS generation
Before the patch, the method to generate DTS only works with
timebase equal to 1/fps. With timebase like 1/1000

./ffmpeg -i foo.mp4 -an -c:v h264_nvenc -enc_time_base 1/1000 bar.mp4

pts 0    dts -3
pts 160  dts 37
pts 80   dts 77
pts 40   dts 117 <-- invalid
pts 120  dts 157
pts 320  dts 197
pts 240  dts 237
pts 200  dts 277 <-- invalid
pts 280  dts 317 <-- invalid

The generated DTS can be larger than PTS, since it only reorder the
input PTS and minus the number of frame delay, which doesn't take
timebase into account. It should minus the "time" of frame delay.

9a245bd trying to fix the issue, but the implementation is incomplete,
which only use time_base.num. Then it got reverted by ac7c265b33.

After this patch:

pts 0    dts -120
pts 160  dts -80
pts 80   dts -40
pts 40   dts 0
pts 120  dts 40
pts 320  dts 80
pts 240  dts 120
pts 200  dts 160
pts 280  dts 200

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-08-02 17:57:19 +02:00
Roman Arzumanyan
bcea693f75 avcodec/cuviddec: more accurately guess probed sw pixel format
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-08-02 17:38:46 +02:00
Gnattu OC
d50f9701b6 avutil/hwcontext_videotoolbox: Correctly set trc
The color trc key was assigned a color primaries value which causes
the resulting colorspace is always SDR.

Fixes #10884.

Signed-off-by: Gnattu OC <gnattuoc@me.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-02 10:24:09 +08:00
Rémi Denis-Courmont
1b2a925e94 lavc/riscv: drop probing for F & D extensions
F and D extensions are included in all RISC-V application profiles ever
made (so starting from RV64GC a.k.a. RVA20). Realistically they need to be
selected at compilation time.

Currently, there are no consumers for these two flags. If there is ever a
need to reintroduce F- or D-specific optimisations, we can always use
__riscv_f or __riscv_d compiler predefined macros respectively.
2024-08-01 22:56:50 +03:00
Rémi Denis-Courmont
2f083fd581 lavc/audiodsp: drop R-V F vector_clipf
This is now firmly slower than C.

SiFive-U74 (cycles):
audiodsp.vector_clipf_c:   31.2
audiodsp.vector_clipf_rvf: 39.5
2024-08-01 19:29:40 +03:00
Rémi Denis-Courmont
c48213b2dc lavc/audiodsp: drop opposite sign optimisation
This was added along side the original SSE(one) DSP function in
0a68cd876e without rationale. This was
presumably faster on x87, which is no longer relevant since we pretty
much assume SSE2 or later on x86.

Meanwhile this function is ~2.5x slower than the normal floating point
one on SiFive-U74.
2024-08-01 19:29:40 +03:00
Rémi Denis-Courmont
d86b6767ce lavc/audiodsp: properly unroll vector_clipf
Given that source and destination can alias, the compiler was forced to
perform each read-modify-write sequentially. We cannot use the `restrict`
qualifier to avoid this here because the AC-3 encoder uses the function
in-place. Instead this commit provides an explicit guarantee to the
compiler that batches of 8 elements will not overlap, so that it can
interleave calculations.

In practice contemporary optimising compilers are able to unroll and keep
the temporary array in FPU registers (without spilling).

On SiFive-U74, this speeds the same signs branch by 4x, and the
opposite signs branch 1.5x.
2024-08-01 19:29:40 +03:00
Rémi Denis-Courmont
d527d23872 lavc/pixblockdsp: specialise aligned 16-bit get_pixels
The current code assumes that we have unaligned rows, which hurts on
platforms with slower unaligned accesses. (Also, this lets the compiler
unroll manually, which it seems to do in practice.)
2024-08-01 18:44:01 +03:00
Rémi Denis-Courmont
656a9664bf checkasm/riscv: preserve T1 whilst calling...
This preserves T1 whilst calling the instrumented function. In a Sci-Fi
setting where type-based Control Flow Integrity (CFI) is supported, the
calling code (i.e., the `checkasm` test case) will set T1 to the expected
value of the landing pad label (LPL) of the instrumented function.

The call wrapper will always use LPL zero which is a wild card. We should
preserve the value of T1 at least until the indirect call to the
instrumented function. Of course this is Sci-Fi, because:
1) there is no hardware (or even QEMU) support yet,
2) all our assembler functions currently use LPL zero anyway.

This uses T3 rather than T2 because indirect branches with T2 is reserved
for notionally direct calls made with an indirect call instruction (e.g.
due to GOT indirection), and are exempted from forward-edge CFI checks.
2024-08-01 18:44:01 +03:00
Rémi Denis-Courmont
54b1970c60 lavu/riscv: fix return type 2024-08-01 18:44:01 +03:00
Rémi Denis-Courmont
54ae270213 lavc/rv34dsp: use saturating add/sub for R-V V DC add
T-Head C908 (cycles):
rv34_idct_dc_add_c:      113.2
rv34_idct_dc_add_rvv_i32: 48.5 (before)
rv34_idct_dc_add_rvv_i32: 39.5 (after)
2024-08-01 18:43:04 +03:00
Rémi Denis-Courmont
952b426f3b lavc/bswapdsp: add RV Zvbb bswap16 and bswap32 2024-08-01 18:43:04 +03:00
James Almer
f4daf633b2 avcodec/aacps_tablegen_template: don't redefine CONFIG_HARDCODED_TABLES
Fixes relevant warnings when compiling with --enable-hardcoded-tables

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-01 12:13:53 -03:00
James Almer
6f8e365a2a avutil/hwcontext_vaapi: use the correct type for VASurfaceAttribExternalBuffers.buffers
Should fix ticket #11115.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-01 12:13:53 -03:00
Marvin Scholz
ca7fcf5089 avutil/hwcontext_videotoolbox: Fix build with older SDKs
The previous fix was not sufficient.
To make things easier to reason about, split the function and
add the guards there instead of complicating the call site more.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-08-01 20:58:27 +08:00
Anton Khirnov
bcf08c1171 lavc/ffv1: change FFV1SliceContext.plane into a RefStruct object
Frame threading in the FFV1 decoder works in a very unusual way - the
state that needs to be propagated from the previous frame is not decoded
pixels(¹), but each slice's entropy coder state after decoding the slice.

For that purpose, the decoder's update_thread_context() callback stores
a pointer to the previous frame thread's private data. Then, when
decoding each slice, the frame thread uses the standard progress
mechanism to wait for the corresponding slice in the previous frame to
be completed, then copies the entropy coder state from the
previously-stored pointer.

This approach is highly dubious, as update_thread_context() should be
the only point where frame-thread contexts come into direct contact.
There are no guarantees that the stored pointer will be valid at all, or
will contain any particular data after update_thread_context() finishes.

More specifically, this code can break due to the fact that keyframes
reset entropy coder state and thus do not need to wait for the previous
frame. As an example, consider a decoder process with 2 frame threads -
thread 0 with its context 0, and thread 1 with context 1 - decoding a
previous frame P, current frame F, followed by a keyframe K. Then
consider concurrent execution consistent with the following sequence of
events:
* thread 0 starts decoding P
* thread 0 reads P's slice header, then calls
  ff_thread_finish_setup() allowing next frame thread to start
* main thread calls update_thread_context() to transfer state from
  context 0 to context 1; context 1 stores a pointer to context 0's private
  data
* thread 1 starts decoding F
* thread 1 reads F's slice header, then calls
  ff_thread_finish_setup() allowing the next frame thread to start
  decoding
* thread 0 finishes decoding P
* thread 0 starts decoding K; since K is a keyframe, it does not
  wait for F and reallocates the arrays holding entropy coder state
* thread 0 finishes decoding K
* thread 1 reads entropy coder state from its stored pointer to context
  0, however it finds state from K rather than from P

This execution is currently prevented by special-casing FFV1 in the
generic frame threading code, however that is supremely ugly. It also
involves unnecessary copies of the state arrays, when in fact they can
only be used by one thread at a time.

This commit addresses these deficiencies by changing the array of
PlaneContext (each of which contains the allocated state arrays)
embedded in FFV1SliceContext into a RefStruct object. This object can
then be propagated across frame threads in standard manner. Since the
code structure guarantees only one thread accesses it at a time, no
copies are necessary. It is also re-created for keyframes, solving the
above issue cleanly.

Special-casing of FFV1 in the generic frame threading code will be
removed in a later commit.

(¹) except in the case of a damaged slice, when previous frame's pixels
    are used directly
2024-08-01 10:09:26 +02:00
Anton Khirnov
c335218a81 lavc/ffv1dec: inline copy_fields() into update_thread_context()
It is now only called from a single place, so there is no point in it
being a separate function.
2024-08-01 10:09:26 +02:00
Anton Khirnov
d44812f7cf lavc/ffv1dec: stop using per-slice FFV1Context
All remaining accesses to them are for fields that have the same value
in the main encoder context.

Drop now-unused FFV1Context.slice_contexts.
2024-08-01 10:09:26 +02:00
Anton Khirnov
2b21cdff6e lavc/ffv1dec: move slice_damaged to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov
f2aeba56c4 lavc/ffv1dec: move slice_reset_contexts to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov
84dda32202 lavc/ffv1enc: stop using per-slice FFV1Context
All remaining accesses to them are for fields that have the same value
in the main encoder context.
2024-08-01 10:09:26 +02:00
Anton Khirnov
96e8af6c4d lavc/ffv1: move ac_byte_count to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov
e7d0f44138 lavc/ffv1enc: store per-slice rc_stat(2?) in FFV1SliceContext
Instead of the per-slice FFV1Context, which will be removed in future
commits.
2024-08-01 10:09:26 +02:00
Anton Khirnov
7b2bfba55d lavc/ffv1: move RangeCoder to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov
28769f6bc1 lavc/ffv1: move FFV1Context.plane to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov
9b86ba5a92 lavc/ffv1: always use the main context values of ac
It cannot change between slices.
2024-08-01 10:09:26 +02:00
Anton Khirnov
a57c88d67b lavc/ffv1: move FFV1Context.slice_{coding_mode,rct_.y_coef} to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov
39486a2b29 lavc/ffv1: always use the main context values of plane_count/transparency
They cannot change between slices.
2024-08-01 10:09:26 +02:00
Anton Khirnov
492df65201 lavc/ffv1: drop write-only PlaneContext.interlace_bit_state 2024-08-01 10:09:26 +02:00
Anton Khirnov
a411fc5a84 lavc/ffv1: drop redundant PlaneContext.quant_table
It is a copy of FFV1Context.quant_tables[quant_table_index].
2024-08-01 10:09:26 +02:00
Anton Khirnov
4b9f7c7e3a lavc/ffv1: drop redundant FFV1Context.quant_table
In all cases except decoding version 1 it's either not used, or contains
a copy of a table from quant_tables, which we can just as well use
directly.

When decoding version 1, we can just as well decode into
quant_tables[0], which would otherwise be unused.
2024-08-01 10:09:26 +02:00
Anton Khirnov
d2f507233a lavc/ffv1enc: move bit writer to per-slice context 2024-08-01 10:09:26 +02:00
Anton Khirnov
889faedd26 lavc/ffv1dec: move the bitreader to stack
There is no reason to place it in persistent state.
2024-08-01 10:09:25 +02:00
Anton Khirnov
19e9f3d5f2 lavc/ffv1: move run_index to the per-slice context 2024-08-01 10:09:25 +02:00
Anton Khirnov
91d3c1ac47 lavc/ffv1: move sample_buffer to the per-slice context 2024-08-01 10:09:25 +02:00
Anton Khirnov
54aa33f116 lavc/ffv1: add a per-slice context
FFV1 decoder and encoder currently use the same struct - FFV1Context -
both as codec private data and per-slice context. For this purpose
FFV1Context contains an array of pointers to per-slice FFV1Context
instances.

This pattern is highly confusing, as it is not clear which fields are
per-slice and which per-codec.

Address this by adding a new struct storing only per-slice data. Start
by moving slice_{x,y,width,height} to it.
2024-08-01 10:09:25 +02:00
Anton Khirnov
d845ea49c5 lavc/ffv1dec: move copy_fields() under HAVE_THREADS
It is unused otherwise
2024-08-01 10:09:25 +02:00
Anton Khirnov
3a5c814b19 lavc/ffv1dec: drop a pointless variable in decode_slice()
fsdst is by construction always equal to fs, there is even an
av_assert1() checking that. Just use fs directly.
2024-08-01 10:09:25 +02:00
Anton Khirnov
4da146ba83 lavc/ffv1dec: drop FFV1Context.cur
It is merely a pointer to FFV1Context.picture.f, which can just as well
be used directly.
2024-08-01 10:09:25 +02:00
Anton Khirnov
e1fa107fd1 lavc/ffv1dec: simplify slice index calculation 2024-08-01 10:09:25 +02:00
Anton Khirnov
d776fa4e4d lavc/ffv1dec: declare loop variables in the loop where possible 2024-08-01 10:09:25 +02:00
Anton Khirnov
8e19c24634 tests/fate/vcodec: add vsynth tests for FFV1 version 2 2024-08-01 10:09:25 +02:00
Michael Niedermayer
06f5ed40f8 avcodec/snow: Fix off by 1 error in run_buffer
Fixes: out of array access
Fixes: 70741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5703668010647552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-01 00:18:02 +02:00
Michael Niedermayer
58fbeb59e7 avcodec/utils: apply the same alignment to YUV410 as we do to YUV420 for snow
The snow encoder uses block based motion estimation which can read out of array if
insufficient alignment is used

It may be better to only apply this for the encoder, as it would safe a few bytes of memory
for the decoder. Until then, this fixes the issue in a simple way.

Fixes: out of array access
Fixes: 68963/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-4979988435632128
Fixes: 68969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6239933667803136.fuzz
Fixed: 70497/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5751882631413760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-01 00:18:02 +02:00
Michael Niedermayer
ed96ac87a9 avformat/iamf_parse: Check for 0 samples
Fixes: division by zero
Fixes: 70561/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6199435013455872
Fixes: 70565/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5783790316748800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-01 00:18:02 +02:00
Nathan E. Egge
8280ec7a32 lavu/riscv: Revert d808070, removing AV_READ_TIME
The implementation of ff_read_time() for RISC-V uses rdtime which has
 precision on existing hardware too low (!) for benchmarking purposes.
Deleting this implementation falls back on clock_gettime() which was
 added as the default ff_read_time() implementation in 33e4cc9.
Below are metrics gathered on SpacemiT K1, before and after this commit:

Before:

$ tests/checkasm/checkasm --bench
benchmarking with native FFmpeg timers
nop: 0.0
checkasm: using random seed 3473665261
checkasm: bench runs 1024 (1 << 10)
RVI:
 - pixblockdsp.get_pixels                [OK]
 - vc1dsp.mspel_pixels                   [OK]
RVF:
 - audiodsp.audiodsp                     [OK]
checkasm: all 4 tests passed
audiodsp.vector_clipf_c: 1388.7
audiodsp.vector_clipf_rvf: 261.5
get_pixels_c: 2.0
get_pixels_rvi: 1.5
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_c: 8.0
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_rvi: 1.0
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_c: 2.0
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_rvi: 0.5

After:

$ tests/checkasm/checkasm --bench
benchmarking with native FFmpeg timers
nop: 56.4
checkasm: using random seed 1021411603
checkasm: bench runs 1024 (1 << 10)
RVI:
 - pixblockdsp.get_pixels                [OK]
 - vc1dsp.mspel_pixels                   [OK]
RVF:
 - audiodsp.audiodsp                     [OK]
checkasm: all 4 tests passed
audiodsp.vector_clipf_c: 23236.4
audiodsp.vector_clipf_rvf: 11038.4
get_pixels_c: 79.6
get_pixels_rvi: 48.4
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_c: 329.6
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_rvi: 38.1
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_c: 89.9
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_rvi: 17.1

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-07-31 17:48:50 +03:00
James Almer
ab5c612137 avcodec/Makefile: use the correct path for aacdec_fixed.o when setting its dependencies
Fixes ticket #11112

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-31 11:32:56 -03:00
Anton Khirnov
43f702a253 lavfi/framesync: avoid forcing frame writability unnecessarily
Callers of ff_framesync_get_frame() generally do not expect the result
to be writable, those that do (e.g. ff_framesync_dualinput_get_writable())
ensure writability themselves.

Significantly reduces memory consumption in complex graphs with
framesync-based filters (e.g. scale, ssim).

Reported-By: Mark Shwartzman
2024-07-31 11:12:45 +02:00
Rémi Denis-Courmont
262168b04e lavc/videodsp: RISC-V zicbop prefetch
There are currently no ways to run-time detect the CPU capability, so we
take it for granted (in the worst case, it will execute NOPs).
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont
4570b9f3c4 configure: check if assembler supports RV zicbop
zicbop is the Cache Block Operation, Prefetch extension to RVI.
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont
324eba69f7 lavc/vc1dsp: use saturating arithmetic for RVV inv_trans_dc
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_4x4_dc_c:      113.7
vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 46.5 (before)
vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 45.5 (after)
vc1dsp.vc1_inv_trans_4x8_dc_c:      230.7
vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 65.7 (before)
vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 52.5 (after)
vc1dsp.vc1_inv_trans_8x4_dc_c:      246.7
vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 56.7 (before)
vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 45.5 (after)
vc1dsp.vc1_inv_trans_8x8_dc_c:      419.7
vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 81.2 (before)
vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 53.5 (after)
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont
784a72a116 lavc/vc1dsp: unify R-V V DC bypass functions 2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont
bd0c3edb13 lavu/riscv: count bytes rather than words for bswap32
This removes the dependency on Zba at essentially zero cost.
2024-07-30 18:41:51 +03:00
Rémi Denis-Courmont
5171baa228 lavc/ac3dsp: fix R-V CPU requirements
It probably will not matter on any real hardware, but the Zbb optimisations
do not require Zba. And then, we need HAVE_RVV to build the RVV stuff.
2024-07-30 18:41:51 +03:00
Peter Ross
0e09f6d690 avcodec/adpcm: only process right samples when decoding stereo
Fixes Coverity issue #1610760.
2024-07-30 19:55:31 +10:00
Leo Izen
7bb5626fa7 avcodec/pngenc: fix sBIT writing for indexed-color PNGs
We currently write invalid sBIT entries for indexed PNGs, which by PNG
specification[1] must be 3-bytes long. The values also are capped at 8
for indexed-color PNGs, not the palette depth. This patch fixes both of
these issues previously fixed in the decoder, but not the encoder.

[1]: https://www.w3.org/TR/png-3/#11sBIT

Regression since: c125860892.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla: <ramiro.polla@gmail.com>
2024-07-30 05:43:36 -04:00
Leo Izen
825606641b avcodec/pngdec: use 8-bit sBIT cap for indexed PNGs per spec
The PNG specification[1] says that sBIT entries must be at most the bit
depth specified in IHDR, unless the PNG is indexed-color, in which case
sBIT must be between 1 and 8. We should not reject valid sBITs on PNGs
with indexed color.

[1]: https://www.w3.org/TR/png-3/#11sBIT

Regression since 84b454935f.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-07-30 05:43:31 -04:00
Marth64
e2105b2800 avcodec/aacenc: Correct option description for aac_coder fast
The description advertises fast as "Default fast search", but
this has not been the default for a long time (current default
is twoloop).

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-30 05:42:50 -04:00
Fei Wang
79b4869959 lavu/hwcontext_qsv: Derive bind flag from frame type if no valid surface
Fix cmd:
ffmpeg.exe -init_hw_device d3d11va=d3d -init_hw_device qsv=qsv@d3d \
-filter_hw_device d3d -hwaccel qsv -hwaccel_output_format qsv      \
-i in.h264 -vf "hwmap,format=d3d11,hwdownload,format=nv12" -y out.yuv

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Tested-by: Tong Wu <wutong1208@outlook.com>
2024-07-30 13:41:15 +08:00
Fei Wang
d30a9fdc80 lavc/qsvdec: Add VVC decoder
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-30 13:40:21 +08:00
Fei Wang
cf9c398fc1 configure: Alphabetical order for av1 codecs
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-30 13:32:44 +08:00
James Almer
9e7a93c6fd x86/intreadwrite: add SSE2 optimized AV_COPY128U
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 23:17:52 -03:00
James Almer
92b317245c avformat/mov: use AV_WL*A
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
James Almer
f1fcc3ca5f avformat/matroskadec: use AV_WL32A
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
James Almer
09de979ff6 avcodec/amfenc_av1: use AV_WL32A
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
James Almer
753f2aeed7 avutil/intreadwrite: add missing aligned read/write macros
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 21:33:31 -03:00
Rémi Denis-Courmont
7b24f96c87 lavc/vp9dsp: remove R-V I intra functions
At this point, they are identical to the C code, except for instruction
ordering. In fact, they are typically slower or no faster than the C code.
2024-07-29 21:16:41 +03:00
Rémi Denis-Courmont
7aa6510fe1 lavc/vp9dsp: copy 8 pixels at once
In the 8-bit case, we can actually read/write 8 aligned pixel values per
load/store, which unsurprisingly tends to be faster on 64-bit systems (and
makes no differences on 32-bit systems). This requires ifdef'ing though.
2024-07-29 21:16:41 +03:00
Rémi Denis-Courmont
c98127c00e lavc/vp9dsp: use restrict qualifier for copy/avg MC
Same as previous commit.
2024-07-29 21:16:41 +03:00
Rémi Denis-Courmont
56fc5fc6ce lavc/vp9dsp: restrict vertical intra pointers
This lets the compiler unroll ever so slightly better (at least in the
16x16 case for RISC-V GCC).
2024-07-29 21:16:41 +03:00
James Almer
afb06aef7e avcodec/decode: remove unused argument from ff_frame_new_side_data_from_buf()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-29 14:00:48 -03:00
James Almer
e7d3ff8dcd avformat/mov: check that child boxes of trak are only present inside it
Based on the check done for the stco box.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-28 17:28:19 -03:00
James Almer
2aa63784b5 avformat/mov: check that sample and chunk count is 1 for HEIF
Fixes NULL pointer dereference in broken/fuzzed streams.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-28 17:28:19 -03:00
Rémi Denis-Courmont
39ced529b0 lavu/riscv: implement floating point clips
Unlike x86, fmin/fmax are single instructions, not function calls. They
are much much faster than doing a comparison, then branching based on its
results. With this, audiodsp.vector_clipf gets almost twice as fast, and
a properly unrollled version of it gets 4-5x faster, on SiFive-U74.
This is only the low-hanging fruit: FFMIN and FFMAX are presumably
affected as well.

This likely applies to other instruction sets with native IEEE floats,
especially those lacking a conditional select instruction.
2024-07-28 21:24:58 +03:00
Rémi Denis-Courmont
b0b3bea10b lavc/h264dsp: use saturing add/sub for R-V V 8-bit DC add
T-Head C908 (cycles):
h264_idct4_dc_add_8bpp_c:      109.2
h264_idct4_dc_add_8bpp_rvv_i32: 34.5 (before)
h264_idct4_dc_add_8bpp_rvv_i32: 25.5 (after)
h264_idct8_dc_add_8bpp_c:      418.7
h264_idct8_dc_add_8bpp_rvv_i64: 69.5 (before)
h264_idct8_dc_add_8bpp_rvv_i64: 33.5 (after)
2024-07-28 21:24:12 +03:00
Shiyou Yin
4713a5cc24 swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure.
Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-28 19:02:16 +02:00
Michael Niedermayer
3b9c6c7fbb avcodec/adpcm: Remove setting min_channel to value it is already set to
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-28 19:02:15 +02:00
Tong Wu
b1d410716b lavc/d3d12va_encode: trim header alignment at output
It is d3d12va's requirement that the FrameStartOffset must be aligned as
per hardware limitation. However, we could trim this alignment at output
to reduce coded size. A aligned_header_size is added to
D3D12VAEncodePicture.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-07-28 17:50:30 +02:00
Rémi Denis-Courmont
9b4655c3a1 lavc/vp8dsp: use saturating add/sub for R-V V DC add
T-Head C908 (cycles):
vp7_idct_dc_add_c:          108.5
vp7_idct_dc_add_rvv_i32:     56.2 (before)
vp7_idct_dc_add_rvv_i32:     47.2 (after)
vp8_idct_dc_add_c:           96.2
vp8_idct_dc_add_rvv_i32:     43.0 (before)
vp8_idct_dc_add_rvv_i32:     34.0 (after)
2024-07-28 17:37:21 +03:00
Rémi Denis-Courmont
bbfc0ac9ca lavc/riscv: don't set vxrm if unnecessary
While narrowing clip is nominally a rounding operation, the rounding mode
has no arithmetic consequence if the right shift is by zero bits.
2024-07-28 17:37:21 +03:00
Niklas Haas
e42a0763b7 avcodec/dovi_rpudec: clarify semantics
ff_dovi_rpu_parse() and ff_dovi_rpu_generate() are a bit inconsistent in
that they expect different levels of encapsulation, due to the nature of
how this is handled in the context of different APIs. Clarify the status
quo. (And fix an incorrect reference to the RPU payload bytes as 'RBSP')
2024-07-28 12:20:07 +02:00
Niklas Haas
6b66df74b8 avcodec/dovi_rpu: correctly copy num_ext_blocks 2024-07-28 12:20:07 +02:00
Niklas Haas
b5aeafc00a fftools/ffprobe: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas
3d5d60d041 avformat/dump: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas
ce8166a19c avformat/mpegts: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas
b3a9fab9da avformat/dovi_isom: implement dv_md_compression 2024-07-28 12:20:07 +02:00
Niklas Haas
cbea92c84d avutil/dovi_meta: add dv_md_compression to cfg record
This field is used to signal the compression method in use.
2024-07-28 12:20:07 +02:00
Zhao Zhili
719e46f54c avcodec/videotoolboxenc: Fix variable type of AV_OPT_TYPE_BOOL
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-26 19:54:56 +08:00
Zhao Zhili
f4e0f40230 avcodec/videotoolboxenc: Set default bitrate to zero
Zero is auto mode. From the doc of videotoolbox:

   The default bit rate is zero, which indicates that the video
   encoder should determine the size of compressed data.

Before the patch, the default bitrate is 200000 setting by
avcodec/options_table, which doesn't work for most of cases.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-26 19:54:20 +08:00
Zhao Zhili
d07da7539d avcodec/videotoolboxenc: Fix bitrate doesn't work as expected
Commit 4ef5e7d472 add qmin/qmax support to videotoolbox encoder.
The default value of (qmin, qmax) is (2, 31), which makes bitrate
control doesn't work as users' expectations.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-26 19:54:20 +08:00
Rémi Denis-Courmont
8030876d1c checkasm/riscv: align the landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
7dde8be29f checkasm/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
4f2472909e sws/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
b5c111272b lavfi/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
f2c30fe15a lavc/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
a14d21a446 lavu/riscv: add forward-edge CFI landing pads 2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
6319601343 lavu/riscv: assembly for zicfilp LPAD
This instruction, if aligned on a 4-byte boundary, defines a valid target
("landing pad") for an indirect call or jump. Since this instruction is a
HINT, it is safe to assemble even if not included in the target
instruction set architecture.

The necessary alignment is already provided by the `func` macro. However
this still lacks the ELF attribute to indicate that the zicfilp is supported
in simple mode. This is left for future work as the ELF specification is not
ratified as of yet.

This will also nonobviously require the assembler to support zicfilp,
insofar as the `tail` pseudo-instruction shall clobber T2 (instead of T1) as
its temporary register.
2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
982376660c lavu/riscv: align functions to 4 bytes
Currently the start of the byte range for each function is aligned to
4 bytes. But this can lead to situations whence the function is preceded
by a 2-byte C.NOP at the aligned 4-byte boundary. Then the first actual
instruction and the function symbol are only aligned on 2 bytes.

This forcefully disables compression for the alignment and the symbol,
thus ensuring that there is no padding before the function.
2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
b62586e310 lavc/h264dsp: use RISC-V B extension
This saves one register and one instruction per transform.
add16 and add16intra thus become stack-less.
2024-07-25 23:10:01 +03:00
Rémi Denis-Courmont
45d7078a21 lavu/riscv: add CPU flag for B bit manipulations
The B extension was finally ratified in May 2024, encompassing:
- Zba (addresses),
- Zbb (basics) and
- Zbs (single bits).
It does not include Zbc (base-2 polynomials).
2024-07-25 23:09:58 +03:00
Rémi Denis-Courmont
529d423012 lavu/riscv: remove bespoke SH{1,2,3}ADD assembler
configure checks that the assembler supports the B extension (or rather
its constituents) anyway. These macros were dodging sanity checks for
unsupported instructions and nothing else.
2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont
5f10173fa1 lavu/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont
e91a8cc4de sws/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont
9108f3e5e1 lavfi/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont
187d4d066a lavc/riscv: require B or zba explicitly 2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont
7f97344bfb lavu/riscv: grok B as an extension
The RISC-V B bit manipulation extension was ratified only two months ago.
But it is strictly equivalent to the union of the zba, zbb and zbs
extensions which were defined almost 3 years earlier. Rather than require
new assembler, we can just match the extension name manually and translate
it into its constituent parts.
2024-07-25 18:55:48 +03:00
Rémi Denis-Courmont
1e7ab200ee lavu/riscv: allow any number of extensions
This reworks the func/endfunc macros to support any number of ISA extension
as parameters.
2024-07-25 18:55:48 +03:00
Araz Iusubov
2128c17739 avcodec/amf_enc: av1 cropping support
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-25 10:22:02 -03:00
Rémi Denis-Courmont
896c22ef00 lavc/vp8dsp: fix RV32 stack alignment
SP must be a multiple of 16 bytes at all times on POSIX - even in leaf
functions - so that signal handlers have a properly aligned stack.
2024-07-24 22:08:54 +03:00
Jens Frederich
60b1750134 avdevice/dshow: Don't skip audio devices if no video device is present
The search of the current DirectShow device list has been customized so
that audio devices are always found even if no video device is connected.

Signed-off-by: Jens Frederich <jens.frederich@vector.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-24 14:45:20 +02:00
Martin Storsjö
97a708a507 checkasm: Increase the tolerance for ac3_sum_square_butterfly_float
Increase the tolerance from 10 ulp to 11 ulp. This fixes occasional
errors for some inputs; the errors could be reproduced on
aarch64/neon builds, with "checkasm --test=ac3dsp 3446175925".

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-24 12:10:33 +03:00
Anton Khirnov
d1fa39d08d fftools/ffmpeg: prefer real errors over EOF in err_merge()
Fixes an issue in 6.1 when reading a corrupted file with -xerror would
exit with success. This specific issue is not present in master, but
this should generally be a more robust behaviour.

Reported-by: Andrej Peterka
2024-07-24 08:20:21 +02:00
Lynne
b1b69ccbc0 aacdec: set ac->output_elements upon channel element free
The issue is that ac->output_elements is populated from
ac->che, which may be freed, leaving dangling pointers in this
list.

Should fix clusterfuzz.
2024-07-24 00:32:38 +02:00
Michael Niedermayer
204f7f8cc7 avcodec/hdrenc: Allocate more space
This needs to be double checked or a checking way of writing should be used

Fixes: out of array access
Fixes: 70007/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HDR_fuzzer-5478704150020096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:17 +02:00
Michael Niedermayer
5dde255abd avcodec/cfhdenc: Height of 16 is not supported
Fixes: out of array access
Fixes: 68941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5990952685600768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:17 +02:00
Michael Niedermayer
a308d79e4d avcodec/cfhdenc: Allocate more space
Fixes: Assertion failure
Fixes: 68979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5375874714107904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:16 +02:00
Michael Niedermayer
6420c1bf30 avcodec/osq: fix integer overflow when applying factor
Fixes: signed integer overflow: -35511773 * 256 cannot be represented in type 'int'
Fixes: 70406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6545326804434944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:16 +02:00
Michael Niedermayer
56c334d732 avcodec/osq: avoid using too large numbers for shifts and integers in update_residue_parameter()
Fixes: 2.96539e+09 is outside the range of representable values of type 'int'
Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:423
Fixes: 62241/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-4525761925873664
Fixes: 70406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6545326804434944

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:16 +02:00
Michael Niedermayer
3cd077e282 avcodec/vaapi_encode: Check hwctx
Fixes: null pointer dereference
Fixes: 70376/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_VAAPI_fuzzer-4733551250046976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:15 +02:00
Michael Niedermayer
2f7aaa33e7 avcodec/aac/aacdec_lpd: Check kv indec
Fixes: index 9 out of bounds for type 'uint32_t [8][8]'
Fixes: 70363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6723855293415424.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:15 +02:00
Michael Niedermayer
ae20be8b5d avcodec/aac/aacdec_usac: Dont leave invalid max_sfb in the context
Fixes: out of array read
Fixes: 70363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6723855293415424.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:15 +02:00
Michael Niedermayer
d52fabaec0 avcodec/hevc/hevcdec: avoid signed shifts with lt_idx_sps
Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 70122/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5172200613675008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:14 +02:00
Michael Niedermayer
419eee6356 avcodec/proresdec: Consider negative bits left
Fixes: 70036/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-6298797647396864
Fixes: shift exponent 40 is too large for 32-bit type 'uint32_t' (aka 'unsigned int')

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:14 +02:00
Michael Niedermayer
6194cb87cb avcodec/alsdec: Clear shift_value
(the exact issue is unreproducable but the use of uninitialized data is reproducable)

Should fix: signed integer overflow: -2147483648 - 127 cannot be represented in type 'int'
Should fix: 69881/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-4751301204836352

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:14 +02:00
Michael Niedermayer
5d9544cfb0 avcodec/hevc/hevcdec: Do not allow slices to depend on failed slices
An alternative would be to leave the context unchanged on failure of hls_slice_header()

Fixes: out of array access
Fixes: NULL pointer dereference
Fixes: 69584/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5931086299856896
Fixes: 69724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5104066422702080
Fixes: 70422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5908731129298944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:13 +02:00
Michael Niedermayer
586f6fda1d avformat/mov: add an EOF check in IPRP
Fixes: Timeout
Fixes: 69230/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6540512101203968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-23 23:21:13 +02:00
Michael Niedermayer
55af81b5a4 Revert "avformat/udp: Fix temporary buffer race"
This is not needed

This reverts commit 7b2f67ea77.
2024-07-23 23:21:13 +02:00
Martin Storsjö
4acb9b7d10 aarch64: vvc: Fix unnecessary extra spaces
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 16:04:28 +03:00
Martin Storsjö
99598629e8 aarch64: vvc: Consistently use # for immediate constants
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 15:24:37 +03:00
Martin Storsjö
400843151d aarch64: vvc: Fix compilation of alf.S with MSVC 2022 17.7 and older
Use the "ldur" instruction explicitly, instead of having the
assembler implicitly convert "ldr" instructions to "ldur".

This fixes build errors like these:

libavcodec\aarch64\vvc\alf.o.asm(1023) : error A2518: operand 2: Memory offset must be aligned
        ldr             q22, [x3, #24]
libavcodec\aarch64\vvc\alf.o.asm(1024) : error A2518: operand 2: Memory offset must be aligned
        ldr             q24, [x2, #24]
libavcodec\aarch64\vvc\alf.o.asm(1393) : error A2518: operand 2: Memory offset must be aligned
        ldr             q22, [x3, #24]
libavcodec\aarch64\vvc\alf.o.asm(1394) : error A2518: operand 2: Memory offset must be aligned
        ldr             q24, [x2, #24]

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 15:24:33 +03:00
aaron
53d0f9afb4 avcodec/electronicarts: decode framerate
Reviewed-by: Peter Ross <pross@xvid.org>
2024-07-23 06:40:30 +10:00
aaron
f44353cfb6 avcodec/adpcm: Mono ADPCM for EA WVE Files
Reviewed-by: Peter Ross <pross@xvid.org>
2024-07-23 06:40:30 +10:00
Rémi Denis-Courmont
0e32192548 lavu/riscv: do not fallback to AT_HWCAP auxillary vector
If __riscv_hwprobe() fails, then the kernel version is presumably too
old. There is not much point falling back to the auxillary vector.

- The Linux kernel requires I, so the flag is always set on Linux, and
  run-time detection is unnecessary. Our RISC-V assembler does anyway not
  support targets without I.

- Linux can compile with or without F and D, but it cannot perform
  run-time detection for them (a kernel with F support will not boot a
  processor without F). The run-time detection is thus useless in that
  case. Besides F and D extensions are used throughout the C code, so
  their run-time detection would not be practical.

- Support for V was added in a later kernel version than riscv_hwprobe(),
  so the system call will always be available if the kernel supports V.
  The only exception would be vendor kernel forks, but those are known to
  haphasardly pretend to support V on systems without actual V support, or
  with only pre-ratification binary-incompatible version. Furthermore, a
  large chunk of our optimisations require Zba and/or Zbb which cannot be
  detected with HWCAP in those kernels.

For what it is worth, OpenJDK already took a similar action. Note that this
keeps AT_HWCAP usage for platforms with neither C run-time <sys/hwprobe.h>
nor kernel <asm/hwprobe.h>, notably kernels other than Linux.
2024-07-22 19:43:51 +03:00
Zhao Zhili
2d4ef304c9 avcodec/vvc: Add aarch64 neon optimization for ALF
vvc_alf_filter_chroma_4x4_8_c: 3.0
vvc_alf_filter_chroma_4x4_8_neon: 1.0
vvc_alf_filter_chroma_4x4_10_c: 2.7
vvc_alf_filter_chroma_4x4_10_neon: 1.0
vvc_alf_filter_chroma_4x4_12_c: 2.7
vvc_alf_filter_chroma_4x4_12_neon: 1.0
vvc_alf_filter_chroma_8x8_8_c: 10.2
vvc_alf_filter_chroma_8x8_8_neon: 3.0
vvc_alf_filter_chroma_8x8_10_c: 10.0
vvc_alf_filter_chroma_8x8_10_neon: 2.5
vvc_alf_filter_chroma_8x8_12_c: 10.0
vvc_alf_filter_chroma_8x8_12_neon: 2.5
vvc_alf_filter_chroma_16x16_8_c: 41.7
vvc_alf_filter_chroma_16x16_8_neon: 11.2
vvc_alf_filter_chroma_16x16_10_c: 39.0
vvc_alf_filter_chroma_16x16_10_neon: 10.0
vvc_alf_filter_chroma_16x16_12_c: 40.2
vvc_alf_filter_chroma_16x16_12_neon: 10.2
vvc_alf_filter_chroma_32x32_8_c: 162.0
vvc_alf_filter_chroma_32x32_8_neon: 45.0
vvc_alf_filter_chroma_32x32_10_c: 155.5
vvc_alf_filter_chroma_32x32_10_neon: 39.5
vvc_alf_filter_chroma_32x32_12_c: 155.5
vvc_alf_filter_chroma_32x32_12_neon: 40.0
vvc_alf_filter_chroma_64x64_8_c: 646.0
vvc_alf_filter_chroma_64x64_8_neon: 175.5
vvc_alf_filter_chroma_64x64_10_c: 708.2
vvc_alf_filter_chroma_64x64_10_neon: 166.7
vvc_alf_filter_chroma_64x64_12_c: 619.2
vvc_alf_filter_chroma_64x64_12_neon: 157.2
vvc_alf_filter_chroma_128x128_8_c: 2611.5
vvc_alf_filter_chroma_128x128_8_neon: 698.2
vvc_alf_filter_chroma_128x128_10_c: 2470.0
vvc_alf_filter_chroma_128x128_10_neon: 616.0
vvc_alf_filter_chroma_128x128_12_c: 2531.5
vvc_alf_filter_chroma_128x128_12_neon: 620.2
vvc_alf_filter_luma_8x8_8_c: 25.2
vvc_alf_filter_luma_8x8_8_neon: 4.2
vvc_alf_filter_luma_8x8_10_c: 18.5
vvc_alf_filter_luma_8x8_10_neon: 4.0
vvc_alf_filter_luma_8x8_12_c: 19.0
vvc_alf_filter_luma_8x8_12_neon: 4.0
vvc_alf_filter_luma_16x16_8_c: 106.5
vvc_alf_filter_luma_16x16_8_neon: 16.2
vvc_alf_filter_luma_16x16_10_c: 75.2
vvc_alf_filter_luma_16x16_10_neon: 14.7
vvc_alf_filter_luma_16x16_12_c: 79.7
vvc_alf_filter_luma_16x16_12_neon: 14.7
vvc_alf_filter_luma_32x32_8_c: 400.5
vvc_alf_filter_luma_32x32_8_neon: 63.2
vvc_alf_filter_luma_32x32_10_c: 299.2
vvc_alf_filter_luma_32x32_10_neon: 57.7
vvc_alf_filter_luma_32x32_12_c: 299.2
vvc_alf_filter_luma_32x32_12_neon: 57.7
vvc_alf_filter_luma_64x64_8_c: 1602.5
vvc_alf_filter_luma_64x64_8_neon: 251.7
vvc_alf_filter_luma_64x64_10_c: 1197.0
vvc_alf_filter_luma_64x64_10_neon: 235.5
vvc_alf_filter_luma_64x64_12_c: 1220.2
vvc_alf_filter_luma_64x64_12_neon: 235.7
vvc_alf_filter_luma_128x128_8_c: 6570.2
vvc_alf_filter_luma_128x128_8_neon: 1007.7
vvc_alf_filter_luma_128x128_10_c: 4822.7
vvc_alf_filter_luma_128x128_10_neon: 936.2
vvc_alf_filter_luma_128x128_12_c: 4791.2
vvc_alf_filter_luma_128x128_12_neon: 938.5

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-22 21:09:56 +08:00
ha7sh17
172da370e7 doc/filters: fix outpad labels in libvmaf_cuda example 2024-07-22 13:00:04 +05:30
Rémi Denis-Courmont
9135dffd17 lavc/h264dsp: reduce spills in R-V V idct_add16 2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont
245f76ad74 lavc/h264dsp: reuse the R-V V IDCT DC add functions
This reuses the DC bypass functions from the multiple IDCT functions, to
leverage vector code.

As an added bonus, the caller functions can now rely on the callee functions
to preserve their parameters, thus cutting down on stack spills.
2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont
0a5b5bae89 lavc/h264dsp: correct VL and LMUL in idct_dc_add
T-Head C908 (cycles):
h264_idct4_dc_add_8bpp_c:        94.7
h264_idct4_dc_add_8bpp_rvv_i32:  55.0 (before)
h264_idct4_dc_add_8bpp_rvv_i32:  34.5 (after)
h264_idct4_dc_add_9bpp_c:        94.7
h264_idct4_dc_add_9bpp_rvv_i32:  43.5 (before)
h264_idct4_dc_add_9bpp_rvv_i32:  38.2 (after)
h264_idct4_dc_add_10bpp_c:       94.7
h264_idct4_dc_add_10bpp_rvv_i32: 43.5 (before)
h264_idct4_dc_add_10bpp_rvv_i32: 38.2 (after)
h264_idct4_dc_add_12bpp_c:       94.7
h264_idct4_dc_add_12bpp_rvv_i32: 43.7 (before)
h264_idct4_dc_add_12bpp_rvv_i32: 38.5 (after)
h264_idct4_dc_add_14bpp_c:       94.7
h264_idct4_dc_add_14bpp_rvv_i32: 43.7 (before)
h264_idct4_dc_add_14bpp_rvv_i32: 38.5 (after)
2024-07-21 22:39:45 +03:00
J. Dekker
c9dc2ad09b lavc/h264dsp: move R-V V idct_dc_add
No functional changes. This just moves the assembler so that it can be
referenced by other functions in h264idct_rvv.S with local jumps.

Edited-by: Rémi Denis-Courmont <remi@remlab.net>
2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont
d15169c51f lavc/h264dsp: factor some mostly identical R-V V code 2024-07-21 22:39:45 +03:00
Rémi Denis-Courmont
c4c811b3d9 checkasm/h264dsp: test TX bypass 2024-07-21 22:36:48 +03:00
Michael Niedermayer
73ca4e75eb avfilter/vf_xfade: Check ff_inlink_consume_frame() for failure
Fixes: CID1458043 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:14 +02:00
Michael Niedermayer
23851c9ee0 avutil/slicethread: Check pthread_*_init() for failure
Fixes: CID1604383 Unchecked return value
Fixes: CID1604439 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:13 +02:00
Michael Niedermayer
15540b3d28 avutil/frame: Check log2_crop_align
Fixes: CID1604586 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:13 +02:00
Michael Niedermayer
82f5b20ff5 avutil/buffer: Check ff_mutex_init() for failure
Fixes: CID1604487 Unchecked return value
Fixes: CID1604494 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:13 +02:00
Michael Niedermayer
064bcda142 avutil/avsscanf: Remove dead code
Fixes: CID1604498 Structurally dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:12 +02:00
Michael Niedermayer
696685df0c avformat/xmv: Check this_packet_size
Fixes: CID1604489 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:12 +02:00
Michael Niedermayer
7734c583f7 avformat/webpenc: Check filesize in trailer
not sure this is possible

Fixes: CID1604446 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:12 +02:00
Michael Niedermayer
be30913538 avformat/ty: rec_size seems to only need 32bit
May help CID1604560 Overflowed integer argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:11 +02:00
Michael Niedermayer
41745e550a avformat/tty: Check avio_size()
Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:11 +02:00
Michael Niedermayer
124a97dd8b avformat/siff: Basic pkt_size check
Fixes: half of CID1258461 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:11 +02:00
Michael Niedermayer
759aae590c avformat/sauce: Check avio_size() for failure
Fixes: CID1604592 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:10 +02:00
Michael Niedermayer
3e305a0e70 avformat/sapdec: Check ffurl_get_file_handle() for error
Fixes: CID1604506 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:51 +02:00
Michael Niedermayer
e83e246504 avformat/nsvdec: Check asize for PCM
Fixes: CID1604527 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:43 +02:00
Michael Niedermayer
cea4dbc903 avformat/mp3dec: Check header_filesize
Fixes: CID1608714 Division or modulo by float zero

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:41 +02:00
Michael Niedermayer
bb936a1a72 avformat/mp3dec; Check for avio_size() failure
Fixes: CID1608710 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:37 +02:00
Michael Niedermayer
046d069552 avformat/mov: Use 64bit for str_size
We assign a 64bit variable to it before checking

Fixes: CID1604544 Overflowed integer argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:35 +02:00
Michael Niedermayer
139bf41246 avformat/mm: Check length
Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:32 +02:00
Michael Niedermayer
291356f58b avformat/hnm: Check *chunk_size
Fixes: CID1604419 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:23 +02:00
Michael Niedermayer
7e577165c1 avformat/hlsenc: Check ret
Fixes: CID1609624 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:41:11 +02:00
Michael Niedermayer
bf61f811e7 avformat/bintext: Check avio_size() return
Fixes: CID1604503 Overflowed constant
Fixes: CID1604566 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:40:49 +02:00
Michael Niedermayer
891bc070f0 avformat/asfdec_o: Check size of index object
We subtract 24 so it must be at least 24

Fixes: CID1604482 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:40:48 +02:00
Michael Niedermayer
2a8fb3c2cc avfilter/vf_scale: Check ff_scale_adjust_dimensions() for failure
Helps: CID1513722 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:31 +02:00
Michael Niedermayer
ad9df8bcfe avfilter/scale_eval: Use 64bit, check values in ff_scale_adjust_dimensions()
Found by reviewing CID1513722 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:30 +02:00
Michael Niedermayer
6db4e326c2 avfilter/vf_neighbor_opencl: Use AV_PIX_MAX_PLANES
Fix/Robustness/whatever: CID1439575 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:29 +02:00
Michael Niedermayer
ace2e25720 avfilter/vf_lut3d: Check av_scanf()
Fixes: CID1604398 Unchecked return value
Fixes: CID1604542 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:28 +02:00
Michael Niedermayer
64aa233a88 avfilter/vf_fftfilt: Remove dead depth code
Fixes: CID1509373 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:27 +02:00
Michael Niedermayer
2af95b9214 avfilter/vf_elbg: Use unsigned for shifting into the top bit
Fixes: part of CID1355110 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:25 +02:00
Michael Niedermayer
05e21b8902 avfilter/vf_premultiply: Use AV_PIX_MAX_PLANES
Helps: CID1435164 Out-of-bounds read
Helps: CID1435165 Out-of-bounds read
Helps: CID1435167 Out-of-bounds read
Helps: CID1435169 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:57:43 +02:00
Michael Niedermayer
9385847af4 avfilter/vf_deshake_opencl: Ensure that the first iteration initializes the best variables
Fixes: CID1452759 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:52:09 +02:00
Michael Niedermayer
c37dc63c7d avfilter/vf_deshake_opencl: Use AV_VIDEO_MAX_PLANES
Fixes: CID1452758 Out-of-bounds read (actual out of bounds access depends on a frame with more than 3 planes)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:52:08 +02:00
Michael Niedermayer
9b9e02f2ff avformat/iamf_parse: Check for negative sample sizes
Fixes: index -2 out of bounds for type 'const enum AVCodecID [3]'
Fixes: 69866/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4971166119821312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:35:08 +02:00
Michael Niedermayer
bcab9789ef swscale/output: Fix integer overflows in yuv2rgba64_X_c_template
Fixes: signed integer overflow: -1082982400 + -1068681048 cannot be represented in type 'int'
Fixes: 69995/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6285740271534080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:35:08 +02:00
Michael Niedermayer
d8d288479d avformat/mxfdec: Reorder elements of expression in bisect loop
Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long'
Fixes: 68578/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6032171648221184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:25 +02:00
Michael Niedermayer
d5ca373d7e avutil/timecode: Use a 64bit framenum internally
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 68550/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6424065930756096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:25 +02:00
Mark Thompson
7110a36ba0 cbs_av1: Reject thirty-two zero bits in uvlc code
The spec allows at least thirty-two zero bits followed by a one to mean
2^32-1, with no constraint on the number of zeroes.  The libaom
reference decoder does not match this, instead reading thirty-two zeroes
but not the following one to mean 2^32-1.  These two interpretations are
incompatible and other implementations may follow one or the other.
Therefore reject thirty-two zeroes because the intended behaviour is not
clear.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:25 +02:00
Michael Niedermayer
3faadbe2a2 avcodec/pnmdec: Use 64bit for input size check
Fixes: out of array read
Fixes: poc3

Reported-by: VulDB CNA Team
Found-by: CookedMelon
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:24 +02:00
Michael Niedermayer
167bf8f61e avformat/mov: Check extradata in mov_read_iacb()
Fixes: MemLeak
Fixes: 69853/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4660448545275904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:29:24 +02:00
Tong Wu
5c8523cef1 lavc/hw_base_encode: correct the timestamp when input_order = decode_delay
Fixed the command line: ffmpeg -hwaccel vaapi -pix_fmt nv12 -s:v
widthxheight -i input.yuv -vf "hwupload" -c:v hevc_vaapi -bf 10 -b_depth 3
-vframes 3 -f null -

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2024-07-20 11:21:36 +02:00
James Almer
2aab4e4cc0 avformat/iamf_writer: disallow Opus extradata with mapping family other than 0
Clause 3.11.1 of IAMF[1] states the Opus ID Header should conform to  ChannelMappingFamily == 0.

[1]https://aomediacodec.github.io/iamf/#opus-specific

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-19 21:07:32 -03:00
James Almer
9ce065c90d avformat/iamf_parse: sanitize audio_roll_distance values
Ensure the values are spec complaint and that no integer overflow can happen.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-19 21:07:32 -03:00
Leo Izen
e30bc8a963 fate/png: add mDCv and cLLi read and write test
This test confirms that we can write mDCv and cLLi chunks and read them
back via the png decoder. It uses an HEVC conformance sample with this
metadata as the base source for the side data in the frames.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-19 11:30:19 -04:00
James Almer
97fd5d3363 checkasm/lls: increase epsilon value for the update_lls test
Should fix failures for some seeds on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-19 09:24:59 -03:00
James Almer
7dabad079b avformat/iamf: byteswap values in OpusHeader
Clause 3.11.1 of IAMF[1] states the values are stored in big endian, in
contrast to the Ogg Encapsulation for Opus[2] where they are in little endian.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#opus-specific
[2]https://datatracker.ietf.org/doc/html/rfc7845#section-5.1

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
James Almer
54b8d5e201 avformat/iamf: rename Codec Config seek_preroll to audio_roll_distance
The semantics for the field are different than the one in AVCodecParameters,
so use the name defined in the IAMF spec to prevent confusion.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Felicia Lim
2094f40295 avformat/iamf_writer: fix coded audio_roll_distance values
'seek_preroll' corresponds to 'audio_roll_distance' in IAMF[1]

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#audio_roll_distance

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Felicia Lim
709a5687ed avformat/iamf_writer: fix PCM endian-ness flag
The value was swapped from what's defined in clause 3.11.4 of IAMF[1]

[1]https://aomediacodec.github.io/iamf/#lpcm-specific

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Felicia Lim
180c869faf avformat/movenc: fix channel count and samplerate fields for IAMF tracks
Clause 6.2.3 of IAMF[1] states both of these shall be set to 0.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#iasampleentry-section

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
James Almer
3de65f47e0 avformat/mov: don't export frame cropping stream side data when the clap box is a no-op
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
James Almer
2ff7d10c30 fftools/ffmpeg_filter: use the correct specifier for crop arguments
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 23:27:20 -03:00
Leo Izen
90e28331c7 avcodec/png: more informative error message for invalid sBIT size
If the sBIT chunk size is invalid, we should print a more informative
error message rather than return an error and print nothing.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2024-07-18 21:20:38 -04:00
Leo Izen
4225f51c62 avcodec/pngdec: avoid erroring with sBIT on indexed-color images
Indexed color images use three colors for sBIT, but the function
ff_png_get_nb_channels returns 1 in this case. We should avoid erroring
out on valid files in this scenario.

Regression since 84b454935f.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
2024-07-18 21:16:18 -04:00
Rémi Denis-Courmont
483fd732ab lavc/h264dsp: R-V V high-depth idct_add{,intra}16, idct8_add4
As with 8-bit, this tends to be faster, but results are all over the
place due to the variable distribution of non-zero coefficients.
2024-07-18 20:37:09 +03:00
James Almer
90672974bd fftools/ffmpeg_demux: don't insert the crop filter if frame cropping side data defines no cropping
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-18 09:50:36 -03:00
J. Dekker
fa5a605542 avcodec/riscv: add h264 dc idct rvv
checkasm: bench runs 131072 (1 << 17)
h264_idct4_add_dc_8bpp_c: 1.5
h264_idct4_add_dc_8bpp_rvv_i64: 0.7
h264_idct4_add_dc_9bpp_c: 1.5
h264_idct4_add_dc_9bpp_rvv_i64: 0.7
h264_idct4_add_dc_10bpp_c: 1.5
h264_idct4_add_dc_10bpp_rvv_i64: 0.7
h264_idct4_add_dc_12bpp_c: 1.2
h264_idct4_add_dc_12bpp_rvv_i64: 0.7
h264_idct4_add_dc_14bpp_c: 1.2
h264_idct4_add_dc_14bpp_rvv_i64: 0.7
h264_idct8_add_dc_8bpp_c: 5.2
h264_idct8_add_dc_8bpp_rvv_i64: 1.5
h264_idct8_add_dc_9bpp_c: 5.5
h264_idct8_add_dc_9bpp_rvv_i64: 1.2
h264_idct8_add_dc_10bpp_c: 5.5
h264_idct8_add_dc_10bpp_rvv_i64: 1.2
h264_idct8_add_dc_12bpp_c: 4.2
h264_idct8_add_dc_12bpp_rvv_i64: 1.2
h264_idct8_add_dc_14bpp_c: 4.2
h264_idct8_add_dc_14bpp_rvv_i64: 1.2

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-07-18 02:47:30 +02:00
Zhao Zhili
b3aeef3bf9 avcodec/vvc: Remove write-only assignments in alf_filter_chroma 2024-07-17 21:23:41 +08:00
Zhao Zhili
8bac9d4a21 avcodec/vvc: Remove NOP condition check in alf_filter_luma
If (y + i == vb_above) or (y + i == vb_below), the if body has no
operation.
2024-07-17 21:23:41 +08:00
Michael Niedermayer
0993ef675f avcodec/mpeg12enc: Use av_rescale() in vbv_buffer_size computation
Fixes: signed integer overflow: 20 * 2314885530818453759 cannot be represented in type 'long'
Fixes: 69098/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-6107989688778752

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 19:03:50 +02:00
Michael Niedermayer
69e90491f1 avcodec/utvideoenc: Use unsigned shift to build flags
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 69083/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5608202363273216

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 19:03:50 +02:00
Michael Niedermayer
a84fbd7471 avcodec/j2kenc: Merge dwt_norm into lambda
This moves computations out of a loop

This may help with UB in vsynth*-jpeg2000-yuva444p16

Fixes: signed integer overflow: 31665934879948800 * 9998 cannot be represented in type 'long'
Fixes: 69024/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5949662967169024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 19:03:50 +02:00
Michael Niedermayer
8a4e5e0e15 tools/target_dec_fuzzer: Adjust threshold for RV30
Fixes: Timeout
Fixes: 69216/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV30_fuzzer-5808725188214784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:15 +02:00
Michael Niedermayer
664fbfb9ac avcodec/mscc: move frame allocates to later
Fixes: Timeout
Fixes: 66964/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SRGC_fuzzer-5413170363564032
Fixes: 69373/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSCC_fuzzer-5239787748392960

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:15 +02:00
James Almer
b248dace92 avformat/iamf_parse: keep substream count consistent
Fixes: member access within null pointer of type 'IAMFSubStream' (aka 'struct IAMFSubStream')
Fixes: 69795/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6216287009701888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:14 +02:00
Michael Niedermayer
7147c3c911 avcodec/ratecontrol: Handle wanted bits overflow
Fixes: 5.92611e+20 is outside the range of representable values of type 'unsigned long'
Fixes: 68984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5155755073273856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:14 +02:00
Michael Niedermayer
af99358353 avcodec/vc2enc: Fix overflows with storing large values
Fixes: left shift of 1431634944 by 2 places cannot be represented in type 'int'
Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int'
Fixes: 69061/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC2_fuzzer-6325700826038272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-16 18:43:14 +02:00
Zhao Zhili
8ca60e14d2 configure: Fix Apple framework dependencies in .pc file
configure use "-Wl,-framework,foo" and "-framework foo" to specify
dependencies on Apple frameworks. These two styles essentially do
the same thing when build ffmpeg. However, they do make difference
when generate pkg-config files. Some tools interact with pkg-config
cannot handle "-Wl,-framework,foo" in Libs field, e.g., cmake with
pkg_check_modules.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:41 +08:00
Zhao Zhili
cb9c98da16 avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL
fd_dup is unused when fd and pipe have been disabled. This also
fix build error with wasi since 'dup' isn't available.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:21 +08:00
Zhao Zhili
e713a2d85d avutil/file_open: Fix build error with wasi
Don't assume tempnam is available when !HAVE_MKSTEMP. Check tempnam
explicitly in configure.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:21 +08:00
Rémi Denis-Courmont
3002310b70 lavc/h264dsp: R-V V high-depth add_pixels8
T-Head C908 (cycles);
h264_add_pixels8_9bpp_c:        270.5
h264_add_pixels8_9bpp_rvv_i32:  164.2
h264_add_pixels8_10bpp_c:       270.5
h264_add_pixels8_10bpp_rvv_i32: 164.2
h264_add_pixels8_12bpp_c:       270.5
h264_add_pixels8_12bpp_rvv_i32: 164.2
h264_add_pixels8_14bpp_c:       270.5
h264_add_pixels8_14bpp_rvv_i32: 164.2
2024-07-16 17:25:40 +03:00
Rémi Denis-Courmont
7744c08240 lavc/h264dsp: R-V V add_pixels4 and 8-bit add_pixels8
T-Head C908 (cycles):
h264_add_pixels4_8bpp_c:        93.5
h264_add_pixels4_8bpp_rvv_i32:  39.5
h264_add_pixels4_9bpp_c:        87.5
h264_add_pixels4_9bpp_rvv_i64:  50.5
h264_add_pixels4_10bpp_c:       87.5
h264_add_pixels4_10bpp_rvv_i64: 50.5
h264_add_pixels4_12bpp_c:       87.5
h264_add_pixels4_12bpp_rvv_i64: 50.5
h264_add_pixels4_14bpp_c:       87.5
h264_add_pixels4_14bpp_rvv_i64: 50.5
h264_add_pixels8_8bpp_c:       265.2
h264_add_pixels8_8bpp_rvv_i64:  84.5
2024-07-16 17:25:40 +03:00
Zhao Zhili
635f7c0f6c avcodec/videotoolboxenc: Put ExtraSEI inside BufNode directly
Reduce error path and simplify the code.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili
2fca8e400e avcodec/videotoolboxenc: Fix concurrent access to CVPixelBufferRef
For a frame comes from AV_HWDEVICE_TYPE_VIDEOTOOLBOX, it's
CVPixelBufferRef is maintained by a pool. CVPixelBufferRef returned
to the pool when frame buffer reference reached to zero. However,
VTCompressionSessionEncodeFrame also hold a reference to the
CVPixelBufferRef. So a new frame get from av_hwframe_get_buffer
may access a CVPixelBufferRef which still used by the encoder.
It's only after vtenc_output_callback that we can make sure
CVPixelBufferRef has been released by the encoder.

The issue can be tested with sample from trac #10884.
ffmpeg -hwaccel videotoolbox \
	-hwaccel_output_format videotoolbox_vld \
        -i input.mp4 \
	-c:v hevc_videotoolbox \
	-profile:v main \
        -b:v 3M \
        -vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709:color_transfer=bt709 \
        -c:a copy \
	-tag:v hvc1 \
	output.mp4

Withtout the patch, there are some out of order images in output.mp4.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili
0e338c4114 avcodec/videotoolboxenc: Use BufNode as sourceFrameRefcon
ExtraSEI is used as the sourceFrameRefcon of VTCompressionSessionEncodeFrame.
It cannot hold other information which is necessary to fix another issue
in the following patch.

This patch also fixed leak of ExtraSEI on the error path of
vtenc_output_callback.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili
4a3625859b avcodec/videotoolboxenc: Remove unused variable
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Zhao Zhili
2eae57c862 avcodec/videotoolboxenc: Don't ignore ENOMEM
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:53:53 +08:00
Marvin Scholz
2fc37c4239 avutil/hwcontext_videotoolbox: Fix build with older SDKs
I've accidentally used API not available on the checked version.
Additionally check for the SDK to be new enough to even have the
CVImageBufferCreateColorSpaceFromAttachments API to not fail
the build.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 19:51:45 +08:00
James Almer
5d74dcf0e3 fate/lavf-container: add a test for L-HEVC remuxing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 18:19:00 -03:00
James Almer
27eb55a9c9 avcodec/cbs_h265: add support for 3D Reference Displays Information SEI
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer
64807ccc91 avcodec/cbs_h265: add support for PPS Multilayer extension fields
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer
25138fa0f3 avcodec/cbs_h265: reindent after the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer
41211edc1b avcodec/cbs_h265: add support for SPS Multilayer extension fields
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
James Almer
5fe13aeb65 avcodec/cbs_h265: fix range of sps_max_sub_layers_minus1
The VPS referenced by the SPS must always be present as the max value for
sps_max_sub_layers_minus1 is vps_max_sub_layers_minus1. This replaces a buggy
custom range check for the aforementioned field.
Also, add the missing conformance check for sps_temporal_id_nesting_flag while
at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-15 16:39:44 -03:00
Gyan Doshi
350146a1ea ffmpeg: don't truncate getmaxrss value
Can lead to printing of nonsensical negative memory usage
2024-07-15 15:15:55 +05:30
Fei Wang
246600974f lavc/vaapi_{decode, av1}: Fix memory leak in fail codepath
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-15 10:25:43 +08:00
Michael Niedermayer
9c8881cb35 avcodec/mpegvideo_enc: Do not duplicate pictures on shifting
Fixes: out of array access
Fixes: 69098/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-6107989688778752
Fixes: 69599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4848626296225792.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:41 +02:00
Michael Niedermayer
a7f5845a6c avfilter: Free out on error
CID1197065 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:41 +02:00
Michael Niedermayer
348968e9f7 avdevice/dshow_capture: Fix error handling in ff_dshow_##prefix##_Create()
Untested, needs review

Fixes: CID1591856 Resource leak
Fixes: CID1591887 Resource leak
Fixes: CID1591874 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:40 +02:00
Michael Niedermayer
66d6b8033b avcodec/tiff: Check value on positive signed targets
Fixes: CID1604593 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:40 +02:00
Michael Niedermayer
19a5a8997c avfilter/vf_convolution_opencl: Assert that the filter name is one of the filters
Helps with: CID1439572 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:40 +02:00
Michael Niedermayer
ec18ec9fc1 avfilter/vf_bm3d: Dont round MSE2SSE to an integer
Fixes: CID1439581 Result is not floating-point

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Michael Niedermayer
ffba528bc6 avfilter/vf_avgblur_opencl: Use AV_VIDEO_MAX_PLANES
Fixes: CID1437470 Out-of-bounds read (out of bounds read would only occur with a pixel format of more than 4 planes)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Michael Niedermayer
989e11acb6 avdevice/dshow: Remove NULL check on pin
The pointer is used before the check

Fixes: CID1591884 Dereference before null check

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Michael Niedermayer
2c2e727088 avdevice/dshow: check ff_dshow_pin_ConnectionMediaType() for failure
Maybe Fixes: CID1598557 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:38 +02:00
Michael Niedermayer
175c191668 avdevice/dshow: Check device_filter_unique_name before use
Fixes: CID1591931 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:38 +02:00
Michael Niedermayer
25f9211bdd avdevice/dshow: Cleanup also on av_log case
Fixes: CID1598550 Resource leak

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:38 +02:00
Michael Niedermayer
daf61dddc8 avdevice/dshow_filter: Use wcscpy_s()
Fixes: CID1591929 Copy into fixed size buffer

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:37 +02:00
Michael Niedermayer
8f74c313f1 avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()
This simplification assumes that the code is correct

Fixes: CID1560036 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:37 +02:00
Tong Wu
affeca005a mailmap: add entry for myself
Signed-off-by: Tong Wu <wutong1208@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:37 +02:00
Marvin Scholz
613c85a8f5 avfilter/af_channelsplit: fix mixed declaration and code
Fix a "mixing declarations and code is incompatible with standards
before C99" warning.
2024-07-14 15:43:01 -04:00
Rémi Denis-Courmont
c654e37254 lavc/h264dsp: R-V V high-depth h264_idct8_add
Unlike the 8-bit version, we need two iterations to process this within
128-bit vectors. This adds some extra complexity for pointer arithmetic
and counting down which is unnecessary in the 8-bit variant.

Accordingly the gain relative to C are just slight better than half as
good with 128-bit vectors as with 256-bit ones.

T-Head C908 (2 iterations):
h264_idct8_add_9bpp_c:       17.5
h264_idct8_add_9bpp_rvv_i32: 10.0
h264_idct8_add_10bpp_c:      17.5
h264_idct8_add_10bpp_rvv_i32: 9.7
h264_idct8_add_12bpp_c:      17.7
h264_idct8_add_12bpp_rvv_i32: 9.7
h264_idct8_add_14bpp_c:      17.7
h264_idct8_add_14bpp_rvv_i32: 9.7

SpacemiT X60 (single iteration):
h264_idct8_add_9bpp_c:       15.2
h264_idct8_add_9bpp_rvv_i32:  5.0
h264_idct8_add_10bpp_c:      15.2
h264_idct8_add_10bpp_rvv_i32: 5.0
h264_idct8_add_12bpp_c:      14.7
h264_idct8_add_12bpp_rvv_i32: 5.0
h264_idct8_add_14bpp_c:      14.7
h264_idct8_add_14bpp_rvv_i32: 4.7
2024-07-14 21:06:50 +03:00
Lynne
80ddc72717 vulkan: rename read_only to singular
There's nothing stopping users from writing to such buffers.
Its more accurate to say they are singular, i.e. not duplicated
between multiple submissions.

This can be helpful for global statistics, or error propagation
purposes.
2024-07-14 18:33:56 +02:00
Lynne
e11087b162 vulkan: set VkDescriptorAddressInfoEXT.sType
This was not done, resulting in validation issues, and potential
driver issues.
2024-07-14 18:31:44 +02:00
Niklas Haas
4ec45aca36 swscale/utils: fix leak on threaded ctx init failure
This count gets incremented after init succeeds, when it should be
incremented after *alloc* succeeds. Otherwise, we leak the context on
failure.

There are no negative consequences of incrementing for
allocated-but-not-initialized contexts, as the only functions that
reference it will, in the worst case, simply behave as if called on
allocated-but-not-initialized contexts, which is in line with expected
behavior when sws_init_context() fails.
2024-07-14 13:48:59 +02:00
Alexander Strasser
36aee69f0d libavdevice: Improve example in deprecation message for opengl and sdl
When piping ffmpeg into ffplay both programs write a status line in
the terminal. That causes flickering and invisibility of one or the
other status line.

As compromise set ffplay log level to warning, so it doesn't show
the status line.

The user is usually testing ffmpeg command lines and want's a
preview of the result. This way the user can see the ffmpeg output
and still see errors and warnings from ffplay, should they occur.

Additionally set PTS to zero in ffplay to lessen the delay until
the frames are displayed. Without it delay is quite observable
when e.g. live capturing with low frame rates.
2024-07-14 13:31:03 +02:00
Rémi Denis-Courmont
8b3d997bed lavc/h264dsp: remove MMI 8-bit 4:2:2 chroma DC dequant
The function is exactly identical to the C reference, only with the
constant propagated and the loop unrolled manually.
2024-07-14 11:39:35 +03:00
Rémi Denis-Courmont
a194131cb6 lavc/h264dsp: remove MMI 8-bit chroma DC dequant
The function is exactly identical to the C reference, only with the
constant propagated manually. It does not optimise anything.
2024-07-14 11:39:35 +03:00
Rémi Denis-Courmont
4e0e872881 lavc/h264dsp: R-V V high-depth h264_idct_add
T-Head C908 (cycles):
h264_idct4_add_9bpp_c:        248.2
h264_idct4_add_9bpp_rvv_i32:  128.7
h264_idct4_add_10bpp_c:       256.7
h264_idct4_add_10bpp_rvv_i32: 128.7
h264_idct4_add_12bpp_c:       252.5
h264_idct4_add_12bpp_rvv_i32: 129.7
h264_idct4_add_14bpp_c:       258.0
h264_idct4_add_14bpp_rvv_i32: 129.7
2024-07-14 11:39:35 +03:00
James Almer
d059ea5663 avcodec/bsf/showinfo: print packet data checksum
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-13 23:48:34 -03:00
Marth64
f1abb754aa avformat/dvdvideodec: Fix incorrect padding cell trim logic
When -trim option is used (by default), padding cells
at the beginning of the title are supposed to be ignored.
The current implementation does the ignoring after we
have locked on to the PGC navigation event stream,
but does not set the PGC/PG state properly.

This causes false positives and errors on some discs
due to a search for a program stream cell that
never succeeds. User would have to know to disable
the -trim option to work around the issue.

Simplify the logic and move it to the NAV packet
event handling, in turn implementing the behaviour
correctly and fixing the trim function for impacted discs.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-13 17:17:36 +02:00
Marth64
f37f86a774 avformat/dvdvideodec: Remove redundant ret initializations
Remove initializing ret = 0, in areas where ret is
only used to hold an error value, immediately returned,
and the function would otherwise return a literal 0.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-13 17:17:27 +02:00
Marth64
eb07a593d3 avformat/dvdvideodec: Don't add chapter markers for empty/dummy PTTs
Some discs (usually same ones with padding cells), also have empty
padding PTTs / chapters to accompany them. This results, for example,
in an extra chapter marker that starts and ends at 0 (no duration).

Don't add these empty chapter markers.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-13 17:17:22 +02:00
Michael Niedermayer
9af348bd1a avcodec/flac_parser: Assert that we do not overrun the link_penalty array
Helps: CID1454676 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:49:33 +02:00
Michael Niedermayer
ed34b0c54e avcodec/osq: avoid signed overflow in downsample path
Fixes: signed integer overflow: 865309950 * 256 cannot be represented in type 'int'
Fixes: 69191/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6310214413385728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:45:58 +02:00
Michael Niedermayer
12dab3860c tools/target_enc_fuzzer: A64MULTI5 encoder is very slow, check and adjust threshold
Fixes: Timeout
Fixes: 68999/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_A64MULTI5_fuzzer-5078418784845824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:44:19 +02:00
Michael Niedermayer
032e831ab4 tools/target_enc_fuzzer: A64MULTI encoder is very slow, check and adjust threshold
Fixes: Timeout
Fixes: 69097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_A64MULTI_fuzzer-5062757287264256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:44:17 +02:00
Michael Niedermayer
0474614e6c avcodec/pixlet: Simplify pfx computation
Found by reviewing code related to CID1604365 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:46 +02:00
Michael Niedermayer
f18b442370 avcodec/motion_est: Fix score squaring overflow
Fixes: CID1604552 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:44 +02:00
Michael Niedermayer
06f01d9fa0 avcodec/mlpenc: Use 64 for ml, mr
Fixes: CID1604429 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:42 +02:00
Michael Niedermayer
371265f0ec avcodec/me_cmp: Fix type check
Fixes: CID1604375 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:40 +02:00
Michael Niedermayer
d553276843 avcodec/loco: Check loco_get_rice() for failure
Fixes: CID1604495 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:38 +02:00
Michael Niedermayer
b989986641 avcodec/loco: check get_ur_golomb_jpegls() for failure
Fixes: CID1604400 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:35 +02:00
Michael Niedermayer
0e3e7e8aeb avcodec/leaddec: Check init_get_bits8() for failure
Fixes: CID1604416 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:33 +02:00
Michael Niedermayer
6e4c037833 avcodec/imm4: check cbphi for error
Fixes: CID1604356 Overflowed constant
Fixes: CID1604573 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:31 +02:00
Michael Niedermayer
cfe66dfebb avcodec/iff: Use signed count
This is more a style fix than a bugfix (CID1604392 Overflowed constant)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:28 +02:00
Michael Niedermayer
1e888fb006 avcodec/hw_base_encode: Simplify EOF check
Found while reviewing CID1608712 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:25 +02:00
Michael Niedermayer
b2aaeb81f6 avcodec/golomb: Assert that k is in the supported range for get_ur/sr_golomb()
Found by code review related to CID1604563 Overflowed return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:23 +02:00
Michael Niedermayer
7cf5b83f6f avcodec/golomb: Document return for get_ur_golomb_jpegls() and get_sr_golomb_flac()
Found while reviewing code related to CID1604409 Overflowed return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:21 +02:00
Michael Niedermayer
e5af1c6e91 avcodec/dxv: Fix type in get_opcodes()
Found by code review related to CID1604386 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:20 +02:00
Michael Niedermayer
69dcd123f1 avcodec/cri: Check length
Fixes: CID1604394 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:18 +02:00
Michael Niedermayer
96fd9417e2 avcodec/xsubdec: Check parse_timecode()
Fixes: CID1604490 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:42:14 +02:00
Michael Niedermayer
ba63e32957 avutil/imgutils: av_image_check_size2() ensure width and height fit in 32bit
width and height > 32bit is not supported and its easier to check in a central place

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 22:16:05 +02:00
Michael Niedermayer
20e59af07e avfilter/vf_tiltandshift: Free dst on error
Fixes: CID1559901 Resource leak

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 21:58:50 +02:00
Michael Niedermayer
e6c0c5731e doc/examples/mux: remove nop
Found through code review related to CID1604493 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:51 +02:00
Michael Niedermayer
93e0265e27 avcodec/proresenc_kostya: use unsigned alpha for rotation
Fixes: left shift of negative value -208
Fixes: 69073/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_KS_fuzzer-4745020002336768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:51 +02:00
Michael Niedermayer
f13ae63259 avformat/rtpenc_rfc4175: Use 64bit in computation if copy_offset
Found while reviewing: CID1494441 Untrusted value as argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:51 +02:00
Michael Niedermayer
38c2e6a2c7 avformat/rtmpproto: Use AV_DICT_MATCH_CASE instead of litteral number
Found by reviewing: CID1530166 Free of array-typed value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:50 +02:00
Michael Niedermayer
cedbef0394 avformat/rtmppkt: Simplify and deobfuscate amf_tag_skip() slightly
Found while reviewing: CID1530313 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:50 +02:00
Michael Niedermayer
665be4fa2f avformat/rmdec: use 64bit for audio_framesize checks
It is not entirely clear what would prevent such overflow so even if it is
not possible, it is better to use 64bit

Fixes: CID1491898 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 16:40:42 +02:00
Fei Wang
71f802cdc9 lavc/hevcdec: Update slice index before hwaccel decode slice
Otherwise, slice index will never update for hwaccel decode, and slice
RPL will be always overlap into first one which use slice index to construct.

Fixes hwaccel decoding after 47d34ba7fb

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-12 16:27:34 +08:00
Fei Wang
e741cf665d lavc/hevcdec: Put slice address checking after hwaccel decode slice
Slice address tab only been updated in software decode slice data.

Fixes hwaccel decoding after d725c737fe.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-12 16:27:34 +08:00
James Almer
092ef4097c Changelog: mention cropping support in Matroska and MP4
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 21:35:40 -03:00
James Almer
70c6b904be x86/intreadwrite: add missing casts to pointer arguments
Should make strict compilers happy.

Also, make AV_COPY128 use integer operations while at it. Removing the
inclusion of immintrin.h ensures a lot less intrinsic related headers are
included as well, which fixes a clash of defines with some Clang versions.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 18:24:26 -03:00
Rémi Denis-Courmont
d28a7e8eb7 lavc/h264dsp: avoid \+ expansion
This seems to be unsupported by LLVM-as.
2024-07-11 21:07:17 +03:00
James Almer
58cb0cab5e avformat/mov: ensure pasp box derived SAR is used if present
It's meant to override any codec specific (but still container level)
information, but its position is not guaranteed, so apply the values after the
entire trak structure has been parsed.
Also, replace the ugly roundabout int -> double -> int method to set SAR from
existing dimensions while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
James Almer
32588a9394 avformat/movenc: support writing cropping values
Finishes implementing ticket #7437.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
James Almer
93be6b425e avformat/mov: export cropping values from clap boxes
Addresses part of ticket #7437.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
James Almer
0b6c5e9df4 avfilter/vf_crop: prevent integer overflows when calculating SAR
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
Zhao Zhili
0e5f8ddc1d avcodec/vvc: Use static const for function table 2024-07-11 20:26:47 +08:00
Zhao Zhili
906b883e7b avutil/executor: Fix stack overflow due to recursive call
av_executor_execute run the task directly when thread is disabled.
The task can schedule a new task by call av_executor_execute. This
forms an implicit recursive call. This patch removed the recursive
call.
2024-07-11 20:26:23 +08:00
Zhao Zhili
54f9469fa1 avutil/executor: Fix missing check before using mutex 2024-07-11 20:24:11 +08:00
James Almer
1a86a7a48d x86/intreadwrite: fix include of config.h
Should fix make checkheaders.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:52:52 -03:00
James Almer
15056dd650 x86/intreadwrite.h: add missing preprocessor checks
Removed by accident in the previous commits. This makes the code only run when
compiled with GCC and Clang like before. Support for other compilers like msvc
can be added later.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:49:21 -03:00
James Almer
bd1bcb07e0 x86/intreadwrite: use intrinsics instead of inline asm for AV_COPY128
This has the benefit of removing any SSE -> AVX penalty that may happen when
the compiler emits VEX encoded instructions.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:25:44 -03:00
James Almer
4a04cca69a x86/intreadwrite: use intrinsics instead of inline asm for AV_ZERO128
When called inside a loop, the inline asm version results in one pxor
unnecessarely emitted per iteration, as the contents of the __asm__() block are
opaque to the compiler's instruction scheduler.
This is not the case with intrinsics, where pxor will be emitted once with any
half decent compiler.

This also has the benefit of removing any SSE -> AVX penalty that may happen
when the compiler emits VEX encoded instructions.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:25:44 -03:00
Sean McGovern
34b4ca8696 swscale: prevent undefined behaviour in the PUTRGBA macro
For even small values of 'asrc[x]', shifting them by 24 bits or more
will cause arithmetic overflow and be caught by
GCC's undefined behaviour sanitizer.

Ensure the values do not overflow by up-casting the bracketed
expressions involving 'asrc' to uint32_t.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:10 +02:00
Michael Niedermayer
e9e8bea2e7 avutil/wchar_filename: Correct sizeof
Fixes: CID1591930 Wrong sizeof argument

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:10 +02:00
Michael Niedermayer
628ba061c8 avutil/hwcontext_d3d11va: correct sizeof IDirect3DSurface9
Fixes: CID1591944 Wrong sizeof argument

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:09 +02:00
Michael Niedermayer
cf22f944d5 avutil/hwcontext_d3d11va: Free AVD3D11FrameDescriptor on error
Fixes: CID1598558 Resource leak

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:09 +02:00
Michael Niedermayer
698ed0d5a5 avutil/hwcontext_d3d11va: correct sizeof AVD3D11FrameDescriptor
Fixes: CID1591909 Wrong sizeof argument

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:09 +02:00
Michael Niedermayer
eb552ecd54 avcodec/vvc/refs: Use unsigned mask
Not a bugfix, but might fix CID1604361 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:08 +02:00
Marvin Scholz
6d9c4bd69e lavfi/perlin: Fix out of bounds stack buffer write
An incorrect calculation in ff_perlin_init causes a write to the
stack array at index 256, which is out of bounds.

Fixes: CID1608711
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:08 +02:00
Tong Wu
f2f2b27517 MAINTAINERS: add myself as d3d12va_encode maintainer
Signed-off-by: Tong Wu <wutong1208@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:08 +02:00
Michael Niedermayer
3e4bfff211 doc/examples/vaapi_encode: Try to check fwrite() for failure
Fixes: CID1604548 Unused value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:07 +02:00
Ramiro Polla
ac6263945a swscale/x86/yuv2rgb: Detemplatize
Every function in yuv2rgb_template.c is only compiled exactly
once, so detemplatize it.
2024-07-10 12:25:32 +02:00
Ramiro Polla
4f7f9b1026 swscale: remove unconditional #define DITHER1XBPP
This seems to have had an use in the past, but it is now defined
unconditionally.
2024-07-10 12:25:03 +02:00
Ramiro Polla
7405f1ad53 configure: restore autodetection of v4l2 and fbdev
The detection logic for v4l2 and fbdev was accidentally modified to
depend on v4l2-m2m in 43b3412.
2024-07-10 12:24:33 +02:00
Niklas Haas
0deb301ba9 avfilter/vf_scale: test return code of scale_frame()
Instead of testing the returned frame against NULL, test the return code
itself, going more in line with the usual behavior of such functions.
2024-07-10 11:38:44 +02:00
Niklas Haas
084e0b364d avfilter/vf_scale: fix frame lifetimes
scale_frame() inconsistently handled the lifetime of `in`. Fixes a
possible double free and a possible memory leak.

The new code always has `scale_frame` take over ownership of the input
frame. I first tried writing this code in a way where the calling code
retains ownership, but this is nontrivial due to the presence of the
no-op short-circuit condition in which the input frame is directly
returned. (As an alternative, we could use av_frame_clone() instead, but
I wanted to avoid touching the original behavior in this commit)
2024-07-10 11:38:44 +02:00
Rémi Denis-Courmont
f1ed351d3b lavc/h264dsp: R-V V 8-bit h264_biweight_pixels
T-Head C908:
h264_biweight2_8_c:        58.0
h264_biweight2_8_rvv_i32:  11.2
h264_biweight4_8_c:       106.0
h264_biweight4_8_rvv_i32:  22.7
h264_biweight8_8_c:       205.7
h264_biweight8_8_rvv_i32:  50.0
h264_biweight16_8_c:      403.5
h264_biweight16_8_rvv_i32: 83.2

SpacemiT X60:
h264_weight2_8_c:          48.2
h264_weight2_8_rvv_i32:     8.2
h264_weight4_8_c:          90.5
h264_weight4_8_rvv_i32:    16.5
h264_weight8_8_c:         175.2
h264_weight8_8_rvv_i32:    38.0
h264_weight16_8_c:        342.2
h264_weight16_8_rvv_i32:   66.0
2024-07-09 18:03:30 +03:00
Rémi Denis-Courmont
3606e592ea lavc/h264dsp: R-V V 8-bit h264_weight_pixels
There are two implementations here:
- a generic scalable one processing two columns at a time,
- a specialised processing one (fixed-size) row at a time.

Unsurprisingly, the generic one works out better with smaller widths.
With larger widths, the gains from filling vectors are outweighed by
the extra cost of strided loads and stores. In other words, memory
accesses become the bottleneck.

T-Head C908:
h264_weight2_8_c:        54.5
h264_weight2_8_rvv_i32:  13.7
h264_weight4_8_c:       101.7
h264_weight4_8_rvv_i32:  27.5
h264_weight8_8_c:       197.0
h264_weight8_8_rvv_i32:  75.5
h264_weight16_8_c:      385.0
h264_weight16_8_rvv_i32: 74.2

SpacemiT X60:
h264_weight2_8_c:        48.5
h264_weight2_8_rvv_i32:   8.2
h264_weight4_8_c:        90.7
h264_weight4_8_rvv_i32:  16.5
h264_weight8_8_c:       175.0
h264_weight8_8_rvv_i32:  37.7
h264_weight16_8_c:      342.2
h264_weight16_8_rvv_i32: 66.0
2024-07-09 18:03:29 +03:00
Zhao Zhili
85706f5136 avutil/hwcontext_videotoolbox: Fix version check
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-09 21:39:09 +08:00
Anton Khirnov
9fb8d13d56 lavf: deprecate avformat_transfer_internal_stream_timing_info()
And av_stream_get_codec_timebase().

They were both added for ffmpeg CLI, which no longer calls either of
them. Furthermore the notion of "internal stream timing info" that needs
to be transferred with a special magic API function is fundamentally
flawed and should be removed.
2024-07-09 11:14:47 +02:00
Anton Khirnov
10185e2d4c fftools/ffmpeg_mux_init: default to input timebase for streamcopy
Stop trying to invent some "framerate-based" timebase when there is no
reason to think the stream is CFR at all.
2024-07-09 11:14:08 +02:00
Anton Khirnov
ff55d1cc20 fftools/ffmpeg_dec: improve detection of lavf-guessed durations
Will be useful in following commit.
2024-07-09 11:14:08 +02:00
Andreas Rheinhardt
b6c43328ee avformat/matroskaenc: Avoid indirection via st->codecpar
Use the already available AVCodecParameters pointer instead.
Shortens lines.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:32 +02:00
Andreas Rheinhardt
0d1bc9666c avformat/matroskaenc: Only write useful cropping values
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:27 +02:00
Andreas Rheinhardt
9ffac78eba avformat/matroskaenc: Fix and simplify check for invalid crop values
The check "left >= INT_MAX - right" is supposed to check for
whether left + right does not overflow/wraparound, but given that
left and top are uint32_t INT_MAX - right can already wraparound
for big values of right (and ordinary 32-bit ints):
If right == UINT32_MAX, INT_MAX - right is INT_MAX + 1;
for left in 0..par->width both checks will be passed.

Fix this and simplify the check by using 64-bit types,
where the addition is guaranteed not to overflow.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:20 +02:00
Andreas Rheinhardt
8765b36a52 avformat/matroskaenc: Fix potential stack-buffer-overflow
Forgotten in f194f291d8

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-08 20:11:03 +02:00
James Almer
bf87688a9f fftools/ffmpeg: support applying container level cropping
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer
f194f291d8 avformat/matroskaenc: support writing cropping values
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer
79e8e980c2 avformat/matroskadec: export cropping values
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer
dc763efe70 avformat/matroskadec: don't infer display dimensions when DisplayUnit is not pixels
The spec doesn't define a default value for other values of DisplayUnit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer
d570457eb7 ffprobe: print Frame Cropping packet side data info
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:30:24 -03:00
James Almer
893c6802ac avformat/dump: print Frame Cropping packet side data info
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:29:49 -03:00
James Almer
1b58f3af30 avcodec/packet: add a decoded frame cropping side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-08 13:23:33 -03:00
Michael Niedermayer
0619138639 avformat/usmdec: Initialize value
Fixes: CID1551685 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:33 +02:00
Michael Niedermayer
7b2f67ea77 avformat/udp: Fix temporary buffer race
Fixes: CID1551679 Data race condition
Fixes: CID1551687 Data race condition

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:33 +02:00
Michael Niedermayer
f022afea77 avformat/tls_schannel: Initialize ret
Fixes: CID1591881 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:32 +02:00
Michael Niedermayer
426d8c84c3 avformat/subfile: Assert that whence is a known case
This may help CID1452449 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:32 +02:00
Michael Niedermayer
2a0a7d964b avformat/subfile: Merge if into switch()
Found while reviewing CID1452449 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:32 +02:00
Michael Niedermayer
c8200d3825 avformat/rtsp: Check that lower transport is handled in one of the if()
Fixes: CID1473554 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:31 +02:00
Michael Niedermayer
498ce4e8b8 avformat/rtsp: initialize reply1
It seems reply1 is initialized by ff_rtsp_send_cmd() in most cases but there
are code paths like "continue" which look like they could skip it but even if not
writing this so a complex loop after several layers of calls initialized a local
variable through a pointer is just bad design.
This patch simply initialized the variable.

Fixes: CID1473532 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:31 +02:00
Michael Niedermayer
9bb38ba2b7 avformat/rtsp: use < 0 for error check
Found while reviewing CID1473532 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:31 +02:00
Michael Niedermayer
7a9ddb7051 avformat/rtpenc_vc2hq: Check sizes
Fixes: CID1452585 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:30 +02:00
Michael Niedermayer
382e9e79f3 avfilter/af_aderivative: Free out on error
Fixes: CID1197065 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:30 +02:00
Michael Niedermayer
66b60bae68 swscale/swscale: Use ptrdiff_t for linesize computations
This is unlikely to make a difference

Fixes: CID1591896 Unintentional integer overflow
Fixes: CID1591901 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:30 +02:00
Michael Niedermayer
62d4414d54 avfilter/af_amerge: Cleanup on av_channel_layout_copy() failure
Fixes: CID1503088 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer
a5c815f937 avfilter/af_afir: Assert format
Maybe helps: CID1516805 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer
8f9a6c4ea8 avfilter/af_afftdn: Assert format
Maybe helps: CID1515514 Uninitialized scalar variable
Maybe helps: CID1515517 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer
5fe8bf4aa5 avfilter/af_pan: check nb_output_channels before use
Fixes: CID1500281 Out-of-bounds write
Fixes: CID1500331 Out-of-bounds write

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer
2d0d502ff1 avfilter/af_mcompand: compute half frequency in double
Fixes: CID1422217 Result is not floating-point

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer
cef720ab42 avfilter/af_channelsplit: Assert that av_channel_layout_channel_from_index() succeeds
Maybe Helps: CID1503077 Bad bit shift operation

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer
7a0ea15c7a avfilter/af_aresample: Cleanup on av_channel_layout_copy() failure
Fixes: CID1503078 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:27 +02:00
Michael Niedermayer
380a8213b1 tools/coverity: Phase 1 study of anti-halicogenic for coverity av_rescale()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:27 +02:00
Fei Wang
7ba8982181 MAINTAINERS: add myself to the general developers list
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:27 +02:00
James Almer
33d6e14d6f avformat/hevc: reindent after previous commits
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 13:54:07 -03:00
James Almer
aa8230c7ba avformat/movenc: add support for writting hfov boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer
6a428876fc avformat/movenc: add support for writting vexu boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer
d4e2af4144 avformat/movenc: add support for writing lhvC boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
Derek Buitenhuis
c4ebdd8d2d avformat/mov: Mark streams with a layered HEVC box as multilayer
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-07 12:38:57 -03:00
James Almer
c657c694e3 avformat/mov: add support for lhvC box parsing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer
cbfbacff20 avformat/hevc: add a function to write a lhvC box
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer
cee43e512d avformat/hevc: store parameter set and layer IDs in HVCCNALUnit
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer
361b01329f avformat/hevc: use a single array for per-PS NALUs
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer
ab7893a7b1 avformat/hevc: don't write the same array values per nal addition
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
James Almer
a696b28886 avformat/hevc: don't write NALUs with nuh_layer_id > 0 in hvcC boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-07 12:38:57 -03:00
Derek Buitenhuis
46f7ea4456 avformat: Add a new stream disposition for multilayer video
This lets us detect when a container has flagged a stream as multilayer.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-07 12:38:50 -03:00
Hao Guan
cd2f8a22e9 avcodec/videotoolboxenc: fix vtctx reset condition
In vtenc_populate_extradata, the cleanup function vtenc_reset should not
be used when no error occurs, otherwise some color information is lost
(#11036).

This patch checks the status code and conducts the correct cleanup.

Signed-off-by: Hao Guan <hguandl@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-07 18:46:02 +08:00
Anton Khirnov
24b3bad811 tests/fate/mov: add a test for VFR muxing 2024-07-07 11:37:43 +02:00
Anton Khirnov
ef521e7a57 lavf/movenc: mark mov/mp4 as supporting VFR 2024-07-07 11:37:43 +02:00
Anton Khirnov
6cde03739e tests/fate/filter-audio: convert atempo test to oneoff
Filter output is not bitexact.
2024-07-07 11:34:13 +02:00
Marth64
8b8ee799de avformat/dvdvideodec: Remove unused cell count variable
Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-07 11:33:32 +02:00
Rémi Denis-Courmont
f9d1230224 lavc/h264dsp: R-V V 8-bit h264_idct8_add
T-Head C908 (cycles):
h264_idct8_add_8bpp_c:      1072.0
h264_idct8_add_8bpp_rvv_i32: 318.5
2024-07-07 09:34:32 +03:00
James Almer
ecd3a97834 fate/filter-video: add missing swscale flags to tiltandshift tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 17:41:24 -03:00
James Almer
3d5bad7501 fate/filter-video: tests more pixel formats with the tiltandshift filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 10:50:55 -03:00
James Almer
a528a54ee1 avfilter/vf_tiltandshift: fix buffer offset for yuv422p input
Fixes ticket #10950.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 10:50:55 -03:00
Stefano Sabatini
9c357324f0 doc/filters/perlin: specify default values 2024-07-06 14:14:02 +02:00
Rémi Denis-Courmont
f447189b0c lavc/h264dsp: R-V V 8-bit h264_idct_add
T-Head C908 (cycles):
h264_idct4_add_8bpp_c:      271.5
h264_idct4_add_8bpp_rvv_i32: 91.5
2024-07-05 20:06:22 +03:00
Rémi Denis-Courmont
e0eff64ed1 lavc/h264dsp: R-V V 8-bit h264_idct8_add4 2024-07-05 18:56:03 +03:00
Rémi Denis-Courmont
d1f0c1fbf8 lavc/h264dsp: R-V V 8-bit h264_idct_add16intra 2024-07-05 18:56:03 +03:00
Rémi Denis-Courmont
30475c95ba lavc/h264dsp: R-V V 8-bit h264_idct_add16
While this *tends* to be faster than plain C, the performance numbers
are all over the place, presuambly due to the conditional character of
the main loop.

Some additional micro-optimisations should be feasible after the
underlying h264_idct_add and h264_idct_dc_add functions are also
implemented. Then it will no longer be necesseray to stricly abide by
the C ABI.
2024-07-05 18:56:02 +03:00
Marvin Scholz
cd9ceaef22 avutil/hwcontext_videotoolbox: Set CVBuffer CGColorSpace
In addition to the other properties, try to obtain the right
CGColorSpace and set it as well, else it could lead to a CVBuffer
tagged as BT.2020 but with a CGColorSpace indicating BT.709.

Therefore it is essential for consistency to set a colorspace
according to the other values, or if none can be obtained (for example
because the other values are all unspecified) unset it as well.

Fix #10884

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 19:13:43 +08:00
Marvin Scholz
b4f9fcc63c avutil/hwcontext_videotoolbox: Update documentation
The documentation was not clear at all what specifically the
function does, so it was left unspecified if it will unset or
not touch attachments it could not map from the AVFrame.

The documentation of the return  value was wrong as well.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 19:13:43 +08:00
Marvin Scholz
1fa7554bd6 avutil/hwcontext_videotoolbox: Unset undefined values
When mapping AVFrame properties to the CVBuffer attachments, it is
necessary to properly delete undefined attachments, else we can
leave incorrect values in there guessed from VideoToolbox for
example, leading to inconsistent results where the AVFrame and
CVBuffer differ in metadata.

Ref #10884

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 19:13:43 +08:00
Jun Zhao
03c2e9d77e lavf/scdet: minor fix
Change dbl to i64 for bool type

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-07-05 18:06:14 +08:00
Jun Zhao
25a7dcf069 lavc/libx264: minor format fix
Remove redundant semicolons

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-07-05 18:05:10 +08:00
Zhao Zhili
4d90a76986 swscale/aarch64: Add argb/abgr to yuv
Test on Apple M1 with kperf:
				: -O3		: -O3 -fno-vectorize
abgr_to_uv_8_c			: 19.4		: 26.1
abgr_to_uv_8_neon		: 29.9		: 51.1
abgr_to_uv_128_c		: 146.4		: 558.9
abgr_to_uv_128_neon		: 85.1		: 83.4
abgr_to_uv_1080_c		: 1162.6	: 4786.4
abgr_to_uv_1080_neon		: 819.6		: 826.6
abgr_to_uv_1920_c		: 2063.6	: 8492.1
abgr_to_uv_1920_neon		: 1435.1	: 1447.1
abgr_to_uv_half_8_c		: 16.4		: 11.4
abgr_to_uv_half_8_neon		: 35.6		: 20.4
abgr_to_uv_half_128_c		: 108.6		: 359.4
abgr_to_uv_half_128_neon	: 75.4		: 42.6
abgr_to_uv_half_1080_c		: 883.4		: 2885.6
abgr_to_uv_half_1080_neon	: 460.6		: 481.1
abgr_to_uv_half_1920_c		: 1553.6	: 5106.9
abgr_to_uv_half_1920_neon	: 817.6		: 820.4
abgr_to_y_8_c			: 6.1		: 26.4
abgr_to_y_8_neon		: 40.6		: 6.4
abgr_to_y_128_c			: 99.9		: 390.1
abgr_to_y_128_neon		: 67.4		: 55.9
abgr_to_y_1080_c		: 735.9		: 3170.4
abgr_to_y_1080_neon		: 534.6		: 536.6
abgr_to_y_1920_c		: 1279.4	: 6016.4
abgr_to_y_1920_neon		: 932.6		: 927.6

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 16:32:31 +08:00
Zhao Zhili
52422133ae swscale/aarch64: Add bgra/rgba to yuv
Test on Apple M1 with kperf
				: -O3		: -O3 -fno-vectorize
bgra_to_uv_8_c			: 13.4		: 27.5
bgra_to_uv_8_neon		: 37.4		: 41.7
bgra_to_uv_128_c		: 155.9		: 550.2
bgra_to_uv_128_neon		: 91.7		: 92.7
bgra_to_uv_1080_c		: 1173.2	: 4558.2
bgra_to_uv_1080_neon		: 822.7		: 809.5
bgra_to_uv_1920_c		: 2078.2	: 8115.2
bgra_to_uv_1920_neon		: 1437.7	: 1438.7
bgra_to_uv_half_8_c		: 17.9		: 14.2
bgra_to_uv_half_8_neon		: 37.4		: 10.5
bgra_to_uv_half_128_c		: 103.9		: 326.0
bgra_to_uv_half_128_neon	: 73.9		: 68.7
bgra_to_uv_half_1080_c		: 850.2		: 3732.0
bgra_to_uv_half_1080_neon	: 484.2		: 490.0
bgra_to_uv_half_1920_c		: 1479.2	: 4942.7
bgra_to_uv_half_1920_neon	: 824.2		: 824.7
bgra_to_y_8_c			: 8.2		: 29.5
bgra_to_y_8_neon		: 18.2		: 32.7
bgra_to_y_128_c			: 101.4		: 361.5
bgra_to_y_128_neon		: 74.9		: 73.7
bgra_to_y_1080_c		: 739.4		: 3018.0
bgra_to_y_1080_neon		: 613.4		: 544.2
bgra_to_y_1920_c		: 1298.7	: 5326.0
bgra_to_y_1920_neon		: 918.7		: 934.2

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 16:32:31 +08:00
Zhao Zhili
b8b71be07a swscale/aarch64: Add bgr24 to yuv
Test on Apple M1 with kperf
				: -O3		: -O3 -fno-vectorize
bgr24_to_uv_8_c			: 28.5		: 52.5
bgr24_to_uv_8_neon		: 54.5		: 59.7
bgr24_to_uv_128_c		: 294.0		: 830.7
bgr24_to_uv_128_neon		: 99.7		: 112.0
bgr24_to_uv_1080_c		: 965.0		: 6624.0
bgr24_to_uv_1080_neon		: 751.5		: 754.7
bgr24_to_uv_1920_c		: 1693.2	: 11554.5
bgr24_to_uv_1920_neon		: 1292.5	: 1307.5
bgr24_to_uv_half_8_c		: 54.2		: 37.0
bgr24_to_uv_half_8_neon		: 27.2		: 22.5
bgr24_to_uv_half_128_c		: 127.2		: 392.5
bgr24_to_uv_half_128_neon	: 63.0		: 52.0
bgr24_to_uv_half_1080_c		: 880.2		: 3329.0
bgr24_to_uv_half_1080_neon	: 401.5		: 390.7
bgr24_to_uv_half_1920_c		: 1585.7	: 6390.7
bgr24_to_uv_half_1920_neon	: 694.7		: 698.7
bgr24_to_y_8_c			: 21.7		: 22.5
bgr24_to_y_8_neon		: 797.2		: 25.5
bgr24_to_y_128_c		: 88.0		: 280.5
bgr24_to_y_128_neon		: 63.7		: 55.0
bgr24_to_y_1080_c		: 616.7		: 2208.7
bgr24_to_y_1080_neon		: 900.0		: 452.0
bgr24_to_y_1920_c		: 1093.2	: 3894.7
bgr24_to_y_1920_neon		: 777.2		: 767.5

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-05 16:32:31 +08:00
James Almer
bef77c6c9c avformat/dump: only print yaw, pitch, and roll if set
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-04 23:35:08 -03:00
Martin Storsjö
e14cdf9990 hlsenc: Calculate the average and actual maximum bitrate of segments
Previously, the bitrate advertised in the master playlist would only
be based on the nominal values in either AVCodecParameters bit_rate,
or via AVCPBProperties max_bitrate. On top of this, a
fudge factor of 10% is added, to account for container overhead.

Neither of these bitrates may be known, and if the encoder is
running in VBR mode, there is no such value to be known. And
the container overhead may be more or less than the given
constant factor of 10%.

Instead, calculate the maximum bitrate per segment based on
what actually gets output from the muxer, and average bitrate
across all segments.

When muxing of the file finishes, update the master playlist
with these values, exposing both the maximum (which previously
was a guesstimate based on the nominal values) via
EXT-X-STREAM-INF BANDWIDTH, and the average via
EXT-X-STREAM-INF AVERAGE-BANDWIDTH.

This makes it possible to use the hlsenc muxer with VBR
encodes, for VOD style muxing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:27 +03:00
Martin Storsjö
9246cca7f7 hlsenc: When not using HLS_SINGLE_FILE, set vs->size to range_length
This matches what is done in the corresponding case for
HLS_SINGLE_FILE.

Normally, vs->size is already initialized correctly - but when
writing the initial segment, with mp4 files, vs->size has been set
to the size of the init segment, while range_length contains the
real size of the first segment.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:26 +03:00
Martin Storsjö
a50b8bb7cd hlsenc: Remove bogus check for if (vs->start_pos) for appending segments
Previously, vs->start_pos was never 0 here, unless using the
-hls_segment_size option, which wasn't allowed for SEGMENT_TYPE_FMP4.
Therefore, this if statement was practically always taken anyway.

Remove this bogus if statement, to allow changing vs->start_pos
to reflect the right value when not using the -hls_segment_size
option.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:25 +03:00
Martin Storsjö
52f57568d5 hlsenc: Fix setting vs->start_pos when not using HLS_SINGLE_FILE or hls_segment_size
When not using HLS_SINGLE_FILE or hls_segment_size, we're writing
each segment into a separate file. In that case, the file start pos for
each segment will be zero.

This matches the case in (hls->max_seg_size > 0) above, where we
decide to switch to a new file.

This fixes the calculation of "vs->size = new_start_pos - vs->start_pos"
at the start of hls_write_packet; previously, start_pos would
refer to the byte size of the previous segment file, giving
vs->size entirely bogus values here.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:24 +03:00
Martin Storsjö
01312fdfcf hlsenc: Fix the return value accumulation in append_single_file
Both the read_byte variable (which is accumulated into
append_single_file) and the return value are int64_t;
give the ret variable the right corresponding type too.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:33:23 +03:00
Martin Storsjö
affc1acde7 tests: Add a missing dependency for the filter-atempo test
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-04 23:03:20 +03:00
Andreas Rheinhardt
b13291f37c avcodec/hw_base_encode: Add missing include
Fixes checkheaders.

Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Reviewed-by: Tong Wu <wutong1208@outlook.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-07-04 19:45:51 +02:00
Rémi Denis-Courmont
e2af5904f0 lavc/h264dsp: R-V V 8-bit MBAFF loop filter
Performance is (unfortunately) the same as with non-MBAFF, since the
hardware under test does not short-circuit vector tail calculations.
(IMO, a generic solution or work-around should be agreed on, rather
than bespoke approaches all over the place.)
2024-07-04 19:57:42 +03:00
Rémi Denis-Courmont
5a6e333fc7 lavc/h264dsp: R-V V 8-bit luma loop filter
T-Head C908 (cycles):
h264_h_loop_filter_luma_8bpp_c:       297.5
h264_h_loop_filter_luma_8bpp_rvv_i32: 369.2
h264_v_loop_filter_luma_8bpp_c:       862.7
h264_v_loop_filter_luma_8bpp_rvv_i32: 199.7

Performance in the horizontal scenario seems worse than scalar. x86
SSE2 and AVX optimisations are similarly affected. This is presumably
caused by unlucky inputs from checkasm, such that the C code
short-circuits almost all filter calculations.
2024-07-04 19:57:42 +03:00
Gyan Doshi
03175b587c doc/filter: fix grammar in tiltandshift filter 2024-07-04 15:21:17 +05:30
Ramiro Polla
61e851381f swscale/yuv2rgb/x86: remove mmx/mmxext yuv2rgb functions
These functions are either slower or barely faster than the C LUT
yuv2rgb code.
2024-07-04 11:12:47 +02:00
Ramiro Polla
7eb37c142a avdevice/v4l2: add limited support for multiplanar API
This commit adds support for V4L2's multiplanar API, but only when the
number of planes is 1.

Adding full support for the multiplanar API would require a device that
actually uses more than 1 plane, which I have not found yet.
2024-07-04 11:09:53 +02:00
James Almer
cf7e2c5e05 avformat/mov: add more checks for infe atom size
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
James Almer
235ba14cc0 avformat/mov: check for EOF inside the infe list parsing loop
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
James Almer
a9a5d000aa avformat/mov: check extent_offset calculation for overflow
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
James Almer
c49898a6b1 avformat/mov: check that iloc offset values fit on an int64_t
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 19:54:31 -03:00
Rémi Denis-Courmont
4a2de380b7 lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_8
T-Head C908 (cycles)             before   after
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 240.0   228.0
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 235.2   224.2
vc1dsp.vc1_inv_trans_8x8_rvv_i32: 340.7   327.2
2024-07-03 18:16:36 +03:00
Rémi Denis-Courmont
78e1565f84 lavc/vc1dsp: fuse multiply-adds in R-V V inv_trans_4
T-Head C908 (cycles):            before   after
vc1dsp.vc1_inv_trans_4x4_rvv_i32: 128.0   120.0
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 244.0   240.0
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 239.2   235.2
2024-07-03 18:16:36 +03:00
Leo Izen
d69e522523 avcodec/pngenc: fix mDCv typo
When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct.

Typo originally introduced in 7894904141.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-07-03 10:21:17 -04:00
Leo Izen
c1af34c25b avcodec/pngdec: fix mDCv typo
When mDCv support was added, there was a typo in both variable names
and also the MKTAG itself, incorrectly listing it as mDVc. The tag name
stands for Mastering Display Color Volume so mDCv is correct. See other
files such as av1dec.c which uses mdcv.

Typo originally introduced in c7a57b0f70.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-07-03 10:21:06 -04:00
James Almer
d241edc2b4 fftools/ffmpeg_opt: add missing codec type to some options
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-03 08:26:44 -03:00
Anton Khirnov
901f7e3f72 fftools/ffmpeg_mux_init: make encoder_opts local to ost_add()
It is no longer needed after this function returns.
2024-07-03 11:38:52 +02:00
Anton Khirnov
9a7686e545 fftools/ffmpeg_mux_init: apply encoder options manually
Do not pass an options dictionary to the avcodec_open2() in enc_open().

This is cleaner and more robust, as previously various bits of code
would try to interpret the contents of the options dictionary, with
varying degrees of correctness. Now they can just access the encoder
AVCodecContext directly.

Cf. 372c78dd42 - analogous change for
decoding.

A non-progressive field order is now written on the container level in
interlaced ProRes encoding tests.
2024-07-03 11:38:52 +02:00
Anton Khirnov
f1664aabb1 fftools/ffmpeg: rewrite checking whether codec AVOptions have been used
Share the code between encoding and decoding. Instead of checking every
stream's options dictionary (which is also used for other purposes),
track all used options in a dedicated dictionary.
2024-07-03 11:38:52 +02:00
Rajiv Harlalka
fc446eea05 tests/fate/filter-audio.mak: add test for atempo audio filter
Signed-off-by: Rajiv Harlalka <rajivharlalka009@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-03 11:37:40 +02:00
Yotam Ofek
a9c05eb657 avcodec/aaccoder_twoloop: remove unread max scaler 2024-07-03 02:51:37 +02:00
Yotam Ofek
b5ad997e72 avcodec/aaccoder_twoloop: remove unused macro
seems the `sclip` macro was never used
2024-07-03 02:51:09 +02:00
Marvin Scholz
ac60ad1872 avcodec/aacdec_usac: Fix array size
The array in ff_aac_usac_mdst_filt_cur that is passed to that has a size
of 7 elements, not 6 and the code in the function accesses the array at
index 6, which would be out of bounds if the size was actually 6.

Fixes: CID1603196
2024-07-03 02:48:27 +02:00
Michael Niedermayer
c296d4fdec avfilter/vf_avgblur: Check plane instead of AVFrame
Fixes: CID1551694 Use after free (false positive based on assuming that out == in and one is freed and one used)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:25 +02:00
Michael Niedermayer
34f821e448 avfilter/drawutils: Fix depthb computation
Fixes: CID1496940 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Michael Niedermayer
aab0c344c5 avfilter/avf_showcwt: Check av_parse_video_rate() for failure
Fixes: CID1539147 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Michael Niedermayer
0d0373de3b avformat/rdt: Check pkt_len
Fixes: CID1473553 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Michael Niedermayer
ca237a841e avformat/mpeg: Check len in mpegps_probe()
Fixes: CID1473590 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:23 +02:00
Michael Niedermayer
64df7d4c1e avformat/mov: Check requested_sample before using it
I am not sure the case described by coverity is possible
but its more robust checking the argument first

Fixes: CID1598441 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:23 +02:00
Michael Niedermayer
a469e48b6d avformat/mxfenc: resurrects the error print
Fixes: CID1524681 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:23 +02:00
Michael Niedermayer
4c285bb278 avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure
Fixes: CID1591939 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:22 +02:00
Michael Niedermayer
86cd7c68bc avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure
Fixes: CID1591911 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:22 +02:00
Michael Niedermayer
63ecce9ba8 avcodec/vc1_loopfilter: Factor duplicate code in vc1_b_h_intfi_loop_filter()
Fixes: CID1435168

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:22 +02:00
Michael Niedermayer
97ae47f9e9 avcodec/vvc/ctu: Remove dead ret check
Fixes: CID1560040 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:21 +02:00
Michael Niedermayer
d22a33710a avcodec/vvc/dec: Remove constant eos_at_start
Fixes: CID1560041 'Constant' variable guards dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:21 +02:00
Michael Niedermayer
4824156fa0 avformat/img2dec: assert no pipe on ts_from_file
Help coverity with CID1500302 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:21 +02:00
Michael Niedermayer
385784a148 avcodec/cbs_jpeg: Try to move the read entity to one side in a test
The checked entity should be alone on one side of the check, this avoids
complex considerations of overflows.
This fixes a issue of bad style in our code and a coverity issue.

Fixes: CID1439654 Untrusted pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:20 +02:00
Michael Niedermayer
4bca147415 fftools/ffplay: Check vulkan_params
Fixes: CID1550133 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:20 +02:00
Michael Niedermayer
ed364444f1 fftools/ffmpeg_sched: Remove dead assignments in sch_dec_send()
Fixes: CID1592383 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:20 +02:00
Michael Niedermayer
68f6063e04 fftools/ffmpeg_mux_init: Cleanup on error return in set_dispositions()
Fixes: CID1539099 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:19 +02:00
Michael Niedermayer
7b48360907 fftools/ffmpeg_mux: Remove unneeded initialization
Not sure this change makes sense, the code is more robust with ret set

Fixes: CID1559178 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:19 +02:00
Michael Niedermayer
935d9a5712 fftools/ffmpeg_enc: Initialize Decoder
Fixes: CID1591439 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:19 +02:00
Michael Niedermayer
462bd44b03 fftools/ffmpeg_enc: Initialize fd
Fixes: CID1520677 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:18 +02:00
Michael Niedermayer
97b2ab15de fftools/ffmpeg_enc: simplify opaque_ref check
Found-while-revieweing: CID1520670 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:18 +02:00
Michael Niedermayer
2882d30e3a avformat/mov: Check edit list for overflow
Fixes: 67492/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5778297231310848
Fixes: signed integer overflow: 2314885530818453536 + 7782220156096217088 cannot be represented in type 'long'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:18 +02:00
Mars Zuo
09a62a6413 swresample/swresample: Rectify invalid function in the documentation
The function av_opt_set_channel_layout has been removed since
version 7.0, and the replacement is av_opt_set_chlayout.
The documentation needs to be updated accordingly.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:17 +02:00
Michael Niedermayer
34fd247c3b fftools/ffmpeg: Check read() for failure
Fixes: CID1591932 Ignoring number of bytes read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:17 +02:00
Michael Niedermayer
6398242bb2 avcodec/vvc/dec: Check ff_init_cabac_decoder() for failure
Fixes: signed integer overflow: 1107820800 + 1107820800 cannot be represented in type 'int'
Fixes: left shift of 1091059712 by 6 places cannot be represented in type 'int'
Fixes: 69910/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5162839971528704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:17 +02:00
Michael Niedermayer
ca4ff242d8 MAINTAINERS: Add Timo Rothenpieler to server admins
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:16 +02:00
Tong Wu
e783e45e29 avcodec/hw_base_encode: avoid getting FFHWBaseEncodeContext from avctx
This patch is to make FFHWBaseEncodeContext a standalone component
and avoid getting FFHWBaseEncodeContext from avctx->priv_data.
This patch also removes some unnecessary AVCodecContext arguments.

For receive_packet call, a small wrapper is introduced.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
0ba10f2d75 Changelog: add D3D12VA HEVC encoder changelog
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
ba0c14e6bf avcodec: add D3D12VA hardware HEVC encoder
This implementation is based on D3D12 Video Encoding Spec:
https://microsoft.github.io/DirectX-Specs/d3d/D3D12VideoEncoding.html

Sample command line for transcoding:
ffmpeg.exe -hwaccel d3d12va -hwaccel_output_format d3d12 -i input.mp4
-c:v hevc_d3d12va output.mp4

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
d822146f4f avutil/hwcontext_d3d12va: add Flags for resource creation
Flags field is added to support diffferent resource creation.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
fc25b7866a avcodec/vaapi_encode: extract a free funtion to base layer
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
6403ad77e3 avcodec/vaapi_encode: extract a get_recon_format function to base layer
Surface size and block size parameters are also moved to base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
88b70b8883 avcodec/vaapi_encode: extract set_output_property to base layer
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
3ca740f19c avcodec/vaapi_encode: extract gop configuration and two options to base layer
idr_interval and desired_b_depth are moved to HW_BASE_ENCODE_COMMON_OPTIONS.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
1242abdcee avcodec/vaapi_encode: extract the init and close function to base layer
Related parameters such as device context, frame context are also moved
to base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
aa82340b0c avcodec/vaapi_encode: move the dpb logic from VAAPI to base layer
Move receive_packet function to base. This requires adding *alloc,
*issue, *output, *free as hardware callbacks. HWBaseEncodePicture is
introduced as the base layer structure. The related parameters in
VAAPIEncodeContext are also extracted to HWBaseEncodeContext. Then DPB
management logic can be fully extracted to base layer as-is.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
f303c26292 avcodec/vaapi_encode: move pic->input_surface initialization to encode_alloc
When allocating the VAAPIEncodePicture, pic->input_surface can be
initialized right in the place. This movement simplifies the send_frame
logic and is the preparation for moving vaapi_encode_send_frame to the base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
dea5204b41 avcodec/vaapi_encode: add picture type name to base
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
ff06343d7e avcodec/vaapi_encode: add async_depth to common options
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
ab944e06bc avcodec/hw_base_encode: add FF_HW_ prefix for two enums
PICTURE_TYPE_* and FLAG_* are added FF_HW_ prefix after being moved to
base layer.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Tong Wu
3747bf0426 avcodec/vaapi_encode: introduce a base layer for vaapi encode
Since VAAPI and future D3D12VA implementation may share some common parameters,
a base layer encode context is introduced as vaapi context's base.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Anton Khirnov
e939f02ce6 lavc/hevcdec: improve check for PPS changing between slices
Compare actual PPS objects rather than just PPS ID, as the former might
change while the latter stays the same.

Reported-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 09:55:39 +02:00
Anton Khirnov
5861576f39 lavc/hevcdec: move export_stream_params() from set_sps() to hevc_frame_start()
The only other caller of set_sps() --- hevc_update_thread_context() ---
does not need to call export_stream_params(), since it only updates
AVCodecContext fields that have already been updated by generic code.
2024-07-02 09:55:39 +02:00
Anton Khirnov
99b0c3dc7c lavc/hevcdec: do not pass a pixel format to set_sps()
It is merely copied to AVCodecContext.pix_fmt, which serves no useful
purpose. set_sps() is called from two places:
* when a new SPS becomes active - then the pixel format is
  overridden immediately after the set_sps() call by the result from
  ff_get_format();
* when a new SPS is propagated across frame threads - then the
  AVCodecContext value is already set to the same value by the generic
  code.
2024-07-02 09:55:39 +02:00
Anton Khirnov
5295650655 lavc/hevcdec: do not call export_stream_params_from_sei() in update_thread_context()
It is redundant, since it only sets AVCodecContext fields that are
already copied by the generic code.
2024-07-02 09:55:39 +02:00
Anton Khirnov
fd69700e51 lavc/hevcdec: call export_stream_params_from_sei() before ff_get_buffer()
So that correct values of color_trc are set on the allocated frame.
2024-07-02 09:55:39 +02:00
Jiasheng Jiang
4065ff69a2 avcodec/mpegvideo_enc: Add check for av_packet_new_side_data()
Add check for av_packet_new_side_data() to avoid null pointer
dereference if allocation fails.

Fixes: bdc1220eeb ("h263enc: Add an option for outputting info about MBs as side data")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-07-02 09:55:24 +02:00
Andrew Sayers
5d54a25eea avfilter/af_afade: fix opt_type for nb_samples/ns
The actual value is an int64_t, and is accessed elsewhere as AV_OPT_TYPE_INT64.
2024-07-01 23:16:44 +02:00
Marth64
4dc204ea3e avformat/dvdvideodec: Fix duration logic with 1 chapter and validate chapter range
Chapters and duration are calculated together in dvdvideo demuxer.
Previous chapter calculation logic treated extraction of 1 chapter
using chapter_start and chapter_end switches incorrectly, returning
the duration of the entire title instead of just the segment.

Fix the logic so that it calculates and returns the duration of the
chapter segment instead. Additionally, validate that chapter_end
exceeds chapter_start (except in the special case of 0).

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-01 22:54:00 +02:00
Marth64
0c1c7688ea avformat/dvdvideodec: Do not EOF on WAIT events
A DVDNAV_WAIT event by itself should not warrant an
EOF when navigating the program stream. Some discs
have WAIT events in the middle of a title, causing
playback to end prematurely prior to this fix.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-07-01 22:53:54 +02:00
Stefano Sabatini
3764b8ecdb lavfi: add Perlin noise generator 2024-07-01 22:31:02 +02:00
Josh Allmann
c9151ea507 avcodec/nvenc: fix segfault in intra-only mode
In intra-only mode, frameIntervalP is 0, which means the frame
data array is smaller than the number of surfaces.

Together with using the wrong size on deallocation of the
frame_data_array, this lead to a crash.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-07-01 19:59:01 +02:00
Ramiro Polla
cc6fb1643d avdevice/v4l2: add NV16 and NV24 pixel formats 2024-07-01 13:43:07 +02:00
Rémi Denis-Courmont
b818dff8d8 lavc/vc1dsp: fix potential overflow in R-V V inv_trans_4
Judging by the coefficients, the last round of add/sub can overflow
to 17 bits with a very small probability just as with the 8-point
transform. This is not observed under FATE, but better safe than sorry.
2024-06-30 19:02:32 +03:00
Rémi Denis-Courmont
349c49fd1b lavc/vc1dsp: fix overflow in R-V V inv_trans_8
The last set of additions/subtractions can break the 16-bit limit, and
require 17 bits of precision. This uses widening adds accordingly to fix
the MSS2 FATE tests.

The problem potentially also affects inv_trans_4 with a very low
probability, but this is not reproducible under FATE.
2024-06-30 19:02:32 +03:00
Rémi Denis-Courmont
2c900d4c11 lavc/vc1dsp: factor R-V V inv_trans_8 code 2024-06-30 19:02:32 +03:00
Andreas Rheinhardt
2902ed25b5 avcodec/iirfilter: Move ff_iir_filter() to lavc/tests/iirfilter.c
It is only used by the test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:37:25 +02:00
Andreas Rheinhardt
2330e77c97 avfilter/textutils: Constify ff_expand_text()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:37:06 +02:00
Andreas Rheinhardt
ba457e9adb avfilter/textutils,vf_drawtext,qrencode: Constify function pointers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:37:04 +02:00
Andreas Rheinhardt
5a30b45c0f avcodec/mpeg12dec: Don't adapt (last|next)_pic.linesize for field pics
These values are not read anywhere. Furthermore, since commit
fe6037fd04 the linesize values
of the MPVWorkPictures were wrong for subsequent fields
in a chain of B-pictures (as they are always doubled and no longer
based upon the frame-linesizes) which can eventually lead to overflow.

Finally, it makes no real sense to ever double the linesize
of the reference pictures at all: Even when the current picture
is a field, it can still reference both fields of reference
pictures and therefore the linesize should allow to address
both fields (for the same reason, data is not offset for
reference pictures).

libavcodec/mpeg12dec.c:1304:41: runtime error: signed integer overflow: 4611686018427387904 * 2 cannot be represented in type 'long'

issue: 69732/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEGVIDEO_fuzzer-5123551179374592

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:34:36 +02:00
Andreas Rheinhardt
f26255962c avcodec/aacsbr_template: Remove unused-but-set variable
Also fixes a -Wdeclaration-after-statement.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-30 11:32:27 +02:00
Marton Balint
0d5e3f5a40 avutil/timestamp: avoid possible FPE when 0 is passed to av_ts_make_time_string2()
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-30 09:11:44 +02:00
Rémi Denis-Courmont
d5e603ddc0 lavu/lls: remove useless VSETVL
This changes neither VL nor VTYPE, so it can safely be removed.
2024-06-29 21:03:44 +03:00
James Almer
0b330d8642 avformat/mov: set Stereo3D type when parsing eyes box
If view is defined in the child stri box, then the type must be set to
unspecified, as these boxes don't carry packing information.
Also, don't attach a useless Stereo 3D side data if the stream is monoscopic.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer
8af0919cc6 avutil/stereo3d: add a Stereo3D view to signal that the view is unspecified
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer
1c8b32e19f avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
Given that a video stream/frame may have only one view or both views coded with
the packing information being unavailable, this commit adds a new type value
AV_STEREO3D_UNSPEC for this purpose.
The most common case for this is container level signaling of Stereo3D video
where the specifics are defined at the bitstream level.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer
e0b574c483 avcodec/cbs_h266: move decoded_picture_hash to CBS SEI
It's defined in H.274 as a common SEI message type and not in H.266

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer
826f55d5b3 avcodec/cbs_sei: add support for Frame Packing Arrangement SEI parsing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer
0cb733d276 avfilter/vf_showinfo: don't use sizeof(AVSphericalMapping)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
James Almer
beacdbf4b4 avfilter/vf_showinfo: only print yaw, pitch, and roll if set
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:51 -03:00
James Almer
778096757d avfilter/vf_showinfo: use av_spherical_projection_name()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:57:49 -03:00
James Almer
6da38e11f6 avfilter/vf_showinfo: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:57:49 -03:00
James Almer
3478cf2c2d avfilter/vf_showinfo: print more Stereo 3D fields
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:57:49 -03:00
Dawid Kozinski
3e6c794862 avcodec/evc: Alterations following changes in libxeve
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:20:15 -03:00
Frank Plowman
83b77990c6 lavc/vvc: Always set flags for the current picture
ff_vvc_frame_rpl uses the flags to detect whether a frame is in use.
Therefore, in the case of a CVSS AU (RASL/GDR with
NoOutputBeforeRecoveryFlag) with ph_non_ref_pic_flag = 1, the frame
would be freed before it is used.  Fix this by always marking the
current frame with VVC_FRAME_FLAG_SHORT_REF, as is done by the HEVC
decoder.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-28 21:37:40 +08:00
Ramiro Polla
1fb77347c8 checkasm: add tests for yuv2rgb 2024-06-28 14:49:49 +02:00
Ramiro Polla
a8e2714d82 libavcodec/mjpeg: preserve unclipped last_dc value
Perform av_clip_int16(val) _after_ copying the value to last_dc.

This change ensures that clipping is applied only within the context of
the current block, preventing the propagation of clipped values to
subsequent DC components.

Related commits: c28f648b19 and dffae122d0
Related ticket: 4683
2024-06-28 14:48:23 +02:00
Leo Izen
539d2e989d avcodec/aacdec_lpd: remove unused local variables
int idx, and int first_tcx_flag are set but not used, so this commit
removes their declarations and assignments.
2024-06-28 01:43:52 -04:00
Kacper Michajłow
02b3fc5826 avformat/nuv: return early if header id fails to read
Fixes use of uninitialized value in memcmp below, reported by MSAN.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-27 23:28:46 +02:00
Zhao Zhili
6aeb084c39 avcodec/vvc: Don't create new thread when thread_count is 1
Make its behavior consistent with other decoders, e.g., H.264/H.265.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-27 20:54:42 +08:00
Zhao Zhili
baf3123c1c avutil/executor: Allowing thread_count be zero
Before the patch, disable threads support at configure/build time
was the only method to force zero thread in executor. However,
it's common practice for libavcodec to run on caller's thread when
user specify thread number to one. And for WASM environment, whether
threads are supported needs to be detected at runtime. So executor
should support zero thread at runtime.

A single thread executor can be useful, e.g., to handle network
protocol. So we can't take thread_count one as zero thread, which
disabled a valid usercase.

Other libraries take -threads 0 to mean auto. Executor as a low
level utils doesn't do cpu detect. So take thread_count zero as
zero thread, literally.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-27 20:54:42 +08:00
Frank Plowman
d79c926ab6 lavc/vvc: Validate IBC block vector
From H.266 (V3) (09/2023) p. 321:

It is a requirement of bitstream conformance that the luma block
vector bvL shall obey the following constraints:
- CtbSizeY is greater than or equal to
((yCb + (bvL[ 1 ] >> 4)) & (CtbSizeY − 1)) + cbHeight

This patch checks this is true, which fixes crashes on fuzzed
bitstreams.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-27 20:38:34 +08:00
Frank Plowman
c917c423e0 lavc/vvc: Don't discard return codes
Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-27 20:36:13 +08:00
Gyan Doshi
9a3bc59a38 configure: fix alignment of conditional lib dependencies 2024-06-27 15:12:35 +05:30
Gyan Doshi
27284b7800 configure: fix assignment of dep libs for QR-code filters 2024-06-27 15:12:06 +05:30
Martin Storsjö
75e3b81f75 avcodec/vvcdec: Fix compiling with MSVC 2022 17.8 and older
Versions of MSVC older than 17.9 error out here with the following
error:

    src/libavcodec/vvc/filter.c(815): error C2059: syntax error: '}'
    src/libavcodec/vvc/filter.c(832): error C2065: 'all_zero_bs': undeclared identifier
    src/libavcodec/vvc/filter.c(836): error C2065: 'all_zero_bs': undeclared identifier

This was a regression from 5b9320b209.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-27 11:06:23 +03:00
Michael Niedermayer
1080116658 avcodec/aac/aacdec_usac: Test ac in usac
ff_aac_usac_config_decode() needs AACDecContext to be set but some callers
pass NULL.

Happens only when the LATM decoder is used, and USAC is not supported in
LATM

Fixes: member access within null pointer of type 'AACDecContext' (aka 'struct AACDecContext')
Fixes: 69435/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5733527483121664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:55:11 +02:00
Michael Niedermayer
c221c7422f swscale/output: Avoid undefined overflow in yuv2rgb_write_full()
Fixes: signed integer overflow: -140140 * 16525 cannot be represented in type 'int'
Fixes: 68859/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4516387130245120

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:36 +02:00
Michael Niedermayer
9e6c5b6e86 swscale/output: alpha can become negative after scaling, use multiply
Fixes: left shift of negative value -3245
Fixes: 69047/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6571511551950848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:36 +02:00
Paul B Mahol
c22488f718 avcodec/smcenc: make sure ny/nx are >= 0
(cherry picked from commit 5ad38785e7ad4067a288e9d5e8ce2c4ed2bf584a)

Fixes: out of array read
Fixes: 68939/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMC_fuzzer-587804104884224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:35 +02:00
Michael Niedermayer
4a7220bd5c avcodec/targaenc: Allocate space for the palette
Fixes: out of array access
Fixes: 68927/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TARGA_fuzzer-5105665067515904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:35 +02:00
Michael Niedermayer
d34d4b6a7c avcodec/r210enc: Use av_rescale for bitrate
Fixes: signed integer overflow: 281612954574848 * 65344 cannot be represented in type 'long'
Fixes: 68956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_R210_fuzzer-6459074458746880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:35 +02:00
Michael Niedermayer
228f255b5d avcodec/jfdctint_template: Fewer integer anomalies
Fixes: signed integer overflow: 105788 * -20995 cannot be represented in type 'int'
Fixes: signed integer overflow: 923211729 + 2073948236 cannot be represented in type 'int'
Fixes: signed integer overflow: 1281179284 + 2073948236 cannot be represented in type 'int'
Fixes: 68975/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-6266769177116672
Fixes: 68997/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_KS_fuzzer-6284237161431040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:34 +02:00
Michael Niedermayer
3a9292aff3 avcodec/snowenc: MV limits due to mv_penalty table size
Fixes: out of array read
Fixes: 69673/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5476592894148608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:34 +02:00
Michael Niedermayer
eb9c96a82f avcodec/ratecontrol: Try to keep fps as a rational
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:34 +02:00
Michael Niedermayer
f81602fb3a tools/target_dec_fuzzer: Adjust threshold for MV30
Fixes: 60867/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-6381933108527104
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:33 +02:00
Michael Niedermayer
749994194c tools/target_dec_fuzzer: Adjust threshold for jpeg2000
Fixes: Timeout
Fixes: 57385/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5394334324490240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-26 20:49:25 +02:00
J. Dekker
e61fed8280 avutil/riscv/cpu: fix __riscv_v_min_vlen typo
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-06-26 12:50:02 +02:00
Brad Smith
41190da9e1 aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl
Signed-off-by: Brad Smith <brad@comstyle.com>
2024-06-26 02:06:53 -04:00
Nuo Mi
23531c9776 avcodec/vvcdec: alf, support virtual boundaries
see https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9503377

passed files:
    GDR_A_ERICSSON_2.bit
    GDR_B_NOKIA_2.bit
    GDR_C_NOKIA_2.bit
    VIRTUAL_A_MediaTek_3.bit
    VIRTUAL_B_MediaTek_3.bit
2024-06-25 19:32:17 +08:00
Nuo Mi
3bac5ba861 avcodec/vvcdec: sao, support virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi
17c8b63781 avcodec/vvcdec: deblock, support virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi
80ded9cfe7 avcodec/vvcdec: ps, derive virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi
8b3d1f1fb3 cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi
fc731d8b39 avcodec/vvcdec: misc, constify ALFParams 2024-06-25 19:32:17 +08:00
Nuo Mi
9b532ace02 avcodec/vvcdec: misc, remove unused ALFParams.applied 2024-06-25 19:32:17 +08:00
Nuo Mi
98b6b90601 avcodec/vvcdec: refact out alf_get_edges 2024-06-25 19:32:17 +08:00
Nuo Mi
45d0ba8313 avcodec/vvcdec: misc, reformat ff_vvc_sao_filter 2024-06-25 19:32:17 +08:00
Nuo Mi
a69b07dc79 avcodec/vvcdec: refact, fix naming convention of x0, y0 for sao
it's mismatched with the ff_vvc_sao_filter function declaration
2024-06-25 19:32:17 +08:00
Nuo Mi
ccf1d4172c avcodec/vvcdec: refact out sao_extends_edges 2024-06-25 19:32:17 +08:00
Nuo Mi
200862b144 avcodec/vvcdec: refact out sao_get_edges 2024-06-25 19:32:17 +08:00
Nuo Mi
5b9320b209 avcodec/vvcdec: refact, unify ff_vvc_deblock_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi
16e410aaac avcodec/vvcdec: misc, use POS to simplify filter code 2024-06-25 19:32:17 +08:00
Nuo Mi
a6ea542a34 avcodec/vvcdec: refact, unify {horizontal, vertical}_bs, {horizontal, vertical}_p, {horizontal, vertical}_q 2024-06-25 19:32:17 +08:00
Nuo Mi
cc89832d56 avcodec/vvcdec: refact, unify vvc_deblock_bs_chroma_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi
0a5bbcf0f3 avcodec/vvcdec: refact, unify vvc_deblock_bs_luma_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi
cb6538e9a1 avcodec/vvcdec: refact, unify vvc_deblock_subblock_bs_{horizontal, vertical} 2024-06-25 19:32:17 +08:00
Nuo Mi
0333b97414 checkasm/vvc_alf: ensure right and bottom boundaries are not overwritten by asm 2024-06-25 19:32:17 +08:00
Nuo Mi
6b0e6a98b5 x86/vvc_alf: avoid overwriting for non-16 aligned widths
Previously, the code allowed overwriting on 16-aligned blocks, which was suitable when there were
no picture's virtual boundaries because both CTU sizes and strides were 16-aligned. However, with
picture's virtual boundaries, each CTU is divided into four ALF blocks, leading to potential issues
with overwriting later CTUs.

In cases involving picture virtual boundaries, each ALF block is 8-pixel aligned.
For luma, we consistently ensure an 8-aligned width. For chroma in 4:2:0 format,
we need to account for a 4-aligned width.
2024-06-25 19:32:17 +08:00
Nuo Mi
1fa9f5b17f checkasm/vvc_alf: random select alf virtual boundaries position
A picture's virtual boundaries will split a CTU into 4 ALF blocks.
The ALF virtual boundary may cross or not cross a ALF block.
2024-06-25 19:32:17 +08:00
Nuo Mi
b82ef7c0ba checkasm/vvc_alf: only check the valid filter and classify sizes 2024-06-25 19:32:17 +08:00
James Almer
74035aaed7 avformat/matroskadec: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:11 -03:00
James Almer
f6b29c8773 avformat/mov: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:11 -03:00
James Almer
7c0ebb095d avcodec/mpeg12dec: don't use sizeof(AVStereo3D)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:10 -03:00
James Almer
e6baf4f384 avutil/stereo3d: add a new allocator function that returns a size
av_stereo3d_alloc() is not useful in scenarios where you need to know the
runtime size of AVStereo3D.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-25 00:01:05 -03:00
James Almer
1034296eac avformat/dump: print Stereo3D AVRationals as float
Same as every other rational printed in this file.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-24 20:00:14 -03:00
Timo Rothenpieler
6d4eba51f2 fftools/ffplay_renderer: use correct NULL value for Vulkan type 2024-06-25 00:19:03 +02:00
Lynne
dae12ddb2e lavu/stereo3d: change the horizontal FOV field to a rational
This avoids hardcoding any implementation-specific limitiations as
part of the API, and allows for future expandability.

This also allows API users to more conveniently convert the
values into floats without hardcoding specific conversion constants.

The API was committed a few days ago, so changing this field now
is within the realms of acceptable.
2024-06-24 23:53:25 +02:00
Rémi Denis-Courmont
0d748eec8d configure: detect 64-bit generic platforms
Currently, any unrecognised platform is treated as 32-bit. This should
detect *most* 64-bit platforms, namely LP64 and LLP64 ones.
Unfortunately this will not work for ILP32 ABIs on 64-bit ISAs, but
still better than nothing.
2024-06-24 20:23:32 +03:00
Cosmin Stejerean
c3814d5409 avcodec/dovi_rpudec: fix reading el_bit_depth_minus8
now that we are reading ext_mapping_idc as the upper 8 bits of
el_bit_depth_minus8 we need to use get_ue_golomb_long rather than
get_ue_golomb_31 for reading it
2024-06-24 18:05:20 +02:00
Pierre-Anthony Lemieux
77ab1c773c fate/jpeg2000dec: add support for p0_10.j2k
p0_10.j2k is one of the reference codestreams included in Rec. ITU-T T.803 | ISO/IEC 15444-4.
Adding this test was made possible by commit 6f4a95cfb8.
2024-06-24 08:50:59 -07:00
Timo Rothenpieler
76317e22a6 avformat/tls_schannel: forward AVIO_FLAG_NONBLOCK to tcp stream
Fixes for example rtmps streaming over schannel.
2024-06-24 15:00:27 +02:00
Ramiro Polla
e37a93031e swscale/yuv2rgb: reindent after previous commit 2024-06-24 13:35:22 +02:00
Ramiro Polla
0a08c64588 swscale/yuv2rgb: fix yuv422p input in C code
The C code was silently ignoring the second chroma line on yuv422p
input.
2024-06-24 13:34:53 +02:00
Ramiro Polla
fb8fae864f swscale/yuv2rgb: add macros to simplify code generation 2024-06-24 13:34:28 +02:00
Ramiro Polla
88a402df74 swscale/yuv2rgb: fix conversion for widths not aligned to 8
The C code for some pixel formats (rgb555, rgb565, rgb444, and monob)
was not converting the last pixels on widths not aligned to 8.

NOTE: the last pixel for odd widths is still not converted for any of
      the pixel formats in the C code for yuv2rgb except for monob.
2024-06-24 13:33:53 +02:00
Martin Storsjö
6ec22731ae movenc: Add an option for resilient, hybrid fragmented/non-fragmented muxing
This allows ending up with a normal, non-fragmented file when
the file is finished, while keeping the file readable if writing
is aborted abruptly at any point. (Normally when writing a
mov/mp4 file, the unfinished file is completely useless unless it
is finished properly.)

This results in a file where the mdat atom contains (and hides)
all the moof atoms that were part of the fragmented file structure
initially.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-24 11:24:04 +03:00
Martin Storsjö
4b8ddf71dc movenc: Factorize a function for finishing a written fragment
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-24 11:23:55 +03:00
Lynne
0b67c83b2e aacdec_usac, aacsbr: implement SBR support for USAC
Currently, no eSBR features are supported.
Thankfully, no encoders exist for it yet.
2024-06-23 09:10:15 +02:00
Cosmin Stejerean
0c0e7ec81e avcodec/dovi_rpu: correctly read el_bit_depth_minus8 and ext_mapping_idc
These two fields are coded together into a single 16 bit integer with upper 8
bits for ext_mapping_idc and lower 8 bits for el_bit_depth_minus8.

Furthermore ext_mapping_idc has two components, upper 3 bits and lower 5 bits.

Co-authored-by: Niklas Haas <git@haasn.dev>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-06-22 15:48:25 +02:00
Cosmin Stejerean
cc587e69c6 avutil/dovi_meta: add fields for ext_mapping_idc
Co-authored-by: Niklas Haas <git@haasn.dev>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-06-22 15:48:23 +02:00
James Almer
127545350f avformat/mov: use the updated default value for horizontal_disparity_adjustment in the eyes box
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-21 14:09:25 -03:00
Lynne
d45e20c37b aacdec_usac: remove custom rate_idx and use standard variable for it
m4ac.sampling_index is what aacdec.c uses.
2024-06-21 10:50:22 +02:00
Lynne
a381cbc7c7 aacdec_usac: rename noise_scale to noise_bands
This was a typo.
2024-06-21 10:50:21 +02:00
Lynne
89de2f0de1 aacdec_ac: fix an overread
Fixes reading state->last[i + 1] in ff_aac_ac_get_context for the
last array member.
2024-06-21 10:50:21 +02:00
Lynne
50e5b78b79 aac: expose ff_aac_sample_rate_idx() in aac.h
The rate index is a value important to both encoders and decoders.
USAC needs it as well, so put it into the shared main header.
2024-06-21 10:50:20 +02:00
Lynne
1c3545f053 aacdec_usac: apply specification fix M55715 2024-06-21 10:50:13 +02:00
James Almer
35df214a72 avformat/mxfdec: don't use sizeof(AVMasteringDisplayMetadata)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:04:03 -03:00
James Almer
a91f34aad8 avformat/mov: don't use sizeof(AVMasteringDisplayMetadata)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:04:03 -03:00
James Almer
8a85d3fd39 avformat/matroskadec: don't use sizeof(AVMasteringDisplayMetadata)
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:04:03 -03:00
James Almer
c3606cad9c avutil/stereo3d: set a sane default value for AVRational fields
Prevent potential divisions by 0 when using them immediately after allocation.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:03:55 -03:00
James Almer
1044c09eca avutil/mastering_display_metadata: set a sane default value for AVRational fields
Prevent potential divisions by 0 when using them immediately after allocation.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:02:50 -03:00
James Almer
7f1b590480 avutil/ambient_viewing_environment: set a sane default value for AVRational fields
Prevent potential divisions by 0 when using them immediately after allocation.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:02:50 -03:00
James Almer
5140d8334e ffprobe: always print all Stereo3D fields
ffprobe is meant to generate parseable output, and if a field is present, it
should be printed even if it has a default value.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 17:02:44 -03:00
Andreas Rheinhardt
3a5202d026 avcodec/h261enc: Fix ac_vlc_length tables
These tables are supposed to contain the number of bits needed
to encode a given (run, level) pair. Yet the number of bits
for pairs needing the escape code was wrong (it only contained
the escape code and not the bits needed for run and level).

Furthermore, H.261 (a format with explicit end-of-block codes)
does not work well together with the RLTable API from rl.c:
The EOB code is the first one in ff_h261_rl_tcoeff's VLC table
and has a run value of zero. Therefore the result of get_rl_index()
is off by one for run == 0 and level values with explicit
(run, level) pair.

Fixing this necessitated changing the ref files of the
vsynth*-h261-trellis tests. Both filesizes as well as PSNR
decreased. If one used a qscale value of 11 for this test,
one would have received files with about the same size as
before this patch (with qscale 12), but with better PSNR.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
f3829cc72d avcodec/h261enc: Avoid RLTable when writing macroblock
The RLTable API in rl.c is not well designed for codecs with
an explicit end-of-block code. ff_h261_rl_tcoeff's vlc has
the EOB code as first element (presumably so that the decoder
can check for it via "if (level == 0)") and this implies
that the indices returned by get_rl_index() are off by one
for run == 0 which is therefore explicitly checked.

This commit changes this by adding a simple LUT for the
values not requiring escaping. It is easy to directly
include the sign bit into this, so this has also been done.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
3874442db2 avcodec/h261data: Make some tables non-static
This will allow to avoid the indirection via ff_h261_rl_tcoeff
in future commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
390dbcb8b8 avcodec/mpegvideo_enc: Constify pointers to static storage
These must not be modified (even when they are initialized at runtime
and therefore modifiable).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
b28bf830cd avcodec/motion_est: Optimize dead code away
H.261 does not have B-frames.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
bbb10f1d83 avcodec/h261enc: Inline constants
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
48cdb7d579 avcodec/mpegvideo_dec: Move setting dct_unquant funcs to h263dec.c
It is a better place for it; no non-h263-based decoder needs
these functions any more (both H.261 and the error resilience
code recently stopped doing so).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
64d2bca452 avcodec/rv10: Avoid indirection
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
594723ec38 avcodec/mpegvideo: Move quant_precision to Mpeg4DecContext
It is an MPEG-4-only value; it is always five for the MPEG-4
encoder, so just hardcode this value and move the MpegEncContext
field to Mpeg4DecContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
c735552b0b avcodec/rv10: Use ff_h263_decode_init()
The RV10 and RV20 decoders use ff_h263_decode_mb() and also the
H.263 DSP and VLCs. Despite not calling ff_h263_decode_frame(),
it is nevertheless beneficial to call ff_h263_decode_init()
to reduce code duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
7b539ca3e6 avcodec/mpeg_er: Simplify disabling IDCT
The error resilience code does not make up block coefficients
and therefore zeroes them in order to disable the IDCT.
But this can be done in a simpler manner, namely by setting
block_last_index to a negative value. Doing so also has
the advantage that the dct_unquantize functions are never even
called for those codecs that do not use ff_mpv_reconstruct_mb()
for ordinary decoding (namely RV-30/40 and the VC-1 family).

This approach would not work for intra macroblocks (there is always
at least one coefficient for them and therefore there is no check
for block_last_index for them), but this does not happen at all.
Add an assert for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
fee9520716 avcodec/rv10: Remove write-only assignments
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
eb0beffcb3 avcodec/h261dec: Don't set framerate multiple times
Just do it once during init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
9933dfe103 avcodec/h261dec: Simplify decoding motion vectors
Don't use a LUT to negate followed by a conditional ordinary
negation immediately thereafter. Instead fold the two.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
f793074784 avcodec/h261dec: Unquantize coefficients while parsing them
This is beneficial for performance: When concatenating
the file from the vsynth1-h261 fate-test 100 times,
performance (measured by timing the codec's decode callback)
improved by 9.6%.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
1745d12d67 avcodec/h261enc, msmpeg4: Avoid setting dc_scale_tables unnecessarily
It is unnecessary because ff_mpeg1_dc_scale_table is the default
for both dc_scale_tables.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
65d5ccb808 avcodec/mpeg_er: Don't set block_index unnecessarily
ff_init_block_index() sets MpegEncContext.dest and
MpegEncContext.block_index. The latter is unused by
ff_mpv_reconstruct_mb() (which is what this code is
preparatory for) and dest is overwritten a few lines below.
So don't initialize block_index at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
c41818dc5d avcodec/mpeg4videodec: Don't initialize unused inter_scantable
inter_scantable is only used by the dct_unquantize_h263_inter
functions, yet this is not used by the MPEG-4 decoder at all
(in case H.263 quantization is used, the unquantization already
happens in mpeg4_decode_block()).

Also move the common initialization of ff_permute_scantable()
out of the if.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
0f92fecebb avcodec/mpv_reconstruct_mb_template: Optimize WMV2 code away if possible
The WMV2 decoder does not support lowres, so one can optimize
the WMV2 specific code away in the lowres version of this function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
f694db87ca avcodec/mpegvideo: Join loops when initializing ScanTable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
66709df403 avcodec/mpegvideo_dec: Remove unnecessary FFMIN
No mpegvideo-based decoder supports lowres > 3,
so the FFMIN here are unnecessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
2e5287e519 avcodec/mpv_reconstruct_mb_template: Optimize always-true branch away
There are only two mpegvideo decoders that use another
(software) pixel format than YUV420: MPEG-1/2 and
the MPEG-4 studio profile. Neither of these use this part
of the code, so one can optimize the 422 code away when
this code is compiled for the decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
c1097556c7 avcodec/h261dec: Simplify decoding GOB header
h261_resync() can be completely removed, because
h261_decode_gob_header() checks for a GOB header itself if
gob_start_code_skipped is zero.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:39 +02:00
Andreas Rheinhardt
18b059f208 avcodec/h261dec: Fix UB NULL + 0, remove broken resync code
last_resync_gb is never initialized, causing NULL + 0
in align_get_bits(). In addition to that, the loop is never
entered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
fb1acbc941 avcodec/h261dec: Don't reset gob_start_code_skipped in h261_decode_init()
It always gets reset at the start of h261_decode_frame().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
89a0cec790 avcodec/msmpeg4enc: Combine writing bits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
a1a8a03373 avcodec/mpeg12enc: Pass AVCodecContext* directly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
0c88303c0c avcodec/mpeg12enc: Use AVCodecContext, not priv ctx as logctx
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
1d270e99f9 avcodec/mpeg4videodec: Remove always-false check
All valid values of dc_lum and dc_chrom are in the range 0..9,
because they are initialized via tables with 10 elements.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
963bdac226 avcodec/vc1_block: Simplify resetting coded_block
Everything that init_block_index() sets will be overwritten
a few lines below again, so don't call it and simply calculate
the only thing that is used (namely block_index[0]) manually.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
6e1ca92206 avcodec/vc1_block: Remove unnecessary assignments
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
7bccf63de5 avcodec/mpeg4videodec: Don't initialize unused stuff
Only the intra scantable is used for studio profile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
d197a8d6b6 avcodec/mpeg4videodec: Inline constants
Partitioned macroblocks are always 8bit and not studio profile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
646ace34cd avcodec/h263enc: Remove no-output code
The no-output mode (guarded by AV_CODEC_FLAG2_NO_OUTPUT)
does not provide a noteworthy speedup; in fact, it even
turned out to be slower than the code with the no-output
code removed (ordinary encode: 153259721 decicycles,
noout encode: 153259721; encode with this patch applied:
152451581 decicycles; timings are for encode_frame callbacks
when encoding a 1080p sample to MPEG-4).

(Furthermore, this code was broken for most of its existence
(since 9207dc3b0d) and no one
noticed, so the no-output mode is probably not used at all.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
d40b46f47c avcodec/ituh263enc: Inline constants
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
0b0a4a7e69 avcodec/svq1enc: Stop copying PutBitContext unnecessarily
Possible since 404fe63e23.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
952a32e9a0 avcodec/mpegutils: Don't output wrong mb skip values
The earlier code had two problems:
1. For reference frames that are not directly output (happens unless
low_delay is set), the mb skip values referred to the next reference
frame to be decoded.
2. For non-reference frames, every macroblock was always considered
skipped.
This makes the output (worse than) useless; that no one ever
complained about this shows that this feature is not really used.
It is therefore removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
b2195a238c avcodec/mpegvideo_dec: Don't keep droppable in sync in update_thread_ctx
It is not a stream property, but a property of an individual picture
(in fact, it is only set by the FLV decoder that does not even support
frame threading).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
39660bf964 avcodec/mpegvideo_dec: Don't alloc framesize-bufs in update_thread_ctx
It is always allocated in ff_mpv_frame_start(), so the only
reason to put it into ff_mpeg_update_thread_context()
would be for the case that a frame-threaded decoder
that supports coded fields implements frame-threading.

The only mpegvideo-decoders supporting coded fields
are MPEG-1/2 and VC-1. The latter's bitstream requires
both coded fields to be part of the same access unit/packet,
so that every frame thread will always call ff_mpv_frame_start()
itself. The former only "need" the framesize buffers when
using lowres. If MPEG-1/2 gains frame-threading, one could either
perform framesize allocation in its update_thread_context
or when starting a field.

(Given that the next packet may trigger a reinitialization
due to a frame size change, it was possible for the buffers
that were allocated here to be thrown away unused.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
ba341be095 avcodec/mpeg12dec: Disable allocating scratchpad buffers when possible
They are no longer used by the MPEG-1/2 decoders except when
using lowres.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
3acf351e77 avcodec/mpv_reconstruct_mb_template: Don't unnecessarily copy data
There is no reason to use a temporary buffer as destination
for the new macroblock before copying it into its proper place.
(Originally, this has been added in commit
b68ab2609c due to concerns about
copying from GPU memory.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
c28e553cbf avcodec/mpegutils: Fix ff_draw_horiz_band()
Broken in 5ecf5b93dd.

More precisely, 3994623df2 changed
the precursor of ff_mpv_reconstruct_mb() to always decode
to the first row of macroblocks for B pictures when
a draw_horiz_band callback is set and to (they are exported to
the caller via said callback and each row overwrites the previously
decoded row; this was probably intended as a cache-optimization).
This first macroblock row was used as source for the draw_horiz_band
callback.

This of course means that the ordinary output B-frame was not
decoded correctly at all. Therefore the first aforementioned commit
removed this special handling of draw_horiz_band; yet it did not
remove the special handling for B-frames in ff_draw_horiz_band(),
which broke draw_horiz_band for B-frames. This commit fixes this.

(Actually, draw_horiz_band was already broken before
5ecf5b93dd when using slice-threading:
All slice-threads would write to the first row of macroblocks
for B-frames, leading to data races. It seems no one has ever complained
about this, just as no one has ever complained about the breakage
caused by 5ecf5b93dd. Probably no one
uses draw_horiz_band.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
f8b8f16163 avcodec/mpegvideo_enc: Don't update qscale unnecessarily
The new value will be overwritten in ff_set_qscale() below.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
85cc6478b6 avcodec/mpegvideo_enc: Initialize qscale tab for all codecs
Calling it is the first thing ff_clean_h263_qscales() and
ff_clean_mpeg4_qscales() do anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
3b67ab85ee avcodec/mpegvideo_enc: Only keep what is used from MECmpContext
A MECmpContext is quite big (792B here) and given
how ff_update_duplicate_context() works, it is (unfortunately)
copied quite frequently when using slice threading.
Therefore keep only what is needed from MECmpContext
and remove MECmpContext from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
eb3415912b avcodec/mpegvideo_enc: Avoid branch for sse vs nsse cmp
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
8b4f7c0663 avcodec/me_cmp: Zero MECmpContext in ff_me_cmp_init()
Not every function will be set, so zero the context
to initialize everything.

This also allows to remove an initialization in dvenc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
10e7633cd7 avcodec/motion_est: Store remaining required me_cmp_funcs
This avoids using MpegEncContext.mecc; it already allows
to avoid touching the latter for snowenc and svq1enc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
d163eefd47 avcodec/me_cmp, motion_est: Sanitize permissible cmp_funcs
Several of the potential choices of comparison functions
need an initialized MpegEncContext (initialized for encoding,
not only ff_mpv_common_init()) or they crash when called.
Modify ff_set_cmp() to check for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
b1a31b32ab avcodec/me_cmp,dvenc,mpegvideo: Move ildct_cmp to its users
MECmpContext.ildct_cmp is an array of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

Remove these pointers from MECmpContext and add pointers
for the actually used functions to its users. (The DV encoder
already did so.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
cd2e46a350 avcodec/me_cmp, mpegvideo: Move frame_skip_cmp to MpegEncContext
MECmpContext has several arrays of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

One of these other users is mpegvideo_enc; it is the only user
of MECmpContext.frame_skip_cmp and it only uses one of these
function pointers at all.

This commit therefore moves this function pointer to MpegEncContext;
and removes the array from MECmpContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
182e647a64 avcodec/me_cmp, motion_est: Move me_(pre_)?_cmp etc. to MotionEstContext
MECmpContext has several arrays of function pointers that
are not set by ff_me_cmp_init(), but that are set by users
to one of the other arrays via ff_set_cmp().

One of these other users is the motion estimation API.
It uses MECmpContext.(me_pre|me|me_sub|mb)_cmp. It is
basically the only user of these arrays.

This commit therefore moves these arrays to MotionEstContext;
this has the additional advantage of making motion_est.c
more independent from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
1367ef198a avcodec/me_cmp: Constify ff_set_cmp()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
bbd355355d avcodec/motion_est: Factor one-time initialization out of ff_init_me
The majority of the stuff performed in it needs to be done only
once; so factor it out into a function of its own to be called
in the user's init function.
Also avoid using MpegEncContext in it, to separate the two
a bit more.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
422711d1a5 avcodec/dvenc: Check for availability of interlaced dct cmp func
Not every type of comparison function implements every function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
c46711d44f avcodec/mpegvideo_enc: Check for existence of ildct cmp functions
Not all compare functions are implemented for all compare function
types. Therefore check for the existence of the used functions.
Fixes issue #10245.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
415a3c32c9 avcodec/mpegvideo_enc: Avoid excessive inlining
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
0ef8f0f965 avcodec/ituh263dec: Use VLC symbol table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
010951239c avcodec/mpeg12dec: Use VLC symbol table
Possible by using MB_TYPE_CODEC_SPECIFIC for MB_TYPE_ZERO_MV
and due to the MB_TYPE_*_MV flags fitting into an int16_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
e7d6300c10 avcodec/mpeg4videodec: Use VLC symbol table
Possible now that MB_TYPE_L1 (which does not fit into
an int16_t) is no longer used).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
f161d9449a avcodec/mpegutils: Move H.264-only macros to h264dec.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
f5d5b80f3c avcodec/mpegutils: Don't use MB_TYPE_L[01] for mpegvideo
MB_TYPE_L[01] is based upon H.264 terminology (it stands for
list); yet the mpegvideo based decoders don't have lists
of reference frames, they have at most one forward and one
backward reference. So use terminology based upon this.

This also has a second advantage: MB_TYPE_L[01] is actually
an OR of two flags (which are set independently for H.264,
but aren't for mpegvideo). Switching to different flags
makes the flags fit into an int16_t, which will be useful
in future commits.

The only downside to this is a very small amount of code
in error_resilience.c and mpegutils.c (the only code shared
between the H.264 decoder and mpegvideo).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
07ae09bdf1 avcodec/mpegutils: Remove always-false check
SVQ3 does not call ff_print_debug_info2().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
c94d81ce00 avcodec/h261dec: Remove nonsense information from error message
The "invalid mtype index" here is always -1, because that is
the value the VLC api uses for not existent leafs in an incomplete tree.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
0876b160d6 avcodec/h261dec: Use VLC symbol table
This is possible now that MB_TYPE_CBP and MB_TYPE_QUANT
fit into an int16_t; only MB_TYPE_H261_FIL needs to
be remapped to MB_TYPE_CODEC_SPECIFIC.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
4cdd684e86 avcodec/mpegutils: Remap MB_TYPE_{GMC,SKIP,CBP,QUANT}
Do this to make MB_TYPE_{CBP,QUANT} fit into an int16_t,
so that can be used in a VLC symbol table.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
dd1e804a98 avcodec/mpegutils: Remap MB_TYPE_ACPRED, add codec-specific MB_TYPE
MB_TYPE_ACPRED is currently reused for MB_TYPE_REF0 by H.264,
so that the value fits into an uint16_t. Given that MB_TYPE_ACPRED
is not subject to any such restriction (apart from fitting into
32bits), it can be remapped to a hithereto unused bit.
The then available bit will be declared to be codec-specific
(i.e. unused by generic code), so that H.264 can use it
for MB_TYPE_REF0 and so that it can be reused later for
e.g. MB_TYPE_H261_FIL.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
5805b860fe configure: Remove obsolete mpeg4_decoder->mpeg4video_parser dependency
Obsolete since 3ceffe7839.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
18f1aca3e8 avcodec/mpegvideo_dec: Set dct_unquantize ptrs only once when possible
Everything except dct_unquantize_intra for MPEG-4 need only
be set once.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
091d006637 avcodec/mpegvideo: Set dct_unquantize earlier
Set them in ff_mpv_idct_init() so that they are already set
in ff_mpv_decode_init(). This is in preparation for avoiding
to set dct_unquantize in every ff_mpv_frame_start().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
4339d2c11c avcodec/mpegvideo: Don't pretend dct_init can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
80c2d7c890 avcodec/mpegvideo_enc: Avoid branches for flipping no_rounding
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Andreas Rheinhardt
91fce67691 avcodec/vc1: Combine identical checks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-20 18:58:38 +02:00
Theo Fabi
d6d14b3a15 avdevice/avfoundation: add external video devices
Video devices categorized by AVFoundation as
'AVCaptureDeviceTypeExternal(Unknown)' (like USB video streams) were not
recognized by libavdevice.

Signed-off-by: Theo Fabi <fabi.theo@gmail.com>
2024-06-20 18:52:06 +02:00
Frank Plowman
8d6014dbc6 lavc/vvc: Invalidate PPSs which refer to a changed SPS
When the SPS associated with a particular SPS ID changes, invalidate all
the PPSs which use that SPS ID.  Fixes crashes with illegal bitstreams.
This is done in the CBS, rather than in libavcodec/vvc/ps.c like the SPS
ID reuse validation, as parts of the CBS parsing process for PPSs
depend on the SPS being referred to.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-20 20:33:23 +08:00
Araz Iusubov
02430680b0 libavcodec/amfenc: Update AMF encoder options
Encoder options have been updated to the current version of the AMF.

Signed-off-by: Araz Iusubov <Primeadvice@gmail.com>
2024-06-20 09:12:24 -03:00
Araz Iusubov
696bd64d01 libavcodec/amfenc: Update AMF release version 2024-06-20 09:12:24 -03:00
James Almer
53c8d417ed avformat: split off generic NAL function helpers into their own file
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-20 08:57:45 -03:00
Frank Plowman
0eacad6921 fate/vvc: add vvc-conformance-RPR_A_4
Before    After
-------------------------------------------------
make fate-vvc CPU Time (No ASM)  131.52s  134.83s
libavcodec/vvc/* Line Coverage     95.3%    96.9%
inter_template.c Line Coverage     74.3%    88.2%
inter.c Line Coverage              85.3%    99.2%

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-20 08:57:45 -03:00
James Almer
0ae157b360 avformat/iamf_parse: add missing padding to AAC extradata
Fixes: out of array access
Fixes: 68863/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4833546039525376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-19 10:12:57 -03:00
James Almer
4e608e90eb avformat/evc: fix writing reserved bits
They are all zeroes, not ones.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-19 10:12:50 -03:00
James Almer
5191339f74 avformat/evc: remove useless struct field
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-19 10:03:04 -03:00
Michael Niedermayer
4cab028bd0 avformat/mxfdec: Check container_ul->desc before use
Fixes: CID1592939 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 13:24:31 +02:00
Michael Niedermayer
0da6865ce2 avfilter/qsvvpp: Remove unreachable code
Fixes: CID1598548 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 13:23:07 +02:00
Michael Niedermayer
2b2ced61eb avcodec/libvpxenc: Cleanup on error
This or fifo needs to be freed on errors explicitly

Fixes: memleak
Fixes: 68937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVPX_VP8_fuzzer-4830831016214528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:58:22 +02:00
Michael Niedermayer
7fab9b9761 avformat/iamf_parse: 0 layers are not allowed
Fixes: out of array access
Fixes: 68302/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4665793796177920

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:54:46 +02:00
Michael Niedermayer
c69e6cccd7 avformat/iamf_parse: consider nb_substreams when accessing substreams array
Fixes: out of array access
Fixes: 68584/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6256656668229632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:52:20 +02:00
Michael Niedermayer
97ecfb5a19 MAINTAINERS: Update the entries for the release maintainer for FFmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-19 12:36:02 +02:00
Ramiro Polla
75f1a8e071 swscale/aarch64: add neon {lum,chr}ConvertRange
chrRangeFromJpeg_8_c: 29.2
chrRangeFromJpeg_8_neon: 19.5
chrRangeFromJpeg_24_c: 80.5
chrRangeFromJpeg_24_neon: 34.0
chrRangeFromJpeg_128_c: 413.7
chrRangeFromJpeg_128_neon: 156.0
chrRangeFromJpeg_144_c: 471.0
chrRangeFromJpeg_144_neon: 174.2
chrRangeFromJpeg_256_c: 842.0
chrRangeFromJpeg_256_neon: 305.5
chrRangeFromJpeg_512_c: 1699.0
chrRangeFromJpeg_512_neon: 608.0
chrRangeToJpeg_8_c: 51.7
chrRangeToJpeg_8_neon: 22.7
chrRangeToJpeg_24_c: 149.7
chrRangeToJpeg_24_neon: 38.0
chrRangeToJpeg_128_c: 761.7
chrRangeToJpeg_128_neon: 176.7
chrRangeToJpeg_144_c: 866.2
chrRangeToJpeg_144_neon: 198.7
chrRangeToJpeg_256_c: 1516.5
chrRangeToJpeg_256_neon: 348.7
chrRangeToJpeg_512_c: 3067.2
chrRangeToJpeg_512_neon: 692.7
lumRangeFromJpeg_8_c: 24.0
lumRangeFromJpeg_8_neon: 17.0
lumRangeFromJpeg_24_c: 56.7
lumRangeFromJpeg_24_neon: 21.0
lumRangeFromJpeg_128_c: 294.5
lumRangeFromJpeg_128_neon: 76.7
lumRangeFromJpeg_144_c: 332.5
lumRangeFromJpeg_144_neon: 86.7
lumRangeFromJpeg_256_c: 586.0
lumRangeFromJpeg_256_neon: 152.2
lumRangeFromJpeg_512_c: 1190.0
lumRangeFromJpeg_512_neon: 298.0
lumRangeToJpeg_8_c: 31.7
lumRangeToJpeg_8_neon: 19.5
lumRangeToJpeg_24_c: 83.5
lumRangeToJpeg_24_neon: 24.2
lumRangeToJpeg_128_c: 440.5
lumRangeToJpeg_128_neon: 91.0
lumRangeToJpeg_144_c: 504.2
lumRangeToJpeg_144_neon: 101.0
lumRangeToJpeg_256_c: 879.7
lumRangeToJpeg_256_neon: 177.2
lumRangeToJpeg_512_c: 1794.2
lumRangeToJpeg_512_neon: 354.0
2024-06-18 23:12:41 +02:00
Niklas Haas
90579fbb90 avcodec/dovi_rpudec: handle errors consistently
Only flush state when we started parsing data, otherwise just error out.
Remove the 'fail' label to make this a bit less confusing to read.
2024-06-18 21:18:30 +02:00
Niklas Haas
0a5ed91e5e avcodec/dovi_rpudec: reject reserved_zero_3bits != 0
This is used by future versions of the spec to implement metadata
compression. Given that we don't yet implement that spec, validate that
this is equal to 0 for now.
2024-06-18 21:18:30 +02:00
Niklas Haas
d9f902d3a4 avcodec/dovi_rpu: guard ext blocks by dm_metadata_present
In the spec, dm_metadata_present also toggles all extension blocks, so
we need to move them inside the branch.
2024-06-18 21:18:30 +02:00
Niklas Haas
5e778cbfd5 avcodec/dovi_rpu: move ff_dovi_rpu_generate to correct section
This is not an internal use function.
2024-06-18 21:18:30 +02:00
Niklas Haas
7bf08a5b2d avcodec/dovi_rpu: simplify vdr type
Storing the color metadata alongside the data mapping is no longer
needed, so we can simplify this array's type.
2024-06-18 21:18:30 +02:00
Niklas Haas
ae7bff55df avcodec/dovi_rpudec: simplify vdr handling (cosmetic)
Move `vdr` into local scope and point only to the field we actually care
about.
2024-06-18 21:18:30 +02:00
Niklas Haas
7ee64631f6 avcodec/dovi_rpu: fix dm_metadata_id handling
Despite the suggestive size limits, this metadata ID has nothing to do
with the VDR metadata ID used for the data mappings. Actually, the
specification leaves them wholly unexplained, other than acknowleding
their existence. Must be some secret dolby sauce. They're not even
involved in DM metadata compression, which is handled using an entirely
separate ID.

That leaves us with a lack of anything sensible to do with these IDs.
Since we unfortunately only expose one `dm_metadata_id` field to the
user, just ensure that they match; which appears to always be the case
in practice. If somebody ever hits this error, I would really much
rather like to see the triggering file.
2024-06-18 21:18:30 +02:00
Niklas Haas
68a22ac936 avcodec/dovi_rpu: properly handle vdr_dm_metadata_present
When this is 0, the metadata is explicitly inferred to stated default
values from the spec, rather than inferred from the previous frame's
values.

Likewise, when encoding, instead of checking if the value changed since
the last frame, we need to check if it differs from the default.
2024-06-18 21:18:30 +02:00
Niklas Haas
e1b91eb195 avdovi/dovi_rpudec: handle prev_vdr_rpu_id failures
According to the spec, missing previous VDR RPU IDs do not constitute an
error, but we should instead fallback first to VDR RPU with ID 0, and
failing that, synthesize "neutral" metadata.

That's nontrivial though as the resulting metadata will be dependent on
other properties of the RPU, and this case is not hit in practice so
I'll defer it to a rainy day.
2024-06-18 21:18:30 +02:00
Niklas Haas
954f890f95 avcodec/dovi_rpudec: validate L2.ms_weight
This is specified to be in the range -1 to 4095, apparently the only
extension level with such a restriction.
2024-06-18 21:17:36 +02:00
Niklas Haas
e07b735a99 avcodec/dovi_rpudec: add return code to parse_ext_v* 2024-06-18 21:17:30 +02:00
Derek Buitenhuis
620f6f7d5b avformat/dump: Print all possible Stereo3D info
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 19:54:35 +01:00
James Almer
0c0be4b99e fate/lavf-container: add extract_extradata BSF dependency to lavf-fate-hevc.mp4
Otherwise a bunch of SEI units that should not be in hvcC will be included,
and generate different output with builds where extract_extradata_bsf is not
present.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-18 15:47:59 -03:00
James Almer
89779a3cbe fate/lavf-container: add a hevc in ISOBMFF remux test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-18 12:47:44 -03:00
Derek Buitenhuis
8e7ca22b36 avformat/mov: Add support for reading and exporting horizontal field of view
These boxes are created by the Apple Vision Pro and the iPhone 15+ when
capture for the Vision Pro is enabled.

Based off of the swift API:
  * https://developer.apple.com/documentation/coremedia/kcmformatdescriptionextension_horizontalfieldofview

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis
5c17376321 avformat/mov: Add support for exporting Video Extension Usage info
This box is provided by files created by the Apple Vision Pro, as well
as the iPhone 15+ when capture for Vision Pro is enabled.

The boxes are a mix of things documented by Apple in some PDFs, their
API docs, and reverse engineering. Ideally we will have a real spec
one day.

Links:
  * https://developer.apple.com/av-foundation/Stereo-Video-ISOBMFF-Extensions.pdf
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis
049dfe3f65 fftools/ffprobe: Print more Stereo 3D info from side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis
cf2436a0b4 avutil/stereo3d: Fill out stereo info provided by Vision Pro files
Based on what is in the files themselves, and what the API provides
to users.

URLs:
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline
  * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment
  * https://developer.apple.com/documentation/coremedia/kcmformatdescriptionextension_horizontalfieldofview

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Derek Buitenhuis
57bfba35d6 avutil/spherical: Add more spherical types
These originate from the Apple Vision Pro, and are documented here:

    https://developer.apple.com/documentation/coremedia/cmprojectiontype

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-06-18 14:47:40 +01:00
Andreas Rheinhardt
b515088576 avcodec/loongarch/Makefile: Fix vc1dsp_lasx.o build criterion
Fixes ticket #11057.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-18 11:49:27 +02:00
Zhao Zhili
e598a323dc avutil/macos_kperf: Fix assert which makes kperf failed to run
On m1, kpc_get_counter_count(KPC_MASK) return 8 in my test. The
exact value doesn't matter in our case, as long as we have a
sufficiently large array

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-18 15:24:12 +08:00
Zhao Zhili
ec1daa39e0 avutil/timer: Fix missing header for mach_absolute_time
mach/mach_time.h was included only when CONFIG_MACOS_KPERF wasn't
been defined.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-18 15:24:02 +08:00
Zhao Zhili
74b4e550cb tests/checkasm: Remove check on linux perf fd in uninit
The check should be >= 0, not > 0. The check itself is redundant
since uninit only being called after init is success.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-18 15:23:46 +08:00
sfan5
c28e5b597e lavf/tls_mbedtls: add workaround for TLSv1.3 vs. verify=0
As of mbedTLS 3.6.0 TLSv1.3 is enabled by default and certificate verification
is now mandatory. Our default configuration does not do verification, so
downgrade to 1.2 in these situations to avoid breaking it.

ref: https://github.com/Mbed-TLS/mbedtls/issues/7075

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-18 07:23:44 +02:00
Martin Storsjö
ab8f7030bc aarch64: Use cntvct_el0 as timer register on Android and macOS
The default timer register pmccntr_el0 usually requires enabling
access with e.g. a kernel module (while it is accessible by
default on Windows). On Linux, the default for checkasm benchmarks
is to use perf (if suitable headers are available) though.

On macOS, using cntvct_el0 gives measurements with the same
magnitude as mach_absolute_time (which is used currently), but
possibly with a little less overhead/noise.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-17 14:00:34 +03:00
James Almer
fcf72966a5 swscale/x86/range_convert: add missing AVX2 preprocessor wrapper
Fixes compilation with old yasm.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-16 10:09:38 -03:00
Andreas Rheinhardt
7c95c7de4a avcodec/libx265: Don't copy A53 closed captions by default
The SEI handling of libx265 is buggy and can easily lead
to memory corruption: It reuses certain buffers, but when
reusing them it presumes that it is enough for these buffers
to exist and does not check whether they are actually large
enough to hold what is intended to be stored in them.*

Our users are exposed to this because forwarding A53 CC data
is enabled by default. Change this to make it disabled
by default.

"Fixes" tickets #10411, #11052 and (presumably) #10906.

*: See https://trac.ffmpeg.org/ticket/9666#comment:1

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-16 12:30:59 +02:00
James Almer
fa325379c9 fate/checkasm: run the sw_range_convert test
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-15 21:02:06 -03:00
James Almer
8a4c9d6bd3 swscale/x86/range_convert: reduce amount of xmm regs clobbered in luma functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-15 21:02:06 -03:00
Ramiro Polla
f6859cade3 swscale/x86: add sse2 and avx2 {lum,chr}ConvertRange
chrRangeFromJpeg_8_c: 22.3
chrRangeFromJpeg_8_sse2: 13.3
chrRangeFromJpeg_8_avx2: 13.3
chrRangeFromJpeg_24_c: 72.8
chrRangeFromJpeg_24_sse2: 22.3
chrRangeFromJpeg_24_avx2: 17.5
chrRangeFromJpeg_128_c: 345.5
chrRangeFromJpeg_128_sse2: 106.0
chrRangeFromJpeg_128_avx2: 57.8
chrRangeFromJpeg_144_c: 380.5
chrRangeFromJpeg_144_sse2: 118.5
chrRangeFromJpeg_144_avx2: 62.3
chrRangeFromJpeg_256_c: 646.3
chrRangeFromJpeg_256_sse2: 218.8
chrRangeFromJpeg_256_avx2: 109.0
chrRangeFromJpeg_512_c: 1461.5
chrRangeFromJpeg_512_sse2: 426.5
chrRangeFromJpeg_512_avx2: 211.5
chrRangeToJpeg_8_c: 37.8
chrRangeToJpeg_8_sse2: 10.5
chrRangeToJpeg_8_avx2: 14.0
chrRangeToJpeg_24_c: 114.3
chrRangeToJpeg_24_sse2: 23.5
chrRangeToJpeg_24_avx2: 16.3
chrRangeToJpeg_128_c: 633.5
chrRangeToJpeg_128_sse2: 107.5
chrRangeToJpeg_128_avx2: 55.0
chrRangeToJpeg_144_c: 758.3
chrRangeToJpeg_144_sse2: 132.0
chrRangeToJpeg_144_avx2: 64.5
chrRangeToJpeg_256_c: 1345.0
chrRangeToJpeg_256_sse2: 218.0
chrRangeToJpeg_256_avx2: 105.3
chrRangeToJpeg_512_c: 2524.0
chrRangeToJpeg_512_sse2: 417.0
chrRangeToJpeg_512_avx2: 218.8
lumRangeFromJpeg_8_c: 11.8
lumRangeFromJpeg_8_sse2: 11.0
lumRangeFromJpeg_8_avx2: 10.3
lumRangeFromJpeg_24_c: 38.5
lumRangeFromJpeg_24_sse2: 15.5
lumRangeFromJpeg_24_avx2: 12.5
lumRangeFromJpeg_128_c: 232.3
lumRangeFromJpeg_128_sse2: 60.0
lumRangeFromJpeg_128_avx2: 26.8
lumRangeFromJpeg_144_c: 259.5
lumRangeFromJpeg_144_sse2: 65.3
lumRangeFromJpeg_144_avx2: 29.0
lumRangeFromJpeg_256_c: 464.5
lumRangeFromJpeg_256_sse2: 107.5
lumRangeFromJpeg_256_avx2: 54.0
lumRangeFromJpeg_512_c: 897.5
lumRangeFromJpeg_512_sse2: 224.5
lumRangeFromJpeg_512_avx2: 109.8
lumRangeToJpeg_8_c: 17.8
lumRangeToJpeg_8_sse2: 11.0
lumRangeToJpeg_8_avx2: 11.8
lumRangeToJpeg_24_c: 56.3
lumRangeToJpeg_24_sse2: 11.0
lumRangeToJpeg_24_avx2: 12.5
lumRangeToJpeg_128_c: 333.8
lumRangeToJpeg_128_sse2: 53.3
lumRangeToJpeg_128_avx2: 26.5
lumRangeToJpeg_144_c: 375.5
lumRangeToJpeg_144_sse2: 60.8
lumRangeToJpeg_144_avx2: 29.0
lumRangeToJpeg_256_c: 652.0
lumRangeToJpeg_256_sse2: 109.5
lumRangeToJpeg_256_avx2: 53.5
lumRangeToJpeg_512_c: 1284.3
lumRangeToJpeg_512_sse2: 218.0
lumRangeToJpeg_512_avx2: 108.3
2024-06-16 00:35:51 +02:00
Ramiro Polla
874152033d checkasm: add tests for {lum,chr}ConvertRange 2024-06-16 00:34:24 +02:00
Osamu Watanabe
6f4a95cfb8 avcodec/jpeg2000dec: fix tilepart processing
Fix http://trac.ffmpeg.org/ticket/10121

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-06-15 10:25:17 -07:00
Thomas Siedel
c75940db29 avcodec: add external enc libvvenc for H266/VVC
Add external encoder VVenC for H266/VVC encoding.
Register new encoder libvvenc.
Add libvvenc to wrap the vvenc interface.
libvvenc implements encoder option: preset,qp,qpa,period,
passlogfile,stats,vvenc-params,level,tier.
Enable encoder by adding --enable-libvvenc in configure step.

Co-authored-by: Christian Bartnik chris10317h5@gmail.com
Signed-off-by: Thomas Siedel <thomas.ff@spin-digital.com>
2024-06-15 21:00:05 +08:00
Rémi Denis-Courmont
4e4444f97c configure: remove stray bfin architecture
This seems to have been omitted in
880e2aa236.
2024-06-14 21:28:11 +03:00
Rémi Denis-Courmont
4819aeebf4 avr32: remove explicit support
The vendor has long since switched to Arm, with the last product
reaching their official end-of-life over 11 years ago. Linux support for
the ISA was dropped 7 years ago. More importantly, this architecture was
never supported by upstream GCC, and the vendor fork is stuck at version
4.2, which FFmpeg no longer supports (as per C11 requirement).

Presumably, this is still the case given the lack of vendor support.
Indeed all of the code being removed here consisted of inline assembler
scalar optimisations. A sane C compiler should be able to perform those
automatically nowadays (with the sole exception of fast CLZ detection),
but this is moot as this architecture is evidently dead.
2024-06-14 21:28:10 +03:00
Tomas Härdin
be2cabce32 lavu/intmath.h: Fix UB in ff_ctz_c() and ff_ctzll_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin
3b9e457647 lavu/common.h: Fix UB in av_clip_uintp2_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin
60ab40be70 lavu/common.h: Fix UB in av_clip_intp2_c()
Found by value analysis
2024-06-14 14:28:25 +02:00
Tomas Härdin
818a487849 lavu/common.h: Fix UB in av_clipl_int32_c()
Found by value analysis
2024-06-14 14:28:24 +02:00
Niklas Haas
6225ad5c19 avcodec/dovi_rpu{enc,dec}: fix ms_weight handling
The code as written was wrong. In the spec, these fields are treated
merely as plain integers in the range 0 to 4095. The only difference
between L2 and L8 is that L2.ms_weight also accepts an additional value
of -1, hence the extra sign bit. While it's likely that these are still
shifted integers in disguise, since all real-world samples seem to use
a value of 2048 here, the offset used in the code was wrong.

In addition, because the l8.ms_weight struct member is unsigned, these
wrong shifting semantics ended up overflowing the field, leading to
undefined behavior when transcoding. Fortunately, the damage was
relatively contained in practice, because it just corrupts the coding of
this field, which is ignored in practice in all implementations I have
seen.
2024-06-14 13:43:55 +02:00
James Almer
08383443ff avcodec/vorbisdec: don't use double intermediate in vorbisfloat2float
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer
1b9af306da avcodec: use the renamed av_zero_extend
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer
4b57ea8fc7 avutil/common: assert that bit position in av_zero_extend is valid
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:36:09 -03:00
James Almer
39c90d6466 avutil: rename av_mod_uintp2 to av_zero_extend
It's more descriptive of what it does.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 20:35:57 -03:00
Sean McGovern
cdd139d760 libavcodec/alpha: remove DSP & support code
Introduced in 1992, the Alpha was a 64-bit RISC processor designed
to replace the VAX CISC machines sold by Digital Equipment Corporation.

After Digital was acquired by Compaq in 1998 -- who themselves would be
later purchased by Hewlett-Packard, the architecture was phased out over
the following decade. It became effectively defunct in 2007, the last
publicly available processor being the Alpha 21364.

FFmpeg has not added any DSP code for this architecture since lowres2
was introduced in 2012, and it is more than unlikely someone still wishes
to maintain it.

Remove the DSP and support code.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2024-06-13 23:14:26 +02:00
Rémi Denis-Courmont
a5d2d26742 sh4: remove architecture
Support for SuperH was dropped over a decade ago. There no longer is any
architecture-specific code to be found, so just remove the corresponding
test. Technically it is still possible to compile FFmpeg as the
"generic" (pure C) architecture.
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont
c5f69719bc lavu/bswap: remove some inline assembler
C code or compiler built-ins are preferable over inline assembler for
byte-swaps as it allows for better optimisations (e.g. instruction
scheduling) which would otherwise be impossible.

As with f64c2e710f for x86 and Arm,
this removes the inline assembler on GCC (and Clang) since we now
require recent enough compiler versions. This indeed seems to work on
AArch64, SuperH and, if Zbb is enabled, RISC-V. (AVR32 was not tested
since it has no known working compilers at this time.)
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont
0231097d1b lavu/x86: remove GCC 4.4- stuff
Since the C11 support is required, those GCC versions can no longer be
supported anyhow. (Clang pretends to be GCC 4.4, but it looks like the
code was intended for old GCC specifically.)
2024-06-13 21:16:16 +03:00
Rémi Denis-Courmont
424ac84839 lavu/arm: remove GCC 4.6- stuff
Since the C11 support is required, those GCC versions can no longer be
supported anyhow. (Clang pretends to be GCC 4.4, but the removed code
does not seem to have been intended for Clang.)
2024-06-13 21:16:16 +03:00
James Almer
a7e9f1c1e7 checkasm/lls: add missing random values to the test buffers
Fixes valgrind warnings after 18adaf9fe5.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-13 14:21:18 -03:00
Anton Khirnov
0060a368b1 lavc/hevcdec: always call hevc_frame_end() after successfully decoding an AU
Currently it is only done if the final CTB address is at the end of the
frame, however that address is not known with hwaccel decoding. As we
only support exactly one AU per packet, and not partial/multiple AUs, we
can just as well call hevc_frame_end() unconditionally.

Fixes hwaccel decoding after d725c737fe.

Reported-by: llyyr <llyyr.public@gmail.com>
2024-06-13 11:44:05 +02:00
Michael Niedermayer
959cb2e2e3 doc/developer: Provide information about git send-email and gmail
The 2 links are the clearest i found.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-13 00:39:57 +02:00
Marton Balint
9fb6f024c3 avformat/mxfdec: use the newly added channel ids for more exact mapping
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
Marton Balint
d9a0a6a2b5 avformat/mov_chan: make iso_channel_position table more compact
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
Marton Balint
e405afdd0a avformat/mov_chan: use the newly added channel ids for more exact mapping
Also make the iso_channel_position table consistent with what the AAC decoder
uses in avcodec/aac/aacdec_usac.c.

Fate changes are caused by the change of how 7.1 layout is mapped, previously
it included Side Surround channels, now it includes the Surround channels.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-06-12 19:37:01 +02:00
sunyuechi
a4901a56c6 lavc/vp8dsp: R-V V bilin_load to bilin_load_h
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-06-12 18:38:41 +03:00
sunyuechi
8d9fb7b5cf lavc/vp8dsp: R-V V put_bilin_h v unroll
Since len < 64, the registers are sufficient, so it can be
directly unrolled (a4 is even).

Another benefit of unrolling is that it reduces one load operation
vertically compared to horizontally.

                                 old                 new
                             C908   X60          C908   X60
vp8_put_bilin4_h_c         :    6.2    5.5     :    6.2    5.5
vp8_put_bilin4_h_rvv_i32   :    2.2    2.0     :    1.5    1.5
vp8_put_bilin4_v_c         :    6.5    5.7     :    6.2    5.7
vp8_put_bilin4_v_rvv_i32   :    2.2    2.0     :    1.2    1.5
vp8_put_bilin8_h_c         :   24.2   21.5     :   24.2   21.5
vp8_put_bilin8_h_rvv_i32   :    5.2    4.7     :    3.5    3.5
vp8_put_bilin8_v_c         :   24.5   21.7     :   24.5   21.7
vp8_put_bilin8_v_rvv_i32   :    5.2    4.7     :    3.5    3.2
vp8_put_bilin16_h_c        :   48.0   42.7     :   48.0   42.7
vp8_put_bilin16_h_rvv_i32  :    5.7    5.0     :    5.2    4.5
vp8_put_bilin16_v_c        :   48.2   43.0     :   48.2   42.7
vp8_put_bilin16_v_rvv_i32  :    5.7    5.2     :    4.5    4.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-06-12 18:38:41 +03:00
Frank Plowman
d72a5fe719 lavc/vvc: Prevent overflow in chroma QP derivation
On the top of p. 112 in VVC (09/2023):

It is a requirement of bitstream conformance that the values of
qpInVal[ i ][ j ] and qpOutVal[ i ][ j ] shall be in the range
of −QpBdOffset to 63, inclusive for i in the range of 0 to
numQpTables − 1, inclusive, and j in the range of 0 to
sps_num_points_in_qp_table_minus1[ i ] + 1, inclusive.

Additionally, don't discard the return code from sps_chroma_qp_table.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-12 20:48:08 +08:00
Andreas Rheinhardt
edcfa846cf api/api-band-test: Query codec capabilities to decide admissibility
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
b8cc5cf233 api/api-band-test: Perform codec admissibility check earlier
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
4c22b00780 api/api-band-test: Remove write-only variable
Besides being write only it had the wrong type:
An uint8_t is definitely not enough to store the size
of these buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 14:29:30 +02:00
Andreas Rheinhardt
89742b88c6 avcodec/mpegvideo_enc: Don't pretend ff_dct_encode_init() can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:25:10 +02:00
Andreas Rheinhardt
1dc1b6c5af avcodec/mpegvideo: Remove fast_dct_quantize
It has been added in 3a87ac948f,
but there was never an implementation different from the ordinary
dct_quantize of it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:24:20 +02:00
Andreas Rheinhardt
e80bd068c5 avcodec/mpegvideo_enc: Always set c funcs in ff_dct_encode_init()
Use the common approach whereby the _c versions are set first
and then (potentially) overwritten by the arch-specific ones
instead of calling the arch-specific code first, followed by
setting the function pointers that have not already been set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:24:09 +02:00
Andreas Rheinhardt
8327828205 avcodec/mips/mpegvideo: Set denoise_dct only for encoder
The C version is set in ff_dct_encode_init(), yet the MIPS version
is set in dct_init() (in ff_mpv_common_init() and therefore also
for decoders). This commit fixes this inconsistency.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:23:30 +02:00
Andreas Rheinhardt
adb1521385 avcodec/mpegvideo_enc: Move initializing H263DSP to ituh263enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:23:29 +02:00
Andreas Rheinhardt
bf8208d0cd avcodec/mpegvideo_enc: Make ff_dct_quantize_c() static
Only used here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:20:47 +02:00
Andreas Rheinhardt
f0c021b6ff avcodec/dnxhdenc: Remove always-false check
Always false since 49331f7ba3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 13:20:41 +02:00
Andreas Rheinhardt
1fe2a97b61 avcodec/vc1_pred: Fix indentation
Forgotten after 41f9742053.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:07:49 +02:00
Andreas Rheinhardt
bf087a7e26 avcodec/mpegvideo_enc: Binarize reference
The H.264 decoder used reference to store its picture_structure
into it; yet it does not use mpegvideo any more since commit
2c54155407. Afterwards commit
629259bdb5 removed the last remnants.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:07:31 +02:00
Andreas Rheinhardt
34ed9d1954 avcodec/ituh263enc: Remove redundant check
It is redundant due to the identical check in ff_mpv_encode_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:07:20 +02:00
Andreas Rheinhardt
b2ac792367 avcodec/mpegvideo: Use enum for msmpeg4_version
Improves readability.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:03:00 +02:00
Andreas Rheinhardt
2f6768c761 avcodec/mpegvideo: Remove pblocks
It has been added in a579db0c4f
due to XvMC, but today it is only used to swap U and V
for VCR2, a MPEG-2 variant with U and V swapped.
This can be done in a simpler fashion, namely by simply
swapping the U and V pointers of the corresponding
MPVWorkPictures.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:02:31 +02:00
Andreas Rheinhardt
1f5c64cbdc avcodec/mpeg12dec: Don't initialize inter_scantable
MPEG-1/2 only needs one scantable and therefore all code
already uses the intra one. So stop initializing
the inter one altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:02:14 +02:00
Andreas Rheinhardt
9bb35cfa4d avcodec/mpeg12dec: Pass Mpeg1Context* in mpeg_field_start()
Avoids a cast.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:02:03 +02:00
Andreas Rheinhardt
c703a519a5 avcodec/mpegvideo_dec: Don't sync encoder-only coded_picture_number
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:01:42 +02:00
Andreas Rheinhardt
a13ca893cf avcodec/mpegvideo_dec, rv34: Simplify check for "does pic exist?"
The days in which an MPVPicture* is set with the corresponding frame
being blank are over; this allows to simplify some checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 12:01:27 +02:00
Andreas Rheinhardt
7e61e77c4e avcodec/mpeg12enc: Simplify writing startcodes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:56:06 +02:00
Andreas Rheinhardt
4f2719a239 avcodec/mpegvideo_enc: Unify initializing PutBitContexts
This also rids us of the requirement to preserve the PutBitContext
in ff_update_duplicate_context().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:55:44 +02:00
Andreas Rheinhardt
a05eebee99 avcodec/mpegpicture: Avoid MotionEstContext in ff_mpeg_framesize_alloc()
Only set the ScratchpadContext and let the users that need it
(i.e. encoders) set the MotionEstContext stuff themselves.
Also add an explicit pointer to ScratchpadContext to point
to the allocated buffer so that none of the other scratchpad
pointers is singled out as being used for the allocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:54:57 +02:00
Andreas Rheinhardt
d0f76e6a11 avcodec/mpegpicture: Use union for b_scratchpad and rd_scratchpad
These pointers point to the same buffers, so one can just
use a union for them and avoid synchronising one of them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:54:47 +02:00
Andreas Rheinhardt
12fcbff446 avcodec/mpegpicture: Avoid loop and branch when setting motion_val
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:54:08 +02:00
Andreas Rheinhardt
45cf0541cf avcodec/mpegpicture: Use ThreadProgress instead of ThreadFrame API
Given that MPVPictures are already directly shared between threads
in case of frame-threaded decoding, one can simply use it to
pass decoding progress information between threads. This allows
to avoid one level of indirection; it also means avoids allocations
(of the ThreadFrameProgress structure) in case of frame-threading
and indeed makes ff_thread_release_ext_buffer() decoder-only
(actually, H.264-decoder-only).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:53:49 +02:00
Andreas Rheinhardt
5475000942 avcodec/mpeg4videoenc: Simplify writing startcodes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:53:20 +02:00
Andreas Rheinhardt
4ef98a43ee avcodec/mpeg4videoenc: Avoid branch for writing stuffing
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:52:32 +02:00
Andreas Rheinhardt
9ce56f91c0 avcodec/mpegpicture: Make MPVPicture refcounted
Up until now, an initialized MpegEncContext had an array of
MPVPictures (way more than were ever needed) and the MPVPicture*
contained in the MPVWorkPictures as well as the input_picture
and reordered_input_picture arrays (for the encoder) pointed
into this array. Several of the pointers could point to the
same slot and because there was no reference counting involved,
one had to check for aliasing before unreferencing.
Furthermore, given that these pointers were not ownership pointers
the pointers were often simply reset without unreferencing
the slot (happened e.g. for the RV30 and RV40 decoders) or
there were moved without resetting the src pointer (happened
for the encoders where the entries in the input_picture
and reordered_input_picture arrays were not reset).
Instead actually releasing these pictures was performed by looping
over the whole array and checking which one of the entries needed
to be kept. Given that the array had way too many slots (36),
this meant that more than 30 MPVPictures have been unnecessarily
unreferenced in every ff_mpv_frame_start(); something similar
happened for the encoder.

This commit changes this by making the MPVPictures refcounted
via the RefStruct API. The MPVPictures itself are part of a pool
so that this does not entail constant allocations; instead,
the amount of allocations actually goes down, because the
earlier code used such a large array of MPVPictures (36 entries) and
allocated an AVFrame for every one of these on every
ff_mpv_common_init(). In fact, the pool is only freed when closing
the codec, so that reinitializations don't lead to new allocations
(this avoids having to sync the pool in update_thread_context).

Making MPVPictures refcounted also has another key benefit:
It makes it possible to directly share them across threads
(when using frame-threaded decoding), eliminating ugly code
with underlying av_frame_ref()'s; sharing these pictures
can't fail any more.

The pool is allocated in ff_mpv_decode_init() for decoders,
which therefore can fail now. This and the fact that the pool
is not unreferenced in ff_mpv_common_end() also necessitated
to mark several mpegvideo-decoders with the FF_CODEC_CAP_INIT_CLEANUP
flag.

*: This also means that there is no good reason any more for
ff_mpv_common_frame_size_change() to exist.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:47:49 +02:00
Andreas Rheinhardt
99d26939af avcodec/mpegvideo_dec: Add close function for mpegvideo-decoders
Currently identical to the H.261 and H.263 close functions
(which it replaces). It will be extended in future commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:44:13 +02:00
Andreas Rheinhardt
b90b676409 avformat/riff: Declare VCR2 to be MPEG-2
This brings it in line with mpeg12dec.c.
(This entry has been added before the MPEG2VIDEO codec id
existed.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:44:10 +02:00
Andreas Rheinhardt
5ea7c0e323 avcodec/mpeg12dec: Set out_format only once
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:44:03 +02:00
Andreas Rheinhardt
bbe10bcae8 avcodec/mpeg12dec: Remove write-only assignment
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:59 +02:00
Andreas Rheinhardt
2f22fd7ec1 avcodec/mpeg12dec: Only initialize IDCT for IPU
This is all that is used. This is in preparation for further
commits that will extend ff_mpv_decode_init() in a way
that will make it possible to fail and require cleanup.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:48 +02:00
Andreas Rheinhardt
183a67580b avcodec/mpeg12dec: Don't initialize inter tables for IPU
IPU is intra-only.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:30 +02:00
Andreas Rheinhardt
dceb73a22d avcodec/mpegvideo_enc: Reindentation
Also try to use loop-scope for iterators.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:22 +02:00
Andreas Rheinhardt
b64dfe2bd1 avcodec/mpegvideo_enc: Return early when getting length of B frame chain
Possible now that this is a function of its own.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:43:14 +02:00
Andreas Rheinhardt
17b5fc2e51 avcodec/mpegvideo_enc: Factor setting length of B frame chain out
It already avoids a goto and will be useful in the future
to be able to specify each functions tasks and obligations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:42:59 +02:00
Andreas Rheinhardt
17501b2267 avcodec/error_resilience: Deduplicate cleanup code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:42:24 +02:00
Andreas Rheinhardt
fe6037fd04 avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary Pic
There are two types of MPVPictures: Three (cur_pic, last_pic, next_pic)
that are directly part of MpegEncContext and an array of MPVPictures
that are separately allocated and are mostly accessed via pointers
(cur|last|next)_pic_ptr; they are also used to store AVFrames in the
encoder (necessary due to B-frames). As the name implies, each of the
former is directly associated with one of the _ptr pointers:
They actually share the same underlying buffers, but the ones
that are part of the context can have their data pointers offset
and their linesize doubled for field pictures.

Up until now, each of these had their own references; in particular,
there was an underlying av_frame_ref() to sync cur_pic and cur_pic_ptr
etc. This is wasteful.

This commit changes this relationship: cur_pic, last_pic and next_pic
now become MPVWorkPictures; this structure does not have an AVFrame
at all any more, but only the cached values of data and linesize.
It also contains a pointer to the corresponding MPVPicture, establishing
a more natural relationsship between the two.
This already means that creating the context-pictures from the pointers
can no longer fail.

What has not been changed is the fact that the MPVPicture* pointers
are not ownership pointers and that the MPVPictures are part of an
array of MPVPictures that is owned by a single AVCodecContext.
Doing so will be done in a latter commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:38:13 +02:00
Andreas Rheinhardt
dac15a5b6e avcodec/vc1_mc: Don't check AVFrame INTERLACE flags
Instead cache these values in VC1Context to avoid the indirection
and AND.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:37:33 +02:00
Andreas Rheinhardt
59422955cf avcodec/mpegpicture: Rename Picture->MPVPicture
Picture is just too generic.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:36:09 +02:00
Andreas Rheinhardt
2dfe7c1e40 avcodec/mpegvideo_enc: Move copying properties to alloc_picture()
This way said function sets everything (except for the actual
contents of the frame's data). Also rename it to prepare_picture()
given its new role.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:32:35 +02:00
Andreas Rheinhardt
8225d2da73 avcodec/mpegvideo_enc: Pass AVFrame*, not Picture* to alloc_picture()
It now only deals with the AVFrame and no longer with the accessories.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:32:25 +02:00
Andreas Rheinhardt
89ca63cc9c avcodec/mpegpicture: Split ff_alloc_picture() into check and alloc part
ff_alloc_picture() currently does two things: It checks the
consistency of the linesize (which should not be necessary, but is)
and it allocates certain buffers. (It does not actually allocate
the picture buffers, so its name is misleading.)
This commit splits it into two separate functions. The rationale
for this is that for the encoders, every picture needs its linesizes
checked, but not every picture needs these extra buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:27:25 +02:00
Andreas Rheinhardt
042117da75 avcodec/mpegpicture: Improve error messages and code
Make it clear that this is not a failure of get_buffer/the user,
but a deficit of mpegvideo.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:27:15 +02:00
Andreas Rheinhardt
8c59b5aa6b avcodec/vc1_pred: Remove unused function parameter
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:27:04 +02:00
Andreas Rheinhardt
dda009b97d avcodec/mpegvideo: Add const where appropriate
Specifically, add const to the pointed-to-type of pointers
that point to something static or that belong to last_pic
or next_pic (because modifying these might lead to data races).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:26:51 +02:00
Andreas Rheinhardt
f1c4e8950e avcodec/rv30, rv34, rv40: Avoid indirection
Use the cached values from MpegEncContext.(cur|last|next)_pic
instead of the corresponding *_pic_ptr.
Also do the same in wmv2dec.c and mpegvideo_enc.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:22:41 +02:00
Andreas Rheinhardt
7814dd77aa avcodec/mpegpicture: Cache AVFrame.data and linesize values
This avoids an indirection and is in preparation for removing
the AVFrame from MpegEncContext.(cur|last|next)_pic altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:20:56 +02:00
Andreas Rheinhardt
1c40a17922 avcodec/mpegpicture: Reduce value of MAX_PLANES define
No mpegvideo based codec supports alpha.
While just at it, also make the define shorter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:20:27 +02:00
Andreas Rheinhardt
ec1eba792a avcodec/mpegvideo: Shorten variable names
current_picture->cur_pic, last_picture->last_pic, similarly
for new_picture and next_picture.
Also rename the corresponding *_ptr fields.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:44 +02:00
Andreas Rheinhardt
3a4e7694a1 avcodec/mpegvideo: Restrict resetting mbskip_table to MPEG-4 decoder
This is done due to invalid input and therefore the encoder is not
affected by it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:39 +02:00
Andreas Rheinhardt
47e43c19cb avcodec/h263: Move setting mbskip_table to decoder/encoders
This removes a branch from H.263 based decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:17 +02:00
Andreas Rheinhardt
9645eeb485 avcodec/mpegvideo: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:19:15 +02:00
Andreas Rheinhardt
101ed72c2f avcodec/h263, mpeg(picture|video): Only allocate mbskip_table for MPEG-4
It is the only user of said table and doing so is especially
important given that this buffer is zeroed every time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:14:32 +02:00
Andreas Rheinhardt
2cbca73975 avcodec/h263: Move encoder-only part out of ff_h263_update_motion_val()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:14:13 +02:00
Andreas Rheinhardt
bed17eba47 avcodec/mpegpicture: Use RefStruct-pool API
It involves less allocations and therefore has less
potential errors to be checked. One consequence thereof
is that updating the picture tables can no longer fail.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:13:03 +02:00
Andreas Rheinhardt
6450cfcd10 avcodec/mpegpicture: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:12:59 +02:00
Andreas Rheinhardt
788892d647 avcodec/mpegvideo, mpegpicture: Add buffer pool
This avoids constant allocations+frees and will also allow
to simply switch to the RefStruct API, thereby avoiding
the overhead of the AVBuffer API.
It also simplifies the code, because it removes the "needs_realloc"
field: It was added in 435c0b87d2,
before the introduction of the AVBuffer API: given that these buffers
may be used by different threads, they were not freed immediately
and instead were marked as being freed later by setting needs_realloc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:08:19 +02:00
Andreas Rheinhardt
a95591dbfd avcodec/mpegvideo: Redo aligning mb_height for VC-1
VC-1 can switch from between being progressive and interlaced
on a per-frame basis. In the latter case, the number of macroblocks
is aligned to two (or equivalently, the height to 32); therefore
certain buffers are allocated for the bigger mb_height
(see 950fb8acb4 and
017e234c20).

This commit changes how this is done: Aligning these buffers is
restricted to VC-1 and it is done directly by aligning
mb_height (but not MpegEncContext.mb_height) instead of
adding something in an ad-hoc manner.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:05:12 +02:00
Andreas Rheinhardt
7ad13e173b avcodec/mpegpicture: Always reset mbskip_table
Codecs call ff_find_unused_picture() to get the index of
an unused picture; said picture may have buffers left
from using it previously (these buffers are intentionally
not unreferenced so that it might be possible to reuse them;
they are only reused when they are writable, otherwise
they are replaced by new, zeroed buffers). They should
not make any assumptions about which picture they get.

Yet this is not true for mbskip_table and damaged bitstreams.
When one returns old unused slots randomly, the output
becomes nondeterministic. This can't happen now (see below),
but it will be possible once mpegpicture uses proper pools
for the picture tables.

The following discussion uses the sample created via
ffmpeg -bitexact -i fate-suite/svq3/Vertical400kbit.sorenson3.mov -ps 50 -bf 2 -bitexact -an -qscale 5 -ss 40 -error_rate 4 -threads 1 out.avi

When decoding this with one thread, the slots are as follows:
Cur 0 (type I), last -1, Next -1; cur refcount -1, not reusing buffers
Cur 1 (type P), last -1, Next 0; cur refcount -1, not reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount -1, not reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 0 (type P), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 1, reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 2, not reusing buffers
Cur 1 (type P), last 1, Next 0; cur refcount 2, not reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount 1, reusing buffers
Cur 2 (type B), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 0 (type I), last 0, Next 1; cur refcount 2, not reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 1, reusing buffers
Cur 2 (type B), last 1, Next 0; cur refcount 2, not reusing buffers
Cur 1 (type P), last 1, Next 0; cur refcount 2, not reusing buffers

After the slots have been filled initially, the buffers are only
reused for the first B-frame in a B-frame chain:
a) When the new picture is an I or a P frame, the slot of the backward
reference is cleared and reused for the new frame (as has been said,
"cleared" does not mean that the auxiliary buffers have been
unreferenced). Given that not only the slot in the picture array,
but also MpegEncContext.last_picture contain references to these
auxiliary buffers, they are not writable and are therefore not reused,
but replaced by new, zero-allocated buffers.
b) When the new picture is the first B-frame in a B-frame chain,
the two reference slots are kept as-is and one gets a slot that
does not share its auxiliary buffers with any of MpegEncContext.
current_picture, last_picture, next_picture. The buffers are
therefore writable and are reused.
c) When the new picture is a B-frame that is not the first frame
in a B-frame chain, ff_mpv_frame_start() reuses the slot occupied
by the preceding B-frame. Said slot shares its auxilary buffers
with MpegEncContext.current_picture, so that they are not considered
writable and are therefore not reused.

When using frame-threading, the slots are made to match the one
from the last thread, so that the above analysis is mostly the same
with one exception: Other threads may also have references to these
buffers, so that initial B-frames of a B-frame chain need no longer
have writable/reusable buffers. In particular, all I and P-frames
always use new, zeroed buffers. Because only the mbskip_tables of
I- and P-frames are ever used, it follows that there is currently
no problem with using stale values for them at all.

Yet as the analysis shows this is very fragile:
1. MpegEncContext.(current|last|next)_picture need not have
references of their own, but they have them and this influences
the writability decision.
2. It would not work if the slots were returned in a truely random
fashion or if there were a proper pool used.

Therefore this commit always resets said buffer. This is in preparation
for actually adding such a pool (where the checksums for said sample
would otherwise be depending on the number of threads used for
decoding).

Future commits will restrict this to only the codecs for which
it is necessary (namely the MPEG-4 decoder).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:01:24 +02:00
Andreas Rheinhardt
71ff9217f7 avcodec/mpegpicture: Always reset motion val buffer
Codecs call ff_find_unused_picture() to get the index of
an unused picture; said picture may have buffers left
from using it previously (these buffers are intentionally
not unreferenced so that it might be possible to reuse them;
this is mpegvideo's version of a bufferpool). They should
not make any assumptions about which picture they get.
Yet somehow this is not true when decoding OBMC: Returning
random empty pictures (instead of the first one) leads
to nondeterministic results; similarly, explicitly
rezeroing the buffer before handing it over to the codec
changes the outcome of the h263-obmc tests, but it makes it
independent of the returned pictures. Therefore this commit
does so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:01:07 +02:00
Andreas Rheinhardt
caac9740f8 avcodec/mpegvideo: Only allocate cbp_table, pred_dir_table when needed
Namely for the MPEG-4 decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 11:00:57 +02:00
Andreas Rheinhardt
582d828f75 avcodec/mpegvideo: Don't reset coded_block unnecessarily
coded_block is only used for I-frames, so it is unnecessary
to reset it in ff_clean_intra_table_entries() (which
cleans certain tables for a non-intra MB).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:54:27 +02:00
Andreas Rheinhardt
ba033acb56 avcodec/mpegvideo: Only allocate coded_block when needed
It is only needed for msmpeg4v3, wmv1, wmv2 and VC-1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:54:08 +02:00
Andreas Rheinhardt
1a5c21daee avcodec/msmpeg4enc: Only calculate coded_cbp when used
With this patch, msmpeg4v1 and msmpeg4v2 no longer use
MpegEncContext.coded_block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:53:23 +02:00
Andreas Rheinhardt
60d4c8a137 avcodec/mpegvideo_motion: Avoid constant function argument
Always 8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:53:13 +02:00
Andreas Rheinhardt
55e81306bf avcodec/mpegvideo_motion: Optimize check away
When !CONFIG_SMALL, we create separate functions for FMT_MPEG1
(i.e. for MPEG-1/2); given that there are only three possibilities
for out_format (FMT_MPEG1, FMT_H263 and FMT_H261 -- MJPEG and SpeedHQ
are both intra-only and do not have motion vectors at all, ergo
they don't call this function), one can optimize MPEG-1/2-only code
away in mpeg_motion_internal().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:51:16 +02:00
Andreas Rheinhardt
5f505995db avcodec/mpegvideo_motion: Optimize check away
Only MPEG-2 can have field motion vectors with coded fields.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:50:57 +02:00
Andreas Rheinhardt
f44d212e0e avcodec/mpegvideo_motion: Remove dead checks for existence of reference
These references now always exist due to dummy frames.
Also remove the corresponding checks in the lowres code
in mpegvideo_dec.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:50:39 +02:00
Andreas Rheinhardt
c85508f5a9 avcodec/mpeg12dec: Allocate dummy frames for non-I fields
MPEG-2 allows to pair an intra field (as first field) together
with a P-field. In this case a conformant bitstream has to satisfy
certain restrictions in order to ensure that only the I field
is used for prediction. See section 7.6.3.5 of the MPEG-2
specifications.

We do not check these restrictions; normally we simply allocate
dummy frames for reference in order to avoid checks lateron.
This happens in ff_mpv_frame_start() and therefore does not happen
for a second field. This is inconsistent. Fix this by allocating
these dummy frames for the second field, too.

This already fixes two bugs:
1. Undefined pointer arithmetic in prefetch_motion() in
mpegvideo_motion.c where it is simply presumed that the reference
frame exists.
2. Several MPEG-2 hardware accelerations rely on last_picture
being allocated for P pictures and next picture for B pictures;
e.g. VDPAU returns VDP_STATUS_INVALID_HANDLE when decoding
an I-P fields pair because the forward_reference was set incorrectly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:50:12 +02:00
Andreas Rheinhardt
73676dd47a avcodec/mpegpicture: Mark dummy frames as such
This will allow to avoid outputting them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:49:57 +02:00
Andreas Rheinhardt
99543c93ec avcodec/mpegvideo_dec: Factor allocating dummy frames out
This will allow to reuse it to allocate dummy frames for
the second field (which can be a P-field even if the first
field was an intra field).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:49:24 +02:00
Andreas Rheinhardt
a30c95ed8a avcodec/mpegvideo_dec: Sync linesize and uvlinesize between threads
linesize and uvlinesize are supposed to be the common linesize of all
the Y/UV-planes of all the currently cached pictures.
ff_mpeg_update_thread_context() syncs the pictures, yet it did not sync
linesize and uvlinesize. This mostly works, because ff_alloc_picture()
only accepts new pictures if they coincide with the linesize of the
already provided pictures (if any).  Yet there is a catch: Linesize
changes are accepted when the dimensions change (in which case the
cached frames are discarded).

So imagine a scenario where all frame threads use the same dimension A
until a frame with a different dimension B is encountered in the
bitstream, only to be instantly reverted to A in the next picture. If
the user changes the linesize of the frames upon the change to dimension
B and keeps the linesize thereafter (possible if B > A),
ff_alloc_picture() will report an error when frame-threading is in use:
The thread decoding B will perform a frame size change and so will the
next thread in ff_mpeg_update_thread_context() as well as when decoding
its picture. But the next thread will (presuming it is not the same
thread that decoded B, i.e. presuming >= 3 threads) not perform a frame
size change, because the new frame size coincides with its old frame
size, yet the linesize it expects from ff_alloc_picture() is outdated,
so that it errors out.

It is also possible for the user to use the original linesizes for
the frame after the frame that reverted back to A; this will be
accepted, yet the assumption that of all pictures are the same
will be broken, leading to segfaults.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:49:03 +02:00
Andreas Rheinhardt
d4b63885a6 avcodec/mpegpicture: Store linesize in ScratchpadContext
The mpegvideo-based codecs currently require the linesize to be
constant (except when the frame dimensions change); one reason
for this is that certain scratch buffers whose size depend on
linesize are only allocated once and are presumed to be correctly
sized if the pointers are != NULL.

This commit changes this by storing the actual linesize these
buffers belong to and reallocating the buffers if it does not
suffice. This is not enough to actually support changing linesizes,
but it is a start. And it is a prerequisite for the next patch.

Also don't emit an error message in case the source ctx's
edge_emu_buffer is unset in ff_mpeg_update_thread_context().
It need not be an error at all; e.g. it is a perfectly normal
state in case a hardware acceleration is used as the scratch
buffers are not allocated in this case (it is easy to run into
this issue with MPEG-4) or if the src context was not initialized
at all (e.g. because the first packet contained garbage).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:47:44 +02:00
Andreas Rheinhardt
0aaabe1fd7 avcodec/get_buffer: Remove redundant check
It is unnecessary to check for whether the number of planes
of an already existing audio pool coincides with the number
of planes to use for the frame: If the common format of both
is planar, then the number of planes coincides with the number
of channels for which there is already a check*; if not,
then both the existing pool as well as the frame use one pool.

*: In fact, one could reuse the pool in this case even if the
number of channels changes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:37:16 +02:00
Andreas Rheinhardt
2786d34712 avcodec/ratecontrol: Avoid padding in RateControlEntry
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:37:11 +02:00
Andreas Rheinhardt
685cda26aa avcodec/mpegvideo, ratecontrol: Remove write-only skip_count
Write-only since 6cf0cb8935.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:37 +02:00
Andreas Rheinhardt
68a06640b1 avcodec/ratecontrol: Don't call ff_rate_control_uninit() ourselves
It is currently done inconsistently: Only one error path
(namely the one from init_pass2()) made ff_rate_control_init()
call ff_rate_control_uninit(); in other error paths
cleanup was left to the caller.

Given that the only caller of this function already performs
the necessary cleanup this commit changes this to always
rely on the caller to perform cleanup on error.

Also return the error code from init_pass2().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:30 +02:00
Andreas Rheinhardt
0c9e04b0e2 avcodec/ratecontrol: Pass RCContext directly in ff_rate_control_uninit()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:16 +02:00
Andreas Rheinhardt
ba28222a14 avcodec/ratecontrol: Fix double free on error
Happens on init_pass2() failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-12 10:36:01 +02:00
Lynne
bdd3c6ca50 aacdec_usac: always zero out alpha_q values for stereo streams
The issue is that if a frame has no complex stereo prediction,
the alpha values must all be assumed to be zero if the next frame
has complex prediction and uses delta coding.
2024-06-12 03:33:45 +02:00
Lynne
d79fbad366 aacdec_usac: rename spectrum decode function and remove unused arg
The LC part of the decoder combines scalefactor application with
spectrum decoding, and this was the plan here, but that's not possible,
so change the function name.
2024-06-12 03:33:45 +02:00
Lynne
11a8e0a4e5 aacdec_usac: dequantize scalefactors after noise synthesis
The issue here is that the spec implied that the offset is done
on the dequantized scalefactor, but in fact, it is done on the
scalefactor offset. Delay dequantizing the scalefactors until
after noise synthesis is performed, and change to apply the
offset onto the offset.
2024-06-12 03:33:38 +02:00
Haihao Xiang
a4630d479a lavu/hwcontext_vulkan: Support write on drm frame
Otherwise nothing is written into the destination when a write mapping
is requested.

For example, a vulkan frame mapped from a drm frame (which is wrapped as
a vaapi frame in the example) is used as the output of scale_vulkan
filter, it always gets a green screen without this patch.

ffmpeg -init_hw_device vaapi=va -init_hw_device vulkan=vulkan@va
-filter_hw_device vulkan -f lavfi -i testsrc=size=352x288,format=nv12
-vf
"hwupload,scale_vulkan,hwmap=derive_device=vaapi:reverse=1,format=vaapi,hwdownload,format=nv12"
-f nut - | ffplay -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-06-12 01:53:18 +02:00
Michael Niedermayer
9c9f095e30 avfilter/vf_rotate: Check ff_draw_init2() return value
Fixes: NULL pointer dereference
Fixes: 3_343

Found-by: De3mond
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:14 +02:00
Michael Niedermayer
034054b370 avformat/mov: Use int64_t in intermediate for corrected_dts
Fixes: CID1500312 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:13 +02:00
Michael Niedermayer
0c977d37aa avformat/mov: Use 64bit in intermediate for current_dts
Fixes: CID1500304 Unintentional integer overflow
Fixes: CID1500318 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:13 +02:00
Michael Niedermayer
019fce18bb avformat/matroskadec: Assert that num_levels is non negative
Maybe Closes: CID1452496 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:13 +02:00
Michael Niedermayer
0263b6a48c avformat/libzmq: Check av_strstart()
Fixes: CID1453457 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:12 +02:00
Michael Niedermayer
5712f36dd0 avformat/img2dec: Little JFIF / Exif cleanup
This changes the behavior and makes it behave how it probably was intended.
Either way this is unlikely to result in any user visible change

Fixes: CID1494637 Missing break in switch

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:12 +02:00
Michael Niedermayer
7d04c6016b avformat/img2dec: Move DQT after unrelated if()
Fixes: CID1494636 Missing break in switch

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:12 +02:00
Michael Niedermayer
f10493f6fc avformat/imfdec: Simplify get_next_track_with_minimum_timestamp()
This also makes the code more robust

Fixes: CID1512414 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:11 +02:00
Michael Niedermayer
c21fb3624b avformat/iamf_parse: Remove dead case
Fixes: CID1559546 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:11 +02:00
Michael Niedermayer
78d6d13bab avdevice/xcbgrab: Check sscanf() return
Alot more input checking can be performed, this is only checking the obvious missing case

Fixes: CID1598562 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-12 00:39:11 +02:00
Rémi Denis-Courmont
f6d0a41c8c lavu/riscv: use Zbb CLZ/CTZ/CLZW/CTZW at run-time
Zbb static    Zbb dynamic   I baseline
clz       0.668032642   1.336072283   19.552376803
clzl      0.668092643   1.336181786   26.110855571
ctz       1.336208533   3.340209702   26.054869008
ctzl      1.336247784   3.340362457   26.055266290
(seconds for 1 billion iterations on a SiFive-U74 core)
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont
98db140910 lavu/riscv: use Zbb CPOP/CPOPW at run-time
Zbb static    Zbb dynamic   I baseline
popcount  1.336129286   3.469067758   20.146362909
popcountl 1.336322291   3.340292968   20.224829821
(seconds for 1 billion iterations on a SiFive-U74 core)
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont
324899b748 lavu/riscv: use Zbb REV8 at run-time
This adds runtime support to use Zbb REV8 for 32- and 64-bit byte-wise
swaps. The result is about five times slower than if targetting Zbb
statically, but still a lot faster than the default bespoke C code or a
call to GCC run-time functions.

For 16-bit swap, this is however unsurprisingly a lot worse, and so this
sticks to the baseline. In fact, even using REV8 statically does not
seem to be beneficial in that case.

         Zbb static    Zbb dynamic   I baseline
bswap16:  0.668184765   3.340764069   0.668029012
bswap32:  0.668174014   3.340763319   9.353855435
bswap64:  0.668221765   3.340496313  14.698672283
(seconds for 1 billion iterations on a SiFive-U74 core)
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont
378d1b06c3 riscv: probe for Zbb extension at load time
Due to hysterical raisins, most RISC-V Linux distributions target a
RV64GC baseline excluding the Bit-manipulation ISA extensions, most
notably:
- Zba: address generation extension and
- Zbb: basic bit manipulation extension.
Most CPUs that would make sense to run FFmpeg on support Zba and Zbb
(including the current FATE runner), so it makes sense to optimise for
them. In fact a large chunk of existing assembler optimisations relies
on Zba and/or Zbb.

Since we cannot patch shared library code, the next best thing is to
carry a flag initialised at load-time and check it on need basis.
This results in 3 instructions overhead on isolated use, e.g.:
1:  AUIPC rd, %pcrel_hi(ff_rv_zbb_supported)
    LBU   rd, %pcrel_lo(1b)(rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

The C compiler will typically load the flag ahead of time to reducing
latency, and can also keep it around if Zbb is used multiple times in a
single optimisation scope. For this to work, the flag symbol must be
hidden; otherwise the optimisation degrades with a GOT look-up to
support interposition:
1:  AUIPC rd, GOT_OFFSET_HI
    LD    rd, GOT_OFFSET_LO(rd)
    LBU   rd, (rd)
    BEQZ  rd, non_Zbb_fallback_code
    // Zbb code here

This patch adds code to provision the flag in libraries using bit
manipulation functions from libavutil: byte-swap, bit-weight and
counting leading or trailing zeroes.
2024-06-11 20:12:37 +03:00
Rémi Denis-Courmont
18adaf9fe5 checkasm/lls: adjust buffer sizes and alignments
var must be padded.
param has `order + 1`, not `order` elements and is *not* over-aligned.
2024-06-11 20:07:55 +03:00
Anton Khirnov
08ea7d6b8e lavc/hevcdec: constify source frame in hevc_ref_frame() 2024-06-11 17:39:35 +02:00
Anton Khirnov
ccd391d6a3 lavc/hevcdec: do not unref current frame on frame_end() failure
It's a race with frame threading.
2024-06-11 17:39:35 +02:00
Anton Khirnov
d725c737fe lavc/hevcdec: move some frame-end code to hevc_frame_end()
Specifically, calling hwaccel end_frame, verifying frame checksum,
and printing the frame-was-decoded message.
2024-06-11 17:39:35 +02:00
Anton Khirnov
edb6a471c4 lavc/hevcdec: factor decoding a slice NALU out of decode_nal_unit() 2024-06-11 17:39:35 +02:00
Anton Khirnov
90e75c4ec9 lavc/hevcdec: drop a redundant multiple-frame-per-packet check 2024-06-11 17:39:35 +02:00
Anton Khirnov
3cd6492fb5 lavc/hevcdec: move the check for multiple frames in a packet
Do not do it in hls_slice_header(), which is the wrong place for it.
Avoids special magic return value of 1 in that function. The comment
mentioning potential corrupted state is no longer relevant, as
hls_slice_header() modifies no state beyond SliceHeader, which will only
get used for a valid frame.
2024-06-11 17:39:35 +02:00
Anton Khirnov
a8f9d52c22 lavc/hevcdec: move setting slice_initialized out of hls_slice_header()
hls_slice_header() no longer modifies anything in HEVCContext besides
SliceHeader.
2024-06-11 17:39:35 +02:00
Anton Khirnov
82ded1ad3a lavc/hevcdec: move sequence increment/IDR handling to hevc_frame_start()
From hls_slice_header(). It is only done once per frame, so that is a
more appropriate place for this code.
2024-06-11 17:39:35 +02:00
Anton Khirnov
a2e77caf37 lavc/hevcdec: set active PPS/SPS in hevc_frame_start()
Not in hls_slice_header(), as it should only be done once per frame.
2024-06-11 17:39:35 +02:00
Anton Khirnov
47d34ba7fb lavc/hevcdec: move constructing slice RPL to decode_slice_data() 2024-06-11 17:39:35 +02:00
Anton Khirnov
fe171a3b51 lavc/hevcdec: move calling hwaccel decode_slice to decode_slice_data()
From decode_nal_unit(), as that is a more appropriate place for it.
2024-06-11 17:39:35 +02:00
Anton Khirnov
6ee550d83d lavc/hevcdec: move calling hwaccel start_frame to hevc_frame_start()
From decode_nal_unit(), as that is a more appropriate place for it.
2024-06-11 17:39:35 +02:00
Anton Khirnov
3bbb5d78c7 lavc/hevcdec: move per-slice local_ctx setup out of hls_slice_header()
Into decode_slice_data(). This is a step towards constifying
HEVCContext in hls_slice_header().
2024-06-11 17:39:35 +02:00
Anton Khirnov
efc827bf6f lavc/hevcdec: move slice decoding dispatch to its own function
Also move there a sanity check from hls_decode_entry() that should also
be performed when WPP is active (note that the check is not moved to
hls_slice_header() because it requires the HEVCContext.tab_slice_address
to be set up).
2024-06-11 17:39:35 +02:00
Anton Khirnov
7cce612a26 lavc/hevcdec: move a slice segment sanity check to hls_slice_header()
Combine it with an existing similar check.
2024-06-11 17:39:35 +02:00
Anton Khirnov
d43527a1a0 lavc/hevcdec: store slice header POC in SliceHeader
Rather than decoding directly into HEVCContext.poc.

This is a step towards constifying HEVCContext in hls_slice_header().
2024-06-11 17:39:35 +02:00
Anton Khirnov
e4e9e1da15 lavc/hevcdec: drop redundant HEVCContext.threads_{type,number}
They are useless duplicates of corresponding AVCodecContext fields.
2024-06-11 17:39:35 +02:00
Anton Khirnov
b0c29a45dc lavc/hevc/cabac: do not infer WPP use based on HEVCContext.threads_number
Pass this information explicitly instead.
2024-06-11 17:39:35 +02:00
Anton Khirnov
d86ac94df2 lavc/hevcdec: output RASL frames based on the value of no_rasl_output_flag
Instead of an ad-hoc scheme. Also, combine skipping RASL frames with
skip_frame handling - current code seems flawed as it only executes for
the first slice of a RASL frame and unnecessarily unsets is_decoded,
which should not be set at this point anyway..

Some RASL frames in fate-hevc-afd-tc-sei that were previously discarded
are now output.
2024-06-11 17:39:35 +02:00
Anton Khirnov
3115c84015 lavc/hevcdec: only set no_rasl_output_flag for IRAP frames
Its meaning is only specified for IRAP frames.

As it's currently never used otherwise, this should not change decoder
behaviour, but will be useful in future commits.
2024-06-11 17:39:35 +02:00
Anton Khirnov
381b70e173 lavc/hevcdec: do not pass HEVCContext to ff_hevc_frame_nb_refs()
Pass the only things required from it - slice header and PPS -
explicitly.

Will be useful in the following commits to avoid mofiying HEVCContext in
hls_slice_header().
2024-06-11 17:39:35 +02:00
Anton Khirnov
07eb60c0da lavc/hevcdec: only call export_stream_params_from_sei() once per frame
Not once per each slice header, as it makes no sense and may cause races
with frame threading.
2024-06-11 17:39:35 +02:00
Anton Khirnov
01b379a93e lavc/hevcdec: move pocTid0 computation to hevc_frame_start()
It is only done once per frame. Also, rename the variable to poc_tid0 to
be consistent with our naming conventions.
2024-06-11 17:39:35 +02:00
Anton Khirnov
5e438511ab lavc/hevcdec: do not pass HEVCContext to decode_lt_rps()
Pass the two numbers needed from it explicitly.

Makes it clear that HEVCContext is not modified by this function.
2024-06-11 17:39:35 +02:00
Anton Khirnov
0892ec947c lavc/hevcdec: pass SliceHeader explicitly to pred_weight_table()
And replace the HEVCContext* parameter by void *logctx.

Makes it clear that only SliceHeader is modified by this function.
2024-06-11 17:39:35 +02:00
Anton Khirnov
90fc331b0f lavc/hevcdec: only ignore INVALIDDATA in decode_nal_unit()
All other errors should cause a failure, regardless of the value of
err_recognition. Also, print a warning message when skipping invalid NAL
units.
2024-06-11 17:39:35 +02:00
Anton Khirnov
8eb134f4f9 lavc/hevcdec: drop an always-zero variable 2024-06-11 17:39:35 +02:00
Anton Khirnov
8c8072c29c lavc/hevcdec: move active PPS from HEVCParamSets to HEVCContext
"Currently active PPS" is a property of the decoding process, not of the
list of available parameter sets.
2024-06-11 17:39:34 +02:00
Anton Khirnov
0f47342c12 lavc/hevcdec: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS/SPS as function arguments.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov
38b8ae4112 lavc/hevc/pred: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS/SPS as function arguments.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov
d0868d70ea lavc/hevc/cabac: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS/SPS as function arguments.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov
b38aecffec lavc/hevc/filter: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS as a function argument and retrieve SPS through it.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov
fb873a05b3 lavc/hevc/mvs: stop accessing parameter sets through HEVCParamSets
Instead, accept PPS as a function argument and retrieve SPS through it.

Makes the code shorter and significantly reduces diff in future commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov
6ddba110eb lavc/hevc/parser: stop using HEVCParamSets.[psv]ps
The parser does not need to preserve these between frames.
2024-06-11 17:39:34 +02:00
Anton Khirnov
2e46d68f55 lavc/hevc_ps: make SPS hold a reference to its VPS
SPS and its dependent PPSes depend on, and are parsed for, specific VPS data.

This will be useful in following commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov
c879165b39 lavc/hevc_ps: make PPS hold a reference to its SPS
PPS depends on, and is parsed for, specific SPS data.

This will be useful in following commits.
2024-06-11 17:39:34 +02:00
Anton Khirnov
e12fd62d1d lavc/hevcdec: drop a redundant assignment in hevc_decode_frame()
The exact same code is executed at the beginning of decode_nal_units()
2024-06-11 17:39:34 +02:00
Anton Khirnov
a82f2b0924 lavc/hevcdec: simplify condition 2024-06-11 17:39:34 +02:00
Anton Khirnov
0407556716 lavc/hevcdec: do not free SliceHeader arrays in pic_arrays_free()
SliceHeader.{entry_point_offset,size,offset} are not derived from frame
size and do not need to be freed here.
2024-06-11 17:39:34 +02:00
sfan5
0455a62d84 lavf/tls_mbedtls: handle session ticket error code as no-op
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read()
will return an error code to inform about a received session ticket.
This can simply be handled like EAGAIN instead of errornously
aborting the connection.

ref: https://github.com/Mbed-TLS/mbedtls/issues/8749
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 17:00:35 +02:00
sfan5
1b1e9cadc5 lavf/tls_mbedtls: fix handling of certification validation failures
We manually check the verification status after the handshake has completed
using mbedtls_ssl_get_verify_result(). However with VERIFY_REQUIRED
mbedtls_ssl_handshake() already returns an error, so this code is never reached.
Fix that by using VERIFY_OPTIONAL, which performs the verification but
does not abort the handshake.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:58:22 +02:00
sfan5
827578ca76 lavf/tls_mbedtls: hook up debug message callback
Unfortunately this won't work out-of-the-box because mbedTLS
only provides a global (not per-context) debug toggle.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:58:15 +02:00
sfan5
807d1505bf lavf/tls_mbedtls: add missing call to psa_crypto_init
This is mandatory depending on configuration or at least with mbedTLS 3.6.0.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:35:46 +02:00
sfan5
63b6620ad3 lavf/tls_mbedtls: handle more error codes for human-readable messages
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-06-11 16:35:31 +02:00
Rémi Denis-Courmont
b6f37ffba7 lavc/vc1dsp: match C block layout in inv_trans_4x8_rvv
Although checkasm does not verify this, the decoder requires that the
transform updates the input block exactly like the C code does.

This fixes vc1-ism, vc1_ilaced_twomv, vc1_sa00040, vc1_sa10091,
vc1_sa10143, vc1_sa20021, vc1test_smm0005 and wmv3-drm-dec tests.
2024-06-11 17:15:09 +03:00
Rémi Denis-Courmont
6c05069e68 lavc/vc1dsp: match C block layout in inv_trans_4x4_rvv
Although checkasm does not verify this, the decoder requires that the
transform updates the input block exactly like the C code does.

This fixes vc1-ism, vc1_ilaced_twomv, vc1_sa00040, vc1_sa10091,
vc1_sa10143, vc1_sa20021, vc1test_smm0005 and wmv3-drm-dec tests.
2024-06-11 17:15:09 +03:00
Andreas Rheinhardt
6ae1a337f2 fftools/ffmpeg_mux_init: Fix leak when using non-encoding option
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 14:32:25 +02:00
Andreas Rheinhardt
8754c9bd82 configure: Disable DNN without backend
The DNN filters are useless without a backend.
This will also "fix" Coverity issues #1598288 and #1601718.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 19:36:54 +08:00
Andreas Rheinhardt
c84e40d9e6 fftools/ffmpeg_mux_init: Return error upon error
Currently it may return an uninitialized value.
Introduced in 840f2bc18e.
Fixes Coverity issue #1603565.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 08:16:42 +02:00
Andreas Rheinhardt
a0ff31e740 avcodec/vvc/inter: Don't return void
Returning a void is not allowed by the spec. Just return instead.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-11 02:43:14 +02:00
Rémi Denis-Courmont
417957ec5e sws/range_convert: R-V V to/from JPEG
C908   X60
chrRangeFromJpeg_8_c:          2.7    2.5
chrRangeFromJpeg_8_rvv_i32:    1.7    1.5
chrRangeFromJpeg_24_c:         7.5    6.7
chrRangeFromJpeg_24_rvv_i32:   1.7    1.5
chrRangeFromJpeg_128_c:       55.2   34.7
chrRangeFromJpeg_128_rvv_i32:  6.5    3.0
chrRangeFromJpeg_144_c:       44.0   39.2
chrRangeFromJpeg_144_rvv_i32:  7.7    4.5
chrRangeFromJpeg_256_c:       78.2   69.5
chrRangeFromJpeg_256_rvv_i32: 12.2    6.0
chrRangeFromJpeg_512_c:      172.2  138.5
chrRangeFromJpeg_512_rvv_i32: 24.5   11.7
chrRangeToJpeg_8_c:            4.7    4.2
chrRangeToJpeg_8_rvv_i32:      2.0    1.7
chrRangeToJpeg_24_c:          13.7   12.2
chrRangeToJpeg_24_rvv_i32:     2.0    1.5
chrRangeToJpeg_128_c:         72.0   63.7
chrRangeToJpeg_128_rvv_i32:    6.7    3.2
chrRangeToJpeg_144_c:         80.7   71.7
chrRangeToJpeg_144_rvv_i32:    8.5    4.7
chrRangeToJpeg_256_c:        143.2  127.2
chrRangeToJpeg_256_rvv_i32:   13.5    6.5
chrRangeToJpeg_512_c:        285.7  253.7
chrRangeToJpeg_512_rvv_i32:   27.0   13.0
lumRangeFromJpeg_8_c:          1.7    1.5
lumRangeFromJpeg_8_rvv_i32:    1.2    1.0
lumRangeFromJpeg_24_c:         4.2    3.7
lumRangeFromJpeg_24_rvv_i32:   1.2    1.0
lumRangeFromJpeg_128_c:       21.7   19.2
lumRangeFromJpeg_128_rvv_i32:  3.7    1.7
lumRangeFromJpeg_144_c:       24.7   22.0
lumRangeFromJpeg_144_rvv_i32:  4.7    2.7
lumRangeFromJpeg_256_c:       43.7   39.0
lumRangeFromJpeg_256_rvv_i32:  7.5    3.2
lumRangeFromJpeg_512_c:       87.0   77.2
lumRangeFromJpeg_512_rvv_i32: 14.5    6.7
lumRangeToJpeg_8_c:            2.7    2.2
lumRangeToJpeg_8_rvv_i32:      1.0    1.0
lumRangeToJpeg_24_c:           7.2    6.5
lumRangeToJpeg_24_rvv_i32:     1.2    1.0
lumRangeToJpeg_128_c:         37.7   33.7
lumRangeToJpeg_128_rvv_i32:    3.7    2.0
lumRangeToJpeg_144_c:         42.5   37.7
lumRangeToJpeg_144_rvv_i32:    4.7    2.7
lumRangeToJpeg_256_c:         75.0   66.7
lumRangeToJpeg_256_rvv_i32:    7.5    3.5
lumRangeToJpeg_512_c:        149.5  133.0
lumRangeToJpeg_512_rvv_i32:   14.7    7.0
2024-06-10 22:48:52 +03:00
Zhao Zhili
9dac8495b0 swscale/aarch64: Add rgb24 to yuv implementation
Test on Apple M1:

rgb24_to_uv_8_c: 0.0
rgb24_to_uv_8_neon: 0.2
rgb24_to_uv_128_c: 1.0
rgb24_to_uv_128_neon: 0.5
rgb24_to_uv_1080_c: 7.0
rgb24_to_uv_1080_neon: 5.7
rgb24_to_uv_1920_c: 12.5
rgb24_to_uv_1920_neon: 9.5
rgb24_to_uv_half_8_c: 0.2
rgb24_to_uv_half_8_neon: 0.2
rgb24_to_uv_half_128_c: 1.0
rgb24_to_uv_half_128_neon: 0.5
rgb24_to_uv_half_1080_c: 6.2
rgb24_to_uv_half_1080_neon: 3.0
rgb24_to_uv_half_1920_c: 11.2
rgb24_to_uv_half_1920_neon: 5.2
rgb24_to_y_8_c: 0.2
rgb24_to_y_8_neon: 0.0
rgb24_to_y_128_c: 0.5
rgb24_to_y_128_neon: 0.5
rgb24_to_y_1080_c: 4.7
rgb24_to_y_1080_neon: 3.2
rgb24_to_y_1920_c: 8.0
rgb24_to_y_1920_neon: 5.7

On Pixel 6:

rgb24_to_uv_8_c: 30.7
rgb24_to_uv_8_neon: 56.9
rgb24_to_uv_128_c: 213.9
rgb24_to_uv_128_neon: 173.2
rgb24_to_uv_1080_c: 1649.9
rgb24_to_uv_1080_neon: 1424.4
rgb24_to_uv_1920_c: 2907.9
rgb24_to_uv_1920_neon: 2480.7
rgb24_to_uv_half_8_c: 36.2
rgb24_to_uv_half_8_neon: 33.4
rgb24_to_uv_half_128_c: 167.9
rgb24_to_uv_half_128_neon: 99.4
rgb24_to_uv_half_1080_c: 1293.9
rgb24_to_uv_half_1080_neon: 778.7
rgb24_to_uv_half_1920_c: 2292.7
rgb24_to_uv_half_1920_neon: 1328.7
rgb24_to_y_8_c: 19.7
rgb24_to_y_8_neon: 27.7
rgb24_to_y_128_c: 129.9
rgb24_to_y_128_neon: 96.7
rgb24_to_y_1080_c: 995.4
rgb24_to_y_1080_neon: 767.7
rgb24_to_y_1920_c: 1747.4
rgb24_to_y_1920_neon: 1337.2

Note both tests use clang as compiler, which has vectorization
enabled by default with -O3.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:12:09 +08:00
Zhao Zhili
b1240c983f tests/checkasm: Fix build error when enable linux perf on Android
B0 is defined by system header, see f0f596dbc6 for ref.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:11:46 +08:00
Zhao Zhili
33e4cc963d avutil/timer: Add clock_gettime as a fallback of AV_READ_TIME
Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:11:36 +08:00
Zhao Zhili
6a18c0bc87 avutil/aarch64: Skip define AV_READ_TIME for apple
It will fallback to mach_absolute_time inside libavutil/timer.h

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-11 01:10:42 +08:00
James Almer
94f2274a8b x86/aacencdsp: fix ff_aac_quantize_bands_avx on unix64 ABI
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 17:16:02 -03:00
James Almer
17c3cc5bb6 swscale/x86/rgb_2_rgb: add missing wrap to ff_uyvytoyuv422_avx2
Fixes old yasm.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 16:04:36 -03:00
James Almer
03546f49a3 swscale/x86/rgb2rgb: add missing wrap for ff_uyvytoyuv422_avx2
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 15:56:52 -03:00
James Almer
287d139b77 checkasm/sw_rgb: fix alignment of buffers for rgb_to_yuv tests
src is apparently not guaranteed to be >8 byte aligned, but align to 16
nonetheless as the x86 asm will do unaligned loads anyway.
dst is guaranteed to be 32 byte aligned for the Y plane, but 16 byte for UV.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 14:12:51 -03:00
James Almer
e8cef5e152 swscale/x86/rgb2rgb: remove mmxext version of shuffle_bytes_2103
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:43:11 -03:00
James Almer
c578bb9864 swscale/x86/input: add AVX2 optimized uyvytoyuv422
uyvytoyuv422_c: 23991.8
uyvytoyuv422_sse2: 2817.8
uyvytoyuv422_avx: 2819.3
uyvytoyuv422_avx2: 1972.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:43:11 -03:00
James Almer
e9cfd53257 swscale/x86/input: add AVX2 optimized RGB32 to YUV functions
abgr_to_uv_8_c: 43.3
abgr_to_uv_8_sse2: 14.3
abgr_to_uv_8_avx: 15.3
abgr_to_uv_8_avx2: 18.8
abgr_to_uv_128_c: 650.3
abgr_to_uv_128_sse2: 110.8
abgr_to_uv_128_avx: 112.3
abgr_to_uv_128_avx2: 64.8
abgr_to_uv_1080_c: 5456.3
abgr_to_uv_1080_sse2: 888.8
abgr_to_uv_1080_avx: 900.8
abgr_to_uv_1080_avx2: 518.3
abgr_to_uv_1920_c: 9692.3
abgr_to_uv_1920_sse2: 1593.8
abgr_to_uv_1920_avx: 1613.3
abgr_to_uv_1920_avx2: 864.8
abgr_to_y_8_c: 23.3
abgr_to_y_8_sse2: 12.8
abgr_to_y_8_avx: 13.3
abgr_to_y_8_avx2: 17.3
abgr_to_y_128_c: 308.3
abgr_to_y_128_sse2: 67.3
abgr_to_y_128_avx: 66.8
abgr_to_y_128_avx2: 44.8
abgr_to_y_1080_c: 2371.3
abgr_to_y_1080_sse2: 512.8
abgr_to_y_1080_avx: 505.8
abgr_to_y_1080_avx2: 314.3
abgr_to_y_1920_c: 4177.3
abgr_to_y_1920_sse2: 915.8
abgr_to_y_1920_avx: 926.8
abgr_to_y_1920_avx2: 519.3
bgra_to_uv_8_c: 37.3
bgra_to_uv_8_sse2: 13.3
bgra_to_uv_8_avx: 14.8
bgra_to_uv_8_avx2: 19.8
bgra_to_uv_128_c: 563.8
bgra_to_uv_128_sse2: 111.3
bgra_to_uv_128_avx: 112.3
bgra_to_uv_128_avx2: 64.8
bgra_to_uv_1080_c: 4691.8
bgra_to_uv_1080_sse2: 893.8
bgra_to_uv_1080_avx: 899.8
bgra_to_uv_1080_avx2: 517.8
bgra_to_uv_1920_c: 8332.8
bgra_to_uv_1920_sse2: 1590.8
bgra_to_uv_1920_avx: 1605.8
bgra_to_uv_1920_avx2: 867.3
bgra_to_y_8_c: 22.3
bgra_to_y_8_sse2: 12.8
bgra_to_y_8_avx: 12.8
bgra_to_y_8_avx2: 17.3
bgra_to_y_128_c: 291.3
bgra_to_y_128_sse2: 67.8
bgra_to_y_128_avx: 69.3
bgra_to_y_128_avx2: 45.3
bgra_to_y_1080_c: 2357.3
bgra_to_y_1080_sse2: 508.3
bgra_to_y_1080_avx: 518.3
bgra_to_y_1080_avx2: 399.8
bgra_to_y_1920_c: 4202.8
bgra_to_y_1920_sse2: 906.8
bgra_to_y_1920_avx: 907.3
bgra_to_y_1920_avx2: 526.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:43:11 -03:00
James Almer
d5fe99dc5f swscale/x86/input: add AVX2 optimized RGB24 to YUV functions
rgb24_to_uv_8_c: 39.3
rgb24_to_uv_8_sse2: 14.3
rgb24_to_uv_8_ssse3: 13.3
rgb24_to_uv_8_avx: 12.8
rgb24_to_uv_8_avx2: 14.3
rgb24_to_uv_128_c: 582.8
rgb24_to_uv_128_sse2: 127.3
rgb24_to_uv_128_ssse3: 107.3
rgb24_to_uv_128_avx: 111.3
rgb24_to_uv_128_avx2: 62.3
rgb24_to_uv_1080_c: 4981.3
rgb24_to_uv_1080_sse2: 1048.3
rgb24_to_uv_1080_ssse3: 876.8
rgb24_to_uv_1080_avx: 887.8
rgb24_to_uv_1080_avx2: 492.3
rgb24_to_uv_1280_c: 5906.8
rgb24_to_uv_1280_sse2: 1263.3
rgb24_to_uv_1280_ssse3: 1048.3
rgb24_to_uv_1280_avx: 1045.8
rgb24_to_uv_1280_avx2: 579.8
rgb24_to_uv_1920_c: 8665.3
rgb24_to_uv_1920_sse2: 1888.8
rgb24_to_uv_1920_ssse3: 1571.8
rgb24_to_uv_1920_avx: 1558.8
rgb24_to_uv_1920_avx2: 869.3
rgb24_to_y_8_c: 20.3
rgb24_to_y_8_sse2: 11.8
rgb24_to_y_8_ssse3: 10.3
rgb24_to_y_8_avx: 10.3
rgb24_to_y_8_avx2: 10.8
rgb24_to_y_128_c: 284.8
rgb24_to_y_128_sse2: 83.3
rgb24_to_y_128_ssse3: 66.8
rgb24_to_y_128_avx: 64.8
rgb24_to_y_128_avx2: 39.3
rgb24_to_y_1080_c: 2451.3
rgb24_to_y_1080_sse2: 696.3
rgb24_to_y_1080_ssse3: 516.8
rgb24_to_y_1080_avx: 518.8
rgb24_to_y_1080_avx2: 301.8
rgb24_to_y_1280_c: 2892.8
rgb24_to_y_1280_sse2: 816.8
rgb24_to_y_1280_ssse3: 623.3
rgb24_to_y_1280_avx: 616.3
rgb24_to_y_1280_avx2: 350.8
rgb24_to_y_1920_c: 4338.8
rgb24_to_y_1920_sse2: 1210.8
rgb24_to_y_1920_ssse3: 928.3
rgb24_to_y_1920_avx: 920.3
rgb24_to_y_1920_avx2: 534.8

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 13:42:09 -03:00
James Almer
6743c2fc6a checkasm/sw_rgb: test rgb32/rgb32_1 to yuv
Test all four pixel formats, but only bench the two native endian ones for a
given target.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 12:29:49 -03:00
James Almer
91b9af0058 x86/aacencdsp: add AVX version of quantize_bands
quant_bands_signed_c: 1928.0
quant_bands_signed_sse2: 406.0
quant_bands_signed_avx: 207.0
quant_bands_unsigned_c: 1702.0
quant_bands_unsigned_sse2: 404.0
quant_bands_unsigned_avx: 209.0

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-09 12:29:49 -03:00
Rémi Denis-Courmont
7a3369398f sws/input: R-V V 32-bit RGB to halved UV
T-Head C908:
abgr_to_uv_half_8_c:            2.2
abgr_to_uv_half_8_rvv_i32:      3.5
abgr_to_uv_half_128_c:         44.0
abgr_to_uv_half_128_rvv_i32:   13.0
abgr_to_uv_half_1080_c:       245.0
abgr_to_uv_half_1080_rvv_i32: 107.2
abgr_to_uv_half_1920_c:       406.2
abgr_to_uv_half_1920_rvv_i32: 188.7
bgra_to_uv_half_8_c:            2.2
bgra_to_uv_half_8_rvv_i32:      3.5
bgra_to_uv_half_128_c:         26.5
bgra_to_uv_half_128_rvv_i32:   13.0
bgra_to_uv_half_1080_c:       219.7
bgra_to_uv_half_1080_rvv_i32: 107.0
bgra_to_uv_half_1920_c:       406.7
bgra_to_uv_half_1920_rvv_i32: 188.7

SpacemiT X60:
abgr_to_uv_half_8_c:           2.2
abgr_to_uv_half_8_rvv_i32:     3.0
abgr_to_uv_half_128_c:        28.2
abgr_to_uv_half_128_rvv_i32:   5.7
abgr_to_uv_half_1080_c:      235.5
abgr_to_uv_half_1080_rvv_i32: 47.7
abgr_to_uv_half_1920_c:      418.2
abgr_to_uv_half_1920_rvv_i32: 84.0
bgra_to_uv_half_8_c:           2.0
bgra_to_uv_half_8_rvv_i32:     3.0
bgra_to_uv_half_128_c:        23.7
bgra_to_uv_half_128_rvv_i32:   5.7
bgra_to_uv_half_1080_c:      195.5
bgra_to_uv_half_1080_rvv_i32: 47.7
bgra_to_uv_half_1920_c:      346.5
bgra_to_uv_half_1920_rvv_i32: 84.0
2024-06-09 14:33:04 +03:00
Rémi Denis-Courmont
e2f069905e sws/input: R-V V 32-bit RGB to UV 2024-06-09 14:33:04 +03:00
Rémi Denis-Courmont
f5555cb106 sws/input: R-V V 32-bit RGB to Y
T-Head C908:
abgr_to_y_8_c:            2.5
abgr_to_y_8_rvv_i32:      2.2
abgr_to_y_128_c:         37.0
abgr_to_y_128_rvv_i32:    8.5
abgr_to_y_1080_c:       327.0
abgr_to_y_1080_rvv_i32:  69.5
abgr_to_y_1920_c:       552.0
abgr_to_y_1920_rvv_i32: 122.2
bgra_to_y_8_c:            2.5
bgra_to_y_8_rvv_i32:      2.2
bgra_to_y_128_c:         37.2
bgra_to_y_128_rvv_i32:    8.5
bgra_to_y_1080_c:       310.2
bgra_to_y_1080_rvv_i32:  69.5
bgra_to_y_1920_c:       568.2
bgra_to_y_1920_rvv_i32: 122.5

SpacemiT X60:
abgr_to_y_8_c:            2.5
abgr_to_y_8_rvv_i32:      2.0
abgr_to_y_128_c:         33.0
abgr_to_y_128_rvv_i32:    3.7
abgr_to_y_1080_c:       276.0
abgr_to_y_1080_rvv_i32:  31.5
abgr_to_y_1920_c:       493.7
abgr_to_y_1920_rvv_i32:  55.5
bgra_to_y_8_c:            2.2
bgra_to_y_8_rvv_i32:      2.0
bgra_to_y_128_c:         33.0
bgra_to_y_128_rvv_i32:    3.7
bgra_to_y_1080_c:       276.0
bgra_to_y_1080_rvv_i32:  31.5
bgra_to_y_1920_c:       490.7
bgra_to_y_1920_rvv_i32:  55.5
2024-06-09 14:33:04 +03:00
Andreas Rheinhardt
8b62fb231a swscale/x86/rgb2rgb: Detemplatize
Every function in rgb2rgb_template.c is only compiled exactly
once; there is no overlap at all between the MMXEXT and the
SSE2 functions, so detemplatize it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt
5421dee0e7 swscale/x86/rgb2rgb_template: Remove unused uyvytoyv12
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt
c1c35380a7 swscale/x86/rgb2rgb: Don't unnecessarily check for inline ASM
The SSE2 and AVX versions of deinterleaveBytes are external ASM.
Move them out of the inline ASM template.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt
f7305eb3b3 swscale/x86/rgb2rgb_template: Remove unnecessary SFENCE
The ff_nv12ToUV_* functions don't use non-temporal stores
at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt
fca796ac3b tests/checkasm/sw_rgb: Be more strict about clobbering MMX state
The MMXEXT versions of the rgb2rgb functions tested here
always emit emms on their own. Therefore one can use
a stricter test to ensure that it stays that way.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 12:03:47 +02:00
Andreas Rheinhardt
3af6136669 avcodec/dnxhdenc: Simplify padding
It is unnecessary to first pad to 32bits; the memset later
will pad everything will with zeroes anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
b0e0b3c58a avcodec/dnxhdenc: Move PutBitContext from ctx to stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
542abee213 avcodec/cbs_h266_syntax_template: Use correct format specifier
H266RawSliceHeader.num_entry_points is an uint32_t.
Fixes -Wformat warnings:
https://fate.ffmpeg.org/log.cgi?slot=aarch64-osx-clang-1200.0.32.29&time=20240604151047&log=compile

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
8f199cfb5b avformat/evc: Fix format specifiers
Fixes -Wformat warnings; see e.g.
https://fate.ffmpeg.org/log.cgi?slot=aarch64-osx-clang-1200.0.32.29&time=20240604151047&log=compile

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
5f31a4fd16 avformat/vvc: Don't use uint8_t iterators, fix shadowing
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
1c4362cce9 avformat/vvc: Fix comment
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
fa77dc8c44 avformat/vvc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
8b6c7e7cda avformat/vvc: Fix crash on allocation failure, avoid allocations
This is the VVC version of 8b5d155301.

(Hint: This ensures that the order of NALU arrays is OPI-VPS-SPS-PPS-
Prefix-SEI-Suffix-SEI, regardless of the order in the original
extradata. I hope this is right.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
4482b3353d avformat/vvc: Don't use ff_copy_bits()
There is no benefit in using it: The fast path of copying
is not taken because of misalignment; furthermore we are
only dealing with a few byte here anyway, so simply copy
the bytes manually, avoiding the dependency on bitstream.c
in lavf (which also contains a function that is completely
unused in lavf).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
52fb49a8a3 avformat/vvc: Use put_bytes_output()
The PutBitContext has just been flushed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Andreas Rheinhardt
dd8fb0aaae avcodec/hevc/Makefile: Move rules for lavc/* files to lavc/Makefile
If any of these files (say A) would be changed in such a way
that A acquires a new dependency on another file B, building B
would need to be added to all the rules that lead to A being built.
Yet currently the rules for several files are spread over
the lavc Makefile and the Makefile of the lavc/hevc subdir, making
it more likely to be forgotten. So move the rules for these files
to the lavc/Makefile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-09 10:59:33 +02:00
Rémi Denis-Courmont
daac101e61 lavc/aacencdsp: fix rounding in R-V V quantize_bands
We need to round toward zero here.
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont
658439934b lavc/vp8dsp: R-V V vp8_idct_add
T-Head C908 (cycles):
vp8_idct_add_c:       312.2
vp8_idct_add_rvv_i32: 117.0
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont
e0f4d185f1 sws/input: R-V V rgb24ToUV_half and bgr24ToUV_half
T-Head C908:
rgb24_to_uv_half_4_c:           2.0
rgb24_to_uv_half_4_rvv_i32:     3.5
rgb24_to_uv_half_64_c:         27.0
rgb24_to_uv_half_64_rvv_i32:   12.5
rgb24_to_uv_half_540_c:       223.7
rgb24_to_uv_half_540_rvv_i32: 105.2
rgb24_to_uv_half_640_c:       265.5
rgb24_to_uv_half_640_rvv_i32: 123.7
rgb24_to_uv_half_960_c:       414.5
rgb24_to_uv_half_960_rvv_i32: 249.5

SpacemiT X60:
rgb24_to_uv_half_4_c:           1.7
rgb24_to_uv_half_4_rvv_i32:     4.2
rgb24_to_uv_half_64_c:         24.0
rgb24_to_uv_half_64_rvv_i32:    8.7
rgb24_to_uv_half_540_c:       199.2
rgb24_to_uv_half_540_rvv_i32:  72.5
rgb24_to_uv_half_640_c:       235.7
rgb24_to_uv_half_640_rvv_i32:  85.2
rgb24_to_uv_half_960_c:       353.5
rgb24_to_uv_half_960_rvv_i32: 127.5
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont
3ef5867e4b sws/input: R-V V rgb24ToUV and bgr24ToUV
T-Head C908:
rgb24_to_uv_8_c:            2.7
rgb24_to_uv_8_rvv_i32:      3.2
rgb24_to_uv_128_c:         41.0
rgb24_to_uv_128_rvv_i32:   12.7
rgb24_to_uv_1080_c:       342.5
rgb24_to_uv_1080_rvv_i32: 105.7
rgb24_to_uv_1280_c:       406.0
rgb24_to_uv_1280_rvv_i32: 124.2
rgb24_to_uv_1920_c:       626.0
rgb24_to_uv_1920_rvv_i32: 186.0

SpacemiT X60:
rgb24_to_uv_8_c:            2.5
rgb24_to_uv_8_rvv_i32:      3.0
rgb24_to_uv_128_c:         36.5
rgb24_to_uv_128_rvv_i32:    5.7
rgb24_to_uv_1080_c:       304.2
rgb24_to_uv_1080_rvv_i32:  49.0
rgb24_to_uv_1280_c:       360.5
rgb24_to_uv_1280_rvv_i32:  57.5
rgb24_to_uv_1920_c:       540.7
rgb24_to_uv_1920_rvv_i32:  86.2
2024-06-08 18:30:43 +03:00
Rémi Denis-Courmont
79dfdac4db sws/input: R-V V rgb24ToY & bgr24ToY
T-Head C908:
rgb24_to_y_8_c:            2.0
rgb24_to_y_8_rvv_i32:      2.7
rgb24_to_y_128_c:         26.2
rgb24_to_y_128_rvv_i32:    9.2
rgb24_to_y_1080_c:       219.5
rgb24_to_y_1080_rvv_i32:  76.2
rgb24_to_y_1280_c:       276.2
rgb24_to_y_1280_rvv_i32:  89.7
rgb24_to_y_1920_c:       389.7
rgb24_to_y_1920_rvv_i32: 134.2

SpacemiT X60:
rgb24_to_y_8_c:            1.7
rgb24_to_y_8_rvv_i32:      2.2
rgb24_to_y_128_c:         23.2
rgb24_to_y_128_rvv_i32:    4.2
rgb24_to_y_1080_c:       195.0
rgb24_to_y_1080_rvv_i32:  33.7
rgb24_to_y_1280_c:       231.0
rgb24_to_y_1280_rvv_i32:  40.0
rgb24_to_y_1920_c:       346.2
rgb24_to_y_1920_rvv_i32:  59.7
2024-06-08 18:30:43 +03:00
Wenbin Chen
7560db937d libavfi/dnn: enable LibTorch xpu device option support
Add xpu device support to libtorch backend.
To enable xpu support you need to add
 "-Wl,--no-as-needed -lintel-ext-pt-gpu -Wl,--as-needed" to
"--extra-libs" when configure ffmpeg.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2024-06-08 19:45:21 +08:00
Nuo Mi
f68f40736f avcodec/vvcdec: support mv wraparound
A 360 video specific tool
see https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9503377

passed files:
    DMVR_A_Huawei_3.bit
    WRAP_D_InterDigital_4.bit
    WRAP_A_InterDigital_4.bit
    WRAP_B_InterDigital_4.bit
    WRAP_C_InterDigital_4.bit
    ERP_A_MediaTek_3.bit
2024-06-08 17:45:55 +08:00
Nuo Mi
685174069f avcodec/vvcdec: misc, reindent inter.c 2024-06-08 17:45:55 +08:00
Nuo Mi
a4013e748a avcodec/vvcdec: refact out emulated_edge_no_wrap
prepare for refrence wraparound
2024-06-08 17:45:55 +08:00
Nuo Mi
8abdf0a28e avcodec/vvcdec: misc, move src offset inside emulated_edge 2024-06-08 17:45:55 +08:00
Nuo Mi
2d98786fee avcodec/vvcdec: refact, remove emulated_edge_dmvr and emulated_edge_bilinear to simplify code 2024-06-08 17:45:55 +08:00
Lynne
714596bcbf aacdec_usac: zero out alpha values for the current frame 2024-06-08 00:22:41 +02:00
Lynne
c2d459cb51 aacdec_usac: fix stereo alpha values for transients
Typo.
Also added comments and fixed the branch underneath.
2024-06-08 00:22:40 +02:00
Lynne
7223523335 aacdec_usac: use correct TNS values
The standard slightly modified the maximum TNS bands allowed.
2024-06-08 00:22:40 +02:00
Lynne
9b41cc0430 aacdec_usac: do not round noise amplitude values
Use floating point division instead of integer division.
2024-06-08 00:22:40 +02:00
Lynne
a18d0659f4 aacdec_usac: skip coeff decoding if the number to be decoded is 0
Yet another thing not mentioned in the spec.
2024-06-08 00:22:39 +02:00
Lynne
1ad9a4008b aacdec_usac: decouple TNS active from TNS data present flag
The issue was that in case of common TNS parameters, TNS was
entirely skipped, as tns.present was set to 0.
2024-06-08 00:22:39 +02:00
Lynne
c0fdb0cdfd aacdec_usac: do not continue parsing bitstream on core_mode == 1
Although LPD is not functional yet, the bitstream ends at that point.
2024-06-08 00:22:38 +02:00
Lynne
8ecaa64b9b aacdec_usac: respect tns_on_lr flag
This was left out, and due to av_unused, forgotten about.
2024-06-08 00:22:38 +02:00
Lynne
25b848a0bd aacdec_usac: correctly set and use the layout map 2024-06-08 00:22:38 +02:00
Lynne
ae495b56ff aacdec_usac: remove fallback for custom maps with invalid position
Not needed as every possible index is mapped.
2024-06-08 00:22:37 +02:00
Lynne
91ab17e2fe aacdec_usac: tag LFE channels as such in the channel map
Missed.
2024-06-08 00:22:37 +02:00
Lynne
62cd6d9e59 aacdec_usac: clean up nb_elems on error
Require that there is a valid layout with a valid number of channels
before accepting nb_elems.
The value is required when flushing.

Thanks to kasper93 for figuring it out.
2024-06-08 00:22:37 +02:00
Lynne
5c328e6c1e aacdec: increase MAX_ELEM_ID to 64
In USAC, we set the max to 64.
2024-06-08 00:22:36 +02:00
Lynne
91fd6ca000 lavc: bump minor and add APIchanges entry for new USAC profile 2024-06-08 00:22:36 +02:00
Lynne
1c066867df aac: define a new profile for USAC
This allows users to determine whether a stream is USAC or not.
2024-06-08 00:22:35 +02:00
Lynne
ee419804da mpeg4audio: explicitly define each AOT
This makes it far easier to figure out which AOT belongs to which
profile.
Also, explicitly highlight the holes.
2024-06-08 00:22:35 +02:00
Lynne
8a2fe8a5b9 mpeg4audio: rename AOT_USAC_NOSBR to AOT_USAC
The issue is that AOT 45 isn't defined anywhere, and looking at the git
blame, it seems to have sprung up through a reordering of the enum,
and adding a hole.

The spec does not define an explicit AOT for SBR and no SBR, and only
uses AOT 42 (previously AOT_USAC_NOSBR), so just rename AOT_USAC to
it and replace its use everywhere.
2024-06-08 00:22:31 +02:00
Michael Niedermayer
840f2bc18e fftools/ffmpeg_mux_init: Free pts on error
Fixes: CID1538863 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:26 +02:00
Michael Niedermayer
d9b9fc4be2 fftools/cmdutils: Add protective () to FLAGS
issue found while reviewing CID1452612 Free of array-typed value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:26 +02:00
Michael Niedermayer
5b82852519 avformat/sdp: Check before appending ","
Found by reviewing code related to CID1500301 String not null terminated

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:25 +02:00
Kacper Michajłow
a3d3a58026 avformat/rpl: reject invalid sample rate
Fixes overflow check for bit_rate multiplication few lines below.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:25 +02:00
Michael Niedermayer
dce69ba89e avcodec/libx264: Check init_get_bits8() return code
Fixes: CID1594529 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:25 +02:00
Michael Niedermayer
8a64a003b5 avcodec/ilbcdec: Remove dead code
Yes the same dead code is in "iLBC Speech Coder ANSI-C Source Code"

Fixes: CID1509370 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:24 +02:00
Michael Niedermayer
9b76e49061 avcodec/vp8: Check cond init
Fixes: CID1598563 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:24 +02:00
Michael Niedermayer
4ac7405aaf avcodec/vp8: Check mutex init
Fixes: CID1598556 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:24 +02:00
Gerion Entrup
300df41c30 libavfilter/signature_lookup: fix jaccard distance
Actually, the jaccard distance is defined as D = 1 - intersect / union.
Additionally, the distance value is compared against a constant that
must be between 0 and 1, which is not the case here. Both facts together
has led to the fact, that the function always returned a matching course
signature. To leave the constant intact and to avoid floating point
computation, this commit multiplies with 1 << 16 making the constant
effectively 9000 / (1<<16) =~ 0.14.

Reported-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Reviewed-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Tested-by: Sachin Tilloo <sachin.tilloo@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-07 21:42:23 +02:00
Rémi Denis-Courmont
3152c684cb lavc/vc1dsp: R-V V vc1_inv_trans_4x4
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_4x4_c: 310.7
vc1dsp.vc1_inv_trans_4x4_rvv_i32: 120.0

We could use 1 `vlseg4e64.v` instead of 4 `vle16.v`, but that seems to
be about 7% slower.
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont
6ffa639c8a lavc/vc1dsp: R-V V vc1_inv_trans_4x8
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_4x8_c: 653.2
vc1dsp.vc1_inv_trans_4x8_rvv_i32: 234.0
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont
a169f3bca5 lavc/vc1dsp: R-V V vc1_inv_trans_8x4
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_8x4_c:       626.2
vc1dsp.vc1_inv_trans_8x4_rvv_i32: 215.2
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont
04397a29de lavc/vc1dsp: R-V V vc1_inv_trans_8x8
T-Head C908 (cycles):
vc1dsp.vc1_inv_trans_8x8_c:       871.7
vc1dsp.vc1_inv_trans_8x8_rvv_i32: 286.7
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont
8d117024fe checkasm: disable unaligned access emulation
The OS may silently fix (emulate) unaligned hardware access exceptions.
This is extremely slow and code should be fixed not to rely on unaligned
access on affected hardware. Accordingly this requests that the OS
disable emulation and instead throw Bus error, which will be caught by
checkasm's signal handler.

This has no effects if the hardware supports unaligned access in
hardware, since no exceptions are generated. prctl() will fail safe in
that case.
2024-06-07 17:53:05 +03:00
Rémi Denis-Courmont
c3dbbb316e lavc/flacdsp: fix sign extension in R-V V wasted33
We need to use either VWCVT.X.X.V or VSEXT.VF2. The later is preferable
to avoid changing VTYPE.
2024-06-07 17:53:05 +03:00
Ramiro Polla
5939f7228a libswscale/x86/yuv_2_rgb: fix some comments 2024-06-07 15:24:06 +02:00
Zhao Zhili
7d46ab9e12 avcodec/mediacodecenc: workaround the alignment requirement for H.265
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-07 13:14:46 +08:00
Zhao Zhili
2a68b2d643 avcodec/mediacodecenc: workaround the alignment requirement only for H.264
There is no bsf for other codecs to modify crop info except H.265.
For H.265, the assumption that FFALIGN(width, 16)xFFALIGN(height, 16)
is the video resolution can be wrong, since the encoder can use CTU
larger than 16x16. In that case, use FFALIGN(width, 16) - width
as crop_right is incorrect. So disable the workaround for H.265 now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-07 13:14:46 +08:00
Zhao Zhili
680b3cee1f avcodec/h265_metadata: Add options to set width/height after crop
It's a common usecase to request a video size after crop. Before
this patch, user must know the video size before crop, then set
crop_right/crop_bottom accordingly. Since HEVC can have different
CTU size, it's not easy to get/deduce the video size before crop.
With the new width/height options, there is no such requirement.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-06-07 13:14:46 +08:00
Gyan Doshi
d55f5cba7b avfilter/trim: flag trim filter as metadata only
Similar to select filter for video - it can only pass through or drop frames
2024-06-06 15:09:45 +05:30
Zhao Zhili
47ba87551c checkasm/sw_rgb: test rgb24/bgr24 to yuv
The line width 8 is supposed to test corner case, while the
performance doesn't matter. Width 1080 is also a case of
unaligned to 16.

Width 1920 meant for benchmark (together with --runs options).

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-05 15:22:49 -03:00
Ramiro Polla
2d24a80e5e avcodec/mpegvideo_enc: give magic number a name 2024-06-05 19:39:36 +02:00
Ramiro Polla
01b1f4c9a5 libavcodec/libxvid: code cleanup (replace magic numbers) 2024-06-05 19:39:35 +02:00
Rémi Denis-Courmont
0415bb74c8 lavc/vp8dsp: remove no longer used macros 2024-06-04 17:42:07 +03:00
Rémi Denis-Courmont
121fb846b9 lavc/vp7dsp: add R-V V vp7_idct_dc_add4uv
This is almost the same story as vp7_idct_add4y. We just have to use
strided loads of 2 64-bit elements to account for the different data
layout in memory.

T-Head C908:
vp7_idct_dc_add4uv_c:       7.5
vp7_idct_dc_add4uv_rvv_i64: 2.0
vp8_idct_dc_add4uv_c:       6.2
vp8_idct_dc_add4uv_rvv_i32: 2.2 (before)
vp8_idct_dc_add4uv_rvv_i64: 2.0

SpacemiT X60:
vp7_idct_dc_add4uv_c:       6.7
vp7_idct_dc_add4uv_rvv_i64: 2.2
vp8_idct_dc_add4uv_c:       5.7
vp8_idct_dc_add4uv_rvv_i32: 2.5 (before)
vp8_idct_dc_add4uv_rvv_i64: 2.0
2024-06-04 17:42:07 +03:00
Rémi Denis-Courmont
225de53c9d lavc/vp8dsp: rework R-V V idct_dc_add4y
DCT-related FFmpeg functions often add an unsigned 8-bit sample to a
signed 16-bit coefficient, then clip the result back to an unsigned
8-bit value. RISC-V has no signed 16-bit to unsigned 8-bit clip, so
instead our most common sequence is:
    VWADDU.WV
    set SEW to 16 bits
    VMAX.VV zero     # clip negative values to 0
    set SEW to 8 bits
    VNCLIPU.WI       # clip values over 255 to 255 and narrow

Here we use a different sequence which does not require toggling the
vector type. This assumes that the wide addend vector is biased by
-128:
    VWADDU.WV
    VNCLIP.WI    # clip values to signed 8-bit and narrow
    VXOR.VX 0x80 # flip sign bit (convert signed to unsigned)

Also the VMAX is effectively replaced by a VXOR of half-width. In this
function, this comes for free as we anyway add a constant to the wide
vector in the prologue.

On C908, this has no observable effects. On X60, this improves
microbenchmarks by about 20%.
2024-06-04 17:42:07 +03:00
Rémi Denis-Courmont
4e120fbbbd lavc/vp8dsp: add R-V V vp7_idct_dc_add4y
As with idct_dc_add, most of the code is shared with, and replaces, the
previous VP8 function. To improve performance, we break down the 16x4
matrix into 4 rows, rather than 4 squares. Thus strided loads and
stores are avoided, and the 4 DC calculations are vectored.
Unfortunately this requires a vector gather to splat the DC values, but
overall this is still a win for performance:

T-Head C908:
vp7_idct_dc_add4y_c:       7.2
vp7_idct_dc_add4y_rvv_i32: 2.2
vp8_idct_dc_add4y_c:       6.2
vp8_idct_dc_add4y_rvv_i32: 2.2 (before)
vp8_idct_dc_add4y_rvv_i32: 1.7

SpacemiT X60:
vp7_idct_dc_add4y_c:       6.2
vp7_idct_dc_add4y_rvv_i32: 2.0
vp8_idct_dc_add4y_c:       5.5
vp8_idct_dc_add4y_rvv_i32: 2.5 (before)
vp8_idct_dc_add4y_rvv_i32: 1.7

I also tried to provision the DC values using indexed loads. It ends up
slower overall, especially for VP7, as we then have to compute 16 DC's
instead of just 4.
2024-06-04 17:40:41 +03:00
Rémi Denis-Courmont
30797e4ff6 lavc/vp8dsp: add R-V V vp7_idct_dc_add
This just computes the direct coefficient and hands over to code shared
with VP8. Accordingly the bulk of changes are just rewriting the VP8
code to share.

Nothing to write home about:
vp7_idct_dc_add_c:       1.7
vp7_idct_dc_add_rvv_i32: 1.2
2024-06-04 17:40:36 +03:00
Frank Plowman
d866f49791 lavc/vvc: Reallocate pixel buffers if pixel shift changes
Allocations in the following lines depend on the pixel shift, and so
these buffers must be reallocated if the pixel shift changes.  Patch
fixes segmentation faults in fuzzed bitstreams.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-06-04 20:13:47 +08:00
Anton Khirnov
9576a00527 lavc/hevcdec: drop unused HEVCContext.width/height 2024-06-04 11:46:27 +02:00
Anton Khirnov
a13b892080 lavc/hevcdec: deduplicate calling hwaccel decode_params() 2024-06-04 11:46:27 +02:00
Anton Khirnov
e4601cc339 lavc/hevc*: move to hevc/ subdir 2024-06-04 11:46:27 +02:00
Anton Khirnov
ba56a300a9 lavc/hevcdec: drop HEVCContext.frame
It is merely a redundant pointer to cur_frame->f
2024-06-04 11:46:27 +02:00
Anton Khirnov
db84c1c6ef lavc/hevcdec: rename HEVCFrame.frame to just f
This is shorter, loses no information, and is consistent with other
similar structs.
2024-06-04 11:46:23 +02:00
Anton Khirnov
9226514ced lavc/hevcdec: rename HEVCContext.ref to cur_frame
Since it stores a pointer to the current frame.
2024-06-04 11:44:37 +02:00
Anton Khirnov
7ad9400952 lavc/hevcdec: drop HEVCContext.HEVClc
It is merely a pointer to local_ctx[0], which we can just as well use
directly.
2024-06-04 11:36:51 +02:00
Anton Khirnov
67ca18dd56 lavc/hevcdec: drop HEVCLocalContext.gb
In all HEVCLocalContext instances except the first one, the bitreader is
never used for actually reading bits, but merely for passing the buffer
to ff_init_cabac_decoder(), which is better done directly.

The instance that actually is used for bitreading gets moved to stack in
decode_nal_unit(), which makes its lifetime clearer.
2024-06-04 11:36:51 +02:00
Anton Khirnov
ac69e6caf6 lavc/hevcdec: include first row in SliceHeader.offset/size
Will be useful in the following commit.
2024-06-04 11:36:51 +02:00
Anton Khirnov
79c0310aca lavc/hevcdec: drop a useless condition
hls_slice_data_wpp() is only called when num_entry_point_offsets>0
2024-06-04 11:36:51 +02:00
Anton Khirnov
74159cbfc3 lavc/hevcdec: move handling of byte alignment at the end of slice header
Do it in hls_slice_header() rather than cabac_init_decoder() - the
former is a more logical place as according the spec the byte alignment
is a part of the slice header, not slice data. Avoids a second instance
of alignment handling in vaapi_hevc.

Also, check that alignment_bit_equal_to_one is, in fact, equal to one.
2024-06-04 11:36:51 +02:00
James Almer
a14440867c x86/float_dsp: add SSE2 and AVX versions of scalarproduct_double
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-03 22:14:55 -03:00
Lynne
7413b81e50 aacdec_usac: fix typo in debug message 2024-06-04 03:08:46 +02:00
Lynne
f4371029f8 aacdec_usac: fix off by one error check on channel numbers 2024-06-04 03:08:45 +02:00
Lynne
0d93e04bc6 aacdec_usac: error out on receiving too many channels for the current layout
Verify that we have a correct number of channels.
2024-06-04 03:08:45 +02:00
Lynne
39826eacff aacdec_usac: error out on too many elements
USAC supports up to 64 audio channels, but puts no limit on the total
number of extensions that may be present. Which may mean that there's
a single audio channel, with 65 thousand extension elements.

We assume that 64 elements is the maximum for now. So check the value.
2024-06-04 03:08:44 +02:00
Lynne
b70fdbde9c aacdec_usac: prevent get_bits(0) in get_escaped_value
Some calls to get_escaped_value() specify 0 bits as the third value.
This would result in get_bits(0), which is not a correct usage of the
get_bits API.
2024-06-04 03:08:39 +02:00
Rémi Denis-Courmont
fd4977c876 lavc/aacencdsp: R-V V quant_bands
T-Head C908:
quant_bands_signed_c:        576.0
quant_bands_signed_rvv_f32:   48.7
quant_bands_unsigned_c:      414.2
quant_bands_unsigned_rvv_f32: 31.7

SpacemiT X60:
quant_bands_signed_c:        497.7
quant_bands_signed_rvv_f32:   23.0
quant_bands_unsigned_c:      353.5
quant_bands_unsigned_rvv_f32: 16.2
2024-06-03 22:43:37 +03:00
Rémi Denis-Courmont
be6f8c439a checkasm: add aacencdsp.quant_bands test 2024-06-03 22:43:37 +03:00
Andreas Rheinhardt
bb3c50b46d avcodec/tiff: Suppress unused variable warnings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-03 16:38:32 +02:00
Andreas Rheinhardt
87a13986bc avformat/nutdec: Don't create inconsistent side data
Forgotten in 65ddc74988.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-03 16:38:15 +02:00
Tomas Härdin
4037d5e103 lavc/speedhqenc: Require width to be a multiple of 16 2024-06-03 14:13:56 +02:00
Tomas Härdin
017a18b026 lavc/speedhqdec: Reindent 2024-06-03 14:13:34 +02:00
Tomas Härdin
42d5ddb2de lavc/speedhqdec: Add AV_CODEC_CAP_SLICE_THREADS
Each field slice is assigned to one thread.
Serial performance is unaffected.
2024-06-03 14:13:30 +02:00
Stefano Sabatini
77ad449911 doc/filters/curves: fix typos 2024-06-03 11:24:33 +02:00
Stefano Sabatini
17a759cce1 doc/filters/tiltandshift: apply typo fixes, add introductory description 2024-06-03 11:07:27 +02:00
Marcus B Spencer
26084887b0 doc/developer: update outdated information
Codec IDs have split from `avcodec.h` into `codec_id.h` after commit
c6978418b8.

General documentation contents (which are now in
`general_contents.texi`) have split from the header in `general.texi`
after commit 6accb7718a.

Update the developer documentation to match these changes.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
2024-06-03 10:58:31 +02:00
James Almer
4d59d58ea6 avcodec/aac/aacdec_usac: remove unnecessary cast
Fixes "libavcodec/aac/aacdec_usac.c(543): error C2440: 'type cast': cannot convert from 'GetBitContext' to 'GetBitContext'"
from msvc.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-02 20:14:20 -03:00
Michael Niedermayer
6106177ad6 avcodec/proresenc_anatoliy: Assert that AV_PROFILE_UNKNOWN is replaced
If its not replaced we would have a negative index used in an array potentially

Helps: CID1440385 Negative array index read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:42 +02:00
Michael Niedermayer
160b81ce2a avcodec/pcm-dvdenc: 64bit pkt-size
It seems nothing prevents such overflow even though odd

Fixes: CID1441934 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:42 +02:00
Michael Niedermayer
19db9636c5 avcodec/notchlc: Check init_get_bits8() for failure
Fixes: CID1500300 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer
161d0aa2a8 avcodec/tests/dct: Use 64bit in intermediate for error computation
Fixes: CID1500284 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer
d741638042 avcodec/scpr3: Check add_dec() for failure
Fixes: CID1441459 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:31:41 +02:00
Michael Niedermayer
e5098589b0 avcodec/rv34: assert that size is not 0 in rv34_gen_vlc_ext()
Helps: CID1548380 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer
6f976db251 avcodec/wavpackenc: Use unsigned for potential 31bit shift
Fixes: CID1465481 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer
30f2bac9f7 avcodec/wavpack: Remove dead assignments
Fixes: CID1442018 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:23 +02:00
Michael Niedermayer
2e5433dc12 avcodec/vvc/mvs: Initialize mvf
This might not be needed for correctness but it could
help general reproducability of issues

Related to: CID1560037 Uninitialized scalar variable
Related to: CID1560044 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer
12391b732f avcodec/tests/jpeg2000dwt: Use 64bit in comparission
Found while reviewing: CID1500309 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer
847a53f264 avcodec/tests/jpeg2000dwt: Use 64bit in err2 computation
This issue cannot happen with the current function parameters

Fixes: CID1500309 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:22 +02:00
Michael Niedermayer
348c3a7ffe avformat/fwse: Remove always false expression
Fixes: CID1460758 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-02 22:29:21 +02:00
Lynne
18757b26bd aacdec_usac: fix typo in fac_length
The spec says:
fac_length = (window_sequence==EIGHT_SHORT_SEQUENCE) ? ccfl/16 : ccfl/8;

The length used was flipped for short vs long.
2024-06-02 21:12:31 +02:00
James Almer
d8ffd65bfd avcodec/aac/aacdec_usac: remove call to realloc
Must be one of the lavu wrappers instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-02 15:32:04 -03:00
Lynne
63e166d802 lavu: bump minor and add APIchanges entries for the new channel positions 2024-06-02 19:19:25 +02:00
Lynne
24d3291f7c changelog: add entry for xHE-AAC 2024-06-02 18:34:46 +02:00
Lynne
7852d9e604 libavcodec: bump minor version for xHE-AAC 2024-06-02 18:34:46 +02:00
Lynne
b3212797ae fate: add tests for xHE-AAC
Starting off small with a few features.
Samples and reference decoded files copied from the official ISO
reference suite.
2024-06-02 18:34:46 +02:00
Lynne
eee5fa0808 aacdec: add a decoder for AAC USAC (xHE-AAC)
This commit adds a decoder for the frequency-domain part of USAC.

What works:
 - Mono
 - Stereo (no prediction)
 - Stereo (mid/side coding)
 - Stereo (complex prediction)

What's left:
 - SBR
 - Speech coding

Known issues:
 - Desync with certain sequences
 - Preroll crossover missing (shouldn't matter, bitrate adaptation only)
2024-06-02 18:34:45 +02:00
Lynne
23b45d7e20 aactab: add new scalefactor offset tables for 96/768pt windows 2024-06-02 18:34:45 +02:00
Lynne
a300ec3569 aactab: add tables for the new USAC arithmetic coder 2024-06-02 18:34:45 +02:00
Lynne
7cd8a3f509 aactab: add deemphasis tables for USAC 2024-06-02 18:34:44 +02:00
Lynne
0513c5cd25 aacdec_dsp: implement 768-point transform and windowing
Required for USAC
2024-06-02 18:34:44 +02:00
Lynne
f8543f3763 aacdec: expose decode_tns
USAC has the same syntax, with one minor change we can check for.
2024-06-02 18:34:43 +02:00
Lynne
0f2303f629 aacdec: expose channel layout related functions 2024-06-02 18:34:43 +02:00
Lynne
39b8d84b53 aacdec: move from scalefactor ranged arrays to flat arrays
AAC uses an unconventional system to send scalefactors
(the volume+quantization value for each band).
Each window is split into either 1 or 8 blocks (long vs short),
and transformed separately from one another, with the coefficients
for each being also completely independent. The scalefactors
slightly increase from 64 (long) to 128 (short) to accomodate
better per-block-per-band volume for each window.

To reduce overhead, the codec signals scalefactor sizes in an obtuse way,
where each group's scalefactor types are sent via a variable length decoding,
with a range.
But our decoder was written in a way where those ranges were carried through
the entire decoder, and to actually read them you had to use the range.

Instead of having a dedicated array with a range for each scalefactor,
just let the decoder directly index each scalefactor.

This also switches the form of quantized scalefactors to the format
the spec uses, where for intensity stereo and regular, scalefactors
are stored in a scalefactor - 100 form, rather than as-is.

USAC gets rid of the complex scalefactor handling. This commit permits
for code sharing between both.
2024-06-02 18:34:43 +02:00
Lynne
caeb275092 channel_layout: add new channel positions supported by xHE-AAC
apichanges will be updated upon merging, as well as a version bump.
2024-06-02 18:34:38 +02:00
Rémi Denis-Courmont
6c6bec04f3 lavc/vc1dsp: fix R-V V avg_mspel_pixels
The 8x8 pixel arrays are not necessarily aligned to 64 bits, so the
current code leads to Bus error on real hardware. This reproducible
with FATE's vc1_ilaced_twomv test case.

The new "pessimist" code can trivially be shared for 16x16 pixel
arrays so we also do that. FWIW, this also nominally reduces the
hardware requirement from Zve64x to Zve32x.

T-Head C908:
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c:      14.7
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32: 3.5
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c:       3.7
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i32: 1.5

SpacemiT X60:
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c:      13.0
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32: 3.0
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c:       3.2
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i32: 1.2
2024-06-02 10:37:09 +03:00
Andreas Rheinhardt
2c38ca3d37 avcodec/hevc_ps: Fix UB 1 << 31
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-06-02 05:15:00 +02:00
Michael Niedermayer
00d029d5c0 avcodec/sga: Make it clear that the return is intentionally not checked
Related: CID1473496 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:29 +02:00
Michael Niedermayer
70b4994762 avformat/asfdec_f: Use 64bit for preroll computation
Fixes: CID1500342 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer
d9d1f65308 avformat/argo_asf: Use 64bit in offset intermediate
Fixes: CID1467435 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer
a2b8d03347 avformat/ape: Use 64bit for final frame size
Fixes: CID1505963 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:28 +02:00
Michael Niedermayer
2f04cb673c avformat/ac4dec: Check remaining space in ac4_probe()
Fixes: CID1538298 Untrusted loop bound
Fixes: undefined behavior

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:27 +02:00
Michael Niedermayer
6f52b64bcc avdevice/pulse_audio_enc: Use av_rescale() to avoid integer overflow
Fixes: CID1503075 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-06-01 18:01:05 +02:00
Rémi Denis-Courmont
eed0a1d3d4 lavu/lls: R-V V update_lls
update_lls_8_c:        7.5
update_lls_8_rvv_f64:  4.2
update_lls_12_c:      14.5
update_lls_12_rvv_f64: 5.7
2024-06-01 18:05:58 +03:00
Rémi Denis-Courmont
fc85aff72f checkasm: add linear least square tests 2024-06-01 18:05:58 +03:00
James Almer
7087da303f avutil/float_dsp.h: fix doxy for scalarproduct_double
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 11:15:30 -03:00
James Almer
7736ca1d7b avutil/float_dsp: revert accidental doxy removal
done by accident in 6a7c4d60a1.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 11:14:42 -03:00
James Almer
7e182a8d92 avcodec/videotoolbox: use the correct HEVCSPS field name
Fixes compilation that was broken in 6fed1841a1.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-01 10:56:19 -03:00
James Almer
0a949aacae checkasm/lpc: use fixed length to bench apply_welch_window
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 17:06:08 -03:00
Rémi Denis-Courmont
16132a810d checkasm/lpc: test compute_autocorr
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 16:36:43 -03:00
Rémi Denis-Courmont
9238f6cb41 lavu/float_dsp: R-V V scalarproduct_double
C908:
scalarproduct_double_c:       39.2
scalarproduct_double_rvv_f64: 10.5

X60:
scalarproduct_double_c:       35.0
scalarproduct_double_rvv_f64:  5.2
2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont
b114952030 lavfi: get rid of bespoke double scalar products 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont
73c278d270 lavu/lls: use ff_scalarproduct_double_c() 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont
98405d28fa checkasm/float_dsp: add double-precision scalar product 2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont
6a7c4d60a1 lavu/float_dsp: add double-precision scalar product
The function pointer is appended to the structure for backward binary
compatibility. Fortunately, this is allocated by libavutil, not by the
user, so increasing the structure size is safe.
2024-05-31 22:22:43 +03:00
Rémi Denis-Courmont
06fc919aad lavc/sbrdsp: add support for 256-bit vectors
hf_apply_noise_0_c: 35.7
hf_apply_noise_0_rvv_f32: 9.5
hf_apply_noise_1_c: 38.5
hf_apply_noise_1_rvv_f32: 10.0
hf_apply_noise_2_c: 35.5
hf_apply_noise_2_rvv_f32: 9.7
hf_apply_noise_3_c: 38.5
hf_apply_noise_3_rvv_f32: 10.0

Maybe extending the noise table manually is not such great idea, but I
not quite sure how to deal with that otherwise? Allocating the table
dynamically is possible but would require an ELF destructor to clean up.
2024-05-31 22:22:43 +03:00
Anton Khirnov
63a96dbcce lavc/hevc_ps: compactify ShortTermRPS
Do not use larger fields than needed, use size-1 bitfields for flags.

Reduces sizeof(HEVCSPS) by 1280 bytes.
2024-05-31 19:26:06 +02:00
Anton Khirnov
9127819d51 lavc/hevc_ps: reduce the size of ShortTermRPS.used
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.

Reduces sizeof(HEVCSPS) by 1792 bytes.
2024-05-31 19:26:06 +02:00
Anton Khirnov
d893667867 lavc/hevc_ps: do not store delta_poc_s[01] in ShortTermRPS
They are only used in vulkan_hevc and are not actually needed, as they
can be computed from delta_poc.

Reduces sizeof(HEVCSPS) by 16kB.

Also, fix a typo (s0->s1) in the code being touched.
2024-05-31 19:26:06 +02:00
Anton Khirnov
4264e4056c lavc/hevc_ps: fix variable signedness in ff_hevc_decode_short_term_rps()
It is actually supposed to go negative in the loop over num_negative
pics, but underflow does not break anything as the result is then
assigned to a signed int.
2024-05-31 19:26:06 +02:00
Anton Khirnov
6fed1841a1 lavc/hevc_ps/HEVCSPS: change flags into uint8_t
Reduces sizeof(HEVCSPS) by 64 bytes.

Also improve flag names: drop redundant suffixes and prefixes, and
consistently use disabled/enabled.
2024-05-31 19:26:06 +02:00
Anton Khirnov
bd1a06dc43 lavc/hevc_ps: reduce the size of used_by_curr_pic_lt_sps_flag
It is currently an array of 32 uint8_t, each storing a single flag. A
single uint32_t is sufficient.
2024-05-31 19:26:06 +02:00
Anton Khirnov
72bdbce00d lavc/hevcdec: drop a useless execute() call with 1 job 2024-05-31 19:26:06 +02:00
Anton Khirnov
f0aece90d9 lavc/hevcdec: allocate local_ctx as array of structs rather than pointers
It is more efficient and easier to manage.
2024-05-31 19:26:06 +02:00
Anton Khirnov
25ce44efa5 lavc/hevcdec: track local context count separately from WPP thread count
The latter can be lowered while decoding, which would lead to memleaks.
2024-05-31 19:26:06 +02:00
Anton Khirnov
a1471ec8ad lavc/hevcdec: rename HEVCContext.HEVClcList to local_ctx
It is more consistent with our naming conventions.
2024-05-31 19:26:06 +02:00
James Almer
e0db1f51d6 avcodec/lpc: account for odd len values
Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 13:36:02 -03:00
Gyan Doshi
2f184aa89b configure: correct libopenjpeg description
Decoding is no longer possible as the decoder wrapper was removed
in 60ccb3fe78
2024-05-31 21:20:28 +05:30
James Almer
8a1c491354 avcodec/packet: remove reference to old AV_SIDE_DATA_PARAM_CHANGE_ values
They were forgotten in 65ddc74988.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 11:24:37 -03:00
Andreas Rheinhardt
8cbf7e8408 avcodec/diracdec: Mark flush as av_cold
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
0f3090cbd1 avcodec/diracdec: Use FF_CODEC_CAP_INIT_CLEANUP
This was one of the few decoders incompatible with the flag.
Also only call free_sequence_buffers() instead of dirac_decode_flush()
in dirac_decode_end().

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
d9bd5baf9d avcodec/vc2enc: Use already available AVPixFmtDescriptor
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
d1d40a7c9b avcodec/vc2enc: Move transient PutBitContext from ctx to stack
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
c309285666 avcodec/vc2enc: Avoid relocations for short strings
These strings are so short that they can be put directly
into the containing structure, avoiding the pointer
and putting it into .rodata.
Also use chars for interlaced and level while at it, as
these are so small.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
02ecf8d7f3 avcodec/vc2enc: Fix slice length
args->bytes here already includes prefix_bytes (see
SSIZE_ROUND macro), so including it here again and
forgetting it when offsetting skip seems wrong.
This only works because prefix_bytes is currently
always zero in this encoder.
(This has been added in b88be742fa
without any reason.)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
eac8dcb187 avcodec/vc2enc: Remove superfluous error message
ff_get_encode_buffer() already emits an error message of its own.
While just at it, also check for ret < 0 instead of just ret != 0.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
b1702afdfd avcodec/vc2enc: Constify slices->main context pointers
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
6d86146fce avcodec/vc2enc: Avoid void* where possible
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
2d818644a3 avfilter/af_afir: Merge header into af_afir.c
Done in 0df18f29ae,
accidentally undone in 163e737c17.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
21bfc62642 avfilter/af_aiir: Avoid unchecked allocation
W has not been checked at all; allocate it jointly with M
to fix this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
37cc648fbd avfilter/af_aiir: Remove dead code
Fixes Coverity issue #1468252.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
996e0a57ca avformat/matroskadec: Add assert to silence Coverity false positive
Helps with Coverity issue #1452453.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
Andreas Rheinhardt
dfd0320e23 avfilter/vf_signalstats: Use 64bit for processing histogram
The result might not fit into 32bit if an image has gigantic
dimensions and one of the planes has a dominant value
(particularly so if said value is big).

Fixes Coverity issues #1598399, #1598401, #1598402, #1598403, #1598404.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-31 14:18:33 +02:00
James Almer
4008a80c1b tests/checkasm/vvc_mc: don't zero the SAD buffers
They will be filled immediately after.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 20:05:21 +08:00
James Almer
b70289f354 tests/checkasm/vvc_mc: fix indentation
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-31 20:05:21 +08:00
Wu Jianhua
442e94e5e4 tests/checkasm/vvc_alf: change alf step size to 8
From Benjamin Bross:
> for ALF where functions are in increments of 4 while 8 should be sufficient according to the spec.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Wu Jianhua
9950f14864 avcodec/x86/vvc/vvc_alf: use xq to match ptrdiff_t
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Wu Jianhua
09d3370c28 avcodec/x86/vvc/vvc_alf: fix integer overflow
Some tests fails with certain seeds

tests/checkasm/checkasm 2325607578 --test=vvc_alf
checkasm: using random seed 2325607578
AVX2:
    vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
  - vvc_alf.alf_filter   [FAILED]
  - vvc_alf.alf_classify [OK]
checkasm: 28 of 9216 tests have failed

Reported-by: James Almer <jamrial@gmail.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-31 19:57:31 +08:00
Pierre-Anthony Lemieux
249c66bb22 avcodec/jpeg2000dec: fix HT block decoder
Addresses https://trac.ffmpeg.org/ticket/10905

Co-authored-by: Osamu Watanabe <owatanab@es.takushoku-u.ac.jp>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2024-05-30 21:30:52 -07:00
Shiyou Yin
6b35fcacdb swscale: [loongarch] Fix undeclared functions prob.
Compile with '--disable-lasx', ‘lumRangeFromJpeg_lasx’ undeclared.

Reviewed-by: 金波 <jinbo@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-31 02:20:23 +02:00
sunyuechi
544acfa2c0 lavc/vp9dsp: R-V V rename ff_avg to ff_vp9_avg
Avoid potential naming conflicts

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont
8a96495fef checkasm/vp8dsp: add VP7 tests 2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont
a3d4c73b4e checkasm/vp8dsp: share DSP context across tests
This will simplify later changes.
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont
4fe8f2cc43 riscv: allow passing addend to vtype_vli macro
A constant (-1) is added to the length value, so we can have an added
for free, and optimise the addition away if the addend is exactly 1.
2024-05-30 18:30:52 +03:00
Rémi Denis-Courmont
add8c46215 Revert "avformat/file: seek back to initial position for fd protocol"
The generally expected behaviour is for software to append from the
current position, not to keep resetting. See also how shell works:
 # (foo && bar) > file
...would normally concatenate the output of both commands to file.

If foo seeks like lavf, bar would instead overwrite the output of
foo (possibly not completely).

This reverts commit 5c3d2177e7.
2024-05-30 18:30:21 +03:00
Zhao Zhili
6de951923b avfilter/dnn: Remove a level of dereference
For code such as 'model->model = ov_model' is confusing. We can
just drop the member variable and use cast to get the subclass.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:31 +08:00
Zhao Zhili
a1fea7e11b avfilter/dnn_backend_torch: Simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:27 +08:00
Zhao Zhili
abfefbb33b avfilter/dnn_backend_tf: Simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:21 +08:00
Zhao Zhili
a40df366c4 avfilter/dnn_backend_tf: Fix free context at random place
It will be freed again by ff_dnn_uninit.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:17 +08:00
Zhao Zhili
d3db7bbc03 avfilter/dnn_backend_tf: Remove one level of indentation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:10 +08:00
Zhao Zhili
57a3c2cd40 avfilter/dnn_backend_openvino: simplify memory allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:07 +08:00
Zhao Zhili
ac52cee72e avfilter/dnn_backend_openvino: Fix free context at random place
It will be freed again by ff_dnn_uninit.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:14:00 +08:00
Zhao Zhili
093f5da534 avfilter/dnn: Don't show backends which are not supported by a filter 2024-05-30 18:13:46 +08:00
Zhao Zhili
4f051c746b avfilter/dnn: Use dnn_backend_info_list to search for dnn module
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-30 18:13:29 +08:00
Rémi Denis-Courmont
fa3b153cb1 lavc/vp7dsp: R-V V vp7_idct_add
Most of the code is shared with DC, thanks to minor earlier changes.

vp7_idct_add_c:       5.2
vp7_idct_add_rvv_i32: 2.5
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont
4a0e629b6f lavc/vp7dsp: revector ff_vp7_dc_wht_rvv
This prepares for some code reuse.
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont
fd39997f72 lavc/vp7dsp: add R-V V vp7_luma_dc_wht
This works out a bit more favourably than VP8's due to:
- additional multiplications that can be vectored,
- hardware-supported fixed-point rounding mode.

vp7_luma_dc_wht_c:       3.2
vp7_luma_dc_wht_rvv_i64: 2.0
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont
91b5ea7bb9 lavc/vp8dsp: R-V V vp8_luma_dc_wht
This is not great as transposition is poorly supported, but it works:
vp8_luma_dc_wht_c:       2.5
vp8_luma_dc_wht_rvv_i32: 1.7
2024-05-29 16:57:02 +03:00
Rémi Denis-Courmont
c53d42380d lavc/lpc: optimise RVV vector type for compute_autocorr
On SpacemiT X60 (with len == 4000):
autocorr_10_c:       2303.7
autocorr_10_rvv_f64: 1411.5 (before)
autocorr_10_rvv_f64:  842.2 (after)
2024-05-29 16:57:02 +03:00
Stone Chen
d82c503555 tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that  8x16, 16x8, and 16x16 are the only allowed sizes.

This changes check_vvc_sad() to only test and benchmark those sizes.
2024-05-29 21:35:34 +08:00
Stone Chen
55e9c758f0 libavcode/x86/vvc: change label to vvc_sad_16 to reflect block sizes
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that  8x16, 16x8, and 16x16 are the only allowed sizes. This re-labels vvc_sad_16_128 to vvc_sad_16 to reflect this and adds a comment about the block size constraints. There's no functionality change.
2024-05-29 21:35:34 +08:00
David Rosca
510494760c lavc/vaapi_h264: Fix merging fields in DPB with missing references
If there are missing references, h264 decode does error concealment
by copying previous refs which means there will be duplicated surfaces.
Check long_ref and frame_idx in addition to surface when looking for
the other field to avoid trying to merge with wrong picture.
Also allow to merge with multiple pictures in case there are duplicates
of the other field.

Signed-off-by: David Rosca <nowrep@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:52:10 +08:00
David Rosca
d2d911eb9a lavc/vaapi_av1: Avoid sending the same slice buffer multiple times
When there are multiple tiles in one slice buffer, use multiple slice
params to avoid sending the same slice buffer multiple times and thus
increasing the bitstream size the driver will need to upload to hw.

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: David Rosca <nowrep@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:49:35 +08:00
David Rosca
fe9d889dcd lavc/vaapi_decode: Make it possible to send multiple slice params buffers
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: David Rosca <nowrep@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:47:43 +08:00
Haihao Xiang
c872ba5899 lavc/qsvenc: respect user's setting for keyframes
For example:
./ffmpeg -hwaccel qsv -i input.mp4 -force_key_frames:v source -c:v
hevc_qsv -f null -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:46:54 +08:00
Haihao Xiang
dbdd9ccded lavc/qsvdec: fix keyframes
MFX_FRAMETYPE_IDR is ORed to the frame type for AVC and HEVC keyframes,
and MFX_FRAMETYPE_I is taken as keyframe flag for other codecs when
getting the output surface from the SDK, hence we may mark the output
frame as keyframe accordingly.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-29 10:46:54 +08:00
Rémi Denis-Courmont
a11122f9c6 lavc/vp8dsp: save one R-V GPR
This saves one instruction and frees up A5, which will be repurposed in
later changes. Unfortunately, we need to add quite a lot of alternative
code for this.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont
4e56455d36 lavc/vp8dsp: avoid one multiplication on RISC-V
Use shifts rather than multiply, and save one instruction.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont
0aad5b9bf5 lavc/vp8dsp: factor R-V V bilin functions
For a given type, only the first VSETVLI instruction varies depending
on the size.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont
b248d7c319 lavc/sbrdsp: fold immediate offset into relocation
This results in AUIPC; ADDI instead of AUIPC; ADDI; ... ADDI.
2024-05-28 19:44:11 +03:00
Rémi Denis-Courmont
8444115262 lavc/startcode: fix RVV return value on no match
If there are no zero bytes, t2 equals -1. The code cannot simply fall
through to the match case.
2024-05-28 19:43:40 +03:00
Rémi Denis-Courmont
af20fb9c4e lavc/lpc: fix off-by-one in R-V V compute_autocorr 2024-05-28 19:43:40 +03:00
Niklas Haas
9fd88bd092 avcodec/h2645_sei: loosen up min luminance requirements
The H.265 specification is quite clear on this case:

> When min_display_mastering_luminance is not in the range of 1 to
> 50000, the nominal maximum display luminance of the mastering display
> is unknown or unspecified or specified by other means not specified in
> this Specification.

And so the current code is correct in marking luminance data as invalid
if min luminance is set to 0. However, this breaks playback of at least
several real-world Blu-ray releases, for example La La Land, Planet of
the Apes, and quite possibly a lot more. These come with ostensibly
valid max_luminance tags (1000 nits), but min_luminance set to 0.

Loosen up this requirement by guarding it behind FF_COMPLIANCE_STRICT.
We still reject blatantly invalid metadata (wrong value range on
luminance, max set to 0, max below min, min above 50 nits etc.), so this
shouldn't cause any unintended regressions.

Fixes: https://github.com/mpv-player/mpv/issues/14177
2024-05-28 18:11:57 +02:00
Kacper Michajłow
b2b23f353a avformat/hls: update current segment reference before use
It may be invalidated by the time it is used.

Fixes use after free when accessing current segment.

Fixes: #10825
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-28 15:02:02 +02:00
Michael Niedermayer
62d7106c36 avcodec/vlc: Cleanup on multi table alloc failure in ff_vlc_init_multi_from_lengths()
Fixes: CID1544630 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:08 +02:00
Michael Niedermayer
d5cc21741b avcodec/vc1_block: remove unneeded store to off in vc1_decode_p_mb_intfi()
Found while reviewing code related to coverity

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:08 +02:00
Michael Niedermayer
992b28f572 avcodec/vc1_block: remove unused off from vc1_decode_p_mb_intfr()
Fixes: CID1435166 Unused value
Fixes: CID1529221 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:08 +02:00
Michael Niedermayer
a287f17db2 avcodec/tiff: Assert init_get_bits8() success in unpack_gray()
Helps: CID1441939 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:07 +02:00
Michael Niedermayer
8814cedb07 avcodec/tiff: Assert init_get_bits8() success in horizontal_fill()
Helps: CID1441167 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:07 +02:00
Michael Niedermayer
6df8bd64ff tools/decode_simple: Check avcodec_send_packet() for errors on flushing
This will not error but the API allows errors so we should check it
Fixes: CID1489999 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:06 +02:00
Michael Niedermayer
bfc22f364d swscale/yuv2rgb: Use 64bit for brightness computation
This will not overflow for normal values
Fixes: CID1500280 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:06 +02:00
Michael Niedermayer
3f9daf1c18 swscale/x86/swscale: use a clearer name for INPUT_PLANER_RGB_A_FUNC_CASE
related: CID1497114 Missing break in switch

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:06 +02:00
Michael Niedermayer
e3481730ed avutil/tests/opt: Check av_set_options_string() for failure
This is test code after all so it should test things

Fixes: CID1518990 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:05 +02:00
Michael Niedermayer
e8a1e1899d avutil/tests/dict: Check av_dict_set() before get for failure
Failure is possible due to strdup()

Fixes: CID1516764 Dereference null return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:05 +02:00
Michael Niedermayer
87846f64b5 avutil/random_seed: Avoid dead returns
Fixes: CID1538296 Structurally dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:05 +02:00
Michael Niedermayer
c4004605b2 avdevice/dshow: fix badly indented line
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:04 +02:00
Michael Niedermayer
c841cb45e8 qsv: Initialize impl_value
Fixes: The warnings from CID1598553 Uninitialized scalar variable

Passing partly initialized structs is ugly and asking for hard to rieproduce bugs,
The uninitialized fields where not used

Reviewed-by: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:04 +02:00
Michael Niedermayer
3c1915d776 avformat/hlsenc: Remove dead ret stores
Fixes: CID1529222 Unused value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:04 +02:00
Michael Niedermayer
33da5f4e27 avformat/demux: resurrect dead stores
Fixes: CID1473512 Unused value
Fixes: CID1529228 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:03 +02:00
Michael Niedermayer
e7775973f0 avcodec/tests/bitstream_template: Assert bits_init8() return
Helps: CID1518967 Unchecked return value
Helps: CID1518968 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:03 +02:00
Michael Niedermayer
b6fa2ed77e tools/enc_recon_frame_test: Assert that av_image_get_linesize() succeeds
Helps: CID1524598 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:03 +02:00
Marton Balint
ed927f2f0c fftools/ffplay: allow unused format options which are also codec options
Same as it is handled in ffmpeg, allows using -ch_layout codec option.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint
4d97557137 fftools/ffplay: use cmdutils code for checking remaining avoptions
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint
f9810be5d3 fftools: move check_avoptions and remove_avoptions to cmdutils
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint
169b6ee732 doc/ffmpeg: document -channel_layout/ch_layout options
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Marton Balint
4bfecde9b9 fftools/ffmpeg_demux: honor -ch_layout options for overriding input stream channel layout
The code only set the channel layout of the AVFormatContext, so the user could
not override the channel layout if the demuxer did not have such parameter.

This used to work via the respective AVCodecContext option, but since
639c2f0049 it no longer gets passed to the
decoders. It is actually better if we set it manually, instead of using the
codec option because that way we can also override it on the stream level, so
it will also work for stream copy or bitstream filtering.

We don't allow changing the number of channels, because that can cause
unexpected results. We disable layout guessing, if a channel layout is
specified.

Fixes ticket #11016.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-27 21:46:47 +02:00
Rémi Denis-Courmont
44f7f6e010 checkasm: add h263dsp.{h,v}_loop_filter 2024-05-27 22:42:07 +03:00
Rémi Denis-Courmont
a535ce2ac0 lavc/flacdsp: R-V Zvl256b lpc33
flac_lpc_33_13_c: 499.7
flac_lpc_33_13_rvv_i64: 197.7
flac_lpc_33_16_c: 601.5
flac_lpc_33_16_rvv_i64: 195.2
flac_lpc_33_29_c: 1011.5
flac_lpc_33_29_rvv_i64: 300.7
flac_lpc_33_32_c: 1099.0
flac_lpc_33_32_rvv_i64: 296.7
2024-05-27 22:07:29 +03:00
Rémi Denis-Courmont
5ebb071d79 lavc/vp8dsp: disable EPEL HV on RV128
RV128 is mostly scifi at this point, so we can just disable it here
(the EPEL HV prologue/epilogue do not save 128-bit registers).
2024-05-27 22:07:29 +03:00
Diego Felix de Souza
aead61451c avcodec/nvenc_av1: Correct CQ range for AV1
The Constant Quality (CQ) range for the AV1 codec is actually 0 to
63, contrary to what is stated in the header and documentation.

Signed-off-by: Diego Felix de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-05-27 19:20:18 +02:00
Andreas Rheinhardt
41e1322845 tests/fate/source-check: Relax BSD licence check
Several files already had standard license header (namely
2-clause BSD files), yet due to the 80 char line length limit,
they were not treated as such by source-check.sh (which
fate-source uses). Therefore relax the BSD check.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-27 19:04:09 +02:00
Andreas Rheinhardt
f1337e5dd9 doc/mips: Update list of files with MIPS copyright notice
E.g. the AAC stuff has been removed in
03cf101645.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-27 19:04:08 +02:00
Frank Plowman
49c3918c1a lavc/vvc: Validate temporal MVP references
Per VVCv3 p. 157, the collocated reference picture used in temporal
motion vector prediction must have RprConstraintsActiveFlag equal to
zero and the same CTU size as the current picture.  Add these checks,
fixing crashes decoding some fuzzed bitstreams.

Additionally, only set up the collocated reference picture if it is
actually going to be used (i.e. if ph_temporal_mvp_enabled_flag is 1),
else legal RPR bitstreams will fail the new checks.

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-05-27 20:24:21 +08:00
llyyr
2b11a8b95b lavc/vp9: reset segmentation fields when segmentation isn't enabled
Fields under the segmentation switch are never reset on a new frame, and
retain the value from the previous frame. This bugs out a bunch of
hwaccel drivers when segmentation is disabled but update_map isn't
reset because they don't ignore values behind switches. This commit also
resets the temporal field, though it may not be required.

We also do this for vp8 [1] so this commit is just mirroring the vp8
logic.

This fixes an issue with certain samples [2] that causes blocky
artifacts with vaapi, d3d11va and cuda (and possibly others).
Mesa worked around [3] this by ignoring these fields if
segmentation.enabled is 0, but d3d11va still displays blocky artifacts.

[1] 2e877090f9:/libavcodec/vp8.c#l797
[2] https://github.com/mpv-player/mpv/issues/13533
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27816

Signed-off-by: llyyr <llyyr.public@gmail.com>
2024-05-27 12:23:40 +02:00
Fei Wang
01c7f68f7a lavc/qsvdec: Use coded_w/h for frame resolution when use system memory
Fix output mismatch when decode clip with crop(conf_win_*offset in
syntax) info by using system memory:

$ ffmpeg -c:v hevc_qsv -i conf_win_offet.bit -y out.yuv

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-05-27 09:38:46 +08:00
Fei Wang
1c56263704 lavc/qsvdec: Allow decoders to export crop information
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-05-27 09:38:46 +08:00
Haihao Xiang
a72e9aeabc lavc/qsvenc_av1: accept HDR metadata if have
The sdk av1 encoder can accept HDR metadata via mfxEncodeCtrl::ExtParam.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-27 09:38:46 +08:00
Haihao Xiang
473e84ad62 lavc/qsvdec: update HDR side data on output AVFrame for AV1 decoding
The SDK may provide HDR metadata for HDR streams via mfxExtBuffer
attached on output mfxFrameSurface1

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-27 09:38:46 +08:00
Brad Smith
43b1a95678 configure: enable ffnvcodec, nvenc, nvdec for FreeBSD
Signed-off-by: Brad Smith <brad@comstyle.com>
2024-05-26 19:25:51 -04:00
Rémi Denis-Courmont
25a33665a0 lavc/vp8dsp: remove unused macro parameter 2024-05-26 19:20:48 +03:00
Rémi Denis-Courmont
728a1dd3b6 lavc/rv34dsp: remove stray load immediate 2024-05-26 19:20:45 +03:00
sunyuechi
63697d3350 lavc/vp8dsp: R-V V put_epel hv
C908:
vp8_put_epel4_h4v4_c: 20.0
vp8_put_epel4_h4v4_rvv_i32: 11.0
vp8_put_epel4_h4v6_c: 25.2
vp8_put_epel4_h4v6_rvv_i32: 13.5
vp8_put_epel4_h6v4_c: 22.2
vp8_put_epel4_h6v4_rvv_i32: 14.5
vp8_put_epel4_h6v6_c: 29.0
vp8_put_epel4_h6v6_rvv_i32: 15.7
vp8_put_epel8_h4v4_c: 73.0
vp8_put_epel8_h4v4_rvv_i32: 22.2
vp8_put_epel8_h4v6_c: 90.5
vp8_put_epel8_h4v6_rvv_i32: 26.7
vp8_put_epel8_h6v4_c: 85.0
vp8_put_epel8_h6v4_rvv_i32: 27.2
vp8_put_epel8_h6v6_c: 104.7
vp8_put_epel8_h6v6_rvv_i32: 29.5
vp8_put_epel16_h4v4_c: 145.5
vp8_put_epel16_h4v4_rvv_i32: 26.5
vp8_put_epel16_h4v6_c: 190.7
vp8_put_epel16_h4v6_rvv_i32: 47.5
vp8_put_epel16_h6v4_c: 173.7
vp8_put_epel16_h6v4_rvv_i32: 33.2
vp8_put_epel16_h6v6_c: 222.2
vp8_put_epel16_h6v6_rvv_i32: 35.5

Amended to disable unsupported RV128.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-26 15:15:28 +03:00
Rémi Denis-Courmont
0b2316e37f lavc/sbrdsp: fix inverted boundary check
128-bit is the maximum, not the minimum here. Larger vector sizes can
result in reads past the end of the noise value table.

This partially reverts commit cdcb4b98b7.
2024-05-25 22:03:37 +03:00
Rémi Denis-Courmont
e6b38c944f lavc/sbrdsp: fix potential overflow in noise table
Since the SBR noise application optimisations are currently restricted
to hardware with 128-bit vectors, and use a quadruple multipler, they
can load up to 16 32-bit elements. But the "loads" are of 2 segments,
or 16 pairs of single precision float.

Thus we need to expand the dupiclated section of the noise table from
2x8 to 2x16 to avoid overflows.
2024-05-25 22:00:18 +03:00
Andreas Rheinhardt
e9197db4f7 tests/checkasm/vvc_alf: Don't use declare_func_emms
VVC does not have MMX code at all, so one can use the stricter
declare_func to also check that the MMX state has not been clobbered
with (which would be an ABI violation).

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 14:21:54 +02:00
Andreas Rheinhardt
8e27bd025f avformat/async,cache: Use more unique context names
Otherwise Doxygen thinks any text like "Context for foo"
is a link to the async protocol's struct called "Context".

Reported-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:52:19 +02:00
Andreas Rheinhardt
edc235e076 avformat/riffenc: Fix outdated comment
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:52:05 +02:00
Andreas Rheinhardt
50c25d1f0a avformat/matroskaenc: Check ff_put_wav_header() failure
Fixes Coverity issue #1506706.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:58 +02:00
Andreas Rheinhardt
65763bffb6 avformat/mpegts: Don't use uninitialized value in av_log()
It is undefined behaviour in (at least) C11 (see C11 6.3.2.1 (2)).
Fixes Coverity issue #1500314.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt
d8cad01805 avformat/dhav: Check amount read
Prevents potential use of uninitialized data in the following
memcmp().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt
cf6d07522a avformat/dhav: Check ffio_ensure_seekback()
Fixes Coverity issue #1492324.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt
95faf45af1 avformat/qoadec: Check ffio_ensure_seekback()
Fixes Coverity issue #1598406.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt
6dc8d4eea8 avformat/westwood_vqa: Check ffio_ensure_seekback()
Fixes Coverity issue #1598405.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt
590fffe6ad avformat/gifdec: Check ffio_ensure_seekback()
Fixes Coverity issue #1598400.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Andreas Rheinhardt
b47116be45 avformat/oggdec: Check ffio_ensure_seekback()
Fixes Coverity issue #1492327.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-25 13:51:27 +02:00
Rémi Denis-Courmont
f883746587 lavc/flacdsp: do not assume maximum R-V VL
This loop correctly assumes that VLMAX=16 (4x128-bit vectors
with 32-bit elements) and 32 >= pred_order > 16. We need to alternate
between VL=16 and VL=t2=pred_order-16 elements to add up to pred_order.

The current code requests AVL=a2=pred_order elements. In QEMU and on
thte K230 hardware, this sets VL=16 as we need. But the specification
merely guarantees that we get: ceil(AVL / 2) <= VL <= VLMAX. For
instance, if pred_order equals 27, we could end up with VL=14 or VL=15
instead of VL=16. So instead, request literally VLMAX=16.
2024-05-25 10:31:50 +03:00
Andreas Rheinhardt
aff24c1658 avcodec/flacdec: Remove unused variable
Forgotten in 0380a03f1f.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-24 19:05:57 +02:00
Rémi Denis-Courmont
ba38d0e328 lavc/pixblockdsp: add scalar get_pixels_unaligned
The code is already there, we just need to use it.

get_pixels_unaligned_c: 2.2
get_pixels_unaligned_misaligned: 1.7
2024-05-24 17:53:43 +03:00
Rémi Denis-Courmont
d03cdfa2b6 checkasm/riscv: test misaligned before V
Otherwise V functions mask scalar misaligned ones.
2024-05-24 17:53:43 +03:00
James Almer
0920f506a7 checkasm/flacdsp: add a test for lpc33
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-24 09:23:00 -03:00
James Almer
0380a03f1f avcodec/flacdsp: split off lpc33 into a dsp function
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-24 09:23:00 -03:00
James Almer
62397bcf6a avformat/movenc: add support for writing SA3D boxes
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-23 19:06:46 -03:00
James Almer
8c97449482 avutil/channel_layout: add a helper function to get the ambisonic order of a layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-23 12:07:19 -03:00
Haihao Xiang
8155808ce6 libavcodec/x86/vvc/vvc_sad: fix assembler error
X86ASM    libavcodec/x86/vvc/vvc_sad.o
libavcodec/x86/vvc/vvc_sad.asm:85: error: invalid number of operands
libavcodec/x86/vvc/vvc_sad.asm:87: error: invalid number of operands

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-23 09:12:50 -03:00
Andreas Rheinhardt
ece95dc3dc avfilter/af_atempo: Fix indentation
Forgotten after b8f74ee57a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-23 10:45:55 +02:00
Andreas Rheinhardt
42e0e05834 avfilter/af_atempo: Simplify resetting
The earlier code distinguished between a partial reset
(yae_clear()) and a complete reset (yae_release_buffers()
which also releases the buffers); this separation existed
to avoid allocations, as buffers were reallocated on reconfigs.

Yet it is pointless since a5704659e3,
so simply use yae_release_buffers() everywhere.

Reviewed-by: Pavel Koshevoy <pkoshevoy@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-23 10:45:25 +02:00
Andreas Rheinhardt
35e7fa0a2e avfilter/af_atempo: Properly check av_tx_init()
Fixes Coverity issue #1516804.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-23 10:45:16 +02:00
Stone Chen
2e877090f9 tests/checkasm: Add check_vvc_sad to vvc_mc.c
Adds checkasm for DMVR SAD AVX2 implementation.

Benchmarks ( AMD 7940HS )
vvc_sad_8x8_c: 50.3
vvc_sad_8x8_avx2: 0.3
vvc_sad_16x16_c: 250.3
vvc_sad_16x16_avx2: 10.3
vvc_sad_32x32_c: 1020.3
vvc_sad_32x32_avx2: 60.3
vvc_sad_64x64_c: 3850.3
vvc_sad_64x64_avx2: 220.3
vvc_sad_128x128_c: 14100.3
vvc_sad_128x128_avx2: 840.3

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 20:36:46 -03:00
Stone Chen
0e52a4e434 libavcodec/x86/vvc: Add AVX2 DMVR SAD functions for VVC
Implements AVX2 DMVR (decoder-side motion vector refinement) SAD functions. DMVR SAD is only calculated if w >= 8, h >= 8, and w * h > 128. To reduce complexity, SAD is only calculated on even rows. This is calculated for all video bitdepths, but the values passed to the function are always 16bit (even if the original video bitdepth is 8). The AVX2 implementation uses min/max/sub.

Additionally this changes parameters dx and dy from int to intptr_t. This allows dx & dy to be used as pointer offsets without needing to use movsxd.

Benchmarks ( AMD 7940HS )
Before:
BQTerrace_1920x1080_60_10_420_22_RA.vvc | 106.0 |
Chimera_8bit_1080P_1000_frames.vvc | 204.3 |
NovosobornayaSquare_1920x1080.bin | 197.3 |
RitualDance_1920x1080_60_10_420_37_RA.266 | 174.0 |

After:
BQTerrace_1920x1080_60_10_420_22_RA.vvc | 109.3 |
Chimera_8bit_1080P_1000_frames.vvc | 216.0 |
NovosobornayaSquare_1920x1080.bin | 204.0|
RitualDance_1920x1080_60_10_420_37_RA.266 | 181.7 |

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 20:36:21 -03:00
James Almer
3146b77a7d avformat/mov: store sample_sizes as unsigned ints
As defined in Section 8.7.3.2.1 of ISO 14496-12.
Any unsupported value will be rejected in mov_build_index() without outright
aborting demuxing.

Fixes ticket #11005.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 17:46:49 -03:00
James Almer
2d84ee3745 avformat/vvc: fix parsing sps_subpic_id
The length of the sps_subpic_id[i] syntax element is sps_subpic_id_len_minus1 + 1 bits.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 17:46:49 -03:00
James Almer
3bd7e3a336 avformat/vvc: initialize some ptl flags
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 17:46:49 -03:00
Rémi Denis-Courmont
910d281b21 lavc/h263dsp: R-V V {h,v}_loop_filter
Since the horizontal and vertical filters are identical except for a
transposition, this uses a common subprocedure with an ad-hoc ABI.
To preserve return-address stack prediction, a link register has to be
used (c.f. the "Control Transfer Instructions" from the
RISC-V ISA Manual). The alternate/temporary link register T0 is used
here, so that the normal RA is preserved (something Arm cannot do!).

To load the strength value based on `qscale`, the shortest possible
and PIC-compatible sequence is used: AUIPC; ADD; LBU. The classic
LLA; ADD; LBU sequence would add one more instruction since LLA is a
convenience alias for AUIPC; ADDI. To ensure that this trick works,
relocation relaxation is disabled.

To implement the two signed divisions by a power of two toward zero:
 (x / (1 << SHIFT))
the code relies on the small range of integers involved, computing:
 (x + (x >> (16 - SHIFT))) >> SHIFT
rather than the more general:
 (x + ((x >> (16 - 1)) & ((1 << SHIFT) - 1))) >> SHIFT
Thus one ANDI instruction is avoided.

T-Head C908:
h263dsp.h_loop_filter_c:       228.2
h263dsp.h_loop_filter_rvv_i32: 144.0
h263dsp.v_loop_filter_c:       242.7
h263dsp.v_loop_filter_rvv_i32: 114.0
(C is probably worse in real use due to less predictible branches.)
2024-05-22 19:15:39 +03:00
James Almer
3d1597d3e2 x86/vvc_alf: use the x86inc instruction macros
Let its magic figure out the correct mnemonic based on target instruction set.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-22 20:51:30 +08:00
llyyr
d1b96c3808 avformat/mov: avoid seeking back to 0 on HEVC open GOP files
ab77b878f1 attempted to fix the issue of broken packets being sent to
the decoder by implementing logic that kept attempting to PTS-step
backwards until it reached a valid point, however applying this
heuristic meant that in files that had no valid points (such as HEVC
videos shot on iPhones), we'd seek back to sample 0 on every seek
attempt. This meant that files that were previously seekable, albeit
with some skipped frames, were not seekable at all now.

Relax this heuristic a bit by giving up on seeking to a valid point if
we've tried a different sample and we still don't have a valid point to
seek to. This may some frames to be skipped on seeking but it's better
than not being able to seek at all in such files.

Fixes: ab77b878f1 ("avformat/mov: fix seeking with HEVC open GOP files")
Fixes: #10585
Signed-off-by: Philip Langdale <philipl@overt.org>
2024-05-21 18:57:44 -07:00
sunyuechi
0c1304ae11 lavc/vp9dsp: R-V V mc avg
C908:
vp9_avg4_8bpp_c: 1.2
vp9_avg4_8bpp_rvv_i64: 1.0
vp9_avg8_8bpp_c: 3.7
vp9_avg8_8bpp_rvv_i64: 1.5
vp9_avg16_8bpp_c: 14.7
vp9_avg16_8bpp_rvv_i64: 3.5
vp9_avg32_8bpp_c: 57.7
vp9_avg32_8bpp_rvv_i64: 10.0
vp9_avg64_8bpp_c: 229.0
vp9_avg64_8bpp_rvv_i64: 31.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-21 21:28:14 +03:00
Rémi Denis-Courmont
7591eb4055 Revert "lavc/sbrdsp: R-V V neg_odd_64"
While this function can easily be written with vectors, it just fails to
get any performance improvement.

For reference, this is a simpler loop-free implementation that does get
better performance than the current one depending on hardware, but still
more or less the same metrics as the C code:

 func ff_sbr_neg_odd_64_rvv, zve64x
         li      a1, 32
         addi    a0, a0, 7
         li      t0, 8
         vsetvli zero, a1, e8, m2, ta, ma
         li      t1, 0x80
         vlse8.v v8, (a0), t0
         vxor.vx v8, v8, t1
         vsse8.v v8, (a0), t0
         ret
 endfunc

This reverts commit d06fd18f8f.
2024-05-21 21:26:39 +03:00
Rémi Denis-Courmont
d452db8410 lavc/vc1dsp: R-V V vc1_unescape_buffer
Notes:
- The loop is biased toward no unescaped bytes as that should be most common.
- The input byte array is slid rather than the (8 times smaller) bit-mask,
  as RISC-V V does not provide a bit-mask (or bit-wise) slide instruction.
- There are two comparisons with 0 per iteration, for the same reason.
- In case of match, bytes are copied until the first match, and the loop is
  restarted after the escape byte. Vector compression (vcompress.vm) could
  discard all escape bytes but that is slower if escape bytes are rare.

Further optimisations should be possible, e.g.:
- processing 2 bytes fewer per iteration to get rid of a 2 slides,
- taking a short cut if the input vector contains less than 2 zeroes.
But this is a good starting point:

T-Head C908:
vc1dsp.vc1_unescape_buffer_c:      12749.5
vc1dsp.vc1_unescape_buffer_rvv_i32: 6009.0

SpacemiT X60:
vc1dsp.vc1_unescape_buffer_c:      11038.0
vc1dsp.vc1_unescape_buffer_rvv_i32: 2061.0
2024-05-21 21:16:30 +03:00
Martin Storsjö
6093367147 checkasm: h264dsp: Avoid out of buffer writes when benchmarking
The loop filters can write before the pointer given to them;
the actual test invocations correctly used an offset, while
the benchmark calls were lacking an offset. Therefore, when
running with benchmarking, these tests could have spurious
failures.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-05-21 19:20:06 +03:00
Lynne
d43e123837 checkasm: print bench runs when benchmarking
Helps make sense of the possible noise in the results.
2024-05-21 17:48:48 +02:00
J. Dekker
b1adf6d1d0 checkasm: add runs argument to adjust during bench
Some timers on certain device and test combinations can produce noisy
results, affecting the reliability of performance measurements. One
notable example of this is the Canaan K230 RISC-V development board.

An option to adjust the number of samples by an exponent (--runs) has
been added, allowing developers to increase the sample count for more
reliable results.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-21 16:47:45 +02:00
Martin Storsjö
a9dc7dd7fd checkasm: vvc_alf: Limit benchmarking to a reasonable subset of functions
Don't benchmark every single combination of widths and heights;
only benchmark cases which are squares (like in vvc_mc.c).

Contrary to vvc_mc, which increases sizes by doubling dimensions,
vvc_alf tests all sizes in increments of 4. Limit benchmarking to
the cases which are powers of two.

This reduces the number of benchmarked cases from 3072 down to 18.
2024-05-21 20:20:50 +08:00
Nuo Mi
b8eb8b4f19 Changelog: add DVB compatible information for VVC decoder
see https://dvb.org/specifications/verification-validation/vvc-test-content/
2024-05-21 20:20:25 +08:00
Nuo Mi
1b33c9a50a avcodec/vvcdec: support Reference Picture Resampling
passed clips:
    RPR_A_Alibaba_4.bit
    RPR_B_Alibaba_3.bit
    RPR_C_Alibaba_3.bit
    RPR_D_Qualcomm_1.bit
    VVC_HDR_UHDTV1_OpenGOP_Max3840x2160_50fps_HLG10_res_change_with_RPR.ts
2024-05-21 20:20:25 +08:00
Nuo Mi
cae0b01282 avcodec/vvcdec: increase edge_emu_buffer for RPR 2024-05-21 20:20:25 +08:00
Nuo Mi
7904ec2d34 avcodec/vvcdec: refact, remove hf_idx and vf_idx from mc_xxx's param list 2024-05-21 20:20:25 +08:00
Nuo Mi
77d971c348 avcodec/vvcdec: refact out luma_prof from luma_prof_bi 2024-05-21 20:20:25 +08:00
Nuo Mi
ac4575594f avcodec/vvcdec: fix dmvr, bdof, cb_prof for RPR 2024-05-21 20:20:25 +08:00
Nuo Mi
77acd0a0dd avcodec/vvcdec: inter, wait reference with a different resolution
For RPR, the current frame may reference a frame with a different resolution.
Therefore, we need to consider frame scaling when we wait for reference pixels.
2024-05-21 20:20:25 +08:00
Nuo Mi
deda59a996 avcodec/vvcdec: add RPR dsp 2024-05-21 20:20:25 +08:00
Nuo Mi
e70225e0a8 avcodec/vvcdec: emulated_edge, use reference frame's sps and pps
a preparation for Reference Picture Resampling
2024-05-21 20:20:25 +08:00
Nuo Mi
aa8d5c6e7e avcodec/vvcdec: add vvc inter filters for RPR 2024-05-21 20:20:25 +08:00
Nuo Mi
08ad51ece6 avcodec/vvcdec: refact, pred_get_refs return VVCRefPic instead of VVCFrame 2024-05-21 20:20:25 +08:00
Nuo Mi
66c6bee061 avcodec/vvcdec: refact out VVCRefPic from RefPicList 2024-05-21 20:20:25 +08:00
Nuo Mi
44bbafb69f avcodec/vvcdec: refact, unify pred_regular_{luma, chroma} to pred_regular 2024-05-21 20:20:25 +08:00
Nuo Mi
875fa9692c avcodec/vvcdec: misc, remove unused EMULATED_EDGE_{LUMA, CHROMA}, EMULATED_EDGE_DMVR_{LUAM, CHROMA} 2024-05-21 20:20:25 +08:00
Nuo Mi
84a93d91d1 avcodec/vvcdec: refact, unify {luma, chroma}_mc_bi to mc_bi 2024-05-21 20:20:25 +08:00
Nuo Mi
6769fe1614 avcodec/vvcdec: refact, unify {luma, chroma}_mc_uni to mc_uni 2024-05-21 20:20:25 +08:00
Nuo Mi
bc099afc8d avcodec/vvcdec: refact, unify {luma, chroma}_mc to mc 2024-05-21 20:20:25 +08:00
Nuo Mi
1289da9244 avcodec/vvcdec: misc, inter, use is_chroma instead of is_luma 2024-05-21 20:20:25 +08:00
Zhao Zhili
553c572204 avfilter/vf_dnn_detect: Fix null pointer dereference
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-21 18:17:07 +08:00
David Rosca
f7a1453f27 lavc/vaapi_decode: Reject decoding of frames with no slices
Matches other hwaccels.
2024-05-21 16:57:46 +08:00
oltolm
45d31614bc avutil/hwcontext_qsv: fix GCC 14.1 warnings
Tested-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: oltolm <oleg.tolmatcev@gmail.com>
2024-05-21 16:57:46 +08:00
Andreas Rheinhardt
9a74581234 avfilter/vf_signalstats: Reindent after the previous commit
Also use loop scope for iterators while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-21 08:56:52 +02:00
Andreas Rheinhardt
48c0cce83d avfilter/vf_signalstats: Deduplicate <= 8 and > 8 bit code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-21 08:56:52 +02:00
Andreas Rheinhardt
f2dac83628 avfilter/vf_signalstats: Use av_dict_set_int() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-21 08:56:52 +02:00
Marton Balint
49e018d6fe avformat/mp3dec: change bogus error message if read_header encounters EOF
Because of ffio_ensure_seekback() a seek error normally should only happen if
the end of file is reached during checking for the junk run-in. Also use proper
error code.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-21 08:28:09 +02:00
Marton Balint
b75e604fe5 avformat/mp3dec: simplify inner frame size check in mp3_read_header
We are protecting the checked buffer with ffio_ensure_seekback(), so if the
inner check fails with a seek error, that likely means the end of file was
reached when checking for the next frame. This could also be the result of a
wrongly guessed (larger than normal) frame size, so let's continue the loop
instead of breaking out early. It will end sooner or later anyway.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-21 08:28:09 +02:00
Marton Balint
b005317219 avformat/mp3dec: only call ffio_ensure_seekback once
Otherwise the subsequent ffio_ensure_seekback calls destroy the buffer of the
earlier. The worst case ~66kB seekback is so small it is easier to request it
entirely.

Fixes ticket #10837, a regression since
0d17f5228f.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-21 08:28:09 +02:00
LuMingYin
3f691c0c6a libavfilter/vf_curves: fix a memory leak on error path
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-20 23:57:45 +08:00
LuMingYin
14f9e47314 libavformat/rtsp: fix a memory leak on error path
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-20 23:57:05 +08:00
LuMingYin
9481b7d932 libavformat/hlsenc: fix a memory leak on error path
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-05-20 23:56:58 +08:00
James Almer
b113050d96 avcodec/cbs_h266: read vps_ptl_max_tid before using it
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-20 10:29:30 -03:00
Andreas Rheinhardt
0d7430d3ab avfilter/vf_v360: Add assert to suppress Coverity false positives
Should fix many Coverity false positives, namely #1457947-#1457994
as well as #1461195-#146210.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:16:39 +02:00
Andreas Rheinhardt
2c94b1bbf1 avcodec/tiff: Fix leak on error
Fixes Coverity issue #1516957.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:15:48 +02:00
Andreas Rheinhardt
62929f40ee fftools/ffmpeg_filter: Fix leak on error
Do this by attaching the FilterGraph directly to more permanent
storage from which it will be automatically freed.
Fixes Coverity issue #1596533.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:15:23 +02:00
Andreas Rheinhardt
b50c5d0290 avformat/flacdec: Reorder allocations to avoid leak on error
Fixes Coverity issue #1591795.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:15:18 +02:00
Andreas Rheinhardt
59b1838e09 avcodec/ac3enc: Move transient PutBitContext to stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:11:25 +02:00
Andreas Rheinhardt
e863cbceae avcodec/ac3enc_template: Avoid always-true check
This might also help Coverity with issue #1596532.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 14:11:03 +02:00
Andreas Rheinhardt
f3d206d25f fftools, avfilter, avformat: Simplify check for "is dictionary empty?"
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:52:41 +02:00
Andreas Rheinhardt
482afe8f3f avcodec/lib*, avformat/tee: Simplify iterating over AVDictionary
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:51:55 +02:00
Andreas Rheinhardt
ce22e7ab28 avformat/tee: Use smaller scope for variables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:49:58 +02:00
Andreas Rheinhardt
26f3e79114 avformat/tee: Constify AVDictionaryEntry* pointee where possible
This is in preparation for using av_dict_iterate().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 13:33:38 +02:00
Andreas Rheinhardt
583c3d45fa avformat/tls_openssl: #if ff_openssl_init/deinit() away if possible
These functions do nothing useful when used with a non-ancient
version of openssl (namely 1.1.0 or above).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:37:42 +02:00
Andreas Rheinhardt
8b48b0adab avformat/utils: Use static mutexes instead of ff_lock_avformat()
Its existence is a remnant of (libavcodec's) lock-manager API
which has been removed in a04c2c707d.
There is no need to use the same lock for avisynth, chromaprint
or tls, so switch to ordinary static mutexes instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:28:28 +02:00
Andreas Rheinhardt
a2874c5721 avcodec/aac_ac3_parser: Use ff_adts_header_parse_buf()
instead of avpriv_adts_header_parse(). Using the former avoids
an indirection.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:06:50 +02:00
Andreas Rheinhardt
12ded9cd85 avcodec/adts_header: Add ff_adts_header_parse_buf()
Most users of ff_adts_header_parse() don't already have
an opened GetBitContext for the header, so add a convenience
function for them.
Also use a forward declaration of GetBitContext in adts_header.h
as this avoids (implicit) inclusion of get_bits.h in some of
the users that now no longer use a GetBitContext of their own.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 12:06:31 +02:00
Andreas Rheinhardt
ae937c4902 avcodec/aac_ac3_parser: Untangle AAC and AC3 parsing error codes
Also remove the (unused) AAC_AC3_PARSE_ERROR_CHANNEL_CFG while at it;
furthermore, fix the documentation of ff_ac3_parse_header()
and (ff|avpriv)_adts_header_parse().

Reviewed-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 11:58:07 +02:00
Andreas Rheinhardt
6c812a80dd avcodec/adts_parser: Don't presume buffer to be padded
The documentation of av_adts_header_parse() does not require
the buffer to be padded at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 11:48:03 +02:00
Haihao Xiang
127ded5078 lavfi/qsvvpp: require a dynamic frame pool for output if possible
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
5646285f76 lavfi/qsvvpp: use the right mfxFrameInfo when dynamic frame pool is used
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
a00cfc6c24 lavc/qsvdec: require a dynamic frame pool if possible
This allows a downstream element stores more frames from qsv decoders
and fixes error in get_buffer().

$ ffmpeg -hwaccel qsv -hwaccel_output_format qsv -i input.mp4 -vf
reverse -f null -

[vist#0:0/h264 @ 0x562248f12c50] Decoding error: Cannot allocate memory
[h264_qsv @ 0x562248f66b10] get_buffer() failed

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
75015f9b0e lavc/qsvenc: use the right info for encoding
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
cda721e01d lavc/qsv: fix the mfx allocator to support dynamic frame pool
When the external allocator is used for dynamic frame allocation, only
video memory is supported, the SDK doesn't lock/unlock the memory block
via Lock()/Unlock() calls.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
d3cc5ead42 lavu/hwcontext_qsv: add support for dynamic frame pool in qsv_map_to
Make it work with the source which has a dynamic frame pool.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
932f78c4e5 lavu/hwcontext_qsv: add support for dynamic frame pool in qsv_frames_derive_to
Make it work with the source which has a dynamic frame pool.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
96db4a62e0 lavu/hwcontext_qsv: create dynamic frame pool if required
When AVHWFramesContext.initial_pool_size is 0, a dynamic frame pool is
required. We may support this under certain conditions, e.g. oneVPL 2.9+
support dynamic frame allocation, we needn't provide a fixed frame pool
in the mfxFrameAllocator.Alloc callback.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:49 +08:00
Haihao Xiang
4c0bb7d4a9 lavu/hwcontext_qsv: update AVQSVFramesContext to support dynamic frame pool
Add AVQSVFramesContext.info and update the description.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:30:48 +08:00
Haihao Xiang
3178c99fa9 lavu/version: fix minor version
The latest version should be 59.18.100 since commit 01c5f4ad

$ git diff 01c5f4ad~1..HEAD doc/APIchanges
...
+2024-05-10 - xxxxxxxxx - lavu 59.18.100 - cpu.h
+  Add AV_CPU_FLAG_RV_ZVBB.
+

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-20 09:24:44 +08:00
Andreas Rheinhardt
d7fdd502d6 tests/ref/fate/source: Add exceptions for riscv startcode files
Fixes fate-source.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-20 00:08:51 +02:00
Michael Niedermayer
e35fe3d8b9 avcodec/mscc & mwsc: Check loop counts before use
This could cause timeouts

Fixes: CID1439568 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:39 +02:00
Michael Niedermayer
b6b2b01025 avcodec/mpegvideo_enc: Fix potential overflow in RD
Fixes: CID1500285 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:38 +02:00
Michael Niedermayer
8fc649b931 avcodec/mpeg4videodec: assert impossible wrap points
Helps: CID1473517 Uninitialized scalar variable
Helps: CID1473497 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:37 +02:00
Michael Niedermayer
4c725df059 avcodec/mpeg12dec: Use 64bit in bit computation
I dont think this can actually overflow but 64bit seems reasonable to use

Fixes: CID1521983 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:14:37 +02:00
Michael Niedermayer
6a9302739f avcodec/vqcdec: Check init_get_bits8() for failure
Fixes: CID1516090 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:55 +02:00
Michael Niedermayer
4a8506c794 avcodec/vvc/dec: Check init_get_bits8() for failure
Fixes: CID1560042 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:55 +02:00
Michael Niedermayer
dd5379db5d avcodec/vble: Check av_image_get_buffer_size() for failure
Fixes: CID1461482 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Reviewed-.by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:54 +02:00
Michael Niedermayer
1b991e77b9 avcodec/vp3: Replace check by assert
Fixes: CID1452425 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:54 +02:00
Michael Niedermayer
63feed1519 avcodec/vp8: Forward return of ff_vpx_init_range_decoder()
Fixes: CID1507483 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:54 +02:00
Andrea Mastroberti
90ce54804a avfilter/smartblur: Added alpha layer support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-19 22:12:53 +02:00
Rémi Denis-Courmont
463c573e6b lavc/huffyuvdsp: optimise RVV vtype for add_hfyu_left_pred_bgr32
T-Head C908:
add_hfyu_left_pred_bgr32_c:       237.5
add_hfyu_left_pred_bgr32_rvv_i32: 173.5 (before)
add_hfyu_left_pred_bgr32_rvv_i32: 110.0 (after)
2024-05-19 18:37:33 +03:00
Rémi Denis-Courmont
233066e85a lavc/flacdsp: optimise RVV vector type for lpc32
This is pretty much the same as for lpc16, though it only improves half
as large prediction orders. With 128-bit vectors, this gives:

   C      V old  V new
1   69.2  181.5   95.5
2  107.7  180.7   95.2
3  145.5  180.0  103.5
4  183.0  179.2  102.7
5  220.7  178.5  128.0
6  257.7  194.0  127.5
7  294.5  193.7  126.7
8  331.0  193.0  126.5

Larger prediction orders see no significant changes at that size.
2024-05-19 18:37:33 +03:00
Rémi Denis-Courmont
6ab4b92e82 lavc/flacdsp: optimise RVV vector type for lpc16
This calculates the optimal vector type value at run-time based on the
hardware vector length and the FLAC LPC prediction order. In this
particular case, the additional computation is easily amortised over
the loop iterations:

T-Head C908:
    C     V before  V after
 1   48.0    214.7     95.2
 2   64.7    214.2     94.7
 3   79.7    213.5     94.5
 4   96.2    196.5     94.2 #
 5  111.0    195.7    118.5
 6  127.0    211.2    102.0
 7  143.7    194.2    101.5
 8  175.7    193.2    101.2 #
 9  176.2    224.2    126.0
10  191.5    192.0    125.5
11  224.5    191.2    124.7
12  223.0    190.2    124.2
13  239.2    189.5    123.7
14  253.7    188.7    139.5
15  286.2    188.0    122.7
16  284.0    187.0    122.5 #
17  300.2    186.5    186.5
18  314.0    185.5    185.7
19  329.7    184.7    185.0
20  343.0    184.2    184.2
21  358.7    199.2    183.7
22  371.7    182.7    182.7
23  387.5    181.7    182.0
24  400.7    181.0    181.2
25  431.5    180.2    196.5
26  443.7    195.5    196.0
27  459.0    178.7    196.2
28  470.7    177.7    194.2
29  470.0    177.0    193.5
30  481.2    176.2    176.5
31  496.2    175.5    175.7
32  507.2    174.7    191.0 #

 # Power of two boundary.

With 128-bit vectors, improvements are expected for the first two
test cases only. For the other two, there is overhead but below noise.
Improvements should be better observable with prediction order of 8
and less, or on hardware with larger vector sizes.
2024-05-19 18:37:33 +03:00
Rémi Denis-Courmont
ee1526c05f lavu/riscv: add assembler macros for adjusting vector LMUL
vtype_vli computes the VTYPE value with the optimal LMUL for a given
element width, tail and mask policies and a run-time vector length.

vtype_ivli does the same, but with the compile-time constant vector
length.

vwtypei and vntypei can be used to widen or narrow a VTYPE value for
use in mixed-width vector-optimised functions.
2024-05-19 18:37:33 +03:00
Andreas Rheinhardt
a7e506fcd8 avcodec/vc1_parser: Check init_get_bits8()
Addresses Coverity issue #1441935.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:49:33 +02:00
Andreas Rheinhardt
95937d6316 avcodec/codec_desc: Mark AVRN, TGQ, PhotoCD, VBN as intra-only
Also remove the then redundant assignments of AV_FRAME_FLAG_KEY,
AV_PICTURE_TYPE_I.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:55 +02:00
Andreas Rheinhardt
2a00d68c09 avcodec/yop: Add missing AV_CODEC_CAP_DR1
This decoder does not do anything fancy any more since
c6303f8d70 (before that,
it overwrote the frame's linesize) so that it supports
direct rendering. This effectively reverts
d3de3a16d1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:43 +02:00
Andreas Rheinhardt
df3cdf4c75 avcodec: Remove redundant setting of AV_FRAME_FLAG_KEY, AV_PICTURE_TYPE_I
This is done generically now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:40:07 +02:00
Andreas Rheinhardt
eee88ba0dc avcodec/decode: Set KEY flag+pict_type generically for intra-only codecs
This commit is the analog of 3f11eac757
for decoding: It sets the AV_FRAME_FLAG_KEY and (for video decoders)
also pict_type to AV_PICTURE_TYPE_I. It furthermore stops setting
audio frames as always being key frames -- it is wrong for e.g.
TrueHD/MLP. The latter also affects TAK and DFPWM.

The change already improves output for several decoders where
it has been forgotten to set e.g. pict_type like speedhq, wnv1
or tiff. The latter is the reason for the change to the exif-image-tiff
FATE test reference file.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:45 +02:00
Andreas Rheinhardt
41fc62f2e8 avcodec/codec_desc, jvdec: JV is not intra-only
It reuses the previous frame and does not code unchanged blocks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:35 +02:00
Andreas Rheinhardt
876a25027c avcodec/mlpdec: Set AV_FRAME_FLAG_KEY explicitly
It is currently always set for all audio frames, but this is
wrong (namely for MLP/TrueHD) and will be changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-19 11:39:18 +02:00
Rémi Denis-Courmont
259c639137 lavc/vp9_intra: fix another .irp use with LLVM as 2024-05-19 10:22:46 +03:00
Rémi Denis-Courmont
8cea66a73c lavc/vp9_intra: fix .irp use with LLVM as 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont
cbe51ebf93 lavc/vp8dsp: fix .irp use with LLVM as 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont
fa47299516 lavc/startcode: add R-V V startcode_find_candidate 2024-05-19 10:03:49 +03:00
Rémi Denis-Courmont
4ad5b9c8db lavc/startcode: add R-V Zbb startcode_find_candidate
The main loop processes 8 bytes in 5 instructions.
For comparison, the optimal plain strnlen() requires 4 instructions per
byte (6.4x worse): LBU; ADDI; BEQZ; BNE. The current libavcodec C code
involves 5 instructions per byte (8x worse). Actual benchmarks may be
slightly less favourable due to latency from ORC.B to BNE.
2024-05-19 10:03:49 +03:00
Marcus B Spencer
8b8b555de0 avformat/aacdec: strictly conform to K&R style
In the K&R style, a single-statement block does not have braces.
Edit the code to conform to this rule.

It is FFmpeg's code formatting convention to use K&R style.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
2024-05-19 01:26:40 +02:00
James Almer
7e59f02c14 fate/lavf-container: add a test for VVC in mp4 muxing
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:30:32 -03:00
James Almer
3765305928 configure: split ISOBMFF writer helpers into a separate component
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:35 -03:00
James Almer
9ab8dddf1f avformat/vvc: use align_get_bits() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:35 -03:00
James Almer
f00b23453c avformat/vvc: reduce the scope of some variables
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 13:21:24 -03:00
James Almer
a48203d51a avformat/vvc: fix parsing some early VPS bitstream values
vps_default_ptl_dpb_hrd_max_tid_flag needs to always be set, and
vps_direct_ref_layer_flag needs to be read even when
vps_max_tid_ref_present_flag is false.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:35:27 -03:00
James Almer
f121d52b35 avformat/vvc: remove duplicate struct
VVCCProfileTierLevel is the same as VVCPTLRecord since the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
James Almer
cba15ca0ec avformat/vvc: generalize calculating num_bytes_constraint_info
Will be useful for when the aditional bits are supported, as well as for the
next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
James Almer
415dfa89e2 avformat/vvc: fix writing general_constraint_info bytes
The existing implementation was completely broken.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-18 11:33:46 -03:00
Zhao Zhili
8c21f1e3b7 avfilter/dnn: Refactor DNN parameter configuration system
This patch trying to resolve mulitiple issues related to parameter
configuration:

Firstly, each DNN filters duplicate DNN_COMMON_OPTIONS, which should
be the common options of backend.

Secondly, backend options are hidden behind the scene. It's a
AV_OPT_TYPE_STRING backend_configs for user, and parsed by each
backend. We don't know each backend support what kind of options
from the help message.

Third, DNN backends duplicate DNN_BACKEND_COMMON_OPTIONS.

Last but not the least, pass backend options via AV_OPT_TYPE_STRING
makes it hard to pass AV_OPT_TYPE_BINARY to backend, if not impossible.

This patch puts backend common options and each backend options inside
DnnContext to reduce code duplication, make options user friendly, and
easy to extend for future usecase.

For example,

./ffmpeg -h filter=dnn_processing

dnn_processing AVOptions:
   dnn_backend       <int>        ..FV....... DNN backend (from INT_MIN to INT_MAX) (default tensorflow)
     tensorflow      1            ..FV....... tensorflow backend flag
     openvino        2            ..FV....... openvino backend flag
     torch           3            ..FV....... torch backend flag

dnn_base AVOptions:
   model             <string>     ..F........ path to model file
   input             <string>     ..F........ input name of the model
   output            <string>     ..F........ output name of the model
   backend_configs   <string>     ..F.......P backend configs (deprecated)
   options           <string>     ..F.......P backend configs (deprecated)
   nireq             <int>        ..F........ number of request (from 0 to INT_MAX) (default 0)
   async             <boolean>    ..F........ use DNN async inference (default true)
   device            <string>     ..F........ device to run model

dnn_tensorflow AVOptions:
   sess_config       <string>     ..F........ config for SessionOptions

dnn_openvino AVOptions:
   batch_size        <int>        ..F........ batch size per request (from 1 to 1000) (default 1)
   input_resizable   <boolean>    ..F........ can input be resizable or not (default false)
   layout            <int>        ..F........ input layout of model (from 0 to 2) (default none)
     none            0            ..F........ none
     nchw            1            ..F........ nchw
     nhwc            2            ..F........ nhwc
   scale             <float>      ..F........ Add scale preprocess operation. Divide each element of input by specified value. (from INT_MIN to INT_MAX) (default 0)
   mean              <float>      ..F........ Add mean preprocess operation. Subtract specified value from each element of input. (from INT_MIN to INT_MAX) (default 0)

dnn_th AVOptions:
   optimize          <int>        ..F........ turn on graph executor optimization (from 0 to 1) (default 0)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-05-18 19:44:50 +08:00
Brad Smith
115c96b9bd avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD
Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-05-18 07:38:40 -04:00
Aaron Thompson
be3404bbac lavc/libvpxenc: Fix parsing of ts_layering_mode parameter
The value was being parsed as base 4, so the value "4" was invalid and
would result in ts_layering_mode being set to 0.

Signed-off-by: Aaron Thompson <dev@aaront.org>
Signed-off-by: James Zern <jzern@google.com>
2024-05-17 15:40:31 -07:00
James Almer
727a603158 checkasm/h264dsp: use int64_t scale values
Fixes "signed integer overflow: [varies] * 104858 cannot be represented in type 'int'" errors
under ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-17 17:04:08 -03:00
sunyuechi
d521b7280c lavc/vp9dsp: R-V V ipred tm
C908:
vp9_tm_4x4_8bpp_c: 116.5
vp9_tm_4x4_8bpp_rvv_i32: 43.5
vp9_tm_8x8_8bpp_c: 416.2
vp9_tm_8x8_8bpp_rvv_i32: 86.0
vp9_tm_16x16_8bpp_c: 1665.5
vp9_tm_16x16_8bpp_rvv_i32: 187.2
vp9_tm_32x32_8bpp_c: 6974.2
vp9_tm_32x32_8bpp_rvv_i32: 625.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-17 18:12:11 +03:00
Rémi Denis-Courmont
88d973a5d6 lavc/flacdsp: R-V V flac_wasted33
T-Head C908:
flac_wasted_33_c:       786.2
flac_wasted_33_rvv_i64: 486.5
2024-05-17 18:08:04 +03:00
Andreas Rheinhardt
784672b833 tests/checkasm/sw_gbrp: Use correct function types for calls
E.g. f2de911818 forgot to
add the unused void* here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:36:03 +02:00
Andreas Rheinhardt
9126705e6e tests/checkasm/vf_blend: Update function type
Forgotten in 5b8faaad6c,
a69a0b689c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:35:33 +02:00
Andreas Rheinhardt
caec57eb3a tests/checkasm/vf_bwdif: Use correct function pointer type
Forgotten in fa06f48371.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:37 +02:00
Andreas Rheinhardt
4c57cbda67 tests/checkasm/vf_colorspace: Use correct function pointer type
Forgotten in 9b26a8077f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:23 +02:00
Andreas Rheinhardt
e3de22e307 tests/checkasm/vvc_mc: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:31:09 +02:00
Andreas Rheinhardt
6c0994864e tests/checkasm/vp8dsp: Use correct function pointer type
Forgotten in a54e53a1c4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:30:17 +02:00
Andreas Rheinhardt
dcbdcc3bf5 tests/checkasm/motion: Use correct function pointer type
Forgotten in abb85429f3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:30:06 +02:00
Andreas Rheinhardt
99135a2f8b tests/checkasm/llviddsp: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:29:51 +02:00
Andreas Rheinhardt
631636e582 tests/checkasm/huffyuvdsp: Use correct function pointer type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:29:34 +02:00
Andreas Rheinhardt
895dd370a2 tests/checkasm/hevc_*: Fix funtion pointer types
Forgotten in b3bbbb14d0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:28:20 +02:00
Andreas Rheinhardt
dff0a1557e tests/checkasm/llauddsp: Avoid UB integer overflow
The only multiplicators used in scalarproduct_and_madd_*
are -1, 0 and +1. Yet it is of type int and the checkasm
test uses the complete range of int for it, leading to overflows
that don't happen for actual users.

Fix this by using a more reasonable range for mul: Given
that it is used in v1[i] += v3[i] * mul with v1 being
a 16bit integer, it makes no sense to use values for mul
that don't fit into 16bit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-17 13:16:58 +02:00
sunyuechi
d4083ecb7c lavc/vc1dsp: R-V V mspel_pixels
C908 X60
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_c            :  14.7 13.2
vc1dsp.avg_vc1_mspel_pixels_tab[0][0]_rvv_i32      :   2.5  2.2
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_c            :   3.7  3.5
vc1dsp.avg_vc1_mspel_pixels_tab[1][0]_rvv_i64      :   1.0  1.2
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_c            :   9.0  8.0
vc1dsp.put_vc1_mspel_pixels_tab[0][0]_rvi          :   1.0  1.0
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_c            :   2.5  2.2
vc1dsp.put_vc1_mspel_pixels_tab[1][0]_rvi          :   0.5  0.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-16 17:08:18 +03:00
Rémi Denis-Courmont
7b47099bc0 lavc/flacdsp: R-V V flac_wasted32
T-Head C908:
flac_wasted_32_c:       949.0
flac_wasted_32_rvv_i32: 278.7
2024-05-15 20:04:08 +03:00
Rémi Denis-Courmont
83e5fdd3f4 lavu/riscv: fix parsing the unaligned access capability
Pointed-out-by: Stefan O'Rear <sorear@fastmail.com>
2024-05-15 20:04:08 +03:00
sunyuechi
0cc8661499 lavc/vp9dsp: R-V V ipred hor
C908:
vp9_hor_8x8_8bpp_c: 74.7
vp9_hor_8x8_8bpp_rvv_i32: 35.7
vp9_hor_16x16_8bpp_c: 175.5
vp9_hor_16x16_8bpp_rvv_i32: 80.2
vp9_hor_32x32_8bpp_c: 510.2
vp9_hor_32x32_8bpp_rvv_i32: 264.0

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:56:06 +03:00
sunyuechi
b82d9f55d1 lavc/vp9dsp: R-V mc copy
C908:
vp9_put4_8bpp_c: 0.7
vp9_put4_8bpp_rvi: 0.5
vp9_put8_8bpp_c: 2.5
vp9_put8_8bpp_rvi: 0.5
vp9_put16_8bpp_c: 16.7
vp9_put16_8bpp_rvi: 1.5
vp9_put32_8bpp_c: 37.2
vp9_put32_8bpp_rvi: 5.7
vp9_put64_8bpp_c: 107.5
vp9_put64_8bpp_rvi: 21.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:52:28 +03:00
sunyuechi
aa9dbd91cf lavc/vp9dsp: R-V ipred vert
C908:
vp9_vert_8x8_8bpp_c: 22.0
vp9_vert_8x8_8bpp_rvi: 15.7
vp9_vert_16x16_8bpp_c: 71.2
vp9_vert_16x16_8bpp_rvi: 39.0
vp9_vert_32x32_8bpp_c: 300.2
vp9_vert_32x32_8bpp_rvi: 135.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-15 19:52:25 +03:00
Rémi Denis-Courmont
a3e45063c0 lavc/flacdsp: fix CPU requirement for 32-bit LPC 2024-05-15 19:45:07 +03:00
James Almer
8670615743 checkasm/h264dsp: add missing pixel_mask values
Fixes "runtime error: index 4 out of bounds for type 'uint32_t [3]'" errors
after commit 4ced36744e.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 23:17:30 -03:00
James Almer
e9741f1a6b fate/checkasm: test vvc_alf
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 22:58:21 -03:00
Michael Niedermayer
4ed4f9a6c0 avcodec/jpeg2000dec: remove ST=3 case
Fixes: CID1460979 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-15 03:53:25 +02:00
Michael Niedermayer
8789c550fa avcodec/qsvdec: Check av_image_get_buffer_size() for failure
Fixes: CID1477406 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-15 03:53:24 +02:00
Marton Balint
b0093ab8a3 avfilter/vf_geq: fix interpolation with 1 pixel width/height
Fixes ticket #9740.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Marton Balint
64330e365b avfilter/blend: use a per-thread AVExpr
Otherwise expression state is accessed and changed from multiple threads.

Fixes ticket #10987.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Marton Balint
a69a0b689c avfilter/blend: put slice parameters to a single struct
This should make future extensibility easier.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Marton Balint
77fc047bd9 avfilter/vsrc_testsrc: do not round down width and height for color src
ff_draw_rectangle handles subsampling since 2013.

Fixes ticket #10989.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-14 21:07:37 +02:00
Rémi Denis-Courmont
20fbc07af1 lavu/riscv: remove bogus B extension
The B Bit manipulation extension was not defined to this day, and
probably never will. Instead it was broken down into Zba, Zbb, Zbc and
Zbs with no particular blessed set to make up B.

This removes the bogus field test. Linux never set this bit, nor
(AFAICT) did FreeBSD or any other OS. We can always add it back in the
unlikely event that it gets taken into use.
2024-05-14 19:50:00 +03:00
Rémi Denis-Courmont
9d3f561721 lavc/vp8dsp: restrict RVI optimisations
They are actually awfully slow if the CPU does not support misaligned
accesses natively, so only use them if misaligned accesses are fast.
2024-05-14 19:50:00 +03:00
Rémi Denis-Courmont
b410439263 lavu/riscv: CPU flag for fast misaligned accesses 2024-05-14 19:50:00 +03:00
Rémi Denis-Courmont
61ec7450ff lavu/riscv: fallback to raw hwprobe() system call
Not all C run-times support this, and even then, it will be a while
before distributions provide recent enough versions thereof.

Since this is a trivial system call wrapper, we might just as well call
the corresponding kernel system call directly where the C run-time lacks
support but the kernel headers are new enough (as is the case on Debian
Unstable at the time of writing). In doing so, we need to add a few more
guards as the first suitable kernel (headers) release did not expose the
V, Zba and Zbb extensions.
2024-05-14 19:50:00 +03:00
J. Dekker
4ced36744e checkasm/h264dsp: support checking more idct depths
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-14 17:46:55 +02:00
J. Dekker
ca583b22e4 avfilter/riscv: build afir only if required
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-14 17:46:19 +02:00
James Almer
14aff7e45e x86/vvc/vvcdsp_init: coalesce function initializers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-14 11:17:54 -03:00
Wu Jianhua
3fa98f274a tests/checkasm/vvc_alf: add check_alf_classify
Perforamnce Test (fps):
clip                                      before  after delta
Tango2_3840x2160_60_10_420_27_LD.266      56      115   105.36%
RitualDance_1920x1080_60_10_420_32_LD.266 272     481   76.83%
RitualDance_1920x1080_60_10_420_37_RA.266 303     426   40.59%

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Wu Jianhua
abf69a39b5 avcodec/x86/vvc/vvc_alf: add alf classify avx2 optimizations
vvc_alf_classify_4x4_8_c: 480.5
vvc_alf_classify_4x4_8_avx2: 203.0
vvc_alf_classify_4x4_10_c: 439.0
vvc_alf_classify_4x4_10_avx2: 171.7
vvc_alf_classify_4x8_8_c: 690.0
vvc_alf_classify_4x8_8_avx2: 267.0
vvc_alf_classify_4x8_10_c: 706.5
vvc_alf_classify_4x8_10_avx2: 215.7
vvc_alf_classify_4x12_8_c: 935.7
vvc_alf_classify_4x12_8_avx2: 377.2
vvc_alf_classify_4x12_10_c: 937.2
vvc_alf_classify_4x12_10_avx2: 330.0
vvc_alf_classify_4x16_8_c: 1216.5
vvc_alf_classify_4x16_8_avx2: 439.7
vvc_alf_classify_4x16_10_c: 1197.5
vvc_alf_classify_4x16_10_avx2: 387.0
vvc_alf_classify_4x20_8_c: 1431.0
vvc_alf_classify_4x20_8_avx2: 556.7
vvc_alf_classify_4x20_10_c: 1401.2
vvc_alf_classify_4x20_10_avx2: 472.5
vvc_alf_classify_4x24_8_c: 1650.5
vvc_alf_classify_4x24_8_avx2: 615.5
vvc_alf_classify_4x24_10_c: 1737.7
vvc_alf_classify_4x24_10_avx2: 534.7
vvc_alf_classify_4x28_8_c: 1879.2
vvc_alf_classify_4x28_8_avx2: 743.5
vvc_alf_classify_4x28_10_c: 1942.5
vvc_alf_classify_4x28_10_avx2: 622.2
vvc_alf_classify_4x32_8_c: 2119.0
vvc_alf_classify_4x32_8_avx2: 890.5
vvc_alf_classify_4x32_10_c: 2139.7
vvc_alf_classify_4x32_10_avx2: 671.2
vvc_alf_classify_4x36_8_c: 2359.5
vvc_alf_classify_4x36_8_avx2: 915.7
vvc_alf_classify_4x36_10_c: 2388.5
vvc_alf_classify_4x36_10_avx2: 774.2
vvc_alf_classify_4x40_8_c: 2601.5
vvc_alf_classify_4x40_8_avx2: 973.7
vvc_alf_classify_4x40_10_c: 2623.2
vvc_alf_classify_4x40_10_avx2: 827.0
vvc_alf_classify_4x44_8_c: 2915.5
vvc_alf_classify_4x44_8_avx2: 1092.2
vvc_alf_classify_4x44_10_c: 2859.2
vvc_alf_classify_4x44_10_avx2: 924.0
vvc_alf_classify_4x48_8_c: 3260.7
vvc_alf_classify_4x48_8_avx2: 1157.5
vvc_alf_classify_4x48_10_c: 3225.2
vvc_alf_classify_4x48_10_avx2: 1326.7
vvc_alf_classify_4x52_8_c: 3332.2
vvc_alf_classify_4x52_8_avx2: 1267.2
vvc_alf_classify_4x52_10_c: 3385.7
vvc_alf_classify_4x52_10_avx2: 1075.0
vvc_alf_classify_4x56_8_c: 3591.2
vvc_alf_classify_4x56_8_avx2: 1330.5
vvc_alf_classify_4x56_10_c: 3636.0
vvc_alf_classify_4x56_10_avx2: 1198.2
vvc_alf_classify_4x60_8_c: 3944.2
vvc_alf_classify_4x60_8_avx2: 1453.2
vvc_alf_classify_4x60_10_c: 3858.5
vvc_alf_classify_4x60_10_avx2: 1276.0
vvc_alf_classify_4x64_8_c: 4062.0
vvc_alf_classify_4x64_8_avx2: 1509.2
vvc_alf_classify_4x64_10_c: 4095.5
vvc_alf_classify_4x64_10_avx2: 1321.5
vvc_alf_classify_4x68_8_c: 4323.2
vvc_alf_classify_4x68_8_avx2: 1624.0
vvc_alf_classify_4x68_10_c: 4357.7
vvc_alf_classify_4x68_10_avx2: 1422.0
vvc_alf_classify_4x72_8_c: 4555.0
vvc_alf_classify_4x72_8_avx2: 1693.0
vvc_alf_classify_4x72_10_c: 8527.7
vvc_alf_classify_4x72_10_avx2: 1465.2
vvc_alf_classify_4x76_8_c: 13716.2
vvc_alf_classify_4x76_8_avx2: 1858.7
vvc_alf_classify_4x76_10_c: 4832.0
vvc_alf_classify_4x76_10_avx2: 1575.5
vvc_alf_classify_4x80_8_c: 5030.0
vvc_alf_classify_4x80_8_avx2: 1869.0
vvc_alf_classify_4x80_10_c: 5097.7
vvc_alf_classify_4x80_10_avx2: 1620.0
vvc_alf_classify_4x84_8_c: 5273.5
vvc_alf_classify_4x84_8_avx2: 2048.2
vvc_alf_classify_4x84_10_c: 5301.7
vvc_alf_classify_4x84_10_avx2: 1787.7
vvc_alf_classify_4x88_8_c: 5522.2
vvc_alf_classify_4x88_8_avx2: 2118.2
vvc_alf_classify_4x88_10_c: 5568.5
vvc_alf_classify_4x88_10_avx2: 1822.7
vvc_alf_classify_4x92_8_c: 5768.7
vvc_alf_classify_4x92_8_avx2: 2230.0
vvc_alf_classify_4x92_10_c: 5964.2
vvc_alf_classify_4x92_10_avx2: 1929.7
vvc_alf_classify_4x96_8_c: 6020.5
vvc_alf_classify_4x96_8_avx2: 2291.0
vvc_alf_classify_4x96_10_c: 6758.5
vvc_alf_classify_4x96_10_avx2: 1979.7
vvc_alf_classify_4x100_8_c: 6269.2
vvc_alf_classify_4x100_8_avx2: 2470.2
vvc_alf_classify_4x100_10_c: 6335.5
vvc_alf_classify_4x100_10_avx2: 2081.0
vvc_alf_classify_4x104_8_c: 6509.7
vvc_alf_classify_4x104_8_avx2: 2468.5
vvc_alf_classify_4x104_10_c: 6553.0
vvc_alf_classify_4x104_10_avx2: 2134.5
vvc_alf_classify_4x108_8_c: 6760.7
vvc_alf_classify_4x108_8_avx2: 2661.2
vvc_alf_classify_4x108_10_c: 6983.2
vvc_alf_classify_4x108_10_avx2: 2229.2
vvc_alf_classify_4x112_8_c: 6998.2
vvc_alf_classify_4x112_8_avx2: 2650.7
vvc_alf_classify_4x112_10_c: 7041.5
vvc_alf_classify_4x112_10_avx2: 2285.7
vvc_alf_classify_4x116_8_c: 7236.5
vvc_alf_classify_4x116_8_avx2: 2833.2
vvc_alf_classify_4x116_10_c: 7470.0
vvc_alf_classify_4x116_10_avx2: 2381.2
vvc_alf_classify_4x120_8_c: 7477.7
vvc_alf_classify_4x120_8_avx2: 2827.2
vvc_alf_classify_4x120_10_c: 7524.0
vvc_alf_classify_4x120_10_avx2: 2418.5
vvc_alf_classify_4x124_8_c: 7708.7
vvc_alf_classify_4x124_8_avx2: 2947.2
vvc_alf_classify_4x124_10_c: 7818.7
vvc_alf_classify_4x124_10_avx2: 2525.7
vvc_alf_classify_4x128_8_c: 7938.7
vvc_alf_classify_4x128_8_avx2: 3009.7
vvc_alf_classify_4x128_10_c: 8016.2
vvc_alf_classify_4x128_10_avx2: 2580.7
vvc_alf_classify_8x4_8_c: 722.5
vvc_alf_classify_8x4_8_avx2: 211.7
vvc_alf_classify_8x4_10_c: 638.0
vvc_alf_classify_8x4_10_avx2: 174.7
vvc_alf_classify_8x8_8_c: 1029.5
vvc_alf_classify_8x8_8_avx2: 267.7
vvc_alf_classify_8x8_10_c: 1011.7
vvc_alf_classify_8x8_10_avx2: 221.5
vvc_alf_classify_8x12_8_c: 1435.5
vvc_alf_classify_8x12_8_avx2: 377.2
vvc_alf_classify_8x12_10_c: 1539.5
vvc_alf_classify_8x12_10_avx2: 336.2
vvc_alf_classify_8x16_8_c: 3085.0
vvc_alf_classify_8x16_8_avx2: 436.2
vvc_alf_classify_8x16_10_c: 1800.0
vvc_alf_classify_8x16_10_avx2: 8534.5
vvc_alf_classify_8x20_8_c: 2208.0
vvc_alf_classify_8x20_8_avx2: 560.5
vvc_alf_classify_8x20_10_c: 2137.5
vvc_alf_classify_8x20_10_avx2: 480.7
vvc_alf_classify_8x24_8_c: 2542.0
vvc_alf_classify_8x24_8_avx2: 620.7
vvc_alf_classify_8x24_10_c: 2485.5
vvc_alf_classify_8x24_10_avx2: 542.2
vvc_alf_classify_8x28_8_c: 2895.0
vvc_alf_classify_8x28_8_avx2: 751.7
vvc_alf_classify_8x28_10_c: 2887.5
vvc_alf_classify_8x28_10_avx2: 634.2
vvc_alf_classify_8x32_8_c: 3297.0
vvc_alf_classify_8x32_8_avx2: 903.5
vvc_alf_classify_8x32_10_c: 3277.0
vvc_alf_classify_8x32_10_avx2: 702.2
vvc_alf_classify_8x36_8_c: 3656.7
vvc_alf_classify_8x36_8_avx2: 919.5
vvc_alf_classify_8x36_10_c: 3621.7
vvc_alf_classify_8x36_10_avx2: 789.0
vvc_alf_classify_8x40_8_c: 4050.0
vvc_alf_classify_8x40_8_avx2: 985.0
vvc_alf_classify_8x40_10_c: 4025.5
vvc_alf_classify_8x40_10_avx2: 833.7
vvc_alf_classify_8x44_8_c: 4403.0
vvc_alf_classify_8x44_8_avx2: 1138.2
vvc_alf_classify_8x44_10_c: 4495.7
vvc_alf_classify_8x44_10_avx2: 931.2
vvc_alf_classify_8x48_8_c: 4960.7
vvc_alf_classify_8x48_8_avx2: 1199.7
vvc_alf_classify_8x48_10_c: 4784.2
vvc_alf_classify_8x48_10_avx2: 1431.0
vvc_alf_classify_8x52_8_c: 11901.7
vvc_alf_classify_8x52_8_avx2: 1286.5
vvc_alf_classify_8x52_10_c: 5744.5
vvc_alf_classify_8x52_10_avx2: 1087.7
vvc_alf_classify_8x56_8_c: 5563.2
vvc_alf_classify_8x56_8_avx2: 1356.5
vvc_alf_classify_8x56_10_c: 5486.5
vvc_alf_classify_8x56_10_avx2: 1216.5
vvc_alf_classify_8x60_8_c: 6120.2
vvc_alf_classify_8x60_8_avx2: 1477.0
vvc_alf_classify_8x60_10_c: 5869.2
vvc_alf_classify_8x60_10_avx2: 1289.5
vvc_alf_classify_8x64_8_c: 6300.5
vvc_alf_classify_8x64_8_avx2: 1533.7
vvc_alf_classify_8x64_10_c: 6255.7
vvc_alf_classify_8x64_10_avx2: 1334.2
vvc_alf_classify_8x68_8_c: 6711.5
vvc_alf_classify_8x68_8_avx2: 1658.7
vvc_alf_classify_8x68_10_c: 6625.0
vvc_alf_classify_8x68_10_avx2: 1451.7
vvc_alf_classify_8x72_8_c: 7091.2
vvc_alf_classify_8x72_8_avx2: 2300.0
vvc_alf_classify_8x72_10_c: 7002.7
vvc_alf_classify_8x72_10_avx2: 1496.5
vvc_alf_classify_8x76_8_c: 7445.0
vvc_alf_classify_8x76_8_avx2: 1883.0
vvc_alf_classify_8x76_10_c: 7394.5
vvc_alf_classify_8x76_10_avx2: 1679.7
vvc_alf_classify_8x80_8_c: 8050.0
vvc_alf_classify_8x80_8_avx2: 1889.7
vvc_alf_classify_8x80_10_c: 7767.5
vvc_alf_classify_8x80_10_avx2: 1644.0
vvc_alf_classify_8x84_8_c: 8206.0
vvc_alf_classify_8x84_8_avx2: 2147.0
vvc_alf_classify_8x84_10_c: 8361.0
vvc_alf_classify_8x84_10_avx2: 1812.2
vvc_alf_classify_8x88_8_c: 8594.0
vvc_alf_classify_8x88_8_avx2: 2140.0
vvc_alf_classify_8x88_10_c: 8497.2
vvc_alf_classify_8x88_10_avx2: 1853.2
vvc_alf_classify_8x92_8_c: 8939.5
vvc_alf_classify_8x92_8_avx2: 2265.7
vvc_alf_classify_8x92_10_c: 9144.7
vvc_alf_classify_8x92_10_avx2: 2015.2
vvc_alf_classify_8x96_8_c: 9303.0
vvc_alf_classify_8x96_8_avx2: 2329.0
vvc_alf_classify_8x96_10_c: 9262.0
vvc_alf_classify_8x96_10_avx2: 2011.0
vvc_alf_classify_8x100_8_c: 9737.2
vvc_alf_classify_8x100_8_avx2: 2511.5
vvc_alf_classify_8x100_10_c: 9603.0
vvc_alf_classify_8x100_10_avx2: 2115.5
vvc_alf_classify_8x104_8_c: 10089.5
vvc_alf_classify_8x104_8_avx2: 2506.2
vvc_alf_classify_8x104_10_c: 9994.7
vvc_alf_classify_8x104_10_avx2: 2161.5
vvc_alf_classify_8x108_8_c: 10464.0
vvc_alf_classify_8x108_8_avx2: 2700.2
vvc_alf_classify_8x108_10_c: 10395.5
vvc_alf_classify_8x108_10_avx2: 2269.5
vvc_alf_classify_8x112_8_c: 10849.0
vvc_alf_classify_8x112_8_avx2: 2691.0
vvc_alf_classify_8x112_10_c: 11047.7
vvc_alf_classify_8x112_10_avx2: 2580.5
vvc_alf_classify_8x116_8_c: 11248.2
vvc_alf_classify_8x116_8_avx2: 2876.7
vvc_alf_classify_8x116_10_c: 11139.5
vvc_alf_classify_8x116_10_avx2: 2425.0
vvc_alf_classify_8x120_8_c: 25271.2
vvc_alf_classify_8x120_8_avx2: 2874.2
vvc_alf_classify_8x120_10_c: 11568.2
vvc_alf_classify_8x120_10_avx2: 2475.7
vvc_alf_classify_8x124_8_c: 12008.5
vvc_alf_classify_8x124_8_avx2: 2991.0
vvc_alf_classify_8x124_10_c: 13275.5
vvc_alf_classify_8x124_10_avx2: 2584.5
vvc_alf_classify_8x128_8_c: 12311.5
vvc_alf_classify_8x128_8_avx2: 3048.5
vvc_alf_classify_8x128_10_c: 20640.0
vvc_alf_classify_8x128_10_avx2: 2629.7
vvc_alf_classify_12x4_8_c: 962.5
vvc_alf_classify_12x4_8_avx2: 208.2
vvc_alf_classify_12x4_10_c: 845.0
vvc_alf_classify_12x4_10_avx2: 177.0
vvc_alf_classify_12x8_8_c: 1410.5
vvc_alf_classify_12x8_8_avx2: 273.0
vvc_alf_classify_12x8_10_c: 1349.7
vvc_alf_classify_12x8_10_avx2: 218.7
vvc_alf_classify_12x12_8_c: 1933.2
vvc_alf_classify_12x12_8_avx2: 388.5
vvc_alf_classify_12x12_10_c: 1851.7
vvc_alf_classify_12x12_10_avx2: 344.5
vvc_alf_classify_12x16_8_c: 2472.7
vvc_alf_classify_12x16_8_avx2: 451.0
vvc_alf_classify_12x16_10_c: 2350.5
vvc_alf_classify_12x16_10_avx2: 390.0
vvc_alf_classify_12x20_8_c: 2976.5
vvc_alf_classify_12x20_8_avx2: 576.7
vvc_alf_classify_12x20_10_c: 2851.7
vvc_alf_classify_12x20_10_avx2: 486.7
vvc_alf_classify_12x24_8_c: 3426.0
vvc_alf_classify_12x24_8_avx2: 640.0
vvc_alf_classify_12x24_10_c: 3420.0
vvc_alf_classify_12x24_10_avx2: 553.7
vvc_alf_classify_12x28_8_c: 3935.5
vvc_alf_classify_12x28_8_avx2: 761.5
vvc_alf_classify_12x28_10_c: 3874.2
vvc_alf_classify_12x28_10_avx2: 642.5
vvc_alf_classify_12x32_8_c: 4446.2
vvc_alf_classify_12x32_8_avx2: 915.5
vvc_alf_classify_12x32_10_c: 4394.0
vvc_alf_classify_12x32_10_avx2: 703.2
vvc_alf_classify_12x36_8_c: 4938.5
vvc_alf_classify_12x36_8_avx2: 952.0
vvc_alf_classify_12x36_10_c: 4890.7
vvc_alf_classify_12x36_10_avx2: 807.7
vvc_alf_classify_12x40_8_c: 5444.7
vvc_alf_classify_12x40_8_avx2: 1011.0
vvc_alf_classify_12x40_10_c: 5397.7
vvc_alf_classify_12x40_10_avx2: 851.7
vvc_alf_classify_12x44_8_c: 6510.2
vvc_alf_classify_12x44_8_avx2: 1136.0
vvc_alf_classify_12x44_10_c: 6214.7
vvc_alf_classify_12x44_10_avx2: 1040.0
vvc_alf_classify_12x48_8_c: 6486.7
vvc_alf_classify_12x48_8_avx2: 1192.0
vvc_alf_classify_12x48_10_c: 6395.7
vvc_alf_classify_12x48_10_avx2: 1422.7
vvc_alf_classify_12x52_8_c: 7058.5
vvc_alf_classify_12x52_8_avx2: 1329.5
vvc_alf_classify_12x52_10_c: 6882.0
vvc_alf_classify_12x52_10_avx2: 1116.7
vvc_alf_classify_12x56_8_c: 7498.5
vvc_alf_classify_12x56_8_avx2: 1380.2
vvc_alf_classify_12x56_10_c: 7394.5
vvc_alf_classify_12x56_10_avx2: 1237.7
vvc_alf_classify_12x60_8_c: 8016.2
vvc_alf_classify_12x60_8_avx2: 1505.5
vvc_alf_classify_12x60_10_c: 7909.0
vvc_alf_classify_12x60_10_avx2: 1320.0
vvc_alf_classify_12x64_8_c: 8546.2
vvc_alf_classify_12x64_8_avx2: 1568.7
vvc_alf_classify_12x64_10_c: 8384.7
vvc_alf_classify_12x64_10_avx2: 1377.2
vvc_alf_classify_12x68_8_c: 9087.0
vvc_alf_classify_12x68_8_avx2: 1692.2
vvc_alf_classify_12x68_10_c: 9163.0
vvc_alf_classify_12x68_10_avx2: 1482.2
vvc_alf_classify_12x72_8_c: 9597.7
vvc_alf_classify_12x72_8_avx2: 2436.2
vvc_alf_classify_12x72_10_c: 9434.0
vvc_alf_classify_12x72_10_avx2: 1527.7
vvc_alf_classify_12x76_8_c: 10122.2
vvc_alf_classify_12x76_8_avx2: 1927.0
vvc_alf_classify_12x76_10_c: 10229.7
vvc_alf_classify_12x76_10_avx2: 1629.2
vvc_alf_classify_12x80_8_c: 10843.7
vvc_alf_classify_12x80_8_avx2: 1936.5
vvc_alf_classify_12x80_10_c: 10515.2
vvc_alf_classify_12x80_10_avx2: 1678.2
vvc_alf_classify_12x84_8_c: 11108.7
vvc_alf_classify_12x84_8_avx2: 2182.7
vvc_alf_classify_12x84_10_c: 10957.0
vvc_alf_classify_12x84_10_avx2: 1856.7
vvc_alf_classify_12x88_8_c: 11638.5
vvc_alf_classify_12x88_8_avx2: 2246.0
vvc_alf_classify_12x88_10_c: 11459.5
vvc_alf_classify_12x88_10_avx2: 1908.2
vvc_alf_classify_12x92_8_c: 12129.0
vvc_alf_classify_12x92_8_avx2: 2309.7
vvc_alf_classify_12x92_10_c: 12249.0
vvc_alf_classify_12x92_10_avx2: 2016.2
vvc_alf_classify_12x96_8_c: 12650.2
vvc_alf_classify_12x96_8_avx2: 2376.7
vvc_alf_classify_12x96_10_c: 12436.5
vvc_alf_classify_12x96_10_avx2: 2061.0
vvc_alf_classify_12x100_8_c: 13152.2
vvc_alf_classify_12x100_8_avx2: 2567.7
vvc_alf_classify_12x100_10_c: 12950.5
vvc_alf_classify_12x100_10_avx2: 2181.5
vvc_alf_classify_12x104_8_c: 13716.0
vvc_alf_classify_12x104_8_avx2: 2567.2
vvc_alf_classify_12x104_10_c: 13463.5
vvc_alf_classify_12x104_10_avx2: 2221.2
vvc_alf_classify_12x108_8_c: 14194.0
vvc_alf_classify_12x108_8_avx2: 2828.0
vvc_alf_classify_12x108_10_c: 14055.5
vvc_alf_classify_12x108_10_avx2: 2337.2
vvc_alf_classify_12x112_8_c: 15696.7
vvc_alf_classify_12x112_8_avx2: 2820.5
vvc_alf_classify_12x112_10_c: 14607.2
vvc_alf_classify_12x112_10_avx2: 2384.0
vvc_alf_classify_12x116_8_c: 16497.0
vvc_alf_classify_12x116_8_avx2: 3002.2
vvc_alf_classify_12x116_10_c: 15063.7
vvc_alf_classify_12x116_10_avx2: 2551.0
vvc_alf_classify_12x120_8_c: 15702.7
vvc_alf_classify_12x120_8_avx2: 3017.5
vvc_alf_classify_12x120_10_c: 15618.5
vvc_alf_classify_12x120_10_avx2: 2541.2
vvc_alf_classify_12x124_8_c: 16210.0
vvc_alf_classify_12x124_8_avx2: 3064.7
vvc_alf_classify_12x124_10_c: 18047.5
vvc_alf_classify_12x124_10_avx2: 2644.0
vvc_alf_classify_12x128_8_c: 16710.2
vvc_alf_classify_12x128_8_avx2: 3134.7
vvc_alf_classify_12x128_10_c: 16721.5
vvc_alf_classify_12x128_10_avx2: 2700.0
vvc_alf_classify_16x4_8_c: 1204.5
vvc_alf_classify_16x4_8_avx2: 321.5
vvc_alf_classify_16x4_10_c: 1050.5
vvc_alf_classify_16x4_10_avx2: 299.7
vvc_alf_classify_16x8_8_c: 1731.7
vvc_alf_classify_16x8_8_avx2: 451.0
vvc_alf_classify_16x8_10_c: 1725.7
vvc_alf_classify_16x8_10_avx2: 389.2
vvc_alf_classify_16x12_8_c: 2427.0
vvc_alf_classify_16x12_8_avx2: 621.5
vvc_alf_classify_16x12_10_c: 2338.7
vvc_alf_classify_16x12_10_avx2: 553.0
vvc_alf_classify_16x16_8_c: 3179.5
vvc_alf_classify_16x16_8_avx2: 739.2
vvc_alf_classify_16x16_10_c: 3307.5
vvc_alf_classify_16x16_10_avx2: 644.2
vvc_alf_classify_16x20_8_c: 3763.0
vvc_alf_classify_16x20_8_avx2: 943.2
vvc_alf_classify_16x20_10_c: 3604.0
vvc_alf_classify_16x20_10_avx2: 774.2
vvc_alf_classify_16x24_8_c: 4304.0
vvc_alf_classify_16x24_8_avx2: 1041.5
vvc_alf_classify_16x24_10_c: 4265.2
vvc_alf_classify_16x24_10_avx2: 866.5
vvc_alf_classify_16x28_8_c: 4966.0
vvc_alf_classify_16x28_8_avx2: 1224.7
vvc_alf_classify_16x28_10_c: 4861.7
vvc_alf_classify_16x28_10_avx2: 1016.2
vvc_alf_classify_16x32_8_c: 5595.2
vvc_alf_classify_16x32_8_avx2: 1496.5
vvc_alf_classify_16x32_10_c: 5515.5
vvc_alf_classify_16x32_10_avx2: 1113.7
vvc_alf_classify_16x36_8_c: 6278.7
vvc_alf_classify_16x36_8_avx2: 1526.2
vvc_alf_classify_16x36_10_c: 6150.0
vvc_alf_classify_16x36_10_avx2: 1256.0
vvc_alf_classify_16x40_8_c: 6906.5
vvc_alf_classify_16x40_8_avx2: 1644.0
vvc_alf_classify_16x40_10_c: 6783.0
vvc_alf_classify_16x40_10_avx2: 1346.2
vvc_alf_classify_16x44_8_c: 7524.0
vvc_alf_classify_16x44_8_avx2: 1830.0
vvc_alf_classify_16x44_10_c: 7604.0
vvc_alf_classify_16x44_10_avx2: 1537.5
vvc_alf_classify_16x48_8_c: 8212.0
vvc_alf_classify_16x48_8_avx2: 1948.5
vvc_alf_classify_16x48_10_c: 8035.5
vvc_alf_classify_16x48_10_avx2: 1674.5
vvc_alf_classify_16x52_8_c: 8819.0
vvc_alf_classify_16x52_8_avx2: 2127.2
vvc_alf_classify_16x52_10_c: 9160.0
vvc_alf_classify_16x52_10_avx2: 1748.2
vvc_alf_classify_16x56_8_c: 9491.5
vvc_alf_classify_16x56_8_avx2: 2246.5
vvc_alf_classify_16x56_10_c: 9312.0
vvc_alf_classify_16x56_10_avx2: 1967.0
vvc_alf_classify_16x60_8_c: 10170.5
vvc_alf_classify_16x60_8_avx2: 2431.7
vvc_alf_classify_16x60_10_c: 9949.5
vvc_alf_classify_16x60_10_avx2: 2040.0
vvc_alf_classify_16x64_8_c: 10769.2
vvc_alf_classify_16x64_8_avx2: 2551.0
vvc_alf_classify_16x64_10_c: 10593.5
vvc_alf_classify_16x64_10_avx2: 2119.0
vvc_alf_classify_16x68_8_c: 11420.0
vvc_alf_classify_16x68_8_avx2: 2729.0
vvc_alf_classify_16x68_10_c: 11266.0
vvc_alf_classify_16x68_10_avx2: 2262.7
vvc_alf_classify_16x72_8_c: 12090.2
vvc_alf_classify_16x72_8_avx2: 3826.7
vvc_alf_classify_16x72_10_c: 11893.0
vvc_alf_classify_16x72_10_avx2: 2354.2
vvc_alf_classify_16x76_8_c: 12741.2
vvc_alf_classify_16x76_8_avx2: 3121.0
vvc_alf_classify_16x76_10_c: 12523.0
vvc_alf_classify_16x76_10_avx2: 2502.0
vvc_alf_classify_16x80_8_c: 13354.0
vvc_alf_classify_16x80_8_avx2: 3150.5
vvc_alf_classify_16x80_10_c: 13220.7
vvc_alf_classify_16x80_10_avx2: 2664.5
vvc_alf_classify_16x84_8_c: 14040.5
vvc_alf_classify_16x84_8_avx2: 3428.2
vvc_alf_classify_16x84_10_c: 13776.2
vvc_alf_classify_16x84_10_avx2: 2737.2
vvc_alf_classify_16x88_8_c: 15866.2
vvc_alf_classify_16x88_8_avx2: 3458.0
vvc_alf_classify_16x88_10_c: 14792.7
vvc_alf_classify_16x88_10_avx2: 2834.0
vvc_alf_classify_16x92_8_c: 15316.2
vvc_alf_classify_16x92_8_avx2: 3641.2
vvc_alf_classify_16x92_10_c: 15020.0
vvc_alf_classify_16x92_10_avx2: 2982.2
vvc_alf_classify_16x96_8_c: 15976.7
vvc_alf_classify_16x96_8_avx2: 3743.2
vvc_alf_classify_16x96_10_c: 16119.7
vvc_alf_classify_16x96_10_avx2: 3075.2
vvc_alf_classify_16x100_8_c: 16591.7
vvc_alf_classify_16x100_8_avx2: 3945.7
vvc_alf_classify_16x100_10_c: 16393.7
vvc_alf_classify_16x100_10_avx2: 4552.7
vvc_alf_classify_16x104_8_c: 17254.5
vvc_alf_classify_16x104_8_avx2: 4063.5
vvc_alf_classify_16x104_10_c: 16997.7
vvc_alf_classify_16x104_10_avx2: 3310.5
vvc_alf_classify_16x108_8_c: 17893.5
vvc_alf_classify_16x108_8_avx2: 4472.2
vvc_alf_classify_16x108_10_c: 17676.0
vvc_alf_classify_16x108_10_avx2: 3453.5
vvc_alf_classify_16x112_8_c: 18530.2
vvc_alf_classify_16x112_8_avx2: 4479.7
vvc_alf_classify_16x112_10_c: 20518.5
vvc_alf_classify_16x112_10_avx2: 3548.2
vvc_alf_classify_16x116_8_c: 19234.0
vvc_alf_classify_16x116_8_avx2: 4740.7
vvc_alf_classify_16x116_10_c: 19553.5
vvc_alf_classify_16x116_10_avx2: 3803.5
vvc_alf_classify_16x120_8_c: 19873.7
vvc_alf_classify_16x120_8_avx2: 4833.0
vvc_alf_classify_16x120_10_c: 19662.2
vvc_alf_classify_16x120_10_avx2: 3785.0
vvc_alf_classify_16x124_8_c: 20402.5
vvc_alf_classify_16x124_8_avx2: 5014.7
vvc_alf_classify_16x124_10_c: 20388.2
vvc_alf_classify_16x124_10_avx2: 3945.7
vvc_alf_classify_16x128_8_c: 21121.7
vvc_alf_classify_16x128_8_avx2: 4991.2
vvc_alf_classify_16x128_10_c: 20953.5
vvc_alf_classify_16x128_10_avx2: 4071.7
vvc_alf_classify_20x4_8_c: 2303.5
vvc_alf_classify_20x4_8_avx2: 379.5
vvc_alf_classify_20x4_10_c: 1270.7
vvc_alf_classify_20x4_10_avx2: 357.7
vvc_alf_classify_20x8_8_c: 2081.0
vvc_alf_classify_20x8_8_avx2: 512.7
vvc_alf_classify_20x8_10_c: 2029.7
vvc_alf_classify_20x8_10_avx2: 450.2
vvc_alf_classify_20x12_8_c: 2923.2
vvc_alf_classify_20x12_8_avx2: 757.0
vvc_alf_classify_20x12_10_c: 2798.2
vvc_alf_classify_20x12_10_avx2: 665.5
vvc_alf_classify_20x16_8_c: 3747.0
vvc_alf_classify_20x16_8_avx2: 856.0
vvc_alf_classify_20x16_10_c: 3588.2
vvc_alf_classify_20x16_10_avx2: 757.7
vvc_alf_classify_20x20_8_c: 4584.2
vvc_alf_classify_20x20_8_avx2: 1210.5
vvc_alf_classify_20x20_10_c: 4334.5
vvc_alf_classify_20x20_10_avx2: 941.7
vvc_alf_classify_20x24_8_c: 5207.2
vvc_alf_classify_20x24_8_avx2: 1212.0
vvc_alf_classify_20x24_10_c: 5119.2
vvc_alf_classify_20x24_10_avx2: 1039.2
vvc_alf_classify_20x28_8_c: 5985.2
vvc_alf_classify_20x28_8_avx2: 1524.7
vvc_alf_classify_20x28_10_c: 5864.0
vvc_alf_classify_20x28_10_avx2: 1244.0
vvc_alf_classify_20x32_8_c: 6794.0
vvc_alf_classify_20x32_8_avx2: 1748.5
vvc_alf_classify_20x32_10_c: 6626.0
vvc_alf_classify_20x32_10_avx2: 1338.7
vvc_alf_classify_20x36_8_c: 7551.5
vvc_alf_classify_20x36_8_avx2: 1878.5
vvc_alf_classify_20x36_10_c: 7401.7
vvc_alf_classify_20x36_10_avx2: 1570.2
vvc_alf_classify_20x40_8_c: 8537.0
vvc_alf_classify_20x40_8_avx2: 1953.7
vvc_alf_classify_20x40_10_c: 8165.7
vvc_alf_classify_20x40_10_avx2: 1662.5
vvc_alf_classify_20x44_8_c: 9092.2
vvc_alf_classify_20x44_8_avx2: 2210.7
vvc_alf_classify_20x44_10_c: 8920.2
vvc_alf_classify_20x44_10_avx2: 1905.2
vvc_alf_classify_20x48_8_c: 9863.0
vvc_alf_classify_20x48_8_avx2: 2335.7
vvc_alf_classify_20x48_10_c: 9667.2
vvc_alf_classify_20x48_10_avx2: 2215.5
vvc_alf_classify_20x52_8_c: 10678.2
vvc_alf_classify_20x52_8_avx2: 2580.0
vvc_alf_classify_20x52_10_c: 10486.2
vvc_alf_classify_20x52_10_avx2: 2196.5
vvc_alf_classify_20x56_8_c: 11472.2
vvc_alf_classify_20x56_8_avx2: 2705.0
vvc_alf_classify_20x56_10_c: 11825.2
vvc_alf_classify_20x56_10_avx2: 2319.5
vvc_alf_classify_20x60_8_c: 12260.7
vvc_alf_classify_20x60_8_avx2: 2943.2
vvc_alf_classify_20x60_10_c: 11970.5
vvc_alf_classify_20x60_10_avx2: 68760.2
vvc_alf_classify_20x64_8_c: 13000.2
vvc_alf_classify_20x64_8_avx2: 3070.0
vvc_alf_classify_20x64_10_c: 27692.5
vvc_alf_classify_20x64_10_avx2: 2627.0
vvc_alf_classify_20x68_8_c: 13793.5
vvc_alf_classify_20x68_8_avx2: 3290.5
vvc_alf_classify_20x68_10_c: 13531.2
vvc_alf_classify_20x68_10_avx2: 2829.5
vvc_alf_classify_20x72_8_c: 14586.5
vvc_alf_classify_20x72_8_avx2: 4231.0
vvc_alf_classify_20x72_10_c: 15078.0
vvc_alf_classify_20x72_10_avx2: 2921.0
vvc_alf_classify_20x76_8_c: 15346.7
vvc_alf_classify_20x76_8_avx2: 3761.0
vvc_alf_classify_20x76_10_c: 15429.5
vvc_alf_classify_20x76_10_avx2: 3128.0
vvc_alf_classify_20x80_8_c: 16605.2
vvc_alf_classify_20x80_8_avx2: 3785.5
vvc_alf_classify_20x80_10_c: 15812.2
vvc_alf_classify_20x80_10_avx2: 3219.0
vvc_alf_classify_20x84_8_c: 16956.0
vvc_alf_classify_20x84_8_avx2: 4115.5
vvc_alf_classify_20x84_10_c: 16612.0
vvc_alf_classify_20x84_10_avx2: 3420.7
vvc_alf_classify_20x88_8_c: 17691.7
vvc_alf_classify_20x88_8_avx2: 4129.7
vvc_alf_classify_20x88_10_c: 18300.2
vvc_alf_classify_20x88_10_avx2: 3516.7
vvc_alf_classify_20x92_8_c: 18534.7
vvc_alf_classify_20x92_8_avx2: 4375.5
vvc_alf_classify_20x92_10_c: 18152.0
vvc_alf_classify_20x92_10_avx2: 3730.5
vvc_alf_classify_20x96_8_c: 19260.0
vvc_alf_classify_20x96_8_avx2: 4496.0
vvc_alf_classify_20x96_10_c: 18926.5
vvc_alf_classify_20x96_10_avx2: 3823.7
vvc_alf_classify_20x100_8_c: 20001.0
vvc_alf_classify_20x100_8_avx2: 4727.7
vvc_alf_classify_20x100_10_c: 19691.2
vvc_alf_classify_20x100_10_avx2: 4021.0
vvc_alf_classify_20x104_8_c: 21388.5
vvc_alf_classify_20x104_8_avx2: 4853.5
vvc_alf_classify_20x104_10_c: 20421.7
vvc_alf_classify_20x104_10_avx2: 4124.5
vvc_alf_classify_20x108_8_c: 21618.5
vvc_alf_classify_20x108_8_avx2: 5084.5
vvc_alf_classify_20x108_10_c: 21230.5
vvc_alf_classify_20x108_10_avx2: 4326.2
vvc_alf_classify_20x112_8_c: 22346.0
vvc_alf_classify_20x112_8_avx2: 5341.2
vvc_alf_classify_20x112_10_c: 22014.7
vvc_alf_classify_20x112_10_avx2: 4400.7
vvc_alf_classify_20x116_8_c: 23122.0
vvc_alf_classify_20x116_8_avx2: 5622.0
vvc_alf_classify_20x116_10_c: 23385.2
vvc_alf_classify_20x116_10_avx2: 4616.7
vvc_alf_classify_20x120_8_c: 23936.0
vvc_alf_classify_20x120_8_avx2: 5596.0
vvc_alf_classify_20x120_10_c: 23615.7
vvc_alf_classify_20x120_10_avx2: 4709.2
vvc_alf_classify_20x124_8_c: 24638.2
vvc_alf_classify_20x124_8_avx2: 6028.2
vvc_alf_classify_20x124_10_c: 24440.2
vvc_alf_classify_20x124_10_avx2: 4924.2
vvc_alf_classify_20x128_8_c: 25533.2
vvc_alf_classify_20x128_8_avx2: 5952.7
vvc_alf_classify_20x128_10_c: 25189.2
vvc_alf_classify_20x128_10_avx2: 5058.2
vvc_alf_classify_24x4_8_c: 1684.5
vvc_alf_classify_24x4_8_avx2: 378.7
vvc_alf_classify_24x4_10_c: 1472.7
vvc_alf_classify_24x4_10_avx2: 359.2
vvc_alf_classify_24x8_8_c: 2423.7
vvc_alf_classify_24x8_8_avx2: 512.7
vvc_alf_classify_24x8_10_c: 2370.0
vvc_alf_classify_24x8_10_avx2: 464.0
vvc_alf_classify_24x12_8_c: 3369.2
vvc_alf_classify_24x12_8_avx2: 734.0
vvc_alf_classify_24x12_10_c: 3285.2
vvc_alf_classify_24x12_10_avx2: 667.2
vvc_alf_classify_24x16_8_c: 4503.5
vvc_alf_classify_24x16_8_avx2: 862.7
vvc_alf_classify_24x16_10_c: 4180.2
vvc_alf_classify_24x16_10_avx2: 763.0
vvc_alf_classify_24x20_8_c: 5344.2
vvc_alf_classify_24x20_8_avx2: 1089.2
vvc_alf_classify_24x20_10_c: 5079.2
vvc_alf_classify_24x20_10_avx2: 975.2
vvc_alf_classify_24x24_8_c: 6094.7
vvc_alf_classify_24x24_8_avx2: 1218.7
vvc_alf_classify_24x24_10_c: 5966.0
vvc_alf_classify_24x24_10_avx2: 1046.0
vvc_alf_classify_24x28_8_c: 7034.7
vvc_alf_classify_24x28_8_avx2: 1454.7
vvc_alf_classify_24x28_10_c: 6845.5
vvc_alf_classify_24x28_10_avx2: 1253.0
vvc_alf_classify_24x32_8_c: 7949.2
vvc_alf_classify_24x32_8_avx2: 1756.5
vvc_alf_classify_24x32_10_c: 7941.7
vvc_alf_classify_24x32_10_avx2: 1343.2
vvc_alf_classify_24x36_8_c: 8846.5
vvc_alf_classify_24x36_8_avx2: 1846.5
vvc_alf_classify_24x36_10_c: 8630.5
vvc_alf_classify_24x36_10_avx2: 1578.5
vvc_alf_classify_24x40_8_c: 9820.5
vvc_alf_classify_24x40_8_avx2: 1965.0
vvc_alf_classify_24x40_10_c: 9551.0
vvc_alf_classify_24x40_10_avx2: 1675.2
vvc_alf_classify_24x44_8_c: 10639.0
vvc_alf_classify_24x44_8_avx2: 2233.0
vvc_alf_classify_24x44_10_c: 10417.0
vvc_alf_classify_24x44_10_avx2: 1959.2
vvc_alf_classify_24x48_8_c: 11574.2
vvc_alf_classify_24x48_8_avx2: 2348.5
vvc_alf_classify_24x48_10_c: 11366.5
vvc_alf_classify_24x48_10_avx2: 2229.5
vvc_alf_classify_24x52_8_c: 12551.2
vvc_alf_classify_24x52_8_avx2: 2592.7
vvc_alf_classify_24x52_10_c: 12260.7
vvc_alf_classify_24x52_10_avx2: 2334.2
vvc_alf_classify_24x56_8_c: 13440.5
vvc_alf_classify_24x56_8_avx2: 2719.2
vvc_alf_classify_24x56_10_c: 13476.5
vvc_alf_classify_24x56_10_avx2: 2329.0
vvc_alf_classify_24x60_8_c: 14334.7
vvc_alf_classify_24x60_8_avx2: 2955.5
vvc_alf_classify_24x60_10_c: 14063.0
vvc_alf_classify_24x60_10_avx2: 2620.2
vvc_alf_classify_24x64_8_c: 15261.2
vvc_alf_classify_24x64_8_avx2: 3079.7
vvc_alf_classify_24x64_10_c: 14927.7
vvc_alf_classify_24x64_10_avx2: 2645.5
vvc_alf_classify_24x68_8_c: 16150.5
vvc_alf_classify_24x68_8_avx2: 3318.0
vvc_alf_classify_24x68_10_c: 15804.7
vvc_alf_classify_24x68_10_avx2: 2854.7
vvc_alf_classify_24x72_8_c: 17098.2
vvc_alf_classify_24x72_8_avx2: 4557.0
vvc_alf_classify_24x72_10_c: 17138.5
vvc_alf_classify_24x72_10_avx2: 2950.7
vvc_alf_classify_24x76_8_c: 18070.2
vvc_alf_classify_24x76_8_avx2: 3680.5
vvc_alf_classify_24x76_10_c: 18125.2
vvc_alf_classify_24x76_10_avx2: 3144.5
vvc_alf_classify_24x80_8_c: 18916.0
vvc_alf_classify_24x80_8_avx2: 3808.0
vvc_alf_classify_24x80_10_c: 18548.2
vvc_alf_classify_24x80_10_avx2: 3236.0
vvc_alf_classify_24x84_8_c: 55244.0
vvc_alf_classify_24x84_8_avx2: 4039.5
vvc_alf_classify_24x84_10_c: 33735.2
vvc_alf_classify_24x84_10_avx2: 3452.7
vvc_alf_classify_24x88_8_c: 20739.0
vvc_alf_classify_24x88_8_avx2: 4172.0
vvc_alf_classify_24x88_10_c: 30171.2
vvc_alf_classify_24x88_10_avx2: 3534.0
vvc_alf_classify_24x92_8_c: 21650.5
vvc_alf_classify_24x92_8_avx2: 4388.2
vvc_alf_classify_24x92_10_c: 21769.7
vvc_alf_classify_24x92_10_avx2: 3764.7
vvc_alf_classify_24x96_8_c: 22539.0
vvc_alf_classify_24x96_8_avx2: 4520.0
vvc_alf_classify_24x96_10_c: 22151.0
vvc_alf_classify_24x96_10_avx2: 3952.5
vvc_alf_classify_24x100_8_c: 23469.0
vvc_alf_classify_24x100_8_avx2: 4764.2
vvc_alf_classify_24x100_10_c: 23026.7
vvc_alf_classify_24x100_10_avx2: 4053.0
vvc_alf_classify_24x104_8_c: 24381.2
vvc_alf_classify_24x104_8_avx2: 5019.5
vvc_alf_classify_24x104_10_c: 23956.7
vvc_alf_classify_24x104_10_avx2: 4158.7
vvc_alf_classify_24x108_8_c: 25321.7
vvc_alf_classify_24x108_8_avx2: 5124.5
vvc_alf_classify_24x108_10_c: 45315.0
vvc_alf_classify_24x108_10_avx2: 4353.2
vvc_alf_classify_24x112_8_c: 26200.5
vvc_alf_classify_24x112_8_avx2: 6552.2
vvc_alf_classify_24x112_10_c: 25795.5
vvc_alf_classify_24x112_10_avx2: 4445.5
vvc_alf_classify_24x116_8_c: 27166.2
vvc_alf_classify_24x116_8_avx2: 5660.7
vvc_alf_classify_24x116_10_c: 26805.2
vvc_alf_classify_24x116_10_avx2: 4668.0
vvc_alf_classify_24x120_8_c: 28112.2
vvc_alf_classify_24x120_8_avx2: 7519.5
vvc_alf_classify_24x120_10_c: 27617.0
vvc_alf_classify_24x120_10_avx2: 4751.5
vvc_alf_classify_24x124_8_c: 28968.5
vvc_alf_classify_24x124_8_avx2: 6042.7
vvc_alf_classify_24x124_10_c: 28515.7
vvc_alf_classify_24x124_10_avx2: 4961.5
vvc_alf_classify_24x128_8_c: 29832.2
vvc_alf_classify_24x128_8_avx2: 5998.7
vvc_alf_classify_24x128_10_c: 32860.5
vvc_alf_classify_24x128_10_avx2: 5109.0
vvc_alf_classify_28x4_8_c: 1933.5
vvc_alf_classify_28x4_8_avx2: 382.5
vvc_alf_classify_28x4_10_c: 1699.7
vvc_alf_classify_28x4_10_avx2: 370.2
vvc_alf_classify_28x8_8_c: 2773.0
vvc_alf_classify_28x8_8_avx2: 518.0
vvc_alf_classify_28x8_10_c: 2774.0
vvc_alf_classify_28x8_10_avx2: 451.7
vvc_alf_classify_28x12_8_c: 7068.2
vvc_alf_classify_28x12_8_avx2: 744.5
vvc_alf_classify_28x12_10_c: 3779.7
vvc_alf_classify_28x12_10_avx2: 674.7
vvc_alf_classify_28x16_8_c: 9153.5
vvc_alf_classify_28x16_8_avx2: 868.7
vvc_alf_classify_28x16_10_c: 4787.2
vvc_alf_classify_28x16_10_avx2: 773.7
vvc_alf_classify_28x20_8_c: 6086.0
vvc_alf_classify_28x20_8_avx2: 1101.2
vvc_alf_classify_28x20_10_c: 5834.2
vvc_alf_classify_28x20_10_avx2: 964.7
vvc_alf_classify_28x24_8_c: 6961.0
vvc_alf_classify_28x24_8_avx2: 1225.5
vvc_alf_classify_28x24_10_c: 6852.2
vvc_alf_classify_28x24_10_avx2: 1052.0
vvc_alf_classify_28x28_8_c: 8025.7
vvc_alf_classify_28x28_8_avx2: 1469.0
vvc_alf_classify_28x28_10_c: 7865.0
vvc_alf_classify_28x28_10_avx2: 1260.5
vvc_alf_classify_28x32_8_c: 9313.0
vvc_alf_classify_28x32_8_avx2: 1773.5
vvc_alf_classify_28x32_10_c: 8909.7
vvc_alf_classify_28x32_10_avx2: 1427.2
vvc_alf_classify_28x36_8_c: 11260.5
vvc_alf_classify_28x36_8_avx2: 1869.5
vvc_alf_classify_28x36_10_c: 9922.5
vvc_alf_classify_28x36_10_avx2: 1604.5
vvc_alf_classify_28x40_8_c: 11209.2
vvc_alf_classify_28x40_8_avx2: 1987.2
vvc_alf_classify_28x40_10_c: 10948.7
vvc_alf_classify_28x40_10_avx2: 1694.5
vvc_alf_classify_28x44_8_c: 12237.7
vvc_alf_classify_28x44_8_avx2: 2263.5
vvc_alf_classify_28x44_10_c: 11968.2
vvc_alf_classify_28x44_10_avx2: 1927.7
vvc_alf_classify_28x48_8_c: 13301.2
vvc_alf_classify_28x48_8_avx2: 6656.5
vvc_alf_classify_28x48_10_c: 13011.5
vvc_alf_classify_28x48_10_avx2: 2074.0
vvc_alf_classify_28x52_8_c: 14360.0
vvc_alf_classify_28x52_8_avx2: 2616.5
vvc_alf_classify_28x52_10_c: 14040.5
vvc_alf_classify_28x52_10_avx2: 2304.5
vvc_alf_classify_28x56_8_c: 15431.0
vvc_alf_classify_28x56_8_avx2: 2746.0
vvc_alf_classify_28x56_10_c: 15093.7
vvc_alf_classify_28x56_10_avx2: 2367.0
vvc_alf_classify_28x60_8_c: 16449.0
vvc_alf_classify_28x60_8_avx2: 2977.7
vvc_alf_classify_28x60_10_c: 16139.0
vvc_alf_classify_28x60_10_avx2: 2647.7
vvc_alf_classify_28x64_8_c: 17493.0
vvc_alf_classify_28x64_8_avx2: 3110.2
vvc_alf_classify_28x64_10_c: 17088.0
vvc_alf_classify_28x64_10_avx2: 2815.2
vvc_alf_classify_28x68_8_c: 18554.7
vvc_alf_classify_28x68_8_avx2: 3348.5
vvc_alf_classify_28x68_10_c: 18119.2
vvc_alf_classify_28x68_10_avx2: 2891.2
vvc_alf_classify_28x72_8_c: 19574.2
vvc_alf_classify_28x72_8_avx2: 3470.7
vvc_alf_classify_28x72_10_c: 19206.5
vvc_alf_classify_28x72_10_avx2: 2971.7
vvc_alf_classify_28x76_8_c: 46253.7
vvc_alf_classify_28x76_8_avx2: 3709.0
vvc_alf_classify_28x76_10_c: 20747.2
vvc_alf_classify_28x76_10_avx2: 3190.0
vvc_alf_classify_28x80_8_c: 29286.5
vvc_alf_classify_28x80_8_avx2: 3876.5
vvc_alf_classify_28x80_10_c: 21226.0
vvc_alf_classify_28x80_10_avx2: 3277.7
vvc_alf_classify_28x84_8_c: 22761.5
vvc_alf_classify_28x84_8_avx2: 4076.0
vvc_alf_classify_28x84_10_c: 22905.0
vvc_alf_classify_28x84_10_avx2: 3495.2
vvc_alf_classify_28x88_8_c: 33349.5
vvc_alf_classify_28x88_8_avx2: 4195.2
vvc_alf_classify_28x88_10_c: 23983.2
vvc_alf_classify_28x88_10_avx2: 3576.5
vvc_alf_classify_28x92_8_c: 24845.2
vvc_alf_classify_28x92_8_avx2: 4450.7
vvc_alf_classify_28x92_10_c: 24362.7
vvc_alf_classify_28x92_10_avx2: 3812.5
vvc_alf_classify_28x96_8_c: 25837.7
vvc_alf_classify_28x96_8_avx2: 4562.5
vvc_alf_classify_28x96_10_c: 25472.2
vvc_alf_classify_28x96_10_avx2: 3890.7
vvc_alf_classify_28x100_8_c: 26931.0
vvc_alf_classify_28x100_8_avx2: 4819.2
vvc_alf_classify_28x100_10_c: 27242.7
vvc_alf_classify_28x100_10_avx2: 4109.5
vvc_alf_classify_28x104_8_c: 28027.2
vvc_alf_classify_28x104_8_avx2: 5160.7
vvc_alf_classify_28x104_10_c: 28308.7
vvc_alf_classify_28x104_10_avx2: 4199.7
vvc_alf_classify_28x108_8_c: 29042.2
vvc_alf_classify_28x108_8_avx2: 5175.2
vvc_alf_classify_28x108_10_c: 28589.5
vvc_alf_classify_28x108_10_avx2: 4410.5
vvc_alf_classify_28x112_8_c: 30102.0
vvc_alf_classify_28x112_8_avx2: 5437.7
vvc_alf_classify_28x112_10_c: 29659.5
vvc_alf_classify_28x112_10_avx2: 4493.2
vvc_alf_classify_28x116_8_c: 31242.0
vvc_alf_classify_28x116_8_avx2: 5874.5
vvc_alf_classify_28x116_10_c: 30746.7
vvc_alf_classify_28x116_10_avx2: 4715.0
vvc_alf_classify_28x120_8_c: 41923.5
vvc_alf_classify_28x120_8_avx2: 5698.0
vvc_alf_classify_28x120_10_c: 31763.2
vvc_alf_classify_28x120_10_avx2: 4803.0
vvc_alf_classify_28x124_8_c: 51929.2
vvc_alf_classify_28x124_8_avx2: 6393.5
vvc_alf_classify_28x124_10_c: 57978.2
vvc_alf_classify_28x124_10_avx2: 5017.2
vvc_alf_classify_28x128_8_c: 34202.2
vvc_alf_classify_28x128_8_avx2: 6063.5
vvc_alf_classify_28x128_10_c: 34803.5
vvc_alf_classify_28x128_10_avx2: 5146.2
vvc_alf_classify_32x4_8_c: 2185.5
vvc_alf_classify_32x4_8_avx2: 494.2
vvc_alf_classify_32x4_10_c: 1903.0
vvc_alf_classify_32x4_10_avx2: 456.5
vvc_alf_classify_32x8_8_c: 3311.2
vvc_alf_classify_32x8_8_avx2: 719.0
vvc_alf_classify_32x8_10_c: 3055.7
vvc_alf_classify_32x8_10_avx2: 582.0
vvc_alf_classify_32x12_8_c: 7939.5
vvc_alf_classify_32x12_8_avx2: 975.2
vvc_alf_classify_32x12_10_c: 4237.7
vvc_alf_classify_32x12_10_avx2: 853.5
vvc_alf_classify_32x16_8_c: 5815.0
vvc_alf_classify_32x16_8_avx2: 1152.5
vvc_alf_classify_32x16_10_c: 5389.0
vvc_alf_classify_32x16_10_avx2: 966.2
vvc_alf_classify_32x20_8_c: 6895.7
vvc_alf_classify_32x20_8_avx2: 1454.0
vvc_alf_classify_32x20_10_c: 6536.5
vvc_alf_classify_32x20_10_avx2: 1216.5
vvc_alf_classify_32x24_8_c: 7877.5
vvc_alf_classify_32x24_8_avx2: 1635.0
vvc_alf_classify_32x24_10_c: 7709.5
vvc_alf_classify_32x24_10_avx2: 1355.7
vvc_alf_classify_32x28_8_c: 9064.7
vvc_alf_classify_32x28_8_avx2: 1997.5
vvc_alf_classify_32x28_10_c: 8852.5
vvc_alf_classify_32x28_10_avx2: 1769.7
vvc_alf_classify_32x32_8_c: 10232.2
vvc_alf_classify_32x32_8_avx2: 2428.5
vvc_alf_classify_32x32_10_c: 32419.0
vvc_alf_classify_32x32_10_avx2: 2635.5
vvc_alf_classify_32x36_8_c: 11432.7
vvc_alf_classify_32x36_8_avx2: 2478.7
vvc_alf_classify_32x36_10_c: 11172.0
vvc_alf_classify_32x36_10_avx2: 2058.0
vvc_alf_classify_32x40_8_c: 12648.7
vvc_alf_classify_32x40_8_avx2: 2654.5
vvc_alf_classify_32x40_10_c: 12323.5
vvc_alf_classify_32x40_10_avx2: 2198.7
vvc_alf_classify_32x44_8_c: 13783.7
vvc_alf_classify_32x44_8_avx2: 2953.0
vvc_alf_classify_32x44_10_c: 13500.0
vvc_alf_classify_32x44_10_avx2: 3119.7
vvc_alf_classify_32x48_8_c: 14968.5
vvc_alf_classify_32x48_8_avx2: 8776.5
vvc_alf_classify_32x48_10_c: 14637.0
vvc_alf_classify_32x48_10_avx2: 2597.7
vvc_alf_classify_32x52_8_c: 16166.7
vvc_alf_classify_32x52_8_avx2: 3424.5
vvc_alf_classify_32x52_10_c: 15778.0
vvc_alf_classify_32x52_10_avx2: 2917.7
vvc_alf_classify_32x56_8_c: 17326.2
vvc_alf_classify_32x56_8_avx2: 3624.7
vvc_alf_classify_32x56_10_c: 16924.2
vvc_alf_classify_32x56_10_avx2: 3017.7
vvc_alf_classify_32x60_8_c: 18505.7
vvc_alf_classify_32x60_8_avx2: 3924.2
vvc_alf_classify_32x60_10_c: 18068.0
vvc_alf_classify_32x60_10_avx2: 3444.5
vvc_alf_classify_32x64_8_c: 19720.2
vvc_alf_classify_32x64_8_avx2: 4596.5
vvc_alf_classify_32x64_10_c: 19266.7
vvc_alf_classify_32x64_10_avx2: 3401.5
vvc_alf_classify_32x68_8_c: 20907.5
vvc_alf_classify_32x68_8_avx2: 4420.7
vvc_alf_classify_32x68_10_c: 20431.5
vvc_alf_classify_32x68_10_avx2: 3666.5
vvc_alf_classify_32x72_8_c: 24578.5
vvc_alf_classify_32x72_8_avx2: 4602.5
vvc_alf_classify_32x72_10_c: 21547.0
vvc_alf_classify_32x72_10_avx2: 3819.7
vvc_alf_classify_32x76_8_c: 23236.0
vvc_alf_classify_32x76_8_avx2: 4911.5
vvc_alf_classify_32x76_10_c: 23336.5
vvc_alf_classify_32x76_10_avx2: 4073.0
vvc_alf_classify_32x80_8_c: 24448.2
vvc_alf_classify_32x80_8_avx2: 5082.7
vvc_alf_classify_32x80_10_c: 23937.5
vvc_alf_classify_32x80_10_avx2: 4198.2
vvc_alf_classify_32x84_8_c: 25680.0
vvc_alf_classify_32x84_8_avx2: 5354.7
vvc_alf_classify_32x84_10_c: 34406.5
vvc_alf_classify_32x84_10_avx2: 4455.0
vvc_alf_classify_32x88_8_c: 26850.0
vvc_alf_classify_32x88_8_avx2: 5558.7
vvc_alf_classify_32x88_10_c: 34482.2
vvc_alf_classify_32x88_10_avx2: 4597.5
vvc_alf_classify_32x92_8_c: 28070.2
vvc_alf_classify_32x92_8_avx2: 5849.2
vvc_alf_classify_32x92_10_c: 27514.2
vvc_alf_classify_32x92_10_avx2: 4841.7
vvc_alf_classify_32x96_8_c: 29203.7
vvc_alf_classify_32x96_8_avx2: 6033.0
vvc_alf_classify_32x96_10_c: 28716.7
vvc_alf_classify_32x96_10_avx2: 5008.5
vvc_alf_classify_32x100_8_c: 30348.5
vvc_alf_classify_32x100_8_avx2: 6331.0
vvc_alf_classify_32x100_10_c: 29793.5
vvc_alf_classify_32x100_10_avx2: 5240.7
vvc_alf_classify_32x104_8_c: 31537.7
vvc_alf_classify_32x104_8_avx2: 7049.2
vvc_alf_classify_32x104_10_c: 31032.7
vvc_alf_classify_32x104_10_avx2: 5539.7
vvc_alf_classify_32x108_8_c: 32654.7
vvc_alf_classify_32x108_8_avx2: 7017.5
vvc_alf_classify_32x108_10_c: 33944.5
vvc_alf_classify_32x108_10_avx2: 5695.7
vvc_alf_classify_32x112_8_c: 33961.7
vvc_alf_classify_32x112_8_avx2: 7023.5
vvc_alf_classify_32x112_10_c: 33351.7
vvc_alf_classify_32x112_10_avx2: 5880.5
vvc_alf_classify_32x116_8_c: 35124.0
vvc_alf_classify_32x116_8_avx2: 7574.2
vvc_alf_classify_32x116_10_c: 34633.2
vvc_alf_classify_32x116_10_avx2: 6179.0
vvc_alf_classify_32x120_8_c: 36341.7
vvc_alf_classify_32x120_8_avx2: 7746.2
vvc_alf_classify_32x120_10_c: 35714.0
vvc_alf_classify_32x120_10_avx2: 6318.2
vvc_alf_classify_32x124_8_c: 38506.0
vvc_alf_classify_32x124_8_avx2: 7850.7
vvc_alf_classify_32x124_10_c: 36915.0
vvc_alf_classify_32x124_10_avx2: 6644.5
vvc_alf_classify_32x128_8_c: 67019.2
vvc_alf_classify_32x128_8_avx2: 8028.2
vvc_alf_classify_32x128_10_c: 38049.0
vvc_alf_classify_32x128_10_avx2: 6859.7
vvc_alf_classify_36x4_8_c: 2410.5
vvc_alf_classify_36x4_8_avx2: 543.5
vvc_alf_classify_36x4_10_c: 2116.0
vvc_alf_classify_36x4_10_avx2: 501.5
vvc_alf_classify_36x8_8_c: 3724.5
vvc_alf_classify_36x8_8_avx2: 772.7
vvc_alf_classify_36x8_10_c: 3506.7
vvc_alf_classify_36x8_10_avx2: 633.5
vvc_alf_classify_36x12_8_c: 4817.7
vvc_alf_classify_36x12_8_avx2: 1081.7
vvc_alf_classify_36x12_10_c: 4725.2
vvc_alf_classify_36x12_10_avx2: 964.0
vvc_alf_classify_36x16_8_c: 6283.7
vvc_alf_classify_36x16_8_avx2: 1264.2
vvc_alf_classify_36x16_10_c: 5963.2
vvc_alf_classify_36x16_10_avx2: 1076.5
vvc_alf_classify_36x20_8_c: 7663.2
vvc_alf_classify_36x20_8_avx2: 1609.0
vvc_alf_classify_36x20_10_c: 7244.0
vvc_alf_classify_36x20_10_avx2: 1383.2
vvc_alf_classify_36x24_8_c: 8761.7
vvc_alf_classify_36x24_8_avx2: 1790.7
vvc_alf_classify_36x24_10_c: 8529.2
vvc_alf_classify_36x24_10_avx2: 1521.0
vvc_alf_classify_36x28_8_c: 10089.2
vvc_alf_classify_36x28_8_avx2: 2214.2
vvc_alf_classify_36x28_10_c: 9837.7
vvc_alf_classify_36x28_10_avx2: 1937.7
vvc_alf_classify_36x32_8_c: 11397.7
vvc_alf_classify_36x32_8_avx2: 2668.5
vvc_alf_classify_36x32_10_c: 14978.5
vvc_alf_classify_36x32_10_avx2: 2916.2
vvc_alf_classify_36x36_8_c: 12735.2
vvc_alf_classify_36x36_8_avx2: 2749.0
vvc_alf_classify_36x36_10_c: 12434.2
vvc_alf_classify_36x36_10_avx2: 2336.5
vvc_alf_classify_36x40_8_c: 14084.5
vvc_alf_classify_36x40_8_avx2: 2933.0
vvc_alf_classify_36x40_10_c: 13740.0
vvc_alf_classify_36x40_10_avx2: 2475.7
vvc_alf_classify_36x44_8_c: 15419.0
vvc_alf_classify_36x44_8_avx2: 3363.0
vvc_alf_classify_36x44_10_c: 15023.5
vvc_alf_classify_36x44_10_avx2: 2781.7
vvc_alf_classify_36x48_8_c: 16695.5
vvc_alf_classify_36x48_8_avx2: 9654.0
vvc_alf_classify_36x48_10_c: 16299.2
vvc_alf_classify_36x48_10_avx2: 2927.7
vvc_alf_classify_36x52_8_c: 18018.0
vvc_alf_classify_36x52_8_avx2: 3806.5
vvc_alf_classify_36x52_10_c: 17572.0
vvc_alf_classify_36x52_10_avx2: 3301.2
vvc_alf_classify_36x56_8_c: 19315.2
vvc_alf_classify_36x56_8_avx2: 4000.7
vvc_alf_classify_36x56_10_c: 18855.7
vvc_alf_classify_36x56_10_avx2: 3398.5
vvc_alf_classify_36x60_8_c: 20690.0
vvc_alf_classify_36x60_8_avx2: 4368.7
vvc_alf_classify_36x60_10_c: 20216.2
vvc_alf_classify_36x60_10_avx2: 3792.7
vvc_alf_classify_36x64_8_c: 22015.5
vvc_alf_classify_36x64_8_avx2: 4555.0
vvc_alf_classify_36x64_10_c: 21487.5
vvc_alf_classify_36x64_10_avx2: 3849.7
vvc_alf_classify_36x68_8_c: 23267.2
vvc_alf_classify_36x68_8_avx2: 4905.0
vvc_alf_classify_36x68_10_c: 22714.0
vvc_alf_classify_36x68_10_avx2: 4169.7
vvc_alf_classify_36x72_8_c: 24612.0
vvc_alf_classify_36x72_8_avx2: 5092.5
vvc_alf_classify_36x72_10_c: 24062.5
vvc_alf_classify_36x72_10_avx2: 4315.0
vvc_alf_classify_36x76_8_c: 26001.7
vvc_alf_classify_36x76_8_avx2: 7126.2
vvc_alf_classify_36x76_10_c: 25349.2
vvc_alf_classify_36x76_10_avx2: 4625.0
vvc_alf_classify_36x80_8_c: 27225.2
vvc_alf_classify_36x80_8_avx2: 5617.5
vvc_alf_classify_36x80_10_c: 26705.5
vvc_alf_classify_36x80_10_avx2: 4766.5
vvc_alf_classify_36x84_8_c: 28567.0
vvc_alf_classify_36x84_8_avx2: 5972.7
vvc_alf_classify_36x84_10_c: 28726.5
vvc_alf_classify_36x84_10_avx2: 5063.5
vvc_alf_classify_36x88_8_c: 29915.7
vvc_alf_classify_36x88_8_avx2: 6155.2
vvc_alf_classify_36x88_10_c: 30048.7
vvc_alf_classify_36x88_10_avx2: 5210.2
vvc_alf_classify_36x92_8_c: 31168.2
vvc_alf_classify_36x92_8_avx2: 6854.5
vvc_alf_classify_36x92_10_c: 30626.2
vvc_alf_classify_36x92_10_avx2: 5526.7
vvc_alf_classify_36x96_8_c: 32525.0
vvc_alf_classify_36x96_8_avx2: 6683.2
vvc_alf_classify_36x96_10_c: 31923.2
vvc_alf_classify_36x96_10_avx2: 5685.2
vvc_alf_classify_36x100_8_c: 34694.0
vvc_alf_classify_36x100_8_avx2: 9107.7
vvc_alf_classify_36x100_10_c: 33254.0
vvc_alf_classify_36x100_10_avx2: 6504.5
vvc_alf_classify_36x104_8_c: 35172.5
vvc_alf_classify_36x104_8_avx2: 9890.5
vvc_alf_classify_36x104_10_c: 64638.0
vvc_alf_classify_36x104_10_avx2: 6124.7
vvc_alf_classify_36x108_8_c: 36582.0
vvc_alf_classify_36x108_8_avx2: 7629.7
vvc_alf_classify_36x108_10_c: 36721.0
vvc_alf_classify_36x108_10_avx2: 6473.2
vvc_alf_classify_36x112_8_c: 37802.0
vvc_alf_classify_36x112_8_avx2: 7798.7
vvc_alf_classify_36x112_10_c: 71670.5
vvc_alf_classify_36x112_10_avx2: 6648.2
vvc_alf_classify_36x116_8_c: 39173.0
vvc_alf_classify_36x116_8_avx2: 8202.2
vvc_alf_classify_36x116_10_c: 39524.7
vvc_alf_classify_36x116_10_avx2: 7047.2
vvc_alf_classify_36x120_8_c: 41516.0
vvc_alf_classify_36x120_8_avx2: 8604.5
vvc_alf_classify_36x120_10_c: 39835.0
vvc_alf_classify_36x120_10_avx2: 7417.0
vvc_alf_classify_36x124_8_c: 42846.7
vvc_alf_classify_36x124_8_avx2: 10122.2
vvc_alf_classify_36x124_10_c: 41129.2
vvc_alf_classify_36x124_10_avx2: 7602.0
vvc_alf_classify_36x128_8_c: 43040.7
vvc_alf_classify_36x128_8_avx2: 8924.0
vvc_alf_classify_36x128_10_c: 42391.5
vvc_alf_classify_36x128_10_avx2: 7787.7
vvc_alf_classify_40x4_8_c: 2649.5
vvc_alf_classify_40x4_8_avx2: 552.2
vvc_alf_classify_40x4_10_c: 2318.5
vvc_alf_classify_40x4_10_avx2: 502.2
vvc_alf_classify_40x8_8_c: 3960.2
vvc_alf_classify_40x8_8_avx2: 733.2
vvc_alf_classify_40x8_10_c: 3741.7
vvc_alf_classify_40x8_10_avx2: 637.7
vvc_alf_classify_40x12_8_c: 5294.2
vvc_alf_classify_40x12_8_avx2: 1085.5
vvc_alf_classify_40x12_10_c: 5158.7
vvc_alf_classify_40x12_10_avx2: 967.7
vvc_alf_classify_40x16_8_c: 6916.0
vvc_alf_classify_40x16_8_avx2: 1268.0
vvc_alf_classify_40x16_10_c: 6594.5
vvc_alf_classify_40x16_10_avx2: 1087.5
vvc_alf_classify_40x20_8_c: 8402.7
vvc_alf_classify_40x20_8_avx2: 1629.0
vvc_alf_classify_40x20_10_c: 8017.7
vvc_alf_classify_40x20_10_avx2: 1392.2
vvc_alf_classify_40x24_8_c: 9651.5
vvc_alf_classify_40x24_8_avx2: 1800.2
vvc_alf_classify_40x24_10_c: 9426.0
vvc_alf_classify_40x24_10_avx2: 1531.5
vvc_alf_classify_40x28_8_c: 11395.2
vvc_alf_classify_40x28_8_avx2: 2224.7
vvc_alf_classify_40x28_10_c: 10799.0
vvc_alf_classify_40x28_10_avx2: 1953.7
vvc_alf_classify_40x32_8_c: 12789.5
vvc_alf_classify_40x32_8_avx2: 2678.5
vvc_alf_classify_40x32_10_c: 16857.5
vvc_alf_classify_40x32_10_avx2: 2157.0
vvc_alf_classify_40x36_8_c: 14054.7
vvc_alf_classify_40x36_8_avx2: 2760.2
vvc_alf_classify_40x36_10_c: 13709.2
vvc_alf_classify_40x36_10_avx2: 2347.0
vvc_alf_classify_40x40_8_c: 15489.0
vvc_alf_classify_40x40_8_avx2: 2942.5
vvc_alf_classify_40x40_10_c: 15090.7
vvc_alf_classify_40x40_10_avx2: 2612.0
vvc_alf_classify_40x44_8_c: 16967.2
vvc_alf_classify_40x44_8_avx2: 3302.2
vvc_alf_classify_40x44_10_c: 16514.5
vvc_alf_classify_40x44_10_avx2: 2794.5
vvc_alf_classify_40x48_8_c: 26976.5
vvc_alf_classify_40x48_8_avx2: 9696.5
vvc_alf_classify_40x48_10_c: 17966.7
vvc_alf_classify_40x48_10_avx2: 3013.0
vvc_alf_classify_40x52_8_c: 19828.2
vvc_alf_classify_40x52_8_avx2: 3834.0
vvc_alf_classify_40x52_10_c: 19325.7
vvc_alf_classify_40x52_10_avx2: 3338.5
vvc_alf_classify_40x56_8_c: 21271.5
vvc_alf_classify_40x56_8_avx2: 4021.7
vvc_alf_classify_40x56_10_c: 21445.0
vvc_alf_classify_40x56_10_avx2: 3406.7
vvc_alf_classify_40x60_8_c: 22737.7
vvc_alf_classify_40x60_8_avx2: 4376.2
vvc_alf_classify_40x60_10_c: 22215.7
vvc_alf_classify_40x60_10_avx2: 4047.0
vvc_alf_classify_40x64_8_c: 24652.5
vvc_alf_classify_40x64_8_avx2: 4566.2
vvc_alf_classify_40x64_10_c: 23704.2
vvc_alf_classify_40x64_10_avx2: 3869.0
vvc_alf_classify_40x68_8_c: 26322.2
vvc_alf_classify_40x68_8_avx2: 4939.0
vvc_alf_classify_40x68_10_c: 25080.5
vvc_alf_classify_40x68_10_avx2: 4190.7
vvc_alf_classify_40x72_8_c: 27159.7
vvc_alf_classify_40x72_8_avx2: 5121.5
vvc_alf_classify_40x72_10_c: 26473.7
vvc_alf_classify_40x72_10_avx2: 4589.0
vvc_alf_classify_40x76_8_c: 28565.5
vvc_alf_classify_40x76_8_avx2: 6863.5
vvc_alf_classify_40x76_10_c: 27863.5
vvc_alf_classify_40x76_10_avx2: 4644.2
vvc_alf_classify_40x80_8_c: 30042.5
vvc_alf_classify_40x80_8_avx2: 5689.0
vvc_alf_classify_40x80_10_c: 29329.7
vvc_alf_classify_40x80_10_avx2: 4794.0
vvc_alf_classify_40x84_8_c: 31592.0
vvc_alf_classify_40x84_8_avx2: 5999.0
vvc_alf_classify_40x84_10_c: 32422.5
vvc_alf_classify_40x84_10_avx2: 5090.5
vvc_alf_classify_40x88_8_c: 32943.7
vvc_alf_classify_40x88_8_avx2: 6529.7
vvc_alf_classify_40x88_10_c: 33863.0
vvc_alf_classify_40x88_10_avx2: 5238.5
vvc_alf_classify_40x92_8_c: 34382.5
vvc_alf_classify_40x92_8_avx2: 6716.7
vvc_alf_classify_40x92_10_c: 33669.7
vvc_alf_classify_40x92_10_avx2: 5557.2
vvc_alf_classify_40x96_8_c: 35925.2
vvc_alf_classify_40x96_8_avx2: 6719.0
vvc_alf_classify_40x96_10_c: 36098.0
vvc_alf_classify_40x96_10_avx2: 5710.7
vvc_alf_classify_40x100_8_c: 37341.0
vvc_alf_classify_40x100_8_avx2: 7070.5
vvc_alf_classify_40x100_10_c: 37602.0
vvc_alf_classify_40x100_10_avx2: 6039.0
vvc_alf_classify_40x104_8_c: 38805.7
vvc_alf_classify_40x104_8_avx2: 7258.7
vvc_alf_classify_40x104_10_c: 39000.5
vvc_alf_classify_40x104_10_avx2: 6165.7
vvc_alf_classify_40x108_8_c: 40170.7
vvc_alf_classify_40x108_8_avx2: 7649.0
vvc_alf_classify_40x108_10_c: 39418.0
vvc_alf_classify_40x108_10_avx2: 6523.0
vvc_alf_classify_40x112_8_c: 41707.0
vvc_alf_classify_40x112_8_avx2: 7844.7
vvc_alf_classify_40x112_10_c: 92090.5
vvc_alf_classify_40x112_10_avx2: 6701.2
vvc_alf_classify_40x116_8_c: 48145.5
vvc_alf_classify_40x116_8_avx2: 8430.5
vvc_alf_classify_40x116_10_c: 43498.7
vvc_alf_classify_40x116_10_avx2: 7109.0
vvc_alf_classify_40x120_8_c: 44681.2
vvc_alf_classify_40x120_8_avx2: 8687.5
vvc_alf_classify_40x120_10_c: 69010.7
vvc_alf_classify_40x120_10_avx2: 7246.2
vvc_alf_classify_40x124_8_c: 95709.0
vvc_alf_classify_40x124_8_avx2: 8795.7
vvc_alf_classify_40x124_10_c: 46376.5
vvc_alf_classify_40x124_10_avx2: 7640.7
vvc_alf_classify_40x128_8_c: 47594.5
vvc_alf_classify_40x128_8_avx2: 9196.5
vvc_alf_classify_40x128_10_c: 46446.2
vvc_alf_classify_40x128_10_avx2: 7808.5
vvc_alf_classify_44x4_8_c: 4501.5
vvc_alf_classify_44x4_8_avx2: 556.0
vvc_alf_classify_44x4_10_c: 2544.2
vvc_alf_classify_44x4_10_avx2: 497.2
vvc_alf_classify_44x8_8_c: 4198.2
vvc_alf_classify_44x8_8_avx2: 758.5
vvc_alf_classify_44x8_10_c: 4091.0
vvc_alf_classify_44x8_10_avx2: 637.2
vvc_alf_classify_44x12_8_c: 6121.0
vvc_alf_classify_44x12_8_avx2: 1093.0
vvc_alf_classify_44x12_10_c: 5634.0
vvc_alf_classify_44x12_10_avx2: 976.7
vvc_alf_classify_44x16_8_c: 7561.2
vvc_alf_classify_44x16_8_avx2: 1278.2
vvc_alf_classify_44x16_10_c: 7175.5
vvc_alf_classify_44x16_10_avx2: 1084.0
vvc_alf_classify_44x20_8_c: 17157.0
vvc_alf_classify_44x20_8_avx2: 1632.0
vvc_alf_classify_44x20_10_c: 8728.0
vvc_alf_classify_44x20_10_avx2: 9631.2
vvc_alf_classify_44x24_8_c: 10555.5
vvc_alf_classify_44x24_8_avx2: 1807.0
vvc_alf_classify_44x24_10_c: 10261.2
vvc_alf_classify_44x24_10_avx2: 1533.0
vvc_alf_classify_44x28_8_c: 12429.5
vvc_alf_classify_44x28_8_avx2: 2239.0
vvc_alf_classify_44x28_10_c: 12145.0
vvc_alf_classify_44x28_10_avx2: 1972.7
vvc_alf_classify_44x32_8_c: 13739.7
vvc_alf_classify_44x32_8_avx2: 2425.7
vvc_alf_classify_44x32_10_c: 13375.7
vvc_alf_classify_44x32_10_avx2: 2103.0
vvc_alf_classify_44x36_8_c: 15328.2
vvc_alf_classify_44x36_8_avx2: 2781.2
vvc_alf_classify_44x36_10_c: 14929.7
vvc_alf_classify_44x36_10_avx2: 2368.5
vvc_alf_classify_44x40_8_c: 16936.0
vvc_alf_classify_44x40_8_avx2: 3030.5
vvc_alf_classify_44x40_10_c: 16478.0
vvc_alf_classify_44x40_10_avx2: 2508.5
vvc_alf_classify_44x44_8_c: 18484.2
vvc_alf_classify_44x44_8_avx2: 3407.7
vvc_alf_classify_44x44_10_c: 18053.7
vvc_alf_classify_44x44_10_avx2: 2819.0
vvc_alf_classify_44x48_8_c: 20096.5
vvc_alf_classify_44x48_8_avx2: 5928.0
vvc_alf_classify_44x48_10_c: 19579.0
vvc_alf_classify_44x48_10_avx2: 2964.2
vvc_alf_classify_44x52_8_c: 21637.2
vvc_alf_classify_44x52_8_avx2: 3855.5
vvc_alf_classify_44x52_10_c: 21147.0
vvc_alf_classify_44x52_10_avx2: 3356.7
vvc_alf_classify_44x56_8_c: 23266.5
vvc_alf_classify_44x56_8_avx2: 4053.7
vvc_alf_classify_44x56_10_c: 22671.5
vvc_alf_classify_44x56_10_avx2: 3439.5
vvc_alf_classify_44x60_8_c: 24811.0
vvc_alf_classify_44x60_8_avx2: 4527.0
vvc_alf_classify_44x60_10_c: 24184.7
vvc_alf_classify_44x60_10_avx2: 3758.0
vvc_alf_classify_44x64_8_c: 26430.0
vvc_alf_classify_44x64_8_avx2: 4610.7
vvc_alf_classify_44x64_10_c: 25782.0
vvc_alf_classify_44x64_10_avx2: 3912.2
vvc_alf_classify_44x68_8_c: 29482.5
vvc_alf_classify_44x68_8_avx2: 4960.7
vvc_alf_classify_44x68_10_c: 27418.7
vvc_alf_classify_44x68_10_avx2: 4224.2
vvc_alf_classify_44x72_8_c: 29607.5
vvc_alf_classify_44x72_8_avx2: 5144.0
vvc_alf_classify_44x72_10_c: 28970.7
vvc_alf_classify_44x72_10_avx2: 4363.5
vvc_alf_classify_44x76_8_c: 31137.7
vvc_alf_classify_44x76_8_avx2: 7238.0
vvc_alf_classify_44x76_10_c: 31328.7
vvc_alf_classify_44x76_10_avx2: 4695.0
vvc_alf_classify_44x80_8_c: 32779.7
vvc_alf_classify_44x80_8_avx2: 5692.7
vvc_alf_classify_44x80_10_c: 32152.7
vvc_alf_classify_44x80_10_avx2: 4960.0
vvc_alf_classify_44x84_8_c: 34326.5
vvc_alf_classify_44x84_8_avx2: 6049.5
vvc_alf_classify_44x84_10_c: 35506.7
vvc_alf_classify_44x84_10_avx2: 5138.7
vvc_alf_classify_44x88_8_c: 35976.7
vvc_alf_classify_44x88_8_avx2: 6567.7
vvc_alf_classify_44x88_10_c: 35217.2
vvc_alf_classify_44x88_10_avx2: 5289.2
vvc_alf_classify_44x92_8_c: 38601.0
vvc_alf_classify_44x92_8_avx2: 6751.0
vvc_alf_classify_44x92_10_c: 36839.7
vvc_alf_classify_44x92_10_avx2: 5606.5
vvc_alf_classify_44x96_8_c: 52745.5
vvc_alf_classify_44x96_8_avx2: 6772.5
vvc_alf_classify_44x96_10_c: 71567.2
vvc_alf_classify_44x96_10_avx2: 5907.2
vvc_alf_classify_44x100_8_c: 41777.5
vvc_alf_classify_44x100_8_avx2: 7133.0
vvc_alf_classify_44x100_10_c: 41089.0
vvc_alf_classify_44x100_10_avx2: 6064.5
vvc_alf_classify_44x104_8_c: 42395.0
vvc_alf_classify_44x104_8_avx2: 7311.7
vvc_alf_classify_44x104_10_c: 77076.5
vvc_alf_classify_44x104_10_avx2: 6368.2
vvc_alf_classify_44x108_8_c: 43981.2
vvc_alf_classify_44x108_8_avx2: 7697.5
vvc_alf_classify_44x108_10_c: 43128.0
vvc_alf_classify_44x108_10_avx2: 6578.2
vvc_alf_classify_44x112_8_c: 45534.5
vvc_alf_classify_44x112_8_avx2: 7888.0
vvc_alf_classify_44x112_10_c: 45932.7
vvc_alf_classify_44x112_10_avx2: 6765.2
vvc_alf_classify_44x116_8_c: 47275.0
vvc_alf_classify_44x116_8_avx2: 8303.5
vvc_alf_classify_44x116_10_c: 47532.2
vvc_alf_classify_44x116_10_avx2: 7132.2
vvc_alf_classify_44x120_8_c: 48868.7
vvc_alf_classify_44x120_8_avx2: 8948.5
vvc_alf_classify_44x120_10_c: 47850.0
vvc_alf_classify_44x120_10_avx2: 7306.5
vvc_alf_classify_44x124_8_c: 53115.5
vvc_alf_classify_44x124_8_avx2: 8924.0
vvc_alf_classify_44x124_10_c: 49986.2
vvc_alf_classify_44x124_10_avx2: 7671.5
vvc_alf_classify_44x128_8_c: 52051.5
vvc_alf_classify_44x128_8_avx2: 9042.2
vvc_alf_classify_44x128_10_c: 51696.0
vvc_alf_classify_44x128_10_avx2: 17807.2
vvc_alf_classify_48x4_8_c: 3143.5
vvc_alf_classify_48x4_8_avx2: 703.2
vvc_alf_classify_48x4_10_c: 2737.7
vvc_alf_classify_48x4_10_avx2: 586.5
vvc_alf_classify_48x8_8_c: 4549.0
vvc_alf_classify_48x8_8_avx2: 937.2
vvc_alf_classify_48x8_10_c: 4553.7
vvc_alf_classify_48x8_10_avx2: 769.0
vvc_alf_classify_48x12_8_c: 6429.2
vvc_alf_classify_48x12_8_avx2: 1349.0
vvc_alf_classify_48x12_10_c: 6273.2
vvc_alf_classify_48x12_10_avx2: 1172.5
vvc_alf_classify_48x16_8_c: 8193.0
vvc_alf_classify_48x16_8_avx2: 1585.2
vvc_alf_classify_48x16_10_c: 7807.0
vvc_alf_classify_48x16_10_avx2: 1331.2
vvc_alf_classify_48x20_8_c: 10251.0
vvc_alf_classify_48x20_8_avx2: 2003.5
vvc_alf_classify_48x20_10_c: 9447.5
vvc_alf_classify_48x20_10_avx2: 9912.5
vvc_alf_classify_48x24_8_c: 11419.5
vvc_alf_classify_48x24_8_avx2: 2235.2
vvc_alf_classify_48x24_10_c: 11424.2
vvc_alf_classify_48x24_10_avx2: 1866.5
vvc_alf_classify_48x28_8_c: 13205.7
vvc_alf_classify_48x28_8_avx2: 2642.7
vvc_alf_classify_48x28_10_c: 12837.2
vvc_alf_classify_48x28_10_avx2: 2232.2
vvc_alf_classify_48x32_8_c: 26485.7
vvc_alf_classify_48x32_8_avx2: 2895.0
vvc_alf_classify_48x32_10_c: 14525.2
vvc_alf_classify_48x32_10_avx2: 2473.5
vvc_alf_classify_48x36_8_c: 16583.0
vvc_alf_classify_48x36_8_avx2: 3313.5
vvc_alf_classify_48x36_10_c: 23623.7
vvc_alf_classify_48x36_10_avx2: 3972.5
vvc_alf_classify_48x40_8_c: 18331.5
vvc_alf_classify_48x40_8_avx2: 3554.2
vvc_alf_classify_48x40_10_c: 17877.2
vvc_alf_classify_48x40_10_avx2: 3018.2
vvc_alf_classify_48x44_8_c: 20040.5
vvc_alf_classify_48x44_8_avx2: 3972.5
vvc_alf_classify_48x44_10_c: 19598.2
vvc_alf_classify_48x44_10_avx2: 3299.5
vvc_alf_classify_48x48_8_c: 21781.0
vvc_alf_classify_48x48_8_avx2: 7116.0
vvc_alf_classify_48x48_10_c: 21293.2
vvc_alf_classify_48x48_10_avx2: 3556.2
vvc_alf_classify_48x52_8_c: 23545.7
vvc_alf_classify_48x52_8_avx2: 4627.2
vvc_alf_classify_48x52_10_c: 22884.5
vvc_alf_classify_48x52_10_avx2: 3838.5
vvc_alf_classify_48x56_8_c: 25240.7
vvc_alf_classify_48x56_8_avx2: 4890.7
vvc_alf_classify_48x56_10_c: 24615.2
vvc_alf_classify_48x56_10_avx2: 4055.2
vvc_alf_classify_48x60_8_c: 26960.2
vvc_alf_classify_48x60_8_avx2: 5295.0
vvc_alf_classify_48x60_10_c: 26313.7
vvc_alf_classify_48x60_10_avx2: 4404.5
vvc_alf_classify_48x64_8_c: 28666.0
vvc_alf_classify_48x64_8_avx2: 5558.7
vvc_alf_classify_48x64_10_c: 27977.2
vvc_alf_classify_48x64_10_avx2: 4566.7
vvc_alf_classify_48x68_8_c: 30411.0
vvc_alf_classify_48x68_8_avx2: 5934.7
vvc_alf_classify_48x68_10_c: 29682.7
vvc_alf_classify_48x68_10_avx2: 4932.5
vvc_alf_classify_48x72_8_c: 40354.7
vvc_alf_classify_48x72_8_avx2: 6214.7
vvc_alf_classify_48x72_10_c: 31432.7
vvc_alf_classify_48x72_10_avx2: 5120.7
vvc_alf_classify_48x76_8_c: 33815.5
vvc_alf_classify_48x76_8_avx2: 6785.2
vvc_alf_classify_48x76_10_c: 33106.7
vvc_alf_classify_48x76_10_avx2: 5484.2
vvc_alf_classify_48x80_8_c: 35575.2
vvc_alf_classify_48x80_8_avx2: 6821.0
vvc_alf_classify_48x80_10_c: 34751.0
vvc_alf_classify_48x80_10_avx2: 5822.0
vvc_alf_classify_48x84_8_c: 37262.0
vvc_alf_classify_48x84_8_avx2: 7482.2
vvc_alf_classify_48x84_10_c: 52635.5
vvc_alf_classify_48x84_10_avx2: 6094.0
vvc_alf_classify_48x88_8_c: 39039.5
vvc_alf_classify_48x88_8_avx2: 7874.7
vvc_alf_classify_48x88_10_c: 39220.5
vvc_alf_classify_48x88_10_avx2: 6298.2
vvc_alf_classify_48x92_8_c: 40761.2
vvc_alf_classify_48x92_8_avx2: 7922.5
vvc_alf_classify_48x92_10_c: 41033.7
vvc_alf_classify_48x92_10_avx2: 6712.2
vvc_alf_classify_48x96_8_c: 42540.2
vvc_alf_classify_48x96_8_avx2: 8176.2
vvc_alf_classify_48x96_10_c: 52250.7
vvc_alf_classify_48x96_10_avx2: 14817.2
vvc_alf_classify_48x100_8_c: 44212.7
vvc_alf_classify_48x100_8_avx2: 9316.2
vvc_alf_classify_48x100_10_c: 44433.7
vvc_alf_classify_48x100_10_avx2: 7335.5
vvc_alf_classify_48x104_8_c: 45995.7
vvc_alf_classify_48x104_8_avx2: 9066.5
vvc_alf_classify_48x104_10_c: 44958.2
vvc_alf_classify_48x104_10_avx2: 7500.7
vvc_alf_classify_48x108_8_c: 47680.0
vvc_alf_classify_48x108_8_avx2: 9231.5
vvc_alf_classify_48x108_10_c: 47952.0
vvc_alf_classify_48x108_10_avx2: 7934.2
vvc_alf_classify_48x112_8_c: 49484.5
vvc_alf_classify_48x112_8_avx2: 9456.2
vvc_alf_classify_48x112_10_c: 49713.5
vvc_alf_classify_48x112_10_avx2: 8127.2
vvc_alf_classify_48x116_8_c: 51270.2
vvc_alf_classify_48x116_8_avx2: 9944.2
vvc_alf_classify_48x116_10_c: 51405.7
vvc_alf_classify_48x116_10_avx2: 8536.0
vvc_alf_classify_48x120_8_c: 52977.7
vvc_alf_classify_48x120_8_avx2: 10223.2
vvc_alf_classify_48x120_10_c: 51797.5
vvc_alf_classify_48x120_10_avx2: 8768.2
vvc_alf_classify_48x124_8_c: 56032.0
vvc_alf_classify_48x124_8_avx2: 10860.5
vvc_alf_classify_48x124_10_c: 53594.5
vvc_alf_classify_48x124_10_avx2: 9158.5
vvc_alf_classify_48x128_8_c: 56197.7
vvc_alf_classify_48x128_8_avx2: 10849.7
vvc_alf_classify_48x128_10_c: 55097.7
vvc_alf_classify_48x128_10_avx2: 9347.0
vvc_alf_classify_52x4_8_c: 4955.5
vvc_alf_classify_52x4_8_avx2: 742.2
vvc_alf_classify_52x4_10_c: 2937.5
vvc_alf_classify_52x4_10_avx2: 640.2
vvc_alf_classify_52x8_8_c: 5191.5
vvc_alf_classify_52x8_8_avx2: 989.5
vvc_alf_classify_52x8_10_c: 4778.2
vvc_alf_classify_52x8_10_avx2: 830.7
vvc_alf_classify_52x12_8_c: 6754.0
vvc_alf_classify_52x12_8_avx2: 1461.5
vvc_alf_classify_52x12_10_c: 6577.5
vvc_alf_classify_52x12_10_avx2: 1283.5
vvc_alf_classify_52x16_8_c: 19243.7
vvc_alf_classify_52x16_8_avx2: 1700.5
vvc_alf_classify_52x16_10_c: 8391.5
vvc_alf_classify_52x16_10_avx2: 1446.5
vvc_alf_classify_52x20_8_c: 10467.0
vvc_alf_classify_52x20_8_avx2: 2224.2
vvc_alf_classify_52x20_10_c: 10221.2
vvc_alf_classify_52x20_10_avx2: 1905.5
vvc_alf_classify_52x24_8_c: 12339.0
vvc_alf_classify_52x24_8_avx2: 2491.2
vvc_alf_classify_52x24_10_c: 12622.7
vvc_alf_classify_52x24_10_avx2: 2095.2
vvc_alf_classify_52x28_8_c: 14197.0
vvc_alf_classify_52x28_8_avx2: 2936.0
vvc_alf_classify_52x28_10_c: 13860.5
vvc_alf_classify_52x28_10_avx2: 2513.0
vvc_alf_classify_52x32_8_c: 31290.5
vvc_alf_classify_52x32_8_avx2: 3186.7
vvc_alf_classify_52x32_10_c: 23000.0
vvc_alf_classify_52x32_10_avx2: 2685.0
vvc_alf_classify_52x36_8_c: 17915.2
vvc_alf_classify_52x36_8_avx2: 3651.0
vvc_alf_classify_52x36_10_c: 17448.2
vvc_alf_classify_52x36_10_avx2: 4415.5
vvc_alf_classify_52x40_8_c: 19768.0
vvc_alf_classify_52x40_8_avx2: 3899.7
vvc_alf_classify_52x40_10_c: 19243.0
vvc_alf_classify_52x40_10_avx2: 3287.5
vvc_alf_classify_52x44_8_c: 21639.5
vvc_alf_classify_52x44_8_avx2: 4371.0
vvc_alf_classify_52x44_10_c: 21100.2
vvc_alf_classify_52x44_10_avx2: 3687.5
vvc_alf_classify_52x48_8_c: 23510.7
vvc_alf_classify_52x48_8_avx2: 4614.5
vvc_alf_classify_52x48_10_c: 22895.5
vvc_alf_classify_52x48_10_avx2: 3876.5
vvc_alf_classify_52x52_8_c: 25365.7
vvc_alf_classify_52x52_8_avx2: 13366.7
vvc_alf_classify_52x52_10_c: 24681.5
vvc_alf_classify_52x52_10_avx2: 4296.5
vvc_alf_classify_52x56_8_c: 27864.5
vvc_alf_classify_52x56_8_avx2: 5337.5
vvc_alf_classify_52x56_10_c: 26472.5
vvc_alf_classify_52x56_10_avx2: 4518.5
vvc_alf_classify_52x60_8_c: 29038.5
vvc_alf_classify_52x60_8_avx2: 5818.7
vvc_alf_classify_52x60_10_c: 28356.2
vvc_alf_classify_52x60_10_avx2: 4917.5
vvc_alf_classify_52x64_8_c: 30848.7
vvc_alf_classify_52x64_8_avx2: 6059.7
vvc_alf_classify_52x64_10_c: 30126.5
vvc_alf_classify_52x64_10_avx2: 5084.5
vvc_alf_classify_52x68_8_c: 32760.5
vvc_alf_classify_52x68_8_avx2: 6517.0
vvc_alf_classify_52x68_10_c: 32049.2
vvc_alf_classify_52x68_10_avx2: 5516.2
vvc_alf_classify_52x72_8_c: 34608.0
vvc_alf_classify_52x72_8_avx2: 14938.0
vvc_alf_classify_52x72_10_c: 33837.2
vvc_alf_classify_52x72_10_avx2: 5722.5
vvc_alf_classify_52x76_8_c: 36504.7
vvc_alf_classify_52x76_8_avx2: 7409.2
vvc_alf_classify_52x76_10_c: 35682.5
vvc_alf_classify_52x76_10_avx2: 6141.0
vvc_alf_classify_52x80_8_c: 39394.0
vvc_alf_classify_52x80_8_avx2: 7482.2
vvc_alf_classify_52x80_10_c: 37561.5
vvc_alf_classify_52x80_10_avx2: 6672.7
vvc_alf_classify_52x84_8_c: 40214.0
vvc_alf_classify_52x84_8_avx2: 8228.7
vvc_alf_classify_52x84_10_c: 39395.5
vvc_alf_classify_52x84_10_avx2: 6864.2
vvc_alf_classify_52x88_8_c: 43282.7
vvc_alf_classify_52x88_8_avx2: 8458.5
vvc_alf_classify_52x88_10_c: 41324.2
vvc_alf_classify_52x88_10_avx2: 7058.5
vvc_alf_classify_52x92_8_c: 43975.2
vvc_alf_classify_52x92_8_avx2: 8942.5
vvc_alf_classify_52x92_10_c: 43035.5
vvc_alf_classify_52x92_10_avx2: 7503.7
vvc_alf_classify_52x96_8_c: 95769.7
vvc_alf_classify_52x96_8_avx2: 8966.5
vvc_alf_classify_52x96_10_c: 46109.2
vvc_alf_classify_52x96_10_avx2: 7730.2
vvc_alf_classify_52x100_8_c: 47693.5
vvc_alf_classify_52x100_8_avx2: 9698.7
vvc_alf_classify_52x100_10_c: 46808.7
vvc_alf_classify_52x100_10_avx2: 8168.2
vvc_alf_classify_52x104_8_c: 49524.0
vvc_alf_classify_52x104_8_avx2: 9676.0
vvc_alf_classify_52x104_10_c: 48575.2
vvc_alf_classify_52x104_10_avx2: 8846.5
vvc_alf_classify_52x108_8_c: 51498.7
vvc_alf_classify_52x108_8_avx2: 10391.7
vvc_alf_classify_52x108_10_c: 51799.0
vvc_alf_classify_52x108_10_avx2: 8842.0
vvc_alf_classify_52x112_8_c: 53450.7
vvc_alf_classify_52x112_8_avx2: 10373.7
vvc_alf_classify_52x112_10_c: 55156.7
vvc_alf_classify_52x112_10_avx2: 9064.5
vvc_alf_classify_52x116_8_c: 55332.5
vvc_alf_classify_52x116_8_avx2: 10907.7
vvc_alf_classify_52x116_10_c: 55580.0
vvc_alf_classify_52x116_10_avx2: 9549.5
vvc_alf_classify_52x120_8_c: 57152.5
vvc_alf_classify_52x120_8_avx2: 11123.0
vvc_alf_classify_52x120_10_c: 55924.5
vvc_alf_classify_52x120_10_avx2: 9758.0
vvc_alf_classify_52x124_8_c: 60613.7
vvc_alf_classify_52x124_8_avx2: 11901.5
vvc_alf_classify_52x124_10_c: 57656.5
vvc_alf_classify_52x124_10_avx2: 10189.7
vvc_alf_classify_52x128_8_c: 60976.5
vvc_alf_classify_52x128_8_avx2: 11867.7
vvc_alf_classify_52x128_10_c: 59470.0
vvc_alf_classify_52x128_10_avx2: 10417.7
vvc_alf_classify_56x4_8_c: 6350.0
vvc_alf_classify_56x4_8_avx2: 751.7
vvc_alf_classify_56x4_10_c: 3149.7
vvc_alf_classify_56x4_10_avx2: 641.0
vvc_alf_classify_56x8_8_c: 5411.2
vvc_alf_classify_56x8_8_avx2: 994.5
vvc_alf_classify_56x8_10_c: 5112.7
vvc_alf_classify_56x8_10_avx2: 859.7
vvc_alf_classify_56x12_8_c: 7241.7
vvc_alf_classify_56x12_8_avx2: 1464.5
vvc_alf_classify_56x12_10_c: 7075.7
vvc_alf_classify_56x12_10_avx2: 1288.7
vvc_alf_classify_56x16_8_c: 9484.0
vvc_alf_classify_56x16_8_avx2: 1701.2
vvc_alf_classify_56x16_10_c: 8985.0
vvc_alf_classify_56x16_10_avx2: 1440.0
vvc_alf_classify_56x20_8_c: 11515.5
vvc_alf_classify_56x20_8_avx2: 2222.7
vvc_alf_classify_56x20_10_c: 11241.0
vvc_alf_classify_56x20_10_avx2: 1915.7
vvc_alf_classify_56x24_8_c: 13215.5
vvc_alf_classify_56x24_8_avx2: 2481.0
vvc_alf_classify_56x24_10_c: 13210.2
vvc_alf_classify_56x24_10_avx2: 2099.7
vvc_alf_classify_56x28_8_c: 15271.0
vvc_alf_classify_56x28_8_avx2: 2942.0
vvc_alf_classify_56x28_10_c: 14850.7
vvc_alf_classify_56x28_10_avx2: 2531.5
vvc_alf_classify_56x32_8_c: 17194.2
vvc_alf_classify_56x32_8_avx2: 3181.7
vvc_alf_classify_56x32_10_c: 16787.0
vvc_alf_classify_56x32_10_avx2: 2696.2
vvc_alf_classify_56x36_8_c: 19196.2
vvc_alf_classify_56x36_8_avx2: 3665.0
vvc_alf_classify_56x36_10_c: 18702.2
vvc_alf_classify_56x36_10_avx2: 3124.5
vvc_alf_classify_56x40_8_c: 21149.5
vvc_alf_classify_56x40_8_avx2: 3906.2
vvc_alf_classify_56x40_10_c: 20653.5
vvc_alf_classify_56x40_10_avx2: 3295.0
vvc_alf_classify_56x44_8_c: 23154.0
vvc_alf_classify_56x44_8_avx2: 4381.5
vvc_alf_classify_56x44_10_c: 22548.5
vvc_alf_classify_56x44_10_avx2: 3709.7
vvc_alf_classify_56x48_8_c: 25235.5
vvc_alf_classify_56x48_8_avx2: 4627.2
vvc_alf_classify_56x48_10_c: 24548.7
vvc_alf_classify_56x48_10_avx2: 3898.0
vvc_alf_classify_56x52_8_c: 27202.7
vvc_alf_classify_56x52_8_avx2: 5094.0
vvc_alf_classify_56x52_10_c: 36011.7
vvc_alf_classify_56x52_10_avx2: 4326.2
vvc_alf_classify_56x56_8_c: 29131.7
vvc_alf_classify_56x56_8_avx2: 5365.0
vvc_alf_classify_56x56_10_c: 28410.7
vvc_alf_classify_56x56_10_avx2: 4520.0
vvc_alf_classify_56x60_8_c: 31166.7
vvc_alf_classify_56x60_8_avx2: 5828.2
vvc_alf_classify_56x60_10_c: 30405.7
vvc_alf_classify_56x60_10_avx2: 4928.0
vvc_alf_classify_56x64_8_c: 33207.2
vvc_alf_classify_56x64_8_avx2: 6102.2
vvc_alf_classify_56x64_10_c: 32368.0
vvc_alf_classify_56x64_10_avx2: 5235.2
vvc_alf_classify_56x68_8_c: 35095.0
vvc_alf_classify_56x68_8_avx2: 6556.5
vvc_alf_classify_56x68_10_c: 34307.7
vvc_alf_classify_56x68_10_avx2: 5536.5
vvc_alf_classify_56x72_8_c: 37044.0
vvc_alf_classify_56x72_8_avx2: 6794.7
vvc_alf_classify_56x72_10_c: 36262.7
vvc_alf_classify_56x72_10_avx2: 5735.2
vvc_alf_classify_56x76_8_c: 39156.5
vvc_alf_classify_56x76_8_avx2: 7480.0
vvc_alf_classify_56x76_10_c: 64912.7
vvc_alf_classify_56x76_10_avx2: 6179.0
vvc_alf_classify_56x80_8_c: 41115.7
vvc_alf_classify_56x80_8_avx2: 7537.5
vvc_alf_classify_56x80_10_c: 40226.5
vvc_alf_classify_56x80_10_avx2: 6361.5
vvc_alf_classify_56x84_8_c: 43101.7
vvc_alf_classify_56x84_8_avx2: 8252.2
vvc_alf_classify_56x84_10_c: 44485.2
vvc_alf_classify_56x84_10_avx2: 6888.7
vvc_alf_classify_56x88_8_c: 45161.7
vvc_alf_classify_56x88_8_avx2: 8501.7
vvc_alf_classify_56x88_10_c: 45322.7
vvc_alf_classify_56x88_10_avx2: 7070.5
vvc_alf_classify_56x92_8_c: 47111.2
vvc_alf_classify_56x92_8_avx2: 8978.7
vvc_alf_classify_56x92_10_c: 46129.0
vvc_alf_classify_56x92_10_avx2: 7551.5
vvc_alf_classify_56x96_8_c: 49168.0
vvc_alf_classify_56x96_8_avx2: 9066.2
vvc_alf_classify_56x96_10_c: 61295.7
vvc_alf_classify_56x96_10_avx2: 7757.7
vvc_alf_classify_56x100_8_c: 51162.2
vvc_alf_classify_56x100_8_avx2: 9601.0
vvc_alf_classify_56x100_10_c: 50049.0
vvc_alf_classify_56x100_10_avx2: 8227.7
vvc_alf_classify_56x104_8_c: 53067.0
vvc_alf_classify_56x104_8_avx2: 10090.5
vvc_alf_classify_56x104_10_c: 51965.7
vvc_alf_classify_56x104_10_avx2: 8437.7
vvc_alf_classify_56x108_8_c: 93589.0
vvc_alf_classify_56x108_8_avx2: 10726.7
vvc_alf_classify_56x108_10_c: 55358.5
vvc_alf_classify_56x108_10_avx2: 8900.2
vvc_alf_classify_56x112_8_c: 57206.7
vvc_alf_classify_56x112_8_avx2: 10511.5
vvc_alf_classify_56x112_10_c: 55839.0
vvc_alf_classify_56x112_10_avx2: 9109.2
vvc_alf_classify_56x116_8_c: 59168.2
vvc_alf_classify_56x116_8_avx2: 10926.5
vvc_alf_classify_56x116_10_c: 59343.7
vvc_alf_classify_56x116_10_avx2: 9588.2
vvc_alf_classify_56x120_8_c: 61240.0
vvc_alf_classify_56x120_8_avx2: 11207.2
vvc_alf_classify_56x120_10_c: 59814.7
vvc_alf_classify_56x120_10_avx2: 9802.0
vvc_alf_classify_56x124_8_c: 66683.7
vvc_alf_classify_56x124_8_avx2: 11974.5
vvc_alf_classify_56x124_10_c: 61689.7
vvc_alf_classify_56x124_10_avx2: 10218.2
vvc_alf_classify_56x128_8_c: 65126.5
vvc_alf_classify_56x128_8_avx2: 11909.5
vvc_alf_classify_56x128_10_c: 63622.2
vvc_alf_classify_56x128_10_avx2: 10463.2
vvc_alf_classify_60x4_8_c: 11662.5
vvc_alf_classify_60x4_8_avx2: 755.5
vvc_alf_classify_60x4_10_c: 3397.0
vvc_alf_classify_60x4_10_avx2: 651.2
vvc_alf_classify_60x8_8_c: 5912.5
vvc_alf_classify_60x8_8_avx2: 996.7
vvc_alf_classify_60x8_10_c: 5475.2
vvc_alf_classify_60x8_10_avx2: 829.2
vvc_alf_classify_60x12_8_c: 7911.2
vvc_alf_classify_60x12_8_avx2: 1472.7
vvc_alf_classify_60x12_10_c: 7515.0
vvc_alf_classify_60x12_10_avx2: 1304.0
vvc_alf_classify_60x16_8_c: 10115.7
vvc_alf_classify_60x16_8_avx2: 1706.5
vvc_alf_classify_60x16_10_c: 9589.7
vvc_alf_classify_60x16_10_avx2: 1454.7
vvc_alf_classify_60x20_8_c: 12611.7
vvc_alf_classify_60x20_8_avx2: 2243.5
vvc_alf_classify_60x20_10_c: 11694.2
vvc_alf_classify_60x20_10_avx2: 1927.7
vvc_alf_classify_60x24_8_c: 14107.7
vvc_alf_classify_60x24_8_avx2: 2498.0
vvc_alf_classify_60x24_10_c: 13725.0
vvc_alf_classify_60x24_10_avx2: 2112.2
vvc_alf_classify_60x28_8_c: 16247.0
vvc_alf_classify_60x28_8_avx2: 2959.7
vvc_alf_classify_60x28_10_c: 15802.5
vvc_alf_classify_60x28_10_avx2: 2539.0
vvc_alf_classify_60x32_8_c: 18336.7
vvc_alf_classify_60x32_8_avx2: 3204.0
vvc_alf_classify_60x32_10_c: 17889.7
vvc_alf_classify_60x32_10_avx2: 2715.5
vvc_alf_classify_60x36_8_c: 20486.5
vvc_alf_classify_60x36_8_avx2: 3688.0
vvc_alf_classify_60x36_10_c: 19951.0
vvc_alf_classify_60x36_10_avx2: 4284.7
vvc_alf_classify_60x40_8_c: 22606.7
vvc_alf_classify_60x40_8_avx2: 3930.2
vvc_alf_classify_60x40_10_c: 22034.7
vvc_alf_classify_60x40_10_avx2: 3334.2
vvc_alf_classify_60x44_8_c: 25381.7
vvc_alf_classify_60x44_8_avx2: 4401.5
vvc_alf_classify_60x44_10_c: 24098.2
vvc_alf_classify_60x44_10_avx2: 3827.0
vvc_alf_classify_60x48_8_c: 26876.7
vvc_alf_classify_60x48_8_avx2: 4776.0
vvc_alf_classify_60x48_10_c: 26170.0
vvc_alf_classify_60x48_10_avx2: 3914.5
vvc_alf_classify_60x52_8_c: 28988.5
vvc_alf_classify_60x52_8_avx2: 5129.7
vvc_alf_classify_60x52_10_c: 28241.0
vvc_alf_classify_60x52_10_avx2: 4352.2
vvc_alf_classify_60x56_8_c: 31052.7
vvc_alf_classify_60x56_8_avx2: 5381.5
vvc_alf_classify_60x56_10_c: 30352.7
vvc_alf_classify_60x56_10_avx2: 4549.7
vvc_alf_classify_60x60_8_c: 33250.5
vvc_alf_classify_60x60_8_avx2: 5883.2
vvc_alf_classify_60x60_10_c: 32453.5
vvc_alf_classify_60x60_10_avx2: 4949.0
vvc_alf_classify_60x64_8_c: 35382.5
vvc_alf_classify_60x64_8_avx2: 6120.2
vvc_alf_classify_60x64_10_c: 34573.7
vvc_alf_classify_60x64_10_avx2: 5267.2
vvc_alf_classify_60x68_8_c: 37432.5
vvc_alf_classify_60x68_8_avx2: 6585.7
vvc_alf_classify_60x68_10_c: 36710.2
vvc_alf_classify_60x68_10_avx2: 5587.0
vvc_alf_classify_60x72_8_c: 39538.5
vvc_alf_classify_60x72_8_avx2: 7002.0
vvc_alf_classify_60x72_10_c: 38736.5
vvc_alf_classify_60x72_10_avx2: 5773.2
vvc_alf_classify_60x76_8_c: 41805.2
vvc_alf_classify_60x76_8_avx2: 7503.5
vvc_alf_classify_60x76_10_c: 41977.7
vvc_alf_classify_60x76_10_avx2: 6191.0
vvc_alf_classify_60x80_8_c: 43911.2
vvc_alf_classify_60x80_8_avx2: 7530.5
vvc_alf_classify_60x80_10_c: 42902.2
vvc_alf_classify_60x80_10_avx2: 6397.2
vvc_alf_classify_60x84_8_c: 46103.7
vvc_alf_classify_60x84_8_avx2: 8303.2
vvc_alf_classify_60x84_10_c: 46241.0
vvc_alf_classify_60x84_10_avx2: 6914.7
vvc_alf_classify_60x88_8_c: 48194.0
vvc_alf_classify_60x88_8_avx2: 8536.7
vvc_alf_classify_60x88_10_c: 47123.7
vvc_alf_classify_60x88_10_avx2: 7135.2
vvc_alf_classify_60x92_8_c: 50299.2
vvc_alf_classify_60x92_8_avx2: 9026.2
vvc_alf_classify_60x92_10_c: 49260.2
vvc_alf_classify_60x92_10_avx2: 7627.5
vvc_alf_classify_60x96_8_c: 52484.7
vvc_alf_classify_60x96_8_avx2: 9049.7
vvc_alf_classify_60x96_10_c: 51410.2
vvc_alf_classify_60x96_10_avx2: 7785.5
vvc_alf_classify_60x100_8_c: 54701.7
vvc_alf_classify_60x100_8_avx2: 9515.2
vvc_alf_classify_60x100_10_c: 61687.5
vvc_alf_classify_60x100_10_avx2: 8264.2
vvc_alf_classify_60x104_8_c: 56808.5
vvc_alf_classify_60x104_8_avx2: 9735.0
vvc_alf_classify_60x104_10_c: 58579.2
vvc_alf_classify_60x104_10_avx2: 8493.5
vvc_alf_classify_60x108_8_c: 59031.2
vvc_alf_classify_60x108_8_avx2: 10243.5
vvc_alf_classify_60x108_10_c: 57776.5
vvc_alf_classify_60x108_10_avx2: 8988.0
vvc_alf_classify_60x112_8_c: 61161.0
vvc_alf_classify_60x112_8_avx2: 19378.7
vvc_alf_classify_60x112_10_c: 59857.2
vvc_alf_classify_60x112_10_avx2: 9403.5
vvc_alf_classify_60x116_8_c: 63339.2
vvc_alf_classify_60x116_8_avx2: 11263.0
vvc_alf_classify_60x116_10_c: 108271.7
vvc_alf_classify_60x116_10_avx2: 9629.2
vvc_alf_classify_60x120_8_c: 65533.7
vvc_alf_classify_60x120_8_avx2: 11261.5
vvc_alf_classify_60x120_10_c: 63974.5
vvc_alf_classify_60x120_10_avx2: 9869.7
vvc_alf_classify_60x124_8_c: 128422.0
vvc_alf_classify_60x124_8_avx2: 12019.2
vvc_alf_classify_60x124_10_c: 65994.0
vvc_alf_classify_60x124_10_avx2: 10267.2
vvc_alf_classify_60x128_8_c: 90041.5
vvc_alf_classify_60x128_8_avx2: 12029.2
vvc_alf_classify_60x128_10_c: 68045.7
vvc_alf_classify_60x128_10_avx2: 12642.0
vvc_alf_classify_64x4_8_c: 3723.0
vvc_alf_classify_64x4_8_avx2: 871.0
vvc_alf_classify_64x4_10_c: 3592.7
vvc_alf_classify_64x4_10_avx2: 756.2
vvc_alf_classify_64x8_8_c: 5952.0
vvc_alf_classify_64x8_8_avx2: 1179.2
vvc_alf_classify_64x8_10_c: 5804.5
vvc_alf_classify_64x8_10_avx2: 967.0
vvc_alf_classify_64x12_8_c: 8222.5
vvc_alf_classify_64x12_8_avx2: 1734.0
vvc_alf_classify_64x12_10_c: 7983.5
vvc_alf_classify_64x12_10_avx2: 1499.5
vvc_alf_classify_64x16_8_c: 18657.7
vvc_alf_classify_64x16_8_avx2: 2030.5
vvc_alf_classify_64x16_10_c: 19251.0
vvc_alf_classify_64x16_10_avx2: 1699.0
vvc_alf_classify_64x20_8_c: 22643.2
vvc_alf_classify_64x20_8_avx2: 2597.0
vvc_alf_classify_64x20_10_c: 12420.2
vvc_alf_classify_64x20_10_avx2: 2186.0
vvc_alf_classify_64x24_8_c: 14990.2
vvc_alf_classify_64x24_8_avx2: 2894.2
vvc_alf_classify_64x24_10_c: 14601.5
vvc_alf_classify_64x24_10_avx2: 2477.2
vvc_alf_classify_64x28_8_c: 17265.0
vvc_alf_classify_64x28_8_avx2: 3422.2
vvc_alf_classify_64x28_10_c: 16790.7
vvc_alf_classify_64x28_10_avx2: 2880.7
vvc_alf_classify_64x32_8_c: 19616.0
vvc_alf_classify_64x32_8_avx2: 3724.5
vvc_alf_classify_64x32_10_c: 19511.7
vvc_alf_classify_64x32_10_avx2: 3105.7
vvc_alf_classify_64x36_8_c: 21791.2
vvc_alf_classify_64x36_8_avx2: 4250.5
vvc_alf_classify_64x36_10_c: 21212.7
vvc_alf_classify_64x36_10_avx2: 4861.7
vvc_alf_classify_64x40_8_c: 24067.0
vvc_alf_classify_64x40_8_avx2: 4558.5
vvc_alf_classify_64x40_10_c: 23391.5
vvc_alf_classify_64x40_10_avx2: 3793.0
vvc_alf_classify_64x44_8_c: 26300.2
vvc_alf_classify_64x44_8_avx2: 5098.5
vvc_alf_classify_64x44_10_c: 25601.7
vvc_alf_classify_64x44_10_avx2: 4381.0
vvc_alf_classify_64x48_8_c: 28551.5
vvc_alf_classify_64x48_8_avx2: 16879.5
vvc_alf_classify_64x48_10_c: 27861.2
vvc_alf_classify_64x48_10_avx2: 4515.2
vvc_alf_classify_64x52_8_c: 30856.2
vvc_alf_classify_64x52_8_avx2: 5891.5
vvc_alf_classify_64x52_10_c: 30032.0
vvc_alf_classify_64x52_10_avx2: 4925.7
vvc_alf_classify_64x56_8_c: 33136.5
vvc_alf_classify_64x56_8_avx2: 6249.7
vvc_alf_classify_64x56_10_c: 32272.7
vvc_alf_classify_64x56_10_avx2: 5179.0
vvc_alf_classify_64x60_8_c: 35354.0
vvc_alf_classify_64x60_8_avx2: 6783.7
vvc_alf_classify_64x60_10_c: 34487.2
vvc_alf_classify_64x60_10_avx2: 5625.0
vvc_alf_classify_64x64_8_c: 37661.2
vvc_alf_classify_64x64_8_avx2: 7085.2
vvc_alf_classify_64x64_10_c: 36687.7
vvc_alf_classify_64x64_10_avx2: 6024.5
vvc_alf_classify_64x68_8_c: 39874.5
vvc_alf_classify_64x68_8_avx2: 7678.7
vvc_alf_classify_64x68_10_c: 39001.0
vvc_alf_classify_64x68_10_avx2: 7132.5
vvc_alf_classify_64x72_8_c: 42170.2
vvc_alf_classify_64x72_8_avx2: 8176.2
vvc_alf_classify_64x72_10_c: 41205.2
vvc_alf_classify_64x72_10_avx2: 6690.0
vvc_alf_classify_64x76_8_c: 44412.5
vvc_alf_classify_64x76_8_avx2: 8500.2
vvc_alf_classify_64x76_10_c: 44564.0
vvc_alf_classify_64x76_10_avx2: 7182.0
vvc_alf_classify_64x80_8_c: 46690.2
vvc_alf_classify_64x80_8_avx2: 11504.2
vvc_alf_classify_64x80_10_c: 45674.0
vvc_alf_classify_64x80_10_avx2: 7404.7
vvc_alf_classify_64x84_8_c: 48897.7
vvc_alf_classify_64x84_8_avx2: 9564.7
vvc_alf_classify_64x84_10_c: 49035.0
vvc_alf_classify_64x84_10_avx2: 7923.7
vvc_alf_classify_64x88_8_c: 51226.2
vvc_alf_classify_64x88_8_avx2: 9865.2
vvc_alf_classify_64x88_10_c: 50101.2
vvc_alf_classify_64x88_10_avx2: 8192.0
vvc_alf_classify_64x92_8_c: 53611.5
vvc_alf_classify_64x92_8_avx2: 10117.0
vvc_alf_classify_64x92_10_c: 52247.2
vvc_alf_classify_64x92_10_avx2: 8652.7
vvc_alf_classify_64x96_8_c: 55821.0
vvc_alf_classify_64x96_8_avx2: 19153.0
vvc_alf_classify_64x96_10_c: 54491.7
vvc_alf_classify_64x96_10_avx2: 8941.2
vvc_alf_classify_64x100_8_c: 58148.2
vvc_alf_classify_64x100_8_avx2: 10996.2
vvc_alf_classify_64x100_10_c: 58252.5
vvc_alf_classify_64x100_10_avx2: 9427.5
vvc_alf_classify_64x104_8_c: 60409.0
vvc_alf_classify_64x104_8_avx2: 11382.7
vvc_alf_classify_64x104_10_c: 60470.7
vvc_alf_classify_64x104_10_avx2: 9708.7
vvc_alf_classify_64x108_8_c: 62720.5
vvc_alf_classify_64x108_8_avx2: 11765.0
vvc_alf_classify_64x108_10_c: 73424.5
vvc_alf_classify_64x108_10_avx2: 10192.2
vvc_alf_classify_64x112_8_c: 64955.2
vvc_alf_classify_64x112_8_avx2: 12140.2
vvc_alf_classify_64x112_10_c: 64983.5
vvc_alf_classify_64x112_10_avx2: 10426.7
vvc_alf_classify_64x116_8_c: 67216.7
vvc_alf_classify_64x116_8_avx2: 13101.2
vvc_alf_classify_64x116_10_c: 69119.5
vvc_alf_classify_64x116_10_avx2: 10902.5
vvc_alf_classify_64x120_8_c: 69503.7
vvc_alf_classify_64x120_8_avx2: 13039.0
vvc_alf_classify_64x120_10_c: 67813.2
vvc_alf_classify_64x120_10_avx2: 11182.0
vvc_alf_classify_64x124_8_c: 71656.7
vvc_alf_classify_64x124_8_avx2: 13608.0
vvc_alf_classify_64x124_10_c: 70031.0
vvc_alf_classify_64x124_10_avx2: 11697.0
vvc_alf_classify_64x128_8_c: 73895.0
vvc_alf_classify_64x128_8_avx2: 23036.5
vvc_alf_classify_64x128_10_c: 72049.0
vvc_alf_classify_64x128_10_avx2: 11957.7
vvc_alf_classify_68x4_8_c: 6104.5
vvc_alf_classify_68x4_8_avx2: 929.0
vvc_alf_classify_68x4_10_c: 3801.2
vvc_alf_classify_68x4_10_avx2: 787.0
vvc_alf_classify_68x8_8_c: 6298.2
vvc_alf_classify_68x8_8_avx2: 1232.7
vvc_alf_classify_68x8_10_c: 6138.0
vvc_alf_classify_68x8_10_avx2: 1017.0
vvc_alf_classify_68x12_8_c: 8929.5
vvc_alf_classify_68x12_8_avx2: 1834.0
vvc_alf_classify_68x12_10_c: 9148.2
vvc_alf_classify_68x12_10_avx2: 1610.0
vvc_alf_classify_68x16_8_c: 19903.5
vvc_alf_classify_68x16_8_avx2: 2142.0
vvc_alf_classify_68x16_10_c: 10808.0
vvc_alf_classify_68x16_10_avx2: 1802.7
vvc_alf_classify_68x20_8_c: 13827.2
vvc_alf_classify_68x20_8_avx2: 2750.5
vvc_alf_classify_68x20_10_c: 13162.7
vvc_alf_classify_68x20_10_avx2: 2342.5
vvc_alf_classify_68x24_8_c: 15862.7
vvc_alf_classify_68x24_8_avx2: 3061.7
vvc_alf_classify_68x24_10_c: 15506.0
vvc_alf_classify_68x24_10_avx2: 2576.2
vvc_alf_classify_68x28_8_c: 18326.2
vvc_alf_classify_68x28_8_avx2: 3641.7
vvc_alf_classify_68x28_10_c: 17756.0
vvc_alf_classify_68x28_10_avx2: 3089.2
vvc_alf_classify_68x32_8_c: 20681.0
vvc_alf_classify_68x32_8_avx2: 3935.2
vvc_alf_classify_68x32_10_c: 20153.0
vvc_alf_classify_68x32_10_avx2: 3324.0
vvc_alf_classify_68x36_8_c: 23079.5
vvc_alf_classify_68x36_8_avx2: 5052.5
vvc_alf_classify_68x36_10_c: 22453.2
vvc_alf_classify_68x36_10_avx2: 3839.2
vvc_alf_classify_68x40_8_c: 25528.0
vvc_alf_classify_68x40_8_avx2: 5375.5
vvc_alf_classify_68x40_10_c: 25439.5
vvc_alf_classify_68x40_10_avx2: 4083.5
vvc_alf_classify_68x44_8_c: 27835.7
vvc_alf_classify_68x44_8_avx2: 5425.5
vvc_alf_classify_68x44_10_c: 27156.7
vvc_alf_classify_68x44_10_avx2: 4715.0
vvc_alf_classify_68x48_8_c: 30252.5
vvc_alf_classify_68x48_8_avx2: 5725.5
vvc_alf_classify_68x48_10_c: 29457.7
vvc_alf_classify_68x48_10_avx2: 4934.2
vvc_alf_classify_68x52_8_c: 32636.7
vvc_alf_classify_68x52_8_avx2: 6303.5
vvc_alf_classify_68x52_10_c: 31844.5
vvc_alf_classify_68x52_10_avx2: 5314.5
vvc_alf_classify_68x56_8_c: 35039.2
vvc_alf_classify_68x56_8_avx2: 6623.5
vvc_alf_classify_68x56_10_c: 34209.0
vvc_alf_classify_68x56_10_avx2: 5575.7
vvc_alf_classify_68x60_8_c: 37513.0
vvc_alf_classify_68x60_8_avx2: 7210.5
vvc_alf_classify_68x60_10_c: 36603.7
vvc_alf_classify_68x60_10_avx2: 6089.7
vvc_alf_classify_68x64_8_c: 39852.7
vvc_alf_classify_68x64_8_avx2: 7506.0
vvc_alf_classify_68x64_10_c: 38954.0
vvc_alf_classify_68x64_10_avx2: 6312.2
vvc_alf_classify_68x68_8_c: 42225.2
vvc_alf_classify_68x68_8_avx2: 8175.5
vvc_alf_classify_68x68_10_c: 41316.2
vvc_alf_classify_68x68_10_avx2: 6930.5
vvc_alf_classify_68x72_8_c: 45843.7
vvc_alf_classify_68x72_8_avx2: 8676.7
vvc_alf_classify_68x72_10_c: 43700.5
vvc_alf_classify_68x72_10_avx2: 7206.7
vvc_alf_classify_68x76_8_c: 47006.2
vvc_alf_classify_68x76_8_avx2: 12198.0
vvc_alf_classify_68x76_10_c: 46000.2
vvc_alf_classify_68x76_10_avx2: 7708.7
vvc_alf_classify_68x80_8_c: 49479.2
vvc_alf_classify_68x80_8_avx2: 9338.0
vvc_alf_classify_68x80_10_c: 48364.5
vvc_alf_classify_68x80_10_avx2: 7955.2
vvc_alf_classify_68x84_8_c: 51963.5
vvc_alf_classify_68x84_8_avx2: 10207.0
vvc_alf_classify_68x84_10_c: 50718.5
vvc_alf_classify_68x84_10_avx2: 8750.5
vvc_alf_classify_68x88_8_c: 54344.2
vvc_alf_classify_68x88_8_avx2: 10493.7
vvc_alf_classify_68x88_10_c: 70013.2
vvc_alf_classify_68x88_10_avx2: 8810.7
vvc_alf_classify_68x92_8_c: 56737.5
vvc_alf_classify_68x92_8_avx2: 10814.5
vvc_alf_classify_68x92_10_c: 56925.7
vvc_alf_classify_68x92_10_avx2: 9342.5
vvc_alf_classify_68x96_8_c: 59233.0
vvc_alf_classify_68x96_8_avx2: 11322.5
vvc_alf_classify_68x96_10_c: 59301.2
vvc_alf_classify_68x96_10_avx2: 9627.0
vvc_alf_classify_68x100_8_c: 61642.2
vvc_alf_classify_68x100_8_avx2: 12001.2
vvc_alf_classify_68x100_10_c: 60201.2
vvc_alf_classify_68x100_10_avx2: 10178.7
vvc_alf_classify_68x104_8_c: 64171.0
vvc_alf_classify_68x104_8_avx2: 15589.5
vvc_alf_classify_68x104_10_c: 66096.0
vvc_alf_classify_68x104_10_avx2: 10442.5
vvc_alf_classify_68x108_8_c: 76781.2
vvc_alf_classify_68x108_8_avx2: 12918.5
vvc_alf_classify_68x108_10_c: 64967.2
vvc_alf_classify_68x108_10_avx2: 11000.0
vvc_alf_classify_68x112_8_c: 68881.7
vvc_alf_classify_68x112_8_avx2: 12894.0
vvc_alf_classify_68x112_10_c: 67330.7
vvc_alf_classify_68x112_10_avx2: 11222.7
vvc_alf_classify_68x116_8_c: 71385.0
vvc_alf_classify_68x116_8_avx2: 13935.2
vvc_alf_classify_68x116_10_c: 124259.7
vvc_alf_classify_68x116_10_avx2: 11805.7
vvc_alf_classify_68x120_8_c: 73800.5
vvc_alf_classify_68x120_8_avx2: 13922.2
vvc_alf_classify_68x120_10_c: 71991.0
vvc_alf_classify_68x120_10_avx2: 12118.5
vvc_alf_classify_68x124_8_c: 76190.2
vvc_alf_classify_68x124_8_avx2: 23092.7
vvc_alf_classify_68x124_10_c: 74383.0
vvc_alf_classify_68x124_10_avx2: 12677.2
vvc_alf_classify_68x128_8_c: 78439.2
vvc_alf_classify_68x128_8_avx2: 15155.0
vvc_alf_classify_68x128_10_c: 76557.2
vvc_alf_classify_68x128_10_avx2: 12919.2
vvc_alf_classify_72x4_8_c: 4247.0
vvc_alf_classify_72x4_8_avx2: 927.5
vvc_alf_classify_72x4_10_c: 4021.7
vvc_alf_classify_72x4_10_avx2: 783.2
vvc_alf_classify_72x8_8_c: 6662.2
vvc_alf_classify_72x8_8_avx2: 1225.5
vvc_alf_classify_72x8_10_c: 6474.7
vvc_alf_classify_72x8_10_avx2: 1017.7
vvc_alf_classify_72x12_8_c: 9500.0
vvc_alf_classify_72x12_8_avx2: 1848.0
vvc_alf_classify_72x12_10_c: 8972.2
vvc_alf_classify_72x12_10_avx2: 1618.2
vvc_alf_classify_72x16_8_c: 12019.2
vvc_alf_classify_72x16_8_avx2: 2142.2
vvc_alf_classify_72x16_10_c: 11353.7
vvc_alf_classify_72x16_10_avx2: 1810.7
vvc_alf_classify_72x20_8_c: 14567.5
vvc_alf_classify_72x20_8_avx2: 2832.5
vvc_alf_classify_72x20_10_c: 13850.0
vvc_alf_classify_72x20_10_avx2: 2358.7
vvc_alf_classify_72x24_8_c: 16775.0
vvc_alf_classify_72x24_8_avx2: 3065.5
vvc_alf_classify_72x24_10_c: 16326.7
vvc_alf_classify_72x24_10_avx2: 2586.7
vvc_alf_classify_72x28_8_c: 19343.5
vvc_alf_classify_72x28_8_avx2: 3648.7
vvc_alf_classify_72x28_10_c: 18861.0
vvc_alf_classify_72x28_10_avx2: 3092.5
vvc_alf_classify_72x32_8_c: 21832.2
vvc_alf_classify_72x32_8_avx2: 3946.5
vvc_alf_classify_72x32_10_c: 21221.5
vvc_alf_classify_72x32_10_avx2: 3330.7
vvc_alf_classify_72x36_8_c: 24411.0
vvc_alf_classify_72x36_8_avx2: 4537.7
vvc_alf_classify_72x36_10_c: 23720.7
vvc_alf_classify_72x36_10_avx2: 3865.2
vvc_alf_classify_72x40_8_c: 26833.5
vvc_alf_classify_72x40_8_avx2: 4968.2
vvc_alf_classify_72x40_10_c: 26146.2
vvc_alf_classify_72x40_10_avx2: 4085.7
vvc_alf_classify_72x44_8_c: 29480.0
vvc_alf_classify_72x44_8_avx2: 5421.7
vvc_alf_classify_72x44_10_c: 28680.2
vvc_alf_classify_72x44_10_avx2: 4718.7
vvc_alf_classify_72x48_8_c: 31904.0
vvc_alf_classify_72x48_8_avx2: 5724.0
vvc_alf_classify_72x48_10_c: 31156.2
vvc_alf_classify_72x48_10_avx2: 4823.7
vvc_alf_classify_72x52_8_c: 34512.7
vvc_alf_classify_72x52_8_avx2: 6324.2
vvc_alf_classify_72x52_10_c: 33691.2
vvc_alf_classify_72x52_10_avx2: 5478.0
vvc_alf_classify_72x56_8_c: 37046.0
vvc_alf_classify_72x56_8_avx2: 6809.7
vvc_alf_classify_72x56_10_c: 36104.0
vvc_alf_classify_72x56_10_avx2: 5590.0
vvc_alf_classify_72x60_8_c: 39525.7
vvc_alf_classify_72x60_8_avx2: 7420.7
vvc_alf_classify_72x60_10_c: 39589.5
vvc_alf_classify_72x60_10_avx2: 6112.0
vvc_alf_classify_72x64_8_c: 42244.7
vvc_alf_classify_72x64_8_avx2: 7524.0
vvc_alf_classify_72x64_10_c: 41351.7
vvc_alf_classify_72x64_10_avx2: 6337.0
vvc_alf_classify_72x68_8_c: 53394.0
vvc_alf_classify_72x68_8_avx2: 8198.5
vvc_alf_classify_72x68_10_c: 67545.2
vvc_alf_classify_72x68_10_avx2: 6959.5
vvc_alf_classify_72x72_8_c: 47175.2
vvc_alf_classify_72x72_8_avx2: 11214.5
vvc_alf_classify_72x72_10_c: 48550.5
vvc_alf_classify_72x72_10_avx2: 7231.2
vvc_alf_classify_72x76_8_c: 49661.0
vvc_alf_classify_72x76_8_avx2: 11986.2
vvc_alf_classify_72x76_10_c: 48558.0
vvc_alf_classify_72x76_10_avx2: 7751.7
vvc_alf_classify_72x80_8_c: 52309.0
vvc_alf_classify_72x80_8_avx2: 9370.0
vvc_alf_classify_72x80_10_c: 51034.2
vvc_alf_classify_72x80_10_avx2: 7999.7
vvc_alf_classify_72x84_8_c: 54803.0
vvc_alf_classify_72x84_8_avx2: 9965.0
vvc_alf_classify_72x84_10_c: 53464.7
vvc_alf_classify_72x84_10_avx2: 8562.0
vvc_alf_classify_72x88_8_c: 57452.5
vvc_alf_classify_72x88_8_avx2: 10627.0
vvc_alf_classify_72x88_10_c: 55965.5
vvc_alf_classify_72x88_10_avx2: 8858.5
vvc_alf_classify_72x92_8_c: 59940.5
vvc_alf_classify_72x92_8_avx2: 10843.0
vvc_alf_classify_72x92_10_c: 105877.7
vvc_alf_classify_72x92_10_avx2: 9358.2
vvc_alf_classify_72x96_8_c: 62520.0
vvc_alf_classify_72x96_8_avx2: 11135.0
vvc_alf_classify_72x96_10_c: 114266.5
vvc_alf_classify_72x96_10_avx2: 9707.2
vvc_alf_classify_72x100_8_c: 65064.7
vvc_alf_classify_72x100_8_avx2: 12045.2
vvc_alf_classify_72x100_10_c: 65117.5
vvc_alf_classify_72x100_10_avx2: 10242.0
vvc_alf_classify_72x104_8_c: 67648.0
vvc_alf_classify_72x104_8_avx2: 12035.2
vvc_alf_classify_72x104_10_c: 66391.7
vvc_alf_classify_72x104_10_avx2: 10490.7
vvc_alf_classify_72x108_8_c: 70124.0
vvc_alf_classify_72x108_8_avx2: 12973.5
vvc_alf_classify_72x108_10_c: 68434.5
vvc_alf_classify_72x108_10_avx2: 11000.7
vvc_alf_classify_72x112_8_c: 72658.2
vvc_alf_classify_72x112_8_avx2: 12922.0
vvc_alf_classify_72x112_10_c: 72752.7
vvc_alf_classify_72x112_10_avx2: 11295.7
vvc_alf_classify_72x116_8_c: 75252.0
vvc_alf_classify_72x116_8_avx2: 14020.5
vvc_alf_classify_72x116_10_c: 75308.5
vvc_alf_classify_72x116_10_avx2: 11900.5
vvc_alf_classify_72x120_8_c: 77831.5
vvc_alf_classify_72x120_8_avx2: 13933.5
vvc_alf_classify_72x120_10_c: 75910.2
vvc_alf_classify_72x120_10_avx2: 12162.5
vvc_alf_classify_72x124_8_c: 80310.5
vvc_alf_classify_72x124_8_avx2: 14529.2
vvc_alf_classify_72x124_10_c: 79012.5
vvc_alf_classify_72x124_10_avx2: 12677.7
vvc_alf_classify_72x128_8_c: 84960.0
vvc_alf_classify_72x128_8_avx2: 14841.0
vvc_alf_classify_72x128_10_c: 107239.0
vvc_alf_classify_72x128_10_avx2: 12968.2
vvc_alf_classify_76x4_8_c: 4633.7
vvc_alf_classify_76x4_8_avx2: 932.7
vvc_alf_classify_76x4_10_c: 4272.0
vvc_alf_classify_76x4_10_avx2: 795.0
vvc_alf_classify_76x8_8_c: 7905.5
vvc_alf_classify_76x8_8_avx2: 1234.2
vvc_alf_classify_76x8_10_c: 19211.5
vvc_alf_classify_76x8_10_avx2: 1025.2
vvc_alf_classify_76x12_8_c: 10295.7
vvc_alf_classify_76x12_8_avx2: 1849.5
vvc_alf_classify_76x12_10_c: 9518.2
vvc_alf_classify_76x12_10_avx2: 1619.0
vvc_alf_classify_76x16_8_c: 13146.2
vvc_alf_classify_76x16_8_avx2: 2151.7
vvc_alf_classify_76x16_10_c: 12145.5
vvc_alf_classify_76x16_10_avx2: 1819.0
vvc_alf_classify_76x20_8_c: 25675.5
vvc_alf_classify_76x20_8_avx2: 2772.7
vvc_alf_classify_76x20_10_c: 14780.2
vvc_alf_classify_76x20_10_avx2: 2359.7
vvc_alf_classify_76x24_8_c: 17877.2
vvc_alf_classify_76x24_8_avx2: 3150.0
vvc_alf_classify_76x24_10_c: 17904.0
vvc_alf_classify_76x24_10_avx2: 2592.0
vvc_alf_classify_76x28_8_c: 20605.0
vvc_alf_classify_76x28_8_avx2: 3665.7
vvc_alf_classify_76x28_10_c: 20071.0
vvc_alf_classify_76x28_10_avx2: 3193.2
vvc_alf_classify_76x32_8_c: 23248.5
vvc_alf_classify_76x32_8_avx2: 3963.5
vvc_alf_classify_76x32_10_c: 22641.0
vvc_alf_classify_76x32_10_avx2: 3528.0
vvc_alf_classify_76x36_8_c: 25997.2
vvc_alf_classify_76x36_8_avx2: 4553.5
vvc_alf_classify_76x36_10_c: 25317.5
vvc_alf_classify_76x36_10_avx2: 3878.0
vvc_alf_classify_76x40_8_c: 28701.2
vvc_alf_classify_76x40_8_avx2: 4852.7
vvc_alf_classify_76x40_10_c: 27898.5
vvc_alf_classify_76x40_10_avx2: 5867.7
vvc_alf_classify_76x44_8_c: 31374.5
vvc_alf_classify_76x44_8_avx2: 5759.0
vvc_alf_classify_76x44_10_c: 30566.0
vvc_alf_classify_76x44_10_avx2: 4744.0
vvc_alf_classify_76x48_8_c: 34060.0
vvc_alf_classify_76x48_8_avx2: 5745.7
vvc_alf_classify_76x48_10_c: 34274.7
vvc_alf_classify_76x48_10_avx2: 4833.5
vvc_alf_classify_76x52_8_c: 36723.0
vvc_alf_classify_76x52_8_avx2: 6358.5
vvc_alf_classify_76x52_10_c: 35839.0
vvc_alf_classify_76x52_10_avx2: 5552.7
vvc_alf_classify_76x56_8_c: 39423.7
vvc_alf_classify_76x56_8_avx2: 6663.0
vvc_alf_classify_76x56_10_c: 38493.0
vvc_alf_classify_76x56_10_avx2: 5619.7
vvc_alf_classify_76x60_8_c: 42163.5
vvc_alf_classify_76x60_8_avx2: 7260.5
vvc_alf_classify_76x60_10_c: 41103.7
vvc_alf_classify_76x60_10_avx2: 6841.5
vvc_alf_classify_76x64_8_c: 44916.7
vvc_alf_classify_76x64_8_avx2: 7550.0
vvc_alf_classify_76x64_10_c: 43823.5
vvc_alf_classify_76x64_10_avx2: 6363.7
vvc_alf_classify_76x68_8_c: 47678.0
vvc_alf_classify_76x68_8_avx2: 8216.5
vvc_alf_classify_76x68_10_c: 46482.0
vvc_alf_classify_76x68_10_avx2: 7003.2
vvc_alf_classify_76x72_8_c: 50366.7
vvc_alf_classify_76x72_8_avx2: 11094.2
vvc_alf_classify_76x72_10_c: 49293.7
vvc_alf_classify_76x72_10_avx2: 7271.5
vvc_alf_classify_76x76_8_c: 53078.2
vvc_alf_classify_76x76_8_avx2: 9342.7
vvc_alf_classify_76x76_10_c: 63219.5
vvc_alf_classify_76x76_10_avx2: 7792.7
vvc_alf_classify_76x80_8_c: 55789.7
vvc_alf_classify_76x80_8_avx2: 9410.2
vvc_alf_classify_76x80_10_c: 54511.0
vvc_alf_classify_76x80_10_avx2: 8037.7
vvc_alf_classify_76x84_8_c: 58525.7
vvc_alf_classify_76x84_8_avx2: 10252.0
vvc_alf_classify_76x84_10_c: 57079.5
vvc_alf_classify_76x84_10_avx2: 8603.0
vvc_alf_classify_76x88_8_c: 61157.2
vvc_alf_classify_76x88_8_avx2: 14401.7
vvc_alf_classify_76x88_10_c: 59927.7
vvc_alf_classify_76x88_10_avx2: 8881.5
vvc_alf_classify_76x92_8_c: 72620.2
vvc_alf_classify_76x92_8_avx2: 11391.0
vvc_alf_classify_76x92_10_c: 62475.2
vvc_alf_classify_76x92_10_avx2: 9436.2
vvc_alf_classify_76x96_8_c: 66747.0
vvc_alf_classify_76x96_8_avx2: 11188.5
vvc_alf_classify_76x96_10_c: 65167.5
vvc_alf_classify_76x96_10_avx2: 9749.0
vvc_alf_classify_76x100_8_c: 69424.7
vvc_alf_classify_76x100_8_avx2: 12085.5
vvc_alf_classify_76x100_10_c: 67832.7
vvc_alf_classify_76x100_10_avx2: 10952.5
vvc_alf_classify_76x104_8_c: 72164.5
vvc_alf_classify_76x104_8_avx2: 12072.5
vvc_alf_classify_76x104_10_c: 72270.2
vvc_alf_classify_76x104_10_avx2: 10550.2
vvc_alf_classify_76x108_8_c: 74791.7
vvc_alf_classify_76x108_8_avx2: 12994.0
vvc_alf_classify_76x108_10_c: 130213.7
vvc_alf_classify_76x108_10_avx2: 11073.7
vvc_alf_classify_76x112_8_c: 77550.7
vvc_alf_classify_76x112_8_avx2: 17381.2
vvc_alf_classify_76x112_10_c: 77789.5
vvc_alf_classify_76x112_10_avx2: 11333.0
vvc_alf_classify_76x116_8_c: 80354.5
vvc_alf_classify_76x116_8_avx2: 14416.7
vvc_alf_classify_76x116_10_c: 79035.5
vvc_alf_classify_76x116_10_avx2: 11961.5
vvc_alf_classify_76x120_8_c: 83188.7
vvc_alf_classify_76x120_8_avx2: 13960.2
vvc_alf_classify_76x120_10_c: 81126.7
vvc_alf_classify_76x120_10_avx2: 12201.2
vvc_alf_classify_76x124_8_c: 88152.0
vvc_alf_classify_76x124_8_avx2: 14623.0
vvc_alf_classify_76x124_10_c: 83762.7
vvc_alf_classify_76x124_10_avx2: 12730.0
vvc_alf_classify_76x128_8_c: 88425.2
vvc_alf_classify_76x128_8_avx2: 15309.5
vvc_alf_classify_76x128_10_c: 86329.0
vvc_alf_classify_76x128_10_avx2: 13013.0
vvc_alf_classify_80x4_8_c: 4608.5
vvc_alf_classify_80x4_8_avx2: 1048.2
vvc_alf_classify_80x4_10_c: 4467.0
vvc_alf_classify_80x4_10_avx2: 883.5
vvc_alf_classify_80x8_8_c: 16560.7
vvc_alf_classify_80x8_8_avx2: 1413.0
vvc_alf_classify_80x8_10_c: 7221.7
vvc_alf_classify_80x8_10_avx2: 1156.0
vvc_alf_classify_80x12_8_c: 10551.0
vvc_alf_classify_80x12_8_avx2: 2114.0
vvc_alf_classify_80x12_10_c: 9973.2
vvc_alf_classify_80x12_10_avx2: 1852.5
vvc_alf_classify_80x16_8_c: 13102.2
vvc_alf_classify_80x16_8_avx2: 2544.2
vvc_alf_classify_80x16_10_c: 12781.2
vvc_alf_classify_80x16_10_avx2: 2323.5
vvc_alf_classify_80x20_8_c: 34616.7
vvc_alf_classify_80x20_8_avx2: 3118.2
vvc_alf_classify_80x20_10_c: 15529.2
vvc_alf_classify_80x20_10_avx2: 2718.5
vvc_alf_classify_80x24_8_c: 18748.5
vvc_alf_classify_80x24_8_avx2: 3575.2
vvc_alf_classify_80x24_10_c: 18301.7
vvc_alf_classify_80x24_10_avx2: 2994.0
vvc_alf_classify_80x28_8_c: 21601.5
vvc_alf_classify_80x28_8_avx2: 4112.7
vvc_alf_classify_80x28_10_c: 68371.0
vvc_alf_classify_80x28_10_avx2: 3586.5
vvc_alf_classify_80x32_8_c: 24438.0
vvc_alf_classify_80x32_8_avx2: 4495.2
vvc_alf_classify_80x32_10_c: 23808.5
vvc_alf_classify_80x32_10_avx2: 3755.2
vvc_alf_classify_80x36_8_c: 27255.0
vvc_alf_classify_80x36_8_avx2: 5147.7
vvc_alf_classify_80x36_10_c: 26578.0
vvc_alf_classify_80x36_10_avx2: 12649.5
vvc_alf_classify_80x40_8_c: 30087.7
vvc_alf_classify_80x40_8_avx2: 5485.7
vvc_alf_classify_80x40_10_c: 29355.7
vvc_alf_classify_80x40_10_avx2: 4587.0
vvc_alf_classify_80x44_8_c: 32937.7
vvc_alf_classify_80x44_8_avx2: 6145.5
vvc_alf_classify_80x44_10_c: 32119.2
vvc_alf_classify_80x44_10_avx2: 5275.0
vvc_alf_classify_80x48_8_c: 35763.0
vvc_alf_classify_80x48_8_avx2: 6468.0
vvc_alf_classify_80x48_10_c: 34904.5
vvc_alf_classify_80x48_10_avx2: 5418.7
vvc_alf_classify_80x52_8_c: 39599.2
vvc_alf_classify_80x52_8_avx2: 7174.7
vvc_alf_classify_80x52_10_c: 37653.7
vvc_alf_classify_80x52_10_avx2: 6012.2
vvc_alf_classify_80x56_8_c: 41508.2
vvc_alf_classify_80x56_8_avx2: 7511.2
vvc_alf_classify_80x56_10_c: 40429.2
vvc_alf_classify_80x56_10_avx2: 6298.2
vvc_alf_classify_80x60_8_c: 44284.5
vvc_alf_classify_80x60_8_avx2: 8252.2
vvc_alf_classify_80x60_10_c: 43316.2
vvc_alf_classify_80x60_10_avx2: 6887.2
vvc_alf_classify_80x64_8_c: 47146.2
vvc_alf_classify_80x64_8_avx2: 8620.0
vvc_alf_classify_80x64_10_c: 47253.0
vvc_alf_classify_80x64_10_avx2: 7166.5
vvc_alf_classify_80x68_8_c: 49968.5
vvc_alf_classify_80x68_8_avx2: 9267.2
vvc_alf_classify_80x68_10_c: 48771.7
vvc_alf_classify_80x68_10_avx2: 7760.7
vvc_alf_classify_80x72_8_c: 52813.2
vvc_alf_classify_80x72_8_avx2: 9574.0
vvc_alf_classify_80x72_10_c: 51611.2
vvc_alf_classify_80x72_10_avx2: 8078.7
vvc_alf_classify_80x76_8_c: 55685.5
vvc_alf_classify_80x76_8_avx2: 10497.7
vvc_alf_classify_80x76_10_c: 54412.7
vvc_alf_classify_80x76_10_avx2: 8646.2
vvc_alf_classify_80x80_8_c: 58621.7
vvc_alf_classify_80x80_8_avx2: 13887.2
vvc_alf_classify_80x80_10_c: 124217.0
vvc_alf_classify_80x80_10_avx2: 8955.2
vvc_alf_classify_80x84_8_c: 61433.5
vvc_alf_classify_80x84_8_avx2: 11576.5
vvc_alf_classify_80x84_10_c: 59853.5
vvc_alf_classify_80x84_10_avx2: 9578.5
vvc_alf_classify_80x88_8_c: 71694.5
vvc_alf_classify_80x88_8_avx2: 15040.7
vvc_alf_classify_80x88_10_c: 62628.2
vvc_alf_classify_80x88_10_avx2: 9930.0
vvc_alf_classify_80x92_8_c: 67087.2
vvc_alf_classify_80x92_8_avx2: 12269.7
vvc_alf_classify_80x92_10_c: 116943.5
vvc_alf_classify_80x92_10_avx2: 10532.5
vvc_alf_classify_80x96_8_c: 70031.7
vvc_alf_classify_80x96_8_avx2: 21980.0
vvc_alf_classify_80x96_10_c: 126884.5
vvc_alf_classify_80x96_10_avx2: 10834.7
vvc_alf_classify_80x100_8_c: 72805.7
vvc_alf_classify_80x100_8_avx2: 13629.2
vvc_alf_classify_80x100_10_c: 71001.2
vvc_alf_classify_80x100_10_avx2: 11377.0
vvc_alf_classify_80x104_8_c: 75675.7
vvc_alf_classify_80x104_8_avx2: 13704.7
vvc_alf_classify_80x104_10_c: 73803.5
vvc_alf_classify_80x104_10_avx2: 20744.2
vvc_alf_classify_80x108_8_c: 90007.2
vvc_alf_classify_80x108_8_avx2: 14325.0
vvc_alf_classify_80x108_10_c: 78656.2
vvc_alf_classify_80x108_10_avx2: 12289.2
vvc_alf_classify_80x112_8_c: 81427.5
vvc_alf_classify_80x112_8_avx2: 14605.7
vvc_alf_classify_80x112_10_c: 79553.7
vvc_alf_classify_80x112_10_avx2: 12597.5
vvc_alf_classify_80x116_8_c: 86491.0
vvc_alf_classify_80x116_8_avx2: 16225.5
vvc_alf_classify_80x116_10_c: 84457.0
vvc_alf_classify_80x116_10_avx2: 13196.7
vvc_alf_classify_80x120_8_c: 87295.0
vvc_alf_classify_80x120_8_avx2: 16167.5
vvc_alf_classify_80x120_10_c: 85213.5
vvc_alf_classify_80x120_10_avx2: 13461.2
vvc_alf_classify_80x124_8_c: 90062.7
vvc_alf_classify_80x124_8_avx2: 21437.5
vvc_alf_classify_80x124_10_c: 87712.7
vvc_alf_classify_80x124_10_avx2: 14429.0
vvc_alf_classify_80x128_8_c: 92741.5
vvc_alf_classify_80x128_8_avx2: 16798.0
vvc_alf_classify_80x128_10_c: 90529.0
vvc_alf_classify_80x128_10_avx2: 14266.2
vvc_alf_classify_84x4_8_c: 4834.2
vvc_alf_classify_84x4_8_avx2: 1100.2
vvc_alf_classify_84x4_10_c: 4691.2
vvc_alf_classify_84x4_10_avx2: 936.5
vvc_alf_classify_84x8_8_c: 7791.2
vvc_alf_classify_84x8_8_avx2: 1462.2
vvc_alf_classify_84x8_10_c: 7579.7
vvc_alf_classify_84x8_10_avx2: 1210.5
vvc_alf_classify_84x12_8_c: 10728.2
vvc_alf_classify_84x12_8_avx2: 2217.5
vvc_alf_classify_84x12_10_c: 10465.5
vvc_alf_classify_84x12_10_avx2: 1966.0
vvc_alf_classify_84x16_8_c: 13719.5
vvc_alf_classify_84x16_8_avx2: 2582.2
vvc_alf_classify_84x16_10_c: 13361.5
vvc_alf_classify_84x16_10_avx2: 2304.5
vvc_alf_classify_84x20_8_c: 16677.5
vvc_alf_classify_84x20_8_avx2: 3280.7
vvc_alf_classify_84x20_10_c: 16289.0
vvc_alf_classify_84x20_10_avx2: 2882.0
vvc_alf_classify_84x24_8_c: 19647.5
vvc_alf_classify_84x24_8_avx2: 3735.7
vvc_alf_classify_84x24_10_c: 19155.2
vvc_alf_classify_84x24_10_avx2: 12106.0
vvc_alf_classify_84x28_8_c: 22662.5
vvc_alf_classify_84x28_8_avx2: 4336.0
vvc_alf_classify_84x28_10_c: 22105.5
vvc_alf_classify_84x28_10_avx2: 3726.0
vvc_alf_classify_84x32_8_c: 25594.5
vvc_alf_classify_84x32_8_avx2: 4711.2
vvc_alf_classify_84x32_10_c: 24930.7
vvc_alf_classify_84x32_10_avx2: 3992.0
vvc_alf_classify_84x36_8_c: 28565.7
vvc_alf_classify_84x36_8_avx2: 5409.7
vvc_alf_classify_84x36_10_c: 27801.5
vvc_alf_classify_84x36_10_avx2: 4628.5
vvc_alf_classify_84x40_8_c: 31522.7
vvc_alf_classify_84x40_8_avx2: 5768.0
vvc_alf_classify_84x40_10_c: 30761.7
vvc_alf_classify_84x40_10_avx2: 4866.2
vvc_alf_classify_84x44_8_c: 34457.0
vvc_alf_classify_84x44_8_avx2: 6462.7
vvc_alf_classify_84x44_10_c: 33620.5
vvc_alf_classify_84x44_10_avx2: 5499.0
vvc_alf_classify_84x48_8_c: 37439.2
vvc_alf_classify_84x48_8_avx2: 15042.0
vvc_alf_classify_84x48_10_c: 36518.7
vvc_alf_classify_84x48_10_avx2: 5921.7
vvc_alf_classify_84x52_8_c: 111397.0
vvc_alf_classify_84x52_8_avx2: 7554.5
vvc_alf_classify_84x52_10_c: 39506.5
vvc_alf_classify_84x52_10_avx2: 6420.2
vvc_alf_classify_84x56_8_c: 43379.5
vvc_alf_classify_84x56_8_avx2: 8114.5
vvc_alf_classify_84x56_10_c: 42356.5
vvc_alf_classify_84x56_10_avx2: 6730.7
vvc_alf_classify_84x60_8_c: 46418.5
vvc_alf_classify_84x60_8_avx2: 8665.5
vvc_alf_classify_84x60_10_c: 45283.7
vvc_alf_classify_84x60_10_avx2: 7362.2
vvc_alf_classify_84x64_8_c: 49449.5
vvc_alf_classify_84x64_8_avx2: 9032.0
vvc_alf_classify_84x64_10_c: 57727.5
vvc_alf_classify_84x64_10_avx2: 7647.5
vvc_alf_classify_84x68_8_c: 52378.2
vvc_alf_classify_84x68_8_avx2: 10001.5
vvc_alf_classify_84x68_10_c: 68782.0
vvc_alf_classify_84x68_10_avx2: 8287.2
vvc_alf_classify_84x72_8_c: 55418.0
vvc_alf_classify_84x72_8_avx2: 10108.0
vvc_alf_classify_84x72_10_c: 62207.0
vvc_alf_classify_84x72_10_avx2: 8625.5
vvc_alf_classify_84x76_8_c: 58325.5
vvc_alf_classify_84x76_8_avx2: 11101.0
vvc_alf_classify_84x76_10_c: 103525.0
vvc_alf_classify_84x76_10_avx2: 9262.7
vvc_alf_classify_84x80_8_c: 61449.2
vvc_alf_classify_84x80_8_avx2: 11453.2
vvc_alf_classify_84x80_10_c: 63180.7
vvc_alf_classify_84x80_10_avx2: 9516.0
vvc_alf_classify_84x84_8_c: 64427.2
vvc_alf_classify_84x84_8_avx2: 11870.5
vvc_alf_classify_84x84_10_c: 62809.0
vvc_alf_classify_84x84_10_avx2: 10213.0
vvc_alf_classify_84x88_8_c: 67366.5
vvc_alf_classify_84x88_8_avx2: 12553.5
vvc_alf_classify_84x88_10_c: 65873.5
vvc_alf_classify_84x88_10_avx2: 10563.0
vvc_alf_classify_84x92_8_c: 70472.5
vvc_alf_classify_84x92_8_avx2: 12955.7
vvc_alf_classify_84x92_10_c: 68788.0
vvc_alf_classify_84x92_10_avx2: 11257.0
vvc_alf_classify_84x96_8_c: 73445.2
vvc_alf_classify_84x96_8_avx2: 13321.2
vvc_alf_classify_84x96_10_c: 71600.7
vvc_alf_classify_84x96_10_avx2: 21085.0
vvc_alf_classify_84x100_8_c: 76393.5
vvc_alf_classify_84x100_8_avx2: 14417.7
vvc_alf_classify_84x100_10_c: 74482.7
vvc_alf_classify_84x100_10_avx2: 12231.7
vvc_alf_classify_84x104_8_c: 81407.5
vvc_alf_classify_84x104_8_avx2: 14440.5
vvc_alf_classify_84x104_10_c: 79468.7
vvc_alf_classify_84x104_10_avx2: 12558.7
vvc_alf_classify_84x108_8_c: 82476.0
vvc_alf_classify_84x108_8_avx2: 15129.2
vvc_alf_classify_84x108_10_c: 80524.2
vvc_alf_classify_84x108_10_avx2: 13179.0
vvc_alf_classify_84x112_8_c: 85463.0
vvc_alf_classify_84x112_8_avx2: 15539.5
vvc_alf_classify_84x112_10_c: 85670.7
vvc_alf_classify_84x112_10_avx2: 13443.5
vvc_alf_classify_84x116_8_c: 88564.5
vvc_alf_classify_84x116_8_avx2: 16685.7
vvc_alf_classify_84x116_10_c: 98094.2
vvc_alf_classify_84x116_10_avx2: 14146.2
vvc_alf_classify_84x120_8_c: 91551.5
vvc_alf_classify_84x120_8_avx2: 17045.0
vvc_alf_classify_84x120_10_c: 89213.2
vvc_alf_classify_84x120_10_avx2: 14412.2
vvc_alf_classify_84x124_8_c: 102796.7
vvc_alf_classify_84x124_8_avx2: 17343.2
vvc_alf_classify_84x124_10_c: 92093.0
vvc_alf_classify_84x124_10_avx2: 15010.2
vvc_alf_classify_84x128_8_c: 108483.2
vvc_alf_classify_84x128_8_avx2: 18180.2
vvc_alf_classify_84x128_10_c: 94806.5
vvc_alf_classify_84x128_10_avx2: 42804.0
vvc_alf_classify_88x4_8_c: 13215.2
vvc_alf_classify_88x4_8_avx2: 1100.5
vvc_alf_classify_88x4_10_c: 4861.7
vvc_alf_classify_88x4_10_avx2: 939.5
vvc_alf_classify_88x8_8_c: 8276.0
vvc_alf_classify_88x8_8_avx2: 1464.5
vvc_alf_classify_88x8_10_c: 7813.0
vvc_alf_classify_88x8_10_avx2: 1244.0
vvc_alf_classify_88x12_8_c: 12432.5
vvc_alf_classify_88x12_8_avx2: 2230.0
vvc_alf_classify_88x12_10_c: 10823.5
vvc_alf_classify_88x12_10_avx2: 1966.7
vvc_alf_classify_88x16_8_c: 14203.0
vvc_alf_classify_88x16_8_avx2: 2584.5
vvc_alf_classify_88x16_10_c: 13792.7
vvc_alf_classify_88x16_10_avx2: 2198.7
vvc_alf_classify_88x20_8_c: 17277.0
vvc_alf_classify_88x20_8_avx2: 3374.2
vvc_alf_classify_88x20_10_c: 16822.7
vvc_alf_classify_88x20_10_avx2: 2897.2
vvc_alf_classify_88x24_8_c: 20336.2
vvc_alf_classify_88x24_8_avx2: 3748.7
vvc_alf_classify_88x24_10_c: 19776.7
vvc_alf_classify_88x24_10_avx2: 3083.5
vvc_alf_classify_88x28_8_c: 23446.7
vvc_alf_classify_88x28_8_avx2: 4339.7
vvc_alf_classify_88x28_10_c: 22776.5
vvc_alf_classify_88x28_10_avx2: 3743.0
vvc_alf_classify_88x32_8_c: 26488.7
vvc_alf_classify_88x32_8_avx2: 4715.0
vvc_alf_classify_88x32_10_c: 25773.7
vvc_alf_classify_88x32_10_avx2: 4008.2
vvc_alf_classify_88x36_8_c: 29528.5
vvc_alf_classify_88x36_8_avx2: 5425.5
vvc_alf_classify_88x36_10_c: 28789.0
vvc_alf_classify_88x36_10_avx2: 6275.7
vvc_alf_classify_88x40_8_c: 32608.5
vvc_alf_classify_88x40_8_avx2: 5785.7
vvc_alf_classify_88x40_10_c: 31775.2
vvc_alf_classify_88x40_10_avx2: 4895.2
vvc_alf_classify_88x44_8_c: 35677.2
vvc_alf_classify_88x44_8_avx2: 14706.2
vvc_alf_classify_88x44_10_c: 34771.7
vvc_alf_classify_88x44_10_avx2: 5509.5
vvc_alf_classify_88x48_8_c: 38745.5
vvc_alf_classify_88x48_8_avx2: 6828.5
vvc_alf_classify_88x48_10_c: 37738.7
vvc_alf_classify_88x48_10_avx2: 5938.5
vvc_alf_classify_88x52_8_c: 41818.7
vvc_alf_classify_88x52_8_avx2: 7577.5
vvc_alf_classify_88x52_10_c: 40823.0
vvc_alf_classify_88x52_10_avx2: 6436.7
vvc_alf_classify_88x56_8_c: 50052.5
vvc_alf_classify_88x56_8_avx2: 7957.5
vvc_alf_classify_88x56_10_c: 43728.2
vvc_alf_classify_88x56_10_avx2: 6752.5
vvc_alf_classify_88x60_8_c: 48024.0
vvc_alf_classify_88x60_8_avx2: 8704.2
vvc_alf_classify_88x60_10_c: 46803.0
vvc_alf_classify_88x60_10_avx2: 7386.0
vvc_alf_classify_88x64_8_c: 51067.0
vvc_alf_classify_88x64_8_avx2: 9070.7
vvc_alf_classify_88x64_10_c: 49814.2
vvc_alf_classify_88x64_10_avx2: 7675.0
vvc_alf_classify_88x68_8_c: 54122.5
vvc_alf_classify_88x68_8_avx2: 12731.5
vvc_alf_classify_88x68_10_c: 52772.2
vvc_alf_classify_88x68_10_avx2: 8286.5
vvc_alf_classify_88x72_8_c: 57197.7
vvc_alf_classify_88x72_8_avx2: 10128.2
vvc_alf_classify_88x72_10_c: 55801.7
vvc_alf_classify_88x72_10_avx2: 8611.2
vvc_alf_classify_88x76_8_c: 60319.5
vvc_alf_classify_88x76_8_avx2: 10832.5
vvc_alf_classify_88x76_10_c: 58812.2
vvc_alf_classify_88x76_10_avx2: 9539.0
vvc_alf_classify_88x80_8_c: 63412.2
vvc_alf_classify_88x80_8_avx2: 11550.7
vvc_alf_classify_88x80_10_c: 63446.5
vvc_alf_classify_88x80_10_avx2: 9591.0
vvc_alf_classify_88x84_8_c: 66528.7
vvc_alf_classify_88x84_8_avx2: 12204.2
vvc_alf_classify_88x84_10_c: 64810.0
vvc_alf_classify_88x84_10_avx2: 10278.5
vvc_alf_classify_88x88_8_c: 69608.7
vvc_alf_classify_88x88_8_avx2: 12243.0
vvc_alf_classify_88x88_10_c: 67680.0
vvc_alf_classify_88x88_10_avx2: 10605.5
vvc_alf_classify_88x92_8_c: 72568.0
vvc_alf_classify_88x92_8_avx2: 12984.7
vvc_alf_classify_88x92_10_c: 74913.7
vvc_alf_classify_88x92_10_avx2: 11603.0
vvc_alf_classify_88x96_8_c: 75651.2
vvc_alf_classify_88x96_8_avx2: 13700.7
vvc_alf_classify_88x96_10_c: 75659.2
vvc_alf_classify_88x96_10_avx2: 11612.2
vvc_alf_classify_88x100_8_c: 78813.7
vvc_alf_classify_88x100_8_avx2: 14469.2
vvc_alf_classify_88x100_10_c: 143178.7
vvc_alf_classify_88x100_10_avx2: 12281.0
vvc_alf_classify_88x104_8_c: 82081.5
vvc_alf_classify_88x104_8_avx2: 14475.0
vvc_alf_classify_88x104_10_c: 81947.7
vvc_alf_classify_88x104_10_avx2: 12591.5
vvc_alf_classify_88x108_8_c: 85257.5
vvc_alf_classify_88x108_8_avx2: 19292.7
vvc_alf_classify_88x108_10_c: 85139.0
vvc_alf_classify_88x108_10_avx2: 13218.5
vvc_alf_classify_88x112_8_c: 88309.7
vvc_alf_classify_88x112_8_avx2: 15553.7
vvc_alf_classify_88x112_10_c: 85993.2
vvc_alf_classify_88x112_10_avx2: 13527.5
vvc_alf_classify_88x116_8_c: 91353.5
vvc_alf_classify_88x116_8_avx2: 17198.7
vvc_alf_classify_88x116_10_c: 88953.5
vvc_alf_classify_88x116_10_avx2: 14163.5
vvc_alf_classify_88x120_8_c: 94418.5
vvc_alf_classify_88x120_8_avx2: 17117.2
vvc_alf_classify_88x120_10_c: 91824.7
vvc_alf_classify_88x120_10_avx2: 14419.7
vvc_alf_classify_88x124_8_c: 97452.2
vvc_alf_classify_88x124_8_avx2: 22101.0
vvc_alf_classify_88x124_10_c: 94837.0
vvc_alf_classify_88x124_10_avx2: 15052.5
vvc_alf_classify_88x128_8_c: 100288.0
vvc_alf_classify_88x128_8_avx2: 18212.0
vvc_alf_classify_88x128_10_c: 97639.2
vvc_alf_classify_88x128_10_avx2: 42889.0
vvc_alf_classify_92x4_8_c: 5243.0
vvc_alf_classify_92x4_8_avx2: 1099.0
vvc_alf_classify_92x4_10_c: 5071.7
vvc_alf_classify_92x4_10_avx2: 938.0
vvc_alf_classify_92x8_8_c: 8431.0
vvc_alf_classify_92x8_8_avx2: 1466.7
vvc_alf_classify_92x8_10_c: 8157.5
vvc_alf_classify_92x8_10_avx2: 1214.2
vvc_alf_classify_92x12_8_c: 11618.2
vvc_alf_classify_92x12_8_avx2: 2232.2
vvc_alf_classify_92x12_10_c: 11278.7
vvc_alf_classify_92x12_10_avx2: 1976.5
vvc_alf_classify_92x16_8_c: 15229.2
vvc_alf_classify_92x16_8_avx2: 2593.5
vvc_alf_classify_92x16_10_c: 14390.5
vvc_alf_classify_92x16_10_avx2: 2207.0
vvc_alf_classify_92x20_8_c: 19547.0
vvc_alf_classify_92x20_8_avx2: 3486.2
vvc_alf_classify_92x20_10_c: 19520.5
vvc_alf_classify_92x20_10_avx2: 2902.5
vvc_alf_classify_92x24_8_c: 21806.5
vvc_alf_classify_92x24_8_avx2: 3663.5
vvc_alf_classify_92x24_10_c: 20660.7
vvc_alf_classify_92x24_10_avx2: 3104.2
vvc_alf_classify_92x28_8_c: 24413.5
vvc_alf_classify_92x28_8_avx2: 4364.2
vvc_alf_classify_92x28_10_c: 23760.2
vvc_alf_classify_92x28_10_avx2: 3757.2
vvc_alf_classify_92x32_8_c: 27656.2
vvc_alf_classify_92x32_8_avx2: 4859.5
vvc_alf_classify_92x32_10_c: 26897.5
vvc_alf_classify_92x32_10_avx2: 4017.2
vvc_alf_classify_92x36_8_c: 30896.5
vvc_alf_classify_92x36_8_avx2: 5446.2
vvc_alf_classify_92x36_10_c: 30010.2
vvc_alf_classify_92x36_10_avx2: 4664.5
vvc_alf_classify_92x40_8_c: 43649.2
vvc_alf_classify_92x40_8_avx2: 5799.2
vvc_alf_classify_92x40_10_c: 33145.5
vvc_alf_classify_92x40_10_avx2: 4916.7
vvc_alf_classify_92x44_8_c: 38165.0
vvc_alf_classify_92x44_8_avx2: 6510.2
vvc_alf_classify_92x44_10_c: 36346.7
vvc_alf_classify_92x44_10_avx2: 5533.2
vvc_alf_classify_92x48_8_c: 40482.0
vvc_alf_classify_92x48_8_avx2: 6865.7
vvc_alf_classify_92x48_10_c: 39475.2
vvc_alf_classify_92x48_10_avx2: 5972.0
vvc_alf_classify_92x52_8_c: 43660.5
vvc_alf_classify_92x52_8_avx2: 7607.2
vvc_alf_classify_92x52_10_c: 42521.0
vvc_alf_classify_92x52_10_avx2: 6464.2
vvc_alf_classify_92x56_8_c: 46978.0
vvc_alf_classify_92x56_8_avx2: 7969.2
vvc_alf_classify_92x56_10_c: 45694.7
vvc_alf_classify_92x56_10_avx2: 6747.2
vvc_alf_classify_92x60_8_c: 50130.2
vvc_alf_classify_92x60_8_avx2: 8728.7
vvc_alf_classify_92x60_10_c: 48865.7
vvc_alf_classify_92x60_10_avx2: 7433.7
vvc_alf_classify_92x64_8_c: 53323.2
vvc_alf_classify_92x64_8_avx2: 9094.5
vvc_alf_classify_92x64_10_c: 57975.5
vvc_alf_classify_92x64_10_avx2: 7695.2
vvc_alf_classify_92x68_8_c: 58109.0
vvc_alf_classify_92x68_8_avx2: 9796.7
vvc_alf_classify_92x68_10_c: 55161.2
vvc_alf_classify_92x68_10_avx2: 8335.0
vvc_alf_classify_92x72_8_c: 59800.5
vvc_alf_classify_92x72_8_avx2: 13325.7
vvc_alf_classify_92x72_10_c: 59940.2
vvc_alf_classify_92x72_10_avx2: 8674.5
vvc_alf_classify_92x76_8_c: 63032.5
vvc_alf_classify_92x76_8_avx2: 11160.2
vvc_alf_classify_92x76_10_c: 61517.0
vvc_alf_classify_92x76_10_avx2: 9577.7
vvc_alf_classify_92x80_8_c: 66250.2
vvc_alf_classify_92x80_8_avx2: 11543.0
vvc_alf_classify_92x80_10_c: 64581.2
vvc_alf_classify_92x80_10_avx2: 9616.5
vvc_alf_classify_92x84_8_c: 69468.0
vvc_alf_classify_92x84_8_avx2: 12253.0
vvc_alf_classify_92x84_10_c: 103687.2
vvc_alf_classify_92x84_10_avx2: 10341.7
vvc_alf_classify_92x88_8_c: 72778.2
vvc_alf_classify_92x88_8_avx2: 12306.2
vvc_alf_classify_92x88_10_c: 70857.7
vvc_alf_classify_92x88_10_avx2: 10655.2
vvc_alf_classify_92x92_8_c: 76069.0
vvc_alf_classify_92x92_8_avx2: 13025.0
vvc_alf_classify_92x92_10_c: 75981.7
vvc_alf_classify_92x92_10_avx2: 11340.5
vvc_alf_classify_92x96_8_c: 158890.5
vvc_alf_classify_92x96_8_avx2: 13406.7
vvc_alf_classify_92x96_10_c: 77145.7
vvc_alf_classify_92x96_10_avx2: 11642.7
vvc_alf_classify_92x100_8_c: 82550.5
vvc_alf_classify_92x100_8_avx2: 14139.7
vvc_alf_classify_92x100_10_c: 90021.0
vvc_alf_classify_92x100_10_avx2: 12346.5
vvc_alf_classify_92x104_8_c: 85850.2
vvc_alf_classify_92x104_8_avx2: 14525.5
vvc_alf_classify_92x104_10_c: 93039.7
vvc_alf_classify_92x104_10_avx2: 23445.5
vvc_alf_classify_92x108_8_c: 89110.5
vvc_alf_classify_92x108_8_avx2: 15645.5
vvc_alf_classify_92x108_10_c: 86758.7
vvc_alf_classify_92x108_10_avx2: 13314.5
vvc_alf_classify_92x112_8_c: 92352.0
vvc_alf_classify_92x112_8_avx2: 20589.0
vvc_alf_classify_92x112_10_c: 89840.2
vvc_alf_classify_92x112_10_avx2: 13574.5
vvc_alf_classify_92x116_8_c: 95486.5
vvc_alf_classify_92x116_8_avx2: 16347.0
vvc_alf_classify_92x116_10_c: 95514.2
vvc_alf_classify_92x116_10_avx2: 14225.2
vvc_alf_classify_92x120_8_c: 98601.2
vvc_alf_classify_92x120_8_avx2: 29220.2
vvc_alf_classify_92x120_10_c: 101389.5
vvc_alf_classify_92x120_10_avx2: 14509.7
vvc_alf_classify_92x124_8_c: 101845.2
vvc_alf_classify_92x124_8_avx2: 17927.5
vvc_alf_classify_92x124_10_c: 99274.5
vvc_alf_classify_92x124_10_avx2: 15142.0
vvc_alf_classify_92x128_8_c: 104868.7
vvc_alf_classify_92x128_8_avx2: 18263.0
vvc_alf_classify_92x128_10_c: 102287.5
vvc_alf_classify_92x128_10_avx2: 15463.0
vvc_alf_classify_96x4_8_c: 5453.0
vvc_alf_classify_96x4_8_avx2: 1303.5
vvc_alf_classify_96x4_10_c: 5283.2
vvc_alf_classify_96x4_10_avx2: 1029.5
vvc_alf_classify_96x8_8_c: 8743.0
vvc_alf_classify_96x8_8_avx2: 1646.2
vvc_alf_classify_96x8_10_c: 8506.2
vvc_alf_classify_96x8_10_avx2: 1353.5
vvc_alf_classify_96x12_8_c: 12085.0
vvc_alf_classify_96x12_8_avx2: 2475.7
vvc_alf_classify_96x12_10_c: 11786.5
vvc_alf_classify_96x12_10_avx2: 2141.7
vvc_alf_classify_96x16_8_c: 15816.0
vvc_alf_classify_96x16_8_avx2: 3128.5
vvc_alf_classify_96x16_10_c: 15036.2
vvc_alf_classify_96x16_10_avx2: 2423.5
vvc_alf_classify_96x20_8_c: 18781.2
vvc_alf_classify_96x20_8_avx2: 3749.5
vvc_alf_classify_96x20_10_c: 18261.5
vvc_alf_classify_96x20_10_avx2: 3152.2
vvc_alf_classify_96x24_8_c: 22105.5
vvc_alf_classify_96x24_8_avx2: 4077.5
vvc_alf_classify_96x24_10_c: 21500.2
vvc_alf_classify_96x24_10_avx2: 3388.7
vvc_alf_classify_96x28_8_c: 25427.5
vvc_alf_classify_96x28_8_avx2: 4846.7
vvc_alf_classify_96x28_10_c: 24749.0
vvc_alf_classify_96x28_10_avx2: 4083.5
vvc_alf_classify_96x32_8_c: 28734.7
vvc_alf_classify_96x32_8_avx2: 5399.0
vvc_alf_classify_96x32_10_c: 27983.2
vvc_alf_classify_96x32_10_avx2: 4392.5
vvc_alf_classify_96x36_8_c: 32075.2
vvc_alf_classify_96x36_8_avx2: 5987.7
vvc_alf_classify_96x36_10_c: 31270.2
vvc_alf_classify_96x36_10_avx2: 5046.5
vvc_alf_classify_96x40_8_c: 35479.2
vvc_alf_classify_96x40_8_avx2: 6442.0
vvc_alf_classify_96x40_10_c: 34538.7
vvc_alf_classify_96x40_10_avx2: 14154.7
vvc_alf_classify_96x44_8_c: 38812.5
vvc_alf_classify_96x44_8_avx2: 7200.0
vvc_alf_classify_96x44_10_c: 37813.0
vvc_alf_classify_96x44_10_avx2: 6208.0
vvc_alf_classify_96x48_8_c: 42127.0
vvc_alf_classify_96x48_8_avx2: 7647.7
vvc_alf_classify_96x48_10_c: 40984.7
vvc_alf_classify_96x48_10_avx2: 6546.2
vvc_alf_classify_96x52_8_c: 58726.0
vvc_alf_classify_96x52_8_avx2: 8396.0
vvc_alf_classify_96x52_10_c: 44367.0
vvc_alf_classify_96x52_10_avx2: 7067.5
vvc_alf_classify_96x56_8_c: 48805.2
vvc_alf_classify_96x56_8_avx2: 8835.2
vvc_alf_classify_96x56_10_c: 47509.5
vvc_alf_classify_96x56_10_avx2: 7408.5
vvc_alf_classify_96x60_8_c: 52232.2
vvc_alf_classify_96x60_8_avx2: 9597.0
vvc_alf_classify_96x60_10_c: 50848.0
vvc_alf_classify_96x60_10_avx2: 8078.7
vvc_alf_classify_96x64_8_c: 55567.7
vvc_alf_classify_96x64_8_avx2: 10019.5
vvc_alf_classify_96x64_10_c: 54121.0
vvc_alf_classify_96x64_10_avx2: 8420.5
vvc_alf_classify_96x68_8_c: 65621.5
vvc_alf_classify_96x68_8_avx2: 10833.5
vvc_alf_classify_96x68_10_c: 57358.0
vvc_alf_classify_96x68_10_avx2: 9099.7
vvc_alf_classify_96x72_8_c: 62258.0
vvc_alf_classify_96x72_8_avx2: 14643.0
vvc_alf_classify_96x72_10_c: 60623.5
vvc_alf_classify_96x72_10_avx2: 9430.2
vvc_alf_classify_96x76_8_c: 65628.5
vvc_alf_classify_96x76_8_avx2: 14946.7
vvc_alf_classify_96x76_10_c: 63920.7
vvc_alf_classify_96x76_10_avx2: 28269.0
vvc_alf_classify_96x80_8_c: 69054.0
vvc_alf_classify_96x80_8_avx2: 12765.7
vvc_alf_classify_96x80_10_c: 67322.7
vvc_alf_classify_96x80_10_avx2: 10529.5
vvc_alf_classify_96x84_8_c: 72347.0
vvc_alf_classify_96x84_8_avx2: 14025.7
vvc_alf_classify_96x84_10_c: 73767.7
vvc_alf_classify_96x84_10_avx2: 11271.2
vvc_alf_classify_96x88_8_c: 88992.7
vvc_alf_classify_96x88_8_avx2: 13678.7
vvc_alf_classify_96x88_10_c: 75902.0
vvc_alf_classify_96x88_10_avx2: 11632.5
vvc_alf_classify_96x92_8_c: 79048.2
vvc_alf_classify_96x92_8_avx2: 14504.5
vvc_alf_classify_96x92_10_c: 142249.5
vvc_alf_classify_96x92_10_avx2: 12319.0
vvc_alf_classify_96x96_8_c: 82587.0
vvc_alf_classify_96x96_8_avx2: 14953.7
vvc_alf_classify_96x96_10_c: 80332.2
vvc_alf_classify_96x96_10_avx2: 12700.2
vvc_alf_classify_96x100_8_c: 88264.5
vvc_alf_classify_96x100_8_avx2: 15832.2
vvc_alf_classify_96x100_10_c: 83848.5
vvc_alf_classify_96x100_10_avx2: 13413.0
vvc_alf_classify_96x104_8_c: 89402.2
vvc_alf_classify_96x104_8_avx2: 16661.5
vvc_alf_classify_96x104_10_c: 87071.5
vvc_alf_classify_96x104_10_avx2: 13777.0
vvc_alf_classify_96x108_8_c: 92672.2
vvc_alf_classify_96x108_8_avx2: 17332.5
vvc_alf_classify_96x108_10_c: 92729.2
vvc_alf_classify_96x108_10_avx2: 14482.2
vvc_alf_classify_96x112_8_c: 96115.7
vvc_alf_classify_96x112_8_avx2: 17833.7
vvc_alf_classify_96x112_10_c: 93598.7
vvc_alf_classify_96x112_10_avx2: 14825.5
vvc_alf_classify_96x116_8_c: 99384.7
vvc_alf_classify_96x116_8_avx2: 18223.5
vvc_alf_classify_96x116_10_c: 96829.7
vvc_alf_classify_96x116_10_avx2: 15505.5
vvc_alf_classify_96x120_8_c: 102737.2
vvc_alf_classify_96x120_8_avx2: 19030.7
vvc_alf_classify_96x120_10_c: 100096.7
vvc_alf_classify_96x120_10_avx2: 15860.7
vvc_alf_classify_96x124_8_c: 105888.0
vvc_alf_classify_96x124_8_avx2: 19426.2
vvc_alf_classify_96x124_10_c: 103313.7
vvc_alf_classify_96x124_10_avx2: 16611.2
vvc_alf_classify_96x128_8_c: 109085.0
vvc_alf_classify_96x128_8_avx2: 19815.0
vvc_alf_classify_96x128_10_c: 106370.0
vvc_alf_classify_96x128_10_avx2: 16900.2
vvc_alf_classify_100x4_8_c: 5643.5
vvc_alf_classify_100x4_8_avx2: 1314.0
vvc_alf_classify_100x4_10_c: 5479.0
vvc_alf_classify_100x4_10_avx2: 1080.2
vvc_alf_classify_100x8_8_c: 9123.5
vvc_alf_classify_100x8_8_avx2: 1700.5
vvc_alf_classify_100x8_10_c: 17203.7
vvc_alf_classify_100x8_10_avx2: 1407.7
vvc_alf_classify_100x12_8_c: 12573.5
vvc_alf_classify_100x12_8_avx2: 2578.5
vvc_alf_classify_100x12_10_c: 12243.0
vvc_alf_classify_100x12_10_avx2: 2241.5
vvc_alf_classify_100x16_8_c: 16971.0
vvc_alf_classify_100x16_8_avx2: 2997.7
vvc_alf_classify_100x16_10_c: 15608.2
vvc_alf_classify_100x16_10_avx2: 2524.0
vvc_alf_classify_100x20_8_c: 19523.7
vvc_alf_classify_100x20_8_avx2: 3908.5
vvc_alf_classify_100x20_10_c: 19027.0
vvc_alf_classify_100x20_10_avx2: 3321.0
vvc_alf_classify_100x24_8_c: 23018.5
vvc_alf_classify_100x24_8_avx2: 4229.5
vvc_alf_classify_100x24_10_c: 22349.0
vvc_alf_classify_100x24_10_avx2: 3550.2
vvc_alf_classify_100x28_8_c: 26479.0
vvc_alf_classify_100x28_8_avx2: 5043.5
vvc_alf_classify_100x28_10_c: 25746.2
vvc_alf_classify_100x28_10_avx2: 4403.0
vvc_alf_classify_100x32_8_c: 29932.2
vvc_alf_classify_100x32_8_avx2: 5473.7
vvc_alf_classify_100x32_10_c: 29130.0
vvc_alf_classify_100x32_10_avx2: 4611.5
vvc_alf_classify_100x36_8_c: 33411.2
vvc_alf_classify_100x36_8_avx2: 6267.7
vvc_alf_classify_100x36_10_c: 32506.5
vvc_alf_classify_100x36_10_avx2: 19257.0
vvc_alf_classify_100x40_8_c: 36901.5
vvc_alf_classify_100x40_8_avx2: 6697.2
vvc_alf_classify_100x40_10_c: 35930.5
vvc_alf_classify_100x40_10_avx2: 5645.7
vvc_alf_classify_100x44_8_c: 40395.7
vvc_alf_classify_100x44_8_avx2: 7750.0
vvc_alf_classify_100x44_10_c: 39253.2
vvc_alf_classify_100x44_10_avx2: 6401.0
vvc_alf_classify_100x48_8_c: 43784.7
vvc_alf_classify_100x48_8_avx2: 7964.7
vvc_alf_classify_100x48_10_c: 42643.2
vvc_alf_classify_100x48_10_avx2: 6911.5
vvc_alf_classify_100x52_8_c: 47267.5
vvc_alf_classify_100x52_8_avx2: 112640.7
vvc_alf_classify_100x52_10_c: 46106.7
vvc_alf_classify_100x52_10_avx2: 7476.2
vvc_alf_classify_100x56_8_c: 50880.7
vvc_alf_classify_100x56_8_avx2: 25744.0
vvc_alf_classify_100x56_10_c: 49506.0
vvc_alf_classify_100x56_10_avx2: 7820.2
vvc_alf_classify_100x60_8_c: 54407.5
vvc_alf_classify_100x60_8_avx2: 10054.2
vvc_alf_classify_100x60_10_c: 52928.5
vvc_alf_classify_100x60_10_avx2: 8543.5
vvc_alf_classify_100x64_8_c: 58028.2
vvc_alf_classify_100x64_8_avx2: 10477.2
vvc_alf_classify_100x64_10_c: 57819.0
vvc_alf_classify_100x64_10_avx2: 9617.2
vvc_alf_classify_100x68_8_c: 61341.2
vvc_alf_classify_100x68_8_avx2: 11291.2
vvc_alf_classify_100x68_10_c: 59854.2
vvc_alf_classify_100x68_10_avx2: 9617.2
vvc_alf_classify_100x72_8_c: 64870.2
vvc_alf_classify_100x72_8_avx2: 11699.5
vvc_alf_classify_100x72_10_c: 63279.7
vvc_alf_classify_100x72_10_avx2: 9987.2
vvc_alf_classify_100x76_8_c: 68441.7
vvc_alf_classify_100x76_8_avx2: 12857.7
vvc_alf_classify_100x76_10_c: 66703.0
vvc_alf_classify_100x76_10_avx2: 15491.5
vvc_alf_classify_100x80_8_c: 90362.5
vvc_alf_classify_100x80_8_avx2: 13655.0
vvc_alf_classify_100x80_10_c: 70098.7
vvc_alf_classify_100x80_10_avx2: 11057.5
vvc_alf_classify_100x84_8_c: 75404.7
vvc_alf_classify_100x84_8_avx2: 14219.7
vvc_alf_classify_100x84_10_c: 73414.7
vvc_alf_classify_100x84_10_avx2: 11927.2
vvc_alf_classify_100x88_8_c: 79004.5
vvc_alf_classify_100x88_8_avx2: 14704.5
vvc_alf_classify_100x88_10_c: 76871.7
vvc_alf_classify_100x88_10_avx2: 12275.0
vvc_alf_classify_100x92_8_c: 82500.7
vvc_alf_classify_100x92_8_avx2: 15152.5
vvc_alf_classify_100x92_10_c: 80242.7
vvc_alf_classify_100x92_10_avx2: 13023.5
vvc_alf_classify_100x96_8_c: 86157.7
vvc_alf_classify_100x96_8_avx2: 15536.7
vvc_alf_classify_100x96_10_c: 83840.2
vvc_alf_classify_100x96_10_avx2: 13402.5
vvc_alf_classify_100x100_8_c: 114762.7
vvc_alf_classify_100x100_8_avx2: 16834.0
vvc_alf_classify_100x100_10_c: 89558.0
vvc_alf_classify_100x100_10_avx2: 14150.2
vvc_alf_classify_100x104_8_c: 93097.5
vvc_alf_classify_100x104_8_avx2: 23405.0
vvc_alf_classify_100x104_10_c: 95517.7
vvc_alf_classify_100x104_10_avx2: 14494.2
vvc_alf_classify_100x108_8_c: 96584.0
vvc_alf_classify_100x108_8_avx2: 18149.7
vvc_alf_classify_100x108_10_c: 172316.2
vvc_alf_classify_100x108_10_avx2: 15267.7
vvc_alf_classify_100x112_8_c: 99926.2
vvc_alf_classify_100x112_8_avx2: 18562.7
vvc_alf_classify_100x112_10_c: 97512.0
vvc_alf_classify_100x112_10_avx2: 15601.5
vvc_alf_classify_100x116_8_c: 175468.0
vvc_alf_classify_100x116_8_avx2: 25182.5
vvc_alf_classify_100x116_10_c: 103579.2
vvc_alf_classify_100x116_10_avx2: 16351.5
vvc_alf_classify_100x120_8_c: 106971.5
vvc_alf_classify_100x120_8_avx2: 19926.2
vvc_alf_classify_100x120_10_c: 104397.2
vvc_alf_classify_100x120_10_avx2: 16689.5
vvc_alf_classify_100x124_8_c: 110449.2
vvc_alf_classify_100x124_8_avx2: 21430.0
vvc_alf_classify_100x124_10_c: 107455.7
vvc_alf_classify_100x124_10_avx2: 17519.0
vvc_alf_classify_100x128_8_c: 113703.5
vvc_alf_classify_100x128_8_avx2: 20763.0
vvc_alf_classify_100x128_10_c: 110851.2
vvc_alf_classify_100x128_10_avx2: 17832.5
vvc_alf_classify_104x4_8_c: 6035.7
vvc_alf_classify_104x4_8_avx2: 1307.0
vvc_alf_classify_104x4_10_c: 5701.7
vvc_alf_classify_104x4_10_avx2: 1082.5
vvc_alf_classify_104x8_8_c: 9968.7
vvc_alf_classify_104x8_8_avx2: 1694.7
vvc_alf_classify_104x8_10_c: 9204.0
vvc_alf_classify_104x8_10_avx2: 1408.5
vvc_alf_classify_104x12_8_c: 13048.0
vvc_alf_classify_104x12_8_avx2: 2582.2
vvc_alf_classify_104x12_10_c: 12710.5
vvc_alf_classify_104x12_10_avx2: 2254.5
vvc_alf_classify_104x16_8_c: 22530.0
vvc_alf_classify_104x16_8_avx2: 3000.0
vvc_alf_classify_104x16_10_c: 16173.5
vvc_alf_classify_104x16_10_avx2: 2522.0
vvc_alf_classify_104x20_8_c: 20302.5
vvc_alf_classify_104x20_8_avx2: 3919.7
vvc_alf_classify_104x20_10_c: 19725.5
vvc_alf_classify_104x20_10_avx2: 3330.2
vvc_alf_classify_104x24_8_c: 23918.7
vvc_alf_classify_104x24_8_avx2: 4238.5
vvc_alf_classify_104x24_10_c: 23197.2
vvc_alf_classify_104x24_10_avx2: 3570.5
vvc_alf_classify_104x28_8_c: 27436.7
vvc_alf_classify_104x28_8_avx2: 5069.5
vvc_alf_classify_104x28_10_c: 26707.7
vvc_alf_classify_104x28_10_avx2: 4418.2
vvc_alf_classify_104x32_8_c: 31067.7
vvc_alf_classify_104x32_8_avx2: 5472.2
vvc_alf_classify_104x32_10_c: 38667.0
vvc_alf_classify_104x32_10_avx2: 4632.5
vvc_alf_classify_104x36_8_c: 34710.0
vvc_alf_classify_104x36_8_avx2: 6300.5
vvc_alf_classify_104x36_10_c: 33822.2
vvc_alf_classify_104x36_10_avx2: 7360.2
vvc_alf_classify_104x40_8_c: 38283.7
vvc_alf_classify_104x40_8_avx2: 6888.0
vvc_alf_classify_104x40_10_c: 37259.7
vvc_alf_classify_104x40_10_avx2: 7778.0
vvc_alf_classify_104x44_8_c: 41889.5
vvc_alf_classify_104x44_8_avx2: 7566.5
vvc_alf_classify_104x44_10_c: 75633.2
vvc_alf_classify_104x44_10_avx2: 6760.0
vvc_alf_classify_104x48_8_c: 45516.0
vvc_alf_classify_104x48_8_avx2: 7982.7
vvc_alf_classify_104x48_10_c: 44370.7
vvc_alf_classify_104x48_10_avx2: 6937.5
vvc_alf_classify_104x52_8_c: 49152.2
vvc_alf_classify_104x52_8_avx2: 8816.7
vvc_alf_classify_104x52_10_c: 47882.7
vvc_alf_classify_104x52_10_avx2: 7890.2
vvc_alf_classify_104x56_8_c: 52855.5
vvc_alf_classify_104x56_8_avx2: 14825.5
vvc_alf_classify_104x56_10_c: 51417.0
vvc_alf_classify_104x56_10_avx2: 7844.7
vvc_alf_classify_104x60_8_c: 59516.7
vvc_alf_classify_104x60_8_avx2: 10099.0
vvc_alf_classify_104x60_10_c: 69411.0
vvc_alf_classify_104x60_10_avx2: 8580.0
vvc_alf_classify_104x64_8_c: 60078.2
vvc_alf_classify_104x64_8_avx2: 10519.0
vvc_alf_classify_104x64_10_c: 58476.5
vvc_alf_classify_104x64_10_avx2: 8899.5
vvc_alf_classify_104x68_8_c: 63734.7
vvc_alf_classify_104x68_8_avx2: 11629.7
vvc_alf_classify_104x68_10_c: 62048.0
vvc_alf_classify_104x68_10_avx2: 9668.0
vvc_alf_classify_104x72_8_c: 75167.5
vvc_alf_classify_104x72_8_avx2: 11753.7
vvc_alf_classify_104x72_10_c: 65595.7
vvc_alf_classify_104x72_10_avx2: 9985.7
vvc_alf_classify_104x76_8_c: 70918.7
vvc_alf_classify_104x76_8_avx2: 12894.2
vvc_alf_classify_104x76_10_c: 69032.2
vvc_alf_classify_104x76_10_avx2: 15554.0
vvc_alf_classify_104x80_8_c: 74547.5
vvc_alf_classify_104x80_8_avx2: 13684.0
vvc_alf_classify_104x80_10_c: 72640.2
vvc_alf_classify_104x80_10_avx2: 11110.5
vvc_alf_classify_104x84_8_c: 78148.7
vvc_alf_classify_104x84_8_avx2: 13886.5
vvc_alf_classify_104x84_10_c: 76163.5
vvc_alf_classify_104x84_10_avx2: 11965.2
vvc_alf_classify_104x88_8_c: 82029.2
vvc_alf_classify_104x88_8_avx2: 19774.0
vvc_alf_classify_104x88_10_c: 79810.0
vvc_alf_classify_104x88_10_avx2: 12324.2
vvc_alf_classify_104x92_8_c: 85605.2
vvc_alf_classify_104x92_8_avx2: 15206.7
vvc_alf_classify_104x92_10_c: 83404.5
vvc_alf_classify_104x92_10_avx2: 13092.7
vvc_alf_classify_104x96_8_c: 89178.2
vvc_alf_classify_104x96_8_avx2: 16046.0
vvc_alf_classify_104x96_10_c: 86913.0
vvc_alf_classify_104x96_10_avx2: 13445.7
vvc_alf_classify_104x100_8_c: 93119.7
vvc_alf_classify_104x100_8_avx2: 16455.0
vvc_alf_classify_104x100_10_c: 92797.7
vvc_alf_classify_104x100_10_avx2: 14236.5
vvc_alf_classify_104x104_8_c: 96437.2
vvc_alf_classify_104x104_8_avx2: 25136.2
vvc_alf_classify_104x104_10_c: 93994.7
vvc_alf_classify_104x104_10_avx2: 14530.0
vvc_alf_classify_104x108_8_c: 100045.5
vvc_alf_classify_104x108_8_avx2: 17745.5
vvc_alf_classify_104x108_10_c: 105085.2
vvc_alf_classify_104x108_10_avx2: 15305.2
vvc_alf_classify_104x112_8_c: 103752.5
vvc_alf_classify_104x112_8_avx2: 18142.2
vvc_alf_classify_104x112_10_c: 100910.7
vvc_alf_classify_104x112_10_avx2: 35559.2
vvc_alf_classify_104x116_8_c: 107519.7
vvc_alf_classify_104x116_8_avx2: 19032.2
vvc_alf_classify_104x116_10_c: 110130.5
vvc_alf_classify_104x116_10_avx2: 16429.5
vvc_alf_classify_104x120_8_c: 110979.5
vvc_alf_classify_104x120_8_avx2: 19985.5
vvc_alf_classify_104x120_10_c: 118477.2
vvc_alf_classify_104x120_10_avx2: 16764.0
vvc_alf_classify_104x124_8_c: 114415.5
vvc_alf_classify_104x124_8_avx2: 21518.7
vvc_alf_classify_104x124_10_c: 111520.0
vvc_alf_classify_104x124_10_avx2: 17534.0
vvc_alf_classify_104x128_8_c: 117941.5
vvc_alf_classify_104x128_8_avx2: 20791.0
vvc_alf_classify_104x128_10_c: 114727.5
vvc_alf_classify_104x128_10_avx2: 17905.5
vvc_alf_classify_108x4_8_c: 6084.5
vvc_alf_classify_108x4_8_avx2: 1314.5
vvc_alf_classify_108x4_10_c: 5905.7
vvc_alf_classify_108x4_10_avx2: 1121.5
vvc_alf_classify_108x8_8_c: 10081.5
vvc_alf_classify_108x8_8_avx2: 1700.5
vvc_alf_classify_108x8_10_c: 9546.5
vvc_alf_classify_108x8_10_avx2: 1433.2
vvc_alf_classify_108x12_8_c: 13558.7
vvc_alf_classify_108x12_8_avx2: 2582.2
vvc_alf_classify_108x12_10_c: 13206.0
vvc_alf_classify_108x12_10_avx2: 2262.7
vvc_alf_classify_108x16_8_c: 17286.0
vvc_alf_classify_108x16_8_avx2: 3006.7
vvc_alf_classify_108x16_10_c: 16825.0
vvc_alf_classify_108x16_10_avx2: 2532.2
vvc_alf_classify_108x20_8_c: 21014.5
vvc_alf_classify_108x20_8_avx2: 3819.2
vvc_alf_classify_108x20_10_c: 20471.0
vvc_alf_classify_108x20_10_avx2: 3334.7
vvc_alf_classify_108x24_8_c: 26118.5
vvc_alf_classify_108x24_8_avx2: 4242.0
vvc_alf_classify_108x24_10_c: 24092.2
vvc_alf_classify_108x24_10_avx2: 3665.7
vvc_alf_classify_108x28_8_c: 28569.5
vvc_alf_classify_108x28_8_avx2: 5086.5
vvc_alf_classify_108x28_10_c: 27755.5
vvc_alf_classify_108x28_10_avx2: 4438.7
vvc_alf_classify_108x32_8_c: 32257.0
vvc_alf_classify_108x32_8_avx2: 5483.5
vvc_alf_classify_108x32_10_c: 31412.5
vvc_alf_classify_108x32_10_avx2: 6330.2
vvc_alf_classify_108x36_8_c: 36032.5
vvc_alf_classify_108x36_8_avx2: 6318.2
vvc_alf_classify_108x36_10_c: 35038.5
vvc_alf_classify_108x36_10_avx2: 5364.5
vvc_alf_classify_108x40_8_c: 39797.0
vvc_alf_classify_108x40_8_avx2: 6737.7
vvc_alf_classify_108x40_10_c: 39716.5
vvc_alf_classify_108x40_10_avx2: 5689.0
vvc_alf_classify_108x44_8_c: 43489.7
vvc_alf_classify_108x44_8_avx2: 15886.7
vvc_alf_classify_108x44_10_c: 42430.0
vvc_alf_classify_108x44_10_avx2: 6780.0
vvc_alf_classify_108x48_8_c: 47211.7
vvc_alf_classify_108x48_8_avx2: 8011.0
vvc_alf_classify_108x48_10_c: 46019.5
vvc_alf_classify_108x48_10_avx2: 6947.5
vvc_alf_classify_108x52_8_c: 51052.0
vvc_alf_classify_108x52_8_avx2: 9871.5
vvc_alf_classify_108x52_10_c: 67485.2
vvc_alf_classify_108x52_10_avx2: 7714.2
vvc_alf_classify_108x56_8_c: 54701.0
vvc_alf_classify_108x56_8_avx2: 9289.5
vvc_alf_classify_108x56_10_c: 53323.5
vvc_alf_classify_108x56_10_avx2: 7865.7
vvc_alf_classify_108x60_8_c: 58589.0
vvc_alf_classify_108x60_8_avx2: 10122.0
vvc_alf_classify_108x60_10_c: 57030.2
vvc_alf_classify_108x60_10_avx2: 8614.2
vvc_alf_classify_108x64_8_c: 65679.7
vvc_alf_classify_108x64_8_avx2: 10561.5
vvc_alf_classify_108x64_10_c: 60706.0
vvc_alf_classify_108x64_10_avx2: 8939.5
vvc_alf_classify_108x68_8_c: 84568.7
vvc_alf_classify_108x68_8_avx2: 11365.7
vvc_alf_classify_108x68_10_c: 64393.0
vvc_alf_classify_108x68_10_avx2: 9697.0
vvc_alf_classify_108x72_8_c: 69908.7
vvc_alf_classify_108x72_8_avx2: 11774.7
vvc_alf_classify_108x72_10_c: 68045.7
vvc_alf_classify_108x72_10_avx2: 10037.2
vvc_alf_classify_108x76_8_c: 73698.5
vvc_alf_classify_108x76_8_avx2: 12924.7
vvc_alf_classify_108x76_10_c: 71717.7
vvc_alf_classify_108x76_10_avx2: 10759.7
vvc_alf_classify_108x80_8_c: 83899.5
vvc_alf_classify_108x80_8_avx2: 13797.7
vvc_alf_classify_108x80_10_c: 75383.0
vvc_alf_classify_108x80_10_avx2: 12395.5
vvc_alf_classify_108x84_8_c: 90998.2
vvc_alf_classify_108x84_8_avx2: 13936.5
vvc_alf_classify_108x84_10_c: 97572.2
vvc_alf_classify_108x84_10_avx2: 11994.2
vvc_alf_classify_108x88_8_c: 85230.7
vvc_alf_classify_108x88_8_avx2: 14369.2
vvc_alf_classify_108x88_10_c: 85163.2
vvc_alf_classify_108x88_10_avx2: 15998.5
vvc_alf_classify_108x92_8_c: 97140.2
vvc_alf_classify_108x92_8_avx2: 15220.2
vvc_alf_classify_108x92_10_c: 86602.2
vvc_alf_classify_108x92_10_avx2: 13105.2
vvc_alf_classify_108x96_8_c: 92775.7
vvc_alf_classify_108x96_8_avx2: 16055.7
vvc_alf_classify_108x96_10_c: 90149.2
vvc_alf_classify_108x96_10_avx2: 13448.0
vvc_alf_classify_108x100_8_c: 96467.2
vvc_alf_classify_108x100_8_avx2: 16461.7
vvc_alf_classify_108x100_10_c: 96402.0
vvc_alf_classify_108x100_10_avx2: 14256.7
vvc_alf_classify_108x104_8_c: 100318.7
vvc_alf_classify_108x104_8_avx2: 81441.7
vvc_alf_classify_108x104_10_c: 100149.2
vvc_alf_classify_108x104_10_avx2: 14596.2
vvc_alf_classify_108x108_8_c: 112731.5
vvc_alf_classify_108x108_8_avx2: 17834.0
vvc_alf_classify_108x108_10_c: 101330.7
vvc_alf_classify_108x108_10_avx2: 15355.7
vvc_alf_classify_108x112_8_c: 113469.0
vvc_alf_classify_108x112_8_avx2: 18202.0
vvc_alf_classify_108x112_10_c: 107540.5
vvc_alf_classify_108x112_10_avx2: 15714.7
vvc_alf_classify_108x116_8_c: 111402.5
vvc_alf_classify_108x116_8_avx2: 19077.0
vvc_alf_classify_108x116_10_c: 111403.2
vvc_alf_classify_108x116_10_avx2: 16920.7
vvc_alf_classify_108x120_8_c: 122865.5
vvc_alf_classify_108x120_8_avx2: 24927.5
vvc_alf_classify_108x120_10_c: 112153.7
vvc_alf_classify_108x120_10_avx2: 16790.7
vvc_alf_classify_108x124_8_c: 118863.5
vvc_alf_classify_108x124_8_avx2: 20392.7
vvc_alf_classify_108x124_10_c: 115644.0
vvc_alf_classify_108x124_10_avx2: 17575.7
vvc_alf_classify_108x128_8_c: 122349.2
vvc_alf_classify_108x128_8_avx2: 20815.7
vvc_alf_classify_108x128_10_c: 119170.2
vvc_alf_classify_108x128_10_avx2: 17907.0
vvc_alf_classify_112x4_8_c: 6302.0
vvc_alf_classify_112x4_8_avx2: 1473.7
vvc_alf_classify_112x4_10_c: 6103.7
vvc_alf_classify_112x4_10_avx2: 1208.2
vvc_alf_classify_112x8_8_c: 13832.0
vvc_alf_classify_112x8_8_avx2: 1908.2
vvc_alf_classify_112x8_10_c: 10121.7
vvc_alf_classify_112x8_10_avx2: 1606.0
vvc_alf_classify_112x12_8_c: 14034.7
vvc_alf_classify_112x12_8_avx2: 2820.5
vvc_alf_classify_112x12_10_c: 13666.0
vvc_alf_classify_112x12_10_avx2: 2446.0
vvc_alf_classify_112x16_8_c: 17904.7
vvc_alf_classify_112x16_8_avx2: 3300.7
vvc_alf_classify_112x16_10_c: 17409.5
vvc_alf_classify_112x16_10_avx2: 2752.7
vvc_alf_classify_112x20_8_c: 21811.2
vvc_alf_classify_112x20_8_avx2: 4180.2
vvc_alf_classify_112x20_10_c: 21239.5
vvc_alf_classify_112x20_10_avx2: 3602.5
vvc_alf_classify_112x24_8_c: 25672.0
vvc_alf_classify_112x24_8_avx2: 4651.7
vvc_alf_classify_112x24_10_c: 24965.7
vvc_alf_classify_112x24_10_avx2: 3965.5
vvc_alf_classify_112x28_8_c: 29536.0
vvc_alf_classify_112x28_8_avx2: 5566.2
vvc_alf_classify_112x28_10_c: 29466.0
vvc_alf_classify_112x28_10_avx2: 4774.5
vvc_alf_classify_112x32_8_c: 33377.7
vvc_alf_classify_112x32_8_avx2: 6045.7
vvc_alf_classify_112x32_10_c: 32520.0
vvc_alf_classify_112x32_10_avx2: 6700.5
vvc_alf_classify_112x36_8_c: 37265.7
vvc_alf_classify_112x36_8_avx2: 6924.5
vvc_alf_classify_112x36_10_c: 36291.0
vvc_alf_classify_112x36_10_avx2: 5810.5
vvc_alf_classify_112x40_8_c: 41181.2
vvc_alf_classify_112x40_8_avx2: 7433.0
vvc_alf_classify_112x40_10_c: 40068.0
vvc_alf_classify_112x40_10_avx2: 6186.5
vvc_alf_classify_112x44_8_c: 45026.0
vvc_alf_classify_112x44_8_avx2: 8335.0
vvc_alf_classify_112x44_10_c: 44967.2
vvc_alf_classify_112x44_10_avx2: 7184.0
vvc_alf_classify_112x48_8_c: 53005.5
vvc_alf_classify_112x48_8_avx2: 8812.2
vvc_alf_classify_112x48_10_c: 47786.7
vvc_alf_classify_112x48_10_avx2: 7537.0
vvc_alf_classify_112x52_8_c: 52891.2
vvc_alf_classify_112x52_8_avx2: 9648.5
vvc_alf_classify_112x52_10_c: 51462.2
vvc_alf_classify_112x52_10_avx2: 8347.5
vvc_alf_classify_112x56_8_c: 56795.7
vvc_alf_classify_112x56_8_avx2: 10132.5
vvc_alf_classify_112x56_10_c: 55257.2
vvc_alf_classify_112x56_10_avx2: 8514.2
vvc_alf_classify_112x60_8_c: 62325.7
vvc_alf_classify_112x60_8_avx2: 11087.2
vvc_alf_classify_112x60_10_c: 59023.7
vvc_alf_classify_112x60_10_avx2: 9311.0
vvc_alf_classify_112x64_8_c: 64577.7
vvc_alf_classify_112x64_8_avx2: 11572.0
vvc_alf_classify_112x64_10_c: 62830.0
vvc_alf_classify_112x64_10_avx2: 9645.5
vvc_alf_classify_112x68_8_c: 68422.5
vvc_alf_classify_112x68_8_avx2: 12485.7
vvc_alf_classify_112x68_10_c: 66671.7
vvc_alf_classify_112x68_10_avx2: 10498.2
vvc_alf_classify_112x72_8_c: 72298.5
vvc_alf_classify_112x72_8_avx2: 22113.7
vvc_alf_classify_112x72_10_c: 72233.0
vvc_alf_classify_112x72_10_avx2: 10923.5
vvc_alf_classify_112x76_8_c: 78264.5
vvc_alf_classify_112x76_8_avx2: 14219.0
vvc_alf_classify_112x76_10_c: 100623.2
vvc_alf_classify_112x76_10_avx2: 11746.2
vvc_alf_classify_112x80_8_c: 103612.5
vvc_alf_classify_112x80_8_avx2: 14421.2
vvc_alf_classify_112x80_10_c: 78130.2
vvc_alf_classify_112x80_10_avx2: 12386.0
vvc_alf_classify_112x84_8_c: 97624.5
vvc_alf_classify_112x84_8_avx2: 15230.5
vvc_alf_classify_112x84_10_c: 84079.7
vvc_alf_classify_112x84_10_avx2: 12917.0
vvc_alf_classify_112x88_8_c: 88193.7
vvc_alf_classify_112x88_8_avx2: 20079.2
vvc_alf_classify_112x88_10_c: 88078.0
vvc_alf_classify_112x88_10_avx2: 13321.2
vvc_alf_classify_112x92_8_c: 206002.7
vvc_alf_classify_112x92_8_avx2: 16703.5
vvc_alf_classify_112x92_10_c: 89479.7
vvc_alf_classify_112x92_10_avx2: 14136.7
vvc_alf_classify_112x96_8_c: 95951.7
vvc_alf_classify_112x96_8_avx2: 17611.7
vvc_alf_classify_112x96_10_c: 95780.5
vvc_alf_classify_112x96_10_avx2: 14528.5
vvc_alf_classify_112x100_8_c: 99635.7
vvc_alf_classify_112x100_8_avx2: 23523.5
vvc_alf_classify_112x100_10_c: 99715.0
vvc_alf_classify_112x100_10_avx2: 15350.5
vvc_alf_classify_112x104_8_c: 103612.2
vvc_alf_classify_112x104_8_avx2: 19520.7
vvc_alf_classify_112x104_10_c: 103491.0
vvc_alf_classify_112x104_10_avx2: 15777.2
vvc_alf_classify_112x108_8_c: 107624.7
vvc_alf_classify_112x108_8_avx2: 19958.2
vvc_alf_classify_112x108_10_c: 104685.5
vvc_alf_classify_112x108_10_avx2: 16545.7
vvc_alf_classify_112x112_8_c: 111381.7
vvc_alf_classify_112x112_8_avx2: 19957.7
vvc_alf_classify_112x112_10_c: 202160.7
vvc_alf_classify_112x112_10_avx2: 16956.7
vvc_alf_classify_112x116_8_c: 115317.2
vvc_alf_classify_112x116_8_avx2: 20836.0
vvc_alf_classify_112x116_10_c: 112206.0
vvc_alf_classify_112x116_10_avx2: 17649.5
vvc_alf_classify_112x120_8_c: 119227.5
vvc_alf_classify_112x120_8_avx2: 21946.5
vvc_alf_classify_112x120_10_c: 119078.2
vvc_alf_classify_112x120_10_avx2: 18071.5
vvc_alf_classify_112x124_8_c: 136884.5
vvc_alf_classify_112x124_8_avx2: 22225.2
vvc_alf_classify_112x124_10_c: 119720.0
vvc_alf_classify_112x124_10_avx2: 18841.0
vvc_alf_classify_112x128_8_c: 126549.2
vvc_alf_classify_112x128_8_avx2: 22646.7
vvc_alf_classify_112x128_10_c: 123245.2
vvc_alf_classify_112x128_10_avx2: 19300.5
vvc_alf_classify_116x4_8_c: 6859.7
vvc_alf_classify_116x4_8_avx2: 1528.5
vvc_alf_classify_116x4_10_c: 6331.7
vvc_alf_classify_116x4_10_avx2: 1258.2
vvc_alf_classify_116x8_8_c: 10507.2
vvc_alf_classify_116x8_8_avx2: 1964.2
vvc_alf_classify_116x8_10_c: 10211.5
vvc_alf_classify_116x8_10_avx2: 1660.0
vvc_alf_classify_116x12_8_c: 14535.0
vvc_alf_classify_116x12_8_avx2: 2930.7
vvc_alf_classify_116x12_10_c: 14098.7
vvc_alf_classify_116x12_10_avx2: 2548.0
vvc_alf_classify_116x16_8_c: 18534.7
vvc_alf_classify_116x16_8_avx2: 3404.5
vvc_alf_classify_116x16_10_c: 18038.7
vvc_alf_classify_116x16_10_avx2: 2860.0
vvc_alf_classify_116x20_8_c: 22565.7
vvc_alf_classify_116x20_8_avx2: 4333.7
vvc_alf_classify_116x20_10_c: 21910.5
vvc_alf_classify_116x20_10_avx2: 3764.0
vvc_alf_classify_116x24_8_c: 26544.5
vvc_alf_classify_116x24_8_avx2: 4823.0
vvc_alf_classify_116x24_10_c: 25850.5
vvc_alf_classify_116x24_10_avx2: 4039.5
vvc_alf_classify_116x28_8_c: 30534.7
vvc_alf_classify_116x28_8_avx2: 16124.0
vvc_alf_classify_116x28_10_c: 29772.7
vvc_alf_classify_116x28_10_avx2: 5014.0
vvc_alf_classify_116x32_8_c: 34546.2
vvc_alf_classify_116x32_8_avx2: 6259.5
vvc_alf_classify_116x32_10_c: 33593.0
vvc_alf_classify_116x32_10_avx2: 5264.5
vvc_alf_classify_116x36_8_c: 38610.5
vvc_alf_classify_116x36_8_avx2: 7211.2
vvc_alf_classify_116x36_10_c: 37584.5
vvc_alf_classify_116x36_10_avx2: 6099.5
vvc_alf_classify_116x40_8_c: 42648.2
vvc_alf_classify_116x40_8_avx2: 7693.0
vvc_alf_classify_116x40_10_c: 41491.0
vvc_alf_classify_116x40_10_avx2: 6478.2
vvc_alf_classify_116x44_8_c: 47878.2
vvc_alf_classify_116x44_8_avx2: 8665.5
vvc_alf_classify_116x44_10_c: 45396.2
vvc_alf_classify_116x44_10_avx2: 7569.0
vvc_alf_classify_116x48_8_c: 50606.0
vvc_alf_classify_116x48_8_avx2: 25446.5
vvc_alf_classify_116x48_10_c: 49336.2
vvc_alf_classify_116x48_10_avx2: 7917.5
vvc_alf_classify_116x52_8_c: 54651.0
vvc_alf_classify_116x52_8_avx2: 10093.0
vvc_alf_classify_116x52_10_c: 53221.2
vvc_alf_classify_116x52_10_avx2: 8782.0
vvc_alf_classify_116x56_8_c: 58734.2
vvc_alf_classify_116x56_8_avx2: 10561.5
vvc_alf_classify_116x56_10_c: 57269.5
vvc_alf_classify_116x56_10_avx2: 8929.0
vvc_alf_classify_116x60_8_c: 62804.5
vvc_alf_classify_116x60_8_avx2: 24801.2
vvc_alf_classify_116x60_10_c: 61104.5
vvc_alf_classify_116x60_10_avx2: 9755.7
vvc_alf_classify_116x64_8_c: 66826.7
vvc_alf_classify_116x64_8_avx2: 11996.5
vvc_alf_classify_116x64_10_c: 66785.2
vvc_alf_classify_116x64_10_avx2: 10128.7
vvc_alf_classify_116x68_8_c: 70815.2
vvc_alf_classify_116x68_8_avx2: 12937.7
vvc_alf_classify_116x68_10_c: 69030.2
vvc_alf_classify_116x68_10_avx2: 11034.5
vvc_alf_classify_116x72_8_c: 74941.5
vvc_alf_classify_116x72_8_avx2: 13783.7
vvc_alf_classify_116x72_10_c: 72939.7
vvc_alf_classify_116x72_10_avx2: 11426.0
vvc_alf_classify_116x76_8_c: 78980.5
vvc_alf_classify_116x76_8_avx2: 49974.5
vvc_alf_classify_116x76_10_c: 131868.5
vvc_alf_classify_116x76_10_avx2: 12337.5
vvc_alf_classify_116x80_8_c: 83044.2
vvc_alf_classify_116x80_8_avx2: 19745.2
vvc_alf_classify_116x80_10_c: 80892.7
vvc_alf_classify_116x80_10_avx2: 12723.2
vvc_alf_classify_116x84_8_c: 87306.7
vvc_alf_classify_116x84_8_avx2: 16213.2
vvc_alf_classify_116x84_10_c: 89580.2
vvc_alf_classify_116x84_10_avx2: 13573.0
vvc_alf_classify_116x88_8_c: 91257.2
vvc_alf_classify_116x88_8_avx2: 16341.0
vvc_alf_classify_116x88_10_c: 93727.5
vvc_alf_classify_116x88_10_avx2: 13952.0
vvc_alf_classify_116x92_8_c: 95304.0
vvc_alf_classify_116x92_8_avx2: 17272.5
vvc_alf_classify_116x92_10_c: 92690.7
vvc_alf_classify_116x92_10_avx2: 14832.2
vvc_alf_classify_116x96_8_c: 99386.2
vvc_alf_classify_116x96_8_avx2: 18243.2
vvc_alf_classify_116x96_10_c: 96681.5
vvc_alf_classify_116x96_10_avx2: 15214.2
vvc_alf_classify_116x100_8_c: 103386.0
vvc_alf_classify_116x100_8_avx2: 18738.0
vvc_alf_classify_116x100_10_c: 105932.0
vvc_alf_classify_116x100_10_avx2: 16131.0
vvc_alf_classify_116x104_8_c: 107264.2
vvc_alf_classify_116x104_8_avx2: 20291.5
vvc_alf_classify_116x104_10_c: 104482.7
vvc_alf_classify_116x104_10_avx2: 16496.7
vvc_alf_classify_116x108_8_c: 111518.0
vvc_alf_classify_116x108_8_avx2: 30071.7
vvc_alf_classify_116x108_10_c: 108513.7
vvc_alf_classify_116x108_10_avx2: 17384.2
vvc_alf_classify_116x112_8_c: 115431.2
vvc_alf_classify_116x112_8_avx2: 20659.5
vvc_alf_classify_116x112_10_c: 176058.5
vvc_alf_classify_116x112_10_avx2: 17773.7
vvc_alf_classify_116x116_8_c: 119516.5
vvc_alf_classify_116x116_8_avx2: 21691.5
vvc_alf_classify_116x116_10_c: 119247.2
vvc_alf_classify_116x116_10_avx2: 18585.5
vvc_alf_classify_116x120_8_c: 131159.0
vvc_alf_classify_116x120_8_avx2: 22717.0
vvc_alf_classify_116x120_10_c: 120167.2
vvc_alf_classify_116x120_10_avx2: 18993.5
vvc_alf_classify_116x124_8_c: 127283.5
vvc_alf_classify_116x124_8_avx2: 23078.2
vvc_alf_classify_116x124_10_c: 123905.7
vvc_alf_classify_116x124_10_avx2: 19831.2
vvc_alf_classify_116x128_8_c: 130967.5
vvc_alf_classify_116x128_8_avx2: 31874.2
vvc_alf_classify_116x128_10_c: 134527.7
vvc_alf_classify_116x128_10_avx2: 20225.2
vvc_alf_classify_120x4_8_c: 6913.2
vvc_alf_classify_120x4_8_avx2: 1530.7
vvc_alf_classify_120x4_10_c: 6530.5
vvc_alf_classify_120x4_10_avx2: 1265.0
vvc_alf_classify_120x8_8_c: 10879.5
vvc_alf_classify_120x8_8_avx2: 1973.7
vvc_alf_classify_120x8_10_c: 10543.5
vvc_alf_classify_120x8_10_avx2: 1667.7
vvc_alf_classify_120x12_8_c: 15460.0
vvc_alf_classify_120x12_8_avx2: 3020.5
vvc_alf_classify_120x12_10_c: 14604.2
vvc_alf_classify_120x12_10_avx2: 2552.5
vvc_alf_classify_120x16_8_c: 20219.2
vvc_alf_classify_120x16_8_avx2: 3413.2
vvc_alf_classify_120x16_10_c: 18635.2
vvc_alf_classify_120x16_10_avx2: 2849.0
vvc_alf_classify_120x20_8_c: 23300.0
vvc_alf_classify_120x20_8_avx2: 4340.5
vvc_alf_classify_120x20_10_c: 22682.0
vvc_alf_classify_120x20_10_avx2: 3764.0
vvc_alf_classify_120x24_8_c: 27480.5
vvc_alf_classify_120x24_8_avx2: 4828.2
vvc_alf_classify_120x24_10_c: 26670.5
vvc_alf_classify_120x24_10_avx2: 4148.2
vvc_alf_classify_120x28_8_c: 31597.2
vvc_alf_classify_120x28_8_avx2: 16091.5
vvc_alf_classify_120x28_10_c: 30721.5
vvc_alf_classify_120x28_10_avx2: 5017.0
vvc_alf_classify_120x32_8_c: 35781.0
vvc_alf_classify_120x32_8_avx2: 6253.5
vvc_alf_classify_120x32_10_c: 34746.5
vvc_alf_classify_120x32_10_avx2: 6975.5
vvc_alf_classify_120x36_8_c: 39964.5
vvc_alf_classify_120x36_8_avx2: 7233.5
vvc_alf_classify_120x36_10_c: 38774.5
vvc_alf_classify_120x36_10_avx2: 6095.0
vvc_alf_classify_120x40_8_c: 44089.2
vvc_alf_classify_120x40_8_avx2: 7703.2
vvc_alf_classify_120x40_10_c: 43995.7
vvc_alf_classify_120x40_10_avx2: 6479.7
vvc_alf_classify_120x44_8_c: 48290.0
vvc_alf_classify_120x44_8_avx2: 8676.7
vvc_alf_classify_120x44_10_c: 46908.0
vvc_alf_classify_120x44_10_avx2: 7774.2
vvc_alf_classify_120x48_8_c: 52322.5
vvc_alf_classify_120x48_8_avx2: 9151.7
vvc_alf_classify_120x48_10_c: 51897.2
vvc_alf_classify_120x48_10_avx2: 7753.2
vvc_alf_classify_120x52_8_c: 56534.2
vvc_alf_classify_120x52_8_avx2: 10084.2
vvc_alf_classify_120x52_10_c: 61056.7
vvc_alf_classify_120x52_10_avx2: 8574.0
vvc_alf_classify_120x56_8_c: 60697.2
vvc_alf_classify_120x56_8_avx2: 10584.5
vvc_alf_classify_120x56_10_c: 59073.7
vvc_alf_classify_120x56_10_avx2: 8936.7
vvc_alf_classify_120x60_8_c: 64942.5
vvc_alf_classify_120x60_8_avx2: 12135.0
vvc_alf_classify_120x60_10_c: 63094.2
vvc_alf_classify_120x60_10_avx2: 9764.0
vvc_alf_classify_120x64_8_c: 69053.0
vvc_alf_classify_120x64_8_avx2: 11995.0
vvc_alf_classify_120x64_10_c: 67191.5
vvc_alf_classify_120x64_10_avx2: 10152.0
vvc_alf_classify_120x68_8_c: 73237.5
vvc_alf_classify_120x68_8_avx2: 13660.2
vvc_alf_classify_120x68_10_c: 75027.7
vvc_alf_classify_120x68_10_avx2: 11061.7
vvc_alf_classify_120x72_8_c: 77311.0
vvc_alf_classify_120x72_8_avx2: 13804.2
vvc_alf_classify_120x72_10_c: 75311.5
vvc_alf_classify_120x72_10_avx2: 11453.7
vvc_alf_classify_120x76_8_c: 81621.2
vvc_alf_classify_120x76_8_avx2: 14845.2
vvc_alf_classify_120x76_10_c: 79453.5
vvc_alf_classify_120x76_10_avx2: 12335.2
vvc_alf_classify_120x80_8_c: 85961.2
vvc_alf_classify_120x80_8_avx2: 19395.0
vvc_alf_classify_120x80_10_c: 93155.5
vvc_alf_classify_120x80_10_avx2: 12724.7
vvc_alf_classify_120x84_8_c: 90095.5
vvc_alf_classify_120x84_8_avx2: 16287.0
vvc_alf_classify_120x84_10_c: 89870.7
vvc_alf_classify_120x84_10_avx2: 13624.2
vvc_alf_classify_120x88_8_c: 94162.2
vvc_alf_classify_120x88_8_avx2: 16347.7
vvc_alf_classify_120x88_10_c: 94100.5
vvc_alf_classify_120x88_10_avx2: 38904.0
vvc_alf_classify_120x92_8_c: 98367.5
vvc_alf_classify_120x92_8_avx2: 17400.5
vvc_alf_classify_120x92_10_c: 98248.0
vvc_alf_classify_120x92_10_avx2: 14891.0
vvc_alf_classify_120x96_8_c: 102452.2
vvc_alf_classify_120x96_8_avx2: 17810.2
vvc_alf_classify_120x96_10_c: 102388.5
vvc_alf_classify_120x96_10_avx2: 15228.2
vvc_alf_classify_120x100_8_c: 106574.0
vvc_alf_classify_120x100_8_avx2: 27557.0
vvc_alf_classify_120x100_10_c: 109351.7
vvc_alf_classify_120x100_10_avx2: 16172.5
vvc_alf_classify_120x104_8_c: 110733.0
vvc_alf_classify_120x104_8_avx2: 20340.0
vvc_alf_classify_120x104_10_c: 110646.2
vvc_alf_classify_120x104_10_avx2: 16537.5
vvc_alf_classify_120x108_8_c: 114998.5
vvc_alf_classify_120x108_8_avx2: 20255.7
vvc_alf_classify_120x108_10_c: 111836.7
vvc_alf_classify_120x108_10_avx2: 17387.2
vvc_alf_classify_120x112_8_c: 119066.7
vvc_alf_classify_120x112_8_avx2: 21274.5
vvc_alf_classify_120x112_10_c: 115989.0
vvc_alf_classify_120x112_10_avx2: 17775.2
vvc_alf_classify_120x116_8_c: 123326.2
vvc_alf_classify_120x116_8_avx2: 21669.7
vvc_alf_classify_120x116_10_c: 123140.5
vvc_alf_classify_120x116_10_avx2: 18621.2
vvc_alf_classify_120x120_8_c: 127428.7
vvc_alf_classify_120x120_8_avx2: 22750.7
vvc_alf_classify_120x120_10_c: 123980.0
vvc_alf_classify_120x120_10_avx2: 18990.5
vvc_alf_classify_120x124_8_c: 131400.7
vvc_alf_classify_120x124_8_avx2: 23083.2
vvc_alf_classify_120x124_10_c: 128029.7
vvc_alf_classify_120x124_10_avx2: 20354.7
vvc_alf_classify_120x128_8_c: 142786.2
vvc_alf_classify_120x128_8_avx2: 31621.5
vvc_alf_classify_120x128_10_c: 198348.0
vvc_alf_classify_120x128_10_avx2: 20239.2
vvc_alf_classify_124x4_8_c: 7142.2
vvc_alf_classify_124x4_8_avx2: 1529.2
vvc_alf_classify_124x4_10_c: 6747.2
vvc_alf_classify_124x4_10_avx2: 1267.7
vvc_alf_classify_124x8_8_c: 11227.2
vvc_alf_classify_124x8_8_avx2: 1979.7
vvc_alf_classify_124x8_10_c: 10878.7
vvc_alf_classify_124x8_10_avx2: 1672.2
vvc_alf_classify_124x12_8_c: 15934.7
vvc_alf_classify_124x12_8_avx2: 2935.2
vvc_alf_classify_124x12_10_c: 15041.5
vvc_alf_classify_124x12_10_avx2: 2557.2
vvc_alf_classify_124x16_8_c: 28888.7
vvc_alf_classify_124x16_8_avx2: 3416.2
vvc_alf_classify_124x16_10_c: 19231.7
vvc_alf_classify_124x16_10_avx2: 2870.5
vvc_alf_classify_124x20_8_c: 24719.0
vvc_alf_classify_124x20_8_avx2: 4354.5
vvc_alf_classify_124x20_10_c: 23422.7
vvc_alf_classify_124x20_10_avx2: 3792.7
vvc_alf_classify_124x24_8_c: 28342.2
vvc_alf_classify_124x24_8_avx2: 4846.7
vvc_alf_classify_124x24_10_c: 27510.5
vvc_alf_classify_124x24_10_avx2: 4056.7
vvc_alf_classify_124x28_8_c: 32610.7
vvc_alf_classify_124x28_8_avx2: 6459.5
vvc_alf_classify_124x28_10_c: 31765.5
vvc_alf_classify_124x28_10_avx2: 4918.2
vvc_alf_classify_124x32_8_c: 36881.5
vvc_alf_classify_124x32_8_avx2: 6443.7
vvc_alf_classify_124x32_10_c: 39921.5
vvc_alf_classify_124x32_10_avx2: 5268.2
vvc_alf_classify_124x36_8_c: 42321.7
vvc_alf_classify_124x36_8_avx2: 7252.7
vvc_alf_classify_124x36_10_c: 40074.0
vvc_alf_classify_124x36_10_avx2: 6118.7
vvc_alf_classify_124x40_8_c: 45440.2
vvc_alf_classify_124x40_8_avx2: 7725.7
vvc_alf_classify_124x40_10_c: 44233.7
vvc_alf_classify_124x40_10_avx2: 6500.7
vvc_alf_classify_124x44_8_c: 49769.0
vvc_alf_classify_124x44_8_avx2: 8690.2
vvc_alf_classify_124x44_10_c: 54004.5
vvc_alf_classify_124x44_10_avx2: 7796.5
vvc_alf_classify_124x48_8_c: 54049.5
vvc_alf_classify_124x48_8_avx2: 9178.0
vvc_alf_classify_124x48_10_c: 52695.5
vvc_alf_classify_124x48_10_avx2: 7772.7
vvc_alf_classify_124x52_8_c: 58455.5
vvc_alf_classify_124x52_8_avx2: 10117.0
vvc_alf_classify_124x52_10_c: 56912.0
vvc_alf_classify_124x52_10_avx2: 8786.2
vvc_alf_classify_124x56_8_c: 63079.2
vvc_alf_classify_124x56_8_avx2: 10609.2
vvc_alf_classify_124x56_10_c: 61059.0
vvc_alf_classify_124x56_10_avx2: 8973.7
vvc_alf_classify_124x60_8_c: 67066.5
vvc_alf_classify_124x60_8_avx2: 11539.2
vvc_alf_classify_124x60_10_c: 65277.7
vvc_alf_classify_124x60_10_avx2: 9827.2
vvc_alf_classify_124x64_8_c: 71373.0
vvc_alf_classify_124x64_8_avx2: 12048.5
vvc_alf_classify_124x64_10_c: 69513.5
vvc_alf_classify_124x64_10_avx2: 10168.2
vvc_alf_classify_124x68_8_c: 75641.5
vvc_alf_classify_124x68_8_avx2: 13328.7
vvc_alf_classify_124x68_10_c: 75718.5
vvc_alf_classify_124x68_10_avx2: 11106.7
vvc_alf_classify_124x72_8_c: 80025.2
vvc_alf_classify_124x72_8_avx2: 13834.0
vvc_alf_classify_124x72_10_c: 77995.2
vvc_alf_classify_124x72_10_avx2: 11473.7
vvc_alf_classify_124x76_8_c: 84430.7
vvc_alf_classify_124x76_8_avx2: 19030.0
vvc_alf_classify_124x76_10_c: 82220.7
vvc_alf_classify_124x76_10_avx2: 12381.5
vvc_alf_classify_124x80_8_c: 88765.7
vvc_alf_classify_124x80_8_avx2: 15341.2
vvc_alf_classify_124x80_10_c: 86383.2
vvc_alf_classify_124x80_10_avx2: 13093.7
vvc_alf_classify_124x84_8_c: 93136.2
vvc_alf_classify_124x84_8_avx2: 16297.7
vvc_alf_classify_124x84_10_c: 123184.7
vvc_alf_classify_124x84_10_avx2: 13675.0
vvc_alf_classify_124x88_8_c: 108571.5
vvc_alf_classify_124x88_8_avx2: 16410.2
vvc_alf_classify_124x88_10_c: 97350.7
vvc_alf_classify_124x88_10_avx2: 14035.5
vvc_alf_classify_124x92_8_c: 101640.5
vvc_alf_classify_124x92_8_avx2: 17320.2
vvc_alf_classify_124x92_10_c: 101666.5
vvc_alf_classify_124x92_10_avx2: 14882.2
vvc_alf_classify_124x96_8_c: 113688.5
vvc_alf_classify_124x96_8_avx2: 17838.5
vvc_alf_classify_124x96_10_c: 114840.0
vvc_alf_classify_124x96_10_avx2: 15285.0
vvc_alf_classify_124x100_8_c: 110383.7
vvc_alf_classify_124x100_8_avx2: 18800.7
vvc_alf_classify_124x100_10_c: 107472.7
vvc_alf_classify_124x100_10_avx2: 33382.2
vvc_alf_classify_124x104_8_c: 114539.7
vvc_alf_classify_124x104_8_avx2: 20340.0
vvc_alf_classify_124x104_10_c: 114496.2
vvc_alf_classify_124x104_10_avx2: 16597.7
vvc_alf_classify_124x108_8_c: 118830.7
vvc_alf_classify_124x108_8_avx2: 20297.5
vvc_alf_classify_124x108_10_c: 115634.5
vvc_alf_classify_124x108_10_avx2: 17492.2
vvc_alf_classify_124x112_8_c: 133032.7
vvc_alf_classify_124x112_8_avx2: 20783.0
vvc_alf_classify_124x112_10_c: 119909.0
vvc_alf_classify_124x112_10_avx2: 17866.7
vvc_alf_classify_124x116_8_c: 148887.5
vvc_alf_classify_124x116_8_avx2: 21810.7
vvc_alf_classify_124x116_10_c: 130743.2
vvc_alf_classify_124x116_10_avx2: 18714.2
vvc_alf_classify_124x120_8_c: 131714.2
vvc_alf_classify_124x120_8_avx2: 22241.0
vvc_alf_classify_124x120_10_c: 128238.2
vvc_alf_classify_124x120_10_avx2: 19086.5
vvc_alf_classify_124x124_8_c: 145988.5
vvc_alf_classify_124x124_8_avx2: 23233.0
vvc_alf_classify_124x124_10_c: 132326.5
vvc_alf_classify_124x124_10_avx2: 19906.5
vvc_alf_classify_124x128_8_c: 140001.2
vvc_alf_classify_124x128_8_avx2: 23662.0
vvc_alf_classify_124x128_10_c: 136284.5
vvc_alf_classify_124x128_10_avx2: 20333.2
vvc_alf_classify_128x4_8_c: 7170.2
vvc_alf_classify_128x4_8_avx2: 1646.2
vvc_alf_classify_128x4_10_c: 6952.0
vvc_alf_classify_128x4_10_avx2: 1358.7
vvc_alf_classify_128x8_8_c: 11856.5
vvc_alf_classify_128x8_8_avx2: 2149.5
vvc_alf_classify_128x8_10_c: 11207.0
vvc_alf_classify_128x8_10_avx2: 1812.2
vvc_alf_classify_128x12_8_c: 15988.7
vvc_alf_classify_128x12_8_avx2: 3188.5
vvc_alf_classify_128x12_10_c: 15937.0
vvc_alf_classify_128x12_10_avx2: 2738.2
vvc_alf_classify_128x16_8_c: 28577.5
vvc_alf_classify_128x16_8_avx2: 3718.5
vvc_alf_classify_128x16_10_c: 19881.2
vvc_alf_classify_128x16_10_avx2: 3080.5
vvc_alf_classify_128x20_8_c: 24904.0
vvc_alf_classify_128x20_8_avx2: 4712.0
vvc_alf_classify_128x20_10_c: 24195.0
vvc_alf_classify_128x20_10_avx2: 4045.2
vvc_alf_classify_128x24_8_c: 29276.0
vvc_alf_classify_128x24_8_avx2: 5251.2
vvc_alf_classify_128x24_10_c: 28468.7
vvc_alf_classify_128x24_10_avx2: 4353.7
vvc_alf_classify_128x28_8_c: 33712.2
vvc_alf_classify_128x28_8_avx2: 6930.5
vvc_alf_classify_128x28_10_c: 32883.2
vvc_alf_classify_128x28_10_avx2: 5255.0
vvc_alf_classify_128x32_8_c: 38144.5
vvc_alf_classify_128x32_8_avx2: 6994.5
vvc_alf_classify_128x32_10_c: 37062.5
vvc_alf_classify_128x32_10_avx2: 5645.0
vvc_alf_classify_128x36_8_c: 42580.5
vvc_alf_classify_128x36_8_avx2: 7862.0
vvc_alf_classify_128x36_10_c: 41482.0
vvc_alf_classify_128x36_10_avx2: 6572.2
vvc_alf_classify_128x40_8_c: 65219.0
vvc_alf_classify_128x40_8_avx2: 8412.5
vvc_alf_classify_128x40_10_c: 47065.7
vvc_alf_classify_128x40_10_avx2: 6978.0
vvc_alf_classify_128x44_8_c: 51480.2
vvc_alf_classify_128x44_8_avx2: 9351.5
vvc_alf_classify_128x44_10_c: 50187.5
vvc_alf_classify_128x44_10_avx2: 10803.5
vvc_alf_classify_128x48_8_c: 70445.7
vvc_alf_classify_128x48_8_avx2: 9950.0
vvc_alf_classify_128x48_10_c: 54430.7
vvc_alf_classify_128x48_10_avx2: 8285.7
vvc_alf_classify_128x52_8_c: 61941.5
vvc_alf_classify_128x52_8_avx2: 10928.0
vvc_alf_classify_128x52_10_c: 58756.5
vvc_alf_classify_128x52_10_avx2: 9348.0
vvc_alf_classify_128x56_8_c: 64813.7
vvc_alf_classify_128x56_8_avx2: 11485.0
vvc_alf_classify_128x56_10_c: 63235.0
vvc_alf_classify_128x56_10_avx2: 9583.0
vvc_alf_classify_128x60_8_c: 69262.5
vvc_alf_classify_128x60_8_avx2: 12526.7
vvc_alf_classify_128x60_10_c: 67531.0
vvc_alf_classify_128x60_10_avx2: 10468.5
vvc_alf_classify_128x64_8_c: 73696.2
vvc_alf_classify_128x64_8_avx2: 13000.2
vvc_alf_classify_128x64_10_c: 71710.2
vvc_alf_classify_128x64_10_avx2: 10893.7
vvc_alf_classify_128x68_8_c: 86714.7
vvc_alf_classify_128x68_8_avx2: 14089.7
vvc_alf_classify_128x68_10_c: 136306.0
vvc_alf_classify_128x68_10_avx2: 11850.5
vvc_alf_classify_128x72_8_c: 82803.7
vvc_alf_classify_128x72_8_avx2: 15011.7
vvc_alf_classify_128x72_10_c: 80592.0
vvc_alf_classify_128x72_10_avx2: 12270.5
vvc_alf_classify_128x76_8_c: 87332.0
vvc_alf_classify_128x76_8_avx2: 15638.0
vvc_alf_classify_128x76_10_c: 85011.0
vvc_alf_classify_128x76_10_avx2: 13226.0
vvc_alf_classify_128x80_8_c: 91826.2
vvc_alf_classify_128x80_8_avx2: 16120.5
vvc_alf_classify_128x80_10_c: 89285.5
vvc_alf_classify_128x80_10_avx2: 13608.7
vvc_alf_classify_128x84_8_c: 143179.7
vvc_alf_classify_128x84_8_avx2: 17245.0
vvc_alf_classify_128x84_10_c: 101502.7
vvc_alf_classify_128x84_10_avx2: 14548.5
vvc_alf_classify_128x88_8_c: 100696.2
vvc_alf_classify_128x88_8_avx2: 17640.5
vvc_alf_classify_128x88_10_c: 100436.2
vvc_alf_classify_128x88_10_avx2: 15349.7
vvc_alf_classify_128x92_8_c: 105006.2
vvc_alf_classify_128x92_8_avx2: 19319.0
vvc_alf_classify_128x92_10_c: 102174.5
vvc_alf_classify_128x92_10_avx2: 15913.5
vvc_alf_classify_128x96_8_c: 109382.7
vvc_alf_classify_128x96_8_avx2: 19886.0
vvc_alf_classify_128x96_10_c: 109492.7
vvc_alf_classify_128x96_10_avx2: 16310.5
vvc_alf_classify_128x100_8_c: 113894.7
vvc_alf_classify_128x100_8_avx2: 20232.0
vvc_alf_classify_128x100_10_c: 110981.7
vvc_alf_classify_128x100_10_avx2: 17228.5
vvc_alf_classify_128x104_8_c: 118252.0
vvc_alf_classify_128x104_8_avx2: 21472.2
vvc_alf_classify_128x104_10_c: 118206.2
vvc_alf_classify_128x104_10_avx2: 17741.0
vvc_alf_classify_128x108_8_c: 122676.2
vvc_alf_classify_128x108_8_avx2: 31258.5
vvc_alf_classify_128x108_10_c: 119589.5
vvc_alf_classify_128x108_10_avx2: 18629.5
vvc_alf_classify_128x112_8_c: 127215.0
vvc_alf_classify_128x112_8_avx2: 22934.7
vvc_alf_classify_128x112_10_c: 127325.2
vvc_alf_classify_128x112_10_avx2: 19077.0
vvc_alf_classify_128x116_8_c: 131676.2
vvc_alf_classify_128x116_8_avx2: 23950.7
vvc_alf_classify_128x116_10_c: 128281.5
vvc_alf_classify_128x116_10_avx2: 19991.2
vvc_alf_classify_128x120_8_c: 136028.2
vvc_alf_classify_128x120_8_avx2: 24012.5
vvc_alf_classify_128x120_10_c: 132437.5
vvc_alf_classify_128x120_10_avx2: 20376.5
vvc_alf_classify_128x124_8_c: 140269.2
vvc_alf_classify_128x124_8_avx2: 25045.5
vvc_alf_classify_128x124_10_c: 136694.7
vvc_alf_classify_128x124_10_avx2: 21252.7
vvc_alf_classify_128x128_8_c: 144558.0
vvc_alf_classify_128x128_8_avx2: 25650.2
vvc_alf_classify_128x128_10_c: 140670.0
vvc_alf_classify_128x128_10_avx2: 21729.5

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Wu Jianhua
9ef6e15b04 tests/checkasm: add checkasm_check_vvc_alf and check_alf_filter
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Wu Jianhua
ec2a7ef867 avcodec/x86/vvc: add alf filter luma and chroma avx2 optimizations
ff_vvc_alf_filter_luma_4x4_10_c: 135
ff_vvc_alf_filter_luma_4x4_10_avx2: 54
ff_vvc_alf_filter_luma_4x8_10_c: 268
ff_vvc_alf_filter_luma_4x8_10_avx2: 106
ff_vvc_alf_filter_luma_4x12_10_c: 400
ff_vvc_alf_filter_luma_4x12_10_avx2: 160
ff_vvc_alf_filter_luma_4x16_10_c: 535
ff_vvc_alf_filter_luma_4x16_10_avx2: 213
ff_vvc_alf_filter_luma_4x20_10_c: 646
ff_vvc_alf_filter_luma_4x20_10_avx2: 262
ff_vvc_alf_filter_luma_4x24_10_c: 783
ff_vvc_alf_filter_luma_4x24_10_avx2: 309
ff_vvc_alf_filter_luma_4x28_10_c: 908
ff_vvc_alf_filter_luma_4x28_10_avx2: 361
ff_vvc_alf_filter_luma_4x32_10_c: 1039
ff_vvc_alf_filter_luma_4x32_10_avx2: 412
ff_vvc_alf_filter_luma_8x4_10_c: 260
ff_vvc_alf_filter_luma_8x4_10_avx2: 53
ff_vvc_alf_filter_luma_8x8_10_c: 516
ff_vvc_alf_filter_luma_8x8_10_avx2: 105
ff_vvc_alf_filter_luma_8x12_10_c: 779
ff_vvc_alf_filter_luma_8x12_10_avx2: 157
ff_vvc_alf_filter_luma_8x16_10_c: 1038
ff_vvc_alf_filter_luma_8x16_10_avx2: 210
ff_vvc_alf_filter_luma_8x20_10_c: 1293
ff_vvc_alf_filter_luma_8x20_10_avx2: 259
ff_vvc_alf_filter_luma_8x24_10_c: 1553
ff_vvc_alf_filter_luma_8x24_10_avx2: 309
ff_vvc_alf_filter_luma_8x28_10_c: 1815
ff_vvc_alf_filter_luma_8x28_10_avx2: 361
ff_vvc_alf_filter_luma_8x32_10_c: 2067
ff_vvc_alf_filter_luma_8x32_10_avx2: 419
ff_vvc_alf_filter_luma_12x4_10_c: 390
ff_vvc_alf_filter_luma_12x4_10_avx2: 54
ff_vvc_alf_filter_luma_12x8_10_c: 773
ff_vvc_alf_filter_luma_12x8_10_avx2: 107
ff_vvc_alf_filter_luma_12x12_10_c: 1159
ff_vvc_alf_filter_luma_12x12_10_avx2: 155
ff_vvc_alf_filter_luma_12x16_10_c: 1550
ff_vvc_alf_filter_luma_12x16_10_avx2: 207
ff_vvc_alf_filter_luma_12x20_10_c: 1970
ff_vvc_alf_filter_luma_12x20_10_avx2: 260
ff_vvc_alf_filter_luma_12x24_10_c: 2379
ff_vvc_alf_filter_luma_12x24_10_avx2: 309
ff_vvc_alf_filter_luma_12x28_10_c: 2763
ff_vvc_alf_filter_luma_12x28_10_avx2: 362
ff_vvc_alf_filter_luma_12x32_10_c: 3158
ff_vvc_alf_filter_luma_12x32_10_avx2: 419
ff_vvc_alf_filter_luma_16x4_10_c: 523
ff_vvc_alf_filter_luma_16x4_10_avx2: 53
ff_vvc_alf_filter_luma_16x8_10_c: 1049
ff_vvc_alf_filter_luma_16x8_10_avx2: 103
ff_vvc_alf_filter_luma_16x12_10_c: 1566
ff_vvc_alf_filter_luma_16x12_10_avx2: 159
ff_vvc_alf_filter_luma_16x16_10_c: 2078
ff_vvc_alf_filter_luma_16x16_10_avx2: 211
ff_vvc_alf_filter_luma_16x20_10_c: 2631
ff_vvc_alf_filter_luma_16x20_10_avx2: 259
ff_vvc_alf_filter_luma_16x24_10_c: 3149
ff_vvc_alf_filter_luma_16x24_10_avx2: 316
ff_vvc_alf_filter_luma_16x28_10_c: 3631
ff_vvc_alf_filter_luma_16x28_10_avx2: 359
ff_vvc_alf_filter_luma_16x32_10_c: 4233
ff_vvc_alf_filter_luma_16x32_10_avx2: 428
ff_vvc_alf_filter_luma_20x4_10_c: 649
ff_vvc_alf_filter_luma_20x4_10_avx2: 106
ff_vvc_alf_filter_luma_20x8_10_c: 1294
ff_vvc_alf_filter_luma_20x8_10_avx2: 206
ff_vvc_alf_filter_luma_20x12_10_c: 1936
ff_vvc_alf_filter_luma_20x12_10_avx2: 310
ff_vvc_alf_filter_luma_20x16_10_c: 2594
ff_vvc_alf_filter_luma_20x16_10_avx2: 411
ff_vvc_alf_filter_luma_20x20_10_c: 3234
ff_vvc_alf_filter_luma_20x20_10_avx2: 517
ff_vvc_alf_filter_luma_20x24_10_c: 3894
ff_vvc_alf_filter_luma_20x24_10_avx2: 621
ff_vvc_alf_filter_luma_20x28_10_c: 4542
ff_vvc_alf_filter_luma_20x28_10_avx2: 722
ff_vvc_alf_filter_luma_20x32_10_c: 5205
ff_vvc_alf_filter_luma_20x32_10_avx2: 832
ff_vvc_alf_filter_luma_24x4_10_c: 774
ff_vvc_alf_filter_luma_24x4_10_avx2: 104
ff_vvc_alf_filter_luma_24x8_10_c: 1546
ff_vvc_alf_filter_luma_24x8_10_avx2: 206
ff_vvc_alf_filter_luma_24x12_10_c: 2318
ff_vvc_alf_filter_luma_24x12_10_avx2: 312
ff_vvc_alf_filter_luma_24x16_10_c: 3104
ff_vvc_alf_filter_luma_24x16_10_avx2: 411
ff_vvc_alf_filter_luma_24x20_10_c: 3893
ff_vvc_alf_filter_luma_24x20_10_avx2: 513
ff_vvc_alf_filter_luma_24x24_10_c: 4681
ff_vvc_alf_filter_luma_24x24_10_avx2: 616
ff_vvc_alf_filter_luma_24x28_10_c: 5474
ff_vvc_alf_filter_luma_24x28_10_avx2: 721
ff_vvc_alf_filter_luma_24x32_10_c: 6271
ff_vvc_alf_filter_luma_24x32_10_avx2: 832
ff_vvc_alf_filter_luma_28x4_10_c: 907
ff_vvc_alf_filter_luma_28x4_10_avx2: 103
ff_vvc_alf_filter_luma_28x8_10_c: 1797
ff_vvc_alf_filter_luma_28x8_10_avx2: 206
ff_vvc_alf_filter_luma_28x12_10_c: 2708
ff_vvc_alf_filter_luma_28x12_10_avx2: 309
ff_vvc_alf_filter_luma_28x16_10_c: 3632
ff_vvc_alf_filter_luma_28x16_10_avx2: 413
ff_vvc_alf_filter_luma_28x20_10_c: 4537
ff_vvc_alf_filter_luma_28x20_10_avx2: 519
ff_vvc_alf_filter_luma_28x24_10_c: 5463
ff_vvc_alf_filter_luma_28x24_10_avx2: 616
ff_vvc_alf_filter_luma_28x28_10_c: 6372
ff_vvc_alf_filter_luma_28x28_10_avx2: 719
ff_vvc_alf_filter_luma_28x32_10_c: 7274
ff_vvc_alf_filter_luma_28x32_10_avx2: 823
ff_vvc_alf_filter_luma_32x4_10_c: 1029
ff_vvc_alf_filter_luma_32x4_10_avx2: 104
ff_vvc_alf_filter_luma_32x8_10_c: 2060
ff_vvc_alf_filter_luma_32x8_10_avx2: 206
ff_vvc_alf_filter_luma_32x12_10_c: 3112
ff_vvc_alf_filter_luma_32x12_10_avx2: 307
ff_vvc_alf_filter_luma_32x16_10_c: 4161
ff_vvc_alf_filter_luma_32x16_10_avx2: 413
ff_vvc_alf_filter_luma_32x20_10_c: 5211
ff_vvc_alf_filter_luma_32x20_10_avx2: 514
ff_vvc_alf_filter_luma_32x24_10_c: 6238
ff_vvc_alf_filter_luma_32x24_10_avx2: 614
ff_vvc_alf_filter_luma_32x28_10_c: 7261
ff_vvc_alf_filter_luma_32x28_10_avx2: 720
ff_vvc_alf_filter_luma_32x32_10_c: 8312
ff_vvc_alf_filter_luma_32x32_10_avx2: 819
ff_vvc_alf_filter_chroma_4x4_10_c: 70
ff_vvc_alf_filter_chroma_4x4_10_avx2: 53
ff_vvc_alf_filter_chroma_4x8_10_c: 139
ff_vvc_alf_filter_chroma_4x8_10_avx2: 104
ff_vvc_alf_filter_chroma_4x12_10_c: 208
ff_vvc_alf_filter_chroma_4x12_10_avx2: 155
ff_vvc_alf_filter_chroma_4x16_10_c: 275
ff_vvc_alf_filter_chroma_4x16_10_avx2: 218
ff_vvc_alf_filter_chroma_4x20_10_c: 344
ff_vvc_alf_filter_chroma_4x20_10_avx2: 257
ff_vvc_alf_filter_chroma_4x24_10_c: 411
ff_vvc_alf_filter_chroma_4x24_10_avx2: 309
ff_vvc_alf_filter_chroma_4x28_10_c: 481
ff_vvc_alf_filter_chroma_4x28_10_avx2: 361
ff_vvc_alf_filter_chroma_4x32_10_c: 545
ff_vvc_alf_filter_chroma_4x32_10_avx2: 411
ff_vvc_alf_filter_chroma_8x4_10_c: 138
ff_vvc_alf_filter_chroma_8x4_10_avx2: 53
ff_vvc_alf_filter_chroma_8x8_10_c: 274
ff_vvc_alf_filter_chroma_8x8_10_avx2: 106
ff_vvc_alf_filter_chroma_8x12_10_c: 422
ff_vvc_alf_filter_chroma_8x12_10_avx2: 158
ff_vvc_alf_filter_chroma_8x16_10_c: 545
ff_vvc_alf_filter_chroma_8x16_10_avx2: 206
ff_vvc_alf_filter_chroma_8x20_10_c: 683
ff_vvc_alf_filter_chroma_8x20_10_avx2: 257
ff_vvc_alf_filter_chroma_8x24_10_c: 816
ff_vvc_alf_filter_chroma_8x24_10_avx2: 312
ff_vvc_alf_filter_chroma_8x28_10_c: 951
ff_vvc_alf_filter_chroma_8x28_10_avx2: 359
ff_vvc_alf_filter_chroma_8x32_10_c: 1098
ff_vvc_alf_filter_chroma_8x32_10_avx2: 409
ff_vvc_alf_filter_chroma_12x4_10_c: 204
ff_vvc_alf_filter_chroma_12x4_10_avx2: 53
ff_vvc_alf_filter_chroma_12x8_10_c: 410
ff_vvc_alf_filter_chroma_12x8_10_avx2: 104
ff_vvc_alf_filter_chroma_12x12_10_c: 614
ff_vvc_alf_filter_chroma_12x12_10_avx2: 155
ff_vvc_alf_filter_chroma_12x16_10_c: 814
ff_vvc_alf_filter_chroma_12x16_10_avx2: 210
ff_vvc_alf_filter_chroma_12x20_10_c: 1017
ff_vvc_alf_filter_chroma_12x20_10_avx2: 258
ff_vvc_alf_filter_chroma_12x24_10_c: 1221
ff_vvc_alf_filter_chroma_12x24_10_avx2: 308
ff_vvc_alf_filter_chroma_12x28_10_c: 1423
ff_vvc_alf_filter_chroma_12x28_10_avx2: 366
ff_vvc_alf_filter_chroma_12x32_10_c: 1624
ff_vvc_alf_filter_chroma_12x32_10_avx2: 410
ff_vvc_alf_filter_chroma_16x4_10_c: 272
ff_vvc_alf_filter_chroma_16x4_10_avx2: 52
ff_vvc_alf_filter_chroma_16x8_10_c: 541
ff_vvc_alf_filter_chroma_16x8_10_avx2: 105
ff_vvc_alf_filter_chroma_16x12_10_c: 812
ff_vvc_alf_filter_chroma_16x12_10_avx2: 155
ff_vvc_alf_filter_chroma_16x16_10_c: 1091
ff_vvc_alf_filter_chroma_16x16_10_avx2: 206
ff_vvc_alf_filter_chroma_16x20_10_c: 1354
ff_vvc_alf_filter_chroma_16x20_10_avx2: 257
ff_vvc_alf_filter_chroma_16x24_10_c: 1637
ff_vvc_alf_filter_chroma_16x24_10_avx2: 313
ff_vvc_alf_filter_chroma_16x28_10_c: 1899
ff_vvc_alf_filter_chroma_16x28_10_avx2: 359
ff_vvc_alf_filter_chroma_16x32_10_c: 2161
ff_vvc_alf_filter_chroma_16x32_10_avx2: 410
ff_vvc_alf_filter_chroma_20x4_10_c: 339
ff_vvc_alf_filter_chroma_20x4_10_avx2: 103
ff_vvc_alf_filter_chroma_20x8_10_c: 681
ff_vvc_alf_filter_chroma_20x8_10_avx2: 207
ff_vvc_alf_filter_chroma_20x12_10_c: 1013
ff_vvc_alf_filter_chroma_20x12_10_avx2: 307
ff_vvc_alf_filter_chroma_20x16_10_c: 1349
ff_vvc_alf_filter_chroma_20x16_10_avx2: 415
ff_vvc_alf_filter_chroma_20x20_10_c: 1685
ff_vvc_alf_filter_chroma_20x20_10_avx2: 522
ff_vvc_alf_filter_chroma_20x24_10_c: 2037
ff_vvc_alf_filter_chroma_20x24_10_avx2: 622
ff_vvc_alf_filter_chroma_20x28_10_c: 2380
ff_vvc_alf_filter_chroma_20x28_10_avx2: 733
ff_vvc_alf_filter_chroma_20x32_10_c: 2712
ff_vvc_alf_filter_chroma_20x32_10_avx2: 838
ff_vvc_alf_filter_chroma_24x4_10_c: 408
ff_vvc_alf_filter_chroma_24x4_10_avx2: 104
ff_vvc_alf_filter_chroma_24x8_10_c: 818
ff_vvc_alf_filter_chroma_24x8_10_avx2: 207
ff_vvc_alf_filter_chroma_24x12_10_c: 1219
ff_vvc_alf_filter_chroma_24x12_10_avx2: 308
ff_vvc_alf_filter_chroma_24x16_10_c: 1648
ff_vvc_alf_filter_chroma_24x16_10_avx2: 420
ff_vvc_alf_filter_chroma_24x20_10_c: 2061
ff_vvc_alf_filter_chroma_24x20_10_avx2: 525
ff_vvc_alf_filter_chroma_24x24_10_c: 2437
ff_vvc_alf_filter_chroma_24x24_10_avx2: 617
ff_vvc_alf_filter_chroma_24x28_10_c: 2832
ff_vvc_alf_filter_chroma_24x28_10_avx2: 722
ff_vvc_alf_filter_chroma_24x32_10_c: 3271
ff_vvc_alf_filter_chroma_24x32_10_avx2: 830
ff_vvc_alf_filter_chroma_28x4_10_c: 476
ff_vvc_alf_filter_chroma_28x4_10_avx2: 104
ff_vvc_alf_filter_chroma_28x8_10_c: 948
ff_vvc_alf_filter_chroma_28x8_10_avx2: 205
ff_vvc_alf_filter_chroma_28x12_10_c: 1420
ff_vvc_alf_filter_chroma_28x12_10_avx2: 310
ff_vvc_alf_filter_chroma_28x16_10_c: 1889
ff_vvc_alf_filter_chroma_28x16_10_avx2: 423
ff_vvc_alf_filter_chroma_28x20_10_c: 2372
ff_vvc_alf_filter_chroma_28x20_10_avx2: 513
ff_vvc_alf_filter_chroma_28x24_10_c: 2843
ff_vvc_alf_filter_chroma_28x24_10_avx2: 618
ff_vvc_alf_filter_chroma_28x28_10_c: 3307
ff_vvc_alf_filter_chroma_28x28_10_avx2: 724
ff_vvc_alf_filter_chroma_28x32_10_c: 3801
ff_vvc_alf_filter_chroma_28x32_10_avx2: 827
ff_vvc_alf_filter_chroma_32x4_10_c: 543
ff_vvc_alf_filter_chroma_32x4_10_avx2: 105
ff_vvc_alf_filter_chroma_32x8_10_c: 1084
ff_vvc_alf_filter_chroma_32x8_10_avx2: 206
ff_vvc_alf_filter_chroma_32x12_10_c: 1621
ff_vvc_alf_filter_chroma_32x12_10_avx2: 309
ff_vvc_alf_filter_chroma_32x16_10_c: 2173
ff_vvc_alf_filter_chroma_32x16_10_avx2: 408
ff_vvc_alf_filter_chroma_32x20_10_c: 2703
ff_vvc_alf_filter_chroma_32x20_10_avx2: 513
ff_vvc_alf_filter_chroma_32x24_10_c: 3245
ff_vvc_alf_filter_chroma_32x24_10_avx2: 612
ff_vvc_alf_filter_chroma_32x28_10_c: 3795
ff_vvc_alf_filter_chroma_32x28_10_avx2: 722
ff_vvc_alf_filter_chroma_32x32_10_c: 4339
ff_vvc_alf_filter_chroma_32x32_10_avx2: 820

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-05-14 19:21:35 +08:00
Rémi Denis-Courmont
cdcb4b98b7 lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
Rémi Denis-Courmont
247c5b2b97 lavu/riscv: add ff_rv_vlen_least()
This inline function checks that the vector length is at least a given
value. With this, most run-time VLEN checks can be optimised away.
2024-05-13 18:36:07 +03:00
Rémi Denis-Courmont
38e7b0ecf8 lavc/vp9dsp: fix indentation 2024-05-13 18:36:07 +03:00
James Almer
b450c44630 x86/flacdsp: remove unused parameters to pmacsdql macro
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-13 12:18:38 -03:00
James Almer
eb5733f38f x86/flacdsp: add an SSE4 version of wasted33
flac_wasted_33_c: 214.1
flac_wasted_33_sse4: 103.2

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-13 12:18:10 -03:00
James Almer
5ba6f4e63e checkasm/flacdsp: add a test for wasted33
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-13 12:18:10 -03:00
Ramiro Polla
d4d09c8e42 lavc/aarch64/fdct: add neon-optimized fdct for aarch64
The code is imported from libjpeg-turbo-3.0.1. The neon registers used
have been changed to avoid modifying v8-v15.

Reviewed-by: Martin Storsjö <martin@martin.st>
2024-05-13 14:54:10 +02:00
Ramiro Polla
27f6211c74 lavc/aarch64: fix include for cpu.h 2024-05-13 14:50:38 +02:00
Andreas Rheinhardt
b7b1a4e6c3 configure: Add missing ftr_parser->adts_header,mpeg4audio dependencies
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-13 14:32:21 +02:00
Andreas Rheinhardt
06d1840b56 configure, avcodec/Makefile: Add h264parse->h264data,golomb dependencies
Fixes standalone compilation of the dts2pts BSF.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-13 14:32:21 +02:00
Andreas Rheinhardt
4df43df6e1 avcodec/bsf/dts2pts: Fix shadowing
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-13 14:32:21 +02:00
Lynne
baf8651d56 aacdec: restore arm32 dequantization optimizations
Unintentionally removed as part of 03cf101645.
Untested, but its assumed that unlike most of the old ARM code,
this one was still working.
2024-05-13 13:02:02 +02:00
Tomas Härdin
37db0454e4 lavc/speedhqdec: Obey AVDISCARD_ALL 2024-05-13 08:35:09 +02:00
Tomas Härdin
5b32685d77 lavc/speedhqdec: Add AV_CODEC_CAP_FRAME_THREADS 2024-05-13 08:35:09 +02:00
Michael Niedermayer
36126e4c14 avcodec/exr: Fix preview overflow
Fixes: CID1515456 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:19 +02:00
Michael Niedermayer
73d6d9f129 avcodec/dovi_rpuenc: fix compaatibility
Fixes: a frequency
Found while reviewing: CID1596607

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:18 +02:00
Michael Niedermayer
46ad68084e avcodec/dovi_rpuenc: initialize profile
Code is taken from dovi_rpudec

Fixes: CID1596604 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:18 +02:00
Michael Niedermayer
e9bb586543 avcodec/decode: decode_simple_internal() only implements audio and video
Fixes: CID1538861 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:18 +02:00
Michael Niedermayer
96c1162545 avcodec/fmvc: remove dead assignment
Fixes: CID1529220 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:17 +02:00
Michael Niedermayer
fdaa6ae2b6 avcodec/h2645_sei: Remove dead checks
Fixes: CID1596534 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:17 +02:00
Michael Niedermayer
a68aa951b2 avcodec/h264_slice: Remove dead sps check
Fixes: CID1439574 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:17 +02:00
Brad Smith
950a7891a9 MAINTAINERS: add myself as *BSD maintainer
I try to help out with *BSD patches or build related issues where I can.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:16 +02:00
Michael Niedermayer
c2d897f356 avcodec/lpc: copy levenson coeffs only when they have been computed
Fixes: CID1473514 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:40:16 +02:00
Michael Niedermayer
c304784a86 avutil/tests/base64: Check with too short output array
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:26:57 +02:00
Michael Niedermayer
2d216566f2 libavutil/base64: Try not to write over the array end
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-13 03:26:57 +02:00
James Almer
0664cbd732 x86/flacdsp: add a SSE2 version of wasted32
flac_wasted_32_c: 851.3
flac_wasted_32_sse2: 41.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 17:24:08 -03:00
James Almer
5acec189af checkasm/flacdsp: add a test for wasted32
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 17:24:08 -03:00
James Almer
1ba5287697 avcodec/flacdsp: split off wasted bit handling into dsp functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 17:23:58 -03:00
James Almer
c00c8679ed x86/flacdsp: add a SSE4 version of lpc16
flac_lpc_16_13_c: 2841.3
flac_lpc_16_13_sse4: 2151.8
flac_lpc_16_16_c: 3382.8
flac_lpc_16_16_sse4: 2228.3
flac_lpc_16_29_c: 5800.3
flac_lpc_16_29_sse4: 3727.3
flac_lpc_16_32_c: 5972.8
flac_lpc_16_32_sse4: 4052.3

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 12:54:19 -03:00
James Almer
479d26cea2 checkasm/flacdsp: sanitize lpc arguments
Fixes signed integer overflows as reported by ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 12:36:46 -03:00
James Almer
467d84a06d checkasm/flacdsp: run lpc benchmarks with an unmodified buffer
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-12 12:36:46 -03:00
Yotam Ofek
02c032abcd avcodec/aacenc_tns: remove unreachable code branch
the condition being tested was the same as the stop condition for the containing loop,
so inside the loop it would always test positive
2024-05-12 16:01:44 +02:00
Rémi Denis-Courmont
0d9591841b lavc/ac3dsp: add R-V Zvbb extract_exponents 2024-05-11 11:38:49 +03:00
Rémi Denis-Courmont
5d8f62feb5 lavu/riscv: add Zvbb CPU capability detection
This requires Linux kernel version 6.8 or later.
2024-05-11 11:38:49 +03:00
Rémi Denis-Courmont
01c5f4ad9f riscv: add Zvbb vector bit manipulation extension 2024-05-11 11:38:49 +03:00
sunyuechi
11f689317d checkasm: Fix h264chroma test name
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-11 11:36:20 +03:00
Ramiro Polla
250c0defa2 checkasm: add test for fdct
Reviewed-by: Martin Storsjö <martin@martin.st>
Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-11 10:28:59 +02:00
Ramiro Polla
b8af0809fb libavcodec/mpegvideo_enc: fix multi-threaded motion estimation rounding for mpeg4
ff_init_me() was being called after ff_update_duplicate_context(),
which caused the propagation of the initialization to other thread
contexts to be delayed by one frame.

In the case of mpeg4 (or flipflop_rounding), this would make the
hpel_put functions differ between the first thread (which would be
correctly initialized) and the other threads (which would be stale
from the previous frame).
2024-05-11 10:13:58 +02:00
Ramiro Polla
713c6eba8d libavcodec/motion_est: fix penalty_factor for b frames
In direct_search() and ff_estimate_b_frame_motion(), penalty_factor
would be used before being initialized in estimate_motion_b(). Also,
the initialization would happen more than once unnecessarily.
2024-05-11 09:38:34 +02:00
Haihao Xiang
ceace488ff lavc/vaapi_encode_av1: insert HDR_CLL metadata if have
Only look for HDR_CLL on key frame on the output.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-11 15:21:57 +08:00
Haihao Xiang
0bdf71ada7 lavc/vaapi_encode_av1: Insert HDR_MDCV metadata if have
Only look for HDR_MDVC on key frame on the output.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-11 15:21:57 +08:00
Haihao Xiang
7f3ba6bbfa lavc/vaapi_encode_av1: implement write_extra_header callback
This can be used to insert a metadata OBU to the stream later.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-11 15:21:57 +08:00
Niklas Haas
9c6c4f3d47 avcodec/libaomenc: properly clean up image metadata
This does not get consumed by aom_codec_encode().
2024-05-11 01:25:15 +02:00
Rémi Denis-Courmont
5afe734b6d lavu/riscv: remove bespoke assembler for MIN
This is no longer necessary as Zbb is now always explicitly required.
2024-05-10 18:59:06 +03:00
Rémi Denis-Courmont
6c6313f1b5 swscale/riscv: explicitly require Zbb for MIN 2024-05-10 18:59:06 +03:00
Rémi Denis-Courmont
c07af340ae lavc/riscv: explicitly require Zbb for MIN 2024-05-10 18:59:06 +03:00
Rémi Denis-Courmont
89029baebd lavu/riscv: allow requesting a second extension 2024-05-10 18:59:06 +03:00
sunyuechi
6e77af1c22 lavc/vp8dsp: R-V V put_epel v
C908:
vp8_put_epel4_v4_c: 11.0
vp8_put_epel4_v4_rvv_i32: 5.0
vp8_put_epel4_v6_c: 16.5
vp8_put_epel4_v6_rvv_i32: 6.2
vp8_put_epel8_v4_c: 43.7
vp8_put_epel8_v4_rvv_i32: 11.2
vp8_put_epel8_v6_c: 68.7
vp8_put_epel8_v6_rvv_i32: 13.2
vp8_put_epel16_v4_c: 92.5
vp8_put_epel16_v4_rvv_i32: 13.7
vp8_put_epel16_v6_c: 135.7
vp8_put_epel16_v6_rvv_i32: 16.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi
109daea619 lavc/vp8dsp: R-V V put_epel h
C908:
vp8_put_epel4_h4_c: 10.7
vp8_put_epel4_h4_rvv_i32: 5.0
vp8_put_epel4_h6_c: 15.0
vp8_put_epel4_h6_rvv_i32: 6.2
vp8_put_epel8_h4_c: 43.2
vp8_put_epel8_h4_rvv_i32: 11.2
vp8_put_epel8_h6_c: 57.5
vp8_put_epel8_h6_rvv_i32: 13.5
vp8_put_epel16_h4_c: 92.5
vp8_put_epel16_h4_rvv_i32: 13.7
vp8_put_epel16_h6_c: 139.0
vp8_put_epel16_h6_rvv_i32: 16.5

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi
538f217bbb lavc/vp8dsp: R-V V put_bilin_hv
C908:
vp8_put_bilin4_hv_c: 561.0
vp8_put_bilin4_hv_rvv_i32: 232.7
vp8_put_bilin8_hv_c: 2162.7
vp8_put_bilin8_hv_rvv_i32: 506.7
vp8_put_bilin16_hv_c: 4769.7
vp8_put_bilin16_hv_rvv_i32: 556.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi
bb5039b3cb lavc/vp8dsp: R-V V put_bilin_h v
C908:
vp8_put_bilin4_h_c: 367.0
vp8_put_bilin4_h_rvv_i32: 137.7
vp8_put_bilin4_v_c: 377.0
vp8_put_bilin4_v_rvv_i32: 137.7
vp8_put_bilin8_h_c: 1431.0
vp8_put_bilin8_h_rvv_i32: 297.5
vp8_put_bilin8_v_c: 1449.0
vp8_put_bilin8_v_rvv_i32: 297.5
vp8_put_bilin16_h_c: 2839.0
vp8_put_bilin16_h_rvv_i32: 344.7
vp8_put_bilin16_v_c: 2857.0
vp8_put_bilin16_v_rvv_i32: 344.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
sunyuechi
0b8e5e5a00 lavc/vp8dsp: R-V put_vp8_pixels
C908:
vp8_put_pixels4_c: 78.0
vp8_put_pixels4_rvi: 33.7
vp8_put_pixels8_c: 278.0
vp8_put_pixels8_rvi: 55.0
vp8_put_pixels16_c: 999.0
vp8_put_pixels16_rvi: 86.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-10 18:41:13 +03:00
Michael Niedermayer
d7924a4f60 avcodec/cbs_av1: Avoid shift overflow
Fixes: CID1465488 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:40 +02:00
Michael Niedermayer
f44f441555 fftools/ffplay: Check return of swr_alloc_set_opts2()
This probably makes no difference but its more correct

Fixes: CID1503080 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:40 +02:00
Michael Niedermayer
ba7038043a tools/opt_common: Check for malloc failure
Fixes: CID1539100 Negative loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:40 +02:00
Michael Niedermayer
91d27f7e02 doc/examples/demux_decode: Simplify loop
Fixes: CID1463550 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:39 +02:00
Michael Niedermayer
a5d1497f33 avformat/concatdec: Check file
Fixes: null pointer dereference
Fixes: -stream_loop 1 -ss 00:00:05 -i zgclab/ffmpeg_crash/poc2 -codec:v copy -codec:a aac -y output.mp4

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:39 +02:00
Michael Niedermayer
24bd01ea65 tools/target_enc_fuzzer: Only read pix_fmts if its set
Fixes: null pointer dereference
Fixes: rawvideo encoder

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:39 +02:00
Michael Niedermayer
c2918eb88e tools/target_enc_fuzzer: replace assert by clean exit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-09 16:17:38 +02:00
Dawid Kozinski
e4da96c6b2 avformat/evc: Small fixes in documentation
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-09 10:06:38 -03:00
Andreas Rheinhardt
6fa967810d tests/checkasm/svq1enc: Use proper range for input
ssd_int8_vs_int16 is only called from encode_block()
in svq1enc.c; it calls it in stages: At stage 0,
the int16_t array contains the difference of two
uint16_t. At each of the following stages, the
int16_t array is filled by subtracting an int8_t from
the current stage's int16_t array. The maximum stage
is five, so the int16_t are in the range
(-255 - 5 * 127)..(255 + 5 * 128).

This commit modifies the checkasm test to only use
values from this range, fixing (undefined) integer overflow
in the test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-09 13:40:18 +02:00
Andreas Rheinhardt
ebe78e3ef0 avfilter/af_volume: Don't free options manually
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-09 13:18:32 +02:00
Dawid Kozinski
e8e84dc325 avcodec/evc: Reference to ISO_IEC_23094-1-2020 document section for EVC_MAX_APS_COUNT enum has been fixed
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:15:05 -03:00
Dawid Kozinski
73d338d47c avformat/avi: Added EVC codec tag to the list of supported codec_id-codec_tag pairs for AVI muxer
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:15:05 -03:00
Dawid Kozinski
cf45526a0d avcodec/bitstream_filters: Declaration of the ff_evc_frame_merge_bsf variable has been moved to the appropriate following the alphabetical order
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:15:05 -03:00
Dawid Kozinski
0797651c12 avcodec/evc: Set the AV_FRAME_FLAG_KEY flag for a decoded frame when the decoded packet contains a keyframe
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2024-05-08 21:14:56 -03:00
James Almer
214cbe29dc x86/blockdsp: add sse2 and avx2 versions of fill_block_tab
blockdsp.fill_block_tab[0]_c: 34.1
blockdsp.fill_block_tab[0]_sse2: 11.1
blockdsp.fill_block_tab[0]_avx2: 10.1
blockdsp.fill_block_tab[1]_c: 10.1
blockdsp.fill_block_tab[1]_sse2: 6.1
blockdsp.fill_block_tab[1]_avx2: 5.6

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-08 21:13:23 -03:00
James Almer
b6054e57cb checkasm/blockdsp: use smallest allowed aligned buffers for fill_block_tab tests
The requirement is either 8 or 16 bytes alignment, not 32.
This should help finding bugs in asm implementations.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-08 21:13:23 -03:00
James Almer
febd9271fc checkasm/blockdsp: don't randomize the buffers for fill_block_tab
It ignores and overwrites the previous values.
Fixes running the test under ubsan.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-08 21:13:23 -03:00
PoorvaGaikar
8b6e66d0f0 avfilter/f_select.c: add support for iw and ih variables
Fixes ticket #10509.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-08 21:33:32 +02:00
Brad Smith
9e674b3160 lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's
The proper type was used until 73251678c8.

This covers all of the OS's that currently have V4L2 support, permutations
of Linux glibc/musl, Android bionic, FreeBSD, NetBSD, OpenBSD, Solaris.

Copied from FreeBSD ports patch.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-08 21:33:32 +02:00
Rémi Denis-Courmont
f8715d0300 lavc/vp9dsp: fix compilation with llvm-as 2024-05-08 18:26:32 +03:00
Rémi Denis-Courmont
1f150a68ac lavu/riscv: fix build without <sys/hwprobe.h> 2024-05-08 18:26:32 +03:00
James Almer
4e069ba80a avutil/opt: free the temporary layout in av_opt_is_set_to_default()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
James Almer
ae0293ee41 avutil/opt: propagate av_dict_copy() errors in av_opt_{get,set}_dict_val()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
James Almer
9614efc258 avutil/opt: don't set a channel layout if the option is flagged as read only
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
James Almer
2987c65caa avutil/opt: add a note about the av_opt_{get,set}_chlayout() behavior
Based on the one for av_opt_set_dict_val().

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-07 20:11:42 -03:00
Andreas Rheinhardt
894879a1df avfilter/Makefile: Add missing morpho->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
1739dba536 configure: Add missing identity filter->scene_sad dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
b5cf359c97 avfilter/Makefile: Add missing identity->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
9ec928e627 avfilter/x86/Makefile: Fix standalone build of haldclut filter
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
0d80348748 avfilter/vf_lut3d: Fix standalone build of lut1d
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
afda5ee7b9 avfilter/Makefile: Add missing multiply->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
c11d7ca2f0 avfilter/x86/Makefile: Add missing dependencies for sobel filter
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
3c7dc9ea59 avfilter/vf_convolution: Fix compilation with sobel disabled
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
dd246bdc0f avfilter/Makefile: Add missing guided->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
7e582d8b3e avfilter/vsrc_testsrc: Fix compilation of colorchart filter
Move set_color() out of the CONFIG_TESTSRC2_FILTER block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
03618ee8a8 avfilter/Makefile: Add scale(2ref)->framesync dependency
Forgotten in e82a3997cd.

Reviewed-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
2e1b95283e avfilter/vf_xmedian: Define OFFSET, FLAGS macros unconditionally
They are currently defined inside the #if CONFIG_XMEDIAN_FILTER
block. Fixes standalone compilation of the tmedian filter.
Broken in f58939affe.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
db53ee915d avfilter/Makefile: Add missing colormap->framesync dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
609d2c01ea avfilter/Makefile: Add missing tiltshelf entry
Forgotten in 525f83becd.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
5de78958e4 avformat/Makefile: Add asf_muxer->asf_tags.o dependency
Forgotten in 493356cc0b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
07c1bd5feb avcodec/Makefile: Fix intrax8 objects
Forgotten in d1d30edf42.
This fixes standalone compilation of the VC-1 based
decoders when using shared builds (for static builds,
nothing pulls in msmpeg4data.o, yet for shared builds
the default behaviour of linkers is different, leading
to undefined references because msmpeg4data.o relies
on stuff from mpeg4video.o).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
2e7bd08c4c configure: Add wmv2dsp->qpeldsp dependency
It reuses e.g. ff_put_pixels8_l2_8() directly even though
it never initializes a QpelDSPContext.
Fixes standalone compilation of the wmv2 encoder (the decoder
already has a qpeldsp dependency via the h263 decoder).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
8b7f089e4b avcodec/Makefile: Correct name of cbd2_dpcm decoder
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
df2416ca97 Remove remnants of prores_lgpl decoder
Forgotten in 5c6a3604f0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
db2cd9cabf avcodec/Makefile, v408(dec|enc): Remove remnants of AYUV codecs
Forgotten in 9ee59b63f5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
b2003d6dcc configure: Add missing ftr decoder->adts_header dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
3c7c5e42f2 configure: Add missing atrac3p(al) decoder->sinewin dependency
atrac3plusdsp.o needs it.
Broken in 34330adb29.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
1261ca2c85 configure: Add missing pdv decoder->inflate_wrapper dependency
A dependency on zlib is not enough.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Andreas Rheinhardt
aebddfd4d6 configure: Add missing dirac_decoder->qpeldsp dependency
Forgotten in fd0e37f126.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 23:53:26 +02:00
Marton Balint
8d92f59d11 avformat/file: fail for non-numerical arguments to pipe:
Before this patch, the implementation of pipe: inputs/outputs would
silently fall back to stdin/stdout for any argument not successfully
parsed by strtol().

This patch introduces an explicit error for any non-numerical arguments,
which should avoid user confusion as in #10977.

New behavior:

$ cat /tmp/video.mkv | ./ffmpeg -i pipe:aa -acodec copy -vcodec copy -f matroska pipe:1 | cat >/tmp/out.mkv

[pipe @ 0x5618c7bcf740] Non-numerical argument "aa" to pipe:
[in#0 @ 0x5618c7bced00] Error opening input: Invalid argument
Error opening input file pipe:aa.
Error opening input files: Invalid argument

Based on the patch of Nils Goroll <nils.goroll@uplex.de>.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-05-07 23:38:05 +02:00
Andreas Rheinhardt
39ce8a9695 avcodec/diracdec: Don't use EDGE_WIDTH from mpegpicture.h
There is nothing that forces us to use the same value
as mpegvideo_enc.c, so define our own constant.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 13:24:32 +02:00
Andreas Rheinhardt
2eab5a1f54 avcodec/aac/aacdec: Fix linking errors with only one decoder enabled
This is achieved by using function pointers for AAC SBR functions.
This unfortunately necessitated to use void* in
ff_aac_sbr_apply(_fixed).
Fixes ticket #10999.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 12:33:50 +02:00
Mandava, Mounika
b1037d4ebe lavc/qsvenc: add support for oneVPL string API
A new option -qsv_params <str> is added, where <str> is a :-separated
list of key=value parameters.

Example:
$ ffmpeg -y -f lavfi -i testsrc -vf "format=nv12" -c:v h264_qsv -qsv_params
"TargetUsage=1:GopPicSize=30:GopRefDist=2:TargetKbps=5000" -f null -

Signed-off-by: Mounika Mandava <mounika.mandava@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-07 11:06:37 +08:00
Haihao Xiang
df76c3756d lavc/qsvenc: always allocate the array to store mfxExtBuffer points
This allows us to append mfxExtBuffer per user's settings

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-05-07 11:06:37 +08:00
Andreas Rheinhardt
f5d2dc7b4b avcodec/aac/aacdec_(fixed|float): Set AACDecDSP, AACDecProc directly
This is more in line with how we initialize DSP functions
and avoids tables of function pointers as well as relocations
for these.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 00:02:57 +02:00
Andreas Rheinhardt
8762aa4d62 avcodec/aac/aacdec: Move init functions to aacdec_fixed/float
This allows to merge it with AACDecDSP.init and remove the latter
(it is called only once anyway); it also allows to make
the fixed/float AACDecDSP and AACDecProc implementations internal
to aacdec_fixed/float.c (which also fixes a violation of our
naming conventions). And it some linker errors when either decoder
is disabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 00:01:39 +02:00
Andreas Rheinhardt
0fc3d8e4d6 avcodec/aac/aacdec: Avoid compiling latm decoder if disabled
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-07 00:00:04 +02:00
Andreas Rheinhardt
d4fb110f5c avcodec/aac/aacdec: Mark flush as cold
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:59:43 +02:00
Andreas Rheinhardt
41922bef7a avcodec/aac/aacdec_(fixed|float): Avoid AAC_RENAME, INTFLOAT
Unnecessary now that this has been detemplatized.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:59:27 +02:00
Andreas Rheinhardt
c13b5d96c8 avcodec/aac/aacdec_float: Call ff_aac_float_common_init() only once
That's enough.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:59:10 +02:00
Andreas Rheinhardt
41ea317ced avcodec/aac/aacdec: Avoid branch to set sample_fmt
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:58:58 +02:00
Andreas Rheinhardt
ef16882e8f avcodec/aac/aacdec: Move channel number check out of init_dsp()
Also move initializing random_state.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:58:31 +02:00
Andreas Rheinhardt
e4e9144a5c avcodec/aac/aacdec: Remove unnecessary ff_thread_once()
ff_aacdec_common_init_once() already uses its own AVOnce.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:58:08 +02:00
Andreas Rheinhardt
44474dd7b9 avcodec/aacsbr: Fix type mismatch
ff_aac_sbr_apply() and ff_aac_sbr_apply_fixed() still used
pointers to INTFLOAT which is float or int depending upon
whether USE_FIXED is set or not; in particular, according
to these declarations both functions have the same type.
But that is wrong and given that aacdec.c sets USE_FIXED,
it sees the wrong type for ff_aac_sbr_apply().
This leads to a -Wlto-type-mismatch warning when using lto [1].
Fix this by avoiding INTFLOAT in aacsbr.h (which also means
that aac_defines.h need not be included there any more).

[1]: https://fate.ffmpeg.org/log.cgi?slot=x86_64-archlinux-gcc-lto&time=20240506022217&log=compile

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:57:41 +02:00
Andreas Rheinhardt
e6bf540048 avcodec/aactab: Provide ff_ltp_coef, ff_tns_tmp2_map unconditionally
The fixed point decoder needs it since
905fdb0601.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 23:56:40 +02:00
Mark Thompson
7b482815a0 vulkan_av1: Fix force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson
b73e6af337 vaapi_av1: Fix force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson
b62d385ecf nvdec_av1: Use av1dec force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson
e5a5125bbe vdpau_av1: Use av1dec force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson
5162247092 dxva2_av1: Use av1dec force_integer_mv value 2024-05-06 20:17:50 +01:00
Mark Thompson
6f56e0e7e5 av1dec: Add force_integer_mv derived field for decoder use
This is not the same as the syntax element value in the frame header
because the specification parsing tables override the value on intra
frames.
2024-05-06 20:17:50 +01:00
Rémi Denis-Courmont
9e77188cba lavc/ac3dsp: R-V Zbb ac3_exponent_min
SiFive U74:
ac3_exponent_min_reuse0_c:       10.0
ac3_exponent_min_reuse0_rvb_b:    8.0
ac3_exponent_min_reuse1_c:     2924.7
ac3_exponent_min_reuse1_rvb_b: 1803.0
ac3_exponent_min_reuse2_c:     5043.0
ac3_exponent_min_reuse2_rvb_b: 2827.5
ac3_exponent_min_reuse3_c:     7028.7
ac3_exponent_min_reuse3_rvb_b: 3872.0
ac3_exponent_min_reuse4_c:     8824.2
ac3_exponent_min_reuse4_rvb_b: 5122.2
ac3_exponent_min_reuse5_c:    10487.5
ac3_exponent_min_reuse5_rvb_b: 6412.2
2024-05-06 22:10:16 +03:00
Rémi Denis-Courmont
95d1052fba lavu/riscv: add hwprobe() for CPU detection
This adds the Linux-specific function call to detect CPU features. Unlike
the more portable auxillary vector, this supports extensions other than
single lettered ones. At this point, FFmpeg already needs this to detect
Zba and Zbb at run-time, and probably will need it for Zvbb in the near
future.

Support will be available in glibc 2.40 onward.
2024-05-06 22:09:41 +03:00
Rémi Denis-Courmont
d7333ba6f2 lavu/riscv: indent code
This reindents code to prepare for the next changeset.
No functional changes.
2024-05-06 22:09:41 +03:00
Andreas Rheinhardt
2f8bf90054 avcodec/allcodecs: Remove LIBX264_CONST
Possible since 71669f2ad5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-06 14:51:56 +02:00
Nuo Mi
a9586a00df avcodec/vvcdec: ff_vvc_frame_submit, avoid initializing task twice.
For some error bitstreams, a CTU belongs to two slices/entry points.
If the decoder initializes and submmits the CTU task twice, it may crash the program
or cause it to enter an infinite loop.

Reported-by: Frank Plowman <post@frankplowman.com>
2024-05-06 20:22:42 +08:00
Michael Niedermayer
96449cfeae avcodec/mpegvideo_enc: Fix 1 line and one column images
Fixes: Ticket10952
Fixes: poc21ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:41 +02:00
Michael Niedermayer
a3bb269db9 avcodec/amrwbdec: assert mode to be valid in decode_fixed_vector()
Inspired-by: CID1473499 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:41 +02:00
Michael Niedermayer
a2ec2bd493 avcodec/wavarc: fix integer overflow in decode_5elp() block type 2
Fixes: signed integer overflow: 2097152000 + 107142979 cannot be represented in type 'int'
Fixes: 67919/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-5955101769400320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:41 +02:00
Michael Niedermayer
1330a73cca swscale/output: Fix integer overflow in yuv2rgba64_full_1_c_template()
Fixes: signed integer overflow: -1082982400 + -1079364728 cannot be represented in type 'int'
Fixes: 67910/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5329011971522560
The input is 9bit in 16bit, the fuzzer fills all 16bit thus generating "invalid" input
No overflow should happen with valid input.

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:40 +02:00
Michael Niedermayer
a56559e688 swscale/output: Fix integer overflow in yuv2rgba64_1_c_template
Fixes: signed integer overflow: -831176 * 9539 cannot be represented in type 'int'
Fixes: 67869/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5117342091640832

The input is 9bit in 16bit, the fuzzer fills all 16bit thus generating "invalid" input
No overflow should happen with valid input.

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:40 +02:00
Michael Niedermayer
c7075cdb67 avcodec/dovi_rpuenc: Initialize bl_compat_id
Fixes: CID1596607 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-06 03:00:40 +02:00
James Almer
2e16285fe8 avformat/iamf_reader: split "if ((ret = ...) < 0)" line
Cosmetic change.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer
0ec8f3c55a avformat/mov: don't use stream duration to calculate bitrate with fragmented input
sc->data_size may contain the size of a single fragment after probing, and
using it alongside the duration of the entire stream to calculate bitrate
will result in a bogus small value.

Before:
  Duration: 00:00:05.00, start: 0.000000, bitrate: 586 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 112 kb/s, 60 fps, 60 tbr, 15360 tbn (default)

After:
  Duration: 00:00:05.00, start: 0.000000, bitrate: 586 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 561 kb/s, 60 fps, 60 tbr, 15360 tbn (default)

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer
82397084a9 avfilter/vf_scale: properly reinitialize framesync
Fixes leaks as reported by ASAN and Valgrind.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer
ccf395e8bd avfilter/framesync: reset nb_in on allocation failure
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
James Almer
eb392e4100 avfilter/vf_scale: don't expose framesync options in vf_scale2ref
It doesn't use them.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-05 21:37:07 -03:00
Derek Buitenhuis
f8a613d6a8 fftools/ffprobe: Avoid overflow when calculating DAR
Both the codecpar's width and height, and the SAR num and den are
ints, which can overflow. Cast to int64_t, which is what av_reduce
takes.

Without this, occasionally, display_aspect_ratio can be negative in
ffprobe's -show_stream output.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-05-05 11:56:29 +01:00
James Almer
088bf6e8c1 avutil/iamf: use AV_OPT_TYPE_UINT
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:31:33 -03:00
James Almer
d6e877bbcd avutil/iamf: fix offsets for mix_gain options
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:20:35 -03:00
James Almer
d053290d8d avutil/opt: add an unsigned option type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:17:40 -03:00
James Almer
9902fc550a avutil/tests/opt: test values > INT_MAX for INT64 type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:11:47 -03:00
James Almer
72ac495960 avutil/tests/opt: test negative values for INT and INT64 types
Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-04 21:11:47 -03:00
Andreas Rheinhardt
2c77dc5aad avformat/movenc: Avoid loop for writing array
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-04 16:30:22 +02:00
Andreas Rheinhardt
601873263e avformat/movenc: Check av_malloc()
Fixes Coverity issue #1596735.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-04 16:29:58 +02:00
Niklas Haas
df868bae23 doc/filters: mention scale2ref in replacement example
So ctrl+f "scale2ref" finds it.
2024-05-04 13:15:15 +02:00
Niklas Haas
8bf0a9c2ca doc/filters: move scale=ref_* to correct sectton
This was accidentally filed under scale_npp, instead of scale. (Why is
this entire section basically duplicated anyway?)
2024-05-04 13:15:11 +02:00
Niklas Haas
6a5b021e35 avfilter/vf_scale: fix input declaration
This filter needs to be marked as having only one input by default, with
AVFILTER_FLAG_DYNAMIC_INPUTS allowing the extra input to be added at
init() time.

Fixes: bb80445813
2024-05-04 13:07:27 +02:00
Rémi Denis-Courmont
38f67a32b3 lavc/ac3dsp: R-V V min_exponents
T-Head C908:
ac3_exponent_min_reuse0_c:         7.5
ac3_exponent_min_reuse0_rvv_i32:   7.5
ac3_exponent_min_reuse1_c:      1820.7
ac3_exponent_min_reuse1_rvv_i32: 102.5
ac3_exponent_min_reuse2_c:      3088.5
ac3_exponent_min_reuse2_rvv_i32: 138.7
ac3_exponent_min_reuse3_c:      5073.7
ac3_exponent_min_reuse3_rvv_i32: 174.7
ac3_exponent_min_reuse4_c:      4624.2
ac3_exponent_min_reuse4_rvv_i32: 204.2
ac3_exponent_min_reuse5_c:      5138.7
ac3_exponent_min_reuse5_rvv_i32: 238.0
2024-05-04 10:17:11 +03:00
Marcus B Spencer
5e7180864f avutil/opt: Clarify type of integers
Clarify comment regarding type of integers regarding AV_OPT_TYPE_IMAGE_SIZE.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-04 01:15:05 +02:00
sunyuechi
5bc3b7f513 lavc/rv40dsp: R-V V chroma_mc
This is similar to h264, but here we use manual_avg instead of vaaddu
because rv40's OP differs from h264. If we use vaaddu,
rv40 would need to repeatedly switch between vxrm=0 and vxrm=2,
and switching vxrm is very slow.

C908:
avg_chroma_mc4_c: 2330.0
avg_chroma_mc4_rvv_i32: 602.7
avg_chroma_mc8_c: 1211.0
avg_chroma_mc8_rvv_i32: 602.7
put_chroma_mc4_c: 1825.0
put_chroma_mc4_rvv_i32: 414.7
put_chroma_mc8_c: 932.0
put_chroma_mc8_rvv_i32: 414.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 18:00:53 +03:00
sunyuechi
cfa8d2488d checkasm/rv40dsp: add chroma_mc test
This is similar to h264.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 18:00:53 +03:00
sunyuechi
7d0673db7e lavc/blockdsp: R-V V fill_block
C908:
blockdsp.fill_block_tab[0]_c: 549.7
blockdsp.fill_block_tab[0]_rvv_i64: 48.2
blockdsp.fill_block_tab[1]_c: 77.0
blockdsp.fill_block_tab[1]_rvv_i64: 19.7

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 17:49:23 +03:00
sunyuechi
b369c4d569 checkasm/blockdsp: add fill_block test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-05-03 17:49:23 +03:00
Rémi Denis-Courmont
6cd97cd797 lavc/ac3dsp: R-V V sum_square_butterfly_float
As we do not need to widen accumulators to 64 bits, we effectively get
double capacity for unrolling compared to the integer function. This
explains the slightly better performance gains.

ac3_sum_square_bufferfly_float_c:       65.2
ac3_sum_square_bufferfly_float_rvv_f32: 12.2
2024-05-03 17:48:46 +03:00
Rémi Denis-Courmont
6459966beb lavc/ac3dsp: R-V V sum_square_butterfly_int32
ac3_sum_square_bufferfly_int32_c:       61.0
ac3_sum_square_bufferfly_int32_rvv_i64: 14.7
2024-05-03 17:48:46 +03:00
Niklas Haas
95568c4e31 avfilter/scale2ref: deprecate in favor of scale=rw:rh
And remove it from the documentation.
2024-05-03 14:23:23 +02:00
Niklas Haas
5b5e692da6 fate/scale2ref_keep_aspect: switch to vf_scale ref_* 2024-05-03 14:23:23 +02:00
Niklas Haas
bb80445813 avfilter/vf_scale: add optional "ref" input
This is automatically enabled if the width/height expressions reference
any ref_* variable. This will ultimately serve as a more principled
replacement for the fundamentally broken scale2ref.

See-Also: https://trac.ffmpeg.org/ticket/10795
2024-05-03 14:23:23 +02:00
Niklas Haas
e82a3997cd avfilter/vf_scale: switch to FFFrameSync
Preliminary commit, in anticipation of adding support for multiple
inputs (with proper synchronization and activate() callback).
2024-05-03 14:23:23 +02:00
Niklas Haas
a5032dc12a avfilter/framesync: make framesync_class un-static
And rename to ff_framesync_class. More convenient for downstream users.
2024-05-03 14:23:22 +02:00
Michael Niedermayer
69b4d9736b avcodec/av1dec: Change bit_depth to int
Suggested-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:50 +02:00
Michael Niedermayer
fd7d24fa3f avcodec/av1dec: bit_depth cannot be another values than 8,10,12
Fixes: CID1544265 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:50 +02:00
Michael Niedermayer
f9218e4d52 avcodec/avs3_parser: assert the return value of init_get_bits()
Fixes: CID1492867 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:50 +02:00
Michael Niedermayer
a7c4f119c9 avcodec/avs2_parser: Assert init_get_bits8() success with const size 15
Fixes: CID1506708 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-03 02:35:49 +02:00
Andreas Rheinhardt
c3ca90a92e avcodec/x86/vp3dsp_init: Set correct function pointer, fix crash
Regression since fd172185580c1ccdcfb90bbfdb59fa806fad3117;
triggered by vp4/KTkvw8dg1J8.avi in the FATE suite, but not
when running fate as this code is not used when the bitexact
flag is set.

Bisecting done by ami_stuff, patch from user Mika Fischer
in ticket #10027 (which this commit fixes).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-02 23:38:15 +02:00
Andreas Rheinhardt
9fb3d640fb avcodec/av1dec: Always set ret before goto end
Before 0f8763fbea, av1_frame_ref()
and update_reference_list() could fail and therefore needed to
be checked, which incidentally set ret. This is no longer happening,
leading to a potential use of an uninitialized value which is
also the subject of Coverity ticket #1596605.

Fix this by always setting ret before goto end; do not return
some random ancient value.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-05-02 23:37:16 +02:00
James Almer
86e418ffd7 avcodec/avcodec: free decoded_side_data in ff_codec_close()
It's set by the library when decoding, so it should be freed when closing the
context.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-05-02 10:39:56 -03:00
Niklas Haas
71669f2ad5 avcodec/libx264: bump minimum required version to 155
This version is seven years old, and present in Debian oldoldstable,
Ubuntu 20.04 and Leap 15.0.

Allows cleaning up the file substantially. In particular, this is
motivated by the desire to stop relying on init_static_data.
2024-05-02 12:12:49 +02:00
Timo Rothenpieler
476688095f configure: handle xargs versions that exec empty commands
Some versions of xargs don't run any commands if no input is given,
others do run it at least once, causing errors.
Pass -r to xargs to avoid that behaviour and never run empty commands.
2024-05-01 19:40:00 +02:00
Timo Rothenpieler
95edaf72b4 configure: support msvc build inside WSL 2024-05-01 19:00:36 +02:00
Michael Niedermayer
e757726e89 avfilter/avfiltergraph: return value of ff_request_frame() is unused
Fixes: CID1397741 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:13 +02:00
Andrew Sayers
99e43a6dfe lavu/opt: Clarify the scope of AVOptions
See discussion on the mailing list:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-April/326054.html

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:13 +02:00
Michael Niedermayer
9f54c13bc4 avformat/iamfdec: check nb_streams in header read
Fixes: Assertion pkt->stream_index < (unsigned)s->nb_streams && "Invalid stream index.\n" failed at libavformat/demux.c:572
Fixes: 67890/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5166340789829632.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:12 +02:00
Michael Niedermayer
20a6bfda0f avformat/mxfdec: Check body_offset
Fixes: signed integer overflow: 538976288 - -9223372036315799520 cannot be represented in type 'long'
Fixes: 68060/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5523457266745344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:12 +02:00
Michael Niedermayer
c26a762ea1 avformat/kvag: Check sample_rate
Fixes: Division by 0
Fixes: -copyts -start_at_zero -itsoffset 00:00:01 -itsscale 1 -ss 00:00:02  -i zgclab/ffmpeg_crash/poc1 output.mp4

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:12 +02:00
Michael Niedermayer
615c994739 avcodec/atrac9dec: Check init_get_bits8() for failure
Fixes: CID1439569 Unchecked return value
Fixes: CID1439578 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:11 +02:00
Michael Niedermayer
63415168db avcodec/ac3_parser: Check init_get_bits8() for failure
Fixes: CID1420393 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:11 +02:00
James Almer
e09164940e avformat/mov: free the infe allocated item data on failure
Fixes: memleak
Fixes: 68212/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4963488540721152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-30 18:29:38 -03:00
Martin Storsjö
d11be191fa checkasm: vc1dsp: Align buffers sufficiently for the mspel tests
This fixes crashes in the mspel tests on x86.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-30 23:13:47 +03:00
Niklas Haas
1d89de03d6 avcodec/dovi_rpuenc: avoid division by zero
Fixes: https://trac.ffmpeg.org/ticket/10985
2024-04-30 21:35:42 +02:00
James Almer
b7debef3cc avformat/mov: support SpatialAudioBox ambisonic layouts with non-diegetic channels
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-30 11:15:13 -03:00
James Almer
37c8d93e56 avformat/mov: support SpatialAudioBox ambisonic layouts with arbitrary channel mapping
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-30 11:15:13 -03:00
Andreas Rheinhardt
08781ebe1a avcodec/riscv/vp9dsp: Fix inclusion guard
Fixes fate-source.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-29 21:23:32 +02:00
sunyuechi
c3a96f97f8 lavc/vp9dsp: R-V V ipred dc
C908:
vp9_dc_8x8_8bpp_c: 46.0
vp9_dc_8x8_8bpp_rvv_i64: 41.0
vp9_dc_16x16_8bpp_c: 109.2
vp9_dc_16x16_8bpp_rvv_i32: 72.7
vp9_dc_32x32_8bpp_c: 365.2
vp9_dc_32x32_8bpp_rvv_i32: 165.5
vp9_dc_127_8x8_8bpp_c: 23.0
vp9_dc_127_8x8_8bpp_rvv_i64: 22.0
vp9_dc_127_16x16_8bpp_c: 70.2
vp9_dc_127_16x16_8bpp_rvv_i32: 50.2
vp9_dc_127_32x32_8bpp_c: 295.2
vp9_dc_127_32x32_8bpp_rvv_i32: 136.7
vp9_dc_128_8x8_8bpp_c: 23.0
vp9_dc_128_8x8_8bpp_rvv_i64: 22.0
vp9_dc_128_16x16_8bpp_c: 70.2
vp9_dc_128_16x16_8bpp_rvv_i32: 50.2
vp9_dc_128_32x32_8bpp_c: 295.2
vp9_dc_128_32x32_8bpp_rvv_i32: 136.7
vp9_dc_129_8x8_8bpp_c: 23.0
vp9_dc_129_8x8_8bpp_rvv_i64: 22.0
vp9_dc_129_16x16_8bpp_c: 70.2
vp9_dc_129_16x16_8bpp_rvv_i32: 50.2
vp9_dc_129_32x32_8bpp_c: 295.2
vp9_dc_129_32x32_8bpp_rvv_i32: 136.7
vp9_dc_left_8x8_8bpp_c: 38.0
vp9_dc_left_8x8_8bpp_rvv_i64: 36.0
vp9_dc_left_16x16_8bpp_c: 93.2
vp9_dc_left_16x16_8bpp_rvv_i32: 67.7
vp9_dc_left_32x32_8bpp_c: 333.2
vp9_dc_left_32x32_8bpp_rvv_i32: 158.5
vp9_dc_top_8x8_8bpp_c: 38.7
vp9_dc_top_8x8_8bpp_rvv_i64: 36.0
vp9_dc_top_16x16_8bpp_c: 93.2
vp9_dc_top_16x16_8bpp_rvv_i32: 67.7
vp9_dc_top_32x32_8bpp_c: 333.2
vp9_dc_top_32x32_8bpp_rvv_i32: 156.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-04-29 20:46:05 +03:00
sunyuechi
dedc2456bf checkasm/vc1dsp: add mspel_pixels test
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-04-29 20:34:29 +03:00
Lynne
f492095bd3 opustab: macro constant as a double
May increase intermediate precision on some compilers.
2024-04-29 15:30:25 +02:00
Zhao Zhili
cf4af4bca0 avcodec/mediacodecenc: Flush bsf after create extradata
Avoid leaving any data inside bsf while also avoid keep bsf in
EOF state.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-29 15:58:48 +08:00
David Rosca
1e2ac489a4 lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers
This allows some optimizations in driver, such as not having to read
back the data if write-only mapping is requested.
2024-04-29 11:08:41 +08:00
Haihao Xiang
578ac59887 lavfi/qsv: Copy metadata fields from the given input
Currently it always copies the metadata fields from the last input when
there are multiple inputs for the filter. For example, the metadata
fields from input1 are copied to the output for overlay_qsv filter,
however for regular overlay filters, the metadata fields from input0 are
copied to the output. With this fix, we may copy the metadata fields
from input0 to the ouput as well.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-29 11:08:41 +08:00
Fei Wang
67fc9b8427 lavc/qsvdec: Use FFmpeg default 1/25 framerate if can't derive it from bitstream
Fix error:
$ ffmpeg -hwaccel qsv -i input.h265 -f null -
...
[null @ 0x55da1a629200] Application provided invalid, non monotonically
increasing dts to muxer in stream 0: 3 >= 3

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-04-29 11:08:41 +08:00
Andreas Rheinhardt
651f3aa7f9 avcodec/h264dec: Remove unused coded_picture_number
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-28 19:13:17 +02:00
Yotam Ofek
a9a69a5a31 avcodec/aacenc: don't redundantly re-compute max sfb
Remove an unneeded inner loop in adjust_frame_information that
had no effect, the loop body can be run only once and will compute
the same max sfb.
2024-04-28 13:59:57 +02:00
James Almer
31327c2d07 avformat/mov: fix the check for the heif item parsing loop
Fixes: Null pointer dereference
Fixes: 67861/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5352628142800896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-27 19:39:23 -03:00
Timo Rothenpieler
59767636c7 fate: allow https for git URLs 2024-04-27 23:24:58 +02:00
Michael Niedermayer
091fdce87e avcodec/pngdec: Check last AVFrame before deref
Fixes: NULL pointer dereference
Fixes: 68184/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-4926478069334016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-27 21:16:40 +02:00
Michael Niedermayer
d9699464c3 avcodec/vp3: Call ff_progress_frame_unref() before ff_progress_frame_get_buffer()
Fixes: Assertion !f->f && !f->progress failed at libavcodec/decode.c:1688
Fixes: 68190/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-5942090287611904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-27 21:16:40 +02:00
Michael Niedermayer
5eb05f4450 avcodec/hevcdec: Check ref frame
Fixes: NULL pointer dereferences
Fixes: 68197/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6382538823106560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-27 21:16:39 +02:00
Andreas Rheinhardt
4c8a6631ad fftools/ffmpeg_filter: Fix check
Fixes Coverity issues #1596529, #1596531.
Introduced in 8e35e33d42.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-27 17:00:12 +02:00
Andreas Rheinhardt
67c7c44c79 avcodec/vp8: Return error on error
Regression since e1ba00ac8f.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-27 16:55:00 +02:00
Lynne
3390693bfb aacdec: avoid generating unused code when either implementation is disabled
Minor optimization to remove extra branches.
We need to include the header for xHE anyway, which is float-only.
2024-04-27 11:12:12 +02:00
Lynne
134dba9544 opusdsp: add ability to modify deemphasis constant
xHE-AAC relies on the same postfilter mechanism
that Opus uses to improve clarity (albeit with a steeper
deemphasis filter).

The code to apply it is identical, it's still just a
simple IIR low-pass filter. This commit makes it possible
to use alternative constants.
2024-04-27 11:12:07 +02:00
Niklas Haas
a2cdb2f5be avfilter/f_sidedata: synchronize with side data list
Add all recently added frame data types, as well as the more consistent
name DETECTION_BBOXES as an alias to DETECTION_BOUNDING_BOXES.
2024-04-26 21:02:46 +02:00
Derek Buitenhuis
2d5fa816fb avformat/http: Add support for Retry-After header
429 and 503 codes can, and often do (e.g. all Google Cloud
Storage URLs can), return a Retry-After header with the error,
indicating how long to wait, asd either a date, or in seconds,
before retrying again. If it is not respected by, for example,
using our default backoff stratetgy instead, chances of success
are very unlikely.

Some references:
    * https://datatracker.ietf.org/doc/html/rfc6585
    * https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.3

This adds an AVOption to respect that header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 15:21:25 +01:00
Derek Buitenhuis
6d89fd4c27 avformat/http: Rename parse_set_cookie_expiry_time to parse_http_date
That is what it actually does, and it will be needed for more
than the Expiry header soon.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 15:21:25 +01:00
Derek Buitenhuis
1f8e5b6d95 doc/protocols: Fill in missing HTTP options
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:21:25 +01:00
Derek Buitenhuis
5d568b16a0 doc/protocols: Re-order HTTP options to match http.c order
This makes the list easier to maintain.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:20:28 +01:00
Derek Buitenhuis
31de02cf31 avformat/http: Add option to limit total reconnect delay
The existing option only allows users to set the max delay for a
single attempt, rather than the total allowed delay, which is both
pretty unintitive, and only applicable when exponential backoff is
used.

The default for this option is set to 256, which is just above the
effective total delay accomplished by the the existing
reconnect_delay_max default of 120.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:19:50 +01:00
Derek Buitenhuis
10374ab5ed avformat/http: Add options to set the max number of connection retries
Not every use case benefits from setting retries in terms of the backoff.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:17:33 +01:00
Derek Buitenhuis
a776d524e1 avformat/http: Rename attempts to auth_attempts
This accurately reflects what it does, as per
e75bbcf493.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:15:32 +01:00
Derek Buitenhuis
fa00624693 avformat/http: Don't bail on parsing headers on "bad" HTTP codes
Many "bad" HTTP codes like 429 and 503 may include important info in
their headers.

Also, in general, there is no purpose in bailing here.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:15:08 +01:00
Derek Buitenhuis
b79260550b avformat/http: Use AVERROR_HTTP_TOO_MANY_REQUESTS
Added in the previous commit.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:14:36 +01:00
Derek Buitenhuis
bcae59b898 avutil/error: Add HTTP 429 Too Many Requests AVERROR code
This is a common error code from e.g. CDNs or cloud storage, and
it is useful to be able to handle it differently to a generic
4XX code.

Its source is RFC6585.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:13:47 +01:00
James Almer
5fc4a824db fate/iamf: don't demux packets in fate-iamf-5_1-{copy,demux}
They contain side data whose size is arch dependent.
This fixes fate failures on 32bit targets.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-25 09:36:19 -03:00
Michael Niedermayer
cae0f2bc55 doc/examples/qsv_transcode: Initialize pointer before free
Fixees: CID1517023 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:59 +02:00
Michael Niedermayer
191950d1bf doc/examples/qsv_transcode: Simplify str_to_dict() loop
Fixes: CID1517022 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:59 +02:00
Michael Niedermayer
c9c11a0866 doc/examples/vaapi_transcode: Simplify loop
Fixes: CID1428858(1/2) Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:58 +02:00
Michael Niedermayer
82cce20934 doc/examples/qsv_transcode: Simplify loop
Fixes: CID1428858(2/2) Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: "Xiang, Haihao" <haihao.xiang@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-25 03:24:58 +02:00
Diego Felix de Souza
9d675bb60d avcodec/nvenc: add high bit depth encoding for HEVC
Adding 10-bit encoding support for HEVC if the input is 8-bit. In
case of 8-bit input content, NVENC performs an internal CUDA 8 to
10-bit conversion of the input prior to encoding. Currently, only
AV1 supports encoding 8-bit content as 10-bit.

Signed-off-by: Diego Felix de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-04-25 00:33:13 +02:00
James Almer
1a8d50e379 fate/iamf: add a demux text
Using the same input sample as iamf-5_1-copy, in order to compare both test's output

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 18:12:05 -03:00
James Almer
8c27cdd2d4 fftools/ffmpeg_mux_init: add missing IAMF Param Definition copies
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 18:12:00 -03:00
James Almer
f684228407 fftools/ffmpeg_mux_init: remove leftover debug log messages
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 17:37:13 -03:00
James Almer
b9af58184f avutil/iamf: fix mix_gain_class name
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 17:37:12 -03:00
James Almer
8c0045f013 fate/iamf: add a remux test with stream group copying
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 15:18:56 -03:00
Haihao Xiang
8c62d77139 lavc/vp9: Fix regression introduced in 0ba05857
It is possible that ff_progress_frame_await() is called but
ff_progress_frame_report() isn't called when a hardware acceleration
method is used, so a thread for vp9 decoding might get stuck.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-24 11:47:34 +08:00
James Almer
725d3b6f17 doc/APIchanges: fix date for the latest entry
And add the commit hash while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 00:19:36 -03:00
James Almer
757367e068 avformat/demux: extract extradata from packets when context update is requested
If the demuxer doesn't set extradata in the stream's codecpar, a
need_context_update request will delete the previously extracted extradata in
the stream's internal AVCodecContext.
As we can't ensure the old extradata is valid for the stream in its post
context update request state, try to get extradata from the new packet instead
of attempting to preserve the old in some form.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 00:11:37 -03:00
James Almer
c4e3d6cdb0 avcodec/codec_par: always clear extradata_size in avcodec_parameters_to_context()
Missed in d383ae43c2.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-24 00:11:37 -03:00
James Almer
ecf87dd230 fftools/ffmpeg_mux_init: allow mapping a stream group from one of the inputs
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
James Almer
8616cfe089 avutil/opt: add support for children objects in av_opt_serialize
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
James Almer
855d4b5254 avutil/tests/opt: test av_opt_find2()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
James Almer
a9df9f95c4 avutil/test/opt: test the AV_OPT_SERIALIZE_SKIP_DEFAULTS flag
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
Michael Niedermayer
b91e3c4c90 avcodec/cbs_h2645: Check NAL space
Found-by-reviewing: CID1419833 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:17 +02:00
Michael Niedermayer
02301017d2 avfilter/vf_thumbnail_cuda: Set ret before checking it
Fixes: CID1418336 Logically dead code

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:17 +02:00
Michael Niedermayer
e7174e66ac avfilter/signature_lookup: Dont copy uninitialized stuff around
Fixes: CID1403238 Uninitialized pointer read
Fixes: CID1403239 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:16 +02:00
Michael Niedermayer
25cb66369e avfilter/signature_lookup: Fix 2 differences to the refernce SW
Fixes: CID1403227 Division or modulo by float zero

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:16 +02:00
Michael Niedermayer
fb4a1eaadf tools: add target_enc_fuzzer.c
Sponsored-by: Sovereign Tech Fund
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-24 02:52:16 +02:00
Timo Rothenpieler
61f27e5f71 doc: use HOSTEXESUF when calling print_options
This is neccesary on WSL, and has no averse effects in normal
environments.
2024-04-24 00:09:38 +02:00
Martin Storsjö
cdf71f789b Remove .travis.yml
Travis is no longer relevant for attempting to run CI jobs in our
setup.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-24 00:03:31 +03:00
James Almer
ce33a5f16d avformat/movenc: remove one level of indentation
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 12:46:49 -03:00
James Almer
63702d5f9c avcodec/aac/aacdec: remove double colon
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 11:02:00 -03:00
Zhao Zhili
1b41631185 fftools: Fix implicit-const-int-float-conversion warning
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 16:09:09 +08:00
Zhao Zhili
66161166dc avcodec/mediacodecenc: add AV_CODEC_CAP_ENCODER_FLUSH support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili
9e49915195 avcodec/mediacodecenc: Add global header support
The extradata is generated by encoding a dummy frame, then reset
the encoder state by mediacodec flush(). It only works for pixel
format other than AV_PIX_FMT_MEDIACODEC, since I'm not sure how
to create a dummy frame safely with AV_PIX_FMT_MEDIACODEC.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili
3cfea6993a avcodec/mediacodecenc: Remove write only variable
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili
a5a3788f56 avcodec/mediacodecenc: Fix return empty packet when bsf is used
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili
32fa20c0c9 avcodec/mediacodec_wrapper: Fix unused variable warning 2024-04-23 15:35:26 +08:00
Zhao Zhili
98b5e80fd6 avcodec/mediacodec_wrapper: link to NDK mediacodec API directly
Drop support of Android version before 5.0.
2024-04-23 15:35:26 +08:00
Zhao Zhili
309cff378c configure: Lower Android API level requirement of mediandk
AImage_delete is introduced in API level 24, while AMediaFormat_new
is introduced in API level 21. We only need API level 21 to support
NDK mediacodec. This change doesn't break or change of
android_camera_indev since camera2ndk still needs API level 24.
2024-04-23 15:35:26 +08:00
Lynne
e3650886c7 aacdec: initialize float/fixed SBR tables only when either is needed 2024-04-23 08:31:41 +02:00
Lynne
176c922e4e aacsbr: constify the only SBR table 2024-04-23 08:31:41 +02:00
Lynne
03cf101645 aacdec: remove AAC-specific MIPS optimizations
The code was written in 2012, but seems to have been broken
for just as long. Compilation is broken on every MIPS/MIPS64
system with an FPU (which the code depends on).
2024-04-23 08:31:40 +02:00
Lynne
ae7c6cc17d aac: move aacdec.c to aac/aacdec.c 2024-04-23 08:31:40 +02:00
Lynne
551ce16b59 aacdec: move aacdec.h into libavcodec/aac 2024-04-23 08:31:40 +02:00
Lynne
cd1e404a10 aacdec: merge previously-templated code 2024-04-23 08:31:39 +02:00
Lynne
ce740618d1 aacdec: move LATM decode functions into a separate file 2024-04-23 08:31:39 +02:00
Lynne
e93793bf3c aacdec: fully detemplate decoder core 2024-04-23 08:31:38 +02:00
Lynne
2f90d83981 aacdec: move fixed/float DSP initialization to templated init functions 2024-04-23 08:31:38 +02:00
Lynne
905fdb0601 aacdec: reuse TNS and LTP tables between fixed and float decoders
The fixed decoder derives the values from floats anyway.
2024-04-23 08:31:38 +02:00
Lynne
49e7be1e37 aacdec: move prediction to separate files 2024-04-23 08:31:37 +02:00
Lynne
b1718ce0f9 aacdec: move CCE decoding to a separate templated file
Unfortunately, although it's a purely decode function, it does
need to be templated.
2024-04-23 08:31:37 +02:00
Lynne
41c04bec0a aacdec: move fixed-point clipping to a separate function 2024-04-23 08:31:36 +02:00
Lynne
87a93a5670 aacdec: split off channel coupling into a new file 2024-04-23 08:31:36 +02:00
Lynne
b7387ea00e aacdec: deduplicate table initizalization
All tables now initialized by aac/aacdec_fixed|float
2024-04-23 08:31:36 +02:00
Lynne
41ae2b03a5 aacdec: move spectrum decode and dequantization to a new file 2024-04-23 08:31:35 +02:00
Lynne
5c026e6637 aacdec: remove unnecessary decode_spectrum_and_dequant arguments
Small cleanup to reduce number of arguments.
2024-04-23 08:31:35 +02:00
Lynne
eef9100a8e aacdec: template LTP windowing separately
The function is called only internally in DSP, so we do not
need to expose it.

apply_ltp on MIPS uses this function, but due to the function
being just a glue function with no real optimizations,
duplicate it there.
2024-04-23 08:31:35 +02:00
Lynne
091d85217d aacdec: template windowing and transforms separately 2024-04-23 08:31:34 +02:00
Lynne
a309aa4127 aacdec: duplicate table initialization
Preparation to move all table init and support windowing functions.
2024-04-23 08:31:34 +02:00
Lynne
e9fc7661da aacdec: template LTP application separately 2024-04-23 08:31:33 +02:00
Lynne
db5128ef70 aacdec: template TNS application separately 2024-04-23 08:31:33 +02:00
Lynne
ad16349f9b aacdec: template intensity stereo application separately 2024-04-23 08:31:33 +02:00
Lynne
9f3fa77e0d aacdec: template mid/side stereo application separately 2024-04-23 08:31:32 +02:00
Lynne
a6295586f5 aacdec: template scalefactor dequantization separately 2024-04-23 08:31:32 +02:00
Lynne
7f3b3e2df1 aacdec: switch-ify scalefactor decoding
Brings it in line with dequantization.
2024-04-23 08:31:31 +02:00
Lynne
77a88bbdda aacdec: give spectrum dequant+decode SCE rather than an ICS
Eliminates using templated values in function definition.
2024-04-23 08:31:31 +02:00
Lynne
60b60dd635 aacdec: separate out scalefactor dequantization from decoding
Allows to template away dequantization.
2024-04-23 08:31:31 +02:00
Lynne
ed009bfd3d aacdec: add a decoder DSP structure
To be used to abstract away DSP functions.
2024-04-23 08:31:30 +02:00
Andreas Rheinhardt
9de66fd449 avcodec/aacdec_template: Deduplicate common part of aac_decode_init()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:30 +02:00
Andreas Rheinhardt
980a55fb46 avcodec/aacdec_template: Deduplicate AVClass+AVOptions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt
e3693c6f56 avcodec/aacdec_template: Deduplicate aac_decode_close()
This is possible now that both AAC decoders share the same
context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt
7117e0c7be avcodec/aacdec: Use same AACDecContext for fixed and float
Up until now, there was one AACDecContext for the fixed
and one for the floating point decoder. These differed
mostly in certain arrays which were int for the fixed-point
and float for the floating point decoder; there were also
differences in corresponding function pointers.

Yet in order to deduplicate the enormous amount of currently
duplicated code between the float and the fixed-point decoder,
one needs common contexts. Given that int and float have the
same size on all common systems, this commit replaces these
arrays by unions of int arrays and of float arrays. The names
of these arrays have been chosen to be compatible with
AAC_RENAME().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt
fc3c2ea8dc avcodec/aacdec: PredictorState array out of SingleChannelElement
sizeof(PredictorState) is different for the floating-point and
the fixed-point AAC decoders; this is an obstacle for deduplicating
code between these decoders. So don't include this array in
SingleChannelElement, instead add a union of pointers to the
fixed-point PredictorState and the floating-point PredictorState.
The actual arrays are part of the extended ChannelElement
to be allocated by ff_aac_sbr_ctx_alloc_init(); it also
sets the pointers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt
8b2261e573 avcodec/aacdec: Always include AV(Fixed|Float)DSPContext in AACDecContext
Up until now, AACDecContext included pointers to one of these
contexts depending upon USE_FIXED. Yet deduplicating
the common parts of the float and fixed-point AAC decoders
needs common structures, so we put both of these pointers
in a union.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt
5bd7b8d999 avcodec/aacdec: Split SBR context from ChannelElement
The AAC fixed-point and floating-point decoders have
a lot of duplicated code; the main obstacle to
deduplicating it is that several structures with the
same name are actually different types, because
they contain INTFLOATs (int or float) and AAC_FLOATs
(SoftFloat or float). SoftFloat and float typically
have different sizes, so dealing with it is the more
complicated of the two.

AAC_FLOAT is mainly used in the sbr code and structures,
so one can still deduplicate the code by only exposing
the common part of ChannelElement (without SBR context)
to the common decoder part. One prerequisite of this
is to move allocating the whole ChannelElement to
code that will stay unduplicated. It is most natural
to move said allocation to ff_aac_sbr_ctx_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt
6975d965fc avcodec/aacsbr: Make ff_aac_sbr_* funcs accept ChannelElement*
Each ChannelElement contains exactly one SpectralBandReplication
structure; the latter structure contains lots of buffers
whose size depend upon USE_FIXED (i.e. AAC_FLOAT arrays).
This complicates deduplicating the parts of the AAC decoder
that are duplicated between the fixed-point and the floating
point decoder.

In order to fix this, the SpectralBandReplication structure
will be moved from the part of ChannelElement visible to
the common code. Therefore the ff_aac_sbr_* functions
are ported to accept a ChannelElement*; they will then have
to translate that to the corresponding SpectralBandReplication*
themselves (which is possible, because there are floating-point
and fixed-point versions of these functions).

While just at it, also ensure that these functions are properly
namespaced.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:27 +02:00
Lynne
3600f757db aacsbr_template: include mem.h
Future AAC changes remove the need to include this header.
2024-04-23 08:31:27 +02:00
Lynne
f55b587820 aacdec: move aacdec_common to aac/aacdec_tab
Start to clean up the decoder.
Also renames a confusingly named file.
2024-04-23 08:31:18 +02:00
Jun Zhao
fc02b910ad lavc/libxevd: Fixed the has_b_frames setting
has_b_frames used in decoder for size of the frame
reordering buffer, and we don't used the max_b_frames
in decoder.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-04-23 07:27:38 +08:00
Mark Thompson
ba6b08c75b av1dec: Fix RefFrameSignBias calculation 2024-04-22 21:41:50 +01:00
Haihao Xiang
3032a74cac configure: fix rpuenc typos
Otherwise there are link errors:
LD      ffprobe_g
/usr/bin/ld: libavcodec/libavcodec.so: undefined reference to
`ff_dovi_rpu_generate'
/usr/bin/ld: libavcodec/libavcodec.so: undefined reference to
`ff_dovi_configure'
collect2: error: ld returned 1 exit status

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-22 17:20:16 -03:00
Niklas Haas
2f3c1e1641 avcodec/libsvtav1: implement dolby vision coding 2024-04-22 12:17:56 +02:00
Niklas Haas
39ca87ed1e avcodec/libx265: implement dolby vision coding
libx265 supports these natively, we just need to attach the generated
NALs to the x265picture, as well as setting the appropriate DV profile.
2024-04-22 12:17:56 +02:00
Niklas Haas
8dea94a146 avcodec/libaomenc: implement dolby vision coding 2024-04-22 12:17:56 +02:00
Niklas Haas
69e45a627c avformat/movenc: warn if dovi cfg ignored
Since this is guarded behind strict unofficial, we should warn if the
user feeds a dolby vision stream to this muxer, as it will otherwise
result in a broken file.
2024-04-22 12:17:56 +02:00
Niklas Haas
3306766608 avcodec/dovi_rpuenc: add ff_dovi_rpu_generate()
This function takes a decoded AVDOVIMetadata struct and turns it back
into a binary RPU. Verified using existing tools, and matches the
bitstream in official reference files.

I decided to just roll the EMDF and NAL encapsulation into this function
because the end user will need to do it otherwise anyways.
2024-04-22 12:17:56 +02:00
Niklas Haas
f140935005 avcodec/dovi_rpuenc: add ff_dovi_configure()
We need to set up the configuration struct appropriately based on the
codec type, colorspace metadata, and presence/absence of an EL (though,
we currently don't support an EL).

When present, we use the signalled RPU data header to help infer (and
validate) the right values.

Behavior can be controlled by a new DOVIContext.enable flag.
2024-04-22 12:17:51 +02:00
Niklas Haas
f131086a70 avcodec/dovi_rpu: split into dovi_rpu.c and dovi_rpudec.c
To allow compiling the decoding objects without the encoding objects and
vice versa. Common helpers that users of both APIs need are put into the
shared dovi_rpu.c.
2024-04-22 12:17:05 +02:00
Niklas Haas
783734d979 configure: rename dovi_rpu subsystem to dovi_rpudec
To distinguish it from the to-be-added dovi_rpuenc.
2024-04-22 12:17:05 +02:00
Niklas Haas
2a99d3527b avcodec/dovi_rpu: expose guess_profile(), clarify semantics
To allow internally re-using it for both the encoder and decoder.

This is based on HEVC only, H.264/AV1 use their own (hopefully correctly
signalled) profiles (and in particular, the AV1 decoders implicitly
default the correct profile in the absence of a configuration record).
2024-04-22 12:17:05 +02:00
Niklas Haas
dbfd979c1b avcodec/dovi_rpu: clarify error on missing RPU VDR
The code was written under the misguided assumption that these fields
would only be present when the value changes, however this does not
match the actual patent specification, which says that streams are
required to either always signal this metadata, or never signal it.

That said, the specification does not really clarify what the defaults
of these fields should be in the event that this metadata is missing, so
without any sample file or other reference I don't wish to hazard
a guess at how to interpret these fields.

Fix the current behavior by making sure we always throw this error, even
for files that have the vdr sequence info in one frame but are missing
it in the next frame.
2024-04-22 12:17:05 +02:00
Niklas Haas
fc616de1a5 avcodec/dovi_rpu: properly replace context header
This was never set in ff_dovi_ctx_replace(), leading to possibly
out-of-date when copying from one thread to another.
2024-04-22 12:17:05 +02:00
Niklas Haas
d0392619a7 avcodec/dovi_rpu: store entire config record
And make it public.

For encoding, users may also be interested in the configured level and
compatibility ID. So generalize the dv_profile field and just expose the
whole configuration record.

This makes the already rather reductive ff_dovi_update_cfg() function
almost wholly redundant, since users can just directly assign
DOVIContext.cfg.
2024-04-22 12:17:05 +02:00
Andreas Rheinhardt
20206e14d7 avcodec/av1dec: Make av1_frame_replace() out of av1_frame_ref()
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Andreas Rheinhardt
0f8763fbea avcodec/av1dec: Use ProgressFrames
AV1 can put a frame into multiple reference slots;
up until now, this involved creating a new reference
to the underlying AVFrame; therefore av1_frame_ref()
could fail.
This commit changes this by using the ProgressFrame API
to share the underlying AVFrames.

(Hint: vaapi_av1_surface_id() checked whether the AV1Frames
contained in the AV1DecContext were NULL or not (of course
they were not); this has been changed to actually check for
whether said AV1Frame is blank or not.)

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Andreas Rheinhardt
0ec886ddc7 avcodec/hevcdec: Use union for AVFrame* and ProgressFrame
It avoids having to sync ProgressFrame.f and the pointer
typically used to access the AVFrame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Andreas Rheinhardt
1d17d84b7d avcodec/progressframe: Explain how unnamed union can simplify accesses
This relies on the common initial seqence guarantee
(and on C11 support for unnamed members).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 16:31:42 +02:00
Jun Zhao
822e2843ca lavc/vvc/refs: Use dpb_max_num_reorder_pics to control output
Use dpb_max_num_reorder_pics to control output instead of
dpb_max_dec_pic_buffering, when dpb_max_dec_pic_buffering
is much larger than dpb_max_num_reorder_pics, it may cause
dpb overflow error.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: elinyhuang <elinyhuang@tencent.com>
2024-04-21 21:06:50 +08:00
Jun Zhao
50b8666dc6 lavc/vvc_parser: Fixed the has_b_frames setting
has_b_frames used in decoder for size of the frame reordering
buffer, setting this field from dpb_max_num_reorder_pics.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-04-21 21:06:50 +08:00
Jun Zhao
d9f72eb107 lavc/vvc_parser: Remove max_b_frames setting
We don't used the max_b_frames field in decoder normally

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-04-21 21:06:50 +08:00
Andreas Rheinhardt
277f051ff6 avcodec/pthread_frame: Fix leak of coded side data
Happens in the mov-elst-ends-betn-b-and-i and mov-ibi-elst-starts-b
FATE tests with frame-threading.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-21 13:34:33 +02:00
Matthieu Bouron
8cdf1bae94 avcodec/jni: fix mixed declaration and code 2024-04-21 09:43:17 +02:00
Wu Jianhua
a44c346312 avcodec/x86/vvc/vvcdsp_init: fix linking error when configuring with --disable-ssse3 --disable-optimizations options
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-04-20 12:11:43 +08:00
Wu Jianhua
2f3aaef1b5 avcodec/x86/vvc/vvcdsp_init: add avg prototypes
When we used the --disable-ssse3 --disable-optimizations options,
the compiler would not skip the MC_LINKS like the compilation that
enabled the optimization, so it would fail to find the function
prototypes. Hence, this commit uses the same way to add prototypes
for the functions as HEVC DSP.

And, when prototypes are added for the functions, we cannot add the static qualifier.
Therefore, the ff_vvc prefix is needed to avoid the naming conflict.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-04-20 12:11:43 +08:00
Wu Jianhua
4358f49568 avcodec/x86/vvc/vvcdsp_init: add put prototypes
When we used the --disable-ssse3 --disable-optimizations options,
the compiler would not skip the MC_LINKS like the compilation that
enabled the optimization, so it would fail to find the function
prototypes. Hence, this commit uses the same way to add prototypes
for the functions as HEVC DSP.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-04-20 12:11:43 +08:00
Andreas Rheinhardt
bba996d6cd avcodec/hevcdec: Fix precedence, bogus film grain warning
Reviewed-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 17:44:21 +02:00
Andreas Rheinhardt
f18de5bc4a avcodec/v4l2_(m2m|buffers): Use RefStruct API for context references
Avoids allocations and therefore error checks; also avoids
indirections and allows to remove the boilerplate code
for creating an object with a dedicated free function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
fbd1b90b29 avcodec/rkmppdec: Allocate AVDRMFrameDescriptor and frame ctx jointly
Avoids an allocation and therefore one error path.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
1427e67500 avcodec/rkmppdec: Use RefStruct API for references to decoder itself
Avoids boilerplate code when creating the context
and avoids allocations and therefore whole error paths
when creating references to it. Also avoids an indirection
and improves type-safety.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
9a0614c7bd avcodec/rkmppdec: Check av_buffer_ref()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
4513300989 avcodec/rkmppdec: Fix double-free on error
After having created the AVBuffer that is put into frame->buf[0],
ownership of several objects (namely an AVDRMFrameDescriptor,
an MppFrame and some AVBufferRefs framecontextref and decoder_ref)
has passed to the AVBuffer and therefore to the frame.
Yet it has nevertheless been freed manually on error
afterwards, which would lead to a double-free as soon
as the AVFrame is unreferenced.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
d692c42938 avcodec/qsv: Use RefStruct API for memory id (mids) array
Avoids allocations and therefore error checks and cleanup code;
also avoids indirections.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
ac8288e288 avcodec/ffv1dec: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer).

It also fixes a data race: The AVFrame's sample_aspect_ratio
is currently updated after ff_thread_finish_setup()
and this write is unsynchronized with the read in av_frame_ref().
Removing the implicit av_frame_ref() fixed this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
2f29147b7f avcodec/pngdec: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
a807e469d5 avcodec/hevcdec: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
2b46ae6407 avcodec/codec_internal: Remove FF_CODEC_CAP_ALLOCATE_PROGRESS
Before commit f025b8e110,
every frame-threaded decoder used ThreadFrames, even when
they did not have any inter-frame dependencies at all.
In order to distinguish those decoders that need the AVBuffer
for progress communication from those that do not (to avoid
the allocation for the latter), the former decoders were marked
with the FF_CODEC_CAP_ALLOCATE_PROGRESS internal codec cap.

Yet distinguishing these two can be done in a more natural way:
Don't use ThreadFrames when not needed and split ff_thread_get_buffer()
into a core function that calls the user's get_buffer2 callback
and a wrapper around it that also allocates the progress AVBuffer.
This has been done in 02220b88fc
and since that commit the ALLOCATE_PROGRESS cap was nearly redundant.

The only exception was WebP and VP8. WebP can contain VP8
and uses the VP8 decoder directly (i.e. they share the same
AVCodecContext). Both decoders are frame-threaded and VP8
has inter-frame dependencies (in general, not in valid WebP)
and therefore the ALLOCATE_PROGRESS cap. In order to avoid
allocating progress in case of a frame-threaded WebP decoder
the cap and the check for the cap has been kept in place.

Yet now the VP8 decoder has been switched to use ProgressFrames
and therefore there is just no reason any more for this check
and the cap. This commit therefore removes both.

Also change the value of FF_CODEC_CAP_USES_PROGRESSFRAMES
to leave no gaps.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
d7374ac713 avcodec/vp8: Mark flushing functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
d48d7bc434 avcodec/vp8: Convert to ProgressFrame API
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
d74102e325 avcodec/wavpack: Move transient variable from context to stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
483c85e85e avcodec/wavpack: Optimize always-false comparison away
Also use the correct type limit SIZE_MAX; INT_MAX comes
from a time when this used av_buffer_allocz() which used
an int at the time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
70e79d289b avcodec/wavpack: Only reset DSD context upon parameter change
The current code resets it all the time unless we are decoding
a DSD frame with identical parameters to the last frame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
8dd0bd4f9b avcodec/wavpack: Move initializing DSD data to a better place
Namely to code that is only executed if we are indeed
initializing a DSD context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
2aac42605c avcodec/wavpack: Use ThreadProgress API
It is more natural given that WavPack doesn't need the data of
the previous frame at all; it just needs the DSD context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
9dc8f8839e avcodec/pthread_frame: Add API to share RefStruct refs just once
This is useful when the lifetime of the object to be shared
is the whole decoding process as it allows to avoid having
to sync them every time in update_thread_context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
267a763a55 avcodec/vp9: Replace atomic_store() by atomic_init()
This part of the code is not slice-threaded and they are
semantically an initialization, so use atomic_init()
instead of the potentially expensive atomic_store()
(which uses sequentially consistent memory ordering).

Also remove the initial initialization directly after
allocating this array.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
259234b46f avcodec/vp9: Simplify replacing VP9Frame
ff_thread_progress_replace() can handle a blank ProgressFrame
as src (in which case it simply unreferences dst), but not
a NULL one. So add a blank frame to be used as source for
this case, so that we can use the replace functions
to simplify vp9_frame_replace().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
98e1e848ef avcodec/vp9: Reduce wait times
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
0ba058579f avcodec/vp9: Fix race when attaching side-data for show-existing frame
When outputting a show-existing frame, the VP9 decoder simply
created a reference to said frame and returned it immediately to
the caller, without waiting for it to have finished decoding.
In case of frame-threading it is possible for the frame to
only be decoded while it was waiting to be output.
This is normally benign.

But there is one case where it is not: If the user wants
video encoding parameters to be exported, said side data
will only be attached to the src AVFrame at the end of
decoding the frame that is actually being shown. Without
synchronisation adding said side data in the decoder thread
and the reads in av_frame_ref() in the output thread
constitute a data race. This happens e.g. when using the
venc_data_dump tool with vp90-2-10-show-existing-frame.webm
from the FATE-suite.

Fix this by actually waiting for the frame to be output.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
7bd3b73716 avcodec/vp9: Switch to ProgressFrames
This already fixes a race in the vp9-encparams test. In this test,
side data is added to the current frame after having been decoded
(and therefore after ff_thread_finish_setup() has been called).
Yet the update_thread_context callback called ff_thread_ref_frame()
and therefore av_frame_ref() with this frame as source frame and
the ensuing read was unsynchronised with adding the side data,
i.e. there was a data race.

By switching to the ProgressFrame API the implicit av_frame_ref()
is removed and the race fixed except if this frame is later reused by
a show-existing-frame which uses an explicit av_frame_ref().
The vp9-encparams test does not cover this, so this commit
already fixes all the races in this test.

This decoder kept multiple references to the same ThreadFrames
in the same context and therefore had lots of implicit av_frame_ref()
even when decoding single-threaded. This incurred lots of small
allocations: When decoding an ordinary 10s video in single-threaded
mode the number of allocations reported by Valgrind went down
from 57,814 to 20,908; for 10 threads it went down from 84,223 to
21,901.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
444bd353e9 avcodec/vp3: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks. It also avoids explicitly allocating
the AVFrames (done implicitly when getting the buffer)
and it also allows to reuse the flushing code for freeing
the ProgressFrames.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
c381c23154 avcodec/mimic: Switch to ProgressFrames
Avoids implicit av_frame_ref() and therefore allocations
and error checks.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
2135a40b1c avcodec/decode: Add new ProgressFrame API
Frame-threaded decoders with inter-frame dependencies
use the ThreadFrame API for syncing. It works as follows:

During init each thread allocates an AVFrame for every
ThreadFrame.

Thread A reads the header of its packet and allocates
a buffer for an AVFrame with ff_thread_get_ext_buffer()
(which also allocates a small structure that is shared
with other references to this frame) and sets its fields,
including side data. Then said thread calls ff_thread_finish_setup().
From that moment onward it is not allowed to change any
of the AVFrame fields at all any more, but it may change
fields which are an indirection away, like the content of
AVFrame.data or already existing side data.

After thread A has called ff_thread_finish_setup(),
another thread (the user one) calls the codec's update_thread_context
callback which in turn calls ff_thread_ref_frame() which
calls av_frame_ref() which reads every field of A's
AVFrame; hence the above restriction on modifications
of the AVFrame (as any modification of the AVFrame by A after
ff_thread_finish_setup() would be a data race). Of course,
this av_frame_ref() also incurs allocations and therefore
needs to be checked. ff_thread_ref_frame() also references
the small structure used for communicating progress.

This av_frame_ref() makes it awkward to propagate values that
only become known during decoding to later threads (in case of
frame reordering or other mechanisms of delayed output (like
show-existing-frames) it's not the decoding thread, but a later
thread that returns the AVFrame). E.g. for VP9 when exporting video
encoding parameters as side data the number of blocks only
becomes known during decoding, so one can't allocate the side data
before ff_thread_finish_setup(). It is currently being done afterwards
and this leads to a data race in the vp9-encparams test when using
frame-threading. Returning decode_error_flags is also complicated
by this.

To perform this exchange a buffer shared between the references
is needed (notice that simply giving the later threads a pointer
to the original AVFrame does not work, because said AVFrame will
be reused lateron when thread A decodes the next packet given to it).
One could extend the buffer already used for progress for this
or use a new one (requiring yet another allocation), yet both
of these approaches have the drawback of being unnatural, ugly
and requiring quite a lot of ad-hoc code. E.g. in case of the VP9
side data mentioned above one could not simply use the helper
that allocates and adds the side data to an AVFrame in one go.

The ProgressFrame API meanwhile offers a different solution to all
of this. It is based around the idea that the most natural
shared object for sharing information about an AVFrame between
decoding threads is the AVFrame itself. To actually implement this
the AVFrame needs to be reference counted. This is achieved by
putting a (ownership) pointer into a shared (and opaque) structure
that is managed by the RefStruct API and which also contains
the stuff necessary for progress reporting.
The users get a pointer to this AVFrame with the understanding
that the owner may set all the fields until it has indicated
that it has finished decoding this AVFrame; then the users are
allowed to read everything. Every decoder may of course employ
a different contract than the one outlined above.

Given that there is no underlying av_frame_ref(), creating
references to a ProgressFrame can't fail. Only
ff_thread_progress_get_buffer() can fail, but given that
it will replace calls to ff_thread_get_ext_buffer() it is
at places where errors are already expected and properly
taken care of.

The ProgressFrames are empty (i.e. the AVFrame pointer is NULL
and the AVFrames are not allocated during init at all)
while not being in use; ff_thread_progress_get_buffer() both
sets up the actual ProgressFrame and already calls
ff_thread_get_buffer(). So instead of checking for
ThreadFrame.f->data[0] or ThreadFrame.f->buf[0] being NULL
for "this reference frame is non-existing" one should check for
ProgressFrame.f.

This also implies that one can only set AVFrame properties
after having allocated the buffer. This restriction is not deep:
if it becomes onerous for any codec, ff_thread_progress_get_buffer()
can be broken up. The user would then have to get a buffer
himself.

In order to avoid unnecessary allocations, the shared structure
is pooled, so that both the structure as well as the AVFrame
itself are reused. This means that there won't be lots of
unnecessary allocations in case of non-frame-threaded decoding.
It might even turn out to have fewer than the current code
(the current code allocates AVFrames for every DPB slot, but
these are often excessively large and not completely used;
the new code allocates them on demand). Pooling relies on the
reset function of the RefStruct pool API, it would be impossible
to implement with the AVBufferPool API.

Finally, ProgressFrames have no notion of owner; they are built
on top of the ThreadProgress API which also lacks such a concept.
Instead every ThreadProgress and every ProgressFrame contains
its own mutex and condition variable, making it completely independent
of pthread_frame.c. Just like the ThreadFrame API it is simply
presumed that only the actual owner/producer of a frame reports
progress on said frame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:18:04 +02:00
Andreas Rheinhardt
89828417b0 avcodec/threadprogress: Add new API for frame-threaded progress
The API is similar to the ThreadFrame API, with the exception
that it no longer has an included AVFrame and that it has its
own mutexes and condition variables which makes it more independent
of pthread_frame.c. One can wait on anything via a ThreadProgress.
One just has to ensure that the lifetime of the object containing
the ThreadProgress is long enough. This will typically be solved
by putting a ThreadProgress in a refcounted structure that is
shared between threads.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-19 13:07:48 +02:00
Stefano Sabatini
0fb0946de7 doc/muxers: add mmf 2024-04-19 09:00:59 +02:00
Stefano Sabatini
b9f2e1b929 doc/muxers: add microdvd 2024-04-19 09:00:59 +02:00
Stefano Sabatini
ac3460c61c doc/muxers/md5: apply misc consistency fixes 2024-04-19 09:00:41 +02:00
Stefano Sabatini
4bd192ddf4 doc/muxers/matroska: add missing options, apply misc style fixes 2024-04-19 08:44:20 +02:00
Stefano Sabatini
bba492dc9c lavf/matroskaenc: apply consistent style to options descriptions 2024-04-19 08:44:20 +02:00
Frank Plowman
bb9e4ff355 lavc/vvc: Skip enhancement layer NAL units
The native VVC decoder does not yet support quality/spatial/multiview
scalability.  Bitstreams requiring this feature could cause crashes.
Patch fixes this by skipping NAL units which are not in the base layer,
warning the user while doing so.

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-18 17:38:15 -03:00
James Almer
5b9db32ccc avformat/mov: ignore old infe box versions
Some files with no image items have them, and were working prior to the recent
HEIF parsing overhaul.
Ignore such boxes instead, to recover the old behavior.

Fixes a regression since d9fed9df2a.

Tested-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-18 13:00:11 -03:00
Andrew Sayers
6927457443 avutil/frame: remove comment about avcodec_get_frame_class()
The function was deprecated a while back and deleted last year.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-18 12:24:43 -03:00
Andreas Rheinhardt
7f35c999f6 avcodec/ac3enc: Avoid copying samples
Only the last 256 samples of each frame are used;
the encoder currently uses a buffer for 1536 + 256 samples
whose first 256 samples contain are the last 256 samples
from the last frame and the next 1536 are the samples
of the current frame.
Yet since 238b2d4155 all the
DSP functions only need 256 contiguous samples and this can
be achieved by only retaining the last 256 samples of each
frame. Doing so saves 6KiB per channel.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt
da460fb95c avcodec/ac3enc: Combine cpl_coord buffers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt
5b9fab0f07 avcodec/ac3enc: Combine loops
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt
79d1814b71 avcodec/ac3enc: Avoid indirections, allocations of small arrays
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt
94132dc4aa avcodec/ac3enc: Avoid allocation for mdct_window
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Andreas Rheinhardt
3b93b1af13 avcodec/ac3enc: Avoid allocation for windowed_samples
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-18 14:52:26 +02:00
Xinpeng Sun
35ae44c615 lavfi/tonemap_vaapi: Add support for HDR to HDR tone mapping
Usage example:
ffmpeg -y -hwaccel vaapi -hwaccel_output_format vaapi -i hdr.mp4 \
-vf "tonemap_vaapi=display=7500 3000|34000 16000|13250 34500|15635 16450|500 10000000:extra_hw_frames=64" \
-c:v hevc_vaapi output.mp4

Signed-off-by: Xinpeng Sun <xinpeng.sun@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang
db22804145 lavfi/tonemap_vaapi: Update the log
demote the message to AV_LOG_VERBOSE.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang
3172a6722e lavfi/tonemap_vaapi: By default use bt709 for output frame
By default don't use the color properties from input frame as output
frame properties when performing HDR to SDR conversion

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang
1b5ca2e631 Changelog: Add pad_vaapi, drawbox_vaapi entry
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang
5c55e4e297 lavfi: Add drawbox_vaapi filter
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang
42eb10ecc6 lavfi: Add pad_vaapi filter
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Tong Wu
b2e2fb0344 avcodec/vaapi_encode_h265: use is_reference to fill reference_pic_flag
This codec supports FLAG_B_PICTURE_REFERENCES. We need to fill
reference_pic_flag with pic->is_reference.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-04-18 14:43:07 +08:00
Tong Wu
02fb1782ef avcodec/vaapi_encode_h264: use is_reference to fill reference_pic_flag
This codec supports FLAG_B_PICTURE_REFERENCES. We need to correctly fill
the reference_pic_flag with is_reference variable instead of 0 for B
frames.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang
16616a3d1b lavfi/vaapi_vpp: Use dynamic frame pool in outlink if possible
This can avoid to exhaust the buffers within outlink when libva2 is
available.

For example:
$ ffmpeg -hwaccel_output_format vaapi -hwaccel vaapi -i input.mp4 \
-vf 'scale_vaapi=w=720:h=480' -c:v hevc_vaapi -f null -
...
[vf#0:0 @ 0x55acad91f400] Error while filtering: Cannot allocate memory
[vf#0:0 @ 0x55acad91f400] Task finished with error code: -12 (Cannot
allocate memory)
[vf#0:0 @ 0x55acad91f400] Terminating thread with return code -12
(Cannot allocate memory)

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Haihao Xiang
41e3d36a39 lavc/vaapi_decode: Use dynamic frame pool if possible
libva2 doesn't require a fixed surface-array any more, so we may use
dynamic frame pool for decoding when libva2 is available, which allows a
downstream element stores more frames from VAAPI decoders and fixes the
error below:

$ ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \
-i input.mp4 -c:v hevc_vaapi -f null -
...
[h264 @ 0x557a075a1400] get_buffer() failed
[h264 @ 0x557a075a1400] thread_get_buffer() failed
[h264 @ 0x557a075a1400] decode_slice_header error
[h264 @ 0x557a075a1400] no frame!

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-18 14:43:07 +08:00
Geoff Hill
1abba59738 avcodec/ac3: Remove unused fixed-point ARMv7 DSP
This diff removes 4 unused ARMv7 NEON fixed-point DSP functions.

The function were originally moved here by 4958f35a2 (Dec 2013).

After 9e05421db (Jan 2021), as part of the refactor of the AC3
DSP to consistently use 32-bit sample format in the encoder, these
functions were removed from the DSP function table, but the ARMv7
implementations were kept.

Signed-off-by: Geoff Hill <geoff@geoffhill.org>
2024-04-18 08:38:14 +02:00
Nicolas Gaullier
376b3d53c5 avfilter/vf_colorspace: use colorspace negotiation API
Fixes a regression due to the fact that the colorspace filter does
not use the new API introduced by 8c7934f73a.
The scale filter uses it since 45e09a3041, and the setparams
filter since 3bf80df3cc.

Example:
ffprobe -f lavfi yuvtestsrc,setparams=color_primaries=bt470bg:color_trc=
bt470bg:colorspace=bt470bg,colorspace=bt709:range=tv,scale,showinfo

Before:
  color_range:unknown color_space:bt470bg ...
After:
  color_range:tv color_space:bt709 ...

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-04-17 22:17:56 +02:00
Gyan Doshi
38c322681e avformat/ivfenc: remove unused var
sum_delta_pts is unused since 3b358f151d
2024-04-17 18:31:06 +05:30
Andreas Rheinhardt
639013aafc avformat/lc3: Only allow AV_CODEC_ID_LC3 in muxer
Also check for the number of streams and the AVCodecID generically
using FF_OFMT_FLAGs.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-16 21:40:13 +02:00
arch1t3cht
e9e1932c1c avcodec/h264dec: Reindent after the previous commit
Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
arch1t3cht
728ffe6ca6 avcodec/h264dec: Handle non-recovered frames when draining
When starting on a SEI recovery point close enough to the end of
the stream that draining starts before the recovery point's frame
is output, there can be non-recovered frames in the delayed picture
buffer that would currently cause the decoder to fail to output a
frame. This commit skips such frames and outputs the first recovered
frame, if there exists one.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
arch1t3cht
5a856ac6e6 avcodec/h264dec: Properly mark frames as recovered when draining
When decoding starts at a SEI recovery point very shortly before the
end of the video stream, there can be frames which are decoded before
the recovery point's frame is output and which will only be output once
the draining has started. Previously, these frames would never be set
as recovered. This commit copies the logic from h264_select_output_frame
to send_next_delayed_frame to properly mark such frames as recovered.

Fixes ticket #10936.

Signed-off-by: arch1t3cht <arch1t3cht@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-16 16:36:22 +01:00
James Almer
6b6a0fc53d avformat/iamf_writer: reject duplicated stream ids in a stream group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-16 11:43:10 -03:00
Antoine SOULIER
257bc2a82a avformat/lc3: add file format for LC3/LC3plus transport
A file format is described in Bluetooth SIG LC3 and ETSI TS 103 634, for
test purpose.
2024-04-15 18:34:12 +02:00
Stefano Sabatini
b2bc4ac69e doc/utils/eval: review and extend, clarify ld/st index meaning
Prefer idx in place of id for functions accessing the internal
variables, and add a short introduction to mention them.
2024-04-15 18:32:38 +02:00
Stefano Sabatini
8ceb37d5ad doc/utils/eval: clarify meaning of random* seed value
Possible address trac issue:
http://trac.ffmpeg.org/ticket/10763
2024-04-15 18:30:35 +02:00
Frank Plowman
993c231de0 lavc/vvc: Increase size of ctb_size_y
sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future
use.  The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so
ctb_size_y should be at least 16 bits to prevent overflows.  An
alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and
disallow sps_log2_ctu_size_minus5 = 3.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-15 21:06:13 +08:00
LuMingYin
5e380bcdb1 avfilter/af_channelsplit: fix memory leak
Signed-off-by: LuMingYin <lumingyindetect@163.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-15 10:30:46 +08:00
Lynne
db09f1a5d8 vulkan_av1: add workaround for NVIDIA drivers tested on broken CTS
The first release of the CTS for AV1 decoding had incorrect
offsets for the OrderHints values.
The CTS will be fixed, and eventually, the drivers will be
updated to the proper spec-conforming behaviour, but we still
need to add a workaround as this will take months.

Only NVIDIA use these values at all, so limit the workaround
to only NVIDIA. Also, other vendors don't tend to provide accurate
CTS information.
2024-04-15 02:40:02 +02:00
Mark Thompson
3cca8dfbd8 lavc/vulkan_av1: Use av1dec reference order hint information 2024-04-14 21:05:08 +01:00
Mark Thompson
22ced1edc6 lavc/av1: Record reference ordering information for each frame
This is needed by Vulkan.  Constructing this can't be delegated to CBS
because packets might contain multiple frames (when non-shown frames are
present) but we need separate snapshots immediately before each frame
for the decoder.
2024-04-14 21:05:05 +01:00
Andreas Rheinhardt
f48987f609 doc/muxers.texi: Don't use confusing variable name
reserve_index_space is a size, not an index.
Also refer to the variable in the description.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-14 17:25:16 +02:00
Diego Felix de Souza
1f265aa91d avcodec/nvenc: Multi NVENC Split Frame Encoding in HEVC and AV1
When Split frame encoding is enabled, each input frame is partitioned into
horizontal strips which are encoded independently and simultaneously by
separate NVENCs, usually resulting in increased encoding speed compared to
single NVENC encoding.

Signed-off-by: Diego Felix de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2024-04-13 18:00:43 +02:00
Kacper Michajłow
1c45104f74 avcodec/h2645_sei: validate Mastering Display Colour Volume SEI values
As we can read in ST 2086:

Values outside the specified ranges of luminance and chromaticity values
are not reserved by SMPTE, and can be used for purposes outside the
scope of this standard.

This is further acknowledged by ITU-T H.264 and ITU-T H.265. Which says
that values out of range are unknown or unspecified or specified by
other means not specified in this Specification.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-04-13 17:50:49 +02:00
Zhao Zhili
65c1c83ca4 avformat/tls_mbedtls: Pass FLAG_NONBLOCK to underlying transport
This fix rtmps failure since rtmps requires nonblocking read.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-12 15:24:17 +08:00
Shiyou Yin
2a7d622ddd swscale: [LA] Optimize swscale funcs in input.c
Optimized 7 funcs with LSX and LASX:
1. yuy2ToUV_c
2. yvy2ToUV_c
3. uyvyToUV_c
4. nv12ToUV_c
5. nv21ToUV_c
6. abgrToA_c
7. rgbaToA_c

Reviewed-by: colleague of Shiyou Yin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:59 +02:00
Shiyou Yin
8b76df9142 swscale: [LA] Optimize yuv2plane1_8_c.
Reviewed-by: colleague of Shiyou Yin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:59 +02:00
Shiyou Yin
f3fe2cb5f7 swscale: [LA] Optimize range convert for yuvj420p.
Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-11 23:53:41 +02:00
James Almer
dd5f665b40 avutil/frame: free the old side data buffer before replacing it
Fixes memleaks reported by ASAN/Valgrind.

Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 12:32:13 -03:00
James Almer
6d0c89980c avcodec/hevcdec: export global side data in AVCodecContext
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:48:39 -03:00
James Almer
6def8e3923 avcodec/decode: add AVFrameSideData helper wrappers that don't depend on frames
They will be useful to fill arrays stored in other structs.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:46:23 -03:00
James Almer
6d760c666d avutil/mastering_display_metadata: add a new allocator function that returns a size
av_mastering_display_metadata_alloc() is not useful in scenarios where you need to
know the runtime size of AVMasteringDisplayMetadata.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:46:18 -03:00
James Almer
adb67bba06 avutil/version: bump minor after recent AVFrame API additions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 11:43:51 -03:00
James Almer
662dbf826d avutil/frame: add helper to remove side data of a given type from an array
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
James Almer
55621f6fae avutil/frame: add a flag to allow overwritting existing entries
Enable it only for side data types that don't allow more than one entry.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
James Almer
a16338089c avutil/frame: add helper for adding side data w/ AVBufferRef to array
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-11 09:18:19 -03:00
Martin Storsjö
e4f5c2414b tests/movenc: Validate that normal muxer usage doesn't print warnings
We have test to make sure that certain configurations do print
warnings. However, the normal operation of the muxer within this
test always printed a warning, so those tests to check for
extra warnings didn't essentially guard anything.

The warning that always was printed, "track 1: codec frame size is
not set" was not present in the libav fork where this testcase
originated, it was removed in f234e8a32e.

Set the frame size for the audio stream to silence the warning,
and use this frame size in a couple later calculations, and check
that one test configuration doesn't print warnings.

Setting the frame size apparently changes the rounding of a timestamp
in the ismv muxing testcase.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-11 14:08:55 +03:00
Andreas Rheinhardt
497a0f839d avformat/img2: Avoid relocations for ff_img_tags
The strings here are so short that using a pointer is wasteful
(the longest string takes nine bytes; on 64 bit systems,
the pointer+padding already take 12 bytes). So avoid them
and add asserts to ensure that no one ever tries to use a too
long tag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
1533351990 avcodec/flacenc: Avoid shift where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
0458fdbeed avcodec/ac3enc: Avoid calculating the CRC multiple times
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
28ffc39808 avcodec/ac3enc: Move EAC-3 specific initialization to eac3enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
2281ab5c24 avcodec/ac3enc: Avoid function pointers to initialize MDCT
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
6c55cb95ed avcodec/ac3enc_float: Remove uninformative error message
AVERROR(ENOMEM) is enough.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
3cd136bc12 avcodec/ac3enc: Deduplicate copying input samples
These memcpy operands only depend upon sizeof(SampleType)
(and this size is actually the same for both the fixed-point
and the floating-point encoders for most (all supported?)
systems).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
7311a9086e avcodec/ac3enc: Deduplicate allocating buffers
These allocations only depend upon sizeof(SampleType)
(and this size is actually the same for both the fixed-point
and the floating-point encoders for most (all supported?)
systems).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
2fcc50d1f5 avcodec/ac3enc: Share more code between fixed/float encoders
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
1042ee36cd avcodec/ac3enc: Move ff_ac3_validate_metadate() upwards
Will avoid a forward declaration in the next commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
6244ecf8ec avcodec/ac3enc: Use common encode_frame function
This is in preparation for sharing even more stuff
common to the fixed and floating-point encoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:53:26 +02:00
Andreas Rheinhardt
fee093a570 avcodec/ac3enc: Remove disabled code for RealAudio variant of AC-3
Implicitly disabled by 4679a474f0.
Given that no one has ever complained about this, this commit
removes the now dead code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:52:46 +02:00
Andreas Rheinhardt
27a830c1d8 avcodec/ac3enc: Remove always-false sample rate check
encode_preinit_audio() already checks that the sample rate
is among AVCodec.supported_samplerates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt
e878ec7eb2 avcodec/ac3enc: Avoid copying strings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt
8261d5d38c avcodec/ac3enc: Use bit-operations for bit-mask
Simply masking the LFE bit is more natural than subtracting
if set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt
b3d12fe200 avcodec/ac3enc: Remove redundant channel layout checks
These are all checked generically via AVCodec.ch_layouts
in encode_preinit_audio().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt
13daafd5c0 avcodec/ac3enc: Don't overwrite AVCodecContext.ch_layout
This is unnecessary (the channel layout guessing code became
moot when the channel layouts were enforced generically)
and also dangerous, as a custom channel layout mapping
would leak in case one was used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Andreas Rheinhardt
c3fb0c5bab avcodec/ac3enc: Don't presume ch_layout to be AV_CHANNEL_ORDER_NATIVE
It is perfectly legal for users to use a custom layout
that is equivalent to a supported native one.
In this case the union in AVChannelLayout is not an uint64_t mask,
but a pointer to a custom map.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-11 12:44:27 +02:00
Anton Khirnov
0e4dfa4709 Revert "bsf: use standard include paths"
This reverts commit 41b73ae883.

This patch was pushed extremely quickly, without giving developers the
time to object.
2024-04-10 15:17:54 +02:00
J. Dekker
985fdf8e3d tests/checkasm: add exclude_guest for non-x86 linux perf
The exclude_guest option only has an effect on x86. Omitting
'exclude_guest' defaults to zero which implies that you can count guest
events should you run one. Some non-x86 kernels just ignore it, while
others (e.g. the Asahi Linux kernels) require the user to explicitly set
the option to 1, i.e. the only behaviour that makes sense when counting
guest events isn't supported.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-10 13:37:40 +02:00
Lynne
89a9042291 lavc/avfft: fix RDFT wrapper stride
Per the lavu/tx docs:

> * For forward transforms (R2C), stride must be the spacing between two
> * samples in bytes. For inverse transforms, the stride must be set
> * to the spacing between two complex values in bytes.

The code did the reverse.
The stride parameter is currently not respected for RDFT transforms,
but has to be correct, for a potential future change.
2024-04-10 13:22:18 +02:00
Fei Wang
0534d2ac84 lavfi/dnn_backend_torch: Include mem.h
Fix build fail since 790f793844.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-04-10 18:18:49 +08:00
Stefano Sabatini
7e59c4f908 doc/muxers/matroska: apply misc consistency fixups 2024-04-10 10:56:54 +02:00
Stefano Sabatini
8510108c1d doc/muxers: add lrc 2024-04-10 10:56:54 +02:00
Stefano Sabatini
57d64bb715 doc/muxers: add kvag 2024-04-10 10:56:54 +02:00
Stefano Sabatini
f7fd228560 doc/muxers: add jacosub 2024-04-10 10:56:54 +02:00
Stefano Sabatini
4fe3c8dcfd doc/muxers: add ivf 2024-04-10 10:56:54 +02:00
Martin Storsjö
fbd5e238d4 movenc: Allow writing timed ID3 metadata
This is based on a spec at https://aomediacodec.github.io/id3-emsg/,
further based on ISO/IEC 23009-1:2019.

Within libavformat, timed ID3 metadata (already supported by the
mpegts demuxer and muxer) is handled as a separate data AVStream
with codec type AV_CODEC_ID_TIMED_ID3. However, it doesn't
have a corresponding track in the mov file - instead, these events
are written as separate toplevel 'emsg' boxes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-10 10:48:50 +03:00
Martin Storsjö
e4e3d25d41 movenc: Remove a leftover commented out line
This line originates from 6f69f7a8bf.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-10 10:42:02 +03:00
Martin Storsjö
8339a45400 aarch64: Factorize code for CPU feature detection on Apple platforms
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-10 10:39:08 +03:00
Andrew Kelley
41b73ae883 bsf: use standard include paths
Removes the special -I flag specified in the avcodec/bsf/ subdirectory.

This makes code copy-pastable to other parts of the ffmpeg codebase, as
well as simplifying the build script.

It also reduces ambiguity, since there are many instances of same-named
header files existing in both libavformat/ and libavcodec/
subdirectories.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-09 22:21:59 -03:00
James Almer
9dbc9a0f97 avcodec/libsvt1: check return value of send/receive functions
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-09 21:37:49 -03:00
Marton Balint
c38f785be4 avformat/mov_chan: add support for omitted_channel bitmask in chnl atom
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:22 +02:00
Marton Balint
92e7a9a4d5 avformat/mov_chan: respect channel order when parsing and creating chnl atom
Previously we always assumed that the channels are in native order, even if
they were not. The new channel layout API allows us to signal the proper
channel order, so let's do so.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:22 +02:00
Marton Balint
da0fe26379 avformat/mov_chan: factorize some layout map search functions
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:22 +02:00
Marton Balint
c68dc3e5f1 avformat/mov_chan: check channel count of layout tags at compile time
We can do this by using an X-macro for channel map declaration and doing a
static_assert() in one pass for the check. Thanks for Andreas Rheinhardt for
the suggestion.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:14:21 +02:00
Marton Balint
7801451376 avformat/hlsenc: use a slash separator even in win32
We don't know if the protocol used is referring to a local file or a remote
resource, so it is better to simply use slash as separator which works all the
time. (well, except in very special cases when the user specified a \\?\ path)

Fixes ticket #9780.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:13:09 +02:00
Marton Balint
4721b9f15f avfilter/buffersrc: never override channel count in av_buffersrc_add_frame_flags
Overriding unknown layouts with the negotiated layout is OK, but the number of
channels should match with what was negotiated.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-04-09 23:12:46 +02:00
Martin Storsjö
359b6a7f8a aarch64/ac3dsp: simplify the end of ff_ac3_sum_square_butterfly_float_neon
Before:                           Cortex A53     A72     A78      M1
ac3_sum_square_bufferfly_float_neon:  1005.7   516.5   224.5   194.0
After:
ac3_sum_square_bufferfly_float_neon:   981.7   504.5   223.2   189.5

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 16:50:49 +02:00
Frank Plowman
1c0149359a lavc/vvc: Fix out-of-bounds array access
The 2 which has been changed to an 8 in the array length expression is
the maximum value of sps_bitdepth_minus8.  This was missed when updating
to VVCv2, which increased this maximum from 2 to 8.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:35:48 +08:00
Frank Plowman
2b7e79e890 lavc/vvc: Avoid overflow in coeff scale intermediate
Make intermediate result 64-bits to avoid an overflow before the right
shift.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:30:35 +08:00
Frank Plowman
fcf74c5ebc lavc/vvc: Fix buffer overread in CABAC
The size variable here is taken as gospel for the bounds of the input
buffer in later logic.  Clamp it to ensure that the returned region
does not extend past that allocated in the underlying GetBitContext,
even in the case entry point offsets are signalled in the bitstream.
Also assert this for good measure.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:30:18 +08:00
Frank Plowman
f499503073 lavc/vvc_parser: Fix integer overflow calculating framerate
num_units_in_tick and time_scale are both 32-bit unsigned integers.
Storing them as ints was causing overflows.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:15:29 +08:00
Frank Plowman
b4baa4c0b3 lavc/vvc: Fix left shifts of negative values
All these variables lie in the range [-12..12]

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-09 22:13:49 +08:00
J. Dekker
67e2f8b6bf configure, etc: switch to shebang without space
Note that the config.sh file is left without a shebang, this file is
supposed to be sourced into the current environment.

This commit is purely cosmetic.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 16:01:24 +02:00
J. Dekker
fcfd17dbb4 ffbuild/libversion.sh: add shebang
The implicit interpreter is dependent on the environment, and isn't
guaranteed to be /bin/sh. Some packagers call this script directly, and
in certain environments such as containers using qemu-user through
binfmt_misc emulation on Linux it doesn't fallback to /bin/sh.

To fix these cases we add the interpreter explicitly.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 15:34:53 +02:00
J. Dekker
3090106635 configure: simplify bigendian check
The preferred way to use LTO is --enable-lto but often times packagers
still end up with -flto in cflags for various reasons. Using grep
on binary object files is brittle and relies on specific object
representation, which in the case of LLVM bitcode, debug information or
other intermediary formats can fail silently.

This patch changes the check to a more commonly used define for GCC
style compilers. More checks may be needed to cover other potential
compilers that don't use the __BYTE_ORDER__ define.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-04-09 15:34:13 +02:00
Niklas Haas
459648761f avcodec/hevcdec: fix segfault on invalid film grain metadata
Invalid input files may contain film grain metadata which survives
ff_h274_film_grain_params_supported() but does not pass
av_film_grain_params_select(), leading to a SIGSEGV on hevc_frame_end().

Fix this by duplicating the av_film_grain_params_select() check at frame
init time.

An alternative solution here would be to defer the incompatibility check
to hevc_frame_end(), but this has the downside of allocating a film
grain buffer even when we already know we can't apply film grain.

Fixes: https://trac.ffmpeg.org/ticket/10951
2024-04-09 15:01:58 +02:00
Anton Khirnov
baf17c15be doc/ffmpeg: document that there can be multiple complex filtergraphs 2024-04-09 10:34:18 +02:00
Anton Khirnov
3bd7c57125 fftools/ffmpeg_filter: implement filtergraph chaining
This allows one complex filtergraph's output to be sent as input to
another one, which is useful in certain situations (one is described in
the docs).

Chaining filtergraphs was already effectively possible by using a
wrapped_avframe encoder connected to a loopback decoder, but it is ugly,
non-obvious and inefficient.
2024-04-09 10:34:18 +02:00
Anton Khirnov
255ae03601 fftools/ffmpeg_sched: allow filtergraphs to send to filtergraphs
Will be useful for filtergraph chaining that will be added in following
commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
3d01996b24 fftools/ffmpeg_filter: change processing order in fg_finalise_bindings()
First bind all inputs in all filtergraphs, only then check that all
outputs are bound.

Needed by the following commit.
2024-04-09 10:34:18 +02:00
Anton Khirnov
243a51490a fftools/ffmpeg_filter: only store complex filtergraphs in global array
Store simple filtergraphs in the stream they feed. Keeping the two
separate will be useful in following commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
d74cbcb963 fftools/ffmpeg_filter: drop OutputFilter.ost
All remaining code accessing it only needs to know whether this
filtergraph output has been bound or not.
2024-04-09 10:34:18 +02:00
Anton Khirnov
f2c919252d fftools/ffmpeg_filter: accept encoder thread count through OutputFilterOptions
Stop digging through encoder options manually.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
bfeb751171 fftools/ffmpeg_mux: drop OutputFile.format
It is no longer used outside of the muxing code (where we can access the
muxer directly).
2024-04-09 10:34:18 +02:00
Anton Khirnov
5b0589c8c3 fftools/ffmpeg_mux: drop OutputFile.shortest
It is no longer needed outside of of_open() and its children.
2024-04-09 10:34:18 +02:00
Anton Khirnov
a4c940c86a fftools/ffmpeg_filter: move most of -apad logic to the muxer
The decision whether -apad actually does anything is made based on muxer
properties, and so more properly belongs there. Filtering code only
receives the result.
2024-04-09 10:34:18 +02:00
Anton Khirnov
a2892dbe06 fftools/ffmpeg_filter: pass trim parameters through OutputFilterOptions
Do not read them from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
83304f7c1f fftools/ffmpeg_filter: pass autoscale through OutputFilterOptions
Do not read it from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
b8e6802023 fftools/ffmpeg_filter: pass sws/swr opts through OutputFilterOptions
Do not read them from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
23c23077fc fftools/ffmpeg_filter: drop an unnecessary use of OutputStream
OutputFilter.type contains the same information.
2024-04-09 10:34:18 +02:00
Anton Khirnov
fc6354c39c fftools/ffmpeg_filter: add an AVClass to OutputFilter
Use it for logging where appropriate, avoid logging to OutputStream as
we do not own it.

This is a step towards decoupling filtering from encoding.
2024-04-09 10:34:18 +02:00
Anton Khirnov
3c3e04c8a3 fftools/ffmpeg_filter: simplify retrieving filter type 2024-04-09 10:34:18 +02:00
Anton Khirnov
114cbaa316 fftools/ffmpeg_filter: drop a redundant check
fg_finalise_bindings() already checks that all filtergraph outputs are
connected.
2024-04-09 10:34:18 +02:00
Anton Khirnov
da80e0b077 fftools/ffmpeg_filter: accept a caller-provided output name
Do not construct it from OutputStream manually.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
82c7c21b18 fftools/ffmpeg: drop OutputStream.is_cfr
It is used in a single place in the filtering code, so it is better to
inline it there.
2024-04-09 10:34:18 +02:00
Anton Khirnov
509afedaaf fftools/ffmpeg_filter: pass vsync method through OutputFilterOptions
Do not read it from OutputStream directly.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
bc206ed1b3 fftools/ffmpeg_filter: stop accessing encoder AVCodecContext
Pass all the necessary value through OutputFilterOptions.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
17702c5f7b fftools/ffmpeg_filter: move the MJPEG format selection hack to muxer setup
That, if anywhere, is a more appropriate place for it.
2024-04-09 10:34:18 +02:00
Anton Khirnov
9d5bf2d69e fftools/ffmpeg_filter: pass enc_timebase through OutputFilterOptions
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
606c71bb11 fftools/ffmpeg: warn about ignored -enc_time_base for subtitles earlier
Can do it as soon as that option is parsed, no need to postpone it until
opening the encoder.
2024-04-09 10:34:18 +02:00
Anton Khirnov
e903c31fd1 fftools/ffmpeg_filter: pass keep_pix_fmt through OutputFilterOptions
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
b3864e7a08 fftools/ffmpeg_filter: pass ts offset through OutputFilterOptions
Reduces the need to access OutputFile, which will allow decoupling
filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
651c79da36 fftools/ffmpeg_filter: check that filter type matches output stream type
For simple filtergraphs. For complex filtergraphs they always match.
2024-04-09 10:34:18 +02:00
Anton Khirnov
8e35e33d42 fftools/ffmpeg_filter: stop accessing AVCodecContext.codec
Instead pass the encoder through a newly-added output options struct,
analogous to previously added input options.

Will allow decoupling filtering from encoding in future commits.
2024-04-09 10:34:18 +02:00
Anton Khirnov
8c33085313 fftools/ffmpeg_filter: do not pass OutputStream to set_channel_layout()
It only needs a list of allowed layouts and the requested layout.
2024-04-09 10:34:18 +02:00
Anton Khirnov
d7cde009ce lavfi/avfilter: add an "auto" constant to the threads option
Analogous to the same constant in avfiltergraph and avcodec.
Cf. f599ae88c2.
2024-04-09 10:34:18 +02:00
Anton Khirnov
b0e1bc6298 lavfi/vf_scale: fix AVOption flags for "size"/"s" 2024-04-09 10:34:18 +02:00
James Almer
b0ef9e35e8 x86/ac3dsp: clear the upper 32 bits for input arguments where needed
Fixes checkasm on win64.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-08 13:45:58 -03:00
Andreas Rheinhardt
17414abb69 avcodec/mpegvideo_dec, h264_slice: Return proper error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
7f0efe2324 avcodec/mpeg12dec: Remove redundant mpeg_enc_ctx_allocated
Use context_initialized from the underlying MpegEncContext
instead. Also don't check before ff_mpv_common_end()
in mpeg_decode_end().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
94295bb574 avcodec/mpegvideo: Remove pointless check
Possible since 315c956cbd.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
6f2f496822 avcodec/mpegvideo_dec: Move getting Picture slot into alloc_picture()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
b7cf2d0efc avcodec/mpegvideo_dec: Factor allocating dummy frame out
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
b00c697654 avcodec/mpegvideo_dec: Remove redundant code to reset keyframe flag
These AVFrames are blank and therefore the flag is already unset.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
da4cca5fc0 avcodec/mpegvideo_dec: Remove obsolete current_picture_ptr reuse code
Obsolete since at least 74d623914f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
00e48e6da8 avcodec/mpeg12dec: Remove unnecessary FFCodec.close
The ipu decoder never calls ff_mpv_common_init() or allocates
anything else that would need to be freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
f48313526b avcodec/mpegvideo_dec: Don't emit non-keyframe warning for H.261
H.261 does not have keyframes (or indeed frame types) at all,
so this warning is not warranted.

Also remove an always-true check while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
518f79f2a8 avcodec/mpeg12dec: Don't pretend MPEG-1/2 to support alpha
(FF_PTR_ADD has to be kept although MPEG-1/2 only supports
YUV pixel formats because our decoder also supports decoding
to AV_PIX_FMT_GRAY8 depending upon CONFIG_GRAY.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:02 +02:00
Andreas Rheinhardt
1a5452655a avcodec/mpeg12dec: Remove redundant check
This code only gets executed for the first field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt
a9709b3c83 avcodec/mpegvideo_dec, mpeg12dec: Move MPEG1/2 code to mpeg12dec.c
Up until now, ff_mpv_frame_start() offsets the data of the current
picture and doubles the linesizes of all pictures if the current
picture is field-based so that data and linesize allow to address
the current field only.

This is done based upon the current picture_structure value.
Only two mpegvideo-based decoders ever set this field: mpeg1/2
and VC-1; but the latter only does it after ff_mpv_frame_start()
(when using hardware-acceleration and in order to signal it to
the DXVA2 hwaccel) in which case no offset is applied in
ff_mpv_frame_start(). So only one decoder actually wants this
offset*; therefore move the code performing it to mpeg12dec.c.

*: VC-1 doubles linesize when using field_mode (not only the picture's
linesize, but also uvlinesize and linesize), yet it does not offset
anything. This is further proof that this should not be performed
generically.

Also move MPEG-1/2 specific setting of the top-field-first flag.
(The change here implies that the AVFrame in current_picture
may have different top-field-first flags than the AVFrame
from current_picture_ptr, but this doesn't matter as only
the latter's are used.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt
ca7b2c393a avcodec/mpeg12: Remove always-false check
Forgotten in 7800cc6e82.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt
66923165d5 avcodec/mpegutils: Move definitions to better places
FRAME_SKIPPED -> h263dec.h
CANDIDATE_MB_TYPE_* -> mpegvideoenc.h
INPLACE_OFFSET -> mpegvideoenc.h
enum OutputFormat -> mpegvideo.h

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
Andreas Rheinhardt
908a73df31 avcodec/mpegvideo_enc: Don't update current_picture unnecessarily
current_picture is not changed after frame_start() at all
and it therefore does not need to be updated (i.e. copied to the
slice thread contexts) a second time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-08 15:00:01 +02:00
James Almer
1f049d5627 avcodec/vvc/dec: fix typo
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-08 09:10:04 -03:00
James Almer
9eca5b8369 avcodec/vvc/ps: reset sps_id_used on flush
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-08 08:56:53 -03:00
Geoff Hill
ee1bc723de avcodec/ac3: Implement sum_square_butterfly_float for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill
42e88f18f3 avcodec/ac3: Implement sum_square_butterfly_int32 for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill
69cb34f885 avcodec/ac3: Implement ac3_extract_exponents for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill
6f6bd10531 avcodec/ac3: Implement ac3_exponent_min for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:40 +03:00
Geoff Hill
b69486ea18 avcodec/ac3: Implement float_to_fixed24 for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:28 +03:00
Andreas Rheinhardt
2d33d6bfcc avcodec/dv: Don't pretend initializing work chunks can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
f3c8d0399a avcodec/huffyuvdec: Use assert to check for things that can't fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
a6d6c8442c avcodec/huffyuvdec: Use bytestream API for byte-aligned reads
This also allows to remove the padding from these buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
a6979e3bd2 avcodec/huffyuvenc: Deduplicate options
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
5110d16f5a avcodec/huffyuvenc: Avoid code duplication
This also fixes misindentated code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
d517c9e51b avcodec/huffyuvenc: Avoid duplicate variables
Also simplify assigningfake strides.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
0e5af493fc avcodec/huffyuv: Return proper error code
Also forward said error code in the encoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
cf96c0295e avcodec/huffyuv(dec|enc): Use union for temp/temp16
These pointers already point to the same buffers, so using
a union is possible and avoids the overhead of syncing the
pointers (and saves some memory).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
eef5d60ac6 avcodec/huffyuv: Inline common alloc/free functions in their callers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Andreas Rheinhardt
cebf1d59a5 avcodec/huffyuvdec: Don't zero unnecessarily
A decoder's private data has already been zeroed (apart from options)
before init is called.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-07 21:59:32 +02:00
Frank Plowman
2d79ae3f8a lavc/vvc: Error if SPS ID is duplicated within CVS
Key line from the spec is:

"All SPS NAL units with a particular value of sps_seq_parameter_set_id
in a CVS shall have the same content."

Prior to this patch, the VVC decoder's behaviour on encountering a
duplicated SPS ID (within the entire bitstream, not restricted to
a CVS) was simply to replace the entry in the SPS lookup table with the
new data.  Illegal bitstreams with multiple SPSs in the same CVS sharing
an ID but differing elsewhere could cause all manner of issues.

The patch tracks which SPS IDs have been used in the given CVS using the
new sps_id_used field of VVCParamSets.  If it encounters an SPS with an
ID already in use and whose content differs from the previous SPS, it
throws an AVERROR_INVALIDDATA.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-04-07 10:13:45 +08:00
Andreas Rheinhardt
0dbf45120a avcodec/libdav1d: Don't cast const away unnecessarily
Possible since c89f6ae689.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-06 18:44:06 +02:00
Stefano Sabatini
1cb1f29a04 lavf/lrc: fix comments in headers 2024-04-06 12:59:56 +02:00
Antoine SOULIER
4865ea48cc avcodec/liblc3dec: retrieve duration of the last packet from the demuxer
Use the packet duration field to invalid last samples of the last frame.
2024-04-06 09:55:57 +02:00
Antoine SOULIER
6de00dc5f1 avcodec/liblc3dec: fix extradata size 2024-04-06 09:40:37 +02:00
Antoine SOULIER
ad3fcfd0f2 avcodec/liblc3dec: fix typo in macro name, fix compilation 2024-04-06 09:40:32 +02:00
Oneric
57c545090d avocdec/ass: simplify linebreaks
ff_ass_subtitle_header_* still used explicit CRLF linebreaks
eventhough they will get normalised to LF later since commit
7bf1b9b357. Just directly use LF.
2024-04-06 09:26:30 +02:00
Oneric
0fc975c0d3 avcodec/ass,webvttdec: implement more portable curly brace escapes
Unlike what the old comment suggested, standard ASS has no character
escape mechanism, but a closing curly bracket doesn't even need one.

For manual authored sub files using a full-width variant of an
appropriate font and with scaling and spacing modifiers is a common
workaround.
This is not an option here, but we can still make things much less bad.
Now the desired opening bracket still shows up in libass, and
standard renders will merely display a backslash in its place
instead of stripping the following text like before.
2024-04-06 09:25:03 +02:00
Oneric
baa64fa4e6 avcodec/ass,webvttdec: fix handling of backslashes
Backslashes cannot be escaped by a backslash in any ASS renderer,
but unless followed by specific characters it is just printed out.
Insert a word-joiner character after a backslash to break up
active sequences without changing the visual output.
2024-04-06 09:24:47 +02:00
Oneric
7b8b4cdd96 avcodec/webvttdec: honour bidi marks 2024-04-06 09:23:51 +02:00
James Almer
6f13f5dd59 doc/encoders: add missing libxvid option
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 17:20:54 -03:00
James Almer
16ba7bdd76 doc/encoders: remove non-existent flag
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 17:13:15 -03:00
James Almer
81b3a82fae avcodec/libaomenc: remove variable redefinition
Missed in 5e0eac3d45.

Reported-by: Niklas Haas <ffmpeg@haasn.xyz>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 14:57:29 -03:00
James Almer
5e0eac3d45 avcodec/libaomenc: bump the minimum required version to 2.0.0
v2.0.0 is already four years old and even newer versions are available on
stable distro releases.
With this we stop setting codec capabilities during static data initialization.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-05 14:32:08 -03:00
Andreas Rheinhardt
7b7b7819bd fate/ffmpeg: Avoid dependency on samples
Creating vsynth_lena.yuv needs the FATE suite,
yet several tests in ffmpeg.mak without a dependency
on samples used it as input file. Fix this by using
vsynth1.yuv (which does not have such a dependency)
instead.
Also use vsynth1.yuv in fate-shortest to avoid
the samples dependency in this test, too.

Fixes ticket #10947.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-05 17:37:28 +02:00
Andreas Rheinhardt
d307aca184 avcodec/wavpack: Remove always-false check
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt
aecd63478e avcodec/dsd: Hoist branch out of loop
This is possible by not converting from LSBF to MSBF; instead
add LSBF LUTs.
This approach necessitates reversing the initial values.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt
6d38c260e5 avcodec/dsddec: Fix decoding LSBF samples
ff_dsd2pcm_translate() works internally by converting LSBF input
to MSBF upon reading; its buffer is therefore always MSBF
and should therefore be initialized with MSBF silence;
but this is not true since e3d8963c3c
which this patch effectively reverts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt
e81fa9f482 avcodec/wavpack: Only initialize DSD data when encountering DSD
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt
1c2860e815 fate/wavpack: Add test for DSD
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt
c720c69188 avcodec/dsd: Use double for LUTs
Needed to make DSD->PCM conversion bitexact across arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt
2f59648aed avcodec/wavpack: Fix leak and segfault on reallocation error
av_realloc_f() frees the buffer it is given on allocation
failure. But in this case, the buffer is an array of
ownership pointers, causing leaks on error. Furthermore,
the count of pointers is unchanged on error and the codec's
close function uses it to free said ownership pointers,
causing a NPD.
This is a regression since 46412a8935.

Fix this by switching to av_realloc_array().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:58:57 +02:00
Andreas Rheinhardt
a4800643bb avcodec/lossless_videoencdsp: Don't presume alignment in diff_bytes
The alignment of all the parameters in diff_bytes can be
anything the despite the documentation claiming otherwise.
8ecd383122 was based around
said documentation and is therefore insufficient to fix
e.g. the misaligned loads that happen in the huffyuvbgra
and huffyuvbgr24 vsynth FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:57:19 +02:00
Andreas Rheinhardt
e54696bcaa avcodec/ppc/h264dsp: Fix left shifts of negative numbers
PPC equivalent of c756b3fca2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 23:57:19 +02:00
Leo Izen
7c338f470f avcodec, avformat/ffjni: fix duplicate JNI symbols
Use SHLIBOBJS and STLIBOBJS in the Makefiles for avcodec and avformat,
and add a stub ffjni.c to libavformat, which allows the symbols to be
duplicated for shared builds but not static builds.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-04-04 21:51:21 +02:00
Michael Niedermayer
bf3b74142e avformat/pcm: Use 64bit in bitrate computation
Fixes: signed integer overflow: 65792 * 65312 cannot be represented in type 'int'
Fixes: 67819/clusterfuzz-testcase-minimized-ffmpeg_dem_WADY_fuzzer-5236100912185344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:30 +02:00
Michael Niedermayer
ed49391961 avformat/mxfdec: Check index_edit_rate
Fixes: Assertion b >=0 failed at libavutil/mathematics.c:62
Fixes: 67811/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5108429687422976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:29 +02:00
Michael Niedermayer
1a9eda65d0 swscale/utils: Fix xInc overflow
Fixes: signed integer overflow: 2 * 1073741824 cannot be represented in type 'int'
Fixes: 67802/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6249515855183872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:29 +02:00
Michael Niedermayer
4593cf7ab3 avformat/iamf_parse: Check sound_system
Fixes: index 13 out of bounds for type 'const struct IAMFSoundSystemMap [13]'
Fixes: 67796/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4554553191104512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:29 +02:00
Michael Niedermayer
28c7094b25 avcodec/wavarc: fix signed integer overflow in block type 6/19
Fixes: signed integer overflow: -2088796289 + -91276551 cannot be represented in type 'int'
Fixes: 67772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6533568953122816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-04 19:38:28 +02:00
James Almer
3db674614d avcodec/liblc3enc: don't force unspec channel layouts
We only care about channel count. Layout details will be ignored either way.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 13:57:34 -03:00
James Almer
45d2110fc7 avcodec/liblc3dec: sanitize channel count in avctx
Should prevent out of array accesses.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 13:55:16 -03:00
Antoine Soulier via ffmpeg-devel
240fd04db2 avcodec/liblc3: add encoding/decoding support of LC3 audio codec
The LC3 audio codec is the default codec of Bluetooth LE audio.
This is a wrapper over the liblc3 library (https://github.com/google/liblc3).

Signed-off-by: Antoine Soulier <asoulier@google.com>
2024-04-04 17:47:31 +02:00
Marth64
e3335e9e9e Changelog: fix typos for 7.0 section
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 12:43:47 -03:00
Andreas Rheinhardt
428ff7bd8c swscale/ppc/swscale_ppc_template: Reindent after the previous commit
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 16:47:21 +02:00
Andreas Rheinhardt
95b4aea5e3 swscale/ppc/swscale_ppc_template: Remove code not passing checkasm
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 16:45:23 +02:00
Andreas Rheinhardt
db063212c8 avcodec/vvc: Rename vvc_?foo->foo
A namespace is unnecessary here given that all these files
are already in the vvc subfolder.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 16:45:00 +02:00
Jean-Baptiste Kempf
486a2b964b changelog: update for 7.0
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 10:57:28 -03:00
Wenbin Chen
478d97f303 libavfilter/dnn_io_proc: Take step into consideration when crop frame
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-04-04 14:26:57 +08:00
Wenbin Chen
8869f5ce86 libavfilter/dnn_backend_openvino: Check bbox's height
Check bbox's height with frame's height rather than frame's width.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-04-04 14:26:52 +08:00
Andreas Rheinhardt
9309b5bc64 avcodec/vvc/vvc_inter_template: Fix left shift of negative number
Affected the vvc-conformance-WP_A_3 FATE test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-04 11:36:41 +08:00
Andreas Rheinhardt
3fe28831ed configure: Only enable iamfdec, iamfenc when needed
Since 591e27d1e7 they would
always be compiled even when nothing uses them; for shared
builds the default linker behaviour is to include them
even when not needed.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 22:12:55 +02:00
Andreas Rheinhardt
9c4558b596 configure: Fix iamfdec dependencies
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 22:04:46 +02:00
Michael Niedermayer
5a5422196d doc/developer: (security) researchers should be credited
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 21:38:24 +02:00
Jan Ekström
16128f3c55 avcodec/libx265: do not arbitrarily limit color values
Newer specifications such as H.273 have, and probably will further
in the future add new values to these, so - instead of trying to update
these limits - we should simply check if the values are not set to the
value of "unspecified".

This should allow newer avutil values such as IPT-C2 or YCgCo-R
variants be passed to x265 itself, which apparently does its own
validation further down the line.
2024-04-03 21:31:35 +03:00
Jan Ekström
23d1b50175 avfilter/{buffersrc,vf_setparams}: map IPT-C2, YCgCo-R variants 2024-04-03 21:31:35 +03:00
Jan Ekström
06c53efd23 avcodec/options_table: map IPT-C2, YCgCo-R variants in colorspace 2024-04-03 21:31:35 +03:00
Jan Ekström
29561c8e2d avutil/pix{desc,fmt}: add new matrix coefficients from H.273 v3
* SMPTE ST 2128 IPT-C2 defines the coefficients utilized in DoVi
  Profile 5. Profile 5 can thus now be represented in VUI as
  {AVCOL_RANGE_JPEG, AVCOL_PRI_BT2020, AVCOL_TRC_SMPTE2084,
   AVCOL_SPC_IPT_C2, AVCHROMA_LOC_LEFT} (although other chroma
  sample locations are allowed). AVCOL_TRC_SMPTE2084 should in
  this case be interpreted as 'PQ with reshaping'.
* YCgCo-Re and YCgCo-Ro define the bitexact YCgCo-R, where the
  number of bits added to a source RGB bit depth is 2 (i.e., even)
  and 1 (i.e., odd), respectively.
2024-04-03 21:31:35 +03:00
Andreas Rheinhardt
924402f783 configure: Add missing libdav1d/av1 decoders->dovi_rpu dependency
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 20:07:54 +02:00
Andreas Rheinhardt
7895d1860f avfilter/avfilter: Don't use av_uninit
GCC 9-13 do not emit warnings for this at all optimization
levels even when -Wmaybe-uninitialized is not disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
8d3fdb42c0 avfilter/vf_grayworld: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
de288e406a avfilter/vf_hflip: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
99a200cad8 avfilter/vf_vflip: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
6260d4f770 avfilter/vf_swapuv: Remove empty options and AVClass
This filter only had an AVClass and empty options because up until
recently, avfilter_init_str() errored out when options were provided
for a filter without an AVClass. But setting (generic) options is
necessary to take advantage of timeline support. So with
avfilter_init_str() fixed, the AVClass and the options can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
0c800c0b48 avfilter/avfilter: Honour the short options documentation
The documentation for filter arguments states that short options must
precede long options (i.e. those of the form key=value). Yet if
process_options() encounters arguments not abiding by this, it simply
treats short options after a long option as if it were parsing short
options for the first time. In particular, it overwrites options already
set earlier, possibly via other short options. This is not how it is
intended (as a comment in the code indicates).

This commit modifies the code to reject further shorthand options
after a long option has been encountered. After all, avfilter_init_str()
errors out upon unrecognized options, so it is intended to be picky.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
c96d0a0b85 avfilter/avfilter: Use AV_DICT_DONT_STRDUP_(KEY|VAL) when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
abcb4b44f5 avcodec/tiff: Don't cast const away via bsearch
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:14:12 +02:00
Andreas Rheinhardt
a5fcd97801 avcodec/libvpxenc: Avoid unused-variable warning if VP9 enc is disabled
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:12:22 +02:00
Andreas Rheinhardt
e123295cc8 avcodec/proresdec2: Rename to proresdec
Once upon a time, there used to be a LGPL and a GPL ProRes decoder
in FFmpeg; the current decoder evolved from the second of these.
But given that it is now the only ProRes decoder we have, it's file
should simply be named proresdec.c (which also brings it in line with
its header).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:30 +02:00
Andreas Rheinhardt
07c734b2b2 fate/ffprobe: Fix test requirements
The ffprobe-test file is generated via ffmpeg and several filters;
the requirements for them were missing.
Also deduplicate this while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:24 +02:00
Andreas Rheinhardt
b351cbb314 fate/api: Fix requirements of fate-api-seek
It relies on the fate-lavf-flv test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:24 +02:00
Andreas Rheinhardt
2cd397d90d fate/lavf-container: Check earlier for presence of ffmpeg cli
Several other tests (e.g. concatdec) examine FATE_LAVF_CONTAINER
in order to enable or disable tests that depend on samples
created by the lavf-container tests; right now this procedure
did not account for CONFIG_FFMPEG.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:23 +02:00
Andreas Rheinhardt
7eff280599 fate/libswscale: Disable ffmpeg-dependent tests without ffmpeg
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 19:10:23 +02:00
Niklas Haas
9073f49e6e avcodec/dovi_rpu: attach ext blocks to frames 2024-04-03 16:16:55 +02:00
Niklas Haas
f46fff27d0 avcodec/dovi_rpu: parse extension blocks
We split the inner loop between v1 and v2 extension blocks to print
a warning where an extension block was encountered in an unexpected
context.

Co-authored-by: quietvoid <tcChlisop0@gmail.com>
2024-04-03 16:16:55 +02:00
Niklas Haas
3a1916c38a avcodec/dovi_rpu: add ext_blocks array to DOVIContext 2024-04-03 16:16:55 +02:00
Niklas Haas
b90c18b38c avcodec/dovi_rpu: verify RPU data CRC32
The Dolby Vision RPU contains a CRC32 to validate the payload against.
The implementation is CRC32/MPEG-2.

The CRC is only verified with the AV_EF_CRCCHECK flag.

Co-authored-by: quietvoid <tcChlisop0@gmail.com>
2024-04-03 16:16:53 +02:00
Niklas Haas
a6c624f8f7 avcodec/dovi_rpu: strip container in separate step
This ensures that `gb` in the following section is fully byte-aligned,
points at the start of the actual RPU, and ends on the CRC terminator.

This is important for both calculation of the CRC, as well as dovi
extension block parsing (which aligns to byte boundaries in various
places).
2024-04-03 16:16:25 +02:00
Niklas Haas
0473270a34 avcodec/dovi_rpu: switch to AVERROR_INVALIDDATA
Instead of AVERROR(EINVAL)
2024-04-03 16:16:25 +02:00
Niklas Haas
4f55e16f2b avutil/dovi_meta: add dolby vision extension blocks
As well as accessors plus a function for allocating this struct with
extension blocks,

Definitions generously taken from quietvoid/dovi_tool, which is
assembled as a collection of various patent fragments, as well as output
by the official Dolby Vision bitstream verifier tool.
2024-04-03 16:16:25 +02:00
quietvoid
78076ede29 avutil/dovi_meta: add AVDOVIDataMapping.nlq_pivots
The NLQ pivots are not documented but should be present in the header
for profile 7 RPU format. It has been verified using Dolby's
verification toolkit.

Signed-off-by: quietvoid <tcChlisop0@gmail.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-04-03 16:16:23 +02:00
Eugene Zemtsov
591e27d1e7 configure: Separate subsystem for Immersive Audio Model
This change allows users to build libavfomat without support
for Immersive Audio Model by specifying --disable-iamf.
It helps to save on binary size in cases where it's important.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: Eugene Zemtsov <eugene@chromium.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-03 09:57:52 -03:00
Haihao Xiang
1590a96adc lavc/vaapi_encode: convert from lambda to qp
When AV_CODEC_FLAG_QSCALE is set, the value of avctx->global_quality is
lambda.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-04-03 10:26:33 +08:00
Fei Wang
09377887df lavc/vaapi_encode: Add VAAPI version check for BLBRC
Fix build fail when VAAPI version less than 0.39.2.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-04-03 10:23:05 +08:00
Tong Wu
0faf2ca98a avcodec/d3d12va_decode: remove extra spaces for declaration
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-04-03 10:23:05 +08:00
James Almer
50458b7fa1 avformat/isom: don't drop the known layout when parsing AAC decSpecificInfo
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 20:21:13 -03:00
Michael Niedermayer
d157725cf7 avformat/isom: Uninit layout in ff_mp4_read_dec_config_descr()
Fixes: memleak
Fixes: 67442/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5068813261406208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 20:20:04 -03:00
Michael Niedermayer
e3984de6ff avcodec/exr: Dont use 64bits to hold 6bits
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:38 +02:00
Michael Niedermayer
589fa8a027 avcodec/exr: Check for remaining bits in huf_unpack_enc_table()
Fixes: Timeout
Fixes: 67645/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6308760977997824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:38 +02:00
Michael Niedermayer
1887ff250c avcodec/apedec: Use NABS to avoid undefined negation
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: 67738/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5444313212321792

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:38 +02:00
Michael Niedermayer
d58037c18e avcodec/hevc_ps: --typo
Fixes: null pointer dereference
Fixes: 67737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4858162608930816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:37 +02:00
Michael Niedermayer
aeb13b03be tools/target_dec_fuzzer: Adjust threshold for RV30
Fixes: Timeout
Fixes: 67530/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV30_fuzzer-6635676118351872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-03 00:44:37 +02:00
Mark Samuelson
c52869f36e avcodec/mfenc: expose more properties of the media foundation encoder 2024-04-02 21:45:47 +01:00
Marth64
2204ea00d6 doc/indevs: update CC extraction example to use RCWT muxer
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64
0866b2ba5e doc/muxers: refresh the RCWT muxer's doc to be consistent with the demuxer
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64
58f04608c2 avformat/rcwtenc: remove repeated documentation
The high level summary of RCWT can be delegated doc/muxers, which
makes it easier to maintain and more consistent with the documentation
of the demuxer.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64
536f0239c0 avformat/rcwtenc: don't assume .bin extension
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:09:05 +02:00
Marth64
15406f8377 avformat/rcwtdec: add RCWT Closed Captions demuxer
RCWT (Raw Captions With Time) is a format native to ccextractor,
a commonly used OSS tool for processing 608/708 Closed Captions (CC).
RCWT can be used to archive the original extracted CC bitstream.
The muxer was added in January 2024. In this commit, add the demuxer.

One can now demux RCWT files for rendering in ccaption_dec or interop
with ccextractor (which produces RCWT). Using the muxer/demuxer combo,
the CC bits can be kept for processing or rendering with either tool.
This can be an effective way to backup an original CC stream, including
format extensions like EIA-708 and overall original presentation.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 20:08:51 +02:00
Stefano Sabatini
dfd9c21754 Changelog: add next entry 2024-04-02 20:04:46 +02:00
Marth64
1c35333671 avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events
If ff_subtitles_queue_insert() were given a NULL buffer
with 0 length, it would still attempt to grow the packet
or memcpy depending on if merge option is enabled.

In this commit, allow passing a NULL buffer with 0 length
without attempting to do such operations. This way, if a
subtitle demuxer happens to pass an empty cue or wants to
use av_get_packet() to read bytes, there are no unnecessary
operations on the packet after it is allocated.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-04-02 19:59:01 +02:00
Nicolas Gaullier
ed9363052f avformat/demux: add duration_probesize AVOption
Yet another probesize used to get the durations when
estimate_timings_from_pts is required. It is aimed at users interested
in better durations probing for itself, or because using
avformat_find_stream_info indirectly and requiring exact values: for
concatdec for example, especially if streamcopying above it.
The current code is a performance trade-off that can fail to get video
stream durations in a scenario with high bitrates and buffering for
files ending cleanly (as opposed to live captures): the physical gap
between the last video packet and the last audio packet is very high in
such a case.

Default behaviour is unchanged: 250k up to 250k << 6 (step by step).
Setting this new option has two effects:
- override the maximum probesize (currently 250k << 6)
- reduce the number of steps to 1 instead of 6, this is to avoid
detecting the audio "too early" and failing to reach a video packet.
Even if a single audio stream duration is found but not the other
audio/video stream durations, there will be a retry, so at the end the
full user-overriden probesize will be used as expected by the user.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
2024-04-02 19:53:40 +02:00
Stefano Sabatini
13cdef9d45 doc/muxers: add ircam
Most of the content copy&pasted from:
http://fileformats.archiveteam.org/wiki/Berkeley/IRCAM/Carl_Sound_Format
2024-04-02 19:48:29 +02:00
Stefano Sabatini
026bef7771 doc/muxers/image2: add mention to image2pipe
Clarify the difference with regards to the image2 muxer.
2024-04-02 19:48:28 +02:00
Stefano Sabatini
827889d8f3 doc/muxers/image2: apply misc consistency fixes 2024-04-02 19:48:28 +02:00
Stefano Sabatini
b5488392f0 doc/muxers: add ilbc 2024-04-02 19:48:28 +02:00
Stefano Sabatini
3e4f0b07de doc/muxers: add stub for iamf 2024-04-02 19:48:28 +02:00
Stefano Sabatini
06f17cc9ce doc/muxers/hls: review, apply consistency fixes
Apply misc typo fixes, consistency fixes, and reformat the layout to provide more overall
internal and global consistency.
2024-04-02 19:48:28 +02:00
James Almer
8f85f657d7 RELEASE: update after 7.0 branch
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 13:02:39 -03:00
James Almer
6e52223f3a fate/vvc: add vvc-conformance-IBC_B_Tencent_2
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 12:34:26 -03:00
James Almer
e60d4913ae fate/vvc: add vvc-conformance-SUBPIC_C_ERICSSON_1
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 12:15:03 -03:00
James Almer
e9778d20a4 fate/vvc: disable vvc-conformance-OPI_B_3 and vvc-conformance-VPS_A_3
Both samples rely on a feature our decoder doesn't currently support.

Should fix fate failures on some systems where not even the one single frame
could be generated.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 11:50:08 -03:00
James Almer
45b56455ad avcodec/vvc_refs: don't ask for a "Inter layer ref" sample
The FATE suite has two already.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 11:48:32 -03:00
Nuo Mi
238bb653e7 avcodec/vvcdec: inter prediction, support subpicture
passed files:
    LMCS_B_Dolby_2.bit
    CodingToolsSets_E_Tencent_1.bit
    SUBPIC_A_HUAWEI_3.bit
    SUBPIC_B_HUAWEI_3.bit
    SUBPIC_C_ERICSSON_1.bit
    SUBPIC_D_ERICSSON_1.bit
    SUBPIC_E_MediaTek_1.bit

passed dvb conformance files (https://dvb.org/specifications/verification-validation/vvc-test-content):
    VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_mosaic.bit
    VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_PiP.bit
2024-04-02 20:56:22 +08:00
Nuo Mi
9bc3f3e5fc avcodec/vvcdec: mvs, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi
adeb51c30f avcodec/vvcdec: alf, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi
bbf0ccb8e7 avcodec/vvcdec: sao, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi
0c3018b30a avcodec/vvcdec: sao, refact out tile_edge arrays 2024-04-02 20:56:22 +08:00
Nuo Mi
c9e75393ed avcodec/vvcdec: refact, movie the lc->sc assignment to task_run_stage to simplify the code
This change also make the lc->sc assigned for run_sao
2024-04-02 20:56:22 +08:00
Nuo Mi
8b7304247a avcodec/vvcdec: deblock, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi
0d12e9c3c8 avcodec/vvcdec: refact out deblock_is_boundary 2024-04-02 20:56:22 +08:00
Nuo Mi
4020e68d73 avcodec/vvcdec: misc, rename x_ctb, y_ctb, ctu_x, ctu_y to rx, ry to avoid misleading 2024-04-02 20:56:22 +08:00
Nuo Mi
260130aae8 avcodec/vvcdec: ff_vvc_decode_neighbour, support subpicture 2024-04-02 20:56:22 +08:00
Nuo Mi
4e47847119 avcodec/vvcdec: derive subpic position for PPS 2024-04-02 20:56:03 +08:00
Frank Plowman
8078a0b0fa avcodec/vvcdec: support rectangular single-slice subpics
Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2024-04-02 20:24:31 +08:00
Frank Plowman
9c845e9087 avcodec/vvcdec: fix uninitialized last element of xxx_bd and ctb_to_xxx_bd arrays
see "6.5.1 CTB raster scanning, tile scanning, and subpicture scanning processes"

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
2024-04-02 20:24:31 +08:00
Nuo Mi
64d5cc67cd avcodec/vvcdec: misc, add specification name for pps members 2024-04-02 20:24:31 +08:00
Nuo Mi
191fbd7ddc avcodec/cbs_h266: fix sh_collocated_from_l0_flag and sh_collocated_ref_idx infer
we have to infer sh_collocated_from_l0_flag and sh_collocated_ref_idx from picture head if pps_rpl_info_in_ph_flag is true
2024-04-02 20:24:31 +08:00
Nuo Mi
cd540a333e avcodec/vvcdec: NoBackwardPredFlag, only check active pictures
see "8.3.6 Decoding process for collocated picture and no backward prediction"
2024-04-02 20:24:31 +08:00
James Almer
8e294abd9d avformat/mov: simplify the entry count overflow check in the keys atom
Suggested-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 09:09:35 -03:00
James Almer
5a06d3810e avformat/mov: don't read key_size bytes twice in the keys atom
We only support mdta as type, yet we were not skipping other types,
but rather reading key_size worth of bytes twice per entry.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 00:16:31 -03:00
James Almer
3d12ba77d9 avformat/mov: take into account the first eight bytes in the keys atom
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 00:13:12 -03:00
Eugene Zemtsov
8a23a145d8 avformat/mov: Check if a key is longer than the atom containing it
Stop reading keys and return AVERROR_INVALIDDATA if key_size
is larger than the amount of space left in the atom.

Bug: https://crbug.com/41496983
Signed-off-by: Eugene Zemtsov <eugene@chromium.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-02 00:13:12 -03:00
Andreas Rheinhardt
9d219ff149 avformat/mov: Don't add attached pic if one is already present
Fixes: memleak
Fixes: 67714/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5671570999476224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 04:13:44 +02:00
James Almer
f492f1ac23 avformat/mov: ensure all items id referenced by a grid are valid
Fixes: null pointer dereference
Fixes: 67494/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6528714521247744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-01 21:13:04 -03:00
Andreas Rheinhardt
a8e518e3a7 avcodec/vlc: Use union of uint8_t and uint16_t in VLC_MULTI_ELEM
It is more natural and simplifies writing these arrays.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:59 +02:00
Andreas Rheinhardt
4ab82d2fb6 avcodec/vlc, bitstream: Fix multi VLC with uint8_t syms on BE
VLC_MULTI_ELEM contains an uint8_t array that is supposed
to be treated as an array of uint16_t when the used symbols
have a size of two; otherwise it should be treated as just
an array of uint8_t, but it was not always treated that way:

vlc_multi_gen() initialized the first entry of the array
by writing the symbol via AV_WN16; on big endian systems,
the intended value was instead written into the second entry
of the array (where it would likely be overwritten lateron
during initialization).

read_vlc_multi() also treated this case incorrectly: In case
the code is so long that it needs a classical multi-stage lookup,
the symbol has been written to the destination as if via AV_WN16.
On little endian systems, this sets the correct first symbol and
clobbers (zeroes) the next one, but the next one will be overwritten
lateron anyway, so it won't be recognized. But on big-endian systems,
the first symbol will be set to zero and the actually read symbol
will be put into the slot for the next one (where it will be overwritten
lateron).

This commit fixes this; this fixes the magicyuv and utvideo FATE-tests
on big endian arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:59 +02:00
Andreas Rheinhardt
098f5e2634 fate/fits: Fix tests on BE
The fits decoder decodes to native pixel formats; so
the fitsdec-gbrap16be fate test failed on BE despite
its name because the reference file is LE.
This patch fixes this by forcing a pixel format;
the forced pixel format is BE, causing a change
in the reference file.
The fitsdec-gbrp16be test was not affected, because
its source file (lena-rgb48.png from tne FATE suite)
is actually biendian (as if someone had multiplied
8bit content by 257...).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:59 +02:00
Andreas Rheinhardt
579868f810 fate/filter-video: Insert scale, format filters in filter-yadif,bwdif10
The format and the first scale filter ensures that the filter
processing actually happens in high bit depth; the second
scale filter is only necessary for big endian arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt
1b684a1527 fate/filter-video: Always use little endian pixel format
Fixes filter-metadata-signalstats-yuv420p10 on BE arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt
d5897f70d4 fate/video: Only use bitexact IDCT in avid meridian
Precludes the usage of the altivec IDCT which fixes
the avid-meridian FATE test on ppc64be here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt
8ecd383122 avcodec/huffyuvencdsp: Fix load of misaligned values
Affected many ffvhuff FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt
3ed23dab98 avfilter/vf_spp: Fix left-shift of negative value
Affected the vf-spp FATE-test (on x86 only when MMX
is disabled).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt
9e4e8ae1e6 avcodec/pngdsp: Fix unaligned accesses, effective type violations
Affected the lscr fate-test (only visible on x86 if
the SSE2 is disabled).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
Andreas Rheinhardt
356610a2ac avcodec/ppc/hpeldsp_altivec: Fix left-shift of negative number
It is UB and affected e.g. the vp5 and vp61 FATE tests:
https://fate.ffmpeg.org/report.cgi?time=20240327083327&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-02 00:21:58 +02:00
David Rosca
3f863f089c lavc/vaapi_encode_av1: Set roi_quant_range 2024-04-01 20:08:11 +01:00
Michael Niedermayer
84ce5ced31 avcodec/vvc/vvcdec: Do not submit frames without VVCFrameThread
Such frames will crash when pthread functions are called on the NULL pointer

Fixes: member access within null pointer of type 'VVCFrameThread' (aka 'struct VVCFrameThread')
Fixes: 65160/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-4665241535119360 (partly)
Fixes: 65636/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5394745824182272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 19:05:31 +02:00
Michael Niedermayer
cb9752d897 avformat/mpegts: Reset local nb_prg on add_program() failure
add_program() will deallocate the whole array on failure so
we must clear nb_prgs

Fixes: null pointer dereference
Fixes: crash-35a3b39ddcc5babeeb005b7399a3a1217c8781bc

Found-by: Catena cyber
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 19:03:06 +02:00
Michael Niedermayer
c0532f5579 avcodec/iff: dont add into unused pointers
Fixes: overflowing pointers
Fixes: 66444/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-4812862400823296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 19:00:30 +02:00
Michael Niedermayer
23b29f72ee avformat/aiffdec: Check for previously set channels
Fixes: out of array access (av_channel_layout_copy())
Fixes: 67087/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-4920720268263424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:59:07 +02:00
Michael Niedermayer
f30fe5e8d0 avformat/mxfdec: Make edit_unit_byte_count unsigned
Suggested-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:52:38 +02:00
Michael Niedermayer
d88c284c18 avformat/movenc: Check that cts fits in 32bit
Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, track->timescale, AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694
Fixes: poc2

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:51:59 +02:00
James Almer
0a693bce62 avformat/iamf_parse: keep count_label consistent on language_label allocation failure
Fixes: null pointer dereference
Fixes: 67023/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6011025237278720

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer
f26ee6e066 avformat/iamf_reader: Check len before summing
Fixes: integer overflow
Fixes: 67275/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5438920751906816
Fixes: 67688/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5970342318243840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer
d6ed6f6e8d avformat/mxfdec: Check first case of offset_temp computation for overflow
This is kind of ugly
Fixes: signed integer overflow: 255 * 1157565362826411919 cannot be represented in type 'long'
Fixes: 67313/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6250434245230592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:28 +02:00
Michael Niedermayer
7b7eea8e63 avcodec/jpeg2000htdec: warn about non zero roi shift
Suggested-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:27 +02:00
Michael Niedermayer
19ad05e9e0 avcodec/jpeg2000htdec: Check magp before using it in a shift
Fixes: shift exponent -1 is negative
Fixes: 65378/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5457678193197056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-04-01 18:17:27 +02:00
Anton Khirnov
63f56c9943 doc/community: update conflict of interest rule according to GA vote 2024-04-01 15:38:28 +02:00
Zhao Zhili
7bf85d2d3a avcodec/h264_parse: Fix error code in decode_extradata
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-01 17:05:21 +08:00
Timo Rothenpieler
271a0a55bc avcodec/nvenc: provide nvenc with monotonic frame index 2024-04-01 00:46:12 +02:00
Timo Rothenpieler
c06e9e289f avcodec/nvenc: update minimum driver version list 2024-03-31 21:43:38 +02:00
Timo Rothenpieler
21b4708969 avcodec/nvenc: add support for unidirectional b-frames 2024-03-31 21:32:55 +02:00
Timo Rothenpieler
a270966118 avcodec/nvenc: add support for uhq tune 2024-03-31 21:17:11 +02:00
Timo Rothenpieler
77d23bcb1b avcodec/nvenc: add support for lookahead_level 2024-03-31 20:58:27 +02:00
Timo Rothenpieler
64e3fc9069 avcodec/nvenc: add support for HEVC temporal filtering 2024-03-31 20:47:59 +02:00
Timo Rothenpieler
06c2a2c425 avcodec/nvenc: support SDK 12.2 bit depth API 2024-03-31 19:10:49 +02:00
Timo Rothenpieler
43b417d516 avcodec/nvenc: stop using long deprecated format specifiers 2024-03-31 19:10:49 +02:00
Andreas Rheinhardt
199c479b9a avcodec/arm/vp8: Don't discard const
Forgotten in 25e1986e68.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
0e5f71230a avutil/internal: Move avpriv_set_systematic_pal2 decl to imgutils_internal.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
888e2c0a85 avutil/hwcontext_vulkan: Include hwcontext.h
struct Foo * declares a new type (namely struct Foo)
if there is no declaration of struct Foo already visible
in the current scope; otherwise it is just a pointer to
an element of the already declared type "struct Foo".
There is a gotcha with the first case:
struct Foo is only declared in its scope; a later declaration
of struct Foo in an enclosing scope declares a different type.

This happens in hwcontext_vulkan.h if it is included before
hwcontext.h, because some declarations of struct AVHWDeviceContext
and struct AVHWFramesContext have function prototype scope.

Compilers warn about this (during checkheaders):
‘struct AVHWDeviceContext’ declared inside parameter list will not
be visible outside of this definition or declaration

Fix this by including hwcontext.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
0f78b26e9c avutil/internal: Move FF_MEMORY_POISON to its only user
Namely mem.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
8041a91a32 avutil/internal: Move libm inclusion to the beginning
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
e4e6377afc avcodec/arm/mpegvideo_arm: Use static_assert to check offsets
Also move AV_CHECK_OFFSET to its only user, namely
lavc/arm/mpegvideo_arm.c and rename it to CHECK_OFFSET.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
b616be1649 lib*/version: Use static_assert for static asserts
Also update the checks that guard against inserting
a new enum entry in the middle of a range.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
2d38141ea6 swscale/swscale_internal: Don't export internal function
sws_alloc_set_opts() can actually be made internal to utils.c.
This commit does so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
ad1cef04a9 swscale/swscale_internal: Hoist branch out of loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
c8549d480f avcodec/msmpeg4: Don't include x86-specific header unconditionally
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
a265e8ca92 avcodec, avfilter: Don't use "" for system headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
b49e621c83 swscale/ppc/swscale_altivec: Simplify macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
72f4f1dafb swscale/ppc/swscale_altivec: Fix build with -O0
In this case GCC does not treat a const variable initialized
to the compile-time constant "3" as a compile-time constant
and errors out because the argument is not a literal value.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
347a70f101 avcodec/pcm-bluray/dvd: Use correct pointer types on BE
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
cd63dab55c avcodec/mips/ac3dsp_mips: Add missing includes
Likely broken in d7a75d2163.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Marton Balint
2df2b4067e avfilter/buffersrc: fix overriding unknown channel layouts with negotiated one
Fixes ffplay playback of unknown layouts, when SDL directly supports the audio
format, such as:

ffplay -f lavfi anullsrc=cl=2C,aformat=s16

Without the patch, "Channel layout change is not supported" errors are
generated because buffersrc (unknown 2 channel) and buffersink (stereo)
negotiated a stereo layout, but the stereo layout was never stored in the
BufferSourceContext.

This fixes a regression of 7251f90972, but this
is more of a regression of the avfilter channel layout conversion
(1f96db959c).

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-30 20:59:15 +01:00
Andreas Rheinhardt
ff215d9559 fate/image: Fix EXR tests on big endian
These tests need a scale filter to convert to the prescribed
pixel format (the native format is endian-dependent).

Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 20:33:56 +01:00
James Almer
e37b233ee2 Revert "avformat/mov: ignore item boxes for animated heif"
This reverts commit f6b7b473d4.
The image in the item boxes and the animation in the trak box are not
necessarely the same, so both should be exported.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 12:25:59 -03:00
James Almer
f8fbec8686 avutil/frame: use the same data information as the source entry when cloning side data
src->{data,size} does not need to match src->buf->{data,size}.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 10:15:02 -03:00
Andreas Rheinhardt
ba7980d9c0 avutil/opt: Avoid av_uninit
GCC 9-13 do not emit warnings for this at all optimization
levels even when -Wmaybe-uninitialized is not disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
dc7a60529c avcodec/ratecontrol: Use forward declaration for AVExpr
Avoids including eval.h everywhere where mpegvideo.h
is included.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
348461e550 avcodec/h264_refs: Use smaller scope, don't use av_uninit
In particular, declare iterators with loop scope.
Also remove av_uninit while at it, because they
are now unnecessary due to the changes of the preceding
commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
ac14d68277 avcodec/h264_refs: Rewrite code to make control flow clearer
While this change IMO makes the control flow clearer
for the human reader, it is especially important for
GCC: It erroneously believes that it is possible to
enter the SHORT2(UNUSED|LONG) cases without having
entered the preceding block that initializes pic,
frame_num, structure and j; it would emit -Wmaybe-uninitialized
warnings for these variables if they were not pseudo-
initialized with av_uninit(). This patch allows to remove
the latter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
4b44b5eaf0 swscale/swscale_internal: Only include altivec header iff HAVE_ALTIVEC
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:41 +01:00
Andreas Rheinhardt
7d9d400695 postproc/postprocess: Don't generally include arch-specific headers
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:27 +01:00
Sean McGovern
f63a87629e fate: fix sub2video_{basic, time_limited} on big-endian targets
The reference file uses BGRA pixel format, so request it here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:03:43 +01:00
Timo Rothenpieler
e99c273fec avcodec/nvdec: reset bitstream_len/nb_slices when resetting bitstream pointer 2024-03-30 00:12:23 +01:00
James Almer
547c920193 avcodec/hevc_ps: don't use a fixed sized buffer for parameter set raw data
Allocate it instead, and use it to compare sets instead of the parsed struct.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 15:34:21 -03:00
Tong Wu
6bf17136a2 avcodec/hevc_ps: fix the problem of memcmp losing effectiveness
HEVCHdrParams* receives a pointer which points to a dynamically
allocated memory block. It causes the memcmp always returning 1.
Add a function to do the comparision. A condition is also added to
avoid malloc(0).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 12:35:54 -03:00
Anton Khirnov
fa110c32b5 lavfi/setpts: unset frame durations
Actual frame durations are, in general, not computable without buffering
a frame.

FIxes #10886
2024-03-29 09:09:40 +01:00
Anton Khirnov
f121d954ac lavf/vf_setpts: unset output framerate
This filter produces VFR output in general.

Avoids dropping frames in the setpts test.
2024-03-29 09:07:13 +01:00
Anton Khirnov
c240ff98b3 lavc/packet: schedule AV_PKT_DATA_QUALITY_FACTOR for removal
It is unused internally and has been marked as deprecated a long time
ago.
2024-03-29 09:01:54 +01:00
Anton Khirnov
1d843ae6c7 lavc: rename avpacket.c to packet.c
For consistency with its API header packet.h.
2024-03-29 09:01:54 +01:00
Anton Khirnov
24b9f29ff2 fftools/ffmpeg_sched: make sure to always run task cleanup
Even in cases where sch_start() failed. This ensures all links are
properly closed and no tasks are left hanging.

Fixes #10916.
2024-03-29 08:51:12 +01:00
Anton Khirnov
af81788f30 fftools/ffmpeg_sched: move sch_stop() to the bottom of the file
Will allow avoiding forward declarations in following commits.
2024-03-29 08:51:12 +01:00
Andreas Rheinhardt
8d1093a784 avcodec/libvpxenc: Remove obsolete av_unused
Forgotten in 753074721b.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:58:05 +01:00
Andreas Rheinhardt
1093b40218 avcodec/libvpxenc: Only search for side data when intending to use it
Also rewrite the code so that a variable that is only used
depending upon CONFIG_LIBVPX_VP9_ENCODER is not declared
outside of the #if block.
(The variable was declared with av_uninit, but it should have been
av_unused, as the former does not work for all compilers.)

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:45:17 +01:00
Andreas Rheinhardt
e465cebfee avcodec/Makefile: Remove redundant dependencies on hevc_data.o
hevc_data.c only provides ff_hevc_diag_scan tables and
neither the QSV HEVC encoder nor the HEVC parser use these
directly and the indirect dependency is already accounted
for in the dependencies of the hevcparse subsystem since
b0c61209cd, so remove these
spurious dependencies.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:39:11 +01:00
James Almer
e54591369f avformat/flac_picture: print a warning when mimetype is unknown
It's not an error since bba6df9ac7.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-28 18:00:34 -03:00
Michael Niedermayer
3d5f03bbc8 avfilter/vf_signature: Dont crash on no frames
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-28 18:07:13 +01:00
Dale Curtis
bba6df9ac7 Don't throw an error when attached picture isn't recognized.
The MIME type field is required per the FLAC standard, but it's
not an error just because ffmpeg doesn't recognize it.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-28 18:07:13 +01:00
Tobias Rapp
02eb2fc577 examples/decode_filter_video: Add loop for draining the filtergraph
Depending on the filters used, the filtergraph may produce trailing data
after feeding it the last input frame. Update the example to include the
necessary loop for draining the filtergraph.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-03-28 12:04:09 +01:00
Tobias Rapp
55ce666062 examples/decode_filter_audio: Add loop for draining the filtergraph
Depending on the filters used, the filtergraph may produce trailing data
after feeding it the last input frame. Update the example to include the
necessary loop for draining the filtergraph.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-03-28 12:03:57 +01:00
Tobias Rapp
94ebe604b0 tests/audiogen: Fix total RIFF chunk size
The "RIFF" identifier and chunk size fields should not be included
within the size value.
2024-03-28 11:54:41 +01:00
Andreas Rheinhardt
5d71f97e0e all: Don't use ATOMIC_VAR_INIT
C11 required to use ATOMIC_VAR_INIT to statically initialize
atomic objects with static storage duration. Yet this macro
was unsuitable for initializing structures [1] and was actually
unneeded for all known implementations (this includes our
compatibility fallback implementations which simply wrap the value
in parentheses: #define ATOMIC_VAR_INIT(value) (value)).
Therefore C17 deprecated the macro and C23 actually removed it [2].

Since commit 5ff0eb34d2 we default
to C17 if the compiler supports it; Clang warns about ATOMIC_VAR_INIT
in this mode. Given that no implementation ever needed this macro,
this commit stops using it to avoid this warning.

[1]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm#dr_485
[2]: https://en.cppreference.com/w/c/atomic/ATOMIC_VAR_INIT

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 09:12:48 +01:00
Anton Khirnov
a69cedb6a6 fftools/ffmpeg_demux: make InputStream.autorotate private
It is no longer accessed outside of ffmpeg_demux.
2024-03-28 08:40:11 +01:00
Anton Khirnov
c9a90c052a fftools/ffmpeg_enc: stop copying demuxer side data to the muxer
All side data should be propagated through the trancoding pipeline.
2024-03-28 08:40:11 +01:00
Anton Khirnov
e0de84ad2e lavc/encode: map AVCodecContext.decoded_side_data to coded_side_data
This way it can be automagically propagated through the encoder to
muxing.
2024-03-28 08:40:11 +01:00
Anton Khirnov
a3f4670943 lavc/decode: move sd_global_map to avcodec
It will be shared with encoding code.
2024-03-28 08:40:01 +01:00
Anton Khirnov
e1f384adbf lavc/frame_thread_encoder: avoid assigning a whole AVCodecContext
It is highly unsafe, as AVCodecContext contains many allocated fields.
Almost everything needed by worker threads should be covered by
routing through AVCodecParameters and av_opt_copy(), except for a few
fields that are copied manually.

avcodec_free_context() can now be used for per-thread contexts.
2024-03-28 08:40:01 +01:00
Anton Khirnov
198a7788e7 lavc: avoid leaking AVCodecContext.chroma_intra_matrix 2024-03-28 08:40:01 +01:00
Anton Khirnov
106131bb10 fftools/ffmpeg_filter: remove display matrix if we have applied it 2024-03-28 08:40:01 +01:00
Anton Khirnov
b1aaa1f585 fftools/ffmpeg_dec: apply cropping manually
lavfi does not require aligned buffers, so we can safely apply top/left
cropping by any amount, without passing any special flags to lavc.
Longer term, an even better solution would probably be auto-inserting
the crop filter (or its hwaccel versions) as needed.

Multiple FATE tests no longer need -flags unaligned.
2024-03-28 08:40:01 +01:00
Anton Khirnov
0edbd00ccf fftools/ffmpeg_{demux,dec}: pass -bitexact through DecoderFlags
Avoids abusing AV_DICT_MULTIKEY and relying on undocumented AVDictionary
ordering behaviour.
2024-03-28 08:40:01 +01:00
Anton Khirnov
372c78dd42 fftools/ffmpeg_dec: apply decoder options manually
Do not pass an options dictionary to avcodec_open2().

This should be equivalent to current behaviour, but will allow
overriding caller-supplied options in a cleaner and more robust manner.

We can now set the COPY_OPAQUE flag directly rather going through
dec_opts.
2024-03-28 08:40:01 +01:00
Anton Khirnov
2d06a7570e fftools/cmdutils: do not use a random codec's private options
There is only a single caller of filter_codec_opts() that passes
a NULL codec to it, which is streamcopy in ffmpeg CLI. In that case we
only want generic AVCodecContext options, not private options of any
specific encoder.
2024-03-28 08:40:01 +01:00
Anton Khirnov
da67816128 fftools/ffmpeg_demux: only call filter_codec_opts() when we have a decoder
It is pointless otherwise, as decoder options will not be used.
2024-03-28 08:40:01 +01:00
Anton Khirnov
56320880f7 doc/ffmpeg: mention how to pass options to loopback decoders 2024-03-28 08:39:19 +01:00
Andreas Rheinhardt
b9297128f5 avutil/tests/.gitignore: Add side_data_array
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:37:42 +01:00
Andreas Rheinhardt
c85477f78d avutil/opt: Don't cast when the result might be misaligned
A pointer conversion is UB if the resulting pointer is not
correctly aligned for the resultant type, even if no
load/store is ever performed through that pointer (C11 6.3.2.3 (7)).

This may happen in opt_copy_elem(), because the pointers are
converted even when they belong to a type that does not guarantee
sufficient alignment.

Fix this by deferring the cast after having checked the type.
Also make the casts -Wcast-qual safe and avoid an indirection
for src.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt
aa7d6520e6 avutil/opt: Avoid av_strdup(NULL)
It is not documented to be safe and in any case it is nonsense:
Currently av_strdup(NULL) returns NULL and in order to distinguish
this from a genuine allocation failure, opt_copy_elem()
checked afterwards whether src was actually NULL. But then one
can simply check in advance whether one should call av_strdup()
at all.
set_string() was even worse and returned ENOMEM in case the value
to be duplicated is NULL; this only worked because
av_opt_set_defaults2() does not check the return value at all
(given that it can't propagate it).

These two places account for 389114 of 390356 av_strdup(NULL)
calls during one FATE run.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt
686d33a6b0 avcodec/profiles: Don't include avcodec.h
Forgotten in 8238bc0b5e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt
33b1c7ebbf avcodec/magicyuvenc: Don't call functions twice due to macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:01 +01:00
Andreas Rheinhardt
8013574e9b avcodec/mjpegenc: Inline chroma subsampling
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:08:00 +01:00
Andreas Rheinhardt
0b212f3595 avcodec/bfi: Remove unused AVCodecContext* from context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Andreas Rheinhardt
6edd83c0e2 avcodec/ratecontrol: Avoid function pointer casts
It is undefined behaviour to call a function with a different
signature for the call than the actual function signature;
there are no exceptions for void* and RateControlEntry*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Andreas Rheinhardt
641850f67f avcodec/wmaprodec: Explicitly return 0 on success
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Andreas Rheinhardt
432e287e27 fftools/ffmpeg_sched: Explicitly return 0 on sch_enc_send() success
Do not return the return value of the last enc_send_to_dst()
call, as this would treat the last call differently from the
earlier calls; furthermore, sch_enc_send() explicitly documents
to always return 0 on success.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 03:06:13 +01:00
Niklas Haas
b89ee26539 avfilter: properly reduce YUV colorspace format lists
Doing this with REDUCE_FORMATS() instead of swap_color_*() is not only
shorter, but more importantly comes with the benefit of being done
inside a loop, allowing us to correctly propagate complex graphs
involving multiple conversion filters (e.g. -vf scale,zscale).

The latter family of swapping functions is only used to settle the
best *remaining* entry if no exact match was found, and as such was
never the correct solution to YUV colorspaces, which only care about
exact matches.
2024-03-27 19:11:27 +01:00
James Almer
189c32f536 avformat/mov: don't abort on duplicate Mastering Display Metadata boxes
The VP9 spec defines a SmDm box for this information, and the ISOBMFF spec defines a
mdvc one. If both are present, just ignore one of them.
This is in line with clli and CoLL boxes.

Fixes ticket #10711.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-27 13:51:28 -03:00
Andreas Rheinhardt
8ca57fcf9e avutil/fifo, file: Remove unused headers
Forgotten in 4105899245,
4c92fc02f8.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-27 17:07:22 +01:00
Andreas Rheinhardt
9223c92c88 doc/examples: Always use <> includes
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-27 17:07:06 +01:00
Zhao Zhili
89e9486bc3 avcodec/h264_mp4toannexb: Fix heap buffer overflow
Fixes: out of array write
Fixes: 64407/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_MP4TOANNEXB_fuzzer-4966763443650560

mp4toannexb_filter counts the number of bytes needed in the first
pass and allocate the memory, then do memcpy in the second pass.
Update sps/pps size in the loop makes the count invalid in the
case of SPS/PPS occur after IDR slice. This patch process in-band
SPS/PPS before the two pass loops.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-27 20:04:40 +08:00
Zhao Zhili
edb1f1bc09 tests: Remove fate-libx265-hdr10
The test depends on the compile option of x265. It failed when
HIGH_BIT_DEPTH isn't enabled. It also failed when asan is enabled
because of memory issue inside of x265, which I don't think can
be fixed within FFmpeg.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-27 20:04:40 +08:00
Anton Khirnov
8fc1e1358b fftools/ffmpeg_enc: simplify error handling for decoded_side_data setup
There is no need to free the already-added items, they will be freed
alongside the codec context. There is also little point in an error
message, as the only reason this can fail is malloc failure.
2024-03-27 11:36:21 +01:00
Anton Khirnov
6f2cb0923c fftools/ffmpeg_enc: move decoded_side_data setup out of video-only block
Nothing about this code is video-specific.
2024-03-27 11:36:20 +01:00
Anton Khirnov
fabf148578 fftools/ffmpeg_enc: only promote first frame side data to global when meaningful
Skip those side data types that do not make sense as global side data.
2024-03-27 11:35:27 +01:00
Anton Khirnov
2621be3539 lavu/frame: add side data descriptors
They allow exporting extended information about side data types.
2024-03-27 11:33:45 +01:00
Michael Niedermayer
6b213175c9 Bump after 7.0 branch point
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-27 01:04:54 +01:00
4685 changed files with 219863 additions and 102993 deletions

93
.forgejo/CODEOWNERS Normal file
View File

@@ -0,0 +1,93 @@
# This file describes the expected reviewers for a PR based on the changed
# files. Unlike what the name of the file suggests they don't own the code, but
# merely have a good understanding of that area of the codebase and therefore
# are usually suited as a reviewer.
# Lines in this file match changed paths via Go-Style regular expressions:
# https://pkg.go.dev/regexp/syntax
# Mind the alphabetical order
# avcodec
# =======
libavcodec/.*aac.* @lynne
libavcodec/.*ac3.* @lynne
libavcodec/.*atrac9.* @lynne
libavcodec/.*bitpacked.* @lynne
libavcodec/.*d3d12va.* @jianhuaw
libavcodec/.*dirac.* @lynne
libavcodec/.*ffv1.* @lynne @michaelni
libavcodec/golomb.* @michaelni
libavcodec/.*h266.* @frankplow @NuoMi @jianhuaw
libavcodec/h26x/.* @frankplow @NuoMi @jianhuaw
libavcodec/.*jpegxl.* @lynne
libavcodec/.*jxl.* @lynne
libavcodec/.*opus.* @lynne
libavcodec/.*prores.* @lynne
libavcodec/rangecoder.* @michaelni
libavcodec/ratecontrol.* @michaelni
libavcodec/.*siren.* @lynne
libavcodec/.*vc2.* @lynne
libavcodec/.*vvc.* @frankplow @NuoMi @jianhuaw
libavcodec/aarch64/.* @lynne @mstorsjo
libavcodec/arm/.* @mstorsjo
libavcodec/ppc/.* @sean_mcg
libavcodec/x86/.* @lynne
# avfilter
# =======
libavfilter/aarch64/.* @mstorsjo
libavfilter/af_whisper.* @vpalmisano
libavfilter/vf_yadif.* @michaelni
libavfilter/vsrc_mandelbrot.* @michaelni
# avformat
# =======
libavformat/iamf.* @jamrial
# avutil
# ======
libavutil/.*crc.* @lynne @michaelni
libavutil/.*d3d12va.* @jianhuaw
libavutil/eval.* @michaelni
libavutil/iamf.* @jamrial
libavutil/integer.* @michaelni
libavutil/lfg.* @michaelni
libavutil/lls.* @michaelni
libavutil/md5.* @michaelni
libavutil/mathematics.* @michaelni
libavutil/mem.* @michaelni
libavutil/qsort.* @michaelni
libavutil/random_seed.* @michaelni
libavutil/rational.* @michaelni
libavutil/sfc.* @michaelni
libavutil/softfloat.* @michaelni
libavutil/tree.* @michaelni
libavutil/tx.* @lynne
libavutil/aarch64/.* @lynne @mstorsjo
libavutil/arm/.* @mstorsjo
libavutil/ppc/.* @sean_mcg
libavutil/x86/.* @lynne
# swresample
# =======
libswresample/aarch64/.* @mstorsjo
libswresample/arm/.* @mstorsjo
libswresample/.* @michaelni
# swscale
# =======
libswscale/aarch64/.* @mstorsjo
libswscale/arm/.* @mstorsjo
libswscale/ppc/.* @sean_mcg
# doc
# ===
doc/.* @GyanD
# Frameworks
# ==========
.*d3d12va.* @jianhuaw
.*vulkan.* @lynne

View File

@@ -0,0 +1,9 @@
# Summary of the bug
Briefly describe the issue you're experiencing. Include any error messages, unexpected behavior, or relevant observations.
# Steps to reproduce
List the steps required to trigger the bug.
Include the exact CLI command used, if any.
Provide sample input files, logs, or scripts if available.

View File

@@ -0,0 +1,36 @@
module.exports = async ({github, context}) => {
const title = (context.payload.pull_request?.title || context.payload.issue?.title || '').toLowerCase();
const labels = [];
const kwmap = {
'avcodec': 'avcodec',
'avdevice': 'avdevice',
'avfilter': 'avfilter',
'avformat': 'avformat',
'avutil': 'avutil',
'swresample': 'swresample',
'swscale': 'swscale',
'fftools': 'CLI'
};
if (context.payload.action === 'opened') {
labels.push('new');
console.log('Detected label: new');
}
for (const [kw, label] of Object.entries(kwmap)) {
if (title.includes(kw)) {
labels.push(label);
console.log('Detected label: ' + label);
}
}
if (labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request?.number || context.payload.issue?.number,
labels: labels,
});
}
}

View File

@@ -0,0 +1,31 @@
avcodec:
- changed-files:
- any-glob-to-any-file: libavcodec/**
avdevice:
- changed-files:
- any-glob-to-any-file: libavdevice/**
avfilter:
- changed-files:
- any-glob-to-any-file: libavfilter/**
avformat:
- changed-files:
- any-glob-to-any-file: libavformat/**
avutil:
- changed-files:
- any-glob-to-any-file: libavutil/**
swresample:
- changed-files:
- any-glob-to-any-file: libswresample/**
swscale:
- changed-files:
- any-glob-to-any-file: libswscale/**
CLI:
- changed-files:
- any-glob-to-any-file: fftools/**

View File

@@ -0,0 +1,28 @@
exclude: ^tests/ref/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-shebang-scripts-are-executable
- id: check-yaml
- id: end-of-file-fixer
- id: file-contents-sorter
files:
.forgejo/pre-commit/ignored-words.txt
args:
- --ignore-case
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args:
- --ignore-words=.forgejo/pre-commit/ignored-words.txt
- --ignore-multiline-regex=codespell:off.*?(codespell:on|\Z)
exclude: ^tools/(patcheck|clean-diff)$

View File

@@ -0,0 +1,119 @@
abl
ACN
acount
addin
alis
alls
ALOG
ALS
als
ANC
anc
ANS
ans
anull
basf
bloc
brane
BREIF
BU
bu
bufer
CAF
caf
clen
clens
Collet
compre
dum
endin
erro
FIEL
fiel
filp
fils
FILTERD
filterd
fle
fo
FPR
fro
Hald
indx
ine
inh
inout
inouts
inport
ist
LAF
laf
lastr
LinS
mapp
mis
mot
nd
nIn
offsetp
orderd
ot
outout
padd
PAETH
paeth
PARM
parm
parms
pEvents
PixelX
Psot
quater
readd
recuse
redY
Reencode
reencode
remaind
renderD
rin
SAV
SEH
SER
ser
setts
shft
SIZ
siz
skipd
sme
som
sover
STAP
startd
statics
struc
suble
TE
tE
te
tha
tne
tolen
tpye
tre
TRUN
trun
truns
Tung
TYE
ue
UES
ues
vai
vas
vie
VILL
vor
wel
wih

View File

@@ -0,0 +1,25 @@
on:
pull_request_target:
types: [opened, edited, synchronize]
issues:
types: [opened, edited]
jobs:
pr_labeler:
runs-on: utilities
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Label by file-changes
uses: https://github.com/actions/labeler@v5
if: ${{ forge.event_name == 'pull_request_target' }}
with:
configuration-path: .forgejo/labeler/labeler.yml
repo-token: ${{ secrets.AUTOLABELER_TOKEN }}
- name: Label by title-match
uses: https://github.com/actions/github-script@v7
with:
script: |
const script = require('.forgejo/labeler/labeler.js')
await script({github, context})
github-token: ${{ secrets.AUTOLABELER_TOKEN }}

View File

@@ -0,0 +1,26 @@
on:
push:
branches:
- master
pull_request:
jobs:
lint:
runs-on: utilities
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pre-commit CI
id: install
run: |
python3 -m venv ~/pre-commit
~/pre-commit/bin/pip install --upgrade pip setuptools
~/pre-commit/bin/pip install pre-commit
echo "envhash=$({ python3 --version && cat .forgejo/pre-commit/config.yaml; } | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
- name: Cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ steps.install.outputs.envhash }}
- name: Run pre-commit CI
run: ~/pre-commit/bin/pre-commit run -c .forgejo/pre-commit/config.yaml --show-diff-on-failure --color=always --all-files

View File

@@ -0,0 +1,59 @@
on:
push:
branches:
- master
pull_request:
jobs:
run_fate:
strategy:
fail-fast: false
matrix:
runner: [linux-amd64,linux-aarch64]
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: ./configure --enable-gpl --enable-nonfree --enable-memory-poisoning --assert-level=2
- name: Build
run: make -j$(nproc)
- name: Restore Cached Fate-Suite
id: cache
uses: actions/cache/restore@v4
with:
path: fate-suite
key: fate-suite
restore-keys: |
fate-suite-
- name: Sync Fate-Suite
id: fate
run: |
make fate-rsync SAMPLES=$PWD/fate-suite
echo "hash=$(find fate-suite -type f | sort | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
- name: Cache Fate-Suite
uses: actions/cache/save@v4
if: ${{ format('fate-suite-{0}', steps.fate.outputs.hash) != steps.cache.outputs.cache-matched-key }}
with:
path: fate-suite
key: fate-suite-${{ steps.fate.outputs.hash }}
- name: Run Fate
run: make fate SAMPLES=$PWD/fate-suite -j$(nproc)
compile_only:
strategy:
fail-fast: false
matrix:
image: ["ghcr.io/btbn/ffmpeg-builds/win64-gpl:latest"]
runs-on: linux-amd64
container: ${{ matrix.image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: |
./configure --pkg-config-flags="--static" $FFBUILD_TARGET_FLAGS $FF_CONFIGURE \
--cc="$CC" --cxx="$CXX" --ar="$AR" --ranlib="$RANLIB" --nm="$NM" \
--extra-cflags="$FF_CFLAGS" --extra-cxxflags="$FF_CXXFLAGS" \
--extra-libs="$FF_LIBS" --extra-ldflags="$FF_LDFLAGS" --extra-ldexeflags="$FF_LDEXEFLAGS"
- name: Build
run: make -j$(nproc)

1
.gitattributes vendored
View File

@@ -1 +1,2 @@
*.pnm -diff -text
Changelog merge=union

5
.gitignore vendored
View File

@@ -1,5 +1,6 @@
*.a
*.o
*.objs
*.o.*
*.d
*.def
@@ -41,3 +42,7 @@
/src
/mapfile
/tools/python/__pycache__/
/libavcodec/vulkan/*.c
/libavfilter/vulkan/*.c
/.*/
!/.forgejo/

View File

@@ -24,3 +24,7 @@ rcombs <rcombs@rcombs.me> <rodger.combs@gmail.com>
<lq@chinaffmpeg.org> <liuqi05@kuaishou.com>
<ruiling.song83@gmail.com> <ruiling.song@intel.com>
Cosmin Stejerean <cosmin@cosmin.at> Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
<wutong1208@outlook.com> <tong1.wu-at-intel.com@ffmpeg.org>
<wutong1208@outlook.com> <tong1.wu@intel.com>
<toqsxw@outlook.com> <jianhua.wu-at-intel.com@ffmpeg.org>
<toqsxw@outlook.com> <jianhua.wu@intel.com>

View File

@@ -1,30 +0,0 @@
language: c
sudo: false
os:
- linux
- osx
addons:
apt:
packages:
- nasm
- diffutils
compiler:
- clang
- gcc
matrix:
exclude:
- os: osx
compiler: gcc
cache:
directories:
- ffmpeg-samples
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install nasm; fi
script:
- mkdir -p ffmpeg-samples
- ./configure --samples=ffmpeg-samples --cc=$CC
- make -j 8
- make fate-rsync
- make check -j 8

View File

@@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -158,7 +158,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@@ -267,7 +267,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest

167
Changelog
View File

@@ -1,6 +1,161 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version 8.0.1:
avutil/common: cast GET_BYTE/GET_16BIT returned value
avfilter/vf_drawtext: fix call GET_UTF8 with invalid argument
avfilter/vf_drawtext: fix incorrect text length
Update for 8.0.1
avfilter/vf_drawtext: Account for bbox text seperator
avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size
avcodec/rv60dec: Clear blk_info
avformat/whip: Fix rtp_ctx->streams access
avcodec/utvideodec: Set B for the width= 1 case in restore_median_planar_il()
avcodec/osq: Fix 32bit sample overflow
avformat/rtpdec_rfc4175: Only change PayloadContext on success
avformat/rtpdec_rfc4175: Check dimensions
avformat/rtpdec_rfc4175: Fix memleak of sampling
avformat/http: Fix off by 1 error
avcodec/exr: spelling
avcodec/rv60dec: add upper bound check for qp
avcodec/exr: use tile dimensions in pxr24 UINT case
avcodec/exr: Simple check for available channels
avformat/sctp: Check size in sctp_write()
avformat/rtmpproto: consider command line argument lengths
avformat/rtmpproto_ Check tcurl and flashver length
avcodec/g723_1enc: Make min_err 64bit
avcodec/vlc: Clear val8/16 in vlc_multi_gen() by av_mallocz()
avformat/rtpenc_h264_hevc: Check space for nal_length_size in ff_rtp_send_h264_hevc()
avcodec/ffv1enc: Consider variation in slice sizes
libavcodec/cbs_apv_syntax_template: limit tile to 2gb
swscale/output: Fix unsigned cast position in yuv2*
swscale/output: Fix integer overflow in yuv2ya16_X_c_template()
avcodec/exr: Check that DWA has 3 channels
avcodec/exr: check ac_size
avcodec/exr: Round dc_w/h up
avcodec/mjpegdec: Explain buf_size/width/height check
configure: strip non numeric trailer from gcc version
avformat/dhav: Fix off by length of read element error
avformat/aviobuf: Keep checksum_ptr consistent in avio_seek()
doc/examples/vaapi_encode: fix invalid check on fwrite
avcodec/librsvgdec: fix compilation with librsvg 2.50.3
avcodec/mfenc: fix memory leak with D3D11 input surfaces
swscale/graph: fix double-free when legacy pass fails initializing
libavformat/udp: Fix call to recvfrom(2)
avfilter/f_ebur128: Fix incorrect ebur128 peak calculation.
avformat/udp: fix warning about unused varible
avdevice/lavfi: stop setting deprecated buffersink options
configure: unbreak glslang build
swscale/range_convert: fix truncation bias in range conversion
lavc/aarch64: Fix addp overflow in ff_pred16x16_plane_neon_10
avcodec/mlpdec: don't depend on context channel layout when setting substream masks
avformat/demux: pass new extradata to the parser
avfilter/af_whisper: fix srt index
avfilter/af_whisper: fix int64 printf format
avfilter/af_whisper: fix srt file format
avfilter/whisper: correct option formatting
avfilter/af_whisper: fix broken output for multibyte character
avformat/rtsp: fix leading space in RTSP reason
avformat/rtsp: do not log invalid values
avformat/http: Handle IPv6 Zone ID in hostname
avformat/dump: fix log level passed to av_log when printing stream group side data
avcodec/hevc/sei: don't attempt to use stale values in HEVCSEITDRDI
avcodec/hevc/sei: prevent storing a potentially bogus num_ref_displays value in HEVCSEITDRDI
avcodec/hevc/refs: don't unconditionally discard non-IRAP frames if no IRAP frame was seen before
libavutil/arm: Rename the HWCAP defines
libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
fftools/ffmpeg: fix gracefully shutdown
avcodec/decode: sync initial_pict_type and intra_only_flag with thread worker's avctx
avcodec/x86/pngdsp: add missing emms at the end of add_png_paeth_prediction
avcodec/videotoolboxenc: ensure bitrate is set in low_delay mode
avcodec/videotoolboxenc: allow low latency RC with HEVC
avcodec/videotoolboxenc: support global_quality without qscale
avcodec/videotoolboxenc: fix the loss of precision when calculating quality
fftools/ffmpeg_demux: ensure the display_rotation option is honored
avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix
avutil/tests/aes_ctr: extend the test to cover payloads smaller than a block
avutil/aes_ctr: reintroduce the block offset state
avfilter/vf_lcevc: support LCEVCdec version 4
avcodec/lcevcdec: support LCEVCdec version 4
movenc: ensure chapters track extradata is not null and populated
version 8.0:
- Whisper filter
- Drop support for OpenSSL < 1.1.0
- Enable TLS peer certificate verification by default (on next major version bump)
- yasm support dropped, users need to use nasm
- VVC VAAPI decoder
- RealVideo 6.0 decoder
- OpenMAX encoders deprecated
- libx265 alpha layer encoding
- ADPCM IMA Xbox decoder
- Enhanced FLV v2: Multitrack audio/video, modern codec support
- Animated JPEG XL encoding (via libjxl)
- VVC in Matroska
- CENC AV1 support in MP4 muxer
- pngenc: set default prediction method to PAETH
- APV decoder and APV raw bitstream muxing and demuxing
- APV parser
- APV encoding support through a libopenapv wrapper
- VVC decoder supports all content of SCC (Screen Content Coding):
IBC (Inter Block Copy), Palette Mode and ACT (Adaptive Color Transform
- G.728 decoder
- pad_cuda filter
- Sanyo LD-ADPCM decoder
- APV in MP4/ISOBMFF muxing and demuxing
- OpenHarmony hardware decoder/encoder
- Colordetect filter
- Add vf_scale_d3d11 filter
- No longer disabling GCC autovectorization, on X86, ARM and AArch64
- VP9 Vulkan hwaccel
- AV1 Vulkan encoder
- ProRes RAW decoder
- ProRes RAW Vulkan hwaccel
version 7.1:
- Raw Captions with Time (RCWT) closed caption demuxer
- LC3/LC3plus decoding/encoding using external library liblc3
- ffmpeg CLI filtergraph chaining
- LC3/LC3plus demuxer and muxer
- pad_vaapi, drawbox_vaapi filters
- vf_scale supports secondary ref input and framesync options
- vf_scale2ref deprecated
- qsv_params option added for QSV encoders
- VVC decoder compatible with DVB test content
- xHE-AAC decoder
- removed DEC Alpha DSP and support code
- VVC encoding support via libvvenc
- perlin video source
- D3D12VA HEVC encoder
- Cropping metadata parsing and writing in Matroska and MP4/MOV de/muxers
- Intel QSV-accelerated VVC decoding
- MediaCodec AAC/AMR-NB/AMR-WB/MP3 decoding
- YUV colorspace negotiation for codecs and filters, obsoleting the
YUVJ pixel format
- Vulkan H.264 encoder
- Vulkan H.265 encoder
- stream specifiers in fftools can now match by stream disposition
- LCEVC enhancement data exporting in H.26x and MP4/ISOBMFF
- LCEVC filter
- MV-HEVC decoding
- minor stream specifier syntax changes:
- when matching by metadata (:m:<key>:<val>), the colon character
in keys or values now has to be backslash-escaped
- in optional maps (-map ....?) with a metadata-matching stream specifier,
the value has to be separated from the question mark by a colon, i.e.
-map ....:m:<key>:<val>:? (otherwise it would be ambiguous whether the
question mark is a part of <val> or not)
- multiple stream types in a single specifier (e.g. :s:s:0) now cause an
error, as such a specifier makes no sense
- Mastering Display and Content Light Level metadata support in hevc_nvenc
and av1_nvenc encoders
- libswresample now accepts custom order channel layouts as input, with some
constrains
- FFV1 parser
version 7.0:
- DXV DXT1 encoder
- LEAD MCMP decoder
@@ -17,7 +172,7 @@ version 7.0:
- qrencode filter and qrencodesrc source
- quirc filter
- lavu/eval: introduce randomi() function in expressions
- VVC decoder
- VVC decoder (experimental)
- fsync filter
- Raw Captions with Time (RCWT) closed caption muxer
- ffmpeg CLI -bsf option may now be used for input as well as output
@@ -38,6 +193,15 @@ version 7.0:
- ffplay with hwaccel decoding support (depends on vulkan renderer via libplacebo)
- dnn filter libtorch backend
- Android content URIs protocol
- AOMedia Film Grain Synthesis 1 (AFGS1)
- RISC-V optimizations for AAC, FLAC, JPEG-2000, LPC, RV4.0, SVQ, VC1, VP8, and more
- Loongarch optimizations for HEVC decoding
- Important AArch64 optimizations for HEVC
- IAMF support inside MP4/ISOBMFF
- Support for HEIF/AVIF still images and tiled still images
- Dolby Vision profile 10 support in AV1
- Support for Ambient Viewing Environment metadata in MP4/ISOBMFF
- HDR10 metadata passthrough when encoding with libx264, libx265, and libsvtav1
version 6.1:
@@ -78,6 +242,7 @@ version 6.1:
variable-fields elements within the same parent element
- ffprobe -output_format option added as an alias of -of
# codespell:off
version 6.0:
- Radiance HDR image support

7
FUNDING.json Normal file
View File

@@ -0,0 +1,7 @@
{
"drips": {
"ethereum": {
"ownedBy": "0x2f3900e7064eE63D30d749971265858612AA7139"
}
}
}

View File

@@ -1,5 +1,8 @@
## Installing FFmpeg
0. If you like to include source plugins, merge them before configure
for example run tools/merge-all-source-plugins
1. Type `./configure` to create the configuration. A list of configure
options is printed by running `configure --help`.
@@ -15,3 +18,11 @@ NOTICE
------
- Non system dependencies (e.g. libx264, libvpx) are disabled by default.
NOTICE for Package Maintainers
------------------------------
- It is recommended to build FFmpeg twice, first with minimal external dependencies so
that 3rd party packages, which depend on FFmpegs libavutil/libavfilter/libavcodec/libavformat
can then be built. And last build FFmpeg with full dependencies (which may in turn depend on
some of these 3rd party packages). This avoids circular dependencies during build.

View File

@@ -12,7 +12,6 @@ configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
Specifically, the GPL parts of FFmpeg are:
- libpostproc
- optional x86 optimization in the files
- `libavcodec/x86/flac_dsp_gpl.asm`
- `libavcodec/x86/idct_mmx.c`
@@ -45,7 +44,6 @@ Specifically, the GPL parts of FFmpeg are:
- `vf_owdenoise.c`
- `vf_perspective.c`
- `vf_phase.c`
- `vf_pp.c`
- `vf_pp7.c`
- `vf_pullup.c`
- `vf_repeatfields.c`

View File

@@ -6,10 +6,26 @@ FFmpeg code.
Please try to keep entries where you are the maintainer up to date!
Names in () mean that the maintainer currently has no time to maintain the code.
*Status*, one of the following:
[X] Old code. Something tagged obsolete generally means it has been replaced by a better system and you should be using that.
[0] No current maintainer [but maybe you could take the role as you write your new code].
[1] It has a maintainer but they don't have time to do much other than throw the odd patch in.
[2] Someone actually looks after it.
A (CC <address>) after the name means that the maintainer prefers to be CC-ed on
patches and related discussions.
(L <address>) *Mailing list* that is relevant to this area
(W <address>) *Web-page* with status/info
(B <address>) URI for where to file *bugs*. A web-page with detailed bug
filing info, a direct bug tracker link, or a mailto: URI.
(P <address>) *Subsystem Profile* document for more details submitting
patches to the given subsystem. This is either an in-tree file,
or a URI. See Documentation/maintainer/maintainer-entry-profile.rst
for details.
(T <address>) *SCM* tree type and location.
Type is one of: git, hg, quilt, stgit, topgit
Applications
============
@@ -18,10 +34,10 @@ ffmpeg:
ffmpeg.c Michael Niedermayer, Anton Khirnov
ffplay:
ffplay.c Marton Balint
ffplay.c [2] Marton Balint
ffprobe:
ffprobe.c Stefano Sabatini
ffprobe.c [2] Stefano Sabatini
Commandline utility code:
cmdutils.c, cmdutils.h Michael Niedermayer
@@ -29,30 +45,32 @@ Commandline utility code:
QuickTime faststart:
tools/qt-faststart.c Baptiste Coudurier
Execution Graph Printing
fftools/graph, fftools/resources [2] softworkz
Miscellaneous Areas
===================
documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Gyan Doshi
project server day to day operations Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov
project server emergencies Árpád Gereöffy, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov
presets Robert Swain
project server day to day operations (L: root@ffmpeg.org) Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
project server emergencies (L: root@ffmpeg.org) Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov, Timo Rothenpieler
presets [0]
metadata subsystem Aurelien Jacobs
release management Michael Niedermayer
API tests Ludmila Glinskih
API tests [0]
samples-request [2] Thilo Borgmann, James Almer, Ben Littler
Communication
=============
website Deby Barbara Lepage
fate.ffmpeg.org Timothy Gu
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos
Patchwork Andriy Gelman
mailing lists Baptiste Coudurier
website (T: https://git.ffmpeg.org/ffmpeg-web) Deby Barbara Lepage
fate.ffmpeg.org (L: fate-admin@ffmpeg.org) (W: https://fate.ffmpeg.org) (P: https://ffmpeg.org/fate.html) (S: https://git.ffmpeg.org/fateserver) Timo Rothenpieler
Trac bug tracker (W: https://trac.ffmpeg.org) Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos
Patchwork [2] (W: https://patchwork.ffmpeg.org) Andriy Gelman
mailing lists (W: https://ffmpeg.org/contact.html#MailingLists) Baptiste Coudurier
Twitter Reynaldo H. Verdejo Pinochet
Launchpad Timothy Gu
ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, rcombs, wm4
ffmpeg-security [2] (L: ffmpeg-security@ffmpeg.org) (W: https://ffmpeg.org/security.html) Michael Niedermayer, Reimar Doeffinger
libavutil
@@ -67,24 +85,26 @@ Other:
aes_ctr.c, aes_ctr.h Eran Kornblau
bprint Nicolas George
bswap.h
csp.c, csp.h Leo Izen, Ronald S. Bultje
des Reimar Doeffinger
dynarray.h Nicolas George
eval.c, eval.h Michael Niedermayer
eval.c, eval.h [2] Michael Niedermayer
float_dsp Loren Merritt
hash Reimar Doeffinger
hwcontext_cuda* Timo Rothenpieler
hwcontext_vulkan* Lynne
hwcontext_d3d12va* Wu Jianhua
hwcontext_vulkan* [2] Lynne
intfloat* Michael Niedermayer
integer.c, integer.h Michael Niedermayer
lzo Reimar Doeffinger
mathematics.c, mathematics.h Michael Niedermayer
mem.c, mem.h Michael Niedermayer
mathematics.c, mathematics.h [2] Michael Niedermayer
mem.c, mem.h [2] Michael Niedermayer
opencl.c, opencl.h Wei Gao
opt.c, opt.h Michael Niedermayer
rational.c, rational.h Michael Niedermayer
rational.c, rational.h [2] Michael Niedermayer
rc4 Reimar Doeffinger
ripemd.c, ripemd.h James Almer
tx* Lynne
tx* [2] Lynne
libavcodec
@@ -106,20 +126,18 @@ Generic Parts:
DSP utilities:
dsputils.c, dsputils.h Michael Niedermayer
entropy coding:
rangecoder.c, rangecoder.h Michael Niedermayer
rangecoder.c, rangecoder.h [2] Michael Niedermayer
lzw.* Michael Niedermayer
floating point AAN DCT:
faandct.c, faandct.h Michael Niedermayer
faandct.c, faandct.h [2] Michael Niedermayer
Golomb coding:
golomb.c, golomb.h Michael Niedermayer
golomb.c, golomb.h [2] Michael Niedermayer
motion estimation:
motion* Michael Niedermayer
rate control:
ratecontrol.c Michael Niedermayer
ratecontrol.c [2] Michael Niedermayer
simple IDCT:
simple_idct.c, simple_idct.h Michael Niedermayer
postprocessing:
libpostproc/* Michael Niedermayer
simple_idct.c, simple_idct.h [2] Michael Niedermayer
table generation:
tableprint.c, tableprint.h Reimar Doeffinger
fixed point FFT:
@@ -127,7 +145,7 @@ Generic Parts:
Text Subtitles Clément Bœsch
Codecs:
4xm.c Michael Niedermayer
4xm.c [2] Michael Niedermayer
8bps.c Roberto Togni
8svx.c Jaikrishnan Menon
aacenc*, aaccoder.c Rostislav Pehlivanov
@@ -161,9 +179,10 @@ Codecs:
dss_sp.c Oleksij Rempel
dv.c Roman Shaposhnik
dvbsubdec.c Anshul Maheshwari
dxv.*, dxvenc.* Emma Worley
eacmv*, eaidct*, eat* Peter Ross
exif.c, exif.h Thilo Borgmann
ffv1* Michael Niedermayer
ffv1* [2] Michael Niedermayer
ffwavesynth.c Nicolas George
fifo.c Jan Sebechlebsky
flicvideo.c Mike Melanson
@@ -174,6 +193,7 @@ Codecs:
h263* Michael Niedermayer
h264* Loren Merritt, Michael Niedermayer
hap* Tom Butterworth
hevc/* Anton Khirnov
huffyuv* Michael Niedermayer
idcinvideo.c Mike Melanson
interplayvideo.c Mike Melanson
@@ -190,7 +210,6 @@ Codecs:
libgsm.c Michel Bardiaux
libkvazaar.c Arttu Ylä-Outinen
libopenh264enc.c Martin Storsjo, Linjie Fu
libopenjpeg.c Jaikrishnan Menon
libopenjpegenc.c Michael Bradshaw
libtheoraenc.c David Conrad
libvorbis.c David Conrad
@@ -228,6 +247,7 @@ Codecs:
rpza.c Roberto Togni
rtjpeg.c, rtjpeg.h Reimar Doeffinger
rv10.c Michael Niedermayer
sanm.c Manuel Lauss
smc.c Mike Melanson
snow* Michael Niedermayer, Loren Merritt
sonic.c Alex Beregszaszi
@@ -250,7 +270,7 @@ Codecs:
vp8 David Conrad, Ronald Bultje
vp9 Ronald Bultje
vqavideo.c Mike Melanson
vvc Nuo Mi
vvc [2] Nuo Mi, Wu Jianhua, Frank Plowman
wmaprodec.c Sascha Sommer
wmavoice.c Ronald S. Bultje
wmv2.c Michael Niedermayer
@@ -260,6 +280,8 @@ Codecs:
Hardware acceleration:
dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme
d3d11va* Steve Lhomme
d3d12va* Wu Jianhua
d3d12va_encode* Tong Wu
mediacodec* Matthieu Bouron, Aman Gupta, Zhao Zhili
vaapi* Haihao Xiang
vaapi_encode* Mark Thompson, Haihao Xiang
@@ -324,12 +346,13 @@ Filters:
vf_mestimate.c Davinder Singh
vf_minterpolate.c Davinder Singh
vf_readvitc.c Tobias Rapp (CC t.rapp at noa-archive dot com)
vf_scale.c Michael Niedermayer
vf_scale.c [2] Michael Niedermayer
vf_tonemap_opencl.c Ruiling Song
vf_yadif.c Michael Niedermayer
vf_yadif.c [2] Michael Niedermayer
vf_xfade_vulkan.c [2] Marvin Scholz (CC <epirat07@gmail.com>)
Sources:
vsrc_mandelbrot.c Michael Niedermayer
vsrc_mandelbrot.c [2] Michael Niedermayer
dnn Yejun Guo
@@ -347,7 +370,7 @@ Generic parts:
Muxers/Demuxers:
4xm.c Mike Melanson
aadec.c Vesselin Bontchev (vesselin.bontchev at yandex dot com)
adtsenc.c Robert Swain
adtsenc.c [0]
aiffdec.c Baptiste Coudurier, Matthieu Bouron
aiffenc.c Baptiste Coudurier, Matthieu Bouron
alp.c Zane van Iperen
@@ -373,7 +396,7 @@ Muxers/Demuxers:
dss.c Oleksij Rempel
dtsdec.c foo86
dv.c Roman Shaposhnik
dvdvideodec.c Marth64
dvdvideodec.c [2] Marth64
electronicarts.c Peter Ross
evc* Samsung (Dawid Kozinski)
ffm* Baptiste Coudurier
@@ -383,6 +406,7 @@ Muxers/Demuxers:
gxf.c Reimar Doeffinger
gxfenc.c Baptiste Coudurier
hlsenc.c Christian Suloway, Steven Liu
iamf* [2] James Almer
idcin.c Mike Melanson
idroqdec.c Mike Melanson
iff.c Jaikrishnan Menon
@@ -397,9 +421,9 @@ Muxers/Demuxers:
libopenmpt.c Josh de Kock
lmlm4.c Ivo van Poorten
lxfdec.c Tomas Härdin
matroska.c Aurelien Jacobs, Andreas Rheinhardt
matroskadec.c Aurelien Jacobs, Andreas Rheinhardt
matroskaenc.c David Conrad, Andreas Rheinhardt
matroska.c Andreas Rheinhardt
matroskadec.c Andreas Rheinhardt
matroskaenc.c Andreas Rheinhardt
matroska subtitles (matroskaenc.c) John Peebles
metadata* Aurelien Jacobs
microdvd* Aurelien Jacobs
@@ -426,7 +450,8 @@ Muxers/Demuxers:
pva.c Ivo van Poorten
r3d.c Baptiste Coudurier
raw.c Michael Niedermayer
rcwtenc.c Marth64
rcwtdec.c [2] Marth64
rcwtenc.c [2] Marth64
rdt.c Ronald S. Bultje
rl2.c Sascha Sommer
rmdec.c, rmenc.c Ronald S. Bultje
@@ -445,6 +470,7 @@ Muxers/Demuxers:
sdp.c Martin Storsjo
segafilm.c Mike Melanson
segment.c Stefano Sabatini
smush.c Manuel Lauss
spdif* Anssi Hannula
srtdec.c Aurelien Jacobs
swf.c Baptiste Coudurier
@@ -468,33 +494,35 @@ Protocols:
libzmq.c Andriy Gelman
mms*.c Ronald S. Bultje
udp.c Luca Abeni
icecast.c Marvin Scholz
icecast.c [2] Marvin Scholz (CC <epirat07@gmail.com>)
libswresample
=============
Generic parts:
audioconvert.c Michael Niedermayer
dither.c Michael Niedermayer
rematrix*.c Michael Niedermayer
swresample*.c Michael Niedermayer
audioconvert.c [2] Michael Niedermayer
dither.c [2] Michael Niedermayer
rematrix*.c [2] Michael Niedermayer
swresample*.c [2] Michael Niedermayer
Resamplers:
resample*.c Michael Niedermayer
resample*.c [2] Michael Niedermayer
soxr_resample.c Rob Sykes
Operating systems / CPU architectures
=====================================
Alpha Falk Hueffner
*BSD [2] Brad Smith
Alpha [0]
MIPS Manojkumar Bhosale, Shiyou Yin
LoongArch Shiyou Yin
Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier
LoongArch [2] Shiyou Yin
Darwin (macOS, iOS) [2] Marvin Scholz
Mac OS X / PowerPC [0]
Amiga / PowerPC Colin Ward
Linux / PowerPC Lauri Kasanen
RISC-V Rémi Denis-Courmont
Linux / PowerPC [1] Lauri Kasanen
RISC-V [2] Rémi Denis-Courmont
Windows MinGW Alex Beregszaszi, Ramiro Polla
Windows Cygwin Victor Paesa
Windows MSVC Hendrik Leppkes
@@ -513,6 +541,7 @@ Benjamin Larsson
Bobby Bingham
Daniel Verkamp
Derek Buitenhuis
Fei Wang
Ganesh Ajjanagadde
Henrik Gramner
Ivan Uskov
@@ -520,6 +549,7 @@ James Darnley
Jan Ekström
Joakim Plate
Jun Zhao
Kacper Michajłow
Kieran Kunhya
Kirill Gavrilov
Limin Wang
@@ -535,10 +565,12 @@ wm4
Releases
========
7.0 Michael Niedermayer
6.1 Michael Niedermayer
5.1 Michael Niedermayer
4.4 Michael Niedermayer
3.4 Michael Niedermayer
2.8 Michael Niedermayer
2.7 Michael Niedermayer
2.6 Michael Niedermayer
2.5 Michael Niedermayer
If you want to maintain an older release, please contact us
@@ -559,6 +591,7 @@ Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
Clément Bœsch 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8
Frank Plowman 34E2 48D6 B7DF 4769 70C7 3304 03A8 4C6A 098F 2C6B
Ganesh Ajjanagadde C96A 848E 97C3 CEA2 AB72 5CE4 45F9 6A2D 3C36 FB1B
Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
Haihao Xiang (haihao) 1F0C 31E8 B4FE F7A4 4DC1 DC99 E0F5 76D4 76FC 437F

View File

@@ -19,14 +19,20 @@ vpath %/fate_config.sh.template $(SRC_PATH)
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample
ALLFFLIBS = \
avcodec \
avdevice \
avfilter \
avformat \
avutil \
swscale \
swresample \
# $(FFLIBS-yes) needs to be in linking order
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
FFLIBS-$(CONFIG_AVFILTER) += avfilter
FFLIBS-$(CONFIG_AVFORMAT) += avformat
FFLIBS-$(CONFIG_AVCODEC) += avcodec
FFLIBS-$(CONFIG_POSTPROC) += postproc
FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
FFLIBS-$(CONFIG_SWSCALE) += swscale
@@ -52,6 +58,9 @@ $(TOOLS): %$(EXESUF): %.o
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
target_enc_%_fuzzer$(EXESUF): target_enc_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/target_bsf_%_fuzzer$(EXESUF): tools/target_bsf_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
@@ -67,6 +76,8 @@ tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS)
tools/target_sws_fuzzer$(EXESUF): tools/target_sws_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/target_swr_fuzzer$(EXESUF): tools/target_swr_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
@@ -98,8 +109,8 @@ SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS \
OBJS SLIBOBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS
MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS RVVB-OBJS \
OBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS SIMD128-OBJS
define RESET
$(1) :=

View File

@@ -1 +1 @@
5.1.git
8.0.1

15
RELEASE_NOTES Normal file
View File

@@ -0,0 +1,15 @@
┌────────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 8.0 "Huffman" │
└────────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 8.0 "Huffman", about 11
months after the release of FFmpeg 7.1.
A complete Changelog is available at the root of the project, and the
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
We hope you will like this release as much as we enjoyed working on it, and
as usual, if you have any questions about it, or any FFmpeg related topic,
feel free to join us on the #ffmpeg IRC channel (on irc.libera.chat) or ask
on the mailing-lists.

View File

@@ -1,173 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* based on vlc_atomic.h from VLC
* Copyright (C) 2010 Rémi Denis-Courmont
*/
#ifndef COMPAT_ATOMICS_GCC_STDATOMIC_H
#define COMPAT_ATOMICS_GCC_STDATOMIC_H
#include <stddef.h>
#include <stdint.h>
#define ATOMIC_FLAG_INIT 0
#define ATOMIC_VAR_INIT(value) (value)
#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)
#define kill_dependency(y) ((void)0)
#define atomic_thread_fence(order) \
__sync_synchronize()
#define atomic_signal_fence(order) \
((void)0)
#define atomic_is_lock_free(obj) 0
typedef _Bool atomic_flag;
typedef _Bool atomic_bool;
typedef char atomic_char;
typedef signed char atomic_schar;
typedef unsigned char atomic_uchar;
typedef short atomic_short;
typedef unsigned short atomic_ushort;
typedef int atomic_int;
typedef unsigned int atomic_uint;
typedef long atomic_long;
typedef unsigned long atomic_ulong;
typedef long long atomic_llong;
typedef unsigned long long atomic_ullong;
typedef wchar_t atomic_wchar_t;
typedef int_least8_t atomic_int_least8_t;
typedef uint_least8_t atomic_uint_least8_t;
typedef int_least16_t atomic_int_least16_t;
typedef uint_least16_t atomic_uint_least16_t;
typedef int_least32_t atomic_int_least32_t;
typedef uint_least32_t atomic_uint_least32_t;
typedef int_least64_t atomic_int_least64_t;
typedef uint_least64_t atomic_uint_least64_t;
typedef int_fast8_t atomic_int_fast8_t;
typedef uint_fast8_t atomic_uint_fast8_t;
typedef int_fast16_t atomic_int_fast16_t;
typedef uint_fast16_t atomic_uint_fast16_t;
typedef int_fast32_t atomic_int_fast32_t;
typedef uint_fast32_t atomic_uint_fast32_t;
typedef int_fast64_t atomic_int_fast64_t;
typedef uint_fast64_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef uintptr_t atomic_uintptr_t;
typedef size_t atomic_size_t;
typedef ptrdiff_t atomic_ptrdiff_t;
typedef intmax_t atomic_intmax_t;
typedef uintmax_t atomic_uintmax_t;
#define atomic_store(object, desired) \
do { \
*(object) = (desired); \
__sync_synchronize(); \
} while (0)
#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)
#define atomic_load(object) \
(__sync_synchronize(), *(object))
#define atomic_load_explicit(object, order) \
atomic_load(object)
#define atomic_exchange(object, desired) \
({ \
__typeof__(object) _obj = (object); \
__typeof__(*object) _old; \
do \
_old = atomic_load(_obj); \
while (!__sync_bool_compare_and_swap(_obj, _old, (desired))); \
_old; \
})
#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)
#define atomic_compare_exchange_strong(object, expected, desired) \
({ \
__typeof__(object) _exp = (expected); \
__typeof__(*object) _old = *_exp; \
*_exp = __sync_val_compare_and_swap((object), _old, (desired)); \
*_exp == _old; \
})
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)
#define atomic_fetch_add(object, operand) \
__sync_fetch_and_add(object, operand)
#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)
#define atomic_fetch_sub(object, operand) \
__sync_fetch_and_sub(object, operand)
#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)
#define atomic_fetch_or(object, operand) \
__sync_fetch_and_or(object, operand)
#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)
#define atomic_fetch_xor(object, operand) \
__sync_fetch_and_xor(object, operand)
#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)
#define atomic_fetch_and(object, operand) \
__sync_fetch_and_and(object, operand)
#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)
#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)
#define atomic_flag_clear(object) \
atomic_store(object, 0)
#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)
#endif /* COMPAT_ATOMICS_GCC_STDATOMIC_H */

View File

@@ -1,197 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* based on vlc_atomic.h from VLC
* Copyright (C) 2010 Rémi Denis-Courmont
*/
#ifndef COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
#define COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
#include <stdint.h>
#define ATOMIC_FLAG_INIT 0
#define ATOMIC_VAR_INIT(value) (value)
#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)
#define kill_dependency(y) ((void)0)
#define atomic_signal_fence(order) \
((void)0)
#define atomic_is_lock_free(obj) 0
typedef intptr_t atomic_flag;
typedef intptr_t atomic_bool;
typedef intptr_t atomic_char;
typedef intptr_t atomic_schar;
typedef intptr_t atomic_uchar;
typedef intptr_t atomic_short;
typedef intptr_t atomic_ushort;
typedef intptr_t atomic_int;
typedef intptr_t atomic_uint;
typedef intptr_t atomic_long;
typedef intptr_t atomic_ulong;
typedef intptr_t atomic_llong;
typedef intptr_t atomic_ullong;
typedef intptr_t atomic_wchar_t;
typedef intptr_t atomic_int_least8_t;
typedef intptr_t atomic_uint_least8_t;
typedef intptr_t atomic_int_least16_t;
typedef intptr_t atomic_uint_least16_t;
typedef intptr_t atomic_int_least32_t;
typedef intptr_t atomic_uint_least32_t;
typedef intptr_t atomic_int_least64_t;
typedef intptr_t atomic_uint_least64_t;
typedef intptr_t atomic_int_fast8_t;
typedef intptr_t atomic_uint_fast8_t;
typedef intptr_t atomic_int_fast16_t;
typedef intptr_t atomic_uint_fast16_t;
typedef intptr_t atomic_int_fast32_t;
typedef intptr_t atomic_uint_fast32_t;
typedef intptr_t atomic_int_fast64_t;
typedef intptr_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef intptr_t atomic_uintptr_t;
typedef intptr_t atomic_size_t;
typedef intptr_t atomic_ptrdiff_t;
typedef intptr_t atomic_intmax_t;
typedef intptr_t atomic_uintmax_t;
void avpriv_atomic_lock(void);
void avpriv_atomic_unlock(void);
static inline void atomic_thread_fence(int order)
{
avpriv_atomic_lock();
avpriv_atomic_unlock();
}
static inline void atomic_store(intptr_t *object, intptr_t desired)
{
avpriv_atomic_lock();
*object = desired;
avpriv_atomic_unlock();
}
#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)
static inline intptr_t atomic_load(intptr_t *object)
{
intptr_t ret;
avpriv_atomic_lock();
ret = *object;
avpriv_atomic_unlock();
return ret;
}
#define atomic_load_explicit(object, order) \
atomic_load(object)
static inline intptr_t atomic_exchange(intptr_t *object, intptr_t desired)
{
intptr_t ret;
avpriv_atomic_lock();
ret = *object;
*object = desired;
avpriv_atomic_unlock();
return ret;
}
#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)
static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected,
intptr_t desired)
{
int ret;
avpriv_atomic_lock();
if (*object == *expected) {
ret = 1;
*object = desired;
} else {
ret = 0;
*expected = *object;
}
avpriv_atomic_unlock();
return ret;
}
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)
#define FETCH_MODIFY(opname, op) \
static inline intptr_t atomic_fetch_ ## opname(intptr_t *object, intptr_t operand) \
{ \
intptr_t ret; \
avpriv_atomic_lock(); \
ret = *object; \
*object = *object op operand; \
avpriv_atomic_unlock(); \
return ret; \
}
FETCH_MODIFY(add, +)
FETCH_MODIFY(sub, -)
FETCH_MODIFY(or, |)
FETCH_MODIFY(xor, ^)
FETCH_MODIFY(and, &)
#undef FETCH_MODIFY
#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)
#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)
#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)
#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)
#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)
#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)
#define atomic_flag_clear(object) \
atomic_store(object, 0)
#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)
#endif /* COMPAT_ATOMICS_PTHREAD_STDATOMIC_H */

View File

@@ -1,186 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMPAT_ATOMICS_SUNCC_STDATOMIC_H
#define COMPAT_ATOMICS_SUNCC_STDATOMIC_H
#include <atomic.h>
#include <mbarrier.h>
#include <stddef.h>
#include <stdint.h>
#define ATOMIC_FLAG_INIT 0
#define ATOMIC_VAR_INIT(value) (value)
#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)
#define kill_dependency(y) ((void)0)
#define atomic_thread_fence(order) \
__machine_rw_barrier();
#define atomic_signal_fence(order) \
((void)0)
#define atomic_is_lock_free(obj) 0
typedef intptr_t atomic_flag;
typedef intptr_t atomic_bool;
typedef intptr_t atomic_char;
typedef intptr_t atomic_schar;
typedef intptr_t atomic_uchar;
typedef intptr_t atomic_short;
typedef intptr_t atomic_ushort;
typedef intptr_t atomic_int;
typedef intptr_t atomic_uint;
typedef intptr_t atomic_long;
typedef intptr_t atomic_ulong;
typedef intptr_t atomic_llong;
typedef intptr_t atomic_ullong;
typedef intptr_t atomic_wchar_t;
typedef intptr_t atomic_int_least8_t;
typedef intptr_t atomic_uint_least8_t;
typedef intptr_t atomic_int_least16_t;
typedef intptr_t atomic_uint_least16_t;
typedef intptr_t atomic_int_least32_t;
typedef intptr_t atomic_uint_least32_t;
typedef intptr_t atomic_int_least64_t;
typedef intptr_t atomic_uint_least64_t;
typedef intptr_t atomic_int_fast8_t;
typedef intptr_t atomic_uint_fast8_t;
typedef intptr_t atomic_int_fast16_t;
typedef intptr_t atomic_uint_fast16_t;
typedef intptr_t atomic_int_fast32_t;
typedef intptr_t atomic_uint_fast32_t;
typedef intptr_t atomic_int_fast64_t;
typedef intptr_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef intptr_t atomic_uintptr_t;
typedef intptr_t atomic_size_t;
typedef intptr_t atomic_ptrdiff_t;
typedef intptr_t atomic_intmax_t;
typedef intptr_t atomic_uintmax_t;
static inline void atomic_store(intptr_t *object, intptr_t desired)
{
*object = desired;
__machine_rw_barrier();
}
#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)
static inline intptr_t atomic_load(intptr_t *object)
{
__machine_rw_barrier();
return *object;
}
#define atomic_load_explicit(object, order) \
atomic_load(object)
#define atomic_exchange(object, desired) \
atomic_swap_ptr(object, desired)
#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)
static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected,
intptr_t desired)
{
intptr_t old = *expected;
*expected = (intptr_t)atomic_cas_ptr(object, (void *)old, (void *)desired);
return *expected == old;
}
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)
static inline intptr_t atomic_fetch_add(intptr_t *object, intptr_t operand)
{
return atomic_add_ptr_nv(object, operand) - operand;
}
#define atomic_fetch_sub(object, operand) \
atomic_fetch_add(object, -(operand))
static inline intptr_t atomic_fetch_or(intptr_t *object, intptr_t operand)
{
intptr_t old;
do {
old = atomic_load(object);
} while (!atomic_compare_exchange_strong(object, old, old | operand));
return old;
}
static inline intptr_t atomic_fetch_xor(intptr_t *object, intptr_t operand)
{
intptr_t old;
do {
old = atomic_load(object);
} while (!atomic_compare_exchange_strong(object, old, old ^ operand));
return old;
}
static inline intptr_t atomic_fetch_and(intptr_t *object, intptr_t operand)
{
intptr_t old;
do {
old = atomic_load(object);
} while (!atomic_compare_exchange_strong(object, old, old & operand));
return old;
}
#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)
#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)
#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)
#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)
#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)
#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)
#define atomic_flag_clear(object) \
atomic_store(object, 0)
#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)
#endif /* COMPAT_ATOMICS_SUNCC_STDATOMIC_H */

View File

@@ -189,4 +189,7 @@ static inline __device__ float __cosf(float a) { return __nvvm_cos_approx_f(a);
static inline __device__ float __expf(float a) { return __nvvm_ex2_approx_f(a * (float)__builtin_log2(__builtin_exp(1))); }
static inline __device__ float __powf(float a, float b) { return __nvvm_ex2_approx_f(__nvvm_lg2_approx_f(a) * b); }
// Misc helper functions
extern "C" __device__ int printf(const char*, ...);
#endif /* COMPAT_CUDA_CUDA_RUNTIME_H */

View File

@@ -218,7 +218,7 @@ while (<F>) {
# Lines of the form '} SOME_VERSION_NAME_1.0;'
if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) {
$glob = 'glob';
# We tried to match symbols agains this version, but none matched.
# We tried to match symbols against this version, but none matched.
# Emit dummy hidden symbol to avoid marking this version WEAK.
if ($matches_attempted && $matched_symbols == 0) {
print " hidden:\n";

599
compat/stdbit/stdbit.h Normal file
View File

@@ -0,0 +1,599 @@
/*
* Copyright (C) 2023 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*/
#ifndef __STDC_VERSION_STDBIT_H__
#define __STDC_VERSION_STDBIT_H__ 202311L
#include <stdbool.h>
#include <limits.h> /* CHAR_BIT */
#define __STDC_ENDIAN_LITTLE__ 1234
#define __STDC_ENDIAN_BIG__ 4321
#ifdef __BYTE_ORDER__
# if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_LITTLE__
# elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_BIG__
# else
# define __STDC_ENDIAN_NATIVE__ 3412
# endif
#elif defined(_MSC_VER)
# define __STDC_ENDIAN_NATIVE__ __STDC_ENDIAN_LITTLE__
#else
# error Not implemented.
#endif
#define __stdbit_generic_type_func(func, value) \
_Generic (value, \
unsigned long long: stdc_##func##_ull((unsigned long long)(value)), \
unsigned long: stdc_##func##_ul((unsigned long)(value)), \
unsigned int: stdc_##func##_ui((unsigned int)(value)), \
unsigned short: stdc_##func##_us((unsigned short)(value)), \
unsigned char: stdc_##func##_uc((unsigned char)(value)))
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_leading_zeros_ull(unsigned long long value)
{
return value ? __builtin_clzll(value) : (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ul(unsigned long value)
{
return value ? __builtin_clzl(value) : (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ui(unsigned int value)
{
return value ? __builtin_clz(value) : (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_leading_zeros_us(unsigned short value)
{
return stdc_leading_zeros_ui(value)
- CHAR_BIT * (sizeof (int) - sizeof (value));
}
static inline unsigned int stdc_leading_zeros_uc(unsigned char value)
{
return stdc_leading_zeros_ui(value) - (CHAR_BIT * (sizeof (int) - 1));
}
#else
static inline unsigned int __stdc_leading_zeros(unsigned long long value,
unsigned int size)
{
unsigned int zeros = size * CHAR_BIT;
while (value != 0) {
value >>= 1;
zeros--;
}
return zeros;
}
static inline unsigned int stdc_leading_zeros_ull(unsigned long long value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ul(unsigned long value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_ui(unsigned int value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_us(unsigned short value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
static inline unsigned int stdc_leading_zeros_uc(unsigned char value)
{
return __stdc_leading_zeros(value, sizeof (value));
}
#endif
#define stdc_leading_zeros(value) \
__stdbit_generic_type_func(leading_zeros, value)
static inline unsigned int stdc_leading_ones_ull(unsigned long long value)
{
return stdc_leading_zeros_ull(~value);
}
static inline unsigned int stdc_leading_ones_ul(unsigned long value)
{
return stdc_leading_zeros_ul(~value);
}
static inline unsigned int stdc_leading_ones_ui(unsigned int value)
{
return stdc_leading_zeros_ui(~value);
}
static inline unsigned int stdc_leading_ones_us(unsigned short value)
{
return stdc_leading_zeros_us(~value);
}
static inline unsigned int stdc_leading_ones_uc(unsigned char value)
{
return stdc_leading_zeros_uc(~value);
}
#define stdc_leading_ones(value) \
__stdbit_generic_type_func(leading_ones, value)
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_trailing_zeros_ull(unsigned long long value)
{
return value ? (unsigned int)__builtin_ctzll(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ul(unsigned long value)
{
return value ? (unsigned int)__builtin_ctzl(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ui(unsigned int value)
{
return value ? (unsigned int)__builtin_ctz(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_us(unsigned short value)
{
return value ? (unsigned int)__builtin_ctz(value)
: (CHAR_BIT * sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_uc(unsigned char value)
{
return value ? (unsigned int)__builtin_ctz(value)
: (CHAR_BIT * sizeof (value));
}
#else
static inline unsigned int __stdc_trailing_zeros(unsigned long long value,
unsigned int size)
{
unsigned int zeros = 0;
if (!value)
return size * CHAR_BIT;
while ((value & 1) == 0) {
value >>= 1;
zeros++;
}
return zeros;
}
static inline unsigned int stdc_trailing_zeros_ull(unsigned long long value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ul(unsigned long value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_ui(unsigned int value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_us(unsigned short value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
static inline unsigned int stdc_trailing_zeros_uc(unsigned char value)
{
return __stdc_trailing_zeros(value, sizeof (value));
}
#endif
#define stdc_trailing_zeros(value) \
__stdbit_generic_type_func(trailing_zeros, value)
static inline unsigned int stdc_trailing_ones_ull(unsigned long long value)
{
return stdc_trailing_zeros_ull(~value);
}
static inline unsigned int stdc_trailing_ones_ul(unsigned long value)
{
return stdc_trailing_zeros_ul(~value);
}
static inline unsigned int stdc_trailing_ones_ui(unsigned int value)
{
return stdc_trailing_zeros_ui(~value);
}
static inline unsigned int stdc_trailing_ones_us(unsigned short value)
{
return stdc_trailing_zeros_us(~value);
}
static inline unsigned int stdc_trailing_ones_uc(unsigned char value)
{
return stdc_trailing_zeros_uc(~value);
}
#define stdc_trailing_ones(value) \
__stdbit_generic_type_func(trailing_ones, value)
static inline unsigned int stdc_first_leading_one_ull(unsigned long long value)
{
return value ? (stdc_leading_zeros_ull(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_ul(unsigned long value)
{
return value ? (stdc_leading_zeros_ul(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_ui(unsigned int value)
{
return value ? (stdc_leading_zeros_ui(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_us(unsigned short value)
{
return value ? (stdc_leading_zeros_us(value) + 1) : 0;
}
static inline unsigned int stdc_first_leading_one_uc(unsigned char value)
{
return value ? (stdc_leading_zeros_uc(value) + 1) : 0;
}
#define stdc_first_leading_one(value) \
__stdbit_generic_type_func(first_leading_one, value)
static inline unsigned int stdc_first_leading_zero_ull(unsigned long long value)
{
return stdc_leading_ones_ull(~value);
}
static inline unsigned int stdc_first_leading_zero_ul(unsigned long value)
{
return stdc_leading_ones_ul(~value);
}
static inline unsigned int stdc_first_leading_zero_ui(unsigned int value)
{
return stdc_leading_ones_ui(~value);
}
static inline unsigned int stdc_first_leading_zero_us(unsigned short value)
{
return stdc_leading_ones_us(~value);
}
static inline unsigned int stdc_first_leading_zero_uc(unsigned char value)
{
return stdc_leading_ones_uc(~value);
}
#define stdc_first_leading_zero(value) \
__stdbit_generic_type_func(first_leading_zero, value)
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_first_trailing_one_ull(unsigned long long value)
{
return __builtin_ffsll(value);
}
static inline unsigned int stdc_first_trailing_one_ul(unsigned long value)
{
return __builtin_ffsl(value);
}
static inline unsigned int stdc_first_trailing_one_ui(unsigned int value)
{
return __builtin_ffs(value);
}
static inline unsigned int stdc_first_trailing_one_us(unsigned short value)
{
return __builtin_ffs(value);
}
static inline unsigned int stdc_first_trailing_one_uc(unsigned char value)
{
return __builtin_ffs(value);
}
#else
static inline unsigned int stdc_first_trailing_one_ull(unsigned long long value)
{
return value ? (1 + stdc_trailing_zeros_ull(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_ul(unsigned long value)
{
return value ? (1 + stdc_trailing_zeros_ul(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_ui(unsigned int value)
{
return value ? (1 + stdc_trailing_zeros_ui(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_us(unsigned short value)
{
return value ? (1 + stdc_trailing_zeros_us(value)) : 0;
}
static inline unsigned int stdc_first_trailing_one_uc(unsigned char value)
{
return value ? (1 + stdc_trailing_zeros_uc(value)) : 0;
}
#endif
#define stdc_first_trailing_one(value) \
__stdbit_generic_type_func(first_trailing_one, value)
static inline unsigned int stdc_first_trailing_zero_ull(unsigned long long value)
{
return stdc_first_trailing_one_ull(~value);
}
static inline unsigned int stdc_first_trailing_zero_ul(unsigned long value)
{
return stdc_first_trailing_one_ul(~value);
}
static inline unsigned int stdc_first_trailing_zero_ui(unsigned int value)
{
return stdc_first_trailing_one_ui(~value);
}
static inline unsigned int stdc_first_trailing_zero_us(unsigned short value)
{
return stdc_first_trailing_one_us(~value);
}
static inline unsigned int stdc_first_trailing_zero_uc(unsigned char value)
{
return stdc_first_trailing_one_uc(~value);
}
#define stdc_first_trailing_zero(value) \
__stdbit_generic_type_func(first_trailing_zero, value)
#if defined (__GNUC__) || defined (__clang__)
static inline unsigned int stdc_count_ones_ull(unsigned long long value)
{
return __builtin_popcountll(value);
}
static inline unsigned int stdc_count_ones_ul(unsigned long value)
{
return __builtin_popcountl(value);
}
static inline unsigned int stdc_count_ones_ui(unsigned int value)
{
return __builtin_popcount(value);
}
static inline unsigned int stdc_count_ones_us(unsigned short value)
{
return __builtin_popcount(value);
}
static inline unsigned int stdc_count_ones_uc(unsigned char value)
{
return __builtin_popcount(value);
}
#else
static inline unsigned int __stdc_count_ones(unsigned long long value,
unsigned int size)
{
unsigned int ones = 0;
for (unsigned int c = 0; c < (size * CHAR_BIT); c++) {
ones += value & 1;
value >>= 1;
}
return ones;
}
static inline unsigned int stdc_count_ones_ull(unsigned long long value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_ul(unsigned long value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_ui(unsigned int value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_us(unsigned short value)
{
return __stdc_count_ones(value, sizeof (value));
}
static inline unsigned int stdc_count_ones_uc(unsigned char value)
{
return __stdc_count_ones(value, sizeof (value));
}
#endif
#define stdc_count_ones(value) \
__stdbit_generic_type_func(count_ones, value)
static inline unsigned int stdc_count_zeros_ull(unsigned long long value)
{
return stdc_count_ones_ull(~value);
}
static inline unsigned int stdc_count_zeros_ul(unsigned long value)
{
return stdc_count_ones_ul(~value);
}
static inline unsigned int stdc_count_zeros_ui(unsigned int value)
{
return stdc_count_ones_ui(~value);
}
static inline unsigned int stdc_count_zeros_us(unsigned short value)
{
return stdc_count_ones_us(~value);
}
static inline unsigned int stdc_count_zeros_uc(unsigned char value)
{
return stdc_count_ones_uc(~value);
}
#define stdc_count_zeros(value) \
__stdbit_generic_type_func(count_zeros, value)
static inline bool stdc_has_single_bit_ull(unsigned long long value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_ul(unsigned long value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_ui(unsigned int value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_us(unsigned short value)
{
return value && (value & (value - 1)) == 0;
}
static inline bool stdc_has_single_bit_uc(unsigned char value)
{
return value && (value & (value - 1)) == 0;
}
#define stdc_has_single_bit(value) \
__stdbit_generic_type_func(has_single_bit, value)
static inline unsigned int stdc_bit_width_ull(unsigned long long value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ull(value);
}
static inline unsigned int stdc_bit_width_ul(unsigned long value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ul(value);
}
static inline unsigned int stdc_bit_width_ui(unsigned int value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_ui(value);
}
static inline unsigned int stdc_bit_width_us(unsigned short value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_us(value);
}
static inline unsigned int stdc_bit_width_uc(unsigned char value)
{
return (CHAR_BIT * sizeof (value)) - stdc_leading_zeros_uc(value);
}
#define stdc_bit_width(value) \
__stdbit_generic_type_func(bit_width, value)
static inline unsigned long long stdc_bit_floor_ull(unsigned long long value)
{
return value ? (1ULL << (stdc_bit_width_ull(value) - 1)) : 0ULL;
}
static inline unsigned long stdc_bit_floor_ul(unsigned long value)
{
return value ? (1UL << (stdc_bit_width_ul(value) - 1)) : 0UL;
}
static inline unsigned int stdc_bit_floor_ui(unsigned int value)
{
return value ? (1U << (stdc_bit_width_ui(value) - 1)) : 0U;
}
static inline unsigned short stdc_bit_floor_us(unsigned short value)
{
return value ? (1U << (stdc_bit_width_us(value) - 1)) : 0U;
}
static inline unsigned int stdc_bit_floor_uc(unsigned char value)
{
return value ? (1U << (stdc_bit_width_uc(value) - 1)) : 0U;
}
#define stdc_bit_floor(value) \
__stdbit_generic_type_func(bit_floor, value)
/* NOTE: Bit ceiling undefines overflow. */
static inline unsigned long long stdc_bit_ceil_ull(unsigned long long value)
{
return 1ULL << (value ? stdc_bit_width_ull(value - 1) : 0);
}
static inline unsigned long stdc_bit_ceil_ul(unsigned long value)
{
return 1UL << (value ? stdc_bit_width_ul(value - 1) : 0);
}
static inline unsigned int stdc_bit_ceil_ui(unsigned int value)
{
return 1U << (value ? stdc_bit_width_ui(value - 1) : 0);
}
static inline unsigned short stdc_bit_ceil_us(unsigned short value)
{
return 1U << (value ? stdc_bit_width_us(value - 1) : 0);
}
static inline unsigned int stdc_bit_ceil_uc(unsigned char value)
{
return 1U << (value ? stdc_bit_width_uc(value - 1) : 0);
}
#define stdc_bit_ceil(value) \
__stdbit_generic_type_func(bit_ceil, value)
#endif /* __STDC_VERSION_STDBIT_H__ */

View File

@@ -26,6 +26,7 @@
#include "config.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/wchar_filename.h"
static inline wchar_t *get_module_filename(HMODULE module)

View File

@@ -50,7 +50,7 @@ typedef struct pthread_t {
void *(*func)(void* arg);
void *arg;
void *ret;
} pthread_t;
} *pthread_t;
/* use light weight mutex/condition variable API for Windows Vista and later */
typedef SRWLOCK pthread_mutex_t;
@@ -74,7 +74,7 @@ typedef CONDITION_VARIABLE pthread_cond_t;
static av_unused THREADFUNC_RETTYPE
__stdcall attribute_align_arg win32thread_worker(void *arg)
{
pthread_t *h = (pthread_t*)arg;
pthread_t h = (pthread_t)arg;
h->ret = h->func(h->arg);
return 0;
}
@@ -82,21 +82,35 @@ __stdcall attribute_align_arg win32thread_worker(void *arg)
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
void *(*start_routine)(void*), void *arg)
{
thread->func = start_routine;
thread->arg = arg;
pthread_t ret;
ret = av_mallocz(sizeof(*ret));
if (!ret)
return EAGAIN;
ret->func = start_routine;
ret->arg = arg;
#if HAVE_WINRT
thread->handle = (void*)CreateThread(NULL, 0, win32thread_worker, thread,
0, NULL);
ret->handle = (void*)CreateThread(NULL, 0, win32thread_worker, ret,
0, NULL);
#else
thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread,
0, NULL);
ret->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, ret,
0, NULL);
#endif
return !thread->handle;
if (!ret->handle) {
av_free(ret);
return EAGAIN;
}
*thread = ret;
return 0;
}
static av_unused int pthread_join(pthread_t thread, void **value_ptr)
{
DWORD ret = WaitForSingleObject(thread.handle, INFINITE);
DWORD ret = WaitForSingleObject(thread->handle, INFINITE);
if (ret != WAIT_OBJECT_0) {
if (ret == WAIT_ABANDONED)
return EINVAL;
@@ -104,8 +118,9 @@ static av_unused int pthread_join(pthread_t thread, void **value_ptr)
return EDEADLK;
}
if (value_ptr)
*value_ptr = thread.ret;
CloseHandle(thread.handle);
*value_ptr = thread->ret;
CloseHandle(thread->handle);
av_free(thread);
return 0;
}

808
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,377 @@
The last version increases of all libraries were on 2024-03-07
The last version increases of all libraries were on 2025-03-28
API changes, most recent first:
2025-07-29 - 1c85a3832af - lavc 62.10.100 - smpte_436m.h
Add a new public header smpte_436m.h with API for
manipulating AV_CODEC_ID_SMPTE_436M_ANC data.
2025-07-10 - a566fcb9dc0 - lavf 62.2.100
mxf [de]muxer now uses AV_CODEC_ID_SMPTE_436M_ANC for
the vbi_vanc_smpte_436M streams instead of AV_CODEC_ID_NONE.
2025-07-10 - f4ff379baea - lavc 62.10.100 - codec_id.h
Add AV_CODEC_ID_SMPTE_436M_ANC.
2025-08-08 - 83b36f54108 - lavc 62.9.100 - codec_id.h
Add AV_CODEC_ID_PRORES_RAW.
2025-07-31 - 119d127d05c - lavu 60.7.100 - spherical.h
Add AV_SPHERICAL_PARAMETRIC_IMMERSIVE.
2025-07-20 - 157d3b007e9 - lavu 60.6.100 - attributes.h, avstring.h
Add av_scanf_format() and use it on av_sscanf().
2025-07-18 - fbda5ffb953 - lavu 60.5.100 - pixfmt.h
Add AV_PIX_FMT_OHCODEC.
2025-07-18 - fbda5ffb953 - lavu 60.5.100 - hwcontext.h
Add AV_HWDEVICE_TYPE_OHCODEC and AVOHCodecDeviceContext.
2025-07-14 - b24155cae11 - lavfi 11.2.100 - avfilter.h
Add AVFilterGraph->max_buffered_frames.
2025-07-07 - eca477da52 - lavc 62.6.100 - packet.h
Add AV_PKT_DATA_RTCP_SR.
2025-07-01 - 39d5a998bd - lavc 62.4.101 - packet.h
Add AV_PKT_DATA_3D_REFERENCE_DISPLAYS.
2025-07-01 - b2e4b0e282 - lavu 60.4.101 - frame.h
Add AV_FRAME_DATA_3D_REFERENCE_DISPLAYS.
2025-07-01 - 80a05bea4f - lavu 60.4.100 - tdrdi.h
Add AV3DReferenceDisplaysInfo and AV3DReferenceDisplay structs.
Add av_tdrdi_alloc() and av_tdrdi_get_display().
2025-05-21 - 004cc60f0e3 - lavu 60.3.100 - avassert.h
Add av_unreachable() and av_assume() macros.
2025-02-15 - e2f39671ae2 - lavfi 10.10.100 - avfilter.h
Add avfilter_link_get_hw_frames_ctx().
2025-04-21 - bf1579c904a - lavu 60.2.100 - log.h
Add AV_CLASS_CATEGORY_HWDEVICE.
2025-04-16 - c818c67991 - libpostproc 59.1.100 - postprocess.h
Deprecate PP_CPU_CAPS_3DNOW.
2025-04-07 - 19e9a203b7 - lavu 60.01.100 - dict.h
Add AV_DICT_DEDUP.
2025-03-17 - 49af9746e8f - lavu 59.60.100 - pixfmt.h
Add AV_PIX_FMT_GBRAP32BE and AV_PIX_FMT_GBRAP32LE.
2025-03-10 - 61fc9b6fee1 - lavu 59.59.100 - pixfmt.h
Add AV_PIX_FMT_YAF16BE, AV_PIX_FMT_YAF16LE, AV_PIX_FMT_YAF32BE,
and AV_PIX_FMT_YAF32LE.
2025-03-01 - 0245e9382c7 - lavu 59.58.100 - pixfmt.h
Add AV_PIX_FMT_GRAY32BE and AV_PIX_FMT_GRAY32LE.
2025-02-04 - 0ef678f5c50 - lavu 59.56.000 - pixfmt.h
Add AV_PIX_FMT_AMF_SURFACE.
2025-01-09 - a73760da537 - lavu 59.55.100 - pixfmt.h
Add AV_PIX_FMT_GBRPF16BE, AV_PIX_FMT_GBRPF16LE, AV_PIX_FMT_GBRAPF16BE,
AV_PIX_FMT_GBRAPF16LE, AV_PIX_FMT_GRAYF16BE, and AV_PIX_FMT_GRAYF16LE.
2025-02-16 - c79cdae3777 - lavu 59.57.100 - log.h
Add flags AV_LOG_PRINT_TIME and AV_LOG_PRINT_DATETIME.
2025-02-09 - 9fb806fa577 - lavc 61.32.100 - codec_id.h
Add AV_CODEC_ID_IVTV_VBI.
2025-01-25 - ea3c3b42dff - lavu 59.56.100 - frame.h
Add AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT.
2025-01-25 - 6707d970c04 - lavfi 10.9.100 - buffersink.h
Add av_buffersink_get_side_data().
2025-01-25 - 7a025e1cb5f - lavfi 10.8.100 - buffersrc.h
Add AVBufferSrcParameters.side_data and AVBufferSrcParameters.nb_side_data
2025-01-25 - ef1cb1c9c81 - lavfi 10.7.100 - avfilter.h
Add AVFilterLink.side_data and AVFilterLink.nb_side_data
2025-01-05 - 42e72d5c8b5 - lavu 59.55.100 - frame.h
Add AV_FRAME_SIDE_DATA_FLAG_NEW_REF.
2025-01-05 - 19c95ecbff8 - lavc 61.31.100 - avcodec.h
Deprecate AVCodecContext->properties.
2025-01-05 - 2d91f89445d - lavc 61.30.100 - frame.h
Add AV_FRAME_FLAG_LOSSLESS.
2025-01-03 - f3c40826455 - lavc 61.29.100 - codec_id.h
Add AV_CODEC_ID_JPEGXL_ANIM.
2025-01-03 - da9dcaba69d - lavu 59.54.100 - frame.h
Add AV_CH_LAYOUT_5POINT1POINT2 and AV_CHANNEL_LAYOUT_5POINT1POINT2.
2024-12-23 - b88944a8aa5 - lavu 59.53.100 - frame.h
Add av_frame_side_data_remove_by_props().
2024-12-23 - 3428a8d8303 - lavu 59.52.100 - frame.h
Add AV_SIDE_DATA_PROP_SIZE_DEPENDENT and AV_FRAME_DATA_PROP_COLOR_DEPENDENT.
2024-12-23 - 45f0a7ad338 - lsws 8.13.100 - swscale.h
Add enum SwsIntent and SwsContext.intent.
2024-12-15 - 2ac34d08542 - lavc 61.27.100 packet.h
Add av_container_fifo_alloc_avpacket().
2024-12-15 - 56ba57b6725 - lavu 59.51.100 - refstruct.h container_fifo.h
Add a new public header refstruct.h with new API for
reference-counted objects.
Add a new public header container_fifo.h with new API for
a FIFO of container objects (e.g. AVFrame or AVPacket).
2024-12-13 - 6eb4bf04e92 - lavu 59.50.100 - channel_layout.h
Add AV_CH_LAYOUT_9POINT1POINT6 and AV_CHANNEL_LAYOUT_9POINT1POINT6.
2024-12-05 - 06f084468e0 - lavu 59.49.100 - csp.h
Add av_csp_itu_eotf() and av_csp_itu_eotf_inv().
2024-12-05 - bf0a6c41111 - lavu 59.48.100 - csp.h
Add av_csp_trc_func_inv_from_id().
2024-11-25 - 2a091d4f2ee - lsws 8.12.100 - swscale.h
Allow using sws_frame_scale() dynamically, without first initializing the
SwsContext. Deprecate sws_init_context(). Add sws_frame_setup() instead.
2024-11-25 - fb169640092 - lsws 8.11.100 - swscale.h
Replace #define-based SWS_* flags by enum SwsFlags.
2024-11-25 - ed5dd675624 - lsws 8.10.100 - swscale.h
Publicly expose struct SwsContext, enum SwsDither, and enum SwsAlphaBlend.
2024-11-16 - 46cb7b8d9dc - lavu 59.47.101 - frame.h
av_frame_get_buffer() now also aligns the data pointers according to
the requested alignment.
2024-11-13 - 20af68b63a4 - lavu 59.47.100 - channel_layout.h
Add AV_CHAN_BINAURAL_LEFT, AV_CHAN_BINAURAL_RIGHT
Add AV_CH_BINAURAL_LEFT, AV_CH_BINAURAL_RIGHT
Add AV_CH_LAYOUT_BINAURAL, AV_CHANNEL_LAYOUT_BINAURAL
2024-10-26 - e02a3b40a5e - lavu 59.46.100 - pixfmt.h
Add AV_PIX_FMT_XV48.
2024-10-23 - b03c758600f - lsws 8.9.100 - swscale.h
Add sws_is_noop().
2024-10-23 - 5e50a56b9c4 - lsws 8.8.100 - swscale.h
Add frame property testing API:
- sws_test_format()
- sws_test_colorspace()
- sws_test_primaries()
- sws_test_transfer()
- sws_test_frame()
2024-10-23 - 87baf9ab2c2 - lsws 8.7.100 - swscale.h
Add sws_free_context().
2024-10-23 - f462ba05f54 - lavu 59.45.100 - pixfmt.h
Add AV_PIX_FMT_Y216.
2024-10-15 - 2336e685657 - lavu 59.44.100 - pixfmt.h
Add AV_PIX_FMT_RGB96 and AV_PIX_FMT_RGBA128.
2024-10-14 - c993a91bea - lavu 59.43.100 - pixfmt.h
Add AV_PIX_FMT_RGBF16.
2024-10-08 - 29ea34728f1 - lavu 59.42.100 - pixfmt.h
Add AV_PIX_FMT_AYUV, AV_PIX_FMT_UYVA, AV_PIX_FMT_VYU444,
and AV_PIX_FMT_V30X.
2024-10-01 - 0548ab2e425 - lavu 59.41.100 - log.h
Add AVClass.state_flags_offset and AV_CLASS_STATE_INITIALIZED.
2024-09-30 - 50d1b89fa0d - lavf 61.9.100 - avformat.h
Add {nb_}coded_side_data to AVStreamGroupTileGrid.
2024-09-30 - df9b80d21a2 - lavu 59
Deprecate av_int_list_length_for_size(), av_int_list_length(), and
av_opt_set_int_list() without replacement. All AVOptions using these
should be replaced with AV_OPT_TYPE_FLAG_ARRAY.
2024-09-30 - 1efcdbc54d9 - lavfi 10.6.100
Buffersink now has array-type options
- pixel_formats
- colorspaces
- colorranges
replacing the int-list options
- pix_fmts
- color_spaces
- color_ranges
abuffersink now has array-type options
- sample_formats
- samplerates
- channel_layouts
replacing the int-list/string options
- sample_fmts
- sample_rates
- ch_layouts
-------- 8< --------- FFmpeg 7.1 was cut here -------- 8< ---------
2024-09-23 - 6940a6de2f0 - lavu 59.38.100 - frame.h
Add AV_FRAME_DATA_VIEW_ID.
2024-09-23 - 6147385393a - lavc 61.18.100 - avcodec.h
Add a new flag AV_CODEC_EXPORT_DATA_ENHANCEMENTS for export_side_data.
2024-09-18 - df609af8e44 - lavc 61.17.100 - packet.h
Add AV_PKT_DATA_LCEVC.
2024-09-18 - ba0ef0860f0 - lavf 61.5.100 - avformat.h
Add AVStreamGroupLCEVC
Add AV_STREAM_GROUP_PARAMS_LCEVC
Add AVStreamGroup.params.lcevc
2024-09-18 - 58963182294 - lavc 61.16.100 - avcodec.h
Add AV_CODEC_ID_LCEVC.
2024-09-18 - 90d12c24c51 - lavu 59.37.100 - frame.h
Add AV_FRAME_DATA_LCEVC.
2024-09-08 - 3305767560a - lavc 61.13.100 - avcodec.h
Add avcodec_get_supported_config() and enum AVCodecConfig; deprecate
AVCodec.pix_fmts, AVCodec.sample_fmts, AVCodec.supported_framerates,
AVCodec.supported_samplerates and AVCodec.ch_layouts.
2024-09-06 - c35a51f4bb1 - lavc 61.12.100 - defs.h
Add AV_PROFILE_HEVC_MULTIVIEW_MAIN
2024-09-06 - 450a3f58edb - lavu 59.36.100 - opt.h
Add av_opt_set_array() and AV_OPT_ARRAY_REPLACE.
2024-08-27 - d89930f8666 - lavu 59.35.100 - opt.h
Add av_opt_get_array_size() and av_opt_get_array().
2024-08-18 - 8657eb9c3f4 - lavc 61.11.100 - avcodec.h
Clarify the documentation for get_buffer*() functions, making it
clear that the memory returned by them should not contain sensitive
information. This is not a change in the API, it is how it already worked
before.
2024-08-10 - 5f0f1f7b7a6 - lavu 59.34.100 - hwcontext_vulkan.h
Add qf and nb_qf to AVVulkanDeviceContext.
Deprecate queue_family_index, nb_graphics_queues,
queue_family_tx_index, nb_tx_queues.
queue_family_comp_index, nb_comp_queues.
queue_family_encode_index, nb_encode_queues.
queue_family_decode_index, and nb_decode_queues,
from AVVulkanDeviceContext.
2024-07-30 - e0f9f4d4915 - lavu 59.32.100 - cpu.h
Deprecate AV_CPU_FLAG_RVF and AV_CPU_FLAG_RVD without replacement.
Deprecate AV_CPU_FLAG_RVB_ADDR, subsumed into AV_CPU_FLAG_RVB.
2024-07-29 - 753f2aeed76 - lavu 59.31.100 - intreadwrite.h
Add AV_{R,W}{L,B}{16,32}A and AV_{R,W}B64A.
2024-07-28 - cbea92c84d4 - lavu 59.30.100 - dovi_meta.h
Add AVDOVIDecoderConfigurationRecord.dv_md_compression.
2024-07-25 - 45d7078a218 - lavu 59.29.100 - cpu.h
Add AV_CPU_FLAG_RVB.
2024-07-xx - xxxxxxxxxx - lavf 61 - avformat.h
Deprecate avformat_transfer_internal_stream_timing_info()
and av_stream_get_codec_timebase() without replacement.
2024-07-08 - 1b58f3af30c - lavc 61.10.100 - packet.h
Add AV_PKT_DATA_FRAME_CROPPING.
2024-07-07 - 46f7ea44563 - lavf 61.5.100 - avformat.h
Add AV_DISPOSITION_MULTILAYER
2024-07-02 - d822146f4fc - lavu 59.28.100 - hwcontext_d3d12va.h
Add AVD3D12VAFramesContext.flags
2024-06-28 - 8af0919cc66 - lavu 59.27.100 - stereo3d.h
Add AV_STEREO3D_UNSPEC and AV_STEREO3D_VIEW_UNSPEC.
2024-06-25 - e6baf4f3841 - lavu 59.26.100 - stereo3d.h
Add av_stereo3d_alloc_size().
2024-06-19 - cc587e69c6f - lavu 59.25.100 - dovi_meta.h
Add AVDOVIRpuDataHeader.ext_mapping_idc_0_4 and ext_mapping_idc_5_7.
2024-06-18 - cf2436a0b4d - lavu 59.24.100 - stereo3d.h
Add primary_eye, baseline, horizontal_disparity_adjustment, and
horizontal_field_of_view fields to AVStereo3D.
Add AVStereo3DPrimaryEye.
Add av_stereo3d_view_name.
Add av_stereo3d_view_from_name.
Add av_stereo3d_primary_eye_name.
Add av_stereo3d_primary_eye_from_name.
2024-06-18 - 57bfba35d6b - lavu 59.23.100 - spherical.h
Add AV_SPHERICAL_HALF_EQUIRECTANGULAR, AV_SPHERICAL_RECTILINEAR, and
AV_SPHERICAL_FISHEYE values to AVSphericalProjection, and initialize
to AV_SPHERICAL_RECTILINEAR on alloc.
2024-06-13 - 39c90d6466a - lavu 59.22.100 - common.h
Deprecate av_mod_uintp2[_c]() and replace it with av_zero_extend[_c]().
2024-06-08 - 91fd6ca000c - lavc 61.7.100 - defs.h
Add AV_PROFILE_AAC_USAC.
2024-06-02 - 63e166d8028 - lavu 59.21.100 - channel_layout.h
Add AV_CHAN_SIDE_SURROUND_RIGHT and AV_CH_SIDE_SURROUND_LEFT.
Add AV_CHAN_SIDE_SURROUND_RIGHT and AV_CH_SIDE_SURROUND_RIGHT.
Add AV_CHAN_TOP_SURROUND_LEFT and AV_CH_TOP_SURROUND_LEFT.
Add AV_CHAN_TOP_SURROUND_RIGHT and AV_CH_TOP_SURROUND_RIGHT.
2024-05-23 - 8c974494822 - lavu 59.20.100 - channel_layout.h
Add av_channel_layout_ambisonic_order().
2024-05-20 - 4c0bb7d4a91 - lavu 59.19.100 - hwcontext_qsv.h
Add AVQSVFramesContext.info
2024-05-10 - 01c5f4ad9fa - lavu 59.18.100 - cpu.h
Add AV_CPU_FLAG_RV_ZVBB.
2024-05-04 - d053290d8dd - lavu 59.17.100 - opt.h
Add AV_OPT_TYPE_UINT and av_opt_eval_uint().
2024-04-24 - 8616cfe0890 - lavu 59.16.100 - opt.h
Add AV_OPT_SERIALIZE_SEARCH_CHILDREN.
2024-04-11 - 6d0c89980c7 - lavc 61.5.102 - avcodec.h
AVCodecContext.decoded_side_data may now be set by libavcodec after
calling avcodec_open2().
2024-04-11 - 6d760c666d5 - lavu 59.15.100 - frame.h
Add av_mastering_display_metadata_alloc_size().
2024-04-11 - adb67bba064 - lavu 59.14.100 - frame.h
Add av_frame_side_data_add() and av_frame_side_data_remove().
Add AV_FRAME_SIDE_DATA_FLAG_REPLACE.
2024-04-03 - 29561c8e2d4 - lavu 59.13.100 - pixfmt.h
Add AVCOL_SPC_IPT_C2, AVCOL_SPC_YCGCO_RE and AVCOL_SPC_YCGCO_RO
to map new matrix coefficients defined by H.273 v3.
2024-04-03 - 4f55e16f2bc - lavu 59.12.100 - dovi_meta.h
Add AVDOVIMetadata.ext_block_{offset,size}, AVDOVIMetadata.num_ext_blocks,
AVDOVIDmData and AVDOVIDmLevel{1..6,8..11,254..255}, av_dovi_get_ext()
and av_dovi_find_level().
2024-04-03 - 78076ede296 - lavu 59.11.100 - dovi_meta.h
Add AVDOVIDataMapping.nlq_pivots.
2024-03-29 - ed9363052f4 - lavf 61.3.100 - avformat.h
Add AVFormatContext.duration_probesize.
2024-03-27 - 2621be35397 - lavu 59.10.100 - frame.h
Add AVSideDataDescriptor, enum AVSideDataProps, and
av_frame_side_data_desc().
-------- 8< --------- FFmpeg 7.0 was cut here -------- 8< ---------
2024-03-25 - 5df901ffa56 - lavu 59.7.100 - timestamp.h
@@ -257,7 +627,7 @@ API changes, most recent first:
Deprecate AVFrame.palette_has_changed without replacement.
2023-05-15 - 7d1d61cc5f5 - lavc 60 - avcodec.h
Depreate AVCodecContext.ticks_per_frame in favor of
Deprecate AVCodecContext.ticks_per_frame in favor of
AVCodecContext.framerate (encoding) and
AV_CODEC_PROP_FIELDS (decoding).
@@ -265,7 +635,7 @@ API changes, most recent first:
Add AV_CODEC_PROP_FIELDS.
2023-05-15 - 8b20d0dcb5c - lavc 60 - codec.h
Depreate AV_CODEC_CAP_SUBFRAMES without replacement.
Deprecate AV_CODEC_CAP_SUBFRAMES without replacement.
2023-05-07 - c2ae8e30b7f - lavc 60.11.100 - codec_par.h
Add AVCodecParameters.framerate.

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 8.0.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -1093,7 +1093,7 @@ HTML_STYLESHEET =
# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefor more robust against future updates.
# standard style sheet and is therefore more robust against future updates.
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra stylesheet files is of importance (e.g. the last
# stylesheet in the list overrules the setting of the previous ones in the
@@ -1636,7 +1636,7 @@ EXTRA_PACKAGES =
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empty string,
# for the replacement values of the other commands the user is referred to
# HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.

View File

@@ -60,7 +60,7 @@ GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
$(GENTEXI): TAG = GENTEXI
$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
$(M)doc/print_options $* > $@
$(M)doc/print_options$(HOSTEXESUF) $* > $@
doc/%.html: TAG = HTML
doc/%-all.html: TAG = HTML

View File

@@ -101,6 +101,29 @@ Remove zero padding at the end of a packet.
Extract the core from a DCA/DTS stream, dropping extensions such as
DTS-HD.
@section dovi_rpu
Manipulate Dolby Vision metadata in a HEVC/AV1 bitstream, optionally enabling
metadata compression.
@table @option
@item strip
If enabled, strip all Dolby Vision metadata (configuration record + RPU data
blocks) from the stream.
@item compression
Which compression level to enable.
@table @samp
@item none
No metadata compression.
@item limited
Limited metadata compression scheme. Should be compatible with most devices.
This is the default.
@item extended
Extended metadata compression. Devices are not required to support this. Note
that this level currently behaves the same as @samp{limited} in libavcodec.
@end table
@end table
@section dump_extra
Add extradata to the beginning of the filtered packets except when
@@ -166,6 +189,52 @@ see page 44-46 or section 5.5 of
Extract the core from a E-AC-3 stream, dropping extra channels.
@section eia608_to_smpte436m
Convert from a @code{EIA_608} stream to a @code{SMPTE_436M_ANC} data stream, wrapping the closed captions in CTA-708 CDP VANC packets.
@table @option
@item line_number
Choose which line number the generated VANC packets should go on. You generally want either line 9 (the default) or 11.
@item wrapping_type
Choose the SMPTE 436M wrapping type, defaults to @samp{vanc_frame}.
It accepts the values:
@table @samp
@item vanc_frame
VANC frame (interlaced or segmented progressive frame)
@item vanc_field_1
@item vanc_field_2
@item vanc_progressive_frame
@end table
@item sample_coding
Choose the SMPTE 436M sample coding, defaults to @samp{8bit_luma}.
It accepts the values:
@table @samp
@item 8bit_luma
8-bit component luma samples
@item 8bit_color_diff
8-bit component color difference samples
@item 8bit_luma_and_color_diff
8-bit component luma and color difference samples
@item 10bit_luma
10-bit component luma samples
@item 10bit_color_diff
10-bit component color difference samples
@item 10bit_luma_and_color_diff
10-bit component luma and color difference samples
@item 8bit_luma_parity_error
8-bit component luma samples with parity error
@item 8bit_color_diff_parity_error
8-bit component color difference samples with parity error
@item 8bit_luma_and_color_diff_parity_error
8-bit component luma and color difference samples with parity error
@end table
@item initial_cdp_sequence_cntr
The initial value of the CDP's 16-bit unsigned integer @code{cdp_hdr_sequence_cntr} and @code{cdp_ftr_sequence_cntr} fields. Defaults to 0.
@item cdp_frame_rate
Set the CDP's @code{cdp_frame_rate} field. This doesn't actually change the timing of the data stream, it just changes the values inserted in that field in the generated CDP packets. Defaults to @samp{30000/1001}.
@end table
@section extract_extradata
Extract the in-band extradata.
@@ -400,9 +469,21 @@ Please note that this filter is auto-inserted for MPEG-TS (muxer
@section h264_redundant_pps
This applies a specific fixup to some Blu-ray streams which contain
redundant PPSs modifying irrelevant parameters of the stream which
confuse other transformations which require correct extradata.
This applies a specific fixup to some Blu-ray BDMV H264 streams
which contain redundant PPSs. The PPSs modify irrelevant parameters
of the stream, confusing other transformations which require
the correct extradata.
The encoder used on these impacted streams adds extra PPSs throughout
the stream, varying the initial QP and whether weighted prediction
was enabled. This causes issues after copying the stream into
a global header container, as the starting PPS is not suitable
for the rest of the stream. One side effect, for example,
is seeking will return garbled output until a new PPS appears.
This BSF removes the extra PPSs and rewrites the slice headers
such that the stream uses a single leading PPS in the global header,
which resolves the issue.
@section hevc_metadata
@@ -456,6 +537,10 @@ will replace the current ones if the stream is already cropped.
These fields are set in pixels. Note that some sizes may not be
representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
@item width
@item height
Set width and height after crop.
@item level
Set the level in the VPS and SPS. See H.265 section A.4 and tables
A.6 and A.7.
@@ -669,12 +754,12 @@ ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
Drop every video packet not marked as a keyframe after timestamp 30s but do not
modify any of the remaining packets.
@example
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(pts*tb\,30)*not(key)' output.mkv
@end example
Drop one second of audio every 10 seconds and add some random noise to the rest.
@example
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(pts*tb\,10)\,9\,10)' output.mkv
@end example
@section null
@@ -909,6 +994,11 @@ ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
Log basic packet information. Mainly useful for testing, debugging,
and development.
@section smpte436m_to_eia608
Convert from a @code{SMPTE_436M_ANC} data stream to a @code{EIA_608} stream,
extracting the closed captions from CTA-708 CDP VANC packets, and ignoring all other data.
@anchor{text2movsub}
@section text2movsub

View File

@@ -30,6 +30,13 @@ fate
fate-list
List all fate/regression test targets.
fate-list-failing
List the fate tests that failed the last time they were executed.
fate-clear-reports
Remove the test reports from previous test executions (getting rid of
potentially stale results from fate-list-failing).
install
Install headers, libraries and programs.
@@ -63,4 +70,3 @@ make -j<num>
make -k
Continue build in case of errors, this is useful for the regression tests
sometimes but note that it will still not run all reg tests.

View File

@@ -664,6 +664,8 @@ for codecs that support it. At present, those are H.264 and VP9.
@item film_grain
Export film grain parameters through frame side data (see @code{AV_FRAME_DATA_FILM_GRAIN_PARAMS}).
Supported at present by AV1 decoders.
@item enhancements
Export picture enhancement metadata through frame side data, e.g. LCEVC (see @code{AV_FRAME_DATA_LCEVC}).
@end table
@item threads @var{integer} (@emph{decoding/encoding,video})

View File

@@ -82,8 +82,6 @@ The TC has 2 modes of operation: a RFC one and an internal one.
If the TC thinks it needs the input from the larger community, the TC can call for a RFC. Else, it can decide by itself.
If the disagreement involves a member of the TC, that member should recuse themselves from the decision.
The decision to use a RFC process or an internal discussion is a discretionary decision of the TC.
The TC can also reject a seizure for a few reasons such as: the matter was not discussed enough previously; it lacks expertise to reach a beneficial decision on the matter; or the matter is too trivial.
@@ -123,6 +121,13 @@ The decisions from the TC will be sent on the mailing list, with the [TC] tag.
Internally, the TC should take decisions with a majority, or using ranked-choice voting.
Each TC member must vote on such decision according to what is, in their view, best for the project.
If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recuse themselves from the TC
discussion and vote.
A conflict of interest is presumed to occur when a TC member has a personal interest (e.g. financial) in a specific outcome of the case.
The decision from the TC should be published with a summary of the reasons that lead to this decision.
The decisions from the TC are final, until the matters are reopened after no less than one year.

View File

@@ -38,6 +38,51 @@ Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
@end table
@section hevc
HEVC (AKA ITU-T H.265 or ISO/IEC 23008-2) decoder.
The decoder supports MV-HEVC multiview streams with at most two views. Views to
be output are selected by supplying a list of view IDs to the decoder (the
@option{view_ids} option). This option may be set either statically before
decoder init, or from the @code{get_format()} callback - useful for the case
when the view count or IDs change dynamically during decoding.
Only the base layer is decoded by default.
Note that if you are using the @code{ffmpeg} CLI tool, you should be using view
specifiers as documented in its manual, rather than the options documented here.
@subsection Options
@table @option
@item view_ids (MV-HEVC)
Specify a list of view IDs that should be output. This option can also be set to
a single '-1', which will cause all views defined in the VPS to be decoded and
output.
@item view_ids_available (MV-HEVC)
This option may be read by the caller to retrieve an array of view IDs available
in the active VPS. The array is empty for single-layer video.
The value of this option is guaranteed to be accurate when read from the
@code{get_format()} callback. It may also be set at other times (e.g. after
opening the decoder), but the value is informational only and may be incorrect
(e.g. when the stream contains multiple distinct VPS NALUs).
@item view_pos_available (MV-HEVC)
This option may be read by the caller to retrieve an array of view positions
(left, right, or unspecified) available in the active VPS, as
@code{AVStereo3DView} values. When the array is available, its elements apply to
the corresponding elements of @option{view_ids_available}, i.e.
@code{view_pos_available[i]} contains the position of view with ID
@code{view_ids_available[i]}.
Same validity restrictions as for @option{view_ids_available} apply to
this option.
@end table
@section rawvideo
Raw video decoder.
@@ -157,7 +202,7 @@ Force to use a specific number of threads
@section QSV Decoders
The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
JPEG/MJPEG, VP8, VP9, AV1).
JPEG/MJPEG, VP8, VP9, AV1, VVC).
@subsection Common Options
@@ -350,7 +395,7 @@ without this library.
@c man end AUDIO DECODERS
@chapter Subtitles Decoders
@c man begin SUBTILES DECODERS
@c man begin SUBTITLES DECODERS
@section libaribb24
@@ -382,7 +427,7 @@ Enabled by default.
Yet another ARIB STD-B24 caption decoder using external @dfn{libaribcaption}
library.
Implements profiles A and C of the Japanse ARIB STD-B24 standard,
Implements profiles A and C of the Japanese ARIB STD-B24 standard,
Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T.
Requires the presence of the libaribcaption headers and library
@@ -432,7 +477,7 @@ Specify comma-separated list of font family names to be used for @dfn{bitmap}
or @dfn{ass} type subtitle rendering.
Only first font name is used for @dfn{ass} type subtitle.
If not specified, use internaly defined default font family.
If not specified, use internally defined default font family.
@item -ass_single_rect @var{boolean}
ARIB STD-B24 specifies that some captions may be displayed at different
@@ -450,7 +495,7 @@ default behavior at compilation.
@item -force_outline_text @var{boolean}
Specify whether always render outline text for all characters regardless of
the indication by charactor style.
the indication by character style.
The default is @var{false}.
@@ -651,4 +696,4 @@ box and an end box, typically subtitles. Default value is 0 if
@end table
@c man end SUBTILES DECODERS
@c man end SUBTITLES DECODERS

View File

@@ -292,7 +292,6 @@ DVD-Video demuxer, powered by libdvdnav and libdvdread.
Can directly ingest DVD titles, specifically sequential PGCs, into
a conversion pipeline. Menu assets, such as background video or audio,
can also be demuxed given the menu's coordinates (at best effort).
Seeking is not supported at this time.
Block devices (DVD drives), ISO files, and directory structures are accepted.
Activate with @code{-f dvdvideo} in front of one of these inputs.
@@ -380,11 +379,11 @@ Default is false.
@item menu_lu @var{int}
The menu language to demux. In DVD, menus are grouped by language.
Default is 0, the first language unit.
Default is 1, the first language unit.
@item menu_vts @var{int}
The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
Default is 0, VMG menu.
Default is 1, menu of the first VTS.
@item pgc @var{int}
The entry PGC to start playback, in conjunction with @option{pg}.
@@ -397,8 +396,7 @@ Default is 0, automatically resolve from value of @option{title}.
The entry PG to start playback, in conjunction with @option{pgc}.
Alternative to setting @option{title}.
Chapter markers are not supported at this time.
Default is 0, automatically resolve from value of @option{title}, or
start from the beginning (PG 1) of the menu.
Default is 1, the first PG of the PGC.
@item preindex @var{bool}
Enable this to have accurate chapter (PTT) markers and duration measurement,
@@ -406,7 +404,6 @@ which requires a slow second pass read in order to index the chapter marker
timestamps from NAV packets. This is non-ideal extra work for real optical drives.
It is recommended and faster to use this option with a backup of the DVD structure
stored on a hard drive. Not compatible with @option{pgc} and @option{pg}.
Not applicable to menus.
Default is 0, false.
@item trim @var{bool}
@@ -567,6 +564,13 @@ prefer to use #EXT-X-START if it's in playlist instead of live_start_index.
@item allowed_extensions
',' separated list of file extensions that hls is allowed to access.
@item extension_picky
This blocks disallowed extensions from probing
It also requires all available segments to have matching extensions to the format
except mpegts, which is always allowed.
It is recommended to set the whitelists correctly instead of depending on extensions
Enabled by default.
@item max_reload
Maximum number of times a insufficient list is attempted to be reloaded.
Default value is 1000.
@@ -851,6 +855,32 @@ Set the sample rate for libopenmpt to output.
Range is from 1000 to INT_MAX. The value default is 48000.
@end table
@anchor{mccdec}
@section mcc
Demuxer for MacCaption MCC files, it supports MCC versions 1.0 and 2.0.
MCC files store VANC data, which can include closed captions (EIA-608 and CEA-708), ancillary time code, pan-scan data, etc.
By default, for backward compatibility, the MCC demuxer extracts just the EIA-608 and CEA-708 closed captions and returns a @code{EIA_608} stream, ignoring all other VANC data.
You can change it to return all VANC data in a @code{SMPTE_436M_ANC} data stream by setting @option{-eia608_extract 0}
@subsection Examples
@itemize
@item
Convert a MCC file to Scenarist (SCC) format:
@example
ffmpeg -i CC.mcc -c:s copy CC.scc
@end example
Note that the SCC format only supports EIA-608, so this will discard all other data such as CEA-708 extensions.
@item
Merge a MCC file into a MXF file:
@example
ffmpeg -i video_and_audio.mxf -eia608_extract 0 -i CC.mcc -c copy -map 0 -map 1 out.mxf
@end example
This retains all VANC data and inserts it into the output MXF file as a @code{SMPTE_436M_ANC} data stream.
@end itemize
@section mov/mp4/3gp
Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
@@ -986,7 +1016,7 @@ to 1 (-1 means automatic setting, 1 means enabled, 0 means
disabled). Default value is -1.
@item merge_pmt_versions
Re-use existing streams when a PMT's version is updated and elementary
Reuse existing streams when a PMT's version is updated and elementary
streams move to different PIDs. Default value is 0.
@item max_packet_size
@@ -1038,6 +1068,36 @@ the command:
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
@end example
@anchor{rcwtdec}
@section rcwt
RCWT (Raw Captions With Time) is a format native to ccextractor, a commonly
used open source tool for processing 608/708 Closed Captions (CC) sources.
For more information on the format, see @ref{rcwtenc,,,ffmpeg-formats}.
This demuxer implements the specification as of March 2024, which has
been stable and unchanged since April 2014.
@subsection Examples
@itemize
@item
Render CC to ASS using the built-in decoder:
@example
ffmpeg -i CC.rcwt.bin CC.ass
@end example
Note that if your output appears to be empty, you may have to manually
set the decoder's @option{data_field} option to pick the desired CC substream.
@item
Convert an RCWT backup to Scenarist (SCC) format:
@example
ffmpeg -i CC.rcwt.bin -c:s copy CC.scc
@end example
Note that the SCC format does not support all of the possible CC extensions
that can be stored in RCWT (such as EIA-708).
@end itemize
@section sbg
SBaGen script demuxer.

View File

@@ -70,9 +70,6 @@ variable-length arrays;
@item
complex numbers;
@item
mixed statements and declarations.
@end itemize
@subsection SIMD/DSP
@@ -115,7 +112,7 @@ Objective-C where required for interacting with macOS-specific interfaces.
@section Code formatting conventions
There are the following guidelines regarding the indentation in files:
There are the following guidelines regarding the code style in files:
@itemize @bullet
@item
@@ -135,6 +132,104 @@ K&R coding style is used.
@end itemize
The presentation is one inspired by 'indent -i4 -kr -nut'.
@subsection Examples
Some notable examples to illustrate common code style in FFmpeg:
@itemize @bullet
@item
Space around assignments and after
@code{if}/@code{do}/@code{while}/@code{for} keywords:
@example c, good
// Good
if (condition)
av_foo();
@end example
@example c, good
// Good
for (size_t i = 0; i < len; i++)
av_bar(i);
@end example
@example c, good
// Good
size_t size = 0;
@end example
However no spaces between the parentheses and condition, unless it helps
readability of complex conditions, so the following should not be done:
@example c, bad
// Bad style
if ( condition )
av_foo();
@end example
@item
No unnecessary parentheses, unless it helps readability:
@example c, good
// Good
int fields = ilace ? 2 : 1;
@end example
@item
Don't wrap single-line blocks in braces. Use braces only if there is an accompanying else statement. This keeps future code changes easier to keep track of.
@example c, good
// Good
if (bits_pixel == 24) @{
avctx->pix_fmt = AV_PIX_FMT_BGR24;
@} else if (bits_pixel == 8) @{
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
@} else
return AVERROR_INVALIDDATA;
@end example
@item
Avoid assignments in conditions where it makes sense:
@example c, good
// Good
video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64)
if (!video_enc->chroma_intra_matrix)
return AVERROR(ENOMEM);
@end example
@example c, bad
// Bad style
if (!(video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64)))
return AVERROR(ENOMEM);
@end example
@example c, good
// Ok
while ((entry = av_dict_iterate(options, entry)))
av_log(ctx, AV_LOG_INFO, "Item '%s': '%s'\n", entry->key, entry->value);
@end example
@item
When declaring a pointer variable, the @code{*} goes with the variable not the type:
@example c, good
// Good
AVStream *stream;
@end example
@example c, bad
// Bad style
AVStream* stream;
@end example
@end itemize
If you work on a file that does not follow these guidelines consistently,
change the parts that you are editing to follow these guidelines but do
not make unrelated changes in the file to make it conform to these.
@subsection Vim configuration
In order to configure Vim to follow FFmpeg formatting conventions, paste
the following snippet into your @file{.vimrc}:
@@ -390,6 +485,10 @@ If you apply a patch, send an
answer to ffmpeg-devel (or wherever you got the patch from) saying that
you applied the patch.
@subheading Credit any researchers
If a commit/patch fixes an issues found by some researcher, always credit the
researcher in the commit message for finding/reporting the issue.
@subheading Always wait long enough before pushing changes
Do NOT commit to code actively maintained by others without permission.
Send a patch to ffmpeg-devel. If no one answers within a reasonable
@@ -447,7 +546,7 @@ FFmpeg also has a defined scope - your new API must fit within it.
@subsubheading Replacing existing APIs
If your new API is replacing an existing one, it should be strictly superior to
it, so that the advantages of using the new API outweight the cost to the
it, so that the advantages of using the new API outweigh the cost to the
callers of changing their code. After adding the new API you should then
deprecate the old one and schedule it for removal, as described in
@ref{Removing interfaces}.
@@ -497,7 +596,7 @@ change in @file{doc/APIchanges}.
Backward-incompatible API or ABI changes require incrementing (bumping) the
major version number, as described in @ref{Major version bumps}. Major
bumps are significant events that happen on a schedule - so if your change
strictly requires one you should add it under @code{#if} preprocesor guards that
strictly requires one you should add it under @code{#if} preprocessor guards that
disable it until the next major bump happens.
New APIs that can be added without breaking API or ABI compatibility require
@@ -634,6 +733,11 @@ patch is inline or attached per mail.
You can check @url{https://patchwork.ffmpeg.org}, if your patch does not show up, its mime type
likely was wrong.
@subheading How to setup git send-email?
Please see @url{https://git-send-email.io/}.
For gmail additionally see @url{https://shallowsky.com/blog/tech/email/gmail-app-passwds.html}.
@subheading Sending patches from email clients
Using @code{git send-email} might not be desirable for everyone. The
following trick allows to send patches via email clients in a safe
@@ -678,7 +782,7 @@ number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
@item
Did you add the AVCodecID to @file{avcodec.h}?
Did you add the AVCodecID to @file{codec_id.h}?
When adding new codec IDs, also add an entry to the codec descriptor
list in @file{libavcodec/codec_desc.c}.
@@ -693,7 +797,7 @@ already being compiled by some other rule, like a raw demuxer.
@item
Did you add an entry to the table of supported formats or codecs in
@file{doc/general.texi}?
@file{doc/general_contents.texi}?
@item
Did you add an entry in the Changelog?
@@ -813,10 +917,10 @@ improves readability.
Consider adding a regression test for your code. All new modules
should be covered by tests. That includes demuxers, muxers, decoders, encoders
filters, bitstream filters, parsers. If its not possible to do that, add
an explanation why to your patchset, its ok to not test if theres a reason.
an explanation why to your patchset, its ok to not test if there's a reason.
@item
If you added YASM code please check that things still work with --disable-yasm.
If you added NASM code please check that things still work with --disable-x86asm.
@item
Test your code with valgrind and or Address Sanitizer to ensure it's free
@@ -918,6 +1022,25 @@ In case you need finer control over how valgrind is invoked, use the
@code{--target-exec='valgrind <your_custom_valgrind_options>} option in
your configure line instead.
@anchor{Maintenance}
@chapter Maintenance process
@anchor{MAINTAINERS}
@section MAINTAINERS
The developers maintaining each part of the codebase are listed in @file{MAINTAINERS}.
Being listed in @file{MAINTAINERS}, gives one the right to have git write access to
the specific repository.
@anchor{Becoming a maintainer}
@section Becoming a maintainer
People add themselves to @file{MAINTAINERS} by sending a patch like any other code
change. These get reviewed by the community like any other patch. It is expected
that, if someone has an objection to a new maintainer, she is willing to object
in public with her full name and is willing to take over maintainership for the area.
@anchor{Release process}
@chapter Release process

View File

@@ -106,15 +106,8 @@ debugging by setting the option to "disable".
Enables the use of the long term prediction extension which increases coding
efficiency in very low bandwidth situations such as encoding of voice or
solo piano music by extending constant harmonic peaks in bands throughout
frames. This option is implied by profile:a aac_low and is incompatible with
aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
@item aac_pred
Enables the use of a more traditional style of prediction where the spectral
coefficients transmitted are replaced by the difference of the current
coefficients minus the previous "predicted" coefficients. In theory and sometimes
in practice this can improve quality for low to mid bitrate audio.
This option implies the aac_main profile and is incompatible with aac_ltp.
frames. This option is implied by profile:a aac_low.
Use in conjunction with @option{-ar} to decrease the samplerate.
@item profile
Sets the encoding profile, possible values:
@@ -132,10 +125,6 @@ MPEG4 specifications.
Long term prediction profile, is enabled by and will enable the @option{aac_ltp}
option. Introduced in MPEG4.
@item aac_main
Main-type prediction profile, is enabled by and will enable the @option{aac_pred}
option. Introduced in MPEG2.
@end table
If this option is unspecified it is set to @samp{aac_low}.
@end table
@@ -144,8 +133,7 @@ If this option is unspecified it is set to @samp{aac_low}.
AC-3 audio encoders.
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
the undocumented RealAudio 3 (a.k.a. dnet).
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366.
The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
encoder only uses fixed-point integer math. This does not mean that one is
@@ -814,6 +802,63 @@ ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
@end example
@end itemize
@anchor{liblc3-enc}
@section liblc3
liblc3 LC3 (Low Complexity Communication Codec) encoder wrapper.
Requires the presence of the liblc3 headers and library during configuration.
You need to explicitly configure the build with @code{--enable-liblc3}.
This encoder has support for the Bluetooth SIG LC3 codec for the LE Audio
protocol, and the following features of LC3plus:
@itemize
@item
Frame duration of 2.5 and 5ms.
@item
High-Resolution mode, 48 KHz, and 96 kHz sampling rates.
@end itemize
For more information see the liblc3 project at
@url{https://github.com/google/liblc3}.
@subsection Options
The following options are mapped on the shared FFmpeg codec options.
@table @option
@item b @var{bitrate}
Set the bit rate in bits/s. This will determine the fixed size of the encoded
frames, for a selected frame duration.
@item ar @var{frequency}
Set the audio sampling rate (in Hz).
@item channels
Set the number of audio channels.
@item frame_duration
Set the audio frame duration in milliseconds. Default value is 10ms.
Allowed frame durations are 2.5ms, 5ms, 7.5ms and 10ms.
LC3 (Bluetooth LE Audio), allows 7.5ms and 10ms; and LC3plus 2.5ms, 5ms
and 10ms.
The 10ms frame duration is available in LC3 and LC3 plus standard.
In this mode, the produced bitstream can be referenced either as LC3 or LC3plus.
@item high_resolution @var{boolean}
Enable the high-resolution mode if set to 1. The high-resolution mode is
available with all LC3plus frame durations and for a sampling rate of 48 KHz,
and 96 KHz.
The encoder automatically turns off this mode at lower sampling rates and
activates it at 96 KHz.
This mode should be preferred at high bitrates. In this mode, the audio
bandwidth is always up to the Nyquist frequency, compared to LC3 at 48 KHz,
which limits the bandwidth to 20 KHz.
@end table
@anchor{libmp3lame}
@section libmp3lame
@@ -993,7 +1038,7 @@ forces a wideband cutoff for bitrates < 15 kbps, unless CELT-only
Set channel mapping family to be used by the encoder. The default value of -1
uses mapping family 0 for mono and stereo inputs, and mapping family 1
otherwise. The default also disables the surround masking and LFE bandwidth
optimzations in libopus, and requires that the input contains 8 channels or
optimizations in libopus, and requires that the input contains 8 channels or
fewer.
Other values include 0 for mono and stereo, 1 for surround sound with masking
@@ -1335,6 +1380,48 @@ Higher is better but slower.
@end table
@anchor{ffv1}
@section ffv1
FFv1 Encoder
@subsection Options
The following options are supported by FFmpeg's FFv1 encoder.
@table @option
@item context
Sets the context size, 0 (default) is small, 1 is big.
@item coder
Set the coder,
@table @samp
@item rice
Golomb rice coder
@item range_def
Range coder with default table
@item range_tab
Range coder with custom table
@end table
@item slicecrc
-1 (default, automatic), 1 use crc with zero initial and final state, 2 use crc with non zero initial and final state
@item qtable
@table @samp
@item default
default, automatic
@item 8bit
use 8bit default
@item greater8bit
use >8bit default
@end table
@item remap_optimizer
0 - 5, default 3, how much effort the encoder puts into optimizing the remap table.
@end table
@section GIF
GIF image/animation encoder.
@@ -1802,6 +1889,42 @@ ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model
@end table
@section liboapv
Advanced Professional Video codec encoder wrapper.
This encoder requires the presence of the liboapv headers and library
during configuration. You need to explicitly configure the build with
@option{--enable-liboapv}.
@float NOTE
Many liboapv encoder options are mapped to FFmpeg global codec options,
while unique encoder options are provided through private options.
@end float
The apv project website is at @url{https://github.com/AcademySoftwareFoundation/openapv}.
@subsection Options
The following options are supported by the liboapv wrapper.
@float NOTE
To get a more extensive documentation of the liboapv options, consult the
liboapv documentation.
@end float
@table @option
@item preset
Set the quality-speed tradeoff [fastest, fast, medium, slow, placebo, default]
@item qp
Set the quantization parameter value for CQP rate control mode.
@item oapv-params (@emph{parse_apv_params})
Set liboapvenc options using a list of @var{key}=@var{value} pairs separated
by ":". See the liboapv encoder user guide for a list of accepted parameters.
@end table
@section libsvtav1
SVT-AV1 encoder wrapper.
@@ -2322,6 +2445,70 @@ Indicates frame duration
For more information about libvpx see:
@url{http://www.webmproject.org/}
@section libvvenc
VVenC H.266/VVC encoder wrapper.
This encoder requires the presence of the libvvenc headers and library
during configuration. You need to explicitly configure the build with
@option{--enable-libvvenc}.
The VVenC project website is at
@url{https://github.com/fraunhoferhhi/vvenc}.
@subsection Supported Pixel Formats
VVenC supports only 10-bit color spaces as input. But the internal (encoded)
bit depth can be set to 8-bit or 10-bit at runtime.
@subsection Options
@table @option
@item b
Sets target video bitrate.
@item g
Set the GOP size. Currently support for g=1 (Intra only) or default.
@item preset
Set the VVenC preset.
@item levelidc
Set level idc.
@item tier
Set vvc tier.
@item qp
Set constant quantization parameter.
@item subopt @var{boolean}
Set subjective (perceptually motivated) optimization. Default is 1 (on).
@item bitdepth8 @var{boolean}
Set 8bit coding mode instead of using 10bit. Default is 0 (off).
@item period
set (intra) refresh period in seconds.
@item vvenc-params
Set vvenc options using a list of @var{key}=@var{value} couples separated
by ":". See @command{vvencapp --fullhelp} or @command{vvencFFapp --fullhelp} for a list of options.
For example, the options might be provided as:
@example
intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8
@end example
For example the encoding options might be provided with @option{-vvenc-params}:
@example
ffmpeg -i input -c:v libvvenc -b 1M -vvenc-params intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8 output.mp4
@end example
@end table
@section libwebp
libwebp WebP Image encoder wrapper
@@ -3045,9 +3232,6 @@ Enable high quality AC prediction.
@item gray
Only encode grayscale.
@item gmc
Enable the use of global motion compensation (GMC).
@item qpel
Enable quarter-pixel motion compensation.
@@ -3059,7 +3243,9 @@ Place global headers in extradata instead of every keyframe.
@end table
@item trellis
@item gmc
Enable the use of global motion compensation (GMC). Default is 0
(disabled).
@item me_quality
Set motion estimation quality level. Possible values in decreasing order of
@@ -3114,6 +3300,9 @@ be better than any of the two specified individually. In other
words, the resulting quality will be the worse one of the two
effects.
@item trellis
Set rate-distortion optimal quantization.
@item ssim
Set structural similarity (SSIM) displaying method. Possible values:
@@ -3153,6 +3342,75 @@ fastest.
@end table
@section MediaCodec
MediaCodec encoder wrapper enables hardware-accelerated video encoding on
Android device. It supports H.264, H.265 (HEVC), VP8, VP9, MPEG-4, and AV1
encoding (whether works or not is device dependent).
Android provides two sets of APIs: Java MediaCodec and NDK MediaCodec. The
MediaCodec encoder wrapper supports both. Note that the NDK MediaCodec API
operates without requiring JVM, but may fail to function outside the JVM
environment due to dependencies on system framework services, particularly
after Android 15.
@table @option
@item ndk_codec @var{boolean}
Use the NDK-based MediaCodec API instead of the Java API. Enabled by default
if @code{av_jni_get_java_vm()} return NULL.
@item ndk_async @var{boolean}
Use NDK MediaCodec in async mode. Async mode has less overhead than poll in a
loop in sync mode. The drawback of async mode is AV_CODEC_FLAG_GLOBAL_HEADER
doesn't work (use extract_extradata bsf when necessary). It doesn't work and
will be disabled automatically on devices below Android 8.0.
@item codec_name @var{string}
A codec type can have multiple implementations on a single device, this option
specify which backend to use (via MediaCodec createCodecByName API). It's NULL
by default, and encoder is created by createEncoderByType.
@item bitrate_mode @var{integer}
Possible values:
@table @samp
@item cq
Constant quality mode
@item vbr
Variable bitrate mode
@item cbr
Constant bitrate mode
@item cbr_fd
Constant bitrate mode with frame drops
@end table
@item pts_as_dts @var{boolean}
Use PTS as DTS. This is a workaround since MediaCodec API doesn't provide
decoding timestamp. It is enabled automatically if B frame is 0.
@item operating_rate @var{integer}
The desired operating rate that the codec will need to operate at, zero for
unspecified. This is used for cases like high-speed/slow-motion video capture,
where the video encoder format contains the target playback rate (e.g. 30fps),
but the component must be able to handle the high operating capture rate (e.g.
240fps). This rate will be used by codec for resource planning and setting the
operating points.
@item qp_i_min @var{integer}
Minimum quantization parameter for I frame.
@item qp_p_min @var{integer}
Minimum quantization parameter for P frame.
@item qp_b_min @var{integer}
Minimum quantization parameter for B frame.
@item qp_i_max @var{integer}
Maximum quantization parameter for I frame.
@item qp_p_max @var{integer}
Maximum quantization parameter for P frame.
@item qp_b_max @var{integer}
Maximum quantization parameter for B frame.
@end table
@section MediaFoundation
This provides wrappers to encoders (both audio and video) in the
@@ -3235,6 +3493,13 @@ Default is 1 (on).
PNG image encoder.
@subsection Options
@table @option
@item compression_level
Sets the compression level, from 0 to 9(default)
@end table
@subsection Private options
@table @option
@@ -3242,6 +3507,8 @@ PNG image encoder.
Set physical density of pixels, in dots per inch, unset by default
@item dpm @var{integer}
Set physical density of pixels, in dots per meter, unset by default
@item pred @var{method}
Set prediction method (none, sub, up, avg, paeth, mixed), default is paeth
@end table
@section ProRes
@@ -3436,7 +3703,7 @@ For encoders set this flag to ON to reduce power consumption and GPU usage.
@end table
@subsection Runtime Options
Following options can be used durning qsv encoding.
Following options can be used during qsv encoding.
@table @option
@item @var{global_quality}
@@ -3488,6 +3755,20 @@ Change these value to reset qsv codec's bitrate control configuration.
@item @var{pic_timing_sei}
Supported in h264_qsv and hevc_qsv.
Change this value to reset qsv codec's pic_timing_sei configuration.
@item @var{qsv_params}
Set QSV encoder parameters as a colon-separated list of key-value pairs.
The @option{qsv_params} should be formatted as @code{key1=value1:key2=value2:...}.
These parameters are passed directly to the underlying Intel Quick Sync Video (QSV) encoder using the MFXSetParameter function.
Example:
@example
ffmpeg -i input.mp4 -c:v h264_qsv -qsv_params "CodingOption1=1:CodingOption2=2" output.mp4
@end example
This option allows fine-grained control over various encoder-specific settings provided by the QSV encoder.
@end table
@subsection H264 options
@@ -3532,7 +3813,7 @@ improves subjective visual quality. Enabling this flag may have negative impact
on performance and objective visual quality metric.
@item @var{low_delay_brc}
Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
more accurate bitrate control to minimize the variance of bitstream size frame
by frame. Value: -1-default 0-off 1-on
@@ -3731,7 +4012,7 @@ improves subjective visual quality. Enabling this flag may have negative impact
on performance and objective visual quality metric.
@item @var{low_delay_brc}
Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
more accurate bitrate control to minimize the variance of bitstream size frame
by frame. Value: -1-default 0-off 1-on
@@ -3965,14 +4246,22 @@ Extended bitrate control.
Depth of look ahead in number frames, available when extbrc option is enabled.
@item @var{low_delay_brc}
Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
more accurate bitrate control to minimize the variance of bitstream size frame
by frame. Value: -1-default 0-off 1-on
@item max_frame_size
@item @var{max_frame_size}
Set the allowed max size in bytes for each frame. If the frame size exceeds
the limitation, encoder will adjust the QP value to control the frame size.
Invalid in CQP rate control mode.
@item @var{max_frame_size_i}
Maximum encoded frame size for I frames in bytes. If this value is set as larger
than zero, then for I frames the value set by max_frame_size is ignored.
@item @var{max_frame_size_p}
Maximum encoded frame size for P frames in bytes. If this value is set as larger
than zero, then for P frames the value set by max_frame_size is ignored.
@end table
@section snow
@@ -4313,6 +4602,25 @@ Reduces detail but attempts to preserve color at extremely low bitrates.
@chapter Subtitles Encoders
@c man begin SUBTITLES ENCODERS
@section dvbsub
This codec encodes the bitmap subtitle format that is used in DVB
broadcasts and recordings. The bitmaps are typically embedded in a
container such as MPEG-TS as a separate stream.
@subsection Options
@table @option
@item min_bpp @var{integer (2, 4, or 8)}
Set a minimum bits-per-pixel value for the subtitle color lookup tables.
DVB supports 2, 4, and 8 bits-per-pixel color lookup tables. This
option enables forcing a particular bits-per-pixel value regardless of
the number of colors. Since not all players support or properly
support 2 bits-per-pixel, this value defaults to 4.
@end table
@section dvdsub
This codec encodes the bitmap subtitle format that is used in DVDs.
@@ -4340,4 +4648,18 @@ one byte per subtitle on average.
By default, this work-around is disabled.
@end table
@section lrc
This codec encodes the LRC lyrics format.
@subsection Options
@table @option
@item precision
Specify the precision of the fractional part of the timestamp. Time base is
determined based on this value.
Defaults to 2 for centiseconds.
@end table
@c man end SUBTITLES ENCODERS

View File

@@ -32,6 +32,7 @@
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/file.h>
#include <libavutil/mem.h>
struct buffer_data {
uint8_t *ptr;
@@ -95,6 +96,7 @@ int main(int argc, char *argv[])
avio_ctx = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size,
0, &bd, &read_packet, NULL, NULL);
if (!avio_ctx) {
av_freep(&avio_ctx_buffer);
ret = AVERROR(ENOMEM);
goto end;
}

View File

@@ -128,6 +128,10 @@ int main(int argc, char **argv)
outfilename = argv[2];
pkt = av_packet_alloc();
if (!pkt) {
fprintf(stderr, "Could not allocate AVPacket\n");
exit(1); /* or proper cleanup and returning */
}
/* find the MPEG audio decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
@@ -161,7 +165,7 @@ int main(int argc, char **argv)
}
outfile = fopen(outfilename, "wb");
if (!outfile) {
av_free(c);
fprintf(stderr, "Could not open %s\n", outfilename);
exit(1);
}

View File

@@ -37,6 +37,7 @@
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/channel_layout.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
static const char *filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono";
@@ -95,8 +96,7 @@ static int init_filters(const char *filters_descr)
const AVFilter *abuffersink = avfilter_get_by_name("abuffersink");
AVFilterInOut *outputs = avfilter_inout_alloc();
AVFilterInOut *inputs = avfilter_inout_alloc();
static const enum AVSampleFormat out_sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 };
static const int out_sample_rates[] = { 8000, -1 };
static const int out_sample_rate = 8000;
const AVFilterLink *outlink;
AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base;
@@ -122,34 +122,40 @@ static int init_filters(const char *filters_descr)
}
/* buffer audio sink: to terminate the filter chain. */
ret = avfilter_graph_create_filter(&buffersink_ctx, abuffersink, "out",
NULL, NULL, filter_graph);
if (ret < 0) {
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, abuffersink, "out");
if (!buffersink_ctx) {
av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n");
ret = AVERROR(ENOMEM);
goto end;
}
ret = av_opt_set_int_list(buffersink_ctx, "sample_fmts", out_sample_fmts, -1,
AV_OPT_SEARCH_CHILDREN);
ret = av_opt_set(buffersink_ctx, "sample_formats", "s16",
AV_OPT_SEARCH_CHILDREN);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n");
goto end;
}
ret = av_opt_set(buffersink_ctx, "ch_layouts", "mono",
AV_OPT_SEARCH_CHILDREN);
ret = av_opt_set(buffersink_ctx, "channel_layouts", "mono",
AV_OPT_SEARCH_CHILDREN);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n");
goto end;
}
ret = av_opt_set_int_list(buffersink_ctx, "sample_rates", out_sample_rates, -1,
AV_OPT_SEARCH_CHILDREN);
ret = av_opt_set_array(buffersink_ctx, "samplerates", AV_OPT_SEARCH_CHILDREN,
0, 1, AV_OPT_TYPE_INT, &out_sample_rate);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n");
goto end;
}
ret = avfilter_init_dict(buffersink_ctx, NULL);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot initialize audio buffer sink\n");
goto end;
}
/*
* Set the endpoints for the filter graph. The filter_graph will
* be linked to the graph described by filters_descr.
@@ -279,6 +285,25 @@ int main(int argc, char **argv)
}
av_packet_unref(packet);
}
if (ret == AVERROR_EOF) {
/* signal EOF to the filtergraph */
if (av_buffersrc_add_frame_flags(buffersrc_ctx, NULL, 0) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while closing the filtergraph\n");
goto end;
}
/* pull remaining frames from the filtergraph */
while (1) {
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
break;
if (ret < 0)
goto end;
print_frame(filt_frame);
av_frame_unref(filt_frame);
}
}
end:
avfilter_graph_free(&filter_graph);
avcodec_free_context(&dec_ctx);

View File

@@ -36,6 +36,7 @@
#include <libavformat/avformat.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
const char *filter_descr = "scale=78:24,transpose=cclock";
@@ -98,7 +99,6 @@ static int init_filters(const char *filters_descr)
AVFilterInOut *outputs = avfilter_inout_alloc();
AVFilterInOut *inputs = avfilter_inout_alloc();
AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base;
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
filter_graph = avfilter_graph_alloc();
if (!outputs || !inputs || !filter_graph) {
@@ -121,20 +121,26 @@ static int init_filters(const char *filters_descr)
}
/* buffer video sink: to terminate the filter chain. */
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
NULL, NULL, filter_graph);
if (ret < 0) {
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
if (!buffersink_ctx) {
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
ret = AVERROR(ENOMEM);
goto end;
}
ret = av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts,
AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
ret = av_opt_set(buffersink_ctx, "pixel_formats", "gray8",
AV_OPT_SEARCH_CHILDREN);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n");
goto end;
}
ret = avfilter_init_dict(buffersink_ctx, NULL);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot initialize buffer sink\n");
goto end;
}
/*
* Set the endpoints for the filter graph. The filter_graph will
* be linked to the graph described by filters_descr.
@@ -276,6 +282,25 @@ int main(int argc, char **argv)
}
av_packet_unref(packet);
}
if (ret == AVERROR_EOF) {
/* signal EOF to the filtergraph */
if (av_buffersrc_add_frame_flags(buffersrc_ctx, NULL, 0) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error while closing the filtergraph\n");
goto end;
}
/* pull remaining frames from the filtergraph */
while (1) {
ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
break;
if (ret < 0)
goto end;
display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base);
av_frame_unref(filt_frame);
}
}
end:
avfilter_graph_free(&filter_graph);
avcodec_free_context(&dec_ctx);

View File

@@ -138,11 +138,9 @@ static int decode_packet(AVCodecContext *dec, const AVPacket *pkt)
ret = output_audio_frame(frame);
av_frame_unref(frame);
if (ret < 0)
return ret;
}
return 0;
return ret;
}
static int open_codec_context(int *stream_idx,

View File

@@ -41,15 +41,15 @@
#include <stdio.h>
#include <stdlib.h>
#include "libavutil/channel_layout.h"
#include "libavutil/md5.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include <libavutil/channel_layout.h>
#include <libavutil/md5.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
#include <libavutil/samplefmt.h>
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersink.h"
#include "libavfilter/buffersrc.h"
#include <libavfilter/avfilter.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#define INPUT_SAMPLERATE 48000
#define INPUT_FORMAT AV_SAMPLE_FMT_FLTP
@@ -270,7 +270,6 @@ int main(int argc, char *argv[])
AVFilterGraph *graph;
AVFilterContext *src, *sink;
AVFrame *frame;
uint8_t errstr[1024];
float duration;
int err, nb_frames, i;
@@ -295,6 +294,7 @@ int main(int argc, char *argv[])
md5 = av_md5_alloc();
if (!md5) {
av_frame_free(&frame);
fprintf(stderr, "Error allocating the MD5 context\n");
return 1;
}
@@ -302,8 +302,10 @@ int main(int argc, char *argv[])
/* Set up the filtergraph. */
err = init_filter_graph(&graph, &src, &sink);
if (err < 0) {
av_frame_free(&frame);
av_freep(&md5);
fprintf(stderr, "Unable to init filter graph:");
goto fail;
return 1;
}
/* the main filtering loop */
@@ -354,7 +356,10 @@ int main(int argc, char *argv[])
return 0;
fail:
av_strerror(err, errstr, sizeof(errstr));
fprintf(stderr, "%s\n", errstr);
avfilter_graph_free(&graph);
av_frame_free(&frame);
av_freep(&md5);
fprintf(stderr, "%s\n", av_err2str(err));
return 1;
}

View File

@@ -35,6 +35,7 @@
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/mem.h>
#include <libavutil/pixdesc.h>
#include <libavutil/hwcontext.h>
#include <libavutil/opt.h>

View File

@@ -347,8 +347,7 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
if (frame) {
/* convert samples from native format to destination codec format, using the resampler */
/* compute destination number of samples */
dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples,
c->sample_rate, c->sample_rate, AV_ROUND_UP);
dst_nb_samples = swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples;
av_assert0(dst_nb_samples == frame->nb_samples);
/* when we pass a frame to the encoder, it may keep a reference to it
@@ -419,7 +418,7 @@ static void open_video(AVFormatContext *oc, const AVCodec *codec,
exit(1);
}
/* allocate and init a re-usable frame */
/* allocate and init a reusable frame */
ost->frame = alloc_frame(c->pix_fmt, c->width, c->height);
if (!ost->frame) {
fprintf(stderr, "Could not allocate video frame\n");

View File

@@ -30,16 +30,16 @@
#include <stdio.h>
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include "libavcodec/avcodec.h"
#include <libavcodec/avcodec.h>
#include "libavutil/buffer.h"
#include "libavutil/error.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/mem.h"
#include <libavutil/buffer.h>
#include <libavutil/error.h>
#include <libavutil/hwcontext.h>
#include <libavutil/hwcontext_qsv.h>
#include <libavutil/mem.h>
static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts)
{
@@ -219,11 +219,8 @@ int main(int argc, char **argv)
ret = decode_packet(decoder_ctx, frame, sw_frame, NULL, output_ctx);
finish:
if (ret < 0) {
char buf[1024];
av_strerror(ret, buf, sizeof(buf));
fprintf(stderr, "%s\n", buf);
}
if (ret < 0)
fprintf(stderr, "%s\n", av_err2str(ret));
avformat_close_input(&input_ctx);

View File

@@ -38,6 +38,7 @@
#include <errno.h>
#include <libavutil/hwcontext.h>
#include <libavutil/mem.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/opt.h>
@@ -75,8 +76,7 @@ static int str_to_dict(char* optstr, AVDictionary **opt)
if (value == NULL)
return AVERROR(EINVAL);
av_dict_set(opt, key, value, 0);
} while(key != NULL);
return 0;
} while(1);
}
static int dynamic_set_parameter(AVCodecContext *avctx)
@@ -101,7 +101,7 @@ static int dynamic_set_parameter(AVCodecContext *avctx)
/* Set codec specific option */
if ((ret = av_opt_set_dict(avctx->priv_data, &opts)) < 0)
goto fail;
/* There is no "framerate" option in commom option list. Use "-r" to set
/* There is no "framerate" option in common option list. Use "-r" to set
* framerate, which is compatible with ffmpeg commandline. The video is
* assumed to be average frame rate, so set time_base to 1/framerate. */
e = av_dict_get(opts, "r", NULL, 0);
@@ -180,7 +180,7 @@ static int open_input_file(char *filename)
decoder = avcodec_find_decoder_by_name("mjpeg_qsv");
break;
default:
fprintf(stderr, "Codec is not supportted by qsv\n");
fprintf(stderr, "Codec is not supported by qsv\n");
return AVERROR(EINVAL);
}
@@ -289,7 +289,7 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, char *optstr)
fprintf(stderr, "Failed to set encoding parameter.\n");
goto fail;
}
/* There is no "framerate" option in commom option list. Use "-r" to
/* There is no "framerate" option in common option list. Use "-r" to
* set framerate, which is compatible with ffmpeg commandline. The
* video is assumed to be average frame rate, so set time_base to
* 1/framerate. */
@@ -334,17 +334,15 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, char *optstr)
fail:
av_frame_free(&frame);
if (ret < 0)
return ret;
}
return 0;
return ret;
}
int main(int argc, char **argv)
{
const AVCodec *enc_codec;
int ret = 0;
AVPacket *dec_pkt;
AVPacket *dec_pkt = NULL;
if (argc < 5 || (argc - 5) % 2) {
av_log(NULL, AV_LOG_ERROR, "Usage: %s <input file> <encoder> <output file>"

View File

@@ -28,6 +28,7 @@
* input to the output without transcoding.
*/
#include <libavutil/mem.h>
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>

View File

@@ -35,6 +35,7 @@
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/channel_layout.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
#include <libavutil/pixdesc.h>
@@ -170,23 +171,38 @@ static int open_output_file(const char *filename)
* sample rate etc.). These properties can be changed for output
* streams easily using filters */
if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
const enum AVPixelFormat *pix_fmts = NULL;
enc_ctx->height = dec_ctx->height;
enc_ctx->width = dec_ctx->width;
enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
ret = avcodec_get_supported_config(dec_ctx, NULL,
AV_CODEC_CONFIG_PIX_FORMAT, 0,
(const void**)&pix_fmts, NULL);
/* take first format from list of supported formats */
if (encoder->pix_fmts)
enc_ctx->pix_fmt = encoder->pix_fmts[0];
else
enc_ctx->pix_fmt = dec_ctx->pix_fmt;
enc_ctx->pix_fmt = (ret >= 0 && pix_fmts) ?
pix_fmts[0] : dec_ctx->pix_fmt;
/* video time_base can be set to whatever is handy and supported by encoder */
enc_ctx->time_base = av_inv_q(dec_ctx->framerate);
} else {
const enum AVSampleFormat *sample_fmts = NULL;
enc_ctx->sample_rate = dec_ctx->sample_rate;
ret = av_channel_layout_copy(&enc_ctx->ch_layout, &dec_ctx->ch_layout);
if (ret < 0)
return ret;
ret = avcodec_get_supported_config(dec_ctx, NULL,
AV_CODEC_CONFIG_SAMPLE_FORMAT, 0,
(const void**)&sample_fmts, NULL);
/* take first format from list of supported formats */
enc_ctx->sample_fmt = encoder->sample_fmts[0];
enc_ctx->sample_fmt = (ret >= 0 && sample_fmts) ?
sample_fmts[0] : dec_ctx->sample_fmt;
enc_ctx->time_base = (AVRational){1, enc_ctx->sample_rate};
}
@@ -282,10 +298,10 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
goto end;
}
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
NULL, NULL, filter_graph);
if (ret < 0) {
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
if (!buffersink_ctx) {
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
ret = AVERROR(ENOMEM);
goto end;
}
@@ -296,6 +312,12 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n");
goto end;
}
ret = avfilter_init_dict(buffersink_ctx, NULL);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot initialize buffer sink\n");
goto end;
}
} else if (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
char buf[64];
buffersrc = avfilter_get_by_name("abuffer");
@@ -321,10 +343,10 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
goto end;
}
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
NULL, NULL, filter_graph);
if (ret < 0) {
buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
if (!buffersink_ctx) {
av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n");
ret = AVERROR(ENOMEM);
goto end;
}
@@ -351,6 +373,15 @@ static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n");
goto end;
}
if (enc_ctx->frame_size > 0)
av_buffersink_set_frame_size(buffersink_ctx, enc_ctx->frame_size);
ret = avfilter_init_dict(buffersink_ctx, NULL);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot initialize audio buffer sink\n");
goto end;
}
} else {
ret = AVERROR_UNKNOWN;
goto end;

View File

@@ -29,19 +29,20 @@
#include <stdio.h>
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include <libavutil/mem.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include "libavcodec/avcodec.h"
#include <libavcodec/avcodec.h>
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/frame.h"
#include "libavutil/opt.h"
#include <libavutil/audio_fifo.h>
#include <libavutil/avassert.h>
#include <libavutil/avstring.h>
#include <libavutil/channel_layout.h>
#include <libavutil/frame.h>
#include <libavutil/opt.h>
#include "libswresample/swresample.h"
#include <libswresample/swresample.h>
/* The output bit rate in bit/s */
#define OUTPUT_BIT_RATE 96000

View File

@@ -88,6 +88,10 @@ static int encode_write(AVCodecContext *avctx, AVFrame *frame, FILE *fout)
enc_pkt->stream_index = 0;
ret = fwrite(enc_pkt->data, enc_pkt->size, 1, fout);
av_packet_unref(enc_pkt);
if (!ret) {
ret = AVERROR(errno);
break;
}
}
end:

View File

@@ -215,10 +215,8 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec)
fail:
av_frame_free(&frame);
if (ret < 0)
return ret;
}
return 0;
return ret;
}
int main(int argc, char **argv)

View File

@@ -208,6 +208,13 @@ Download/synchronize sample files to the configured samples directory.
@item fate-list
Will list all fate/regression test targets.
@item fate-list-failing
List the fate tests that failed the last time they were executed.
@item fate-clear-reports
Remove the test reports from previous test executions (getting rid of
potentially stale results from fate-list-failing).
@item fate
Run the FATE test suite (requires the fate-suite dataset).
@end table

View File

@@ -1,5 +1,5 @@
slot= # some unique identifier
repo=git://source.ffmpeg.org/ffmpeg.git # the source repository
repo=https://git.ffmpeg.org/ffmpeg.git # the source repository
#branch=release/2.6 # the branch to test
samples= # path to samples directory
workdir= # directory in which to do all the work

View File

@@ -21,22 +21,24 @@ ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_url}@}
inputs - including live grabbing/recording devices - filter, and transcode them
into a plethora of output formats.
@command{ffmpeg} reads from an arbitrary number of input "files" (which can be regular
@command{ffmpeg} reads from an arbitrary number of inputs (which can be regular
files, pipes, network streams, grabbing devices, etc.), specified by the
@code{-i} option, and writes to an arbitrary number of output "files", which are
specified by a plain output url. Anything found on the command line which
cannot be interpreted as an option is considered to be an output url.
@code{-i} option, and writes to an arbitrary number of outputs, which are
specified by a plain output url. Anything found on the command line which cannot
be interpreted as an option is considered to be an output url.
Each input or output url can, in principle, contain any number of streams of
different types (video/audio/subtitle/attachment/data). The allowed number and/or
types of streams may be limited by the container format. Selecting which
streams from which inputs will go into which output is either done automatically
or with the @code{-map} option (see the Stream selection chapter).
Each input or output can, in principle, contain any number of elementary streams
of different types (video/audio/subtitle/attachment/data), though the allowed
stream counts and/or types may be limited by the container format. Selecting
which streams from which inputs will go into which output is either done
automatically or with the @code{-map} option (see the @ref{Stream selection}
chapter).
To refer to input files in options, you must use their indices (0-based). E.g.
the first input file is @code{0}, the second is @code{1}, etc. Similarly, streams
within a file are referred to by their indices. E.g. @code{2:3} refers to the
fourth stream in the third input file. Also see the Stream specifiers chapter.
To refer to inputs/outputs in options, you must use their indices (0-based).
E.g. the first input is @code{0}, the second is @code{1}, etc. Similarly,
streams within an input/output are referred to by their indices. E.g. @code{2:3}
refers to the fourth stream in the third input or output. Also see the
@ref{Stream specifiers} chapter.
As a general rule, options are applied to the next specified
file. Therefore, order is important, and you can have the same
@@ -85,140 +87,405 @@ The format option may be needed for raw input files.
@chapter Detailed description
@c man begin DETAILED DESCRIPTION
The transcoding process in @command{ffmpeg} for each output can be described by
the following diagram:
@command{ffmpeg} builds a transcoding pipeline out of the components listed
below. The program's operation then consists of input data chunks flowing from
the sources down the pipes towards the sinks, while being transformed by the
components they encounter along the way.
The following kinds of components are available:
@itemize
@item
@emph{Demuxers} (short for "demultiplexers") read an input source in order to
extract
@itemize
@item
global properties such as metadata or chapters;
@item
list of input elementary streams and their properties
@end itemize
One demuxer instance is created for each @option{-i} option, and sends encoded
@emph{packets} to @emph{decoders} or @emph{muxers}.
In other literature, demuxers are sometimes called @emph{splitters}, because
their main function is splitting a file into elementary streams (though some
files only contain one elementary stream).
A schematic representation of a demuxer looks like this:
@verbatim
_______ ______________
| | | |
| input | demuxer | encoded data | decoder
| file | ---------> | packets | -----+
|_______| |______________| |
v
_________
| |
| decoded |
| frames |
|_________|
________ ______________ |
| | | | |
| output | <-------- | encoded data | <----+
| file | muxer | packets | encoder
|________| |______________|
┌──────────┬───────────────────────┐
│ demuxer │ │ packets for stream 0
╞══════════╡ elementary stream 0 ├──────────────────────►
│ │ │
│ global ├───────────────────────┤
│properties│ │ packets for stream 1
and │ elementary stream 1 ├──────────────────────►
│ metadata │
├───────────────────────┤
........... │
├───────────────────────┤
│ │ │ packets for stream N
│ elementary stream N ├──────────────────────►
│ │ │
└──────────┴───────────────────────┘
│ read from file, network stream,
│ grabbing device, etc.
@end verbatim
@command{ffmpeg} calls the libavformat library (containing demuxers) to read
input files and get packets containing encoded data from them. When there are
multiple input files, @command{ffmpeg} tries to keep them synchronized by
tracking lowest timestamp on any active input stream.
@item
@emph{Decoders} receive encoded (compressed) @emph{packets} for an audio, video,
or subtitle elementary stream, and decode them into raw @emph{frames} (arrays of
pixels for video, PCM for audio). A decoder is typically associated with (and
receives its input from) an elementary stream in a @emph{demuxer}, but sometimes
may also exist on its own (see @ref{Loopback decoders}).
A schematic representation of a decoder looks like this:
@verbatim
┌─────────┐
packets │ │ raw frames
─────────►│ decoder ├────────────►
│ │
└─────────┘
@end verbatim
@item
@emph{Filtergraphs} process and transform raw audio or video @emph{frames}. A
filtergraph consists of one or more individual @emph{filters} linked into a
graph. Filtergraphs come in two flavors - @emph{simple} and @emph{complex},
configured with the @option{-filter} and @option{-filter_complex} options,
respectively.
A simple filtergraph is associated with an @emph{output elementary stream}; it
receives the input to be filtered from a @emph{decoder} and sends filtered
output to that output stream's @emph{encoder}.
A simple video filtergraph that performs deinterlacing (using the @code{yadif}
deinterlacer) followed by resizing (using the @code{scale} filter) can look like
this:
@verbatim
┌────────────────────────┐
│ simple filtergraph │
frames from ╞════════════════════════╡ frames for
a decoder │ ┌───────┐ ┌───────┐ │ an encoder
────────────►├─►│ yadif ├─►│ scale ├─►│────────────►
│ └───────┘ └───────┘ │
└────────────────────────┘
@end verbatim
A complex filtergraph is standalone and not associated with any specific stream.
It may have multiple (or zero) inputs, potentially of different types (audio or
video), each of which receiving data either from a decoder or another complex
filtergraph's output. It also has one or more outputs that feed either an
encoder or another complex filtergraph's input.
The following example diagram represents a complex filtergraph with 3 inputs and
2 outputs (all video):
@verbatim
┌─────────────────────────────────────────────────┐
│ complex filtergraph │
╞═════════════════════════════════════════════════╡
frames ├───────┐ ┌─────────┐ ┌─────────┐ ┌────────┤ frames
─────────►│input 0├─►│ overlay ├─────►│ overlay ├─►│output 0├────────►
├───────┘ │ │ │ │ └────────┤
frames ├───────┐╭►│ │ ╭►│ │ │
─────────►│input 1├╯ └─────────┘ │ └─────────┘ │
├───────┘ │ │
frames ├───────┐ ┌─────┐ ┌─────┬─╯ ┌────────┤ frames
─────────►│input 2├►│scale├►│split├───────────────►│output 1├────────►
├───────┘ └─────┘ └─────┘ └────────┤
└─────────────────────────────────────────────────┘
@end verbatim
Frames from second input are overlaid over those from the first. Frames from the
third input are rescaled, then the duplicated into two identical streams. One of
them is overlaid over the combined first two inputs, with the result exposed as
the filtergraph's first output. The other duplicate ends up being the
filtergraph's second output.
@item
@emph{Encoders} receive raw audio, video, or subtitle @emph{frames} and encode
them into encoded @emph{packets}. The encoding (compression) process is
typically @emph{lossy} - it degrades stream quality to make the output smaller;
some encoders are @emph{lossless}, but at the cost of much higher output size. A
video or audio encoder receives its input from some filtergraph's output,
subtitle encoders receive input from a decoder (since subtitle filtering is not
supported yet). Every encoder is associated with some muxer's @emph{output
elementary stream} and sends its output to that muxer.
A schematic representation of an encoder looks like this:
@verbatim
┌─────────┐
raw frames │ │ packets
────────────►│ encoder ├─────────►
│ │
└─────────┘
@end verbatim
@item
@emph{Muxers} (short for "multiplexers") receive encoded @emph{packets} for
their elementary streams from encoders (the @emph{transcoding} path) or directly
from demuxers (the @emph{streamcopy} path), interleave them (when there is more
than one elementary stream), and write the resulting bytes into the output file
(or pipe, network stream, etc.).
A schematic representation of a muxer looks like this:
@verbatim
┌──────────────────────┬───────────┐
packets for stream 0 │ │ muxer │
──────────────────────►│ elementary stream 0 ╞═══════════╡
│ │ │
├──────────────────────┤ global │
packets for stream 1 │ │properties │
──────────────────────►│ elementary stream 1 │ and │
│ │ metadata │
├──────────────────────┤ │
│ │ │
│ ........... │ │
│ │ │
├──────────────────────┤ │
packets for stream N │ │ │
──────────────────────►│ elementary stream N │ │
│ │ │
└──────────────────────┴─────┬─────┘
write to file, network stream, │
grabbing device, etc. │
@end verbatim
@end itemize
@section Streamcopy
The simplest pipeline in @command{ffmpeg} is single-stream
@emph{streamcopy}, that is copying one @emph{input elementary stream}'s packets
without decoding, filtering, or encoding them. As an example, consider an input
file called @file{INPUT.mkv} with 3 elementary streams, from which we take the
second and write it to file @file{OUTPUT.mp4}. A schematic representation of
such a pipeline looks like this:
@verbatim
┌──────────┬─────────────────────┐
│ demuxer │ │ unused
╞══════════╡ elementary stream 0 ├────────╳
│ │ │
│INPUT.mkv ├─────────────────────┤ ┌──────────────────────┬───────────┐
│ │ │ packets │ │ muxer │
│ │ elementary stream 1 ├─────────►│ elementary stream 0 ╞═══════════╡
│ │ │ │ │OUTPUT.mp4 │
│ ├─────────────────────┤ └──────────────────────┴───────────┘
│ │ │ unused
│ │ elementary stream 2 ├────────╳
│ │ │
└──────────┴─────────────────────┘
@end verbatim
The above pipeline can be constructed with the following commandline:
@example
ffmpeg -i INPUT.mkv -map 0:1 -c copy OUTPUT.mp4
@end example
In this commandline
@itemize
@item
there is a single input @file{INPUT.mkv};
@item
there are no input options for this input;
@item
there is a single output @file{OUTPUT.mp4};
@item
there are two output options for this output:
@itemize
@item
@code{-map 0:1} selects the input stream to be used - from input with index 0
(i.e. the first one) the stream with index 1 (i.e. the second one);
@item
@code{-c copy} selects the @code{copy} encoder, i.e. streamcopy with no decoding
or encoding.
@end itemize
@end itemize
Streamcopy is useful for changing the elementary stream count, container format,
or modifying container-level metadata. Since there is no decoding or encoding,
it is very fast and there is no quality loss. However, it might not work in some
cases because of a variety of factors (e.g. certain information required by the
target container is not available in the source). Applying filters is obviously
also impossible, since filters work on decoded frames.
More complex streamcopy scenarios can be constructed - e.g. combining streams
from two input files into a single output:
@verbatim
┌──────────┬────────────────────┐ ┌────────────────────┬───────────┐
│ demuxer 0│ │ packets │ │ muxer │
╞══════════╡elementary stream 0 ├────────►│elementary stream 0 ╞═══════════╡
│INPUT0.mkv│ │ │ │OUTPUT.mp4 │
└──────────┴────────────────────┘ ├────────────────────┤ │
┌──────────┬────────────────────┐ │ │ │
│ demuxer 1│ │ packets │elementary stream 1 │ │
╞══════════╡elementary stream 0 ├────────►│ │ │
│INPUT1.aac│ │ └────────────────────┴───────────┘
└──────────┴────────────────────┘
@end verbatim
that can be built by the commandline
@example
ffmpeg -i INPUT0.mkv -i INPUT1.aac -map 0:0 -map 1:0 -c copy OUTPUT.mp4
@end example
The output @option{-map} option is used twice here, creating two streams in the
output file - one fed by the first input and one by the second. The single
instance of the @option{-c} option selects streamcopy for both of those streams.
You could also use multiple instances of this option together with
@ref{Stream specifiers} to apply different values to each stream, as will be
demonstrated in following sections.
A converse scenario is splitting multiple streams from a single input into
multiple outputs:
@verbatim
┌──────────┬─────────────────────┐ ┌───────────────────┬───────────┐
│ demuxer │ │ packets │ │ muxer 0 │
╞══════════╡ elementary stream 0 ├─────────►│elementary stream 0╞═══════════╡
│ │ │ │ │OUTPUT0.mp4│
│INPUT.mkv ├─────────────────────┤ └───────────────────┴───────────┘
│ │ │ packets ┌───────────────────┬───────────┐
│ │ elementary stream 1 ├─────────►│ │ muxer 1 │
│ │ │ │elementary stream 0╞═══════════╡
└──────────┴─────────────────────┘ │ │OUTPUT1.mp4│
└───────────────────┴───────────┘
@end verbatim
built with
@example
ffmpeg -i INPUT.mkv -map 0:0 -c copy OUTPUT0.mp4 -map 0:1 -c copy OUTPUT1.mp4
@end example
Note how a separate instance of the @option{-c} option is needed for every
output file even though their values are the same. This is because non-global
options (which is most of them) only apply in the context of the file before
which they are placed.
These examples can of course be further generalized into arbitrary remappings
of any number of inputs into any number of outputs.
@section Transcoding
@emph{Transcoding} is the process of decoding a stream and then encoding it
again. Since encoding tends to be computationally expensive and in most cases
degrades the stream quality (i.e. it is @emph{lossy}), you should only transcode
when you need to and perform streamcopy otherwise. Typical reasons to transcode
are:
@itemize
@item
applying filters - e.g. resizing, deinterlacing, or overlaying video; resampling
or mixing audio;
@item
you want to feed the stream to something that cannot decode the original codec.
@end itemize
Note that @command{ffmpeg} will transcode all audio, video, and subtitle streams
unless you specify @option{-c copy} for them.
Consider an example pipeline that reads an input file with one audio and one
video stream, transcodes the video and copies the audio into a single output
file. This can be schematically represented as follows
@verbatim
┌──────────┬─────────────────────┐
│ demuxer │ │ audio packets
╞══════════╡ stream 0 (audio) ├─────────────────────────────────────╮
│ │ │ │
│INPUT.mkv ├─────────────────────┤ video ┌─────────┐ raw │
│ │ │ packets │ video │ video frames │
│ │ stream 1 (video) ├─────────►│ decoder ├──────────────╮ │
│ │ │ │ │ │ │
└──────────┴─────────────────────┘ └─────────┘ │ │
▼ ▼
│ │
┌──────────┬─────────────────────┐ video ┌─────────┐ │ │
│ muxer │ │ packets │ video │ │ │
╞══════════╡ stream 0 (video) │◄─────────┤ encoder ├──────────────╯ │
│ │ │ │(libx264)│ │
│OUTPUT.mp4├─────────────────────┤ └─────────┘ │
│ │ │ │
│ │ stream 1 (audio) │◄────────────────────────────────────╯
│ │ │
└──────────┴─────────────────────┘
@end verbatim
and implemented with the following commandline:
@example
ffmpeg -i INPUT.mkv -map 0:v -map 0:a -c:v libx264 -c:a copy OUTPUT.mp4
@end example
Note how it uses stream specifiers @code{:v} and @code{:a} to select input
streams and apply different values of the @option{-c} option to them; see the
@ref{Stream specifiers} section for more details.
Encoded packets are then passed to the decoder (unless streamcopy is selected
for the stream, see further for a description). The decoder produces
uncompressed frames (raw video/PCM audio/...) which can be processed further by
filtering (see next section). After filtering, the frames are passed to the
encoder, which encodes them and outputs encoded packets. Finally, those are
passed to the muxer, which writes the encoded packets to the output file.
@section Filtering
Before encoding, @command{ffmpeg} can process raw audio and video frames using
filters from the libavfilter library. Several chained filters form a filter
graph. @command{ffmpeg} distinguishes between two types of filtergraphs:
simple and complex.
When transcoding, audio and video streams can be filtered before encoding, with
either a @emph{simple} or @emph{complex} filtergraph.
@subsection Simple filtergraphs
Simple filtergraphs are those that have exactly one input and output, both of
the same type. In the above diagram they can be represented by simply inserting
an additional step between decoding and encoding:
the same type (audio or video). They are configured with the per-stream
@option{-filter} option (with @option{-vf} and @option{-af} aliases for
@option{-filter:v} (video) and @option{-filter:a} (audio) respectively). Note
that simple filtergraphs are tied to their output stream, so e.g. if you have
multiple audio streams, @option{-af} will create a separate filtergraph for each
one.
Taking the transcoding example from above, adding filtering (and omitting audio,
for clarity) makes it look like this:
@verbatim
_________ ______________
| | | |
| decoded | | encoded data |
| frames |\ _ | packets |
|_________| \ /||______________|
\ __________ /
simple _\|| | / encoder
filtergraph | filtered |/
| frames |
|__________|
┌──────────┬───────────────┐
│ demuxer │ ┌─────────┐
╞══════════╡ video stream │ packets video │ frames
│INPUT.mkv │ ├─────────►│ decoder ├─────►───╮
│ │ │ └─────────┘ │
└──────────┴───────────────┘
╭───────────◄───────────╯
│ ┌────────────────────────┐
│ │ simple filtergraph
│ ╞════════════════════════╡
│ │ ┌───────┐ ┌───────┐ │
╰──►├─►│ yadif ├─►│ scale ├─►├╮
│ └───────┘ └───────┘ ││
└────────────────────────┘│
┌──────────┬───────────────┐ video ┌─────────┐ │
│ muxer │ │ packets │ video │ │
╞══════════╡ video stream │◄─────────┤ encoder ├───────◄───────╯
│OUTPUT.mp4│ │ │ │
│ │ │ └─────────┘
└──────────┴───────────────┘
@end verbatim
Simple filtergraphs are configured with the per-stream @option{-filter} option
(with @option{-vf} and @option{-af} aliases for video and audio respectively).
A simple filtergraph for video can look for example like this:
@verbatim
_______ _____________ _______ ________
| | | | | | | |
| input | ---> | deinterlace | ---> | scale | ---> | output |
|_______| |_____________| |_______| |________|
@end verbatim
Note that some filters change frame properties but not frame contents. E.g. the
@code{fps} filter in the example above changes number of frames, but does not
touch the frame contents. Another example is the @code{setpts} filter, which
only sets timestamps and otherwise passes the frames unchanged.
@subsection Complex filtergraphs
Complex filtergraphs are those which cannot be described as simply a linear
processing chain applied to one stream. This is the case, for example, when the graph has
more than one input and/or output, or when output stream type is different from
input. They can be represented with the following diagram:
@verbatim
_________
| |
| input 0 |\ __________
|_________| \ | |
\ _________ /| output 0 |
\ | | / |__________|
_________ \| complex | /
| | | |/
| input 1 |---->| filter |\
|_________| | | \ __________
/| graph | \ | |
/ | | \| output 1 |
_________ / |_________| |__________|
| | /
| input 2 |/
|_________|
@end verbatim
Complex filtergraphs are configured with the @option{-filter_complex} option.
Note that this option is global, since a complex filtergraph, by its nature,
cannot be unambiguously associated with a single stream or file.
The @option{-lavfi} option is equivalent to @option{-filter_complex}.
processing chain applied to one stream. This is the case, for example, when the
graph has more than one input and/or output, or when output stream type is
different from input. Complex filtergraphs are configured with the
@option{-filter_complex} option. Note that this option is global, since a
complex filtergraph, by its nature, cannot be unambiguously associated with a
single stream or file. Each instance of @option{-filter_complex} creates a new
complex filtergraph, and there can be any number of them.
A trivial example of a complex filtergraph is the @code{overlay} filter, which
has two video inputs and one video output, containing one video overlaid on top
of the other. Its audio counterpart is the @code{amix} filter.
@section Stream copy
Stream copy is a mode selected by supplying the @code{copy} parameter to the
@option{-codec} option. It makes @command{ffmpeg} omit the decoding and encoding
step for the specified stream, so it does only demuxing and muxing. It is useful
for changing the container format or modifying container-level metadata. The
diagram above will, in this case, simplify to this:
@verbatim
_______ ______________ ________
| | | | | |
| input | demuxer | encoded data | muxer | output |
| file | ---------> | packets | -------> | file |
|_______| |______________| |________|
@end verbatim
Since there is no decoding or encoding, it is very fast and there is no quality
loss. However, it might not work in some cases because of many factors. Applying
filters is obviously also impossible, since filters work on uncompressed data.
@anchor{Loopback decoders}
@section Loopback decoders
While decoders are normally associated with demuxer streams, it is also possible
to create "loopback" decoders that decode the output from some encoder and allow
@@ -229,12 +496,16 @@ successive integers starting at zero. These indices should then be used to refer
to loopback decoders in complex filtergraph link labels, as described in the
documentation for @option{-filter_complex}.
Decoding AVOptions can be passed to loopback decoders by placing them before
@code{-dec}, analogously to input/output options.
E.g. the following example:
@example
ffmpeg -i INPUT \
-map 0:v:0 -c:v libx264 -crf 45 -f null - \
-dec 0:0 -filter_complex '[0:v][dec:0]hstack[stack]' \
-threads 3 -dec 0:0 \
-filter_complex '[0:v][dec:0]hstack[stack]' \
-map '[stack]' -c:v ffv1 OUTPUT
@end example
@@ -244,17 +515,52 @@ reads an input video and
(line 2) encodes it with @code{libx264} at low quality;
@item
(line 3) decodes this encoded stream and places it side by side with the
original input video;
(line 3) decodes this encoded stream using 3 threads;
@item
(line 4) combined video is then losslessly encoded and written into
(line 4) places decoded video side by side with the original input video;
@item
(line 5) combined video is then losslessly encoded and written into
@file{OUTPUT}.
@end itemize
Such a transcoding pipeline can be represented with the following diagram:
@verbatim
┌──────────┬───────────────┐
│ demuxer │ │ ┌─────────┐ ┌─────────┐ ┌────────────────────┐
╞══════════╡ video stream │ │ video │ │ video │ │ null muxer │
│ INPUT │ ├──►│ decoder ├──┬────────►│ encoder ├─┬─►│(discards its input)│
│ │ │ └─────────┘ │ │(libx264)│ │ └────────────────────┘
└──────────┴───────────────┘ │ └─────────┘ │
╭───────◄──╯ ┌─────────┐ │
│ │loopback │ │
│ ╭─────◄──────┤ decoder ├────◄──╯
│ │ └─────────┘
│ │
│ │
│ │ ┌───────────────────┐
│ │ │complex filtergraph│
│ │ ╞═══════════════════╡
│ │ │ ┌─────────────┐ │
╰─╫─►├─►│ hstack ├─►├╮
╰─►├─►│ │ ││
│ └─────────────┘ ││
└───────────────────┘│
┌──────────┬───────────────┐ ┌─────────┐ │
│ muxer │ │ │ video │ │
╞══════════╡ video stream │◄─┤ encoder ├───────◄──────────╯
│ OUTPUT │ │ │ (ffv1) │
│ │ │ └─────────┘
└──────────┴───────────────┘
@end verbatim
@c man end DETAILED DESCRIPTION
@anchor{Stream selection}
@chapter Stream selection
@c man begin STREAM SELECTION
@@ -615,24 +921,25 @@ ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
@end example
@item -disposition[:stream_specifier] @var{value} (@emph{output,per-stream})
Sets the disposition for a stream.
Sets the disposition flags for a stream.
By default, the disposition is copied from the input stream, unless the output
stream this option applies to is fed by a complex filtergraph - in that case the
disposition is unset by default.
Default value: by default, all disposition flags are copied from the input stream,
unless the output stream this option applies to is fed by a complex filtergraph
- in that case no disposition flags are set by default.
@var{value} is a sequence of items separated by '+' or '-'. The first item may
also be prefixed with '+' or '-', in which case this option modifies the default
value. Otherwise (the first item is not prefixed) this options overrides the
default value. A '+' prefix adds the given disposition, '-' removes it. It is
also possible to clear the disposition by setting it to 0.
@var{value} is a sequence of disposition flags separated by '+' or '-'. A '+'
prefix adds the given disposition, '-' removes it. If the first flag is also
prefixed with '+' or '-', the resulting disposition is the default value
updated by @var{value}. If the first flag is not prefixed, the resulting
disposition is @var{value}. It is also possible to clear the disposition by
setting it to 0.
If no @code{-disposition} options were specified for an output file, ffmpeg will
automatically set the 'default' disposition on the first stream of each type,
automatically set the 'default' disposition flag on the first stream of each type,
when there are multiple streams of this type in the output file and no stream of
that type is already marked as default.
The @code{-dispositions} option lists the known dispositions.
The @code{-dispositions} option lists the known disposition flags.
For example, to make the second audio stream the default stream:
@example
@@ -650,6 +957,29 @@ To add an embedded cover/thumbnail:
ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
@end example
To add the 'original' and remove the 'comment' disposition flag from the first
audio stream without removing its other disposition flags:
@example
ffmpeg -i in.mkv -c copy -disposition:a:0 +original-comment out.mkv
@end example
To remove the 'original' and add the 'comment' disposition flag to the first
audio stream without removing its other disposition flags:
@example
ffmpeg -i in.mkv -c copy -disposition:a:0 -original+comment out.mkv
@end example
To set only the 'original' and 'comment' disposition flags on the first audio
stream (and remove its other disposition flags):
@example
ffmpeg -i in.mkv -c copy -disposition:a:0 original+comment out.mkv
@end example
To remove all disposition flags from the first audio stream:
@example
ffmpeg -i in.mkv -c copy -disposition:a:0 0 out.mkv
@end example
Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
@item -program [title=@var{title}:][program_num=@var{program_num}:]st=@var{stream}[:st=@var{stream}...] (@emph{output})
@@ -657,10 +987,11 @@ Not all muxers support embedded thumbnails, and those who do, only support a few
Creates a program with the specified @var{title}, @var{program_num} and adds the specified
@var{stream}(s) to it.
@item -stream_group type=@var{type}:st=@var{stream}[:st=@var{stream}][:stg=@var{stream_group}][:id=@var{stream_group_id}...] (@emph{output})
@item -stream_group [map=@var{input_file_id}=@var{stream_group}][type=@var{type}:]st=@var{stream}[:st=@var{stream}][:stg=@var{stream_group}][:id=@var{stream_group_id}...] (@emph{output})
Creates a stream group of the specified @var{type}, @var{stream_group_id} and adds the specified
@var{stream}(s) and/or previously defined @var{stream_group}(s) to it.
Creates a stream group of the specified @var{type} and @var{stream_group_id}, or by
@var{map}ping an input group, adding the specified @var{stream}(s) and/or previously
defined @var{stream_group}(s) to it.
@var{type} can be one of the following:
@table @option
@@ -717,7 +1048,7 @@ The following flags are available:
@table @option
@item recon_gain
Wether to signal if recon_gain is present as metadata in parameter blocks within frames
Whether to signal if recon_gain is present as metadata in parameter blocks within frames
@end table
@item output_gain
@@ -857,6 +1188,27 @@ all sub-mix element's @var{annotations}s
@end table
E.g. to create an scalable 5.1 IAMF file from several WAV input files
@example
ffmpeg -i front.wav -i back.wav -i center.wav -i lfe.wav
-map 0:0 -map 1:0 -map 2:0 -map 3:0 -c:a opus
-stream_group type=iamf_audio_element:id=1:st=0:st=1:st=2:st=3,
demixing=parameter_id=998,
recon_gain=parameter_id=101,
layer=ch_layout=stereo,
layer=ch_layout=5.1(side),
-stream_group type=iamf_mix_presentation:id=2:stg=0:annotations=en-us=Mix_Presentation,
submix=parameter_id=100:parameter_rate=48000|element=stg=0:parameter_id=100:annotations=en-us=Scalable_Submix|layout=sound_system=stereo|layout=sound_system=5.1(side)
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.iamf
@end example
To copy the two stream groups (Audio Element and Mix Presentation) from an input IAMF file with four
streams into an mp4 output
@example
ffmpeg -i input.iamf -c:a copy -stream_group map=0=0:st=0:st=1:st=2:st=3 -stream_group map=0=1:stg=0
-streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.mp4
@end example
@item -target @var{type} (@emph{output})
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
@@ -1021,31 +1373,62 @@ The properties where a change triggers reinitialization are,
for video, frame resolution or pixel format;
for audio, sample format, sample rate, channel count or channel layout.
@item -drop_changed[:@var{stream_specifier}] @var{integer} (@emph{input,per-stream})
This boolean option determines whether a frame with differing frame parameters mid-stream
gets dropped instead of leading to filtergraph reinitialization, as that would lead to loss
of filter state. Generally useful to avoid corrupted yet decodable packets in live streaming
inputs. Default is false.
@item -filter_threads @var{nb_threads} (@emph{global})
Defines how many threads are used to process a filter pipeline. Each pipeline
will produce a thread pool with this many threads available for parallel processing.
The default is the number of available CPUs.
@item -filter_buffered_frames @var{nb_frames} (@emph{global})
Defines the maximum number of buffered frames allowed in a filtergraph. Under
normal circumstances, a filtergraph should not buffer more than a few frames,
especially if frames are being fed to it and read from it in a balanced way
(which is the intended behavior in ffmpeg). That said, this option allows you
to limit the total number of frames buffered across all links in a filtergraph.
If more frames are generated, filtering is aborted and an error is returned.
The default value is 0, which means no limit.
@item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
Specify the preset for matching stream(s).
@item -stats (@emph{global})
Print encoding progress/statistics. It is on by default, to explicitly
disable it you need to specify @code{-nostats}.
Log encoding progress/statistics as "info"-level log (see @code{-loglevel}).
It is on by default, to explicitly disable it you need to specify @code{-nostats}.
@item -stats_period @var{time} (@emph{global})
Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
@item -print_graphs (@emph{global})
Prints execution graph details to stderr in the format set via -print_graphs_format.
@item -print_graphs_file @var{filename} (@emph{global})
Writes execution graph details to the specified file in the format set via -print_graphs_format.
@item -print_graphs_format @var{format} (@emph{global})
Sets the output format (available formats are: default, compact, csv, flat, ini, json, xml, mermaid, mermaidhtml)
The default format is json.
@item -progress @var{url} (@emph{global})
Send program-friendly progress information to @var{url}.
Progress information is written periodically and at the end of
the encoding process. It is made of "@var{key}=@var{value}" lines. @var{key}
consists of only alphanumeric characters. The last key of a sequence of
progress information is always "progress".
progress information is always "progress" with the value "continue" or "end".
The update period is set using @code{-stats_period}.
For example, log progress information to stdout:
@example
ffmpeg -progress pipe:1 -i in.mkv out.mkv
@end example
@anchor{stdin option}
@item -stdin
Enable interaction on standard input. On by default unless standard input is
@@ -1351,6 +1734,21 @@ Note that forcing too many keyframes is very harmful for the lookahead
algorithms of certain encoders: using fixed-GOP options or similar
would be more efficient.
@item -apply_cropping[:@var{stream_specifier}] @var{source} (@emph{input,per-stream})
Automatically crop the video after decoding according to file metadata.
Default is @emph{all}.
@table @option
@item none (0)
Don't apply any cropping metadata.
@item all (1)
Apply both codec and container level croppping. This is the default mode.
@item codec (2)
Apply codec level croppping.
@item container (3)
Apply container level croppping.
@end table
@item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
When doing stream copy, copy also non-key frames found at the
beginning.
@@ -1415,6 +1813,11 @@ The following options are recognized:
When @var{device} is not specified, use this option to specify the name of the kernel
driver associated with the desired device. This option is available only when
the hardware acceleration method @emph{drm} and @emph{vaapi} are enabled.
@item vendor_id
When @var{device} and @var{kernel_driver} are not specified, use this option to specify
the vendor id associated with the desired device. This option is available only when the
hardware acceleration method @emph{drm} and @emph{vaapi} are enabled and @emph{kernel_driver}
is not specified.
@end table
Examples:
@@ -1430,6 +1833,9 @@ Create a vaapi device on DirectX adapter 1.
@item -init_hw_device vaapi:,kernel_driver=i915
Create a vaapi device on a device associated with kernel driver @samp{i915}.
@item -init_hw_device vaapi:,vendor_id=0x8086
Create a vaapi device on a device associated with vendor id @samp{0x8086}.
@end table
@item vdpau
@@ -1604,6 +2010,9 @@ transcoding, without copying the frames into the system memory.
For it to work, both the decoder and the encoder must support QSV acceleration
and no filters must be used.
@item videotoolbox
Use Video Toolbox hardware acceleration.
@end table
This option has no effect if the selected hwaccel is not available or not
@@ -1691,12 +2100,21 @@ This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter optio
@table @option
@item -atag @var{fourcc/tag} (@emph{output})
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
@item -ch_layout[:@var{stream_specifier}] @var{layout} (@emph{input/output,per-stream})
Alias for @code{-channel_layout}.
@item -channel_layout[:@var{stream_specifier}] @var{layout} (@emph{input/output,per-stream})
Set the audio channel layout. For output streams it is set by default to the
input channel layout. For input streams it overrides the channel layout of the
input. Not all decoders respect the overridden channel layout. This option
also sets the channel layout for audio grabbing devices and raw demuxers
and is mapped to the corresponding demuxer option.
@item -guess_layout_max @var{channels} (@emph{input,per-stream})
If some input channel layout is not known, try to guess only if it
corresponds to at most the specified number of channels. For example, 2
tells to @command{ffmpeg} to recognize 1 channel as mono and 2 channels as
stereo but not 6 channels as 5.1. The default is to always try to guess. Use
0 to disable all guessing.
0 to disable all guessing. Using the @code{-channel_layout} option to
explicitly specify an input layout also disables guessing.
@end table
@section Subtitle options
@@ -1739,7 +2157,7 @@ Set the size of the canvas used to render subtitles.
@section Advanced options
@table @option
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][?] | @var{[linklabel]} (@emph{output})
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][:@var{view_specifier}][:?] | @var{[linklabel]} (@emph{output})
Create one or more streams in the output file. This option has two forms for
specifying the data source(s): the first selects one or more streams from some
@@ -1754,6 +2172,26 @@ only those streams that match the specifier are used (see the
A @code{-} character before the stream identifier creates a "negative" mapping.
It disables matching streams from already created mappings.
An optional @var{view_specifier} may be given after the stream specifier, which
for multiview video specifies the view to be used. The view specifier may have
one of the following formats:
@table @option
@item view:@var{view_id}
select a view by its ID; @var{view_id} may be set to 'all' to use all the views
interleaved into one stream;
@item vidx:@var{view_idx}
select a view by its index; i.e. 0 is the base view, 1 is the first non-base
view, etc.
@item vpos:@var{position}
select a view by its display position; @var{position} may be @code{left} or
@code{right}
@end table
The default for transcoding is to only use the base view, i.e. the equivalent of
@code{vidx:0}. For streamcopy, view specifiers are not supported and all views
are always copied.
A trailing @code{?} after the stream index will allow the map to be
optional: if the map matches no streams the map will be ignored instead
of failing. Note the map will still fail if an invalid input file index
@@ -1915,6 +2353,11 @@ Read input at native frame rate. This is equivalent to setting @code{-readrate 1
@item -readrate_initial_burst @var{seconds}
Set an initial read burst time, in seconds, after which @option{-re/-readrate}
will be enforced.
@item -readrate_catchup @var{speed} (@emph{input})
If either the input or output is blocked leading to actual read speed falling behind the
specified readrate, then this rate takes effect till the input catches up with the
specified readrate. Must not be lower than the primary readrate.
@item -vsync @var{parameter} (@emph{global})
@itemx -fps_mode[:@var{stream_specifier}] @var{parameter} (@emph{output,per-stream})
Set video sync method / framerate mode. vsync is applied to all output video streams
@@ -2137,15 +2580,68 @@ Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
outputs. For simple graphs -- those with one input and one output of the same
type -- see the @option{-filter} options. @var{filtergraph} is a description of
the filtergraph, as described in the ``Filtergraph syntax'' section of the
ffmpeg-filters manual.
ffmpeg-filters manual. This option may be specified multiple times - each use
creates a new complex filtergraph.
Input link labels must refer to either input streams or loopback decoders. For
input streams, use the @code{[file_index:stream_specifier]} syntax (i.e. the
same as @option{-map} uses). If @var{stream_specifier} matches multiple streams,
the first one will be used.
Inputs to a complex filtergraph may come from different source types,
distinguished by the format of the corresponding link label:
@itemize
@item
To connect an input stream, use @code{[file_index:stream_specifier]} (i.e. the
same syntax as @option{-map}). If @var{stream_specifier} matches multiple
streams, the first one will be used. For multiview video, the stream specifier
may be followed by the view specifier, see documentation for the @option{-map}
option for its syntax.
For decoders, the link label must be [dec:@var{dec_idx}], where @var{dec_idx} is
the index of the loopback decoder to be connected to given input.
@item
To connect a loopback decoder use [dec:@var{dec_idx}], where @var{dec_idx} is
the index of the loopback decoder to be connected to given input. For multiview
video, the decoder index may be followed by the view specifier, see
documentation for the @option{-map} option for its syntax.
@item
To connect an output from another complex filtergraph, use its link label. E.g
the following example:
@example
ffmpeg -i input.mkv \
-filter_complex '[0:v]scale=size=hd1080,split=outputs=2[for_enc][orig_scaled]' \
-c:v libx264 -map '[for_enc]' output.mkv \
-dec 0:0 \
-filter_complex '[dec:0][orig_scaled]hstack[stacked]' \
-map '[stacked]' -c:v ffv1 comparison.mkv
@end example
reads an input video and
@itemize
@item
(line 2) uses a complex filtergraph with one input and two outputs
to scale the video to 1920x1080 and duplicate the result to both
outputs;
@item
(line 3) encodes one scaled output with @code{libx264} and writes the result to
@file{output.mkv};
@item
(line 4) decodes this encoded stream with a loopback decoder;
@item
(line 5) places the output of the loopback decoder (i.e. the
@code{libx264}-encoded video) side by side with the scaled original input;
@item
(line 6) combined video is then losslessly encoded and written into
@file{comparison.mkv}.
@end itemize
Note that the two filtergraphs cannot be combined into one, because then there
would be a cycle in the transcoding pipeline (filtergraph output goes to
encoding, from there to decoding, then back to the same graph), and such cycles
are not allowed.
@end itemize
An unlabeled input will be connected to the first unused input stream of the
matching type.

View File

@@ -139,13 +139,6 @@ stream.
All the container format information is printed within a section with
name "FORMAT".
@item -show_format_entry @var{name}
Like @option{-show_format}, but only prints the specified entry of the
container format information, rather than all. This option may be given more
than once, then all specified entries will be shown.
This option is deprecated, use @code{show_entries} instead.
@item -show_entries @var{section_entries}
Set list of entries to show.
@@ -351,6 +344,19 @@ while other writers always print them. This option enables one to control this b
Valid values are @code{always}/@code{1}, @code{never}/@code{0} and @code{auto}/@code{-1}.
Default is @var{auto}.
@item -analyze_frames
Analyze frames and/or their side data up to the provided read interval,
providing additional information that may be useful at a stream level.
Must be paired with the @option{-show_streams} option or it will have no effect.
Currently, the additional fields provided by this option when enabled are the
@code{closed_captions} and @code{film_grain} fields.
For example, to analyze the first 20 seconds and populate these fields:
@example
ffprobe -show_streams -analyze_frames -read_intervals "%+20" INPUT
@end example
@item -bitexact
Force bitexact output, useful to produce output which is not dependent
on the specific build.

View File

@@ -129,6 +129,7 @@
<xsd:attribute name="pict_type" type="xsd:string"/>
<xsd:attribute name="interlaced_frame" type="xsd:int" />
<xsd:attribute name="top_field_first" type="xsd:int" />
<xsd:attribute name="lossless" type="xsd:int" />
<xsd:attribute name="repeat_pict" type="xsd:int" />
<xsd:attribute name="color_range" type="xsd:string"/>
<xsd:attribute name="color_space" type="xsd:string"/>
@@ -255,6 +256,7 @@
<xsd:attribute name="metadata" type="xsd:int" use="required" />
<xsd:attribute name="dependent" type="xsd:int" use="required" />
<xsd:attribute name="still_image" type="xsd:int" use="required" />
<xsd:attribute name="multilayer" type="xsd:int" use="required" />
</xsd:complexType>
<xsd:complexType name="streamType">

View File

@@ -78,7 +78,12 @@ Match the stream by stream id (e.g. PID in MPEG-TS container).
@item m:@var{key}[:@var{value}]
Matches streams with the metadata tag @var{key} having the specified value. If
@var{value} is not given, matches streams that contain the given tag with any
value.
value. The colon character ':' in @var{key} or @var{value} needs to be
backslash-escaped.
@item disp:@var{dispositions}[:@var{additional_stream_specifier}]
Matches streams with the given disposition(s). @var{dispositions} is a list of
one or more dispositions (as printed by the @option{-dispositions} option)
joined with '+'.
@item u
Matches streams with usable configuration, the codec must be defined and the
essential information such as video dimension or audio sample rate must be present.
@@ -221,6 +226,10 @@ and the "Last message repeated n times" line will be omitted.
Indicates that log output should add a @code{[level]} prefix to each message
line. This can be used as an alternative to log coloring, e.g. when dumping the
log to file.
@item time
Indicates that log lines should be prefixed with time information.
@item datetime
Indicates that log lines should be prefixed with date and time information.
@end table
Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
flag without affecting other @var{flags} or changing @var{loglevel}. When

View File

@@ -214,6 +214,7 @@ Frame scheduling
FF_FILTER_FORWARD_STATUS(inlink, outlink);
FF_FILTER_FORWARD_STATUS_ALL(inlink, filter);
FF_FILTER_FORWARD_WANTED(outlink, inlink);
FF_FILTER_FORWARD_WANTED_ANY(filter, inlink);
filter_frame
------------

File diff suppressed because it is too large Load Diff

View File

@@ -225,9 +225,26 @@ Specifies the maximum number of streams. This can be used to reject files that
would require too many resources due to a large number of streams.
@item skip_estimate_duration_from_pts @var{bool} (@emph{input})
Skip estimation of input duration when calculated using PTS.
Skip estimation of input duration if it requires an additional probing for PTS at end of file.
At present, applicable for MPEG-PS and MPEG-TS.
@item duration_probesize @var{integer} (@emph{input})
Set probing size, in bytes, for input duration estimation when it actually requires
an additional probing for PTS at end of file (at present: MPEG-PS and MPEG-TS).
It is aimed at users interested in better durations probing for itself, or indirectly
because using the concat demuxer, for example.
The typical use case is an MPEG-TS CBR with a high bitrate, high video buffering and
ending cleaning with similar PTS for video and audio: in such a scenario, the large
physical gap between the last video packet and the last audio packet makes it necessary
to read many bytes in order to get the video stream duration.
Another use case is where the default probing behaviour only reaches a single video frame which is
not the last one of the stream due to frame reordering, so the duration is not accurate.
Setting this option has a performance impact even for small files because the probing
size is fixed.
Default behaviour is a general purpose trade-off, largely adaptive, but the probing size
will not be extended to get streams durations at all costs.
Must be an integer not lesser than 1, or 0 for default behaviour.
@item strict, f_strict @var{integer} (@emph{input/output})
Specify how strictly to follow the standards. @code{f_strict} is deprecated and
should be used only via the @command{ffmpeg} tool.

View File

@@ -160,6 +160,19 @@ Go to @url{http://lame.sourceforge.net/} and follow the
instructions for installing the library.
Then pass @code{--enable-libmp3lame} to configure to enable it.
@section LCEVCdec
FFmpeg can make use of the liblcevc_dec library for LCEVC enhancement layer
decoding on supported bitstreams.
Go to @url{https://github.com/v-novaltd/LCEVCdec} and follow the instructions
for installing the library. Then pass @code{--enable-liblcevc-dec} to configure to
enable it.
@float NOTE
LCEVCdec is under the BSD-3-Clause-Clear License.
@end float
@section libilbc
iLBC is a narrowband speech codec that has been made freely available
@@ -237,6 +250,14 @@ Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
instructions for installing the library.
Then pass @code{--enable-libfdk-aac} to configure to enable it.
@subsection LC3 library
FFmpeg can make use of the Google LC3 library for LC3 decoding & encoding.
Go to @url{https://github.com/google/liblc3/} and follow the instructions for
installing the library.
Then pass @code{--enable-liblc3} to configure to enable it.
@section OpenH264
FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
@@ -604,6 +625,7 @@ library:
@item raw AMR-NB @tab @tab X
@item raw AMR-WB @tab @tab X
@item raw APAC @tab @tab X
@item raw APV @tab X @tab X
@item raw aptX @tab X @tab X
@item raw aptX HD @tab X @tab X
@item raw Bonk @tab @tab X
@@ -616,6 +638,7 @@ library:
@item raw E-AC-3 @tab X @tab X
@item raw EVC @tab X @tab X
@item raw FLAC @tab X @tab X
@item raw G.728 @tab @tab X
@item raw GSM @tab @tab X
@item raw H.261 @tab X @tab X
@item raw H.263 @tab X @tab X
@@ -874,6 +897,7 @@ following image formats are supported:
@tab fourcc: apch,apcn,apcs,apco,ap4h,ap4x
@item Apple QuickDraw @tab @tab X
@tab fourcc: qdrw
@item APV @tab @tab X
@item Argonaut Video @tab @tab X
@tab Used in some Argonaut games.
@item Asus v1 @tab X @tab X
@@ -1015,6 +1039,8 @@ following image formats are supported:
@item Kega Game Video (KGV1) @tab @tab X
@tab Kega emulator screen capture codec.
@item Lagarith @tab @tab X
@item LCEVC / MPEG-5 LCEVC / MPEG-5 Part 2 @tab @tab E
@tab decoding supported through external library liblcevc-dec
@item LCL (LossLess Codec Library) MSZH @tab @tab X
@item LCL (LossLess Codec Library) ZLIB @tab E @tab E
@item LEAD MCMP @tab @tab X
@@ -1086,6 +1112,7 @@ following image formats are supported:
@item RealVideo 3.0 @tab @tab X
@tab still far from ideal
@item RealVideo 4.0 @tab @tab X
@item RealVideo 6.0 @tab @tab X
@item Renderware TXD (TeXture Dictionary) @tab @tab X
@tab Texture dictionaries used by the Renderware Engine.
@item RivaTuner Video @tab @tab X
@@ -1209,6 +1236,7 @@ following image formats are supported:
@item ADPCM IMA Duck DK4 @tab @tab X
@tab Used in some Sega Saturn console games.
@item ADPCM IMA Radical @tab @tab X
@item ADPCM IMA Xbox @tab @tab X
@item ADPCM Microsoft @tab X @tab X
@item ADPCM MS IMA @tab X @tab X
@item ADPCM Nintendo Gamecube AFC @tab @tab X
@@ -1216,6 +1244,7 @@ following image formats are supported:
@item ADPCM Nintendo THP @tab @tab X
@item ADPCM Playstation @tab @tab X
@item ADPCM QT IMA @tab X @tab X
@item ADPCM Sanyo @tab @tab X
@item ADPCM SEGA CRI ADX @tab X @tab X
@tab Used in Sega Dreamcast games.
@item ADPCM Shockwave Flash @tab X @tab X
@@ -1290,6 +1319,7 @@ following image formats are supported:
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
@item FTR Voice @tab @tab X
@item G.723.1 @tab X @tab X
@item G.728 @tab @tab X
@item G.729 @tab @tab X
@item GSM @tab E @tab X
@tab encoding supported through external library libgsm
@@ -1300,7 +1330,8 @@ following image formats are supported:
@tab encoding and decoding supported through external library libilbc
@item IMC (Intel Music Coder) @tab @tab X
@item Interplay ACM @tab @tab X
@item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X
@item LC3 @tab E @tab E
@tab supported through external library liblc3
@item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X
@item Marian's A-pac audio @tab @tab X
@item MI-SC4 (Micronas SC-4 Audio) @tab @tab X

View File

@@ -71,7 +71,6 @@ git clone git@@ffmpeg.org:ffmpeg-web <target>
This will put the source of the FFmpeg website into the directory
@var{<target>} and let you push back your changes to the remote repository.
(Note that @var{gil} stands for GItoLite and is not a typo of @var{git}.)
If you don't have write-access to the ffmpeg-web repository, you can
create patches after making a read-only ffmpeg-web clone:
@@ -143,7 +142,7 @@ git log <filename(s)>
@end example
You may also use the graphical tools like @command{gitview} or @command{gitk}
or the web interface available at @url{http://source.ffmpeg.org/}.
or the web interface available at @url{https://git.ffmpeg.org/ffmpeg.git}.
@section Checking source tree status

6
doc/htmlxref.cnf Normal file
View File

@@ -0,0 +1,6 @@
ffmpeg mono ./ffmpeg.html
ffmpeg-filters mono ./ffmpeg-filters.html
ffmpeg-formats mono ./ffmpeg-formats.html
ffmpeg-resampler mono ./ffmpeg-resampler.html
ffmpeg-scaler mono ./ffmpeg-scaler.html
ffmpeg-utils mono ./ffmpeg-utils.html

View File

@@ -220,41 +220,6 @@ $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
@end itemize
@section bktr
BSD video input device. Deprecated and will be removed - please contact
the developers if you are interested in maintaining it.
@subsection Options
@table @option
@item framerate
Set the frame rate.
@item video_size
Set the video frame size. Default is @code{vga}.
@item standard
Available values are:
@table @samp
@item pal
@item ntsc
@item secam
@item paln
@item palm
@item ntscj
@end table
@end table
@section decklink
The decklink input device provides capture capabilities for Blackmagic
@@ -396,6 +361,22 @@ Defaults to @samp{audio}.
@item draw_bars
If set to @samp{true}, color bars are drawn in the event of a signal loss.
Defaults to @samp{true}.
This option is deprecated, please use the @code{signal_loss_action} option.
@item signal_loss_action
Sets the action to take in the event of a signal loss. Accepts one of the
following values:
@table @option
@item 1, none
Do nothing on signal loss. This usually results in black frames.
@item 2, bars
Draw color bars on signal loss. Only supported for 8-bit input signals.
@item 3, repeat
Repeat the last video frame on signal loss.
@end table
Defaults to @samp{bars}.
@item queue_size
Sets maximum input buffer size in bytes. If the buffering reaches this value,
@@ -723,7 +704,7 @@ Win32 GDI-based screen capture device.
This device allows you to capture a region of the display on Windows.
Amongst options for the imput filenames are such elements as:
Amongst options for the input filenames are such elements as:
@example
desktop
@end example
@@ -1069,9 +1050,9 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
@end example
@item
Dump decoded frames to images and closed captions to a file (experimental):
Dump decoded frames to images and Closed Captions to an RCWT backup:
@example
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rcwt subcc.bin
@end example
@end itemize

View File

@@ -1,8 +1,18 @@
FFmpeg Infrastructure:
======================
Trademark:
~~~~~~~~~~
ffmpeg trademark registered in france by ffmpeg creator.
Domain + NS:
~~~~~~~~~~~~
ffmpeg.org domain name
ns1.avcodec.org Primary Name server (provided by Telepoint, hosted at Telepoint in bulgaria)
ns2.avcodec.org Replica Name server (provided by an ffmpeg developer, hosted at Hetzner in germany)
ns3.avcodec.org Replica Name server (provided by an ffmpeg developer, hosted at Prometeus Cdlan in italy)
Servers:
~~~~~~~~
@@ -23,6 +33,8 @@ Web, mail, and public facing git, also website git
fftrac VM:
----------
trac.ffmpeg.org Issue tracking
gpg encrypted backups of the trac repositories are created once a day
and can be downloaded by any of the admins.
ffaux VM:
@@ -65,6 +77,9 @@ Github mirrors are redundantly synced by multiple people
You need a new git repository related to FFmpeg ? contact root at ffmpeg.org
git repositories are managed by gitolite, every change to permissions is
logged, including when, what and by whom
Fate:
~~~~~
@@ -87,8 +102,47 @@ You need a VM, docker container for FFmpeg? contact root at ffmpeg.org
Multimedia Wiki:
~~~~~~~~~~~~~~~~
The Multimedia Wiki http://wiki.multimedia.cx is ran by Mike Melanson.
While not directly part of FFmpeg infrastructure, technical codec and format
information written by FFmpeg developers can be found within.
It is our unofficial official tech wiki. For access contact Mike.
IRC:
~~~~
irc channels are at https://libera.chat/
irc channel archives are at https://libera.irclog.whitequark.org
#ffmpeg and #ffmpeg-devel founder/admins: BtbN, Michael, Compn
#ffmpeg-meeting founder/admins: BtbN, Michael
Twitter aka X:
~~~~~~~~~~~~~~
https://twitter.com/FFmpeg or https://x.com/FFmpeg
If you would like to post to twitter please contact twitter MAINTAINERS
for access. We want more developers posting to twitter!
Reddit:
~~~~~~~
https://www.reddit.com/r/ffmpeg/
moderated by Gyan
Facebook:
~~~~~~~~~
https://www.facebook.com/ffmpeg
???
Wikipedia entry:
~~~~~~~~~~~~~~~~
https://en.wikipedia.org/wiki/FFmpeg

View File

@@ -1,115 +0,0 @@
CONTEXT
=======
The FFmpeg project merges all the changes from the Libav project
(https://libav.org) since the origin of the fork (around 2011).
With the exceptions of some commits due to technical/political disagreements or
issues, the changes are merged on a more or less regular schedule (daily for
years thanks to Michael, but more sparse nowadays).
WHY
===
The majority of the active developers believe the project needs to keep this
policy for various reasons.
The most important one is that we don't want our users to have to choose
between two distributors of libraries of the exact same name in order to have a
different set of features and bugfixes. By taking the responsibility of
unifying the two codebases, we allow users to benefit from the changes from the
two teams.
Today, FFmpeg has a much larger user database (we are distributed by every
major distribution), so we consider this mission a priority.
A different approach to the merge could have been to pick the changes we are
interested in and drop most of the cosmetics and other less important changes.
Unfortunately, this makes the following picks much harder, especially since the
Libav project is involved in various deep API changes. As a result, we decide
to virtually take everything done there.
Any Libav developer is of course welcome anytime to contribute directly to the
FFmpeg tree. Of course, we fully understand and are forced to accept that very
few Libav developers are interested in doing so, but we still want to recognize
their work. This leads us to create merge commits for every single one from
Libav. The original commit appears totally unchanged with full authorship in
our history (and the conflict are solved in the merge one). That way, not a
single thing from Libav will be lost in the future in case some reunification
happens, or that project disappears one way or another.
DOWNSIDES
=========
Of course, there are many downsides to this approach.
- It causes a non negligible merge commits pollution. We make sure there are
not several level of merges entangled (we do a 1:1 merge/commit), but it's
still a non-linear history.
- Many duplicated work. For instance, we added libavresample in our tree to
keep compatibility with Libav when our libswresample was already covering the
exact same purpose. The same thing happened for various elements such as the
ProRes support (but differences in features, bugs, licenses, ...). There are
many work to do to unify them, and any help is very much welcome.
- So much manpower from both FFmpeg and Libav is lost because of this mess. We
know it, and we don't know how to fix it. It takes incredible time to do
these merges, so we have even less time to work on things we personally care
about. The bad vibes also do not help with keeping our developers motivated.
- There is a growing technical risk factor with the merges due to the codebase
differing more and more.
MERGE GUIDELINES
================
The following gives developer guidelines on how to proceed when merging Libav commits.
Before starting, you can reduce the risk of errors on merge conflicts by using
a different merge conflict style:
$ git config --global merge.conflictstyle diff3
tools/libav-merge-next-commit is a script to help merging the next commit in
the queue. It assumes a remote named libav. It has two modes: merge, and noop.
The noop mode creates a merge with no change to the HEAD. You can pass a hash
as extra argument to reference a justification (it is common that we already
have the change done in FFmpeg).
Also see tools/murge, you can copy and paste a 3 way conflict into its stdin
and it will display colored diffs. Any arguments to murge (like ones to suppress
whitespace differences) are passed into colordiff.
TODO/FIXME/UNMERGED
===================
Stuff that didn't reach the codebase:
-------------------------------------
- HEVC DSP and x86 MC SIMD improvements from Libav (see https://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/184777.html)
- 1f821750f hevcdsp: split the qpel functions by width instead of by the subpixel fraction
- 818bfe7f0 hevcdsp: split the epel functions by width
- 688417399 hevcdsp: split the pred functions by width
- a853388d2 hevc: change the stride of the MC buffer to be in bytes instead of elements
- 0cef06df0 checkasm: add HEVC MC tests
- e7078e842 hevcdsp: add x86 SIMD for MC
- 7993ec19a hevc: Add hevc_get_pixel_4/8/12/16/24/32/48/64
- use av_cpu_max_align() instead of hardcoding alignment requirements (see https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215834.html)
- f44ec22e0 lavc: use av_cpu_max_align() instead of hardcoding alignment requirements
- 4de220d2e frame: allow align=0 (meaning automatic) for av_frame_get_buffer()
- Support recovery from an already present HLS playlist (see 16cb06bb30)
- Remove all output devices (see 8e7e042d41, 8d3db95f20, 6ce13070bd, d46cd24986 and https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/216904.html)
- avcodec/libaomenc: export the Sequence Header OBU as extradata (See a024c3ce9a)
Collateral damage that needs work locally:
------------------------------------------
- Merge proresenc_anatoliy.c and proresenc_kostya.c
- Fix MIPS AC3 downmix
Extra changes needed to be aligned with Libav:
----------------------------------------------
- Switching our examples to the new encode/decode API (see 67d28f4a0f)
- HEVC IDCT bit depth 12-bit support (Libav added 8 and 10 but doesn't have 12)

View File

@@ -157,9 +157,6 @@ Perform a site search using your favorite search engine. Example:
You can ask for help in the official @t{#ffmpeg} IRC channel on Libera Chat.
Some users prefer the third-party @url{http://www.ffmpeg-archive.org/, Nabble}
interface which presents the mailing lists in a typical forum layout.
There are also numerous third-party help sites such as
@url{https://superuser.com/tags/ffmpeg, Super User} and
@url{https://www.reddit.com/r/ffmpeg/, r/ffmpeg on reddit}.

View File

@@ -49,11 +49,6 @@ Files that have MIPS copyright notice in them:
libm_mips.h
softfloat_tables.h
* libavcodec/mips/
aacdec_fixed.c
aacsbr_fixed.c
aacsbr_template.c
aaccoder_mips.c
aacpsy_mips.h
ac3dsp_mips.c
acelp_filters_mips.c
acelp_vectors_mips.c
@@ -64,8 +59,6 @@ Files that have MIPS copyright notice in them:
compute_antialias_fixed.h
compute_antialias_float.h
lsp_mips.h
dsputil_mips.c
fmtconvert_mips.c
iirfilter_mips.c
mpegaudiodsp_mips_fixed.c
mpegaudiodsp_mips_float.c

View File

@@ -36,9 +36,9 @@ Frame threading -
* Codecs similar to ffv1, whose streams don't reset across frames,
will not work because their bitstreams cannot be decoded in parallel.
* The contents of buffers must not be read before ff_thread_await_progress()
* The contents of buffers must not be read before ff_progress_frame_await()
has been called on them. reget_buffer() and buffer age optimizations no longer work.
* The contents of buffers must not be written to after ff_thread_report_progress()
* The contents of buffers must not be written to after ff_progress_frame_report()
has been called on them. This includes draw_edges().
Porting codecs to frame threading
@@ -53,14 +53,13 @@ thread.
Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
speed gain at this point but it should work.
If there are inter-frame dependencies, so the codec calls
ff_thread_report/await_progress(), set FF_CODEC_CAP_ALLOCATE_PROGRESS in
FFCodec.caps_internal and use ff_thread_get_buffer() to allocate frames.
Otherwise decode directly into the user-supplied frames.
Use ff_thread_get_buffer() (or ff_progress_frame_get_buffer()
in case you have inter-frame dependencies and use the ProgressFrame API)
to allocate frame buffers.
Call ff_thread_report_progress() after some part of the current picture has decoded.
Call ff_progress_frame_report() after some part of the current picture has decoded.
A good place to put this is where draw_horiz_band() is called - add this if it isn't
called anywhere, as it's useful too and the implementation is trivial when you're
doing this. Note that draw_edges() needs to be called before reporting progress.
Before accessing a reference frame or its MVs, call ff_thread_await_progress().
Before accessing a reference frame or its MVs, call ff_progress_frame_await().

File diff suppressed because it is too large Load Diff

View File

@@ -157,4 +157,3 @@ PFD[32] would for example be signed 32 bit little-endian IEEE float
@item XVID @tab non-compliant MPEG-4 generated by old Xvid
@item XVIX @tab non-compliant MPEG-4 generated by old Xvid with interlacing bug
@end multitable

View File

@@ -188,7 +188,7 @@ Code that depends on data in registries being untouched, should be written as
a single __asm__() statement. Ideally, a single function contains only one
__asm__() block.
Use external asm (nasm/yasm) or inline asm (__asm__()), do not use intrinsics.
Use external asm (nasm) or inline asm (__asm__()), do not use intrinsics.
The latter requires a good optimizing compiler which gcc is not.
When debugging a x86 external asm compilation issue, if lost in the macro
@@ -199,7 +199,7 @@ actual lines causing issues.
Inline asm vs. external asm
---------------------------
Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc)
and external asm (.s or .asm files, handled by an assembler such as nasm/yasm)
and external asm (.s or .asm files, handled by an assembler such as nasm)
are accepted in FFmpeg. Which one to use differs per specific case.
- if your code is intended to be inlined in a C function, inline asm is always

View File

@@ -301,45 +301,6 @@ ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
@section opengl
OpenGL output device. Deprecated and will be removed.
To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
This output device allows one to render to OpenGL context.
Context may be provided by application or default SDL window is created.
When device renders to external context, application must implement handlers for following messages:
@code{AV_DEV_TO_APP_CREATE_WINDOW_BUFFER} - create OpenGL context on current thread.
@code{AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER} - make OpenGL context current.
@code{AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER} - swap buffers.
@code{AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER} - destroy OpenGL context.
Application is also required to inform a device about current resolution by sending @code{AV_APP_TO_DEV_WINDOW_SIZE} message.
@subsection Options
@table @option
@item background
Set background color. Black is a default.
@item no_window
Disables default SDL window when set to non-zero value.
Application must provide OpenGL context and both @code{window_size_cb} and @code{window_swap_buffers_cb} callbacks when set.
@item window_title
Set the SDL window title, if not specified default to the filename specified for the output device.
Ignored when @option{no_window} is set.
@item window_size
Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
Mostly usable when @option{no_window} is not set.
@end table
@subsection Examples
Play a file on SDL window using OpenGL rendering:
@example
ffmpeg -i INPUT -f opengl "window title"
@end example
@section oss
OSS (Open Sound System) output device.
@@ -406,78 +367,6 @@ Play a file on default device on default server:
ffmpeg -i INPUT -f pulse "stream name"
@end example
@section sdl
SDL (Simple DirectMedia Layer) output device. Deprecated and will be removed.
For monitoring purposes in FFmpeg, pipes and a video player such as ffplay can be used:
@example
ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -
@end example
"sdl2" can be used as alias for "sdl".
This output device allows one to show a video stream in an SDL
window. Only one SDL window is allowed per application, so you can
have only one instance of this output device in an application.
To enable this output device you need libsdl installed on your system
when configuring your build.
For more information about SDL, check:
@url{http://www.libsdl.org/}
@subsection Options
@table @option
@item window_borderless
Set SDL window border off.
Default value is 0 (enable window border).
@item window_enable_quit
Enable quit action (using window button or keyboard key)
when non-zero value is provided.
Default value is 1 (enable quit action).
@item window_fullscreen
Set fullscreen mode when non-zero value is provided.
Default value is zero.
@item window_size
Set the SDL window size, can be a string of the form
@var{width}x@var{height} or a video size abbreviation.
If not specified it defaults to the size of the input video,
downscaled according to the aspect ratio.
@item window_title
Set the SDL window title, if not specified default to the filename
specified for the output device.
@item window_x
@item window_y
Set the position of the window on the screen.
@end table
@subsection Interactive commands
The window created by the device can be controlled through the
following interactive commands.
@table @key
@item q, ESC
Quit the device immediately.
@end table
@subsection Examples
The following command shows the @command{ffmpeg} output is an
SDL window, forcing its size to the qcif format:
@example
ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
@end example
@section sndio
sndio audio output device.

View File

@@ -158,7 +158,7 @@ You will need the following prerequisites:
To set up a proper environment in MSYS2, you need to run @code{msys_shell.bat} from
the Visual Studio or Intel Compiler command prompt.
Place @code{yasm.exe} somewhere in your @code{PATH}.
Place @code{nasm.exe} somewhere in your @code{PATH}.
Next, make sure any other headers and libs you want to use, such as zlib, are
located in a spot that the compiler can see. Do so by modifying the @code{LIB}
@@ -301,7 +301,7 @@ These library packages are only available from
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
@example
yasm, libSDL-devel, libgsm-devel, libmp3lame-devel,
libSDL-devel, libgsm-devel, libmp3lame-devel,
speex-devel, libtheora-devel, libxvidcore-devel
@end example

View File

@@ -71,7 +71,7 @@ client may also set a user/password for authentication. The default for both
fields is "guest". Name of virtual host on broker can be set with vhost. The
default value is "/".
Muliple subscribers may stream from the broker using the command:
Multiple subscribers may stream from the broker using the command:
@example
ffplay amqp://[[user]:[password]@@]hostname[:port][/vhost]
@end example
@@ -442,9 +442,6 @@ value is -1.
@item chunked_post
If set to 1 use chunked Transfer-Encoding for posts, default is 1.
@item content_type
Set a specific content type for the POST messages or for listen mode.
@item http_proxy
set HTTP proxy to tunnel through e.g. http://example.com:1234
@@ -452,42 +449,33 @@ set HTTP proxy to tunnel through e.g. http://example.com:1234
Set custom HTTP headers, can override built in default headers. The
value must be a string encoding the headers.
@item content_type
Set a specific content type for the POST messages or for listen mode.
@item user_agent
Override the User-Agent header. If not specified the protocol will use a
string describing the libavformat build. ("Lavf/<version>")
@item referer
Set the Referer header. Include 'Referer: URL' header in HTTP request.
@item multiple_requests
Use persistent connections if set to 1, default is 0.
@item post_data
Set custom HTTP post data.
@item referer
Set the Referer header. Include 'Referer: URL' header in HTTP request.
@item user_agent
Override the User-Agent header. If not specified the protocol will use a
string describing the libavformat build. ("Lavf/<version>")
@item reconnect_at_eof
If set then eof is treated like an error and causes reconnection, this is useful
for live / endless streams.
@item reconnect_streamed
If set then even streamed/non seekable streams will be reconnected on errors.
@item reconnect_on_network_error
Reconnect automatically in case of TCP/TLS errors during connect.
@item reconnect_on_http_error
A comma separated list of HTTP status codes to reconnect on. The list can
include specific status codes (e.g. '503') or the strings '4xx' / '5xx'.
@item reconnect_delay_max
Sets the maximum delay in seconds after which to give up reconnecting
@item mime_type
Export the MIME type.
@item http_version
Exports the HTTP response version number. Usually "1.0" or "1.1".
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
@item icy
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
supports this, the metadata has to be retrieved by the application by reading
@@ -504,10 +492,40 @@ contains the last non-empty metadata packet sent by the server. It should be
polled in regular intervals by applications interested in mid-stream metadata
updates.
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
@item metadata
Set an exported dictionary containing Icecast metadata from the bitstream, if present.
Only useful with the C API.
@item auth_type
Set HTTP authentication type. No option for Digest, since this method requires
getting nonce parameters from the server first and can't be used straight away like
Basic.
@table @option
@item none
Choose the HTTP authentication type automatically. This is the default.
@item basic
Choose the HTTP basic authentication.
Basic authentication sends a Base64-encoded string that contains a user name and password
for the client. Base64 is not a form of encryption and should be considered the same as
sending the user name and password in clear text (Base64 is a reversible encoding).
If a resource needs to be protected, strongly consider using an authentication scheme
other than basic authentication. HTTPS/TLS should be used with basic authentication.
Without these additional security enhancements, basic authentication should not be used
to protect sensitive or valuable information.
@end table
@item send_expect_100
Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
to 0 it won't, if set to -1 it will try to send if it is applicable. Default
value is -1.
@item location
An exported dictionary containing the content location. Only useful with the C
API.
@item offset
Set initial byte offset.
@@ -525,6 +543,37 @@ be given a Bad Request response.
When unset the HTTP method is not checked for now. This will be replaced by
autodetection in the future.
@item reconnect
Reconnect automatically when disconnected before EOF is hit.
@item reconnect_at_eof
If set then eof is treated like an error and causes reconnection, this is useful
for live / endless streams.
@item reconnect_on_network_error
Reconnect automatically in case of TCP/TLS errors during connect.
@item reconnect_on_http_error
A comma separated list of HTTP status codes to reconnect on. The list can
include specific status codes (e.g. '503') or the strings '4xx' / '5xx'.
@item reconnect_streamed
If set then even streamed/non seekable streams will be reconnected on errors.
@item reconnect_delay_max
Set the maximum delay in seconds after which to give up reconnecting.
@item reconnect_max_retries
Set the maximum number of times to retry a connection. Default unset.
@item reconnect_delay_total_max
Set the maximum total delay in seconds after which to give up reconnecting.
@item respect_retry_after
If enabled, and a Retry-After header is encountered, its requested reconnection
delay will be honored, rather than using exponential backoff. Useful for 429 and
503 errors. Default enabled.
@item listen
If set to 1 enables experimental HTTP server. This can be used to send data when
used as an output option, or read data from a client with HTTP POST when used as
@@ -551,32 +600,16 @@ ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{p
wget --post-file=somefile.ogg http://@var{server}:@var{port}
@end example
@item send_expect_100
Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
to 0 it won't, if set to -1 it will try to send if it is applicable. Default
value is -1.
@item resource
The resource requested by a client, when the experimental HTTP server is in use.
@item auth_type
@item reply_code
The HTTP code returned to the client, when the experimental HTTP server is in use.
Set HTTP authentication type. No option for Digest, since this method requires
getting nonce parameters from the server first and can't be used straight away like
Basic.
@table @option
@item none
Choose the HTTP authentication type automatically. This is the default.
@item basic
Choose the HTTP basic authentication.
Basic authentication sends a Base64-encoded string that contains a user name and password
for the client. Base64 is not a form of encryption and should be considered the same as
sending the user name and password in clear text (Base64 is a reversible encoding).
If a resource needs to be protected, strongly consider using an authentication scheme
other than basic authentication. HTTPS/TLS should be used with basic authentication.
Without these additional security enhancements, basic authentication should not be used
to protect sensitive or valuable information.
@end table
@item short_seek_size
Set the threshold, in bytes, for when a readahead should be preferred over a seek and
new HTTP request. This is useful, for example, to make sure the same connection
is used for reading large video packets with small audio packets in between.
@end table
@@ -1117,10 +1150,15 @@ ffplay "rtmp://myserver/live/mystream live=1"
Real-time Transport Protocol.
The required syntax for an RTP URL is:
rtp://@var{hostname}[:@var{port}][?@var{option}=@var{val}...]
@example
rtp://@var{hostname}[:@var{port}][?@var{options}]
@end example
@var{port} specifies the RTP port to use.
@var{options} contains a list of &-separated options of the form
@var{key}=@var{val}.
The following URL options are supported:
@table @option
@@ -1160,16 +1198,15 @@ set to 1) or to a default remote address (if set to 0).
@item localport=@var{n}
Set the local RTP port to @var{n}.
This is a deprecated option. Instead, @option{localrtpport} should be
used.
@item localaddr=@var{addr}
Local IP address of a network interface used for sending packets or joining
multicast groups.
@item timeout=@var{n}
Set timeout (in microseconds) of socket I/O operations to @var{n}.
This is a deprecated option. Instead, @option{localrtpport} should be
used.
@end table
Important notes:

View File

@@ -96,6 +96,9 @@ If value is set to @code{1}, indicates source is full range. Default value is
If value is set to @code{1}, enable full range for destination. Default value
is @code{0}, which enables limited range.
@item gamma @var{(boolean)}
If value is set to @code{1}, enable gamma correct scaling. Default value is @code{0}.
@anchor{sws_params}
@item param0, param1
Set scaling algorithm parameters. The specified values are specific of

2
doc/style.min.css vendored

File diff suppressed because one or more lines are too long

344
doc/swscale-v2.txt Normal file
View File

@@ -0,0 +1,344 @@
New swscale design to change everything (tm)
============================================
SwsGraph
--------
The entry point to the new architecture, SwsGraph is what coordinates
multiple "passes". These can include cascaded scaling passes, error diffusion
dithering, and so on. Or we could have separate passes for the vertical and
horizontal scaling. In between each SwsPass lies a fully allocated image buffer.
Graph passes may have different levels of threading, e.g. we can have a single
threaded error diffusion pass following a multi-threaded scaling pass.
SwsGraph is internally recreated whenever the image format, dimensions or
settings change in any way. sws_scale_frame() is itself just a light-weight
wrapper that runs ff_sws_graph_create() whenever the format changes, splits
interlaced images into separate fields, and calls ff_sws_graph_run() on each.
From the point of view of SwsGraph itself, all inputs are progressive.
SwsOp / SwsOpList
-----------------
This is the newly introduced abstraction layer between the high-level format
handling logic and the low-level backing implementation. Each SwsOp is designed
to be as small and atomic as possible, with the possible exception of the
read / write operations due to their numerous variants.
The basic idea is to split logic between three major components:
1. The high-level format "business logic", which generates in a very
naive way a sequence of operations guaranteed to get you from point A
to point B. This logic is written with correctness in mind only, and
ignoring any performance concerns or low-level implementation decisions.
Semantically, everything is always decoded from the input format to
normalized (real valued) RGB, and then encoded back to output format.
This code lives in libswscale/format.c
2. The optimizer. This is where the "magic" happens, so to speak. The
optimizer's job is to take the abstract sequence of operations
produced by the high-level format analysis code and incrementally
optimize it. Each optimization step is designed to be minute and provably
lossless, or otherwise guarded behind the BITEXACT flag. This ensures that
the resulting output is always identical, no matter how many layers of
optimization we add.
This code lives in libswscale/ops.c
3. The compiler. Once we have a sequence of operations as output by the
optimizer, we "compile" this down to a callable function. This is then
applied by the dispatch wrapper by striping it over the input image.
See libswscale/ops_backend.c for the reference backend, or
libswscale/x86/ops.c for a more complex SIMD example.
This overall approach has a considerable number of benefits:
1. It allows us to verify correctness of logic and spot semantic errors at a
very high level, by simply looking at the sequence of operations (available
by default at debug / verbose log level), without having to dig through the
multiple levels of complicated, interwoven format handling code that is
legacy swscale.
2. Because most of the brains lives inside the the powerful optimizer, we get
fast paths "for free" for any suitable format conversion, rather than having
to enumerate them one by one. SIMD code itself can be written in a very
general way and does need to be tied to specific pixel formats - subsequent
low-level implementations can be strung together without much overhead.
3. We can in the future, with relative ease, compile these operations
down to SPIR-V (or even LLVM IR) and generate efficient GPU or
target-machine specific implementations. This also opens the window for
adding hardware frame support to libswscale, and even transparently using
GPU acceleration for CPU frames.
4. Platform-specific SIMD can be reduced down to a comparatively small set of
optimized routines, while still providing 100% coverage for all possible
pixel formats and operations. (As of writing, the x86 example backend has
about 60 unique implementations, of which 20 are trivial swizzles, 10 are
read/write ops, 10 are pixel type conversions and the remaining 20 are the
various logic/arithmetic ops).
5. Backends hide behind a layer of abstraction offering them a considerable
deal of flexibility in how they want to implement their operations. For
example, the x86 backend has a dedicated function for compiling compatible
operations down to a single in-place pshufb instruction.
Platform specific low level data is self-contained within its own setup()
function and private data structure, eliminating all reads into SwsContext
or the possibility of conflicts between platforms.
6. We can compute an exact reference result for each operation with fixed
precision (ff_sws_op_apply_q), and use that to e.g. measure the amount of
error introduced by dithering, or even catch bugs in the reference C
implementation. (In theory - currently checkasm just compares against C)
Examples of SwsOp in action
---------------------------
For illustration, here is the sequence of operations currently generated by
my prototype, for a conversion from RGB24 to YUV444P:
Unoptimized operation list:
[ u8 .... -> ....] SWS_OP_READ : 3 elem(s) packed >> 0
[ u8 .... -> ....] SWS_OP_SWIZZLE : 0123
[ u8 .... -> ....] SWS_OP_RSHIFT : >> 0
[ u8 .... -> ....] SWS_OP_CLEAR : {_ _ _ 0}
[ u8 .... -> ....] SWS_OP_CONVERT : u8 -> f32
[f32 .... -> ....] SWS_OP_LINEAR : diag3+alpha [[1/255 0 0 0 0] [0 1/255 0 0 0] [0 0 1/255 0 0] [0 0 0 1 1]]
[f32 .... -> ....] SWS_OP_LINEAR : matrix3 [[0.299000 0.587000 0.114000 0 0] [-0.168736 -0.331264 1/2 0 0] [1/2 -0.418688 -57/701 0 0] [0 0 0 1 0]]
[f32 .... -> ....] SWS_OP_LINEAR : diag3+off3 [[219 0 0 0 16] [0 224 0 0 128] [0 0 224 0 128] [0 0 0 1 0]]
[f32 .... -> ....] SWS_OP_DITHER : 16x16 matrix
[f32 .... -> ....] SWS_OP_MAX : {0 0 0 0} <= x
[f32 .... -> ....] SWS_OP_MIN : x <= {255 255 255 _}
[f32 .... -> ....] SWS_OP_CONVERT : f32 -> u8
[ u8 .... -> ....] SWS_OP_LSHIFT : << 0
[ u8 .... -> ....] SWS_OP_SWIZZLE : 0123
[ u8 .... -> ....] SWS_OP_WRITE : 3 elem(s) planar >> 0
This is optimized into the following sequence:
Optimized operation list:
[ u8 XXXX -> +++X] SWS_OP_READ : 3 elem(s) packed >> 0
[ u8 ...X -> +++X] SWS_OP_CONVERT : u8 -> f32
[f32 ...X -> ...X] SWS_OP_LINEAR : matrix3+off3 [[0.256788 0.504129 0.097906 0 16] [-0.148223 -0.290993 112/255 0 128] [112/255 -0.367788 -0.071427 0 128] [0 0 0 1 0]]
[f32 ...X -> ...X] SWS_OP_DITHER : 16x16 matrix
[f32 ...X -> +++X] SWS_OP_CONVERT : f32 -> u8
[ u8 ...X -> +++X] SWS_OP_WRITE : 3 elem(s) planar >> 0
(X = unused, + = exact, 0 = zero)
The extra metadata on the left of the operation list is just a dump of the
internal state used by the optimizer during optimization. It keeps track of
knowledge about the pixel values, such as their value range, whether or not
they're exact integers, and so on.
In this example, you can see that the input values are exact (except for
the alpha channel, which is undefined), until the first SWS_OP_LINEAR
multiplies them by a noninteger constant. They regain their exact integer
status only after the (truncating) conversion to U8 in the output step.
Example of more aggressive optimization
---------------------------------------
Conversion pass for gray -> rgb48:
Unoptimized operation list:
[ u8 .... -> ....] SWS_OP_READ : 1 elem(s) planar >> 0
[ u8 .... -> ....] SWS_OP_SWIZZLE : 0123
[ u8 .... -> ....] SWS_OP_RSHIFT : >> 0
[ u8 .... -> ....] SWS_OP_CLEAR : {_ 0 0 0}
[ u8 .... -> ....] SWS_OP_CONVERT : u8 -> f32
[f32 .... -> ....] SWS_OP_LINEAR : luma+alpha [[1/255 0 0 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 1]]
[f32 .... -> ....] SWS_OP_LINEAR : matrix3 [[1 0 701/500 0 0] [1 -0.344136 -0.714136 0 0] [1 443/250 0 0 0] [0 0 0 1 0]]
[f32 .... -> ....] SWS_OP_LINEAR : diag3 [[65535 0 0 0 0] [0 65535 0 0 0] [0 0 65535 0 0] [0 0 0 1 0]]
[f32 .... -> ....] SWS_OP_MAX : {0 0 0 0} <= x
[f32 .... -> ....] SWS_OP_MIN : x <= {65535 65535 65535 _}
[f32 .... -> ....] SWS_OP_CONVERT : f32 -> u16
[u16 .... -> ....] SWS_OP_LSHIFT : << 0
[u16 .... -> ....] SWS_OP_SWIZZLE : 0123
[u16 .... -> ....] SWS_OP_WRITE : 3 elem(s) packed >> 0
Optimized operation list:
[ u8 XXXX -> +XXX] SWS_OP_READ : 1 elem(s) planar >> 0
[ u8 .XXX -> +XXX] SWS_OP_CONVERT : u8 -> u16 (expand)
[u16 .XXX -> +++X] SWS_OP_SWIZZLE : 0003
[u16 ...X -> +++X] SWS_OP_WRITE : 3 elem(s) packed >> 0
(X = unused, + = exact, 0 = zero)
Here, the optimizer has managed to eliminate all of the unnecessary linear
operations on previously zero'd values, turn the resulting column matrix into
a swizzle operation, avoid the unnecessary dither (and round trip via float)
because the pixel values are guaranteed to be bit exact, and finally, turns
the multiplication by 65535 / 255 = 257 into a simple integer expand operation.
As a final bonus, the x86 backend further optimizes this into a 12-byte shuffle:
pshufb = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1}
time=208 us, ref=4212 us, speedup=20.236x faster (single thread)
time=57 us, ref=472 us, speedup=8.160x faster (multi thread)
Compiler and underlying implementation layer (SwsOpChain)
---------------------------------------------------------
While the backend API is flexible enough to permit more exotic implementations
(e.g. using JIT code generation), we establish a common set of helpers for use
in "traditional" SIMD implementations.
The basic idea is to have one "kernel" (or implementation) per operation,
and then just chain a list of these kernels together as separate function
calls. For best performance, we want to keep data in vector registers in
between function calls using a custom calling convention, thus avoiding any
unnecessary memory accesses. Additionally, we want the per-kernel overhead to
be as low as possible, with each kernel ideally just jumping directly into
the next kernel.
As a result, we arrive at a design where we first divide the image into small
chunks, or "blocks", and then dispatch the "chain" of kernels on each chunk in
sequence. Each kernel processes a fixed number of pixels, with the overall
entry point taking care of looping. Remaining pixels (the "tail") are handled
generically by the backend-invariant dispatch code (located in ops.c), using a
partial memcpy into a suitably sized temporary buffer.
To minimize the per-kernel function call overhead, we use a "continuation
passing style" for chaining kernels. Each operation computes its result and
then directly calls the next operation in the sequence, with the appropriate
internal function signature.
The C reference backend reads data into the stack and then passes the array
pointers to the next continuation as regular function arguments:
void process(GlobalContext *ctx, OpContext *op,
block_t x, block_t y, block_t z, block_t w)
{
for (int i = 0; i < SWS_BLOCK_SIZE; i++)
// do something with x[i], y[i], z[i], w[i]
op->next(ctx, &op[1], x, y, z, w);
}
With type conversions pushing the new data onto the stack as well:
void convert8to16(GlobalContext *ctx, OpContext *op,
block_t x, block_t y, block_t z, block_t w)
{
/* Pseudo-code */
u16block_t x16 = (u16block_t) x;
u16block_t y16 = (u16block_t) y;
u16block_t z16 = (u16block_t) z;
u16block_t w16 = (u16block_t) w;
op->next(ctx, &op[1], x16, y16, z16, w16);
}
By contrast, the x86 backend always keeps the X/Y/Z/W values pinned in specific
vector registers (ymm0-ymm3 for the lower half, and ymm4-ymm7 for the second
half).
Each kernel additionally has access to a 32 byte per-op context storing the
pointer to the next kernel plus 16 bytes of arbitrary private data. This is
used during construction of the function chain to place things like small
constants.
In assembly, the per-kernel overhead looks like this:
load $tmp, $arg1
...
add $arg1, 32
jump $tmp
This design gives vastly better performance than the alternative of returning
out to a central loop or "trampoline". This is partly because the order of
kernels within a chain is always the same, so the branch predictor can easily
remember the target address of each "jump" instruction.
The only way to realistically improve on this design would be to directly
stitch the kernel body together using runtime code generation.
Future considerations and limitations
-------------------------------------
My current prototype has a number of severe limitations and opportunities
for improvements:
1. It does not handle scaling at all. I am not yet entirely sure on how I want
to handle scaling; this includes handling of subsampled content. I have a
number of vague ideas in my head, but nothing where I can say with certainty
that it will work out well.
It's possible that we won't come up with a perfect solution here, and will
need to decide on which set of compromises we are comfortable accepting:
1. Do we need the ability to scale YUV -> YUV by handling luma and chroma
independently? When downscaling 100x100 4:2:0 to 50x50 4:4:4, should we
support the option of reusing the chroma plane directly (even though
this would introduce a subpixel shift for typical chroma siting)?
Looking towards zimg, I am also thinking that we probably also want to do
scaling on floating point values, since this is best for both performance
and accuracy, especially given that we need to go up to 32-bit intermediates
during scaling anyway.
So far, the most promising approach seems to be to handle subsampled
input/output as a dedicated read/write operation type; perhaps even with a
fixed/static subsampling kernel. To avoid compromising on performance when
chroma resampling is not necessary, the optimizer could then relax the
pipeline to use non-interpolating read/writes when all intermediate
operations are component-independent.
2. Since each operation is conceptually defined on 4-component pixels, we end
up defining a lot of variants of each implementation for each possible
*subset*. For example, we have four different implementations for
SWS_OP_SCALE in my current templates:
- op_scale_1000
- op_scale_1001
- op_scale_1110
- op_scale_1111
This reflects the four different arrangements of pixel components that are
typically present (or absent). While best for performance, it does turn into
a bit of a chore when implementing these kernels.
The only real alternative would be to either branch inside the kernel (bad),
or to use separate kernels for each individual component and chain them all
together. I have not yet tested whether the latter approach would be faster
after the latest round of refactors to the kernel glue code.
3. I do not yet have any support for LUTs. But when I add them, something we
could do is have the optimized pass automatically "promote" a sequence of
operations to LUTs. For example, any sequence that looks like:
1. [u8] SWS_OP_CONVERT -> X
2. [X] ... // only per-component operations
4. [X] SWS_OP_CONVERT -> Y
3. [Y] SWS_OP_WRITE
could be replaced by a LUT with 256 entries. This is especially important
for anything involving packed 8-bit input (e.g. rgb8, rgb4_byte).
We also definitely want to hook this up to the existing CMS code for
transformations between different primaries.
4. Because we rely on AVRational math to generate the coefficients for
operations, we need to be able to represent all pixel values as an
AVRational. However, this presents a challenge for 32-bit formats (e.g.
GRAY32, RGBA128), because their size exceeds INT_MAX, which is the maximum
value representable by an AVRational.
It's possible we may want to introduce an AVRational64 for this, or
perhaps more flexibly, extend AVRational to an AVFloating type which is
represented as { AVRational n; int exp; }, representing n/d * 2^exp. This
would preserve our ability to represent all pixel values exactly, while
opening up the range arbitrarily.
5. Is there ever a situation where the use of floats introduces the risk of
non bit-exact output? For this reason, and possible performance advantages,
we may want to explore the use of a fixed-point 16 bit path as an alternative
to the floating point math.
So far, I have managed to avoid any bit exactness issues inside the x86
backend by ensuring that the order of linear operations is identical
between the C backend and the x86 backend, but this may not be practical
to guarantee on all backends. The x86 float code is also dramatically
faster than the old fixed point code, so I'm tentatively optimistic about
the lack of a need for a fixed point path.

View File

@@ -54,12 +54,24 @@ sub get_formatting_function($$) {
}
# determine texinfo version
my $program_version_num = version->declare(ff_get_conf('PACKAGE_VERSION'))->numify;
my $package_version = ff_get_conf('PACKAGE_VERSION');
$package_version =~ s/\+dev$//;
my $program_version_num = version->declare($package_version)->numify;
my $program_version_6_8 = $program_version_num >= 6.008000;
# no navigation elements
ff_set_from_init_file('HEADERS', 0);
my %sectioning_commands = %Texinfo::Common::sectioning_commands;
if (scalar(keys(%sectioning_commands)) == 0) {
%sectioning_commands = %Texinfo::Commands::sectioning_heading_commands;
}
my %root_commands = %Texinfo::Common::root_commands;
if (scalar(keys(%root_commands)) == 0) {
%root_commands = %Texinfo::Commands::root_commands;
}
sub ffmpeg_heading_command($$$$$)
{
my $self = shift;
@@ -77,6 +89,9 @@ sub ffmpeg_heading_command($$$$$)
return $result;
}
# no need to set it as the $element_id is output unconditionally
my $heading_id;
my $element_id = $self->command_id($command);
$result .= "<a name=\"$element_id\"></a>\n"
if (defined($element_id) and $element_id ne '');
@@ -84,24 +99,40 @@ sub ffmpeg_heading_command($$$$$)
print STDERR "Process $command "
.Texinfo::Structuring::_print_root_command_texi($command)."\n"
if ($self->get_conf('DEBUG'));
my $element;
if ($Texinfo::Common::root_commands{$command->{'cmdname'}}
and $command->{'parent'}
and $command->{'parent'}->{'type'}
and $command->{'parent'}->{'type'} eq 'element') {
$element = $command->{'parent'};
my $output_unit;
if ($root_commands{$command->{'cmdname'}}) {
if ($command->{'associated_unit'}) {
$output_unit = $command->{'associated_unit'};
} elsif ($command->{'structure'}
and $command->{'structure'}->{'associated_unit'}) {
$output_unit = $command->{'structure'}->{'associated_unit'};
} elsif ($command->{'parent'}
and $command->{'parent'}->{'type'}
and $command->{'parent'}->{'type'} eq 'element') {
$output_unit = $command->{'parent'};
}
}
if ($element) {
if ($output_unit) {
$result .= &{get_formatting_function($self, 'format_element_header')}($self, $cmdname,
$command, $element);
$command, $output_unit);
}
my $heading_level;
# node is used as heading if there is nothing else.
if ($cmdname eq 'node') {
if (!$element or (!$element->{'extra'}->{'section'}
and $element->{'extra'}->{'node'}
and $element->{'extra'}->{'node'} eq $command
if (!$output_unit or
(((!$output_unit->{'extra'}->{'section'}
and $output_unit->{'extra'}->{'node'}
and $output_unit->{'extra'}->{'node'} eq $command)
or
((($output_unit->{'extra'}->{'unit_command'}
and $output_unit->{'extra'}->{'unit_command'} eq $command)
or
($output_unit->{'unit_command'}
and $output_unit->{'unit_command'} eq $command))
and $command->{'extra'}
and not $command->{'extra'}->{'associated_section'}))
# bogus node may not have been normalized
and defined($command->{'extra'}->{'normalized'}))) {
if ($command->{'extra'}->{'normalized'} eq 'Top') {
@@ -111,7 +142,15 @@ sub ffmpeg_heading_command($$$$$)
}
}
} else {
$heading_level = $command->{'level'};
if (defined($command->{'extra'})
and defined($command->{'extra'}->{'section_level'})) {
$heading_level = $command->{'extra'}->{'section_level'};
} elsif ($command->{'structure'}
and defined($command->{'structure'}->{'section_level'})) {
$heading_level = $command->{'structure'}->{'section_level'};
} else {
$heading_level = $command->{'level'};
}
}
my $heading = $self->command_text($command);
@@ -119,8 +158,8 @@ sub ffmpeg_heading_command($$$$$)
# if there is an error in the node.
if (defined($heading) and $heading ne '' and defined($heading_level)) {
if ($Texinfo::Common::root_commands{$cmdname}
and $Texinfo::Common::sectioning_commands{$cmdname}) {
if ($root_commands{$cmdname}
and $sectioning_commands{$cmdname}) {
my $content_href = $self->command_contents_href($command, 'contents',
$self->{'current_filename'});
if ($content_href) {
@@ -140,7 +179,13 @@ sub ffmpeg_heading_command($$$$$)
}
}
if ($self->in_preformatted()) {
my $in_preformatted;
if ($program_version_num >= 7.001090) {
$in_preformatted = $self->in_preformatted_context();
} else {
$in_preformatted = $self->in_preformatted();
}
if ($in_preformatted) {
$result .= $heading."\n";
} else {
# if the level was changed, set the command name right
@@ -149,21 +194,25 @@ sub ffmpeg_heading_command($$$$$)
$cmdname
= $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level];
}
# format_heading_text expects an array of headings for texinfo >= 7.0
if ($program_version_num >= 7.000000) {
$heading = [$heading];
}
$result .= &{get_formatting_function($self,'format_heading_text')}(
$result .= &{get_formatting_function($self,'format_heading_text')}($self,
$cmdname, [$cmdname], $heading,
$heading_level +$self->get_conf('CHAPTER_HEADER_LEVEL') -1,
$heading_id, $command);
} else {
$result .= &{get_formatting_function($self,'format_heading_text')}(
$self, $cmdname, $heading,
$heading_level +
$self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
}
}
}
$result .= $content if (defined($content));
return $result;
}
foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') {
foreach my $command (keys(%sectioning_commands), 'node') {
texinfo_register_command_formatting($command, \&ffmpeg_heading_command);
}
@@ -188,28 +237,56 @@ sub ffmpeg_begin_file($$$)
my $filename = shift;
my $element = shift;
my $command;
if ($element and $self->get_conf('SPLIT')) {
$command = $self->element_command($element);
my ($element_command, $node_command, $command_for_title);
if ($element) {
if ($element->{'unit_command'}) {
$element_command = $element->{'unit_command'};
} elsif ($self->can('tree_unit_element_command')) {
$element_command = $self->tree_unit_element_command($element);
} elsif ($self->can('tree_unit_element_command')) {
$element_command = $self->element_command($element);
}
$node_command = $element_command;
if ($element_command and $element_command->{'cmdname'}
and $element_command->{'cmdname'} ne 'node'
and $element_command->{'extra'}
and $element_command->{'extra'}->{'associated_node'}) {
$node_command = $element_command->{'extra'}->{'associated_node'};
}
$command_for_title = $element_command if ($self->get_conf('SPLIT'));
}
my ($title, $description, $encoding, $date, $css_lines,
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
my ($title, $description, $keywords, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $body_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
$program, $generator);
if ($program_version_num >= 7.000000) {
($title, $description, $encoding, $date, $css_lines,
$doctype, $bodytext, $copying_comment, $after_body_open,
if ($program_version_num >= 7.001090) {
($title, $description, $keywords, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $body_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_information($command_for_title,
$filename);
} elsif ($program_version_num >= 7.000000) {
($title, $description, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_information($command);
$program, $generator) = $self->_file_header_information($command_for_title,
$filename);
} else {
($title, $description, $encoding, $date, $css_lines,
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_informations($command);
$doctype, $root_html_element_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_informations($command_for_title);
}
my $links = $self->_get_links ($filename, $element);
my $links;
if ($program_version_num >= 7.000000) {
$links = $self->_get_links($filename, $element, $node_command);
} else {
$links = $self->_get_links ($filename, $element);
}
my $head1 = $ENV{"FFMPEG_HEADER1"} || <<EOT;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
@@ -252,13 +329,25 @@ sub ffmpeg_program_string($)
if (defined($self->get_conf('PROGRAM'))
and $self->get_conf('PROGRAM') ne ''
and defined($self->get_conf('PACKAGE_URL'))) {
return $self->convert_tree(
if ($program_version_num >= 7.001090) {
return $self->convert_tree(
$self->cdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
{ 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')},
'program' => {'text' => $self->get_conf('PROGRAM') }}));
} else {
return $self->convert_tree(
$self->gdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
{ 'program_homepage' => $self->get_conf('PACKAGE_URL'),
'program' => $self->get_conf('PROGRAM') }));
{ 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')},
'program' => {'text' => $self->get_conf('PROGRAM') }}));
}
} else {
return $self->convert_tree(
$self->gdt('This document was generated automatically.'));
if ($program_version_num >= 7.001090) {
return $self->convert_tree(
$self->cdt('This document was generated automatically.'));
} else {
return $self->convert_tree(
$self->gdt('This document was generated automatically.'));
}
}
}
if ($program_version_6_8) {

0
doc/texi2pod.pl Normal file → Executable file
View File

2
doc/texidep.pl Normal file → Executable file
View File

@@ -1,4 +1,4 @@
#! /usr/bin/env perl
#!/usr/bin/env perl
# This script will print the dependency of a Texinfo file to stdout.
# texidep.pl <src-path> <input.texi> <output.ext>

View File

@@ -44,4 +44,3 @@ a+b*c;
here the reader knows that a,b,c are meant to be signed integers but for C
standard compliance / to avoid undefined behavior they are stored in unsigned
ints.

View File

@@ -731,8 +731,12 @@ FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR
FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2
@item 9.1.4
FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR
@item 9.1.6
FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR+TSL+TSR
@item hexadecagonal
FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
@item binaural
BIL+BIR
@item downmix
DL+DR
@item 22.2
@@ -801,6 +805,11 @@ The following binary operators are available: @code{+}, @code{-},
The following unary operators are available: @code{+}, @code{-}.
Some internal variables can be used to store and load intermediary
results. They can be accessed using the @code{ld} and @code{st}
functions with an index argument varying from 0 to 9 to specify which
internal variable to access.
The following functions are available:
@table @option
@item abs(x)
@@ -898,9 +907,9 @@ Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
@item isnan(x)
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
@item ld(var)
Load the value of the internal variable with number
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
@item ld(idx)
Load the value of the internal variable with index @var{idx}, which was
previously stored with st(@var{idx}, @var{expr}).
The function returns the loaded value.
@item lerp(x, y, z)
@@ -933,21 +942,31 @@ Compute the power of @var{x} elevated @var{y}, it is equivalent to
@item print(t)
@item print(t, l)
Print the value of expression @var{t} with loglevel @var{l}. If
@var{l} is not specified then a default log level is used.
Returns the value of the expression printed.
Prints t with loglevel l
Print the value of expression @var{t} with loglevel @var{l}. If @var{l} is not
specified then a default log level is used.
Return the value of the expression printed.
@item random(idx)
Return a pseudo random value between 0.0 and 1.0. @var{idx} is the
index of the internal variable which will be used to save the
seed/state.
index of the internal variable used to save the seed/state, which can be
previously stored with @code{st(idx)}.
To initialize the seed, you need to store the seed value as a 64-bit
unsigned integer in the internal variable with index @var{idx}.
For example, to store the seed with value @code{42} in the internal
variable with index @code{0} and print a few random values:
@example
st(0,42); print(random(0)); print(random(0)); print(random(0))
@end example
@item randomi(idx, min, max)
Return a pseudo random value in the interval between @var{min} and
@var{max}. @var{idx} is the index of the internal variable which will
be used to save the seed/state.
@var{max}. @var{idx} is the index of the internal variable which will be used to
save the seed/state, which can be previously stored with @code{st(idx)}.
To initialize the seed, you need to store the seed value as a 64-bit
unsigned integer in the internal variable with index @var{idx}.
@item root(expr, max)
Find an input value for which the function represented by @var{expr}
@@ -956,14 +975,14 @@ with argument @var{ld(0)} is 0 in the interval 0..@var{max}.
The expression in @var{expr} must denote a continuous function or the
result is undefined.
@var{ld(0)} is used to represent the function input value, which means
that the given expression will be evaluated multiple times with
various input values that the expression can access through
@code{ld(0)}. When the expression evaluates to 0 then the
corresponding input value will be returned.
@var{ld(0)} is used to represent the function input value, which means that the
given expression will be evaluated multiple times with various input values that
the expression can access through @code{ld(0)}. When the expression evaluates to
0 then the corresponding input value will be returned.
@item round(expr)
Round the value of expression @var{expr} to the nearest integer. For example, "round(1.5)" is "2.0".
Round the value of expression @var{expr} to the nearest integer. For example,
"round(1.5)" is "2.0".
@item sgn(x)
Compute sign of @var{x}.
@@ -981,12 +1000,15 @@ Compute the square root of @var{expr}. This is equivalent to
@item squish(x)
Compute expression @code{1/(1 + exp(4*x))}.
@item st(var, expr)
@item st(idx, expr)
Store the value of the expression @var{expr} in an internal
variable. @var{var} specifies the number of the variable where to
store the value, and it is a value ranging from 0 to 9. The function
returns the value stored in the internal variable.
Note, Variables are currently not shared between expressions.
variable. @var{idx} specifies the index of the variable where to store
the value, and it is a value ranging from 0 to 9. The function returns
the value stored in the internal variable.
The stored value can be retrieved with @code{ld(var)}.
Note: variables are currently not shared between expressions.
@item tan(x)
Compute tangent of @var{x}.
@@ -995,16 +1017,16 @@ Compute tangent of @var{x}.
Compute hyperbolic tangent of @var{x}.
@item taylor(expr, x)
@item taylor(expr, x, id)
@item taylor(expr, x, idx)
Evaluate a Taylor series at @var{x}, given an expression representing
the @code{ld(id)}-th derivative of a function at 0.
the @code{ld(idx)}-th derivative of a function at 0.
When the series does not converge the result is undefined.
@var{ld(id)} is used to represent the derivative order in @var{expr},
@var{ld(idx)} is used to represent the derivative order in @var{expr},
which means that the given expression will be evaluated multiple times
with various input values that the expression can access through
@code{ld(id)}. If @var{id} is not specified then 0 is assumed.
@code{ld(idx)}. If @var{idx} is not specified then 0 is assumed.
Note, when you have the derivatives at y instead of 0,
@code{taylor(expr, x-y)} can be used.

View File

@@ -3,6 +3,8 @@ OBJS-$(HAVE_ARMV6) += $(ARMV6-OBJS) $(ARMV6-OBJS-yes)
OBJS-$(HAVE_ARMV8) += $(ARMV8-OBJS) $(ARMV8-OBJS-yes)
OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
OBJS-$(HAVE_SVE) += $(SVE-OBJS) $(SVE-OBJS-yes)
OBJS-$(HAVE_SVE2) += $(SVE2-OBJS) $(SVE2-OBJS-yes)
OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes)
@@ -17,6 +19,9 @@ OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
OBJS-$(HAVE_RV) += $(RV-OBJS) $(RV-OBJS-yes)
OBJS-$(HAVE_RVV) += $(RVV-OBJS) $(RVV-OBJS-yes)
OBJS-$(HAVE_RV_ZVBB) += $(RVVB-OBJS) $(RVVB-OBJS-yes)
OBJS-$(HAVE_SIMD128) += $(SIMD128-OBJS) $(SIMD128-OBJS-yes)
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
OBJS-$(HAVE_X86ASM) += $(X86ASM-OBJS) $(X86ASM-OBJS-yes)

View File

@@ -38,8 +38,10 @@ int main(int argc, char **argv)
return -1;
output = fopen(argv[2], "wb");
if (!output)
if (!output) {
fclose(input);
return -1;
}
if (argc == 4) {
name = argv[3];
@@ -67,8 +69,10 @@ int main(int argc, char **argv)
fclose(output);
if (ferror(input) || !feof(input))
if (ferror(input) || !feof(input)) {
fclose(input);
return -1;
}
fclose(input);

View File

@@ -18,7 +18,7 @@ BIN2C = $(BIN2CEXE)
ifndef V
Q = @
ECHO = printf "$(1)\t%s\n" $(2)
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC BIN2C
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC BIN2C METALCC METALLIB
SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM
MSG = $@
@@ -139,6 +139,46 @@ else
$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
endif
# 1) Preprocess CSS to a minified version
%.css.min: TAG = SED
%.css.min: %.css
$(M)sed 's!/\\*.*\\*/!!g' $< \
| tr '\n' ' ' \
| tr -s ' ' \
| sed 's/^ //; s/ $$//' \
> $@
ifdef CONFIG_RESOURCE_COMPRESSION
# 2) Gzip the minified CSS
%.css.min.gz: TAG = GZIP
%.css.min.gz: %.css.min
$(M)gzip -nc9 $< > $@
# 3) Convert the gzipped CSS to a .c array
%.css.c: %.css.min.gz $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
# 4) Gzip the HTML file (no minification needed)
%.html.gz: TAG = GZIP
%.html.gz: %.html
$(M)gzip -nc9 $< > $@
# 5) Convert the gzipped HTML to a .c array
%.html.c: %.html.gz $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
else # NO COMPRESSION
# 2) Convert the minified CSS to a .c array
%.css.c: %.css.min $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
# 3) Convert the plain HTML to a .c array
%.html.c: %.html $(BIN2CEXE)
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
endif
clean::
$(RM) $(BIN2CEXE) $(CLEANSUFFIXES:%=ffbuild/%)
@@ -159,7 +199,6 @@ endif
include $(SRC_PATH)/ffbuild/arch.mak
OBJS += $(OBJS-yes)
SLIBOBJS += $(SLIBOBJS-yes)
SHLIBOBJS += $(SHLIBOBJS-yes)
STLIBOBJS += $(STLIBOBJS-yes)
FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
@@ -169,7 +208,6 @@ LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(foreach lib,EXTRALIBS-$(NAME) $(FFLIBS:%=EXTRALIBS-%),$($(lib))) $(EXTRALIBS)
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
SHLIBOBJS := $(sort $(SHLIBOBJS:%=$(SUBDIR)%))
STLIBOBJS := $(sort $(STLIBOBJS:%=$(SUBDIR)%))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
@@ -191,9 +229,10 @@ SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
PTXOBJS = $(filter %.ptx.o,$(OBJS))
RESOURCEOBJS = $(filter %.css.o %.html.o,$(OBJS))
$(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
checkheaders: $(HOBJS)
.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=)
.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=) $(RESOURCEOBJS:.o=.c) $(RESOURCEOBJS:%.css.o=%.css.min) $(RESOURCEOBJS:%.css.o=%.css.min.gz) $(RESOURCEOBJS:%.html.o=%.html.gz) $(RESOURCEOBJS:.o=)
alltools: $(TOOLS)
@@ -206,15 +245,14 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o
$(OBJS): | $(sort $(dir $(OBJS)))
$(HOBJS): | $(sort $(dir $(HOBJS)))
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
$(SLIBOBJS): | $(sort $(dir $(SLIBOBJS)))
$(SHLIBOBJS): | $(sort $(dir $(SHLIBOBJS)))
$(STLIBOBJS): | $(sort $(dir $(STLIBOBJS)))
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
$(TOOLOBJS): | tools
OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.objs *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *.html.gz *.html.c *.css.gz *.css.c *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
define RULES
@@ -224,4 +262,4 @@ endef
$(eval $(RULES))
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SHLIBOBJS:.o=.d) $(STLIBOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d)
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SHLIBOBJS:.o=.d) $(STLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d)

View File

@@ -26,7 +26,7 @@ ifdef CONFIG_SHARED
# for purely shared builds.
# Test programs are always statically linked against their library
# to be able to access their library's internals, even with shared builds.
# Yet linking against dependend libraries still uses dynamic linking.
# Yet linking against dependent libraries still uses dynamic linking.
# This means that we are in the scenario described above.
# In case only static libs are used, the linker will only use
# one of these copies; this depends on the duplicated object files
@@ -35,8 +35,14 @@ OBJS += $(SHLIBOBJS)
endif
$(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS)
$(RM) $@
ifeq ($(RESPONSE_FILES),yes)
$(Q)echo $^ > $@.objs
$(AR) $(ARFLAGS) $(AR_O) @$@.objs
else
$(AR) $(ARFLAGS) $(AR_O) $^
endif
$(RANLIB) $@
-$(RM) $@.objs
install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
@@ -64,10 +70,16 @@ $(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD)
ifeq ($(RESPONSE_FILES),yes)
$(Q)echo $$(filter %.o,$$^) > $$@.objs
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) @$$@.objs $(FFEXTRALIBS)
else
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
endif
$(SLIB_EXTRA_CMD)
-$(RM) $$@.objs
ifdef SUBDIR
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)

View File

@@ -1,3 +1,4 @@
#!/bin/sh
toupper(){
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}

View File

@@ -50,7 +50,7 @@ includedir=${source_path}
prefix=
exec_prefix=
libdir=\${pcfiledir}/../../../$name
includedir=${source_path}
includedir=${includedir}
Name: $fullname
Description: $comment

View File

@@ -9,6 +9,8 @@ AVBASENAMES = ffmpeg ffplay ffprobe
ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
include $(SRC_PATH)/fftools/resources/Makefile
OBJS-ffmpeg += \
fftools/ffmpeg_dec.o \
fftools/ffmpeg_demux.o \
@@ -19,9 +21,34 @@ OBJS-ffmpeg += \
fftools/ffmpeg_mux_init.o \
fftools/ffmpeg_opt.o \
fftools/ffmpeg_sched.o \
fftools/objpool.o \
fftools/graph/graphprint.o \
fftools/sync_queue.o \
fftools/thread_queue.o \
fftools/textformat/avtextformat.o \
fftools/textformat/tf_compact.o \
fftools/textformat/tf_default.o \
fftools/textformat/tf_flat.o \
fftools/textformat/tf_ini.o \
fftools/textformat/tf_json.o \
fftools/textformat/tf_mermaid.o \
fftools/textformat/tf_xml.o \
fftools/textformat/tw_avio.o \
fftools/textformat/tw_buffer.o \
fftools/textformat/tw_stdout.o \
$(OBJS-resman) \
OBJS-ffprobe += \
fftools/textformat/avtextformat.o \
fftools/textformat/tf_compact.o \
fftools/textformat/tf_default.o \
fftools/textformat/tf_flat.o \
fftools/textformat/tf_ini.o \
fftools/textformat/tf_json.o \
fftools/textformat/tf_mermaid.o \
fftools/textformat/tf_xml.o \
fftools/textformat/tw_avio.o \
fftools/textformat/tw_buffer.o \
fftools/textformat/tw_stdout.o \
OBJS-ffplay += fftools/ffplay_renderer.o
@@ -31,7 +58,7 @@ ifdef HAVE_GNU_WINDRES
OBJS-$(1) += fftools/fftoolsres.o
endif
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
$$(OBJS-$(1)): | fftools
$$(OBJS-$(1)): | fftools fftools/textformat fftools/resources fftools/graph
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
$(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
@@ -44,6 +71,9 @@ all: $(AVPROGS)
fftools/ffprobe.o fftools/cmdutils.o: libavutil/ffversion.h | fftools
OUTDIRS += fftools
OUTDIRS += fftools/textformat
OUTDIRS += fftools/resources
OUTDIRS += fftools/graph
ifdef AVPROGS
install: install-progs install-data
@@ -62,4 +92,4 @@ uninstall-progs:
$(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
clean::
$(RM) $(ALLAVPROGS) $(ALLAVPROGS_G) $(CLEANSUFFIXES:%=fftools/%)
$(RM) $(ALLAVPROGS) $(ALLAVPROGS_G) $(CLEANSUFFIXES:%=fftools/%) $(CLEANSUFFIXES:%=fftools/graph/%) $(CLEANSUFFIXES:%=fftools/textformat/%)

View File

@@ -33,17 +33,14 @@
#include "compat/va_copy.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "libswscale/version.h"
#include "libswresample/swresample.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/display.h"
#include "libavutil/getenv_utf8.h"
#include "libavutil/mathematics.h"
#include "libavutil/imgutils.h"
#include "libavutil/libm.h"
#include "libavutil/mem.h"
#include "libavutil/parseutils.h"
#include "libavutil/eval.h"
#include "libavutil/dict.h"
@@ -249,6 +246,8 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
(uint8_t *)optctx + po->u.off : po->u.dst_ptr;
char *arg_allocated = NULL;
enum OptionType so_type = po->type;
SpecifierOptList *sol = NULL;
double num;
int ret = 0;
@@ -256,9 +255,10 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
if (*opt == '/') {
opt++;
if (po->type == OPT_TYPE_BOOL) {
if (!opt_has_arg(po)) {
av_log(NULL, AV_LOG_FATAL,
"Requested to load an argument from file for a bool option '%s'\n",
"Requested to load an argument from file for an option '%s'"
" which does not take an argument\n",
po->name);
return AVERROR(EINVAL);
}
@@ -289,6 +289,14 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
goto finish;
}
sol->opt[sol->nb_opt - 1].specifier = str;
if (po->flags & OPT_FLAG_PERSTREAM) {
ret = stream_specifier_parse(&sol->opt[sol->nb_opt - 1].stream_spec,
str, 0, NULL);
if (ret < 0)
goto finish;
}
dst = &sol->opt[sol->nb_opt - 1].u;
}
@@ -313,8 +321,9 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
goto finish;
*(int *)dst = num;
so_type = OPT_TYPE_INT;
} else if (po->type == OPT_TYPE_INT64) {
ret = parse_number(opt, arg, OPT_TYPE_INT64, INT64_MIN, INT64_MAX, &num);
ret = parse_number(opt, arg, OPT_TYPE_INT64, INT64_MIN, (double)INT64_MAX, &num);
if (ret < 0)
goto finish;
@@ -326,6 +335,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
opt, arg);
goto finish;
}
so_type = OPT_TYPE_INT64;
} else if (po->type == OPT_TYPE_FLOAT) {
ret = parse_number(opt, arg, OPT_TYPE_FLOAT, -INFINITY, INFINITY, &num);
if (ret < 0)
@@ -343,9 +353,11 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
ret = po->u.func_arg(optctx, opt, arg);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR,
"Failed to set value '%s' for option '%s': %s\n",
arg, opt, av_err2str(ret));
if ((strcmp(opt, "init_hw_device") != 0) || (strcmp(arg, "list") != 0)) {
av_log(NULL, AV_LOG_ERROR,
"Failed to set value '%s' for option '%s': %s\n",
arg, opt, av_err2str(ret));
}
goto finish;
}
}
@@ -355,7 +367,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
}
if (sol) {
sol->type = po->type;
sol->type = so_type;
sol->opt_canon = (po->flags & OPT_HAS_CANON) ?
find_option(defs, po->u1.name_canon) : po;
}
@@ -483,8 +495,9 @@ int locate_option(int argc, char **argv, const OptionDef *options,
for (i = 1; i < argc; i++) {
const char *cur_opt = argv[i];
if (*cur_opt++ != '-')
if (!(cur_opt[0] == '-' && cur_opt[1]))
continue;
cur_opt++;
po = find_option(options, cur_opt);
if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o')
@@ -542,11 +555,12 @@ static void check_options(const OptionDef *po)
void parse_loglevel(int argc, char **argv, const OptionDef *options)
{
int idx = locate_option(argc, argv, options, "loglevel");
int idx;
char *env;
check_options(options);
idx = locate_option(argc, argv, options, "loglevel");
if (!idx)
idx = locate_option(argc, argv, options, "v");
if (idx && argv[idx + 1])
@@ -581,7 +595,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit,
return o;
}
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0
#define FLAGS ((o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0)
int opt_default(void *optctx, const char *opt, const char *arg)
{
const AVOption *o;
@@ -793,7 +807,7 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
while (optindex < argc) {
const char *opt = argv[optindex++], *arg;
const OptionDef *po;
int ret, group_idx;
int group_idx;
av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
@@ -979,17 +993,366 @@ FILE *get_preset_file(char *filename, size_t filename_size,
return f;
}
int cmdutils_isalnum(char c)
{
return (c >= '0' && c <= '9') ||
(c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z');
}
void stream_specifier_uninit(StreamSpecifier *ss)
{
av_freep(&ss->meta_key);
av_freep(&ss->meta_val);
av_freep(&ss->remainder);
memset(ss, 0, sizeof(*ss));
}
int stream_specifier_parse(StreamSpecifier *ss, const char *spec,
int allow_remainder, void *logctx)
{
char *endptr;
int ret;
memset(ss, 0, sizeof(*ss));
ss->idx = -1;
ss->media_type = AVMEDIA_TYPE_UNKNOWN;
ss->stream_list = STREAM_LIST_ALL;
av_log(logctx, AV_LOG_TRACE, "Parsing stream specifier: %s\n", spec);
while (*spec) {
if (*spec <= '9' && *spec >= '0') { /* opt:index */
ss->idx = strtol(spec, &endptr, 0);
av_assert0(endptr > spec);
spec = endptr;
av_log(logctx, AV_LOG_TRACE,
"Parsed index: %d; remainder: %s\n", ss->idx, spec);
// this terminates the specifier
break;
} else if ((*spec == 'v' || *spec == 'a' || *spec == 's' ||
*spec == 'd' || *spec == 't' || *spec == 'V') &&
!cmdutils_isalnum(*(spec + 1))) { /* opt:[vasdtV] */
if (ss->media_type != AVMEDIA_TYPE_UNKNOWN) {
av_log(logctx, AV_LOG_ERROR, "Stream type specified multiple times\n");
ret = AVERROR(EINVAL);
goto fail;
}
switch (*spec++) {
case 'v': ss->media_type = AVMEDIA_TYPE_VIDEO; break;
case 'a': ss->media_type = AVMEDIA_TYPE_AUDIO; break;
case 's': ss->media_type = AVMEDIA_TYPE_SUBTITLE; break;
case 'd': ss->media_type = AVMEDIA_TYPE_DATA; break;
case 't': ss->media_type = AVMEDIA_TYPE_ATTACHMENT; break;
case 'V': ss->media_type = AVMEDIA_TYPE_VIDEO;
ss->no_apic = 1; break;
default: av_assert0(0);
}
av_log(logctx, AV_LOG_TRACE, "Parsed media type: %s; remainder: %s\n",
av_get_media_type_string(ss->media_type), spec);
} else if (*spec == 'g' && *(spec + 1) == ':') {
if (ss->stream_list != STREAM_LIST_ALL)
goto multiple_stream_lists;
spec += 2;
if (*spec == '#' || (*spec == 'i' && *(spec + 1) == ':')) {
ss->stream_list = STREAM_LIST_GROUP_ID;
spec += 1 + (*spec == 'i');
} else
ss->stream_list = STREAM_LIST_GROUP_IDX;
ss->list_id = strtol(spec, &endptr, 0);
if (spec == endptr) {
av_log(logctx, AV_LOG_ERROR, "Expected stream group idx/ID, got: %s\n", spec);
ret = AVERROR(EINVAL);
goto fail;
}
spec = endptr;
av_log(logctx, AV_LOG_TRACE, "Parsed stream group %s: %"PRId64"; remainder: %s\n",
ss->stream_list == STREAM_LIST_GROUP_ID ? "ID" : "index", ss->list_id, spec);
} else if (*spec == 'p' && *(spec + 1) == ':') {
if (ss->stream_list != STREAM_LIST_ALL)
goto multiple_stream_lists;
ss->stream_list = STREAM_LIST_PROGRAM;
spec += 2;
ss->list_id = strtol(spec, &endptr, 0);
if (spec == endptr) {
av_log(logctx, AV_LOG_ERROR, "Expected program ID, got: %s\n", spec);
ret = AVERROR(EINVAL);
goto fail;
}
spec = endptr;
av_log(logctx, AV_LOG_TRACE,
"Parsed program ID: %"PRId64"; remainder: %s\n", ss->list_id, spec);
} else if (!strncmp(spec, "disp:", 5)) {
const AVClass *st_class = av_stream_get_class();
const AVOption *o = av_opt_find(&st_class, "disposition", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ);
char *disp = NULL;
size_t len;
av_assert0(o);
if (ss->disposition) {
av_log(logctx, AV_LOG_ERROR, "Multiple disposition specifiers\n");
ret = AVERROR(EINVAL);
goto fail;
}
spec += 5;
for (len = 0; cmdutils_isalnum(spec[len]) ||
spec[len] == '_' || spec[len] == '+'; len++)
continue;
disp = av_strndup(spec, len);
if (!disp) {
ret = AVERROR(ENOMEM);
goto fail;
}
ret = av_opt_eval_flags(&st_class, o, disp, &ss->disposition);
av_freep(&disp);
if (ret < 0) {
av_log(logctx, AV_LOG_ERROR, "Invalid disposition specifier\n");
goto fail;
}
spec += len;
av_log(logctx, AV_LOG_TRACE,
"Parsed disposition: 0x%x; remainder: %s\n", ss->disposition, spec);
} else if (*spec == '#' ||
(*spec == 'i' && *(spec + 1) == ':')) {
if (ss->stream_list != STREAM_LIST_ALL)
goto multiple_stream_lists;
ss->stream_list = STREAM_LIST_STREAM_ID;
spec += 1 + (*spec == 'i');
ss->list_id = strtol(spec, &endptr, 0);
if (spec == endptr) {
av_log(logctx, AV_LOG_ERROR, "Expected stream ID, got: %s\n", spec);
ret = AVERROR(EINVAL);
goto fail;
}
spec = endptr;
av_log(logctx, AV_LOG_TRACE,
"Parsed stream ID: %"PRId64"; remainder: %s\n", ss->list_id, spec);
// this terminates the specifier
break;
} else if (*spec == 'm' && *(spec + 1) == ':') {
av_assert0(!ss->meta_key && !ss->meta_val);
spec += 2;
ss->meta_key = av_get_token(&spec, ":");
if (!ss->meta_key) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (*spec == ':') {
spec++;
ss->meta_val = av_get_token(&spec, ":");
if (!ss->meta_val) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
av_log(logctx, AV_LOG_TRACE,
"Parsed metadata: %s:%s; remainder: %s", ss->meta_key,
ss->meta_val ? ss->meta_val : "<any value>", spec);
// this terminates the specifier
break;
} else if (*spec == 'u' && (*(spec + 1) == '\0' || *(spec + 1) == ':')) {
ss->usable_only = 1;
spec++;
av_log(logctx, AV_LOG_ERROR, "Parsed 'usable only'\n");
// this terminates the specifier
break;
} else
break;
if (*spec == ':')
spec++;
}
if (*spec) {
if (!allow_remainder) {
av_log(logctx, AV_LOG_ERROR,
"Trailing garbage at the end of a stream specifier: %s\n",
spec);
ret = AVERROR(EINVAL);
goto fail;
}
if (*spec == ':')
spec++;
ss->remainder = av_strdup(spec);
if (!ss->remainder) {
ret = AVERROR(EINVAL);
goto fail;
}
}
return 0;
multiple_stream_lists:
av_log(logctx, AV_LOG_ERROR,
"Cannot combine multiple program/group designators in a "
"single stream specifier");
ret = AVERROR(EINVAL);
fail:
stream_specifier_uninit(ss);
return ret;
}
unsigned stream_specifier_match(const StreamSpecifier *ss,
const AVFormatContext *s, const AVStream *st,
void *logctx)
{
const AVStreamGroup *g = NULL;
const AVProgram *p = NULL;
int start_stream = 0, nb_streams;
int nb_matched = 0;
switch (ss->stream_list) {
case STREAM_LIST_STREAM_ID:
// <n-th> stream with given ID makes no sense and should be impossible to request
av_assert0(ss->idx < 0);
// return early if we know for sure the stream does not match
if (st->id != ss->list_id)
return 0;
start_stream = st->index;
nb_streams = st->index + 1;
break;
case STREAM_LIST_ALL:
start_stream = ss->idx >= 0 ? 0 : st->index;
nb_streams = st->index + 1;
break;
case STREAM_LIST_PROGRAM:
for (unsigned i = 0; i < s->nb_programs; i++) {
if (s->programs[i]->id == ss->list_id) {
p = s->programs[i];
break;
}
}
if (!p) {
av_log(logctx, AV_LOG_WARNING, "No program with ID %"PRId64" exists,"
" stream specifier can never match\n", ss->list_id);
return 0;
}
nb_streams = p->nb_stream_indexes;
break;
case STREAM_LIST_GROUP_ID:
for (unsigned i = 0; i < s->nb_stream_groups; i++) {
if (ss->list_id == s->stream_groups[i]->id) {
g = s->stream_groups[i];
break;
}
}
// fall-through
case STREAM_LIST_GROUP_IDX:
if (ss->stream_list == STREAM_LIST_GROUP_IDX &&
ss->list_id >= 0 && ss->list_id < s->nb_stream_groups)
g = s->stream_groups[ss->list_id];
if (!g) {
av_log(logctx, AV_LOG_WARNING, "No stream group with group %s %"
PRId64" exists, stream specifier can never match\n",
ss->stream_list == STREAM_LIST_GROUP_ID ? "ID" : "index",
ss->list_id);
return 0;
}
nb_streams = g->nb_streams;
break;
default: av_assert0(0);
}
for (int i = start_stream; i < nb_streams; i++) {
const AVStream *candidate = s->streams[g ? g->streams[i]->index :
p ? p->stream_index[i] : i];
if (ss->media_type != AVMEDIA_TYPE_UNKNOWN &&
(ss->media_type != candidate->codecpar->codec_type ||
(ss->no_apic && (candidate->disposition & AV_DISPOSITION_ATTACHED_PIC))))
continue;
if (ss->meta_key) {
const AVDictionaryEntry *tag = av_dict_get(candidate->metadata,
ss->meta_key, NULL, 0);
if (!tag)
continue;
if (ss->meta_val && strcmp(tag->value, ss->meta_val))
continue;
}
if (ss->usable_only) {
const AVCodecParameters *par = candidate->codecpar;
switch (par->codec_type) {
case AVMEDIA_TYPE_AUDIO:
if (!par->sample_rate || !par->ch_layout.nb_channels ||
par->format == AV_SAMPLE_FMT_NONE)
continue;
break;
case AVMEDIA_TYPE_VIDEO:
if (!par->width || !par->height || par->format == AV_PIX_FMT_NONE)
continue;
break;
case AVMEDIA_TYPE_UNKNOWN:
continue;
}
}
if (ss->disposition &&
(candidate->disposition & ss->disposition) != ss->disposition)
continue;
if (st == candidate)
return ss->idx < 0 || ss->idx == nb_matched;
nb_matched++;
}
return 0;
}
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
{
int ret = avformat_match_stream_specifier(s, st, spec);
StreamSpecifier ss;
int ret;
ret = stream_specifier_parse(&ss, spec, 0, NULL);
if (ret < 0)
av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec);
return ret;
ret = stream_specifier_match(&ss, s, st, NULL);
stream_specifier_uninit(&ss);
return ret;
}
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
AVFormatContext *s, AVStream *st, const AVCodec *codec,
AVDictionary **dst)
AVDictionary **dst, AVDictionary **opts_used)
{
AVDictionary *ret = NULL;
const AVDictionaryEntry *t = NULL;
@@ -998,10 +1361,6 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
char prefix = 0;
const AVClass *cc = avcodec_get_class();
if (!codec)
codec = s->oformat ? avcodec_find_encoder(codec_id)
: avcodec_find_decoder(codec_id);
switch (st->codecpar->codec_type) {
case AVMEDIA_TYPE_VIDEO:
prefix = 'v';
@@ -1020,6 +1379,7 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
while (t = av_dict_iterate(opts, t)) {
const AVClass *priv_class;
char *p = strchr(t->key, ':');
int used = 0;
/* check stream specification in opt name */
if (p) {
@@ -1037,15 +1397,21 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
!codec ||
((priv_class = codec->priv_class) &&
av_opt_find(&priv_class, t->key, NULL, flags,
AV_OPT_SEARCH_FAKE_OBJ)))
AV_OPT_SEARCH_FAKE_OBJ))) {
av_dict_set(&ret, t->key, t->value, 0);
else if (t->key[0] == prefix &&
used = 1;
} else if (t->key[0] == prefix &&
av_opt_find(&cc, t->key + 1, NULL, flags,
AV_OPT_SEARCH_FAKE_OBJ))
AV_OPT_SEARCH_FAKE_OBJ)) {
av_dict_set(&ret, t->key + 1, t->value, 0);
used = 1;
}
if (p)
*p = ':';
if (used && opts_used)
av_dict_set(opts_used, t->key, "", 0);
}
*dst = ret;
@@ -1053,7 +1419,7 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
}
int setup_find_stream_info_opts(AVFormatContext *s,
AVDictionary *codec_opts,
AVDictionary *local_codec_opts,
AVDictionary ***dst)
{
int ret;
@@ -1069,8 +1435,8 @@ int setup_find_stream_info_opts(AVFormatContext *s,
return AVERROR(ENOMEM);
for (int i = 0; i < s->nb_streams; i++) {
ret = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id,
s, s->streams[i], NULL, &opts[i]);
ret = filter_codec_opts(local_codec_opts, s->streams[i]->codecpar->codec_id,
s, s->streams[i], NULL, &opts[i], NULL);
if (ret < 0)
goto fail;
}
@@ -1105,9 +1471,12 @@ void *allocate_array_elem(void *ptr, size_t elem_size, int *nb_elems)
{
void *new_elem;
if (!(new_elem = av_mallocz(elem_size)) ||
av_dynarray_add_nofree(ptr, nb_elems, new_elem) < 0)
new_elem = av_mallocz(elem_size);
if (!new_elem)
return NULL;
if (av_dynarray_add_nofree(ptr, nb_elems, new_elem) < 0)
av_freep(&new_elem);
return new_elem;
}
@@ -1153,3 +1522,23 @@ char *file_read(const char *filename)
return NULL;
return str;
}
void remove_avoptions(AVDictionary **a, AVDictionary *b)
{
const AVDictionaryEntry *t = NULL;
while ((t = av_dict_iterate(b, t))) {
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
}
}
int check_avoptions(AVDictionary *m)
{
const AVDictionaryEntry *t = av_dict_iterate(m, NULL);
if (t) {
av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
return AVERROR_OPTION_NOT_FOUND;
}
return 0;
}

View File

@@ -102,8 +102,70 @@ enum OptionType {
int parse_number(const char *context, const char *numstr, enum OptionType type,
double min, double max, double *dst);
enum StreamList {
STREAM_LIST_ALL,
STREAM_LIST_STREAM_ID,
STREAM_LIST_PROGRAM,
STREAM_LIST_GROUP_ID,
STREAM_LIST_GROUP_IDX,
};
typedef struct StreamSpecifier {
// trailing stream index - pick idx-th stream that matches
// all the other constraints; -1 when not present
int idx;
// which stream list to consider
enum StreamList stream_list;
// STREAM_LIST_STREAM_ID: stream ID
// STREAM_LIST_GROUP_IDX: group index
// STREAM_LIST_GROUP_ID: group ID
// STREAM_LIST_PROGRAM: program ID
int64_t list_id;
// when not AVMEDIA_TYPE_UNKNOWN, consider only streams of this type
enum AVMediaType media_type;
uint8_t no_apic;
uint8_t usable_only;
int disposition;
char *meta_key;
char *meta_val;
char *remainder;
} StreamSpecifier;
/**
* Parse a stream specifier string into a form suitable for matching.
*
* @param ss Parsed specifier will be stored here; must be uninitialized
* with stream_specifier_uninit() when no longer needed.
* @param spec String containing the stream specifier to be parsed.
* @param allow_remainder When 1, the part of spec that is left after parsing
* the stream specifier is stored into ss->remainder.
* When 0, any remainder will cause parsing to fail.
*/
int stream_specifier_parse(StreamSpecifier *ss, const char *spec,
int allow_remainder, void *logctx);
/**
* @return 1 if st matches the parsed specifier, 0 if it does not
*/
unsigned stream_specifier_match(const StreamSpecifier *ss,
const AVFormatContext *s, const AVStream *st,
void *logctx);
void stream_specifier_uninit(StreamSpecifier *ss);
typedef struct SpecifierOpt {
char *specifier; /**< stream/chapter/program/... specifier */
// original specifier or empty string
char *specifier;
// parsed specifier for OPT_FLAG_PERSTREAM options
StreamSpecifier stream_spec;
union {
uint8_t *str;
int i;
@@ -120,6 +182,9 @@ typedef struct SpecifierOptList {
/* Canonical option definition that was parsed into this list. */
const struct OptionDef *opt_canon;
/* Type corresponding to the field that should be used from SpecifierOpt.u.
* May not match the option type, e.g. OPT_TYPE_BOOL options are stored as
* int, so this field would be OPT_TYPE_INT for them */
enum OptionType type;
} SpecifierOptList;
@@ -254,7 +319,7 @@ typedef struct Option {
} Option;
typedef struct OptionGroupDef {
/**< group name */
/** group name */
const char *name;
/**
* Option to be used as group separator. Can be NULL for groups which
@@ -371,11 +436,13 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
* @param codec The particular codec for which the options should be filtered.
* If null, the default one is looked up according to the codec id.
* @param dst a pointer to the created dictionary
* @param opts_used if non-NULL, every option stored in dst is also stored here,
* with specifiers preserved
* @return a non-negative number on success, a negative error code on failure
*/
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
AVFormatContext *s, AVStream *st, const AVCodec *codec,
AVDictionary **dst);
AVDictionary **dst, AVDictionary **opts_used);
/**
* Setup AVCodecContext options for avformat_find_stream_info().
@@ -465,22 +532,17 @@ void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems);
#define GROW_ARRAY(array, nb_elems)\
grow_array((void**)&array, sizeof(*array), &nb_elems, nb_elems + 1)
#define GET_PIX_FMT_NAME(pix_fmt)\
const char *name = av_get_pix_fmt_name(pix_fmt);
#define GET_CODEC_NAME(id)\
const char *name = avcodec_descriptor_get(id)->name;
#define GET_SAMPLE_FMT_NAME(sample_fmt)\
const char *name = av_get_sample_fmt_name(sample_fmt)
#define GET_SAMPLE_RATE_NAME(rate)\
char name[16];\
snprintf(name, sizeof(name), "%d", rate);
double get_rotation(const int32_t *displaymatrix);
/* read file contents into a string */
char *file_read(const char *filename);
/* Remove keys in dictionary b from dictionary a */
void remove_avoptions(AVDictionary **a, AVDictionary *b);
/* Check if any keys exist in dictionary m */
int check_avoptions(AVDictionary *m);
int cmdutils_isalnum(char c);
#endif /* FFTOOLS_CMDUTILS_H */

View File

@@ -68,40 +68,20 @@
#include <conio.h>
#endif
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/dict.h"
#include "libavutil/display.h"
#include "libavutil/fifo.h"
#include "libavutil/hwcontext.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/samplefmt.h"
#include "libavutil/thread.h"
#include "libavutil/threadmessage.h"
#include "libavutil/mem.h"
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
#include "libavcodec/version.h"
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswresample/swresample.h"
#include "cmdutils.h"
#include "ffmpeg.h"
#include "ffmpeg_sched.h"
#include "ffmpeg_utils.h"
#include "sync_queue.h"
#include "graph/graphprint.h"
const char program_name[] = "ffmpeg";
const int program_birth_year = 2000;
@@ -157,7 +137,7 @@ void term_exit(void)
static volatile int received_sigterm = 0;
static volatile int received_nb_signals = 0;
static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0);
static atomic_int transcode_init_done = 0;
static volatile int ffmpeg_exited = 0;
static int64_t copy_ts_first_pts = AV_NOPTS_VALUE;
@@ -306,8 +286,9 @@ static int read_key(void)
}
//Read it
if(nchars != 0) {
read(0, &ch, 1);
return ch;
if (read(0, &ch, 1) == 1)
return ch;
return 0;
}else{
return -1;
}
@@ -328,9 +309,12 @@ const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
static void ffmpeg_cleanup(int ret)
{
if ((print_graphs || print_graphs_file) && nb_output_files > 0)
print_filtergraphs(filtergraphs, nb_filtergraphs, input_files, nb_input_files, output_files, nb_output_files);
if (do_benchmark) {
int maxrss = getmaxrss() / 1024;
av_log(NULL, AV_LOG_INFO, "bench: maxrss=%iKiB\n", maxrss);
int64_t maxrss = getmaxrss() / 1024;
av_log(NULL, AV_LOG_INFO, "bench: maxrss=%"PRId64"KiB\n", maxrss);
}
for (int i = 0; i < nb_filtergraphs; i++)
@@ -360,6 +344,9 @@ static void ffmpeg_cleanup(int ret)
av_freep(&filter_nbthreads);
av_freep(&print_graphs_file);
av_freep(&print_graphs_format);
av_freep(&input_files);
av_freep(&output_files);
@@ -494,21 +481,51 @@ const FrameData *packet_data_c(AVPacket *pkt)
return ret < 0 ? NULL : (const FrameData*)pkt->opaque_ref->data;
}
void remove_avoptions(AVDictionary **a, AVDictionary *b)
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used,
void *logctx, int decode)
{
const AVDictionaryEntry *t = NULL;
const AVClass *class = avcodec_get_class();
const AVClass *fclass = avformat_get_class();
while ((t = av_dict_iterate(b, t))) {
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
}
}
const int flag = decode ? AV_OPT_FLAG_DECODING_PARAM :
AV_OPT_FLAG_ENCODING_PARAM;
const AVDictionaryEntry *e = NULL;
int check_avoptions(AVDictionary *m)
{
const AVDictionaryEntry *t;
if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
return AVERROR_OPTION_NOT_FOUND;
while ((e = av_dict_iterate(opts, e))) {
const AVOption *option, *foption;
char *optname, *p;
if (av_dict_get(opts_used, e->key, NULL, 0))
continue;
optname = av_strdup(e->key);
if (!optname)
return AVERROR(ENOMEM);
p = strchr(optname, ':');
if (p)
*p = 0;
option = av_opt_find(&class, optname, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
foption = av_opt_find(&fclass, optname, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
av_freep(&optname);
if (!option || foption)
continue;
if (!(option->flags & flag)) {
av_log(logctx, AV_LOG_ERROR, "Codec AVOption %s (%s) is not a %s "
"option.\n", e->key, option->help ? option->help : "",
decode ? "decoding" : "encoding");
return AVERROR(EINVAL);
}
av_log(logctx, AV_LOG_WARNING, "Codec AVOption %s (%s) has not been used "
"for any stream. The most likely reason is either wrong type "
"(e.g. a video option with no video streams) or that it is a "
"private option of some decoder which was not actually used "
"for any stream.\n", e->key, option->help ? option->help : "");
}
return 0;
@@ -545,7 +562,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
static int64_t last_time = -1;
static int first_report = 1;
uint64_t nb_frames_dup = 0, nb_frames_drop = 0;
int mins, secs, us;
int mins, secs, ms, us;
int64_t hours;
const char *hours_sign;
int ret;
@@ -569,6 +586,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
vid = 0;
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);
for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
const float q = ost->enc ? atomic_load(&ost->quality) / (float) FF_QP2LAMBDA : -1;
@@ -577,7 +595,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n",
ost->file->index, ost->index, q);
}
if (!vid && ost->type == AVMEDIA_TYPE_VIDEO && ost->filter) {
if (!vid && ost->type == AVMEDIA_TYPE_VIDEO) {
float fps;
uint64_t frame_number = atomic_load(&ost->packets_written);
@@ -591,8 +609,10 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
if (is_last_report)
av_bprintf(&buf, "L");
nb_frames_dup = atomic_load(&ost->filter->nb_frames_dup);
nb_frames_drop = atomic_load(&ost->filter->nb_frames_drop);
if (ost->filter) {
nb_frames_dup = atomic_load(&ost->filter->nb_frames_dup);
nb_frames_drop = atomic_load(&ost->filter->nb_frames_drop);
}
vid = 1;
}
@@ -657,6 +677,15 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
}
secs = (int)t;
ms = (int)((t - secs) * 1000);
mins = secs / 60;
secs %= 60;
hours = mins / 60;
mins %= 60;
av_bprintf(&buf, " elapsed=%"PRId64":%02d:%02d.%02d", hours, mins, secs, ms / 10);
if (print_stats || is_last_report) {
const char end = is_last_report ? '\n' : '\r';
if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
@@ -716,7 +745,7 @@ static void print_stream_maps(void)
av_log(NULL, AV_LOG_INFO, " (graph %d)", ost->filter->graph->index);
av_log(NULL, AV_LOG_INFO, " -> Stream #%d:%d (%s)\n", ost->file->index,
ost->index, ost->enc_ctx->codec->name);
ost->index, ost->enc->enc_ctx->codec->name);
continue;
}
@@ -725,9 +754,9 @@ static void print_stream_maps(void)
ost->ist->index,
ost->file->index,
ost->index);
if (ost->enc_ctx) {
if (ost->enc) {
const AVCodec *in_codec = ost->ist->dec;
const AVCodec *out_codec = ost->enc_ctx->codec;
const AVCodec *out_codec = ost->enc->enc_ctx->codec;
const char *decoder_name = "?";
const char *in_codec_name = "?";
const char *encoder_name = "?";
@@ -777,8 +806,6 @@ static int check_keyboard_interaction(int64_t cur_time)
{
int i, key;
static int64_t last_time;
if (received_nb_signals)
return AVERROR_EXIT;
/* read_key() returns 0 on EOF */
if (cur_time - last_time >= 100000) {
key = read_key();
@@ -808,6 +835,11 @@ static int check_keyboard_interaction(int64_t cur_time)
(n = sscanf(buf, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &time, command, arg)) >= 3) {
av_log(NULL, AV_LOG_DEBUG, "Processing command target:%s time:%f command:%s arg:%s",
target, time, command, arg);
for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
if (ost->fg_simple)
fg_send_command(ost->fg_simple, time, target, command, arg,
key == 'C');
}
for (i = 0; i < nb_filtergraphs; i++)
fg_send_command(filtergraphs[i], time, target, command, arg,
key == 'C');
@@ -857,6 +889,9 @@ static int transcode(Scheduler *sch)
while (!sch_wait(sch, stats_period, &transcode_ts)) {
int64_t cur_time= av_gettime_relative();
if (received_nb_signals)
break;
/* if 'q' pressed, exits */
if (stdin_interaction)
if (check_keyboard_interaction(cur_time) < 0)
@@ -995,5 +1030,8 @@ finish:
sch_free(&sch);
av_log(NULL, AV_LOG_VERBOSE, "\n");
av_log(NULL, AV_LOG_VERBOSE, "Exiting with exit code %d\n", ret);
return ret;
}

View File

@@ -39,6 +39,7 @@
#include "libavfilter/avfilter.h"
#include "libavutil/avutil.h"
#include "libavutil/bprint.h"
#include "libavutil/dict.h"
#include "libavutil/eval.h"
#include "libavutil/fifo.h"
@@ -112,12 +113,32 @@ typedef struct HWDevice {
AVBufferRef *device_ref;
} HWDevice;
enum ViewSpecifierType {
// no specifier given
VIEW_SPECIFIER_TYPE_NONE = 0,
// val is view index
VIEW_SPECIFIER_TYPE_IDX,
// val is view ID
VIEW_SPECIFIER_TYPE_ID,
// specify view by its position, val is AV_STEREO3D_VIEW_LEFT/RIGHT
VIEW_SPECIFIER_TYPE_POS,
// use all views, val is ignored
VIEW_SPECIFIER_TYPE_ALL,
};
typedef struct ViewSpecifier {
enum ViewSpecifierType type;
unsigned val;
} ViewSpecifier;
/* select an input stream for an output stream */
typedef struct StreamMap {
int disabled; /* 1 is this mapping is disabled by a negative map */
int file_index;
int stream_index;
char *linklabel; /* name of an output link, for mapping lavfi outputs */
ViewSpecifier vs;
} StreamMap;
typedef struct OptionsContext {
@@ -143,6 +164,7 @@ typedef struct OptionsContext {
int loop;
int rate_emu;
float readrate;
float readrate_catchup;
double readrate_initial_burst;
int accurate_seek;
int thread_queue_size;
@@ -155,6 +177,7 @@ typedef struct OptionsContext {
SpecifierOptList hwaccel_devices;
SpecifierOptList hwaccel_output_formats;
SpecifierOptList autorotate;
SpecifierOptList apply_cropping;
/* output options */
StreamMap *stream_maps;
@@ -210,6 +233,7 @@ typedef struct OptionsContext {
SpecifierOptList filter_scripts;
#endif
SpecifierOptList reinit_filters;
SpecifierOptList drop_changed;
SpecifierOptList fix_sub_duration;
SpecifierOptList fix_sub_duration_heartbeat;
SpecifierOptList canvas_sizes;
@@ -239,6 +263,8 @@ enum IFilterFlags {
IFILTER_FLAG_AUTOROTATE = (1 << 0),
IFILTER_FLAG_REINIT = (1 << 1),
IFILTER_FLAG_CFR = (1 << 2),
IFILTER_FLAG_CROP = (1 << 3),
IFILTER_FLAG_DROPCHANGED = (1 << 4),
};
typedef struct InputFilterOptions {
@@ -254,6 +280,11 @@ typedef struct InputFilterOptions {
* accurate */
AVRational framerate;
unsigned crop_top;
unsigned crop_bottom;
unsigned crop_left;
unsigned crop_right;
int sub2video_width;
int sub2video_height;
@@ -263,20 +294,97 @@ typedef struct InputFilterOptions {
AVFrame *fallback;
} InputFilterOptions;
enum OFilterFlags {
OFILTER_FLAG_DISABLE_CONVERT = (1 << 0),
// produce 24-bit audio
OFILTER_FLAG_AUDIO_24BIT = (1 << 1),
OFILTER_FLAG_AUTOSCALE = (1 << 2),
};
typedef struct OutputFilterOptions {
// Caller-provided name for this output
char *name;
// Codec used for encoding, may be NULL
const AVCodec *enc;
int64_t trim_start_us;
int64_t trim_duration_us;
int64_t ts_offset;
/* Desired output timebase.
* Numerator can be one of EncTimeBase values, or 0 when no preference.
*/
AVRational output_tb;
AVDictionary *sws_opts;
AVDictionary *swr_opts;
int64_t nb_threads;
// A combination of OFilterFlags.
unsigned flags;
int format;
int width;
int height;
enum AVColorSpace color_space;
enum AVColorRange color_range;
enum VideoSyncMethod vsync_method;
AVRational frame_rate;
AVRational max_frame_rate;
int sample_rate;
AVChannelLayout ch_layout;
const int *formats;
const int *sample_rates;
const AVChannelLayout *ch_layouts;
const AVRational *frame_rates;
const enum AVColorSpace *color_spaces;
const enum AVColorRange *color_ranges;
// for simple filtergraphs only, view specifier passed
// along to the decoder
const ViewSpecifier *vs;
} OutputFilterOptions;
typedef struct InputFilter {
struct FilterGraph *graph;
uint8_t *name;
int index;
// filter data type
enum AVMediaType type;
AVFilterContext *filter;
char *input_name;
/* for filters that are not yet bound to an input stream,
* this stores the input linklabel, if any */
uint8_t *linklabel;
} InputFilter;
typedef struct OutputFilter {
struct OutputStream *ost;
const AVClass *class;
struct FilterGraph *graph;
uint8_t *name;
int index;
AVFilterContext *filter;
char *output_name;
/* for filters that are not yet bound to an output stream,
* this stores the output linklabel, if any */
int bound;
uint8_t *linklabel;
char *apad;
enum AVMediaType type;
atomic_uint_least64_t nb_frames_dup;
@@ -291,6 +399,9 @@ typedef struct FilterGraph {
int nb_inputs;
OutputFilter **outputs;
int nb_outputs;
const char *graph_desc;
struct AVBPrint graph_print_buf;
} FilterGraph;
enum DecoderFlags {
@@ -304,6 +415,8 @@ enum DecoderFlags {
DECODER_FLAG_TOP_FIELD_FIRST = (1 << 3),
#endif
DECODER_FLAG_SEND_END_TS = (1 << 4),
// force bitexact decoding
DECODER_FLAG_BITEXACT = (1 << 5),
};
typedef struct DecoderOpts {
@@ -368,22 +481,12 @@ typedef struct InputStream {
int top_field_first;
#endif
int autorotate;
int fix_sub_duration;
/* decoded data from this stream goes into all those filters
* currently video and audio only */
InputFilter **filters;
int nb_filters;
/*
* Output targets that do not go through lavfi, i.e. subtitles or
* streamcopy. Those two cases are distinguished by the OutputStream
* having an encoder or not.
*/
struct OutputStream **outputs;
int nb_outputs;
} InputStream;
typedef struct InputFile {
@@ -460,13 +563,6 @@ typedef struct EncStats {
int lock_initialized;
} EncStats;
extern const char *const forced_keyframes_const_names[];
typedef enum {
ENCODER_FINISHED = 1,
MUXER_FINISHED = 2,
} OSTFinished ;
enum {
KF_FORCE_SOURCE = 1,
#if FFMPEG_OPT_FORCE_KF_SOURCE_NO_DROP
@@ -490,7 +586,22 @@ typedef struct KeyframeForceCtx {
int dropped_keyframe;
} KeyframeForceCtx;
typedef struct Encoder Encoder;
typedef struct Encoder {
const AVClass *class;
AVCodecContext *enc_ctx;
// number of frames/samples sent to the encoder
uint64_t frames_encoded;
uint64_t samples_encoded;
} Encoder;
enum CroppingType {
CROP_DISABLED = 0,
CROP_ALL,
CROP_CODEC,
CROP_CONTAINER,
};
typedef struct OutputStream {
const AVClass *class;
@@ -502,12 +613,6 @@ typedef struct OutputStream {
int index; /* stream index in the output file */
/**
* Codec parameters for packets submitted to the muxer (i.e. before
* bitstream filtering, if any).
*/
AVCodecParameters *par_in;
/* input stream that is the source for this output stream;
* may be NULL for streams with no well-defined source, e.g.
* attachments or outputs from complex filtergraphs */
@@ -515,21 +620,12 @@ typedef struct OutputStream {
AVStream *st; /* stream in the output file */
AVRational enc_timebase;
Encoder *enc;
AVCodecContext *enc_ctx;
/* video only */
AVRational frame_rate;
AVRational max_frame_rate;
enum VideoSyncMethod vsync_method;
int is_cfr;
int force_fps;
#if FFMPEG_OPT_TOP
int top_field_first;
#endif
int autoscale;
int bitexact;
int bits_per_raw_sample;
@@ -537,26 +633,18 @@ typedef struct OutputStream {
KeyframeForceCtx kf;
char *logfile_prefix;
const char *logfile_prefix;
FILE *logfile;
// simple filtergraph feeding this stream, if any
FilterGraph *fg_simple;
OutputFilter *filter;
AVDictionary *encoder_opts;
AVDictionary *sws_dict;
AVDictionary *swr_opts;
char *apad;
char *attachment_filename;
int keep_pix_fmt;
/* stats */
// number of packets send to the muxer
atomic_uint_least64_t packets_written;
// number of frames/samples sent to the encoder
uint64_t frames_encoded;
uint64_t samples_encoded;
/* packet quality factor */
atomic_int quality;
@@ -576,7 +664,6 @@ typedef struct OutputFile {
int index;
const AVOutputFormat *format;
const char *url;
OutputStream **streams;
@@ -585,7 +672,6 @@ typedef struct OutputFile {
int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units
int shortest;
int bitexact;
} OutputFile;
@@ -618,6 +704,7 @@ extern int nb_input_files;
extern OutputFile **output_files;
extern int nb_output_files;
// complex filtergraphs
extern FilterGraph **filtergraphs;
extern int nb_filtergraphs;
@@ -650,7 +737,11 @@ extern float max_error_rate;
extern char *filter_nbthreads;
extern int filter_complex_nbthreads;
extern int filter_buffered_frames;
extern int vstats_version;
extern int print_graphs;
extern char *print_graphs_file;
extern char *print_graphs_format;
extern int auto_conversion_filters;
extern const AVIOInterruptCB int_cb;
@@ -672,20 +763,21 @@ void term_exit(void);
void show_usage(void);
void remove_avoptions(AVDictionary **a, AVDictionary *b);
int check_avoptions(AVDictionary *m);
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used,
void *logctx, int decode);
int assert_file_overwrite(const char *filename);
AVDictionary *strip_specifiers(const AVDictionary *dict);
int find_codec(void *logctx, const char *name,
enum AVMediaType type, int encoder, const AVCodec **codec);
int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global);
int filtergraph_is_simple(const FilterGraph *fg);
int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
char *graph_desc,
Scheduler *sch, unsigned sch_idx_enc);
int fg_finalise_bindings(FilterGraph *fg);
int fg_create_simple(FilterGraph **pfg,
InputStream *ist,
char *graph_desc,
Scheduler *sch, unsigned sched_idx_enc,
const OutputFilterOptions *opts);
int fg_finalise_bindings(void);
/**
* Get our axiliary frame data attached to the frame, allocating it
@@ -698,8 +790,9 @@ const FrameData *frame_data_c(AVFrame *frame);
FrameData *packet_data (AVPacket *pkt);
const FrameData *packet_data_c(AVPacket *pkt);
int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost,
unsigned sched_idx_enc);
int ofilter_bind_enc(OutputFilter *ofilter,
unsigned sched_idx_enc,
const OutputFilterOptions *opts);
/**
* Create a new filtergraph in the global filtergraph list.
@@ -759,10 +852,24 @@ void dec_free(Decoder **pdec);
*
* @param opts filtergraph input options, to be filled by this function
*/
int dec_filter_add(Decoder *dec, InputFilter *ifilter, InputFilterOptions *opts);
int dec_filter_add(Decoder *dec, InputFilter *ifilter, InputFilterOptions *opts,
const ViewSpecifier *vs, SchedulerNode *src);
/*
* For multiview video, request output of the view(s) determined by vs.
* May be called multiple times.
*
* If this function is never called, only the base view is output. If it is
* called at least once, only the views requested are output.
*
* @param src scheduler node from which the frames corresponding vs
* will originate
*/
int dec_request_view(Decoder *dec, const ViewSpecifier *vs,
SchedulerNode *src);
int enc_alloc(Encoder **penc, const AVCodec *codec,
Scheduler *sch, unsigned sch_idx);
Scheduler *sch, unsigned sch_idx, void *log_parent);
void enc_free(Encoder **penc);
int enc_open(void *opaque, const AVFrame *frame);
@@ -775,7 +882,8 @@ int enc_loopback(Encoder *enc);
*
* Open the muxer once all the streams have been initialized.
*/
int of_stream_init(OutputFile *of, OutputStream *ost);
int of_stream_init(OutputFile *of, OutputStream *ost,
const AVCodecContext *enc_ctx);
int of_write_trailer(OutputFile *of);
int of_open(const OptionsContext *o, const char *filename, Scheduler *sch);
void of_free(OutputFile **pof);
@@ -787,9 +895,11 @@ int64_t of_filesize(OutputFile *of);
int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch);
void ifile_close(InputFile **f);
int ist_output_add(InputStream *ist, OutputStream *ost);
int ist_use(InputStream *ist, int decoding_needed,
const ViewSpecifier *vs, SchedulerNode *src);
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
InputFilterOptions *opts);
const ViewSpecifier *vs, InputFilterOptions *opts,
SchedulerNode *src);
/**
* Find an unused input stream of given type.
@@ -806,46 +916,18 @@ OutputStream *ost_iter(OutputStream *prev);
void update_benchmark(const char *fmt, ...);
#define SPECIFIER_OPT_FMT_str "%s"
#define SPECIFIER_OPT_FMT_i "%i"
#define SPECIFIER_OPT_FMT_i64 "%"PRId64
#define SPECIFIER_OPT_FMT_ui64 "%"PRIu64
#define SPECIFIER_OPT_FMT_f "%f"
#define SPECIFIER_OPT_FMT_dbl "%lf"
#define WARN_MULTIPLE_OPT_USAGE(optname, type, idx, st)\
{\
char namestr[128] = "";\
const SpecifierOpt *so = &o->optname.opt[idx];\
const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\
snprintf(namestr, sizeof(namestr), "-%s", o->optname.opt_canon->name);\
if (o->optname.opt_canon->flags & OPT_HAS_ALT) {\
const char * const *names_alt = o->optname.opt_canon->u1.names_alt;\
for (int _i = 0; names_alt[_i]; _i++)\
av_strlcatf(namestr, sizeof(namestr), "/-%s", names_alt[_i]);\
}\
av_log(NULL, AV_LOG_WARNING, "Multiple %s options specified for stream %d, only the last option '-%s%s%s "SPECIFIER_OPT_FMT_##type"' will be used.\n",\
namestr, st->index, o->optname.opt_canon->name, spec[0] ? ":" : "", spec, so->u.type);\
}
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
{\
int _ret, _matches = 0, _match_idx;\
for (int _i = 0; _i < o->name.nb_opt; _i++) {\
char *spec = o->name.opt[_i].specifier;\
if ((_ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\
outvar = o->name.opt[_i].u.type;\
_match_idx = _i;\
_matches++;\
} else if (_ret < 0)\
return _ret;\
}\
if (_matches > 1 && o->name.opt_canon)\
WARN_MULTIPLE_OPT_USAGE(name, type, _match_idx, st);\
}
const char *opt_match_per_type_str(const SpecifierOptList *sol,
char mediatype);
void opt_match_per_stream_str(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, const char **out);
void opt_match_per_stream_int(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, int *out);
void opt_match_per_stream_int64(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, int64_t *out);
void opt_match_per_stream_dbl(void *logctx, const SpecifierOptList *sol,
AVFormatContext *fc, AVStream *st, double *out);
int view_specifier_parse(const char **pspec, ViewSpecifier *vs);
int muxer_thread(void *arg);
int encoder_thread(void *arg);

Some files were not shown because too many files have changed in this diff Show More