aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
* vulkan: move OPT_CHAIN out of hwcontext_vulkanLynne2025-04-223-84/+64
| | | | | | This allows for it to be shared. Technically, implementations should not give drivers structs that the drivers are not familiar with.
* vulkan: check that the max number of push descriptors is not exceededLynne2025-04-222-5/+11
| | | | | | Just correctness. We don't exceed this on any known hardware, but its better to check. If we do, we simply fall back to regular descriptors.
* vulkan: move feature<->usage mapping code outside of hwcontext_vulkan.cLynne2025-04-223-36/+46
| | | | | Allows for it to be reused. In particular, for a future patch to make vulkan hwaccels output DMABUF-backed VkImages.
* avutil/hwcontext: Add item_name function for AVHWDeviceContextsoftworkz2025-04-211-1/+7
| | | | Signed-off-by: softworkz <softworkz@hotmail.com>
* avutil/log,hwcontext: Add AV_CLASS_CATEGORY_HWDEVICEsoftworkz2025-04-214-1/+4
| | | | Signed-off-by: softworkz <softworkz@hotmail.com>
* vulkan: drop bgr_workaroundLynne2025-04-191-37/+0
| | | | | | | | | | | | | Vulkan's main issue around using BGR is simple. The letters in the shader don't match up (rgba in shader, bgra in format). So of course, rather than allowing "bgra" or other permutations of formats in the shader, they went the nuclear option and spent months writing an extension to get rid of the need to have a format in the shader to begin with. All this to solve a problem that should never have existed to begin with. This fixes BGRA images since enabling WithoutFormat, as the GPU now remaps without your involvement.
* vulkan: always enable ReadWithoutFormat/WriteWithoutFormatLynne2025-04-191-5/+11
| | | | | | | | | | | | This implements support for reading and writing storage images with no format. The issue is that we define our images as arrays, and arrays can only have a single type, which means that f.ex. NV12 needs two different images, R8 and RG8. The only driver known not to advertise support for the extension as a whole is Intel, because they have parial support for odd formats we never use. Therefore, just always enable it by default.
* vulkan: use a single command buffer per command buffer poolLynne2025-04-163-34/+47
| | | | | | | | | | We violated the spec, which, despite the actual command buffer pool *not* being involved in any functions which require external synchronization of the pool, *require* external synchronization even if only the command buffers are used. This also has the effect of *significantly* speeding up execution in case command buffers are contended.
* avutil/hwcontext_vulkan: use the typedef'd name for the expect_assume structJames Almer2025-04-151-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/hwcontext_vulkan: check if expect_assume is supported by the headerJames Almer2025-04-152-0/+11
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* vulkan: add support for expect/assumeLynne2025-04-144-0/+15
| | | | | | This commit adds support for compiler hints. While on AMD these are not used/needed, Nvidia benefits from them, and gives a sizeable 10% speedup on 4k.
* vulkan_ffv1: cache only 2 lines when decoding RGBLynne2025-04-141-0/+1
| | | | | | | | This reduces the intermediate VRAM used for RGB decoding by a factor of 100x for 6k video. This also speeds the decoder up by 16% for 4k RGB24 and 31% for 6k video. This is equivalent to what the software decoder does, but with less pointers.
* hwcontext_vulkan: disable descriptor buffer extension on IntelLynne2025-04-141-1/+21
| | | | | Temporary workaround. Will be replaced with a version check once a fix is in the works and a known next version for Mesa with a fix is known.
* vulkan: remove unused field from exec poolsLynne2025-04-141-2/+0
| | | | | This used to be involved in a mechanism to switch between queue indices, but since the rewrite of the rewrite of the rewrite, it was rewritten out.
* vulkan_shaderc/glslang: print full shaders on TRACE rather than VERBOSELynne2025-04-142-2/+2
| | | | Way too spammy.
* vulkan: fix logging level when erroring upon creating shader moduleLynne2025-04-141-1/+1
|
* avutil/aes: Use #if checks instead of if (ARCH_X86)Andreas Rheinhardt2025-04-131-2/+3
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/aes: Make aes_init_static() av_coldAndreas Rheinhardt2025-04-131-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/x86/aes: remove a few branchesJames Almer2025-04-103-22/+37
| | | | | | | | | | | | | | | | | | | | | | | | The rounds value is constant and can be one of three hardcoded values, so instead of checking it on every loop, just split the function into three different implementations for each value. Before: aes_decrypt_128_aesni: 93.8 (47.58x) aes_decrypt_192_aesni: 106.9 (49.30x) aes_decrypt_256_aesni: 109.8 (56.50x) aes_encrypt_128_aesni: 93.2 (47.70x) aes_encrypt_192_aesni: 111.1 (48.36x) aes_encrypt_256_aesni: 113.6 (56.27x) After: aes_decrypt_128_aesni: 71.5 (63.31x) aes_decrypt_192_aesni: 96.8 (55.64x) aes_decrypt_256_aesni: 106.1 (58.51x) aes_encrypt_128_aesni: 81.3 (55.92x) aes_encrypt_192_aesni: 91.2 (59.78x) aes_encrypt_256_aesni: 109.0 (58.26x) Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/aes: use pthread_once to fill the static tablesJames Almer2025-04-091-23/+30
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/channel_layout: Improve enum range checkAndreas Rheinhardt2025-04-091-1/+1
| | | | | | | | | | Both GCC and Clang use unsigned as underlying type of an enum with no negative enumeration constants, making checks like "layout->order >= 0" here tautologically true. Clang warns about this. Combine both range checks by casting to unsigned to suppress this warning. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/dict: fix memleak in av_dict_set()James Almer2025-04-071-9/+10
| | | | | | Regression since 19e9a203b7b8e613840b055cdf68303a4fb84581. Signed-off-by: James Almer <jamrial@gmail.com>
* APIChanges & version bump for AV_DICT_DEDUPMichael Niedermayer2025-04-071-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/dict: add AV_DICT_DEDUPrcombs2025-04-072-0/+12
| | | | | | | This is useful when multiple metadata inputs may set the same value (e.g. both a container-specific header and an ID3 tag). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/x86/aes: ignore the upper bits in countJames Almer2025-04-061-1/+1
| | | | | | The argument is an int. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/aes_ctr: simplify incrementing the counterJames Almer2025-04-051-10/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/aes_ctr: simplify and optimize av_aes_ctr_crypt()James Almer2025-04-051-26/+21
| | | | | | | | | | | | | Process data in chunks of four or eight bytes, depending on host, instead of one at a time. before: 55561 decicycles in av_aes_ctr_crypt after: 52204 decicycles in av_aes_ctr_crypt Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/aes: add x86 AESNI optimizationsRodger Combs2025-04-055-2/+139
| | | | | | | | | | | | | crypto_bench comparison for AES-128-ECB: lavu_aesni AES-128-ECB size: 1048576 runs: 1024 time: 0.596 +- 0.081 lavu_c AES-128-ECB size: 1048576 runs: 1024 time: 17.007 +- 2.131 crypto AES-128-ECB size: 1048576 runs: 1024 time: 0.612 +- 1.857 gcrypt AES-128-ECB size: 1048576 runs: 1024 time: 1.123 +- 0.224 tomcrypt AES-128-ECB size: 1048576 runs: 1024 time: 9.038 +- 0.790 Improved-By: Henrik Gramner <henrik@gramner.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/aes_ctr: also randomize the encryption keyJames Almer2025-04-051-3/+24
| | | | | | And not just the IV. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/aes_ctr: reindent after the previous commitJames Almer2025-04-051-17/+17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/aes_ctr: also check the encrypted bufferJames Almer2025-04-051-0/+23
| | | | | | | | | | | | | | The test in its current form is just ensuring the plain text output is the same as the plain text input, not bothering to check if anything was done with the latter. av_aes_ctr_crypt() could be a simple memcpy under the hood and this test would still succeed. To check the integrity of the encrypted buffer, both the IV and the key need to be fixed. As such, and in order to not remove the existing randomization of the input IV, do two runs, one with random initialization data, and one with static data. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/aes_ctr: test more than a single block worth of dataJames Almer2025-04-051-2/+3
| | | | | | | This should exercise the implementation more thoroughly after an upcoming change. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/Makefile: Only include half2float, float2half when neededAndreas Rheinhardt2025-04-031-2/+7
| | | | | | | | They are not needed for shared builds (and because --gc-sections is not the default for shared builds, they were included by default included in libavutil since bf22c4cc3e005c01f50e233b1582fd1d8051aed9). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/hwcontext_vulkan: Remove unused variableAndreas Rheinhardt2025-04-031-1/+0
| | | | | | Forgotten in 8c7b00ba3ac4b55d6e48f9a5a4345bbf19c9cb2e. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/hwcontext_vulkan: stop checking for deprecated and removed flagllyyr2025-03-291-3/+0
| | | | | | | | AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY was deprecated in e0f2d2e70228d022195afccc057bd6dc8b688c21 and removed in 09a57602991d47011247f2683f32a53255adcf09 Fixes: e0f2d2e70228d022195afccc057bd6dc8b688c21 Fixes: 09a57602991d47011247f2683f32a53255adcf09
* libs: bump major version for all librariesJames Almer2025-03-281-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/float_dsp: Unavpriv avpriv_scalarproduct_float_c()Andreas Rheinhardt2025-03-284-13/+35
| | | | | | | Not worth the overhead of exporting it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/dict: Unavpriv avpriv_dict_set_timestamp()Andreas Rheinhardt2025-03-282-55/+0
| | | | | | | And move it to lavf, its only user. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: Port AVFrame.private_ref to RefStruct APIAndreas Rheinhardt2025-03-282-15/+7
| | | | | | | | | This is possible without deprecation period, because said field is documented as only for our libav* libraries and not the general public. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/version_major: postpone some deprecations until the next bumpJames Almer2025-03-281-5/+5
| | | | | | They are too recent. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_H274_FILM_GRAIN_VCSJames Almer2025-03-282-50/+9
| | | | | | Deprecated since 2024-03-23. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_VULKAN_CONTIGUOUS_MEMORYJames Almer2025-03-282-6/+0
| | | | | | Deprecated since 2023-05-28. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_PALETTE_HAS_CHANGEDJames Almer2025-03-283-14/+0
| | | | | | Deprecated since 2023-05-18. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_FRAME_KEYJames Almer2025-03-283-16/+0
| | | | | | Deprecated since 2023-05-04. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_INTERLACED_FRAMEJames Almer2025-03-283-25/+0
| | | | | | Deprecated since 2023-05-04. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_FRAME_PKTJames Almer2025-03-283-39/+0
| | | | | | Deprecated since 2023-03-20. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_HDR_VIVID_THREE_SPLINEJames Almer2025-03-282-55/+0
| | | | | | Deprecated since 2023-03-17. Signed-off-by: James Almer <jamrial@gmail.com>
* vulkan_functions: add note to update ff_vk_extensions_to_maskLynne2025-03-271-0/+1
| | | | | Otherwise, the extension looks like its enabled, but isn't actually used by anything.
* vulkan_loader: remap video_maintenance2 in ff_vk_extensions_to_maskLynne2025-03-271-0/+3
| | | | This was broken.
* lavu/vulkan: skip adding NULL buffers as deps in ff_vk_exec_add_dep_bufLynne2025-03-271-0/+3
| | | | Allows for cleaner code.