diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 2dae72793..940806419 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -474,59 +474,6 @@ void Imagefloat::calcCroppedHistogram(const ProcParams ¶ms, float scale, LUT } -// Parallelized transformation; create transform with cmsFLAGS_NOCACHE! -void Imagefloat::ExecCMSTransform2(cmsHTRANSFORM hTransform, bool normalizeIn) -{ - - // LittleCMS cannot parallelize planar setups -- Hombre: LCMS2.4 can! But it we use this new feature, memory allocation - // have to be modified too to build temporary buffers that allow multi processor execution -#ifdef _OPENMP - #pragma omp parallel -#endif - { - AlignedBuffer pBuf(width * 3); - -#ifdef _OPENMP - #pragma omp for schedule(dynamic, 16) -#endif - - for (int y = 0; y < height; y++) - { - float *p = pBuf.data, *pR = r(y), *pG = g(y), *pB = b(y); - - if (normalizeIn) { - for (int x = 0; x < width; x++) { - *(p++) = *(pR++)/ 65535.f; - *(p++) = *(pG++)/ 65535.f; - *(p++) = *(pB++)/ 65535.f; - } - } else { - for (int x = 0; x < width; x++) { - *(p++) = *(pR++); - *(p++) = *(pG++); - *(p++) = *(pB++); - } - } - - cmsDoTransform (hTransform, pBuf.data, pBuf.data, width); - - p = pBuf.data; - pR = r(y); - pG = g(y); - pB = b(y); - - for (int x = 0; x < width; x++) { - *(pR++) = *(p++); - *(pG++) = *(p++); - *(pB++) = *(p++); - } - } // End of parallelization - } -} - - - - // Parallelized transformation; create transform with cmsFLAGS_NOCACHE! void Imagefloat::ExecCMSTransform(cmsHTRANSFORM hTransform) { @@ -540,7 +487,7 @@ void Imagefloat::ExecCMSTransform(cmsHTRANSFORM hTransform) AlignedBuffer pBuf(width * 3); #ifdef _OPENMP - #pragma omp for schedule(static) + #pragma omp for schedule(dynamic, 16) #endif for (int y = 0; y < height; y++) diff --git a/rtengine/imagefloat.h b/rtengine/imagefloat.h index 921f86b59..e1e5086b8 100644 --- a/rtengine/imagefloat.h +++ b/rtengine/imagefloat.h @@ -222,8 +222,6 @@ public: void normalizeFloatTo1(); void normalizeFloatTo65535(); void calcCroppedHistogram(const ProcParams ¶ms, float scale, LUTu & hist); - void ExecCMSTransform2(cmsHTRANSFORM hTransform, bool normalizeIn = true); - void ExecCMSTransform(cmsHTRANSFORM hTransform); void ExecCMSTransform(cmsHTRANSFORM hTransform, const LabImage &labImage, int cx, int cy); }; diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 437144600..3240f06b1 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -644,7 +644,7 @@ void ImProcFunctions::workingtrc(Imagefloat* src, Imagefloat* dst, int cw, int c cmsHTRANSFORM hTransform = cmsCreateTransform(iprof, TYPE_RGB_FLT, oprofdef, TYPE_RGB_FLT, params->icm.outputIntent, flags); lcmsMutex->unlock(); - dst->ExecCMSTransform2(hTransform, false); + dst->ExecCMSTransform(hTransform); cmsDeleteTransform(hTransform); if (normalizeOut) {