diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 59 |
1 files changed, 54 insertions, 5 deletions
@@ -1,14 +1,63 @@ #include <stdio.h> - #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; } |