diff --git a/rtengine/ipdehaz.cc b/rtengine/ipdehaz.cc index 5a5b5c112..4b5cc0996 100644 --- a/rtengine/ipdehaz.cc +++ b/rtengine/ipdehaz.cc @@ -83,18 +83,16 @@ void dehaze_scales( float* scales, int nscales, int mode, int s) void mean_stddv( float **dst, float &mean, float &stddv, int W_L, int H_L ) { - float vsquared; - - vsquared = 0.0f; - mean = 0.0f; -#pragma omp parallel for reduction(+:mean,vsquared) // this leads to differences, but parallel summation is more accurate + float vsquared = 0.f; + float sum = 0.f; +#pragma omp parallel for reduction(+:sum,vsquared) // this leads to differences, but parallel summation is more accurate for (int i = 0; i