From 83fc52c491cb863de2b01d5aaa62870ce8b8a7f5 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 30 Nov 2010 11:53:53 +0000 Subject: [PATCH] smaller norm factor for d->i mask --- ChangeLog | 5 ++++- TODO | 5 +++++ libvips/convolution/im_conv.c | 16 +++++++++++++--- libvips/mask/rw_mask.c | 9 ++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d46e5290..14651d7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,7 +39,8 @@ - mask gtk-doc done - add cfitsio dependancy - add FITS reader -- land the vector branmch ... we have SSE erode/dilate/add/conv +- land the vector branch and the orc dependancy ... we have SSE + erode/dilate/add/conv - add IM_SWAP - dilate/erode do (!=0) on non-uchar images - add multipass Orc to im_conv(), 3.5x faster for 5x5 mask @@ -51,6 +52,8 @@ - oop, bool constants are always (int) now, so (^-1) works for unsigned types, thanks Nicolas - much lower memuse for im_cache() in complex pipelines +- im_scale_dmask() normalises to 20, not 100 ... we hit the fast + conv path more often 12/5/10 started 7.22.2 - the conditional image of ifthenelse can be any format, a (!=0) is added if diff --git a/TODO b/TODO index 9d306689..515e7ba6 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,11 @@ + + - im_conv()/im_morph() could have more than 10 programs? try 20 and see if we still have a speedup + + + - fits >3d load fits save diff --git a/libvips/convolution/im_conv.c b/libvips/convolution/im_conv.c index 0d329db9..ba931df3 100644 --- a/libvips/convolution/im_conv.c +++ b/libvips/convolution/im_conv.c @@ -1037,14 +1037,24 @@ im_conv_raw( IMAGE *in, IMAGE *out, INTMASK *mask ) generate = convvec_gen; #ifdef DEBUG - printf( "im_conv_raw: using vector path\n" ); #endif /*DEBUG*/ + printf( "im_conv_raw: using vector path\n" ); } - else if( mask->xsize == 3 && mask->ysize == 3 ) + else if( mask->xsize == 3 && mask->ysize == 3 ) { generate = conv3x3_gen; - else + +#ifdef DEBUG +#endif /*DEBUG*/ + printf( "im_conv_raw: using 3x3 path\n" ); + } + else { generate = conv_gen; +#ifdef DEBUG +#endif /*DEBUG*/ + printf( "im_conv_raw: using general path\n" ); + } + /* Set demand hints. FATSTRIP is good for us, as THINSTRIP will cause * too many recalculations on overlaps. */ diff --git a/libvips/mask/rw_mask.c b/libvips/mask/rw_mask.c index 49a1167e..02ffc5c4 100644 --- a/libvips/mask/rw_mask.c +++ b/libvips/mask/rw_mask.c @@ -49,6 +49,9 @@ * - gtk-doc * - you can use commas to separate eader fields * - small cleanups + * 30/11/10 + * - im_scale_dmask() normalises to 20, not 100 ... we hit the fast + * conv path more often */ /* @@ -575,7 +578,7 @@ im_read_imask( const char *filename ) * @in: mask to scale * @filename: filename for returned mask * - * Scale the dmask to make an imask with a maximum value of 100. + * Scale the dmask to make an imask with a maximum value of 20. * * See also: im_norm_dmask(). * @@ -605,10 +608,10 @@ im_scale_dmask( DOUBLEMASK *in, const char *filename ) if( in->coeff[i] > maxval ) maxval = in->coeff[i]; - /* Copy and scale, setting max to 100. + /* Copy and scale, setting max to 20. */ for( i = 0; i < size; i++ ) - out->coeff[i] = IM_RINT( in->coeff[i] * 100.0 / maxval ); + out->coeff[i] = IM_RINT( in->coeff[i] * 20.0 / maxval ); out->offset = in->offset; /* Set the scale to match the adjustment to max.