summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-29 20:19:17 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-29 20:19:17 +0000
commit5a26f2776048526226fd3aac82af9731fff166f3 (patch)
treea99c8f77dc8ecac61ef0f723ac40a990f73ab7dd /libvo
parent25486c1da7801b6dcf89058d5c1b9ff11054f66f (diff)
downloadmpv-5a26f2776048526226fd3aac82af9731fff166f3.tar.bz2
mpv-5a26f2776048526226fd3aac82af9731fff166f3.tar.xz
swscaler cleanup
green line at bottom bugfix green lines in yuv2yuv scaler bugfix git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3210 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_vesa.c13
-rw-r--r--libvo/vo_x11.c15
2 files changed, 15 insertions, 13 deletions
diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c
index 4d68b1ea22..85dcca0d18 100644
--- a/libvo/vo_vesa.c
+++ b/libvo/vo_vesa.c
@@ -76,8 +76,8 @@ struct win_frame
static void (*cpy_blk_fnc)(unsigned long,uint8_t *,unsigned long) = NULL;
static int vesa_zoom=0; /* software scaling */
-static unsigned int scale_xinc=0;
-static unsigned int scale_yinc=0;
+static unsigned int scale_srcW=0;
+static unsigned int scale_srcH=0;
static uint32_t image_bpp,image_width, image_height; /* source image dimension */
static int32_t x_offset,y_offset; /* to center image on screen */
@@ -253,8 +253,9 @@ static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int
if(HAS_DGA()) dst[0] += y_offset*SCREEN_LINE_SIZE(PIXEL_SIZE())+x_offset*PIXEL_SIZE();
dst_stride = PIXEL_SIZE()*(HAS_DGA()?video_mode_info.XResolution:image_width);
SwScale_YV12slice(image,stride,y,h,dst,dst_stride,
- image_width, video_mode_info.BitsPerPixel,
- scale_xinc, scale_yinc);
+ video_mode_info.BitsPerPixel,
+ scale_srcW, scale_srcH, image_width, image_height);
+
}
else
{
@@ -722,8 +723,8 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3
image_height = video_mode_info.YResolution;
vesa_zoom = 1;
}
- scale_xinc=(width << 16) / image_width - 2; /* needed for proper rounding */
- scale_yinc=(height << 16) / image_height + 2;
+ scale_srcW=width;
+ scale_srcH=height;
if(!lvo_name) SwScale_Init();
if(verbose) printf("vo_vesa: Using SCALE\n");
}
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 04a34430b5..8dd0fe9b11 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -133,8 +133,9 @@ static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsign
static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
}
-static unsigned int scale_xinc=0;
-static unsigned int scale_yinc=0;
+static unsigned int scale_srcW=0;
+static unsigned int scale_srcH=0;
+
static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d_height,uint32_t flags,char *title,uint32_t format )
{
@@ -179,8 +180,8 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d
image_width=d_width&(~7);
image_height=d_height;
}
- scale_xinc=(width << 16) / image_width - 2; // needed for proper rounding
- scale_yinc=(height << 16) / image_height +2;
+ scale_srcW=width;
+ scale_srcH=height;
SwScale_Init();
}
@@ -481,11 +482,11 @@ static void flip_page( void ){
static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y )
{
-if(scale_xinc){
+if(scale_srcW){
uint8_t *dst[3] = {ImageData, NULL, NULL};
SwScale_YV12slice(src,stride,y,h,
- dst, image_width*((bpp+7)/8), image_width, ( depth == 24 ) ? bpp : depth,
- scale_xinc, scale_yinc);
+ dst, image_width*((bpp+7)/8), ( depth == 24 ) ? bpp : depth,
+ scale_srcW, scale_srcH, image_width, image_height);
} else {
uint8_t *dst=ImageData + ( image_width * y + x ) * ( bpp/8 );
yuv2rgb( dst,src[0],src[1],src[2],w,h,image_width*( bpp/8 ),stride[0],stride[1] );