23 #include <X11/extensions/XvMC.h>
68 cbp <<= 12-mb_block_count;
69 for (i = 0; i < mb_block_count; i++) {
99 "Render token doesn't look as expected.\n");
105 "Rendering surface contains %i unprocessed blocks.\n",
116 "Rendering surface doesn't provide enough block structures to work with.\n");
172 XvMCMacroBlock *mv_block;
174 int i, cbp, blocks_per_mb;
209 mv_block->x = s->
mb_x;
210 mv_block->y = s->
mb_y;
213 mv_block->macroblock_type = XVMC_MB_TYPE_INTRA;
215 mv_block->macroblock_type = XVMC_MB_TYPE_PATTERN;
218 mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_FORWARD;
220 mv_block->PMV[0][0][0] = s->
mv[0][0][0];
221 mv_block->PMV[0][0][1] = s->
mv[0][0][1];
222 mv_block->PMV[1][0][0] = s->
mv[0][1][0];
223 mv_block->PMV[1][0][1] = s->
mv[0][1][1];
226 mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_BACKWARD;
227 mv_block->PMV[0][1][0] = s->
mv[1][0][0];
228 mv_block->PMV[0][1][1] = s->
mv[1][0][1];
229 mv_block->PMV[1][1][0] = s->
mv[1][1][0];
230 mv_block->PMV[1][1][1] = s->
mv[1][1][1];
235 mv_block->motion_type = XVMC_PREDICTION_FRAME;
238 mv_block->motion_type = XVMC_PREDICTION_16x8;
241 mv_block->motion_type = XVMC_PREDICTION_FIELD;
243 mv_block->PMV[0][0][1] <<= 1;
244 mv_block->PMV[1][0][1] <<= 1;
245 mv_block->PMV[0][1][1] <<= 1;
246 mv_block->PMV[1][1][1] <<= 1;
250 mv_block->motion_type = XVMC_PREDICTION_DUAL_PRIME;
253 mv_block->PMV[0][0][0] = s->
mv[0][0][0];
254 mv_block->PMV[0][0][1] = s->
mv[0][0][1] << 1;
256 mv_block->PMV[0][1][0] = s->
mv[0][0][0];
257 mv_block->PMV[0][1][1] = s->
mv[0][0][1] << 1;
259 mv_block->PMV[1][0][0] = s->
mv[0][2][0];
260 mv_block->PMV[1][0][1] = s->
mv[0][2][1] << 1;
262 mv_block->PMV[1][1][0] = s->
mv[0][3][0];
263 mv_block->PMV[1][1][1] = s->
mv[0][3][1] << 1;
266 mv_block->PMV[0][1][0] = s->
mv[0][2][0];
267 mv_block->PMV[0][1][1] = s->
mv[0][2][1];
274 mv_block->motion_vertical_field_select = 0;
278 mv_block->motion_vertical_field_select |= s->
field_select[0][0];
279 mv_block->motion_vertical_field_select |= s->
field_select[1][0] << 1;
280 mv_block->motion_vertical_field_select |= s->
field_select[0][1] << 2;
281 mv_block->motion_vertical_field_select |= s->
field_select[1][1] << 3;
294 for (i = 0; i < blocks_per_mb; i++) {
302 for (i = 4; i < blocks_per_mb; i++) {
308 cbp &= 0xf << (blocks_per_mb - 4);
312 mv_block->coded_block_pattern = cbp;
314 mv_block->macroblock_type &= ~XVMC_MB_TYPE_PATTERN;
316 for (i = 0; i < blocks_per_mb; i++) {
349 #if CONFIG_MPEG1_XVMC_HWACCEL
351 .
name =
"mpeg1_xvmc",
357 .decode_slice = NULL,
363 #if CONFIG_MPEG2_XVMC_HWACCEL
365 .
name =
"mpeg2_xvmc",
371 .decode_slice = NULL,