]> granicus.if.org Git - libx264/commitdiff
Faster x264_macroblock_encode_pskip
authorHenrik Gramner <hengar-6@student.ltu.se>
Fri, 5 Mar 2010 02:19:47 +0000 (03:19 +0100)
committerFiona Glaser <fiona@x264.com>
Sat, 27 Mar 2010 19:47:16 +0000 (12:47 -0700)
GCC is apparently unable to optimize out the calculation of a variable when it isn't used.

encoder/macroblock.c

index 789aa48305228114e90b90f0bc1ae4df5084ac08..092537c92beb44087e7adc21f645168c1aed5fe1 100644 (file)
@@ -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] );