Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
f2d5aed8
Commit
f2d5aed8
authored
Feb 19, 2008
by
Jean-Marc Valin
Browse files
Allowing to choose the frame size and rate from testcelt
parent
5a4bbdeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
libcelt/match-test.sh
View file @
f2d5aed8
...
...
@@ -9,7 +9,7 @@ outfile=/dev/null
if
[
-f
mono_test_file.sw
]
;
then
echo
-n
"mono test... "
./testcelt
-mono
32 mono_test_file.sw
$outfile
./testcelt
44100 1 256 128
32 mono_test_file.sw
$outfile
if
[
$?
!=
0
]
;
then
exit
1
fi
...
...
@@ -19,7 +19,7 @@ fi
if
[
-f
stereo_test_file.sw
]
;
then
echo
-n
"stereo test... "
./testcelt
-stereo
92 stereo_test_file.sw
$outfile
./testcelt
44100 2 256 128
92 stereo_test_file.sw
$outfile
if
[
$?
!=
0
]
;
then
exit
1
fi
...
...
libcelt/testcelt.c
View file @
f2d5aed8
...
...
@@ -48,48 +48,47 @@ int main(int argc, char *argv[])
celt_int32_t
frame_size
,
channels
;
int
bytes_per_packet
;
unsigned
char
data
[
1024
];
int
rate
,
overlap
;
double
rmsd
=
0
;
int
count
=
0
;
if
(
argc
!=
5
)
if
(
argc
!=
8
)
{
fprintf
(
stderr
,
"Usage: testcelt -<mode> <bytes per packet> <input> <output>
\n
"
);
return
1
;
}
if
(
strcmp
(
argv
[
1
],
"-mono"
)
==
0
)
mode
=
celt_mono
;
else
if
(
strcmp
(
argv
[
1
],
"-stereo"
)
==
0
)
mode
=
celt_stereo
;
else
{
fprintf
(
stderr
,
"mode must be -mono or -stereo
\n
"
);
fprintf
(
stderr
,
"Usage: testcelt <rate> <channels> <frame size> <overlap> <bytes per packet> <input> <output>
\n
"
);
return
1
;
}
rate
=
atoi
(
argv
[
1
]);
channels
=
atoi
(
argv
[
2
]);
frame_size
=
atoi
(
argv
[
3
]);
overlap
=
atoi
(
argv
[
4
]);
mode
=
celt_mode_create
(
rate
,
channels
,
frame_size
,
overlap
,
NULL
);
if
(
mode
==
NULL
)
{
fprintf
(
stderr
,
"failed to create a mode
\n
"
);
return
1
;
}
bytes_per_packet
=
atoi
(
argv
[
2
]);
bytes_per_packet
=
atoi
(
argv
[
5
]);
if
(
bytes_per_packet
<
0
||
bytes_per_packet
>
120
)
{
fprintf
(
stderr
,
"bytes per packet must be between 10 and 120
\n
"
);
return
1
;
}
inFile
=
argv
[
3
];
inFile
=
argv
[
6
];
fin
=
fopen
(
inFile
,
"rb"
);
if
(
!
fin
)
{
fprintf
(
stderr
,
"Could not open input file %s
\n
"
,
argv
[
3
]);
fprintf
(
stderr
,
"Could not open input file %s
\n
"
,
argv
[
6
]);
return
1
;
}
outFile
=
argv
[
4
];
outFile
=
argv
[
7
];
fout
=
fopen
(
outFile
,
"wb+"
);
if
(
!
fout
)
{
fprintf
(
stderr
,
"Could not open output file %s
\n
"
,
argv
[
4
]);
fprintf
(
stderr
,
"Could not open output file %s
\n
"
,
argv
[
7
]);
return
1
;
}
...
...
Write
Preview
Supports
Markdown
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