From: Jason Garrett-Glaser Date: Fri, 21 May 2010 21:32:13 +0000 (-0700) Subject: Avoid an extra var2 in chroma encoding if possible X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=2dd5ce29d1e5304310d8577543613b230878cdc5;p=x264.git Avoid an extra var2 in chroma encoding if possible Also remove a redundant if. --- diff --git a/encoder/analyse.c b/encoder/analyse.c index 8868012e..a128a709 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -2637,9 +2637,8 @@ intra_analysis: h->mb.i_partition = D_16x16; assert( h->mb.cache.pskip_mv[1] <= h->mb.mv_max_spel[1] || h->i_thread_frames == 1 ); /* Set up MVs for future predictors */ - if( b_skip ) - for( int i = 0; i < h->mb.pic.i_fref[0]; i++ ) - M32( h->mb.mvr[0][i][h->mb.i_mb_xy] ) = 0; + for( int i = 0; i < h->mb.pic.i_fref[0]; i++ ) + M32( h->mb.mvr[0][i][h->mb.i_mb_xy] ) = 0; } else { diff --git a/encoder/macroblock.c b/encoder/macroblock.c index a961baf5..199bb681 100644 --- a/encoder/macroblock.c +++ b/encoder/macroblock.c @@ -331,7 +331,8 @@ void x264_mb_encode_8x8_chroma( x264_t *h, int b_inter, int i_qp ) { int thresh = (x264_lambda2_tab[i_qp] + 32) >> 6; int ssd[2]; - int score = h->pixf.var2_8x8( h->mb.pic.p_fenc[1], FENC_STRIDE, h->mb.pic.p_fdec[1], FDEC_STRIDE, &ssd[0] ); + int score = h->pixf.var2_8x8( h->mb.pic.p_fenc[1], FENC_STRIDE, h->mb.pic.p_fdec[1], FDEC_STRIDE, &ssd[0] ); + if( score < thresh*4 ) score += h->pixf.var2_8x8( h->mb.pic.p_fenc[2], FENC_STRIDE, h->mb.pic.p_fdec[2], FDEC_STRIDE, &ssd[1] ); if( score < thresh*4 ) {