changeset 3202:e9b18714e3dc

Minor optimization
author nick
date Thu, 29 Nov 2001 18:00:57 +0000
parents 039a973b3dda
children 8312f4bc8dab
files libvo/vesa_lvo.c libvo/vo_vesa.c
diffstat 2 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vesa_lvo.c	Thu Nov 29 17:31:58 2001 +0000
+++ b/libvo/vesa_lvo.c	Thu Nov 29 18:00:57 2001 +0000
@@ -24,6 +24,8 @@
 #include "../drivers/mga_vid.h" /* <- should be changed to "linux/'something'.h" */
 #include "fastmemcpy.h"
 
+#include "video_out.h"
+
 #define WIDTH_ALIGN 32 /* should be 16 for rage:422 and 32 for rage:420 */
 #define NUM_FRAMES 2
 static uint8_t *frames[NUM_FRAMES];
@@ -39,6 +41,8 @@
 #define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
 #define IMAGE_LINE_SIZE(pixel_size) (image_width*(pixel_size))
 
+extern vo_functions_t video_out_vesa;
+
 int vlvo_preinit(const char *drvname)
 {
   if(verbose > 1) printf("vesa_lvo: vlvo_preinit(%s) was called\n",drvname);
@@ -48,6 +52,11 @@
 		printf("vesa_lvo: Couldn't open '%s'\n",drvname);
 		return -1;
 	}
+	/* we are able to tune up this stuff depend on fourcc format */
+	video_out_vesa.draw_slice=vlvo_draw_slice;
+	video_out_vesa.draw_frame=vlvo_draw_frame;
+	video_out_vesa.flip_page=vlvo_flip_page;
+	video_out_vesa.draw_osd=vlvo_draw_osd;
 	return 0;
 }
 
@@ -172,16 +181,18 @@
 
 uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
 {
- uint8_t *dst;
- uint8_t bytpp;
  if(verbose > 1) printf("vesa_lvo: vlvo_draw_slice() was called\n");
- bytpp = (image_bpp+7)/8;
- dst = lvo_mem + (image_width * y + x)*bytpp;
     if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV)
-      vlvo_draw_slice_420(image,stride,w,h,x,y);
+	vlvo_draw_slice_420(image,stride,w,h,x,y);
     else
-      /* vlvo_draw_slice_422(image,stride,w,h,x,y); just for speed */
-      memcpy(dst,image[0],mga_vid_config.frame_size);
+    {
+	uint8_t *dst;
+	uint8_t bytpp;
+	bytpp = (image_bpp+7)/8;
+	dst = lvo_mem + (image_width * y + x)*bytpp;
+	/* vlvo_draw_slice_422(image,stride,w,h,x,y); just for speed */
+	memcpy(dst,image[0],mga_vid_config.frame_size);
+    }
  return 0;
 }
 
--- a/libvo/vo_vesa.c	Thu Nov 29 17:31:58 2001 +0000
+++ b/libvo/vo_vesa.c	Thu Nov 29 18:00:57 2001 +0000
@@ -34,6 +34,7 @@
 #include "linux/vbelib.h"
 #include "bswap.h"
 #include "aspect.h"
+#include "vesa_lvo.h"
 
 #include "../postproc/swscale.h"
 #include "../postproc/rgb2rgb.h"
@@ -245,8 +246,6 @@
 {
     if(verbose > 2)
 	printf("vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y);
-    if(lvo_name) return vlvo_draw_slice(image,stride,w,h,x,y);
-    else
     if(vesa_zoom)
     {
 	 uint8_t *dst[3]= {dga_buffer, NULL, NULL};
@@ -314,8 +313,6 @@
  uint32_t w,h;
  if(verbose > 2)
 	printf("vo_vesa: draw_osd was called\n");
- if(lvo_name) vlvo_draw_osd();
- else
  {
    w = HAS_DGA()?video_mode_info.XResolution:image_width;
    h = HAS_DGA()?video_mode_info.YResolution:image_height;
@@ -327,8 +324,6 @@
 {
   if(verbose > 2)
 	printf("vo_vesa: flip_page was called\n");
-  if(lvo_name) vlvo_flip_page();
-  else
   if(flip_trigger) 
   {
     if(!HAS_DGA()) __vbeCopyData(dga_buffer);
@@ -365,8 +360,6 @@
   uint8_t *data = src[0];
     if(verbose > 2)
         printf("vo_vesa: draw_frame was called\n");
-    if(lvo_name) return vlvo_draw_frame(src);
-    else
     if(rgb2rgb_fnc)
     {
       if(HAS_DGA())