From 8f2ec7e224ddec2aaaea28a280c4cdf101b6b16f Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 7 May 2019 07:54:39 +0200 Subject: [PATCH] Another change CBDL - blur only luminance levels --- rtengine/dirpyr_equalizer.cc | 11 +++++++---- rtengine/iplocallab.cc | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index f81cfa754..e026a2820 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -852,8 +852,6 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data - AlignedBuffer blurbufcbdl(width * height); - float rad = 0.05f * blurcb * fabs((level + 1) * (multbis[level] - 1.f)); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -865,14 +863,19 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data } } - if(blurcb > 0.f) { + + if(blurcb > 0.f && choice == 0) { + AlignedBuffer blurbufcbdl(width * height); + float rad = 0.05f * blurcb * fabs((level + 1) * (multbis[level] - 1.f)); + #ifdef _OPENMP #pragma omp parallel if (multiThread) #endif boxblur(buffer, buffer, blurbufcbdl.data, rad, rad, width, height); + blurbufcbdl.resize(0); } + irangefn.clear(); - blurbufcbdl.resize(0); } void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[maxlevel], const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, float b_l, float t_l, float t_r) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 2f4eb4969..c34dce4d8 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -4973,7 +4973,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o constexpr float t_r = 120.f; constexpr float b_r = 170.f; constexpr double skinprot = 0.; - constexpr int choice = 0; + int choice = 0; if (lp.showmaskcbmet == 0 || lp.showmaskcbmet == 1 || lp.showmaskcbmet == 2 || lp.showmaskcbmet == 4 || lp.enacbMask) { #ifdef _OPENMP @@ -5050,7 +5050,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int lv = 0; lv < 6; lv++) { multc[lv] = rtengine::max((lp.chromacb * ((float) lp.mulloc[lv] - 1.f) / 100.f) + 1.f, 0.f); } - + choice = 1; ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, multc, rtengine::max(lp.chromacb, 1.f), lp.threshol, clarich, 0.f, lp.blurcbdl, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread);