27 #define MAX_SLICES 1024
29 DXVA_PictureParameters
pp;
41 DXVA_PictureParameters *pp)
46 memset(pp, 0,
sizeof(*pp));
48 pp->wDeblockedPictureIndex = 0;
52 pp->wForwardRefPictureIndex = 0xffff;
56 pp->wBackwardRefPictureIndex = 0xffff;
57 pp->wPicWidthInMBminus1 = s->
mb_width - 1;
58 pp->wPicHeightInMBminus1 = (s->
mb_height >> is_field) - 1;
59 pp->bMacroblockWidthMinus1 = 15;
60 pp->bMacroblockHeightMinus1 = 15;
61 pp->bBlockWidthMinus1 = 7;
62 pp->bBlockHeightMinus1 = 7;
68 pp->bBidirectionalAveragingMode = 0;
69 pp->bMVprecisionAndChromaRelation= 0;
71 pp->bPicScanFixed = 1;
73 pp->bPicReadbackRequests = 0;
75 pp->bPicSpatialResid8 = 0;
76 pp->bPicOverflowBlocks = 0;
77 pp->bPicExtrapolation = 0;
78 pp->bPicDeblocked = 0;
79 pp->bPicDeblockConfined = 0;
80 pp->bPic4MVallowed = 0;
84 pp->bReservedBits = 0;
85 pp->wBitstreamFcodes = (s->
mpeg_f_code[0][0] << 12) |
100 pp->bBitstreamConcealmentNeed = 0;
101 pp->bBitstreamConcealmentMethod = 0;
107 DXVA_QmatrixData *qm)
110 for (i = 0; i < 4; i++)
111 qm->bNewQmatrix[i] = 1;
112 for (i = 0; i < 64; i++) {
123 DXVA_SliceInfo *slice,
130 memset(slice, 0,
sizeof(*slice));
131 slice->wHorizontalPosition = s->
mb_x;
132 slice->wVerticalPosition = s->
mb_y >> is_field;
133 slice->dwSliceBitsInBuffer = 8 *
size;
134 slice->dwSliceDataLocation = position;
135 slice->bStartCodeBitOffset = 0;
136 slice->bReservedBits = 0;
139 slice->wBadSliceChopping = 0;
143 slice->wQuantizerScaleCode =
get_bits(&gb, 5);
149 DXVA2_DecodeBufferDesc *bs,
150 DXVA2_DecodeBufferDesc *sc)
164 DXVA2_BitStreamDateBufferType,
165 &dxva_data_ptr, &dxva_size)))
168 dxva_data = dxva_data_ptr;
170 end = dxva_data + dxva_size;
174 unsigned position = slice->dwSliceDataLocation;
175 unsigned size = slice->dwSliceBitsInBuffer / 8;
176 if (size > end - current) {
180 slice->dwSliceDataLocation = current - dxva_data;
183 slice->wNumberMBsInSlice =
184 slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice;
186 slice->wNumberMBsInSlice =
187 mb_count - slice[0].wNumberMBsInSlice;
189 memcpy(current, &ctx_pic->
bitstream[position], size);
193 DXVA2_BitStreamDateBufferType)))
198 memset(bs, 0,
sizeof(*bs));
199 bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
200 bs->DataSize = current - dxva_data;
201 bs->NumMBsInBuffer = mb_count;
204 DXVA2_SliceControlBufferType,
265 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
266 &ctx_pic->
qm,
sizeof(ctx_pic->
qm),
274 .
name =
"mpeg2_dxva2",