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

Issue 1349563007: Disable dithering in libjpeg-turbo for 565 decodes (Closed)

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

Description

Disable dithering in libjpeg-turbo for 565 decodes libjpeg-turbo turns on dithering by default. When we decode to RGBA, it uses Floyd-Steinberg dithering - consistent with the libjpeg6b gold standard, When we decode to 565, it uses ordered dithering. Ordered dithering for 565 is not part of the 6b standard (libjpeg6b doesn't even support 565) and is causing us a number of issues: (1) Ordered dithering + nearest neighbor sampling is causing checkerboard visual artifacts in some outputs. (2) The ordered dither function in libjpeg-turbo actually behaves differently depending on the alignment of the memory that it decodes into. This means that two image decodes that should be identical may look different just because they decode into different memory blocks. This was causing some diffs on Gold with the scanline_subset test that were causing me some confusion. (3) Maybe not the best evidence, but visually I can't tell a difference with and without dithering (except when nearest neighbor scaling causes the checkerboard artifact). (4) Turning off dithering should be a more significant performance improvement than you might expect. libjpeg-turbo has SIMD color conversions to 565, but when dithering is on, it defaults to scalar code. This CL should make every jpeg decode to 565 on Gold look slightly different. Yay! BUG=skia: Committed: https://skia.googlesource.com/skia/+/8ff6ca6e73644b0bec65c9dfeaa5ca01110d948c

Patch Set 1 #

Total comments: 3

Patch Set 2 : Added suggested test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -9 lines) Patch
M src/codec/SkJpegCodec.cpp View 1 chunk +4 lines, -0 lines 0 comments Download
M tests/CodexTest.cpp View 1 2 chunks +12 lines, -9 lines 2 comments Download

Depends on Patchset:

Messages

Total messages: 9 (2 generated)
msarett
5 years, 3 months ago (2015-09-18 14:16:18 UTC) #2
scroggo
First off, I want to say that this is a perfect CL description. It describes ...
5 years, 3 months ago (2015-09-18 15:42:41 UTC) #3
msarett
“First off, I want to say that this is a perfect CL description. It describes ...
5 years, 3 months ago (2015-09-18 18:15:08 UTC) #4
scroggo
lgtm https://codereview.chromium.org/1349563007/diff/20001/tests/CodexTest.cpp File tests/CodexTest.cpp (right): https://codereview.chromium.org/1349563007/diff/20001/tests/CodexTest.cpp#newcode83 tests/CodexTest.cpp:83: bool supports565 = true) { Do all the ...
5 years, 3 months ago (2015-09-18 18:35:30 UTC) #5
msarett
https://codereview.chromium.org/1349563007/diff/20001/tests/CodexTest.cpp File tests/CodexTest.cpp (right): https://codereview.chromium.org/1349563007/diff/20001/tests/CodexTest.cpp#newcode83 tests/CodexTest.cpp:83: bool supports565 = true) { On 2015/09/18 18:35:30, scroggo ...
5 years, 3 months ago (2015-09-18 18:59:26 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1349563007/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1349563007/20001
5 years, 3 months ago (2015-09-18 18:59:38 UTC) #8
commit-bot: I haz the power
5 years, 3 months ago (2015-09-18 19:06:07 UTC) #9
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://skia.googlesource.com/skia/+/8ff6ca6e73644b0bec65c9dfeaa5ca01110d948c

Powered by Google App Engine
This is Rietveld 408576698