[gegl] gblur-1d: fix issue #116, diamond gaussian blur



commit 91d903f363833056115917733e9be0bbd221272e
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Dec 12 00:09:07 2018 +0100

    gblur-1d: fix issue #116, diamond gaussian blur
    
    The computation of one of the coefficients was wrong, with this fix the IIR
    code paths, which are chosen for large radiuses when auto is selected.

 operations/common/gblur-1d.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/operations/common/gblur-1d.c b/operations/common/gblur-1d.c
index a77d30940..514ff7442 100644
--- a/operations/common/gblur-1d.c
+++ b/operations/common/gblur-1d.c
@@ -108,12 +108,13 @@ iir_young_find_constants (gfloat   sigma,
 
   const gdouble b0 = 1.57825 + q*(K1 + q*(    K2 + q *     K3));
   const gdouble b1 =           q*(K1 + q*(2 * K2 + q * 3 * K3));
-  const gdouble b2 =         - q*      q*(    K2 + q * 3 * K3);
+  const gdouble b2 =     (-K2 * q * q) + (-K3 * 3 * q * q * q);
   const gdouble b3 =           q*      q*          q *     K3;
 
   const gdouble a1 = b1 / b0;
   const gdouble a2 = b2 / b0;
   const gdouble a3 = b3 / b0;
+
   const gdouble c  = 1. / ((1+a1-a2+a3) * (1+a2+(a1-a3)*a3));
 
   m[0][0] = c * (-a3*(a1+a3)-a2 + 1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]