Implementation of Atkinson dithering (from freescale).