From 8441ff8fddb66450a616a66bdfb52b62ae6a76c3 Mon Sep 17 00:00:00 2001 From: Ingo Date: Sun, 13 Oct 2013 22:57:33 +0200 Subject: [PATCH] Optimization for ImProcFunctions::firstAnalysis in Filebrowser mode, Issue 1997 --- rtengine/improcfun.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index bdf358214..bbf10b746 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -192,14 +192,12 @@ void ImProcFunctions::firstAnalysis (Imagefloat* original, const ProcParams* par lcmsMutex->unlock (); } - //chroma_scale = 1; - // calculate histogram of the y channel needed for contrast curve calculation in exposure adjustments + int T = 1; #ifdef _OPENMP - int T = omp_get_max_threads(); -#else - int T = 1; + if(multiThread) + T = omp_get_max_threads(); #endif unsigned int** hist = new unsigned int* [T]; @@ -211,7 +209,7 @@ void ImProcFunctions::firstAnalysis (Imagefloat* original, const ProcParams* par #ifdef _OPENMP #pragma omp parallel if (multiThread) { - int H = original->height; + int H = original->height; int tid = omp_get_thread_num(); int nthreads = omp_get_num_threads(); int blk = H/nthreads; @@ -226,14 +224,13 @@ void ImProcFunctions::firstAnalysis (Imagefloat* original, const ProcParams* par #endif histogram.clear(); - for (int i=0; i<65536; i++) - for (int j=0; j