[Mplayer-cvslog] CVS: main/libvo vosub_vidix.c,1.2,1.3

Nick Kurshev nick at mplayer.dev.hu
Sun Jan 6 20:21:12 CET 2002


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

Modified Files:
	vosub_vidix.c 
Log Message:
Looks working ;)

Index: vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vosub_vidix.c	6 Jan 2002 17:12:19 -0000	1.2
+++ vosub_vidix.c	6 Jan 2002 19:21:10 -0000	1.3
@@ -1,3 +1,4 @@
+
 /*
  *  vosub_vidix.c
  *
@@ -123,6 +124,7 @@
 	}
 	image_width = src_width;
 	image_height = src_height;
+	src_format = format;
 	memset(&vidix_play,0,sizeof(vidix_playback_t));
 	vidix_play.fourcc = format;
 	vidix_play.capability = vidix_cap.flags; /* every ;) */
@@ -167,10 +169,10 @@
 {
     uint8_t *src;
     uint8_t *dest;
-    unsigned bespitch;
+    unsigned bespitch,apitch;
     int i;
-
-    bespitch = (vidix_play.dest.w + (vidix_play.dest.pitch.y-1)) & ~(vidix_play.dest.pitch.y-1);
+    apitch = vidix_play.dest.pitch.y-1;
+    bespitch = (w + apitch) & ~apitch;
 
     dest = vidix_mem + frames[next_frame] + vidix_play.offset.y;
     dest += bespitch*y + x;
@@ -181,28 +183,26 @@
         dest += bespitch;
     }
 
-    w/=2;h/=2;x/=2;y/=2;
-
-    bespitch = (vidix_play.dest.w + (vidix_play.dest.pitch.u-1)) & ~(vidix_play.dest.pitch.u-1);
-
-    dest = vidix_mem + frames[next_frame] + vidix_play.offset.u;
-    dest += bespitch*y + x;
+    apitch = vidix_play.dest.pitch.v-1;
+    bespitch = (w + apitch) & ~apitch;
+    dest = vidix_mem + frames[next_frame] + vidix_play.offset.v;
+    dest += (bespitch*y + x)/2;
     src = image[1];
-    for(i=0;i<h;i++){
-        memcpy(dest,src,w);
+    for(i=0;i<h/2;i++){
+        memcpy(dest,src,w/2);
         src+=stride[1];
-        dest+=bespitch;
+        dest+=bespitch/2;
     }
+    apitch = vidix_play.dest.pitch.u-1;
+    bespitch = (w + apitch) & ~apitch;
 
-    bespitch = (vidix_play.dest.w + (vidix_play.dest.pitch.v-1)) & ~(vidix_play.dest.pitch.v-1);
-
-    dest = vidix_mem + frames[next_frame] + vidix_play.offset.v;
-    dest += bespitch*y + x;
+    dest = vidix_mem + frames[next_frame] + vidix_play.offset.u;
+    dest += (bespitch*y + x)/2;
     src = image[2];
-    for(i=0;i<h;i++){
-        memcpy(dest,src,w);
+    for(i=0;i<h/2;i++){
+        memcpy(dest,src,w/2);
         src+=stride[2];
-        dest += bespitch;
+        dest += bespitch/2;
     }
     return 0;
 }
@@ -211,11 +211,10 @@
 {
     uint8_t *src;
     uint8_t *dest;
-    unsigned bespitch;
+    unsigned bespitch,apitch;
     int i;
-
-    bespitch = (vidix_play.dest.w + (vidix_play.dest.pitch.y-1)) & ~(vidix_play.dest.pitch.y-1);
-
+    apitch = vidix_play.dest.pitch.y-1;
+    bespitch = (w*2 + apitch) & ~apitch;
     dest = vidix_mem + frames[next_frame] + vidix_play.offset.y;
     dest += bespitch*y + x;
     src = image[0];




More information about the MPlayer-cvslog mailing list