diff options
author | Martin Storsjo <martin@martin.st> | 2012-11-01 11:08:03 +0200 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2012-11-01 11:08:03 +0200 |
commit | 54dfe1ec6972ca0d56dcb671448f84fea5e37e35 (patch) | |
tree | 5d26aa077f3aa32d3e5113546abc5a4219332640 /libAACenc/src/grp_data.cpp | |
parent | fea3c1d0ffaf5975bb15462e11edf9c7a664890d (diff) | |
parent | 6ab36997af5d5acda4f21d33031f4e45c85f96b7 (diff) | |
download | fdk-aac-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.tar.gz fdk-aac-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.tar.bz2 fdk-aac-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/grp_data.cpp')
-rw-r--r-- | libAACenc/src/grp_data.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libAACenc/src/grp_data.cpp b/libAACenc/src/grp_data.cpp index 88a01ba..4355295 100644 --- a/libAACenc/src/grp_data.cpp +++ b/libAACenc/src/grp_data.cpp @@ -94,6 +94,10 @@ amm-info@iis.fraunhofer.de * this routine does not work in-place */ +static inline FIXP_DBL nrgAddSaturate(const FIXP_DBL a, const FIXP_DBL b) { + return ( (a>=(FIXP_DBL)MAXVAL_DBL-b) ? (FIXP_DBL)MAXVAL_DBL : (a + b) ); +} + void FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out */ SFB_THRESHOLD *sfbThreshold, /* in-out */ @@ -177,7 +181,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out FIXP_DBL thresh = sfbThreshold->Short[wnd][sfb]; for (j=1; j<groupLen[grp]; j++) { - thresh = fAddSaturate(thresh, sfbThreshold->Short[wnd+j][sfb]); + thresh = nrgAddSaturate(thresh, sfbThreshold->Short[wnd+j][sfb]); } sfbThreshold->Long[i++] = thresh; } @@ -195,7 +199,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out FIXP_DBL energy = sfbEnergy->Short[wnd][sfb]; for (j=1; j<groupLen[grp]; j++) { - energy = fAddSaturate(energy, sfbEnergy->Short[wnd+j][sfb]); + energy = nrgAddSaturate(energy, sfbEnergy->Short[wnd+j][sfb]); } sfbEnergy->Long[i++] = energy; } @@ -213,7 +217,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out FIXP_DBL energy = sfbEnergyMS->Short[wnd][sfb]; for (j=1; j<groupLen[grp]; j++) { - energy = fAddSaturate(energy, sfbEnergyMS->Short[wnd+j][sfb]); + energy = nrgAddSaturate(energy, sfbEnergyMS->Short[wnd+j][sfb]); } sfbEnergyMS->Long[i++] = energy; } @@ -231,7 +235,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out FIXP_DBL energy = sfbSpreadEnergy->Short[wnd][sfb]; for (j=1; j<groupLen[grp]; j++) { - energy = fAddSaturate(energy, sfbSpreadEnergy->Short[wnd+j][sfb]); + energy = nrgAddSaturate(energy, sfbSpreadEnergy->Short[wnd+j][sfb]); } sfbSpreadEnergy->Long[i++] = energy; } |