summaryrefslogtreecommitdiffstats
path: root/libAACenc/src/line_pe.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2012-11-01 11:08:03 +0200
committerMartin Storsjo <martin@martin.st>2012-11-01 11:08:03 +0200
commit54dfe1ec6972ca0d56dcb671448f84fea5e37e35 (patch)
tree5d26aa077f3aa32d3e5113546abc5a4219332640 /libAACenc/src/line_pe.cpp
parentfea3c1d0ffaf5975bb15462e11edf9c7a664890d (diff)
parent6ab36997af5d5acda4f21d33031f4e45c85f96b7 (diff)
downloadODR-AudioEnc-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.tar.gz
ODR-AudioEnc-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.tar.bz2
ODR-AudioEnc-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.zip
Merge remote-tracking branch 'aosp/jb-mr1-release' into master
Conflicts: libAACenc/src/band_nrg.cpp libAACenc/src/grp_data.cpp libSBRenc/src/env_est.cpp
Diffstat (limited to 'libAACenc/src/line_pe.cpp')
-rw-r--r--libAACenc/src/line_pe.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libAACenc/src/line_pe.cpp b/libAACenc/src/line_pe.cpp
index ed5ee7f..7014bcb 100644
--- a/libAACenc/src/line_pe.cpp
+++ b/libAACenc/src/line_pe.cpp
@@ -122,6 +122,8 @@ void FDKaacEnc_prepareSfbPe(PE_CHANNEL_DATA *peChanData,
avgFormFactorLdData = ((-sfbEnergyLdData[sfbGrp+sfb]>>1) + (CalcLdInt(sfbWidth)>>1))>>1;
peChanData->sfbNLines[sfbGrp+sfb] =
(INT)CalcInvLdData( (sfbFormFactorLdData[sfbGrp+sfb] + formFacScaling) + avgFormFactorLdData);
+ /* Make sure sfbNLines is never greater than sfbWidth due to unaccuracies (e.g. sfbEnergyLdData[sfbGrp+sfb] = 0x80000000) */
+ peChanData->sfbNLines[sfbGrp+sfb] = fMin(sfbWidth, peChanData->sfbNLines[sfbGrp+sfb]);
}
else {
peChanData->sfbNLines[sfbGrp+sfb] = 0;