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,31 +3380,25 @@ 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;
for (int i = 0; i < W_L * H_L; i++) {
if (level == 0) { if (level == 0) {
refine = cp.lev0s / 40.f; refine = cp.lev0s / 40.f;
} } else if (level == 1) {
if (level == 1) {
refine = cp.lev1s / 40.f; refine = cp.lev1s / 40.f;
} } else if (level == 2) {
if (level == 2) {
refine = cp.lev2s / 40.f; refine = cp.lev2s / 40.f;
} } else if (level == 3) {
if (level == 3) {
refine = cp.lev3s / 40.f; refine = cp.lev3s / 40.f;
} }
WavCoeffs_L[dir][i] *= (1.f + refine); if (refine != 0.f) {
refine += 1.f;
for (int i = 0; i < W_L * H_L; i++) {
WavCoeffs_L[dir][i] *= refine;
}
} }
} }
float cpMul = cp.mul[level]; float cpMul = cp.mul[level];