1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

Minor optimization

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3203 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nick 2001-11-29 18:00:57 +00:00
parent 98feb0179d
commit 4b5c1a845c
2 changed files with 19 additions and 15 deletions

View File

@ -24,6 +24,8 @@
#include "../drivers/mga_vid.h" /* <- should be changed to "linux/'something'.h" */ #include "../drivers/mga_vid.h" /* <- should be changed to "linux/'something'.h" */
#include "fastmemcpy.h" #include "fastmemcpy.h"
#include "video_out.h"
#define WIDTH_ALIGN 32 /* should be 16 for rage:422 and 32 for rage:420 */ #define WIDTH_ALIGN 32 /* should be 16 for rage:422 and 32 for rage:420 */
#define NUM_FRAMES 2 #define NUM_FRAMES 2
static uint8_t *frames[NUM_FRAMES]; 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 SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
#define IMAGE_LINE_SIZE(pixel_size) (image_width*(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) int vlvo_preinit(const char *drvname)
{ {
if(verbose > 1) printf("vesa_lvo: vlvo_preinit(%s) was called\n",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); printf("vesa_lvo: Couldn't open '%s'\n",drvname);
return -1; 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; 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) 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"); 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) 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 else
{
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 */ /* vlvo_draw_slice_422(image,stride,w,h,x,y); just for speed */
memcpy(dst,image[0],mga_vid_config.frame_size); memcpy(dst,image[0],mga_vid_config.frame_size);
}
return 0; return 0;
} }

View File

@ -34,6 +34,7 @@
#include "linux/vbelib.h" #include "linux/vbelib.h"
#include "bswap.h" #include "bswap.h"
#include "aspect.h" #include "aspect.h"
#include "vesa_lvo.h"
#include "../postproc/swscale.h" #include "../postproc/swscale.h"
#include "../postproc/rgb2rgb.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) if(verbose > 2)
printf("vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y); 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) if(vesa_zoom)
{ {
uint8_t *dst[3]= {dga_buffer, NULL, NULL}; uint8_t *dst[3]= {dga_buffer, NULL, NULL};
@ -314,8 +313,6 @@ static void draw_osd(void)
uint32_t w,h; uint32_t w,h;
if(verbose > 2) if(verbose > 2)
printf("vo_vesa: draw_osd was called\n"); printf("vo_vesa: draw_osd was called\n");
if(lvo_name) vlvo_draw_osd();
else
{ {
w = HAS_DGA()?video_mode_info.XResolution:image_width; w = HAS_DGA()?video_mode_info.XResolution:image_width;
h = HAS_DGA()?video_mode_info.YResolution:image_height; h = HAS_DGA()?video_mode_info.YResolution:image_height;
@ -327,8 +324,6 @@ static void flip_page(void)
{ {
if(verbose > 2) if(verbose > 2)
printf("vo_vesa: flip_page was called\n"); printf("vo_vesa: flip_page was called\n");
if(lvo_name) vlvo_flip_page();
else
if(flip_trigger) if(flip_trigger)
{ {
if(!HAS_DGA()) __vbeCopyData(dga_buffer); if(!HAS_DGA()) __vbeCopyData(dga_buffer);
@ -365,8 +360,6 @@ static uint32_t draw_frame(uint8_t *src[])
uint8_t *data = src[0]; uint8_t *data = src[0];
if(verbose > 2) if(verbose > 2)
printf("vo_vesa: draw_frame was called\n"); printf("vo_vesa: draw_frame was called\n");
if(lvo_name) return vlvo_draw_frame(src);
else
if(rgb2rgb_fnc) if(rgb2rgb_fnc)
{ {
if(HAS_DGA()) if(HAS_DGA())