]> granicus.if.org Git - libvpx/commitdiff
Fix bug in bicubic filter in warped_motion.c
authorDavid Barker <david.barker@argondesign.com>
Mon, 7 Nov 2016 13:47:13 +0000 (13:47 +0000)
committerDavid Barker <david.barker@argondesign.com>
Mon, 7 Nov 2016 13:47:13 +0000 (13:47 +0000)
Previously, do_cubic_filter would return results with the
wrong precision if the sample point was exactly aligned to
a pixel.

Change-Id: I40139f9a6701a8e72e691f37bb352f7814a7f306

av1/common/warped_motion.c

index 2534345da385043ac10a77c107ed93b665dc6bb6..7bbf20f88f8ab9cd0761ec42a930436d21805e7d 100644 (file)
@@ -186,9 +186,9 @@ static int32_t do_ntap_filter(int32_t *p, int x) {
 
 static int32_t do_cubic_filter(int32_t *p, int x) {
   if (x == 0) {
-    return p[0];
+    return p[0] * (1 << WARPEDPIXEL_FILTER_BITS);
   } else if (x == (1 << WARPEDPIXEL_PREC_BITS)) {
-    return p[1];
+    return p[1] * (1 << WARPEDPIXEL_FILTER_BITS);
   } else {
     const int64_t v1 = (int64_t)x * x * x * (3 * (p[0] - p[1]) + p[2] - p[-1]);
     const int64_t v2 = x * x * (2 * p[-1] - 5 * p[0] + 4 * p[1] - p[2]);