summaryrefslogtreecommitdiffstats
path: root/src/main.c
blob: 7e260dab041cac84592fdf922abc71182d7af90a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <stdio.h>
#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;
}