flush denormals to zeros for mask blur, #5560

This commit is contained in:
Ingo Weyrich
2019-12-11 13:00:09 +01:00
parent 1d08c9355d
commit a2dd906115

View File

@@ -473,8 +473,18 @@ void buildBlendMask(const float* const * luminance, float **blend, int W, int H,
}
}
#ifdef __SSE2__
// flush denormals to zero for gaussian blur to avoid performance penalty if there are a lot of zero values in the mask
const auto oldMode = _MM_GET_FLUSH_ZERO_MODE();
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
#endif
// blur blend mask to smooth transitions
gaussianBlur(blend, blend, W, H, 2.0);
#ifdef __SSE2__
_MM_SET_FLUSH_ZERO_MODE(oldMode);
#endif
}
}
}