Commit 0a10a984 authored by sdrik's avatar sdrik

Add an alpha parameter to the YUV2RGBFUNC macro to ease the upcoming yuva2rgb patch

git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@28978 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 0607cd34
...@@ -101,7 +101,7 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = { ...@@ -101,7 +101,7 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = {
Y = src[2*i+1]; \ Y = src[2*i+1]; \
dst[6*i+3] = b[Y]; dst[6*i+4] = g[Y]; dst[6*i+5] = r[Y]; 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, \ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, \
int srcSliceH, uint8_t* dst[], int dstStride[]){\ int srcSliceH, uint8_t* dst[], int dstStride[]){\
int y;\ int y;\
...@@ -145,7 +145,7 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic ...@@ -145,7 +145,7 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic
ENDYUV2RGBLINE(dst_delta)\ ENDYUV2RGBLINE(dst_delta)\
ENDYUV2RGBFUNC() ENDYUV2RGBFUNC()
YUV2RGBFUNC(yuv2rgb_c_32, uint32_t) YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0)
LOADCHROMA(0); LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1); PUTRGB(dst_2,py_2,0,1);
...@@ -174,7 +174,7 @@ ENDYUV2RGBLINE(8) ...@@ -174,7 +174,7 @@ ENDYUV2RGBLINE(8)
PUTRGB(dst_1,py_1,1,0); PUTRGB(dst_1,py_1,1,0);
ENDYUV2RGBFUNC() ENDYUV2RGBFUNC()
YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t) YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0)
LOADCHROMA(0); LOADCHROMA(0);
PUTRGB24(dst_1,py_1,0); PUTRGB24(dst_1,py_1,0);
PUTRGB24(dst_2,py_2,0); PUTRGB24(dst_2,py_2,0);
...@@ -201,7 +201,7 @@ ENDYUV2RGBLINE(24) ...@@ -201,7 +201,7 @@ ENDYUV2RGBLINE(24)
ENDYUV2RGBFUNC() ENDYUV2RGBFUNC()
// only trivial mods from yuv2rgb_c_24_rgb // 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); LOADCHROMA(0);
PUTBGR24(dst_1,py_1,0); PUTBGR24(dst_1,py_1,0);
PUTBGR24(dst_2,py_2,0); PUTBGR24(dst_2,py_2,0);
...@@ -229,7 +229,7 @@ ENDYUV2RGBFUNC() ...@@ -229,7 +229,7 @@ ENDYUV2RGBFUNC()
// This is exactly the same code as yuv2rgb_c_32 except for the types of // This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2 // r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_16, uint16_t) YUV2RGBFUNC(yuv2rgb_c_16, uint16_t, 0)
LOADCHROMA(0); LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1); PUTRGB(dst_2,py_2,0,1);
...@@ -249,7 +249,7 @@ CLOSEYUV2RGBFUNC(8) ...@@ -249,7 +249,7 @@ CLOSEYUV2RGBFUNC(8)
// This is exactly the same code as yuv2rgb_c_32 except for the types of // This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2 // r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_8, uint8_t) YUV2RGBFUNC(yuv2rgb_c_8, uint8_t, 0)
LOADCHROMA(0); LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1); PUTRGB(dst_2,py_2,0,1);
...@@ -268,7 +268,7 @@ YUV2RGBFUNC(yuv2rgb_c_8, uint8_t) ...@@ -268,7 +268,7 @@ YUV2RGBFUNC(yuv2rgb_c_8, uint8_t)
CLOSEYUV2RGBFUNC(8) CLOSEYUV2RGBFUNC(8)
// r, g, b, dst_1, dst_2 // 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 *d32 = dither_8x8_32[y&7];
const uint8_t *d64 = dither_8x8_73[y&7]; const uint8_t *d64 = dither_8x8_73[y&7];
#define PUTRGB8(dst,src,i,o) \ #define PUTRGB8(dst,src,i,o) \
...@@ -297,7 +297,7 @@ CLOSEYUV2RGBFUNC(8) ...@@ -297,7 +297,7 @@ CLOSEYUV2RGBFUNC(8)
// This is exactly the same code as yuv2rgb_c_32 except for the types of // This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2 // r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_4, uint8_t) YUV2RGBFUNC(yuv2rgb_c_4, uint8_t, 0)
int acc; int acc;
#define PUTRGB4(dst,src,i) \ #define PUTRGB4(dst,src,i) \
Y = src[2*i]; \ Y = src[2*i]; \
...@@ -323,7 +323,7 @@ YUV2RGBFUNC(yuv2rgb_c_4, uint8_t) ...@@ -323,7 +323,7 @@ YUV2RGBFUNC(yuv2rgb_c_4, uint8_t)
PUTRGB4(dst_1,py_1,3); PUTRGB4(dst_1,py_1,3);
CLOSEYUV2RGBFUNC(4) 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 *d64 = dither_8x8_73[y&7];
const uint8_t *d128 = dither_8x8_220[y&7]; const uint8_t *d128 = dither_8x8_220[y&7];
int acc; int acc;
...@@ -354,7 +354,7 @@ CLOSEYUV2RGBFUNC(4) ...@@ -354,7 +354,7 @@ CLOSEYUV2RGBFUNC(4)
// This is exactly the same code as yuv2rgb_c_32 except for the types of // This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2 // r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t) YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t, 0)
LOADCHROMA(0); LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0); PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1); PUTRGB(dst_2,py_2,0,1);
...@@ -372,7 +372,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t) ...@@ -372,7 +372,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t)
PUTRGB(dst_1,py_1,3,0); PUTRGB(dst_1,py_1,3,0);
CLOSEYUV2RGBFUNC(8) 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 *d64 = dither_8x8_73[y&7];
const uint8_t *d128 = dither_8x8_220[y&7]; const uint8_t *d128 = dither_8x8_220[y&7];
...@@ -399,7 +399,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t) ...@@ -399,7 +399,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t)
PUTRGB4DB(dst_1,py_1,3,6); PUTRGB4DB(dst_1,py_1,3,6);
CLOSEYUV2RGBFUNC(8) 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]; const uint8_t *d128 = dither_8x8_220[y&7];
char out_1 = 0, out_2 = 0; char out_1 = 0, out_2 = 0;
g= c->table_gU[128] + c->table_gV[128]; g= c->table_gU[128] + c->table_gV[128];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment