]> granicus.if.org Git - libvpx/commitdiff
Fixing rounding inside vp9_mv_bit_cost function.
authorDmitry Kovalev <dkovalev@google.com>
Thu, 18 Apr 2013 22:37:11 +0000 (15:37 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Thu, 18 Apr 2013 22:37:11 +0000 (15:37 -0700)
Change-Id: I7209a05919162a8155520bc543658ddb69ba12ce

vp9/encoder/vp9_mcomp.c

index caba2ea85717e74654f8504f12fd605e746e6f0a..17dafe6d71d8b9391eb3be91effcd23766849d67 100644 (file)
@@ -56,9 +56,9 @@ int vp9_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvjcost, int *mvcost[2],
   MV v;
   v.row = mv->as_mv.row - ref->as_mv.row;
   v.col = mv->as_mv.col - ref->as_mv.col;
-  return ((mvjcost[vp9_get_mv_joint(&v)] +
-           mvcost[0][v.row] +
-           mvcost[1][v.col]) * weight) >> 7;
+  return ROUND_POWER_OF_TWO((mvjcost[vp9_get_mv_joint(&v)] +
+                             mvcost[0][v.row] +
+                             mvcost[1][v.col]) * weight, 7);
 }
 
 static int mv_err_cost(int_mv *mv, int_mv *ref, int *mvjcost, int *mvcost[2],