diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2012-02-15 00:52:08 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2012-02-15 00:52:08 +0000 |
commit | 82ffe8cb63a7551346c0e655714e24b54a696f1e (patch) | |
tree | 13ca9824d2208f16e41f5295093e840522a527b9 /include | |
parent | c7b56e4119bc8870fc4f35ac38159414cfe54ff1 (diff) | |
parent | 061c58a5d30290c29f25044cbe9bdcf00364f333 (diff) | |
download | xine-lib-82ffe8cb63a7551346c0e655714e24b54a696f1e.tar.gz xine-lib-82ffe8cb63a7551346c0e655714e24b54a696f1e.tar.bz2 |
Merge from 1.1.
--HG--
rename : src/xine-utils/xineutils.h => include/xine/xineutils.h
Diffstat (limited to 'include')
-rw-r--r-- | include/xine/xineutils.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h index 5b8b4f1f4..608384ad7 100644 --- a/include/xine/xineutils.h +++ b/include/xine/xineutils.h @@ -254,20 +254,21 @@ extern void (*yuy2_to_yv12) unsigned char *v_dst, int v_dst_pitch, int width, int height) XINE_PROTECTED; -/* convert full range rgb to mpeg range yuv */ -#define SCALESHIFT 16 -#define SCALEFACTOR (1<<SCALESHIFT) +#define SCALEFACTOR 65536 #define CENTERSAMPLE 128 +/* These conversions are normalised for the MPEG Y'CbCr colourspace. + * (Yes, we know that we call it YUV elsewhere.) + */ #define COMPUTE_Y(r, g, b) \ (unsigned char) \ - (((y_r_table[r] + y_g_table[g] + y_b_table[b]) >> SCALESHIFT) + 16) + ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR) #define COMPUTE_U(r, g, b) \ (unsigned char) \ - (((u_r_table[r] + u_g_table[g] + u_b_table[b]) >> SCALESHIFT) + CENTERSAMPLE) + ((u_r_table[r] + u_g_table[g] + u_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) #define COMPUTE_V(r, g, b) \ (unsigned char) \ - (((v_r_table[r] + v_g_table[g] + v_b_table[b]) >> SCALESHIFT) + CENTERSAMPLE) + ((v_r_table[r] + v_g_table[g] + v_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) #define UNPACK_BGR15(packed_pixel, r, g, b) \ b = (packed_pixel & 0x7C00) >> 7; \ |