aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/gm.gni
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-09-12 16:04:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-13 14:10:50 +0000
commitb433c5691b0d130697a89e7362c76ec6ae74a254 (patch)
tree01a11ab79e68fca774977f9e33e9b89d73d5d71f /gn/gm.gni
parent489bef054ee912992195a905c1035b5059dc9c57 (diff)
Adjust GPU YUV -> RGB (JPG) conversion
All of the published coefficients assume math is being done on bytes, and that 128 is the encoding of 0 (in the biased Cb and Cr values). When sampling an A8 texture, though, GPUs typically decode as byte/255. Thus, 128 ends up slightly larger than 0.5. To fix this, just adjust the bias terms to be scaled by 128/255, rather than 0.5. I also changed some of the other coefficients to be higher precision, based on the values in ITU-T T.871. This originally surfaced as a Chromium bug where an all-black JPG decoded to (1/255, 0, 1/255) on GPU. I've added a GM that encodes a color cube to JPG, then draws from the encoded data. GPU and CPU (libjpeg) still disagree in many cases, but the newer version performs much better (diffing gl and 8888 configs): Previously: 95.2% of pixels differ, max diff of 2, avg diff of 1 Now : 65.4% of pixels differ, max diff of 1, avg diff of 0 Bug: skia:7038 chromium:763605 Change-Id: I4801db9f6e2fc4d4109eb5e27c9499f214084d38 Reviewed-on: https://skia-review.googlesource.com/45842 Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'gn/gm.gni')
-rw-r--r--gn/gm.gni1
1 files changed, 1 insertions, 0 deletions
diff --git a/gn/gm.gni b/gn/gm.gni
index 4da11bd815..3ccf8a8948 100644
--- a/gn/gm.gni
+++ b/gn/gm.gni
@@ -185,6 +185,7 @@ gm_sources = [
"$_gm/imagesource2.cpp",
"$_gm/internal_links.cpp",
"$_gm/inversepaths.cpp",
+ "$_gm/jpg_color_cube.cpp",
"$_gm/largeglyphblur.cpp",
"$_gm/lattice.cpp",
"$_gm/lcdblendmodes.cpp",