From: David Barker Date: Mon, 7 Nov 2016 13:47:13 +0000 (+0000) Subject: Fix bug in bicubic filter in warped_motion.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f23bdca6a824e6326fe90d48ab623d9e671d06a0;p=libvpx Fix bug in bicubic filter in warped_motion.c Previously, do_cubic_filter would return results with the wrong precision if the sample point was exactly aligned to a pixel. Change-Id: I40139f9a6701a8e72e691f37bb352f7814a7f306 --- diff --git a/av1/common/warped_motion.c b/av1/common/warped_motion.c index 2534345da..7bbf20f88 100644 --- a/av1/common/warped_motion.c +++ b/av1/common/warped_motion.c @@ -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]);