FFmpeg
Data Structures | Macros | Functions | Variables
vulkan_ffv1.c File Reference
#include "vulkan_decode.h"
#include "hwaccel_internal.h"
#include "ffv1.h"
#include "ffv1_vulkan.h"
#include "libavutil/vulkan_spirv.h"
#include "libavutil/mem.h"

Go to the source code of this file.

Data Structures

struct  FFv1VulkanDecodePicture
 
struct  FFv1VulkanDecodeContext
 
struct  FFv1VkParameters
 

Macros

#define HOST_MAP
 

Functions

static void add_push_data (FFVulkanShader *shd)
 
static int vk_ffv1_start_frame (AVCodecContext *avctx, const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
 
static int vk_ffv1_decode_slice (AVCodecContext *avctx, const uint8_t *data, uint32_t size)
 
static int vk_ffv1_end_frame (AVCodecContext *avctx)
 
static void define_shared_code (FFVulkanShader *shd, int use32bit)
 
static int init_setup_shader (FFV1Context *f, FFVulkanContext *s, FFVkExecPool *pool, FFVkSPIRVCompiler *spv, FFVulkanShader *shd)
 
static int init_reset_shader (FFV1Context *f, FFVulkanContext *s, FFVkExecPool *pool, FFVkSPIRVCompiler *spv, FFVulkanShader *shd, int ac)
 
static int init_decode_shader (FFV1Context *f, FFVulkanContext *s, FFVkExecPool *pool, FFVkSPIRVCompiler *spv, FFVulkanShader *shd, AVHWFramesContext *frames_ctx, int use32bit, int ac, int rgb)
 
static int init_rct_shader (FFV1Context *f, FFVulkanContext *s, FFVkExecPool *pool, FFVkSPIRVCompiler *spv, FFVulkanShader *shd, int use32bit, AVHWFramesContext *src_ctx, AVHWFramesContext *dst_ctx)
 
static int init_indirect (AVCodecContext *avctx, FFVulkanContext *s, AVBufferRef **dst, enum AVPixelFormat sw_format)
 
static void vk_decode_ffv1_uninit (FFVulkanDecodeShared *ctx)
 
static int vk_decode_ffv1_init (AVCodecContext *avctx)
 
static void vk_ffv1_free_frame_priv (AVRefStructOpaque _hwctx, void *data)
 

Variables

const char * ff_source_common_comp
 
const char * ff_source_rangecoder_comp
 
const char * ff_source_ffv1_vlc_comp
 
const char * ff_source_ffv1_common_comp
 
const char * ff_source_ffv1_dec_setup_comp
 
const char * ff_source_ffv1_reset_comp
 
const char * ff_source_ffv1_dec_comp
 
const char * ff_source_ffv1_dec_rct_comp
 
const FFVulkanDecodeDescriptor ff_vk_dec_ffv1_desc
 
const FFHWAccel ff_ffv1_vulkan_hwaccel
 

Macro Definition Documentation

◆ HOST_MAP

#define HOST_MAP

Definition at line 44 of file vulkan_ffv1.c.

Function Documentation

◆ add_push_data()

static void add_push_data ( FFVulkanShader shd)
static

Definition at line 112 of file vulkan_ffv1.c.

Referenced by init_decode_shader(), and init_setup_shader().

◆ vk_ffv1_start_frame()

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

Definition at line 146 of file vulkan_ffv1.c.

◆ vk_ffv1_decode_slice()

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

Definition at line 266 of file vulkan_ffv1.c.

◆ vk_ffv1_end_frame()

static int vk_ffv1_end_frame ( AVCodecContext avctx)
static

Definition at line 303 of file vulkan_ffv1.c.

◆ define_shared_code()

static void define_shared_code ( FFVulkanShader shd,
int  use32bit 
)
static

◆ init_setup_shader()

static int init_setup_shader ( FFV1Context f,
FFVulkanContext s,
FFVkExecPool pool,
FFVkSPIRVCompiler spv,
FFVulkanShader shd 
)
static

Definition at line 666 of file vulkan_ffv1.c.

Referenced by vk_decode_ffv1_init().

◆ init_reset_shader()

static int init_reset_shader ( FFV1Context f,
FFVulkanContext s,
FFVkExecPool pool,
FFVkSPIRVCompiler spv,
FFVulkanShader shd,
int  ac 
)
static

Definition at line 764 of file vulkan_ffv1.c.

Referenced by vk_decode_ffv1_init().

◆ init_decode_shader()

static int init_decode_shader ( FFV1Context f,
FFVulkanContext s,
FFVkExecPool pool,
FFVkSPIRVCompiler spv,
FFVulkanShader shd,
AVHWFramesContext frames_ctx,
int  use32bit,
int  ac,
int  rgb 
)
static

Definition at line 856 of file vulkan_ffv1.c.

Referenced by vk_decode_ffv1_init().

◆ init_rct_shader()

static int init_rct_shader ( FFV1Context f,
FFVulkanContext s,
FFVkExecPool pool,
FFVkSPIRVCompiler spv,
FFVulkanShader shd,
int  use32bit,
AVHWFramesContext src_ctx,
AVHWFramesContext dst_ctx 
)
static

Definition at line 949 of file vulkan_ffv1.c.

Referenced by vk_decode_ffv1_init().

◆ init_indirect()

static int init_indirect ( AVCodecContext avctx,
FFVulkanContext s,
AVBufferRef **  dst,
enum AVPixelFormat  sw_format 
)
static

Definition at line 1058 of file vulkan_ffv1.c.

Referenced by vk_decode_ffv1_init().

◆ vk_decode_ffv1_uninit()

static void vk_decode_ffv1_uninit ( FFVulkanDecodeShared ctx)
static

Definition at line 1091 of file vulkan_ffv1.c.

Referenced by vk_decode_ffv1_init().

◆ vk_decode_ffv1_init()

static int vk_decode_ffv1_init ( AVCodecContext avctx)
static

Definition at line 1121 of file vulkan_ffv1.c.

◆ vk_ffv1_free_frame_priv()

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

Definition at line 1272 of file vulkan_ffv1.c.

Variable Documentation

◆ ff_source_common_comp

const char* ff_source_common_comp

◆ ff_source_rangecoder_comp

const char* ff_source_rangecoder_comp

Referenced by define_shared_code().

◆ ff_source_ffv1_vlc_comp

const char* ff_source_ffv1_vlc_comp

◆ ff_source_ffv1_common_comp

const char* ff_source_ffv1_common_comp

Referenced by define_shared_code().

◆ ff_source_ffv1_dec_setup_comp

const char* ff_source_ffv1_dec_setup_comp

Referenced by init_setup_shader().

◆ ff_source_ffv1_reset_comp

const char* ff_source_ffv1_reset_comp

Referenced by init_reset_shader().

◆ ff_source_ffv1_dec_comp

const char* ff_source_ffv1_dec_comp

Referenced by init_decode_shader().

◆ ff_source_ffv1_dec_rct_comp

const char* ff_source_ffv1_dec_rct_comp

Referenced by init_rct_shader().

◆ ff_vk_dec_ffv1_desc

const FFVulkanDecodeDescriptor ff_vk_dec_ffv1_desc
Initial value:
= {
.codec_id = AV_CODEC_ID_FFV1,
.decode_extension = FF_VK_EXT_PUSH_DESCRIPTOR,
.queue_flags = VK_QUEUE_COMPUTE_BIT,
}

Definition at line 38 of file vulkan_ffv1.c.

◆ ff_ffv1_vulkan_hwaccel

const FFHWAccel ff_ffv1_vulkan_hwaccel
Initial value:
= {
.p.name = "ffv1_vulkan",
.p.type = AVMEDIA_TYPE_VIDEO,
.p.pix_fmt = AV_PIX_FMT_VULKAN,
.start_frame = &vk_ffv1_start_frame,
.decode_slice = &vk_ffv1_decode_slice,
.end_frame = &vk_ffv1_end_frame,
.free_frame_priv = &vk_ffv1_free_frame_priv,
.frame_priv_data_size = sizeof(FFv1VulkanDecodePicture),
.decode_params = &ff_vk_params_invalidate,
.frame_params = &ff_vk_frame_params,
.priv_data_size = sizeof(FFVulkanDecodeContext),
}

Definition at line 1299 of file vulkan_ffv1.c.

FFVulkanDecodeContext
Definition: vulkan_decode.h:65
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:379
HWACCEL_CAP_THREAD_SAFE
#define HWACCEL_CAP_THREAD_SAFE
Definition: hwaccel_internal.h:32
vk_ffv1_decode_slice
static int vk_ffv1_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)
Definition: vulkan_ffv1.c:266
FFv1VulkanDecodePicture
Definition: vulkan_ffv1.c:46
HWACCEL_CAP_ASYNC_SAFE
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
Definition: hwaccel_internal.h:31
vk_ffv1_end_frame
static int vk_ffv1_end_frame(AVCodecContext *avctx)
Definition: vulkan_ffv1.c:303
ff_vk_decode_uninit
int ff_vk_decode_uninit(AVCodecContext *avctx)
Free decoder.
Definition: vulkan_decode.c:1129
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:1012
AV_CODEC_ID_FFV1
@ AV_CODEC_ID_FFV1
Definition: codec_id.h:85
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
vk_ffv1_free_frame_priv
static void vk_ffv1_free_frame_priv(AVRefStructOpaque _hwctx, void *data)
Definition: vulkan_ffv1.c:1272
FF_VK_EXT_PUSH_DESCRIPTOR
#define FF_VK_EXT_PUSH_DESCRIPTOR
Definition: vulkan_functions.h:47
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
ff_vk_decode_flush
void ff_vk_decode_flush(AVCodecContext *avctx)
Flush decoder.
Definition: vulkan_decode.c:329
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_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:112
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:91
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
vk_ffv1_start_frame
static int vk_ffv1_start_frame(AVCodecContext *avctx, const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vulkan_ffv1.c:146
vk_decode_ffv1_init
static int vk_decode_ffv1_init(AVCodecContext *avctx)
Definition: vulkan_ffv1.c:1121