From 905c5f794866d63a1fe0183eef327184548fd85e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 Oct 2010 12:29:59 +0000 Subject: bugfix/patch [#24431] Fast Gaussian produces wrong results for higher resolutions report & fix from Martin Lubich (loramel) Use double rather then floats, this doesn't use significantly more memory (as allocating a double buffer would), other vars in this function were doubles already so may even gain some speed. --- source/blender/nodes/intern/CMP_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/nodes/intern') diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c index c762d8cb42d..06c4740f6b9 100644 --- a/source/blender/nodes/intern/CMP_util.c +++ b/source/blender/nodes/intern/CMP_util.c @@ -1303,7 +1303,7 @@ CompBuf* qd_downScaledCopy(CompBuf* src, int scale) void IIR_gauss(CompBuf* src, float sigma, int chan, int xy) { double q, q2, sc, cf[4], tsM[9], tsu[3], tsv[3]; - float *X, *Y, *W; + double *X, *Y, *W; int i, x, y, sz; // <0.5 not valid, though can have a possibly useful sort of sharpening effect @@ -1367,9 +1367,9 @@ void IIR_gauss(CompBuf* src, float sigma, int chan, int xy) // intermediate buffers sz = MAX2(src->x, src->y); - X = MEM_callocN(sz*sizeof(float), "IIR_gauss X buf"); - Y = MEM_callocN(sz*sizeof(float), "IIR_gauss Y buf"); - W = MEM_callocN(sz*sizeof(float), "IIR_gauss W buf"); + X = MEM_callocN(sz*sizeof(double), "IIR_gauss X buf"); + Y = MEM_callocN(sz*sizeof(double), "IIR_gauss Y buf"); + W = MEM_callocN(sz*sizeof(double), "IIR_gauss W buf"); if (xy & 1) { // H for (y=0; yy; ++y) { const int yx = y*src->x; -- cgit v1.2.3