Do not take logarithm of values <= 0, fixes #5164
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user