On 2012-03-09 21:58, Krzysztof Kosiński wrote:
W dniu 8 marca 2012 19:42 użytkownik Jasper van de Gronde <th.v.d.gronde@...528...> napisał: I used this approach to abstract away the OpenMP multithreading support. It works well for the majority of filters, but I admit it's not optimal for morphology. You can ignore ink_cairo_surface_synthesize if you implement multithreading yourself. For example, Gaussian blur does not use these templates at all.
Okay, will do.
You can also try implementing the triple box blur approximation for Gaussian blur, which should be a lot faster than the current approach. The details are in the SVG filter specification. I tried doing this some time ago, but the result was all wrong and I couldn't figure out why.
It is faster, but not so much faster that it's worth the decrease in quality. The current scheme also requires a small fixed amount of operations per pixel, the main difference is that it really needs doubles, while repeated boxblurring can get away with integers. When both approaches are fully accelerated using SSE and such I actually doubt that apart from the increased memory bandwidth needed for doubles there would be much of a difference. Having said that, I have some ideas for getting rid of the current code in favor of something more similar to repeated boxblurring, but I still have to work out some issues (even with boxblurring it is not entirely trivial to handle boundaries properly, which the current scheme does do).