Sunday, September 27, 2009

Turning off Threading for Recursive Processing


In general threading is a great thing for image processing code, since you get close to a Nx speedup for N threads running on different cpu cores. So why would you want to turn it off?

It's possible in Studio Artist's MSG modular image processing architecture to build recursive IO connections. For some MSG processors it doesn't matter, but for things like warps or filtering where the output image buffer is also the input image buffer, strange and magical things happen because of the recursive feedback created by this kind of recursive processing. Now if you thread the processing into multiple cores processing separate bands in the image the recursive spatial feedback is broken up into N chunks. So you get a banded visual effect associated with the recursive processing that is very different than what you would see with non-threaded processing. And the banding is a function of the number of cpu cores.

So i added a new Studio Artist 4 preference option yesterday that lets you turn MSG threading off if you wish. The image at the top of this post is with threading off. The image below is with threading on. Notice the difference in the appearance.


Now sometimes the banding effect associated with threaded processing can be visually quite stunning, so you really do want to have the option of choosing whether you are running this kind of preset with threading on or off.

No comments: