Go to the documentation of this file.
23 #include "config_components.h"
33 #define MAX_SLICES 1024
34 #define INVALID_REF 0xffff
37 DXVA_PictureParameters
pp;
97 D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args->FrameArguments[input_args->NumFrameArguments++];
99 const unsigned mb_count =
s->mb_width * (
s->mb_height >> v->
field_mode);
100 uint8_t *mapped_data, *mapped_ptr;
102 static const uint8_t
start_code[] = { 0, 0, 1, 0x0d };
104 if (FAILED(ID3D12Resource_Map(
buffer, 0,
NULL, (
void **)&mapped_data))) {
109 mapped_ptr = mapped_data;
111 DXVA_SliceInfo *slice = &ctx_pic->
slices[
i];
112 unsigned position = slice->dwSliceDataLocation;
113 unsigned size = slice->dwSliceBitsInBuffer / 8;
115 slice->dwSliceDataLocation = mapped_ptr - mapped_data;
116 if (i < ctx_pic->slice_count - 1)
117 slice->wNumberMBsInSlice = slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice;
119 slice->wNumberMBsInSlice = mb_count - slice[0].wNumberMBsInSlice;
124 mapped_ptr[3] = 0x0c;
126 mapped_ptr[3] = 0x0b;
129 slice->dwSliceBitsInBuffer +=
sizeof(
start_code) * 8;
138 args->Type = D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL;
139 args->Size =
sizeof(DXVA_SliceInfo) * ctx_pic->
slice_count;
140 args->pData = ctx_pic->
slices;
142 input_args->CompressedBitstream = (D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM){
145 .Size = mapped_ptr - mapped_data,
160 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
169 ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1_D2010;
171 ctx->max_num_ref = 3;
175 ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1;
182 #if CONFIG_WMV3_D3D12VA_HWACCEL
184 .
p.
name =
"wmv3_d3d12va",
199 #if CONFIG_VC1_D3D12VA_HWACCEL
201 .
p.
name =
"vc1_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 d3d12va_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
AVHWAccel p
The public AVHWAccel.
int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
uninit D3D12VADecodeContext
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PictureParameters *pp)
MPVPicture * ptr
RefStruct reference.
DXVA_SliceInfo slices[MAX_SLICES]
const struct FFHWAccel ff_wmv3_d3d12va_hwaccel
#define av_assert0(cond)
assert() equivalent, that is always enabled.
DXVA_PictureParameters pp
int ff_d3d12va_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
d3d12va common frame params
MPVWorkPicture cur_pic
copy of the current picture structure.
static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
int field_mode
1 for interlaced field pictures
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)
const struct FFHWAccel ff_vc1_d3d12va_hwaccel
void ff_dxva2_vc1_fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice, unsigned position, unsigned size)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
const char * name
Name of the hardware accelerated codec.
void * hwaccel_picture_private
RefStruct reference for hardware accelerator private data.
#define i(width, name, range_min, range_max)
static int d3d12va_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
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
static int d3d12va_vc1_decode_init(AVCodecContext *avctx)
This structure is used to provide the necessary configurations and data to the FFmpeg Direct3D 12 HWA...
static int d3d12va_vc1_end_frame(AVCodecContext *avctx)
const uint8_t * bitstream
int ff_d3d12va_decode_init(AVCodecContext *avctx)
init D3D12VADecodeContext