-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDPCM_decoding.c
More file actions
39 lines (29 loc) · 794 Bytes
/
DPCM_decoding.c
File metadata and controls
39 lines (29 loc) · 794 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
34
35
36
37
38
39
#include "DPCM_decoding_function.h"
/**
* @brief { validates arguments }
*
* @param[in] argc The argc
*
* @return { status }
*/
int validate_args(int argc) {
if (argc != 2) {
printf("Usage: ./dpcm_decoding [input encoded pgm image filename]\nError on argument validation. Exiting...\n");
return 1;
}
return 0;
}
int main(int argc, char **argv) {
int status = validate_args(argc);
if (status == 1) {
exit(0);
}
clock_t start, end;
double cpu_time_used;
start = clock();
char *in_encoded_filename = argv[1];
decode_using_dpcm(in_encoded_filename);
end = clock();
cpu_time_used = ((double) (end - start) / CLOCKS_PER_SEC);
printf("Decoding Complete!\nElapsed time: %lf\n", cpu_time_used);
}