[cairo] [PATCH/RFC] Preview of fastpath for nearest neighbour scaled Over_8888x8888 operation.

Siarhei Siamashka siarhei.siamashka at nokia.com
Mon Apr 20 15:19:58 PDT 2009


Hello,

This is an attempt to port nearest neighbour fastpath functions from Xomap.

I converted only code for a8r8g8b8 OVER operation for this first patch. The
functions to support rgb565 destination format and SRC compositing operation
can be done using practically the same template.

Scaling is very fast for reasonably large images as inner loops contain only
the very minimum of operations and are also unrolled. Expensive clipping
checks and particularly slow modulo operator for NORMAL repeat are avoided.

The code should be correct for reasonably small images and scale factors.
Bigger images need special checks to make sure that there are no overflows or
any other nasty effects when doing fixed point arithmetics, especially for
NORMAL repeat case.

Handling of fetching pixels outside source image can be improved and they can
be also supported by fastpath code. For example, right now check for clipping
is done with an empty loop and we just bail out when unsupported cases of
clipping are detected. This can be done better if clipped cases are common
and need to be fast.

In addition to discussing patch functionality, I would like to ask for your
opinion/advices about coding style issues, function names, their placement,
etc. Final patch is going to contain quite a lot more lines of code, so I
wonder if everything should go to pixman-pict.c or it makes sense to split
this stuff into a separate source file?

As I mentioned before, pixman still has a lot of room for improvement.
Bilinear scaling can be also optimized and I think that I can do this work.
Feedback from application developers is also appreciated so that we know
what functionality is performance critical for software rendering and needs
more optimizations.

-- 
Best regards,
Siarhei Siamashka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Preview-of-fastpath-for-nearest-neighbour-scaled-Ove.patch
Type: text/x-diff
Size: 11720 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090421/d7cc988d/attachment.patch 


More information about the cairo mailing list