aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/src/FDK_lpc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libFDK/src/FDK_lpc.cpp')
-rw-r--r--libFDK/src/FDK_lpc.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/libFDK/src/FDK_lpc.cpp b/libFDK/src/FDK_lpc.cpp
index 2ba7707..7d7e691 100644
--- a/libFDK/src/FDK_lpc.cpp
+++ b/libFDK/src/FDK_lpc.cpp
@@ -184,12 +184,19 @@ void CLpc_SynthesisLattice(FIXP_DBL *signal, const int signal_size,
for (i = signal_size; i != 0; i--) {
FIXP_DBL *pState = state + order - 1;
const FIXP_DBL *pCoeff = coeff + order - 1;
- FIXP_DBL tmp;
+ FIXP_DBL tmp, accu;
+
+ accu =
+ fMultSubDiv2(scaleValue(*pSignal, signal_e - 1), *pCoeff--, *pState--);
+ tmp = SATURATE_LEFT_SHIFT_ALT(accu, 1, DFRACT_BITS);
- tmp = scaleValue(*pSignal, signal_e) - fMult(*pCoeff--, *pState--);
for (j = order - 1; j != 0; j--) {
- tmp = tmp - fMult(pCoeff[0], pState[0]);
- pState[1] = pState[0] + fMult(*pCoeff--, tmp);
+ accu = fMultSubDiv2(tmp >> 1, pCoeff[0], pState[0]);
+ tmp = SATURATE_LEFT_SHIFT_ALT(accu, 1, DFRACT_BITS);
+
+ accu = fMultAddDiv2(pState[0] >> 1, *pCoeff--, tmp);
+ pState[1] = SATURATE_LEFT_SHIFT_ALT(accu, 1, DFRACT_BITS);
+
pState--;
}