[Mplayer-cvslog] CVS: main/libvo vo_xmga.c,1.54,1.55 mga_common.c,1.22,1.23

Arpi of Ize arpi at mplayer.dev.hu
Sun Mar 24 21:45:33 CET 2002


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

Modified Files:
	vo_xmga.c mga_common.c 
Log Message:
U,V plane odrer fixed

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- vo_xmga.c	17 Mar 2002 03:38:16 -0000	1.54
+++ vo_xmga.c	24 Mar 2002 20:45:30 -0000	1.55
@@ -218,17 +218,13 @@
   {
    case IMGFMT_YV12:
 	height+=height&1;
-        mga_vid_config.format=MGA_VID_FORMAT_YV12;
+        mga_vid_config.format=MGA_VID_FORMAT_IYUV;
         mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
         break;
    case IMGFMT_I420:
-	height+=height&1;
-        mga_vid_config.format=MGA_VID_FORMAT_I420;
-        mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
-        break;
    case IMGFMT_IYUV:
 	height+=height&1;
-        mga_vid_config.format=MGA_VID_FORMAT_IYUV;
+        mga_vid_config.format=MGA_VID_FORMAT_YV12;
         mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
         break;
    case IMGFMT_YUY2:

Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- mga_common.c	10 Mar 2002 03:37:26 -0000	1.22
+++ mga_common.c	24 Mar 2002 20:45:30 -0000	1.23
@@ -85,8 +85,14 @@
         width/=2;height/=2;x/=2;y/=2;
 
 	dest = vid_data + bespitch*mga_vid_config.src_height + bespitch*y + 2*x;
-        src = image[1];
-        src2 = image[2];
+	if(mga_vid_config.format==MGA_VID_FORMAT_YV12){
+	    src = image[1];
+	    src2 = image[2];
+	} else {
+	    src = image[2];
+	    src2 = image[1];
+	}
+	
 	for(h=0; h < height; h++)
 	{
 #ifdef HAVE_MMX
@@ -145,6 +151,7 @@
 {
     uint8_t *src;
     uint8_t *dest;
+    uint8_t *dest2;
     uint32_t bespitch,bespitch2;
     int i;
 
@@ -155,14 +162,18 @@
     mem2agpcpy_pic(dest, image[0], w, h, bespitch, stride[0]);
     
     w/=2;h/=2;x/=2;y/=2;
-    
+
     dest = vid_data + bespitch*mga_vid_config.src_height + bespitch2 * y + x;
-    mem2agpcpy_pic(dest, image[1], w, h, bespitch2, stride[1]);
+    dest2= dest + bespitch2*mga_vid_config.src_height / 2; 
 
-    dest = vid_data + bespitch*mga_vid_config.src_height
-                    + bespitch*mga_vid_config.src_height / 4 
-                    + bespitch2 * y + x;
+  if(mga_vid_config.format==MGA_VID_FORMAT_YV12){
+    // mga_vid's YV12 assumes Y,U,V order (insteda of Y,V,U) :(
+    mem2agpcpy_pic(dest, image[1], w, h, bespitch2, stride[1]);
+    mem2agpcpy_pic(dest2,image[2], w, h, bespitch2, stride[2]);
+  } else {
     mem2agpcpy_pic(dest, image[2], w, h, bespitch2, stride[2]);
+    mem2agpcpy_pic(dest2,image[1], w, h, bespitch2, stride[1]);
+  }
 
 }
 
@@ -233,9 +244,13 @@
        // we're lucky or codec accepts stride => ok, let's go!
        if(mpi->flags&MP_IMGFLAG_PLANAR){
 	   mpi->planes[0]=vid_data;
-	   mpi->planes[1]=vid_data + bespitch*mga_vid_config.src_height;
-	   mpi->planes[2]=vid_data + bespitch*mga_vid_config.src_height
-                    + bespitch*mga_vid_config.src_height / 4;
+	   if(mpi->flags&MP_IMGFLAG_SWAPPED){
+	       mpi->planes[1]=vid_data + bespitch*mga_vid_config.src_height;
+	       mpi->planes[2]=mpi->planes[1] + bespitch2*mga_vid_config.src_height/2;
+	   } else {
+	       mpi->planes[2]=vid_data + bespitch*mga_vid_config.src_height;
+	       mpi->planes[1]=mpi->planes[2] + bespitch2*mga_vid_config.src_height/2;
+	   }
 	   mpi->width=mpi->stride[0]=bespitch;
 	   mpi->stride[1]=mpi->stride[2]=bespitch2;
        } else {




More information about the MPlayer-cvslog mailing list