summaryrefslogtreecommitdiffstats
path: root/libAACenc/src/adj_thr.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2016-04-05 17:43:33 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-05 17:43:33 +0000
commit65750eae6583754ea9d84fed41dc12d1fc3d73d0 (patch)
treea8dc54ef8dba931c72627e7bbebf1844b81a31f7 /libAACenc/src/adj_thr.cpp
parent0713b4acff1a489e7d49725dc7c5e3dad370b5c8 (diff)
parente1c78ed73faa51f2c7fcb0c4a17a92be9cc747f5 (diff)
downloadfdk-aac-65750eae6583754ea9d84fed41dc12d1fc3d73d0.tar.gz
fdk-aac-65750eae6583754ea9d84fed41dc12d1fc3d73d0.tar.bz2
fdk-aac-65750eae6583754ea9d84fed41dc12d1fc3d73d0.zip
SBR/AAC encoder updates, code clean up
am: e1c78ed * commit 'e1c78ed73faa51f2c7fcb0c4a17a92be9cc747f5': SBR/AAC encoder updates, code clean up Change-Id: I908adc47823de593c3e258c67f360da9321780f5
Diffstat (limited to 'libAACenc/src/adj_thr.cpp')
-rw-r--r--libAACenc/src/adj_thr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libAACenc/src/adj_thr.cpp b/libAACenc/src/adj_thr.cpp
index 69a70b4..c318843 100644
--- a/libAACenc/src/adj_thr.cpp
+++ b/libAACenc/src/adj_thr.cpp
@@ -2138,7 +2138,7 @@ static FIXP_DBL FDKaacEnc_bitresCalcBitFac(const INT bitresBits,
bresParam->clipSpendLow, bresParam->clipSpendHigh,
bresParam->minBitSpend, bresParam->maxBitSpend, bitspend_slope);
- pe_pers = fDivNorm(pex - adjThrChan->peMin, adjThrChan->peMax - adjThrChan->peMin);
+ pe_pers = (pex > adjThrChan->peMin) ? fDivNorm(pex - adjThrChan->peMin, adjThrChan->peMax - adjThrChan->peMin) : 0;
tmp_fix = fMult(((FIXP_DBL)bitSpend + (FIXP_DBL)bitSave), pe_pers);
bitresFac_fix = (UNITY>>1) - ((FIXP_DBL)bitSave>>1) + (tmp_fix>>1); qbres = (DFRACT_BITS-2);