19#ifndef AVCODEC_VULKAN_VIDEO_H
20#define AVCODEC_VULKAN_VIDEO_H
26#include <vk_video/vulkan_video_codecs_common.h>
28#define CODEC_VER_MAJ(ver) (ver >> 22)
29#define CODEC_VER_MIN(ver) ((ver >> 12) & ((1 << 10) - 1))
30#define CODEC_VER_PAT(ver) (ver & ((1 << 12) - 1))
31#define CODEC_VER(ver) CODEC_VER_MAJ(ver), CODEC_VER_MIN(ver), CODEC_VER_PAT(ver)
51 const VkAllocationCallbacks *
alloc;
63typedef struct FFVkVideoSession {
116 VkImageAspectFlags *aspect, VkImage
img,
124 VkImageTiling tiling,
void *create_pnext,
132 VkVideoSessionCreateInfoKHR *session_create);
static const char *const format[]
Libavcodec external API header.
AVPixelFormat
Pixel format.
main external API structure.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
VkImageAspectFlags layered_aspect
VkVideoSessionKHR session
FFVkVideoDPBImage * layered_img
VkImageAspectFlags aspect
AVRefStructPool * img_pool
PFN_vkDestroyImage destroy_image
PFN_vkFreeMemory free_memory
const VkAllocationCallbacks * alloc
PFN_vkDestroyImageView destroy_image_view
void ff_vk_video_common_uninit(FFVulkanContext *s, FFVkVideoCommon *common)
Free video session and required resources.
VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth)
Get Vulkan's bit depth from an [8:12] integer.
VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc(const AVPixFmtDescriptor *desc)
Get Vulkan's chroma subsampling from a pixfmt descriptor.
int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level)
int ff_vk_create_view(FFVulkanContext *s, VkImageView *view, VkImageAspectFlags *aspect, VkImage img, VkFormat vkf, VkImageUsageFlags usage, int layered)
Creates image views for video frames.
StdVideoH265ProfileIdc ff_vk_h265_profile_to_vk(int profile)
int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level)
Convert level from Vulkan to AV.
StdVideoH265LevelIdc ff_vk_h265_level_to_vk(int level_idc)
StdVideoAV1Profile ff_vk_av1_profile_to_vk(int profile)
enum AVPixelFormat ff_vk_pix_fmt_from_vkfmt(VkFormat vkf)
Get pixfmt from a Vulkan format.
int ff_vk_video_common_init(AVCodecContext *avctx, FFVulkanContext *s, FFVkVideoCommon *common, VkVideoSessionCreateInfoKHR *session_create)
Initialize video session, allocating and binding necessary memory.
StdVideoH264LevelIdc ff_vk_h264_level_to_vk(int level_idc)
StdVideoH264ProfileIdc ff_vk_h264_profile_to_vk(int profile)
Convert profile from/to AV to Vulkan.
VkImageAspectFlags ff_vk_aspect_bits_from_vkfmt(VkFormat vkf)
Get aspect bits which include all planes from a VkFormat.
StdVideoAV1Level ff_vk_av1_level_to_vk(int level)
int ff_vk_video_dpb_init(FFVulkanContext *s, FFVkVideoCommon *common, VkFormat format, VkImageUsageFlags usage, VkImageTiling tiling, void *create_pnext, int width, int height, int nb_layers)
Initialize the internal DPB image pool.