aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2021-05-07 15:05:19 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-05-07 15:05:19 +0000
commit03416e01c7f9085bdfbcc0d9b3b05c54bdf94731 (patch)
treea9212fc55b8933a2a02f83655c8ebdcc932859c0 /libSBRdec/src
parentfdec102c1846771f6eaf2b6e1d6be36034b5c28c (diff)
parent48e0fa028d4c6f70f46ef5608b2108c89453a487 (diff)
downloadfdk-aac-03416e01c7f9085bdfbcc0d9b3b05c54bdf94731.tar.gz
fdk-aac-03416e01c7f9085bdfbcc0d9b3b05c54bdf94731.tar.bz2
fdk-aac-03416e01c7f9085bdfbcc0d9b3b05c54bdf94731.zip
Avoid unintentional sign conversions in lppTransposer() and lppTransposerHBE(). am: 48e0fa028d
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/aac/+/14373124 Change-Id: I49564df49b3eb4e604687c4f9d6b7a2f199f1b3a
Diffstat (limited to 'libSBRdec/src')
-rw-r--r--libSBRdec/src/lpp_tran.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/libSBRdec/src/lpp_tran.cpp b/libSBRdec/src/lpp_tran.cpp
index 113b1de..68a25bf 100644
--- a/libSBRdec/src/lpp_tran.cpp
+++ b/libSBRdec/src/lpp_tran.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -527,7 +527,7 @@ void lppTransposer(
if ((scale > 0) && (result >= (FIXP_DBL)MAXVAL_DBL >> scale)) {
resetLPCCoeffs = 1;
} else {
- alphar[1] = FX_DBL2FX_SGL(scaleValue(result, scale));
+ alphar[1] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale));
if ((tmp < FL2FX_DBL(0.0f)) ^ (ac.det < FL2FX_DBL(0.0f))) {
alphar[1] = -alphar[1];
}
@@ -555,7 +555,7 @@ void lppTransposer(
scale)) {
resetLPCCoeffs = 1;
} else {
- alphai[1] = FX_DBL2FX_SGL(scaleValue(result, scale));
+ alphai[1] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale));
if ((tmp < FL2FX_DBL(0.0f)) ^ (ac.det < FL2FX_DBL(0.0f))) {
alphai[1] = -alphai[1];
}
@@ -594,7 +594,7 @@ void lppTransposer(
} else {
INT scale;
FIXP_DBL result = fDivNorm(absTmp, fixp_abs(ac.r11r), &scale);
- alphar[0] = FX_DBL2FX_SGL(scaleValue(result, scale + 1));
+ alphar[0] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale + 1));
if ((tmp > FL2FX_DBL(0.0f)) ^ (ac.r11r < FL2FX_DBL(0.0f)))
alphar[0] = -alphar[0];
@@ -614,7 +614,7 @@ void lppTransposer(
} else {
INT scale;
FIXP_DBL result = fDivNorm(absTmp, fixp_abs(ac.r11r), &scale);
- alphai[0] = FX_DBL2FX_SGL(scaleValue(result, scale + 1));
+ alphai[0] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale + 1));
if ((tmp > FL2FX_DBL(0.0f)) ^ (ac.r11r < FL2FX_DBL(0.0f)))
alphai[0] = -alphai[0];
}
@@ -657,7 +657,7 @@ void lppTransposer(
INT scale;
FIXP_DBL result =
fDivNorm(fixp_abs(ac.r01r), fixp_abs(ac.r11r), &scale);
- k1 = scaleValue(result, scale);
+ k1 = scaleValueSaturate(result, scale);
if (!((ac.r01r < FL2FX_DBL(0.0f)) ^ (ac.r11r < FL2FX_DBL(0.0f)))) {
k1 = -k1;
@@ -1062,7 +1062,7 @@ void lppTransposerHBE(
if ((scale > 0) && (result >= (FIXP_DBL)MAXVAL_DBL >> scale)) {
resetLPCCoeffs = 1;
} else {
- alphar[1] = FX_DBL2FX_SGL(scaleValue(result, scale));
+ alphar[1] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale));
if ((tmp < FL2FX_DBL(0.0f)) ^ (ac.det < FL2FX_DBL(0.0f))) {
alphar[1] = -alphar[1];
}
@@ -1088,7 +1088,7 @@ void lppTransposerHBE(
(result >= /*FL2FXCONST_DBL(1.f)*/ (FIXP_DBL)MAXVAL_DBL >> scale)) {
resetLPCCoeffs = 1;
} else {
- alphai[1] = FX_DBL2FX_SGL(scaleValue(result, scale));
+ alphai[1] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale));
if ((tmp < FL2FX_DBL(0.0f)) ^ (ac.det < FL2FX_DBL(0.0f))) {
alphai[1] = -alphai[1];
}
@@ -1117,7 +1117,7 @@ void lppTransposerHBE(
} else {
INT scale;
FIXP_DBL result = fDivNorm(absTmp, fixp_abs(ac.r11r), &scale);
- alphar[0] = FX_DBL2FX_SGL(scaleValue(result, scale + 1));
+ alphar[0] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale + 1));
if ((tmp > FL2FX_DBL(0.0f)) ^ (ac.r11r < FL2FX_DBL(0.0f)))
alphar[0] = -alphar[0];
@@ -1136,7 +1136,7 @@ void lppTransposerHBE(
} else {
INT scale;
FIXP_DBL result = fDivNorm(absTmp, fixp_abs(ac.r11r), &scale);
- alphai[0] = FX_DBL2FX_SGL(scaleValue(result, scale + 1));
+ alphai[0] = FX_DBL2FX_SGL(scaleValueSaturate(result, scale + 1));
if ((tmp > FL2FX_DBL(0.0f)) ^ (ac.r11r < FL2FX_DBL(0.0f))) {
alphai[0] = -alphai[0];
}