diff options
author | José Fonseca <[email protected]> | 2010-04-07 19:58:18 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-04-07 19:58:18 +0100 |
commit | ecdd6bc3e297375d288a9e19e6ca356b7fadcbd4 (patch) | |
tree | eeb4379034e9549edde62643d5443b1390565785 | |
parent | 7f9444050fbf91a5727617ba39806f28ea0921a2 (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.
-rw-r--r-- | src/gallium/auxiliary/util/u_format.csv | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_tile.c | 94 |
2 files changed, 0 insertions, 96 deletions
diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 0cf539247e7..f23352fcad7 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -111,8 +111,6 @@ PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED , plain, 1, 1, f32, u8 , x24 , , xy__, # http://www.fourcc.org/yuv.php#UYVY PIPE_FORMAT_UYVY , subsampled, 2, 1, x32 , , , , xyz1, yuv # http://www.fourcc.org/yuv.php#YUYV (a.k.a http://www.fourcc.org/yuv.php#YUY2) -# XXX: u_tile.c's ycbcr_get_tile_rgba actually interprets it as VYUY but the -# intent should be to match D3DFMT_YUY2 PIPE_FORMAT_YUYV , subsampled, 2, 1, x32 , , , , xyz1, yuv # same subsampling but with rgb channels PIPE_FORMAT_R8G8_B8G8_UNORM , subsampled, 2, 1, x32 , , , , xyz1, rgb diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 9f2bb81cd8f..88a1424dff4 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), |