Commit 18458bd8 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

More options for encode/decode to aid in testing

parent a80b2f34
...@@ -39,11 +39,11 @@ clean: ...@@ -39,11 +39,11 @@ clean:
*.gcno *.gcda *.gcov gmon.out *.gcno *.gcda *.gcov gmon.out
check: encode decode test_szcomp check: encode decode test_szcomp
./encode -cb1 ../data/example_data > ../data/test.aee ./encode -c -b1 -B8 -S128 ../data/example_data > ../data/test.aee
./decode -b1 ../data/test.aee ./decode -b1 -B8 -S128 ../data/test.aee
diff ../data/test ../data/example_data diff ../data/test ../data/example_data
./encode -cb1024 ../data/example_data > ../data/test.aee ./encode -c -b1024 -B8 -S128 ../data/example_data > ../data/test.aee
./decode -b1024 ../data/test.aee ./decode -b1024 -B8 -S128 ../data/test.aee
diff ../data/test ../data/example_data diff ../data/test ../data/example_data
./test_szcomp 65536 ../data/example_data_16 ./test_szcomp 65536 ../data/example_data_16
......
...@@ -20,14 +20,24 @@ int main(int argc, char *argv[]) ...@@ -20,14 +20,24 @@ int main(int argc, char *argv[])
int cflag = 0; int cflag = 0;
chunk = CHUNK; chunk = CHUNK;
strm.bit_per_sample = 8;
strm.block_size = 8;
strm.segment_size = 2;
strm.flags = AE_DATA_MSB | AE_DATA_PREPROCESS;
opterr = 0; opterr = 0;
while ((c = getopt (argc, argv, "cb:")) != -1) while ((c = getopt (argc, argv, "cb:B:S:")) != -1)
switch (c) switch (c)
{ {
case 'b': case 'b':
chunk = 2 * atoi(optarg); chunk = 2 * atoi(optarg);
break; break;
case 'B':
strm.bit_per_sample = atoi(optarg);
break;
case 'S':
strm.segment_size = atoi(optarg);
break;
case 'c': case 'c':
cflag = 1; cflag = 1;
break; break;
...@@ -83,11 +93,6 @@ int main(int argc, char *argv[]) ...@@ -83,11 +93,6 @@ int main(int argc, char *argv[])
if ((infp = fopen(infn, "r")) == NULL) if ((infp = fopen(infn, "r")) == NULL)
exit(-1); exit(-1);
strm.bit_per_sample = 16;
strm.block_size = 8;
strm.segment_size = 128;
strm.flags = AE_DATA_MSB | AE_DATA_PREPROCESS;
if (ae_decode_init(&strm) != AE_OK) if (ae_decode_init(&strm) != AE_OK)
return 1; return 1;
......
...@@ -20,14 +20,24 @@ int main(int argc, char *argv[]) ...@@ -20,14 +20,24 @@ int main(int argc, char *argv[])
int cflag = 0; int cflag = 0;
chunk = CHUNK; chunk = CHUNK;
strm.bit_per_sample = 8;
strm.block_size = 8;
strm.segment_size = 2;
strm.flags = AE_DATA_MSB | AE_DATA_PREPROCESS;
opterr = 0; opterr = 0;
while ((c = getopt (argc, argv, "cb:")) != -1) while ((c = getopt (argc, argv, "cb:B:S:")) != -1)
switch (c) switch (c)
{ {
case 'b': case 'b':
chunk = 2 * atoi(optarg); chunk = 2 * atoi(optarg);
break; break;
case 'B':
strm.bit_per_sample = atoi(optarg);
break;
case 'S':
strm.segment_size = atoi(optarg);
break;
case 'c': case 'c':
cflag = 1; cflag = 1;
break; break;
...@@ -62,11 +72,6 @@ int main(int argc, char *argv[]) ...@@ -62,11 +72,6 @@ int main(int argc, char *argv[])
if (in == NULL || out == NULL) if (in == NULL || out == NULL)
exit(-1); exit(-1);
strm.bit_per_sample = 16;
strm.block_size = 8;
strm.segment_size = 128;
strm.flags = AE_DATA_MSB | AE_DATA_PREPROCESS;
if (ae_encode_init(&strm) != AE_OK) if (ae_encode_init(&strm) != AE_OK)
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment