<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 4, 2017 at 8:50 AM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail-h5">On Wed, May 3, 2017 at 11:53 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-m_8592241497030159484HOEnZb"><div class="gmail-m_8592241497030159484h5">On Wednesday, May 3, 2017 11:37:52 PM PDT Johnson Lin wrote:<br>
> The matrix used for YCbCr to RGB is listed in:<br>
><br>
> <a href="https://en.wikipedia.org/wiki/YCbCr" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/<wbr>YCbCr</a><br>
><br>
> There was an error in converting the offsets from integers to unorm<br>
> values: 0.0625=16/256 should be 16.0/255,and 0.5=128.0/256 should be<br>
> 128.0/255.  With this fix, the CSC result is bit aligned with wikipedia's<br>
> conversion result and FFMPeg's result.<br>
> ---<br>
>  src/compiler/nir/nir_lower_tex<wbr>.c | 6 +++---<br>
>  1 file changed, 3 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/src/compiler/nir/nir_lower_t<wbr>ex.c b/src/compiler/nir/nir_lower_t<wbr>ex.c<br>
> index 352d1499bc8d..4ef81955513e 100644<br>
> --- a/src/compiler/nir/nir_lower_t<wbr>ex.c<br>
> +++ b/src/compiler/nir/nir_lower_t<wbr>ex.c<br>
> @@ -244,9 +244,9 @@ convert_yuv_to_rgb(nir_builder *b, nir_tex_instr *tex,<br>
>     nir_ssa_def *yuv =<br>
>        nir_vec4(b,<br>
>                 nir_fmul(b, nir_imm_float(b, 1.16438356f),<br>
> -                        nir_fadd(b, y, nir_imm_float(b, -0.0625f))),<br>
> -               nir_channel(b, nir_fadd(b, u, nir_imm_float(b, -0.5f)), 0),<br>
> -               nir_channel(b, nir_fadd(b, v, nir_imm_float(b, -0.5f)), 0),<br>
> +                        nir_fadd(b, y, nir_imm_float(b, -16.0f / 255.0f))),<br>
> +               nir_channel(b, nir_fadd(b, u, nir_imm_float(b, -128.0f / 255.0f)), 0),<br>
> +               nir_channel(b, nir_fadd(b, v, nir_imm_float(b, -128.0f / 255.0f)), 0),<br>
>                 nir_imm_float(b, 0.0));<br>
><br>
>     nir_ssa_def *red = nir_fdot4(b, yuv, nir_build_imm(b, 4, 32, m[0]));<br>
> --<br>
> 1.9.1<br>
><br>
> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
><br>
<br>
</div></div>I scooped up the various tags:<br>
<br>
    Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=100854" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/s<wbr>how_bug.cgi?id=100854</a><br>
    Reviewed-by: Eric Anholt <<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>><br>
    Reviewed-by: Kristian H. Kristensen <<a href="mailto:hoegsberg@google.com" target="_blank">hoegsberg@google.com</a>></blockquote></div></div></div></div></div></blockquote><div><br></div><div>Yes, the version here looks good. For reference, this fixes two Android CTS cases:</div><div><br></div><div><span style="font-family:monospace;font-size:13px">android.media.cts.EncodeVirtualDisplayWithCompositionTest#testRenderingMaxResolutionLocally</span><br style="font-family:monospace;font-size:13px"><span style="font-family:monospace;font-size:13px">android.media.cts.EncodeVirtualDisplayWithCompositionTest#testRenderingMaxResolutionRemotely</span><br style="font-family:monospace;font-size:13px"></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Did you also scoop up a stable CC?<br></div></div></div></div>
</blockquote></div><br></div></div>