]> git.videolan.org Git - x264.git/commitdiff
More accurate MV prediction on edges in lookahead
authorJason Garrett-Glaser <darkshikari@gmail.com>
Sun, 2 May 2010 02:34:14 +0000 (19:34 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Thu, 6 May 2010 05:08:24 +0000 (22:08 -0700)
encoder/slicetype.c

index cf2be0e1dbc98e6d29152bbc14e88bf9459290a6..93523679be71bff546751992a5654624ab62a7fd 100644 (file)
@@ -381,21 +381,23 @@ static void x264_slicetype_mb_cost( x264_t *h, x264_mb_analysis_t *a,
 
             /* Reverse-order MV prediction. */
             M32( mvc[0] ) = 0;
-            M32( mvc[1] ) = 0;
             M32( mvc[2] ) = 0;
 #define MVC(mv) { CP32( mvc[i_mvc], mv ); i_mvc++; }
             if( i_mb_x < h->sps->i_mb_width - 1 )
-                MVC(fenc_mv[1]);
+                MVC( fenc_mv[1] );
             if( i_mb_y < h->sps->i_mb_height - 1 )
             {
-                MVC(fenc_mv[i_mb_stride]);
+                MVC( fenc_mv[i_mb_stride] );
                 if( i_mb_x > 0 )
-                    MVC(fenc_mv[i_mb_stride-1]);
+                    MVC( fenc_mv[i_mb_stride-1] );
                 if( i_mb_x < h->sps->i_mb_width - 1 )
-                    MVC(fenc_mv[i_mb_stride+1]);
+                    MVC( fenc_mv[i_mb_stride+1] );
             }
 #undef MVC
-            x264_median_mv( m[l].mvp, mvc[0], mvc[1], mvc[2] );
+            if( i_mvc <= 1 )
+                CP32( m[l].mvp, mvc[0] );
+            else
+                x264_median_mv( m[l].mvp, mvc[0], mvc[1], mvc[2] );
             x264_me_search( h, &m[l], mvc, i_mvc );
 
             m[l].cost -= 2; // remove mvcost from skip mbs