[x264-devel] commit: Avoid an extra var2 in chroma encoding if possible ( Jason Garrett-Glaser )

git at videolan.org git at videolan.org
Wed May 26 19:39:34 CEST 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Fri May 21 14:32:13 2010 -0700| [2dd5ce29d1e5304310d8577543613b230878cdc5] | committer: Jason Garrett-Glaser 

Avoid an extra var2 in chroma encoding if possible
Also remove a redundant if.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=2dd5ce29d1e5304310d8577543613b230878cdc5
---

 encoder/analyse.c    |    5 ++---
 encoder/macroblock.c |    3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/encoder/analyse.c b/encoder/analyse.c
index 8868012..a128a70 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 a961baf..199bb68 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 )
         {



More information about the x264-devel mailing list