stuff
This commit is contained in:
parent
5d278b725f
commit
7f40537fea
@ -13,6 +13,10 @@
|
|||||||
- performance improvements for morphology ops, esp. when zooming out
|
- performance improvements for morphology ops, esp. when zooming out
|
||||||
- oop, im_render() was broken for mask == NULL
|
- oop, im_render() was broken for mask == NULL
|
||||||
- better support for multiple Python installs (thanks Jay)
|
- better support for multiple Python installs (thanks Jay)
|
||||||
|
- better IM_SETSTR() stops some warnings
|
||||||
|
- im_histcum() works for signed histograms
|
||||||
|
- better rounding for im_conv(), im_convsep()
|
||||||
|
- tiny speedup for im_conv()
|
||||||
|
|
||||||
25/1/08 started 7.14.0
|
25/1/08 started 7.14.0
|
||||||
- bump all version numbers for new stable
|
- bump all version numbers for new stable
|
||||||
|
7
TODO
7
TODO
@ -1,3 +1,10 @@
|
|||||||
|
- try
|
||||||
|
|
||||||
|
libsrc/convolution$ grep -l offsets *.c
|
||||||
|
|
||||||
|
could we do the don't calc offsets thing unless bpl; changes thing in more
|
||||||
|
places?
|
||||||
|
|
||||||
- should check for gettext in configure? see
|
- should check for gettext in configure? see
|
||||||
|
|
||||||
https://sourceforge.net/tracker/index.php?func=detail&aid=1836080&group_id=100050&atid=626186
|
https://sourceforge.net/tracker/index.php?func=detail&aid=1836080&group_id=100050&atid=626186
|
||||||
|
@ -27,7 +27,7 @@ echo " by" `header -f Ysize temp.v` "pixels"
|
|||||||
echo "starting benchmark ..."
|
echo "starting benchmark ..."
|
||||||
echo "chain=$chain"
|
echo "chain=$chain"
|
||||||
|
|
||||||
for cpus in 1 2 3 ; do
|
for cpus in 1 2 ; do
|
||||||
export IM_CONCURRENCY=$cpus
|
export IM_CONCURRENCY=$cpus
|
||||||
|
|
||||||
echo IM_CONCURRENCY=$IM_CONCURRENCY
|
echo IM_CONCURRENCY=$IM_CONCURRENCY
|
||||||
|
@ -161,10 +161,10 @@ extern "C" {
|
|||||||
} while( 0 )
|
} while( 0 )
|
||||||
#define IM_FREE( A ) IM_FREEF( im_free, A )
|
#define IM_FREE( A ) IM_FREEF( im_free, A )
|
||||||
#define IM_SETSTR( S, V ) do { \
|
#define IM_SETSTR( S, V ) do { \
|
||||||
if( (S) != (V) ) { \
|
const char *sst = (V); \
|
||||||
if( !(S) || !(V) || strcmp( (S), (V) ) != 0 ) { \
|
\
|
||||||
const char *sst = (V); \
|
if( (S) != sst ) { \
|
||||||
\
|
if( !(S) || !sst || strcmp( (S), sst ) != 0 ) { \
|
||||||
IM_FREE( S ); \
|
IM_FREE( S ); \
|
||||||
if( sst ) \
|
if( sst ) \
|
||||||
(S) = im_strdup( NULL, sst ); \
|
(S) = im_strdup( NULL, sst ); \
|
||||||
|
@ -61,6 +61,9 @@
|
|||||||
* - simpler inner loop avoids gcc4 bug
|
* - simpler inner loop avoids gcc4 bug
|
||||||
* 7/11/07
|
* 7/11/07
|
||||||
* - new evalstart/end callbacks
|
* - new evalstart/end callbacks
|
||||||
|
* 12/5/08
|
||||||
|
* - int rounding was +1 too much, argh
|
||||||
|
* - only rebuild the buffer offsets if bpl changes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -200,6 +203,8 @@ typedef struct {
|
|||||||
|
|
||||||
int underflow; /* Underflow/overflow counts */
|
int underflow; /* Underflow/overflow counts */
|
||||||
int overflow;
|
int overflow;
|
||||||
|
|
||||||
|
int last_bpl; /* Avoid recalcing offsets, if we can */
|
||||||
} ConvSequence;
|
} ConvSequence;
|
||||||
|
|
||||||
/* Free a sequence value.
|
/* Free a sequence value.
|
||||||
@ -239,6 +244,7 @@ conv_start( IMAGE *out, void *a, void *b )
|
|||||||
seq->pts = NULL;
|
seq->pts = NULL;
|
||||||
seq->underflow = 0;
|
seq->underflow = 0;
|
||||||
seq->overflow = 0;
|
seq->overflow = 0;
|
||||||
|
seq->last_bpl = -1;
|
||||||
|
|
||||||
/* Attach region and arrays.
|
/* Attach region and arrays.
|
||||||
*/
|
*/
|
||||||
@ -303,7 +309,11 @@ conv_gen( REGION *or, void *vseq, void *a, void *b )
|
|||||||
Conv *conv = (Conv *) b;
|
Conv *conv = (Conv *) b;
|
||||||
REGION *ir = seq->ir;
|
REGION *ir = seq->ir;
|
||||||
INTMASK *mask = conv->mask;
|
INTMASK *mask = conv->mask;
|
||||||
int rounding = (mask->scale + 1)/2;
|
|
||||||
|
/* You might think this should be (scale+1)/2, but then we'd be adding
|
||||||
|
* one for scale == 1.
|
||||||
|
*/
|
||||||
|
int rounding = mask->scale / 2;
|
||||||
|
|
||||||
Rect *r = &or->valid;
|
Rect *r = &or->valid;
|
||||||
Rect s;
|
Rect s;
|
||||||
@ -323,15 +333,21 @@ conv_gen( REGION *or, void *vseq, void *a, void *b )
|
|||||||
if( im_prepare( ir, &s ) )
|
if( im_prepare( ir, &s ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
/* Fill offset array.
|
/* Fill offset array. Only do this if the bpl has changed since the
|
||||||
*/
|
* previous im_prepare().
|
||||||
z = 0;
|
*/
|
||||||
for( i = 0, y = 0; y < mask->ysize; y++ )
|
if( seq->last_bpl != IM_REGION_LSKIP( ir ) ) {
|
||||||
for( x = 0; x < mask->xsize; x++, i++ )
|
seq->last_bpl = IM_REGION_LSKIP( ir );
|
||||||
if( mask->coeff[i] )
|
|
||||||
seq->offsets[z++] =
|
z = 0;
|
||||||
IM_REGION_ADDR( ir, x + le, y + to ) -
|
for( i = 0, y = 0; y < mask->ysize; y++ )
|
||||||
IM_REGION_ADDR( ir, le, to );
|
for( x = 0; x < mask->xsize; x++, i++ )
|
||||||
|
if( mask->coeff[i] )
|
||||||
|
seq->offsets[z++] =
|
||||||
|
IM_REGION_ADDR( ir,
|
||||||
|
x + le, y + to ) -
|
||||||
|
IM_REGION_ADDR( ir, le, to );
|
||||||
|
}
|
||||||
|
|
||||||
for( y = to; y < bo; y++ ) {
|
for( y = to; y < bo; y++ ) {
|
||||||
/* Init pts for this line of PELs.
|
/* Init pts for this line of PELs.
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
* 21/4/04
|
* 21/4/04
|
||||||
* - scale down int convolves at 1/2 way mark, much less likely to integer
|
* - scale down int convolves at 1/2 way mark, much less likely to integer
|
||||||
* overflow on intermediates
|
* overflow on intermediates
|
||||||
|
* 12/5/08
|
||||||
|
* - int rounding was +1 too much, argh
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -304,7 +306,12 @@ conv_gen( REGION *or, void *vseq, void *a, void *b )
|
|||||||
Conv *conv = (Conv *) b;
|
Conv *conv = (Conv *) b;
|
||||||
REGION *ir = seq->ir;
|
REGION *ir = seq->ir;
|
||||||
INTMASK *mask = conv->mask;
|
INTMASK *mask = conv->mask;
|
||||||
int rounding = (mask->scale + 1)/2;
|
|
||||||
|
/* You might think this should be (scale+1)/2, but then we'd be adding
|
||||||
|
* one for scale == 1.
|
||||||
|
*/
|
||||||
|
int rounding = mask->scale / 2;
|
||||||
|
|
||||||
int bands = in->Bands;
|
int bands = in->Bands;
|
||||||
int *coeff = conv->mask->coeff;
|
int *coeff = conv->mask->coeff;
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
* - neater im_histnorm()
|
* - neater im_histnorm()
|
||||||
* 23/7/07
|
* 23/7/07
|
||||||
* - eek, off by 1 for more than 1 band hists
|
* - eek, off by 1 for more than 1 band hists
|
||||||
|
* 12/5/08
|
||||||
|
* - histcum works for signed hists now as well
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -104,14 +106,14 @@ im_histcum( IMAGE *in, IMAGE *out )
|
|||||||
if( im_incheck( in ) )
|
if( im_incheck( in ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
/* int types -> uint, float/double stay as they are.
|
|
||||||
*/
|
|
||||||
if( im_cp_desc( out, in ) )
|
if( im_cp_desc( out, in ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
out->Xsize = px;
|
out->Xsize = px;
|
||||||
out->Ysize = 1;
|
out->Ysize = 1;
|
||||||
if( im_isint( in ) )
|
if( im_isuint( in ) )
|
||||||
out->BandFmt = IM_BANDFMT_UINT;
|
out->BandFmt = IM_BANDFMT_UINT;
|
||||||
|
else if( im_isint( in ) )
|
||||||
|
out->BandFmt = IM_BANDFMT_INT;
|
||||||
out->Bbits = im_bits_of_fmt( out->BandFmt );
|
out->Bbits = im_bits_of_fmt( out->BandFmt );
|
||||||
|
|
||||||
if( !(outbuf = im_malloc( out, IM_IMAGE_SIZEOF_LINE( out ))) )
|
if( !(outbuf = im_malloc( out, IM_IMAGE_SIZEOF_LINE( out ))) )
|
||||||
@ -119,15 +121,15 @@ im_histcum( IMAGE *in, IMAGE *out )
|
|||||||
|
|
||||||
switch( in->BandFmt ) {
|
switch( in->BandFmt ) {
|
||||||
case IM_BANDFMT_CHAR:
|
case IM_BANDFMT_CHAR:
|
||||||
ACCUMULATE( signed char, unsigned int ); break;
|
ACCUMULATE( signed char, signed int ); break;
|
||||||
case IM_BANDFMT_UCHAR:
|
case IM_BANDFMT_UCHAR:
|
||||||
ACCUMULATE( unsigned char, unsigned int ); break;
|
ACCUMULATE( unsigned char, unsigned int ); break;
|
||||||
case IM_BANDFMT_SHORT:
|
case IM_BANDFMT_SHORT:
|
||||||
ACCUMULATE( signed short, unsigned int ); break;
|
ACCUMULATE( signed short, signed int ); break;
|
||||||
case IM_BANDFMT_USHORT:
|
case IM_BANDFMT_USHORT:
|
||||||
ACCUMULATE( unsigned short, unsigned int ); break;
|
ACCUMULATE( unsigned short, unsigned int ); break;
|
||||||
case IM_BANDFMT_INT:
|
case IM_BANDFMT_INT:
|
||||||
ACCUMULATE( signed int, unsigned int ); break;
|
ACCUMULATE( signed int, signed int ); break;
|
||||||
case IM_BANDFMT_UINT:
|
case IM_BANDFMT_UINT:
|
||||||
ACCUMULATE( unsigned int, unsigned int ); break;
|
ACCUMULATE( unsigned int, unsigned int ); break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user