Cleanup and speedup for a loop in wavelet denoise

This commit is contained in:
Ingo Weyrich 2020-07-08 13:28:27 +02:00
parent d65e00b3df
commit f03a19ebf1

View File

@ -3380,32 +3380,26 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz,
} }
} }
if (!cp.link && cp.noiseena) { //used both with denoise 1 2 3 if (!cp.link && cp.noiseena) { //used both with denoise 1 2 3
float refine = 0.f; float refine = 0.f;
if (level == 0) {
refine = cp.lev0s / 40.f;
} else if (level == 1) {
refine = cp.lev1s / 40.f;
} else if (level == 2) {
refine = cp.lev2s / 40.f;
} else if (level == 3) {
refine = cp.lev3s / 40.f;
}
for (int i = 0; i < W_L * H_L; i++) { if (refine != 0.f) {
if (level == 0) { refine += 1.f;
refine = cp.lev0s / 40.f; for (int i = 0; i < W_L * H_L; i++) {
WavCoeffs_L[dir][i] *= refine;
} }
if (level == 1) {
refine = cp.lev1s / 40.f;
}
if (level == 2) {
refine = cp.lev2s / 40.f;
}
if (level == 3) {
refine = cp.lev3s / 40.f;
}
WavCoeffs_L[dir][i] *= (1.f + refine);
} }
} }
float cpMul = cp.mul[level]; float cpMul = cp.mul[level];
if (cpMul != 0.f && cp.contena) { // cpMul == 0.f means all will be multiplied by 1.f, so we can skip this if (cpMul != 0.f && cp.contena) { // cpMul == 0.f means all will be multiplied by 1.f, so we can skip this