Simplified dithering code and added macros to choose algorithm.

Signed-off-by: retep998 <retep998@verizon.net>