From 2b1adda96c680775db1429521c960a14a58ddf3a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 15 Dec 2008 15:11:54 +0000 Subject: [PATCH] more precision for interpolation --- ChangeLog | 2 ++ include/vips/interpolate.h | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 212d8c3f..2d5bfec3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,8 @@ - interpolators use type introspection - added vips --list classes, does formats too - include sys/param.h to get PATH_MAX in more places +- VIPS_INTERPOLATE_SHIFT bumped to 12, we need the extra precision for u16 gel + data 11/9/08 started 7.16.3 - oop typo in manpage for im_project() diff --git a/include/vips/interpolate.h b/include/vips/interpolate.h index bc937b66..99df93d6 100644 --- a/include/vips/interpolate.h +++ b/include/vips/interpolate.h @@ -94,10 +94,10 @@ int vips_interpolate_get_window_size( VipsInterpolate *interpolate ); /* How many bits of precision we keep for interpolation, ie. where the decimal * is in the fixed-point tables. For 16-bit pixels, we need 16 bits for the - * data, 4 bits to add 16 values together, another bit for the sign and some - * other stuff, so say 24 total. That leaves 8 bits for the fractional part. + * data and 4 bits to add 16 values together. That leaves 12 bits for the + * fractional part. */ -#define VIPS_INTERPOLATE_SHIFT (8) +#define VIPS_INTERPOLATE_SHIFT (12) #define VIPS_INTERPOLATE_SCALE (1 << VIPS_INTERPOLATE_SHIFT) /* Convenience: return static interpolators, no need to unref.