[Mplayer-cvslog] CVS: main/libvo vo_yuv4mpeg.c,1.4,1.5

Arpi of Ize arpi at mplayer.dev.hu
Thu Feb 14 23:31:24 CET 2002


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

Modified Files:
	vo_yuv4mpeg.c 
Log Message:
yv12 slices fix by Robert Kesterson <robertk at robertk.com>

Index: vo_yuv4mpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_yuv4mpeg.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vo_yuv4mpeg.c	10 Feb 2002 16:56:30 -0000	1.4
+++ vo_yuv4mpeg.c	14 Feb 2002 22:31:21 -0000	1.5
@@ -108,18 +108,19 @@
 		}
 		{
 			// copy U + V:
+			int imgstride = image_width >> 1;
 			uint8_t *src1 = srcimg[1];
 			uint8_t *src2 = srcimg[2];
-			uint8_t *dstu = image_u + image_width * (y / 2) + (x / 2);
-			uint8_t *dstv = image_v + image_width * (y / 2) + (x / 2);
+			uint8_t *dstu = image_u + imgstride * (y >> 1) + (x >> 1);
+			uint8_t *dstv = image_v + imgstride * (y >> 1) + (x >> 1);
 			for (i = 0; i < h / 2; i++)
 			{
-				memcpy(dstu, src1 , w / 2);
-				memcpy(dstv, src2, w / 2);
+				memcpy(dstu, src1 , w >> 1);
+				memcpy(dstv, src2, w >> 1);
 				src1 += stride[1];
 				src2 += stride[2];
-				dstu += image_width / 2;
-				dstv += image_width / 2;
+				dstu += imgstride;
+				dstv += imgstride;
 			}
 		}
 	}
@@ -154,7 +155,6 @@
 				rgb24toyv12(src[0], image_y, image_u, image_v, 
 							image_width, image_height, 
 							image_width, image_width / 2, image_width * 3);
-//				RGB2YUV(image_width, image_height, src[0], image_y, image_u, image_v, 1);
 			}
 			break;
 	}




More information about the MPlayer-cvslog mailing list