]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
theoradec: small 4MV code reorganization to ease future improvements
authoraurel <aurel@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 3 Sep 2008 00:10:30 +0000 (00:10 +0000)
committeraurel <aurel@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 3 Sep 2008 00:10:30 +0000 (00:10 +0000)
no functionnal changes

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15165 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/vp3.c

index 3c06fe4d090d523af3cdfb07358b16856b55f736..6740f0c3e596c00887104395ea0189bf7420c578 100644 (file)
@@ -1039,6 +1039,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
                     break;
 
                 case MODE_INTER_FOURMV:
+                    /* vector maintenance */
+                    prior_last_motion_x = last_motion_x;
+                    prior_last_motion_y = last_motion_y;
+
                     /* fetch 4 vectors from the bitstream, one for each
                      * Y fragment, then average for the C fragment vectors */
                     motion_x[4] = motion_y[4] = 0;
@@ -1050,6 +1054,8 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
                             motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)];
                             motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)];
                         }
+                        last_motion_x = motion_x[k];
+                        last_motion_y = motion_y[k];
                         motion_x[4] += motion_x[k];
                         motion_y[4] += motion_y[k];
                     }
@@ -1058,13 +1064,6 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
                     motion_x[4]= RSHIFT(motion_x[4], 2);
                     motion_y[5]=
                     motion_y[4]= RSHIFT(motion_y[4], 2);
-
-                    /* vector maintenance; vector[3] is treated as the
-                     * last vector in this case */
-                    prior_last_motion_x = last_motion_x;
-                    prior_last_motion_y = last_motion_y;
-                    last_motion_x = motion_x[3];
-                    last_motion_y = motion_y[3];
                     break;
 
                 case MODE_INTER_LAST_MV: