6304 Commits
Author SHA1 Message Date
Kyle Swanson 58584087cf avfilter/vf_libvmaf: pass frame colorimetry to libvmaf
Signed-off-by: Kyle Swanson <kswanson@netflix.com>
2026-10-27 20:01:52 +00:00
Ruonan d31915e9dc configure: use pkg-config for libmp3lame when available
LAME 3.101 adds pkg-config support, generating and installing lame.pc.
Its autotools build also replaces the bundled mpglib decoder with
external libmpg123. Static libmp3lame builds with decoding support
therefore require additional libraries when linking.

The existing check links only against libmp3lame and libm, ignoring
pkg-config metadata and failing with undefined mpg123_* references.

Try pkg-config first to obtain the compiler and linker flags, honoring
the configured pkg-config flags for static dependencies. Keep the
existing library check as a fallback for older LAME releases and other
installations without usable pkg-config metadata.

Signed-off-by: Ruonan <yu_ruonan@outlook.com>
2026-10-26 19:24:59 +00:00
Niklas Haas fd92307c40 avformat/jpegmpfdec: add JPEG Multi-Picture Format demuxer
This format is only auto-probed when we can be certain that the image is a
JPEG MPF file; as evidenced either by the extension (.mpo), or by the
presence of an MPF APP2 marker or an ISO21496 gain map stub.

This does require parsing possibly arbitrarily far into the file, since
the MPF header can be after a > 2 KB EXIF header; and this matches files
produced in the wild (by e.g. Apple's jpeg ultra hdr encoder).

The probe function returns AVERROR(EAGAIN) to request more data until it
reaches either the MPF marker or the start of the entropy coded data. If
the probe limit or EOF is hit first, the best scoring other format wins,
e.g. image2 for regular .jpg files.

A few additional notes:

- libultrahdr produces quite spec-incompliant files which we unfortunately
  have to work around

- since the MPF format table can be arbitrarily far from the header, we
  also need to store possibly a lot of data and re-return it to the caller;
  I have followed the convention established by e.g. fitsdec.c of just keeping
  a spare AVPacket for bytes already read during header parsing (cf. also
  jpegxl_anim_dec.c)

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-10-23 20:33:53 +00:00
Zhao Zhili 2f74158ddf avformat/network: add a wakeup channel for blocking waits
ff_network_wait_fd() can only return after its poll() slice, so a
thread blocked in it notices a request from another thread up to
POLLING_TIME late. Add a one-shot channel that a second thread can
signal to end the wait at once, together with a wait function that
polls it next to the socket.

The channel is an eventfd where available and a pipe otherwise. On
Windows neither can be waited on together with sockets, so it is a
loopback datagram socket connected to itself.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-10-23 17:36:15 +00:00
James Almer bd030344b7 fftools/ffmpeg_demux: automatically apply Alpha layer on Alpha Stream Group input
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-23 11:22:12 -03:00
Kyle Swanson 179d083493 avfilter/vf_libvmaf: use vmaf_picture_wrap() if available
Signed-off-by: Kyle Swanson <kswanson@netflix.com>
2026-10-22 20:55:23 +00:00
Kacper Michajłow 8cc7403a43 configure: do not enable leftover funcs in check_class_headers_cxx
The function probes classes and not function. This was copy paste error
that ended up here.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-10-21 23:31:13 +00:00
Kacper Michajłow 4288315738 configure: store probed symbols in a volatile intptr_t
Cast each probed symbol to intptr_t and store it in a static volatile
object instead of casting it to long in a wrapper function whose address
main() masks. The volatile stores keep the references under LTO and
intptr_t avoids the pointer truncation warnings on LLP64 targets
(-Wpointer-to-int-cast). Also deduplicate it with check_host_lib.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-10-21 23:31:13 +00:00
Michael Niedermayer 4d218e16d4 avutil/hwcontext_cuda: allocate transfer buffers from page-locked memory
The device transfers directly to and from page-locked host memory,
while pageable memory is copied through a buffer of the driver.
Pageable memory remains in use when page-locked memory cannot be
allocated and with ffnvcodec headers that lack cuMemHostAlloc().

As a page-locked source is read by the device after the upload
returns, uploads now wait for the transfer to complete, like downloads.

ffmpeg -hwaccel cuda -i hevc.mp4 -f null - on a RTX 5090, mean of 10
runs: 1080p 1773 -> 1855 fps, 2160p 497 -> 533 fps, 4320p 112 -> 124 fps.

Assisted-by: Claude
2026-10-21 19:32:23 +00:00
Zhao Zhili 47ece046a6 configure: stop probing for pthread_cancel
HAVE_PTHREAD_CANCEL has no consumers left: udp no longer cancels its
receive thread, and the dnn guards were already removed.

Android bionic and Windows w32threads do not provide pthread_cancel(),
and on Darwin a cancel request made while cancellation is disabled may
never acted on (see PR #24886). Probing for pthread_cancel may invite
new code to depend on it.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-10-21 17:37:13 +00:00
Ruonan f3aa9ceb4b configure: remove obsolete OpenGL option
The OpenGL output device was removed, but configure still exposed --enable-opengl and probed OpenGL headers and functions.

Remove the stale option, dependency checks, configure probes, and related device metadata.

Signed-off-by: Ruonan <yu_ruonan@outlook.com>
2026-10-21 08:32:04 +00:00
Michael Niedermayer 1c767fe664 avutil/mips/mmiutils: provide the Loongson MMI mnemonics GNU binutils lacks
GNU binutils spells the MMI instructions pxor, pand, por, pnor, ssrld
and sslld as xor, and, or, nor, dsrl and dsll on floating point
registers, with -march=loongson2e/2f/3a and since 2.32 with
-mloongson-mmi; the p-named entries in its opcode table are the R5900
instructions on general purpose registers. The other 43 p-named MMI
instructions FFmpeg uses are spelled the same by everyone. Loongson's
gcc toolchain accepts both spellings (ebedd26eef), the binutils 2.24
of their cross-gcc-4.9.3-n64-loongson-rc6.1 only the GNU ones.

Since 903c5d58f0 configure probes pxor and so silently disables MMI
with every GNU binutils. Probe Loongson's spelling first and fall
back to the GNU one together with assembler macros that define the
six names, as asmdefs.h already does for parse_r. The macros assemble
to the same encodings as the GNU spelling with binutils 2.24, 2.28
and 2.42.

The GNU fallback is limited to little-endian mips64: the MMI code does
not build for O32 and its unaligned loads assume little-endian.
2026-10-20 17:27:32 +00:00
Steven Xiao 07ab463f9f avfilter/dnn: implement D3D12 DirectML zero-copy for ONNX Runtime backend
This commit enables the DNN video filter to run entirely on the GPU
for the full D3D12 pipeline (decode, AI inference, and encode)
without ever copying frames back to system memory, making it
significantly faster on D3D12 hardware.

Benchmarked the new zero-copy D3D12/DirectML DNN pipeline against
the existing CPU round-trip pipeline on three major GPU vendors; up
to 10x throughput improvement was measured across every vendor.

Add dnn_onnx_d3d12, a helper that binds the DirectML execution
provider to a D3D12VA input frame's own device and does NV12
texture<->tensor conversion on the GPU (CopyTextureRegion + compute
shaders), avoiding a host round-trip.

dnn_processing negotiates this automatically for D3D12 NV12 input
with device=dml. Software-frame input retains the host I/O path.
D3D12 input requires successful DirectML negotiation; unsupported
hardware-input configurations fail during configuration. Currently
limited to single-channel FLOAT/NCHW models; chroma bypasses the
model and is copied/upscaled on the GPU. At runtime, DirectML.dll
and d3dcompiler_47.dll must be loadable from the application
directory or System32.

Example usage:

  # Zero-copy pipeline
  ffmpeg.exe -y -loglevel info \
    -hwaccel d3d12va -hwaccel_output_format d3d12 \
    -i input-1920x1080.mp4 \
    -vf "dnn_processing=dnn_backend=onnx:device=dml:model=ecbsrnet_y_fused.onnx:input=input:output=output" \
    -c:v h264_d3d12va -bf 0 -c:a copy \
    output_2x_sr_zero_copy.mp4

  # CPU round-trip pipeline
  ffmpeg.exe -y -loglevel info \
    -init_hw_device d3d12va=dev -filter_hw_device dev -hwaccel d3d12va \
    -i input-1920x1080.mp4 \
    -vf "dnn_processing=dnn_backend=onnx:device=dml:model=ecbsrnet_y_fused.onnx:input=input:output=output,hwupload" \
    -c:v h264_d3d12va -bf 0 -c:a copy \
    output_2x_sr_round_trip.mp4

Signed-off-by: younengxiao <steven.xiao@amd.com>
2026-10-19 21:08:42 +00:00
Michael Niedermayer d20d75cb9b avformat: remove the asf_o demuxer
asf_o is a second, non-default implementation of the ASF demuxer next
to asfdec_f.c. Security issues keep being reported against it, so it
is a maintenance burden without a benefit over the default demuxer.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-10-19 19:16:58 +00:00
Ramiro PollaandClaude Opus 5.5 a5f05c8615 swscale: gate Vulkan support on the SPIR-V backend being available
If Vulkan was enabled but no SPIR-V headers were found, the Vulkan code
in swscale was still compiled, but no backend was exported. Vulkan
frames were still reported as supported by sws_test_hw_format().

Add a swscale_vulkan configure symbol, enabled when Vulkan and either
SPIR-V header are available, and use it for all Vulkan code in swscale
and for the spirv FATE tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:58:00 +00:00
Tom Needham 0ec6a0872d libavcodec: Add Infinity IMM6 Decoder
Signed-off-by: Tom Needham <06needhamt@gmail.com>
2026-10-18 20:57:48 +00:00
Michael Niedermayer 4c838cbfa1 ffplay: list directories and play files chosen from the list
The o key lists the directory of the input, local or remote, in the
list. Enter or a click lists the chosen directory or plays the chosen
file instead of the input once it opened, so a file that is no media
leaves the input playing. Directories come first, hidden entries are
left out, and the popup of a file shows its size.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer 918c5ca2aa ffplay: render the list with libass directly
The strips were rendered by the ass filter over a color source in a
filter graph, whose generic blending took most of the time. libass now
renders each strip and its glyphs are composited over the strip
background where they cover it; a row strip at 1080p takes 0.47 instead
of 1.29 ms. ffplay suggests libass instead of the ass filter and no
longer selects the color filter.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Martin Storsjö cc234e7b5b avcodec: Add encoder wrapper for fdk-xhe-aac
This is a new library, separate from the existing fdk-aac (but
built from the same upstream repo), for encoding xHE-AAC.

This library has the same traits as fdk-aac; it's being distributed
from Fraunhofer to Android Open Source Project, and further
repackaged and distributed through opencore-amr [1] (and in a
personal repo on github at [2]). It is distributed under the
same license as fdk-aac.

This is an initial, barebones wrapper around the library - not
all features of the library are hooked up currently.

In particular, do note that the wrapper currently only handles
loudness in the live operating mode (single pass), where encoding
is done with a single loudness level set before encoding. This may
affect the dynamics of the input.

The preferred and intended mode of use for the fdk-xhe-aac encoder
is for it to be used in two pass mode, which handles the loudness
properly. The two pass operation mode is not set up in the
encoder wrapper yet, but may be added later.

[1] https://sourceforge.net/projects/opencore-amr/
[2] https://github.com/mstorsjo/fdk-aac
2026-10-12 22:37:10 +03:00
Felipe Araújo 1ae485ba98 avformat/file: add Windows handle protocol
Like the fd protocol, but takes a raw Windows HANDLE instead of a CRT file descriptor.
On Windows, CRT file descriptors cannot be reliably passed to child processes, so
HANDLEs need to be used instead.

Signed-off-by: Felipe Araújo <felipdsa21@outlook.com>
2026-10-11 23:10:44 +00:00
Josef Schlehofer 3fe6c8dee2 configure: do not probe dcbzl when it is disabled
The dcbzl probe runs unconditionally and re-enables dcbzl whenever the
assembler accepts it, overriding --disable-dcbzl and the "disable dcbzl"
in the e500 and e500v2 --cpu cases. e500 cores trap on dcbzl, so ffmpeg
dies with SIGILL in ff_blockdsp_init_ppc() on a P2020 (e500v2) as soon
as it opens an MPEG-2 decoder.

Only run the probe when dcbzl is not disabled.

Fixes: #24747
Suggested-by: Michael Niedermayer <michael@niedermayer.cc>
Original-patch-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2026-10-09 16:47:16 +00:00
Michael Niedermayer 104edd0777 configure: validate DeckLink headers with the C++ compiler
After CFLAGS stopped being passed to the C++ compiler, supplying the
DeckLink SDK include path only through --extra-cflags still passed
configure but failed when building the DeckLink C++ sources.

Compile the DeckLinkAPI.h check as C++ and check the SDK version in both
languages. The C wrappers also include DeckLinkAPIVersion.h, so document
that both --extra-cflags and --extra-cxxflags need the SDK include path.

Fixes: 0ce413af9c
Fixes: #23072

Assisted-by: Fairy
2026-10-05 21:02:55 +00:00
Kacper Michajłow 7a8b3510e3 configure: probe warning options with -Werror
GCC warns when a warning option is valid for another language and no -W
option controls that warning, so after 45ec2cae19 dropped -Werror from
the probe, -Wno-pointer-sign passed the C++ check and ended up in
CXXFLAGS. Clang likewise warns about unknown warning options. -Werror
covers both, so use it directly instead of the Clang specific -Werror=
flags, and translate it to -WX for MSVC, which does not accept the GCC
spelling.

Using -Werror already includes more specific warnigns, so remove
`unknown_warning_cflags` and just use -Werror.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-26 23:16:04 +00:00
Zhao Zhili 75f7e9be9a configure: make threads a hard dependency for dnn
All DNN backends (TensorFlow, OpenVINO, libtorch, ONNX Runtime) require
multithreading at runtime, and the DNN async inference path uses pthread
APIs directly. Disabling thread support while building DNN is not a real
use case.
2026-09-26 15:32:47 +00:00
Michael Niedermayer 15586ccb36 ffplay: show a list of the chapters on screen
Page up/down fade in a list of the chapters around the current one and
fade it out again half a second after the last key press, "l" keeps it
on screen, and while it is kept down/up move the selection. Enter seeks
to the selected chapter and the mouse wheel moves the selection whenever
the list is visible. Each entry shows the chapter's number, its title
with the artist beneath it, both clipped to their column, and its
length; a bar at the left edge marks the chapter being played and moves
along with playback.

The ass filter renders the list onto a transparent canvas the size of
the panel, only when its content changes, and SDL composites the result
as a texture whose alpha modulation does the fading. The video path is
untouched and nothing is drawn while the list is hidden. The list is not
available with the Vulkan renderer, which bypasses SDL rendering.

Assisted-by: Claude
2026-09-26 11:36:30 +00:00
Kacper Michajłow 28ab05da84 configure: create native symlinks on Windows and test them with the compiler
MSYS2 emulates ln -s by copying the target unless native links are
requested, so the src link test never passed there and out of tree
builds on Windows got the absolute source path in every -I flag and
dependency file. Native links need Developer Mode or the symlink
privilege. When that is missing, both MSYS2 and Cygwin fall back to link
types only their own tools can read, which the shell test accepts while
the compiler cannot open a header through them.

Request native links, create the src link itself instead of probing a
temporary one, and keep it only if it is a symbolic link and the
compiler can preprocess a header through the src path. A copying link
tool would otherwise pass the compiler test with a stale snapshot of
the tree, so anything else the tool created is removed. That also drops
the temporary files and their cleanup.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-25 10:56:47 +00:00
Kacper Michajłow 9fc3af90c4 avutil/mem: keep poisoned memory undefined for MSan and Valgrind
CONFIG_MEMORY_POISONING fills fresh allocations with a pattern. Memory
checkers that track initialization take that fill for real data and stop
reporting reads of it, which defeats the purpose of the fill.

MSan is told in every MSan build, its cost is expected there. The
Valgrind client requests are only compiled in memory poisoning builds,
since they would otherwise cost every allocation a few instructions in
any ordinary build made where the Valgrind headers are installed.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-24 18:08:16 +00:00
Kacper Michajłow a4ccc8bf93 avcodec/vulkan_video: fix compilation when glslc is not available
d49fcd7f82 moved seg_gather.comp.spv.o to CONFIG_VULKAN, so every build
with Vulkan enabled now compiles GLSL, and one without a GLSL compiler
fails with "glslc: command not found". Vulkan itself does not need a GLSL
compiler.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-24 15:26:13 +00:00
Kacper Michajłow 61f45bd002 configure: link compiler-rt builtins for __int128 on Clang targeting MSVC
Clang targeting MSVC compiles __int128, but nothing links the compiler-rt
builtins that implement 128-bit division. The clang driver defaults to
the libgcc runtime, which adds nothing on MSVC, and link.exe or lld-link
invoked directly do not know the library either. Since b2b37802a9 the
check therefore fails for these toolchains and libswscale falls back to
AVInteger.

Ask the driver for the library name and retry the check with it. The
driver and lld-link search the clang runtime directory on their own, so
this covers linking through clang as well as calling lld-link directly.
link.exe only finds the library through LIB, where the copy shipped with
MSVC is built with cl and lacks the 128-bit routines, so the check keeps
failing there and nothing changes for such setups.

The library is recorded in int128_extralibs and pulled in by libswscale,
the only user of av_int128, the same way libatomic is handled.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-24 06:39:57 +00:00
Kacper Michajłow 741ad68719 configure: drop the unreachable non-pthread atomics abort
Both non-pthread thread backends depend on atomics_native, so
check_deps has already disabled them, or died for an explicit request,
before this line runs. The remedies it suggests refer to the pthread
emulation and the gcc builtins backend, both removed in 8c185ef4e7.
The remaining case, C11 atomics missing on a pthreads target, is still
caught by the abort at the compat include path selection.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-23 19:34:04 +00:00
Kacper Michajłow 9b05547166 configure: define atomics_native as any real atomics implementation
atomics_os2 was not a backend. It has no compat directory and nothing
reads it. It aliased stdatomic without a target guard, so it enabled
atomics_native on every platform with C11 atomics as a side effect,
only to satisfy the os2threads dependency on OS/2.

State the rule directly instead. atomics_native is stdatomic or the
win32 compat backend, and every non-pthread thread backend depends on
it. os2threads stays enabled exactly when stdatomic is available, and
the shared protocol can depend on atomics_native alone, without the
internal stdatomic check as a dependency.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-23 19:34:04 +00:00
Kacper Michajłow 9856da099b configure: update the win32 atomics backend check
Nothing has called MemoryBarrier() since the backend rewrite. Check the
_InterlockedOr directly and drop HAVE_MEMORYBARRIER which is not used
anywhere.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-23 19:34:04 +00:00
Michael Niedermayer 9449b1ae68 configure: select bswapdsp for the h264 and vvc decoders
Found during triage/review of the security report 6f1DsDI0TxJu
2026-09-23 18:59:06 +00:00
Kacper Michajłow 3fc4f99a79 avformat/shared: use av_file_map_shared() and drop the mmap dependency
This makes this available on Windows too. The mmap and unistd_h
dependencies are gone, the protocol builds everywhere and
av_file_map_shared() reports the platforms without shared mappings at
runtime.

The cache file is no longer shortened when it is longer than the known
file size, the mapping simply covers its beginning.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-23 16:52:56 +02:00
Martin Storsjö 52f05ac780 configure: Rewrite "gcc" into "g++" for clang type compilers as well
Many toolchains provide compilers named "gcc" (or "<triple>-gcc")
that still are identified as cc_type="clang" by our configure.

For these, rewrite "gcc" into "g++", rather than rewriting "cc" into
"c++" (which results in "gc++").

This fixes the default value of cxx on macOS when no compiler is
specified by the user (where we default to "gcc") after
662ea4a3e7.
2026-09-22 11:41:51 +03:00
Kacper Michajłow cb5a63736a Reapply "Makefile: output MSVC dependency files as a byproduct of compilation"
This reverts commit fddc59cf34.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-21 21:37:57 +00:00
Kacper Michajłow 662ea4a3e7 configure: derive cxx from cc
configure never looks at the C++ compiler on its own. There is no
probe_cc for it, and CXXFLAGS take the C compiler's flag filter and
object conventions, so one toolchain for both is already assumed. Make
it so by deriving cxx from cc the way as, objcc and ld are.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-21 21:34:23 +00:00
Kacper Michajłow 4b39049f44 configure: let the C compiler decide check_allcflags
b4bd8d1f64 made the status the AND of both compilers and 50e64f97d9 put
it in charge of the arm, mips and darwin decisions. That couples C to
C++ both ways. A C rejection stops C++ from being probed at all, and a
C++ rejection is reported as if C had rejected too. That is not
expacted. Separate the probe, C++ sets flags that it understand now and
the return status of check_allcflags() is C only.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-21 21:34:23 +00:00
James Almer 23b79c0428 ffplay: merge LCEVC streams into the base stream
Signed-off-by: James Almer <jamrial@gmail.com>
2026-09-21 18:07:40 -03: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
Kacper Michajłow bf56c9459d configure: make the SPIR-V header flags depend on vulkan
The SPIR-V header probe runs while vulkan is still auto-enabled, before
check_deps has a chance to disable it for a missing dependency such as
threads.

This fixes builds without threads, which would fail to link:

  error: undefined symbol: backend_spirv
  referenced by ops.c:42 (libswscale/ops.c:42)

Fixes: 2b6fbcad6d

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-20 11:50:57 +00:00
Shreesh Adiga d64b47f259 avutil/cpu: add aarch64 CPU feature flag for ARM AES 2026-09-16 06:29:59 +00:00
James Almer 5b9a3ad71a avfilter/vf_signature: remove dependency on libavformat
av_get_frame_filename() is a trivial function that uses no lavf API, only lavu,
so it can be duplicated here to save an unnecessary dependency.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-09-15 00:24:07 -03:00
Kacper Michajłow 8edbc16719 configure: allow sanitizers for msvc toolchain
MSVC spells the option the same way, see
https://learn.microsoft.com/en-us/cpp/build/reference/fsanitize, so the
existing handling already covers it.

This allows `--toolchain=msvc-asan`.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-14 21:09:36 +00:00
Kacper Michajłow 77b9dc4159 configure: check sanitizer flags before adding them
Configure now will die and report correct error message if
unsupported sanitizer is requested. Instead of adding flags
unconditionally.

The linker flags are added only if supported. Some compilers like MSVC,
does not need/want them. The same goes for -fno-omit-frame-pointer which
is added only when supported now.

Probing needs the temporary files and the probed tools, neither of which
exists where the toolchain is selected, hence the requested sanitizers
are gathered and actual probe is defered to after toolchain is
established.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-14 21:09:36 +00:00
Kacper Michajłow 45ec2cae19 configure: drop -Werror from the C++ warning probe
0ce413af9c gave check_disable_warning() a C++ checks at a time when
unknown_warning_flags was a single set probed with test_cflags, so it
said nothing about what the C++ compiler accepts. The -Werror was added
as a glue that reject C only flags from C++ compilation and probe time.
However, after 005510501e made those flags per language and
unknown_warning_cxxflags is now probed with test_cxxflags, so the Werror
is no longer relevant.

This is not only cosmetic change, because -Werror itself is not valid
flag for MSVC, all tests were failing there.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-14 21:09:36 +00:00
Kacper Michajłow 50e64f97d9 configure: apply common flags to C++ as well
0ce413af9c stopped prepending CFLAGS to CXXFLAGS and converted the call
sites that have to reach every language, but not these. So, things were
silently not added for C++ compilation.

The impact is small, because we have only handful of C++ files, but
still this needed fixing.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-14 21:09:36 +00:00
Kacper Michajłow b4bd8d1f64 configure: drop the redundant ObjC flags from check_allcflags
ObjC is compiled with the C flags. OBJCCFLAGS in ffbuild/common.mak
includes CFLAGS and test_objcc() passes it as well. OBJCFLAGS is meant
for what ObjC needs beyond C. No need to duplicate all flags there.

They were needed for the short while 0ce413af9c had $CFLAGS taken out of
test_objcc(). 189d0b83b2 put it back and left the duplication.

Note that the issue is not only cosmetic duplication, for example MSVC
cannot compile ObjC, so the check_allcflags never suceeded there. While
the ObjC were checked last, flags were added for C/CXX, but the return
value was always false.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-14 21:09:36 +00:00
Jun Zhao 6e9100c648 lavc: add ASTC encoder/decoder via libastcenc
Add the ASTC codec ID and descriptor together with encoder and decoder
wrappers for Arm's astc-encoder library. Support the four ASTC profiles,
2D and 3D block footprints, LDR RGB/RGBA input, and floating-point HDR
input without clamping the decoded result to 8-bit.

Keep the ASTC image dimensions and compressed block sizes bounded by the
format and packet limits, and pass KTX-provided color profile metadata to
the decoder when no explicit profile was selected.

libastcenc is distributed under the Apache License 2.0, so the library is
only available when FFmpeg is built with --enable-version3; list it with
the other libraries that require that option.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2026-09-14 12:44:07 +00:00
Kacper Michajłow eaebdc491d configure: enable shared protocol also with native atomics
stdatomic.h is always available, either the native or the compat version,
so the stdatomic dependency was always incorrect. The stdatomic check is
internal to configure, it only decides whether the compat version has to
be added, and should not be used as a dependency of any code. Before the
recent compat/atomics rewrite the compat headers were not compatible with
the way shared.c uses atomics, so the protocol was silently disabled with
them, probably by accident. The compat win32 version now works just fine
with shared.c.

What the protocol does need are atomic operations that synchronize
processes sharing the cache. The dummy backed is excluded, we need
working atomic operations even in single-threaded build. However small,
such configuration is, every relevant target should have stdatomic
available anyway.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-09-14 04:35:12 +02:00