[xiph-cvs] cvs commit: w3d yuv.c
Holger Waechtler
holger at xiph.org
Thu Mar 21 03:31:43 PST 2002
holger 02/03/21 03:31:42
Modified: . yuv.c
Log:
applied Lxy-Fixes by Kondoros Attila, Lxy is the default colorspace now
Revision Changes Path
1.9 +7 -7 w3d/yuv.c
Index: yuv.c
===================================================================
RCS file: /usr/local/cvsroot/w3d/yuv.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- yuv.c 2001/09/13 16:27:33 1.8
+++ yuv.c 2002/03/21 11:31:42 1.9
@@ -1,7 +1,7 @@
#include "yuv.h"
/*#define TARKIN_YUV_EXACT*/
-/*#define TARKIN_YUV_LXY*/
+#define TARKIN_YUV_LXY
static inline
@@ -28,7 +28,7 @@
}
#elif defined(TARKIN_YUV_LXY)
for (i=0; i<count; i++, rgb+=3) {
- y [i] = ((int16_t) 54 * rgb [0] + 182 * rgb [1] + 18 * rgb [2]) / 256;
+ y [i] = ((int16_t) 55 * rgb [0] + 183 * rgb [1] + 18 * rgb [2]) / 256;
u [i] = rgb [0] - y [i];
v [i] = rgb [2] - y [i];
}
@@ -58,7 +58,7 @@
}
#elif defined(TARKIN_YUV_LXY)
for (i=0; i<count; i++, rgb+=3) {
- rgb [1] = CLAMP(y [i] - (76 * u [i] - 26 * v [i]) / 256);
+ rgb [1] = CLAMP(y [i] - (77 * u [i] + 25 * v [i]) / 256);
rgb [0] = CLAMP(y [i] + u [i]);
rgb [2] = CLAMP(y [i] + v [i]);
}
@@ -88,7 +88,7 @@
}
#elif defined(TARKIN_YUV_LXY)
for (i=0; i<count; i++, rgb+=4) {
- y [i] = ((int16_t) 54 * rgb [0] + 182 * rgb [1] + 18 * rgb [2]) / 256;
+ y [i] = ((int16_t) 55 * rgb [0] + 183 * rgb [1] + 18 * rgb [2]) / 256;
u [i] = rgb [0] - y [i];
v [i] = rgb [2] - y [i];
}
@@ -118,7 +118,7 @@
}
#elif defined(TARKIN_YUV_LXY)
for (i=0; i<count; i++, rgb+=4) {
- rgb [1] = CLAMP(y [i] - (76 * u [i] - 26 * v [i]) / 256);
+ rgb [1] = CLAMP(y [i] - (77 * u [i] + 25 * v [i]) / 256);
rgb [0] = CLAMP(y [i] + u [i]);
rgb [2] = CLAMP(y [i] + v [i]);
}
@@ -150,7 +150,7 @@
}
#elif defined(TARKIN_YUV_LXY)
for (i=0; i<count; i++, rgba+=4) {
- y [i] = ((int16_t) 54 * rgba [0] + 182 * rgba [1] + 18 * rgba [2]) / 256;
+ y [i] = ((int16_t) 55 * rgba [0] + 183 * rgba [1] + 18 * rgba [2]) / 256;
u [i] = rgba [0] - y [i];
v [i] = rgba [2] - y [i];
a [i] = rgba [3];
@@ -184,7 +184,7 @@
}
#elif defined(TARKIN_YUV_LXY)
for (i=0; i<count; i++, rgba+=4) {
- rgba [1] = CLAMP(y [i] - (76 * u [i] - 26 * v [i]) / 256);
+ rgba [1] = CLAMP(y [i] - (77 * u [i] + 25 * v [i]) / 256);
rgba [0] = CLAMP(y [i] + u [i]);
rgba [2] = CLAMP(y [i] + v [i]);
rgba [3] = a [i];
<p><p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list