diff options
author | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-17 15:09:46 +0000 |
---|---|---|
committer | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-17 15:09:46 +0000 |
commit | 8c2eddc2b93b0cce20ed25cbcd2142da36a8def1 (patch) | |
tree | c9e5baca3dc8ab5dd2a558d033fd1ba8c639d35e /libvo | |
parent | 5e06751b43580296cd964ec0838467acfe4da7cd (diff) |
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4745 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vosub_vidix.c | 79 |
1 files changed, 49 insertions, 30 deletions
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c index 531a081976..b71d76ebf9 100644 --- a/libvo/vosub_vidix.c +++ b/libvo/vosub_vidix.c @@ -162,36 +162,55 @@ static uint32_t vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h if (vidix_play.flags & VID_PLAY_INTERLEAVED_UV) { - printf("vosub_vidix: interleaving UV planes not supported yet\n"); - return 0; - } - - /* Plane V */ - apitch = vidix_play.dest.pitch.v-1; - bespitch = (w + apitch) & ~apitch; - - dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v; - dest += bespitch*y/4 + x; - src = image[1]; - for(i=0;i<h/2;i++){ - memcpy(dest,src,w/2); - src+=stride[1]; - dest+=bespitch/2; - } - - /* Plane U */ - apitch = vidix_play.dest.pitch.u-1; - bespitch = (w + apitch) & ~apitch; - - dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.u; - dest += bespitch*y/4 + x; - src = image[2]; - for(i=0;i<h/2;i++){ - memcpy(dest,src,w/2); - src+=stride[2]; - dest += bespitch/2; - } - return 0; + int hi,wi; + uint8_t *src2; + dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v; + dest += bespitch*y/2 + x; // <- is this correct ? + h/=2; + w/=2; + src = image[1]; + src2 = image[2]; + for(hi = 0; hi < h; hi++) + { + for(wi = 0; wi < w; wi++) + { + dest[2*wi+0] = src[wi]; + dest[2*wi+1] = src2[wi]; + } + dest += bespitch; + src += stride[1]; + src2+= stride[2]; + } + + } else { + + /* Plane V */ + apitch = vidix_play.dest.pitch.v-1; + bespitch = (w + apitch) & ~apitch; + + dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v; + dest += bespitch*y/4 + x; + src = image[1]; + for(i=0;i<h/2;i++){ + memcpy(dest,src,w/2); + src+=stride[1]; + dest+=bespitch/2; + } + + /* Plane U */ + apitch = vidix_play.dest.pitch.u-1; + bespitch = (w + apitch) & ~apitch; + + dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.u; + dest += bespitch*y/4 + x; + src = image[2]; + for(i=0;i<h/2;i++){ + memcpy(dest,src,w/2); + src+=stride[2]; + dest += bespitch/2; + } + return 0; + } } static uint32_t vidix_draw_slice_422(uint8_t *image[], int stride[], int w,int h,int x,int y) |