aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src/HFgen_preFlat.cpp
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-09-08 16:53:57 -0700
committerXin Li <delphij@google.com>2020-09-08 16:53:57 -0700
commit7f7e67fe023aa5e479aba0388a7e3fb591bda4e5 (patch)
tree0e353968c34e8c9699663a9b252836b70847c30b /libSBRdec/src/HFgen_preFlat.cpp
parent946a672b0f5b8481eb3a429f854fcb34d847d692 (diff)
parent7a0dde5d5dc4d24095c0391e7fa8297de3c7cd45 (diff)
downloadfdk-aac-7f7e67fe023aa5e479aba0388a7e3fb591bda4e5.tar.gz
fdk-aac-7f7e67fe023aa5e479aba0388a7e3fb591bda4e5.tar.bz2
fdk-aac-7f7e67fe023aa5e479aba0388a7e3fb591bda4e5.zip
Merge Android R
Bug: 168057903 Merged-In: Idcdb13a8c37b0b4b5446169c3e80dfe55586bc77 Change-Id: I29b7ae1003fb72aeb5fbf1fdfdceea849c1c12b8
Diffstat (limited to 'libSBRdec/src/HFgen_preFlat.cpp')
-rw-r--r--libSBRdec/src/HFgen_preFlat.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/libSBRdec/src/HFgen_preFlat.cpp b/libSBRdec/src/HFgen_preFlat.cpp
index 96adbb9..ad4caba 100644
--- a/libSBRdec/src/HFgen_preFlat.cpp
+++ b/libSBRdec/src/HFgen_preFlat.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
@@ -897,30 +897,31 @@ void sbrDecoder_calculateGainVec(FIXP_DBL **sourceBufferReal,
for (i = startSample; i < stopSample; i++) {
maxVal |=
(FIXP_DBL)((LONG)(sourceBufferReal[i][loBand]) ^
- ((LONG)sourceBufferReal[i][loBand] >> (SAMPLE_BITS - 1)));
+ ((LONG)sourceBufferReal[i][loBand] >> (DFRACT_BITS - 1)));
maxVal |=
(FIXP_DBL)((LONG)(sourceBufferImag[i][loBand]) ^
- ((LONG)sourceBufferImag[i][loBand] >> (SAMPLE_BITS - 1)));
+ ((LONG)sourceBufferImag[i][loBand] >> (DFRACT_BITS - 1)));
}
if (maxVal != FL2FX_DBL(0.0f)) {
- reserve = fixMax(0, CntLeadingZeros(maxVal) - 2);
+ reserve = CntLeadingZeros(maxVal) - 2;
}
nrg_ov = nrg = (FIXP_DBL)0;
if (scale_nrg_ov > -31) {
for (i = startSample; i < overlap; i++) {
- nrg_ov += (fPow2Div2(sourceBufferReal[i][loBand] << reserve) +
- fPow2Div2(sourceBufferImag[i][loBand] << reserve)) >>
- sum_scale_ov;
+ nrg_ov +=
+ (fPow2Div2(scaleValue(sourceBufferReal[i][loBand], reserve)) +
+ fPow2Div2(scaleValue(sourceBufferImag[i][loBand], reserve))) >>
+ sum_scale_ov;
}
} else {
scale_nrg_ov = 0;
}
if (scale_nrg > -31) {
for (i = overlap; i < stopSample; i++) {
- nrg += (fPow2Div2(sourceBufferReal[i][loBand] << reserve) +
- fPow2Div2(sourceBufferImag[i][loBand] << reserve)) >>
+ nrg += (fPow2Div2(scaleValue(sourceBufferReal[i][loBand], reserve)) +
+ fPow2Div2(scaleValue(sourceBufferImag[i][loBand], reserve))) >>
sum_scale;
}
} else {