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
303b3b62
Commit
303b3b62
authored
Dec 30, 2009
by
Jean-Marc Valin
Browse files
fixed-point: starting conversion of the new PLC
parent
07fed1bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
libcelt/celt.c
View file @
303b3b62
...
...
@@ -55,6 +55,7 @@
#include <stdarg.h>
#define LPC_ORDER 24
/* #define NEW_PLC */
#if !defined(FIXED_POINT) || defined(NEW_PLC)
#include "plc.c"
#endif
...
...
@@ -1286,7 +1287,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
for
(
c
=
0
;
c
<
C
;
c
++
)
{
celt_word32
e
[
MAX_PERIOD
];
float
exc
[
MAX_PERIOD
];
celt_word16
exc
[
MAX_PERIOD
];
float
ac
[
LPC_ORDER
+
1
];
float
decay
=
1
;
float
S1
=
0
;
...
...
@@ -1294,7 +1295,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
offset
=
MAX_PERIOD
-
pitch_index
;
for
(
i
=
0
;
i
<
MAX_PERIOD
;
i
++
)
exc
[
i
]
=
st
->
out_mem
[
i
*
C
+
c
];
exc
[
i
]
=
SHR32
(
st
->
out_mem
[
i
*
C
+
c
]
,
SIG_SHIFT
)
;
if
(
st
->
loss_count
==
0
)
{
...
...
@@ -1340,7 +1341,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
offset
-=
pitch_index
;
decay
*=
decay
;
}
e
[
i
]
=
decay
*
exc
[
offset
+
i
]
;
e
[
i
]
=
decay
*
SHL32
(
EXTEND32
(
exc
[
offset
+
i
]),
SIG_SHIFT
)
;
S1
+=
st
->
out_mem
[
offset
+
i
]
*
1
.
*
st
->
out_mem
[
offset
+
i
];
}
...
...
libcelt/plc.c
View file @
303b3b62
...
...
@@ -42,12 +42,16 @@ int p
if
(
error
<
.
00001
*
ac
[
0
])
break
;
}
#ifdef FIXED_POINT
for
(
i
=
0
;
i
<
p
;
i
++
)
lpc
[
i
]
=
(
1
.
/
4096
)
*
floor
(.
5
+
4096
*
lpc
[
i
]);
#endif
return
error
;
}
void
fir
(
const
float
*
x
,
void
fir
(
const
celt_word16
*
x
,
const
float
*
num
,
float
*
y
,
celt_word16
*
y
,
int
N
,
int
ord
,
float
*
mem
)
...
...
@@ -95,7 +99,7 @@ void iir(const celt_word32 *x,
}
void
_celt_autocorr
(
const
float
*
x
,
/* in: [0...n-1] samples x */
const
celt_word16
*
x
,
/* in: [0...n-1] samples x */
float
*
ac
,
/* out: [0...lag-1] ac values */
const
celt_word16
*
window
,
int
overlap
,
...
...
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