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

Issue 2046013002: Optimize color xforms with 2.2 gammas for SSE2 (Closed)

Created:
4 years, 6 months ago by msarett
Modified:
4 years, 6 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

Optimize color xforms with 2.2 gammas for SSE2 Because we recognize commonly used gamma tables and parameters as 2.2f, about 98% of jpegs with color profiles will pass through this xform (assuming the dst is also 2.2f). Sample size is 10,322 jpegs. I won't go crazy with performance numbers because this is a work in progress, particularly in terms of correctness. 201295.jpg on HP z620 (300x280, most common form of sRGB profile) Decode Time + QCMS Xform 1.28 ms QCMS Xform Only 0.495 ms Decode Time + Skia Opt Xform 1.01 ms Skia Opt Xform Only 0.235 ms Decode Time + Xform Speed-up 1.27x Xform Only Speed-up 2.11x FWIW, Skia xform time before these optimizations was 41.1 ms. But we expected that code to be slow. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046013002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/a9e878c836994bce695274b4c28890290139dcdf

Patch Set 1 : #

Total comments: 2

Patch Set 2 : #

Total comments: 20

Patch Set 3 : Response to comments #

Total comments: 2

Patch Set 4 : Clarify different versions of clamping #

Total comments: 6

Patch Set 5 : Response to comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -74 lines) Patch
M bench/ColorCodecBench.cpp View 1 chunk +4 lines, -0 lines 0 comments Download
M src/core/SkColorSpaceXform.h View 1 chunk +3 lines, -5 lines 0 comments Download
M src/core/SkColorSpaceXform.cpp View 1 2 3 4 4 chunks +43 lines, -69 lines 0 comments Download
M src/core/SkOpts.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M src/core/SkOpts.cpp View 2 chunks +4 lines, -0 lines 0 comments Download
A src/opts/SkColorXform_opts.h View 1 2 3 4 1 chunk +181 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (19 generated)
msarett
I was hoping to win by a bit more (given that we may need to ...
4 years, 6 months ago (2016-06-07 19:43:49 UTC) #10
mtklein
I take it the plan is: 1) pin down correctness 2) NEON 3) AVX+ ? ...
4 years, 6 months ago (2016-06-08 01:41:41 UTC) #11
mtklein
https://codereview.chromium.org/2046013002/diff/80001/src/core/SkOpts.h File src/core/SkOpts.h (right): https://codereview.chromium.org/2046013002/diff/80001/src/core/SkOpts.h#newcode74 src/core/SkOpts.h:74: extern void (*color_xform_2Dot2_RGBA_to_8888)(uint32_t* dst, const uint32_t* src, int len, ...
4 years, 6 months ago (2016-06-08 02:01:40 UTC) #12
msarett
> I take it the plan is: > 1) pin down correctness > 2) NEON ...
4 years, 6 months ago (2016-06-08 13:48:29 UTC) #13
scroggo
https://codereview.chromium.org/2046013002/diff/100001/src/opts/SkColorXform_opts.h File src/opts/SkColorXform_opts.h (right): https://codereview.chromium.org/2046013002/diff/100001/src/opts/SkColorXform_opts.h#newcode15 src/opts/SkColorXform_opts.h:15: static uint8_t clamp_float_to_byte(float v) { This method is slightly ...
4 years, 6 months ago (2016-06-08 17:08:34 UTC) #15
msarett
https://codereview.chromium.org/2046013002/diff/100001/src/opts/SkColorXform_opts.h File src/opts/SkColorXform_opts.h (right): https://codereview.chromium.org/2046013002/diff/100001/src/opts/SkColorXform_opts.h#newcode15 src/opts/SkColorXform_opts.h:15: static uint8_t clamp_float_to_byte(float v) { On 2016/06/08 17:08:34, scroggo ...
4 years, 6 months ago (2016-06-08 17:23:16 UTC) #16
mtklein
lgtm https://codereview.chromium.org/2046013002/diff/120001/src/core/SkColorSpaceXform.cpp File src/core/SkColorSpaceXform.cpp (right): https://codereview.chromium.org/2046013002/diff/120001/src/core/SkColorSpaceXform.cpp#newcode41 src/core/SkColorSpaceXform.cpp:41: SkColorSpace::k2Dot2Curve_GammaNamed == dstSpace->gammaNamed()) { Wouldn't you feel so ...
4 years, 6 months ago (2016-06-08 18:49:57 UTC) #17
msarett
https://codereview.chromium.org/2046013002/diff/120001/src/core/SkColorSpaceXform.cpp File src/core/SkColorSpaceXform.cpp (right): https://codereview.chromium.org/2046013002/diff/120001/src/core/SkColorSpaceXform.cpp#newcode41 src/core/SkColorSpaceXform.cpp:41: SkColorSpace::k2Dot2Curve_GammaNamed == dstSpace->gammaNamed()) { On 2016/06/08 18:49:57, mtklein wrote: ...
4 years, 6 months ago (2016-06-08 19:11:13 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2046013002/140001
4 years, 6 months ago (2016-06-08 19:26:39 UTC) #20
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/9032) Build-Win-MSVC-x86_64-Debug-Trybot on ...
4 years, 6 months ago (2016-06-08 19:28:20 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2046013002/140001
4 years, 6 months ago (2016-06-08 19:40:41 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/9038) Build-Win-MSVC-x86_64-Debug-Trybot on ...
4 years, 6 months ago (2016-06-08 19:42:12 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2046013002/140001
4 years, 6 months ago (2016-06-08 20:46:27 UTC) #28
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-08 21:05:58 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2046013002/140001
4 years, 6 months ago (2016-06-08 21:43:01 UTC) #33
commit-bot: I haz the power
4 years, 6 months ago (2016-06-08 21:43:56 UTC) #35
Message was sent while issue was closed.
Committed patchset #5 (id:140001) as
https://skia.googlesource.com/skia/+/a9e878c836994bce695274b4c28890290139dcdf

Powered by Google App Engine
This is Rietveld 408576698