aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2018-12-27 11:32:30 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-12-27 11:32:30 -0800
commitceafe133b4088ff30c07678d1700611085af3bab (patch)
treef039597f0cc0e3600b37fe2879d68c09df9a5b16
parent61b3c49df02edfde16650080d73ff50759f816c0 (diff)
parentd8be06332296042e89f1663b880151a6d707b664 (diff)
downloadfdk-aac-ceafe133b4088ff30c07678d1700611085af3bab.tar.gz
fdk-aac-ceafe133b4088ff30c07678d1700611085af3bab.tar.bz2
fdk-aac-ceafe133b4088ff30c07678d1700611085af3bab.zip
Merge "Limit too large scale_change exponent used in adjustTimeSlot" am: cfc6616048 am: 8b3ca08a7d
am: d8be063322 Change-Id: Ie0637291a104ca68ef4e438e2d4a7d599088c6ba
-rw-r--r--libSBRdec/src/env_calc.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/libSBRdec/src/env_calc.cpp b/libSBRdec/src/env_calc.cpp
index d7a8bb5..10c73ec 100644
--- a/libSBRdec/src/env_calc.cpp
+++ b/libSBRdec/src/env_calc.cpp
@@ -1561,13 +1561,14 @@ void calculateSbrEnvelope(
adjustTimeSlotHQ_GainAndNoise(
&analysBufferReal[j][lowSubband],
&analysBufferImag[j][lowSubband], h_sbr_cal_env, pNrgs,
- lowSubband, noSubbands, scale_change, smooth_ratio, noNoiseFlag,
- filtBufferNoiseShift);
+ lowSubband, noSubbands, fMin(scale_change, DFRACT_BITS - 1),
+ smooth_ratio, noNoiseFlag, filtBufferNoiseShift);
} else {
adjustTimeSlotHQ(&analysBufferReal[j][lowSubband],
&analysBufferImag[j][lowSubband], h_sbr_cal_env,
- pNrgs, lowSubband, noSubbands, scale_change,
- smooth_ratio, noNoiseFlag, filtBufferNoiseShift);
+ pNrgs, lowSubband, noSubbands,
+ fMin(scale_change, DFRACT_BITS - 1), smooth_ratio,
+ noNoiseFlag, filtBufferNoiseShift);
}
} else {
FDK_ASSERT(!iTES_enable); /* not supported */
@@ -1575,13 +1576,14 @@ void calculateSbrEnvelope(
/* FDKmemset(analysBufferReal[j], 0, 64 * sizeof(FIXP_DBL)); */
adjustTimeSlot_EldGrid(&analysBufferReal[j][lowSubband], pNrgs,
&h_sbr_cal_env->harmIndex, lowSubband,
- noSubbands, scale_change, noNoiseFlag,
- &h_sbr_cal_env->phaseIndex,
+ noSubbands,
+ fMin(scale_change, DFRACT_BITS - 1),
+ noNoiseFlag, &h_sbr_cal_env->phaseIndex,
EXP2SCALE(adj_e) - sbrScaleFactor->lb_scale);
} else {
adjustTimeSlotLC(&analysBufferReal[j][lowSubband], pNrgs,
&h_sbr_cal_env->harmIndex, lowSubband, noSubbands,
- scale_change, noNoiseFlag,
+ fMin(scale_change, DFRACT_BITS - 1), noNoiseFlag,
&h_sbr_cal_env->phaseIndex);
}
}