changeset 4683:b4dd7005d807 libavcodec

Zero MV vectors for P frame intra blocks
author kostya
date Sun, 18 Mar 2007 18:07:27 +0000
parents 95875881b85b
children 6ec0afffc572
files vc1.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/vc1.c	Sun Mar 18 12:03:29 2007 +0000
+++ b/vc1.c	Sun Mar 18 18:07:27 2007 +0000
@@ -1068,8 +1068,11 @@
         for(i= t1+1; i<4; i++)if(!intra[i]) {t2 = i; break;}
         tx = (mvx[t1] + mvx[t2]) / 2;
         ty = (mvy[t1] + mvy[t2]) / 2;
-    } else
+    } else {
+        s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
+        s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
         return; //no need to do MC for inter blocks
+    }
 
     s->current_picture.motion_val[1][s->block_index[0]][0] = tx;
     s->current_picture.motion_val[1][s->block_index[0]][1] = ty;
@@ -2004,6 +2007,8 @@
     if(s->mb_intra){
         s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = 0;
         s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = 0;
+        s->current_picture.motion_val[1][xy][0] = 0;
+        s->current_picture.motion_val[1][xy][1] = 0;
         if(mv1) { /* duplicate motion data for 1-MV block */
             s->current_picture.motion_val[0][xy + 1][0] = 0;
             s->current_picture.motion_val[0][xy + 1][1] = 0;
@@ -2011,6 +2016,12 @@
             s->current_picture.motion_val[0][xy + wrap][1] = 0;
             s->current_picture.motion_val[0][xy + wrap + 1][0] = 0;
             s->current_picture.motion_val[0][xy + wrap + 1][1] = 0;
+            s->current_picture.motion_val[1][xy + 1][0] = 0;
+            s->current_picture.motion_val[1][xy + 1][1] = 0;
+            s->current_picture.motion_val[1][xy + wrap][0] = 0;
+            s->current_picture.motion_val[1][xy + wrap][1] = 0;
+            s->current_picture.motion_val[1][xy + wrap + 1][0] = 0;
+            s->current_picture.motion_val[1][xy + wrap + 1][1] = 0;
         }
         return;
     }