Merge "Improved uv mv calculations in build inter predictor"
authorScott LaVarnway <slavarnway@google.com>
Tue, 31 Jan 2012 18:43:49 +0000 (10:43 -0800)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Tue, 31 Jan 2012 18:43:49 +0000 (10:43 -0800)
1  2 
vp8/common/reconinter.c

@@@ -9,9 -9,11 +9,10 @@@
   */
  
  
+ #include <limits.h>
  #include "vpx_config.h"
 +#include "vpx_rtcd.h"
  #include "vpx/vpx_integer.h"
 -#include "recon.h"
 -#include "subpixel.h"
  #include "blockd.h"
  #include "reconinter.h"
  #if CONFIG_RUNTIME_CPU_DETECT
@@@ -220,22 -240,13 +221,13 @@@ void vp8_build_inter16x16_predictors_mb
      int mv_row = x->mode_info_context->mbmi.mv.as_mv.row;
      int mv_col = x->mode_info_context->mbmi.mv.as_mv.col;
      int offset;
 -    int pre_stride = x->block[16].pre_stride;
 +    int pre_stride = x->pre.uv_stride;
  
      /* calc uv motion vectors */
-     if (mv_row < 0)
-         mv_row -= 1;
-     else
-         mv_row += 1;
-     if (mv_col < 0)
-         mv_col -= 1;
-     else
-         mv_col += 1;
+     mv_row += 1 | (mv_row >> (sizeof(int) * CHAR_BIT - 1));
+     mv_col += 1 | (mv_col >> (sizeof(int) * CHAR_BIT - 1));
      mv_row /= 2;
      mv_col /= 2;
      mv_row &= x->fullpixel_mask;
      mv_col &= x->fullpixel_mask;