summaryrefslogtreecommitdiffstats
path: root/libvo/vo_yuv4mpeg.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-14 22:31:21 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-14 22:31:21 +0000
commit1423711debf4e256c9e1be28367da6ee0ab5c727 (patch)
tree1c8f887083f4525d70f0820cea94e6fa0a9e2d4d /libvo/vo_yuv4mpeg.c
parent9ed129527a3c4ce9ef5b28631979e6444dd31b05 (diff)
downloadmpv-1423711debf4e256c9e1be28367da6ee0ab5c727.tar.bz2
mpv-1423711debf4e256c9e1be28367da6ee0ab5c727.tar.xz
yv12 slices fix by Robert Kesterson <robertk@robertk.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4707 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_yuv4mpeg.c')
-rw-r--r--libvo/vo_yuv4mpeg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libvo/vo_yuv4mpeg.c b/libvo/vo_yuv4mpeg.c
index 04c12146e9..66a8ccb63a 100644
--- a/libvo/vo_yuv4mpeg.c
+++ b/libvo/vo_yuv4mpeg.c
@@ -108,18 +108,19 @@ static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w,int h,int x,in
}
{
// 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 @@ static uint32_t draw_frame(uint8_t * src[])
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;
}