summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2003-02-17 00:02:52 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2003-02-17 00:02:52 +0000
commit6adf7f8e7f8b42b877eb8b97de028915985618cf (patch)
treef41e2fa2e3320008ead737d30529f0165d610737
parent360db60d8331d665bdd02987dd0f0a6c2715ca5b (diff)
downloadxine-lib-6adf7f8e7f8b42b877eb8b97de028915985618cf.tar.gz
xine-lib-6adf7f8e7f8b42b877eb8b97de028915985618cf.tar.bz2
Better method to fade out a yuv pixel.
CVS patchset: 4177 CVS date: 2003/02/17 00:02:52
-rw-r--r--src/post/visualizations/fftscope.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c
index e10527def..ad898ed16 100644
--- a/src/post/visualizations/fftscope.c
+++ b/src/post/visualizations/fftscope.c
@@ -22,7 +22,7 @@
*
* FFT code by Steve Haehnichen, originally licensed under GPL v1
*
- * $Id: fftscope.c,v 1.9 2003/02/12 00:43:33 tmattern Exp $
+ * $Id: fftscope.c,v 1.10 2003/02/17 00:02:52 tmattern Exp $
*
*/
@@ -250,6 +250,7 @@ static void scale (complex wave[], int bits)
* Fade out a YUV pixel
*/
void fade_out_yuv(uint8_t *y, uint8_t *u, uint8_t *v, float factor) {
+#if 0
float r, g, b;
/* YUV -> RGB */
@@ -266,6 +267,11 @@ void fade_out_yuv(uint8_t *y, uint8_t *u, uint8_t *v, float factor) {
*y = (uint8_t)((0.257 * r) + (0.504 * g) + (0.098 * b) + 16);
*u = (uint8_t)(-(0.148 * r) - (0.291 * g) + (0.439 * b) + 128);
*v = (uint8_t)((0.439 * r) - (0.368 * g) - (0.071 * b) + 128);
+#endif
+
+ *y = (uint8_t)(factor * (*y - 16)) + 16;
+ *u = (uint8_t)(factor * (*u - 128)) + 128;
+ *v = (uint8_t)(factor * (*v - 128)) + 128;
}