diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2008-09-18 00:24:32 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2008-09-18 00:24:32 +0000 |
commit | 3a5ba0c33f8a590cff882630e813ac1c9e81e8c7 (patch) | |
tree | deda6ee11af955fcd64d6008227f4b74ff5205c1 /libswscale | |
parent | e48a79c91a19b430f52ca30fb098cadebde54105 (diff) | |
download | ffmpeg-3a5ba0c33f8a590cff882630e813ac1c9e81e8c7.tar.gz |
Split mono2Y in monowhite and monoblack
Originally committed as revision 27635 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale_template.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 87ef2d94cc..fa657b383c 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2152,11 +2152,21 @@ static inline void RENAME(palToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, } } -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 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, 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(monoblack2Y)(formatConvBuffer, src, srcW); + src= formatConvBuffer; + } + else if (srcFormat==PIX_FMT_MONOWHITE) { - RENAME(mono2Y)(formatConvBuffer, src, srcW, srcFormat); + RENAME(monowhite2Y)(formatConvBuffer, src, srcW); src= formatConvBuffer; } |