changeset 4014:cb7c183816f8

Looks working ;)
author nick
date Sun, 06 Jan 2002 19:21:10 +0000
parents 625b61fd11fb
children 7a9c22d1d984
files libvo/vosub_vidix.c
diffstat 1 files changed, 24 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vosub_vidix.c	Sun Jan 06 17:12:19 2002 +0000
+++ b/libvo/vosub_vidix.c	Sun Jan 06 19:21:10 2002 +0000
@@ -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);
+    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/2;i++){
+        memcpy(dest,src,w/2);
+        src+=stride[1];
+        dest+=bespitch/2;
+    }
+    apitch = vidix_play.dest.pitch.u-1;
+    bespitch = (w + apitch) & ~apitch;
 
     dest = vidix_mem + frames[next_frame] + vidix_play.offset.u;
-    dest += bespitch*y + x;
-    src = image[1];
-    for(i=0;i<h;i++){
-        memcpy(dest,src,w);
-        src+=stride[1];
-        dest+=bespitch;
-    }
-
-    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 += (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];