Mercurial > mplayer.hg
changeset 28943:cf087cb82252
Add an alpha parameter to the YUV2RGBFUNC macro to ease the upcoming yuva2rgb patch
author | sdrik |
---|---|
date | Mon, 16 Mar 2009 20:04:32 +0000 |
parents | 39006a122466 |
children | cb18135338dd |
files | libswscale/yuv2rgb.c |
diffstat | 1 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libswscale/yuv2rgb.c Mon Mar 16 19:26:23 2009 +0000 +++ b/libswscale/yuv2rgb.c Mon Mar 16 20:04:32 2009 +0000 @@ -101,7 +101,7 @@ Y = src[2*i+1]; \ dst[6*i+3] = b[Y]; dst[6*i+4] = g[Y]; dst[6*i+5] = r[Y]; -#define YUV2RGBFUNC(func_name, dst_type) \ +#define YUV2RGBFUNC(func_name, dst_type, alpha) \ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, \ int srcSliceH, uint8_t* dst[], int dstStride[]){\ int y;\ @@ -145,7 +145,7 @@ ENDYUV2RGBLINE(dst_delta)\ ENDYUV2RGBFUNC() -YUV2RGBFUNC(yuv2rgb_c_32, uint32_t) +YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) LOADCHROMA(0); PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_2,py_2,0,1); @@ -174,7 +174,7 @@ PUTRGB(dst_1,py_1,1,0); ENDYUV2RGBFUNC() -YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) LOADCHROMA(0); PUTRGB24(dst_1,py_1,0); PUTRGB24(dst_2,py_2,0); @@ -201,7 +201,7 @@ ENDYUV2RGBFUNC() // only trivial mods from yuv2rgb_c_24_rgb -YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0) LOADCHROMA(0); PUTBGR24(dst_1,py_1,0); PUTBGR24(dst_2,py_2,0); @@ -229,7 +229,7 @@ // This is exactly the same code as yuv2rgb_c_32 except for the types of // r, g, b, dst_1, dst_2 -YUV2RGBFUNC(yuv2rgb_c_16, uint16_t) +YUV2RGBFUNC(yuv2rgb_c_16, uint16_t, 0) LOADCHROMA(0); PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_2,py_2,0,1); @@ -249,7 +249,7 @@ // This is exactly the same code as yuv2rgb_c_32 except for the types of // r, g, b, dst_1, dst_2 -YUV2RGBFUNC(yuv2rgb_c_8, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_8, uint8_t, 0) LOADCHROMA(0); PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_2,py_2,0,1); @@ -268,7 +268,7 @@ CLOSEYUV2RGBFUNC(8) // r, g, b, dst_1, dst_2 -YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0) const uint8_t *d32 = dither_8x8_32[y&7]; const uint8_t *d64 = dither_8x8_73[y&7]; #define PUTRGB8(dst,src,i,o) \ @@ -297,7 +297,7 @@ // This is exactly the same code as yuv2rgb_c_32 except for the types of // r, g, b, dst_1, dst_2 -YUV2RGBFUNC(yuv2rgb_c_4, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_4, uint8_t, 0) int acc; #define PUTRGB4(dst,src,i) \ Y = src[2*i]; \ @@ -323,7 +323,7 @@ PUTRGB4(dst_1,py_1,3); CLOSEYUV2RGBFUNC(4) -YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0) const uint8_t *d64 = dither_8x8_73[y&7]; const uint8_t *d128 = dither_8x8_220[y&7]; int acc; @@ -354,7 +354,7 @@ // This is exactly the same code as yuv2rgb_c_32 except for the types of // r, g, b, dst_1, dst_2 -YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t, 0) LOADCHROMA(0); PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_2,py_2,0,1); @@ -372,7 +372,7 @@ PUTRGB(dst_1,py_1,3,0); CLOSEYUV2RGBFUNC(8) -YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0) const uint8_t *d64 = dither_8x8_73[y&7]; const uint8_t *d128 = dither_8x8_220[y&7]; @@ -399,7 +399,7 @@ PUTRGB4DB(dst_1,py_1,3,6); CLOSEYUV2RGBFUNC(8) -YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t) +YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0) const uint8_t *d128 = dither_8x8_220[y&7]; char out_1 = 0, out_2 = 0; g= c->table_gU[128] + c->table_gV[128];