[Mplayer-cvslog] CVS: main/libvo vesa_lvo.c,1.7,1.8
Nick Kurshev
nick at mplayer.dev.hu
Tue Nov 20 11:01:00 CET 2001
Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv17574/main/libvo
Modified Files:
vesa_lvo.c
Log Message:
Bad attempt of YV12 direct support
Index: vesa_lvo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vesa_lvo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vesa_lvo.c 20 Nov 2001 08:38:15 -0000 1.7
+++ vesa_lvo.c 20 Nov 2001 10:00:58 -0000 1.8
@@ -144,6 +144,49 @@
if(lvo_handler != -1) close(lvo_handler);
}
+static void
+CopyData420(
+ unsigned char *src1,
+ unsigned char *src2,
+ unsigned char *src3,
+ unsigned char *dst1,
+ unsigned char *dst2,
+ unsigned char *dst3,
+ int srcPitch,
+ int srcPitch2,
+ int dstPitch,
+ int h,
+ int w
+){
+ int count;
+
+ count = h;
+ while(count--) {
+ memcpy(dst1, src1, w);
+ src1 += srcPitch;
+ dst1 += dstPitch;
+ }
+
+ w >>= 1;
+ h >>= 1;
+ dstPitch >>= 1;
+
+ count = h;
+ while(count--) {
+ memcpy(dst2, src2, w);
+ src2 += srcPitch2;
+ dst2 += dstPitch;
+ }
+
+ count = h;
+ while(count--) {
+ memcpy(dst3, src3, w);
+ src3 += srcPitch2;
+ dst3 += dstPitch;
+ }
+}
+
+
uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
{
#if 0
@@ -193,6 +236,25 @@
{
yv12toyuy2(image[0],image[1],image[2],dst
,w,h,stride[0],stride[1],w*2);
+ }
+ else
+#else
+ if(src_format == IMGFMT_YV12)
+ {
+ uint32_t dstPitch,d1line,d2line,d3line,d1offset,d2offset,d3offset;
+ dstPitch = (mga_vid_config.src_width + 15) & ~15; /* of luma */
+ d1line = y * dstPitch;
+ d2line = (mga_vid_config.src_height * dstPitch) + ((y >> 1) * (dstPitch >> 1));
+ d3line = d2line + ((mga_vid_config.src_height >> 1) * (dstPitch >> 1));
+
+ y &= ~1;
+
+ d1offset = (y * dstPitch) + x;
+ d2offset = d2line + (x >> 1);
+ d3offset = d3line + (x >> 1);
+ CopyData420(image[0],image[1],image[2],
+ dst+d1offset,dst+d2offset,dst+d3offset,
+ stride[0],stride[1],dstPitch,h,w);
}
else
#endif
More information about the MPlayer-cvslog
mailing list