diff --git a/rtengine/color.cc b/rtengine/color.cc index 4e180690e..c5874d110 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -38,7 +38,9 @@ LUTf Color::gamma2curve; LUTf Color::gammatab; LUTuc Color::gammatabThumb; LUTf Color::igammatab_srgb; +LUTf Color::igammatab_srgb1; LUTf Color::gammatab_srgb; +LUTf Color::gammatab_srgb1; // LUTf Color::igammatab_709; // LUTf Color::gammatab_709; LUTf Color::igammatab_55; @@ -143,7 +145,9 @@ void Color::init () gammatabThumb(maxindex, 0); igammatab_srgb(maxindex, 0); + igammatab_srgb1(maxindex, 0); gammatab_srgb(maxindex, 0); + gammatab_srgb1(maxindex, 0); igammatab_55(maxindex, 0); gammatab_55(maxindex, 0); igammatab_4(maxindex, 0); @@ -187,19 +191,20 @@ void Color::init () { for (int i = 0; i < maxindex; i++) { - gammatab_srgb[i] = 65535.0 * gamma2(i / 65535.0); + gammatab_srgb[i] = gammatab_srgb1[i] = gamma2(i / 65535.0); } - + gammatab_srgb *= 65535.f; gamma2curve.share(gammatab_srgb, LUT_CLIP_BELOW | LUT_CLIP_ABOVE); // shares the buffer with gammatab_srgb but has different clip flags } #ifdef _OPENMP #pragma omp section #endif - +{ for (int i = 0; i < maxindex; i++) { - igammatab_srgb[i] = 65535.0 * igamma2 (i / 65535.0); + igammatab_srgb[i] = igammatab_srgb1[i] = igamma2 (i / 65535.0); } - + igammatab_srgb *= 65535.f; +} #ifdef _OPENMP #pragma omp section #endif diff --git a/rtengine/color.h b/rtengine/color.h index be7740e2a..31c361c86 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -129,7 +129,9 @@ public: // look-up tables for the standard srgb gamma and its inverse (filled by init()) static LUTf igammatab_srgb; + static LUTf igammatab_srgb1; static LUTf gammatab_srgb; + static LUTf gammatab_srgb1; static LUTf igammatab_55; static LUTf gammatab_55; static LUTf igammatab_4; diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 775428a4e..a42c80bf6 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -25,6 +25,8 @@ #include "rawimagesource.h" #include "improcfun.h" #include "rt_math.h" +#define BENCHMARK +#include "StopWatch.h" using namespace rtengine; using namespace rtexif; @@ -1022,6 +1024,7 @@ void DCPProfile::apply( bool apply_look_table ) const { + BENCHFUN const TMatrix work_matrix = iccStore->workingSpaceInverseMatrix(working_space); Matrix xyz_cam; // Camera RGB to XYZ D50 matrix @@ -1715,7 +1718,7 @@ void DCPProfile::hsdApply(const HsdTableInfo& table_info, const std::vector