# HG changeset patch # User arpi # Date 1013725881 0 # Node ID a4400910be9fd221558285ad83abf2dff852b4c1 # Parent f6d45a3f005c1c5874d22240233c4ff318220260 yv12 slices fix by Robert Kesterson diff -r f6d45a3f005c -r a4400910be9f libvo/vo_yuv4mpeg.c --- a/libvo/vo_yuv4mpeg.c Thu Feb 14 22:15:53 2002 +0000 +++ b/libvo/vo_yuv4mpeg.c Thu Feb 14 22:31:21 2002 +0000 @@ -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; }