[gegl] op/gaussian-blur: replace some fdivs with fmul



commit bae7472d63a28f2ff4698938c58092454de5a2c1
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Sun Apr 1 20:48:07 2012 +0100

    op/gaussian-blur: replace some fdivs with fmul
    
    Floating point multiplication is faster than division.

 operations/common/gaussian-blur.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/operations/common/gaussian-blur.c b/operations/common/gaussian-blur.c
index ab02f05..8bdc50b 100644
--- a/operations/common/gaussian-blur.c
+++ b/operations/common/gaussian-blur.c
@@ -98,6 +98,7 @@ iir_young_blur_1D (gfloat  * buf,
 {
   gint wcount, i;
   gdouble tmp;
+  gdouble recip = 1.0 / b[0];
 
   /* forward filter */
   wcount = 0;
@@ -112,7 +113,7 @@ iir_young_blur_1D (gfloat  * buf,
             tmp += b[i]*w[wcount-i];
         }
 
-      tmp /= b[0];
+      tmp *= recip;
       tmp += B*buf[offset];
       w[wcount] = tmp;
 
@@ -134,7 +135,7 @@ iir_young_blur_1D (gfloat  * buf,
             tmp += b[i]*buf[offset+delta_offset*i];
         }
 
-      tmp /= b[0];
+      tmp *= recip;
       tmp += B*w[wcount];
       buf[offset] = tmp;
 



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