- direction = 1;
- break;
- }
- if(!USES_LIST(pict->mb_type[mb_index], direction))
- continue;
-
- if(IS_8X8(pict->mb_type[mb_index])){
- int i;
- for(i=0; i<4; i++){
- int sx= mb_x*16 + 4 + 8*(i&1);
- int sy= mb_y*16 + 4 + 8*(i>>1);
- int xy= (mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*mv_stride) << (mv_sample_log2-1);
- int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
- int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
- draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
- }
- }else if(IS_16X8(pict->mb_type[mb_index])){
- int i;
- for(i=0; i<2; i++){
- int sx=mb_x*16 + 8;
- int sy=mb_y*16 + 4 + 8*i;
- int xy= (mb_x*2 + (mb_y*2 + i)*mv_stride) << (mv_sample_log2-1);
- int mx=(pict->motion_val[direction][xy][0]>>shift);
- int my=(pict->motion_val[direction][xy][1]>>shift);
-
- if(IS_INTERLACED(pict->mb_type[mb_index]))
- my*=2;
-
- draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
- }
- }else if(IS_8X16(pict->mb_type[mb_index])){
- int i;
- for(i=0; i<2; i++){
- int sx=mb_x*16 + 4 + 8*i;
- int sy=mb_y*16 + 8;
- int xy= (mb_x*2 + i + mb_y*2*mv_stride) << (mv_sample_log2-1);
- int mx=(pict->motion_val[direction][xy][0]>>shift);
- int my=(pict->motion_val[direction][xy][1]>>shift);
-
- if(IS_INTERLACED(pict->mb_type[mb_index]))
- my*=2;
-
- draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
- }
- }else{
- int sx= mb_x*16 + 8;
- int sy= mb_y*16 + 8;
- int xy= (mb_x + mb_y*mv_stride) << mv_sample_log2;
- int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
- int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
- draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
+ direction = 1;
+ break;
+ }
+ if (!USES_LIST(pict->mb_type[mb_index], direction))
+ continue;
+
+ if (IS_8X8(pict->mb_type[mb_index])) {
+ int i;
+ for (i = 0; i < 4; i++) {
+ int sx = mb_x * 16 + 4 + 8 * (i & 1);
+ int sy = mb_y * 16 + 4 + 8 * (i >> 1);
+ int xy = (mb_x * 2 + (i & 1) +
+ (mb_y * 2 + (i >> 1)) * mv_stride) << (mv_sample_log2 - 1);
+ int mx = (pict->motion_val[direction][xy][0] >> shift) + sx;
+ int my = (pict->motion_val[direction][xy][1] >> shift) + sy;
+ draw_arrow(ptr, sx, sy, mx, my, width,
+ height, s->linesize, 100);
+ }
+ } else if (IS_16X8(pict->mb_type[mb_index])) {
+ int i;
+ for (i = 0; i < 2; i++) {
+ int sx = mb_x * 16 + 8;
+ int sy = mb_y * 16 + 4 + 8 * i;
+ int xy = (mb_x * 2 + (mb_y * 2 + i) * mv_stride) << (mv_sample_log2 - 1);
+ int mx = (pict->motion_val[direction][xy][0] >> shift);
+ int my = (pict->motion_val[direction][xy][1] >> shift);
+
+ if (IS_INTERLACED(pict->mb_type[mb_index]))
+ my *= 2;
+
+ draw_arrow(ptr, sx, sy, mx + sx, my + sy, width,
+ height, s->linesize, 100);
+ }
+ } else if (IS_8X16(pict->mb_type[mb_index])) {
+ int i;
+ for (i = 0; i < 2; i++) {
+ int sx = mb_x * 16 + 4 + 8 * i;
+ int sy = mb_y * 16 + 8;
+ int xy = (mb_x * 2 + i + mb_y * 2 * mv_stride) << (mv_sample_log2 - 1);
+ int mx = pict->motion_val[direction][xy][0] >> shift;
+ int my = pict->motion_val[direction][xy][1] >> shift;
+
+ if (IS_INTERLACED(pict->mb_type[mb_index]))
+ my *= 2;
+
+ draw_arrow(ptr, sx, sy, mx + sx, my + sy, width,
+ height, s->linesize, 100);
+ }
+ } else {
+ int sx= mb_x * 16 + 8;
+ int sy= mb_y * 16 + 8;
+ int xy= (mb_x + mb_y * mv_stride) << mv_sample_log2;
+ int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
+ int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
+ draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
+ }