Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(243)

Issue 6327044: SSE optimization for 565 pixel format (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 4 months ago by Lei
Modified:
12 years, 2 months ago
Reviewers:
TomH, reed1
Base URL:
http://svn.python.org/view/*checkout*/python/branches/release25-maint/
Visibility:
Public.

Description

Actually, these optimizations were done based on Android Eclair and Froyo branches. At that time, Android Framework were mainly using rgb565. Currently most are using 32b pixel format by default. However there are still some cases which are using 565 format (e.g. system UI on Android). Also, it's expected that these optimizations will also benefit other embedded platforms. The benefit measurement I got on Android platform has several cases: 1. skia_bench -config 565 -forceBlend 1 -forceDither 1 -repeat 30 w/o these opts: D/skia ( 1824): running bench [640 480] bitmap_8888 D/skia ( 1824): 565: cmsecs = 157.49 w/ these opts: D/skia ( 1728): running bench [640 480] bitmap_8888 D/skia ( 1728): 565: cmsecs = 26.78 2. skia_bench -config 565 -repeat 30 w/o these opts: D/skia ( 2954): running bench [640 480] bitmap_8888 D/skia ( 2954): 565: cmsecs = 27.39 D/skia ( 2954): D/skia ( 2954): running bench [640 480] bitmap_8888_A D/skia ( 2954): 565: cmsecs = 79.04 w/ these opts: D/skia ( 2573): running bench [640 480] bitmap_8888 D/skia ( 2573): 565: cmsecs = 13.19 D/skia ( 2573): D/skia ( 2573): running bench [640 480] bitmap_8888_A D/skia ( 2573): 565: cmsecs = 27.41 3: skia_bench -config 565 -forceBlend 1 -repeat 30 w/o these opts: D/skia ( 2216): running bench [640 480] bitmap_8888 D/skia ( 2216): 565: cmsecs = 115.36 D/skia ( 2216): D/skia ( 2216): running bench [640 480] bitmap_8888_A D/skia ( 2216): 565: cmsecs = 110.25 w/ these opts: D/skia ( 2575): running bench [640 480] bitmap_8888 D/skia ( 2575): 565: cmsecs = 23.18 D/skia ( 2575): D/skia ( 2575): running bench [640 480] bitmap_8888_A D/skia ( 2575): 565: cmsecs = 38.36 4: skia_bench -config 565 -forceDither 1 -repeat 30 w/o these opts: D/skia ( 1477): running bench [640 480] bitmap_8888 D/skia ( 1477): 565: cmsecs = 92.68 D/skia ( 1477): D/skia ( 1477): running bench [640 480] bitmap_8888_A D/skia ( 1477): 565: cmsecs = 88.33 w/ these opts: D/skia ( 3315): running bench [640 480] bitmap_8888 D/skia ( 3315): 565: cmsecs = 16.25 D/skia ( 3315): D/skia ( 3315): running bench [640 480] bitmap_8888_A D/skia ( 3315): 565: cmsecs = 29.54 After running several times and double check between the results, it's stable.

Patch Set 1 #

Patch Set 2 : include SkDither.h #

Patch Set 3 : replaced __restrict__ with SK_RESTRICT and use intptr_t instead of int for casting pointers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+836 lines, -1 line) Patch
src/opts/SkBlitRow_opts_SSE2.h View 1 2 1 chunk +24 lines, -0 lines 0 comments Download
src/opts/SkBlitRow_opts_SSE2.cpp View 1 2 2 chunks +791 lines, -0 lines 0 comments Download
src/opts/opts_check_SSE2.cpp View 1 1 chunk +21 lines, -1 line 0 comments Download

Messages

Total messages: 14
Lei
12 years, 4 months ago (2012-06-21 10:08:57 UTC) #1
reed1
lgtm
12 years, 4 months ago (2012-07-09 15:21:54 UTC) #2
reed1
If we don't already have them, we should write some benchmarks to exercise these, so ...
12 years, 4 months ago (2012-07-09 15:23:44 UTC) #3
Lei
Hi Reed, we did these optimizations on Eclair and Froyo platforms. As I said in ...
12 years, 3 months ago (2012-07-16 07:55:04 UTC) #4
Lei
Hi Reed, I update the benefit measurement in the description. Please help check. Thanks very ...
12 years, 3 months ago (2012-07-24 08:34:15 UTC) #5
reed1
nice looking bench results. However, it didn't build for me on top of today's sources: ...
12 years, 3 months ago (2012-07-24 13:58:17 UTC) #6
Lei
Thanks for you check. The error is introduced that SkDither.h is not included. I will ...
12 years, 3 months ago (2012-07-25 03:04:00 UTC) #7
Lei
include SkDither.h
12 years, 3 months ago (2012-07-25 03:04:27 UTC) #8
Lei
Hi Reed, please help check if you can also get the benefit on Mac when ...
12 years, 3 months ago (2012-07-27 03:09:00 UTC) #9
TomH
Header file needs to use SK_RESTRICT, not __restrict__, to work cross-platform.
12 years, 3 months ago (2012-07-27 13:05:52 UTC) #10
reed1
my summary of the issues: 1. cast pointers for bit masking using (intptr_t) instead of ...
12 years, 3 months ago (2012-07-27 13:32:29 UTC) #11
Lei
replaced __restrict__ with SK_RESTRICT and use intptr_t instead of int for casting pointers
12 years, 2 months ago (2012-08-23 09:19:32 UTC) #12
Lei
Hi Reed, sorry for the late reply. I fixed the issues according to your suggestion. ...
12 years, 2 months ago (2012-08-23 09:23:42 UTC) #13
Lei
12 years, 2 months ago (2012-08-28 03:37:46 UTC) #14
The patch landed in r4799. Thanks, Reed! closed this issue.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b