[Mplayer-cvslog] CVS: main/libvo vesa_lvo.c,1.5,1.6

Nick Kurshev nick at mplayer.dev.hu
Sun Nov 18 19:04:34 CET 2001


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv3036/main/libvo

Modified Files:
	vesa_lvo.c 
Log Message:
Ugly YV12 support on Radeon BES. (Only radeon_vid currently work with this stuff :( Sorry!)

Index: vesa_lvo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vesa_lvo.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vesa_lvo.c	18 Nov 2001 15:06:32 -0000	1.5
+++ vesa_lvo.c	18 Nov 2001 18:04:29 -0000	1.6
@@ -24,6 +24,7 @@
 #include "../drivers/mga_vid.h" /* <- should be changed to "linux/'something'.h" */
 #include "fastmemcpy.h"
 #include "../mmx_defs.h"
+#include "../postproc/rgb2rgb.h"
 
 #define WIDTH_ALIGN 32 /* should be 16 for radeons */
 #define NUM_FRAMES 2
@@ -33,9 +34,11 @@
 static uint8_t *lvo_mem = NULL;
 static uint8_t next_frame;
 static mga_vid_config_t mga_vid_config;
-static unsigned image_bpp,image_height,image_width;
+static unsigned image_bpp,image_height,image_width,src_format;
 extern int verbose;
 
+#define HAVE_RADEON 1
+
 #define PIXEL_SIZE() ((video_mode_info.BitsPerPixel+7)/8)
 #define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
 #define IMAGE_LINE_SIZE(pixel_size) (image_width*(pixel_size))
@@ -59,15 +62,25 @@
 	image_width = src_width;
 	image_height = src_height;
 	mga_vid_config.version=MGA_VID_VERSION;
-        mga_vid_config.format=format;
+        src_format = mga_vid_config.format=format;
         awidth = (src_width + (WIDTH_ALIGN-1)) & ~(WIDTH_ALIGN-1);
         switch(format){
+#ifdef HAVE_RADEON
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+	    image_bpp=16;
+	    mga_vid_config.format = IMGFMT_YUY2;
+	    mga_vid_config.frame_size = awidth*src_height*2;
+	    break;
+#else
         case IMGFMT_YV12:
         case IMGFMT_I420:
         case IMGFMT_IYUV:
 	    image_bpp=16;
 	    mga_vid_config.frame_size = awidth*src_height+(awidth*src_height)/2;
 	    break;
+#endif	    
         case IMGFMT_YUY2:
         case IMGFMT_UYVY:
 	    image_bpp=16;
@@ -170,10 +183,21 @@
 #else
  uint8_t *src;
  uint8_t *dst;
-    dst = lvo_mem + image_width * y + x;
-    src = image[0];
-    w *= (image_bpp+7)/8;
-    memcpy(dst,src,w*h);
+ uint8_t bytpp;
+ bytpp = (image_bpp+7)/8;
+ dst = lvo_mem + (image_width * y + x)*bytpp;
+#ifdef HAVE_RADEON
+    if(src_format == IMGFMT_YV12)
+    {
+      yv12toyuy2(image[0],image[1],image[2],dst
+                 ,w,h,stride[0],stride[1],w*2);
+    }
+    else
+#endif
+    {
+      src = image[0];
+      memcpy(dst,src,w*h*bytpp);
+    }  
 #endif
  return 0;
 }




More information about the MPlayer-cvslog mailing list