1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
Commit Graph

6534 Commits

Author SHA1 Message Date
Zhao Zhili
59057aa807 avutil/mem_internal: local align should always work
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-29 12:33:03 +08:00
Zhao Zhili
57861911a3 avutil/mem_internal: define DECLARE_ALIGNED as C11's alignas
alignas is portable than compiler's specific __attribute__. It do
have a limitation, that alignas don't support specify aligment on
the declarations of struct (it works for specify alignment on struct
fields), which only used by avcodec/cavs, and is removed now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-29 12:32:57 +08:00
Lynne
187fd52864
vulkan: fix use of atomics for the current context index
The code used to use atomic, but over time, this got broken.
This commit also remmoves the is-the-last-submission-ready
shortcut, which rarely did anything.
There's also value in relying on the fact that contexts
always carry their frames in a strictly incremental order
with no gaps.
2024-11-28 01:29:21 +09:00
Lynne
d8f301cdf2
ffv1enc_vulkan: switch to receive_packet
This allows the encoder to fully saturate all queues the GPU
has, giving a good 10% in certain cases and resolutions.

This also improves error resilience if an allocation fails,
and properly cleans up after itself if it does.
2024-11-26 14:14:15 +01:00
Lynne
ce8a070cf3
vulkan: only wait for fences on uninit if the context had a submission
This fixes a potential deadlock on exit.
2024-11-26 14:14:14 +01:00
Lynne
86e552506d
vulkan: zero out AVBufferRef in case of failure
This resulted in uninit errors and was never caught as
we generally did not use massive allocations before.
2024-11-26 14:14:14 +01:00
Lynne
f582de8f34
vulkan: only apply shortcut for next context selection if selection has a submission 2024-11-26 14:14:14 +01:00
Lynne
8ac49ae9e0
vulkan: add opaque field to execution contexts
Helps keep track of what dispatch happened where.
2024-11-26 14:14:14 +01:00
Lynne
d485420237
hwcontext_vulkan: take disable_multiplane into account when checking for formats 2024-11-26 14:14:13 +01:00
Lynne
cf0961a527
hwcontext_vulkan: require storage properties to claim formats as supported
This function dates back a long time ago, before vkfmt_from_pixfmt2.
When it was converted over, the thought was that this was far too
restrictive to demand storage images for each format.
With the new clever function, it makes sure to check that the compatible
subformats a format can be used as support storage capabilities.

This gets rid of fake support for RGB48/RGB96 which some implementations
offer but don't support using as storage images.
2024-11-26 14:14:13 +01:00
Lynne
f65e51293a
hwcontext_vulkan: add support for AV_PIX_FMT_GBRAP10/12/14 2024-11-26 14:14:13 +01:00
Lynne
7c52dda55f
hwcontext_vulkan: add support for AV_PIX_FMT_GBRP12/14/16 2024-11-26 14:14:12 +01:00
Lynne
08fb505a66
hwcontext_vulkan: add support for AV_PIX_FMT_GRAY10/12/14 2024-11-26 14:14:07 +01:00
Rémi Denis-Courmont
63922ba5dc lavu/float_dsp: fix compilation with RISC-V ILP32 ABI 2024-11-25 19:29:21 +02:00
Pavel Koshevoy
46cb7b8d9d avutil/frame: also align data pointers in av_frame_get_buffer()
This avoids unpleasant surprises to av_frame_get_buffer callers
that explicitly specified 64-byte alignment and didn't get
AVFrame.data pointers that are 64-byte aligned.

For example, see https://github.com/sekrit-twc/zimg/issues/212

Although the zscale issue has already been resolved by other means
it would still be prudent to improve the behavior of av_frame_get_buffer
to fix any unknown and future instances of similar issues.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
James Almer
ea91d978e3 avutil/frame: fix setting plane_padding
STRIDE_ALIGN is a lavc define and is not necessarely 32. And align may be <= 0 at the
point plane_padding is being set.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
James Almer
09122bd15c avutil/frame: use size_t for total_size in get_video_buffer()
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
Lynne
aad40fed33
vulkan: fix sw_frame_deps counter
The code used as a basis was the buffer dependency code, where the
counter was incremented after each buffer, but for the sw_frame dep
API, we only support adding individual frames at a time.
2024-11-20 05:47:41 +01:00
Brad Smith
f3eca3f387 libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv
libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv

FreeBSD/OpenBSD riscv have elf_aux_info().

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-11-18 22:09:07 +02:00
Rémi Denis-Courmont
e29432e6bb lavu/riscv: fix compilation without Vector support
The half-baked assembler in Clang 16 and earlier can't process our
RISC-V assembler. This adds yet another work around that.

If you must use Clang, please use version 17 or later.
2024-11-18 20:04:38 +02:00
Lynne
d0ab49e3e7
hwcontext_vulkan: add the mapped software frame as an upload dependency
We do uploads asynchronously, and we map the software frames in
order to avoid 2-stage copying. However, whilst we added a dependency
upon the mapped buffers, we did not add the original frame backing
those buffers as a dependency.

This caused issues on RADV, particularly with RGB images.
2024-11-18 07:54:20 +01:00
Lynne
1876026f83
vulkan: add ff_vk_exec_add_dep_sw_frame
Some software frames may be mapped, and we'd like to have
them as proper dependencies.
2024-11-18 07:54:20 +01:00
Lynne
c918b42dcd
vulkan: retrieve Vulkan 1.1 properties
Required to know the subgroup size.
2024-11-18 07:45:46 +01:00
Lynne
16fa710340
vulkan: fix printing descriptors to shader for shaders with no descriptors 2024-11-18 07:45:46 +01:00
Lynne
a516b2da22
vulkan: add support for 10-bit planar RGB 2024-11-18 07:45:46 +01:00
Lynne
eb8f3b8460
hwcontext_vulkan: fix planar RGB images
They were non-working for quite a while.
2024-11-18 07:45:41 +01:00
tangsha
8a5b74f98b delete unused variable ret 2024-11-17 20:56:41 +08:00
Rémi Denis-Courmont
42dd1f1cf1 tests/cpu: print the RISC-V Vector length 2024-11-17 11:28:21 +02:00
Marton Balint
d884606ce0 avutil/rational: never return greater num/den than the maximum allowed in av_d2q
This reverts 887d74c47e, because it ignores the
maximum allowed numerator/denominator. Even if the result was rounded to zero
or infinity, it should not be cause to ignore the maximum allowed number, this
"feature" is unintuitive and undocumented.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-16 20:58:49 +01:00
Marton Balint
25efe34e6f avutil/parseutils: do no rely on av_d2q returning higher num/den than allowed in av_parse_video_rate 2024-11-16 20:58:49 +01:00
Marton Balint
e9af7b7b5d avutil/opt: do no rely on av_d2q returning higher num/den than allowed when parsing rational opts
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-11-16 20:58:49 +01:00
James Almer
edc7b67508 avformat/iamf: use the new Binaural channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
James Almer
20af68b63a avutil/channel_layout: add Binaural channels and layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
Fei Wang
c845a07302 libavutil/hwcontext_{d3d11va, dxva2}: Support Y212/XV36 pixel format
Use DXGI/D3DFMT 16bit pixel format to compatible with 12bit Y212/XV36
since there is no 12bit pixel defined in D3D11/D3D9.

Fix cmdline on Windows:

$ ffmpeg.exe -hwaccel qsv -init_hw_device qsv:hw,child_device_type=
{d3d11, dxva2} -i input_12bit.bin -f null -

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-05 10:28:03 +08:00
Sean McGovern
c325f9c619 libavutil/ppc: defines involving bit shifts should be unsigned
Otherwise, these can overflow at the boundaries of the integer type.

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-11-03 22:05:06 -05:00
Brad Smith
d6b2d08fc7 libavutil/ppc: Include the hardware feature flags like the other archs
Also include the hardware feature flags like the other archs do and
clean up the code a bit.

Tested on Linux POWER9.

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-11-03 03:27:39 -05:00
James Almer
bb57b78013 avutil/hwcontext_vulkan: add missing packed YUV444 format mappings
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-27 14:50:57 -03:00
Marton Balint
9b0128aa76 avutil/wchar_filename: re-introduce explicit cast of void* to char*
Fixes compile error on windows with decklink:

In file included from ./libavformat/os_support.h:175,
                 from ./libavformat/internal.h:30,
                 from libavdevice/decklink_common.cpp:25:
./libavutil/wchar_filename.h: In function 'int wchartocp(unsigned int, const wchar_t*, char**)':
./libavutil/wchar_filename.h:59:32: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
   59 |     *filename = av_malloc_array(num_chars, sizeof **filename);
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                |
      |                                void*

Regression since e9e8bea2e7.

Fixes ticket #11103.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-10-27 09:37:46 +01:00
James Almer
fe21944656 avutil/hwcontext_d3d11va: drop duplicate pixfmt entry
Added by accident in ca71b0b807.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 09:26:36 -03:00
James Almer
ca71b0b807 libavutil/hwcontext_d3d11va: use the XV48 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:55 -03:00
James Almer
dad3d9800d libavutil/hwcontext_dxva2: use the XV48 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:55 -03:00
James Almer
e02a3b40a5 avutil/pixfmt: add XV48 pixel format
Much like XV30 and XV36 in d75c4693fe,
XV48 is added to support 16bit 4:4:4 as defined by Microsoft.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-26 00:04:23 -03:00
James Almer
e1bacfb523 libavutil/hwcontext_d3d11va: use the Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-25 23:57:16 -03:00
James Almer
c76d92b2e0 libavutil/hwcontext_dxva2: use the Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-25 23:57:14 -03:00
James Almer
5c622d4cc1 avutil/hwcontext_vulkan: add support for AV_PIX_FMT_Y216
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 20:06:03 -03:00
James Almer
f462ba05f5 avutil/pixfmt: add Y216 pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-23 14:11:16 -03:00
Lynne
9eb7e8d2a4
vulkan: move alignment of host-visible allocations outside of ff_vk_alloc_mem
The issue is that if dedicated allocation is used, VkBufferCreateInfo.size
and the actual allocated size mismatched, which is a validation error.
2024-10-23 08:14:10 +02:00
James Almer
8d940a07d1 avutil/pixdesc: fix alpha offset for X2{RGB,BGR}10BE
fixes fate-pixelutils

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 10:24:03 -03:00
James Almer
8f1de9ccd9 avutil/pixdesc: add alpha component information to pixfmts with reserved but undefined alpha bits
This can be useful to simplify certain processes that need to know how many
reserved bits there are and where they are placed, even if they are ultimately
unused, as will be shown in the next commit.
For any other case where the user simply looks at nb_components components, it
will make no difference.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:52:50 -03:00
James Almer
72f8f76d45 avutil/pixdesc: ensure the component being read or writen to is valid
If depth is 0, then the component is invalid/unset.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-21 09:43:45 -03:00