GNOME Bugzilla – Bug 758534
transform-core: prepare vfunc doesn't match optimizations in process vfunc
Last modified: 2015-11-23 12:30:44 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.
Created attachment 316089 [details] Test program to demonstrate gegl:translate with NEAREST
Test data: https://rishi.fedorapeople.org/IMG_0631.jpg
Created attachment 316090 [details] [review] operations/transform/transform-core: Avoid conversions in fast paths
Created attachment 316091 [details] [review] operations/transform/transform-core: Remove redundant check
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 :)
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