shithub: libvpx

Download patch

ref: 3e01ca6a19589448b733faf1a9d092a82235f5f5
parent: 2d150439000306bfef0ac4050fe05d6ba4ea73c0
author: Dmitry Kovalev <dkovalev@google.com>
date: Thu Apr 18 11:37:11 EDT 2013

Fixing rounding inside vp9_mv_bit_cost function.

Change-Id: I7209a05919162a8155520bc543658ddb69ba12ce

--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -56,9 +56,9 @@
   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],
--