aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
...
* avutil/downmix_info: zero the allocated bufferJames Almer2025-01-251-1/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil/pixfmt: 16bit float supportMichael Niedermayer2025-01-212-0/+85
| | | | | Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vulkan: enable using .elems field for buffer content definitionsLynne2025-01-221-3/+11
| | | | | This avoids needing to snprintf when the buffer only contains an array of a struct, while letting the validation layers detect errors more reliably.
* avutil/avstring: dont mess with NULL pointers in av_match_list()Michael Niedermayer2025-01-171-2/+4
| | | | | | Fixes: applying zero offset to null pointer Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vulkan: check if semaphores are exportable before enabling exportingLynne2025-01-132-19/+41
| | | | | | | | | lavapipe recently added support for external_semaphore_fd, but only for syncfiles, not for opaque file descriptors. The code is written to allow using syncfiles later on. Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12422
* avutil/frame.h: improve documentation for AV_FRAME_FLAG_LOSSLESSLeo Izen2025-01-111-1/+5
| | | | | | | | | | It should be more clear what this flag is indicating with a more verbose comment documenting it. Signed-off-by: Leo Izen <leo.izen@gmail.com> Reviewed-by: Marton Balint <cus@passwd.hu> Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Reviewed-by: Marth64 <marth64@proxyid.net>
* avutil/frame: add AV_FRAME_SIDE_DATA_FLAG_NEW_REFJames Almer2025-01-103-11/+15
| | | | | | | The flag is documented but did not exist. So introduce it as it can be useful. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/frame: add AV_FRAME_FLAG_LOSSLESSMarton Balint2025-01-051-0/+4
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/channel_layout: fix definition of 5.1.4 layoutJames Almer2025-01-032-2/+2
| | | | | | | It's meant to have the side channels, as defined in Sound System D from ITU-R - BS.2051-3 Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/channel_layout: add a 5.1.2 layout using side channelsJames Almer2025-01-033-2/+5
| | | | | | And rename the existing 5.1.2 to explicitly state it contains back channels. Signed-off-by: James Almer <jamrial@gmail.com>
* hwcontext_vulkan: add VK_EXT_layer_settings to optional instance extensionsLynne2025-01-031-0/+1
| | | | | | | | The issue is that some compilers complain if a struct or array is empty. This extension does nothing by default, and can be useful, so just add it to keep the array non-empty.
* avutil/timecode: Avoid fps overflow in av_timecode_get_smpte_from_framenum()Michael Niedermayer2024-12-241-2/+2
| | | | | | | Fix from c94875471e3ba3dc396c6919ff3ec9b14539cd71 Found-by: Youngjae Choi <youngjaechoi@korea.ac.kr> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/frame: add missing size dependent prop to LCEVC payload side dataJames Almer2024-12-231-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: add av_frame_side_data_remove_by_props()Niklas Haas2024-12-233-1/+25
| | | | | | | | | | As discussed in the previous commit, we often need a convenient way of stripping all side data related to a certain aspect of the frame. This helper accomplishes just that. I considered also adding a way to match only side data matching *all* properties, but I think this is sufficiently useless in practise to not warrant inclusion in the API.
* avutil/frame: add AV_SIDE_DATA_PROP_{SIZE,COLOR}_DEPENDENTNiklas Haas2024-12-233-14/+28
| | | | | | | | | | | | | | | | | | Many filters modify certain aspects of frame data, e.g. through resizing (vf_*scale* family), color volume mapping (vf_lut*, vf_tonemap*), or possibly others. When this happens, we should strip all frame side data that will no longer be correct/relevant after the operation. For example, changing the image size should invalidate AV_FRAME_DATA_PANSCAN because the crop window (given in pixels) no longer corresponds to the actual image size. For another example, tone-mapping filters (e.g. from HDR to SDR) should strip all of the dynamic HDR related metadata. Since there are a lot of different side data types that are affected by such operations, it makes sense to establish this information in a common, easily accessible way. The existing side data properties enum is a perfect fit for this.
* avutil/frame: add AVSideDataDescriptor for AV_FRAME_DATA_VIDEO_HINTNiklas Haas2024-12-231-0/+1
| | | | This entry was seemingly missing.
* configure: add option to statically link to libvulkanLynne2024-12-231-0/+9
| | | | | | | This may be useful in weird setups and on platforms where static linking to libvulkan is supported. libplacebo also has this fallback.
* vulkan: do not reinvent a queue context structLynne2024-12-233-41/+27
| | | | | | | | | | We recently introduced a public field which was a superset of the queue context we used to have. Switch to using it entirely. This also allows us to get rid of the NIH function which was valid only for video queues.
* vulkan: remove pointless mutex locksLynne2024-12-232-12/+2
| | | | | | | | | This code was simply incorrect through and through. It did not protect what actually has to be protected in a multi-threaded setup. Perhaps it was used to silence threading errors? Either way, remove it, and document the correct way to use execution pools in a threaded environment.
* hwcontext_vulkan: disable validation layer threading warningsLynne2024-12-231-0/+1
| | | | | The layer is buggy currently: https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/9045
* hwcontext_vulkan: do not enable portability subset by defaultLynne2024-12-231-0/+2
| | | | | It doesn't make sense to, and could result in the implementation picking emulation layers.
* avutil/mem_internal: Don't include stdalign.h on MSVCMartin Storsjö2024-12-181-0/+2
| | | | | | | | | | | | | | | It's currently actually not used in MSVC builds, since 6e49b8699657b808b7dc80033f2c3f2d0e029fa3. Older versions of MSVC (or, in particular, older versions of UCRT) don't have stdalign.h; it's available since WinSDK 10.0.20348.0; such a new enough version has been installed by default only since MSVC 2022 17.4 and newer. With this change, ffmpeg can still be built with MSVC 2019 16.8 (v19.28). Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/vulkan_glslang: Fix build failureZhao Zhili2024-12-171-1/+1
| | | | | compile_only isn't available until 13.1.0. Let default initialization set it to zero, so the code works with version before and after 13.1.0.
* lavc/container_fifo: move to lavu and make publicAnton Khirnov2024-12-153-0/+351
| | | | | | | | | | | | | | This can be useful in other places, e.g. it can replace objpool in fftools. The API is modified in the following nontrivial ways: * opaque pointers can be passed through to all user callbacks * read and write were previously separate callbacks in order to accomodate the caller wishing to write a new reference to the FIFO and keep the original one; the two callbacks are now merged into one, and a flags argument is added that allows to request such behaviour on a per-call basis * new peek and drain functions
* lavc/refstruct: move to lavu and make publicAnton Khirnov2024-12-154-1/+686
| | | | It is highly versatile and generally useful.
* avutil/file: fix av_file_map file mapping on WindowsKacper Michajłow2024-12-151-1/+1
| | | | | | | | | | | | | This makes the behavior of av_file_map() the same on Windows as it is on other platforms. The file is opened as read-only, but the mapping is copy-on-write, allowing the user to write to the memory pages returned by av_file_map(). This commit fixes libavutil\tests\file.c test, which would crash when trying to write to a read-only memory page. Signed-off-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avutil/channel_layout: simplify the 22.2 layout definitionJames Almer2024-12-131-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/channel_layout: add a 9.1.6 layoutJames Almer2024-12-133-1/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/tests/color_utils: reduce accuracy threshold to pass to 1e-7Hendrik Leppkes2024-12-071-1/+1
| | | | | | | | Fixes FATE on a variety of configurations due to accuracy problems in floating point math. Most constants tested against here are not even specified with 7 decimal digits. Reviewed-by: Niklas Haas <git@haasn.dev>
* avutil/tests/color_utils: add tests for av_csp_itu_eotfNiklas Haas2024-12-051-0/+110
|
* avutil/csp: add EOTF function definitionsNiklas Haas2024-12-053-1/+239
| | | | | | | | | | | | The existing av_csp_trc_func_from_id() mostly implements the OETF, except for PQ. As such, we are currently missing a precise definition of an ITU-R EOTF. Introduce the new functions av_csp_itu_eotf() and av_csp_itu_eotf_inv(), to fill this void. Note that this is not possible in all cases, e.g. AVCOL_TRC_LOG which has no corresponding EOTF definition in any ITU-R standard. Note that we cannot implement the proper HLG and SMPTE 428 OOTFs without access to all three color channels, because they are not independent per channel. As a result, we need to define them on double[3] instead of double (*func)(double).
* avutil/csp: add av_csp_trc_inv_from_id()Niklas Haas2024-12-054-14/+163
| | | | | Mathematical inverse of av_csp_trc_from_id(), plus testing to make sure it roundtrips correctly with the corresponding TRC.
* avutil/tests/color_utils: clean up slightly (cosmetic)Niklas Haas2024-12-051-16/+18
| | | | | Rewrite this test slightly to fix the formatting, improve the readability of the output, and eliminate some unnecessary branching.
* avutil/csp: eliminate redundant branchNiklas Haas2024-12-051-5/+1
|
* avutil/csp: fix documentation of av_csp_trc_functionNiklas Haas2024-12-051-2/+6
| | | | | | This explanation was inaccurate and highly misleading. The new wording is taken more or less directly from ITU-T H.273, and also matches my understanding of these functions.
* configure: Add wasm as a fake archZhao Zhili2024-12-046-0/+56
| | | | | | | | | And add wasm simd128 flag, so we can add simd128 optimizations. It can be enabled by put -msimd128 to extra cflags. There is no runtime detection on simd128 support yet. I think that needs to be done with JavaScript. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avutil/mem_internal: Don't use alignas for MSVCZhao Zhili2024-12-021-0/+4
| | | | | | | MSVC messed up standard C features, again. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> Reviewed-by: James Almer <jamrial@gmail.com>
* avutil/mem_internal: local align should always workZhao Zhili2024-11-291-24/+4
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avutil/mem_internal: define DECLARE_ALIGNED as C11's alignasZhao Zhili2024-11-291-19/+8
| | | | | | | | | 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>
* vulkan: fix use of atomics for the current context indexLynne2024-11-282-12/+4
| | | | | | | | | 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.
* ffv1enc_vulkan: switch to receive_packetLynne2024-11-261-0/+1
| | | | | | | | 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.
* vulkan: only wait for fences on uninit if the context had a submissionLynne2024-11-261-1/+2
| | | | This fixes a potential deadlock on exit.
* vulkan: zero out AVBufferRef in case of failureLynne2024-11-261-0/+4
| | | | | This resulted in uninit errors and was never caught as we generally did not use massive allocations before.
* vulkan: only apply shortcut for next context selection if selection has a ↵Lynne2024-11-261-1/+2
| | | | submission
* vulkan: add opaque field to execution contextsLynne2024-11-261-0/+3
| | | | Helps keep track of what dispatch happened where.
* hwcontext_vulkan: take disable_multiplane into account when checking for formatsLynne2024-11-261-2/+2
|
* hwcontext_vulkan: require storage properties to claim formats as supportedLynne2024-11-261-2/+2
| | | | | | | | | | | 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.
* hwcontext_vulkan: add support for AV_PIX_FMT_GBRAP10/12/14Lynne2024-11-262-1/+9
|
* hwcontext_vulkan: add support for AV_PIX_FMT_GBRP12/14/16Lynne2024-11-262-3/+12
|
* hwcontext_vulkan: add support for AV_PIX_FMT_GRAY10/12/14Lynne2024-11-262-0/+6
|