diff options
author | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-18 18:04:29 +0000 |
---|---|---|
committer | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-18 18:04:29 +0000 |
commit | 83a3479f387c7eb3c173e91e30f58f58deb2bdb8 (patch) | |
tree | a9c120a0e43545036c039e1ddc45cc496720309c /libvo/vesa_lvo.c | |
parent | 4471579a0478cafe5af86d262182467cdc2bf3f1 (diff) | |
download | mpv-83a3479f387c7eb3c173e91e30f58f58deb2bdb8.tar.bz2 mpv-83a3479f387c7eb3c173e91e30f58f58deb2bdb8.tar.xz |
Ugly YV12 support on Radeon BES. (Only radeon_vid currently work with this stuff :( Sorry!)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2975 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vesa_lvo.c')
-rw-r--r-- | libvo/vesa_lvo.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/libvo/vesa_lvo.c b/libvo/vesa_lvo.c index f4c5622857..573d9aff23 100644 --- a/libvo/vesa_lvo.c +++ b/libvo/vesa_lvo.c @@ -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 int lvo_handler = -1; 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 @@ int vlvo_init(unsigned src_width,unsigned src_height, 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 @@ uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y #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; } |