summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEwald Snel <esnel@users.sourceforge.net>2003-02-02 14:09:21 +0000
committerEwald Snel <esnel@users.sourceforge.net>2003-02-02 14:09:21 +0000
commitf003b3a69b19f53c10757080daf49b53aa99f350 (patch)
tree410ee9bec12bcb706dbead38f975b232ff696a90
parent64209c1471e0233275f034fde449e353ae42772a (diff)
downloadxine-lib-f003b3a69b19f53c10757080daf49b53aa99f350.tar.gz
xine-lib-f003b3a69b19f53c10757080daf49b53aa99f350.tar.bz2
Add contrast support to MMX yuv2rgb conversion, fix 'cbu' clipping
CVS patchset: 4090 CVS date: 2003/02/02 14:09:21
-rw-r--r--src/video_out/yuv2rgb_mmx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_out/yuv2rgb_mmx.c b/src/video_out/yuv2rgb_mmx.c
index b85acd313..c631db885 100644
--- a/src/video_out/yuv2rgb_mmx.c
+++ b/src/video_out/yuv2rgb_mmx.c
@@ -61,7 +61,7 @@ void mmx_yuv2rgb_set_csc_levels(yuv2rgb_factory_t *this,
int brightness, int contrast, int saturation)
{
int a,s,i;
- int crv, cbu, cgu, cgv;
+ int crv, cbu, cgu, cgv, cty;
if( brightness <= 16 ) {
a = 0;
@@ -76,22 +76,23 @@ void mmx_yuv2rgb_set_csc_levels(yuv2rgb_factory_t *this,
*((unsigned char *)&mmx_addYw + i) = a;
}
- saturation = (saturation > 242) ? 242 : saturation;
-
crv = Inverse_Table_6_9[this->matrix_coefficients][0];
crv = (crv * saturation + 512) / 1024;
cbu = Inverse_Table_6_9[this->matrix_coefficients][1];
cbu = (cbu * saturation + 512) / 1024;
+ cbu = (cbu > 32767) ? 32767 : cbu;
cgu = Inverse_Table_6_9[this->matrix_coefficients][2];
cgu = (cgu * saturation + 512) / 1024;
cgv = Inverse_Table_6_9[this->matrix_coefficients][3];
cgv = (cgv * saturation + 512) / 1024;
+ cty = (76309 * contrast + 512) / 1024;
for (i=0; i < 4; i++) {
*((int16_t *)&mmx_U_green + i) = -cgu;
*((int16_t *)&mmx_U_blue + i) = cbu;
*((int16_t *)&mmx_V_red + i) = crv;
*((int16_t *)&mmx_V_green + i) = -cgv;
+ *((int16_t *)&mmx_Y_coeff + i) = cty;
}
}