summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-09-13 23:18:22 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-09-13 23:18:22 +0000
commit889b6c4e7abae3f39bb89f829d00411200dafe5e (patch)
tree213a97e36b3ab438abeaeb9084d621cb435c41b6
parent58be490b08b0113faecc331015137dc70ffc68e2 (diff)
fix YCbCr component ordering typos
-rw-r--r--src/mesa/main/texformat_tmp.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h
index 86d62373324..38e5deec7b5 100644
--- a/src/mesa/main/texformat_tmp.h
+++ b/src/mesa/main/texformat_tmp.h
@@ -1,4 +1,4 @@
-/* $Id: texformat_tmp.h,v 1.3.2.2 2002/09/13 19:34:40 brianp Exp $ */
+/* $Id: texformat_tmp.h,v 1.3.2.3 2002/09/13 23:18:22 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -295,23 +295,23 @@ static void FETCH(ycbcr)( const struct gl_texture_image *texImage,
const GLushort *src0 = USHORT_SRC( texImage, (i & ~1), j, k ); /* even */
const GLushort *src1 = src0 + 1; /* odd */
const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */
- const GLubyte cr = *src0 & 0xff; /* chroma U */
+ const GLubyte cb = *src0 & 0xff; /* chroma U */
const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */
- const GLubyte cb = *src1 & 0xff; /* chroma V */
+ const GLubyte cr = *src1 & 0xff; /* chroma V */
GLchan *rgba = (GLchan *) texel;
GLint r, g, b;
if (i & 1) {
/* odd pixel: use y1,cr,cb */
- r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128));
- g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
- b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128));
- }
- else {
- /* even pixel: use y0,cr,cb */
r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128));
g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128));
}
+ else {
+ /* even pixel: use y0,cr,cb */
+ r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128));
+ g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
+ b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128));
+ }
rgba[RCOMP] = CLAMP(r, 0, CHAN_MAX);
rgba[GCOMP] = CLAMP(g, 0, CHAN_MAX);
rgba[BCOMP] = CLAMP(b, 0, CHAN_MAX);
@@ -332,16 +332,16 @@ static void FETCH(ycbcr_rev)( const struct gl_texture_image *texImage,
GLint r, g, b;
if (i & 1) {
/* odd pixel: use y1,cr,cb */
- r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128));
- g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
- b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128));
- }
- else {
- /* even pixel: use y0,cr,cb */
r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128));
g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128));
}
+ else {
+ /* even pixel: use y0,cr,cb */
+ r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128));
+ g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128));
+ b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128));
+ }
rgba[RCOMP] = CLAMP(r, 0, CHAN_MAX);
rgba[GCOMP] = CLAMP(g, 0, CHAN_MAX);
rgba[BCOMP] = CLAMP(b, 0, CHAN_MAX);