1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

119441 Commits

Author SHA1 Message Date
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 bf22c4cc3e).

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
2e962fb080 avcodec/vulkan_video: Remove unused ff_vk_h26[45]_profile_to_av()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
664aef361a avcodec/aactab: Remove unused arrays
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
f5007a07d8 avcodec/aac/aacdec_lpd: Remove dead code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
2b9b4dde93 avcodec/aac/aacdec_lpd: Make ff_aac_lpd_mode_tab static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
132a55fd7c postproc/postprocess_template: Use immediate instead of memory load
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
5e947cc320 postproc/postprocess: Remove unused b02
The line which appears to be using it was always commented out
(since it has been added in 70c5ae870b).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
435be31ef5 swscale/csputils: Remove unused ff_sws_matrix3x3_rmul()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
4d2e38b376 avutil/hwcontext_vulkan: Remove unused variable
Forgotten in 8c7b00ba3a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:57 +02:00
9d543273fe fftools/ffprobe: Fix hypothetical stack buffer overflow
It can't really happen, because no currently used pixel format
has a name exceeding the size of the buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-03 06:04:51 +02:00
2a2b5aec5b tools/target_swr_fuzzer: fix memory leak on av_samples_fill_arrays() error
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:07 +02:00
d5ad860cd8 tests/checkasm/checkasm.c: Assert that aligned_w/h do not overflow
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:07 +02:00
4aeaee1f4e avcodec/ffv1enc: replace the remaining log2() by magic
big secret, reading a float as the corresponding integer is a good
approximation of log2() for numbers not too close to 1.0. At the same
time it maintains strict monotonicity

this reduces run time from 19sec to 17sec for the slowest of my testcases
(with default remap_optimizer 3)

Compression is about the same:

-rw-r----- 1 michael michael  497603370 Mar 30 15:23 float-303503-fixed-40-optim-3-1log2F.nut
-rw-r----- 1 michael michael  497603374 Mar 28 11:27 float-303503-fixed-40-optim-3b.nut
-rw-r----- 1 michael michael  549938852 Mar 28 11:27 float-303503-float16-40-optim-3b.nut
-rw-r----- 1 michael michael  549938857 Mar 30 15:23 float-303503-float16-40-optim-3-1log2F.nut
-rw-r----- 1 michael michael 1150827841 Mar 28 11:28 float-303503-float-40-optim-3b.nut
-rw-r----- 1 michael michael 1150832913 Mar 30 15:22 float-303503-float-40-optim-3ref-log2F2.nut

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:07 +02:00
98c1788370 avcodec/ffv1enc: replace 3 double precision log2() by 1 single precision log2()
This makes the remap finding heuristic much faster

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:58:06 +02:00
b4d165c68f doc: replace http/git by https urls
These are more secure

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-03 01:57:46 +02:00
efa0c6252f fftools/cmdutils: fix error message for "ffmpeg -init_hw_device list"
When running 'ffmpeg -init_hw_device list' to display available hardware
devices, it incorrectly shows an error message:
"Failed to set value 'list' for option 'init_hw_device': Immediate exit requested"

This is a regression introduced by commit a50f90f1c2. The command is
actually working as intended - it should exit after listing devices, but
shouldn't display an error message.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-04-03 06:29:12 +08:00
976c16109b doc/ffmpeg: document videotoolbox in -hwaccel option
Add videotoolbox to the list of supported hardware acceleration methods
in the -hwaccel option documentation. This option allows users to utilize
Apple's VideoToolbox framework for hardware-accelerated video decoding
on macOS and iOS devices.

The videotoolbox acceleration has been supported for a while, but was
missing from the documentation.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-04-03 06:28:51 +08:00
d1f2f8eee0 tests/filter-video: add rgbtestsrc tests for gbrap
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-02 09:32:08 -03:00
67c4891311 tests/filter-video: add yuvtestsrc tests for yuva444p
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-02 09:32:08 -03:00
cd1ec359c4 avfilter/vsrc_testsrc: also fill alpha planes with a test pattern in {rgb,yuv}testsrc
And add support for more formats.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-02 09:32:08 -03:00
ca48e7bb70 avcodec/sbcdsp_data: Make data static
This data is only used by sbcdsp.c, so delete sbcdsp_data.h,
make a header out of sbcdsp_data.c and make the data contained
therein static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:46 +02:00
0ce8868878 avcodec/hevc/hevcdec: Use bitfield instead of array of flags
It is simpler, avoids several loops and also makes GCC no longer
emit bogus -Wstringop-overflow= warnings.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:38 +02:00
ffa56f73a9 avcodec/ac3dec: Read spx flags at once, not one bit at a time
Doing so gets rid of a stupid GCC -Wstringop-overflow= warning
(GCC somehow believes that fbw_channels can be 7 with the old
form of the code, so that channel_uses_spx[7] would be written
to, but now it no longer believes so).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:30 +02:00
2204efc2a6 avcodec/dct: Make declarations and definitions match
GCC considers declarations using a parameter of pointer
type (or equivalently a parameter using an array of unspecified
dimensions) to be inconsistent with a declaration using
a known-length array type and emits a -Warray-parameter warning
for several ff_j_rev_dct* functions for this.

This patch makes the declarations match the actual definitions
to suppress these (IMO nonsensical) warnings.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-02 09:25:24 +02:00
839b41991d avcodec/nvenc: unify CBR filler data insertion for all codecs
Previously, AV1 used filler data with CBR by default while H.264
and HEVC may or may not depending on driver version. Make this
consistent by using not filler data in CBR mode for all codecs.

Since there are valid reasons to use CBR with or without filler,
also add a cbr_padding option to allow users to override this.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-04-01 19:13:38 +02:00
c1a2da72cc checkasm: vp8dsp: Use checkasm_check_padded in check_mc
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:34:53 +03:00
b863b81500 checkasm: Implement helpers for defining and checking padded rects
This backports similar functionality from dav1d, from commits
35d1d011fda4a92bcaf42d30ed137583b27d7f6d and
d130da9c315d5a1d3968d278bbee2238ad9051e7.

This allows detecting writes out of bounds, on all 4 sides of
the intended destination rectangle.

The bounds checking also can optionally allow small overwrites
(up to a specified alignment), while still checking for larger
overwrites past the intended allowed region.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:34:51 +03:00
37c664a253 checkasm: Make checkasm_fail_func return whether we should print verbosely
This makes it easier to implement custom error printouts in tests.

This is a port of dav1d's commit
13a7d78655f8747c2cd01e8a48d44dcc7f60a8e5 into ffmpeg's checkasm.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:34:48 +03:00
4db571e516 checkasm/v210enc.c: Use checkasm_check()
This gives more informative printouts if the tests fail,
if checkasm is run with "-v".

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:31:58 +03:00
d8ae11365c configure: Check for an actual function in VideoToolbox
This makes sure to disable VideoToolbox if building with an SDK
that does contain VideoToolbox, but targeting an older version of
the OS where it is unavailable. Previously, we would enable
VideoToolbox as long as the framework itself was found, which only
require the framework to exist in the SDK.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:31 +03:00
d7d6e9ae69 videotoolboxenc: Add an iOS version condition for VTCopySupportedPropertyDictionaryForEncoder
This fixes building for iOS versions older than 11.0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:29 +03:00
19a4719f3b libavfilter: metal: Fix the version condition for iOS
MTLDevice supportsFamily is available since iOS 13, not 11, see
https://developer.apple.com/documentation/metal/mtldevice/supportsfamily(_:)?language=objc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:26 +03:00
1129957ae2 configure: Add a dependency for the audiotoolbox outdev
The audiotoolbox outdev uses APIs that only are available on macOS,
not on iOS or tvOS. Check for them in configure, and make sure the
outdev is disabled otherwise.

This allows building for iOS without explicitly having to disable
the audiotoolbox outdev.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:23 +03:00
4da84d5c2b swscale/swscale_unscaled: Actually use X2->RGBA64 conversions
The conversion functions were added in
e7382b4d01, yet they were never
really enabled. Found via -ffunction-sections and --gc-sections.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-31 21:45:20 +02:00
581a6a042c doc/encoders: Move FFV1 encoder to video encoder section
It is not an audio encoder.

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-31 21:44:58 +02:00
256a38101f tests/checkasm: fix wrong summation of bench time
This was changed 8 years ago with the introduction of the linux-perf path,
with seemingly no justification at the time. Likely a developer oversight
from testing.

This bug not only made --runs completely ineffective, but also meant that we
didn't actually correctly filter out outliers.

Fixes: e0d56f097f
2025-03-31 15:27:24 +02:00
1015ea2ba1 doc/filters: add thumbnail_cuda entry
Also update thumbnail_cuda filter description.
2025-03-31 18:48:01 +05:30
3e32dc8b08 tests/swscale: allow setting log verbosity
Helpful for debugging the new swscale code, since it dumps the
operations list in verbose logging mode.
2025-03-31 12:19:26 +02:00
92a57f1cfd tests/swscale: constrain reference SSIM for low bit depth formats
Sometimes, the reference SSIM is significantly higher than the
SSIM level expected for the test. This is the case when the source format
has a much lower bit depth than the destination format. In this case, the fact
that legacy swscale does not accurately preserve the source dither pattern
gives it an unfair advantage in a direct comparison, leading to false
positives.

For example, conversion like rgb4 -> rgb565 should be lossless, but swscale
low passes / downscales the input chroma, throwing away massive amounts of
detail. This gives it a higher SSIM score since the lowpassed result removes
some of the dither noise that was present in the source.
2025-03-31 12:19:26 +02:00
8fc9808f18 tests/swscale: calculate theoretical expected SSIM
We can calculate with some confidence the theoretical expected SSIM
from an "ideal" conversion, by computing the reference SSIM level
for an image dithered with uniformly distributed quatization noise.

This gives us an additional safety net to check for regressions even in
the absence of a reference to compare against.
2025-03-31 12:19:26 +02:00
9549daa996 tests/swscale: remove stray whitespace in scanf format 2025-03-31 12:19:24 +02:00