Summary: | YUV to RGB Color Space Conversion result is not precise | ||
---|---|---|---|
Product: | Mesa | Reporter: | johnson.lin |
Component: | glsl-compiler | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | gary.c.wang |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
johnson.lin
2017-04-27 16:32:00 UTC
Do you have a test program that shows the issue? @Matt Turner Yes I have. Also piglit test has YUV2RGB test https://cgit.freedesktop.org/piglit/tree/tests/spec/ext_image_dma_buf_import/sample_yuv.c You can extend this with the problematic YUV value: https://cgit.freedesktop.org/piglit/commit/?id=adc7e03ad59404362141093ae93b091c58bb1018 Fixed by: commit a6fb943f3eb86ca501a7e7b8d4621ba215f91133 Author: Johnson Lin <johnson.lin@intel.com> Date: Thu May 4 14:37:52 2017 +0800 nir/lower_tex: Fix minor error in YUV color conversion matrix The matrix used for YCbCr to RGB is listed in: https://en.wikipedia.org/wiki/YCbCr There was an error in converting the offsets from integers to unorm values: 0.0625=16/256 should be 16.0/255,and 0.5=128.0/256 should be 128.0/255. With this fix, the CSC result is bit aligned with wikipedia's conversion result and FFMPeg's result. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100854 Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.