/*********************************************************************/ /* dct_main perfomes a dct and idct function on an image. */ /*********************************************************************/ /***************************************************** * include files * *****************************************************/ #include #include #include "dct_main.h" /* Includes and Constants used */ #pragma DATA_SECTION (image_in,"myvar0") #pragma DATA_SECTION (image_out,"myvar1") #include "scenary.h" /* an h file containing input image as a 1D array */ /* 1D array to hold output image */ unsigned char image_out[IMAGE_SIZE]; /* 1D array to hold the current block */ short block[BLOCK_SIZE]; /*********************************************************************/ /* Q12 DCT coefficients (actual coefficient x 2^12 ) */ /* */ /*********************************************************************/ const short coe[12]={3135,2217,7568,8410,-1598,6149,-10498,4816,-3686,-12586,8035,-1223}; /*********************************************************************/ /* FUNCTIONS USED */ /*********************************************************************/ /* dct.c */ void dct(void); /* idct.c */ void idct(void); /*********************************************************************/ /* MAIN FUNCTION */ /*********************************************************************/ void main() { int row, col, x, y, i; /*************************************************** * FORWARD DCT/ INVERSE DCT * ***************************************************/ /* block by block processing */ for (row=0; row