-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (30 loc) · 738 Bytes
/
main.cpp
File metadata and controls
33 lines (30 loc) · 738 Bytes
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
#include <iostream>
#include <stdlib.h>
#include "encode.h"
int main(int argc, char* argv[])
{
if (argc != 3) {
fprintf(stderr, "argument error\n");
exit(1);
}
Jpegencoder pic(argv[1], argv[2]);
pic.inputPpm();
std::cout << "inputPpm..." << std::endl;
pic.makeHeader();
std::cout << "makeHeader..." << std::endl;
pic.convertYCbCr();
std::cout << "convertYCbCr..." << std::endl;
//pic.printPic();
pic.DCTconvert();
std::cout << "DCTconvert..." << std::endl;
pic.freeYCbCr();
pic.quantization();
std::cout << "quantization..." << std::endl;
//pic.printQuant();
pic.huffman();
std::cout << "huffman..." << std::endl;
pic.freeDCT();
pic.endHeader();
std::cout << "complete!" << std::endl;
return 0;
}