11 Commits
Author SHA1 Message Date
lusoris 0893feba65 configure: add the libavformat dependency of whisper
af_whisper writes its output through AVIO. Without avformat in the
filter dependencies and avfilter_deps, a minimal shared build leaves
avio_closep, avio_write and avio_open unresolved. The library builds,
but linking a consumer with -Wl,--no-allow-shlib-undefined fails with
undefined references to all three symbols. With --disable-avformat,
configure also kept the filter enabled; it is now disabled cleanly.

Signed-off-by: lusoris <lusoris@proton.me>
2026-11-05 04:43:58 +00:00
lusoris 2753fa2fb8 configure: add the libavformat dependency of metadata and ametadata
f_metadata.c opens its output file with avio_open() and writes it
with avio_vprintf(). metadata_filter_deps and ametadata_filter_deps
list avformat, but the conditional library dependency list has no
entry for either filter, so a build with only one of them enabled sets
avfilter_FFLIBS=avutil and a shared libavfilter has no libavformat
NEEDED entry; a consumer linked with -Wl,--no-allow-shlib-undefined
fails on the avio symbols.

With these entries avfilter_FFLIBS=avformat avcodec avutil and the
consumer links and runs with LD_BIND_NOW=1.

Signed-off-by: lusoris <lusoris@proton.me>
2026-11-04 04:38:43 +00:00
lusoris a7206f6ba3 configure: add the libswscale dependency of scale_vulkan
scale_vulkan calls sws_alloc_context(), sws_scale_frame() and
sws_free_context(), and scale_vulkan_filter_deps lists swscale, but
the conditional library dependency list has no entry for the filter.
A build with only this filter enabled sets avfilter_FFLIBS=avutil, so
a shared libavfilter has no libswscale NEEDED entry and a consumer
linked with -Wl,--no-allow-shlib-undefined fails on the three sws_*
symbols.

With this entry avfilter_FFLIBS=swscale avutil and the consumer links
and runs with LD_BIND_NOW=1. A standalone scale_vulkan build also
needs scale_eval.o, which "avfilter/Makefile: add missing objects for
standalone Vulkan filters" adds.

Signed-off-by: lusoris <lusoris@proton.me>
2026-11-04 04:38:43 +00:00
lusoris f675c507e2 avcodec/adpcm: mark conditionally used frame locals as unused
GCC 14.4.0 and 16.2.1 report -Wunused-variable and
-Wunused-but-set-variable warnings in adpcm_decode_frame with
single-decoder configurations such as adpcm_xa, adpcm_swf, adpcm_sanyo
and adpcm_ima_citrix. Reads of shared locals disappear when their
CASE blocks are disabled.

Mark c, samples, samples_p and st as av_unused to suppress both
warnings for any subset of enabled decoders without changing behavior.

Signed-off-by: lusoris <lusoris@proton.me>
2026-11-02 21:05:10 +00:00
lusoris ccdf3805cf avcodec/adpcm: guard helpers with decoder configuration
GCC 14.4.0 and 16.2.1 report -Wunused-function for decoder helpers left
compiled when their users are disabled. Guard the escape, hvqm2, hvqm4,
circus, XA, SWF, Sanyo and Citrix helpers with the configuration macros
of the decoders that use them.

This changes which helpers are compiled, without changing decoding when
the corresponding decoder is enabled.

Signed-off-by: lusoris <lusoris@proton.me>
2026-11-02 21:05:10 +00:00
lusoris fa4daf630e avcodec/rv60dec: validate angular prediction buffer bounds
GCC 14.4.0 and 16.2.1 report -Wstringop-overflow in angular prediction.
Unchecked block sizes and derived filter lengths could exceed the local
reference buffer. Require a power-of-two size from 4 to 64 and bound the
weak and bilinear filter lengths before writing. Prediction is unchanged
for sizes and lengths within those bounds.

Signed-off-by: lusoris <lusoris@proton.me>
2026-10-27 05:07:26 +00:00
lusoris 96b7f8281a avcodec/nvenc: drop hevc_nvenc SEI above a fixed size
hevc_nvenc stops the encode with "Failed locking bitstream buffer: out
of memory" once the SEI of a picture are large: nvEncLockBitstream()
returns NV_ENC_ERR_OUT_OF_MEMORY. With driver 615.78.08 at 1920x1080 a
single user data unregistered payload of up to 898 bytes passes on an
IDR picture and up to 999 on a P picture, 672 and 747 when the payload
is all zero bytes after the UUID. h264_nvenc carried 8192 bytes.

Count the payload bytes of the A/53, timecode and user data unregistered
SEI of an hevc_nvenc picture in order and drop a SEI that would take the
total above 512 bytes, with a warning for the first one and verbose
messages after that.

Measured on an RTX 4090 with that driver, 1920x1080, five frames, one
user data unregistered SEI on the IDR or on a P picture: payloads up to
512 bytes give output byte-identical to the unpatched encoder, payloads
of 513, 898, 999 and 1000 bytes are dropped with the warning and all
five frames encode, and h264_nvenc output is unchanged.

Signed-off-by: lusoris <lusoris@proton.me>
2026-10-24 21:22:33 +00:00
lusoris bf0e831606 doc/encoders: add a section for the NVENC encoders
h264_nvenc, hevc_nvenc and av1_nvenc had no entry in encoders.texi.
Document them in one section: hardware input and devices, the generic
options they map, the options common to all three (presets and tuning,
rate control, lookahead, AQ and B-frames, SEI and side data), and the
options specific to each codec.

Option names, named values, ranges and defaults follow the AVOption
tables in nvenc_h264.c, nvenc_hevc.c and nvenc_av1.c, checked against
ffmpeg -h encoder=<name> from a build against nv-codec-headers 13.1.
Options that depend on the SDK version state the version they need.

Signed-off-by: lusoris <lusoris@proton.me>
2026-10-22 04:32:31 +00:00
lusoris 2a8c6d30b9 avcodec/av1dec: remove the coding bias from exported chroma grain params
export_film_grain() copied cb_mult, cb_luma_mult and cb_offset (and the
Cr equivalents) straight from the bitstream, where they are coded with
a bias of 128, 128 and 256. AVFilmGrainAOMParams holds them unbiased:
the uv_offset documentation gives a range of [-256, 255], the AFGS1
parser in aom_film_grain.c subtracts the bias, the film grain
synthesizer uses the values as signed multipliers and offsets, and
libdav1d exports them unbiased. The AR coefficients a few lines above
are already unbiased the same way.

With -export_side_data film_grain and a hwaccel, the native decoder
therefore exported values 128 or 256 higher than libdav1d for the
same stream, and any consumer applying the exported grain scaled
chroma noise wrong.

Signed-off-by: lusoris <lusoris@proton.me>
2026-10-20 01:28:48 +00:00
lusoris ffb15c94c2 avfilter/Makefile: link cuda/load_helper.o into three CUDA filters
bilateral_cuda, bwdif_cuda and chromakey_cuda call ff_cuda_load_module(),
which lives in cuda/load_helper.c, but their OBJS lines do not pull that
object in; the other CUDA filters that load a module list it. A build
where one of these is the only CUDA filter fails to link, for example:

  vf_bwdif_cuda.c:312: undefined reference to `ff_cuda_load_module'

Reproduced for each filter with --disable-everything --enable-avfilter
--enable-filter=<name> --enable-cuda-llvm --enable-ffnvcodec; each links
after this change.

Signed-off-by: lusoris <lusoris@proton.me>
2026-10-18 14:52:35 +02:00
lusoris 30b16e57ff ffbuild/library.mak: add the devprogs target
Commit a8968b1425 made the build and check targets depend on devprogs,
but no rule defines devprogs, so make build and make check stop with
"No rule to make target 'devprogs'". Define it like testprogs, from
the DEVPROGS of each library, and mark it phony.

Signed-off-by: lusoris <lusoris@proton.me>
2026-10-16 16:36:46 +00:00