1. 13 Nov, 2018 2 commits
    • Ell's avatar
      gegl/operation, operations: adapt to previous commit · 1fbd84cc
      Ell authored
      Rename gegl_operation_get_min_threaded_sub_size() to
      gegl_operation_get_pixels_per_thread().  This function returns the
      (very hypothetical, ATM) cost of using each additional thread for
      processing the operation, realtive to the cost of processing a
      single pixel.  As before, it simply returns 64 * 64 for now.  This
      function is meant to be used for the thread_cost parameter of
      Use the new function in the auto-threaded operation classes, and in
      manually-threaded operations using gegl_parallel_distribute_area().
      Additionally, use the function in manually-threaded operations
      using gegl_parallel_distribute_range(), by dividing its result by
      the relevant dimension of the processed area.
    • Ell's avatar
      gegl-parallel: improve optimal thread-count calculation · e1d01be8
      Ell authored
      Previously, the number of threads used by
      gegl_parallel_distribute_{range,area}() was proportional to the
      number of elements to be processed, such that each thread processed
      at least a user-provided minimal number of elements.  This,
      however, fails to take into account the fact that each additional
      thread lowers the effective cost of processing each additional
      element, since processing is spread over more threads, and
      therefore more elements are necessary to justify each additional
      To find the optimal number of threads to use, we assume that the
      cost of processing the elements is proportional to the number of
      elements to be processed by each thread, and that each thread
      additional incurs a fixed cost.  This cost is specified by a user-
      provided parameter, relative to the cost of processing a single
      element, replacing the old minimal per-thread element-count
      paramter (it is expected, however, that this parameter will take
      the same value as the old parameter; in particular, the minimal
      number of per-thread elements for using two threads equals the the
      In other words, the cost of processing n elements, using t threads,
      with a fixed realtive per-thread cost c, is assumed to be
      proportional to:
        n / t + c * t
      The number of threads, t, that minimize this cost, for a given per-
      thread cost, c, is roughly proportional to the square root of the
      number of elements, n.
  2. 12 Nov, 2018 6 commits
    • Ell's avatar
      po: keep POTFILES.in alphabetically ordered · f4128b16
      Ell authored
    • Ell's avatar
      operations: add module.c to CLEANFILES · 65a1bbad
      Ell authored
      Add the various generated module.c files to CLEANFILES, so that
      they get properly cleaned.  This is needed to pass distcheck since
      commit 8bf81796.
    • Piotr Drąg's avatar
      Update POTFILES.in · e1e66514
      Piotr Drąg authored
    • Jehan's avatar
      operations: make gegl:distance-transform multi-thread. · 8c79a82f
      Jehan authored
      This replaces my previous request !10. Now we can use the new
      gegl_parallel_*() API. Not using some generic API was the only thing
      which annoyed me in my previous implementation.
      Similarly to the gegl:warp parallelization, make this C++ so we can use
      lambda functions.
    • Jehan's avatar
      gegl: fix missing closing parenthese. · 2b076eb7
      Jehan authored
    • Ell's avatar
      warp: parallelize using gegl-parallel · 0c1d40ea
      Ell authored
      gegl:warp can't use auto-threading.  Use gegl-parallel to
      parallelize it manually.
      Convert the op to C++ in order to use lamdas, which simplify
      parallelizarion.  Move the op to a new common-cxx/ module, where we
      can add C++ operations, and which is only built when a suitable C++
      compiler is found.  We don't leave it in common/, since Automake
      seems to always use CXXLD to link libraries that have (potential)
      C++ sources, even if they're if-ed out after configuration.
  3. 11 Nov, 2018 2 commits
  4. 10 Nov, 2018 3 commits
    • Ell's avatar
      transform: use gegl_parallel_distribute_area() for parallelization · 7c881a60
      Ell authored
      In GeglTransformCore, use gegl_parallel_distribute_area(), added in
      the commit before last, to parallelize processing, instead of a
      local thread pool.
    • Ell's avatar
      operation: use gegl_parallel_distribute_area() for parallelization · f14b731d
      Ell authored
      In all operation types that support auto-threading, use
      gegl_parallel_distribute_area(), added in the previous commit, to
      parallelize processing, instead of local thread pools.
    • Ell's avatar
      gegl: add gegl-parallel · 43519620
      Ell authored
      gegl-parallel provides various parallel algorithms.  Currently,
      this is limited to the gegl_parallel_distribute() family of
      functions, which distribute work across multiple threads, migrated
      from GIMP.
      The following commits use these functions to replace the various
      thread-pools we use to auto-parallelize operations with simpler
      code, fixing potential dealocks as a result of nested operation
      processing, as in bug #790810, along the way.
      Since gegl-parallel is public API, it also eases manual
      parallelization of operations, inside and outside of GEGL.
  5. 05 Nov, 2018 1 commit
  6. 04 Nov, 2018 1 commit
  7. 02 Nov, 2018 1 commit
  8. 01 Nov, 2018 1 commit
  9. 31 Oct, 2018 4 commits
    • Øyvind "pippin" Kolås's avatar
    • Øyvind "pippin" Kolås's avatar
    • Øyvind "pippin" Kolås's avatar
      gegl: add gegl_babl_variant · 326b0c86
      Øyvind "pippin" Kolås authored
      This function returns a babl format derived from the passed in format,
      based on which variant is requested it will at least be floating point
      and possibly also premultiplied forced, the enum/bitflags available
      as an argument is a work in progress.
    • Øyvind "pippin" Kolås's avatar
      buffer: samplers handling dynamic number of components · 365e53a5
      Øyvind "pippin" Kolås authored
      All resampling for GeglBuffers used to happen in RaGaBaA float, now
      grayscale formats end up using YaA float instead, which will improve
      performance of scaling/rotating in GIMP as well as other tools using
      GeglBuffers resampling like the sculpt tool when in grayscale mode.
      buffer: add members for interpolation bpp/components
      buffer: make linear sampler component generic
      buffer: generalize cubic sampler
      buffer: generalize lohalo innerloop
      For now, assuming that input is still a premultiplied format and treat last component
      differently, should sniff whether the interpolation format has alpha and only do
      different treatment in that case.
      buffer: generalize nohalo for components
      buffer: nohalo slight simplification
  10. 30 Oct, 2018 1 commit
  11. 29 Oct, 2018 3 commits
  12. 28 Oct, 2018 4 commits
  13. 27 Oct, 2018 1 commit
    • Jehan's avatar
      operations: watershed-transform: do not queue labels with no... · 0f56f883
      Jehan authored
      ... unlabelled neighbours.
      Previous algorithm was queuing any labelled (i.e. unflagged) pixel to
      later unqueue it, check for its neighbour and do nothing when no
      neighbours were unlabelled (flagged). This was very inefficient
      especially as we were reading the buffer with gegl_buffer_get() when
      unqueuing (buffer iterators are not usable then since we unqueue in
      priority order).
      Before queuing a label, let's make sure it has at least one unlabelled
      neighbour, hence that it will result in actual transformation. On test
      FullHD image on my computer, previous code was running in 1+ second,
      while the optimized operation runs in about 0.1 second for the same
      image (and of course, the result is unchanged, as this doesn't change
      the actual logics).
  14. 26 Oct, 2018 1 commit
    • Jehan's avatar
      operations: make gegl:watershed-transform input format-agnostic. · 26b261a0
      Jehan authored
      Until now, gegl:watershed-transform was processing the input buffer as
      "YA u32". You could let the operation convert your data but this may not
      be what you wanted, especially if you were working on labels without
      color meaning. In any case, since we are not actually processing the
      pixel data, forcing an input format is meaningless. Now any format is
      Moreover let's make the flag value (and the component where to find it)
      parametric instead of using absolutely the alpha component and use 0 as
      unlabelled flag. For instance, this would allow to use a single
      component buffer and simply make any label in it be the "unlabelled"
      Note that the defaults are so that any previous use of this operation
      won't be broken (since we default to using the last component, hence
      alpha in "YA u32" with value 0). So we keep compatibility while allowing
      new usages.
  15. 25 Oct, 2018 2 commits
  16. 24 Oct, 2018 1 commit
  17. 23 Oct, 2018 2 commits
  18. 22 Oct, 2018 3 commits
  19. 18 Oct, 2018 1 commit