]> granicus.if.org Git - libvpx/commitdiff
Fix precision bug in warped_motion.c
authorSarah Parker <sarahparker@google.com>
Fri, 12 Aug 2016 23:44:05 +0000 (16:44 -0700)
committerSarah Parker <sarahparker@google.com>
Fri, 12 Aug 2016 23:44:05 +0000 (16:44 -0700)
The projected coordiantes in projectPointsTranslation were
being shifted by the incorrect precision.

Change-Id: If6040bea9e5187020d85c6095d85c7ff5786b7f9

vp10/common/warped_motion.c

index 7e3aebf4f184f76a1cb7cc5f3a79676a52d4b3e9..59999f79e920feab3873f29bfb3858bb9f5a7603 100644 (file)
@@ -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;
   }