Commit f23bdca6 authored by David Barker's avatar David Barker
Browse files

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
parent 92447f34
......@@ -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]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment