1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

5854 Commits

Author SHA1 Message Date
Lynne
758f8b26b9
vulkan: add ff_vk_count_images() 2023-05-29 00:41:48 +02:00
Lynne
b5eaeb1f13
vulkan: rewrite to support all necessary features
This commit rewrites the majority of vulkan.c to enable its use
as a general-purpose high-level utility code, usable for decoding,
encoding, and filtering of video frames.

The dependency system was rewritten to simplify management of
execution.

The image handling system was rewritten to accomodate multiplane
images.

Due to how related all the new features were, this is a single
commit.
2023-05-29 00:41:48 +02:00
Lynne
721b71da4a
vulkan: return current queue index from ff_vk_qf_rotate() 2023-05-29 00:41:48 +02:00
Lynne
b15104ed97
vulkan: add support for retrieving queue, query and video properties 2023-05-29 00:41:47 +02:00
Lynne
6eaf3fe69c
vulkan: add support for queries 2023-05-29 00:41:47 +02:00
Lynne
f3fb1b50bb
vulkan: minor indent fix, add support for synchronous submission/waiting 2023-05-29 00:41:46 +02:00
Lynne
d386988c39
vulkan: use device properties 2 and add a convenience loader function 2023-05-29 00:41:46 +02:00
Lynne
bf69a64135
vulkan: add size tracking to buffer structs 2023-05-29 00:41:46 +02:00
Lynne
b18e20a4ee
vulkan: do not wait for device idle when destroying buffers
This should be done explicitly.
2023-05-29 00:41:45 +02:00
Lynne
15de0af8f0
vulkan: allow alloc pNext in ff_vk_create_buf 2023-05-29 00:41:45 +02:00
Lynne
af48790465
vulkan: support ignoring memory properties when allocating 2023-05-29 00:41:45 +02:00
Lynne
3c2f43d8ee
vulkan: expose ff_vk_alloc_mem() 2023-05-29 00:41:44 +02:00
Lynne
fa67ccee37
vulkan: add ff_vk_image_create() 2023-05-29 00:41:44 +02:00
Lynne
e8fce74abf
vulkan: add ff_vk_qf_fill() 2023-05-29 00:41:43 +02:00
Lynne
b5e333bba7
vulkan: add pNext argument to ff_vk_create_buf() 2023-05-29 00:41:43 +02:00
Lynne
a0d47a2ad9
vulkan: fix comment statement about exec_queue blocking 2023-05-29 00:41:43 +02:00
Lynne
619b1265a2
vulkan: add additional error codes 2023-05-29 00:41:42 +02:00
Lynne
0c9c0e40fb
vulkan: define VK_NO_PROTOTYPES
This just disables the vulkan headers from defining any symbols
like vkCmdPipelineBarrier2(). Instead, all functions must be loaded
via the loader and used as function pointers as vk->CmdPipelineBarrier2.

Mostly just forces developers to write correct code, as using the
symbols can be undesirable in case API users define their own
function wrappers via the loader API.
2023-05-29 00:41:42 +02:00
Lynne
92ddd415bc
vulkan: lock queues before submitting operations 2023-05-29 00:41:42 +02:00
Lynne
9b385b480f
hwcontext_vulkan: enable GPU-assisted validation when debugging 2023-05-29 00:41:41 +02:00
Lynne
e5e12c5078
hwcontext_vulkan: load query-related functions
Needed for both encoding and decoding.
2023-05-29 00:41:41 +02:00
Lynne
d4cb48dd00
hwcontext_vulkan: support PREP_MODE_DECODING in prepare_frame() 2023-05-29 00:41:41 +02:00
Lynne
6dfa29a58d
hwcontext_vulkan: add functions for video decoding 2023-05-29 00:41:40 +02:00
Lynne
571756bf2f
hwcontext_vulkan: use VK_EXT_physical_device_drm to derive DRM to Vulkan
Finally, a way to directly identify a Vulkan device from a DRM device!
2023-05-29 00:41:40 +02:00
Lynne
e11fd1abdb
hwcontext_vulkan: do not require libdrm to map VAAPI devices
VAAPI is sadly on the way of becoming multiplaform.
2023-05-29 00:41:39 +02:00
Lynne
f50bc930a4
hwcontext_vulkan: add support for descriptor buffers 2023-05-29 00:41:39 +02:00
Lynne
c5702abf71
hwcontext_vulkan: report nonCoherentAtomSize 2023-05-29 00:41:39 +02:00
Lynne
b0af92572f
hwcontext_vulkan: fix minor type issue in VulkanQueueCtx.buf_deps_alloc_size 2023-05-29 00:41:38 +02:00
Lynne
211c910aca
hwcontext_vulkan: rename and expand vk_pixfmt_map to append VK_NULL_FORMAT 2023-05-29 00:41:38 +02:00
Lynne
e0f2d2e702
hwcontext_vulkan: remove contiguous memory path/mode
The hack was added to enable exporting of vulkan images to DRM.
On Intel hardware, specifically for DRM images, all planes must be
allocated next to each other, due to hardware limitation, so the hack
used a single large allocation and suballocated all planes from it.

By natively supporting multiplane images, the driver is what decides
the layout, so exporting just works.

It's a hack because it conflicted heavily with image allocation, and
with the whole ecosystem in general, before multiplane images were
supported, which just made it redundant.

This is also the commit which broke the hwcontext hardest and prompted
the entire rewrite in the first place.
2023-05-29 00:41:37 +02:00
Lynne
46a77c6496
hwcontext_vulkan: support threadsafe queue and frame operations 2023-05-29 00:41:37 +02:00
Lynne
2a1fd2814f
hwcontext_vulkan: use portability subset if available 2023-05-29 00:41:37 +02:00
Lynne
74b202b839
hwcontext_vulkan: enable VK_KHR_synchronization2 if supported 2023-05-29 00:41:36 +02:00
Lynne
fddfb0ebf8
hwcontext_vulkan: enable support for YCbCr samplers 2023-05-29 00:41:36 +02:00
Lynne
59707cc485
hwcontext_vulkan: initialize and require instance version 1.3
This just bumps the required loader library version (libvulkan).
All device-related features, such as video decoding, atomics, etc.
are still optional and the code deals with their loss on a local level
(e.g. the decoder or filter checks for the features it needs, not
the hwcontext).

Bumping the required version essentially packs all maintenance
extensions which correct the spec rather than requiring to enable
them individually.
2023-05-29 00:41:36 +02:00
Lynne
0bda3340a3
lavu: add 12-bit 2-plane 422 and 444 pixel formats 2023-05-29 00:41:35 +02:00
yuanhecai
82278e8749
avutil/la: Add function performance testing
This patch supports the use of the "checkasm --bench" testing feature
on loongarch platform.

Change-Id: I42790388d057c9ade0dfa38a19d9c1fd44ca0bc3
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-25 21:05:21 +02:00
James Almer
4d885271bb avutil/mathematics: add missing constants
Including float variants for all of them.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-19 17:10:58 -03:00
James Almer
4adb6da7a6 avutil/frame: remove one layer of indirection in av_frame_replace()
And don't force copy side data.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-18 11:52:16 -03:00
James Almer
01d444c077 avutil/frame: add av_frame_replace
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-18 10:15:59 -03:00
James Almer
63767b79a5 avutil/frame: deprecate palette_has_changed
Not only this is information that relies on the concept of a sequence of
frames, which is completely out of place as a field in AVFrame, but there are
no known or intended uses of this field.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-18 08:45:23 -03:00
Anton Khirnov
d45a296732 lavu/frame: extend AVFrame.repeat_pict documentation 2023-05-15 10:31:55 +02:00
James Almer
0fc9c1f682 avutil/version: bump minor after recent changes
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 19:20:06 -03:00
James Almer
3e06f6f040 avutil/frame: deprecate key_frame
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 19:20:03 -03:00
James Almer
cc11191fda avutil/frame: add a keyframe flag to AVFrame
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 18:16:47 -03:00
James Almer
599abc0f3a avutil/frame: deprecate interlaced_frame and top_field_first
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 18:15:00 -03:00
James Almer
2df4e054d4 avutil/frame: add new interlaced and top_field_first flags
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 17:40:24 -03:00
Rémi Denis-Courmont
0e580806d8 riscv/intmath: use builtins for counting ones
As with the earlier bswap change, all versions of GCC and Clang that
support RISC-V support the popcount built-ins, so we can just use them
instead of inline assembler.
2023-05-02 22:08:25 +02:00
Rémi Denis-Courmont
7dcb5e1ab0 riscv/bswap: use compiler builtins
av_bswapXX() are used in context that expect exact size types, notably
variable arguments to av_log(). On Linux RV64, uint_fast32_t is an
unsigned long, so the current inline assembler does not work properly.

Since GCC and Clang gained their byte-swap built-ins before they
supported RISC-V, we can simply defer to them. As an added bonus, the
compiler can do instruction scheduling, which it couldn't with the Zbb
inline assembler.
2023-05-02 22:08:21 +02:00
Sil Vilerino
a9a2ddaea8 lavu/hwcontext_qsv: Update after adding support for VAAPI on Windows
- qsv_internal.h: Remove unnecessary include va_drm.h
- qsv_internal.h: Enable AVCODEC_QSV_LINUX_SESSION_HANDLE on Linux/VA only
- hwcontext_qsv.c: Do not allow child_device_type VAAPI for Windows until
  support is added, keep D3D11/DXVA2 as more prioritary defaults.

Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
2023-04-24 13:24:41 +08:00