aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/src/FDK_lpc.cpp
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-05-24 07:24:02 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-24 07:24:02 -0700
commit634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e (patch)
tree4f088dbfd47d22d3f90ebcbcf054a26d6e69bdce /libFDK/src/FDK_lpc.cpp
parent57d474b424be58783e7abba469d2f3d800094967 (diff)
parenta4d1f0ad52e2cf6f168d2193216602f52033fc27 (diff)
downloadfdk-aac-634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e.tar.gz
fdk-aac-634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e.tar.bz2
fdk-aac-634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e.zip
FDKv2 ubsan patches
am: a4d1f0ad52 Change-Id: Ic489768836aae6a9b9cab9e866ecc8b21d819368
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--;
}