aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
...
* avutil/slicethread: Mark avpriv_slicethread_{create,free} as av_coldAndreas Rheinhardt2025-03-261-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/slicethread: Remove NULL pointer check when freeingAndreas Rheinhardt2025-03-261-3/+2
| | | | | | | | | | avpriv_slicethread_free() is one of our functions that takes a pointer to a pointer and resets the pointer when done. It is legal for such functions to be passed a pointer to a NULL pointer, yet passing a NULL pointer would be insane and should not be tolerated. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/libm: Only include intfloat.h when neededAndreas Rheinhardt2025-03-222-0/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavutil/hwcontext_amf: add format validation in transfer_data functionsDmitrii Ovchinnikov2025-03-211-0/+6
|
* avutil/csp: Improve enum range comparisonsAndreas Rheinhardt2025-03-211-7/+7
| | | | | | | | | | | | | | | | | | | The underlying integer type of an enumeration is implementation-defined (see C11, 6.7.2.2 (4)); GCC defaults to unsigned if there are no negative values like for all enums from pixfmt.h except enum AVPixelFormat. This means that tests like "if (csp >= AVCOL_SPC_NB)" for invalid colorspaces need not work as expected (namely if enum AVColorSpace is signed). It also means that testing for such an enum variable to be >= 0 may be tautologically true. Clang emits a -Wtautological-unsigned-enum-zero-compare warning for this. Fix both of these issues by casting to unsigned. Also do the same in libswscale/format.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/tests/pixfmt_best: add more semi planar format testsJames Almer2025-03-191-0/+22
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: only duplicate hal2float and float2half in shared buildsJames Almer2025-03-181-0/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* vulkan: add support for AV_PIX_FMT_GBRAP32Lynne2025-03-172-1/+12
|
* vulkan: add ff_vk_exec_add_dep_wait_sem()Lynne2025-03-172-8/+23
| | | | | This adds a function which adds a regular timeline semaphore as a wait-only dependency.
* vulkan: unify handling of BGR and simplify ffv1_rctLynne2025-03-172-0/+52
|
* hwcontext_vulkan: enable VK_KHR_video_maintenance2Lynne2025-03-172-0/+14
| | | | Enables some fixes for the video specifications, and a new feature.
* vulkan: workaround BGR storage image undefined behaviourLynne2025-03-171-0/+25
|
* hwcontext_vulkan: allow using concurrent access images with more than 5 queuesLynne2025-03-171-1/+1
| | | | | | This limit was not bumped when the queue family rewrite happened. Fixes validation issues on nvidia.
* hwcontext_vulkan: fix downloads; use the common host map function to map ↵Lynne2025-03-171-160/+77
| | | | | | | | | | frame data This commit uses the recently exported code for host mapping images back where it was exported from. The function also had broken download code for image downloading since its recent refactor.
* vulkan: copy host-mapping buffer code from hwcontextLynne2025-03-172-3/+178
| | | | This is useful elsewhere.
* vulkan: add ff_vk_create_imageviewLynne2025-03-172-0/+58
|
* vulkan: rename ff_vk_set_descriptor_image to ff_vk_shader_update_imgLynne2025-03-172-21/+21
|
* pixfmt: add AV_PIX_FMT_GBRAP32Lynne2025-03-173-1/+33
| | | | | | This commit adds a 32-bit *integer* planar RGBA format. Vulkan FFv1 decoding is best performed on separate planes, rather than packed RGBA (i.e. RGBA128), hence this is useful as an intermediate format.
* all: Fix doxy comments wrongly designated as trailing ///<Andreas Rheinhardt2025-03-121-1/+1
| | | | | | | | | | | The ///< or /**< form of doxygen comments are only to be used when the documentation follows the member and the comment block starts on the same line as the member. This commit fixes wrong uses of them; in particular, this fixes the comment for mb_height in H.264 SPS's structure which was wrongly added to mb_width. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* hwcontext_vulkan: add support for mapping multiplane images into CUDALynne2025-03-111-102/+160
| | | | | | | | | | | | | This patch refactors the CUDA import code to allow for Vulkan images with multiple planes to be mapped. Currently, a driver bug exists which causes NV12 images to be mapped incorrectly when the memory being mapped contains both planes, the issue has been reported to NVIDIA. yuv420p does work correctly, however. This is still an improvement, as the code used to crash when trying to map the memory, unless disable_multiplane=1 was given as an option.
* avutil/vulkan: Remove unused ff_vk_create_avbuf()Andreas Rheinhardt2025-03-112-38/+0
| | | | | | | Unused since aea4d4b423c62aecf326ef3ae1578710faa3eca6. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/refstruct: Fix documentationAndreas Rheinhardt2025-03-111-5/+5
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/pixfmt: add YAF16 and YAF32 pixel formatsJames Almer2025-03-103-1/+54
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/log: Set AVClass* in av_expr_eval()Andreas Rheinhardt2025-03-081-5/+7
| | | | | | | | Otherwise it is possible for av_log() to receive a non-NULL object with a NULL AVClass pointer; the default log callback handles it gracefully, yet this is probably an API violation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Added support for direct RGB input to AMF encoderDmitrii Ovchinnikov2025-03-061-0/+2
|
* avutil/attributes_internal: Add EXTERN macro for extern+hiddenAndreas Rheinhardt2025-03-051-0/+2
| | | | | | | | This is inspired by the equivalent dav1d attribute introduced by Henrik Gramner in e4c4af02f3de5e6cea6f81272a2981c0fa7bae28. Also already use it to beautify declarations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/frame: move side data helpers to a new fileJames Almer2025-03-034-311/+351
| | | | | | | Should reduce clutter in frame.c, plus allow us to make opaque changes to side data handling. Signed-off-by: James Almer <jamrial@gmail.com>
* vulkan: take refs of frames using the regular buffer ref pathLynne2025-03-031-6/+14
| | | | | | | | | | | This simplifies the code, reduces allocations, and critically, does not store references of frames, along with references to hw_frames_ctx. The issue was that storing refs to frames while transferring stored refs to hw_frames_ctx of frames, and so created a circular dependency, which caused the Vulkan device to never be terminated. This only stores what it strictly needs as a dependency, and enables the frames context to be freed, even while doing asynchronous transfers.
* avutil/timecode: add ff_timecode_set_smpteTimo Rothenpieler2025-03-024-24/+106
|
* lavu: bump minor and add APIChanges entry for new GRAY32 pixfmtsLynne2025-03-011-1/+1
|
* vulkan: add support for AV_PIX_FMT_GRAY32Lynne2025-03-012-3/+5
|
* pixfmt: add AV_PIX_FMT_GRAY32Lynne2025-03-012-0/+25
| | | | This is a useful format for high-precision intermediates.
* libavutil/vulkan: Expose ff_vk_set_descriptor_imageIndecisiveTurtle2025-02-282-6/+14
| | | | Useful when creating a descriptor array of separate images
* avutil/aarch64/tx_float_neon.S: clean up FFT4_X2Krzysztof Pyrkosz via ffmpeg-devel2025-02-281-24/+8
|
* hwcontext_vulkan: enable read/write without storageLynne2025-02-271-0/+2
| | | | | | | | | | BGR formats in Vulkan cannot be used in storage images, as the pixel labels on storage images are always ordered as RGB, and swizzling is not an option due to old hardware limitations. This means that you must always use an RGB format and manually swizzle when reading or writing to BGR images, or simply not use a format in the shader itself. This adds support for the latter.
* vulkan: add .buf_elems to FFVulkanDescriptorSetLynne2025-02-212-2/+3
| | | | | | | | | | This enables users to specify a number that would be appended to the buf_content string. Saves users from needing to manually print to a string. An earlier commit tried doing this via .elems, but it was faulty, as this also incremented the total number of descriptors in the descriptor set.
* vulkan: don't query video queue properties unless the extension is enabledLynne2025-02-212-3/+3
| | | | Fixes validation errors.
* vulkan: fix crash in ff_vk_shader_freeLynne2025-02-181-4/+6
| | | | | The issue is if a shader fails to compile, shd->desc_layout would not exist, but nb_descriptor_sets would.
* avutil/frame: Fix direct pointer compare between different arrayZhao Zhili2025-02-171-4/+8
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avutil/log: support logging of date and time informationsoftworkz2025-02-163-4/+40
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* random_seed: Improve behaviour with small timer increments with high ↵Martin Storsjö2025-02-131-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | precision timers On a Zen 5, on Ubuntu 24.04 (with CLOCKS_PER_SEC 1000000), the value of clock() in this loop increments by 0 most of the time, and when it does increment, it usually increments by 1 compared to the previous round. Due to the "last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) >= t" expression, we only manage to take one step forward in this loop (incrementing i) if clock() increments by 2, while it incremented by 0 in the previous iteration (last_td). This is similar to the change done in c4152fc42e480c41efb7f761b1bbe5f0bc43d5bc, to speed it up on systems with very small CLOCKS_PER_SEC. However in this case, CLOCKS_PER_SEC is still very large, but the machine is fast enough to hit every clock increment repeatedly. For this case, use the number of repetitions of each timer value as entropy source; require a change in the number of repetitions in order to proceed to the next buffer index. This helps the fate-random-seed test to actually terminate within a reasonable time on such a system (where it previously could hang, running for many minutes). Signed-off-by: Martin Storsjö <martin@martin.st>
* random_seed: Reorder if clauses for gathering entropyMartin Storsjö2025-02-131-8/+11
| | | | | | | | Make it easier to add more cases. This should be a pure refactoring, with no functional changes. Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/hwcontext_amf: fix crash on uninit after init failedKacper Michajłow2025-02-071-2/+4
| | | | | | | | | amf_device_create() calls amf_device_uninit() on errors, but if things were not initialized it will null deref amf_ctx->factory. Fixes: https://github.com/mpv-player/mpv/issues/15814 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avutil/Makefile: fix SKIPHEADERS for AMFJames Almer2025-02-041-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: add hwcontext_amf.Dmitrii Ovchinnikov2025-02-049-0/+718
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds hwcontext_amf, enabling a shared AMF context for encoders, decoders, and AMF-based filters, without copy to the host memory. Code also was tested in HandBrake. Benefits: - Optimizations for direct video memory access from CPU - Significant performance boost in full AMF pipelines with filters - Integration of GPU filters like VPP, Super Resolution, and Compression Artefact Removal(in future plans) - VCN power management control for decoders. - Ability to specify which VCN instance to use for decoding (like for encoder) - AMD will soon introduce full AMF API for multimedia accelerator MA35D - With AMF API, integration will be much easier: GPU and the accelerator will have the same API - including encoder, decoder, scaler, color converter, Windows and Linux. Learn more: https://www.amd.com/en/products/accelerators/alveo/ma35d.html Changes by versions: v2: Header file cleanup. v3: Removed an unnecessary class. v4: code cleanup and improved error handling v5: Fixes related to HandBrake integration. v6: Sequential filters error and memory leak have been fixed.
* avutil/hwcontext_cuda: add 4:2:2 pixel format supportDiego de Souza2025-02-021-0/+2
| | | | | | | | This commit adds support for 4:2:2 pixel formats, namely NV16 and P216 for NVIDIA GPUs. Signed-off-by: Diego de Souza <ddesouza@nvidia.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avutil/cpu: Disable ff_getauxval() on x86Andreas Rheinhardt2025-02-021-0/+2
| | | | | | Not used there. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/frame: check return value for cropping offsetsLeo Izen2025-01-281-2/+7
| | | | | | | | This function can return AVERROR_BUG in theory if something went wrong, but so can the caller, so we should propagate that error message upward in that case. Signed-off-by: Leo Izen <leo.izen@gmail.com>
* avutil/downmix_info: check for side data allocation success before zeroing itJames Almer2025-01-281-1/+2
| | | | | | | Fixes coverity #1641638. Marvin Scholz <epirat07@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: add a side data prop to signal channel layout dependent typesJames Almer2025-01-253-3/+10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>