diff -ur --exclude-from dontdiff vanilla/main/libmpcodecs/vf_expand.c main/libmpcodecs/vf_expand.c --- vanilla/main/libmpcodecs/vf_expand.c 2002-10-17 09:26:04.000000000 +0200 +++ main/libmpcodecs/vf_expand.c 2002-11-02 16:23:20.000000000 +0100 @@ -66,8 +66,8 @@ // TODO clear left and right side of the image if needed } -static void draw_func(int x0,int y0, int w,int h,unsigned char* src, unsigned char *srca, int stride){ - unsigned char* dst; +static void draw_func(int x0,int y0, int w,int h,unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + unsigned char* dst, *dst2, *dst3; if(!vo_osd_changed_flag && vf->priv->dmpi->planes[0]==vf->priv->fb_ptr){ // ok, enough to update the area inside the video, leave the black bands // untouched! @@ -94,19 +94,19 @@ switch(vf->priv->dmpi->imgfmt){ case IMGFMT_BGR15: case IMGFMT_RGB15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,dst,vf->priv->dmpi->stride[0]); break; case IMGFMT_BGR16: case IMGFMT_RGB16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,dst,vf->priv->dmpi->stride[0]); break; case IMGFMT_BGR24: case IMGFMT_RGB24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,dst,vf->priv->dmpi->stride[0]); break; case IMGFMT_BGR32: case IMGFMT_RGB32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,dst,vf->priv->dmpi->stride[0]); break; case IMGFMT_YV12: case IMGFMT_I420: @@ -115,13 +115,22 @@ case IMGFMT_IF09: case IMGFMT_Y800: case IMGFMT_Y8: - vo_draw_alpha_yv12(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); + dst2=vf->priv->dmpi->planes[1]+ + vf->priv->dmpi->stride[1]*y0+ + (vf->priv->dmpi->bpp>>4)*x0; + dst3=vf->priv->dmpi->planes[2]+ + vf->priv->dmpi->stride[2]*y0+ + (vf->priv->dmpi->bpp>>4)*x0; + vo_draw_alpha_yv12(w,h,src,srca,srcp,stride,dst,vf->priv->dmpi->stride[0], + dst2,vf->priv->dmpi->stride[1], + dst3,vf->priv->dmpi->stride[2], + x0 & 0x01, y0 & 0x01); break; case IMGFMT_YUY2: - vo_draw_alpha_yuy2(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,dst,vf->priv->dmpi->stride[0],x0 & 0x01); break; case IMGFMT_UYVY: - vo_draw_alpha_yuy2(w,h,src,srca,stride,dst+1,vf->priv->dmpi->stride[0]); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,dst+1,vf->priv->dmpi->stride[0],x0 & 0x01); break; } } diff -ur --exclude-from dontdiff vanilla/main/libvo/osd.c main/libvo/osd.c --- vanilla/main/libvo/osd.c 2002-05-02 12:46:25.000000000 +0200 +++ main/libvo/osd.c 2002-11-02 17:02:19.000000000 +0100 @@ -2,9 +2,6 @@ // These are "reference implementations", should be optimized later (MMX, etc) // Templating Code from Michael Niedermayer (michaelni@gmx.at) is under GPL -//#define FAST_OSD -//#define FAST_OSD_TABLE - #include "config.h" #include "osd.h" #include "mp_msg.h" @@ -16,6 +13,26 @@ extern int verbose; // defined in mplayer.c +#define PALSIZE 9 +/* R,G,B */ +int palette[PALSIZE][3] = { + {0, 0, 0}, /* dummy entry */ + {0, 0, 0}, + {0, 0, 255}, + {0, 255, 0}, + {0, 255, 255}, + {255, 0, 0}, + {255, 0, 255}, + {255, 255, 0}, + {255, 255, 255}, +}; + +static unsigned int palette_rgb24[256]; +static unsigned int palette_yuy2[3][256]; +static unsigned int palette_yv12[3][256]; + +#undef ARCH_X86 + #ifdef ARCH_X86 #define CAN_COMPILE_X86_ASM #endif @@ -52,14 +69,14 @@ #undef HAVE_3DNOW #undef ARCH_X86 -#ifdef COMPILE_C +//#ifdef COMPILE_C #undef HAVE_MMX #undef HAVE_MMX2 #undef HAVE_3DNOW #undef ARCH_X86 #define RENAME(a) a ## _C #include "osd_template.c" -#endif +//#endif #ifdef CAN_COMPILE_X86_ASM @@ -109,139 +126,157 @@ #endif //CAN_COMPILE_X86_ASM -void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase1, int dststride1, unsigned char* dstbase2, int dststride2, unsigned char* dstbase3, int dststride3, int xmod, int ymod){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered per speed fasterst first if(gCpuCaps.hasMMX2) - vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); else if(gCpuCaps.has3DNow) - vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); else if(gCpuCaps.hasMMX) - vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); else - vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_X86(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); #else - vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_C(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); #elif defined (HAVE_3DNOW) - vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); #elif defined (HAVE_MMX) - vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); #elif defined (ARCH_X86) - vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_X86(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); #else - vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_C(w, h, src, srca, srcp, srcstride, dstbase1, dststride1, dstbase2, dststride2, dstbase3, dststride3, xmod, ymod); #endif #endif //!RUNTIME_CPUDETECT } -void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride,int xmod){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered per speed fasterst first if(gCpuCaps.hasMMX2) - vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); else if(gCpuCaps.has3DNow) - vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); else if(gCpuCaps.hasMMX) - vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); else - vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_X86(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); #else - vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_C(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); #elif defined (HAVE_3DNOW) - vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); #elif defined (HAVE_MMX) - vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); #elif defined (ARCH_X86) - vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_X86(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); #else - vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_C(w, h, src, srca, srcp, srcstride, dstbase, dststride, xmod); #endif #endif //!RUNTIME_CPUDETECT } -void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered per speed fasterst first if(gCpuCaps.hasMMX2) - vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcp, srcstride, dstbase, dststride); else if(gCpuCaps.has3DNow) - vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcp, srcstride, dstbase, dststride); else if(gCpuCaps.hasMMX) - vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcp, srcstride, dstbase, dststride); else - vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_X86(w, h, src, srca, srcp, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_C(w, h, src, srca, srcp, srcstride, dstbase, dststride); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcp, srcstride, dstbase, dststride); #elif defined (HAVE_3DNOW) - vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcp, srcstride, dstbase, dststride); #elif defined (HAVE_MMX) - vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcp, srcstride, dstbase, dststride); #elif defined (ARCH_X86) - vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_X86(w, h, src, srca, srcp, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_C(w, h, src, srca, srcp, srcstride, dstbase, dststride); #endif #endif //!RUNTIME_CPUDETECT } -void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered per speed fasterst first if(gCpuCaps.hasMMX2) - vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcp, srcstride, dstbase, dststride); else if(gCpuCaps.has3DNow) - vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcp, srcstride, dstbase, dststride); else if(gCpuCaps.hasMMX) - vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcp, srcstride, dstbase, dststride); else - vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_X86(w, h, src, srca, srcp, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_C(w, h, src, srca, srcp, srcstride, dstbase, dststride); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcp, srcstride, dstbase, dststride); #elif defined (HAVE_3DNOW) - vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcp, srcstride, dstbase, dststride); #elif defined (HAVE_MMX) - vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcp, srcstride, dstbase, dststride); #elif defined (ARCH_X86) - vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_X86(w, h, src, srca, srcp, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_C(w, h, src, srca, srcp, srcstride, dstbase, dststride); #endif #endif //!RUNTIME_CPUDETECT } -#ifdef FAST_OSD_TABLE -static unsigned short fast_osd_15bpp_table[256]; -static unsigned short fast_osd_16bpp_table[256]; -#endif +#define MIN(a, b) ((a)<(b)?(a):(b)) +#define MAX(a, b) ((a)>(b)?(a):(b)) -void vo_draw_alpha_init(){ -#ifdef FAST_OSD_TABLE +void vo_draw_alpha_generate_palettes() +{ int i; - for(i=0;i<256;i++){ - fast_osd_15bpp_table[i]=((i>>3)<<10)|((i>>3)<<5)|(i>>3); - fast_osd_16bpp_table[i]=((i>>3)<<11)|((i>>2)<<5)|(i>>3); + int r, g, b, y, u, v; + + for (i = 0; i < PALSIZE; i++) { + r = palette[i][0]; + g = palette[i][1]; + b = palette[i][2]; + y = MIN(MAX((int)(0.1494 * r + 0.6061 * g + 0.2445 * b), 0), 0xff); + u = MIN(MAX((int)(0.6066 * r - 0.4322 * g - 0.1744 * b) + 128, 0), 0xff); + v = MIN(MAX((int)(-0.08435 * r - 0.3422 * g + 0.4266 * b) + 128, 0), 0xff); + + palette_yv12[0][i] = y; + palette_yv12[1][i] = u; + palette_yv12[2][i] = v; + +// palette_yuy2[i] = (u >> 4) << 12 | (y >> 4) << 8 | (v >> 4) << 4 | (y & 0x0f); + palette_yuy2[0][i] = y; + palette_yuy2[1][i] = u; + palette_yuy2[2][i] = v; + + palette_rgb24[i] = b << 16 | g << 8 | r; } -#endif +} + + +void vo_draw_alpha_init(){ //FIXME the optimized stuff is a lie for 15/16bpp as they arent optimized yet if(verbose) { @@ -273,31 +308,23 @@ #endif #endif //!RUNTIME_CPUDETECT } + vo_draw_alpha_generate_palettes(); } -void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride){ int y; for(y=0;y>3; - dst[x]=(a<<10)|(a<<5)|a; -#endif -#else unsigned char r=dst[x]&0x1F; unsigned char g=(dst[x]>>5)&0x1F; unsigned char b=(dst[x]>>10)&0x1F; - r=(((r*srca[x])>>5)+src[x])>>3; - g=(((g*srca[x])>>5)+src[x])>>3; - b=(((b*srca[x])>>5)+src[x])>>3; + r=(((r*srca[x])>>5)+(src[x]*(palette_rgb24[srcp[x]]>>16 & 0xff)>>8))>>3; + g=(((g*srca[x])>>5)+(src[x]*(palette_rgb24[srcp[x]]>>8 & 0xff)>>8))>>3; + b=(((b*srca[x])>>5)+(src[x]*(palette_rgb24[srcp[x]] & 0xff)>>8))>>3; dst[x]=(b<<10)|(g<<5)|r; -#endif } } src+=srcstride; @@ -307,28 +334,20 @@ return; } -void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride){ int y; for(y=0;y>3)<<11)|((src[x]>>2)<<5)|(src[x]>>3); -#endif -#else unsigned char r=dst[x]&0x1F; unsigned char g=(dst[x]>>5)&0x3F; unsigned char b=(dst[x]>>11)&0x1F; - r=(((r*srca[x])>>5)+src[x])>>3; - g=(((g*srca[x])>>6)+src[x])>>2; - b=(((b*srca[x])>>5)+src[x])>>3; + r=(((r*srca[x])>>5)+(src[x]*(palette_rgb24[srcp[x]]>>16 & 0xff)>>8))>>3; + g=(((g*srca[x])>>6)+(src[x]*(palette_rgb24[srcp[x]]>>8 & 0xff)>>8))>>2; + b=(((b*srca[x])>>5)+(src[x]*(palette_rgb24[srcp[x]] & 0xff)>>8))>>3; dst[x]=(b<<11)|(g<<5)|r; -#endif } } src+=srcstride; diff -ur --exclude-from dontdiff vanilla/main/libvo/osd.h main/libvo/osd.h --- vanilla/main/libvo/osd.h 2001-06-11 00:25:09.000000000 +0200 +++ main/libvo/osd.h 2002-11-02 16:20:37.000000000 +0100 @@ -7,12 +7,12 @@ extern void vo_draw_alpha_init(); // build tables -extern void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride1,unsigned char* dstbase2, int dststride2, unsigned char* dstbase3, int dststride3, int xmod, int ymod); +extern void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride,int xmod); +extern void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride); #endif diff -ur --exclude-from dontdiff vanilla/main/libvo/osd_template.c main/libvo/osd_template.c --- vanilla/main/libvo/osd_template.c 2002-03-16 18:12:19.000000000 +0100 +++ main/libvo/osd_template.c 2002-11-02 18:03:27.000000000 +0100 @@ -27,12 +27,39 @@ #define EMMS "emms" #endif -static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void calc_pal(unsigned char *srcp, unsigned char *dst, int srcstride, unsigned int *pal) +{ + int cnt = 0; + int pal_idx=0; + int s,d; + + + if (srcp[0]) { pal_idx = srcp[0]; cnt++; } + if (srcp[1]) { pal_idx = srcp[1]; cnt++; } + if (srcp[srcstride]) { pal_idx = srcp[srcstride]; cnt++; } + if (srcp[srcstride+1]) { pal_idx = srcp[srcstride+1]; cnt++; } + + s = pal[pal_idx]; + d = *dst; + + d -= 128; + s -= 128; + + d = (d*(4-cnt)+s*cnt)/4; + + *dst = d+128; + +// *dst = (*dst*(4-cnt) + pal[pal_idx]*cnt)/4; +} + +static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src1, unsigned char *srca1, unsigned char *srcp1, int srcstride, unsigned char* dstbase1,int dststride1, unsigned char* dstbase2, int dststride2, unsigned char* dstbase3, int dststride3, int xmod, int ymod){ int y; -#if defined(FAST_OSD) && !defined(HAVE_MMX) - w=w>>1; -#endif + unsigned char *src = src1; + unsigned char *srca = srca1; + unsigned char *srcp; + unsigned char *pal; PROFILE_START(); + srcp = srcp1; for(y=0;y>8)+src[x]; -#endif + if(srca[x]) dstbase1[x]=((dstbase1[x]*srca[x])>>8)+((src[x]*palette_yv12[0][srcp[x]])>>8); } #endif src+=srcstride; srca+=srcstride; - dstbase+=dststride; + srcp+=srcstride; + dstbase1+=dststride1; + } + srcp = srcp1-srcstride*ymod-xmod; + dstbase2+=dststride2; + srcp+=srcstride*2; + for(y=1;y>1; -#endif + int pal; PROFILE_START(); + + srcp -= xmod; for(y=0;y>8)+src[x]; + dstbase[2*x]=((dstbase[2*x]*srca[x])>>8)+((src[x]*palette_yuy2[0][srcp[x]])>>8); +// if (x & 1) dstbase[2*x+1] = 0; +// else dstbase[2*x+1] = 128; dstbase[2*x+1]=((((signed)dstbase[2*x+1]-128)*srca[x])>>8)+128; + calc_pal_yuy2(srcp+(x&(~1)), dstbase+2*x+1, palette_yuy2[pal+1]); } -#endif + pal = pal ^ 1; } #endif src+=srcstride; srca+=srcstride; + srcp+=srcstride; dstbase+=dststride; } #ifdef HAVE_MMX @@ -164,7 +235,7 @@ return; } -static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride){ int y; for(y=0;y>8)+src[x]; - dst[1]=((dst[1]*srca[x])>>8)+src[x]; - dst[2]=((dst[2]*srca[x])>>8)+src[x]; -#endif + dst[0]=((dst[0]*srca[x])>>8)+(src[x]*(palette_rgb24[srcp[x]]>>16 & 0xff)>>8); + dst[1]=((dst[1]*srca[x])>>8)+(src[x]*(palette_rgb24[srcp[x]]>>8 & 0xff)>>8);; + dst[2]=((dst[2]*srca[x])>>8)+(src[x]*(palette_rgb24[srcp[x]] & 0xff)>>8); } dst+=3; // 24bpp } #endif /* arch_x86 */ src+=srcstride; srca+=srcstride; + srcp+=srcstride; dstbase+=dststride; } #ifdef HAVE_MMX @@ -266,7 +334,7 @@ return; } -static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int srcstride, unsigned char* dstbase,int dststride){ int y; PROFILE_START(); for(y=0;y>8)+src[x]; - dstbase[4*x+1]=((dstbase[4*x+1]*srca[x])>>8)+src[x]; - dstbase[4*x+2]=((dstbase[4*x+2]*srca[x])>>8)+src[x]; -#endif + dstbase[4*x+0]=((dstbase[4*x+0]*srca[x])>>8)+(src[x]*(palette_rgb24[srcp[x]]>>16 & 0xff)>>8); + dstbase[4*x+1]=((dstbase[4*x+1]*srca[x])>>8)+(src[x]*(palette_rgb24[srcp[x]]>>8 & 0xff)>>8); + dstbase[4*x+2]=((dstbase[4*x+2]*srca[x])>>8)+(src[x]*(palette_rgb24[srcp[x]] & 0xff)>>8); } } #endif /* arch_x86 */ src+=srcstride; srca+=srcstride; + srcp+=srcstride; dstbase+=dststride; } #ifdef HAVE_MMX diff -ur --exclude-from dontdiff vanilla/main/libvo/sub.c main/libvo/sub.c --- vanilla/main/libvo/sub.c 2002-10-06 23:04:28.000000000 +0200 +++ main/libvo/sub.c 2002-11-02 17:05:13.000000000 +0100 @@ -43,8 +43,10 @@ return h; } +static int xpal = 0; + // renders char to a big per-object buffer where alpha and bitmap are separated -static void draw_alpha_buf(mp_osd_obj_t* obj, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_buf(mp_osd_obj_t* obj, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride, unsigned char pal_idx) { int dststride = obj->stride; int dstskip = obj->stride-w; @@ -52,6 +54,7 @@ int i, j; unsigned char *b = obj->bitmap_buffer + (y0-obj->bbox.y1)*dststride + (x0-obj->bbox.x1); unsigned char *a = obj->alpha_buffer + (y0-obj->bbox.y1)*dststride + (x0-obj->bbox.x1); + unsigned char *p = obj->palette_buffer + (y0-obj->bbox.y1)*dststride + (x0-obj->bbox.x1); unsigned char *bs = src; unsigned char *as = srca; @@ -63,17 +66,26 @@ } for (i = 0; i < h; i++) { - for (j = 0; j < w; j++, b++, a++, bs++, as++) { - if (*b < *bs) *b = *bs; + for (j = 0; j < w; j++, b++, a++, p++, bs++, as++) { + if (*b < *bs) { + *b = *bs; + *p = xpal; + } if (*as) { - if (*a == 0 || *a > *as) *a = *as; + if (*a == 0 || *a > *as) { + *a = *as; + } } } b+= dstskip; a+= dstskip; + p+= dstskip; bs+= srcskip; as+= srcskip; } + xpal++; + + if (xpal > 8) xpal = 0; } // allocates/enlarges the alpha/bitmap buffer @@ -87,22 +99,26 @@ if (obj->allocatedallocated = len; free(obj->bitmap_buffer); + free(obj->palette_buffer); free(obj->alpha_buffer); obj->bitmap_buffer = (unsigned char *)memalign(16, len); obj->alpha_buffer = (unsigned char *)memalign(16, len); + obj->palette_buffer = (unsigned char *)memalign(16, len); } memset(obj->bitmap_buffer, 0, len); memset(obj->alpha_buffer, 0, len); + memset(obj->palette_buffer, 0, len); } // renders the buffer -inline static void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ +inline static void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride)){ if (obj->allocated > 0) { draw_alpha(obj->bbox.x1,obj->bbox.y1, obj->bbox.x2-obj->bbox.x1, obj->bbox.y2-obj->bbox.y1, obj->bitmap_buffer, obj->alpha_buffer, + obj->palette_buffer, obj->stride); } } @@ -139,7 +155,8 @@ vo_font->pic_a[font]->h, vo_font->pic_b[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); + vo_font->pic_a[font]->w, + 1); x+=vo_font->width[c]+vo_font->charspace; } } @@ -230,7 +247,7 @@ vo_font->pic_a[font]->h, vo_font->pic_b[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); + vo_font->pic_a[font]->w, 1); } c=OSD_PB_START; @@ -240,7 +257,7 @@ vo_font->pic_a[font]->h, vo_font->pic_b[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); + vo_font->pic_a[font]->w, 1); x+=vo_font->width[c]+vo_font->charspace; c=OSD_PB_0; @@ -251,7 +268,7 @@ sa=vo_font->pic_a[font]->bmp+vo_font->start[c]; st=vo_font->pic_a[font]->w; if ((i=mark)) do { - draw_alpha_buf(obj,x,y,w,h,s,sa,st); + draw_alpha_buf(obj,x,y,w,h,s,sa,st,1); x+=charw; } while(--i); } @@ -264,7 +281,7 @@ sa=vo_font->pic_a[font]->bmp+vo_font->start[c]; st=vo_font->pic_a[font]->w; if ((i=elems-mark)) do { - draw_alpha_buf(obj,x,y,w,h,s,sa,st); + draw_alpha_buf(obj,x,y,w,h,s,sa,st,1); x+=charw; } while(--i); } @@ -276,7 +293,7 @@ vo_font->pic_a[font]->h, vo_font->pic_b[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); + vo_font->pic_a[font]->w, 1); // x+=vo_font->width[c]+vo_font->charspace; } @@ -421,7 +438,7 @@ vo_font->pic_a[font]->h+ydys ? vo_font->pic_a[font]->h : obj->dys-y, vo_font->pic_b[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); + vo_font->pic_a[font]->w, 1); x+=vo_font->width[c]+vo_font->charspace; prevc = c; } @@ -443,7 +460,7 @@ obj->flags |= OSDFLAG_BBOX; } -inline static void vo_draw_spudec_sub(mp_osd_obj_t* obj, void (*draw_alpha)(int x0, int y0, int w, int h, unsigned char* src, unsigned char* srca, int stride)) +inline static void vo_draw_spudec_sub(mp_osd_obj_t* obj, void (*draw_alpha)(int x0, int y0, int w, int h, unsigned char* src, unsigned char* srca, unsigned char* srcp, int stride)) { spudec_draw_scaled(vo_spudec, obj->dxs, obj->dys, draw_alpha); } @@ -590,7 +607,7 @@ } } -void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ +void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride)){ mp_osd_obj_t* obj=vo_osd_list; vo_update_osd(dxs,dys); while(obj){ diff -ur --exclude-from dontdiff vanilla/main/libvo/sub.h main/libvo/sub.h --- vanilla/main/libvo/sub.h 2002-10-06 23:04:28.000000000 +0200 +++ main/libvo/sub.h 2002-11-02 10:41:28.000000000 +0100 @@ -44,6 +44,7 @@ int allocated; unsigned char *alpha_buffer; + unsigned char *palette_buffer; unsigned char *bitmap_buffer; } mp_osd_obj_t; @@ -102,7 +103,7 @@ //extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); //extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); //extern void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); -extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride)); extern void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h)); void vo_init_osd(); diff -ur --exclude-from dontdiff vanilla/main/libvo/vesa_lvo.c main/libvo/vesa_lvo.c --- vanilla/main/libvo/vesa_lvo.c 2002-07-26 18:20:58.000000000 +0200 +++ main/libvo/vesa_lvo.c 2002-11-02 16:22:22.000000000 +0100 @@ -227,7 +227,7 @@ } } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { UNUSED(x0); UNUSED(y0); @@ -235,42 +235,46 @@ UNUSED(h); UNUSED(src); UNUSED(srca); + UNUSED(srcp); UNUSED(stride); } -static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { uint32_t bespitch = /*(*/mga_vid_config.src_width;// + 15) & ~15; switch(mga_vid_config.format){ case IMGFMT_BGR15: case IMGFMT_RGB15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); break; case IMGFMT_BGR16: case IMGFMT_RGB16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); break; case IMGFMT_BGR24: case IMGFMT_RGB24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,lvo_mem+3*(y0*bespitch+x0),3*bespitch); + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,lvo_mem+3*(y0*bespitch+x0),3*bespitch); break; case IMGFMT_BGR32: case IMGFMT_RGB32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,lvo_mem+4*(y0*bespitch+x0),4*bespitch); + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,lvo_mem+4*(y0*bespitch+x0),4*bespitch); break; case IMGFMT_YV12: case IMGFMT_IYUV: case IMGFMT_I420: - vo_draw_alpha_yv12(w,h,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); + vo_draw_alpha_yv12(w,h,src,srca,srcp,stride,lvo_mem+bespitch*y0+x0,bespitch, + lvo_mem+bespitch*y0/4+x0/2+mga_vid_config.src_width*mga_vid_config.src_height,bespitch, + lvo_mem+bespitch*y0/4+x0/2+mga_vid_config.src_width*mga_vid_config.src_height*5/4,bespitch, + x0 & 0x01, y0 & 0x01); break; case IMGFMT_YUY2: - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+2*(bespitch*y0+x0),bespitch); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,lvo_mem+2*(bespitch*y0+x0),bespitch,x0 & 0x01); break; case IMGFMT_UYVY: - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+2*(bespitch*y0+x0)+1,bespitch); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,lvo_mem+2*(bespitch*y0+x0)+1,bespitch,x0 & 0x01); break; default: - draw_alpha_null(x0,y0,w,h,src,srca,stride); + draw_alpha_null(x0,y0,w,h,src,srca,srcp,stride); } } diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_dga.c main/libvo/vo_dga.c --- vanilla/main/libvo/vo_dga.c 2002-11-01 19:44:47.000000000 +0100 +++ main/libvo/vo_dga.c 2002-11-02 10:47:02.000000000 +0100 @@ -282,7 +282,7 @@ //--------------------------------------------------------- -static void draw_alpha( int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride ){ +static void draw_alpha( int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride ){ char *d; unsigned int offset; @@ -295,16 +295,16 @@ switch( HW_MODE.vdm_mplayer_depth ){ case 32: - vo_draw_alpha_rgb32(w,h,src,srca,stride, d+4*offset , 4*buffer_stride); + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride, d+4*offset , 4*buffer_stride); break; case 24: - vo_draw_alpha_rgb24(w,h,src,srca,stride, d+3*offset , 3*buffer_stride); + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride, d+3*offset , 3*buffer_stride); break; case 15: - vo_draw_alpha_rgb15(w,h,src,srca,stride, d+2*offset , 2*buffer_stride); + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride, d+2*offset , 2*buffer_stride); break; case 16: - vo_draw_alpha_rgb16(w,h,src,srca,stride, d+2*offset , 2*buffer_stride); + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride, d+2*offset , 2*buffer_stride); break; } } diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_gif89a.c main/libvo/vo_gif89a.c --- vanilla/main/libvo/vo_gif89a.c 2002-09-22 20:21:45.000000000 +0200 +++ main/libvo/vo_gif89a.c 2002-11-02 11:02:07.000000000 +0100 @@ -161,9 +161,9 @@ } #ifdef USE_OSD -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) +static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, unsigned char *srcp, int stride) { - vo_draw_alpha_rgb24(w, h, src, srca, stride, image_data + 3 * (y0 * image_width + x0), 3 * image_width); + vo_draw_alpha_rgb24(w, h, src, srca, srcp, stride, image_data + 3 * (y0 * image_width + x0), 3 * image_width); } #endif diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_gl2.c main/libvo/vo_gl2.c --- vanilla/main/libvo/vo_gl2.c 2002-10-29 23:20:10.000000000 +0100 +++ main/libvo/vo_gl2.c 2002-11-02 11:01:05.000000000 +0100 @@ -99,7 +99,7 @@ static int used_s=0, used_r=0, used_b=0, used_info_done=0; static void (*draw_alpha_fnc) - (int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); + (int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride); /* The squares that are tiled to make up the game screen polygon */ @@ -579,23 +579,23 @@ glLoadIdentity(); } -static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb32(w,h,src,srca,stride,ImageData+4*(y0*image_width+x0),4*image_width); +static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,ImageData+4*(y0*image_width+x0),4*image_width); } -static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb24(w,h,src,srca,stride,ImageData+3*(y0*image_width+x0),3*image_width); +static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,ImageData+3*(y0*image_width+x0),3*image_width); } -static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb16(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); +static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,ImageData+2*(y0*image_width+x0),2*image_width); } -static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb15(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); +static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,ImageData+2*(y0*image_width+x0),2*image_width); } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ } static int choose_glx_visual(Display *dpy, int scr, XVisualInfo *res_vi) diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_jpeg.c main/libvo/vo_jpeg.c --- vanilla/main/libvo/vo_jpeg.c 2002-09-22 20:21:45.000000000 +0200 +++ main/libvo/vo_jpeg.c 2002-11-02 11:01:39.000000000 +0100 @@ -54,9 +54,9 @@ static int cspace=RGB; static int framenum=0; -static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { - vo_draw_alpha_rgb24(w, h, src, srca, stride, image_data + 3 * (y0 * image_width + x0), 3 * image_width); + vo_draw_alpha_rgb24(w, h, src, srca, srcp, stride, image_data + 3 * (y0 * image_width + x0), 3 * image_width); } static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_sdl.c main/libvo/vo_sdl.c --- vanilla/main/libvo/vo_sdl.c 2002-10-10 10:22:23.000000000 +0200 +++ main/libvo/vo_sdl.c 2002-11-02 17:11:47.000000000 +0100 @@ -307,7 +307,7 @@ * **/ -static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ struct sdl_priv_s *priv = &sdl_priv; if(priv->osd_has_changed) { @@ -348,16 +348,20 @@ case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: - vo_draw_alpha_yv12(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + vo_draw_alpha_yv12(w,h,src,srca,srcp,stride, + priv->overlay->pixels[0]+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0], + priv->overlay->pixels[1]+priv->overlay->pitches[1]*(y0>>1)+x0/2,priv->overlay->pitches[1], + priv->overlay->pixels[2]+priv->overlay->pitches[2]*(y0>>1)+x0/2,priv->overlay->pitches[2], + x0 & 0x01, y0 & 0x01); break; case IMGFMT_YUY2: case IMGFMT_YVYU: x0 *= 2; - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0],x0 & 0x01); break; case IMGFMT_UYVY: x0 *= 2; - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0],x0 & 0x01); break; default: @@ -366,19 +370,19 @@ switch(priv->format) { case IMGFMT_RGB15: case IMGFMT_BGR15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; case IMGFMT_RGB16: case IMGFMT_BGR16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; case IMGFMT_RGB24: case IMGFMT_BGR24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; case IMGFMT_RGB32: case IMGFMT_BGR32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; } } @@ -387,19 +391,19 @@ switch(priv->format) { case IMGFMT_RGB15: case IMGFMT_BGR15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; case IMGFMT_RGB16: case IMGFMT_BGR16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; case IMGFMT_RGB24: case IMGFMT_BGR24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; case IMGFMT_RGB32: case IMGFMT_BGR32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; } } diff -ur --exclude-from dontdiff vanilla/main/libvo/vosub_vidix.c main/libvo/vosub_vidix.c --- vanilla/main/libvo/vosub_vidix.c 2002-10-10 10:22:23.000000000 +0200 +++ main/libvo/vosub_vidix.c 2002-11-02 16:22:59.000000000 +0100 @@ -289,7 +289,7 @@ } } -static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { uint32_t apitch,bespitch; void *lvo_mem; @@ -304,35 +304,38 @@ case IMGFMT_Y8: case IMGFMT_Y800: bespitch = (vidix_play.src.w + apitch) & (~apitch); - vo_draw_alpha_yv12(w,h,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); + vo_draw_alpha_yv12(w,h,src,srca,srcp,stride,lvo_mem+bespitch*y0+x0,bespitch, + lvo_mem+bespitch*(y0/2)+x0/2+vidix_play.offset.v,bespitch/2, + lvo_mem+bespitch*(y0/2)+x0/2+vidix_play.offset.u,bespitch/2, + x0&1, y0&1); break; case IMGFMT_YUY2: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0,bespitch); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,lvo_mem+bespitch*y0+2*x0,bespitch,x0 & 0x01); break; case IMGFMT_UYVY: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0+1,bespitch); + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride,lvo_mem+bespitch*y0+2*x0+1,bespitch,x0 & 0x01); break; case IMGFMT_RGB32: case IMGFMT_BGR32: bespitch = (vidix_play.src.w*4 + apitch) & (~apitch); - vo_draw_alpha_rgb32(w,h,src,srca,stride,lvo_mem+y0*bespitch+4*x0,bespitch); + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,lvo_mem+y0*bespitch+4*x0,bespitch); break; case IMGFMT_RGB24: case IMGFMT_BGR24: bespitch = (vidix_play.src.w*3 + apitch) & (~apitch); - vo_draw_alpha_rgb24(w,h,src,srca,stride,lvo_mem+y0*bespitch+3*x0,bespitch); + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,lvo_mem+y0*bespitch+3*x0,bespitch); break; case IMGFMT_RGB16: case IMGFMT_BGR16: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_rgb16(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,lvo_mem+y0*bespitch+2*x0,bespitch); break; case IMGFMT_RGB15: case IMGFMT_BGR15: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_rgb15(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,lvo_mem+y0*bespitch+2*x0,bespitch); break; default: return; diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_vesa.c main/libvo/vo_vesa.c --- vanilla/main/libvo/vo_vesa.c 2002-10-10 10:22:23.000000000 +0200 +++ main/libvo/vo_vesa.c 2002-11-02 11:03:12.000000000 +0100 @@ -103,7 +103,7 @@ static unsigned video_mode; /* selected video mode for playback */ static struct VesaModeInfoBlock video_mode_info; static int flip_trigger = 0; -static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); +static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride); /* multibuffering */ uint8_t* video_base; /* should be never changed */ @@ -281,7 +281,7 @@ /* Please comment it out if you want have OSD within movie */ /*#define OSD_OUTSIDE_MOVIE 1*/ -static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -291,10 +291,10 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb32(w,h,src,srca,stride,dga_buffer+4*(y0*dstride+x0),4*dstride); + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,dga_buffer+4*(y0*dstride+x0),4*dstride); } -static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -304,10 +304,10 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb24(w,h,src,srca,stride,dga_buffer+3*(y0*dstride+x0),3*dstride); + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,dga_buffer+3*(y0*dstride+x0),3*dstride); } -static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -317,10 +317,10 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb16(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); } -static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -330,10 +330,10 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb15(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride) { UNUSED(x0); UNUSED(y0); diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_x11.c main/libvo/vo_x11.c --- vanilla/main/libvo/vo_x11.c 2002-10-29 23:20:10.000000000 +0100 +++ main/libvo/vo_x11.c 2002-11-02 10:44:59.000000000 +0100 @@ -43,7 +43,7 @@ /* private prototypes */ static void Display_Image ( XImage * myximage,unsigned char *ImageData ); -static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); +static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride); /* local data */ static unsigned char *ImageData; @@ -93,23 +93,23 @@ } } -static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb32(w,h,src,srca,stride,ImageData+4*(y0*image_width+x0),4*image_width); +static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb32(w,h,src,srca,srcp,stride,ImageData+4*(y0*image_width+x0),4*image_width); } -static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb24(w,h,src,srca,stride,ImageData+3*(y0*image_width+x0),3*image_width); +static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb24(w,h,src,srca,srcp,stride,ImageData+3*(y0*image_width+x0),3*image_width); } -static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb16(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); +static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb16(w,h,src,srca,srcp,stride,ImageData+2*(y0*image_width+x0),2*image_width); } -static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb15(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); +static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ + vo_draw_alpha_rgb15(w,h,src,srca,srcp,stride,ImageData+2*(y0*image_width+x0),2*image_width); } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ } static SwsContext *swsContext=NULL; diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_xv.c main/libvo/vo_xv.c --- vanilla/main/libvo/vo_xv.c 2002-10-23 19:59:22.000000000 +0200 +++ main/libvo/vo_xv.c 2002-11-02 16:21:52.000000000 +0100 @@ -86,30 +86,38 @@ static uint32_t drwX,drwY,drwBorderWidth,drwDepth; static uint32_t dwidth,dheight; -static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); +static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride); -static void draw_alpha_yv12(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha_yv12(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ x0+=(vo_panscan_x>>2); - vo_draw_alpha_yv12(w,h,src,srca,stride, - xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+ - xvimage[current_buf]->pitches[0]*y0+x0,xvimage[current_buf]->pitches[0]); + + vo_draw_alpha_yv12(w,h,src,srca,srcp,stride, + xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+ + xvimage[current_buf]->pitches[0]*y0+x0,xvimage[current_buf]->pitches[0], + xvimage[current_buf]->data+xvimage[current_buf]->offsets[1]+ + xvimage[current_buf]->pitches[1]*(y0>>1)+(x0>>1),xvimage[current_buf]->pitches[1], + xvimage[current_buf]->data+xvimage[current_buf]->offsets[2]+ + xvimage[current_buf]->pitches[2]*(y0>>1)+(x0>>1),xvimage[current_buf]->pitches[2], + x0 & 0x01, y0 & 0x01 + ); + } -static void draw_alpha_yuy2(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha_yuy2(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ x0+=(vo_panscan_x>>2); - vo_draw_alpha_yuy2(w,h,src,srca,stride, + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride, xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+ - xvimage[current_buf]->pitches[0]*y0+2*x0,xvimage[current_buf]->pitches[0]); + xvimage[current_buf]->pitches[0]*y0+2*x0,xvimage[current_buf]->pitches[0],x0 & 0x01); } -static void draw_alpha_uyvy(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha_uyvy(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ x0+=(vo_panscan_x>>2); - vo_draw_alpha_yuy2(w,h,src,srca,stride, + vo_draw_alpha_yuy2(w,h,src,srca,srcp,stride, xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+ - xvimage[current_buf]->pitches[0]*y0+2*x0+1,xvimage[current_buf]->pitches[0]); + xvimage[current_buf]->pitches[0]*y0+2*x0+1,xvimage[current_buf]->pitches[0],x0 & 0x01); } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride){ } static int xv_set_eq(char *name, int value) diff -ur --exclude-from dontdiff vanilla/main/libvo/vo_yuv4mpeg.c main/libvo/vo_yuv4mpeg.c --- vanilla/main/libvo/vo_yuv4mpeg.c 2002-10-10 10:22:23.000000000 +0200 +++ main/libvo/vo_yuv4mpeg.c 2002-11-02 10:40:59.000000000 +0100 @@ -158,24 +158,28 @@ } static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, - unsigned char *srca, int stride) { + unsigned char *srca, unsigned char *srcp, int stride) { switch (using_format) { case IMGFMT_YV12: - vo_draw_alpha_yv12(w, h, src, srca, stride, - image + y0 * image_width + x0, image_width); + vo_draw_alpha_yv12(w, h, src, srca, srcp, stride, + image + y0 * image_width + x0, image_width, + image + y0 * image_width/4 + x0/2 + image_width*image_height, image_width/2, + image + y0 * image_width/4 + x0/2 + image_width*image_height*5/4, image_width/2, + x0 & 0x01, y0 & 0x01 + ); break; case IMGFMT_BGR|24: case IMGFMT_RGB|24: if (config_interlace != Y4M_ILACE_BOTTOM_FIRST) - vo_draw_alpha_rgb24(w, h, src, srca, stride, + vo_draw_alpha_rgb24(w, h, src, srca, srcp, stride, rgb_buffer + (y0 * image_width + x0) * 3, image_width * 3); else { swap_fields (rgb_buffer, image_height, image_width * 3); - vo_draw_alpha_rgb24(w, h, src, srca, stride, + vo_draw_alpha_rgb24(w, h, src, srca, srcp, stride, rgb_buffer + (y0 * image_width + x0) * 3, image_width * 3); swap_fields (rgb_buffer, image_height, image_width * 3); Only in main: mpconf Only in main: Solyaris.CD1of2.srt diff -ur --exclude-from dontdiff vanilla/main/spudec.c main/spudec.c --- vanilla/main/spudec.c 2002-10-15 16:42:45.000000000 +0200 +++ main/spudec.c 2002-11-02 11:44:01.000000000 +0100 @@ -508,13 +508,13 @@ return ret; } -void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) +void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride)) { spudec_handle_t *spu = (spudec_handle_t *)this; if (spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts && spu->image) { draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height, - spu->image, spu->aimage, spu->stride); + spu->image, spu->aimage, NULL, spu->stride); /* FIXME */ spu->spu_changed = 0; } } @@ -607,7 +607,7 @@ } #endif -void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) +void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride)) { spudec_handle_t *spu = (spudec_handle_t *)me; scale_pixel *table_x; @@ -618,7 +618,7 @@ if (spu->image) { draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height, - spu->image, spu->aimage, spu->stride); + spu->image, spu->aimage, NULL, spu->stride); /* FIXME */ spu->spu_changed = 0; } } @@ -902,7 +902,7 @@ spu->scaled_start_row = dys - spu->scaled_height - 1; #endif draw_alpha(spu->scaled_start_col, spu->scaled_start_row, spu->scaled_width, spu->scaled_height, - spu->scaled_image, spu->scaled_aimage, spu->scaled_stride); + spu->scaled_image, spu->scaled_aimage, NULL, spu->scaled_stride); /* FIXME */ spu->spu_changed = 0; } } diff -ur --exclude-from dontdiff vanilla/main/spudec.h main/spudec.h --- vanilla/main/spudec.h 2002-08-15 18:52:52.000000000 +0200 +++ main/spudec.h 2002-11-02 11:43:36.000000000 +0100 @@ -3,8 +3,8 @@ void spudec_heartbeat(void *this, unsigned int pts100); void spudec_assemble(void *this, unsigned char *packet, unsigned int len, unsigned int pts100); -void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); -void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride)); +void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, unsigned char *srcp, int stride)); void spudec_update_palette(void *this, unsigned int *palette); void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height); void *spudec_new_scaled_vobsub(unsigned int *palette, unsigned int *cuspal, unsigned int custom, unsigned int frame_width, unsigned int frame_height); @@ -16,6 +16,5 @@ void spudec_set_hw_spu(void *this, vo_functions_t *hw_spu); int spudec_changed(void *this); void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int* bbox); -void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); #endif