FFmpeg
Data Structures | Macros | Functions | Variables
proresenc_kostya_vulkan.c File Reference
#include "libavutil/buffer.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/vulkan_spirv.h"
#include "libavutil/hwcontext_vulkan.h"
#include "libavutil/vulkan_loader.h"
#include "libavutil/vulkan.h"
#include "avcodec.h"
#include "codec.h"
#include "codec_internal.h"
#include "encode.h"
#include "packet.h"
#include "put_bits.h"
#include "profiles.h"
#include "bytestream.h"
#include "proresdata.h"
#include "proresenc_kostya_common.h"
#include "hwconfig.h"

Go to the source code of this file.

Data Structures

struct  ProresDataTables
 
struct  SliceDataInfo
 
struct  EncodeSliceInfo
 
struct  SliceData
 
struct  SliceScore
 
struct  VulkanEncodeProresFrameData
 
struct  ProresVulkanContext
 

Macros

#define DCTSIZE   8
 
#define OFFSET(x)   offsetof(ProresVulkanContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int init_slice_data_pipeline (ProresVulkanContext *pv, FFVulkanShader *shd, int blocks_per_mb)
 
static int init_alpha_data_pipeline (ProresVulkanContext *pv, FFVulkanShader *shd)
 
static int init_estimate_slice_pipeline (ProresVulkanContext *pv, FFVulkanShader *shd)
 
static int init_trellis_node_pipeline (ProresVulkanContext *pv, FFVulkanShader *shd)
 
static int init_encode_slice_pipeline (ProresVulkanContext *pv, FFVulkanShader *shd)
 
static int vulkan_encode_prores_submit_frame (AVCodecContext *avctx, FFVkExecContext *exec, AVFrame *frame, int picture_idx)
 
static uint8_t * write_frame_header (AVCodecContext *avctx, ProresContext *ctx, uint8_t **orig_buf, int flags, enum AVColorPrimaries color_primaries, enum AVColorTransferCharacteristic color_trc, enum AVColorSpace colorspace)
 
static int get_packet (AVCodecContext *avctx, FFVkExecContext *exec, AVPacket *pkt)
 
static int vulkan_encode_prores_receive_packet (AVCodecContext *avctx, AVPacket *pkt)
 
static av_cold int encode_close (AVCodecContext *avctx)
 
static av_cold int encode_init (AVCodecContext *avctx)
 

Variables

const unsigned char ff_prores_ks_alpha_data_comp_spv_data []
 
const unsigned int ff_prores_ks_alpha_data_comp_spv_len
 
const unsigned char ff_prores_ks_slice_data_comp_spv_data []
 
const unsigned int ff_prores_ks_slice_data_comp_spv_len
 
const unsigned char ff_prores_ks_estimate_slice_comp_spv_data []
 
const unsigned int ff_prores_ks_estimate_slice_comp_spv_len
 
const unsigned char ff_prores_ks_trellis_node_comp_spv_data []
 
const unsigned int ff_prores_ks_trellis_node_comp_spv_len
 
const unsigned char ff_prores_ks_encode_slice_comp_spv_data []
 
const unsigned int ff_prores_ks_encode_slice_comp_spv_len
 
static const AVOption options []
 
static const AVClass proresenc_class
 
static const AVCodecHWConfigInternal *const prores_ks_hw_configs []
 
const FFCodec ff_prores_ks_vulkan_encoder
 

Macro Definition Documentation

◆ DCTSIZE

#define DCTSIZE   8

Definition at line 46 of file proresenc_kostya_vulkan.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(ProresVulkanContext, x)

Definition at line 935 of file proresenc_kostya_vulkan.c.

◆ VE

Definition at line 936 of file proresenc_kostya_vulkan.c.

Function Documentation

◆ init_slice_data_pipeline()

static int init_slice_data_pipeline ( ProresVulkanContext pv,
FFVulkanShader shd,
int  blocks_per_mb 
)
static

Definition at line 144 of file proresenc_kostya_vulkan.c.

Referenced by encode_init().

◆ init_alpha_data_pipeline()

static int init_alpha_data_pipeline ( ProresVulkanContext pv,
FFVulkanShader shd 
)
static

Definition at line 187 of file proresenc_kostya_vulkan.c.

Referenced by encode_init().

◆ init_estimate_slice_pipeline()

static int init_estimate_slice_pipeline ( ProresVulkanContext pv,
FFVulkanShader shd 
)
static

Definition at line 226 of file proresenc_kostya_vulkan.c.

Referenced by encode_init().

◆ init_trellis_node_pipeline()

static int init_trellis_node_pipeline ( ProresVulkanContext pv,
FFVulkanShader shd 
)
static

Definition at line 275 of file proresenc_kostya_vulkan.c.

Referenced by encode_init().

◆ init_encode_slice_pipeline()

static int init_encode_slice_pipeline ( ProresVulkanContext pv,
FFVulkanShader shd 
)
static

Definition at line 320 of file proresenc_kostya_vulkan.c.

Referenced by encode_init().

◆ vulkan_encode_prores_submit_frame()

static int vulkan_encode_prores_submit_frame ( AVCodecContext avctx,
FFVkExecContext exec,
AVFrame frame,
int  picture_idx 
)
static

Definition at line 368 of file proresenc_kostya_vulkan.c.

Referenced by vulkan_encode_prores_receive_packet().

◆ write_frame_header()

static uint8_t* write_frame_header ( AVCodecContext avctx,
ProresContext ctx,
uint8_t **  orig_buf,
int  flags,
enum AVColorPrimaries  color_primaries,
enum AVColorTransferCharacteristic  color_trc,
enum AVColorSpace  colorspace 
)
static

Definition at line 589 of file proresenc_kostya_vulkan.c.

Referenced by get_packet().

◆ get_packet()

static int get_packet ( AVCodecContext avctx,
FFVkExecContext exec,
AVPacket pkt 
)
static

Definition at line 633 of file proresenc_kostya_vulkan.c.

Referenced by vulkan_encode_prores_receive_packet().

◆ vulkan_encode_prores_receive_packet()

static int vulkan_encode_prores_receive_packet ( AVCodecContext avctx,
AVPacket pkt 
)
static

Definition at line 762 of file proresenc_kostya_vulkan.c.

◆ encode_close()

static av_cold int encode_close ( AVCodecContext avctx)
static

Definition at line 825 of file proresenc_kostya_vulkan.c.

◆ encode_init()

static av_cold int encode_init ( AVCodecContext avctx)
static

Definition at line 855 of file proresenc_kostya_vulkan.c.

Variable Documentation

◆ ff_prores_ks_alpha_data_comp_spv_data

const unsigned char ff_prores_ks_alpha_data_comp_spv_data[]

◆ ff_prores_ks_alpha_data_comp_spv_len

const unsigned int ff_prores_ks_alpha_data_comp_spv_len

◆ ff_prores_ks_slice_data_comp_spv_data

const unsigned char ff_prores_ks_slice_data_comp_spv_data[]

◆ ff_prores_ks_slice_data_comp_spv_len

const unsigned int ff_prores_ks_slice_data_comp_spv_len

◆ ff_prores_ks_estimate_slice_comp_spv_data

const unsigned char ff_prores_ks_estimate_slice_comp_spv_data[]

◆ ff_prores_ks_estimate_slice_comp_spv_len

const unsigned int ff_prores_ks_estimate_slice_comp_spv_len

◆ ff_prores_ks_trellis_node_comp_spv_data

const unsigned char ff_prores_ks_trellis_node_comp_spv_data[]

◆ ff_prores_ks_trellis_node_comp_spv_len

const unsigned int ff_prores_ks_trellis_node_comp_spv_len

◆ ff_prores_ks_encode_slice_comp_spv_data

const unsigned char ff_prores_ks_encode_slice_comp_spv_data[]

◆ ff_prores_ks_encode_slice_comp_spv_len

const unsigned int ff_prores_ks_encode_slice_comp_spv_len

◆ options

const AVOption options[]
static

Definition at line 938 of file proresenc_kostya_vulkan.c.

◆ proresenc_class

const AVClass proresenc_class
static
Initial value:
= {
.class_name = "ProRes vulkan encoder",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 983 of file proresenc_kostya_vulkan.c.

◆ prores_ks_hw_configs

const AVCodecHWConfigInternal* const prores_ks_hw_configs[]
static
Initial value:
= {
HW_CONFIG_ENCODER_FRAMES(VULKAN, VULKAN),
}

Definition at line 990 of file proresenc_kostya_vulkan.c.

◆ ff_prores_ks_vulkan_encoder

const FFCodec ff_prores_ks_vulkan_encoder
CODEC_PIXFMTS
#define CODEC_PIXFMTS(...)
Definition: codec_internal.h:392
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
ff_prores_profiles
const AVProfile ff_prores_profiles[]
Definition: profiles.c:175
options
static const AVOption options[]
Definition: proresenc_kostya_vulkan.c:938
AV_CODEC_CAP_HARDWARE
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: codec.h:130
FF_CODEC_CAP_EOF_FLUSH
#define FF_CODEC_CAP_EOF_FLUSH
The encoder has AV_CODEC_CAP_DELAY set, but does not actually have delay - it only wants to be flushe...
Definition: codec_internal.h:89
encode_init
static av_cold int encode_init(AVCodecContext *avctx)
Definition: proresenc_kostya_vulkan.c:855
NONE
#define NONE
Definition: vf_drawvg.c:261
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:379
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:197
AV_CODEC_CAP_ENCODER_FLUSH
#define AV_CODEC_CAP_ENCODER_FLUSH
This encoder can be flushed using avcodec_flush_buffers().
Definition: codec.h:151
ProresVulkanContext
Definition: proresenc_kostya_vulkan.c:98
proresenc_class
static const AVClass proresenc_class
Definition: proresenc_kostya_vulkan.c:983
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:144
vulkan_encode_prores_receive_packet
static int vulkan_encode_prores_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
Definition: proresenc_kostya_vulkan.c:762
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:332
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
FF_CODEC_RECEIVE_PACKET_CB
#define FF_CODEC_RECEIVE_PACKET_CB(func)
Definition: codec_internal.h:367
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:242
encode_close
static av_cold int encode_close(AVCodecContext *avctx)
Definition: proresenc_kostya_vulkan.c:825
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:550
HW_CONFIG_ENCODER_DEVICE
#define HW_CONFIG_ENCODER_DEVICE(format, device_type_)
Definition: hwconfig.h:95
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
HW_CONFIG_ENCODER_FRAMES
#define HW_CONFIG_ENCODER_FRAMES(format, device_type_)
Definition: hwconfig.h:98
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:760
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
prores_ks_hw_configs
static const AVCodecHWConfigInternal *const prores_ks_hw_configs[]
Definition: proresenc_kostya_vulkan.c:990
AV_CODEC_ID_PRORES
@ AV_CODEC_ID_PRORES
Definition: codec_id.h:200