diff --git a/TODO b/TODO index d1a555bf..3c5156ea 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,28 @@ +- large and puzzling performance regression cf. 7.18 on the benchmark + + 7.18 + $ time ./vips.py wtc_tiled_small.tif wtc2.tif + vips warning: im_conv: 6534 overflows and 13439 underflows detected + real 0m1.891s + user 0m3.110s + sys 0m0.320s + + 7.20 (and 7.22) + + $ time ./vips.py wtc_tiled_small.tif wtc2.tif + vips warning: im_conv: 6502 overflows and 13429 underflows detected + real 0m2.962s + user 0m4.950s + sys 0m0.250s + + and why are the conv numbers different? + + seems to be a difference in the bilinear interpolator? we did increase + accuracy in 7.18 -> 7.20 + + I suppose conv must have changed too? + + - use D65 in cmsCreateLab4Profile() ? not sure diff --git a/libvips/resample/interpolate.c b/libvips/resample/interpolate.c index 9fe25d7e..adabae99 100644 --- a/libvips/resample/interpolate.c +++ b/libvips/resample/interpolate.c @@ -409,10 +409,11 @@ vips_interpolate_bilinear_interpolate( VipsInterpolate *interpolate, const int tx = (six + 1) >> 1; const int ty = (siy + 1) >> 1; - /* We know x/y are always positive, so we can just (int) them. + /* We want ((int)x) ... save this double -> int conversion by just + * shifting sx down. */ - const int ix = (int) x; - const int iy = (int) y; + const int ix = sx >> (VIPS_TRANSFORM_SHIFT + 1); + const int iy = sy >> (VIPS_TRANSFORM_SHIFT + 1); const PEL *p1 = (PEL *) IM_REGION_ADDR( in, ix, iy ); const PEL *p2 = p1 + ps;