FFmpeg
Data Structures | Macros | Functions
vulkan_video.h File Reference
#include "vulkan.h"
#include <vk_video/vulkan_video_codecs_common.h>

Go to the source code of this file.

Data Structures

struct  FFVkVideoSession
 
struct  FFVkVideoBuffer
 

Macros

#define CODEC_VER_MAJ(ver)   (ver >> 22)
 
#define CODEC_VER_MIN(ver)   ((ver >> 12) & ((1 << 10) - 1))
 
#define CODEC_VER_PAT(ver)   (ver & ((1 << 12) - 1))
 
#define CODEC_VER(ver)   CODEC_VER_MAJ(ver), CODEC_VER_MIN(ver), CODEC_VER_PAT(ver)
 

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)
 
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...
 
int ff_vk_video_common_init (void *log, FFVulkanContext *s, FFVkVideoCommon *common, VkVideoSessionCreateInfoKHR *session_create)
 Initialize video session, allocating and binding necessary memory. More...
 
void ff_vk_video_common_uninit (FFVulkanContext *s, FFVkVideoCommon *common)
 Free video session and required resources. More...
 

Macro Definition Documentation

◆ CODEC_VER_MAJ

#define CODEC_VER_MAJ (   ver)    (ver >> 22)

Definition at line 26 of file vulkan_video.h.

◆ CODEC_VER_MIN

#define CODEC_VER_MIN (   ver)    ((ver >> 12) & ((1 << 10) - 1))

Definition at line 27 of file vulkan_video.h.

◆ CODEC_VER_PAT

#define CODEC_VER_PAT (   ver)    (ver & ((1 << 12) - 1))

Definition at line 28 of file vulkan_video.h.

◆ CODEC_VER

#define CODEC_VER (   ver)    CODEC_VER_MAJ(ver), CODEC_VER_MIN(ver), CODEC_VER_PAT(ver)

Definition at line 29 of file vulkan_video.h.

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().

◆ 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_init()

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().

◆ ff_vk_video_common_uninit()

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().