Hi,
Denis Oliver Kropp <[EMAIL PROTECTED]> writes:
> Mask r with 0xF8 and g with 0xFC in the complex double line[tm].
this hint made me find the problem, thanks. No need for a 5bit
alpha multiplicator or masking the green bits, but the red bits
must indeed be masked so that the low bits of the red color don't
add to the blue bits. Unfortunately masking r costs some performance
but it's still about 10% faster over here. Andi, could you try if
it works on PowerPC and how the performance behaves there?
Here's the code that seems to do the trick:
#define SET_ALPHA_PIXEL_RGB16(d,r,g,b,a) \
if (a) {\
if (a == 0xFF) {\
*(d) = (((r)&0xf8) << 8) | (((g)&0xfc) << 3) | (((b)&0xf8) >> 3);\
}\
else {\
__u32 pixel;\
__u8 s=((a)>>2)+1;\
__u8 s1=(64-s);\
\
pixel = *(d);\
pixel = (((((pixel & 0x0000f81f) * s1) + (((((r)&0xf8)<<8) | ((b)>>3))
* s)) & 0x003e07c0) + \
((((pixel & 0x000007e0) * s1) + (((g)<<3) * s)) &
0x0001f800)) >> 6; \
*(d) = pixel;\
}\
}
Salut, Sven
--
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with
"unsubscribe directfb-dev" as subject.