Bug 12801 - Speed up NEAREST non-rotation scaling
Summary: Speed up NEAREST non-rotation scaling
Status: RESOLVED FIXED
Alias: None
Product: pixman
Classification: Unclassified
Component: pixman (show other bugs)
Version: git master
Hardware: Other All
: medium enhancement
Assignee: Søren Sandmann Pedersen
QA Contact: Søren Sandmann Pedersen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-14 15:27 UTC by Björn Lindqvist
Modified: 2010-02-13 15:48 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Speed up NEAREST only scaling like 3x (11.11 KB, patch)
2007-10-14 15:28 UTC, Björn Lindqvist
Details | Splinter Review
Test program to measure scaling performance with (3.62 KB, patch)
2007-10-14 15:29 UTC, Björn Lindqvist
Details | Splinter Review

Description Björn Lindqvist 2007-10-14 15:27:18 UTC
Hello, this is a patch to pixman that optimize the
PIXMAN_FILTER_NEAREST + PIXMAN_REPEAT_NORMAL + n_clip == 1 case. It
turns out that this case is the fastest one when scaling images with
cairo without rotating.

On my computer, this speeds up pure non-rotating scales of ARGB
surfaces where source is 64x64 and destination size is 1000x1000 from
49.60 ms to 13.20 ms. I have also attached a test program which is
supposed to emulate GDK's gdk_pixbuf_color_composite() function with
cairo. Using that program the speed up is from 62.08 ms to 31.88 ms.

The downside is that the patch 153 lines of code. 

I think that all cases should be expanded in a similar way. If the
for-statement that plot pixels contain an if-statement, then that
if-statement should be moved out of the loop if possible. This
increases the code size by a lot, but that should be possible to clean
up using clever macros. Kind of like how the pixops library does it.
Comment 1 Björn Lindqvist 2007-10-14 15:28:23 UTC
Created attachment 12039 [details] [review]
Speed up NEAREST only scaling like 3x
Comment 2 Björn Lindqvist 2007-10-14 15:29:14 UTC
Created attachment 12040 [details] [review]
Test program to measure scaling performance with
Comment 3 Søren Sandmann Pedersen 2010-02-13 15:48:09 UTC
Somehow this patch fell through the cracks. Sorry about that.

These days we do have fast path support for NEAREST scaling, and this patch doesn't really apply anymore, so I'm marking this bug as FIXED.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.