Applied hamming to DCT

Also made hamming now handle non-multiple-of-3 sizes by simply
truncating the excess.