[gegl] sampler-cubic.c: branch likely first



commit d39ca96d581c3e777e0e629ae9b2f0a8033a245b
Author: Nicolas Robidoux <nrobidoux git gnome org>
Date:   Fri Nov 23 19:55:32 2012 -0500

    sampler-cubic.c: branch likely first

 gegl/buffer/gegl-sampler-cubic.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-cubic.c b/gegl/buffer/gegl-sampler-cubic.c
index 8e8a069..eac3b16 100644
--- a/gegl/buffer/gegl-sampler-cubic.c
+++ b/gegl/buffer/gegl-sampler-cubic.c
@@ -272,21 +272,19 @@ cubicKernel (const gfloat  x,
              const gdouble b,
              const gdouble c)
 {
-  gfloat weight;
   const gfloat x2 = x*x;
   const gfloat ax = ( x<(gfloat) 0. ? -x : x );
 
-  if (x2 > (gfloat) 4.) return (gfloat) 0.;
-
   if (x2 <= (gfloat) 1.)
-    weight = ( (gfloat) ((12-9*b-6*c)/6) * ax +
-               (gfloat) ((-18+12*b+6*c)/6) ) * x2 +
-             (gfloat) ((6-2*b)/6);
-  else
-    weight = ( (gfloat) ((-b-6*c)/6) * ax +
-               (gfloat) ((6*b+30*c)/6) ) * x2 +
-             (gfloat) ((-12*b-48*c)/6) * ax +
-             (gfloat) ((8*b+24*c)/6);
-
-  return weight;
+    return ( (gfloat) ((12-9*b-6*c)/6) * ax +
+	     (gfloat) ((-18+12*b+6*c)/6) ) * x2 +
+           (gfloat) ((6-2*b)/6);
+  
+  if (x2 <= (gfloat) 4.)  
+    return ( (gfloat) ((-b-6*c)/6) * ax +
+	     (gfloat) ((6*b+30*c)/6) ) * x2 +
+           (gfloat) ((-12*b-48*c)/6) * ax +
+           (gfloat) ((8*b+24*c)/6);
+
+  return (gfloat) 0.;
 }



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