#include #include "dct.h" #define ENCODE 0 #define DECODE 1 int main(int argc, char argv[]) { int retval; int workspace[DCTSIZE_BLOCK]; int type; char *fileIn, *fileOut; FILE *fI, *fO; fI = fopen(fileIn,"rb"); if (fI == NULL) { printf("unable to open the file",fileIn); return 0; } fO = fopen(fileOut,"wb"); if (fO == NULL) { printf("unable to open the file",fileOut); return 0; } retval = 0; type = ENCODE; switch(type) { case ENCODE: // RGB -> YUV // Convert to 8x8 // DCT fdct(workspace); // ZZ // Q // VLC (huffman) break; case DECODE: // VLD (huffman) // IQ // ZZ // IDCT //idct(workspace); // Convert 8x8 to lines // YUV -> RGB break; } return retval; }