29 DXVA_PictureParameters
pp;
38 DXVA_PictureParameters *pp)
43 memset(pp, 0,
sizeof(*pp));
44 pp->wDecodedPictureIndex =
49 pp->wForwardRefPictureIndex = 0xffff;
53 pp->wBackwardRefPictureIndex = 0xffff;
56 pp->wPicWidthInMBminus1 = avctx->
width - 1;
57 pp->wPicHeightInMBminus1= avctx->
height - 1;
60 pp->wPicWidthInMBminus1 = s->
mb_width - 1;
61 pp->wPicHeightInMBminus1= s->
mb_height - 1;
63 pp->bMacroblockWidthMinus1 = 15;
64 pp->bMacroblockHeightMinus1 = 15;
65 pp->bBlockWidthMinus1 = 7;
66 pp->bBlockHeightMinus1 = 7;
69 pp->bPicStructure |= 0x01;
71 pp->bPicStructure |= 0x02;
75 pp->bBidirectionalAveragingMode = (1 << 7) |
76 ((ctx->
cfg->ConfigIntraResidUnsigned != 0) << 6) |
77 ((ctx->
cfg->ConfigResidDiffAccelerator != 0) << 5) |
89 pp->bPicScanMethod = ctx->
report_id & 0xff;
90 pp->bPicReadbackRequests = 0;
91 pp->bRcontrol = v->
rnd;
105 pp->bPicDeblocked = ((!pp->bPicBackwardPrediction && v->
overlap) << 6) |
127 pp->bReservedBits = 0;
130 pp->wBitstreamPCEelements = v->
lumshift;
136 pp->bBitstreamConcealmentNeed = 0;
137 pp->bBitstreamConcealmentMethod = 0;
141 unsigned position,
unsigned size)
146 memset(slice, 0,
sizeof(*slice));
147 slice->wHorizontalPosition = 0;
148 slice->wVerticalPosition = s->
mb_y;
149 slice->dwSliceBitsInBuffer = 8 *
size;
150 slice->dwSliceDataLocation = position;
151 slice->bStartCodeBitOffset = 0;
152 slice->bReservedBits = 0;
155 slice->wQuantizerScaleCode = v->
pq;
156 slice->wBadSliceChopping = 0;
160 DXVA2_DecodeBufferDesc *bs,
161 DXVA2_DecodeBufferDesc *sc)
168 DXVA_SliceInfo *
slice = &ctx_pic->
si;
170 static const uint8_t start_code[] = { 0, 0, 1, 0x0d };
172 const unsigned slice_size = slice->dwSliceBitsInBuffer / 8;
173 const unsigned padding = 128 - ((start_code_size + slice_size) & 127);
174 const unsigned data_size = start_code_size + slice_size + padding;
180 if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->
decoder,
181 DXVA2_BitStreamDateBufferType,
182 &dxva_data, &dxva_size)))
185 result = data_size <= dxva_size ? 0 : -1;
187 if (start_code_size > 0)
188 memcpy(dxva_data, start_code, start_code_size);
189 memcpy(dxva_data + start_code_size,
190 ctx_pic->
bitstream + slice->dwSliceDataLocation, slice_size);
192 memset(dxva_data + start_code_size + slice_size, 0, padding);
193 slice->dwSliceBitsInBuffer = 8 * data_size;
195 if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->
decoder,
196 DXVA2_BitStreamDateBufferType)))
201 memset(bs, 0,
sizeof(*bs));
202 bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
203 bs->DataSize = data_size;
205 assert((bs->DataSize & 127) == 0);
208 DXVA2_SliceControlBufferType,
209 slice,
sizeof(*slice), bs->NumMBsInBuffer);
265 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
273 #if CONFIG_WMV3_DXVA2_HWACCEL
275 .
name =
"wmv3_dxva2",
in the bitstream is reported as 00b
int extended_mv
Ext MV in P/B (not in Simple)
int broadcast
TFF/RFF present.
uint8_t rangeredfrm
Frame decoding info for S/M profiles only.
int fastuvmc
Rounding of qpel vector to hpel ? (not in Simple)
unsigned surface_count
The number of surface in the surface array.
int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int(*commit_bs_si)(AVCodecContext *, DXVA2_DecodeBufferDesc *bs, DXVA2_DecodeBufferDesc *slice))
DXVA_SliceInfo slice[MAX_SLICES]
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
int panscanflag
NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present.
int interlace
Progressive/interlaced (RPTFTM syntax element)
int profile
Sequence header data for all Profiles TODO: choose between ints, uint8_ts and monobit flags...
#define PICT_BOTTOM_FIELD
static int get_bits_count(const GetBitContext *s)
int refdist_flag
REFDIST syntax element present in II, IP, PI or PP field picture headers.
int mb_height
number of MBs horizontally & vertically
static int dxva2_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
int psf
Progressive Segmented Frame.
unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx, const AVFrame *frame)
int overlap
overlapped transforms in use
in the bitstream is reported as 11b
#define IS_MARKER(state, i, buf, buf_size)
int quarter_sample
1->qpel, 0->half pel ME/MC
int resync_marker
could this stream contain resync markers
int postprocflag
Per-frame processing suggestion flag present.
int tfcntrflag
TFCNTR present.
int width
picture width / height.
uint8_t mv_mode
Frame decoding info for all profiles.
Picture * current_picture_ptr
pointer to the current picture
void * hwaccel_picture_private
hardware accelerator private data
int ff_dxva2_commit_buffer(AVCodecContext *avctx, struct dxva_context *ctx, DXVA2_DecodeBufferDesc *dsc, unsigned type, const void *data, unsigned size, unsigned mb_count)
uint8_t lumscale
Luma compensation parameters.
const DXVA2_ConfigPictureDecode * cfg
DXVA2 configuration used to create the decoder.
const char * name
Name of the hardware accelerated codec.
static void fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice, unsigned position, unsigned size)
unsigned report_id
Private to the Libav AVHWAccel implementation.
int first_field
is 1 for the first field of a field picture 0 otherwise
int rangered
RANGEREDFRM (range reduction) syntax element present at frame level.
int finterpflag
INTERPFRM present.
int chromaformat
2bits, 2=4:2:0, only defined
void * hwaccel_context
Hardware accelerator context.
static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, DXVA2_DecodeBufferDesc *bs, DXVA2_DecodeBufferDesc *sc)
int multires
frame-level RESPIC syntax element present
main external API structure.
int extended_dmv
Additional extended dmv range at P/B frame-level.
int quantizer_mode
2bits, quantizer mode used for sequence, see QUANT_*
int max_b_frames
max number of b-frames for encoding
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int vstransform
variable-size [48]x[48] transform type + info
static int dxva2_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
const uint8_t * bitstream
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
Picture last_picture
copy of the previous picture structure.
static int dxva2_vc1_end_frame(AVCodecContext *avctx)
Picture next_picture
copy of the next picture structure.
AVHWAccel ff_vc1_dxva2_hwaccel
int dquant
How qscale varies with MBs, 2bits (not in Simple)
uint8_t mv_mode2
Secondary MV coding mode (B frames)
static void fill_picture_parameters(AVCodecContext *avctx, struct dxva_context *ctx, const VC1Context *v, DXVA_PictureParameters *pp)
IDirectXVideoDecoder * decoder
DXVA2 decoder object.
This structure is used to provides the necessary configurations and data to the DXVA2 Libav HWAccel i...
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...