Commit Graph

117221 Commits

Author SHA1 Message Date
Anton Khirnov
7d245866b8 lavc/hevc/ps: implement SPS parsing for nuh_layer_id>0
Cf. F.7.3.2.2 "Sequence parameter set RBSP syntax", which extends normal
SPS parsing with special clauses depending on MultiLayerExtSpsFlag.
2024-09-23 17:11:40 +02:00
Anton Khirnov
4359467ad6 lavc/hevc/ps: drop a warning for sps_multilayer_extension_flag
SPS multilayer extension contains a single flag that we are free to
ignore, no reason to print a warning.
2024-09-23 17:11:40 +02:00
Niklas Haas
7351e067bc lavc/hevc_ps: parse VPS extension
Only implementing what's needed for MV-HEVC with two views.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:11:40 +02:00
James Almer
efa9d3deca avcodec/hevc/sei: add support for 3D Reference Displays Information SEI
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:11:40 +02:00
Anton Khirnov
299d9115d4 lavfi/f_select: allow selection based on view ID
Can be used together with the split filter to decompose multiview video
into individual views.
2024-09-23 17:11:40 +02:00
Anton Khirnov
6940a6de2f lavu/frame: add side data storing view ID for multi-view video 2024-09-23 17:11:38 +02:00
Rémi Denis-Courmont
a7505ec562 compat: add a fallback implementation of C23 stdbit.h
Header contents taken from VLC commit 7a970a33329c9836d169727ddbaf49a33240d587.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:08:46 +02:00
Anton Khirnov
8c185ef4e7 compat: drop gcc, suncc, and pthreads stdatomic emulation
Since we now require a C11-compliant compiler, there should be no
supported configurations where any of these is used.
2024-09-23 17:08:46 +02:00
Jonathan Baudanza
6b3f9c2e92 avformat/rtpdec: fix integer overflow in start_time_realtime calculation
I encountered this problem with NTP timestamps that are extremely old,
like from January, 1990.

Although RFC3550 suggests that the timestamps in the RTCP packets use
the actual wallclock, some implementations use other clocks, such as
the CLOCK_MONOTONIC on linux.

I'm my case, I'm dealing with packets from mediasoup.

Without this patch, start_time_realtime shows up in the distance future
instead of around Jan 1900.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:08:33 +02:00
James Almer
660e7e6a0e avcodec: add LCEVC decoding support via LCEVCdec
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:20:47 -03:00
James Almer
6147385393 avcodec: add an export_side_data flag to export picture enhancement layers
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:07:37 -03:00
James Almer
d250cc02e2 avcodec/hevc/refs: ensure LCEVC SEI payloads are exported as frame side data before get_buffer() calls
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:05:34 -03:00
James Almer
dbbf9a5ff7 avcodec/decode: split ProgressFrame allocator into two functions
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:05:34 -03:00
James Almer
a48eba0021 fftools/ffmpeg_filter: ensure that the inserted filters exist
If not, report it as a bug. avfilter_graph_create_filter() will return ENOMEM if the
passed filter argument is NULL, which is misleading.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 09:02:23 -03:00
James Almer
aeb64d6fa5 configure: add missing filter dependencies to ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 09:02:23 -03:00
Víctor Manuel Jáquez Leal
2bcc124e1a
vulkan_encode: set the quality level in session parameters
While running this command

./ffmpeg_g -loglevel debug -hwaccel vulkan -init_hw_device vulkan=vk:0,debug=1 -hwaccel_output_format vulkan -i input.y4m -vf 'format=nv12,hwupload' -c:v h264_vulkan -quality 2 output.mp4 -y

It hit this validation error:

Validation Error: [ VUID-vkCmdEncodeVideoKHR-None-08318 ] Object 0: handle =
0x8f000000008f, type = VK_OBJECT_TYPE_VIDEO_SESSION_KHR; Object 1: handle =
0xfd00000000fd, type = VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR;
| MessageID = 0x5dc3dd39
| vkCmdEncodeVideoKHR(): The currently configured encode quality level (2) for
VkVideoSessionKHR 0x8f000000008f[] does not match the encode quality level (0)
VkVideoSessionParametersKHR 0xfd00000000fd[] was created with. The Vulkan spec
states: The bound video session parameters object must have been created with
the currently set video encode quality level for the bound video session at the
time the command is executed on the
device (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdEncodeVideoKHR-None-08318)

This patch adds a new function helper for creating session parameters, which
also sets the quality level and it's called by the H.264 and H.265 Vulkan
encoders.
2024-09-23 13:42:34 +02:00
Lynne
39c640e1d6
nlmeans_vulkan: split up descriptor sets, rename buffer offset vars 2024-09-23 13:42:34 +02:00
Lynne
bc36fe6f1f
vulkan: use push descriptors where possible
Push descriptors are in theory slightly faster, but come with
limitations for which we have to check.

Either way, they're not difficult to implement, so even though
no one should be using peasant-tier descriptors, do it anyway.
2024-09-23 13:41:07 +02:00
Lynne
8a7af4aa49
vulkan: add support for regular descriptor pools
This permits:
 - The use of Vulkan filtering on many more devices
 - Better debugging due to lack of descriptor buffer support in layers

Much of the changes here are due to a requirement that updates to
descriptors must happen between the command buffer being waited on,
and the pipeline not being bound.

We routinely did it the other way around, by updating only after
we bind the pipeline.
2024-09-23 13:40:38 +02:00
Lynne
3d75ba7495
vulkan: separate out descriptor layouts from sets
Just avoids a single temporary allocation.
2024-09-23 13:40:38 +02:00
Lynne
2942ca802a
hwcontext_vulkan: forward debug_mode to check_extensions() for devices
This allows disabling of certain extensions when debug mode is turned on.
2024-09-23 13:40:37 +02:00
Lynne
b5184c5d45
hwcontext_vulkan: add the PROFILE_INDEPENDENT only when needed 2024-09-23 13:40:36 +02:00
Lynne
a577d313b2
hwcontext_vulkan: add support for implicit DRM synchronization
More recent kernel versions allow for users to extract a sync_file
handle from a DMA-BUF, which can then be imported into Vulkan as a
binary semaphore.

This finally allows for synchronization between Vulkan and DMA-BUF
images, such as those from screen capture software, or VAAPI,
avoiding any corruption artifacts.

This is done fully asynchronously, where we use the kernel's
given binary semaphores as a dependency to increment the image's
usual VkSemaphores we allocate. The old imported binary semaphores
are cleaned up after execution as usual.

In the future, hwcontext_drm should receive support for explicitly
synchronized images as well, which would make the synchronization
more robust and portable.
2024-09-22 02:11:08 +02:00
Lynne
2395444c80
vulkan: add ff_vk_exec_add_dep_bool_sem
This function simply takes in a binary semaphore as a dependency
to an execution.
2024-09-22 02:11:08 +02:00
Lynne
c4048013e5
vulkan: flexibly allocate temporary imageviews
No reason to allocate 16 when 3 will do.
2024-09-22 02:11:07 +02:00
Lynne
1445102e68
hwcontext_vulkan: fix VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask
fmt_props.usage was initialized to 0 as create_info.usage was set later.
2024-09-22 02:11:04 +02:00
Brad Smith
2bf588f273 libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc
Modern Linux has getauxval() and FreeBSD/OpenBSD ppc have elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-21 03:11:22 -04:00
Marvin Scholz
9e1682761f avcodec/cbs_h266: Fix copy paste mistake
The us macro expect the range_max here, which seems should be
MAX_UINT_BITS(hlen) here.

Fix CID1618757 Copy-paste error
2024-09-20 22:32:54 +02:00
James Almer
2eef902d38 avcodec/bsf/dts2pts: don't zero the node buffers when allocating them
It's unnecessary as the entire struct is written to immediately after it's
allocated.
Restores the behavior prior to fec6a8df31.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 23:23:14 -03:00
Marvin Scholz
720ae6b3f7 avcodec/vaapi_encode_h265: fix missing slice_block_cols assignment
Instead of assigning to unit_opts.slice_block_cols, the slice_block_cols
value from the context was incorrectly assigned to slice_block_rows.

Regression from 12f158ca8f

Fixes CID1619479 Unused value

Reviewed-by: Fei Wang <fei.w.wang@intel.com>
2024-09-20 09:30:11 +08:00
Marvin Scholz
4858a8ee2f configure: do not use interval regexp operators with awk
Some awk implementations like mawk (used on Ubuntu) do not support
these.
2024-09-20 02:50:01 +02:00
Marvin Scholz
ed633a1312 MAINTAINERS: add myself as vf_xfade_vulkan maintainer 2024-09-19 21:28:11 +02:00
James Almer
dc11c12b64 avfilter: add an LCEVC decoding filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:06:05 -03:00
James Almer
df609af8e4 avcodec/packet: add an LCEVC enhancement data payload side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:26 -03:00
James Almer
5fa9c4e596 avformat/mov: support for LCEVC tracks
Co-authored-by: V-Nova Team <systems@v-nova.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:24 -03:00
James Almer
ba0ef0860f avformat: add an LCEVC stream group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:02 -03:00
James Almer
5896318229 avcodec/codec_id: add an LCEVC codec id for raw LCEVC data
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:02 -03:00
James Almer
9cea2410a1 avcodec/h2645_sei: export raw LCEVC metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:01:00 -03:00
James Almer
90d12c24c5 avutil/frame: add an LCEVC enhancement data payload side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 08:45:48 -03:00
Gyan Doshi
0d5b68c27c ffmpeg_mux_init: correct log suggestion
The option is enc_time_base, not enc_timebase
2024-09-19 15:35:15 +05:30
Fei Wang
5211ad1acd lavc/vaapi_encode: Fix potential use of uninitialized value
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-19 12:01:28 +08:00
Fei Wang
061c86a717 lavc/vaapi_encode_av1: Fix encode fail since 9db68ed0
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-09-19 12:01:18 +08:00
Michael Niedermayer
6be3786c82
avformat/mxfdec: Check timecode for overflow
Fixes: signed integer overflow: 9223372036840103968 + 538976288 cannot be represented in type 'long'
Fixes: 70604/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4844090340999168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:43:22 +02:00
Michael Niedermayer
5a96aa435a
avformat/mxfdec: More offset_temp checks
Fixes: signed integer overflow: 9223372036854775807 - -1927491430256034080 cannot be represented in type 'long'
Fixes: 70607/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5282235077951488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:39:21 +02:00
Michael Niedermayer
176db9db6e
avformat/flvdec: Free metaVideoColor
Fixes: memeleak
Fixes: 70659/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-4539872627458048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:24:27 +02:00
Michael Niedermayer
bd80c97391
swscale/output: Fix undefined integer overflow in yuv2rgba64_2_c_template()
Fixes: signed integer overflow: -1082982400 + -1083218484 cannot be represented in type 'int'
Fixes: 70657/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6707819712675840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:24:26 +02:00
Michael Niedermayer
44c5641ae8
swscale/swscale: Use unsigned operation to avoid undefined behavior
I have not checked that the constant is correct, this just fixes the undefined behavior

Fixes: signed integer overflow: -646656 * 3517 cannot be represented in type 'int
Fixes: 70559/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5209368631508992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:10:38 +02:00
Michael Niedermayer
6df9a0292c
avcodec/vc2enc: basic sanity check on slice_max_bytes
Fixes: left shift of 896021632 by 3 places cannot be represented in type 'int'
Fixes: 70544/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC2_fuzzer-6685593652756480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-19 00:10:32 +02:00
Tomas Härdin
665bf46ac2 lavf/mxfdec: Handle KLV fill 2024-09-18 21:43:06 +02:00
Tomas Härdin
8f2ba4333d lavf/mxfdec: Switch to mxf_metadata_read_table loop to FF_ARRAY_ELEMS, skip if read == NULL 2024-09-18 21:43:06 +02:00