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

118985 Commits

Author SHA1 Message Date
461b86fe7d avcodec/intrax8: Stop setting write-only block_last_index
These values are only used by the mpegvideo unquantize functions,
yet these are not active when intrax is in use. Furthermore,
given that ff_intrax8_decode_picture() decodes multiple
macroblocks in a given call, it makes no sense to return
any value (that was in practice the maximum of the indices
of all the macroblocks decoded).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
1a564c1aff avcodec/vc1_block: Stop setting write-only block_last_index
It is only used by the mpegvideo unquantize functions which
this decoder does not use at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
594b97e433 avcodec/mpegvideo_dec: Mark init, flush, close functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
248a6578a3 avcodec/msmpeg4enc: Inline constant
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-16 04:24:32 +01:00
c88614662c avcodec/d3d12va_encode: use the correct specifier to log size_t values
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 21:06:33 -03:00
3f57063c58 avcodec/ffv1dec: set the FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability
Will prevent decoding frame data during probing.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 18:43:18 -03:00
63fa1f52b9 swscale/swscale_unscaled: make the fast planar copy path work with more formats
dst_depth - src_depth where the result is 6 or 7 in a high bd path means this
is only executed for 16 -> 10 and 16 -> 9.
This patch makes this path general, supporting arbitrary formats as long as
dst_depth > src_depth > 8.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 18:43:18 -03:00
819dec697a swscale/swscale_unscaled: account for semi planar formats with data in the msb
Fixes fate failures introduced by recent tests that exercise the faulty code.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-15 18:43:18 -03:00
26c5d8cf5d lavc/vvc: Fix NumEntryPoints derivation
If pps_single_slice_per_subpic_flag is 1,
slice_{width,height}_in_tiles are undefined and we must instead get the
dimensions of the slice by referring to the corresponding subpicture.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2025-03-15 10:46:32 +08:00
2da40904f3 avcodec/x86/hevc/dsp_init: Rename ff_hevc_put_hevc->ff_hevc_put
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-15 02:30:56 +01:00
44ed8f61d7 avcodec/aom_film_grain: Cast const away to suppress compiler warning
av_frame_side_data_add() typically takes ownership of
the provided AVBufferRef reference and therefore
uses a parameter of type AVBufferRef**; yet with
the AV_FRAME_SIDE_DATA_FLAG_NEW_REF, it creates
new references instead, without touching the given
reference. Therefore it is safe to cast const away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-15 02:30:56 +01:00
ae84aa775f swscale/utils: split off format code into new file
utils.c is getting quite crowded, and I need a new place to dump a lot of
format handling code for the ongoing rewrite. Rather than bloating this file
even more, start splitting format handling helpers off into a new file.

This also renames the existing utils.h header, which didn't really contain
anything except the SwsFormat definition anyway (the prototypes for what should
have been in utils.h are all still in the legacy swscale_internal.h).
2025-03-14 19:50:44 +01:00
e4c8e80a2e avcodec/x86/constants: Move constants only used by cavsdsp to it
And make them static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-14 11:42:41 +01:00
437cbd25e0 avcodec/ffv1: Implement jeromes idea of making remap flip optional
This also makes remap optional (which is a good idea even if we decide to keep flip fixed)

Effect on compression (using 2 rawlsb, golomb rice, large context model with ACES_OT_VWG_SampleFrames

-rw-r----- 1 michael michael 499101306 Mär 11 14:58 float-303503-try3d-m2.nut
-rw-r----- 1 michael michael 503700199 Mär 11 14:57 float-303503-try3d-m1.nut
-rw-r----- 1 michael michael 518150578 Mär 11 14:57 float-303503-try3d-m0.nut
(the test above used the rawlsb patch, which is not applied yet)

Reviewed-by: Jerome Martinez <jerome@mediaarea.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:04:25 +01:00
dcf6142794 avcodec/ffv1enc: add space for the remap table to max_size
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:59 +01:00
a90ff81287 avcodec/ffv1enc: Factor set_micro_version() out of ff_ffv1_write_extradata()
and call it from ff_ffv1_encode_init()

setting micro version from code writing the extradata is messy, this should
be cleaner

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:59 +01:00
e0aedeb72e avformat/webvttdec: Add webvtt extension and MIME type
The webvtt extension is sometimes used in HLS playlists.

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:59 +01:00
0978fea7fa avcodec/vlc: Reduce debug logging
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-14 02:03:58 +01:00
52eb0e18db avfilter/vsrc_testsrc: use aligned macros for writing
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-13 15:00:10 -03:00
c3b60e0df7 tests/fate/pixfmt: add conversion tests with semi planar YUV formats
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-13 15:00:10 -03:00
228713ef5d swscale/input: add support for UYYVYY411
Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-13 15:00:05 -03:00
154c00514d lavc/videotoolboxenc: add hevc main42210 and p210
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-13 18:34:22 +08:00
958c46800e avcodec/mjpegenc: Reconstify mjpeg encoder
It has been deconstified in 2c2dfd9149
because the FFCodec is touched in av_codec_init_static because
of its get_supported_config callback. Yet this is easily remedied:
Only call get_supported_config to set pix_fmts if the codec does
not already have it set.

This also fixes a mismatch between the declaration of ff_mjpeg_encoder
in allcodecs.c and the definition in mjpegenc.c. Said mismatch is
actually undefined behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:20:06 +01:00
ed1b76cdb7 avcodec/allcodecs: Don't wrap supported_framerates
Only two encoders (the native MPEG-1/2 ones) provide
supported_framerates and they don't implement the
get_supported_config callback. It is highly unlikely that
any codec will set supported_framerates dynamically at all,
so remove the code querying for frame rates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:20:06 +01:00
bfbceb7d55 avcodec/tests/avcodec: Silence deprecation warnings
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:20:05 +01:00
c8be309719 avcodec/codec_internal: Add inlined version of av_codec_is_(de|en)coder
These functions check whether the AVCodec* is NULL, but this
has already been checked at a lot of places in our codebase,
so that it boils down to checking the is_decoder flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:16:27 +01:00
47d7c6cd15 avcodec/codec_internal: Add dedicated is_decoder flag to FFCodec
Allows to simplify av_codec_is_decoder() and av_codec_is_encoder().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:16:27 +01:00
3e19e5062c avcodec/decode: Move is_open check to avcodec_receive_frame()
It also applies to scenarios where ff_encode_receive_frame()
is used. Also remove the redundant av_codec_is_decoder().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-13 02:16:27 +01:00
fed6612415 avcodec/cuviddec: use pre-existing chroma format information
Fixes #11505
2025-03-13 01:47:02 +01:00
4c7d0f88f5 avcodec/Makefile: remove redundant object
It's already listed in OBJS-$(CONFIG_JNI), which should cover all cases
STLIBOBJS does and more.
2025-03-13 01:28:50 +01:00
34aa8449b8 avcodec/pthread*: Mark init, free, flush functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 17:00:24 +01:00
8abac5898b avcodec/sbcdec_data: Merge data into header
sbcdec_data.h is only included by sbcdec.c, so this won't
cause the data to be included multiple times in the binary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 17:00:24 +01:00
a6c58450da all: Fix doxy comments wrongly designated as trailing ///<
The ///< or /**< form of doxygen comments are only to be used
when the documentation follows the member and the comment
block starts on the same line as the member. This commit
fixes wrong uses of them; in particular, this fixes the comment
for mb_height in H.264 SPS's structure which was wrongly added
to mb_width.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 17:00:24 +01:00
e99faf28d5 avcodec/vc2enc: Avoid excessive inlining
There is no reason to inline put_vc2_ue_uint() everywhere;
only one call site is actually hot: The one in encode_subband()
(which accounts for 35735040 of 35739495 calls to said function
in a FATE run). Uninline all the others.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 16:58:53 +01:00
fcd5df5904 fftools/ffmpeg_opt: Remove unused alt_bsf
Forgotten in 6325aede08.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 16:58:16 +01:00
0f7d77fc42 avformat/flvdec: Use appropriate error code
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:07:20 +08:00
fa5a100ed2 avformat/flvdec: Fix error handling of parse_video_color_info
Some error should not be ignored.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:07:09 +08:00
291fdc96ab avformat/flvdec: Use float for FLVMasteringMeta
The precision should be enough for primaries and luminance.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:04:00 +08:00
888f5ea72b avformat/flvdec: Use appropriate types in FLVMetaVideoColor
This also reduce memory usage.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:03:56 +08:00
f0cf122cf4 avformat/flvdec: Remove one level of indentation
Also remove the condition of AMF_DATA_TYPE_BOOL when parse color
info. There is no AMF_DATA_TYPE_BOOL type in color info.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:03:38 +08:00
4f53ecf114 avformat/flvdec: Put FLVMetaVideoColor inside FLVContext directly
1. Rename metaVideoColor to meta_color_info
2. Allocated FLVMetaVideoColor together with FLVContext
3. Improve the use of meta_color_info_flag. Do a sequence of strcmp
only if meta_color_info_flag is FLV_COLOR_INFO_FLAG_PARSING.
4. Check return value of amf_parse_object().

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:03:15 +08:00
f34294897f avformat/flvdec: Fix use sizeof(AVMasteringDisplayMetadata)
sizeof AVMasteringDisplayMetadata isn't part of ABI.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
2025-03-12 16:02:12 +08:00
7b81676be4 tests: Add enhanced-flv-hevc-hdr10 for demux and mux HDR color info
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
2025-03-12 16:01:20 +08:00
74412bd108 avcodec/snow: Remove ff_snow_release_buffer()
Pointless after 7e41f95dce.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 07:29:40 +01:00
b0af322654 avcodec/vc2enc: Use LUT to assemble interleaved golomb code
Up until now, the encoder processed only one bit at a time.
With this patch, it is eight bits.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-12 07:27:48 +01:00
0b097ed9f1 avcodec/ffv1enc_template: Be a bit more verbose on error
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:02 +01:00
a8a83e06f9 avcodec/ffv1: Fix remap and float with golomb rice
Sponsored-by: Sovereign Tech Fund
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:02 +01:00
99f0f6e401 avcodec/ffv1enc: Fix slice coding mode 1 with rgb frames
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:01 +01:00
9899da8175 libavfilter: guard against ff_draw_init/ff_draw_init2 failures
The return value of ff_draw_init and ff_draw_init2 are not checked in
most usages. However, if they return an error, they don't get to the
point where they set the attributes of the FFDrawContext. These
functions are typically used in conjunction with ff_draw_color, which
checks draw->desc->flags, causing a null pointer dereference.

Signed-off-by: Nil Fons Miret <nilf@netflix.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-03-11 14:17:01 +01:00
bdc07f372a hwcontext_vulkan: add support for mapping multiplane images into CUDA
This patch refactors the CUDA import code to allow for Vulkan images
with multiple planes to be mapped.

Currently, a driver bug exists which causes NV12 images to be mapped
incorrectly when the memory being mapped contains both planes, the
issue has been reported to NVIDIA.
yuv420p does work correctly, however.

This is still an improvement, as the code used to crash when trying to
map the memory, unless disable_multiplane=1 was given as an option.
2025-03-11 13:42:19 +01:00