diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 631f45a91..aec11e59b 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -41,6 +41,7 @@ #ifdef _OPENMP #include #endif +#include "StopWatch.h" #define TS 64 // Tile size #define offset 25 // shift between tiles @@ -475,6 +476,7 @@ enum nrquality {QUALITY_STANDARD, QUALITY_HIGH}; SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve, const NoiseCurve & noiseCCurve, float &nresi, float &highresi) { +BENCHFUN //#ifdef _DEBUG MyTime t1e, t2e; t1e.set(); @@ -1781,7 +1783,6 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef fftwf_destroy_plan(plan_backward_blox[0]); fftwf_destroy_plan(plan_forward_blox[1]); fftwf_destroy_plan(plan_backward_blox[1]); - fftwf_cleanup(); } } while (memoryAllocationFailed && numTries < 2 && (options.rgbDenoiseThreadLimit == 0) && !ponder); diff --git a/rtengine/init.cc b/rtengine/init.cc index 8d2cf9174..0d4560c6b 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include #include "../rtgui/profilestorecombobox.h" #include "rtengine.h" #include "iccstore.h" @@ -108,10 +109,15 @@ int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDi void cleanup () { - ProcParams::cleanup (); Color::cleanup (); RawImageSource::cleanup (); +#ifdef RT_FFTW3F_OMP + fftwf_cleanup_threads(); +#else + fftwf_cleanup(); +#endif + } StagedImageProcessor* StagedImageProcessor::create (InitialImage* initialImage) diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index c1cae20f6..c5e7c407f 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -907,18 +907,6 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/* for (int i = 0; i < width * height; i++) { (*U) (i) -= max; } - - // fft parallel threads cleanup, better handled outside this function? -#ifdef RT_FFTW3F_OMP - - if (multithread) { - fftwf_cleanup_threads(); - } - -#endif - - // ph.setValue(90); - //DEBUG_STR << "solve_pde_fft: done" << std::endl; }