Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
Opus
Commits
f2d5aed8
Commit
f2d5aed8
authored
17 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Allowing to choose the frame size and rate from testcelt
parent
5a4bbdeb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libcelt/match-test.sh
+2
-2
2 additions, 2 deletions
libcelt/match-test.sh
libcelt/testcelt.c
+15
-16
15 additions, 16 deletions
libcelt/testcelt.c
with
17 additions
and
18 deletions
libcelt/match-test.sh
+
2
−
2
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
...
...
This diff is collapsed.
Click to expand it.
libcelt/testcelt.c
+
15
−
16
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment