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

Issue 1577703006: Optimized premultiplying swizzles for NEON (Closed)

Created:
4 years, 11 months ago by msarett
Modified:
4 years, 11 months ago
Reviewers:
scroggo, mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Optimized premultiplying swizzles for NEON Improves decode performance for RGBA encoded PNGs. Swizzle Time on Nexus 9 (with clang): SwapPremul 0.44x Premul 0.44x Decode Time On Nexus 9 (with clang): ZeroInit Decodes 0.85x Regular Decodes 0.86x Swizzle Time on Nexus 6P (with clang) SwapPremul 0.14x Premul 0.14x Decode Time On Nexus 6P (with clang): ZeroInit Decodes 0.93x Regular Decodes 0.95x Notes: ZeroInit means memory is zero initialized, and we do not write to memory for large sections of zero pixels (memory use opt for Android). A profile on Nexus 9 shows that the premultiplication step of PNG decoding is now ~5% of decode time (down from ~20%). BUG=skia:4767 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577703006 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/3a24f459582f2665f0e66bd35a0d8f46a1c4c72f

Patch Set 1 : #

Total comments: 14

Patch Set 2 : Response to comments #

Total comments: 20

Patch Set 3 : Fixed loop bugs #

Total comments: 4

Patch Set 4 : Refactor portable code #

Total comments: 2

Patch Set 5 : Remove unnecessary if statement #

Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -52 lines) Patch
M src/core/SkOpts.cpp View 1 2 2 chunks +1 line, -52 lines 0 comments Download
M src/opts/SkOpts_neon.cpp View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
A src/opts/SkSwizzler_opts.h View 1 2 3 4 1 chunk +153 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 26 (10 generated)
msarett
https://codereview.chromium.org/1577703006/diff/20001/src/opts/SkOpts_neon.cpp File src/opts/SkOpts_neon.cpp (right): https://codereview.chromium.org/1577703006/diff/20001/src/opts/SkOpts_neon.cpp#newcode52 src/opts/SkOpts_neon.cpp:52: premul_xxxa = sk_neon::premul_xxxa; This actually doesn't work. In order ...
4 years, 11 months ago (2016-01-13 14:05:38 UTC) #4
mtklein
I think I know why Init_neon() doesn't run. It's a silly oversight from when we ...
4 years, 11 months ago (2016-01-13 14:08:48 UTC) #5
mtklein
On 2016/01/13 14:08:48, mtklein wrote: > I think I know why Init_neon() doesn't run. It's ...
4 years, 11 months ago (2016-01-13 14:28:01 UTC) #6
mtklein
Does +18% mean the runtime is 0.847x? I find these things usually easier to think/talk ...
4 years, 11 months ago (2016-01-13 14:29:54 UTC) #7
mtklein
https://codereview.chromium.org/1577703006/diff/20001/src/opts/SkSwizzler_neon.h File src/opts/SkSwizzler_neon.h (right): https://codereview.chromium.org/1577703006/diff/20001/src/opts/SkSwizzler_neon.h#newcode127 src/opts/SkSwizzler_neon.h:127: rgba.val[0] = result_blues; On 2016/01/13 14:05:38, msarett wrote: > ...
4 years, 11 months ago (2016-01-13 14:33:18 UTC) #8
mtklein
https://codereview.chromium.org/1577703006/diff/20001/src/opts/SkSwizzler_neon.h File src/opts/SkSwizzler_neon.h (right): https://codereview.chromium.org/1577703006/diff/20001/src/opts/SkSwizzler_neon.h#newcode17 src/opts/SkSwizzler_neon.h:17: static void premul_xxxa(uint32_t dst[], const uint32_t src[], int count) ...
4 years, 11 months ago (2016-01-13 15:20:01 UTC) #9
msarett
"Ooops, got myself confused. Let's stick to our guns. This should do the trick: 1) ...
4 years, 11 months ago (2016-01-13 16:17:16 UTC) #11
scroggo
I'll defer to Mike's approval here. I'm excited about the speed-ups!
4 years, 11 months ago (2016-01-13 17:02:21 UTC) #12
mtklein
https://codereview.chromium.org/1577703006/diff/40001/src/core/SkOpts.cpp File src/core/SkOpts.cpp (right): https://codereview.chromium.org/1577703006/diff/40001/src/core/SkOpts.cpp#newcode84 src/core/SkOpts.cpp:84: decltype( premul_xxxa) premul_xxxa = sk_default::premul_xxxa<false>; I'd prefer to add ...
4 years, 11 months ago (2016-01-13 17:04:37 UTC) #13
msarett
https://codereview.chromium.org/1577703006/diff/40001/src/core/SkOpts.cpp File src/core/SkOpts.cpp (right): https://codereview.chromium.org/1577703006/diff/40001/src/core/SkOpts.cpp#newcode84 src/core/SkOpts.cpp:84: decltype( premul_xxxa) premul_xxxa = sk_default::premul_xxxa<false>; On 2016/01/13 17:04:36, mtklein ...
4 years, 11 months ago (2016-01-13 18:52:05 UTC) #14
mtklein
https://codereview.chromium.org/1577703006/diff/60001/src/opts/SkSwizzler_opts.h File src/opts/SkSwizzler_opts.h (right): https://codereview.chromium.org/1577703006/diff/60001/src/opts/SkSwizzler_opts.h#newcode55 src/opts/SkSwizzler_opts.h:55: uint8x8_t b = bgra.val[0], It'd be nice to harmonize ...
4 years, 11 months ago (2016-01-13 21:04:17 UTC) #15
msarett
Changed the commit message to measure performance improvement of: (1) Just the swizzle step. (2) ...
4 years, 11 months ago (2016-01-13 21:30:27 UTC) #19
mtklein
lgtm https://codereview.chromium.org/1577703006/diff/120001/src/opts/SkSwizzler_opts.h File src/opts/SkSwizzler_opts.h (right): https://codereview.chromium.org/1577703006/diff/120001/src/opts/SkSwizzler_opts.h#newcode113 src/opts/SkSwizzler_opts.h:113: if (count > 0) { This check isn't ...
4 years, 11 months ago (2016-01-13 21:45:34 UTC) #20
msarett
https://codereview.chromium.org/1577703006/diff/120001/src/opts/SkSwizzler_opts.h File src/opts/SkSwizzler_opts.h (right): https://codereview.chromium.org/1577703006/diff/120001/src/opts/SkSwizzler_opts.h#newcode113 src/opts/SkSwizzler_opts.h:113: if (count > 0) { On 2016/01/13 21:45:34, mtklein ...
4 years, 11 months ago (2016-01-13 22:11:30 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1577703006/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1577703006/140001
4 years, 11 months ago (2016-01-13 22:11:44 UTC) #24
commit-bot: I haz the power
4 years, 11 months ago (2016-01-13 22:32:05 UTC) #26
Message was sent while issue was closed.
Committed patchset #5 (id:140001) as
https://skia.googlesource.com/skia/+/3a24f459582f2665f0e66bd35a0d8f46a1c4c72f

Powered by Google App Engine
This is Rietveld 408576698