[Mplayer-cvslog] CVS: main/TOOLS/subfont-c subfont.c,1.13,1.14 Makefile,1.5,1.6

Arpi of Ize arpi at mplayerhq.hu
Thu Aug 15 22:50:27 CEST 2002


Update of /cvsroot/mplayer/main/TOOLS/subfont-c
In directory mail:/var/tmp.root/cvs-serv25415

Modified Files:
	subfont.c Makefile 
Log Message:
added gettimeofday-based profiling/timing
little speedup of outline()


Index: subfont.c
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/subfont-c/subfont.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- subfont.c	25 Jul 2002 13:36:59 -0000	1.13
+++ subfont.c	15 Aug 2002 20:50:13 -0000	1.14
@@ -510,6 +510,8 @@
     int x, y;
     for (y = 0; y<height; ++y) {
 	for (x = 0; x<width; ++x, ++s, ++t) {
+	  //if(s[0]>=192) printf("%d\n",s[0]);
+	  if(s[0]!=255){
 	    unsigned max = 0;
 	    unsigned *mrow = m + r;
 	    unsigned char *srow = s -r*width;
@@ -527,7 +529,10 @@
 		    if (v>max) max = v;
 		}
 	    }
+//	    if(!max) *t = 0; else
 	    *t = (max + base/2) / base;
+	  } else 
+	    *t = 255;
 	}
     }
 }
@@ -634,6 +639,7 @@
 
 
 void alpha() {
+    unsigned int ttime;
     int const g_r = ceil(radius);
     int const o_r = ceil(thickness);
     int const g_w = 2*g_r+1;		// matrix size
@@ -669,14 +675,19 @@
     if (DEBUG) eprintf("\n");
 
 
+    ttime=GetTimer();
     if(thickness==1.0)
       outline1(bbuffer, abuffer, width, height);	// FAST solid 1 pixel outline
     else
       outline(bbuffer, abuffer, width, height, om, o_r, o_w);	// solid outline
-
     //outline(bbuffer, abuffer, width, height, gm, g_r, g_w);	// Gaussian outline
+    ttime=GetTimer()-ttime;
+    printf("outline: %7d us\n",ttime);
 
+    ttime=GetTimer();
     blur(abuffer, bbuffer, width, height, g, g_r, g_w, volume);
+    ttime=GetTimer()-ttime;
+    printf("gauss:   %7d us\n",ttime);
 
     free(g);
     free(om);
@@ -771,13 +782,21 @@
 
 
 int main(int argc, char **argv) {
+    unsigned int ttime;
     parse_args(argc, argv);
 
     padding = ceil(radius) + ceil(thickness);
 
+    ttime=GetTimer();
     prepare_charset();
+    ttime=GetTimer()-ttime;
+    printf("charset: %7d us\n",ttime);
 
+    ttime=GetTimer();
     render();
+    ttime=GetTimer()-ttime;
+    printf("render:  %7d us\n",ttime);
+
     write_bitmap(bbuffer, 'b');
 
     abuffer = (unsigned char*)malloc(width*height);

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/subfont-c/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile	24 Aug 2001 10:46:31 -0000	1.5
+++ Makefile	15 Aug 2002 20:50:13 -0000	1.6
@@ -1,6 +1,6 @@
 include ../../config.mak
 
-LDLIBS=-lm $(shell freetype-config --libs)
+LDLIBS=-lm ../../linux/timer-lx.o $(shell freetype-config --libs)
 CFLAGS=$(OPTFLAGS) $(shell freetype-config --cflags)
 
 #CFLAGS+=-O0			# for RedHat's gcc-2.96-95




More information about the MPlayer-cvslog mailing list