#define MASK
#define ONE_HALF
-#define G_SHIFT
-#define B_SHIFT
#define A_SHIFT
-#define G_MASK
-#define B_MASK
+#define R_SHIFT
+#define G_SHIFT
#define A_MASK
+#define R_MASK
+#define G_MASK
#define RB_MASK
#define AG_MASK
\
t = (x & G_MASK) * a + (y & G_MASK) * b; \
t += (t >> G_SHIFT) + (ONE_HALF << G_SHIFT); \
- t >>= B_SHIFT; \
+ t >>= R_SHIFT; \
\
- t |= r << B_SHIFT; \
+ t |= r << R_SHIFT; \
t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
t &= RB_MASK; \
t <<= G_SHIFT; \
\
- r = ((x >> B_SHIFT) & MASK) * a + \
- ((y >> B_SHIFT) & MASK) * b + ONE_HALF; \
+ r = ((x >> R_SHIFT) & MASK) * a + \
+ ((y >> R_SHIFT) & MASK) * b + ONE_HALF; \
r += (r >> G_SHIFT); \
r >>= G_SHIFT; \
\
x = (x & MASK) * a + (y & MASK) * b + ONE_HALF; \
x += (x >> G_SHIFT); \
x >>= G_SHIFT; \
- x |= r << B_SHIFT; \
+ x |= r << R_SHIFT; \
x |= RB_MASK_PLUS_ONE - ((x >> G_SHIFT) & RB_MASK); \
x &= RB_MASK; \
x |= t; \
#define FbByteMulC(x, a) do { \
comp4_t t; \
comp4_t r = (x & MASK) * (a & MASK); \
- r |= (x & B_MASK) * ((a >> B_SHIFT) & MASK); \
+ r |= (x & R_MASK) * ((a >> R_SHIFT) & MASK); \
r += RB_ONE_HALF; \
r = (r + ((r >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
r &= RB_MASK; \
\
x >>= G_SHIFT; \
t = (x & MASK) * ((a >> G_SHIFT) & MASK); \
- t |= (x & B_MASK) * (a >> A_SHIFT); \
+ t |= (x & R_MASK) * (a >> A_SHIFT); \
t += RB_ONE_HALF; \
t = t + ((t >> G_SHIFT) & RB_MASK); \
x = r | (t & AG_MASK); \
#define FbByteMulAddC(x, a, y) do { \
comp4_t t; \
comp4_t r = (x & MASK) * (a & MASK); \
- r |= (x & B_MASK) * ((a >> B_SHIFT) & MASK); \
+ r |= (x & R_MASK) * ((a >> R_SHIFT) & MASK); \
r += RB_ONE_HALF; \
r = (r + ((r >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
r &= RB_MASK; \
\
x >>= G_SHIFT; \
t = (x & MASK) * ((a >> G_SHIFT) & MASK); \
- t |= (x & B_MASK) * (a >> A_SHIFT); \
+ t |= (x & R_MASK) * (a >> A_SHIFT); \
t += RB_ONE_HALF; \
t = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
t &= RB_MASK; \
\
t = (x & G_MASK) * ((a >> G_SHIFT) & MASK) + (y & G_MASK) * b; \
t += (t >> G_SHIFT) + (ONE_HALF << G_SHIFT); \
- t >>= B_SHIFT; \
+ t >>= R_SHIFT; \
\
- t |= r << B_SHIFT; \
+ t |= r << R_SHIFT; \
t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
t &= RB_MASK; \
t <<= G_SHIFT; \
\
- r = ((x >> B_SHIFT) & MASK) * ((a >> B_SHIFT) & MASK) + \
- ((y >> B_SHIFT) & MASK) * b + ONE_HALF; \
+ r = ((x >> R_SHIFT) & MASK) * ((a >> R_SHIFT) & MASK) + \
+ ((y >> R_SHIFT) & MASK) * b + ONE_HALF; \
r += (r >> G_SHIFT); \
r >>= G_SHIFT; \
\
x = (x & MASK) * (a & MASK) + (y & MASK) * b + ONE_HALF; \
x += (x >> G_SHIFT); \
x >>= G_SHIFT; \
- x |= r << B_SHIFT; \
+ x |= r << R_SHIFT; \
x |= RB_MASK_PLUS_ONE - ((x >> G_SHIFT) & RB_MASK); \
x &= RB_MASK; \
x |= t; \
}
m = FbGen (s,d,0,Fa,Fb,t, u, v);
n = FbGen (s,d,G_SHIFT,Fa,Fb,t, u, v);
- o = FbGen (s,d,B_SHIFT,Fa,Fb,t, u, v);
+ o = FbGen (s,d,R_SHIFT,Fa,Fb,t, u, v);
p = FbGen (s,d,A_SHIFT,Fa,Fb,t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
m = FbGen (s,d,0,Fa,Fb,t, u, v);
n = FbGen (s,d,G_SHIFT,Fa,Fb,t, u, v);
- o = FbGen (s,d,B_SHIFT,Fa,Fb,t, u, v);
+ o = FbGen (s,d,R_SHIFT,Fa,Fb,t, u, v);
p = FbGen (s,d,A_SHIFT,Fa,Fb,t, u, v);
s = m|n|o|p;
*(dest + i) = s;
{
x = x >> A_SHIFT;
x |= x << G_SHIFT;
- x |= x << B_SHIFT;
+ x |= x << R_SHIFT;
*(mask) = x;
return;
}
{
x = x >> A_SHIFT;
x |= x << G_SHIFT;
- x |= x << B_SHIFT;
+ x |= x << R_SHIFT;
*(mask) = x;
return;
}
fbCombineMaskC (&s, &m);
sa = (m >> A_SHIFT);
- sr = (m >> B_SHIFT) & MASK;
+ sr = (m >> R_SHIFT) & MASK;
sg = (m >> G_SHIFT) & MASK;
sb = m & MASK;
da = ~d >> A_SHIFT;
n = FbGen (s, d, G_SHIFT, (da << G_SHIFT) / sg, MASK, t, u, v);
if (sr <= da)
- o = Add(s,d,B_SHIFT,t);
+ o = Add(s,d,R_SHIFT,t);
else
- o = FbGen (s, d, B_SHIFT, (da << G_SHIFT) / sr, MASK, t, u, v);
+ o = FbGen (s, d, R_SHIFT, (da << G_SHIFT) / sr, MASK, t, u, v);
if (sa <= da)
p = Add(s,d,A_SHIFT,t);
case CombineAOut:
m = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> 0), da);
n = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
- o = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ o = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> R_SHIFT), da) << R_SHIFT;
p = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineAIn:
m = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> 0), da);
n = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
- o = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ o = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> R_SHIFT), da) << R_SHIFT;
p = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineBOut:
m = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> 0));
n = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
- o = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ o = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> R_SHIFT)) << R_SHIFT;
p = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineBIn:
m = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> 0));
n = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
- o = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ o = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> R_SHIFT)) << R_SHIFT;
p = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
}
m = FbGen (s,d,0,GetComp(Fa,0),GetComp(Fb,0),t, u, v);
n = FbGen (s,d,G_SHIFT,GetComp(Fa,G_SHIFT),GetComp(Fb,G_SHIFT),t, u, v);
- o = FbGen (s,d,B_SHIFT,GetComp(Fa,B_SHIFT),GetComp(Fb,B_SHIFT),t, u, v);
+ o = FbGen (s,d,R_SHIFT,GetComp(Fa,R_SHIFT),GetComp(Fb,R_SHIFT),t, u, v);
p = FbGen (s,d,A_SHIFT,GetComp(Fa,A_SHIFT),GetComp(Fb,A_SHIFT),t, u, v);
s = m|n|o|p;
*(dest + i) = s;
case CombineAOut:
m = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> 0), da);
n = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
- o = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ o = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> R_SHIFT), da) << R_SHIFT;
p = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineAIn:
m = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> 0), da);
n = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
- o = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ o = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> R_SHIFT), da) << R_SHIFT;
p = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineBOut:
m = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> 0));
n = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
- o = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ o = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> R_SHIFT)) << R_SHIFT;
p = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineBIn:
m = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> 0));
n = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
- o = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ o = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> R_SHIFT)) << R_SHIFT;
p = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
}
m = FbGen (s,d,0,GetComp(Fa,0),GetComp(Fb,0),t, u, v);
n = FbGen (s,d,G_SHIFT,GetComp(Fa,G_SHIFT),GetComp(Fb,G_SHIFT),t, u, v);
- o = FbGen (s,d,B_SHIFT,GetComp(Fa,B_SHIFT),GetComp(Fb,B_SHIFT),t, u, v);
+ o = FbGen (s,d,R_SHIFT,GetComp(Fa,R_SHIFT),GetComp(Fb,R_SHIFT),t, u, v);
p = FbGen (s,d,A_SHIFT,GetComp(Fa,A_SHIFT),GetComp(Fb,A_SHIFT),t, u, v);
s = m|n|o|p;
*(dest + i) = s;