Mercurial > mplayer.hg
changeset 27603:a4ec392de2e7
Split mono2Y in monowhite and monoblack
author | lu_zero |
---|---|
date | Thu, 18 Sep 2008 00:24:32 +0000 |
parents | 2de32a90d2dd |
children | 4b7f86c4a8b9 |
files | libswscale/swscale_template.c |
diffstat | 1 files changed, 19 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libswscale/swscale_template.c Thu Sep 18 00:22:53 2008 +0000 +++ b/libswscale/swscale_template.c Thu Sep 18 00:24:32 2008 +0000 @@ -2152,11 +2152,21 @@ } } -static inline void RENAME(mono2Y)(uint8_t *dst, uint8_t *src, long width, int format) +static inline void RENAME(monowhite2Y)(uint8_t *dst, uint8_t *src, long width) { int i, j; for (i=0; i<width/8; i++){ - int d= format == PIX_FMT_MONOBLACK ? src[i] : ~src[i]; + int d= ~src[i]; + for(j=0; j<8; j++) + dst[8*i+j]= ((d>>(7-j))&1)*255; + } +} + +static inline void RENAME(monoblack2Y)(uint8_t *dst, uint8_t *src, long width) +{ + int i, j; + for (i=0; i<width/8; i++){ + int d= src[i]; for(j=0; j<8; j++) dst[8*i+j]= ((d>>(7-j))&1)*255; } @@ -2416,9 +2426,14 @@ RENAME(palToY)(formatConvBuffer, src, srcW, pal); src= formatConvBuffer; } - else if (srcFormat==PIX_FMT_MONOBLACK ||srcFormat==PIX_FMT_MONOWHITE) + else if (srcFormat==PIX_FMT_MONOBLACK) { - RENAME(mono2Y)(formatConvBuffer, src, srcW, srcFormat); + RENAME(monoblack2Y)(formatConvBuffer, src, srcW); + src= formatConvBuffer; + } + else if (srcFormat==PIX_FMT_MONOWHITE) + { + RENAME(monowhite2Y)(formatConvBuffer, src, srcW); src= formatConvBuffer; }