summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
* hwcontext_vulkan: remove optional encode/decode extensions from the listLynne2023-02-061-8/+0
| | | | | | | | | They're not currently used, so they don't need to be there. Vulkan stabilized the decode extensions less than a week ago, and their name prefixes were changed from EXT to KHR. It's a bit too soon to be depending on it, so rather than bumping, just remove these for now. (cherry picked from commit eb0455d64690eed0068e5cb202f72ecdf899837c)
* avutil/hwcontext_d3d11va: fix texture_infos writes on non-fixed-size poolsTimo Rothenpieler2022-07-181-1/+12
|
* avutil/parseutils: use quadhd for Quad HDLimin Wang2022-01-121-1/+1
| | | | | | | | | qHD is 960x540 (q stands for quarter) and QHD is 2560x1440 (Q is quad). use quadhd for QHD for abbreviation. Fix ticket#9591 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/hwcontext_vulkan: fixed incorrect memory offsetWu Jianhua2022-01-051-5/+7
| | | | | | | | This commit fixed hwupload in Vulkan: ffmpeg -init_hw_device vulkan -i test.jpg -vf hwupload,hwdownload,format=yuv420p -y out.jpg Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* lib*/version.h: Bump Versions before release/5.0 branchAndreas Rheinhardt2022-01-041-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/frame: Add Dolby Vision metadata side data typeNiklas Haas2022-01-045-2/+201
| | | | | | | | | | | In order to be able to extend this struct later (as the Dolby Vision RPU evolves), all of the 'container' structs are considered extensible, and the individual constituent fields must instead be accessed via offsets. The precedent for this style of access is set in <libavutil/detection_bbox.h> Signed-off-by: Niklas Haas <git@haasn.dev> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lib*/version.h: Bump Versions after release/5.0 branchMichael Niedermayer2022-01-031-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lib*/version.h: Bump Versions before release/5.0 branchMichael Niedermayer2022-01-031-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vulkan: remove VK_EXT_hdr_metadata from autoloaded extensions listLynne2022-01-031-1/+0
| | | | | | We don't use it. Was copied from libplacebo's recommended defaults. Creates problems with validation on Intel devices, where the driver still advertizes it, even though it's not usable without a swapchain.
* libavutil/hwcontext_qsv: clean padding when upload qsv framesWenbin Chen2021-12-231-13/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix #7830 When we upload a frame that is not padded as MSDK requires, we create a new AVFrame to copy data. The frame's padding data is uninitialized so it brings run to run problem. For example, If we run the following command serveral times we will get different outputs. ffmpeg -init_hw_device qsv=qsv:hw -qsv_device /dev/dri/renderD128 \ -filter_hw_device qsv -f rawvideo -s 192x200 -pix_fmt p010 \ -i 192x200_P010.yuv -vf "format=nv12,hwupload=extra_hw_frames=16" \ -c:v hevc_qsv output.265 According to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#encoding-procedures "Note: It is the application's responsibility to fill pixels outside of crop window when it is smaller than frame to be encoded. Especially in cases when crops are not aligned to minimum coding block size (16 for AVC, 8 for HEVC and VP9)" I add a function to fill padding area with border pixel to fix this run2run problem, and also move the new AVFrame to global structure to reduce redundant allocation operation to increase preformance. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavu/hwcontext_videotoolbox: use OS-provided mapping routines when availablercombs2021-12-221-2/+14
|
* lavu/videotoolbox: expose routine to set CVPixelBufferRef metadatarcombs2021-12-223-1/+14
|
* lavu/videotoolbox: expose conversion routines for color parametersrcombs2021-12-222-83/+113
| | | | | Also fixes symbol lookup errors on older macOS when built with a newer SDK, introduced in 6cab5206b0ad94990c435cb7c5cf3b29675e0231
* avutil/tests/cpu: add slowgatherJames Almer2021-12-211-0/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/cpu: add slowgather to av_parse_cpu_caps()James Almer2021-12-211-0/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/cpu: move slow gather checks below in the functionJames Almer2021-12-211-14/+9
| | | | | | Put them together with other similar slow flag checks. Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil/cpu: Add AV_CPU_FLAG_SLOW_GATHER.Alan Kelly2021-12-213-3/+17
| | | | This flag is set on Haswell and earlier and all AMD cpus.
* avutil/display: fix inverted docZhao Zhili2021-12-202-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: add objc.h to SKIPHEADERSAman Karmani2021-12-191-0/+1
| | | | Signed-off-by: Aman Karmani <aman@tmm1.net>
* avutil/twofish: Fixed decryptionSebastian Kirmayer2021-12-192-7/+16
| | | | | | | | | | The previous implementation swapped the two halves of the plaintext. The existing tests only decrypted data with a plaintext of all zeroes, which is not affected by swapping the halves. Tests which detect the old buggy behavior have been added. Signed-off-by: Sebastian Kirmayer <ffmpeg@kirmayer.eu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: add obj-c helpers into header-only includeAman Karmani2021-12-181-0/+32
| | | | | Reviewed-by: Ridley Combs <rcombs@rcombs.me> Signed-off-by: Aman Karmani <aman@tmm1.net>
* avcodec: [loongarch] Optimize h264_chroma_mc with LASX.Shiyou Yin2021-12-151-0/+1877
| | | | | | | | | | | ./ffmpeg -i ../1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an before:170 after :183 Change-Id: I42ff23cc2dc7c32bd1b7e4274da9d9ec87065f20 Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Reviewed-by: guxiwei <guxiwei-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: [loongarch] Add support for loongarch SIMD.Shiyou Yin2021-12-157-0/+117
| | | | | | | | | | | LSX and LASX is loongarch SIMD extention. They are enabled by default if compiler support it, and can be disabled with '--disable-lsx' '--disable-lasx'. Change-Id: Ie2608ea61dbd9b7fffadbf0ec2348bad6c124476 Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Reviewed-by: guxiwei <guxiwei-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vulkan: wait on semaphores when exporting to DRMLynne2021-12-101-0/+11
| | | | There is no synchronization method for DRM yet.
* lavu: bump minor version and add doc/APIchanges entry for Vulkan changesLynne2021-12-101-2/+2
|
* hwcontext_vulkan: stricter semaphore number requirementsLynne2021-12-101-6/+4
| | | | | | Always require one semaphore per sw_format plane. This is what the implementation uses and relies upon throughout. This was a leftover from an earlier revision that was never needed.
* hwcontext_vulkan: support creating DRM-tiled images and autodetecting modifiersWenbin Chen2021-12-102-9/+165
| | | | | | | | | | | | | | | When vulkan image exports to drm, the tilling need to be VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT. Now add code to create vulkan image using this format. Now the following command line works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format \ vaapi -i input_1080p.264 -vf "hwmap=derive_device=vulkan,format=vulkan, \ scale_vulkan=1920:1080,hwmap=derive_device=vaapi,format=vaapi" -c:v h264_vaapi output.264 Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Further-modifications-by: Lynne <dev@lynne.ee>
* hwcontext_vulkan: add support for mapping frames with planes in a single ↵Wenbin Chen2021-12-101-2/+9
| | | | | | | | | | VkDeviceMemory Add support to map vulkan frames to software frames when using contiguous_planes flag. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Further-modifications-by: Lynne <dev@lynne.ee>
* hwcontext_vulkan: add support for allocating all planes in a single allocationWenbin Chen2021-12-102-4/+103
| | | | | | | | | | | | | | VAAPI on Intel can import external frame, but the planes of the external frames should be in the same drm object. A new option "contiguous_planes" is added to device. This flag tells device to allocate places in one memory. When device is derived from vaapi this flag will be enabled. A new flag frame_flag is also added to AVVulkanFramesContext. User can use this flag to force enable or disable this behaviour. A new variable "offset "is added to AVVKFrame. It describe describe the offset from the memory currently bound to the VkImage. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Further-modifications-by: Lynne <dev@lynne.ee>
* libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frameWenbin Chen2021-12-101-0/+1
| | | | | | | Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* hwcontext_vaapi: Use PRIME_2 memory type for modifiers.Bas Nieuwenhuizen2021-12-101-44/+114
| | | | | | | | | | | | | | | | | | | | | | | | | This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier if all the buffer-passing has used explicit modifier. All these issues should be resolved by passing in the modifier, and for that we switch to using the PRIME_2 memory type. Tested with experimental radeonsi patches for modifiers and kmsgrab. Also tested with radeonsi without the patches to double-check it works without PRIME_2 support. v2: Cache PRIME_2 support to avoid doing two calls every time on libva drivers that do not support it. v3: Remove prime2_vas usage. Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
* avutil/aes_ctr: Avoid allocation of AVAES structAndreas Rheinhardt2021-12-081-12/+5
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/frame: Treat frame as uninitialized in get_frame_defaults()Andreas Rheinhardt2021-12-051-6/+4
| | | | | | | | | | | | | | Currently, it also tests whether extended_data points to something different than the AVFrame's data array and frees extended_data if it is different. Yet this is only necessary for one of its three callers, namely av_frame_unref(); meanwhile the other two callers took measures to avoid this (or rather, to make it to an av_free(NULL)). This commit moves this chunk to av_frame_unref() (so that get_frame_defaults() now treats its input as uninitialized) and removes the now superfluous code in the other two callers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/frame: clarify doxyAnton Khirnov2021-12-041-2/+1
| | | | | AVFrame.data[] elements not used by the format should ALWAYS be null, hwaccel formats are not an exception.
* lavu/frame: drop mentions of non-refcounted framesAnton Khirnov2021-12-041-4/+7
| | | | All frames we deal with should always be refcounted now.
* libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to qsvnyanmisaka2021-12-041-1/+1
| | | | | | | | | | | | | | The data stored in data[3] in VAAPI AVFrame is VASurfaceID while the data stored in pair->first is the pointer of VASurfaceID, so we need to do cast to make following commandline works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \ -hwaccel_output_format vaapi -i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264 Signed-off-by: nyanmisaka <nst799610810@gmail.com> Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavu/avframe: add a time_base fieldLynne2021-12-033-1/+11
| | | | | This adds a time_base field to AVFrame, as an analogue to the AVPacket.time_base field.
* all: Use av_memdup() where appropriateAndreas Rheinhardt2021-12-031-4/+2
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* videotoolbox: add alpha supportrcombs2021-11-281-0/+2
|
* lavu/videotoolbox: add 422 and 444 pixel format mappingsrcombs2021-11-281-0/+44
|
* lavu/pixfmt: add high-bit-depth semi-planar 4:2:2/4:4:4 formatsrcombs2021-11-282-0/+114
| | | | These are used by VideoToolbox hardware decoders.
* hwcontext_vulkan: use correct return value for allocation failureLynne2021-11-271-1/+1
|
* avutil/hwcontext_vulkan: fully support customizable validation layersWu Jianhua2021-11-262-29/+136
| | | | | | | | | | Validation layer is an indispensable part of developing on Vulkan. The following commands is on how to enable validation layers: ffmpeg -init_hw_device vulkan=0,debug=1,validation_layers=VK_LAYER_LUNARG_monitor+VK_LAYER_LUNARG_api_dump Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avutil/hwcontext_vulkan: check if created before destroying the instanceWu Jianhua2021-11-241-1/+2
| | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avutil/hwcontext_vulkan: check if created before destroying the deviceWu Jianhua2021-11-241-1/+2
| | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avutil/hwcontext_cuda: return more useful error codes from init functionsTimo Rothenpieler2021-11-221-7/+11
|
* avutil/hwcontext_cuda: add option to use primary device contextTimo Rothenpieler2021-11-222-1/+25
|
* hwcontext_vulkan: check for non-flagged transfer queue familiesLynne2021-11-201-0/+7
| | | | | | | | | "All commands that are allowed on a queue that supports transfer operations are also allowed on a queue that supports either graphics or compute operations. Thus, if the capabilities of a queue family include VK_QUEUE_GRAPHICS_BIT or VK_QUEUE_COMPUTE_BIT, then reporting the VK_QUEUE_TRANSFER_BIT capability separately for that queue family is optional."
* lavu/vulkan: check for initialization when freeing buffersLynne2021-11-201-1/+1
| | | | | | | | | What happens on startup is that ffmpeg.c initializes the filter, then frees it without feeding a single frame through. With no input frame, the filter lacks a hardware device. The rest of the uninit code checks if Vulkan objects exist, which they must if there's a hardware device, but vk->DeviceWaitIdle does not require an object. So, add a check for it.
* avutil/vulkan_glslang: fix compiling failure issueWu Jianhua2021-11-191-2/+2
| | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>