summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 10:00:58 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 10:00:58 +0000
commitae06a182d42a3a071513cad45ed6ada2d5308376 (patch)
tree92c13839e1819fe84cfacbdacf2ffd9a2094e515 /libvo
parenta9cd780dd1cdfd35ea56f367fac50a3eec61bccd (diff)
downloadmpv-ae06a182d42a3a071513cad45ed6ada2d5308376.tar.bz2
mpv-ae06a182d42a3a071513cad45ed6ada2d5308376.tar.xz
Bad attempt of YV12 direct support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3020 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vesa_lvo.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/libvo/vesa_lvo.c b/libvo/vesa_lvo.c
index 58b215ad92..b6d40e4138 100644
--- a/libvo/vesa_lvo.c
+++ b/libvo/vesa_lvo.c
@@ -144,6 +144,49 @@ void vlvo_term( void )
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
@@ -195,6 +238,25 @@ uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y
,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
memcpy(dst,image[0],mga_vid_config.frame_size);
#endif