From 99adc5797676a67f5cabdfba128347a79f7e42da Mon Sep 17 00:00:00 2001
From: Sarah Parker <sarahparker@google.com>
Date: Fri, 12 Aug 2016 16:44:05 -0700
Subject: [PATCH] Fix precision bug in warped_motion.c

The projected coordiantes in projectPointsTranslation were
being shifted by the incorrect precision.

Change-Id: If6040bea9e5187020d85c6095d85c7ff5786b7f9
---
 vp10/common/warped_motion.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vp10/common/warped_motion.c b/vp10/common/warped_motion.c
index 7e3aebf4f1..59999f79e9 100644
--- a/vp10/common/warped_motion.c
+++ b/vp10/common/warped_motion.c
@@ -62,17 +62,17 @@ static void projectPointsTranslation(int *mat, int *points, int *proj,
     if (subsampling_x)
       *(proj++) = ROUND_POWER_OF_TWO_SIGNED(
           ((x << (WARPEDMODEL_PREC_BITS + 1)) + mat[0]),
-          WARPEDPIXEL_PREC_BITS + 1);
+          WARPEDDIFF_PREC_BITS + 1);
     else
       *(proj++) = ROUND_POWER_OF_TWO_SIGNED(
-          ((x << WARPEDMODEL_PREC_BITS)) + mat[0], WARPEDPIXEL_PREC_BITS);
+          ((x << WARPEDMODEL_PREC_BITS)) + mat[0], WARPEDDIFF_PREC_BITS);
     if (subsampling_y)
       *(proj++) = ROUND_POWER_OF_TWO_SIGNED(
           ((y << (WARPEDMODEL_PREC_BITS + 1)) + mat[1]),
-          WARPEDPIXEL_PREC_BITS + 1);
+          WARPEDDIFF_PREC_BITS + 1);
     else
       *(proj++) = ROUND_POWER_OF_TWO_SIGNED(
-          ((y << WARPEDMODEL_PREC_BITS)) + mat[1], WARPEDPIXEL_PREC_BITS);
+          ((y << WARPEDMODEL_PREC_BITS)) + mat[1], WARPEDDIFF_PREC_BITS);
     points += stride_points - 2;
     proj += stride_proj - 2;
   }
-- 
GitLab