Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathis Rosenhauer
libaec
Commits
18458bd8
Commit
18458bd8
authored
Aug 15, 2012
by
Mathis Rosenhauer
Browse files
More options for encode/decode to aid in testing
parent
a80b2f34
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Makefile
View file @
18458bd8
...
...
@@ -39,11 +39,11 @@ clean:
*
.gcno
*
.gcda
*
.gcov gmon.out
check
:
encode decode test_szcomp
./encode
-c
b1
../data/example_data
>
../data/test.aee
./decode
-b1
../data/test.aee
./encode
-c
-b1
-B8
-S128
../data/example_data
>
../data/test.aee
./decode
-b1
-B8
-S128
../data/test.aee
diff ../data/test ../data/example_data
./encode
-cb1024
../data/example_data
>
../data/test.aee
./decode
-b1024
../data/test.aee
./encode
-c
-
b1024
-B8
-S128
../data/example_data
>
../data/test.aee
./decode
-b1024
-B8
-S128
../data/test.aee
diff ../data/test ../data/example_data
./test_szcomp 65536 ../data/example_data_16
...
...
src/decode.c
View file @
18458bd8
...
...
@@ -20,14 +20,24 @@ int main(int argc, char *argv[])
int
cflag
=
0
;
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
;
while
((
c
=
getopt
(
argc
,
argv
,
"cb:"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"cb:
B:S:
"
))
!=
-
1
)
switch
(
c
)
{
case
'b'
:
chunk
=
2
*
atoi
(
optarg
);
break
;
case
'B'
:
strm
.
bit_per_sample
=
atoi
(
optarg
);
break
;
case
'S'
:
strm
.
segment_size
=
atoi
(
optarg
);
break
;
case
'c'
:
cflag
=
1
;
break
;
...
...
@@ -83,11 +93,6 @@ int main(int argc, char *argv[])
if
((
infp
=
fopen
(
infn
,
"r"
))
==
NULL
)
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
)
return
1
;
...
...
src/encode.c
View file @
18458bd8
...
...
@@ -20,14 +20,24 @@ int main(int argc, char *argv[])
int
cflag
=
0
;
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
;
while
((
c
=
getopt
(
argc
,
argv
,
"cb:"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"cb:
B:S:
"
))
!=
-
1
)
switch
(
c
)
{
case
'b'
:
chunk
=
2
*
atoi
(
optarg
);
break
;
case
'B'
:
strm
.
bit_per_sample
=
atoi
(
optarg
);
break
;
case
'S'
:
strm
.
segment_size
=
atoi
(
optarg
);
break
;
case
'c'
:
cflag
=
1
;
break
;
...
...
@@ -62,11 +72,6 @@ int main(int argc, char *argv[])
if
(
in
==
NULL
||
out
==
NULL
)
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
)
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment