28 DXVA_PictureParameters
pp;
37 DXVA_PictureParameters *pp)
51 memset(pp, 0,
sizeof(*pp));
52 pp->wDecodedPictureIndex =
57 pp->wForwardRefPictureIndex = 0xffff;
61 pp->wBackwardRefPictureIndex = 0xffff;
64 pp->wPicWidthInMBminus1 = avctx->
width - 1;
65 pp->wPicHeightInMBminus1= avctx->
height - 1;
68 pp->wPicWidthInMBminus1 = s->
mb_width - 1;
69 pp->wPicHeightInMBminus1= s->
mb_height - 1;
71 pp->bMacroblockWidthMinus1 = 15;
72 pp->bMacroblockHeightMinus1 = 15;
73 pp->bBlockWidthMinus1 = 7;
74 pp->bBlockHeightMinus1 = 7;
77 pp->bPicStructure |= 0x01;
79 pp->bPicStructure |= 0x02;
83 pp->bBidirectionalAveragingMode = (1 << 7) |
84 ((ctx->
cfg->ConfigIntraResidUnsigned != 0) << 6) |
85 ((ctx->
cfg->ConfigResidDiffAccelerator != 0) << 5) |
97 pp->bPicScanMethod = ctx->
report_id & 0xff;
98 pp->bPicReadbackRequests = 0;
99 pp->bRcontrol = v->
rnd;
113 pp->bPicDeblocked = ((!pp->bPicBackwardPrediction && v->
overlap) << 6) |
135 pp->bReservedBits = v->
pq;
139 pp->wBitstreamPCEelements = v->
lumshift;
141 pp->wBitstreamFcodes = 32;
142 pp->wBitstreamPCEelements = 0;
150 pp->wBitstreamFcodes = (32 << 8) | 32;
151 pp->wBitstreamPCEelements = 0;
154 pp->bBitstreamConcealmentNeed = 0;
155 pp->bBitstreamConcealmentMethod = 0;
159 unsigned position,
unsigned size)
164 memset(slice, 0,
sizeof(*slice));
165 slice->wHorizontalPosition = 0;
166 slice->wVerticalPosition = s->
mb_y;
167 slice->dwSliceBitsInBuffer = 8 *
size;
168 slice->dwSliceDataLocation = position;
169 slice->bStartCodeBitOffset = 0;
173 slice->wQuantizerScaleCode = v->
pq;
174 slice->wBadSliceChopping = 0;
178 DXVA2_DecodeBufferDesc *bs,
179 DXVA2_DecodeBufferDesc *sc)
186 DXVA_SliceInfo *
slice = &ctx_pic->
si;
190 const unsigned slice_size = slice->dwSliceBitsInBuffer / 8;
191 const unsigned padding = 128 - ((start_code_size + slice_size) & 127);
192 const unsigned data_size = start_code_size + slice_size + padding;
199 DXVA2_BitStreamDateBufferType,
200 (
void **)&dxva_data, &dxva_size)))
203 result = data_size <= dxva_size ? 0 : -1;
205 if (start_code_size > 0) {
206 memcpy(dxva_data, start_code, start_code_size);
210 memcpy(dxva_data + start_code_size,
211 ctx_pic->
bitstream + slice->dwSliceDataLocation, slice_size);
213 memset(dxva_data + start_code_size + slice_size, 0, padding);
214 slice->dwSliceBitsInBuffer = 8 *
data_size;
217 DXVA2_BitStreamDateBufferType)))
222 memset(bs, 0,
sizeof(*bs));
223 bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
226 assert((bs->DataSize & 127) == 0);
229 DXVA2_SliceControlBufferType,
230 slice,
sizeof(*slice), bs->NumMBsInBuffer);
286 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
294 #if CONFIG_WMV3_DXVA2_HWACCEL
296 .
name =
"wmv3_dxva2",