From c0b7547e14925222153a9a1998defc692c117a2d Mon Sep 17 00:00:00 2001 From: Oliver Schinagl Date: Mon, 4 Apr 2005 21:33:37 +0000 Subject: Added some comment to main.c and some file open stuff --- src/main.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 7c9b4ed..7e260da 100644 --- a/src/main.c +++ b/src/main.c @@ -1,14 +1,63 @@ #include - #include "dct.h" -int main(void) { +#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; - - fdct(workspace); - + 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; } -- cgit v0.12