implementations of 1d and 2d discrete cosine transforms 9043984