[gegl] Bug 786110 - Gaussian blur has subdivision artifacts ...



commit 33293de5b4a716203fe6754b249ed42a28c4e14b
Author: Ell <ell_se yahoo com>
Date:   Sat Aug 12 17:34:29 2017 -0400

    Bug 786110 - Gaussian blur has subdivision artifacts ...
    
    ... with more than one thread
    
    Override the new get_split_strategy() virtual function of
    GeglOperationFilter in gegl:gblur-1d, so that the processed area is
    split along the direction of the blur.  This avoids the chunking
    artifacts when using the IIR filter, because the scanlines aren't
    broken, and also improves multithreaded performance, by maximizing
    the scanline length.

 operations/common/gblur-1d.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/operations/common/gblur-1d.c b/operations/common/gblur-1d.c
index 4d7c18e..d5c8907 100644
--- a/operations/common/gblur-1d.c
+++ b/operations/common/gblur-1d.c
@@ -765,6 +765,21 @@ gegl_gblur_1d_get_cached_region (GeglOperation       *operation,
   return cached_region;
 }
 
+static GeglSplitStrategy
+gegl_gblur_1d_get_split_strategy (GeglOperation        *operation,
+                                  GeglOperationContext *context,
+                                  const gchar          *output_prop,
+                                  const GeglRectangle  *result,
+                                  gint                  level)
+{
+  GeglProperties *o = GEGL_PROPERTIES (operation);
+
+  if (o->orientation == GEGL_ORIENTATION_HORIZONTAL)
+    return GEGL_SPLIT_STRATEGY_HORIZONTAL;
+  else
+    return GEGL_SPLIT_STRATEGY_VERTICAL;
+}
+
 static GeglAbyssPolicy
 to_gegl_policy (GeglGblur1dPolicy policy)
 {
@@ -899,6 +914,7 @@ gegl_op_class_init (GeglOpClass *klass)
   filter_class    = GEGL_OPERATION_FILTER_CLASS (klass);
 
   filter_class->process                    = gegl_gblur_1d_process;
+  filter_class->get_split_strategy         = gegl_gblur_1d_get_split_strategy;
   operation_class->prepare                 = gegl_gblur_1d_prepare;
   operation_class->process                 = operation_process;
   operation_class->get_bounding_box        = gegl_gblur_1d_get_bounding_box;


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