[Mplayer-cvslog] CVS: main/libvo vo_dxr3.c,1.18,1.19

David Holm mswitch at mplayer.dev.hu
Thu Dec 20 08:40:37 CET 2001


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv5546/libvo

Modified Files:
	vo_dxr3.c 
Log Message:
Removed some old libavcodec code which would cause inproper scaling of some movies...


Index: vo_dxr3.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dxr3.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- vo_dxr3.c	19 Dec 2001 18:26:08 -0000	1.18
+++ vo_dxr3.c	20 Dec 2001 07:40:30 -0000	1.19
@@ -50,7 +50,6 @@
 
 static int v_width,v_height;
 static int s_width,s_height;
-static int c_width,c_height;
 static int s_pos_x,s_pos_y;
 static int d_pos_x,d_pos_y;
 static int osd_w,osd_h;
@@ -132,30 +131,13 @@
 	    return -1;
 	}
 	
-        if(width<=352 && height<=288){
-          c_width=352;
-          c_height=288;
-        } else
-        if(width<=352 && height<=576){
-          c_width=352;
-          c_height=576;
-        } else
-        if(width<=480 && height<=576){
-          c_width=480;
-          c_height=576;
-        } else
-        if(width<=544 && height<=576){
-          c_width=544;
-          c_height=576;
-        } else {
-          c_width=704;
-          c_height=576;
-        }
+	s_width = (scr_width+15)/16; s_width*=16;
+	s_height = (scr_height+15)/16; s_height*=16;
 	
-	mp1e_context = rte_context_new( c_width, c_height, NULL );
+	mp1e_context = rte_context_new( s_width, s_height, NULL );
 	rte_set_verbosity( mp1e_context, 0 );
 	
-	printf( "VO: [dxr3] %dx%d => %dx%d\n", v_width, v_height, c_width, c_height );
+	printf( "VO: [dxr3] %dx%d => %dx%d\n", v_width, v_height, s_width, s_height );
 
 	if( !mp1e_context )
 	{
@@ -201,38 +183,38 @@
 	    return -1;
 	}
 
-        osd_w=scr_width;
-        d_pos_x=(c_width-(int)scr_width)/2;
+        osd_w=s_width;
+        d_pos_x=(s_width-v_width)/2;
         if(d_pos_x<0)
 	{
     	    s_pos_x=-d_pos_x;d_pos_x=0;
-    	    osd_w=c_width;
+    	    osd_w=s_width;
         } else s_pos_x=0;
     
-        osd_h=scr_height;
-        d_pos_y=(c_height-(int)scr_height)/2;
+        osd_h=s_height;
+        d_pos_y=(s_height-v_height)/2;
         if(d_pos_y<0)
 	{
     	    s_pos_y=-d_pos_y;d_pos_y=0;
-    	    osd_h=c_height;
+    	    osd_h=s_height;
         } else s_pos_y=0;
     
         printf("VO: [dxr3] Position mapping: %d;%d => %d;%d\n",s_pos_x,s_pos_y,d_pos_x,d_pos_y);
                 
-        size = c_width*c_height;
+        size = s_width*s_height;
 
         picture_data[0] = malloc((size * 3)/2);
 	picture_data[1] = picture_data[0] + size;
 	picture_data[2] = picture_data[1] + size / 4;
-	picture_linesize[0] = c_width;
-	picture_linesize[1] = c_width / 2;
-	picture_linesize[2] = c_width / 2;
+	picture_linesize[0] = s_width;
+	picture_linesize[1] = s_width / 2;
+	picture_linesize[2] = s_width / 2;
 
 	// Set the border colorwou
 	RGBTOYUV(0,0,0)
-        memset( picture_data[0], YUV_s.Y, picture_linesize[0]*c_height );
-        memset( picture_data[1], YUV_s.U, picture_linesize[1]*(c_height/2) );
-        memset( picture_data[2], YUV_s.V, picture_linesize[2]*(c_height/2) );
+        memset( picture_data[0], YUV_s.Y, picture_linesize[0]*s_height );
+        memset( picture_data[1], YUV_s.U, picture_linesize[1]*(s_height/2) );
+        memset( picture_data[2], YUV_s.V, picture_linesize[2]*(s_height/2) );
 	
 	if( !rte_start_encoding( mp1e_context ) )
 	{
@@ -290,7 +272,7 @@
 	unsigned char *s,*dY,*dU,*dV;
 	
         if(d_pos_x+w>picture_linesize[0]) w=picture_linesize[0]-d_pos_x;
-        if(d_pos_y+h>c_height) h=c_height-d_pos_y;
+        if(d_pos_y+h>s_height) h=s_height-d_pos_y;
 
 	s = src[0]+s_pos_x+s_pos_y*(w*2);
 	dY = picture_data[0]+d_pos_x+d_pos_y*picture_linesize[0];
@@ -311,7 +293,7 @@
 	unsigned char *s,*dY,*dU,*dV;
 	
         if(d_pos_x+w>picture_linesize[0]) w=picture_linesize[0]-d_pos_x;
-        if(d_pos_y+h>c_height) h=c_height-d_pos_y;
+        if(d_pos_y+h>s_height) h=s_height-d_pos_y;
 
 	s = src[0]+s_pos_y*(w*3);
 
@@ -383,7 +365,7 @@
 	y0+=d_pos_y;
 
         if(x0+w>picture_linesize[0]) w=picture_linesize[0]-x0;
-        if(y0+h>c_height) h=c_height-y0;
+        if(y0+h>s_height) h=s_height-y0;
 
         s=srcimg[0]+s_pos_x+s_pos_y*stride[0];
         d=picture_data[0]+x0+y0*picture_linesize[0];




More information about the MPlayer-cvslog mailing list