FFmpeg
Data Structures | Macros | Functions | Variables
vulkan_video.c File Reference
#include "libavutil/mem.h"
#include "vulkan_video.h"

Go to the source code of this file.

Data Structures

struct  FFVkFormatMapEntry
 

Macros

#define ASPECT_2PLANE   (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT)
 
#define ASPECT_3PLANE   (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT)
 

Functions

enum AVPixelFormat ff_vk_pix_fmt_from_vkfmt (VkFormat vkf)
 Get pixfmt from a Vulkan format. More...
 
VkImageAspectFlags ff_vk_aspect_bits_from_vkfmt (VkFormat vkf)
 Get aspect bits which include all planes from a VkFormat. More...
 
VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc (const AVPixFmtDescriptor *desc)
 Get Vulkan's chroma subsampling from a pixfmt descriptor. More...
 
VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth (int depth)
 Get Vulkan's bit depth from an [8:12] integer. More...
 
int ff_vk_h264_level_to_av (StdVideoH264LevelIdc level)
 Convert level from Vulkan to AV. More...
 
int ff_vk_h265_level_to_av (StdVideoH265LevelIdc level)
 
static void free_data_buf (void *opaque, uint8_t *data)
 
static AVBufferRefalloc_data_buf (void *opaque, size_t size)
 
int ff_vk_video_get_buffer (FFVulkanContext *ctx, FFVkVideoCommon *s, AVBufferRef **buf, VkBufferUsageFlags usage, void *create_pNext, size_t size)
 Get a mapped FFVkPooledBuffer with a specific guaranteed minimum size from a pool. More...
 
av_cold void ff_vk_video_common_uninit (FFVulkanContext *s, FFVkVideoCommon *common)
 Free video session and required resources. More...
 
av_cold int ff_vk_video_common_init (void *log, FFVulkanContext *s, FFVkVideoCommon *common, VkVideoSessionCreateInfoKHR *session_create)
 Initialize video session, allocating and binding necessary memory. More...
 

Variables

static const struct FFVkFormatMapEntry vk_format_map []
 
static const int nb_vk_format_map = FF_ARRAY_ELEMS(vk_format_map)
 

Macro Definition Documentation

◆ ASPECT_2PLANE

#define ASPECT_2PLANE   (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT)

Definition at line 22 of file vulkan_video.c.

◆ ASPECT_3PLANE

#define ASPECT_3PLANE   (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT)

Definition at line 23 of file vulkan_video.c.

Function Documentation

◆ ff_vk_pix_fmt_from_vkfmt()

enum AVPixelFormat ff_vk_pix_fmt_from_vkfmt ( VkFormat  vkf)

Get pixfmt from a Vulkan format.

Definition at line 95 of file vulkan_video.c.

Referenced by vulkan_decode_get_profile().

◆ ff_vk_aspect_bits_from_vkfmt()

VkImageAspectFlags ff_vk_aspect_bits_from_vkfmt ( VkFormat  vkf)

Get aspect bits which include all planes from a VkFormat.

Definition at line 103 of file vulkan_video.c.

Referenced by vk_decode_create_view().

◆ ff_vk_subsampling_from_av_desc()

VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc ( const AVPixFmtDescriptor desc)

Get Vulkan's chroma subsampling from a pixfmt descriptor.

Definition at line 111 of file vulkan_video.c.

Referenced by vulkan_setup_profile().

◆ ff_vk_depth_from_av_depth()

VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth ( int  depth)

Get Vulkan's bit depth from an [8:12] integer.

Definition at line 124 of file vulkan_video.c.

Referenced by vulkan_setup_profile().

◆ ff_vk_h264_level_to_av()

int ff_vk_h264_level_to_av ( StdVideoH264LevelIdc  level)

Convert level from Vulkan to AV.

Definition at line 135 of file vulkan_video.c.

Referenced by vulkan_decode_get_profile().

◆ ff_vk_h265_level_to_av()

int ff_vk_h265_level_to_av ( StdVideoH265LevelIdc  level)

Definition at line 161 of file vulkan_video.c.

Referenced by vulkan_decode_get_profile().

◆ free_data_buf()

static void free_data_buf ( void *  opaque,
uint8_t *  data 
)
static

Definition at line 180 of file vulkan_video.c.

Referenced by alloc_data_buf().

◆ alloc_data_buf()

static AVBufferRef* alloc_data_buf ( void *  opaque,
size_t  size 
)
static

Definition at line 189 of file vulkan_video.c.

Referenced by ff_vk_video_get_buffer().

◆ ff_vk_video_get_buffer()

int ff_vk_video_get_buffer ( FFVulkanContext ctx,
FFVkVideoCommon *  s,
AVBufferRef **  buf,
VkBufferUsageFlags  usage,
void *  create_pNext,
size_t  size 
)

Get a mapped FFVkPooledBuffer with a specific guaranteed minimum size from a pool.

Definition at line 202 of file vulkan_video.c.

Referenced by ff_vk_decode_add_slice().

◆ ff_vk_video_common_uninit()

av_cold void ff_vk_video_common_uninit ( FFVulkanContext s,
FFVkVideoCommon *  common 
)

Free video session and required resources.

Definition at line 260 of file vulkan_video.c.

Referenced by ff_vk_video_common_init(), and free_common().

◆ ff_vk_video_common_init()

av_cold int ff_vk_video_common_init ( void *  log,
FFVulkanContext s,
FFVkVideoCommon *  common,
VkVideoSessionCreateInfoKHR *  session_create 
)

Initialize video session, allocating and binding necessary memory.

Definition at line 280 of file vulkan_video.c.

Referenced by ff_vk_decode_init().

Variable Documentation

◆ vk_format_map

const struct FFVkFormatMapEntry vk_format_map[]
static

◆ nb_vk_format_map

const int nb_vk_format_map = FF_ARRAY_ELEMS(vk_format_map)
static

Definition at line 93 of file vulkan_video.c.

Referenced by ff_vk_aspect_bits_from_vkfmt(), and ff_vk_pix_fmt_from_vkfmt().