25 #define MAX_SLICES 1024
27 DXVA_PictureParameters
pp;
39 DXVA_PictureParameters *pp)
44 memset(pp, 0,
sizeof(*pp));
46 pp->wDeblockedPictureIndex = 0;
50 pp->wForwardRefPictureIndex = 0xffff;
54 pp->wBackwardRefPictureIndex = 0xffff;
55 pp->wPicWidthInMBminus1 = s->
mb_width - 1;
56 pp->wPicHeightInMBminus1 = (s->
mb_height >> is_field) - 1;
57 pp->bMacroblockWidthMinus1 = 15;
58 pp->bMacroblockHeightMinus1 = 15;
59 pp->bBlockWidthMinus1 = 7;
60 pp->bBlockHeightMinus1 = 7;
66 pp->bBidirectionalAveragingMode = 0;
67 pp->bMVprecisionAndChromaRelation= 0;
69 pp->bPicScanFixed = 1;
71 pp->bPicReadbackRequests = 0;
73 pp->bPicSpatialResid8 = 0;
74 pp->bPicOverflowBlocks = 0;
75 pp->bPicExtrapolation = 0;
76 pp->bPicDeblocked = 0;
77 pp->bPicDeblockConfined = 0;
78 pp->bPic4MVallowed = 0;
82 pp->bReservedBits = 0;
83 pp->wBitstreamFcodes = (s->
mpeg_f_code[0][0] << 12) |
98 pp->bBitstreamConcealmentNeed = 0;
99 pp->bBitstreamConcealmentMethod = 0;
105 DXVA_QmatrixData *qm)
108 for (i = 0; i < 4; i++)
109 qm->bNewQmatrix[i] = 1;
110 for (i = 0; i < 64; i++) {
121 DXVA_SliceInfo *slice,
128 memset(slice, 0,
sizeof(*slice));
129 slice->wHorizontalPosition = s->
mb_x;
130 slice->wVerticalPosition = s->
mb_y >> is_field;
131 slice->dwSliceBitsInBuffer = 8 *
size;
132 slice->dwSliceDataLocation = position;
133 slice->bStartCodeBitOffset = 0;
134 slice->bReservedBits = 0;
137 slice->wBadSliceChopping = 0;
141 slice->wQuantizerScaleCode =
get_bits(&gb, 5);
147 DXVA2_DecodeBufferDesc *bs,
148 DXVA2_DecodeBufferDesc *sc)
161 DXVA2_BitStreamDateBufferType,
162 (
void **)&dxva_data, &dxva_size)))
165 end = dxva_data + dxva_size;
169 unsigned position = slice->dwSliceDataLocation;
170 unsigned size = slice->dwSliceBitsInBuffer / 8;
171 if (size > end - current) {
175 slice->dwSliceDataLocation = current - dxva_data;
178 slice->wNumberMBsInSlice =
179 slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice;
181 slice->wNumberMBsInSlice =
182 mb_count - slice[0].wNumberMBsInSlice;
184 memcpy(current, &ctx_pic->
bitstream[position], size);
188 DXVA2_BitStreamDateBufferType)))
193 memset(bs, 0,
sizeof(*bs));
194 bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
195 bs->DataSize = current - dxva_data;
196 bs->NumMBsInBuffer = mb_count;
199 DXVA2_SliceControlBufferType,
258 &ctx_pic->
pp,
sizeof(ctx_pic->
pp),
259 &ctx_pic->
qm,
sizeof(ctx_pic->
qm),
267 .
name =
"mpeg2_dxva2",