slightly shorter nohalo1 and snohalo1

This commit is contained in:
Nicolas Robidoux 2009-03-27 01:26:06 +00:00
parent f07e517474
commit 47dec2610f
2 changed files with 32 additions and 38 deletions

View File

@ -422,27 +422,24 @@ nohalo1( const double uno_two,
* Compute the "diagonal" (at the boundary between thrr input * Compute the "diagonal" (at the boundary between thrr input
* pixel areas) double resolution pixel value: * pixel areas) double resolution pixel value:
*/ */
const double piece_of_eight_times_dostre_twothr =
four_times_dos_twothr
+
four_times_dostre_two
+
2. * deux_thr_plus_deux_dos;
const double eight_times_dostre_twothr = const double eight_times_dostre_twothr =
FAST_MINMOD( deux_tre, prem_tre, deux_prem_tre, FAST_MINMOD( deux_tre, prem_tre, deux_prem_tre,
deux_prem_minus_deux_deux_tre ) deux_prem_minus_deux_deux_tre )
+
2. * deux_thr_plus_deux_dos
- -
FAST_MINMOD( deux_tre, troi_tre, deux_troi_tre, FAST_MINMOD( deux_tre, troi_tre, deux_troi_tre,
deux_troi_minus_deux_deux_tre ) deux_troi_minus_deux_deux_tre )
+ +
four_times_dos_twothr
+
FAST_MINMOD( deux_thr, prem_thr, deux_prem_thr, FAST_MINMOD( deux_thr, prem_thr, deux_prem_thr,
deux_prem_minus_deux_deux_thr ) deux_prem_minus_deux_deux_thr )
+
four_times_dostre_two
- -
FAST_MINMOD( deux_thr, troi_thr, deux_troi_thr, FAST_MINMOD( deux_thr, troi_thr, deux_troi_thr,
deux_troi_minus_deux_deux_thr ) deux_troi_minus_deux_deux_thr );
+
piece_of_eight_times_dostre_twothr;
/* /*
* Return the first newly computed double density values: * Return the first newly computed double density values:
@ -588,10 +585,10 @@ vips_interpolate_nohalo1_interpolate( VipsInterpolate* restrict interpolate,
* position of the center of the convex hull of the 2x2 block of * position of the center of the convex hull of the 2x2 block of
* closest pixels. Similarly for y. Range of values: [-.5,.5). * closest pixels. Similarly for y. Range of values: [-.5,.5).
*/ */
const int iy = FAST_PSEUDO_FLOOR (absolute_y); const int iy = FAST_PSEUDO_FLOOR (absolute_y);
const double relative_y = absolute_y_minus_half - iy; const double relative_y = absolute_y_minus_half - iy;
const int ix = FAST_PSEUDO_FLOOR (absolute_x); const int ix = FAST_PSEUDO_FLOOR (absolute_x);
const double relative_x = absolute_x_minus_half - ix; const double relative_x = absolute_x_minus_half - ix;
/* /*
* Move the pointer to (the first band of) the top/left pixel of the * Move the pointer to (the first band of) the top/left pixel of the

View File

@ -305,11 +305,11 @@ snohalo1( const double blur,
const double four_times_dos_twothr = const double four_times_dos_twothr =
FAST_MINMOD( deux_dos, prem_dos, deux_prem_dos, FAST_MINMOD( deux_dos, prem_dos, deux_prem_dos,
deux_prem_minus_deux_deux_dos ) deux_prem_minus_deux_deux_dos )
+
2. * dos_two_plus_dos_thr
- -
FAST_MINMOD( deux_dos, troi_dos, deux_troi_dos, FAST_MINMOD( deux_dos, troi_dos, deux_troi_dos,
deux_troi_minus_deux_deux_dos ) deux_troi_minus_deux_deux_dos );
+
2. * dos_two_plus_dos_thr;
/* /*
* Compute the needed "down" double resolution pixel value: * Compute the needed "down" double resolution pixel value:
@ -317,37 +317,34 @@ snohalo1( const double blur,
const double four_times_dostre_two = const double four_times_dostre_two =
FAST_MINMOD( deux_two, prem_two, deux_prem_two, FAST_MINMOD( deux_two, prem_two, deux_prem_two,
deux_prem_minus_deux_deux_two ) deux_prem_minus_deux_deux_two )
+
2. * dos_two_plus_tre_two
- -
FAST_MINMOD( deux_two, troi_two, deux_troi_two, FAST_MINMOD( deux_two, troi_two, deux_troi_two,
deux_troi_minus_deux_deux_two ) deux_troi_minus_deux_deux_two );
+
2. * dos_two_plus_tre_two;
/* /*
* Compute the "diagonal" (at the boundary between thrr input * Compute the "diagonal" (at the boundary between thrr input
* pixel areas) double resolution pixel value: * pixel areas) double resolution pixel value:
*/ */
const double piece_of_eight_times_dostre_twothr =
four_times_dos_twothr
+
four_times_dostre_two
+
2. * deux_thr_plus_deux_dos;
const double eight_times_dostre_twothr = const double eight_times_dostre_twothr =
FAST_MINMOD( deux_tre, prem_tre, deux_prem_tre, FAST_MINMOD( deux_tre, prem_tre, deux_prem_tre,
deux_prem_minus_deux_deux_tre ) deux_prem_minus_deux_deux_tre )
+
2. * deux_thr_plus_deux_dos
- -
FAST_MINMOD( deux_tre, troi_tre, deux_troi_tre, FAST_MINMOD( deux_tre, troi_tre, deux_troi_tre,
deux_troi_minus_deux_deux_tre ) deux_troi_minus_deux_deux_tre )
+ +
four_times_dos_twothr
+
FAST_MINMOD( deux_thr, prem_thr, deux_prem_thr, FAST_MINMOD( deux_thr, prem_thr, deux_prem_thr,
deux_prem_minus_deux_deux_thr ) deux_prem_minus_deux_deux_thr )
+
four_times_dostre_two
- -
FAST_MINMOD( deux_thr, troi_thr, deux_troi_thr, FAST_MINMOD( deux_thr, troi_thr, deux_troi_thr,
deux_troi_minus_deux_deux_thr ) deux_troi_minus_deux_deux_thr );
+
piece_of_eight_times_dostre_twothr;
/* /*
* Return the first newly computed double density values: * Return the first newly computed double density values:
@ -524,9 +521,9 @@ vips_interpolate_snohalo1_interpolate( VipsInterpolate* restrict interpolate,
* position of the center of the convex hull of the 2x2 block of * position of the center of the convex hull of the 2x2 block of
* closest pixels. Similarly for y. Range of values: [-.5,.5). * closest pixels. Similarly for y. Range of values: [-.5,.5).
*/ */
const int iy = FAST_PSEUDO_FLOOR (absolute_y); const int iy = FAST_PSEUDO_FLOOR (absolute_y);
const double relative_y = absolute_y_minus_half - iy; const double relative_y = absolute_y_minus_half - iy;
const int ix = FAST_PSEUDO_FLOOR (absolute_x); const int ix = FAST_PSEUDO_FLOOR (absolute_x);
const double relative_x = absolute_x_minus_half - ix; const double relative_x = absolute_x_minus_half - ix;
/* /*
@ -544,12 +541,12 @@ vips_interpolate_snohalo1_interpolate( VipsInterpolate* restrict interpolate,
#define CALL( T, inter ) \ #define CALL( T, inter ) \
snohalo1_ ## inter<T>( out, \ snohalo1_ ## inter<T>( out, \
p, \ p, \
bands, \ bands, \
lskip, \ lskip, \
snohalo1->blur, \ snohalo1->blur, \
relative_x, \ relative_x, \
relative_y ); relative_y );
switch( in->im->BandFmt ) { switch( in->im->BandFmt ) {
case IM_BANDFMT_UCHAR: case IM_BANDFMT_UCHAR: