Krita useable for Blender movies

Cyrille Berger cberger at cberger.net
Sat Oct 31 11:28:31 CET 2009


On Friday 30 October 2009, LukasT.dev at gmail.com wrote:
> CPU optimizations
> * Implement MMX, SSE, SSE2 for composite ops (as compilation option to
>  avoid problems).

I started to look at that about two years ago, then I dropped when I started 
to work on opengtl, since I hoped llvm would be able to generate vectorization 
for us, and we would just need to write our composite ops in CTL, 
unfortunately autovectorization is still only "future" plan for llvm, so maybe 
it is indeed a good idea to have again a look at that.

There are two ways of doing this:
1) hand-made composite ops (like in the gimp), you write by hand the different 
composite ops with the different vectorizations instructions
2) with template, you write the composite op once, and with the magic of 
templates it uses either the CPU or SIMD. Basically you would want to write P 
=P1 + P2; and it either implement P1 + P2 with SIMD instruction or CPU.

The advantage of 1) is that you have much better visibility of what you write. 
The drawback is that you have a lot of code to test, write and maintain.

The inconvenient of 2) is that since the SIMD mechanism is hidden, you might 
do something stupid and not notice it (stupid like, not using the fastest 
instruction).
About 2), when I looked at that I started to write a library, libfastpp (fast 
pixel processing), which do the template mechanism, I have not tested it in a 
long time, but it was almost complete. I also know that eigen has some 
template interfaces that are similar to what would be needed here. Eigen would 
have the advantage that we do not have to maintain the library, but I am not 
sure if it suits our need.

My preferrence go to 2). First step would be to see if eigen can suit our 
need, otherwise fallback to libfastpp.

> Tiles
> * Iterators should be rewritten so that they are cached
Hopefully we do not need to rewrite them :) just improve.

-- 
Cyrille Berger


More information about the kimageshop mailing list