From cb28f52567991e24ccf39a039de4db05891908d9 Mon Sep 17 00:00:00 2001 From: arpi Date: Thu, 9 Aug 2001 20:07:45 +0000 Subject: more optimization git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1475 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/subfont-c/subfont.c | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'TOOLS') diff --git a/TOOLS/subfont-c/subfont.c b/TOOLS/subfont-c/subfont.c index 15a2a3bb89..b72040776d 100644 --- a/TOOLS/subfont-c/subfont.c +++ b/TOOLS/subfont-c/subfont.c @@ -55,6 +55,7 @@ char *font_path = NULL; unsigned char *buffer; +unsigned char *ebuffer; // temporary buffer for alphamap creation (edges) unsigned char *abuffer; int width, height; static FT_ULong ustring[256]; @@ -252,6 +253,7 @@ void render() { eprintf("bitmap size: %ix%i\n", width, height); buffer = (unsigned char*)malloc(width*height); + ebuffer = (unsigned char*)malloc(width*height); abuffer = (unsigned char*)malloc(width*height); if (buffer==NULL || abuffer==NULL) ERROR("malloc failed.",NULL); @@ -358,15 +360,13 @@ void blur() { /* This is not a gaussian blur! */ /* And is very slow */ - for (y = 0; y0 && y+my0 && ax255?255:p)*m[mx+r+(my+r)*w]; - } - - } + ebuffer[ax+ay]=(p>255)?255:p; + } +// printf("\n"); + } + + // PASS-2 : blur + for (y = 0; y0 && ay0 && x+mx255) max=255; @@ -393,6 +407,7 @@ void blur() { } // printf("\n"); } + free(m); } -- cgit v1.2.3