+2010-09-20 6.6.4-5 Nicolas Robidoux <nicolas.robidoux@gmail...>
+ * Modified "magick/resize.c" so that PIL is a MagickRealType number. Earlier,
+ some computations were needlessly done in long double precision because PIL
+ forced an automatic upcast wherever it appeared.
+ * Modified "magick/resize.c" so that Bohman uses one trig call + one sqrt call
+ instead of two trig calls.
+
2010-09-20 6.6.4-5 Anthony Thyssen <A.Thyssen@griffith...>
* modified "magick/resample.c" to allow use of either EWA or HQEWA (default)
* Removed LanczosFast from supported filters (SincFast*SincFast is faster)
%
*/
-#define MagickPIL 3.14159265358979323846264338327950288420L
+#define MagickPIL ((MagickRealType) 3.14159265358979323846264338327950288420L)
static MagickRealType Bessel(const MagickRealType x,
const ResizeFilter *magick_unused(resize_filter))
/*
Bohman: 2rd Order cosine windowing function:
(1-x) cos(pi x) + sin(pi x) / pi.
+ Refactored by Nicolas Robidoux to one trig call, one sqrt call,
+ and 7 flops, taking advantage of the fact that the support of
+ Bohman is 1 (so that we know that sin(pi x) >= 0).
*/
- const double pix = (double) (MagickPIL*x);
- return((MagickRealType) ((1.0-x)*cos(pix)+(1.0/MagickPIL)*sin(pix)));
+ const double cospix = cos((double) (MagickPIL*x));
+ const double sinpix = sqrt(1.0-cospix*cospix);
+ return((MagickRealType) ((1.0-x)*cospix+(1.0/MagickPIL)*sinpix));
}
static MagickRealType Box(const MagickRealType x,