b433c5691b
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> |
||
---|---|---|
.. | ||
toolchain | ||
__init__.py | ||
ar.py | ||
bench.gni | ||
BUILD.gn | ||
BUILDCONFIG.gn | ||
call.py | ||
compile_processors.py | ||
core.gni | ||
cp.py | ||
effects.gni | ||
find_headers.py | ||
find_ios_sysroot.py | ||
flutter_defines.gni | ||
gm.gni | ||
gn_helpers.py | ||
gn_meta_sln.py | ||
gn_to_bp.py | ||
gn_to_cmake.py | ||
gpu.gni | ||
gypi_to_gn.py | ||
is_clang.py | ||
opts.gni | ||
package_ios.py | ||
pdf.gni | ||
push_to_android.py | ||
run_sksllex.py | ||
samples.gni | ||
shared_sources.gni | ||
sksl.gni | ||
tests.gni | ||
utils.gni | ||
xps.gni |