FFmpeg
Data Structures | Functions | Variables
vulkan_vp9.c File Reference
#include "vp9shared.h"
#include "vulkan_decode.h"

Go to the source code of this file.

Data Structures

struct  VP9VulkanDecodePicture
 

Functions

static int vk_vp9_fill_pict (AVCodecContext *avctx, const VP9Frame **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, VkVideoPictureResourceInfoKHR *ref, const VP9Frame *pic, int is_current)
 
static enum StdVideoVP9InterpolationFilter remap_interp (uint8_t is_filter_switchable, uint8_t raw_interpolation_filter_type)
 
static int vk_vp9_start_frame (AVCodecContext *avctx, av_unused const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
 
static int vk_vp9_decode_slice (AVCodecContext *avctx, const uint8_t *data, uint32_t size)
 
static int vk_vp9_end_frame (AVCodecContext *avctx)
 
static void vk_vp9_free_frame_priv (AVRefStructOpaque _hwctx, void *data)
 

Variables

const FFVulkanDecodeDescriptor ff_vk_dec_vp9_desc
 
const FFHWAccel ff_vp9_vulkan_hwaccel
 

Function Documentation

◆ vk_vp9_fill_pict()

static int vk_vp9_fill_pict ( AVCodecContext avctx,
const VP9Frame **  ref_src,
VkVideoReferenceSlotInfoKHR *  ref_slot,
VkVideoPictureResourceInfoKHR *  ref,
const VP9Frame pic,
int  is_current 
)
static

Definition at line 55 of file vulkan_vp9.c.

Referenced by vk_vp9_start_frame().

◆ remap_interp()

static enum StdVideoVP9InterpolationFilter remap_interp ( uint8_t  is_filter_switchable,
uint8_t  raw_interpolation_filter_type 
)
static

Definition at line 91 of file vulkan_vp9.c.

Referenced by vk_vp9_start_frame().

◆ vk_vp9_start_frame()

static int vk_vp9_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 105 of file vulkan_vp9.c.

◆ vk_vp9_decode_slice()

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

Definition at line 304 of file vulkan_vp9.c.

◆ vk_vp9_end_frame()

static int vk_vp9_end_frame ( AVCodecContext avctx)
static

Definition at line 320 of file vulkan_vp9.c.

◆ vk_vp9_free_frame_priv()

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

Definition at line 344 of file vulkan_vp9.c.

Variable Documentation

◆ ff_vk_dec_vp9_desc

const FFVulkanDecodeDescriptor ff_vk_dec_vp9_desc
Initial value:
= {
.codec_id = AV_CODEC_ID_VP9,
.decode_extension = FF_VK_EXT_VIDEO_DECODE_VP9,
.queue_flags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
.decode_op = VK_VIDEO_CODEC_OPERATION_DECODE_VP9_BIT_KHR,
.ext_props = {
.extensionName = VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_EXTENSION_NAME,
.specVersion = VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_SPEC_VERSION,
},
}

Definition at line 23 of file vulkan_vp9.c.

◆ ff_vp9_vulkan_hwaccel

const FFHWAccel ff_vp9_vulkan_hwaccel
Initial value:
= {
.p.name = "vp9_vulkan",
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_VP9,
.p.pix_fmt = AV_PIX_FMT_VULKAN,
.start_frame = &vk_vp9_start_frame,
.decode_slice = &vk_vp9_decode_slice,
.end_frame = &vk_vp9_end_frame,
.free_frame_priv = &vk_vp9_free_frame_priv,
.frame_priv_data_size = sizeof(VP9VulkanDecodePicture),
.frame_params = &ff_vk_frame_params,
.priv_data_size = sizeof(FFVulkanDecodeContext),
.caps_internal = HWACCEL_CAP_ASYNC_SAFE,
}

Definition at line 353 of file vulkan_vp9.c.

FFVulkanDecodeContext
Definition: vulkan_decode.h:56
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:379
vk_vp9_free_frame_priv
static void vk_vp9_free_frame_priv(AVRefStructOpaque _hwctx, void *data)
Definition: vulkan_vp9.c:344
VP9VulkanDecodePicture
Definition: vulkan_vp9.c:34
AV_CODEC_ID_VP9
@ AV_CODEC_ID_VP9
Definition: codec_id.h:222
vk_vp9_end_frame
static int vk_vp9_end_frame(AVCodecContext *avctx)
Definition: vulkan_vp9.c:320
HWACCEL_CAP_ASYNC_SAFE
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
Definition: hwaccel_internal.h:31
FF_VK_EXT_VIDEO_DECODE_VP9
#define FF_VK_EXT_VIDEO_DECODE_VP9
Definition: vulkan_functions.h:62
ff_vk_decode_uninit
int ff_vk_decode_uninit(AVCodecContext *avctx)
Free decoder.
Definition: vulkan_decode.c:1191
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:370
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:1075
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
vk_vp9_decode_slice
static int vk_vp9_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)
Definition: vulkan_vp9.c:304
ff_vk_decode_flush
void ff_vk_decode_flush(AVCodecContext *avctx)
Flush decoder.
Definition: vulkan_decode.c:361
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. Use ff_thread_get_buffer()(or ff_progress_frame_get_buffer() in case you have inter-frame dependencies and use the ProgressFrame API) to allocate frame buffers. Call ff_progress_frame_report() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
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:120
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
ff_vk_decode_init
int ff_vk_decode_init(AVCodecContext *avctx)
Initialize decoder.
Definition: vulkan_decode.c:1243
vk_vp9_start_frame
static int vk_vp9_start_frame(AVCodecContext *avctx, av_unused const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vulkan_vp9.c:105