5. How does this work on two dimensional data ?
If the data is also a 4x4 matrix, then we apply the DCT transform to each row and each column. Doing the columns is just mutiplying the whole matrix by the DCT matrix. To do the rows, we turn them into columns by transposing the matrix.
Here are two functions that perform the forward and backward transform on two dimensional data.
And here's an example of the transform of a four by four block of ones. The result is nearly zero everywhere but in the top left.
Created by Mathematica (April 1, 2004)