Round sum values to the nearest integer in *_notab
This commit is contained in:
parent
49d8051e22
commit
fdc140e8e9
@ -281,8 +281,12 @@ reduceh_notab( VipsReduceh *reduceh,
|
||||
|
||||
vips_reduce_make_mask( cx, reduceh->kernel, reduceh->hshrink, x );
|
||||
|
||||
for( int z = 0; z < bands; z++ )
|
||||
out[z] = reduce_sum<T, double>( in + z, bands, cx, n );
|
||||
for( int z = 0; z < bands; z++ ) {
|
||||
double sum;
|
||||
sum = reduce_sum<T, double>( in + z, bands, cx, n );
|
||||
|
||||
out[z] = VIPS_ROUND_UINT( sum );
|
||||
}
|
||||
}
|
||||
|
||||
/* Tried a vector path (see reducev) but it was slower. The vectors for
|
||||
|
@ -511,8 +511,12 @@ reducev_notab( VipsReducev *reducev,
|
||||
|
||||
vips_reduce_make_mask( cy, reducev->kernel, reducev->vshrink, y );
|
||||
|
||||
for( int z = 0; z < ne; z++ )
|
||||
out[z] = reduce_sum<T, double>( in + z, l1, cy, n );
|
||||
for( int z = 0; z < ne; z++ ) {
|
||||
double sum;
|
||||
sum = reduce_sum<T, double>( in + z, l1, cy, n );
|
||||
|
||||
out[z] = VIPS_ROUND_UINT( sum );
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user