Fix non-OpenMP build warnings

This commit is contained in:
Flössie 2020-06-18 14:32:45 +02:00
parent 5d4d637cf5
commit c607b58b18
6 changed files with 48 additions and 14 deletions

View File

@ -604,13 +604,17 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid
array2D<float> residbuff(srcwidth, srcheight);
array2D<float> resid5(srcwidth, srcheight);
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < srcheight; i++)
for (int j = 0; j < srcwidth; j++) {
residbuff[i][j] = 0.f;
}
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < srcheight; i++)
for (int j = 0; j < srcwidth; j++) {
residbuff[i][j] = dirpyrlo[lastlevel - 1][i][j];
@ -622,7 +626,9 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid
if(contres != 0.f) {
int ng = 0;
#ifdef _OPENMP
#pragma omp parallel for reduction(+:avg, ng)
#endif
for (int i = 0; i < srcheight; i++) {
for (int j = 0; j < srcwidth; j++) {
avg += residbuff[i][j];
@ -643,7 +649,9 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid
});
if(contres != 0.f) {
#pragma omp parallel for
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < srcheight; i++)
for (int j = 0; j < srcwidth; j++) {
float buf = LIM01(residbuff[i][j] / 32768.f);
@ -664,11 +672,14 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
array2D<float> loct(srcwidth, srcheight);
#ifdef _OPENMP
#pragma omp parallel for
for (int i = 0; i < srcheight; i++)
for (int j = 0; j < srcwidth; j++) {
loct[i][j] = LIM(residbuff[i][j],0.f,32768.f); // TODO: Really a clip necessary?
}
#endif
for (int i = 0; i < srcheight; i++) {
for (int j = 0; j < srcwidth; j++) {
loct[i][j] = LIM(residbuff[i][j],0.f,32768.f); // TODO: Really a clip necessary?
}
}
float clar = 0.01f * mergeL;
@ -679,17 +690,23 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid
// printf("clar=%f \n", clar);
*/
if(clar > 0.f) {
#pragma omp parallel for
for (int i = 0; i < srcheight; i++)
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < srcheight; i++) {
for (int j = 0; j < srcwidth; j++) {
loctemp[i][j] = LIM((1.f + clar) * loct[i][j] - clar * resid5[i][j],0.f,32768.f);
}
}
}
} else {
#pragma omp parallel for
for (int i = 0; i < srcheight; i++)
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < srcheight; i++) {
for (int j = 0; j < srcwidth; j++) {
loctemp[i][j] = LIM(loct[i][j],0.f,32768.f);
}
}
}
}

View File

@ -394,7 +394,9 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue
int miny = height - 1;
int maxy = 0;
#ifdef _OPENMP
#pragma omp parallel for reduction(min:minx,miny) reduction(max:maxx,maxy) schedule(dynamic, 16)
#endif
for (int i = 0; i < height; ++i) {
for (int j = 0; j< width; ++j) {
if (red[i][j] >= max_f[0] || green[i][j] >= max_f[1] || blue[i][j] >= max_f[2]) {

View File

@ -5194,8 +5194,9 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns
maxL = 1.f;
}
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (i = 0; i < N; i++)
{
L[i] = (L[i] - minL) / maxL;

View File

@ -2098,7 +2098,9 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab)
#ifdef __SSE2__
int bufferLength = ((width + 3) / 4) * 4; // bufferLength has to be a multiple of 4
#endif
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
{
#ifdef __SSE2__
// one line buffer per channel and thread
@ -2109,7 +2111,9 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab)
float Mbuffer[bufferLength] ALIGNED16;
float sbuffer[bufferLength] ALIGNED16;
#endif
#ifdef _OPENMP
#pragma omp for schedule(dynamic, 16)
#endif
for (int i = 0; i < height; i++) {
#ifdef __SSE2__
// vectorized conversion from Lab to jchqms
@ -2943,6 +2947,8 @@ static void mean_fab(int xstart, int ystart, int bfw, int bfh, LabImage* bufexpo
#ifdef _OPENMP
#pragma omp parallel for reduction(+:sumab) if(multiThread)
#else
static_cast<void>(multiThread);
#endif
for (int y = 0; y < bfh; y++) {
for (int x = 0; x < bfw; x++) {
@ -7010,7 +7016,9 @@ void ImProcFunctions::wavcont(const struct local_params& lp, float ** tmp, wavel
if (loclevwavCurve && loclevwavutili) {
float klev = 0.25f * (loclevwavCurve[level * 55.5f]);
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
{
gaussianBlur(templevel[dir - 1][level], templevel[dir - 1][level], W_L, H_L, radlevblur * klev * chromablu);
}
@ -12152,7 +12160,9 @@ void ImProcFunctions::Lab_Local(
}
}
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
{
gaussianBlur(bufa, bufa, W_La, H_La, radblur);
}

View File

@ -81,15 +81,17 @@ void calcGammaLut(double gamma, double ts, LUTf &gammaLut)
const double mul = 1.0 + g_a[4];
if (gamm2 < 1.) {
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 1024)
#endif
for (int i = 0; i < 65536; i++) {
const double x = rtengine::Color::igammareti(i / 65535.0, gamm, start, ts, mul, add);
gammaLut[i] = 0.5 * rtengine::CLIP(x * 65535.0); // CLIP avoid in some case extra values
}
} else {
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 1024)
#endif
for (int i = 0; i < 65536; i++) {
const double x = rtengine::Color::gammareti(i / 65535.0, gamm, start, ts, mul, add);
gammaLut[i] = 0.5 * rtengine::CLIP(x * 65535.0); // CLIP avoid in some case extra values

View File

@ -45,7 +45,9 @@ void RawImageSource::cielab (const float (*rgb)[3], float* l, float* a, float *b
if (!rgb) {
static bool cbrtinit = false;
if(!cbrtinit) {
#pragma omp parallel for
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < 0x14000; i++) {
double r = i / 65535.0;
cbrt[i] = r > Color::eps ? std::cbrt(r) : (Color::kappa * r + 16.0) / 116.0;