> How about splitting to two functions...
> for >= 4bpp:
> col->r = DOSHIFT(pixel & priv->red_mask, priv->red_unmap);
> col->r |= col->r >> priv->red_nbits;
> col->r |= col->r >> priv->red_nbits_times_two;
> For stuff < 4bpp, use a different but similar function.

Please don't call any function at all (call overhead does matter in such
simple functions) but inline or #define it and keep it as fast as possible.

I am using LibGGI for _very_ timing-critical stuff (realtime voxel 
rendering) and color mapping should stay as fast as possible.
Unmapping is a little less critical, but I'd still prefer to have it fast.

The fastest way would be to split the color lib into as many libs as there
are color mapping schemes. This has the additional advantage, that we can
easily add YUV modes and similar.

CU, Andy

-- 
= Andreas Beck                    |  Email :  <[EMAIL PROTECTED]>        =

Reply via email to