6195 Commits
Author SHA1 Message Date
Niklas HaasandNiklas Haas 976e18fdef swscale/x86: use correct HOSTCC_E flag instead of CC_E
HOSTCC and CC might be completely different compilers.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-10 15:04:50 +00:00
Frank PlowmanandJames Almer 6bfc7214d1 configure: Declare MPEG decoder/SEI dependencies on ITU-T35
Forgotten in 070bd112be
2026-06-09 19:07:14 +00:00
Niklas Haas 48a42b5f21 configure: add -P to $CC_E flag
This suppresses the addition of #line directives in the preprocessed output,
which is what we want when we're invoking the hostcc just to preprocess some
files. (Currently, this variable is only used for configure-internal checks
anyways, but I want to use it to preprocess a NASM file)

On MSVC/Intel, /EP is the equivalent syntax, though we use -EP instead for
consistency.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-08 18:24:45 +02:00
Martin Storsjö 17c25ee550 configure: Include stdbit_h in the checkasm config header 2026-06-05 11:46:38 +00:00
Hendrik Leppkes 4eec440e36 configure: filter out -D options from msvc link
The linker does not understand or require -D (define) options, and
unknown options are treated as errors.

Fixes building with MSVC and SChannel, which regressed after
1e031d4af7
2026-06-05 07:39:40 +00:00
Kacper Michajłow 65ae944d34 configure: set -mpreferred-stack-boundary=4 for Windows 32-bit targets
Win32 ABI only mandates 4 bytes stack alignment. GCC 16 changed default
align and no longer works with ffmpeg expectations.

Fixes crashes on aligned memory access in mingw32 gcc 16 build.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-06-05 03:17:43 +02:00
Martin Storsjö 4569ab7eaa configure: Provide checkasm_header_config_generated.h as well
This is required for overriding defines that exist in the public
headers of checkasm, when e.g. building with assembly disabled
for an architecture where we normally would use the checked_call
wrapper.

This fixes a leftover in how checkasm is integrated into the
ffmpeg build system; there were many different approaches
considered for fixing --disable-asm, and the ffmpeg configure
integration didn't end up matching the final solution.

This fixes building with --disable-asm.
2026-06-04 18:26:50 +00:00
Martin Storsjö c2f499d979 configure: Fix a mismatched include guard end comment 2026-06-04 18:26:50 +00:00
Niklas Haas 56de70a2e6 avformat: add shared concurrent block cache protocol
This adds a new protocol shared:URI which is distinct from the existing
`cache:` in that it is explicity designed to be thread-safe and cross-process,
enabling multiple ffmpeg processes (or multiple ffmpeg decoders within the same
process) to share a single cache file, for e.g. a remote HTTP stream. As such,
it uses a radically different internal design.

To facilitate zero-knowledge cross-process interoperability, the cache file
itself is just a memory-mapped representation of the underlying file data,
which has the side benefit that the resulting cache file will contain a
working copy of the streamed file (assuming the stream was read to
completion).

To keep track of which regions are cached and which are not, we use a
secondary file that contains a minimal header along with a static bytemap of
blocks within the file. This secondary file is also used to store metadata
such as the filesize, if known, as well as marking "failed" blocks.

Both files can grow dynamically in order to accommodate larger/growing files,
and can be atomically updated (through the use of shared space maps). I have
extensively checked the space map initalization and update code for race
conditions, and I believe the current design to be solid.

That said, it is the user's responsibility to some extent to ensure that the
same URI is not used for different streams, as we rely on the URI to uniquely
identify the cache files. That said, we use a cryptographic hash with
sufficient collision resistance to protect against possible abuse. The lack of
any implicit default on `-cache_dir` also means that `shared:` can't be enabled
via URL injection to possibly access random files on the disk (or intentionally
leak content from other streams with similar URIs, even if the cryptograhic
hash function is broken).
2026-06-04 17:48:12 +02:00
Niklas Haas c27a3b12e3 configure: re-indent after previous change
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-04 11:44:52 +02:00
Niklas Haas 310ff99f62 configure: support building without checkasm
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-04 11:44:52 +02:00
Niklas HaasandMartin Storsjö 3b1d7cd1f7 tests/checkasm: switch to shared libcheckasm implementation
The checkasm tool originated in x264. It was later rewritten and
modernized for FFmpeg (and relicensed to LGPL). For the dav1d
project, it was relicensed again to 2-clause BSD (with permission
from the relevant authors).

The FFmpeg and dav1d implementations of checkasm have since evolved
independently (with some amount of ported code between the two,
with relicensing permission where relevant).

To synchronize the development, and to make it possible to easily
adopt checkasm in other projects, it has been split out into a
standalone project/library on its own, developed at
https://code.videolan.org/videolan/checkasm/.

That version has all the features of checkasm in both FFmpeg and
dav1d, and has got a number of extra improvements on top:

- More/fixed tests (e.g. properly clobbering high bits of 32-bit registers
  on most platforms),

- Vastly improved overall performance / runtime for benchmarking, due
  primarily to the ability to scale the runtime of each test to that test's
  complexity.

- Much more robust statistical analysis of benchmarking results; including
  robust outlier rejection, an estimation of the histogram, and the ability
  to report the variance / stddev in addition to the (trimmed) mean.

- Interactive HTML and JSON output formats in addition to CSV/TSV.

- More readable and user-friendly output across the board, especially for
  failures and data dumps (e.g. also showing errors inside padding bytes).

- Better cross-platform support, including dynamic fallback of timer
  implementations on ARM platforms, a better RISC-V and AArch64 harness,
  and more.

  On AArch64, it tests which timer out of pmccntr_el0, linux perf,
  macos kperf, cntvct_el0 is available, without the user needing to
  configure things, and falling back on clock_gettime if neither of
  them can be used. This means one automatically gets the best
  available timer, if userspace access to pmccntr_el0 has been
  unlocked with a kernel module, or if one has permission to use
  the perf API, or if the cntvct_el0 is exact enough to be useful.

  On AArch64 macOS, there is now a test harness that catches clobbered
  registers and stack clobbering, like on other platforms.

- An option for setting affinity, for benchmarking on heterogenous
  core systems. (On Linux, this is already easily done through
  taskset, but on Windows, the checkasm built in option makes it
  possible there as well, and portable.)

- Printing of the tested CPU core name, where possible.

To integrate this external implementation of checkasm into FFmpeg,
without having to build libcheckasm as an external library, the upstream
sources are added as a git subtree, and integrated into the FFmpeg
build system as a foreign source.

For the long and storied history of how we arrived at this solution,
see: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22546

The relevant config headers for checkasm are generated by configure,
and the sources are built as part of the main ffmpeg build. The
upstream sources, while they use meson as primary build system,
are structured to make it easy to build as part of a foreign build
system.

The existing testcases are mostly kept untouched (only three minor
changes are required, in crc.c, sw_ops.c and vp8dsp.c), while the
majority of the logic from checkasm.c, checkasm.h and the arch
specific assembly files are removed, replaced with the external
implementation.

Co-Authored-By: Martin Storsjö <martin@martin.st>
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-04 11:44:52 +02:00
James Almer c500c786ab avcodec/libaomdec: use the ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer e40dd45f0d avcodec/libdav1d: use the ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer 19b3d47007 avcodec/av1dec: use the ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer 4fcd2349ff avcodec/itut35: add ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
Diego de SouzaandTimo Rothenpieler 93f653f95c configure: enable ffnvcodec, nvenc, nvdec for aarch64 Windows
Adding support to build FFmpeg with HW accelerated decode (nvdec) and
encode (nvenc) on aarch64 Windows, covering both the MinGW (mingw32/
mingw64) and MSVC (win32/win64) toolchains. The dynamically-loaded
NVIDIA codec headers and the CUDA loader are architecture-agnostic, so
the only gate was the target_os check in the aarch64/ppc64 branch.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
2026-06-01 17:00:46 +00:00
Kacper Michajłow 6026988b75 avcodec/bsf: add dovi_split BSF
Allows splitting interleaved BL+EL HEVC bitstream into separate streams.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 16:58:23 +02:00
Marvin ScholzandLynne 61a0b8fb41 avcodec: remove CELT decoder
libcelt, which it depends on, was not updated in a very long time and is
considered deprecated, as Opus exists which has a CELT mode. Therefore
remove standalone CELT decoding support.

It was already broken since b8604a9761,
11 years ago, and no one noticed and complained.
2026-05-22 09:33:52 +00:00
Lynne a189413832 vf_blackdetect_vulkan: port to compile-time SPIR-V generation 2026-05-22 14:06:03 +09:00
Lynne 2e25da3121 vf_nlmeans_vulkan: port to compile-time SPIR-V generation 2026-05-22 14:06:01 +09:00
crueterandKacper Michajłow 77c3a7349e configure: ignore -I directives on MSVC for link flags
Signed-off-by: crueter <crueter@eden-emu.dev>
2026-05-20 01:07:24 +00:00
crueterandKacper Michajłow 91f8703536 configure: prefer negative-or case for MSVC linker -L flags
This is preferred over positive-and casing because it can mess with
`set -e`.

Signed-off-by: crueter <crueter@eden-emu.dev>
2026-05-20 01:07:24 +00:00
Ramiro Polla a3d8ba6613 avcodec/webp: add support for Animated WebP decoding
Fixes: 4907

Adds Animated WebP feature according to spec:
https://developers.google.com/speed/webp/docs/riff_container#animation

Original work by Josef Zlomek <josef@pex.com>
and Thilo Borgmann <thilo.borgmann@mail.de>

Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
2026-05-19 11:36:10 +02:00
Lynne 5ad8c67e6c apv_decode: add a Vulkan hwaccel 2026-05-19 17:43:53 +09:00
wangbinandLynne 239c679c54 lavc: add ProRes RAW videotoolbox hwaccel 2026-05-17 03:47:23 +00:00
Andreas Rheinhardt b6d2a0fc66 configure: Add missing apv_metadata->cbs_apv dependency
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-08 09:35:35 +02:00
Andreas Rheinhardt 6a59c847b5 configure: Redo enabling cbs in lavf
Right now, the cbs_type_table (the table of all CodedBitstreamTypes
supported by CBS) is empty unless cbs_apv and cbs_av1 is enabled.
The latter are only enabled in configure if they are needed in lavc.
This means that the mov muxers (the only users of cbs-in-lavf)
don't work as they should depending upon the availability of
e.g. the av1_metadata BSF. The table being empty is also illegal C
and according to PR #23038 MSVC warns about this (as does GCC
with -pedantic) and it may even lead to an internal compiler error.

This could be fixed by simply adding a mov_muxer->cbs_av1,cbs_apv
dependency in configure, yet this would have the downside that
it would force cbs_av1 and cbs_apv to be built for lavc, too,
even though it may not be needed there. So add new configure
variables cbs_{apv,av1}_lavf and cbs_lavf to track this correctly.

Reported-by: xiaozhuai <798047000@qq.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Reviewed-by: xiaozhuai <798047000@qq.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-08 09:34:52 +02:00
Marvin Scholz 0e51f7abbd configure: add implicit-fallthrough warning flags 2026-04-28 12:29:37 +00:00
Nicolas George 0b08d82425 configure: use ./src instead of src
Fix “do "src/doc/t2h.pm" failed, '.' is no longer in @INC; did you mean do "./src/doc/t2h.pm"?”
when we have such a symlink.
2026-04-25 17:25:28 +02:00
Lynne 117807510a vf_overlay_vulkan: port to compile-time SPIR-V generation 2026-04-22 12:45:45 +02:00
Lynne c7d3d3ac55 vf_blend_vulkan: port to compile-time SPIR-V generation 2026-04-22 12:45:45 +02:00
Lynne 4d6cd9f983 vf_scdet_vulkan: port to compile-time SPIR-V generation 2026-04-22 12:45:40 +02:00
Dmitrii GershenkopandArazIusubov d1d873c003 avfilter/vf_frc_amf: Add AMF Frame Rate Converter filter 2026-04-21 16:47:05 +00:00
Lynne 8483de2858 chromaber_vulkan: switch to compile-time SPIR-V generation 2026-04-21 08:28:50 +02:00
Lynne 8001b19dc8 vf_gblur_vulkan: port to compile-time SPIR-V generation 2026-04-21 08:28:50 +02:00
Lynne ada9716172 vsrc_testsrc_vulkan: convert to compile-time SPIR-V generation 2026-04-21 08:28:50 +02:00
Lynne 4061e3351f vf_transpose_vulkan: convert to compile-time SPIR-V generation 2026-04-21 08:28:50 +02:00
Lynne d0ee5d0556 vf_flip_vulkan: convert to compile-time SPIR-V generation 2026-04-21 08:28:50 +02:00
Lynne 2f7d3290c0 vf_xfade_vulkan: convert to compile-time SPIR-V generation 2026-04-21 08:28:49 +02:00
Lynne f8f485fb3c vf_interlace_vulkan: convert to compile-time SPIR-V generation 2026-04-21 08:28:49 +02:00
nyanmisakaandTimo Rothenpieler c92304f8c7 avfilter: add transpose_cuda video filter
This patch adds the transpose_cuda video filter.
It's similar to the existing transpose filter but accelerated by CUDA.

It supports the same pixel formats as the scale_cuda filter.
This also supersedes the deprecated transpose_npp filter.

Example usage:
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i <INPUT> -vf "transpose_cuda=dir=clock" <OUTPUT>

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2026-04-20 21:08:21 +02:00
Ramiro Polla 49a2d426e9 configure: collapse else + if into elif 2026-04-13 12:46:49 +00:00
Ramiro Polla 31f280e1e6 configure: add missing quotes around user-specified tool paths
Found-by: Luke Jolliffe <luke.jolliffe@bbc.co.uk>
2026-04-13 12:46:49 +00:00
Ramiro Polla c1d4fe8b44 configure: fix html docs generation when makeinfo is disabled
The makeinfo_html variable wasn't being disabled when the makeinfo test
failed, which prevented texi2html from being probed.

Fixes 589da160b2.

Found-by: Luke Jolliffe <luke.jolliffe@bbc.co.uk>
2026-04-13 12:46:49 +00:00
Zhao ZhiliandZhao Zhili a85a8e6757 configure: fix VSX remaining enabled when -mvsx is unsupported
When check_cflags -mvsx fails, the && short-circuit prevents
check_cc from running. Since check_cc is responsible for
disabling vsx on failure, skipping it leaves vsx incorrectly
enabled.

Fix by removing the && so check_cc always executes.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-04-13 11:45:36 +00:00
Lynne d3d0b7a5ee lavfi/v360: add a Vulkan-compute based filter
This just adds a Vulkan compute-based 360-degree video conversion.
It implements a sufficient subset of the most popular 360-degree video formats.

Options such as rotation are dynamic and can be adjusted during runtime.

Some of the work was based on Paul B. Mahol's patch from 2020. There
were spots where the arithmetic conversion was incorrect.
2026-04-09 12:31:24 +02:00
Priyanshu Thapliyalandmichaelni 43e5b26c00 avcodec/pdvenc: add Playdate video encoder
Add a native encoder for the Playdate PDV format.

Supports monob (1-bit) video, producing zlib-compressed intra frames
and XOR-based delta frames.

Includes bounds checking, overflow guards, correct linesize handling
using ptrdiff_t, and proper buffer allocation ordering.

Mark the encoder as experimental by setting AV_CODEC_CAP_EXPERIMENTAL,
since it has not been validated against Panic's official Playdate
player or SDK.
2026-04-09 03:01:43 +00:00
James Almer 4c69c5f156 configure: only warn about spirv-headers if vulkan was explicitly requested
Given it's autodected by default, its checks should not print warnings nor abort the process.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-08 12:29:28 -03:00
Patrice DumasandRamiro Polla 589da160b2 configure: add makeinfo option
Rename makeinfo enabled variable to makeinfo_command. Do not put
makeinfo_command in HAVE_LIST, it is not used.
2026-04-06 15:07:17 +00:00