# HG changeset patch # User arpi_esp # Date 985881996 0 # Node ID 2dadc379a93497f6667a3ab25f2b5f1aec99ede7 # Parent 33360ef1b97a6a7a4a8d68d6316207cabb5c80ec OSD/SUB image quality & speed improvement diff -r 33360ef1b97a -r 2dadc379a934 libvo/font_load.c --- a/libvo/font_load.c Thu Mar 29 16:00:52 2001 +0000 +++ b/libvo/font_load.c Thu Mar 29 16:06:36 2001 +0000 @@ -199,7 +199,8 @@ printf("font: Missing bitmap(s) for sub-font #%d\n",i); return NULL; } - if(factor!=1.0f){ + //if(factor!=1.0f) + { // re-sample alpha int f=factor*256.0f; int size=desc->pic_a[i]->w*desc->pic_a[i]->h; @@ -208,12 +209,21 @@ for(j=0;jpic_a[i]->bmp[j]; int y=desc->pic_b[i]->bmp[j]; - - x=((x*f*(255-y))>>16)+y; + + x=((x*f)>>8); // scale + if(x<0) x=0; else if(x>255) x=255; + x^=255; // invert + + if(x+y>255) x=255-y; // to avoid overflows + + //x=0; + //x=((x*f*(255-y))>>16); + //x=((x*f*(255-y))>>16)+y; //x=(x*f)>>8;if(x255) x=255; + if(x<1) x=1; else + if(x>=252) x=0; + desc->pic_a[i]->bmp[j]=x; } printf("DONE!\n"); diff -r 33360ef1b97a -r 2dadc379a934 libvo/mga_common.c --- a/libvo/mga_common.c Thu Mar 29 16:00:52 2001 +0000 +++ b/libvo/mga_common.c Thu Mar 29 16:06:36 2001 +0000 @@ -18,7 +18,8 @@ for(x=0;x>8; if(srca[x]) - dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8; + dst[x]=((dst[x]*srca[x])>>8)+src[x]; + //dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8; } src+=stride; srca+=stride; @@ -31,7 +32,8 @@ for(x=0;x>8; if(srca[x]) - dst[2*x]=(dst[2*x]*(srca[x]^255)+src[x]*(srca[x]))>>8; + dst[2*x]=((dst[2*x]*srca[x])>>8)+src[x]; + //dst[2*x]=(dst[2*x]*(srca[x]^255)+src[x]*(srca[x]))>>8; } src+=stride; srca+=stride; diff -r 33360ef1b97a -r 2dadc379a934 libvo/vo_x11.c --- a/libvo/vo_x11.c Thu Mar 29 16:00:52 2001 +0000 +++ b/libvo/vo_x11.c Thu Mar 29 16:06:36 2001 +0000 @@ -392,9 +392,12 @@ for(x=0;x>8; if(srca[x]){ - dst[0]=(dst[0]*(srca[x]^255)+src[x]*(srca[x]))>>8; - dst[1]=(dst[1]*(srca[x]^255)+src[x]*(srca[x]))>>8; - dst[2]=(dst[2]*(srca[x]^255)+src[x]*(srca[x]))>>8; + dst[0]=((dst[0]*srca[x])>>8)+src[x]; + dst[1]=((dst[1]*srca[x])>>8)+src[x]; + dst[2]=((dst[2]*srca[x])>>8)+src[x]; + //dst[0]=(dst[0]*(srca[x]^255)+src[x]*(srca[x]))>>8; + //dst[1]=(dst[1]*(srca[x]^255)+src[x]*(srca[x]))>>8; + //dst[2]=(dst[2]*(srca[x]^255)+src[x]*(srca[x]))>>8; } dst+=dbpp; } diff -r 33360ef1b97a -r 2dadc379a934 libvo/vo_xv.c --- a/libvo/vo_xv.c Thu Mar 29 16:00:52 2001 +0000 +++ b/libvo/vo_xv.c Thu Mar 29 16:06:36 2001 +0000 @@ -264,7 +264,8 @@ for(x=0;x>8; if(srca[x]) - dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8; +// dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8; + dst[x]=((dst[x]*srca[x])>>8)+src[x]; } src+=stride; srca+=stride; @@ -277,7 +278,8 @@ for(x=0;x>8; if(srca[x]) - dst[2*x]=(dst[2*x]*(srca[x]^255)+src[x]*(srca[x]))>>8; +// dst[2*x]=(dst[2*x]*(srca[x]^255)+src[x]*(srca[x]))>>8; + dst[2*x]=((dst[2*x]*srca[x])>>8)+src[x]; } src+=stride; srca+=stride;