[Mplayer-cvslog] CVS: main/libmpcodecs vf_bmovl.c,1.5,1.6

Arpi of Ize arpi at mplayerhq.hu
Tue Jan 28 01:28:12 CET 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv8556/libmpcodecs

Modified Files:
	vf_bmovl.c 
Log Message:
The code for converting RGB to YUV in bmovl is slow because it uses
floating point arithmetic. The attached patch changes it to use integers
instead, giving about a 2x performance boost on animations.
Jonas Jensen <jbj at knef.dk>


Index: vf_bmovl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_bmovl.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vf_bmovl.c	26 Jan 2003 17:42:24 -0000	1.5
+++ vf_bmovl.c	28 Jan 2003 00:27:59 -0000	1.6
@@ -90,9 +90,9 @@
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 #define INRANGE(a,b,c)	( ((a) < (b)) ? (b) : ( ((a) > (c)) ? (c) : (a) ) )
 
-#define rgb2y(R,G,B)  (  (0.257 * R) + (0.504 * G) + (0.098 * B) + 16  )
-#define rgb2u(R,G,B)  ( -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128 )
-#define rgb2v(R,G,B)  (  (0.439 * R) - (0.368 * G) - (0.071 * B) + 128 )
+#define rgb2y(R,G,B)  ( (( 263*R + 516*G + 100*B) >> 10) + 16  )
+#define rgb2u(R,G,B)  ( ((-152*R - 298*G + 450*B) >> 10) + 128 )
+#define rgb2v(R,G,B)  ( (( 450*R - 376*G -  73*B) >> 10) + 128 )
 
 #define DBG(a) (mp_msg(MSGT_VFILTER, MSGL_DBG2, "DEBUG: %d\n", a))
 



More information about the MPlayer-cvslog mailing list