From e49d55c505f59eb7fcea1ebde617e4fb752f6452 Mon Sep 17 00:00:00 2001 From: Ingo Date: Thu, 7 Mar 2013 11:05:00 +0100 Subject: [PATCH] Fixes burnt film artifacts, Issue 1754 --- rtengine/gauss.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rtengine/gauss.h b/rtengine/gauss.h index c719b6082..322fb1774 100644 --- a/rtengine/gauss.h +++ b/rtengine/gauss.h @@ -217,9 +217,10 @@ template void gaussHorizontalSse (T** src, T** dst, int W, int H, float M[2][1] = b1*b2+b3*b2*b2-b1*b3*b3-b3*b3*b3-b3*b2+b3; M[2][2] = b3*(b1+b3*b2); for (int i=0; i<3; i++) - for (int j=0; j<3; j++) - M[i][j] /= (1.0+b1-b2+b3)*(1.0+b2+(b1-b3)*b3); - + for (int j=0; j<3; j++) { + M[i][j] *= (1.0+b2+(b1-b3)*b3); + M[i][j] /= (1.0+b1-b2+b3)*(1.0-b1-b2-b3); + } float tmp[W][4] __attribute__ ((aligned (16))); float tmpV[4] __attribute__ ((aligned (16))); __m128 Rv; @@ -453,9 +454,10 @@ template void gaussVerticalSse (T** src, T** dst, int W, int H, float s M[2][1] = b1*b2+b3*b2*b2-b1*b3*b3-b3*b3*b3-b3*b2+b3; M[2][2] = b3*(b1+b3*b2); for (int i=0; i<3; i++) - for (int j=0; j<3; j++) - M[i][j] /= (1.0+b1-b2+b3)*(1.0+b2+(b1-b3)*b3); - + for (int j=0; j<3; j++) { + M[i][j] *= (1.0+b2+(b1-b3)*b3); + M[i][j] /= (1.0+b1-b2+b3)*(1.0-b1-b2-b3); + } float tmp[H][4] __attribute__ ((aligned (16))); __m128 Rv; __m128 Tv,Tm2v,Tm3v;