help me with Discrete Cosine Transform 1D&2D

We want to see the formula of Discrete Cosine Transform 1D&2D in program mathematica.

i want write code dct3 by myself but have the code write did