X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Ftexformat_tmp.h;h=eb160deff939dab4084b5a8038c8af9d8f59183a;hb=0491142152dcc61ebe0b46b05c94957e54c44bd9;hp=f3b2fb9c9c4bea87d7f1eef52fc14057b6c4fd3c;hpb=d03053688f7370064ded6dfc4912841eae39a4a9;p=mesa.git diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index f3b2fb9c9c4..eb160deff93 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1347,13 +1347,13 @@ static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, const GLubyte cb = *src0 & 0xff; /* chroma U */ const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ const GLubyte cr = *src1 & 0xff; /* chroma V */ - const GLfloat y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ - GLfloat r = 1.164 * (y - 16) + 1.596 * (cr - 128); - GLfloat g = 1.164 * (y - 16) - 0.813 * (cr - 128) - 0.391 * (cb - 128); - GLfloat b = 1.164 * (y - 16) + 2.018 * (cb - 128); - r *= (1.0 / 255.0F); - g *= (1.0 / 255.0F); - b *= (1.0 / 255.0F); + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); + GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); + GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); + r *= (1.0F / 255.0F); + g *= (1.0F / 255.0F); + b *= (1.0F / 255.0F); texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); @@ -1388,13 +1388,13 @@ static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ const GLubyte y1 = *src1 & 0xff; /* luminance */ const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ - const GLfloat y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ - GLfloat r = 1.164 * (y - 16) + 1.596 * (cr - 128); - GLfloat g = 1.164 * (y - 16) - 0.813 * (cr - 128) - 0.391 * (cb - 128); - GLfloat b = 1.164 * (y - 16) + 2.018 * (cb - 128); - r *= (1.0 / 255.0F); - g *= (1.0 / 255.0F); - b *= (1.0 / 255.0F); + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); + GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); + GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); + r *= (1.0F / 255.0F); + g *= (1.0F / 255.0F); + b *= (1.0F / 255.0F); texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); texel[BCOMP] = CLAMP(b, 0.0F, 1.0F);