Previously, do_cubic_filter would return results with the
wrong precision if the sample point was exactly aligned to
a pixel.
Change-Id: I40139f9a6701a8e72e691f37bb352f7814a7f306
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]);