From: Jason Garrett-Glaser Date: Sun, 2 May 2010 02:34:14 +0000 (-0700) Subject: More accurate MV prediction on edges in lookahead X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=c82273d6d74271e0f743c5729e7438ff37e2df5e;p=x264.git More accurate MV prediction on edges in lookahead --- diff --git a/encoder/slicetype.c b/encoder/slicetype.c index cf2be0e1..93523679 100644 --- a/encoder/slicetype.c +++ b/encoder/slicetype.c @@ -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