summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-15 20:50:13 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-15 20:50:13 +0000
commitb43f1eb524f290bfb8aa0e123ea22473a5df515d (patch)
tree9e1d886ce433019d995301e547daab1acafa4af4 /TOOLS
parentee315e724fbf2ba6ca993e137a6966a06248cef1 (diff)
downloadmpv-b43f1eb524f290bfb8aa0e123ea22473a5df515d.tar.bz2
mpv-b43f1eb524f290bfb8aa0e123ea22473a5df515d.tar.xz
added gettimeofday-based profiling/timing
little speedup of outline() git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7017 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/subfont-c/Makefile2
-rw-r--r--TOOLS/subfont-c/subfont.c21
2 files changed, 21 insertions, 2 deletions
diff --git a/TOOLS/subfont-c/Makefile b/TOOLS/subfont-c/Makefile
index bc8a0f3ce3..17bcd86094 100644
--- a/TOOLS/subfont-c/Makefile
+++ b/TOOLS/subfont-c/Makefile
@@ -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
diff --git a/TOOLS/subfont-c/subfont.c b/TOOLS/subfont-c/subfont.c
index 0e4f9c78ed..5b7e131ab0 100644
--- a/TOOLS/subfont-c/subfont.c
+++ b/TOOLS/subfont-c/subfont.c
@@ -510,6 +510,8 @@ void outline(
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 @@ void outline(
if (v>max) max = v;
}
}
+// if(!max) *t = 0; else
*t = (max + base/2) / base;
+ } else
+ *t = 255;
}
}
}
@@ -634,6 +639,7 @@ unsigned gmatrix(unsigned *m, int r, int w, double const A) {
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 @@ void alpha() {
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 @@ void parse_args(int argc, char **argv) {
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);