diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index db136f330..34c81e820 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -79,6 +79,7 @@ #78 19.01.2019 Erweiterung (TooWaBoo) RT 5.5 #79 24.02.2019 Erweiterung (TooWaBoo) RT 5.5 #80 25.03.2019 Erweiterung (TooWaBoo) RT 5.6 +#81 15.04.2019 Erweiterung (TooWaBoo) RT 5.6 ABOUT_TAB_BUILD;Version ABOUT_TAB_CREDITS;Danksagungen @@ -2359,4 +2360,5 @@ ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: - ! Untranslated keys follow; remove the ! prefix after an entry is translated. !!!!!!!!!!!!!!!!!!!!!!!!! -!QUEUE_LOCATION_TITLE;Output Location +QUEUE_LOCATION_TITLE;Ausgabeverzeichnis +PREFERENCES_APPEARANCE_PSEUDOHIDPI;Pseudo-HiDPI-Modus diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 6ae17a24e..294c7ed30 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -42,6 +42,7 @@ #ifdef _OPENMP #include #endif +#define BENCHMARK #include "StopWatch.h" #define TS 64 // Tile size @@ -839,6 +840,12 @@ BENCHFUN {static_cast(wprof[2][0]), static_cast(wprof[2][1]), static_cast(wprof[2][2])} }; + const float wpfast[3][3] = { + {static_cast(wprof[0][0]) / Color::D50x, static_cast(wprof[0][1]) / Color::D50x, static_cast(wprof[0][2]) / Color::D50x}, + {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, + {static_cast(wprof[2][0]) / Color::D50z, static_cast(wprof[2][1]) / Color::D50z, static_cast(wprof[2][2]) / Color::D50z} + }; + // begin tile processing of image #ifdef _OPENMP #pragma omp parallel num_threads(numthreads) if (numthreads>1) @@ -925,51 +932,38 @@ BENCHFUN if (!denoiseMethodRgb) { //lab mode //modification Jacques feb 2013 and july 2014 #ifdef _OPENMP - #pragma omp parallel for num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1) + #pragma omp parallel for schedule(dynamic,16) num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1) #endif for (int i = tiletop; i < tilebottom; ++i) { - int i1 = i - tiletop; + const int i1 = i - tiletop; for (int j = tileleft; j < tileright; ++j) { - int j1 = j - tileleft; - float R_ = gain * src->r(i, j); - float G_ = gain * src->g(i, j); - float B_ = gain * src->b(i, j); + const int j1 = j - tileleft; - R_ = Color::denoiseIGammaTab[R_]; - G_ = Color::denoiseIGammaTab[G_]; - B_ = Color::denoiseIGammaTab[B_]; + const float R_ = Color::denoiseIGammaTab[gain * src->r(i, j)]; + const float G_ = Color::denoiseIGammaTab[gain * src->g(i, j)]; + const float B_ = Color::denoiseIGammaTab[gain * src->b(i, j)]; //apply gamma noise standard (slider) - R_ = R_ < 65535.f ? gamcurve[R_] : (Color::gammanf(R_ / 65535.f, gam) * 32768.f); - G_ = G_ < 65535.f ? gamcurve[G_] : (Color::gammanf(G_ / 65535.f, gam) * 32768.f); - B_ = B_ < 65535.f ? gamcurve[B_] : (Color::gammanf(B_ / 65535.f, gam) * 32768.f); - - //true conversion xyz=>Lab - float X, Y, Z; - Color::rgbxyz(R_, G_, B_, X, Y, Z, wp); - - //convert to Lab - float L, a, b; - Color::XYZ2Lab(X, Y, Z, L, a, b); - - labdn->L[i1][j1] = L; - labdn->a[i1][j1] = a; - labdn->b[i1][j1] = b; + labdn->L[i1][j1] = R_ < 65535.f ? gamcurve[R_] : Color::gammanf(R_ / 65535.f, gam) * 32768.f; + labdn->a[i1][j1] = G_ < 65535.f ? gamcurve[G_] : Color::gammanf(G_ / 65535.f, gam) * 32768.f; + labdn->b[i1][j1] = B_ < 65535.f ? gamcurve[B_] : Color::gammanf(B_ / 65535.f, gam) * 32768.f; if (((i1 | j1) & 1) == 0) { if (numTries == 1) { - noisevarlum[(i1 >> 1)*width2 + (j1 >> 1)] = useNoiseLCurve ? lumcalc[i >> 1][j >> 1] : noisevarL; - noisevarchrom[(i1 >> 1)*width2 + (j1 >> 1)] = useNoiseCCurve ? maxNoiseVarab * ccalc[i >> 1][j >> 1] : 1.f; + noisevarlum[(i1 >> 1) * width2 + (j1 >> 1)] = useNoiseLCurve ? lumcalc[i >> 1][j >> 1] : noisevarL; + noisevarchrom[(i1 >> 1) * width2 + (j1 >> 1)] = useNoiseCCurve ? maxNoiseVarab * ccalc[i >> 1][j >> 1] : 1.f; } else { - noisevarlum[(i1 >> 1)*width2 + (j1 >> 1)] = lumcalc[i >> 1][j >> 1]; - noisevarchrom[(i1 >> 1)*width2 + (j1 >> 1)] = ccalc[i >> 1][j >> 1]; + noisevarlum[(i1 >> 1) * width2 + (j1 >> 1)] = lumcalc[i >> 1][j >> 1]; + noisevarchrom[(i1 >> 1) * width2 + (j1 >> 1)] = ccalc[i >> 1][j >> 1]; } } //end chroma } + //true conversion xyz=>Lab + Color::RGB2Lab(labdn->L[i1], labdn->a[i1], labdn->b[i1], labdn->L[i1], labdn->a[i1], labdn->b[i1], wpfast, width); } } else {//RGB mode #ifdef _OPENMP @@ -1606,27 +1600,13 @@ BENCHFUN for (int i = tiletop; i < tilebottom; ++i) { int i1 = i - tiletop; - + //true conversion Lab==>xyz + Color::Lab2RGBLimit(labdn->L[i1], labdn->a[i1], labdn->b[i1], labdn->L[i1], labdn->a[i1], labdn->b[i1], wip, 9000000.f, 1.f + qhighFactor * realred, 1.f + qhighFactor * realblue, width); for (int j = tileleft; j < tileright; ++j) { int j1 = j - tileleft; - //modification Jacques feb 2013 - //true conversion Lab==>xyz - float L = labdn->L[i1][j1]; - float a = labdn->a[i1][j1]; - float b = labdn->b[i1][j1]; - float c_h = SQR(a) + SQR(b); - - if (c_h > 9000000.f) { - a *= 1.f + qhighFactor * realred; - b *= 1.f + qhighFactor * realblue; - } - - //convert XYZ - float X, Y, Z; - Color::Lab2XYZ(L, a, b, X, Y, Z); - //apply inverse gamma noise - float r_, g_, b_; - Color::xyz2rgb(X, Y, Z, r_, g_, b_, wip); + float r_ = labdn->L[i1][j1]; + float g_ = labdn->a[i1][j1]; + float b_ = labdn->b[i1][j1]; //inverse gamma standard (slider) r_ = r_ < 32768.f ? igamcurve[r_] : (Color::gammanf(r_ / 32768.f, igam) * 65535.f); g_ = g_ < 32768.f ? igamcurve[g_] : (Color::gammanf(g_ / 32768.f, igam) * 65535.f); @@ -2132,52 +2112,7 @@ void ImProcFunctions::RGBoutput_tile_row(float *bloxrow_L, float ** Ldetail, flo #undef epsilon */ -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -float ImProcFunctions::MadMax(float * DataList, int & max, int datalen) -{ - - //computes Median Absolute Deviation and Maximum of DataList - //DataList values should mostly have abs val < 65535 - - int * histo = new int[65536]; - - //memset(histo, 0, 65536*sizeof(histo)); - for (int i = 0; i < 65536; ++i) { - histo[i] = 0; - } - - //calculate histogram of absolute values of HH wavelet coeffs - for (int i = 0; i < datalen; ++i) { - histo[MAX(0, MIN(65535, abs((int)DataList[i])))]++; - } - - //find median of histogram - int median = 0, count = 0; - - while (count < datalen / 2) { - count += histo[median]; - ++median; - } - - //find max of histogram - max = 65535; - - while (histo[max] == 0) { - max--; - } - - int count_ = count - histo[median - 1]; - - delete[] histo; - - // interpolate - return (((median - 1) + (datalen / 2 - count_) / (static_cast(count - count_))) / 0.6745); - -} - -float ImProcFunctions::Mad(float * DataList, const int datalen) +float ImProcFunctions::Mad(const float * DataList, const int datalen) { if (datalen <= 1) { // Avoid possible buffer underrun return 0; @@ -2189,7 +2124,7 @@ float ImProcFunctions::Mad(float * DataList, const int datalen) //calculate histogram of absolute values of wavelet coeffs for (int i = 0; i < datalen; ++i) { - histo[min(255, abs(static_cast(DataList[i])))]++; + histo[static_cast(rtengine::min(255.f, fabsf(DataList[i])))]++; } //find median of histogram @@ -2206,7 +2141,7 @@ float ImProcFunctions::Mad(float * DataList, const int datalen) return (((median - 1) + (datalen / 2 - count_) / (static_cast(count - count_))) / 0.6745); } -float ImProcFunctions::MadRgb(float * DataList, const int datalen) +float ImProcFunctions::MadRgb(const float * DataList, const int datalen) { if (datalen <= 1) { // Avoid possible buffer underrun return 0; @@ -2221,10 +2156,8 @@ float ImProcFunctions::MadRgb(float * DataList, const int datalen) } //calculate histogram of absolute values of wavelet coeffs - int i; - - for (i = 0; i < datalen; ++i) { - histo[min(65535, abs(static_cast(DataList[i])))]++; + for (int i = 0; i < datalen; ++i) { + histo[static_cast(rtengine::min(65535.f, fabsf(DataList[i])))]++; } //find median of histogram @@ -2244,27 +2177,23 @@ float ImProcFunctions::MadRgb(float * DataList, const int datalen) -void ImProcFunctions::Noise_residualAB(wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb) +void ImProcFunctions::Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb) { - int maxlvl = WaveletCoeffs_ab.maxlevel(); + float resid = 0.f; - float madC; float maxresid = 0.f; - for (int lvl = 0; lvl < maxlvl; ++lvl) { +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic) collapse(2) reduction(+:resid) reduction(max:maxresid) num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1) +#endif + for (int lvl = 0; lvl < WaveletCoeffs_ab.maxlevel(); ++lvl) { // compute median absolute deviation (MAD) of detail coefficients as robust noise estimator - - int Wlvl_ab = WaveletCoeffs_ab.level_W(lvl); - int Hlvl_ab = WaveletCoeffs_ab.level_H(lvl); - - float ** WavCoeffs_ab = WaveletCoeffs_ab.level_coeffs(lvl); - for (int dir = 1; dir < 4; ++dir) { - if (denoiseMethodRgb) { - madC = SQR(MadRgb(WavCoeffs_ab[dir], Wlvl_ab * Hlvl_ab)); - } else { - madC = SQR(Mad(WavCoeffs_ab[dir], Wlvl_ab * Hlvl_ab)); - } + const int Wlvl_ab = WaveletCoeffs_ab.level_W(lvl); + const int Hlvl_ab = WaveletCoeffs_ab.level_H(lvl); + + float ** WavCoeffs_ab = WaveletCoeffs_ab.level_coeffs(lvl); + const float madC = SQR(denoiseMethodRgb ? MadRgb(WavCoeffs_ab[dir], Wlvl_ab * Hlvl_ab) : Mad(WavCoeffs_ab[dir], Wlvl_ab * Hlvl_ab)); resid += madC; @@ -2742,7 +2671,7 @@ bool ImProcFunctions::WaveletDenoiseAllAB(wavelet_decomposition &WaveletCoeffs_L if (!memoryAllocationFailed) { #ifdef _OPENMP - #pragma omp for schedule(dynamic) collapse(2) + #pragma omp for schedule(dynamic) collapse(2) nowait #endif for (int lvl = 0; lvl < maxlvl; ++lvl) { diff --git a/rtengine/color.cc b/rtengine/color.cc index a0e7b06d8..d7d26dc42 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -1809,10 +1809,10 @@ void Color::RGB2Lab(float *R, float *G, float *B, float *L, float *a, float *b, { #ifdef __SSE2__ - vfloat minvalfv = F2V(0.f); - vfloat maxvalfv = F2V(MAXVALF); - vfloat c500v = F2V(500.f); - vfloat c200v = F2V(200.f); + const vfloat minvalfv = ZEROV; + const vfloat maxvalfv = F2V(MAXVALF); + const vfloat c500v = F2V(500.f); + const vfloat c200v = F2V(200.f); #endif int i = 0; @@ -1826,9 +1826,7 @@ void Color::RGB2Lab(float *R, float *G, float *B, float *L, float *a, float *b, const vfloat yv = F2V(wp[1][0]) * rv + F2V(wp[1][1]) * gv + F2V(wp[1][2]) * bv; const vfloat zv = F2V(wp[2][0]) * rv + F2V(wp[2][1]) * gv + F2V(wp[2][2]) * bv; - vmask maxMask = vmaskf_gt(vmaxf(xv, vmaxf(yv, zv)), maxvalfv); - vmask minMask = vmaskf_lt(vminf(xv, vminf(yv, zv)), minvalfv); - if (_mm_movemask_ps((vfloat)maxMask) || _mm_movemask_ps((vfloat)minMask)) { + if (_mm_movemask_ps((vfloat)vorm(vmaskf_gt(vmaxf(xv, vmaxf(yv, zv)), maxvalfv), vmaskf_lt(vminf(xv, vminf(yv, zv)), minvalfv)))) { // take slower code path for all 4 pixels if one of the values is > MAXVALF. Still faster than non SSE2 version for (int k = 0; k < 4; ++k) { float x = xv[k]; @@ -1913,6 +1911,51 @@ void Color::RGB2L(float *R, float *G, float *B, float *L, const float wp[3][3], } } +void Color::Lab2RGBLimit(float *L, float *a, float *b, float *R, float *G, float *B, const float wp[3][3], float limit, float afactor, float bfactor, int width) +{ + + int i = 0; + +#ifdef __SSE2__ + const vfloat wpv[3][3] = { + {F2V(wp[0][0]), F2V(wp[0][1]), F2V(wp[0][2])}, + {F2V(wp[1][0]), F2V(wp[1][1]), F2V(wp[1][2])}, + {F2V(wp[2][0]), F2V(wp[2][1]), F2V(wp[2][2])} + }; + const vfloat limitv = F2V(limit); + const vfloat afactorv = F2V(afactor); + const vfloat bfactorv = F2V(bfactor); + + for(;i < width - 3; i+=4) { + const vfloat Lv = LVFU(L[i]); + vfloat av = LVFU(a[i]); + vfloat bv = LVFU(b[i]); + + const vmask mask = vmaskf_gt(SQRV(av) + SQRV(bv), limitv); + av = vself(mask, av * afactorv, av); + bv = vself(mask, bv * bfactorv, bv); + vfloat Xv, Yv, Zv; + Lab2XYZ(Lv, av, bv, Xv, Yv, Zv); + vfloat Rv, Gv, Bv; + xyz2rgb(Xv, Yv, Zv, Rv, Gv, Bv, wpv); + STVFU(R[i], Rv); + STVFU(G[i], Gv); + STVFU(B[i], Bv); + } +#endif + for(;i < width; ++i) { + float X, Y, Z; + float av = a[i]; + float bv = b[i]; + if (SQR(av) + SQR(bv) > limit) { + av *= afactor; + bv *= bfactor; + } + Lab2XYZ(L[i], av, bv, X, Y, Z); + xyz2rgb(X, Y, Z, R[i], G[i], B[i], wp); + } +} + void Color::XYZ2Lab(float X, float Y, float Z, float &L, float &a, float &b) { diff --git a/rtengine/color.h b/rtengine/color.h index 2487b3a5b..7e36dd7aa 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -620,6 +620,7 @@ public: */ static void XYZ2Lab(float x, float y, float z, float &L, float &a, float &b); static void RGB2Lab(float *X, float *Y, float *Z, float *L, float *a, float *b, const float wp[3][3], int width); + static void Lab2RGBLimit(float *L, float *a, float *b, float *R, float *G, float *B, const float wp[3][3], float limit, float afactor, float bfactor, int width); static void RGB2L(float *X, float *Y, float *Z, float *L, const float wp[3][3], int width); /** @@ -844,7 +845,7 @@ public: * @param go green channel of output color [0 ; 65535] (return value) * @param bo blue channel of output color [0 ; 65535] (return value) */ - static void interpolateRGBColor(const float balance, const float r1, const float g1, const float b1, const float r2, const float g2, const float b2, int channels, const double xyz_rgb[3][3], const double rgb_xyz[3][3], float &ro, float &go, float &bo); + static void interpolateRGBColor (float balance, float r1, float g1, float b1, float r2, float g2, float b2, int channels, const double xyz_rgb[3][3], const double rgb_xyz[3][3], float &ro, float &go, float &bo); /** * @brief Interpolate 2 colors from their respective red/green/blue channels, with a balance factor @@ -874,7 +875,7 @@ public: * @param go green channel of output color [0 ; 65535] (return value) * @param bo blue channel of output color [0 ; 65535] (return value) */ - static void interpolateRGBColor(float realL, float iplow, float iphigh, int algm, const float balance, int twoc, int metchrom, float chromat, float luma, const float r1, const float g1, const float b1, const float xl, const float yl, const float zl, const float x2, const float y2, const float z2, const double xyz_rgb[3][3], const double rgb_xyz[3][3], float &ro, float &go, float &bo); + static void interpolateRGBColor (float realL, float iplow, float iphigh, int algm, float balance, int twoc, int metchrom, float chromat, float luma, float r1, float g1, float b1, float xl, float yl, float zl, float x2, float y2, float z2, const double xyz_rgb[3][3], const double rgb_xyz[3][3], float &ro, float &go, float &bo); /** @@ -1438,15 +1439,15 @@ public: * @param moreRGB (Debug target only) to calculate iterations for values >65535 */ #ifdef _DEBUG - static void gamutLchonly(float HH, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef, bool &neg, bool &more_rgb); - static void gamutLchonly(float HH, float2 sincosval, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef, bool &neg, bool &more_rgb); - static void gamutLchonly(float2 sincosval, float &Lprov1, float &Chprov1, const float wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef, bool &neg, bool &more_rgb); + static void gamutLchonly (float HH, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], bool isHLEnabled, float lowerCoef, float higherCoef, bool &neg, bool &more_rgb); + static void gamutLchonly (float HH, float2 sincosval, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], bool isHLEnabled, float lowerCoef, float higherCoef, bool &neg, bool &more_rgb); + static void gamutLchonly (float2 sincosval, float &Lprov1, float &Chprov1, const float wip[3][3], bool isHLEnabled, float lowerCoef, float higherCoef, bool &neg, bool &more_rgb); #else - static void gamutLchonly(float HH, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef); - static void gamutLchonly(float HH, float2 sincosval, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef); - static void gamutLchonly(float2 sincosval, float &Lprov1, float &Chprov1, const float wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef); + static void gamutLchonly (float HH, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], bool isHLEnabled, float lowerCoef, float higherCoef); + static void gamutLchonly (float HH, float2 sincosval, float &Lprov1, float &Chprov1, float &R, float &G, float &B, const double wip[3][3], bool isHLEnabled, float lowerCoef, float higherCoef); + static void gamutLchonly (float2 sincosval, float &Lprov1, float &Chprov1, const float wip[3][3], bool isHLEnabled, float lowerCoef, float higherCoef); #endif - static void gamutLchonly (float HH, float2 sincosval, float &Lprov1, float &Chprov1, float &saturation, const float wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef); + static void gamutLchonly (float HH, float2 sincosval, float &Lprov1, float &Chprov1, float &saturation, const float wip[3][3], bool isHLEnabled, float lowerCoef, float higherCoef); /** @@ -1470,7 +1471,7 @@ public: * @param wip matrix for working profile * @param multiThread whether to parallelize the loop or not */ - static void LabGamutMunsell(float *labL, float *laba, float *labb, const int N, bool corMunsell, bool lumaMuns, bool isHLEnabled, bool gamut, const double wip[3][3]); + static void LabGamutMunsell (float *labL, float *laba, float *labb, int N, bool corMunsell, bool lumaMuns, bool isHLEnabled, bool gamut, const double wip[3][3]); /* @@ -1506,8 +1507,8 @@ public: // -------------------------------- end Munsell - static void scalered(const float rstprotection, const float param, const float limit, const float HH, const float deltaHH, float &scale, float &scaleext); - static void transitred(const float HH, const float Chprov1, const float dred, const float factorskin, const float protect_red, const float factorskinext, const float deltaHH, const float factorsat, float &factor); + static void scalered ( float rstprotection, float param, float limit, float HH, float deltaHH, float &scale, float &scaleext); + static void transitred (float HH, float Chprov1, float dred, float factorskin, float protect_red, float factorskinext, float deltaHH, float factorsat, float &factor); static void skinred(double J, double h, double sres, double Sp, float dred, float protect_red, int sk, float rstprotection, float ko, double &s); static void skinredfloat(float J, float h, float sres, float Sp, float dred, float protect_red, int sk, float rstprotection, float ko, float &s); // static void scaleredcdbl ( float skinprot, float param, float limit, float HH, float deltaHH, float &scale,float &scaleext); diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 7b3e69995..17834ca36 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -380,11 +380,10 @@ public: void ShrinkAll_info(float ** WavCoeffs_a, float ** WavCoeffs_b, int W_ab, int H_ab, float **noisevarlum, float **noisevarchrom, float **noisevarhue, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, int schoice, int lvl, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb); - void Noise_residualAB(wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb); + void Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb); void calcautodn_info(float &chaut, float &delta, int Nb, int levaut, float maxmax, float lumema, float chromina, int mode, int lissage, float redyel, float skinc, float nsknc); - float MadMax(float * DataList, int &max, int datalen); - float Mad(float * DataList, const int datalen); - float MadRgb(float * DataList, const int datalen); + float Mad(const float * DataList, int datalen); + float MadRgb(const float * DataList, int datalen); // pyramid wavelet void cbdl_local_temp(float ** src, float ** loctemp, int srcwidth, int srcheight, const float * mult, float kchro, const double dirpyrThreshold, const float mergeL, const float contres, const float blurcb, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale, bool multiThread);