Optimize RGBAtoRGB function |
||||||
Issue descriptionCalls to the new API canvas.toBlob() will scan pixels and convert it to RGB when the export format is JPEG. That is quite expensive on ARM and could be made much faster by using NEON instructions.
,
Dec 14 2016
Sample trace screenshot comparing the scalar code X NEON (device tested was Nexus 6).
,
Dec 14 2016
,
Dec 14 2016
From the trace, the CPU Self time went from an average of 0.077ms to 0.018ms, yielding a saving of around 238 ms for the test case.
,
Dec 14 2016
,
Dec 14 2016
,
Dec 16 2016
,
Dec 17 2016
Using vraddhn dropped the walltime even more (from 90ms to 77ms).
,
Jan 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/39aabd2e6f55099ec252ee0fa12f51549e4b011c commit 39aabd2e6f55099ec252ee0fa12f51549e4b011c Author: cavalcantii <cavalcantii@chromium.org> Date: Fri Jan 06 18:40:11 2017 Introducing a perf test for canvas.toBlob() JPEG case The idea is to allow to monitor performance gains while optimizing parts of the JPEG code path. BUG= 674264 Review-Url: https://codereview.chromium.org/2617843002 Cr-Commit-Position: refs/heads/master@{#441989} [add] https://crrev.com/39aabd2e6f55099ec252ee0fa12f51549e4b011c/third_party/WebKit/PerformanceTests/Canvas/toBlob_duration_jpeg.html
,
Jan 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b630fb4deab73deea701d7122154a2835dbdf7fc commit b630fb4deab73deea701d7122154a2835dbdf7fc Author: cavalcantii <cavalcantii@chromium.org> Date: Mon Jan 09 09:34:43 2017 NEON-ize RGBA to RGB code The code path alone was made at least 4x faster than the original (from 85us to 14us in a Nexus 6), lowering the runtime of pixel conversion in 1/4 (e.g. from 330ms to 77ms in a 4K canvas). This yields a global improvement of about 15% while calling canvas.toBlob() and toDataURL() when the output format is JPEG and canvas is hardware accelerated. BUG= 674264 Review-Url: https://codereview.chromium.org/2576223002 Cr-Commit-Position: refs/heads/master@{#442218} [modify] https://crrev.com/b630fb4deab73deea701d7122154a2835dbdf7fc/third_party/WebKit/Source/platform/BUILD.gn [modify] https://crrev.com/b630fb4deab73deea701d7122154a2835dbdf7fc/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoder.cpp [add] https://crrev.com/b630fb4deab73deea701d7122154a2835dbdf7fc/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoderTest.cpp [add] https://crrev.com/b630fb4deab73deea701d7122154a2835dbdf7fc/third_party/WebKit/Source/platform/image-encoders/RGBAtoRGB.h
,
Jan 9 2017
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by cavalcantii@chromium.org
, Dec 14 2016