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)
163 DXVA2_BitStreamDateBufferType,
164 (
void **)&dxva_data, &dxva_size)))
167 end = dxva_data + dxva_size;
171 unsigned position = slice->dwSliceDataLocation;
172 unsigned size = slice->dwSliceBitsInBuffer / 8;
173 if (size > end - current) {
177 slice->dwSliceDataLocation = current - dxva_data;
180 slice->wNumberMBsInSlice =
181 slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice;
183 slice->wNumberMBsInSlice =
184 mb_count - slice[0].wNumberMBsInSlice;
186 memcpy(current, &ctx_pic->
bitstream[position], size);
190 DXVA2_BitStreamDateBufferType)))
195 memset(bs, 0,
sizeof(*bs));
196 bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
197 bs->DataSize = current - dxva_data;
198 bs->NumMBsInBuffer = mb_count;
201 DXVA2_SliceControlBufferType,
262 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
263 &ctx_pic->
qm,
sizeof(ctx_pic->
qm),
271 .
name =
"mpeg2_dxva2",