Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
07fed1bf
Commit
07fed1bf
authored
Dec 28, 2009
by
Jean-Marc Valin
Browse files
Adding a safeguard against unstable LPC, so now there's no way (that I can
think of) to produce NaNs in the new PLC.
parent
d69c1cb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/celt.c
View file @
07fed1bf
...
...
@@ -1347,13 +1347,20 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
iir
(
e
,
st
->
lpc
,
e
,
len
+
st
->
mode
->
overlap
,
LPC_ORDER
,
mem
);
{
float
ratio
,
S2
=
0
;
float
S2
=
0
;
for
(
i
=
0
;
i
<
len
+
overlap
;
i
++
)
S2
+=
e
[
i
]
*
1
.
*
e
[
i
];
ratio
=
sqrt
((
S1
+
1
)
/
(
S2
+
1
));
if
(
ratio
<
1
)
/* This checks for an "explosion" in the synthesis (including NaNs) */
if
(
!
(
S1
>
0
.
2
f
*
S2
))
{
for
(
i
=
0
;
i
<
len
+
overlap
;
i
++
)
e
[
i
]
=
0
;
}
else
if
(
S1
<
S2
)
{
float
ratio
=
sqrt
((
S1
+
1
)
/
(
S2
+
1
));
for
(
i
=
0
;
i
<
len
+
overlap
;
i
++
)
e
[
i
]
*=
ratio
;
}
}
for
(
i
=
0
;
i
<
MAX_PERIOD
+
st
->
mode
->
overlap
-
N
;
i
++
)
...
...
Write
Preview
Markdown
is supported
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