Commit Graph

6845 Commits

Author SHA1 Message Date
James Almer
44862a9d68 avutil/aarch64/cpu: fix check for SME on Linux
SME is a AT_HWCAP2 entry, not AT_HWCAP.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-12-10 21:51:11 -03:00
Georgii Zagoruiko
cdb14bc74d configure: add detection of assembler support for SME
All changes are made during development/testing of SVE/SME for ffmpeg (vvc). Tested on Apple M4
2025-12-09 21:38:38 +00:00
Cameron Gutman
212eb8413a hwcontext_vulkan: add APIs to get optional extensions
These provide a way for apps that initialize Vulkan themselves to know
which extensions we may be able to use without having to hardcode it.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2025-12-08 23:22:31 +00:00
Kacper Michajłow
6083c9bb8c avutil/hwcontext_vaapi: mark try_all with av_unused to suppres warning
Fixes: warning: variable 'try_all' set but not used [-Wunused-but-set-variable]
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-12-08 21:31:13 +00:00
Kacper Michajłow
9ed71a837b avutil/vulkan: fix device memory size truncation
size_t cannot fit VK_WHOLE_SIZE on 32-bit builds.

Fixes: warning: conversion from 'long long unsigned int' to 'size_t' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295'

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-12-03 23:45:44 +00:00
Lynne
a8e8daa276 hwcontext_vulkan: fix final error to let old header files work
........
2025-12-03 22:34:32 +01:00
Lynne
bce14bb160 hwcontext_vulkan: fix compilation with older header versions 2025-12-03 21:22:54 +01:00
Andreas Rheinhardt
5d9270df7f libavutil/internal: Remove {SIZE,PTRDIFF}_SPECIFIER
Possible since 222127418b.

Reviewed-by: Kacper Michajłow <kasper93@gmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-12-03 11:52:54 +01:00
averne
1e90047fe6 vulkan: fix host copy stride
memoryRowLength is is texels, not bytes
2025-12-01 15:40:40 +01:00
llyyr
7043522fe0 avutil/hwcontext_d3d12va: use hwdev context for logging
This fixes warning about av_log being called with NULL AVClass. This is
also an API violation

Fixes: https://trac.ffmpeg.org/ticket/11335
2025-12-01 03:15:25 +00:00
Lynne
932a872dbc hwcontext_vulkan: fix VkImageToMemoryCopyEXT.sType
It was copy pasted from the upload path.
Somehow, it was missed, despite god knows how many validation layer runs.
2025-11-30 23:11:46 +01:00
Russell Greene
3beaa2d70f hwcontext_vulkan: remove VK_HOST_IMAGE_COPY_MEMCPY flag
Reading the spec for what this flag means, it copies the data verbatim, including any swizzling/tiling, this has two issues

1. the format may not be what ffmpeg expects elsewhere, as it is expecing normal pitch linear host memeory in `swf`
2. the size of the copied data may not match the size of buffer provided, causing heap buffer overflow

It seems like addition of this flag is an oversight as it seems to be for caching/backups of image data, just to be used with copying back to the GPU with the MEMCPY flag, which is *not* how its used in ffmpeg.

Additionally, set memoryRowLength as if it isn't set, it assumes pitch = width_in_bytes, which I don't think is necessarily the case
2025-11-30 21:47:12 +00:00
Andreas Rheinhardt
59d75bf9e4 avutil/x86/Makefile: Only compile ASM init files when X86ASM is enabled
To do so, simply add these init files to X86ASM-OBJS instead of OBJS
in the Makefile. The former is already used for the actual assembly
files, but using them for the C init files just works, because the build
system uses file extensions to derive whether it is a C or a NASM file.

This avoids compiling unused function stubs and also reduces our
reliance on DCE: We don't add %if checks to the asm files except
for AVX, AVX2, FMA3, FMA4, XOP and AVX512, so all the MMX-SSE4
functions will be available. It also allows to remove HAVE_X86ASM checks
in these init files.

Reviewed-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-30 22:20:13 +01:00
Andreas Rheinhardt
0ec9c1b68d avutil/x86/x86inc: Use parentheses in has_epilogue
Prevents surprises.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-30 00:15:43 +01:00
Diego de Souza
9c76d7db86 avutil/hwcontext_cuda: Expands pixel formats support
Add support for additional pixel formats in CUDA hardware context:
- Planar formats (yuv420p10, yuv422p, yuv422p10, yuv444p10)
- Semiplanar formats (nv16, p210, p216)

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
2025-11-27 22:11:57 +01:00
Lynne
3ddcf042b2 ffv1enc_vulkan: add support for x2bgr10/x2rgb10 2025-11-26 15:16:40 +01:00
Lynne
23cfcf93d2 vulkan: change ff_vk_frame_barrier access and stage type to sync2
Cleans up a compiler warning.
2025-11-26 15:16:40 +01:00
Lynne
6c3984db7f vulkan/common: add a function to flush/invalidate a buffer and use it
Just for convenience.
2025-11-26 15:16:39 +01:00
Lynne
d288d4a24e hwcontext_vulkan: use vkTransitionImageLayoutEXT to switch layouts
Falls back to regular submit-based layout switching if unsupported.
2025-11-26 15:16:39 +01:00
Lynne
5c89528342 hwcontext_vulkan: disable host image transfers for Nvidia devices
Nvidia's binary drivers have a very buggy implementation that is
yet to be fixed.
2025-11-26 15:16:39 +01:00
Lynne
686951849b hwcontext_vulkan: re-enable host image copy extension
We'll slowly start to use it in the code in safe places
rather than globally.
2025-11-26 15:16:39 +01:00
Lynne
fc2dd6c751 hwcontext_vulkan: enable runtime descriptor sizing
We were already using this in places, but it seems validation
layers finally got support to detect it.
2025-11-26 15:16:39 +01:00
Dmitrii Ovchinnikov
140b4f28c3 avutil/hwcontext_amf: move AVMutex to internal context 2025-11-24 20:06:24 +00:00
Andreas Rheinhardt
04a9e2a809 avutil/error: Avoid relocations and unused information
Use a string table instead to avoid relocations and don't add
the tag string to libavutil/error.c: It is only used
during the test program, so move it there.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-24 16:48:31 +01:00
Andreas Rheinhardt
2a90e7d725 av{codec,util}/tests: Remove pointless undefs
Before commit e96d90eed6 lavu/internal.h
contained redefined various discouraged/forbidden functions to induce
compilation failures upon use, like e.g.
 #define malloc please_use_av_malloc
In order to use these functions, some files had to undefine these
macros. This commit removes the remaining pointless undefs.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-24 16:48:31 +01:00
Zhao Zhili
c732564d2e avutil/hwcontext_vaapi: fix use fourcc not supported by devices
1. A AVPixelFormat can map to multiple VA_FOURCCs, while
vaapi_format_from_pix_fmt() only returns the first item matched
before this patch.
2. vaapi_frames_init() use vaapi_format_from_pix_fmt() to get the
first item. Fourcc in this item may not be supported by the device.

This patch makes vaapi_format_from_pix_fmt return all matched items
iteratively, then use strict check in vaapi_frames_init to get the
right fourcc.
2025-11-24 08:51:17 +00:00
Zhao Zhili
0ae8df5f2c avutil/common: cast GET_BYTE/GET_16BIT returned value
In case of GET_BYTE/GET_16BIT return signed value.
2025-11-19 17:46:06 +00:00
Andreas Rheinhardt
5bf57a925c avutil/x86/asm: Remove wrong comment, rename FF_REG_sp
Before FFmpeg commit 531b0a316b,
FFmpeg used REG_SP as macro for the stack pointer, yet this
clashed with a REG_SP define in Solaris system headers, so it
was changed to REG_sp and a comment was added for this.

Libav fixed it by adding an FF_ prefix to the macros in
1e9c5bf4c1. FFmpeg switched
to using these prefixes in 9eb3da2f99,
using FF_REG_sp instead of Libav's FF_REG_SP. In said commit
the comment was changed to claim that Solaris system headers
define FF_REG_SP, but this is (most likely) wrong.

This commit removes the wrong comment and renames the (actually unused)
macro to FF_REG_SP to make it consistent with FF_REG_BP.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-18 20:41:13 +01:00
Andreas Rheinhardt
643e2e10f9 avutil/cpu: Deprecate AV_CPU_FLAG_FORCE
This flag does nothing since the deactivation of
the dsp_mask field of AVCodecContext in
commits 9ae6ba2883 and
9ae6ba2883 (it has
been superseded with better ways to override the CPU flags).
So deprecate it.

Reviewed-by: Lynne <dev@lynne.ee>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-16 11:24:00 +01:00
Dmitrii Ovchinnikov
62184be548 avutil/hwcontext_amf: Simplified blocking before frame submission
Instead of blocking the entire context, which can cause issues in more
complex pipelines, now only frame sending is blocked via AVMutex
2025-11-13 15:49:42 +01:00
Niklas Haas
203c6a93d7 avutil/hwcontext_vulkan: actually limit number of queues
This option is parsed after it is used.
2025-11-12 15:25:07 +00:00
Lynne
f39884b3fd vulkan: fix driver warning for unrecognized structure
VkQueueFamilyQueryResultStatusPropertiesKHR was added with the
VK_KHR_video_queue extension, which NVK does not support yet.
Correctly classify it as part of the video extensions.
2025-11-12 10:36:48 +01:00
Lynne
dd32bb8855 vulkan: allow arrays of buffers
Could be useful.
2025-11-12 00:37:25 +01:00
Rémi Denis-Courmont
9b348aa60b riscv/cpu: add V subset feature detection
This adds support for detecting Zve32x, Zve32f, Zve64x and Zve64d on
a system that does not support (or declare) the full V feature set.

Because the code assumes that vector detected at runtime are at least
128-bit long, we have to manually check that too (in theory, vectors
can be 32-bit or 64-bit, though that makes little sense in 2025).
2025-11-11 18:40:47 +00:00
Tim Blechmann
28461f2c43 libavutil: fix memory leak of drmVersion
address sanitizer showed some leaks of drmVersion structs.
`vaapi_device_create` did not call drmFreeVersion in all possible code
paths.
2025-11-08 21:48:00 +00:00
Andreas Rheinhardt
cb7b962a4a avutil/timecode: Fix -Wformat-truncation warning
Using unsigned for fps is more natural since the corresponding
AVTimecode field is unsigned. It also fixes a -Wformat-truncation
warning from GCC 16: in case fps were negative, hours, minutes
and seconds would be negative, leading to additional '-' characters
which are not accounted for in AV_TIMECODE_STR_SIZE.

Reviewed-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-08 19:33:11 +01:00
Zhao Zhili
36e5576a44 avutil/hwcontext_d3d12va: fix buf size when call av_buffer_create 2025-11-08 08:15:17 +00:00
Rémi Denis-Courmont
7435a3180d riscv/cpu: add av_const for VLEN helpers
This is read from a read-only constant system register.
2025-11-07 08:43:23 +00:00
Lynne
dd80ecb666 doc/APIchanges: bump lavu minor and remove reverted pixfmts 2025-11-06 21:47:08 +01:00
Lynne
9a7174bc9a Revert "lavu/pixfmt: add grayscale 10 and 12-bit MSB padded variants"
This reverts commit ed5b694ebe.
2025-11-06 21:46:43 +01:00
Lynne
26236a47b2 Revert "lavu/pixfmt: add 420 and 422, 10 and 12-bit MSB padded variants"
This reverts commit e42c7698f5.
2025-11-06 21:46:43 +01:00
Lynne
22cc958c58 Revert "hwcontext_vulkan: fix grayscale 10 and 12-bit formats using the new MSB formats"
This reverts commit 471acedec2.
2025-11-06 21:44:13 +01:00
Lynne
2c7732a676 Revert "hwcontext_vulkan: fix 3-plane 444 10 and 12-bit formats using the new MSB formats"
This reverts commit 41ecb203c5.
2025-11-06 21:44:13 +01:00
Lynne
38df9ba71b Revert "hwcontext_vulkan: fix planar 10 and 12-bit RGB formats using the new MSB formats"
This reverts commit 98ee3f6718.
2025-11-06 21:44:13 +01:00
Lynne
15e82dc452 Revert "hwcontext_vulkan: remove unsupported/broken pixel formats"
This reverts commit 5b388f2838.
2025-11-06 21:44:13 +01:00
Zhao Zhili
222127418b avutil/internal: remove some compats for msvc
They are supported by MSVC with C11.
2025-11-06 02:16:27 +00:00
Kacper Michajłow
3eb0cb3b0b avutil/hwcontext_vulkan: use correct bitmask types
Vulkan headers define *FlagBits enum with individual bit values, and
coresponding *Flags typedef to be used to store the bitmask of
coresponding bits.

In practice those two types map to the same type, but for consistency
*Flags should be used.

Fixes MSVC warnings about type mismatch.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-11-05 19:04:09 +01:00
James Almer
633d424b1b avutil/csp: don't dereference NULL pointer in av_csp_primaries_desc_from_id()
Fixes CID 1668265.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-11-01 12:41:23 -03:00
Lynne
71c7b9156b lavu: bump minor and add APIchanges entry for V-Log/V-Gamut 2025-10-28 20:46:21 +01:00
Lynne
92a688cabd lavu: add support for Panasonic V-Gamut 2025-10-28 20:46:21 +01:00