*/
static inline void HatTransform(const float *magick_restrict pixels,
- const size_t stride,const size_t size,const size_t scale,double *kernel)
+ const size_t stride,const size_t size,const size_t scale,float *kernel)
{
const float
*restrict p = pixels,
*image_view,
*noise_view;
- double
- *kernel;
-
float
+ *kernel,
*pixels;
Image
ssize_t
channel;
- static const double
+ static const float
noise_levels[]= {
- 0.8002, 0.2735, 0.1202, 0.0585, 0.0291, 0.0152, 0.0080, 0.0044 };
+ 0.8002f, 0.2735f, 0.1202f, 0.0585f, 0.0291f, 0.0152f, 0.0080f, 0.0044f };
/*
Initialize noise image attributes.
double
magnitude;
+ register float
+ *p,
+ *q;
+
ssize_t
x,
y;
- low_pass=(size_t) (((level & 1)+1)*number_pixels);
+ low_pass=(size_t) (number_pixels*((level & 0x01)+1));
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,1) \
magick_threads(image,image,image->rows,1)
register ssize_t
x;
- HatTransform(pixels+y*image->columns+high_pass,1,image->columns,
- 1UL << level,kernel+id*image->columns);
+ p=kernel+id*image->columns;
+ q=pixels+y*image->columns;
+ HatTransform(q+high_pass,1,image->columns,1UL << level,p);
+ q+=low_pass;
for (x=0; x < (ssize_t) image->columns; x++)
- pixels[y*image->columns+x+low_pass]=kernel[id*image->columns+x];
+ *q++=(*p++);
}
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,1) \
register ssize_t
y;
- HatTransform(pixels+x+low_pass,image->columns,image->rows,1UL << level,
- kernel+id*image->rows);
+ p=kernel+id*image->rows;
+ q=pixels+x+low_pass;
+ HatTransform(q,image->columns,image->rows,1UL << level,p);
for (y=0; y < (ssize_t) image->rows; y++)
- pixels[y*image->columns+x+low_pass]=kernel[id*image->rows+y];
+ {
+ *q=(*p++);
+ q+=image->columns;
+ }
}
/*
To threshold, each coefficient is compared to a threshold value and