119331 Commits

Author SHA1 Message Date
c34d77317e avcodec/x86/hevc/dsp_init: Make ff_hevc_put_bi_w_* functions static
They are always C wrappers around other functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
0cd67da909 avcodec/x86/hevc/dsp_init: Make ff_hevc_put_uni_w_* functions static
These are always C functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
977d65ae17 avcodec/x86/hevc/mc: Remove unused functions
Saved 11536B here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
d72a9af528 avcodec/celp_math: Mark ff_celp_math_init() as av_cold
Also do the same for ff_celp_math_init_mips().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
77b147d3a2 avcodec/lsp: Make ff_acelp_lsp2lpc() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
2c65d3be81 avcodec/celp_math: Reuse ff_scalarproduct_float_c()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
159b482835 avcodec/x86/vvc/dsp_init: Make avg wrappers static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
5c619da0ed avcodec/x86/vvc/dsp_init: Make alf wrappers static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
ed37a8f75a avcodec/x86/vvc/dsp_init: Make ff_vvc_apply_bdof_##bd##_avx2 static
These wrappers around ff_vvc_apply_bdof_avx2() are only used in
dsp_init.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
9ba6f99a62 avcodec/x86/vvc/dsp_init: Make put wrappers static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 13:52:29 +02:00
aeed747f41 avutil/aes: use pthread_once to fill the static tables
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-09 08:44:50 -03:00
890b8da1ce configure: Allow mixing declarations and statements
This C90 rule forces us to use a too big scope and should
therefore be dropped. Given that we already require C11,
all supported compilers can handle mixed declarations
and statements just fine.

Reviewed-by: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 11:45:21 +02:00
830fab6891 avutil/tests/channel_layout: Improve enum range check
Both GCC and Clang use unsigned as underlying type of
an enum with no negative enumeration constants, making
checks like "layout->order >= 0" here tautologically true.
Clang warns about this. Combine both range checks
by casting to unsigned to suppress this warning.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 11:45:14 +02:00
02eda84bf2 avcodec/h264: fix reference reordering
Fixes hardware decoders depending on long_term_pic_idx.
Relevant ITU conformance test vectors: MR6_BT_B, MR8_BT_B

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-04-08 20:44:35 +08:00
1e5c65f539 avutil/dict: fix memleak in av_dict_set()
Regression since 19e9a203b7b8e613840b055cdf68303a4fb84581.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-07 23:38:09 -03:00
f3f1a48a07 APIChanges & version bump for AV_DICT_DEDUP
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:46:05 +02:00
89df6d4068 avcodec/ffv1enc: Fix remap > 0 with gbrp12, that is non float
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:43 +02:00
175cd4ced0 avcodec/ffv1enc: avoid slices larger than 360x288 if no value is specified
This improves speed by providing more independent things for more CPUs

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:43 +02:00
1b04fb385c avcodec/ffv1enc: Remove 65536 pixel per slice limit for remap
About 1% better compression with large slices

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:42 +02:00
feceed9222 avcodec/ffv1: Store slices*planes with the minimum bits needed after remap
This also means that if a plane*slice has only 1 color nothing
is stored after the remap table

This also corrects the RCT offset to the exact value after remap
not a fixed 65536

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:42 +02:00
80b77e8e8d lavf/id3v2dec: support multiple values and TIPL frames
Fixes https://trac.ffmpeg.org/ticket/6949

Ordinary text frames in ID3v2 are allowed to have multiple
(null-separated) values. This technically isn't allowed in TXXX,
but it's used in practice by Picard, and supporting it is harmless.

TIPL/IPL (Involved People List) and TMCL (Musician Credits List) work
similarly to TXXX, but alternate key-value-key-value.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:42 +02:00
172e7ca668 lavf/metadata: support duplicate keys in ff_metadata_conv
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:41 +02:00
19e9a203b7 lavu/dict: add AV_DICT_DEDUP
This is useful when multiple metadata inputs may set the same value
(e.g. both a container-specific header and an ID3 tag).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-07 01:02:35 +02:00
779cbc2b97 checkasm: add tests for AES
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-06 11:02:10 -03:00
a35b4e8d29 avutil/x86/aes: ignore the upper bits in count
The argument is an int.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-06 11:02:09 -03:00
3f30ae823e avutil/aes_ctr: simplify incrementing the counter
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
fe73b84879 avutil/aes_ctr: simplify and optimize av_aes_ctr_crypt()
Process data in chunks of four or eight bytes, depending on host, instead of
one at a time.

before:
55561 decicycles in av_aes_ctr_crypt

after:
52204 decicycles in av_aes_ctr_crypt

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
2ea3c51795 lavu/aes: add x86 AESNI optimizations
crypto_bench comparison for AES-128-ECB:

lavu_aesni AES-128-ECB  size: 1048576  runs:   1024  time:    0.596 +- 0.081
lavu_c     AES-128-ECB  size: 1048576  runs:   1024  time:   17.007 +- 2.131
crypto     AES-128-ECB  size: 1048576  runs:   1024  time:    0.612 +- 1.857
gcrypt     AES-128-ECB  size: 1048576  runs:   1024  time:    1.123 +- 0.224
tomcrypt   AES-128-ECB  size: 1048576  runs:   1024  time:    9.038 +- 0.790

Improved-By: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
2daaafafc6 avutil/tests/aes_ctr: also randomize the encryption key
And not just the IV.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
462d35dc72 avutil/tests/aes_ctr: reindent after the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
19085287b4 avutil/tests/aes_ctr: also check the encrypted buffer
The test in its current form is just ensuring the plain text output is the same
as the plain text input, not bothering to check if anything was done with the
latter. av_aes_ctr_crypt() could be a simple memcpy under the hood and this
test would still succeed.

To check the integrity of the encrypted buffer, both the IV and the key need to
be fixed. As such, and in order to not remove the existing randomization of the
input IV, do two runs, one with random initialization data, and one with static
data.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:40 -03:00
0a34f009aa avutil/tests/aes_ctr: test more than a single block worth of data
This should exercise the implementation more thoroughly after an upcoming
change.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-05 20:46:39 -03:00
ccf073e772 avcodec/d3d12va_decode: enable reference-only mode
The Reference-Only feature in DirectX 12 is a memory optimization
technique designed for video decoding scenarios.
This feature requires that reference resources must be allocated with
the D3D12_RESOURCE_FLAG_VIDEO_DECODE_REFERENCE_ONLY resource flag.
Reference textures must also be separated from output textures.
This feature is not supported in the current version of ffmpeg.
Since AMD GPU uses this feature in Direct 12 decoder,
ffmpeg does not support AMD GPU Direct 12 decoding.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-04-05 11:57:49 +08:00
37a319fb95 avcodec/ffv1enc: Consider 2s x s slice configurations
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:42 +02:00
2d9c9dae14 avcodec/ffv1dec: Limit size of fltmap* to pixel number
This reduces needed memory and also removes the 65536 maximum for remap
on the decoder side

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:42 +02:00
06c00f9355 avcodec/ffv1: Only allocate fltmap* and bitmap when needed
This reduces memory requirements

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:42 +02:00
b67cf79683 avcodec/ffv1: Allocate unit only when needed and only as large as needed
That is instead of a fixed 65536, we now allocate only as many as there
are pixels.
We also allocate only for the encoder and only when remapping is enabled
and only for 32bit per sample

This should reduce memory consumption, the 2nd array will be
dealt with in a future commit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:41 +02:00
f1235f4bc1 avcodec/ffv1enc: run1start variables should fit in 32bit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-04 20:30:41 +02:00
4ebc1f06e9 avcodec: remove remaining references to avcodec_close()
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-04 14:03:21 -03:00
1c17061397 avcodec/decode: Fix avcodec parameters when bsfs are enable by decoder
BSF can update extradata, e.g., vvc_mp4toannexb. If we don't copy
bsf->par_out back to avcodec context, decoder can get extradata in
mp4 format, while packets are in annexb format.
2025-04-05 00:28:20 +08:00
c05ed36b56 libavcodec/amfenc: Setting the VBAQ property before the init call. 2025-04-04 17:57:49 +02:00
8284ba2a21 configure: Check for AVCaptureSession as dependency to avfoundation
This class is unavailable on tvOS before 17.0 (and macOS before 10.7
and iOS before 4.0, but those are fairly ancient). This makes sure
that we don't try to build the avfoundation indevice for such
OSes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-04 17:12:34 +03:00
69bab4e74f avfoundation: Fix compilation for OSes other than macOS and iOS
E.g. tvOS doesn't have devicesWithMediaType.

In principle, we could probably disable building the whole
input device on such OSes, but that would either require
testing explicitly for the OS type in configure (which we don't
do anywhere so far), or test for individual objective C methods.

This approach allows the code to compile, but no input devices
will be found at runtime.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-04 17:12:33 +03:00
46762c8b82 avfilter/vf_libplacebo: don't explode on zero FPS information
While technically not specifiad as valid by the AVFilterLink documentation,
it is currently possible to get an FPS of zero from various sources inside
libavfilter (notably vf_buffersrc).

Avoid a division by zero and resulting infinity when this happens.
2025-04-03 17:17:42 +02:00
68b105341c avformat: Fix AV1 RTP wrong log condition
Fixed warning about OBU count being wrong, which can only be
determined when the number of OBUs in the header is non-zero,
not the other way round.

Signed-off-by: Chris Hodges <chris.hodges@axis.com>
2025-04-03 16:08:41 +02:00
1722f08acf avutil/Makefile: Only include half2float, float2half when needed
They are not needed for shared builds (and because --gc-sections
is not the default for shared builds, they were included by default
included in libavutil since bf22c4cc3e005c01f50e233b1582fd1d8051aed9).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
52d766e5c2 avcodec/vdpau: Only include mpegvideodec.h when used
mpegvideodec.h includes mpegvideodata.h which in turn contains
a "static const uint8_t *const ff_mpeg1_dc_scale_table =
ff_mpeg12_dc_scale_table[0]"; yet if mpegvideo is disabled,
ff_mpeg12_dc_scale_table is not available, yet a non-optimizing
compiler (like GCC with -O0) may emit ff_mpeg1_dc_scale_table
and therefore a reference to ff_mpeg12_dc_scale_table nevertheless.

Fix this by only including mpegvideodec.h if it is needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
1479c2ec27 doc/{in,out}devs: Remove documentation for removed devices
Namely bktr, opengl and sdl2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
265e0d3e24 avfilter/palette: Remove unused ff_srgb_u8_to_linear_int()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
3693acb855 avcodec/x86/h26x/h265dsp: Remove unused functions
The ff_h2656_put_{uni_,}8tap_hv{32,64,128}_8_avx2
and ff_h2656_put_{uni_,}4tap_hv{64,128}_8_avx2
functions were unused and have been removed.
This saved 3712B of .text here.

(ff_h2656_put_{uni_,}4tap_hv32_8_avx2 are now only
called from exactly one callsite (in
ff_hevc_put_{uni_,}epel_hv32_8_avx2) and could be inlined.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00