diff options
author | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-29 18:00:57 +0000 |
---|---|---|
committer | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-29 18:00:57 +0000 |
commit | 4b5c1a845c241d7c1b7d63f8c871bcb3b1d1ee20 (patch) | |
tree | 33cc524a1bc1cc4d3fbd811f394768096b83b200 /libvo | |
parent | 98feb0179d79ae56ae9898b7be7db63f2913f93b (diff) |
Minor optimization
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3203 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vesa_lvo.c | 25 | ||||
-rw-r--r-- | libvo/vo_vesa.c | 9 |
2 files changed, 19 insertions, 15 deletions
diff --git a/libvo/vesa_lvo.c b/libvo/vesa_lvo.c index 34671d7048..1e43465d5f 100644 --- a/libvo/vesa_lvo.c +++ b/libvo/vesa_lvo.c @@ -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 @@ extern int verbose; #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 @@ int vlvo_preinit(const char *drvname) 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_420(uint8_t *image[], int stride[], int w,int h,int x,i 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; } diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c index ef651a25dd..4d68b1ea22 100644 --- a/libvo/vo_vesa.c +++ b/libvo/vo_vesa.c @@ -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 @@ static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int { 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 @@ static void draw_osd(void) 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 @@ static void flip_page(void) { 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 @@ static uint32_t draw_frame(uint8_t *src[]) 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()) |