/* The bit allocator trys to avoid single bit allocations except as a last resort. So in the case where a bitneed of 1 was passed over during the adsjustment phase 2 bits are now allocated.  */
INLINE OI_INT allocAdjustedBits(OI_UINT8 *dest, OI_INT bits, OI_INT excess)
/* The bit allocator trys to avoid single bit allocations except as a last resort. So in the case where a bitneed of 1 was passed over during the adsjustment phase 2 bits are now allocated.  */
INLINE OI_INT allocAdjustedBits(OI_UINT8 *dest, OI_INT bits, OI_INT excess)
{
    if(bits < 16)
    {
        if(bits > 1)
        {
            if(excess)
            {
                ++bits;
                --excess;
            }
        }
        else
            if((bits == 1) && (excess > 1))
            {
                bits = 2;
                excess -= 2;
            }
            else
            {
                bits  = 0;
            }
    }
    else
    {
        bits = 16;
    }
    *dest = (OI_UINT8)bits;
    return excess;
}