From dcb0840e674d5bcb768259f1c5af7e44761113aa Mon Sep 17 00:00:00 2001 From: arpi_esp Date: Thu, 29 Mar 2001 16:39:37 +0000 Subject: [PATCH] optimized alpha resampling git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@251 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libvo/font_load.c b/libvo/font_load.c index 184349000f..cbe44a5b77 100644 --- a/libvo/font_load.c +++ b/libvo/font_load.c @@ -210,21 +210,22 @@ for(i=0;i<=fontdb;i++){ int x=desc->pic_a[i]->bmp[j]; int y=desc->pic_b[i]->bmp[j]; - x=((x*f)>>8); // scale - if(x<0) x=0; else if(x>255) x=255; - x^=255; // invert - + x=255-((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(x=252) x=0; - + desc->pic_a[i]->bmp[j]=x; +// desc->pic_b[i]->bmp[j]=0; // hack } printf("DONE!\n"); }