/******* * dct_matrix.c * * Looking at the matrix for a Discrtete Cosine Transform * * *******/ #include #include // Number of points. JPEG's typically used 8x8 2-dim DCT's. #define N 8 // ------------------------------------------------------ // Define the 64 terms in the DCT and DCT_inverse matrix. void defineDCT(double dct[N][N]){ double pi = 4.0*atan(1.0); // typical way to get pi, using tan(pi/4)=1 double piOver2N = pi/(2*N); double invSqrt2 = 1.0/sqrt(2.0); double sqrt2overN = sqrt(2.0/N); double C; int u,x; for (u=0; u