aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src/lpp_tran.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2019-10-08 14:53:07 +0300
committerMartin Storsjo <martin@martin.st>2019-10-08 14:53:07 +0300
commite365f4f27802954f0cf65d3e2eac88b7fdebc83c (patch)
treed0ef656126c0ad2758164a0cf04136efccfe14c1 /libSBRdec/src/lpp_tran.cpp
parentd387d3b6ed79ff9a82c60440bdd86e6e5e324bec (diff)
parentd929f68a05f5cbdd812dca287c8115a39439acf1 (diff)
downloadfdk-aac-e365f4f27802954f0cf65d3e2eac88b7fdebc83c.tar.gz
fdk-aac-e365f4f27802954f0cf65d3e2eac88b7fdebc83c.tar.bz2
fdk-aac-e365f4f27802954f0cf65d3e2eac88b7fdebc83c.zip
Merge remote-tracking branch 'aosp/master'
Diffstat (limited to 'libSBRdec/src/lpp_tran.cpp')
-rw-r--r--libSBRdec/src/lpp_tran.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/libSBRdec/src/lpp_tran.cpp b/libSBRdec/src/lpp_tran.cpp
index 2ef07eb..6acb626 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 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -446,8 +446,26 @@ void lppTransposer(
pSettings->nCols) +
lowBandShift);
}
- dynamicScale = fixMax(
- 0, dynamicScale - 1); /* one additional bit headroom to prevent -1.0 */
+
+ if (dynamicScale == 0) {
+ /* In this special case the available headroom bits as well as
+ ovLowBandShift and lowBandShift are zero. The spectrum is limited to
+ prevent -1.0, so negative values for dynamicScale can be avoided. */
+ for (i = 0; i < (LPC_ORDER + pSettings->overlap + pSettings->nCols);
+ i++) {
+ lowBandReal[i] = fixMax(lowBandReal[i], (FIXP_DBL)0x80000001);
+ }
+ if (!useLP) {
+ for (i = 0; i < (LPC_ORDER + pSettings->overlap + pSettings->nCols);
+ i++) {
+ lowBandImag[i] = fixMax(lowBandImag[i], (FIXP_DBL)0x80000001);
+ }
+ }
+ } else {
+ dynamicScale =
+ fixMax(0, dynamicScale -
+ 1); /* one additional bit headroom to prevent -1.0 */
+ }
/*
Scale temporal QMF buffer.