summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2005-04-04 21:33:37 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2005-04-04 21:33:37 (GMT)
commitc0b7547e14925222153a9a1998defc692c117a2d (patch)
tree3c12cb51a44c3fe235b43b8177c60024385338d0
parent0692fd3ae8c1219b81098de4fa7a8d7a90422afe (diff)
download5kk53-c0b7547e14925222153a9a1998defc692c117a2d.zip
5kk53-c0b7547e14925222153a9a1998defc692c117a2d.tar.gz
5kk53-c0b7547e14925222153a9a1998defc692c117a2d.tar.bz2
Added some comment to main.c and some file open stuff
-rw-r--r--src/main.c59
1 files 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 <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;
}