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

Issue 105893003: NEON fast path for box blur (Closed)

Created:
7 years ago by zheng.xu
Modified:
6 years, 11 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

NEON fast path for box blur Calculate 8 channels in parallel by using 16-bits to store each channel. Due to the limitation of VQRDMULH, (int16 * int16 * 2 + 0x8000) >> 16, the fast path can only support kernelSize < 128. 8 significant bits are kept at least in each stage, the final error should less-equal than 1. Pre-fetching memory for X-direction read. In fact pre-fetching memory doesn't help much for Y direction read, since it is a waste to load a cache line for only read 8 bytes.(I left it there to keep the symmetry. pre-fetch is cheap :) ) bench data on Nexus 10 before: running bench [640 480] blur_image_filter_large_10.00_10.00 8888: cmsecs = 25081.48 running bench [640 480] blur_image_filter_small_10.00_10.00 8888: cmsecs = 25038.04 running bench [640 480] blur_image_filter_large_1.00_1.00 8888: cmsecs = 25209.04 running bench [640 480] blur_image_filter_small_1.00_1.00 8888: cmsecs = 24928.01 running bench [640 480] blur_image_filter_large_0.00_1.00 8888: cmsecs = 17160.98 running bench [640 480] blur_image_filter_large_0.00_10.00 8888: cmsecs = 17924.11 running bench [640 480] blur_image_filter_large_1.00_0.00 8888: cmsecs = 14609.19 running bench [640 480] blur_image_filter_large_10.00_0.00 8888: cmsecs = 14625.91 after: running bench [640 480] blur_image_filter_large_10.00_10.00 8888: cmsecs = 14848.42 running bench [640 480] blur_image_filter_small_10.00_10.00 8888: cmsecs = 16037.29 running bench [640 480] blur_image_filter_large_1.00_1.00 8888: cmsecs = 14819.55 running bench [640 480] blur_image_filter_small_1.00_1.00 8888: cmsecs = 14563.69 running bench [640 480] blur_image_filter_large_0.00_1.00 8888: cmsecs = 11905.34 running bench [640 480] blur_image_filter_large_0.00_10.00 8888: cmsecs = 11883.85 running bench [640 480] blur_image_filter_large_1.00_0.00 8888: cmsecs = 9576.51 running bench [640 480] blur_image_filter_large_10.00_0.00 8888: cmsecs = 9793.84 BUG= Committed: http://code.google.com/p/skia/source/detail?r=13036

Patch Set 1 #

Total comments: 20

Patch Set 2 : fix coding style issues #

Patch Set 3 : add gm and bench cases with large sigma to cover the box blur path with kernelSize >= 128 #

Patch Set 4 : pre-fetch data for X direction in the code path kernelSize > 128 #

Patch Set 5 : #

Total comments: 8

Patch Set 6 : fix a typo #

Total comments: 2

Patch Set 7 : remove useless prefetch. #

Total comments: 6

Patch Set 8 : #

Patch Set 9 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -8 lines) Patch
M bench/BlurImageFilterBench.cpp View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M expectations/gm/ignored-tests.txt View 1 2 3 4 5 6 7 1 chunk +9 lines, -0 lines 2 comments Download
M gm/imageblur.cpp View 1 2 3 4 5 6 7 3 chunks +14 lines, -5 lines 0 comments Download
M src/opts/SkBlurImage_opts_neon.cpp View 1 2 3 4 5 6 7 8 3 chunks +90 lines, -3 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
zheng.xu
7 years ago (2013-12-12 04:21:40 UTC) #1
Stephen White
Thanks for the patch! Does this provide results which match the existing path pixel-for-pixel? So ...
7 years ago (2013-12-12 05:30:30 UTC) #2
zheng.xu
On 2013/12/12 05:30:30, Stephen White wrote: > Thanks for the patch! > > Does this ...
7 years ago (2013-12-12 05:58:45 UTC) #3
zheng.xu
https://codereview.chromium.org/105893003/diff/1/src/opts/SkBlurImage_opts_neon.cpp File src/opts/SkBlurImage_opts_neon.cpp (right): https://codereview.chromium.org/105893003/diff/1/src/opts/SkBlurImage_opts_neon.cpp#newcode27 src/opts/SkBlurImage_opts_neon.cpp:27: inline uint8x8_t load2pixels(const SkPMColor* src, int srcStride) { On ...
7 years ago (2013-12-12 08:15:37 UTC) #4
zheng.xu
It doesn't provide results match the existing path pixel-for-pixel. Since in Skia, we use 3-pass ...
7 years ago (2013-12-12 08:29:25 UTC) #5
zheng.xu
bench data for patch set 4: before: running bench [640 480] blur_image_filter_large_80.00_80.00 8888: cmsecs = ...
7 years ago (2013-12-12 08:32:07 UTC) #6
kevin.petit.not.used.account
I've tested the patch: 5 mismatching GMs on my Chromebook, errors never exceed 2. I ...
7 years ago (2013-12-12 15:29:31 UTC) #7
zheng.xu
>> pre-fetch is cheap :) > Be careful with that assumption, especially if testing only ...
7 years ago (2013-12-13 04:31:58 UTC) #8
kevin.petit.not.used.account
On 2013/12/13 04:31:58, zheng.xu wrote: > >> pre-fetch is cheap :) > > > Be ...
7 years ago (2013-12-13 15:58:47 UTC) #9
zheng.xu
@Stephen White, any other comments?
7 years ago (2013-12-19 12:01:23 UTC) #10
Stephen White
On 2013/12/19 12:01:23, zheng.xu wrote: > @Stephen White, any other comments? Since this will require ...
7 years ago (2013-12-19 15:17:20 UTC) #11
Stephen White
https://codereview.chromium.org/105893003/diff/90001/src/opts/SkBlurImage_opts_neon.cpp File src/opts/SkBlurImage_opts_neon.cpp (right): https://codereview.chromium.org/105893003/diff/90001/src/opts/SkBlurImage_opts_neon.cpp#newcode37 src/opts/SkBlurImage_opts_neon.cpp:37: return vld1_u8((uint8_t*)src); Looks like you removed the actual fetch ...
7 years ago (2013-12-19 15:27:03 UTC) #12
zheng.xu
https://codereview.chromium.org/105893003/diff/90001/src/opts/SkBlurImage_opts_neon.cpp File src/opts/SkBlurImage_opts_neon.cpp (right): https://codereview.chromium.org/105893003/diff/90001/src/opts/SkBlurImage_opts_neon.cpp#newcode37 src/opts/SkBlurImage_opts_neon.cpp:37: return vld1_u8((uint8_t*)src); On 2013/12/19 15:27:03, Stephen White wrote: > ...
7 years ago (2013-12-20 04:29:54 UTC) #13
zheng.xu
Stephen White: ping :)
6 years, 11 months ago (2014-01-07 13:44:44 UTC) #14
Stephen White
On 2013/12/12 08:29:25, zheng.xu wrote: > It doesn't provide results match the existing path pixel-for-pixel. ...
6 years, 11 months ago (2014-01-09 15:05:52 UTC) #15
zheng.xu
On 2014/01/09 15:05:52, Stephen White wrote: > On 2013/12/12 08:29:25, zheng.xu wrote: > > It ...
6 years, 11 months ago (2014-01-10 11:24:42 UTC) #16
reed1
Skia testing *does* allow for small pixel differences, based on CPU optimizations (e.g. SSE or ...
6 years, 11 months ago (2014-01-10 14:54:56 UTC) #17
Stephen White
Actually, I think we should take this patch. I was just wondering if there was ...
6 years, 11 months ago (2014-01-10 15:13:38 UTC) #18
Stephen White
LGTM https://codereview.chromium.org/105893003/diff/150001/expectations/gm/ignored-tests.txt File expectations/gm/ignored-tests.txt (right): https://codereview.chromium.org/105893003/diff/150001/expectations/gm/ignored-tests.txt#newcode65 expectations/gm/ignored-tests.txt:65: # blur related GM results need rebaslining Nit: ...
6 years, 11 months ago (2014-01-10 15:14:22 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/zheng.xu@arm.com/105893003/150001
6 years, 11 months ago (2014-01-13 08:00:56 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/zheng.xu@arm.com/105893003/150001
6 years, 11 months ago (2014-01-13 08:11:18 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/zheng.xu@arm.com/105893003/150001
6 years, 11 months ago (2014-01-13 08:16:36 UTC) #22
commit-bot: I haz the power
Change committed as 13036
6 years, 11 months ago (2014-01-13 08:16:49 UTC) #23
zheng.xu
https://codereview.chromium.org/105893003/diff/150001/expectations/gm/ignored-tests.txt File expectations/gm/ignored-tests.txt (right): https://codereview.chromium.org/105893003/diff/150001/expectations/gm/ignored-tests.txt#newcode65 expectations/gm/ignored-tests.txt:65: # blur related GM results need rebaslining On 2014/01/10 ...
6 years, 11 months ago (2014-01-13 11:27:18 UTC) #24
zheng.xu
2 verylargebitmap gm cases failed recently. But it should have no relationship with this patch. ...
6 years, 11 months ago (2014-01-13 12:18:42 UTC) #25
Stephen White
6 years, 11 months ago (2014-01-13 17:59:15 UTC) #26
Message was sent while issue was closed.
On 2014/01/13 12:18:42, zheng.xu wrote:
> 2 verylargebitmap gm cases failed recently. But it should have no relationship
> with this patch.
> compared to succeeded/failure-ignored verylargebitmap cases on other builders
or
> backends, it looks like the expected image is wrong or the tests should be
> ignored.
> 
> But I have no idea, why these 2 failure occur after this patch was committed.

I believe those tests are flaky, especially on the Win8 bots:
https://code.google.com/p/skia/issues/detail?id=1978

Powered by Google App Engine
This is Rietveld 408576698