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

Go to the source code of this file.

Data Structures

struct  FFVkCodecMap
 
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...
 

Variables

const FFVkCodecMap ff_vk_codec_map [AV_CODEC_ID_FIRST_AUDIO]
 Index is codec_id. More...
 

Macro Definition Documentation

◆ CODEC_VER_MAJ

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

Definition at line 29 of file vulkan_video.h.

◆ CODEC_VER_MIN

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

Definition at line 30 of file vulkan_video.h.

◆ CODEC_VER_PAT

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

Definition at line 31 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 32 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 117 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 125 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 133 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 146 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 157 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 183 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 224 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 302 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 282 of file vulkan_video.c.

Referenced by ff_vk_video_common_init(), and free_common().

Variable Documentation

◆ ff_vk_codec_map

const FFVkCodecMap ff_vk_codec_map[AV_CODEC_ID_FIRST_AUDIO]

Index is codec_id.

Definition at line 23 of file vulkan_video.c.

Referenced by ff_vk_decode_init(), and vulkan_decode_get_profile().