diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index d1e8540da..20f5b5e1b 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -137,7 +137,7 @@ void ImProcFunctions::Median_Denoise(float **src, float **dst, const int width, for (int j = 0; j < width; ++j) { medianOut[i][j] = medianIn[i][j]; } -} + } } #ifdef _OPENMP @@ -354,7 +354,7 @@ void ImProcFunctions::Median_Denoise(float **src, float **dst, const int width, for (int j = 0; j < width; ++j) { medianOut[i][j] = medianIn[i][j]; } -} + } } BufferIndex ^= 1; // swap buffers @@ -723,7 +723,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef dsttmp->g(i, j) = 0.f; dsttmp->b(i, j) = 0.f; } -} + } } //now we have tile dimensions, overlaps @@ -800,7 +800,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef LbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); fLbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); } -} + } TMatrix wiprof = iccStore->workingSpaceInverseMatrix (params->icm.working); //inverse matrix user select @@ -1193,7 +1193,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef if (!WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, noisevarab_r, useNoiseCCurve, autoch, denoiseMethodRgb)) { memoryAllocationFailed = true; } -} + } } } @@ -1230,7 +1230,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef if (!WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, noisevarab_b, useNoiseCCurve, autoch, denoiseMethodRgb)) { memoryAllocationFailed = true; } -} + } } } @@ -1266,7 +1266,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef if (!WaveletDenoiseAllL(*Ldecomp, noisevarlum, madL, nullptr, edge)) { memoryAllocationFailed = true; } -} + } } if (!memoryAllocationFailed) { @@ -1280,7 +1280,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef for (int j = 0; j < width; ++j) { (*Lin)[i][j] = labdn->L[i][j]; } -} + } Ldecomp->reconstruct(labdn->L[0]); } @@ -1396,7 +1396,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef LbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); fLbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); } -} + } #ifdef _RT_NESTED_OPENMP int masterThread = omp_get_thread_num(); @@ -1765,7 +1765,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef dst->g(i, j) = Color::gammatab_srgb[ dst->g(i, j) ]; dst->b(i, j) = Color::gammatab_srgb[ dst->b(i, j) ]; } -} + } } if (denoiseLuminance) { @@ -1836,7 +1836,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef for (int j = 1; j < wid - 1; ++j) { tm[i][j] = median(source->r(i, j), source->r(i - 1, j), source->r(i + 1, j), source->r(i, j + 1), source->r(i, j - 1), source->r(i - 1, j - 1), source->r(i - 1, j + 1), source->r(i + 1, j - 1), source->r(i + 1, j + 1)); //3x3 } -} + } } } else { #pragma omp for @@ -1867,7 +1867,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef source->r(i, j - 2) ); // 5x5 soft } -} + } } } #ifdef _OPENMP @@ -1894,7 +1894,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef for (int j = 1; j < wid - 1; ++j) { tm[i][j] = median(source->b(i, j), source->b(i - 1, j), source->b(i + 1, j), source->b(i, j + 1), source->b(i, j - 1), source->b(i - 1, j - 1), source->b(i - 1, j + 1), source->b(i + 1, j - 1), source->b(i + 1, j + 1)); } -} + } } } else { #pragma omp for @@ -1925,7 +1925,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef source->b(i, j - 2) ); // 5x5 soft } -} + } } } @@ -1954,7 +1954,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef for (int j = 1; j < wid - 1; ++j) { tm[i][j] = median(source->g(i, j), source->g(i - 1, j), source->g(i + 1, j), source->g(i, j + 1), source->g(i, j - 1), source->g(i - 1, j - 1), source->g(i - 1, j + 1), source->g(i + 1, j - 1), source->g(i + 1, j + 1)); } -} + } } } else { #pragma omp for @@ -1985,7 +1985,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef source->g(i, j - 2) ); // 5x5 soft } -} + } } } @@ -2090,7 +2090,7 @@ void ImProcFunctions::RGBoutput_tile_row (float *bloxrow_L, float ** Ldetail, fl } } -} + } } /* #undef TS @@ -2324,7 +2324,7 @@ SSEFUNCTION bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(wavelet_decomposit float mag_L = SQR(WavCoeffs_L[dir][coeffloc_L]); sfave[coeffloc_L] = mag_L / (mag_L + levelFactor * noisevarlum[coeffloc_L] * xexpf(-mag_L / (9.f * levelFactor * noisevarlum[coeffloc_L])) + eps); } -} + } #endif boxblur(sfave, sfaved, blurBuffer, lvl + 2, lvl + 2, Wlvl_L, Hlvl_L); //increase smoothness by locally averaging shrinkage @@ -2355,7 +2355,7 @@ SSEFUNCTION bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(wavelet_decomposit //use smoothed shrinkage unless local shrinkage is much less WavCoeffs_L[dir][coeffloc_L] *= (SQR(sfaved[coeffloc_L]) + SQR(sf_L)) / (sfaved[coeffloc_L] + sf_L + eps); }//now luminance coeffs are denoised -} + } #endif } @@ -2367,7 +2367,7 @@ SSEFUNCTION bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(wavelet_decomposit if (buffer[i] != nullptr) { delete[] buffer[i]; } -} + } } return (!memoryAllocationFailed); @@ -2506,7 +2506,7 @@ SSEFUNCTION bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(wavelet_decomposi if (buffer[i] != nullptr) { delete[] buffer[i]; } -} + } } return (!memoryAllocationFailed); @@ -2566,7 +2566,7 @@ bool ImProcFunctions::WaveletDenoiseAllL(wavelet_decomposition &WaveletCoeffs_L, if (buffer[i] != nullptr) { delete[] buffer[i]; } -} + } } return (!memoryAllocationFailed); } @@ -2620,7 +2620,7 @@ bool ImProcFunctions::WaveletDenoiseAllAB(wavelet_decomposition &WaveletCoeffs_L if (buffer[i] != nullptr) { delete[] buffer[i]; } -} + } } return (!memoryAllocationFailed); } diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 9f1c689de..2bcb0175e 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -131,7 +131,7 @@ const float d65_white[3] = { 0.950456, 1, 1.088754 }; #define MIN(a,b) rtengine::min(a,static_cast<__typeof__(a)>(b)) #define MAX(a,b) rtengine::max(a,static_cast<__typeof__(a)>(b)) #define LIM(x,min,max) rtengine::LIM(x,static_cast<__typeof__(x)>(min),static_cast<__typeof__(x)>(max)) -#define median(x,y,z) rtengine::median(x,static_cast<__typeof__(x)>(y),static_cast<__typeof__(x)>(z)) +#define ULIM(x,y,z) rtengine::median(x,static_cast<__typeof__(x)>(y),static_cast<__typeof__(x)>(z)) #define CLIP(x) rtengine::CLIP(x) #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; } @@ -9852,5 +9852,5 @@ struct tiff_hdr { /*RT*/#undef MIN /*RT*/#undef ABS /*RT*/#undef LIM -/*RT*/#undef median +/*RT*/#undef ULIM /*RT*/#undef CLIP diff --git a/rtengine/dcraw.patch b/rtengine/dcraw.patch index 5259c6b67..ad2997ae0 100644 --- a/rtengine/dcraw.patch +++ b/rtengine/dcraw.patch @@ -1,5 +1,5 @@ ---- dcraw.c 2016-06-29 12:25:09 +0000 -+++ dcraw.cc 2016-07-06 12:30:27 +0000 +--- dcraw.c 2016-06-04 20:34:18.405932434 +0200 ++++ dcraw.cc 2016-07-09 17:40:46.405632563 +0200 @@ -1,3 +1,16 @@ +/*RT*/#include +/*RT*/#include @@ -153,7 +153,7 @@ +#define MIN(a,b) rtengine::min(a,static_cast<__typeof__(a)>(b)) +#define MAX(a,b) rtengine::max(a,static_cast<__typeof__(a)>(b)) +#define LIM(x,min,max) rtengine::LIM(x,static_cast<__typeof__(x)>(min),static_cast<__typeof__(x)>(max)) -+#define ULIM(x,y,z) rtengine::ULIM(x,static_cast<__typeof__(x)>(y),static_cast<__typeof__(x)>(z)) ++#define ULIM(x,y,z) rtengine::median(x,static_cast<__typeof__(x)>(y),static_cast<__typeof__(x)>(z)) +#define CLIP(x) rtengine::CLIP(x) #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; }