29 DXVA_PictureParameters
pp;
38 DXVA_PictureParameters *pp)
52 memset(pp, 0,
sizeof(*pp));
53 pp->wDecodedPictureIndex =
58 pp->wForwardRefPictureIndex = 0xffff;
62 pp->wBackwardRefPictureIndex = 0xffff;
65 pp->wPicWidthInMBminus1 = avctx->
width - 1;
66 pp->wPicHeightInMBminus1= avctx->
height - 1;
69 pp->wPicWidthInMBminus1 = s->
mb_width - 1;
70 pp->wPicHeightInMBminus1= s->
mb_height - 1;
72 pp->bMacroblockWidthMinus1 = 15;
73 pp->bMacroblockHeightMinus1 = 15;
74 pp->bBlockWidthMinus1 = 7;
75 pp->bBlockHeightMinus1 = 7;
78 pp->bPicStructure |= 0x01;
80 pp->bPicStructure |= 0x02;
84 pp->bBidirectionalAveragingMode = (1 << 7) |
85 ((ctx->
cfg->ConfigIntraResidUnsigned != 0) << 6) |
86 ((ctx->
cfg->ConfigResidDiffAccelerator != 0) << 5) |
98 pp->bPicScanMethod = ctx->
report_id & 0xff;
99 pp->bPicReadbackRequests = 0;
100 pp->bRcontrol = v->
rnd;
114 pp->bPicDeblocked = ((!pp->bPicBackwardPrediction && v->
overlap) << 6) |
136 pp->bReservedBits = v->
pq;
140 pp->wBitstreamPCEelements = v->
lumshift;
142 pp->wBitstreamFcodes = 32;
143 pp->wBitstreamPCEelements = 0;
151 pp->wBitstreamFcodes = (32 << 8) | 32;
152 pp->wBitstreamPCEelements = 0;
155 pp->bBitstreamConcealmentNeed = 0;
156 pp->bBitstreamConcealmentMethod = 0;
160 unsigned position,
unsigned size)
165 memset(slice, 0,
sizeof(*slice));
166 slice->wHorizontalPosition = 0;
167 slice->wVerticalPosition = s->
mb_y;
168 slice->dwSliceBitsInBuffer = 8 *
size;
169 slice->dwSliceDataLocation = position;
170 slice->bStartCodeBitOffset = 0;
174 slice->wQuantizerScaleCode = v->
pq;
175 slice->wBadSliceChopping = 0;
179 DXVA2_DecodeBufferDesc *bs,
180 DXVA2_DecodeBufferDesc *sc)
187 DXVA_SliceInfo *
slice = &ctx_pic->
si;
191 const unsigned slice_size = slice->dwSliceBitsInBuffer / 8;
192 const unsigned padding = 128 - ((start_code_size + slice_size) & 127);
193 const unsigned data_size = start_code_size + slice_size + padding;
201 DXVA2_BitStreamDateBufferType,
202 &dxva_data_ptr, &dxva_size)))
205 dxva_data = dxva_data_ptr;
206 result = data_size <= dxva_size ? 0 : -1;
208 if (start_code_size > 0) {
209 memcpy(dxva_data, start_code, start_code_size);
213 memcpy(dxva_data + start_code_size,
214 ctx_pic->
bitstream + slice->dwSliceDataLocation, slice_size);
216 memset(dxva_data + start_code_size + slice_size, 0, padding);
217 slice->dwSliceBitsInBuffer = 8 * data_size;
220 DXVA2_BitStreamDateBufferType)))
225 memset(bs, 0,
sizeof(*bs));
226 bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
227 bs->DataSize = data_size;
229 assert((bs->DataSize & 127) == 0);
232 DXVA2_SliceControlBufferType,
233 slice,
sizeof(*slice), bs->NumMBsInBuffer);
289 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
297 #if CONFIG_WMV3_DXVA2_HWACCEL
299 .
name =
"wmv3_dxva2",