[Mplayer-cvslog] CVS: main/libvo sub.c,1.32,1.33
Adam Tla/lka
atlka at mplayer.dev.hu
Fri Oct 12 15:24:29 CEST 2001
Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv19191/libvo
Modified Files:
sub.c
Log Message:
speed improvements
Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- sub.c 27 Sep 2001 17:40:43 -0000 1.32
+++ sub.c 12 Oct 2001 13:24:07 -0000 1.33
@@ -173,19 +173,17 @@
// else
for (j=0;j<=len;j++){
if ((c=t[j])>=0x80){
- if (sub_unicode)
- c = (c<<8) + t[++j];
- else
- if (sub_utf8){
- if ((c & 0xe0) == 0xc0) /* 2 bytes U+00080..U+0007FF*/
- c = (c & 0x1f)<<6 | (t[++j] & 0x3f);
- else if((c & 0xf0) == 0xe0)/* 3 bytes U+00800..U+00FFFF*/
- c = ((c & 0x0f)<<6 |
- (t[++j] & 0x3f))<<6 | (t[++j] & 0x3f);
- }
+ if (sub_utf8){
+ if ((c & 0xe0) == 0xc0) /* 2 bytes U+00080..U+0007FF*/
+ c = (c & 0x1f)<<6 | (t[++j] & 0x3f);
+ else if((c & 0xf0) == 0xe0)/* 3 bytes U+00800..U+00FFFF*/
+ c = ((c & 0x0f)<<6 |
+ (t[++j] & 0x3f))<<6 | (t[++j] & 0x3f);
+ } else if (sub_unicode)
+ c = (c<<8) + t[++j];
}
if (k==MAX_UCS){
- utbl[k]=l=0; break;
+ l=0 ; len=j; // cut here
}
utbl[k++]=c;
if (c==' '){
@@ -193,20 +191,11 @@
lastStripPosition=j;
lastxsize=xsize;
}
-#if 1
else if ((font=vo_font->font[c])>=0){
if (vo_font->pic_a[font]->h > h){
h=vo_font->pic_a[font]->h;
}
}
-#endif
-#if 0
- else if ((font=vo_font->font[c])>=0){
- if ((memy-h)+vo_font->pic_a[font]->h > dys){
- h=vo_font->pic_a[font]->h;
- }
- }
-#endif
xsize+=vo_font->width[c]+vo_font->charspace;
if (dxs<xsize){
if (lastStripPosition>0){
@@ -221,20 +210,20 @@
} else if (j<len)
continue;
if (h>memy){ // out of the screen so end parsing
- memy +=vo_font->height-lasth; // correct the y position
+ memy -=lasth - vo_font->height; // correct the y position
l=0; break;
}
utbl[k++]=0;
xtbl[lines++]=(dxs-xsize)/2;
if (lines==MAX_UCSLINES||k>MAX_UCS){
- l=0; break;
+ l=0; j=len; // end parsing
} else if(l || j<len){ // not the last line or not the last char
lastStripPosition=-1;
xsize=-vo_font->charspace;
lasth=h;
h=vo_font->height;
}
- printf("h: %d -> %d \n",vo_font->height,h);
+// printf("h: %d -> %d \n",vo_font->height,h);
memy -=h; // according to max of vo_font->pic_a[font]->h
}
}
@@ -248,7 +237,7 @@
while (i<lines){
x= xtbl[i++];
while ((c=utbl[j++])){
- if ((font=vo_font->font[c])>=0 && y<dys)
+ if ((font=vo_font->font[c])>=0)
draw_alpha(x,y,
vo_font->width[c],
vo_font->pic_a[font]->h+y<dys ? vo_font->pic_a[font]->h : dys-y,
More information about the MPlayer-cvslog
mailing list