Go to the documentation of this file.
23 #include "config_components.h"
34 DXVA_PicParams_VP9
pp;
42 memset(slice, 0,
sizeof(*slice));
43 slice->BSNALunitDataLocation = position;
44 slice->SliceBytesInBuffer =
size;
45 slice->wBadSliceChopping = 0;
92 D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args;
94 if (FAILED(ID3D12Resource_Map(
buffer, 0,
NULL, &mapped_data))) {
99 args = &input_args->FrameArguments[input_args->NumFrameArguments++];
100 args->Type = D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL;
101 args->Size =
sizeof(ctx_pic->
slice);
102 args->pData = &ctx_pic->
slice;
104 memcpy(mapped_data, ctx_pic->
bitstream, ctx_pic->
slice.SliceBytesInBuffer);
108 input_args->CompressedBitstream = (D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM){
111 .Size = ctx_pic->
slice.SliceBytesInBuffer,
132 DXVA_PicParams_VP9 pp;
137 ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2;
143 ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VP9;
152 #if CONFIG_VP9_D3D12VA_HWACCEL
154 .
p.
name =
"vp9_d3d12va",
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
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
AVHWAccel p
The public AVHWAccel.
int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
uninit D3D12VADecodeContext
const uint8_t * bitstream
#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
const struct FFHWAccel ff_vp9_d3d12va_hwaccel
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
static int d3d12va_vp9_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
#define D3D12VA_DECODE_CONTEXT(avctx)
DXVA_Slice_VPx_Short slice
static int d3d12va_vp9_end_frame(AVCodecContext *avctx)
static int d3d12va_vp9_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
static void fill_slice_short(DXVA_Slice_VPx_Short *slice, unsigned position, unsigned size)
const char * name
Name of the hardware accelerated codec.
static int d3d12va_vp9_decode_init(AVCodecContext *avctx)
main external API structure.
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
This structure is used to provide the necessary configurations and data to the FFmpeg Direct3D 12 HWA...
int ff_dxva2_vp9_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_VP9 *pp)
int ff_d3d12va_decode_init(AVCodecContext *avctx)
init D3D12VADecodeContext