Do not take logarithm of values <= 0, fixes #5164

This commit is contained in:
heckflosse
2019-02-06 13:25:57 +01:00
parent 37027e46bd
commit 5ddbefd8c4

View File

@@ -894,12 +894,12 @@ void EdgePreservingDecomposition::CompressDynamicRange(float *Source, float Scal
#endif
for(int ii = 0; ii < n - 3; ii += 4) {
_mm_storeu_ps( &Source[ii], xlogf(LVFU(Source[ii]) + epsv));
_mm_storeu_ps( &Source[ii], xlogf(vmaxf(LVFU(Source[ii]), ZEROV) + epsv));
}
}
for(int ii = n - (n % 4); ii < n; ii++) {
Source[ii] = xlogf(Source[ii] + eps);
Source[ii] = xlogf(std::max(Source[ii], 0.f) + eps);
}
#else
@@ -908,7 +908,7 @@ void EdgePreservingDecomposition::CompressDynamicRange(float *Source, float Scal
#endif
for(int ii = 0; ii < n; ii++) {
Source[ii] = xlogf(Source[ii] + eps);
Source[ii] = xlogf(std::max(Source[ii], 0.f) + eps);
}
#endif