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
67008d23
Commit
67008d23
authored
14 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Support for setting the audio bandwidth
parent
ae18090b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
celt
+1
-1
1 addition, 1 deletion
celt
src/hybrid.h
+4
-3
4 additions, 3 deletions
src/hybrid.h
src/hybrid_decoder.c
+8
-1
8 additions, 1 deletion
src/hybrid_decoder.c
src/hybrid_encoder.c
+14
-1
14 additions, 1 deletion
src/hybrid_encoder.c
with
27 additions
and
6 deletions
celt
@
6bf3b0a7
Subproject commit
b1e017f58d2bb319eb7bc3305048185a9c8fe9d9
Subproject commit
6bf3b0a7a13e469d4a2e161143a240220f563150
This diff is collapsed.
Click to expand it.
src/hybrid.h
+
4
−
3
View file @
67008d23
...
...
@@ -52,9 +52,10 @@ extern "C" {
#define MODE_CELT_ONLY 1002
#define BANDWIDTH_NARROWBAND 1100
#define BANDWIDTH_WIDEBAND 1101
#define BANDWIDTH_SUPERWIDEBAND 1102
#define BANDWIDTH_FULLBAND 1103
#define BANDWIDTH_MEDIUMBAND 1101
#define BANDWIDTH_WIDEBAND 1102
#define BANDWIDTH_SUPERWIDEBAND 1103
#define BANDWIDTH_FULLBAND 1104
...
...
This diff is collapsed.
Click to expand it.
src/hybrid_decoder.c
+
8
−
1
View file @
67008d23
...
...
@@ -88,6 +88,9 @@ int hybrid_decode(HybridDecoder *st, const unsigned char *data,
if
(
st
->
mode
!=
MODE_CELT_ONLY
)
{
DecControl
.
API_sampleRate
=
st
->
Fs
;
/* We Should eventually have to set the bandwidth here */
/* Call SILK encoder for the low band */
silk_ret
=
SKP_Silk_SDK_Decode
(
st
->
silk_dec
,
&
DecControl
,
0
,
&
dec
,
len
,
pcm
,
&
silk_frame_size
);
if
(
silk_ret
)
...
...
@@ -108,8 +111,12 @@ int hybrid_decode(HybridDecoder *st, const unsigned char *data,
celt_decoder_ctl
(
st
->
celt_dec
,
CELT_SET_START_BAND
(
0
));
}
if
(
st
->
mode
!=
MODE_SILK_ONLY
)
if
(
st
->
mode
!=
MODE_SILK_ONLY
&&
st
->
bandwidth
>
BANDWIDTH_WIDEBAND
)
{
if
(
st
->
bandwidth
==
BANDWIDTH_SUPERWIDEBAND
)
celt_decoder_ctl
(
st
->
celt_dec
,
CELT_SET_END_BAND
(
20
));
else
celt_decoder_ctl
(
st
->
celt_dec
,
CELT_SET_END_BAND
(
21
));
/* Encode high band with CELT */
celt_ret
=
celt_decode_with_ec
(
st
->
celt_dec
,
data
,
len
,
pcm_celt
,
frame_size
,
&
dec
);
for
(
i
=
0
;
i
<
frame_size
;
i
++
)
...
...
This diff is collapsed.
Click to expand it.
src/hybrid_encoder.c
+
14
−
1
View file @
67008d23
...
...
@@ -103,6 +103,14 @@ int hybrid_encode(HybridEncoder *st, const short *pcm, int frame_size,
if
(
st
->
Fs
/
frame_size
==
100
)
st
->
encControl
.
bitRate
+=
5000
;
st
->
encControl
.
packetSize
=
frame_size
;
if
(
st
->
bandwidth
==
BANDWIDTH_NARROWBAND
)
st
->
encControl
.
maxInternalSampleRate
=
8000
;
else
if
(
st
->
bandwidth
==
BANDWIDTH_MEDIUMBAND
)
st
->
encControl
.
maxInternalSampleRate
=
12000
;
else
st
->
encControl
.
maxInternalSampleRate
=
16000
;
/* Call SILK encoder for the low band */
nBytes
=
bytes_per_packet
;
ret
=
SKP_Silk_SDK_Encode
(
st
->
silk_enc
,
&
st
->
encControl
,
pcm
,
frame_size
,
&
enc
,
&
nBytes
);
...
...
@@ -121,10 +129,15 @@ int hybrid_encode(HybridEncoder *st, const short *pcm, int frame_size,
celt_encoder_ctl
(
st
->
celt_enc
,
CELT_SET_START_BAND
(
0
));
}
if
(
st
->
mode
!=
MODE_SILK_ONLY
)
if
(
st
->
mode
!=
MODE_SILK_ONLY
&&
st
->
bandwidth
>
BANDWIDTH_WIDEBAND
)
{
short
buf
[
960
];
if
(
st
->
bandwidth
==
BANDWIDTH_SUPERWIDEBAND
)
celt_encoder_ctl
(
st
->
celt_enc
,
CELT_SET_END_BAND
(
20
));
else
celt_encoder_ctl
(
st
->
celt_enc
,
CELT_SET_END_BAND
(
21
));
for
(
i
=
0
;
i
<
ENCODER_DELAY_COMPENSATION
;
i
++
)
buf
[
i
]
=
st
->
delay_buffer
[
i
];
for
(;
i
<
frame_size
;
i
++
)
...
...
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