[gegl] samplers: set OFFSET_0 of lohalo/nohalo to 7



commit 7dcb6513244c23ef0443becdeb1cfab4d247139e
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri Jun 20 00:33:57 2014 +0200

    samplers: set OFFSET_0 of lohalo/nohalo to 7
    
    For affine like buffer sampling a 5.23x speed improvement for nohalo and 2.45x
    speed improvement for lohalo. This tunes the algorithms for more reasonable
    performance; without much loss of quality.

 gegl.doap                         |    2 +-
 gegl/buffer/gegl-sampler-lohalo.c |    2 +-
 gegl/buffer/gegl-sampler-nohalo.c |    2 +-
 gegl/buffer/gegl-sampler.c        |    6 ++++--
 gegl/buffer/gegl-sampler.h        |    2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gegl.doap b/gegl.doap
index 6231432..3d178c7 100644
--- a/gegl.doap
+++ b/gegl.doap
@@ -5,7 +5,7 @@
          xmlns="http://usefulinc.com/ns/doap#";>
 
   <name xml:lang="en">GEGL</name>
-  <shortdesc xml:lang="en">GEGL (Generic Graphics Library) is a graph based image processing 
framework.</shortdesc>
+  <shortdesc xml:lang="en">GEGL (GObject Extendable Graphics Library) is a graph based image processing 
framework.</shortdesc>
   <homepage rdf:resource="http://www.gegl.org"; />
   <mailing-list rdf:resource="https://lists.xcf.berkeley.edu/mailman/listinfo/gegl-developer"; />
 
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index 0acf80e..3958219 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -330,7 +330,7 @@ gegl_sampler_lohalo_class_init (GeglSamplerLohaloClass *klass)
 /*
  * IMPORTANT: LOHALO_OFFSET_0 SHOULD BE AN INTEGER >= 2.
  */
-#define LOHALO_OFFSET_0 (13)
+#define LOHALO_OFFSET_0 (7)
 #define LOHALO_SIZE_0 (1+2*LOHALO_OFFSET_0)
 
 /*
diff --git a/gegl/buffer/gegl-sampler-nohalo.c b/gegl/buffer/gegl-sampler-nohalo.c
index eeef4af..062d11f 100644
--- a/gegl/buffer/gegl-sampler-nohalo.c
+++ b/gegl/buffer/gegl-sampler-nohalo.c
@@ -413,7 +413,7 @@ gegl_sampler_nohalo_class_init (GeglSamplerNohaloClass *klass)
 /*
  * IMPORTANT: NOHALO_OFFSET_0 SHOULD BE AN INTEGER >= 2.
  */
-#define NOHALO_OFFSET_0 (13)
+#define NOHALO_OFFSET_0 (7)
 #define NOHALO_SIZE_0 (1+2*NOHALO_OFFSET_0)
 
 /*
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 77ca2a5..f929817 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -298,8 +298,10 @@ GeglRectangle _gegl_sampler_compute_rectangle (GeglSampler *sampler,
   if (rectangle.height >= GEGL_SAMPLER_MAXIMUM_HEIGHT)
     rectangle.height = GEGL_SAMPLER_MAXIMUM_HEIGHT;
 
-  g_assert (level->context_rect.width  <= rectangle.width);
-  g_assert (level->context_rect.height <= rectangle.height);
+  if (rectangle.width < level->context_rect.width)
+    rectangle.width = level->context_rect.width;
+  if (rectangle.height < level->context_rect.height)
+    rectangle.height = level->context_rect.height;
 
   return rectangle;
 }
diff --git a/gegl/buffer/gegl-sampler.h b/gegl/buffer/gegl-sampler.h
index 5d0d555..114b138 100644
--- a/gegl/buffer/gegl-sampler.h
+++ b/gegl/buffer/gegl-sampler.h
@@ -40,7 +40,7 @@ G_BEGIN_DECLS
  * twice as wide as they are tall.
  */
 
-#define GEGL_SAMPLER_MAXIMUM_HEIGHT (64)
+#define GEGL_SAMPLER_MAXIMUM_HEIGHT 64
 #define GEGL_SAMPLER_MAXIMUM_WIDTH (GEGL_SAMPLER_MAXIMUM_HEIGHT)
 #define GEGL_SAMPLER_BPP 16
 #define GEGL_SAMPLER_ROWSTRIDE (GEGL_SAMPLER_MAXIMUM_WIDTH * GEGL_SAMPLER_BPP)


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