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
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
Marcus Asteborg
Opus
Commits
44cbe6ea
Commit
44cbe6ea
authored
14 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
PLC fix
parent
d9ad6e11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/opus_decoder.c
+4
-5
4 additions, 5 deletions
src/opus_decoder.c
with
4 additions
and
5 deletions
src/opus_decoder.c
+
4
−
5
View file @
44cbe6ea
...
...
@@ -72,7 +72,6 @@ OpusDecoder *opus_decoder_create(int Fs, int channels)
st
->
celt_dec
=
celt_decoder_init
(
st
->
celt_dec
,
Fs
,
channels
,
NULL
);
return
st
;
}
int
opus_decode
(
OpusDecoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
short
*
pcm
,
int
frame_size
)
...
...
@@ -118,6 +117,8 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
data
+=
1
;
ec_byte_readinit
(
&
buf
,(
unsigned
char
*
)
data
,
len
);
ec_dec_init
(
&
dec
,
&
buf
);
}
else
{
audiosize
=
frame_size
;
}
if
(
audiosize
>
frame_size
)
...
...
@@ -128,6 +129,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
frame_size
=
audiosize
;
}
/* SILK processing */
if
(
st
->
mode
!=
MODE_CELT_ONLY
)
{
SKP_int16
*
pcm_ptr
=
pcm
;
...
...
@@ -148,9 +150,6 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
DecControl
.
internalSampleRate
=
16000
;
}
/* FIXME: Add a check here to avoid a buffer overflow if there are more
samples in the SILK frame. In fact the TOC byte should tell us how many
frames there are */
do
{
/* Call SILK decoder */
silk_ret
=
SKP_Silk_SDK_Decode
(
st
->
silk_dec
,
&
DecControl
,
data
==
NULL
,
&
dec
,
len
,
pcm_ptr
,
&
silk_frame_size
);
...
...
@@ -195,7 +194,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
celt_decoder_ctl
(
st
->
celt_dec
,
CELT_SET_END_BAND
(
endband
));
celt_decoder_ctl
(
st
->
celt_dec
,
CELT_SET_CHANNELS
(
st
->
stream_channels
));
/*
En
code
high band with
CELT */
/*
De
code CELT */
celt_ret
=
celt_decode_with_ec
(
st
->
celt_dec
,
data
,
len
,
pcm_celt
,
frame_size
,
&
dec
);
for
(
i
=
0
;
i
<
frame_size
*
st
->
channels
;
i
++
)
pcm
[
i
]
=
ADD_SAT16
(
pcm
[
i
],
pcm_celt
[
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