100 Commits
Author SHA1 Message Date
Timo Rothenpieler d205b2fd0f avfilter/vsrc_gfxcapture: use AV_NOPTS_VALUE as default for pts fields 2026-10-24 20:55:29 +00:00
Timo Rothenpieler 2d49d0e624 MAINTAINERS: describe YesWeHack report processing 2026-10-17 01:10:53 +02:00
Timo Rothenpieler 447b72d90f avfilter/vf_scale_cuda: support resizing during YUV<->RGB conversion
Resizing is done on the RGB side: YUV to RGB conversion converts at the
visible input size before scaling, RGB to YUV conversion converts after
scaling at the output size. Every scaling pass then works on a single
packed plane and reuses the generic RGB kernels, and the conversion
kernels are reused with a float RGB side.

The RGB intermediates hold normalized floats, so filter overshoot and
out of gamut colors are not clipped before the scaler rounds and clamps
once. As conversion and filtering are linear, the result matches
scaling on the YUV side, apart from rounding and the chroma upsampling
of the conversion kernels.

Resizing during conversion always uses the generic filters with the
selected interp_algo, with nearest using point sampling weights.
Conversion without resizing keeps using the direct conversion kernels.

Assisted-By: Claude Opus 5.5
2026-10-16 13:13:51 +00:00
Timo Rothenpieler fcf1a35c4d avfilter/vf_scale_cuda: describe kernel passes independently
Each pass took its kernel, filter weights and planes from its position
in the chain, and the sample format parameters of its kernels from the
filter's input and output formats. Only the geometry came from the
buffers it reads and writes.

Describe every pass explicitly instead: its kernels, weights, written
plane groups, source and destination buffers, and the formats it reads
and writes. The fixed function and generic paths both build such a
plan, and processing a frame just runs its passes in order, passing
plane groups a pass does not write through from its source. This
makes adding passes that do not just read the input or write the
output, such as for color conversion, possible without special cases.

No functional change.

Assisted-By: Claude Opus 5.5
2026-10-16 13:13:51 +00:00
Timo RothenpielerandReinhard Nißl 34a8add0f2 doc/filters: document scale_cuda enhancements
Co-authored-by: Reinhard Nißl <rnissl@gmx.de>
Assisted-By: Claude Opus 5.5
2026-10-16 13:13:51 +00:00
Timo Rothenpieler ef305e32e8 avformat/imfdec: don't busy-loop if non-Asset in Asset-list 2026-10-09 23:23:09 +00:00
Timo Rothenpieler 493e00dc39 tests/checkasm/sw_rgb: test uyvytoyuv420 and yuyvtoyuv420
Only the yuv422 variants of the interleaved-to-planar converters were
tested, so the yuv420 variants had no coverage at all. The existing
helper works for 4:2:0 output as is, since it compares whole
destination buffers.

Also add single-line sizes covering the slow path, the fast path, and
the fast path with a tail, which would have caught the height-1 overrun
fixed in a previous commit.

Assisted-by: Claude Opus 5.5
2026-10-07 19:45:10 +02:00
Timo RothenpielerandJames Almer ce807952aa swscale/rgb2rgb: round the chroma average in uyvy/yuyv to yuv420p
The C and aarch64 implementations of uyvytoyuv420 and yuyvtoyuv420
average the chroma of each line pair with (a + b) >> 1, while the x86
SIMD loop uses pavgb, which computes (a + b + 1) >> 1. Its scalar tail
then truncated again, so x86 output mixed both.

Use round-to-nearest everywhere: in the C reference, the x86 scalar
tail, and on aarch64 by switching uhadd to urhadd and adding the
rounding bias in the scalar paths.

This changes the output of unscaled yuyv422/uyvy422 to yuv420p
conversion. No FATE test covers it.

Co-Authored-By: James Almer <jamrial@gmail.com>
Assisted-by: Claude Opus 5.5
2026-10-07 19:45:10 +02:00
Timo Rothenpieler 5f9b488216 swscale/aarch64: fix uyvy/yuyv to yuv420p with a height of 1
For yuv420 output, interleaved_yuv_to_planar processes two source lines
per iteration and keeps the pair count, height >> 1, in w5. Both the
fast and the slow path test that counter only at the bottom of the loop,
so a height of 1 starts with w5 == 0: the body runs once, reading a
second source line and writing a second luma line that don't exist,
then w5 wraps to -1 and the loop runs far past the buffers.

A height of 1 is reached with 1-line frames, and also when swscale
slice-threads a conversion and the last slice is a single line.

Skip the pair loop when there are no full line pairs and go straight to
the existing odd-last-line handling. The fast-path tail code reads the
tail width from w9, which is otherwise only set at the loop head, so set
it there too.

uyvytoyuv422 and yuyvtoyuv422 do not pair lines and are not affected.

Fixes: #YWH-PGM45796-1
Reported-by: jpraveenrao

Assisted-by: Claude Opus 5.5
2026-10-07 19:38:55 +02:00
Timo Rothenpieler a70587cc9f avformat/tls_schannel: don't automatically send client cert from users store 2026-09-30 15:00:00 +00:00
Timo Rothenpieler 11de0fc8fd avformat/tls_schannel: support sending client certificates 2026-09-30 15:00:00 +00:00
Timo Rothenpieler 8b9e02cc17 avfilter/vf_convolution: don't assume frame is multiple of 16 pixels wide
Limit the 8-bit column filter to the pixels remaining in the current slice. Pass slice_end - y at all three call sites so both the 8-bit and high-bit-depth column filters receive the correct remaining width. This handles partial 16-pixel blocks at frame and thread-slice boundaries. The non-column callbacks do not use this argument.

Fixes: #YWH-PGM40646-36
2026-09-28 23:13:14 +00:00
Timo Rothenpieler e383b7d532 avcodec/aacsbr_template: don't leak on ff_aac_sbr_ctx_alloc_init failure
Fixes: #YWH-PGM40646-23
2026-09-28 22:43:05 +00:00
Timo Rothenpieler 1de217ad4b avformat/mux: don't let positive write_trailer ret shadow pb failure 2026-09-28 00:13:37 +00:00
Timo Rothenpieler d975849594 avformat/mov: don't leak on realloc failure
Fixes: #YWH-PGM40646-48
2026-09-26 16:02:35 +00:00
Timo Rothenpieler fddc59cf34 Revert "Makefile: output MSVC dependency files as a byproduct of compilation"
This reverts commit 59dd21047e.

The new tool does not properly resolve relative paths on MSYS2, and
potentially other targets.
It tries to make paths relative that are outside of the virtual MSYS
root dir, trying to .. below it. Resulting in invalid paths that send
MSYS make into an infinite loop somehow.
2026-09-20 21:15:41 +02:00
Timo Rothenpieler 4efbbd1543 forgejo/inject-pr-samples: properly flush and close injected sample before hashing 2026-08-31 18:09:20 +00:00
Timo Rothenpieler a621ef4291 avfilter/vf_scale_cuda: consider chroma subsampling for scaling decisions 2026-08-20 12:09:22 +00:00
Timo Rothenpieler 4566eee588 avfilter/vf_scale_cuda: always have valid passes setup 2026-08-20 12:09:22 +00:00
Timo Rothenpieler dda8b8253c avfilter/vf_scale_cuda: extract pass determination into its own function 2026-08-20 12:09:22 +00:00
Timo Rothenpieler 3d7ea1dac4 avfilter/vf_scale_cuda: skip allocating intermediate texture if not needed 2026-08-20 12:09:22 +00:00
Timo Rothenpieler 50a9e34e1b avfilter/vf_scale_cuda: don't try to execute disabled filter passes 2026-08-20 12:09:22 +00:00
Timo Rothenpieler 445cba7f4c forgejo/workflows: add cross fate tests for ppc64/mips64/riscv64
And a full-dependency linux-aarch64 one.
2026-08-12 20:05:32 +02:00
Timo Rothenpieler 2be4a694a3 Revert "fate: disable tests that depend on premultipled conversion"
This reverts commit 336b175c9f.
2026-07-27 20:34:37 +02:00
Timo Rothenpieler 80f14b251b Revert "lavfi: do not send premultiplied alpha to filters not ready for it"
This reverts commit f3431169da, which
introduced various regressions and hangs with at least exr, as
reported by fate, and potentially other codecs that are not as
thouroughly tested.
2026-07-27 20:32:34 +02:00
Timo Rothenpieler 7e1f4dc318 Reapply "avfilter/avfiltergraph: always retry format negotiation after auto-filters"
This reverts commit cd9d265344.
2026-07-27 20:13:00 +02:00
Timo Rothenpieler 1b0c9e3dce forgejo/workflows: block concurrent backport runs for the same pull request 2026-07-19 22:47:17 +02:00
Timo Rothenpieler 162c2784f9 forgejo/workflows: fix backport condition compatibility 2026-07-19 18:29:57 +02:00
Timo Rothenpieler e2acef488f forgejo/workflows: add workflow for automatic backport PRs via labels 2026-07-19 18:10:07 +02:00
Timo Rothenpieler d7fe91e9c3 avutil/hwcontext_cuda: fix build with old cuda headers 2026-07-15 02:24:02 +02:00
Timo RothenpielerandDiego de Souza ef3dcf4ea6 avutil/hwcontext_cuda: add CUarray surface pool support
Extend the internal CUDA frames context (CUDAFramesContext) to manage
block-linear CUarray surfaces alongside the existing pitched-linear
allocations.

When the frames context format is AV_PIX_FMT_CUARRAY, the caller
(e.g. NVDEC) can fill cuarray_desc and cuarray_num_surfaces before
calling av_hwframe_ctx_init(), which then allocates the CUarray
surfaces.

Also add cuda_transfer_data_from_cuarray() to support hwdownload
from CUarray frames to host memory via cuMemcpy2DAsync.

Co-authored-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
2026-07-14 19:45:02 +00:00
Timo Rothenpieler a633df56a4 avcodec/d3d12va_vp9: check size of frame bitstream against available buffer size 2026-07-13 21:13:25 +02:00
Timo Rothenpieler 1307db3d3c avcodec/d3d12va_vc1: check size of frame bitstream against available buffer size 2026-07-13 21:13:25 +02:00
Timo Rothenpieler 26a9f9b3ae avcodec/d3d12va_mpeg2: check size of frame bitstream against available buffer size 2026-07-13 21:13:25 +02:00
Timo Rothenpieler fea3f13a1c avcodec/d3d12va_hevc: check size of frame bitstream against available buffer size 2026-07-13 21:13:25 +02:00
Timo Rothenpieler 19e81f9260 avcodec/d3d12va_h264: check size of frame bitstream against available buffer size 2026-07-13 21:13:25 +02:00
Timo Rothenpieler 7309ad9fd7 avcodec/d3d12va_av1: check slice bitstream size against available buffer size 2026-07-13 21:13:25 +02:00
Timo Rothenpieler e1ef95c779 avcodec/d3d12va_av1: check size of frame bitstream against available buffer size 2026-07-13 21:13:25 +02:00
Timo Rothenpieler 23881eef2b Changelog: document cleanup of nvenc 2026-06-24 18:51:12 +00:00
Timo Rothenpieler 677c61b8fe avcodec/nvenc: reject deprecated global_quality instead of -qp 2026-06-24 18:51:12 +00:00
Timo Rothenpieler 64e6d750f9 avcodec/nvenc: remove legacy option aliases 2026-06-24 18:51:12 +00:00
Timo Rothenpieler a66a022332 avcodec/nvenc: remove deprecated preset aliases 2026-06-24 18:51:12 +00:00
Timo Rothenpieler 2b054bc9e6 avcodec/nvenc: remove legacy cbr and 2pass AVOptions 2026-06-24 18:51:12 +00:00
Timo Rothenpieler dcf339c413 avcodec/nvenc: remove old and long deprecated rc modes 2026-06-24 18:51:12 +00:00
Timo Rothenpieler 6495133363 avcodec/nvenc: remove support for SDK versions older than 11.1 2026-06-24 18:51:12 +00:00
Timo Rothenpieler 5f998e304d avcodec/nvenc: fix b_ref_mode capability check
Turns out it's a bitfield, not straight values.

Fixes #23061
2026-06-10 20:17:44 +02:00
Timo Rothenpieler 3baab604db forgejo/workflows: run at least one test out-of-tree 2026-05-24 00:12:16 +02:00
Timo Rothenpieler 0b52ae8aa6 tests/fate/generic-tags: fix out-of-tree testing 2026-05-23 23:16:57 +02:00
Timo Rothenpieler 1351c2c019 forgejo/workflows: make labeler also removed non-applicable labels again 2026-04-26 15:28:38 +00:00
Timo Rothenpieler 5c35d0b880 avformat/tls_gnutls: actually send client cert if one is provided
Without setting this flag, apparently gnutls will only send the client
certificate according some logic based on what it thinks the server
accepts.
This is not the case a lot of times.
Just force it to send the client cert the user supplied, if one was
supplied, no matter what.

Fixes #22707
2026-04-08 12:26:29 +00:00
Timo Rothenpieler fb088f224b avfilter/vf_vpp_amf: fix build on non-windows
sscanf and sscanf_s are identical for pure number parsing anyway.
2026-03-11 14:12:26 +01:00
Timo Rothenpieler 4f77473b46 forgejo/workflows: update actions 2026-01-24 20:05:07 +00:00
Timo Rothenpieler 7379539685 avcodec/prores_raw: use av_popcount instead of limited lookup table
The calculation can yield bigger values than the lookup table provides.
So just use actual popcount instead.

Fixes #21503
2026-01-18 18:52:55 +01:00
Timo Rothenpieler 69773c404a forgejo/workflows: don't cancel concurrent CI builds for non-PR pushes 2026-01-10 01:53:48 +00:00
Timo Rothenpieler b5d6cfd55b avcodec/notchlc: zero-initialize history buffer
Otherwise a specially crafted bitstream can potentially read
uninitialized stack memory.

Fixes #YWH-PGM40646-37
2026-01-05 13:30:38 +00:00
Timo Rothenpieler 7f44dcfbfb avcodec/notchlc: actually use HISTORY_SIZE to initialize history 2026-01-05 13:30:38 +00:00
Timo Rothenpieler e6184bce67 forgejo/workflows: explicitly name all workflows and jobs 2026-01-02 16:56:03 +00:00
Timo Rothenpieler f6a95c7eb7 avformat/img2dec: reject input images too big to fit into a single packet
Not entirely sure if it should instead use some entirely different
approach here, given that images exceeding 2GB don't seem that crazy
to me, but so far processing such images results in a heap overflow,
since the size addition overflows and a much too small packet is
allocated and its size never checked again when writing into it.

Fixes #YWH-PGM40646-32
2025-12-31 14:37:58 +00:00
Timo Rothenpieler 0d7b8d8913 forgejo/workflows: fix error handling of configure result 2025-12-17 13:28:21 +00:00
Timo Rothenpieler 0be989edcb forgejo/workflows: cat .err files after running fate 2025-12-17 13:28:21 +00:00
Timo Rothenpieler 5e8dcd6db1 forgejo/workflows: run windows fate tests through wine 2025-12-17 13:28:21 +00:00
Timo Rothenpieler 4bb9b46486 avcodec/demux: validate avctx state in has_decode_delay_been_guessed 2025-12-16 22:45:17 -03:00
Timo Rothenpieler 338889c0d9 avfilter/vf_scale_d3d12: fix integer overflow in input framerate calculation
Also removes pointless intermediate variables that caused
the overflow and truncation to happen in the first place.

Fixes #YWH-PGM40646-1
2025-12-08 14:22:16 +01:00
Timo Rothenpieler f7aaa8ecb5 forgejo/workflows: make test shared/static mode more human readable 2025-11-26 23:21:11 +00:00
Timo Rothenpieler d479a4926a forgejo/workflows: make one of the builds shared 2025-11-03 19:03:16 +00:00
Timo Rothenpieler 994a368451 configure: deprecate support for libnpp 2025-09-26 12:31:39 +00:00
Timo Rothenpieler 61835e1d8b avfilter/vsrc_gfxcapture: keep cbdata object alive
Depending on the threading backend the stdlib uses, creating a
mutex/condvar can be quite expensive.
So keep this object alive in the ctx, on which we synchronize via the
uninit mutex anyway.
2025-09-18 01:04:59 +00:00
Timo Rothenpieler c4e537793b avfilter/vsrc_gfxcapture: fix leaking all callback handlers
Fixes #20537
2025-09-18 01:04:59 +00:00
Timo Rothenpieler 1849068c65 avfilter/vsrc_gfxcapture: use free threaded capture frame pool
Apparently, using a normal frame pool in a multithreaded environment
leads to strange resource leaks on shutdown, which vanish when using a
free threaded pool.
2025-09-18 01:04:59 +00:00
Timo Rothenpieler 4879c9f4e2 avfilter/vsrc_gfxcapture: stop capture session before initializing capture thread shutdown
It might have things going on in the background that still need cleaned
up, and this gives it a chance to enqueue them on the dispatch queue.
2025-09-18 01:04:59 +00:00
Timo Rothenpieler 23d9412ff9 avfilter/vsrc_gfxcapture: fix re-using ret variable from outside of lambda scope 2025-09-18 01:04:59 +00:00
Timo Rothenpieler 983fed34f8 avfilter/vsrc_gfxcapture: don't pass pointer to ComPtr
While it does appear to work fine, with all the operator overloads, it
at least has potential for surprises, so pass it by reference instead.
2025-09-18 01:04:59 +00:00
Timo Rothenpieler efd484cb2d avutil/hwcontext_d3d11va: remove D3D11_BIND_RENDER_TARGET restriction for array textures
This was added in 4f78711f9c, with the
commit message claiming that it's a Microsoft restriction that array
textures with ArraySize > 2 cannot be created with
D3D11_BIND_RENDER_TARGET.

I was unable to find any documentation or other references on that, and
a quick test also found it to not be the case. So this patch removes
that restriction.

This enables frame sources, like the d3d11 capture filters, to output
frames in an array texture, which is neccesary to pass those frames as
input to some hardware encoders.
2025-09-17 14:50:41 +00:00
Timo Rothenpieler 00ddb408c5 avfilter/vsrc_ddagrab: support rendering mouse cursor onto array textures 2025-09-17 14:50:41 +00:00
Timo Rothenpieler b8256b82f5 avfilter/vsrc_gfxcapture: remove needless use of atomics 2025-09-16 15:52:11 +00:00
Timo Rothenpieler 61378d6b91 avfilter/vsrc_gfxcapture: fix possible missed wakeup race in capture loop 2025-09-16 15:52:11 +00:00
Timo Rothenpieler 189d0b83b2 configure: pass CFLAGS to ObjC tests again
It was mistakenly removed in 0ce413af9c.

This matches how the Makefiles actually compile ObjC code, and
unlike C++, this seems to actually be benign and various existing
setups rely on that behaviour.
2025-09-15 14:37:43 +02:00
Timo Rothenpieler f85da32e3a configure: make --extra-objcflags show the right default flags 2025-09-15 14:17:49 +02:00
Timo Rothenpieler faba1501d5 avfilter/vsrc_gfxcapture: switch to std::thread
Combining C++ with our w32pthreads does not work out.
The C++ standard lib headers might include pthread.h, which will then
define clashing types with our w32pthread header.

To solve this, switch to using C++ native std::thread.
2025-09-14 21:46:40 +02:00
Timo Rothenpieler 570949822b avfilter/vsrc_gfxcapture: MapWindowPoints can return 0 and still succeed 2025-09-14 20:46:29 +02:00
Timo Rothenpieler d74d3080ff avfilter/vsrc_gfxcapture: make checkheaders happy 2025-09-14 20:33:24 +02:00
Timo Rothenpieler 6e63b978d3 doc/filters: fix missed reference to outdated option name 2025-09-14 15:33:31 +02:00
Timo Rothenpieler 36e374efb0 avfilter: add gfxcapture, Windows.Graphics.Capture based window/monitor capture 2025-09-14 11:45:11 +00:00
Timo Rothenpieler 7856f57533 compat/w32pthreads: fix compatibility with C++ 2025-09-14 11:45:11 +00:00
Timo Rothenpieler 5146b2fb8b configure: don't use MinGW ANSI stdio when using UCRT
MinGWs ANSI stdio is quite slow, and when using UCRT, its extra features
are not needed.
The only troublesome part with ucrt printf is that is disagrees about
the size of "long double", but FFmpeg does not use that anywhere, let
alone prints it.
2025-09-14 11:45:11 +00:00
Timo Rothenpieler 9c8a6ac85c configure: fix naming of some C++/cxx functions being mislabeled as cpp 2025-09-14 11:45:11 +00:00
Timo Rothenpieler 0ce413af9c configure: properly split C/CXX and CPP flags
Right now, CFLAGS like -std=c17 leak onto the C++ compilers commandline,
leading to tons of warnings and even some errors.

Undefining __STRICT_ANSI__ causes strong warnings from the stdlib
headers. So only set it for C.
2025-09-14 11:45:11 +00:00
Timo Rothenpieler 0362cb3806 build: link with CXX when -lstdc++ on linker commandline 2025-09-14 11:45:11 +00:00
Timo Rothenpieler 4c80cda08a forgejo: make aarch64 asm linter part of pre-commit
Needed some minor semantical changes to the shell wrapper, since
pre-commit expects it to exit with an error when applying fixes.
2025-09-13 20:58:29 +00:00
Timo Rothenpieler f8a300c673 configure: fix CUDA compilation with SDK version 13 nvcc
Compute Capability 7.5 is now the lowest supported version.

Fixes #20454
2025-09-08 14:25:44 +02:00
Timo Rothenpieler 883162d5b4 forgejo/workflows: make autolabel workflow always use token from secrets
Using the built-in token seems to only partially work.
And in the latest Forgejo release the issue forcing the use of the
built-in token was fixed with:

https://codeberg.org/forgejo/forgejo/pulls/9025
2025-09-01 03:02:51 +02:00
Timo Rothenpieler e3f01682d7 forgejo/labeler: react to 'labeled' action as well 2025-08-29 01:12:20 +02:00
Timo Rothenpieler 0f873fc07a forgejo/workflows: use built-in token for autolabeler whenever possible 2025-08-22 21:07:33 +02:00
Timo Rothenpieler 5bd866b6ed forgejo/workflows: cat config.log on configure failure 2025-08-21 15:08:50 +00:00
Timo Rothenpieler 8591227e1f forgejo/workflows: also run 32bit fate tests 2025-08-21 15:08:50 +00:00
Timo Rothenpieler 274e00ea84 forgejo/autolabeler: clean up logic a bit and prevent self-looping
The loop-protection only takes effect for the automatic token, not for
ffmpeg-devels PAT.
2025-08-10 01:50:46 +02:00
Timo Rothenpieler e992464f0f forgejo/autolabeler: add some logic to also auto-remove the "New" label 2025-08-09 23:18:57 +02:00
Timo Rothenpieler 5621eee672 avformat/tls: switch on peer certificate verification by default 2025-08-09 00:38:17 +00:00
Timo Rothenpieler aac1cddbeb forgejo/CODEOWNER: forgejo uses regex to match paths 2025-08-08 18:14:58 +02:00
Timo Rothenpieler 16d663d371 forgejo/workflows: add pre-commit based linting 2025-08-03 13:48:47 +02:00