GNOME Bugzilla – Bug 142711
Selective gaussian blur filter is slow
Last modified: 2006-06-02 11:55:01 UTC
The selective gaussian blur filter is much slower than the other two guassian blur filter (IIR, RLE). Main reason is that it fully applies a convolution matrix instead of splitting it up in a horizontal and vertical pass. The matrix is decomposable, so it should be possible. Maybe it's also a good idea to merge this plug-in with the other two.
Actually the convolution is *not* decomposable when it is applied selectively. Trying to do so can produce artifacts in certain situations -- see comment #39 for bug #93856 for an example of the kind of artifact you can get. On the other hand, because selective blurring only blurs things that are already low-contrast, the artifacts will not in most cases be noticeable, so the loss in mathematical validity may be compensated by the gain in speed.
Ok, I'm going to study on this one a bit more before I change anything. In the meanwhile I made a few optimizations to the code (not the algorithm) and gained about 75 % speed. On my old Athlon 750 on a 1000 x 1000 rgb image, time was reduced from 27 to 15 seconds. Measured with CFLAGS="-O3 -march=athlon -fomit-framepointer -pipe"
It would probably not hurt to get these optimizations into CVS now.
2004-05-18 Maurits Rijk <m.rijk@chello.nl> * plug-ins/common/sel_gauss.c: HIGified, fixed indendation, speed improvement (around 70 %).
Ok, since the convolution is not decomposable and there won't be much speed gain by tweaking the code more, I'm closing this one. It's still slow as hell, but at least it's almost twice as fast (more like half as slow) as the previous version.
See bug #342860.