1. 03 Jan, 2019 1 commit
    • Ell's avatar
      gegl:invert[-gamma]: add format-specific variants · fee15ff5
      Ell authored
      Factor out the common logic of gegl:invert and gegl:invert-gamma
      into invert-common.h, and implement format-specific variants, which
      significantly improves performance for int images.  In particular,
      this speeds up selection invertion in GIMP, which uses gegl:invert.
      fee15ff5
  2. 02 Jan, 2019 5 commits
    • Ell's avatar
      buffer: in GeglBufferIterator, alias compatible sub-iterators · aace10e2
      Ell authored
      In GeglBufferIterator, when several sub-iterators are compatible --
      i.e., they use the same tile storage and format, fully overlap, and
      don't read outside the abyss -- combine their access modes into the
      first sub-iterator, and make the rest aliases for it, using the
      same data buffer, so that we only fetch the tile, or read/write the
      data, once per iteration.
      aace10e2
    • Ell's avatar
      buffer: in GeglBufferIterator, avoid discarding tile data if aliased · bd7a1f58
      Ell authored
      In GeglBufferIterator, avoid discarding tile data through write-
      only sub-iterators accessing the entire tile, if another sub-
      iterator reads the same tile, during the same iteration.
      bd7a1f58
    • Michael Natterer's avatar
      Issue #118 - Distorts/Waves filter: default period too high · 9bef289c
      Michael Natterer authored
      Reduce the default period to 100 so it produces an immediately obvious
      effect on more image sizes.
      9bef289c
    • Ell's avatar
      buffer: keep tile data-pointer indetity in gegl_buffer_linear_new_from_data() · db4a061e
      Ell authored
      In gegl_buffer_linear_new_from_data(), set the buffer's linear
      tile's keep_identity flag, to guarantee that its data-pointer
      identity is kept throughout the lifetime of the buffer.
      db4a061e
    • Ell's avatar
      buffer: add GeglTile::keep_identity flag · e82a3fba
      Ell authored
      Add a keep_identity flag to GeglTile, which indicates that the
      tile's data pointer's identity must be maintained.  When the flag
      is set, we avoid cloning the tile in gegl_tile_dup(), and rather
      perform a direct copy, since we have to way to unclone the tile
      without changing its data pointer.  Additionally, we avoid trimming
      the tile out of the cache, since the tile storage might copy its
      data and get rid of the tile, returning a new tile, with a
      different data pointer, when re-fetching it.
      e82a3fba
  3. 01 Jan, 2019 5 commits
    • Ell's avatar
      buffer: in GeglTileHandlerZoom, avoid copying fully-damaged tiles · 0f3dff02
      Ell authored
      In GeglTileHandlerZoom, restore the original damage mask of the
      tile before locking it for writing, so that fully-damaged tile data
      doesn't get unnecessarily copied during uncloning.
      0f3dff02
    • Ell's avatar
      buffer: in GeglBufferIterator, avoid fetching/copying whole write-only tiles · 926e0c6c
      Ell authored
      In GeglBufferIterator, use gegl_tile_handler_get_tile() to fetch
      tiles, instead of gegl_buffer_get_tile(), and don't preserve tile
      data when the buffer is accessed for writing only, and the entire
      tile is being written to.  This avoids unnecessarily fetching the
      tile from storage, or copying its data during uncloning.
      926e0c6c
    • Ell's avatar
      buffer: in gegl_buffer_set(), avoid fetching/copying whole tiles · 8a6bbcc3
      Ell authored
      In gegl_buffer_iterate_write(), use gegl_tile_handler_get_tile() to
      fetch written-to tiles, instead of gegl_buffer_get_tile(), and
      don't preserve tile data when the entire tile is being written to.
      This avoids unnecessarily fetching the tile from storage, or
      copying its data during uncloning.
      8a6bbcc3
    • Ell's avatar
      buffer: add gegl_tile_handler_get[_source]_tile() · 4a2a74fd
      Ell authored
      In GeglTileHandler, add new gegl_tile_handler_get[_source]_tile()
      functions, which fetch a tile with a given coordinates from the
      tile handler (or its source).  If the tile doesn't exist, these
      functions return a newly-created tile.
      
      The functions take an additional preserve_data argument.  When it
      is FALSE, the existing tile data doesn't have to be preserved,
      which allow us to perform several optimizations:  Instead of trying
      to fetch the tile using a TILE_GET command, we look up the tile in
      the cache.  If the tile is not in the cache, we return a new tile
      -- this avoids unnecesarily reading the tile from the storage, or
      generating it.  If the tile is in the cache, we fully damage it, so
      that if it's uncloned, its existing data won't be copied (see last
      commit).
      4a2a74fd
    • Ell's avatar
      buffer: don't copy/zero data when uncloning fully-damaged tile · 3636a264
      Ell authored
      When uncloning a fully-damaged tile, allocate a new buffer for the
      tile data, but don't copy the old data over (or zero the new
      buffer, if it's an empty tile), since the existing data is
      conceptually invalid, and will be overwritten anyway.
      
      The next few commits fully damage tiles that are going to be fully
      overwritten, so that, if they have to be uncloned, we don't
      needlessly copy/zero their data.
      3636a264
  4. 31 Dec, 2018 1 commit
  5. 30 Dec, 2018 5 commits
  6. 23 Dec, 2018 2 commits
  7. 22 Dec, 2018 3 commits
  8. 21 Dec, 2018 2 commits
    • Debarshi Ray's avatar
      processor: Simplify and optimize rendering to the cache · 8915459b
      Debarshi Ray authored
      A GeglNode which is not a sink or is a sink that needs its entire input
      in one go, has to be rendered to its own GeglCache. In such cases,
      it is easier to ask gegl_node_blit to render to the cache, instead of
      doing it manually by rendering to a linear memory buffer and then
      writing it to the cache.
      
      If the GeglNode caches naturally during processing, then there's no
      need to separately write to the cache once the processing is over. This
      is something that gegl_node_blit is smart enough to know.
      
      !14
      8915459b
    • Debarshi Ray's avatar
      GeglNode: Don't copy if the result is already in the destination · 72bbcf05
      Debarshi Ray authored
      This can happen if the GeglNode has been explicitly asked to render to
      its own GeglCache, even when it caches naturally during the processing
      of the graph. eg., if the GeglNode and its underlying GeglOperation
      haven't disabled caching and the area being rendered lies within the
      node's bounding box.
      
      In such cases, the GeglBuffer obtained out of processing the GeglNode
      is its own GeglCache. Hence, there's no need to copy it to the
      destination buffer if the destination is the cache itself.
      
      !14
      72bbcf05
  9. 20 Dec, 2018 3 commits
  10. 19 Dec, 2018 1 commit
  11. 18 Dec, 2018 2 commits
  12. 17 Dec, 2018 10 commits
    • Ell's avatar
    • Ell's avatar
      buffer: fix race condition in GeglTileBackendSwap · c130b8be
      Ell authored
      ... when compressing a tile before pushing to the queue in one
      thread, while changing the swap compression algorithm in another
      thread.
      c130b8be
    • Ell's avatar
      configure.ac: verify zlib version · d0fa5a97
      Ell authored
      ... and whitespace foo in gegl-compression-zlib.c
      d0fa5a97
    • Ell's avatar
      buffer: deprecate gegl_tile_backend_unlink_swap() · a4b93a37
      Ell authored
      ... in favor of gegl_buffer_swap_remove_file().
      
      Adapt GeglTileBackendFileAsync to the change.
      
      This should have been part of commit
      b61f9015.
      a4b93a37
    • Ell's avatar
      buffer: add gegl_buffer_swap_has_file() · 1597e17d
      Ell authored
      ... which checks if a given file is a swap file, that is, if it has
      been created with gegl_buffer_swap_create_file(), and hasn't been
      removed yet.
      1597e17d
    • Ell's avatar
      gegl-stats: rename "{tile-cache,swap}-total-uncloned" to "-uncompressed" · 1ee31231
      Ell authored
      In GeglStats, rename the "swap-total-uncloned" property to "swap-
      total-uncompressed", since it now factors the space the swap would
      occupy without *any* form of compression: both block cloning, and
      tile-data compression.
      
      Rename "tile-cache-total-uncloned" to "tile-cache-total-
      uncompressed", for consistency, even though tile cloning is
      currently the only form of compression employed by the cache.
      1ee31231
    • Ell's avatar
      buffer, gegl-config: compress tile data stored in the swap · 9a7738da
      Ell authored
      Use gegl-compression to compress tile data stored in the swap.
      This can both reduce the swap size, and improve its speed, by
      minimizing I/O.  Compression is normally performed by the writer
      thread, however, if the swap queue is full, and a thread attempting
      to store a tile has to block, the thread attempting the store
      compresses the tile before blocking, to minimize the tile cost in
      the queue, and to distribute compression over multiple threads,
      improving tile-store speed.  Decompression is always performed by
      the thread fetching the tile.
      
      Add a "swap-compression" property to GeglConfig (and a
      corresponding --gegl-swap-compression command-line option, and
      GEGL_SWAP_COMPRESSION environment variable), which specifies the
      compression algorithm to be used by the swap.  This property is set
      to "fast" by default.  Setting it to "none" disables compression
      (in contrast to "nop", which doesn't technically *disables*
      compression, but rather uses a NOP compression).
      
      Note that the "swap-compression" property can be changed during
      runtime, which affects the compression used for future tile stores
      (but doesn't affect existing stored tiles).  This can be used, for
      example, to select a better algorithm when running out of swap
      space.
      9a7738da
    • Ell's avatar
      gegl-compression: add "fast", "balanced", and "best" aliases · 11fb76af
      Ell authored
      ... which alias concrete algorithms, based on availability,
      offerring a trade-off between speed and quality.
      11fb76af
    • Ell's avatar
      gegl-compression: add zlib algorithms · ace1a79e
      Ell authored
      Add "zlib", and "zlib1" through "zlib9", compression algorithms,
      which use zlib's DEFLATE algorithm to compress the data.  The
      numeric suffix specifies the compression level, with higher levels
      being better, but slower; "zlib" uses the default compression
      level.
      
      These algorithms are only present when the zlib library is
      available.
      ace1a79e
    • Ell's avatar
      gegl-compression: add RLE algorithms · d87873cd
      Ell authored
      Add a set of RLE compression algorithms: "rle1", "rle2", "rle4",
      and "rle8".  The numeric suffix specifies the unit of compression,
      in bits -- the algorithms independently compress the respective
      units of each pixel.  That is, "rle1" RLE-compresses the first bit
      of each pixel, then the second bit of each pixel, and so on, while
      "rle8" RLE-compresses the first byte of each pixel, then the second
      byte of each pixel, and so on.  Smaller units yield better, but
      slower, compression.
      d87873cd