More double promote fixes

This commit is contained in:
Ingo Weyrich
2020-02-10 16:22:42 +01:00
parent 2c831a11a7
commit f0b5ca02e7
17 changed files with 155 additions and 175 deletions

View File

@@ -897,10 +897,10 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const
//init for edge and denoise
float vari[4];
vari[0] = 8.f * SQR((cp.lev0n / 125.0) * (1.0 + cp.lev0n / 25.0));
vari[1] = 8.f * SQR((cp.lev1n / 125.0) * (1.0 + cp.lev1n / 25.0));
vari[2] = 8.f * SQR((cp.lev2n / 125.0) * (1.0 + cp.lev2n / 25.0));
vari[3] = 8.f * SQR((cp.lev3n / 125.0) * (1.0 + cp.lev3n / 25.0));
vari[0] = 8.f * SQR((cp.lev0n / 125.f) * (1.f + cp.lev0n / 25.f));
vari[1] = 8.f * SQR((cp.lev1n / 125.f) * (1.f + cp.lev1n / 25.f));
vari[2] = 8.f * SQR((cp.lev2n / 125.f) * (1.f + cp.lev2n / 25.f));
vari[3] = 8.f * SQR((cp.lev3n / 125.f) * (1.f + cp.lev3n / 25.f));
if((cp.lev0n > 0.1f || cp.lev1n > 0.1f || cp.lev2n > 0.1f || cp.lev3n > 0.1f) && cp.noiseena) {
int edge = 1;
@@ -1116,7 +1116,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const
float Chprov1 = sqrtf(SQR(a) + SQR(b));
yBuffer[col] = (Chprov1 == 0.f) ? 1.f : a / Chprov1;
xBuffer[col] = (Chprov1 == 0.f) ? 0.f : b / Chprov1;
chprovBuffer[col] = Chprov1 / 327.68;
chprovBuffer[col] = Chprov1 / 327.68f;
}
}
@@ -1280,7 +1280,7 @@ void ImProcFunctions::Aver( float * RESTRICT DataList, int datalen, float &aver
for(int i = 0; i < datalen; i++) {
if(DataList[i] >= thres) {
averaP += DataList[i];
averaP += static_cast<double>(DataList[i]);
if(DataList[i] > lmax) {
lmax = DataList[i];
@@ -1288,7 +1288,7 @@ void ImProcFunctions::Aver( float * RESTRICT DataList, int datalen, float &aver
countP++;
} else if(DataList[i] < -thres) {
averaN += DataList[i];
averaN += static_cast<double>(DataList[i]);
if(DataList[i] < lmin) {
lmin = DataList[i];
@@ -1334,10 +1334,10 @@ void ImProcFunctions::Sigma( float * RESTRICT DataList, int datalen, float aver
for(int i = 0; i < datalen; i++) {
if(DataList[i] >= thres) {
variP += SQR(DataList[i] - averagePlus);
variP += static_cast<double>(SQR(DataList[i] - averagePlus));
countP++;
} else if(DataList[i] <= -thres) {
variN += SQR(DataList[i] - averageNeg);
variN += static_cast<double>(SQR(DataList[i] - averageNeg));
countN++;
}
}
@@ -1613,7 +1613,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float *
#endif
for (int i = 0; i < W_L * H_L; i++) {
avedbl += WavCoeffs_L0[i];
avedbl += static_cast<double>(WavCoeffs_L0[i]);
}
#ifdef _OPENMP
@@ -1702,7 +1702,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float *
#pragma omp parallel num_threads(wavNestedLevels) if(wavNestedLevels>1)
#endif
{
if(contrast != 0.f && cp.resena && max0 > 0.0) { // contrast = 0.f means that all will be multiplied by 1.f, so we can skip this step
if(contrast != 0.f && cp.resena && max0 > 0.f) { // contrast = 0.f means that all will be multiplied by 1.f, so we can skip this step
{
#ifdef _OPENMP
#pragma omp for
@@ -2011,7 +2011,7 @@ void ImProcFunctions::WaveletAandBAllAB(wavelet_decomposition &WaveletCoeffs_a,
editWhatever->v(i,j) = valpar;
}
*/
float valparam = float((hhCurve->getVal(Color::huelab_to_huehsv2(hueR)) - 0.5f) * 1.7f) + hueR; //get H=f(H) 1.7 optimisation !
float valparam = (static_cast<float>(hhCurve->getVal(Color::huelab_to_huehsv2(hueR))) - 0.5f) * 1.7f + hueR; //get H=f(H) 1.7 optimisation !
float2 sincosval = xsincosf(valparam);
WavCoeffs_a0[i * W_L + j] = chR * sincosval.y;
WavCoeffs_b0[i * W_L + j] = chR * sincosval.x;
@@ -3016,9 +3016,8 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit
if(Chutili) {
int i_i = i / W_L;
int j_j = i - i_i * W_L;
double lr;
float modhue2 = varhue[i_i][j_j];
float valparam = float((ChCurve->getVal(lr = Color::huelab_to_huehsv2(modhue2)) - 0.5f)); //get valparam=f(H)
float valparam = static_cast<float>(ChCurve->getVal(Color::huelab_to_huehsv2(modhue2))) - 0.5f; //get valparam=f(H)
if(valparam > 0.f) {
scale2 = 1.f + 3.f * valparam; //arbitrary value