From 6f3a6d52e605acc9df8277acb5c7094190898d82 Mon Sep 17 00:00:00 2001 From: Henrik Gramner Date: Fri, 5 Mar 2010 03:19:47 +0100 Subject: [PATCH] Faster x264_macroblock_encode_pskip GCC is apparently unable to optimize out the calculation of a variable when it isn't used. --- encoder/macroblock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/encoder/macroblock.c b/encoder/macroblock.c index 789aa483..092537c9 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] ); -- 2.40.0