23 #include <X11/extensions/XvMC.h>
58 cbp <<= 12-mb_block_count;
59 for (i = 0; i < mb_block_count; i++) {
85 "Render token doesn't look as expected.\n");
91 "Rendering surface contains %i unprocessed blocks.\n",
102 "Rendering surface doesn't provide enough block structures to work with.\n");
156 XvMCMacroBlock *mv_block;
158 int i, cbp, blocks_per_mb;
193 mv_block->x = s->
mb_x;
194 mv_block->y = s->
mb_y;
197 mv_block->macroblock_type = XVMC_MB_TYPE_INTRA;
199 mv_block->macroblock_type = XVMC_MB_TYPE_PATTERN;
202 mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_FORWARD;
204 mv_block->PMV[0][0][0] = s->
mv[0][0][0];
205 mv_block->PMV[0][0][1] = s->
mv[0][0][1];
206 mv_block->PMV[1][0][0] = s->
mv[0][1][0];
207 mv_block->PMV[1][0][1] = s->
mv[0][1][1];
210 mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_BACKWARD;
211 mv_block->PMV[0][1][0] = s->
mv[1][0][0];
212 mv_block->PMV[0][1][1] = s->
mv[1][0][1];
213 mv_block->PMV[1][1][0] = s->
mv[1][1][0];
214 mv_block->PMV[1][1][1] = s->
mv[1][1][1];
219 mv_block->motion_type = XVMC_PREDICTION_FRAME;
222 mv_block->motion_type = XVMC_PREDICTION_16x8;
225 mv_block->motion_type = XVMC_PREDICTION_FIELD;
227 mv_block->PMV[0][0][1] <<= 1;
228 mv_block->PMV[1][0][1] <<= 1;
229 mv_block->PMV[0][1][1] <<= 1;
230 mv_block->PMV[1][1][1] <<= 1;
234 mv_block->motion_type = XVMC_PREDICTION_DUAL_PRIME;
237 mv_block->PMV[0][0][0] = s->
mv[0][0][0];
238 mv_block->PMV[0][0][1] = s->
mv[0][0][1] << 1;
240 mv_block->PMV[0][1][0] = s->
mv[0][0][0];
241 mv_block->PMV[0][1][1] = s->
mv[0][0][1] << 1;
243 mv_block->PMV[1][0][0] = s->
mv[0][2][0];
244 mv_block->PMV[1][0][1] = s->
mv[0][2][1] << 1;
246 mv_block->PMV[1][1][0] = s->
mv[0][3][0];
247 mv_block->PMV[1][1][1] = s->
mv[0][3][1] << 1;
250 mv_block->PMV[0][1][0] = s->
mv[0][2][0];
251 mv_block->PMV[0][1][1] = s->
mv[0][2][1];
258 mv_block->motion_vertical_field_select = 0;
262 mv_block->motion_vertical_field_select |= s->
field_select[0][0];
263 mv_block->motion_vertical_field_select |= s->
field_select[1][0] << 1;
264 mv_block->motion_vertical_field_select |= s->
field_select[0][1] << 2;
265 mv_block->motion_vertical_field_select |= s->
field_select[1][1] << 3;
278 for (i = 0; i < blocks_per_mb; i++) {
286 for (i = 4; i < blocks_per_mb; i++) {
292 cbp &= 0xf << (blocks_per_mb - 4);
296 mv_block->coded_block_pattern = cbp;
298 mv_block->macroblock_type &= ~XVMC_MB_TYPE_PATTERN;
300 for (i = 0; i < blocks_per_mb; i++) {