Better fix for #4934
This commit is contained in:
@@ -941,7 +941,7 @@ void EdgePreservingDecomposition::CompressDynamicRange(float *Source, float Scal
|
||||
cev = xexpf(LVFU(Source[i]) + LVFU(u[i]) * (tempv)) - epsv;
|
||||
uev = xexpf(LVFU(u[i])) - epsv;
|
||||
sourcev = xexpf(LVFU(Source[i])) - epsv;
|
||||
_mm_storeu_ps( &Source[i], vmaxf(cev + DetailBoostv * (sourcev - uev), ZEROV));
|
||||
_mm_storeu_ps( &Source[i], cev + DetailBoostv * (sourcev - uev) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ void EdgePreservingDecomposition::CompressDynamicRange(float *Source, float Scal
|
||||
float ce = xexpf(Source[i] + u[i] * (temp)) - eps;
|
||||
float ue = xexpf(u[i]) - eps;
|
||||
Source[i] = xexpf(Source[i]) - eps;
|
||||
Source[i] = rtengine::max(ce + DetailBoost * (Source[i] - ue), 0.f);
|
||||
Source[i] = ce + DetailBoost * (Source[i] - ue);
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -961,7 +961,7 @@ void EdgePreservingDecomposition::CompressDynamicRange(float *Source, float Scal
|
||||
float ce = xexpf(Source[i] + u[i] * (temp)) - eps;
|
||||
float ue = xexpf(u[i]) - eps;
|
||||
Source[i] = xexpf(Source[i]) - eps;
|
||||
Source[i] = rtengine::max(ce + DetailBoost * (Source[i] - ue), 0.f);
|
||||
Source[i] = ce + DetailBoost * (Source[i] - ue);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -5264,6 +5264,10 @@ void ImProcFunctions::EPDToneMap (LabImage *lab, unsigned int Iterates, int skip
|
||||
minL = 0.0f; //Disable the shift if there are no negative numbers. I wish there were just no negative numbers to begin with.
|
||||
}
|
||||
|
||||
if (maxL == 0.f) { // avoid division by zero
|
||||
maxL = 1.f;
|
||||
}
|
||||
|
||||
#pragma omp parallel for
|
||||
|
||||
for (size_t i = 0; i < N; ++i)
|
||||
|
Reference in New Issue
Block a user