After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758534 - transform-core: prepare vfunc doesn't match optimizations in process vfunc
transform-core: prepare vfunc doesn't match optimizations in process vfunc
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: operations
git master
Other All
: Normal normal
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2015-11-23 11:55 UTC by Debarshi Ray
Modified: 2015-11-23 12:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program to demonstrate gegl:translate with NEAREST (2.34 KB, text/plain)
2015-11-23 11:57 UTC, Debarshi Ray
  Details
operations/transform/transform-core: Avoid conversions in fast paths (1.47 KB, patch)
2015-11-23 12:04 UTC, Debarshi Ray
committed Details | Review
operations/transform/transform-core: Remove redundant check (807 bytes, patch)
2015-11-23 12:09 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2015-11-23 11:55:47 UTC
transform-core's process vfunc has fast paths for intermediate nodes, the identity matrix, fast translate matrices, and when translating using the NEAREST sampler. These fast paths either pass the input buffer on to the output (like gegl:nop), or create a shifted output buffer from the input.

This means that there is no need to perform any Babl format transformations on the pixel data. Therefore, the prepare vfunc should set the correct input/output formats for the fast paths to achieve their full potential.

Currently, the prepare vfunc only knows about fast translate matrices and (by accident?) the identity matrix which is also a fast translate matrix. This makes the operation slower by an order of magnitude in the other optimized paths. See attached test case.
Comment 1 Debarshi Ray 2015-11-23 11:57:13 UTC
Created attachment 316089 [details]
Test program to demonstrate gegl:translate with NEAREST
Comment 2 Debarshi Ray 2015-11-23 11:58:48 UTC
Test data: https://rishi.fedorapeople.org/IMG_0631.jpg
Comment 3 Debarshi Ray 2015-11-23 12:04:17 UTC
Created attachment 316090 [details] [review]
operations/transform/transform-core: Avoid conversions in fast paths
Comment 4 Debarshi Ray 2015-11-23 12:09:10 UTC
Created attachment 316091 [details] [review]
operations/transform/transform-core: Remove redundant check
Comment 5 Debarshi Ray 2015-11-23 12:29:18 UTC
From #gegl on GIMPNet:

12:09 <rishi> pippin: https://bugzilla.gnome.org/show_bug.cgi?id=758534
12:11 <pippin>  there is more cleanup pending in there as well... :)
12:12 <pippin> I'm on phone now but if make check passes,. and it otherwise     
      seems fine - push at will :)
Comment 6 Debarshi Ray 2015-11-23 12:30:44 UTC
commit 5cde5d7107492906442530a6aba4a64fb8f6faa1
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Mon Nov 23 13:07:59 2015 +0100

    operations/transform/transform-core: Remove redundant check
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758534

commit 0f5af44eb86e12c6fec864fafac0f8dd644cfeb8
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Mon Nov 23 13:03:17 2015 +0100

    operations/transform/transform-core: Avoid conversions in fast paths
    
    The fast paths either pass the input buffer on to the output (like
    gegl:nop), or create a shifted output buffer from the input. Hence,
    there is no need for any Babl format conversions.
    
    We don't need to check for the identity matrix because it is also a
    fast translate matrix. Add a comment to clarify that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758534