aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src/hbe.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2022-01-10 13:44:04 +0200
committerMartin Storsjo <martin@martin.st>2022-01-10 13:55:34 +0200
commit41ae84525e66febd33ea1fa0130a5b46610f4173 (patch)
tree2e7f66da35feda4d6136c3a9e970ebee254d0c2d /libSBRdec/src/hbe.cpp
parent573e93e4d0d08127dd3b2297a0ce52221527d90a (diff)
parentdd6d9f9f6c9d095bd159d4f0d8b36a6b7e6057a8 (diff)
downloadfdk-aac-41ae84525e66febd33ea1fa0130a5b46610f4173.tar.gz
fdk-aac-41ae84525e66febd33ea1fa0130a5b46610f4173.tar.bz2
fdk-aac-41ae84525e66febd33ea1fa0130a5b46610f4173.zip
Merge remote-tracking branch 'aosp/master'
Diffstat (limited to 'libSBRdec/src/hbe.cpp')
-rw-r--r--libSBRdec/src/hbe.cpp51
1 files changed, 18 insertions, 33 deletions
diff --git a/libSBRdec/src/hbe.cpp b/libSBRdec/src/hbe.cpp
index 77cb8af..9485823 100644
--- a/libSBRdec/src/hbe.cpp
+++ b/libSBRdec/src/hbe.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
@@ -1400,42 +1400,27 @@ void QmfTransposerApply(HANDLE_HBE_TRANSPOSER hQmfTransposer,
if (shift_ov != 0) {
for (i = 0; i < HBE_MAX_OUT_SLOTS; i++) {
- for (band = 0; band < QMF_SYNTH_CHANNELS; band++) {
- if (shift_ov >= 0) {
- hQmfTransposer->qmfHBEBufReal_F[i][band] <<= shift_ov;
- hQmfTransposer->qmfHBEBufImag_F[i][band] <<= shift_ov;
- } else {
- hQmfTransposer->qmfHBEBufReal_F[i][band] >>= (-shift_ov);
- hQmfTransposer->qmfHBEBufImag_F[i][band] >>= (-shift_ov);
- }
- }
+ scaleValuesSaturate(&hQmfTransposer->qmfHBEBufReal_F[i][0],
+ QMF_SYNTH_CHANNELS, shift_ov);
+ scaleValuesSaturate(&hQmfTransposer->qmfHBEBufImag_F[i][0],
+ QMF_SYNTH_CHANNELS, shift_ov);
}
- }
- if ((keepStatesSyncedMode == KEEP_STATES_SYNCED_OFF) && shift_ov != 0) {
- for (i = timeStep * firstSlotOffsset; i < ov_len; i++) {
- for (band = hQmfTransposer->startBand; band < hQmfTransposer->stopBand;
- band++) {
- if (shift_ov >= 0) {
- ppQmfBufferOutReal_F[i][band] <<= shift_ov;
- ppQmfBufferOutImag_F[i][band] <<= shift_ov;
- } else {
- ppQmfBufferOutReal_F[i][band] >>= (-shift_ov);
- ppQmfBufferOutImag_F[i][band] >>= (-shift_ov);
- }
+ if (keepStatesSyncedMode == KEEP_STATES_SYNCED_OFF) {
+ int nBands =
+ fMax(0, hQmfTransposer->stopBand - hQmfTransposer->startBand);
+
+ for (i = timeStep * firstSlotOffsset; i < ov_len; i++) {
+ scaleValuesSaturate(&ppQmfBufferOutReal_F[i][hQmfTransposer->startBand],
+ nBands, shift_ov);
+ scaleValuesSaturate(&ppQmfBufferOutImag_F[i][hQmfTransposer->startBand],
+ nBands, shift_ov);
}
- }
- /* shift lpc filterstates */
- for (i = 0; i < timeStep * firstSlotOffsset + LPC_ORDER; i++) {
- for (band = 0; band < (64); band++) {
- if (shift_ov >= 0) {
- lpcFilterStatesReal[i][band] <<= shift_ov;
- lpcFilterStatesImag[i][band] <<= shift_ov;
- } else {
- lpcFilterStatesReal[i][band] >>= (-shift_ov);
- lpcFilterStatesImag[i][band] >>= (-shift_ov);
- }
+ /* shift lpc filterstates */
+ for (i = 0; i < timeStep * firstSlotOffsset + LPC_ORDER; i++) {
+ scaleValuesSaturate(&lpcFilterStatesReal[i][0], (64), shift_ov);
+ scaleValuesSaturate(&lpcFilterStatesImag[i][0], (64), shift_ov);
}
}
}