summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_tile.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-04-07 19:58:18 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-04-07 19:58:18 +0100
commitecdd6bc3e297375d288a9e19e6ca356b7fadcbd4 (patch)
treeeeb4379034e9549edde62643d5443b1390565785 /src/gallium/auxiliary/util/u_tile.c
parent7f9444050fbf91a5727617ba39806f28ea0921a2 (diff)
util: Remove u_tile.c YCbCr's.
Superseded by u_format_yuv.c. Also PIPE_FORMAT_YUYV's interpretation was inconsistent: it was being interpreted as VYUY.
Diffstat (limited to 'src/gallium/auxiliary/util/u_tile.c')
-rw-r--r--src/gallium/auxiliary/util/u_tile.c94
1 files changed, 0 insertions, 94 deletions
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index 9f2bb81cd8..88a1424dff 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -244,94 +244,6 @@ z32f_get_tile_rgba(const float *src,
}
-/*** PIPE_FORMAT_UYVY / PIPE_FORMAT_YUYV ***/
-
-/**
- * Convert YCbCr (or YCrCb) to RGBA.
- */
-static void
-ycbcr_get_tile_rgba(const ushort *src,
- unsigned w, unsigned h,
- float *p,
- unsigned dst_stride,
- boolean rev)
-{
- const float scale = 1.0f / 255.0f;
- unsigned i, j;
-
- for (i = 0; i < h; i++) {
- float *pRow = p;
- /* do two texels at a time */
- for (j = 0; j < (w & ~1); j += 2, src += 2) {
- const ushort t0 = src[0];
- const ushort t1 = src[1];
- const ubyte y0 = (t0 >> 8) & 0xff; /* luminance */
- const ubyte y1 = (t1 >> 8) & 0xff; /* luminance */
- ubyte cb, cr;
- float r, g, b;
-
- if (rev) {
- cb = t1 & 0xff; /* chroma U */
- cr = t0 & 0xff; /* chroma V */
- }
- else {
- cb = t0 & 0xff; /* chroma U */
- cr = t1 & 0xff; /* chroma V */
- }
-
- /* even pixel: y0,cr,cb */
- r = 1.164f * (y0-16) + 1.596f * (cr-128);
- g = 1.164f * (y0-16) - 0.813f * (cr-128) - 0.391f * (cb-128);
- b = 1.164f * (y0-16) + 2.018f * (cb-128);
- pRow[0] = r * scale;
- pRow[1] = g * scale;
- pRow[2] = b * scale;
- pRow[3] = 1.0f;
- pRow += 4;
-
- /* odd pixel: use y1,cr,cb */
- r = 1.164f * (y1-16) + 1.596f * (cr-128);
- g = 1.164f * (y1-16) - 0.813f * (cr-128) - 0.391f * (cb-128);
- b = 1.164f * (y1-16) + 2.018f * (cb-128);
- pRow[0] = r * scale;
- pRow[1] = g * scale;
- pRow[2] = b * scale;
- pRow[3] = 1.0f;
- pRow += 4;
-
- }
- /* do the last texel */
- if (w & 1) {
- const ushort t0 = src[0];
- const ushort t1 = src[1];
- const ubyte y0 = (t0 >> 8) & 0xff; /* luminance */
- ubyte cb, cr;
- float r, g, b;
-
- if (rev) {
- cb = t1 & 0xff; /* chroma U */
- cr = t0 & 0xff; /* chroma V */
- }
- else {
- cb = t0 & 0xff; /* chroma U */
- cr = t1 & 0xff; /* chroma V */
- }
-
- /* even pixel: y0,cr,cb */
- r = 1.164f * (y0-16) + 1.596f * (cr-128);
- g = 1.164f * (y0-16) - 0.813f * (cr-128) - 0.391f * (cb-128);
- b = 1.164f * (y0-16) + 2.018f * (cb-128);
- pRow[0] = r * scale;
- pRow[1] = g * scale;
- pRow[2] = b * scale;
- pRow[3] = 1.0f;
- pRow += 4;
- }
- p += dst_stride;
- }
-}
-
-
void
pipe_tile_raw_to_rgba(enum pipe_format format,
void *src,
@@ -356,12 +268,6 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
case PIPE_FORMAT_Z32_FLOAT:
z32f_get_tile_rgba((float *) src, w, h, dst, dst_stride);
break;
- case PIPE_FORMAT_UYVY:
- ycbcr_get_tile_rgba((ushort *) src, w, h, dst, dst_stride, FALSE);
- break;
- case PIPE_FORMAT_YUYV:
- ycbcr_get_tile_rgba((ushort *) src, w, h, dst, dst_stride, TRUE);
- break;
default:
util_format_read_4f(format,
dst, dst_stride * sizeof(float),