Commit Graph

125398 Commits

Author SHA1 Message Date
Andreas Rheinhardt
bafcf7b73f avcodec/x86/vc1dsp_mc: Add size 16 vertical SSSE3 mc functions
vc1dsp.avg_vc1_mspel_pixels_tab_mc01_16_c:             334.4 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc01_16_mmxext:        177.5 ( 1.88x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc01_16_ssse3:          52.3 ( 6.40x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc02_16_c:             306.9 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc02_16_mmxext:        149.2 ( 2.06x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc02_16_ssse3:          52.2 ( 5.88x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc03_16_c:             334.2 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc03_16_mmxext:        176.5 ( 1.89x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc03_16_ssse3:          51.9 ( 6.44x)
vc1dsp.put_vc1_mspel_pixels_tab_mc01_16_c:             311.9 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc01_16_mmx:           169.8 ( 1.84x)
vc1dsp.put_vc1_mspel_pixels_tab_mc01_16_ssse3:          51.6 ( 6.04x)
vc1dsp.put_vc1_mspel_pixels_tab_mc02_16_c:             279.3 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc02_16_mmx:           144.1 ( 1.94x)
vc1dsp.put_vc1_mspel_pixels_tab_mc02_16_ssse3:          51.7 ( 5.40x)
vc1dsp.put_vc1_mspel_pixels_tab_mc03_16_c:             310.6 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc03_16_mmx:           171.0 ( 1.82x)
vc1dsp.put_vc1_mspel_pixels_tab_mc03_16_ssse3:          51.6 ( 6.02x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
a619524605 avcodec/x86/vc1dsp_mc: Don't xor unnecessarily
m0 is not used at all in this function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
b0d5914678 avcodec/x86/vc1dsp_mc: Add size 8 vertical SSSE3 mc functions
vc1dsp.avg_vc1_mspel_pixels_tab_mc01_8_c:              165.6 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc01_8_mmxext:          44.4 ( 3.73x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc01_8_ssse3:           18.5 ( 8.97x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc02_8_c:              152.5 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc02_8_mmxext:          37.3 ( 4.09x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc02_8_ssse3:           18.5 ( 8.25x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc03_8_c:              162.9 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc03_8_mmxext:          44.1 ( 3.69x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc03_8_ssse3:           18.3 ( 8.88x)
vc1dsp.put_vc1_mspel_pixels_tab_mc01_8_c:              150.5 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc01_8_mmx:             42.4 ( 3.55x)
vc1dsp.put_vc1_mspel_pixels_tab_mc01_8_ssse3:           16.5 ( 9.11x)
vc1dsp.put_vc1_mspel_pixels_tab_mc02_8_c:               78.4 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc02_8_mmx:             36.1 ( 2.17x)
vc1dsp.put_vc1_mspel_pixels_tab_mc02_8_ssse3:           16.5 ( 4.76x)
vc1dsp.put_vc1_mspel_pixels_tab_mc03_8_c:              144.7 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc03_8_mmx:             42.6 ( 3.40x)
vc1dsp.put_vc1_mspel_pixels_tab_mc03_8_ssse3:           16.3 ( 8.89x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
4e05d94424 avcodec/x86/vc1dsp_mmx: Remove purely horizontal MMX mc functions
Superseded by SSSE3. By the way, the SSSE3 functions occupy
816B, but the functions removed now occupied 2304B with GCC
and 6512B with Clang (which inlined everything).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
3354cbf1b7 avcodec/x86/vc1dsp_mc: Add size 16 horizontal SSSE3 mc functions
vc1dsp.avg_vc1_mspel_pixels_tab_mc10_16_c:             309.1 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc10_16_mmxext:        177.3 ( 1.74x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc10_16_ssse3:          52.3 ( 5.91x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc20_16_c:             279.6 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc20_16_mmxext:        148.8 ( 1.88x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc20_16_ssse3:          52.1 ( 5.37x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc30_16_c:             332.6 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc30_16_mmxext:        177.3 ( 1.88x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc30_16_ssse3:          52.5 ( 6.33x)
vc1dsp.put_vc1_mspel_pixels_tab_mc10_16_c:             288.8 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc10_16_mmx:           170.3 ( 1.70x)
vc1dsp.put_vc1_mspel_pixels_tab_mc10_16_ssse3:          51.3 ( 5.63x)
vc1dsp.put_vc1_mspel_pixels_tab_mc20_16_c:             236.2 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc20_16_mmx:           144.1 ( 1.64x)
vc1dsp.put_vc1_mspel_pixels_tab_mc20_16_ssse3:          51.3 ( 4.61x)
vc1dsp.put_vc1_mspel_pixels_tab_mc30_16_c:             286.6 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc30_16_mmx:           170.1 ( 1.69x)
vc1dsp.put_vc1_mspel_pixels_tab_mc30_16_ssse3:          51.2 ( 5.60x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
fd711adcb6 avcodec/x86/vc1dsp_mc: Add size 8 horizontal SSSE3 mc functions
pmaddubsw strikes again.

vc1dsp.avg_vc1_mspel_pixels_tab_mc10_8_c:              150.2 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc10_8_mmxext:          44.5 ( 3.38x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc10_8_ssse3:           18.5 ( 8.12x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc20_8_c:              288.2 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc20_8_mmxext:          37.7 ( 7.64x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc20_8_ssse3:           18.1 (15.97x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc30_8_c:              155.4 ( 1.00x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc30_8_mmxext:          46.5 ( 3.34x)
vc1dsp.avg_vc1_mspel_pixels_tab_mc30_8_ssse3:           18.1 ( 8.60x)
vc1dsp.put_vc1_mspel_pixels_tab_mc10_8_c:              282.2 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc10_8_mmx:             42.7 ( 6.61x)
vc1dsp.put_vc1_mspel_pixels_tab_mc10_8_ssse3:           16.4 (17.16x)
vc1dsp.put_vc1_mspel_pixels_tab_mc20_8_c:              223.4 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc20_8_mmx:             36.3 ( 6.15x)
vc1dsp.put_vc1_mspel_pixels_tab_mc20_8_ssse3:           16.4 (13.59x)
vc1dsp.put_vc1_mspel_pixels_tab_mc30_8_c:              255.2 ( 1.00x)
vc1dsp.put_vc1_mspel_pixels_tab_mc30_8_mmx:             43.6 ( 5.85x)
vc1dsp.put_vc1_mspel_pixels_tab_mc30_8_ssse3:           16.4 (15.52x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
f5b8a15b61 avcodec/x86/vc1dsp_mc: Move inverse transform into a file of its own
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
45c41d1d1b tests/checkasm/vc1dsp: Fix shadowing
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
b122b918eb avcodec/x86/vc1dsp_mc: Remove unnecessary movsxdifnidn
Forgotten in 5a49097b42
merging Libav commit 2ec9fa5ec6
(which changed the stride to ptrdiff_t).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
Andreas Rheinhardt
296d86c8bb tests/checkasm/vc1dsp: Improve mspel test
Up until now, only the fullpel test (i.e. the test without pixel
interpolation) has been tested at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 20:00:46 +02:00
James Almer
a693a4cd80 tests/fate/generic-tags: use codec copy instead of encoding
Using ac3_fixed output was not enough as there's float to int conversion due to
the fact the mp3float decoder is used.
Instead of playing with codec combinations, just remove encoding from the test
altogheter. Mov supports muxing mp3 just fine.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-01 14:35:14 -03:00
James Almer
d7d2d9d539 tests/fate/generic-tags: use ac3_fixed encoder instead of float aac
There's no guarantee the aac encoder will be bitexact in its output across platforms.
Use ac3_fixed instead of aac_fixed while at it, so the aac encoder can get improvements
without affecting this test.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-01 13:52:48 -03:00
Lynne
e2e889d9da aacenc: reduce automatic cutoffs at high rates by 2Khz
We were spending too many bits coding useless junk.
2026-07-02 01:14:55 +09:00
Lynne
d936a51b27 libavcodec/Makefile: add aaccoder_nmr.h to SKIPHEADERS 2026-07-01 21:38:43 +09:00
Martin Storsjö
a1dd71edca configure: Add a dependency on user32 to the gfxcapture filter
This filter uses a bunch of user32 functions, like GetMessage,
DispatchMessage, PeekMessage, GetWindowRect, etc.

This makes it clear that if the gfxcapture filter is built, we
need to link user32, if other components that depend on user32
would happen to be disabled.

Separately, if targeting UWP (with -DWINAPI_FAMILY=WINAPI_FAMILY_APP)
then these user32 APIs are unavailable. We have an existing
configure check for user32, checking for the GetShellWindow
function. This function isn't used by gfxfilter, but its
availability on UWP matches the other functions that gfxfilter
uses.

This fixes builds for UWP, by excluding the gfxcapture filter.
(This is somewhat ironic, as the gfxcapture filter uses
"winrt" APIs - but the implementation of the filter also relies
on lots of APIs that are unavailable in UWP/"winrt".)
2026-07-01 12:24:31 +00:00
Niklas Haas
a974a54486 avfilter: add less confusing error on frame queue overflow
Currently, such filter graphs just fail with a nebulous:

  [fc#0 @ 0x2a7b3c0] [error] Error while filtering: Cannot allocate memory

Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-07-01 12:12:15 +00:00
Lynne
38161819e7 fate: update AAC encoder tests 2026-07-01 21:05:27 +09:00
Lynne
0efac66e7e aacenc: use the NMR coder by default
The old coders will soon be removed.
2026-07-01 21:05:27 +09:00
Lynne
06e949e45d aacpsy: pre-echo-aware short-block detection for isolated onsets
The LAME attack detector high-pass filters at fs/4 before measuring attack
intensity, so the gentler attacks of tonal material (piano, plucked strings)
fall below the threshold and stay in long blocks, smearing pre-echo across the
quiet gap before the note. Relax the attack threshold for an isolated onset,
preceded by PSY_LAME_PE_GAP long frames with a near-silent pre-onset sub-block
(< PSY_LAME_PE_QUIET of the frame peak), so it switches to short blocks.
2026-07-01 21:05:27 +09:00
Lynne
2fe4a91669 aacenc: report coding tool stats at uninit
Useful for debugging.
2026-07-01 21:05:27 +09:00
Lynne
d1943afbb7 aaccoder: add NMR-based coder 2026-07-01 21:05:27 +09:00
Lynne
1298ce9eda aacenc_tns: reengineer coefficient derivation
The TNS tool needed a full rewrite.

1.) PNS cannot be used with M/S or I/S or TNS. The coding tools
interfere with one another.

2.) The coeffs were windowed, which was wrong.

3.) The applied filter did not match what the spec required.
2026-07-01 21:05:22 +09:00
Andreas Rheinhardt
66d9b8e483 swscale/ops_chain: Disable ff_sws_setup_{clear,clamp,scale}
They are only used on aarch64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 05:03:34 +02:00
Andreas Rheinhardt
fc7a984aae swscale/graph: Remove ff_sws_graph_create()
Unused since 9fe0ff3d56.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 05:03:34 +02:00
Andreas Rheinhardt
0002cf3ba1 swscale/Makefile: Mark sws_ops* test tools as requiring CONFIG_UNSTABLE
Fixes "make testprogs" with --disable-unstable

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 05:03:34 +02:00
Andreas Rheinhardt
fad1db043d swscale/format: Build ff_sws_chroma_pos() even without CONFIG_UNSTABLE
It is used in add_legacy_sws_pass() in graph.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 05:03:34 +02:00
Michael Niedermayer
48f30aa08c checkasm/sw_rgb: also test yuyvtoyuv422
yuyvtoyuv422 reads the trailing odd V sample at src[2w+1], one byte further
than uyvytoyuv422, so the number of extra source bytes an odd width needs is
passed in per format (1 for UYVY, 2 for YUYV) and added to the stride.

uyvytoyuv420 and yuyvtoyuv420 are intentionally not added: their x86 mmxext
chroma averaging uses PAVGB rounding and so is not bit-exact with the C
reference, which truncates, so they cannot be verified this way.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-01 01:48:33 +00:00
Michael Niedermayer
ef18ece3f0 checkasm/sw_rgb: test uyvytoyuv422 with odd widths
The SIMD uyvytoyuv422 implementations only handled even widths correctly.
Add odd width and 1x1 entries so the trailing column handling is exercised
against the C reference.

An odd width reads one source byte more than 2*width, the V sample at
src[2w], so the stride is extended by one for odd widths.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-01 01:48:33 +00:00
Michael Niedermayer
d5a2ab9c08 checkasm/sw_rgb: fix too small source stride in uyvytoyuv422 test
The planes table stored a source stride smaller than the 2*width bytes a
packed UYVY line occupies (e.g. width 12 with stride 12), and the correct
stride for width 128 would be 256, which does not even fit the uint8_t
field. The test passed only because the oversized source buffer absorbed
the resulting out-of-bounds reads.

Derive srcStride from the width (2*width) instead of storing it, so each
line is passed its true size.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-01 01:48:33 +00:00
James Almer
b1327568b6 avformat/movenc: unify remainder samples signaling
When writing edit lists and the last packet has skip samples side data to
report discard padding, for codecs that have a fixed frame size it's best to
always use the full packet duration to calculate track duration (and thus
bitrate in some cases) and let the edit list be the sole source of triming
information.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-30 22:19:24 -03:00
Andreas Rheinhardt
f0bfebc9ad avcodec/x86/hevc/add_res: Port ff_hevc_add_residual_4_8_mmxext to SSE2
No change in performance here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-30 22:50:17 +02:00
Michael Niedermayer
b553b810c4 avformat/movenc: free sgpd_entries on the roll-distance error path
Found-by: Ao Xijie
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-30 17:29:51 +00:00
Michael Niedermayer
9a01c1cb6a avfilter/vf_removelogo: free the whole mask on allocation failure
Found-by: Ao Xijie
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-30 11:15:33 +00:00
Michael Niedermayer
59a5090070 avfilter/af_adeclick: free transform contexts and buffers on error
Found-by: Ao Xijie
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-30 11:05:29 +00:00
Martin Storsjö
ae4314e2f4 tests: Implicitly set TAG=GEN for data/*.m3u8
This avoids having to declare it for every rule that generates
test input data, and adds such a missing tag for
tests/data/hls-seek.m3u8.

This fixes a case of a missing TAG for data/hls-seek.m3u8, which
caused it to be printed without a tag, like
"        tests/data/hls-seek.m3u8", now printed as
"GEN     tests/data/hls-seek.m3u8" as expected.
2026-06-30 08:23:04 +00:00
Zhao Zhili
0a44e7ddc1 avformat: add iTerm2 inline image protocol muxer
Add a muxer that wraps encoded image in the iTerm2 inline image protocol
(OSC 1337) so ffmpeg can play video directly in an iTerm2 terminal. The
output is a self-contained byte stream: it can be played live or saved
to a file and replayed with cat.
2026-06-30 05:08:44 +00:00
Daniel Verkamp
f1126f2338 avformat/wavenc: Don't count padding in rf64 data chunk size
When writing the trailer for a RF64 WAV file, the ds64 chunk's 64-bit
version of the data chunk size incorrectly included the padding byte
that may have been added by ff_end_tag() for the data chunk.

Fix this by calculating the data chunk size before calling ff_end_tag().

The data chunk padding byte is only needed when the data is not already
a multiple of two bytes in length, which is fairly rare, requiring
something like mono 8-bit or 24-bit PCM with an odd number of samples to
trigger (and only with -rf64 auto or -rf64 always, neither of which is
enabled by default), so this bug is not likely to have affected many
real-world files.

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
2026-06-30 03:03:30 +00:00
Jeongkeun Kim
2be6bf5507 tests/checkasm/llviddsp: fix add_left_pred_int16 buffer compare size
dst0/dst1 are uint16_t* allocated as width * sizeof(uint16_t), but
the memcmp at the end of check_add_left_pred_16 only compared `width`
bytes — missing the second half of each buffer. Same pattern used
correctly in tests/checkasm/huffyuvdsp.c (memcmp with width * sizeof()).

While at it, fix missing whitespace around & and || on the same line.

Fixes: fbe9148779 ("checkasm/llviddsp : add test for other dsp func")
Signed-off-by: Jeongkeun Kim <variety0724@gmail.com>
2026-06-29 21:40:05 +00:00
Kacper Michajłow
4552f31db8 ffbuild/common.mak: fix source path prefix stripping in INSTALL output
Use $(SRC_PATH), the source tree root, for consistent
repository-relative paths. SRC_DIR used before was undefined and this
macro only stripped leading /.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-06-29 21:22:15 +00:00
Kacper Michajłow
cbdbb07900 Makefile: hide verbose command from linking step
They are part of LD(XX) step, and shouldn't be shown if verbose output
is not enabled.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-06-29 21:22:15 +00:00
Kacper Michajłow
abb2a04649 Makefile: skip STRIP step when stripping is disabled
Instead of showing `STRIP` followed by `skipping strip`.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-06-29 21:22:15 +00:00
James Almer
7ab12fd02a avformat/movenc: use frame_size for EAC3 when merging packets
Otherwise remainder calculations will not work correctly if the input packets
have smaller frame sizes.

Should fix issue #23600.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-29 14:00:25 -03:00
James Almer
df9caa03b8 avformat/movenc: preserve packet side data when merging eac3 packets
If the last packet fed to the muxer has skip samples side data, if it were to be merged
into a single packet, said side data would be lost as is.
Copy it to the merged packet.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-29 12:38:12 -03:00
James Almer
2e6d5dbdc2 avformat/movenc: drain buffered EAC3 packets
handle_eac3() will buffer a packet if it doesn't reach the desired num_blocks
value, but if it was the last one to be passed to the muxer, it will never be
written.
Fix this by writing it during mov_write_trailer().

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-29 12:38:12 -03:00
James Almer
dac8b3f367 avformat/movenc: read packet duration at the time it's needed
Reading it at the beginning of ff_mov_write_packet() means that any changes to it
that happen afterwards will not be taken into account for the remainer calculation.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-29 12:38:12 -03:00
James Almer
613d65d508 tests/fate/hevc: update ref file for the newest test
A recent change affected what stream_remux() prints, and the CI didn't detect it
because it ran before doing a fast-forward rebase.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-29 14:29:33 +00:00
jiangjie
98c766ec19 avcodec/hevc_mp4toannexb: handle packet-side hvcC extradata
Do not overwrite the output codecpar extradata after init(). Keep the currently active HEVC parameter sets in HEVCBSFContext instead.

When AV_PKT_DATA_NEW_EXTRADATA on an input packet carries hvcC extradata, convert it to Annex B, update the runtime extradata state, and remove the packet side data.

Also add a FATE test covering extradata reloads with hevc_mp4toannexb,hevc_metadata.
2026-06-29 14:06:29 +00:00
nyanmisaka
3f6bf150cb avutil/hwcontext_cuda: fix yuv420p V/U plane overlap in cuda_get_buffer()
Odd-height yuv420p result in incorrect calculations of the U-plane
address offset. The last row of the V-plane overlapped with and was
overwritten by the first row of the U-plane, leading to chroma artifacts.

```
ffmpeg -init_hw_device cuda=cu -filter_hw_device cu -f lavfi -i \
testsrc=s=1920x1081,format=yuv420p -vf hwupload -c:v hevc_nvenc \
-vframes 1 -y <OUTPUT>
```

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2026-06-29 10:59:33 +00:00
Niklas Haas
de6bcf5c05 fftools/ffmpeg_demux: only throttle readrate on the slowest stream
If streams are badly interleaved, then the readrate logic can end up
accumulating an ever-growing lag. Rather than looping over each stream
and sleeping for each stream individually based on the local DTS and lag
logic, pull the sleep out of the loop and only sleep once based on the
furthest-behind stream (i.e. the stream contributing the lowest sleep
duration).

To reproduce:

$ ./ffmpeg -re -i fallbeatcaptiontest.mp4 -c copy -f null -t 10 -

Before this commit, this would run at ~0.7x and accumulate an infinitely
growing lag in one stream. After this commit, both streams run at ~1x as
expected, after an initial burst period due to the bad (1s granularity)
interleaving.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-29 09:46:36 +00:00
Niklas Haas
e7be06c8bd fftools/ffmpeg_demux: remove unused variable
This is a dead assignment except on a single branch, so just define it
locally.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-29 09:46:36 +00:00