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

119258 Commits

Author SHA1 Message Date
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
a22faeb992 tests/swscale: check supported inputs for legacy swscale separately
The new code path supports more formats, so we can't test them all
against the legacy implementation.
2025-03-31 12:19:08 +02:00
e1736d0d0b tests/swscale: print performance stats on exit 2025-03-31 12:19:08 +02:00
6c12b1535a tests/swscale: switch from MSE to SSIM
And bias it towards Y. This is much better at ignoring errors due to differing
dither patterns, and rewards algorithms that lower luma noise at the cost of
higher chroma noise.

The (0.8, 0.1, 0.1) weights for YCbCr are taken from the paper:
  "Understanding SSIM" by Jim Nilsson and Tomas Akenine-Möller
  (https://arxiv.org/abs/2006.13846)
2025-03-31 12:19:07 +02:00
1707e81073 tests/swscale: use yuva444p as reference
Instead of the lossy yuva420p. This does change the results compared to the
status quo, but is more reflective of the actual strength of a conversion,
since it will faithfully measure the round-trip error from subsampling and
upsampling.
2025-03-31 12:18:35 +02:00
f438f3f8cd tests/swscale: print speedup numbers in color 2025-03-31 12:18:35 +02:00
995986e512 tests/swscale: allow testing only unscaled convertors
I need this to be able to test the new unscaled conversion code more quickly.
We re-order the flags order to make 0 the first entry, so we don't set any
flags when performing unscaled tests.
2025-03-31 12:18:35 +02:00
d467ceaa9b tests/swscale: use hex format for flags values 2025-03-31 12:18:11 +02:00
0e2742a693 tests/swscale: allow choosing specific flags and dither mode
So I can quickly iterate on the new swscale code.
2025-03-31 12:16:10 +02:00
35c091f4b7 avformat/rtpenc: Check dimensions during init
Also fixes a -Wdeclaration-after-statement warning.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-31 08:04:05 +02:00
1d2c391005 avcodec/ffv1enc: Add -remap_optimizer option
This allows tuning how much effort (time) the encoder spends on
optimizing the remap table

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:20 +02:00
f765085115 avcodec/ffv1enc: Eliminate RemapEncoderState
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:20 +02:00
3faee894fc avcodec/ffv1enc: Eliminate copy_state
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:19 +02:00
2f0500f22c avcodec/ffv1enc: Better heuristic for selecting mul values.
This increases the search space from the hardcoded 17 tables
to ~ 23^512 tables

The mul_count choice is chosen by bruteforce

All testcases tried, improve

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-31 02:42:19 +02:00
948a78365b avcodec/dxa: Remove set-but-unused variable
Forgotten in 6e80ec9dc5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-30 21:31:16 +02:00
c14b837ded speexdec: fix framesize for ultra-wideband
This matches how the libspeex decoder is calculating frame size (except in clamp form).

Fixes #11495

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-30 12:19:43 -03:00
64087171f6 configure: add option to select use of response files 2025-03-30 17:22:10 +05:30
f47c8bca2c fftools/ffprobe: Make pix_fmt output bitexact
It is currently not due to endianness. This forced to add
workarounds with sed in fate/mxf.mak (which are removed
in this commit).
This is supposed to fix the enhanced-flv-hevc-hdr10 test
on big endian systems.

Reviewed-by: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-30 08:24:39 +02:00
2657e1679e avformat/rtpenc: Add flag AVFMT_NODIMENSIONS.
Not all rtp formats require the video dimensions to be available
up front. H264 and HEVC will send them as stream parameters.
The flag is restrictive and prevents RTP repacketization
without parsing the codec information out of the stream.

This change checks to see if the codec parameters are available
on the rtp formats that need it.

Signed-off-by: Koushik Dutta <koushd@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-29 22:49:57 +01:00
5fac8d062d avcodec/ituh263enc: Add necessary #if checks for FLV encoder
Fixes compilation in case where the FLV encoder is disabled
with any other H.263 based encoder enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:48:34 +01:00
d3b940b0ff avcodec/rv10: Make logmessage endian-independent
Also fix a potential effective-type violation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:47:11 +01:00
13f06df4e1 avcodec/rv10: Remove pointless casts
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:45:48 +01:00
116fd73143 avcodec/mpegvideo: Don't set [bf]_code for non-MPEG-4 decoders
It is only used by encoders and the MPEG-4 decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:44:22 +01:00
8e070e1a75 avcodec/snowenc: Don't allocate obmc_scratchpad separately
Put it into SnowEncContext instead. Also use the proper type
(it is only used as IDWTELEM aka short).

(The allocation code allocated it in units of uint32_t,
yet it was never used in this way. I made the array so big
that the size (in bytes) does not change.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:42:55 +01:00
f80a939a2e avcodec/motion_est: Put map, me_map into MotionEstContext
They have a fixed size and given that nowadays
MotionEstContext is no longer in any decoder's private context,
it is not wasteful to just put it into there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:41:19 +01:00
526c401490 fate/vcodec: Test non-default b_strategy
With this modification the test would have caught the regression
introduced in 72bf3d3c12.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:39:55 +01:00
074d8343d6 avcodec/mpegvideo_enc: Don't use unnecessarily much stack
encode_thread() puts two MPVEncContexts (2*6516B here)
on the stack and zeroes one of them in order to
temporarily store the variables that get changed
during encoding a macroblock (when there is more than
one candidate type for a macroblock). This is wasteful
and therefore this commit adds a small (328B here) structure
to store exactly the fields that actually need to be backed
up. Then one can extend MPVEncContext without fearing
too use up to much stack.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:38:30 +01:00
f8360ed629 avcodec/mpegvideo_enc: Pass data_partitioning directly
This avoids having to store it in the backup MPVEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:37:04 +01:00
1422f0057c avcodec/x86/mpegvideoenc_template: Remove remnants of MMX
Forgotten in 7284ab789d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-29 01:30:15 +01:00
8c7b00ba3a avutil/hwcontext_vulkan: stop checking for deprecated and removed flag
AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY was deprecated in e0f2d2e702
and removed in 09a5760299

Fixes: e0f2d2e702
Fixes: 09a5760299
2025-03-29 00:40:48 +01:00
b6bcc1c3c2 avcodec/exr: deprecate gamma and apply_trc options
Decoders should not modify sample values, as that's the job of a library like swscale.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:44:38 -03:00
b338d1b35b libs: bump major version for all libraries
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:44:34 -03:00
aaf3cd9ddb avcodec/raw: Duplicate raw_pix_fmt_tags into fourcc2pixfmt tool
Do this instead of exporting raw_pix_fmt_tags
via avpriv_get_raw_pix_fmt_tags().

For shared builds this will lead to an increase in the
combined size of the lavc and fourcc2pixfmt binaries
(because the overhead of exporting avpriv_get_raw_pix_fmt_tags()
is dwarfed by the size of the array), but given that
fourcc2pixfmt is a test tool that is not widely distributed
it does not really matter. For static builds the opposite
is true (the rest of lavc/raw.o is no longer pulled into
the test tool and the getter can be removed, too).

This patch has the additional benefit of removing
struct PixelFormatTag from the ABI.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-28 14:33:31 -03:00
0ccf385e13 avutil/float_dsp: Unavpriv avpriv_scalarproduct_float_c()
Not worth the overhead of exporting it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:08 -03:00