From: Dmitry Kovalev Date: Thu, 18 Apr 2013 22:37:11 +0000 (-0700) Subject: Fixing rounding inside vp9_mv_bit_cost function. X-Git-Tag: v1.3.0~1106^2~210^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e01ca6a19589448b733faf1a9d092a82235f5f5;p=libvpx Fixing rounding inside vp9_mv_bit_cost function. Change-Id: I7209a05919162a8155520bc543658ddb69ba12ce --- diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index caba2ea85..17dafe6d7 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -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],