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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Victor Ding
Opus
Commits
b5be8261
Commit
b5be8261
authored
14 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Updated to follow changes in SILK API
parent
ae1fad2e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
silk
+1
-1
1 addition, 1 deletion
silk
src/opus_decoder.c
+16
-1
16 additions, 1 deletion
src/opus_decoder.c
src/opus_encoder.c
+10
-5
10 additions, 5 deletions
src/opus_encoder.c
with
27 additions
and
7 deletions
silk
@
d513d743
Subproject commit
6c98e344f395b3d1a285885a8be88c0685a346b2
Subproject commit
d513d743fb5d9802e2d39d74a13f5628c1553059
This diff is collapsed.
Click to expand it.
src/opus_decoder.c
+
16
−
1
View file @
b5be8261
...
...
@@ -85,7 +85,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
ec_dec
dec
;
ec_byte_buffer
buf
;
SKP_SILK_SDK_DecControlStruct
DecControl
;
SKP_int
16
silk_frame_size
;
SKP_int
32
silk_frame_size
;
short
pcm_celt
[
960
];
int
audiosize
;
...
...
@@ -126,6 +126,21 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
if
(
st
->
mode
!=
MODE_CELT_ONLY
)
{
DecControl
.
API_sampleRate
=
st
->
Fs
;
DecControl
.
payloadSize_ms
=
1000
*
audiosize
/
st
->
Fs
;
if
(
st
->
mode
==
MODE_SILK_ONLY
)
{
if
(
st
->
bandwidth
==
BANDWIDTH_NARROWBAND
)
{
DecControl
.
internalSampleRate
=
8000
;
}
else
if
(
st
->
bandwidth
==
BANDWIDTH_MEDIUMBAND
)
{
DecControl
.
internalSampleRate
=
12000
;
}
else
if
(
st
->
bandwidth
==
BANDWIDTH_WIDEBAND
)
{
DecControl
.
internalSampleRate
=
16000
;
}
else
{
SKP_assert
(
0
);
}
}
else
{
/* Hybrid mode */
DecControl
.
internalSampleRate
=
16000
;
}
/* We Should eventually have to set the bandwidth here */
...
...
This diff is collapsed.
Click to expand it.
src/opus_encoder.c
+
10
−
5
View file @
b5be8261
...
...
@@ -92,7 +92,7 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
{
int
i
;
int
ret
=
0
;
SKP_int
16
nBytes
;
SKP_int
32
nBytes
;
ec_enc
enc
;
ec_byte_buffer
buf
;
SKP_SILK_SDK_EncControlStruct
encControl
;
...
...
@@ -119,20 +119,25 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
if
(
st
->
Fs
==
100
*
frame_size
)
encControl
.
bitRate
-=
5000
;
}
encControl
.
packetSize
=
frame_size
;
encControl
.
payloadSize_ms
=
1000
*
frame_size
/
st
->
Fs
;
if
(
st
->
mode
==
MODE_HYBRID
)
encControl
.
minInternalSampleRate
=
16000
;
else
encControl
.
minInternalSampleRate
=
8000
;
if
(
st
->
bandwidth
==
BANDWIDTH_NARROWBAND
)
encControl
.
maxInternalSampleRate
=
8000
;
else
if
(
st
->
bandwidth
==
BANDWIDTH_MEDIUMBAND
)
encControl
.
maxInternalSampleRate
=
12000
;
encControl
.
maxInternalSampleRate
=
12000
;
else
encControl
.
maxInternalSampleRate
=
16000
;
encControl
.
maxInternalSampleRate
=
16000
;
/* Call SILK encoder for the low band */
nBytes
=
bytes_per_packet
;
ret
=
SKP_Silk_SDK_Encode
(
st
->
silk_enc
,
&
encControl
,
pcm
,
frame_size
,
&
enc
,
&
nBytes
);
if
(
ret
)
{
fprintf
(
stderr
,
"SILK encode error
\n
"
);
fprintf
(
stderr
,
"SILK encode error
%d
\n
"
,
ret
);
/* Handle error */
}
ret
=
(
ec_enc_tell
(
&
enc
,
0
)
+
7
)
>>
3
;
...
...
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