Colortoning lab regions: Disabled timing code and removed double declaration of c_factor, #4914
This commit is contained in:
parent
e199d1ea10
commit
64af0e7602
@ -24,11 +24,12 @@
|
||||
|
||||
#include "improcfun.h"
|
||||
#include "guidedfilter.h"
|
||||
#define BENCHMARK
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
#include "sleef.c"
|
||||
|
||||
namespace {
|
||||
|
||||
#ifdef __SSE2__
|
||||
void fastlin2log(float *x, float factor, float base, int w)
|
||||
{
|
||||
@ -46,6 +47,7 @@ void fastlin2log(float *x, float factor, float base, int w)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
namespace rtengine {
|
||||
@ -87,8 +89,12 @@ BENCHFUN
|
||||
abmask[i](lab->W, lab->H);
|
||||
Lmask[i](lab->W, lab->H);
|
||||
}
|
||||
|
||||
array2D<float> guide(lab->W, lab->H);
|
||||
|
||||
// magic constant c_factor: normally chromaticity is in [0; 42000] (see color.h), but here we use the constant to match how the chromaticity pipette works (see improcfun.cc lines 4705-4706 and color.cc line 1930
|
||||
constexpr float c_factor = 327.68f / 48000.f;
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel if (multiThread)
|
||||
#endif
|
||||
@ -96,8 +102,6 @@ BENCHFUN
|
||||
#ifdef __SSE2__
|
||||
float cBuffer[lab->W];
|
||||
float hBuffer[lab->W];
|
||||
// magic constant c_factor: normally chromaticity is in [0; 42000] (see color.h), but here we use the constant to match how the chromaticity pipette works (see improcfun.cc lines 4705-4706 and color.cc line 1930
|
||||
constexpr float c_factor = 327.68f / 48000.f;
|
||||
#endif
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for schedule(dynamic, 16)
|
||||
@ -109,15 +113,13 @@ BENCHFUN
|
||||
fastlin2log(cBuffer, c_factor, 10.f, lab->W);
|
||||
#endif
|
||||
for (int x = 0; x < lab->W; ++x) {
|
||||
float l = lab->L[y][x] / 32768.f;
|
||||
const float l = lab->L[y][x] / 32768.f;
|
||||
guide[y][x] = LIM01(l);
|
||||
#ifdef __SSE2__
|
||||
// use precalculated values
|
||||
float c = cBuffer[x];
|
||||
const float c = cBuffer[x];
|
||||
float h = hBuffer[x];
|
||||
#else
|
||||
// magic constant c_factor: normally chromaticity is in [0; 42000] (see color.h), but here we use the constant to match how the chromaticity pipette works (see improcfun.cc lines 4705-4706 and color.cc line 1930
|
||||
constexpr float c_factor = 327.68f / 48000.f;
|
||||
float c, h;
|
||||
Color::Lab2Lch(lab->a[y][x], lab->b[y][x], c, h);
|
||||
c = xlin2log(c * c_factor, 10.f);
|
||||
@ -176,7 +178,7 @@ BENCHFUN
|
||||
abca[i] = abcoord(r.a);
|
||||
abcb[i] = abcoord(r.b);
|
||||
rs[i] = 1.f + r.saturation / 100.f;
|
||||
rl[i] = 1.f + float(r.lightness) / 500.f;
|
||||
rl[i] = 1.f + r.lightness / 500.f;
|
||||
}
|
||||
|
||||
#ifdef _OPENMP
|
||||
|
Loading…
x
Reference in New Issue
Block a user