[Mplayer-cvslog] CVS: main/libvo vo_vesa.c,1.9,1.10

Nick Kurshev nick at mplayer.dev.hu
Sat Oct 20 18:56:37 CEST 2001


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

Modified Files:
	vo_vesa.c 
Log Message:
Best fix of slice drawing with libmpeg2

Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vo_vesa.c	20 Oct 2001 16:42:17 -0000	1.9
+++ vo_vesa.c	20 Oct 2001 16:56:24 -0000	1.10
@@ -78,7 +78,7 @@
 static unsigned init_mode; /* mode before run of mplayer */
 static void *init_state = NULL; /* state before run of mplayer */
 static struct win_frame win; /* real-mode window to video memory */
-static void *yuv_buffer = NULL; /* for yuv2rgb and sw_scaling */
+static uint8_t *yuv_buffer = NULL; /* for yuv2rgb and sw_scaling */
 static unsigned video_mode; /* selected video mode for playback */
 static struct VesaModeInfoBlock video_mode_info;
 
@@ -212,7 +212,7 @@
 */
 static void __vbeCopyData(uint8_t *image)
 {
-   unsigned long i,j,image_offset,offset,limit;
+   unsigned long i,j,image_offset,offset;
    unsigned pixel_size,image_line_size,screen_line_size,x_shift;
    pixel_size = (video_mode_info.BitsPerPixel+7)/8;
    screen_line_size = video_mode_info.XResolution*pixel_size;
@@ -225,8 +225,7 @@
    else
    {
      x_shift = x_offset*pixel_size;
-     limit = image_height+y_offset;
-     for(j=0,i=y_offset;i<limit;i++,j++)
+     for(j=0,i=y_offset;j<image_height;i++,j++)
      {
        offset = i*screen_line_size+x_shift;
        image_offset = j*image_line_size;
@@ -237,6 +236,7 @@
 /* is called for yuv only */
 static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
 {
+    uint8_t *yuv_slice;
     if(vesa_zoom)
     {
 	 SwScale_YV12slice_brg24(image,stride,y,h,
@@ -247,13 +247,27 @@
     }
     else
     {
-	uint8_t *yuv_slice;
 	yuv_slice=yuv_buffer+(image_width*y+x)*(video_mode_info.BitsPerPixel+7)/8;
 	yuv2rgb(yuv_slice, image[0], image[1], image[2], w, h,
 		image_width * ((video_mode_info.BitsPerPixel+7)/8),
 		stride[0], stride[1]);
     }
-    __vbeCopyData((uint8_t *)yuv_buffer);
+    if(y || x || w != image_width || h != image_height)
+    {
+	unsigned long i,j,image_offset,offset;
+	unsigned pixel_size,image_line_size,screen_line_size,x_shift;
+	pixel_size = (video_mode_info.BitsPerPixel+7)/8;
+	screen_line_size = video_mode_info.XResolution*pixel_size;
+	image_line_size = w*pixel_size;
+	x_shift = (x_offset+x)*pixel_size;
+	for(j=0,i=(y_offset+y);j<h;i++,j++)
+	{
+	    offset = i*screen_line_size+x_shift;
+	    image_offset = j*image_line_size;
+	    __vbeCopyBlock(offset,&yuv_slice[image_offset],image_line_size);
+	}
+    }
+    else __vbeCopyData((uint8_t *)yuv_buffer);
     return 0;
 }
 
@@ -355,7 +369,6 @@
   int err;
 	image_width = width;
 	image_height = height;
-printf("subdevice: %s\n",vo_subdevice);
 	if(fullscreen & (0x1|0x8))
 	{
 	  printf("vo_vesa: switches: -fs, -flip are not supported\n");




More information about the MPlayer-cvslog mailing list