From 7c1d0a7bfba52ad078a0c383095a25cdba406d9d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 14 Mar 2010 20:12:41 +0000 Subject: [PATCH] scale output buffers with nthr for smalltile --- ChangeLog | 2 ++ TODO | 6 ++++++ libvips/iofuncs/region.c | 3 +-- libvips/iofuncs/threadgroup.c | 8 +++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a1b4d11..0ea4c39d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,8 @@ - set VIPS_ICC_DIR in configure - ICC profiles are looked for in VIPS_ICC_DIR as a fallback - im_render() mask image generation no longer triggers image calc +- threadgroups scale output buffers with number of threads for smalltile ... + improves SMP scaling for narrow images on many-way machines 15/1/10 started 7.21.1 - added "written" callbacks, used to implement write to non-vips formats diff --git a/TODO b/TODO index 0f94d31e..77a573c7 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,9 @@ +- try + + vips im_rot90 babe.jpg test2.v + + wtf, thinstrip output o.O + - doing im_create_fmask() and friends - how about im_invalidate_area()? we currently repaint the whole window on diff --git a/libvips/iofuncs/region.c b/libvips/iofuncs/region.c index 2bc17633..4a69aa11 100644 --- a/libvips/iofuncs/region.c +++ b/libvips/iofuncs/region.c @@ -460,9 +460,8 @@ im_region_buffer( REGION *reg, Rect *r ) */ if( reg->invalid ) { im_region_reset( reg ); - if( !(reg->buffer = im_buffer_ref( im, &clipped )) ) + if( !(reg->buffer = im_buffer_new( im, &clipped )) ) return( -1 ); - im_buffer_undone( reg->buffer ); } else { /* Don't call im_region_reset() ... we combine buffer unref diff --git a/libvips/iofuncs/threadgroup.c b/libvips/iofuncs/threadgroup.c index f9da7068..5151bf17 100644 --- a/libvips/iofuncs/threadgroup.c +++ b/libvips/iofuncs/threadgroup.c @@ -15,6 +15,8 @@ * work function * 22/10/09 * - gtkdoc + * 14/3/10 + * - scale nlines with nthr for smalltile */ /* @@ -588,7 +590,11 @@ im_threadgroup_create( IMAGE *im ) case IM_SMALLTILE: tg->pw = im__tile_width; tg->ph = im__tile_height; - tg->nlines = tg->ph; + + /* Enough lines of tiles that we can expect to be able to keep + * nthr busy. + */ + tg->nlines = tg->ph * (1 + tg->nthr / (tg->im->Xsize / tg->pw)); break; case IM_FATSTRIP: