aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src/lpp_tran.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libSBRdec/src/lpp_tran.cpp')
-rw-r--r--libSBRdec/src/lpp_tran.cpp66
1 files changed, 31 insertions, 35 deletions
diff --git a/libSBRdec/src/lpp_tran.cpp b/libSBRdec/src/lpp_tran.cpp
index 93e1158..bdbafa6 100644
--- a/libSBRdec/src/lpp_tran.cpp
+++ b/libSBRdec/src/lpp_tran.cpp
@@ -132,10 +132,6 @@ amm-info@iis.fraunhofer.de
#include "HFgen_preFlat.h"
-#if defined(__arm__)
-#include "arm/lpp_tran_arm.cpp"
-#endif
-
#define LPC_SCALE_FACTOR 2
/*!
@@ -771,45 +767,45 @@ void lppTransposer(
} else { /* bw <= 0 */
if (!useLP) {
- int descale =
- fixMin(DFRACT_BITS - 1, (LPC_SCALE_FACTOR + dynamicScale));
-#ifdef FUNCTION_LPPTRANSPOSER_func1
- lppTransposer_func1(
- lowBandReal + LPC_ORDER + startSample,
- lowBandImag + LPC_ORDER + startSample,
- qmfBufferReal + startSample, qmfBufferImag + startSample,
- stopSample - startSample, (int)hiBand, dynamicScale, descale, a0r,
- a0i, a1r, a1i, fPreWhitening, preWhiteningGains[loBand],
- preWhiteningGains_exp[loBand] + 1);
-#else
+ const int dynscale = fixMax(0, dynamicScale - 2) + 1;
+ const int rescale = -fixMin(0, dynamicScale - 2) + 1;
+ const int descale = fixMin(DFRACT_BITS - 1,
+ LPC_SCALE_FACTOR + dynamicScale + rescale);
+
for (i = startSample; i < stopSample; i++) {
FIXP_DBL accu1, accu2;
- accu1 = (fMultDiv2(a0r, lowBandReal[LPC_ORDER + i - 1]) -
- fMultDiv2(a0i, lowBandImag[LPC_ORDER + i - 1]) +
- fMultDiv2(a1r, lowBandReal[LPC_ORDER + i - 2]) -
- fMultDiv2(a1i, lowBandImag[LPC_ORDER + i - 2])) >>
- dynamicScale;
- accu2 = (fMultDiv2(a0i, lowBandReal[LPC_ORDER + i - 1]) +
- fMultDiv2(a0r, lowBandImag[LPC_ORDER + i - 1]) +
- fMultDiv2(a1i, lowBandReal[LPC_ORDER + i - 2]) +
- fMultDiv2(a1r, lowBandImag[LPC_ORDER + i - 2])) >>
- dynamicScale;
-
- accu1 = (lowBandReal[LPC_ORDER + i] >> descale) + (accu1 << 1);
- accu2 = (lowBandImag[LPC_ORDER + i] >> descale) + (accu2 << 1);
+ accu1 = ((fMultDiv2(a0r, lowBandReal[LPC_ORDER + i - 1]) -
+ fMultDiv2(a0i, lowBandImag[LPC_ORDER + i - 1])) >>
+ 1) +
+ ((fMultDiv2(a1r, lowBandReal[LPC_ORDER + i - 2]) -
+ fMultDiv2(a1i, lowBandImag[LPC_ORDER + i - 2])) >>
+ 1);
+ accu2 = ((fMultDiv2(a0i, lowBandReal[LPC_ORDER + i - 1]) +
+ fMultDiv2(a0r, lowBandImag[LPC_ORDER + i - 1])) >>
+ 1) +
+ ((fMultDiv2(a1i, lowBandReal[LPC_ORDER + i - 2]) +
+ fMultDiv2(a1r, lowBandImag[LPC_ORDER + i - 2])) >>
+ 1);
+
+ accu1 =
+ (lowBandReal[LPC_ORDER + i] >> descale) + (accu1 >> dynscale);
+ accu2 =
+ (lowBandImag[LPC_ORDER + i] >> descale) + (accu2 >> dynscale);
if (fPreWhitening) {
- accu1 = scaleValueSaturate(
+ qmfBufferReal[i][hiBand] = scaleValueSaturate(
fMultDiv2(accu1, preWhiteningGains[loBand]),
- preWhiteningGains_exp[loBand] + 1);
- accu2 = scaleValueSaturate(
+ preWhiteningGains_exp[loBand] + 1 + rescale);
+ qmfBufferImag[i][hiBand] = scaleValueSaturate(
fMultDiv2(accu2, preWhiteningGains[loBand]),
- preWhiteningGains_exp[loBand] + 1);
+ preWhiteningGains_exp[loBand] + 1 + rescale);
+ } else {
+ qmfBufferReal[i][hiBand] =
+ SATURATE_LEFT_SHIFT(accu1, rescale, DFRACT_BITS);
+ qmfBufferImag[i][hiBand] =
+ SATURATE_LEFT_SHIFT(accu2, rescale, DFRACT_BITS);
}
- qmfBufferReal[i][hiBand] = accu1;
- qmfBufferImag[i][hiBand] = accu2;
}
-#endif
} else {
FDK_ASSERT(dynamicScale >= 0);
calc_qmfBufferReal(