FFmpeg
Loading...
Searching...
No Matches
vulkan_av1.c File Reference
#include "av1dec.h"
#include "vulkan_decode.h"

Go to the source code of this file.

Data Structures

struct  AV1VulkanDecodePicture
 

Macros

#define MAX_TILES   256
 

Functions

static int vk_av1_fill_pict (AVCodecContext *avctx, const AV1Frame **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, VkVideoPictureResourceInfoKHR *ref, StdVideoDecodeAV1ReferenceInfo *vkav1_std_ref, VkVideoDecodeAV1DpbSlotInfoKHR *vkav1_ref, const AV1Frame *pic, int is_current, int has_grain, const uint8_t *saved_order_hints)
 
static void vk_av1_params_fill (AVCodecContext *avctx, StdVideoAV1TimingInfo *av1_timing_info, StdVideoAV1ColorConfig *av1_color_config, StdVideoAV1SequenceHeader *av1_sequence_header)
 
static int vk_av1_create_params (AVCodecContext *avctx, VkVideoSessionParametersKHR **buf, AV1VulkanDecodePicture *ap)
 
static int vk_av1_start_frame (AVCodecContext *avctx, av_unused const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
 
static int vk_av1_decode_slice (AVCodecContext *avctx, const uint8_t *data, uint32_t size)
 
static int vk_av1_end_frame (AVCodecContext *avctx)
 
static void vk_av1_free_frame_priv (AVRefStructOpaque _hwctx, void *data)
 

Variables

const FFVulkanDecodeDescriptor ff_vk_dec_av1_desc
 
const FFHWAccel ff_av1_vulkan_hwaccel
 

Macro Definition Documentation

◆ MAX_TILES

#define MAX_TILES   256

Definition at line 24 of file vulkan_av1.c.

Function Documentation

◆ vk_av1_fill_pict()

static int vk_av1_fill_pict ( AVCodecContext * avctx,
const AV1Frame ** ref_src,
VkVideoReferenceSlotInfoKHR * ref_slot,
VkVideoPictureResourceInfoKHR * ref,
StdVideoDecodeAV1ReferenceInfo * vkav1_std_ref,
VkVideoDecodeAV1DpbSlotInfoKHR * vkav1_ref,
const AV1Frame * pic,
int is_current,
int has_grain,
const uint8_t * saved_order_hints )
static

Definition at line 74 of file vulkan_av1.c.

Referenced by vk_av1_start_frame().

◆ vk_av1_params_fill()

static void vk_av1_params_fill ( AVCodecContext * avctx,
StdVideoAV1TimingInfo * av1_timing_info,
StdVideoAV1ColorConfig * av1_color_config,
StdVideoAV1SequenceHeader * av1_sequence_header )
static

Definition at line 142 of file vulkan_av1.c.

Referenced by vk_av1_create_params(), and vk_av1_end_frame().

◆ vk_av1_create_params()

static int vk_av1_create_params ( AVCodecContext * avctx,
VkVideoSessionParametersKHR ** buf,
AV1VulkanDecodePicture * ap )
static

Definition at line 211 of file vulkan_av1.c.

Referenced by vk_av1_end_frame().

◆ vk_av1_start_frame()

static int vk_av1_start_frame ( AVCodecContext * avctx,
av_unused const AVBufferRef * buffer_ref,
av_unused const uint8_t * buffer,
av_unused uint32_t size )
static

Definition at line 247 of file vulkan_av1.c.

◆ vk_av1_decode_slice()

static int vk_av1_decode_slice ( AVCodecContext * avctx,
const uint8_t * data,
uint32_t size )
static

Definition at line 564 of file vulkan_av1.c.

◆ vk_av1_end_frame()

static int vk_av1_end_frame ( AVCodecContext * avctx)
static

Definition at line 592 of file vulkan_av1.c.

◆ vk_av1_free_frame_priv()

static void vk_av1_free_frame_priv ( AVRefStructOpaque _hwctx,
void * data )
static

Definition at line 645 of file vulkan_av1.c.

Variable Documentation

◆ ff_vk_dec_av1_desc

const FFVulkanDecodeDescriptor ff_vk_dec_av1_desc
Initial value:
= {
.codec_id = AV_CODEC_ID_AV1,
.decode_extension = FF_VK_EXT_VIDEO_DECODE_AV1,
.queue_flags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
.decode_op = VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR,
.ext_props = {
.extensionName = VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME,
.specVersion = VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION,
},
}
@ AV_CODEC_ID_AV1
Definition codec_id.h:275
#define FF_VK_EXT_VIDEO_DECODE_AV1

Definition at line 26 of file vulkan_av1.c.

◆ ff_av1_vulkan_hwaccel

const FFHWAccel ff_av1_vulkan_hwaccel
Initial value:
= {
.p.name = "av1_vulkan",
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AV1,
.p.pix_fmt = AV_PIX_FMT_VULKAN,
.start_frame = &vk_av1_start_frame,
.decode_slice = &vk_av1_decode_slice,
.end_frame = &vk_av1_end_frame,
.free_frame_priv = &vk_av1_free_frame_priv,
.frame_priv_data_size = sizeof(AV1VulkanDecodePicture),
.update_thread_context = &ff_vk_update_thread_context,
.decode_params = &ff_vk_params_invalidate,
.frame_params = &ff_vk_frame_params,
.priv_data_size = sizeof(FFVulkanDecodeContext),
.caps_internal = HWACCEL_CAP_ASYNC_SAFE,
}
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition pixfmt.h:379
static int vk_av1_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)
Definition vulkan_av1.c:564
static int vk_av1_end_frame(AVCodecContext *avctx)
Definition vulkan_av1.c:592
static void vk_av1_free_frame_priv(AVRefStructOpaque _hwctx, void *data)
Definition vulkan_av1.c:645
static int vk_av1_start_frame(AVCodecContext *avctx, av_unused const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition vulkan_av1.c:247
int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Synchronize the contexts between 2 threads.
int ff_vk_decode_init(AVCodecContext *avctx)
Initialize decoder.
int ff_vk_params_invalidate(AVCodecContext *avctx, int t, const uint8_t *b, uint32_t s)
Removes current session parameters to recreate them.
int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Initialize hw_frames_ctx with the parameters needed to decode the stream using the parameters from av...
int ff_vk_decode_uninit(AVCodecContext *avctx)
Free decoder.

Definition at line 654 of file vulkan_av1.c.