Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Issue 61643011: SSE2 implementation of RGBA box blurs. This yields ~2X perf improvement on (Closed)

Created:
7 years, 1 month ago by Stephen White
Modified:
7 years, 1 month ago
Reviewers:
mtklein, reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

SSE2 implementation of RGBA box blurs. This yields ~2X perf improvement on Xeon ES-2690. R=mtklein@google.com Committed: https://code.google.com/p/skia/source/detail?r=12204

Patch Set 1 #

Patch Set 2 : Add missing file #

Patch Set 3 : Prevent use of SSE2 when division optimization is disabled #

Patch Set 4 : Add another missing file. #

Total comments: 11

Patch Set 5 : Query for all four blur platform procs at once. Revert to file-local enums for kX, kY. #

Patch Set 6 : Use _mm_prefetch; add x-only and y-only benches #

Patch Set 7 : Add a reinterpret_cast to please MSC. #

Total comments: 19

Patch Set 8 : Added comments, namespace; factored out expand fn; fix _none.cpp. #

Patch Set 9 : Add some more whitespace #

Total comments: 7

Patch Set 10 : Fixes from review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -20 lines) Patch
M bench/BlurImageFilterBench.cpp View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M gyp/opts.gyp View 1 2 3 3 chunks +3 lines, -0 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 2 3 4 3 chunks +8 lines, -20 lines 0 comments Download
A src/opts/SkBlurImage_opts.h View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
A src/opts/SkBlurImage_opts_SSE2.h View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
A src/opts/SkBlurImage_opts_SSE2.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +115 lines, -0 lines 0 comments Download
A src/opts/SkBlurImage_opts_none.cpp View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
M src/opts/opts_check_SSE2.cpp View 1 2 3 4 2 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Stephen White
Mike & Mike: PTAL. Thanks!
7 years, 1 month ago (2013-11-08 00:03:14 UTC) #1
mtklein
Haven't worked through the SSE yet. Will tomorrow! https://codereview.chromium.org/61643011/diff/80001/src/effects/SkBlurImageFilter.cpp File src/effects/SkBlurImageFilter.cpp (right): https://codereview.chromium.org/61643011/diff/80001/src/effects/SkBlurImageFilter.cpp#newcode192 src/effects/SkBlurImageFilter.cpp:192: SkBoxBlurProc ...
7 years, 1 month ago (2013-11-08 02:11:03 UTC) #2
mtklein
https://codereview.chromium.org/61643011/diff/80001/src/opts/SkBlurImage_opts_SSE2.h File src/opts/SkBlurImage_opts_SSE2.h (right): https://codereview.chromium.org/61643011/diff/80001/src/opts/SkBlurImage_opts_SSE2.h#newcode11 src/opts/SkBlurImage_opts_SSE2.h:11: template <SkBlurDirection srcDirection, SkBlurDirection dstDirection> Okay, this breaks my ...
7 years, 1 month ago (2013-11-08 02:17:59 UTC) #3
Stephen White
Thanks for your review. https://codereview.chromium.org/61643011/diff/80001/src/effects/SkBlurImageFilter.cpp File src/effects/SkBlurImageFilter.cpp (right): https://codereview.chromium.org/61643011/diff/80001/src/effects/SkBlurImageFilter.cpp#newcode192 src/effects/SkBlurImageFilter.cpp:192: SkBoxBlurProc boxBlurX = SkBoxBlurGetPlatformProc(kX_BlurDirection, kX_BlurDirection); ...
7 years, 1 month ago (2013-11-08 15:47:47 UTC) #4
mtklein
https://codereview.chromium.org/61643011/diff/80001/src/opts/SkBlurImage_opts_SSE2.cpp File src/opts/SkBlurImage_opts_SSE2.cpp (right): https://codereview.chromium.org/61643011/diff/80001/src/opts/SkBlurImage_opts_SSE2.cpp#newcode68 src/opts/SkBlurImage_opts_SSE2.cpp:68: SK_PREFETCH(sptr + (rightOffset + 1) * srcStrideX); On 2013/11/08 ...
7 years, 1 month ago (2013-11-08 18:42:33 UTC) #5
Stephen White
https://codereview.chromium.org/61643011/diff/210001/src/opts/SkBlurImage_opts_SSE2.cpp File src/opts/SkBlurImage_opts_SSE2.cpp (right): https://codereview.chromium.org/61643011/diff/210001/src/opts/SkBlurImage_opts_SSE2.cpp#newcode16 src/opts/SkBlurImage_opts_SSE2.cpp:16: enum BlurDirection { On 2013/11/08 18:42:34, mtklein wrote: > ...
7 years, 1 month ago (2013-11-08 20:20:48 UTC) #6
mtklein
Just a couple nits. LGTM. https://codereview.chromium.org/61643011/diff/210001/src/opts/SkBlurImage_opts_SSE2.cpp File src/opts/SkBlurImage_opts_SSE2.cpp (right): https://codereview.chromium.org/61643011/diff/210001/src/opts/SkBlurImage_opts_SSE2.cpp#newcode29 src/opts/SkBlurImage_opts_SSE2.cpp:29: __m128i scale = _mm_set1_epi32((1 ...
7 years, 1 month ago (2013-11-08 20:37:34 UTC) #7
Stephen White
https://codereview.chromium.org/61643011/diff/330001/src/opts/SkBlurImage_opts_SSE2.cpp File src/opts/SkBlurImage_opts_SSE2.cpp (right): https://codereview.chromium.org/61643011/diff/330001/src/opts/SkBlurImage_opts_SSE2.cpp#newcode27 src/opts/SkBlurImage_opts_SSE2.cpp:27: inline __m128i expand(int a) { On 2013/11/08 20:37:35, mtklein ...
7 years, 1 month ago (2013-11-08 20:47:44 UTC) #8
Stephen White
Committed patchset #10 manually as r12204 (presubmit successful).
7 years, 1 month ago (2013-11-08 20:49:14 UTC) #9
mtklein
7 years, 1 month ago (2013-11-08 20:49:21 UTC) #10
Message was sent while issue was closed.
lgtm

https://codereview.chromium.org/61643011/diff/330001/src/opts/SkBlurImage_opt...
File src/opts/SkBlurImage_opts_SSE2.cpp (right):

https://codereview.chromium.org/61643011/diff/330001/src/opts/SkBlurImage_opt...
src/opts/SkBlurImage_opts_SSE2.cpp:27: inline __m128i expand(int a) {
On 2013/11/08 20:47:45, Stephen White wrote:
> On 2013/11/08 20:37:35, mtklein wrote:
> > int -> uint32_t?
> 
> The declaration for _mm_cvtsi32_si128 just takes an int, so I'd rather just
> stick with that for compatibility.

SGTM

Powered by Google App Engine
This is Rietveld 408576698