aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRenc
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-05-24 07:24:38 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-05-24 07:24:38 +0000
commitc85b838a65360747539d85099d92268dd3994d11 (patch)
tree4f088dbfd47d22d3f90ebcbcf054a26d6e69bdce /libSBRenc
parente30420c551a348fdf0a20888ca2b95b527060061 (diff)
parenta4d1f0ad52e2cf6f168d2193216602f52033fc27 (diff)
downloadfdk-aac-c85b838a65360747539d85099d92268dd3994d11.tar.gz
fdk-aac-c85b838a65360747539d85099d92268dd3994d11.tar.bz2
fdk-aac-c85b838a65360747539d85099d92268dd3994d11.zip
Snap for 4801384 from a4d1f0ad52e2cf6f168d2193216602f52033fc27 to pi-release
Change-Id: Iab0959417db83cdeb3af7ce59ef4d8584a96b8be
Diffstat (limited to 'libSBRenc')
-rw-r--r--libSBRenc/src/tran_det.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/libSBRenc/src/tran_det.cpp b/libSBRenc/src/tran_det.cpp
index b6f1b9f..3b6765a 100644
--- a/libSBRenc/src/tran_det.cpp
+++ b/libSBRenc/src/tran_det.cpp
@@ -269,23 +269,33 @@ static FIXP_DBL addLowbandEnergies(FIXP_DBL **Energies, int *scaleEnergies,
FIXP_DBL accu1 = FL2FXCONST_DBL(0.0f);
FIXP_DBL accu2 = FL2FXCONST_DBL(0.0f);
int tran_offdiv2 = tran_off >> nrgSzShift;
+ const int sc1 =
+ DFRACT_BITS -
+ fNormz((FIXP_DBL)fMax(
+ 1, (freqBandTable[0] * (YBufferWriteOffset - tran_offdiv2) - 1)));
+ const int sc2 =
+ DFRACT_BITS -
+ fNormz((FIXP_DBL)fMax(
+ 1, (freqBandTable[0] *
+ (tran_offdiv2 + (slots >> nrgSzShift) - YBufferWriteOffset) -
+ 1)));
int ts, k;
/* Sum up lowband energy from one frame at offset tran_off */
/* freqBandTable[LORES] has MAX_FREQ_COEFFS/2 +1 coeefs max. */
for (ts = tran_offdiv2; ts < YBufferWriteOffset; ts++) {
for (k = 0; k < freqBandTable[0]; k++) {
- accu1 += Energies[ts][k] >> 6;
+ accu1 += Energies[ts][k] >> sc1;
}
}
for (; ts < tran_offdiv2 + (slots >> nrgSzShift); ts++) {
for (k = 0; k < freqBandTable[0]; k++) {
- accu2 += Energies[ts][k] >> 9;
+ accu2 += Energies[ts][k] >> sc2;
}
}
- nrgTotal_m = fAddNorm(accu1, 1 - scaleEnergies[0], accu2,
- 4 - scaleEnergies[1], &nrgTotal_e);
+ nrgTotal_m = fAddNorm(accu1, (sc1 - 5) - scaleEnergies[0], accu2,
+ (sc2 - 5) - scaleEnergies[1], &nrgTotal_e);
nrgTotal_m = scaleValueSaturate(nrgTotal_m, nrgTotal_e);
return (nrgTotal_m);