changeset 1947:b306574523ad libavcodec

fix y scale of mv vissualization of interlaced MVs
author michael
date Sun, 18 Apr 2004 18:30:05 +0000
parents f9212b59a802
children d10578f7fd40
files mpegvideo.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Sun Apr 18 17:46:52 2004 +0000
+++ b/mpegvideo.c	Sun Apr 18 18:30:05 2004 +0000
@@ -1738,9 +1738,13 @@
                         int sx=mb_x*16 + 8;
                         int sy=mb_y*16 + 4 + 8*i;
                         int xy= mb_x*2 + (mb_y*2 + i)*s->b8_stride;
-                        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, s->width, s->height, s->linesize, 100);
+                        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, s->width, s->height, s->linesize, 100);
                       }
                     }else{
                       int sx= mb_x*16 + 8;