diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-01-30 09:15:09 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-01-30 09:15:09 +0000 |
commit | f17457ac4911001ac5f1c1cdc7f1d8383fd2562e (patch) | |
tree | 27d0ab688ba6c6017e76de267e5b551b20702299 /postproc/swscale.c | |
parent | 782c5984f130539b825ada941b600eef09552e05 (diff) | |
download | ffmpeg-f17457ac4911001ac5f1c1cdc7f1d8383fd2562e.tar.gz |
fixing rgb4 & bgr4 (2 pixels per byte)
adding bg4b & rg4b (1 pixel per byte)
Originally committed as revision 9172 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc/swscale.c')
-rw-r--r-- | postproc/swscale.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c index 9ee5b6d700..2a6a53fb61 100644 --- a/postproc/swscale.c +++ b/postproc/swscale.c @@ -587,6 +587,17 @@ static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilt const uint8_t * const d64= dither_8x8_73 [y&7];\ const uint8_t * const d128=dither_8x8_220[y&7];\ func(uint8_t)\ + ((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\ + + ((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4);\ + }\ + }\ + break;\ + case IMGFMT_RG4B:\ + case IMGFMT_BG4B:\ + {\ + const uint8_t * const d64= dither_8x8_73 [y&7];\ + const uint8_t * const d128=dither_8x8_220[y&7];\ + func(uint8_t)\ ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\ ((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]];\ }\ @@ -751,6 +762,17 @@ static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **l const uint8_t * const d64= dither_8x8_73 [y&7]; const uint8_t * const d128=dither_8x8_220[y&7]; YSCALE_YUV_2_RGBX_C(uint8_t) + ((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]; + +((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4); + } + } + break; + case IMGFMT_RG4B: + case IMGFMT_BG4B: + { + const uint8_t * const d64= dither_8x8_73 [y&7]; + const uint8_t * const d128=dither_8x8_220[y&7]; + YSCALE_YUV_2_RGBX_C(uint8_t) ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]; ((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]]; } |