[x264-devel] commit: Faster x264_macroblock_encode_pskip (Henrik Gramner )

git at videolan.org git at videolan.org
Sun Mar 28 04:44:27 CEST 2010


x264 | branch: master | Henrik Gramner <hengar-6 at student.ltu.se> | Fri Mar  5 03:19:47 2010 +0100| [49eb50c11ca281146cebea36c7a39d12fa589d51] | committer: Jason Garrett-Glaser 

Faster x264_macroblock_encode_pskip
GCC is apparently unable to optimize out the calculation of a variable when it isn't used.

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

 encoder/macroblock.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/encoder/macroblock.c b/encoder/macroblock.c
index ddb1ce3..8bfdf84 100644
--- a/encoder/macroblock.c
+++ b/encoder/macroblock.c
@@ -475,14 +475,14 @@ static void x264_macroblock_encode_skip( x264_t *h )
  *****************************************************************************/
 static void x264_macroblock_encode_pskip( x264_t *h )
 {
-    const int mvx = x264_clip3( h->mb.cache.mv[0][x264_scan8[0]][0],
-                                h->mb.mv_min[0], h->mb.mv_max[0] );
-    const int mvy = x264_clip3( h->mb.cache.mv[0][x264_scan8[0]][1],
-                                h->mb.mv_min[1], h->mb.mv_max[1] );
-
     /* don't do pskip motion compensation if it was already done in macroblock_analyse */
     if( !h->mb.b_skip_mc )
     {
+        int mvx = x264_clip3( h->mb.cache.mv[0][x264_scan8[0]][0],
+                              h->mb.mv_min[0], h->mb.mv_max[0] );
+        int mvy = x264_clip3( h->mb.cache.mv[0][x264_scan8[0]][1],
+                              h->mb.mv_min[1], h->mb.mv_max[1] );
+
         h->mc.mc_luma( h->mb.pic.p_fdec[0],    FDEC_STRIDE,
                        h->mb.pic.p_fref[0][0], h->mb.pic.i_stride[0],
                        mvx, mvy, 16, 16, &h->sh.weight[0][0] );



More information about the x264-devel mailing list