FFmpeg
Loading...
Searching...
No Matches
vulkan_ffv1.c File Reference
#include "vulkan_decode.h"
#include "hwaccel_internal.h"
#include "ffv1.h"
#include "ffv1_vulkan.h"
#include "libavutil/mem.h"

Go to the source code of this file.

Data Structures

struct  FFv1VulkanDecodePicture
 
struct  FFv1VulkanDecodeContext
 

Macros

#define RGB_LINECACHE   2
 

Functions

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 int init_setup_shader (FFV1Context *f, FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd, VkSpecializationInfo *sl)
 
static int init_reset_shader (FFV1Context *f, FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd, VkSpecializationInfo *sl, int ac)
 
static int init_decode_shader (FFV1Context *f, FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd, AVHWFramesContext *dec_frames_ctx, AVHWFramesContext *out_frames_ctx, VkSpecializationInfo *sl, int ac, int rgb, int bayer)
 
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 unsigned char ff_ffv1_dec_setup_comp_spv_data []
 
const unsigned int ff_ffv1_dec_setup_comp_spv_len
 
const unsigned char ff_ffv1_dec_reset_comp_spv_data []
 
const unsigned int ff_ffv1_dec_reset_comp_spv_len
 
const unsigned char ff_ffv1_dec_reset_golomb_comp_spv_data []
 
const unsigned int ff_ffv1_dec_reset_golomb_comp_spv_len
 
const unsigned char ff_ffv1_dec_comp_spv_data []
 
const unsigned int ff_ffv1_dec_comp_spv_len
 
const unsigned char ff_ffv1_dec_rgb_comp_spv_data []
 
const unsigned int ff_ffv1_dec_rgb_comp_spv_len
 
const unsigned char ff_ffv1_dec_golomb_comp_spv_data []
 
const unsigned int ff_ffv1_dec_golomb_comp_spv_len
 
const unsigned char ff_ffv1_dec_rgb_golomb_comp_spv_data []
 
const unsigned int ff_ffv1_dec_rgb_golomb_comp_spv_len
 
const unsigned char ff_ffv1_dec_rgb_float_comp_spv_data []
 
const unsigned int ff_ffv1_dec_rgb_float_comp_spv_len
 
const unsigned char ff_ffv1_dec_rgb_float_golomb_comp_spv_data []
 
const unsigned int ff_ffv1_dec_rgb_float_golomb_comp_spv_len
 
const unsigned char ff_ffv1_dec_bayer_comp_spv_data []
 
const unsigned int ff_ffv1_dec_bayer_comp_spv_len
 
const unsigned char ff_ffv1_dec_bayer_golomb_comp_spv_data []
 
const unsigned int ff_ffv1_dec_bayer_golomb_comp_spv_len
 
const FFVulkanDecodeDescriptor ff_vk_dec_ffv1_desc
 
const FFHWAccel ff_ffv1_vulkan_hwaccel
 

Macro Definition Documentation

◆ RGB_LINECACHE

#define RGB_LINECACHE   2

Definition at line 28 of file vulkan_ffv1.c.

Function Documentation

◆ 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 101 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 220 of file vulkan_ffv1.c.

◆ vk_ffv1_end_frame()

static int vk_ffv1_end_frame ( AVCodecContext * avctx)
static

Definition at line 255 of file vulkan_ffv1.c.

◆ init_setup_shader()

static int init_setup_shader ( FFV1Context * f,
FFVulkanContext * s,
FFVkExecPool * pool,
FFVulkanShader * shd,
VkSpecializationInfo * sl )
static

Definition at line 583 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,
FFVulkanShader * shd,
VkSpecializationInfo * sl,
int ac )
static

Definition at line 637 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,
FFVulkanShader * shd,
AVHWFramesContext * dec_frames_ctx,
AVHWFramesContext * out_frames_ctx,
VkSpecializationInfo * sl,
int ac,
int rgb,
int bayer )
static

Definition at line 685 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 801 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 837 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 856 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 951 of file vulkan_ffv1.c.

Variable Documentation

◆ ff_ffv1_dec_setup_comp_spv_data

const unsigned char ff_ffv1_dec_setup_comp_spv_data[]
extern

Referenced by init_setup_shader().

◆ ff_ffv1_dec_setup_comp_spv_len

const unsigned int ff_ffv1_dec_setup_comp_spv_len
extern

Referenced by init_setup_shader().

◆ ff_ffv1_dec_reset_comp_spv_data

const unsigned char ff_ffv1_dec_reset_comp_spv_data[]
extern

Referenced by init_reset_shader().

◆ ff_ffv1_dec_reset_comp_spv_len

const unsigned int ff_ffv1_dec_reset_comp_spv_len
extern

Referenced by init_reset_shader().

◆ ff_ffv1_dec_reset_golomb_comp_spv_data

const unsigned char ff_ffv1_dec_reset_golomb_comp_spv_data[]
extern

Referenced by init_reset_shader().

◆ ff_ffv1_dec_reset_golomb_comp_spv_len

const unsigned int ff_ffv1_dec_reset_golomb_comp_spv_len
extern

Referenced by init_reset_shader().

◆ ff_ffv1_dec_comp_spv_data

const unsigned char ff_ffv1_dec_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_comp_spv_len

const unsigned int ff_ffv1_dec_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_comp_spv_data

const unsigned char ff_ffv1_dec_rgb_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_comp_spv_len

const unsigned int ff_ffv1_dec_rgb_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_golomb_comp_spv_data

const unsigned char ff_ffv1_dec_golomb_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_golomb_comp_spv_len

const unsigned int ff_ffv1_dec_golomb_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_golomb_comp_spv_data

const unsigned char ff_ffv1_dec_rgb_golomb_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_golomb_comp_spv_len

const unsigned int ff_ffv1_dec_rgb_golomb_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_float_comp_spv_data

const unsigned char ff_ffv1_dec_rgb_float_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_float_comp_spv_len

const unsigned int ff_ffv1_dec_rgb_float_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_float_golomb_comp_spv_data

const unsigned char ff_ffv1_dec_rgb_float_golomb_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_rgb_float_golomb_comp_spv_len

const unsigned int ff_ffv1_dec_rgb_float_golomb_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_bayer_comp_spv_data

const unsigned char ff_ffv1_dec_bayer_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_bayer_comp_spv_len

const unsigned int ff_ffv1_dec_bayer_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_bayer_golomb_comp_spv_data

const unsigned char ff_ffv1_dec_bayer_golomb_comp_spv_data[]
extern

Referenced by init_decode_shader().

◆ ff_ffv1_dec_bayer_golomb_comp_spv_len

const unsigned int ff_ffv1_dec_bayer_golomb_comp_spv_len
extern

Referenced by init_decode_shader().

◆ ff_vk_dec_ffv1_desc

const FFVulkanDecodeDescriptor ff_vk_dec_ffv1_desc
Initial value:
= {
.codec_id = AV_CODEC_ID_FFV1,
.queue_flags = VK_QUEUE_COMPUTE_BIT,
}
@ AV_CODEC_ID_FFV1
Definition codec_id.h:83

Definition at line 63 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),
.update_thread_context = &ff_vk_update_thread_context,
.frame_params = &ff_vk_frame_params,
.priv_data_size = sizeof(FFVulkanDecodeContext),
}
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.
#define HWACCEL_CAP_THREAD_SAFE
static av_cold void uninit(AVBitStreamFilterContext *ctx)
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition pixfmt.h:379
int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Synchronize the contexts between 2 threads.
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.
static int vk_ffv1_end_frame(AVCodecContext *avctx)
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_decode_ffv1_init(AVCodecContext *avctx)
static void vk_ffv1_free_frame_priv(AVRefStructOpaque _hwctx, void *data)
static int vk_ffv1_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)

Definition at line 1012 of file vulkan_ffv1.c.