Go to the documentation of this file.
23 #include "config_components.h"
38 #define D3D12_AV1_DECODE_CONTEXT(avctx) ((D3D12AV1DecodeContext *)D3D12VA_DECODE_CONTEXT(avctx))
41 DXVA_PicParams_AV1
pp;
78 uint32_t tg_start, tg_end;
85 if (ctx_pic->
tile_count ==
h->tg_end -
h->tg_start + 1) {
93 tg_start =
h->tg_start;
99 for (uint32_t tile_num = tg_start; tile_num <= tg_end; tile_num++) {
100 ctx_pic->
tiles[tile_num].DataOffset =
offset +
h->tile_group_info[tile_num].tile_offset;
101 ctx_pic->
tiles[tile_num].DataSize =
h->tile_group_info[tile_num].tile_size;
102 ctx_pic->
tiles[tile_num].row =
h->tile_group_info[tile_num].tile_row;
103 ctx_pic->
tiles[tile_num].column =
h->tile_group_info[tile_num].tile_column;
104 ctx_pic->
tiles[tile_num].anchor_frame = 0xFF;
116 D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args->FrameArguments[input_args->NumFrameArguments++];
117 args->Type = D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL;
118 args->Size =
sizeof(DXVA_Tile_AV1) * ctx_pic->
tile_count;
119 args->pData = ctx_pic->
tiles;
121 input_args->CompressedBitstream = (D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM){
127 if (FAILED(ID3D12Resource_Map(
buffer, 0,
NULL, &mapped_data))) {
158 DXVA_PicParams_AV1 pp;
165 ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0;
186 if (
ctx->bitstream_buffer)
192 #if CONFIG_AV1_D3D12VA_HWACCEL
194 .
p.
name =
"av1_d3d12va",
static int d3d12va_av1_end_frame(AVCodecContext *avctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
const struct FFHWAccel ff_av1_d3d12va_hwaccel
AVHWAccel p
The public AVHWAccel.
DXVA_Tile_AV1 tiles[MAX_TILES]
int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
uninit D3D12VADecodeContext
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_d3d12va_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
d3d12va common frame params
static int d3d12va_av1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
int ff_d3d12va_common_end_frame(AVCodecContext *avctx, AVFrame *frame, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int(*update_input_arguments)(AVCodecContext *, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *, ID3D12Resource *))
d3d12va common end frame
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
#define D3D12VA_DECODE_CONTEXT(avctx)
static int d3d12va_av1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
int ff_d3d12va_get_suitable_max_bitstream_size(AVCodecContext *avctx)
Get a suitable maximum bitstream size.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
const char * name
Name of the hardware accelerated codec.
#define D3D12_AV1_DECODE_CONTEXT(avctx)
main external API structure.
uint8_t * bitstream_buffer
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
static int d3d12va_av1_decode_init(AVCodecContext *avctx)
int ff_dxva2_av1_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_AV1 *pp)
This structure is used to provide the necessary configurations and data to the FFmpeg Direct3D 12 HWA...
static int d3d12va_av1_decode_uninit(AVCodecContext *avctx)
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
#define AV_PROFILE_AV1_MAIN
int ff_d3d12va_decode_init(AVCodecContext *avctx)
init D3D12VADecodeContext