/* WARNING: This file is generated by combine.pl from combine.inc.
Please edit one of those files rather than this one. */
/*
* Helper macros.
*/
#define MUL_UN16(a, b, t) \
#define DIV_UN16(a, b) \
#define ADD_UN16(x, y, t) \
((t) = x + y, \
#define DIV_ONE_UN16(x) \
/*
* The methods below use some tricks to be able to do two color
* components at the same time.
*/
/*
* x_rb = (x_rb * a) / 255
*/
#define UN16_rb_MUL_UN16(x, a, t) \
do \
{ \
t = ((x) & RB_MASK) * (a); \
t += RB_ONE_HALF; \
x &= RB_MASK; \
} while (0)
/*
* x_rb = min (x_rb + y_rb, 255)
*/
#define UN16_rb_ADD_UN16_rb(x, y, t) \
do \
{ \
t = ((x) + (y)); \
x = (t & RB_MASK); \
} while (0)
/*
* x_rb = (x_rb * a_rb) / 255
*/
#define UN16_rb_MUL_UN16_rb(x, a, t) \
do \
{ \
t += RB_ONE_HALF; \
x = t & RB_MASK; \
} while (0)
/*
* x_c = (x_c * a) / 255
*/
#define UN16x4_MUL_UN16(x, a) \
do \
{ \
\
r1 = (x); \
UN16_rb_MUL_UN16 (r1, a, t); \
\
UN16_rb_MUL_UN16 (r2, a, t); \
\
} while (0)
/*
* x_c = (x_c * a) / 255 + y_c
*/
#define UN16x4_MUL_UN16_ADD_UN16x4(x, a, y) \
do \
{ \
\
r1 = (x); \
UN16_rb_MUL_UN16 (r1, a, t); \
\
UN16_rb_MUL_UN16 (r2, a, t); \
\
} while (0)
/*
* x_c = (x_c * a + y_c * b) / 255
*/
#define UN16x4_MUL_UN16_ADD_UN16x4_MUL_UN16(x, a, y, b) \
do \
{ \
\
r1 = x; \
r2 = y; \
UN16_rb_MUL_UN16 (r1, a, t); \
UN16_rb_MUL_UN16 (r2, b, t); \
\
UN16_rb_MUL_UN16 (r2, a, t); \
UN16_rb_MUL_UN16 (r3, b, t); \
\
} while (0)
/*
* x_c = (x_c * a_c) / 255
*/
#define UN16x4_MUL_UN16x4(x, a) \
do \
{ \
\
r1 = x; \
r2 = a; \
\
\
} while (0)
/*
* x_c = (x_c * a_c) / 255 + y_c
*/
#define UN16x4_MUL_UN16x4_ADD_UN16x4(x, a, y) \
do \
{ \
\
r1 = x; \
r2 = a; \
\
\
} while (0)
/*
* x_c = (x_c * a_c + y_c * b) / 255
*/
#define UN16x4_MUL_UN16x4_ADD_UN16x4_MUL_UN16(x, a, y, b) \
do \
{ \
\
r1 = x; \
r2 = a; \
r2 = y; \
UN16_rb_MUL_UN16 (r2, b, t); \
\
UN16_rb_MUL_UN16 (r3, b, t); \
\
} while (0)
/*
x_c = min(x_c + y_c, 255)
*/
#define UN16x4_ADD_UN16x4(x, y) \
do \
{ \
\
\
\
} while (0)