summaryrefslogtreecommitdiffstats
path: root/fdk-aac/libSACdec/src/sac_stp.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-05 19:05:48 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-05 19:05:48 +0100
commit28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9 (patch)
tree36714366ee8883927f57e096490c209d8317ee99 /fdk-aac/libSACdec/src/sac_stp.cpp
parentc573d3e3cfa9afe42bb3aafae17d527a7f608d55 (diff)
downloadODR-AudioEnc-28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9.tar.gz
ODR-AudioEnc-28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9.tar.bz2
ODR-AudioEnc-28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9.zip
Update fdk-aac to v2.0.3
Diffstat (limited to 'fdk-aac/libSACdec/src/sac_stp.cpp')
-rw-r--r--fdk-aac/libSACdec/src/sac_stp.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/fdk-aac/libSACdec/src/sac_stp.cpp b/fdk-aac/libSACdec/src/sac_stp.cpp
index bb66277..0e6affa 100644
--- a/fdk-aac/libSACdec/src/sac_stp.cpp
+++ b/fdk-aac/libSACdec/src/sac_stp.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2019 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
@@ -229,15 +229,13 @@ inline void combineSignalCplxScale1(FIXP_DBL *hybOutputRealDry,
int n;
FIXP_DBL scaleY;
for (n = bands - 1; n >= 0; n--) {
- scaleY = fMultDiv2(scaleX, *pBP);
+ scaleY = fMult(scaleX, *pBP);
*hybOutputRealDry = SATURATE_LEFT_SHIFT(
- (*hybOutputRealDry >> 1) +
- (fMultDiv2(*hybOutputRealWet, scaleY) << (SF_SCALE + 1)),
- 1, DFRACT_BITS);
+ (*hybOutputRealDry >> SF_SCALE) + fMult(*hybOutputRealWet, scaleY),
+ SF_SCALE, DFRACT_BITS);
*hybOutputImagDry = SATURATE_LEFT_SHIFT(
- (*hybOutputImagDry >> 1) +
- (fMultDiv2(*hybOutputImagWet, scaleY) << (SF_SCALE + 1)),
- 1, DFRACT_BITS);
+ (*hybOutputImagDry >> SF_SCALE) + fMult(*hybOutputImagWet, scaleY),
+ SF_SCALE, DFRACT_BITS);
hybOutputRealDry++, hybOutputRealWet++;
hybOutputImagDry++, hybOutputImagWet++;
pBP++;
@@ -252,12 +250,12 @@ inline void combineSignalCplxScale2(FIXP_DBL *hybOutputRealDry,
int n;
for (n = bands - 1; n >= 0; n--) {
- *hybOutputRealDry =
- *hybOutputRealDry +
- (fMultDiv2(*hybOutputRealWet, scaleX) << (SF_SCALE + 1));
- *hybOutputImagDry =
- *hybOutputImagDry +
- (fMultDiv2(*hybOutputImagWet, scaleX) << (SF_SCALE + 1));
+ *hybOutputRealDry = SATURATE_LEFT_SHIFT(
+ (*hybOutputRealDry >> SF_SCALE) + fMult(*hybOutputRealWet, scaleX),
+ SF_SCALE, DFRACT_BITS);
+ *hybOutputImagDry = SATURATE_LEFT_SHIFT(
+ (*hybOutputImagDry >> SF_SCALE) + fMult(*hybOutputImagWet, scaleX),
+ SF_SCALE, DFRACT_BITS);
hybOutputRealDry++, hybOutputRealWet++;
hybOutputImagDry++, hybOutputImagWet++;
}
@@ -369,15 +367,15 @@ SACDEC_ERROR subbandTPApply(spatialDec *self, const SPATIAL_BS_FRAME *frame) {
hStpDec->update_old_ener = 1;
for (ch = 0; ch < self->numInputChannels; ch++) {
hStpDec->oldDryEnerLD64[ch] =
- CalcLdData(hStpDec->runDryEner[ch] + ABS_THR__FDK);
+ CalcLdData(fAddSaturate(hStpDec->runDryEner[ch], ABS_THR__FDK));
}
for (ch = 0; ch < self->numOutputChannels; ch++) {
if (self->treeConfig == TREE_212)
hStpDec->oldWetEnerLD64[ch] =
- CalcLdData(hStpDec->runWetEner[ch] + ABS_THR__FDK);
+ CalcLdData(fAddSaturate(hStpDec->runWetEner[ch], ABS_THR__FDK));
else
hStpDec->oldWetEnerLD64[ch] =
- CalcLdData(hStpDec->runWetEner[ch] + ABS_THR2__FDK);
+ CalcLdData(fAddSaturate(hStpDec->runWetEner[ch], ABS_THR2__FDK));
}
} else {
hStpDec->update_old_ener++;