Redundant code cleanup. Optimized dither generation. Minor optimization in bit allocation. Comments. Originally committed as revision 9669 to svn://svn.ffmpeg.org/ffmpeg/trunk