From 7e1f91473f52da319727077891595b869fb9c9e4 Mon Sep 17 00:00:00 2001 From: arpi Date: Fri, 16 Aug 2002 21:02:50 +0000 Subject: speedup of gauss git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7024 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/subfont-c/subfont.c | 73 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 12 deletions(-) (limited to 'TOOLS') diff --git a/TOOLS/subfont-c/subfont.c b/TOOLS/subfont-c/subfont.c index 2fda7a326d..4820c42b66 100644 --- a/TOOLS/subfont-c/subfont.c +++ b/TOOLS/subfont-c/subfont.c @@ -626,32 +626,73 @@ void blur( unsigned char *s = buffer - r; unsigned char *t = tmp; + + int *m_end=m+256*mwidth; + for (y = 0; y=width) ? (r+width-x):mwidth; + unsigned* mp = m + 256*x1; int mx; - for (mx = x1; mx>16; } } tmp -= r*width; + for (x = 0; x=height) ? (r+height-y):mwidth; - unsigned char *smy = s + y1*width; + register unsigned *mp = m + 256*y1; + register unsigned char *smy = s + y1*width; int my; - for (my = y1; my>16; } +#else + // pass 1: 0..r + for (y = 0; y=height) ? (r+height-y):mwidth; + unsigned char *smy = s + y1*width; + unsigned* mp = m + 256*y1; + for (; my>16; + } + // pass 2: r..(height-r) + for (; y>16; + } + // pass 3: (height-r)..height + for (; y>16; + } +#endif } } @@ -691,11 +732,12 @@ void alpha() { unsigned volume = 0; // volume under Gaussian area is exactly -pi*base/A unsigned *g = (unsigned*)malloc(g_w * sizeof(unsigned)); + unsigned *gt = (unsigned*)malloc(256 * g_w * sizeof(unsigned)); unsigned *om = (unsigned*)malloc(o_w*o_w * sizeof(unsigned)); unsigned char *omt = malloc(o_size*256); unsigned char *omtp = omt; - if (g==NULL || om==NULL || omt==NULL) ERROR("malloc failed."); + if (g==NULL || gt==NULL || om==NULL || omt==NULL) ERROR("malloc failed."); // gaussian curve for (i = 0; i