FFmpeg
Loading...
Searching...
No Matches
vulkan_video.h File Reference
#include "avcodec.h"
#include "libavutil/vulkan.h"
#include <vk_video/vulkan_video_codecs_common.h>

Go to the source code of this file.

Data Structures

struct  FFVkVideoCommon
 

Macros

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

Functions

enum AVPixelFormat ff_vk_pix_fmt_from_vkfmt (VkFormat vkf)
 Get pixfmt from a Vulkan format.
 
VkImageAspectFlags ff_vk_aspect_bits_from_vkfmt (VkFormat vkf)
 Get aspect bits which include all planes from a VkFormat.
 
VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc (const AVPixFmtDescriptor *desc)
 Get Vulkan's chroma subsampling from a pixfmt descriptor.
 
VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth (int depth)
 Get Vulkan's bit depth from an [8:12] integer.
 
int ff_vk_h264_level_to_av (StdVideoH264LevelIdc level)
 Convert level from Vulkan to AV.
 
int ff_vk_h265_level_to_av (StdVideoH265LevelIdc level)
 
StdVideoH264LevelIdc ff_vk_h264_level_to_vk (int level_idc)
 
StdVideoH265LevelIdc ff_vk_h265_level_to_vk (int level_idc)
 
StdVideoAV1Level ff_vk_av1_level_to_vk (int level)
 
StdVideoH264ProfileIdc ff_vk_h264_profile_to_vk (int profile)
 Convert profile from/to AV to Vulkan.
 
StdVideoH265ProfileIdc ff_vk_h265_profile_to_vk (int profile)
 
StdVideoAV1Profile ff_vk_av1_profile_to_vk (int profile)
 
int ff_vk_create_view (FFVulkanContext *s, FFVkVideoCommon *common, VkImageView *view, VkImageAspectFlags *aspect, AVVkFrame *src, VkFormat vkf, VkImageUsageFlags flags)
 Creates image views for video frames.
 
int ff_vk_video_common_init (AVCodecContext *avctx, FFVulkanContext *s, FFVkVideoCommon *common, VkVideoSessionCreateInfoKHR *session_create)
 Initialize video session, allocating and binding necessary memory.
 
void ff_vk_video_common_uninit (FFVulkanContext *s, FFVkVideoCommon *common)
 Free video session and required resources.
 

Macro Definition Documentation

◆ CODEC_VER_MAJ

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

Definition at line 27 of file vulkan_video.h.

◆ CODEC_VER_MIN

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

Definition at line 28 of file vulkan_video.h.

◆ CODEC_VER_PAT

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

Definition at line 29 of file vulkan_video.h.

◆ CODEC_VER

#define CODEC_VER ( ver)
Value:
#define CODEC_VER_MIN(ver)
#define CODEC_VER_PAT(ver)
#define CODEC_VER_MAJ(ver)

Definition at line 30 of file vulkan_video.h.

Referenced by ff_vulkan_encode_init(), vulkan_decode_get_profile(), and vulkan_encode_h264_init().

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 99 of file vulkan_video.c.

Referenced by ff_vulkan_encode_init(), and 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 107 of file vulkan_video.c.

Referenced by ff_vk_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 115 of file vulkan_video.c.

Referenced by ff_vulkan_encode_init(), and 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 128 of file vulkan_video.c.

Referenced by ff_vulkan_encode_init(), and 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 139 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 191 of file vulkan_video.c.

Referenced by vulkan_decode_get_profile().

◆ ff_vk_h264_level_to_vk()

StdVideoH264LevelIdc ff_vk_h264_level_to_vk ( int level_idc)

Definition at line 165 of file vulkan_video.c.

Referenced by base_unit_to_vk().

◆ ff_vk_h265_level_to_vk()

StdVideoH265LevelIdc ff_vk_h265_level_to_vk ( int level_idc)

Definition at line 210 of file vulkan_video.c.

Referenced by base_unit_to_vk(), set_sps(), and set_vps().

◆ ff_vk_av1_level_to_vk()

StdVideoAV1Level ff_vk_av1_level_to_vk ( int level)

Definition at line 229 of file vulkan_video.c.

◆ ff_vk_h264_profile_to_vk()

StdVideoH264ProfileIdc ff_vk_h264_profile_to_vk ( int profile)

Convert profile from/to AV to Vulkan.

Definition at line 260 of file vulkan_video.c.

Referenced by base_unit_to_vk(), and init_profile().

◆ ff_vk_h265_profile_to_vk()

StdVideoH265ProfileIdc ff_vk_h265_profile_to_vk ( int profile)

Definition at line 272 of file vulkan_video.c.

Referenced by base_unit_to_vk(), init_profile(), and set_vps().

◆ ff_vk_av1_profile_to_vk()

StdVideoAV1Profile ff_vk_av1_profile_to_vk ( int profile)

Definition at line 282 of file vulkan_video.c.

Referenced by init_profile().

◆ ff_vk_create_view()

int ff_vk_create_view ( FFVulkanContext * s,
FFVkVideoCommon * common,
VkImageView * view,
VkImageAspectFlags * aspect,
AVVkFrame * src,
VkFormat vkf,
VkImageUsageFlags flags )

Creates image views for video frames.

Definition at line 292 of file vulkan_video.c.

Referenced by ff_vk_decode_init(), ff_vk_decode_prepare_frame(), vulkan_encode_create_dpb(), and vulkan_encode_init().

◆ ff_vk_video_common_init()

int ff_vk_video_common_init ( AVCodecContext * avctx,
FFVulkanContext * s,
FFVkVideoCommon * common,
VkVideoSessionCreateInfoKHR * session_create )

Initialize video session, allocating and binding necessary memory.

Definition at line 366 of file vulkan_video.c.

Referenced by ff_vk_decode_init(), and ff_vulkan_encode_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 338 of file vulkan_video.c.

Referenced by ff_vk_video_common_init(), ff_vulkan_encode_uninit(), and free_common().