FFmpeg
Data Structures | Macros | Functions | Variables
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, VkVideoDecodeAV1DpbSlotInfoMESA *vkav1_ref, const AV1Frame *pic, int is_current, int has_grain, int dpb_slot_index)
 
static int vk_av1_create_params (AVCodecContext *avctx, AVBufferRef **buf)
 
static int vk_av1_start_frame (AVCodecContext *avctx, 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 (FFRefStructOpaque _hwctx, void *data)
 

Variables

const VkExtensionProperties ff_vk_dec_av1_ext
 
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,
VkVideoDecodeAV1DpbSlotInfoMESA vkav1_ref,
const AV1Frame pic,
int  is_current,
int  has_grain,
int  dpb_slot_index 
)
static

Definition at line 55 of file vulkan_av1.c.

Referenced by vk_av1_start_frame().

◆ vk_av1_create_params()

static int vk_av1_create_params ( AVCodecContext avctx,
AVBufferRef **  buf 
)
static

Definition at line 105 of file vulkan_av1.c.

Referenced by vk_av1_end_frame(), and vk_av1_start_frame().

◆ vk_av1_start_frame()

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

Definition at line 195 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 473 of file vulkan_av1.c.

◆ vk_av1_end_frame()

static int vk_av1_end_frame ( AVCodecContext avctx)
static

Definition at line 506 of file vulkan_av1.c.

◆ vk_av1_free_frame_priv()

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

Definition at line 539 of file vulkan_av1.c.

Variable Documentation

◆ ff_vk_dec_av1_ext

const VkExtensionProperties ff_vk_dec_av1_ext
Initial value:

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),
.decode_params = &ff_vk_params_invalidate,
.frame_params = &ff_vk_frame_params,
.priv_data_size = sizeof(FFVulkanDecodeContext),
.caps_internal = HWACCEL_CAP_ASYNC_SAFE,
}

Definition at line 552 of file vulkan_av1.c.

vk_av1_start_frame
static int vk_av1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vulkan_av1.c:195
FFVulkanDecodeContext
Definition: vulkan_decode.h:56
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:376
vk_av1_end_frame
static int vk_av1_end_frame(AVCodecContext *avctx)
Definition: vulkan_av1.c:506
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
HWACCEL_CAP_ASYNC_SAFE
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
Definition: hwaccel_internal.h:31
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:283
ff_vk_decode_uninit
int ff_vk_decode_uninit(AVCodecContext *avctx)
Free decoder.
Definition: vulkan_decode.c:1090
ff_vk_frame_params
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...
Definition: vulkan_decode.c:1004
update_thread_context
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have update_thread_context() run it in the next thread. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. If there are inter-frame dependencies
ff_vk_decode_flush
void ff_vk_decode_flush(AVCodecContext *avctx)
Flush decoder.
Definition: vulkan_decode.c:301
ff_vk_params_invalidate
int ff_vk_params_invalidate(AVCodecContext *avctx, int t, const uint8_t *b, uint32_t s)
Removes current session parameters to recreate them.
Definition: vulkan_decode.c:109
VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION
Definition: vulkan_video_codec_av1std_mesa.h:33
ff_vk_update_thread_context
int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Synchronize the contexts between 2 threads.
Definition: vulkan_decode.c:68
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:367
ff_vk_decode_init
int ff_vk_decode_init(AVCodecContext *avctx)
Initialize decoder.
Definition: vulkan_decode.c:1105
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:285
AV1VulkanDecodePicture
Definition: vulkan_av1.c:31
VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME
Definition: vulkan_video_codec_av1std_mesa.h:34
vk_av1_decode_slice
static int vk_av1_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)
Definition: vulkan_av1.c:473
vk_av1_free_frame_priv
static void vk_av1_free_frame_priv(FFRefStructOpaque _hwctx, void *data)
Definition: vulkan_av1.c:539