From 59043cc978cb5cdf2d68637388e62eb151a9d083 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sun, 5 Nov 2017 16:25:13 +0100 Subject: [PATCH] Speedup for log-loop in tmo_fattal02 --- rtengine/tmo_fattal02.cc | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index f17371100..281ea702b 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -69,8 +69,10 @@ #include "improcfun.h" #include "settings.h" #include "iccstore.h" - - +#define BENCHMARK +#include "StopWatch.h" +#include "sleef.c" +#include "opthelper.h" namespace rtengine { /****************************************************************************** @@ -426,6 +428,7 @@ void tmo_fattal02(size_t width, int detail_level, bool multithread) { + BENCHFUN // #ifdef TIMER_PROFILING // msec_timer stop_watch; // stop_watch.start(); @@ -471,10 +474,35 @@ void tmo_fattal02(size_t width, } Array2Df* H = new Array2Df(width, height); //#pragma omp parallel for private(i) shared(H, Y, maxLum) - for ( int i=0 ; i get_lambda(int n) void solve_pde_fft(Array2Df *F, Array2Df *U, bool multithread)/*, pfs::Progress &ph, bool adjust_bound)*/ { +BENCHFUN // ph.setValue(20); //DEBUG_STR << "solve_pde_fft: solving Laplace U = F ..." << std::endl; int width = F->getCols(); @@ -1059,6 +1088,7 @@ void rescale_bilinear(const Array2Df &src, Array2Df &dst, bool multithread) void ImProcFunctions::ToneMapFattal02(Imagefloat *rgb) { + BENCHFUN const int detail_level = 3; float alpha = 1.f; @@ -1094,6 +1124,7 @@ void ImProcFunctions::ToneMapFattal02(Imagefloat *rgb) // median filter on the deep shadows, to avoid boosting noise { + StopWatch Stop1("Median"); const float luminance_noise_floor = 65.535f; // 0.1% -- is this ok? #ifdef _OPENMP