some tinkering
still not very quick
This commit is contained in:
parent
4b2349323c
commit
3bb24f2567
27
TODO
27
TODO
@ -1,5 +1,3 @@
|
|||||||
- look for FCLIP / FABS use ... VIPS_ABS() on float type
|
|
||||||
|
|
||||||
- write a shrinker that does two 1D shrinks, vertical and horizontal, with
|
- write a shrinker that does two 1D shrinks, vertical and horizontal, with
|
||||||
bicubic interpolation
|
bicubic interpolation
|
||||||
|
|
||||||
@ -7,6 +5,31 @@
|
|||||||
|
|
||||||
vips_resize() can use this, for the default path at least
|
vips_resize() can use this, for the default path at least
|
||||||
|
|
||||||
|
try with affine vs. reduce in vips_resize ... on the laptop we see
|
||||||
|
|
||||||
|
affine
|
||||||
|
$ time vipsthumbnail wtc.tif -o x.tif -s 7000
|
||||||
|
real 0m2.325s
|
||||||
|
user 0m8.316s
|
||||||
|
sys 0m0.256s
|
||||||
|
|
||||||
|
reduce
|
||||||
|
$ time vipsthumbnail wtc.tif -o x.tif -s 7000
|
||||||
|
real 0m2.388s
|
||||||
|
user 0m8.544s
|
||||||
|
sys 0m0.244s
|
||||||
|
|
||||||
|
argh
|
||||||
|
|
||||||
|
reducev could be faster with the interpolator inlined ... we could pick a
|
||||||
|
set of masks and just run them along a set of input lines to make an output
|
||||||
|
line
|
||||||
|
|
||||||
|
reduceh ... not so clear, need to pick new masks every output pixel, might
|
||||||
|
not make much difference
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- get some brightly coloured spots with nohalo / vsqbs on wobble.ws ... very
|
- get some brightly coloured spots with nohalo / vsqbs on wobble.ws ... very
|
||||||
odd, the interpolation shouldn't change between bands
|
odd, the interpolation shouldn't change between bands
|
||||||
|
|
||||||
|
@ -75,6 +75,32 @@ vips_reduce_build( VipsObject *object )
|
|||||||
if( VIPS_OBJECT_CLASS( vips_reduce_parent_class )->build( object ) )
|
if( VIPS_OBJECT_CLASS( vips_reduce_parent_class )->build( object ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
|
/*
|
||||||
|
if( vips_reduceh( resample->in, &t[0], reduce->xshrink,
|
||||||
|
"interpolate", reduce->interpolateh, NULL ) ||
|
||||||
|
vips_linecache( t[0], &t[1],
|
||||||
|
"tile_height", 4,
|
||||||
|
NULL ) ||
|
||||||
|
vips_reducev( t[1], &t[2], reduce->yshrink,
|
||||||
|
"interpolate", reduce->interpolatev, NULL ) ||
|
||||||
|
vips_image_write( t[2], resample->out ) )
|
||||||
|
return( -1 );
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
if( vips_reducev( resample->in, &t[0], reduce->yshrink,
|
||||||
|
"interpolate", reduce->interpolatev,
|
||||||
|
NULL ) ||
|
||||||
|
vips_linecache( t[0], &t[1],
|
||||||
|
"tile_height", 4,
|
||||||
|
NULL ) ||
|
||||||
|
vips_reduceh( t[1], &t[2], reduce->xshrink,
|
||||||
|
"interpolate", reduce->interpolateh,
|
||||||
|
NULL ) ||
|
||||||
|
vips_image_write( t[2], resample->out ) )
|
||||||
|
return( -1 );
|
||||||
|
*/
|
||||||
|
|
||||||
if( vips_reducev( resample->in, &t[0], reduce->yshrink,
|
if( vips_reducev( resample->in, &t[0], reduce->yshrink,
|
||||||
"interpolate", reduce->interpolatev, NULL ) ||
|
"interpolate", reduce->interpolatev, NULL ) ||
|
||||||
vips_reduceh( t[0], &t[1], reduce->xshrink,
|
vips_reduceh( t[0], &t[1], reduce->xshrink,
|
||||||
|
@ -184,10 +184,6 @@ vips_reduceh_build( VipsObject *object )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
in = t[1];
|
in = t[1];
|
||||||
|
|
||||||
/* THINSTRIP will work, anything else will break seq mode. If you
|
|
||||||
* combine reduce with conv you'll need to use a line cache to maintain
|
|
||||||
* sequentiality.
|
|
||||||
*/
|
|
||||||
if( vips_image_pipelinev( resample->out,
|
if( vips_image_pipelinev( resample->out,
|
||||||
VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) )
|
VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
@ -184,12 +184,8 @@ vips_reducev_build( VipsObject *object )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
in = t[1];
|
in = t[1];
|
||||||
|
|
||||||
/* THINSTRIP will work, anything else will break seq mode. If you
|
|
||||||
* combine reduce with conv you'll need to use a line cache to maintain
|
|
||||||
* sequentiality.
|
|
||||||
*/
|
|
||||||
if( vips_image_pipelinev( resample->out,
|
if( vips_image_pipelinev( resample->out,
|
||||||
VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) )
|
VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
/* Size output. Note: we round the output width down!
|
/* Size output. Note: we round the output width down!
|
||||||
|
@ -230,12 +230,18 @@ vips_resize_build( VipsObject *object )
|
|||||||
vips_info( class->nickname, "%s interpolation", nickname );
|
vips_info( class->nickname, "%s interpolation", nickname );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if( vips_affine( in, &t[3], hresidual, 0, 0, vresidual,
|
if( vips_affine( in, &t[3], hresidual, 0, 0, vresidual,
|
||||||
"interpolate", resize->interpolate,
|
"interpolate", resize->interpolate,
|
||||||
"idx", resize->idx,
|
"idx", resize->idx,
|
||||||
"idy", resize->idy,
|
"idy", resize->idy,
|
||||||
NULL ) )
|
NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
*/
|
||||||
|
|
||||||
|
if( vips_reduce( in, &t[3], 1.0 / hresidual, 1.0 / vresidual, NULL ) )
|
||||||
|
return( -1 );
|
||||||
|
|
||||||
in = t[3];
|
in = t[3];
|
||||||
|
|
||||||
/* If we are upsampling, don't sharpen. Also don't sharpen if we
|
/* If we are upsampling, don't sharpen. Also don't sharpen if we
|
||||||
|
Loading…
Reference in New Issue
Block a user