diff options
author | nplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-05-31 15:13:35 +0000 |
---|---|---|
committer | nplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-05-31 15:13:35 +0000 |
commit | d2ad2147cc21cdc03587f51ca68eed73c5e10c88 (patch) | |
tree | cd7e67e8cffe470c8e10ddb6d2c78eda31ef9ba5 /libvo/osd_template.c | |
parent | 4e8aa8f506f2a377c828c826585b389ea8760c49 (diff) | |
download | mpv-d2ad2147cc21cdc03587f51ca68eed73c5e10c88.tar.bz2 mpv-d2ad2147cc21cdc03587f51ca68eed73c5e10c88.tar.xz |
draw alpha for uyvy
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12517 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/osd_template.c')
-rw-r--r-- | libvo/osd_template.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libvo/osd_template.c b/libvo/osd_template.c index a4b2a59693..5c8c009ec7 100644 --- a/libvo/osd_template.c +++ b/libvo/osd_template.c @@ -160,6 +160,30 @@ static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, u return; } +static inline void RENAME(vo_draw_alpha_uyvy)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ + int y; +#if defined(FAST_OSD) + w=w>>1; +#endif + for(y=0;y<h;y++){ + register int x; + for(x=0;x<w;x++){ +#ifdef FAST_OSD + if(srca[2*x+0]) dstbase[4*x+2]=src[2*x+0]; + if(srca[2*x+1]) dstbase[4*x+0]=src[2*x+1]; +#else + if(srca[x]) { + dstbase[2*x+1]=((dstbase[2*x+1]*srca[x])>>8)+src[x]; + dstbase[2*x]=((((signed)dstbase[2*x]-128)*srca[x])>>8)+128; + } +#endif + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } +} + 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){ int y; for(y=0;y<h;y++){ |