summaryrefslogtreecommitdiffstats
path: root/postproc/swscale.c
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-30 09:15:09 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-30 09:15:09 +0000
commit49a3af8585178fa4b790bedfb587a8c23ec9c99e (patch)
treed580a9eb8d4512209354a96bdd6e7ef1cea3f625 /postproc/swscale.c
parent6df2ca6ea6d6e8f9ceda72e00991a0331ccdbc5d (diff)
downloadmpv-49a3af8585178fa4b790bedfb587a8c23ec9c99e.tar.bz2
mpv-49a3af8585178fa4b790bedfb587a8c23ec9c99e.tar.xz
fixing rgb4 & bgr4 (2 pixels per byte)
adding bg4b & rg4b (1 pixel per byte) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9172 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc/swscale.c')
-rw-r--r--postproc/swscale.c22
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]];
}