[x264-devel] Remove redundant mbcmp calls in weightp analysis

Dylan Yudaken git at videolan.org
Wed Apr 13 04:04:28 CEST 2011


x264 | branch: master | Dylan Yudaken <dyudaken at gmail.com> | Thu Apr  7 16:06:19 2011 -0700| [e577efbf274f78ef9149414b65c80634484b42ad] | committer: Jason Garrett-Glaser

Remove redundant mbcmp calls in weightp analysis

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

 encoder/slicetype.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index df20fcf..e3df242 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -167,14 +167,18 @@ static NOINLINE unsigned int x264_weight_cost_luma( x264_t *h, x264_frame_t *fen
             for( int x = 0; x < i_width; x += 8, i_mb++, pixoff += 8)
             {
                 w->weightfn[8>>2]( buf, 8, &src[pixoff], i_stride, w, 8 );
-                cost += X264_MIN( h->pixf.mbcmp[PIXEL_8x8]( buf, 8, &fenc_plane[pixoff], i_stride ), fenc->i_intra_cost[i_mb] );
+                int cmp = h->pixf.mbcmp[PIXEL_8x8]( buf, 8, &fenc_plane[pixoff], i_stride );
+                cost += X264_MIN( cmp, fenc->i_intra_cost[i_mb] );
             }
         cost += x264_weight_slice_header_cost( h, w, 0 );
     }
     else
         for( int y = 0; y < i_lines; y += 8, pixoff = y*i_stride )
             for( int x = 0; x < i_width; x += 8, i_mb++, pixoff += 8 )
-                cost += X264_MIN( h->pixf.mbcmp[PIXEL_8x8]( &src[pixoff], i_stride, &fenc_plane[pixoff], i_stride ), fenc->i_intra_cost[i_mb] );
+            {
+                int cmp = h->pixf.mbcmp[PIXEL_8x8]( &src[pixoff], i_stride, &fenc_plane[pixoff], i_stride );
+                cost += X264_MIN( cmp, fenc->i_intra_cost[i_mb] );
+            }
     x264_emms();
     return cost;
 }



More information about the x264-devel mailing list