From b341a56f421365c66e5cbca3e9e231acdd7768a4 Mon Sep 17 00:00:00 2001 From: Ingo Date: Sun, 20 Oct 2013 14:47:01 +0200 Subject: [PATCH] Optimization for ImProcFunctions::chromiLuminanceCurve, Issue 2006 --- rtengine/improcfun.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index bbf10b746..af105c69e 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -41,7 +41,6 @@ #include "rt_math.h" #include "EdgePreservingDecomposition.h" #include "improccoordinator.h" - #ifdef _OPENMP #include #endif @@ -2422,7 +2421,6 @@ void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & cur void ImProcFunctions::chromiLuminanceCurve (int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve,LUTf & lhskcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, LUTu &histCCurve) { - int W = lold->W; int H = lold->H; // lhskcurve.dump("lh_curve"); @@ -2441,11 +2439,12 @@ void ImProcFunctions::chromiLuminanceCurve (int pW, LabImage* lold, LabImage* ln float val; //preparate for histograms CIECAM if(pW!=1){//only with improccoordinator - for (int i=0; i<48000; i++) { //# 32768*1.414 approximation maxi for chroma - val = (double)i / 47999.0; - dCcurve[i] = CLIPD(val); - } - hist16Clad.clear(); + chrop = true; + for (int i=0; i<48000; i++) { //# 32768*1.414 approximation maxi for chroma + val = (double)i / 47999.0; + dCcurve[i] = CLIPD(val); + } + hist16Clad.clear(); } #ifdef _DEBUG MyTime t1e,t2e, t3e, t4e; @@ -2464,7 +2463,10 @@ void ImProcFunctions::chromiLuminanceCurve (int pW, LabImage* lold, LabImage* ln float adjustr=1.0f, adjustbg=1.0f; // if(params->labCurve.avoidclip ){ - for (unsigned int j=0; j!=N; j++){ +#ifdef _OPENMP +#pragma omp parallel for if (multiThread) +#endif // _OPENMP + for (unsigned int j=0; j