From d67469f3f6c85bb11dad926047365b49280e0198 Mon Sep 17 00:00:00 2001 From: Ingo Date: Fri, 8 Nov 2013 18:24:10 +0100 Subject: [PATCH] Shadows/Highlights - High radius causes vertical lines, Issue 1921 --- rtengine/gauss.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/rtengine/gauss.h b/rtengine/gauss.h index 7605b8789..0c16f2a5e 100644 --- a/rtengine/gauss.h +++ b/rtengine/gauss.h @@ -332,10 +332,12 @@ template void gaussHorizontalSse (T** src, T** dst, int W, int H, float template void gaussHorizontal (T** src, T** dst, AlignedBufferMP &buffer, int W, int H, double sigma) { -#ifdef __SSE__ - gaussHorizontalSse (src, dst, W, H, sigma); - return; -#else +#ifdef __SSE__ + if(sigma < 70) { // bigger sigma only with double precision + gaussHorizontalSse (src, dst, W, H, sigma); + return; + } +#endif if (sigma<0.25) { // dont perform filtering if (src!=dst) @@ -411,7 +413,6 @@ template void gaussHorizontal (T** src, T** dst, AlignedBufferMP void gaussVerticalSse (T** src, T** dst, int W, int H, float s template void gaussVertical (T** src, T** dst, AlignedBufferMP &buffer, int W, int H, double sigma) { -#ifdef __SSE__ - gaussVerticalSse (src, dst, W, H, sigma); - return; -#else +#ifdef __SSE__ + if(sigma < 70) { // bigger sigma only with double precision + gaussVerticalSse (src, dst, W, H, sigma); + return; + } +#endif if (sigma<0.25) { // dont perform filtering @@ -642,7 +645,6 @@ template void gaussVertical (T** src, T** dst, AlignedBufferMP buffer.release(pBuf); } -#endif }