]> git.videolan.org Git - x264.git/commitdiff
Avoid an extra var2 in chroma encoding if possible
authorJason Garrett-Glaser <darkshikari@gmail.com>
Fri, 21 May 2010 21:32:13 +0000 (14:32 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 26 May 2010 09:06:39 +0000 (02:06 -0700)
Also remove a redundant if.

encoder/analyse.c
encoder/macroblock.c

index 8868012e63b33f53c33cf3af05491958bbdd5235..a128a70954a5c44c5fb1d1ec068823c5ef6de62e 100644 (file)
@@ -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
         {
index a961baf59772565c7a329691bcf151dfa0d39b42..199bb681094719854984a10b133611fe93fdb766 100644 (file)
@@ -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 )
         {