MSRLocal(): Fix a race
This commit is contained in:
@@ -1384,20 +1384,18 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
|
|||||||
}
|
}
|
||||||
|
|
||||||
double avg = 0.f;
|
double avg = 0.f;
|
||||||
int ng = 0;
|
|
||||||
|
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for reduction(+:avg)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < H_L; i++) {
|
for (int i = 0; i < H_L; i++) {
|
||||||
for (int j = 0; j < W_L; j++) {
|
for (int j = 0; j < W_L; j++) {
|
||||||
avg += luminance[i][j];
|
avg += luminance[i][j];
|
||||||
ng++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
avg /= ng;
|
avg /= H_L * W_L;
|
||||||
avg /= 32768.f;
|
avg /= 32768.f;
|
||||||
avg = LIM01(avg);
|
avg = LIM01(avg);
|
||||||
float contreal = 0.5f * vart;
|
float contreal = 0.5f * vart;
|
||||||
|
Reference in New Issue
Block a user