diff options
author | Massimo Valentini <mvalentini@src.gnome.org> | 2015-06-23 12:41:38 +0200 |
---|---|---|
committer | Øyvind Kolås <pippin@gimp.org> | 2015-06-24 18:24:52 +0200 |
commit | ebf36e40bc6d116b407dc3665b06129365c56619 (patch) | |
tree | 1d5733dc68bf48a891c700fa315c83db03cf6e23 | |
parent | 99a53157b0ab9bc28e580d1d11a64c3657dcb80d (diff) |
gblur-1d: constants
-rw-r--r-- | operations/common/gblur-1d.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/operations/common/gblur-1d.c b/operations/common/gblur-1d.c index 8cd14712..7259adef 100644 --- a/operations/common/gblur-1d.c +++ b/operations/common/gblur-1d.c @@ -84,14 +84,17 @@ iir_young_find_constants (gfloat sigma, gdouble *b, gdouble (*m)[3]) { + const gdouble K1 = 2.44413; + const gdouble K2 = 1.4281; + const gdouble K3 = 0.422205; const gdouble q = sigma >= 2.5 ? 0.98711 * sigma - 0.96330 : 3.97156 - 4.14554 * sqrt (1 - 0.26891 * sigma); - const gdouble b0 = 1.57825 + q*(2.44413 + q*(1.4281 + q*0.422205)); - const gdouble b1 = q*(2.44413 + q*(2.85619 + q*1.26661)); - const gdouble b2 = - q* q*(1.4281 + q*1.26661); - const gdouble b3 = q* q* q*0.422205; + 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 b3 = q* q* q * K3; const gdouble a1 = b1 / b0; const gdouble a2 = b2 / b0; |