summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-09-04 13:33:52 -0700
committerXin Li <delphij@google.com>2019-09-04 13:33:52 -0700
commit4f305849ded7434216c8facbfae17d37869fde16 (patch)
tree94c17e8d05625433aa0fe2ef9bc3d15afa422971
parent603e7c5ed50d7a7d9e4548c8bedfc1a6ea8c2038 (diff)
parent5d46637e61e735e13891ef071b23d4f6a17b48ba (diff)
downloadsonivox-4f305849ded7434216c8facbfae17d37869fde16.tar.gz
DO NOT MERGE - Merge Android 10 into master
Bug: 139893257 Change-Id: I47c959a585bf9084b5795b2c071d2837118e62e9
-rw-r--r--arm-wt-22k/lib_src/eas_wtsynth.c3
-rw-r--r--arm-wt-22k/lib_src/wt_22khz.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/arm-wt-22k/lib_src/eas_wtsynth.c b/arm-wt-22k/lib_src/eas_wtsynth.c
index ecb6837..987170b 100644
--- a/arm-wt-22k/lib_src/eas_wtsynth.c
+++ b/arm-wt-22k/lib_src/eas_wtsynth.c
@@ -576,6 +576,9 @@ static EAS_BOOL WT_UpdateVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH
temp += (pVoice->note + pSynth->globalTranspose) * 100;
intFrame.frame.phaseIncrement = WT_UpdatePhaseInc(pWTVoice, pArt, pChannel, temp);
temp = pWTVoice->loopEnd - pWTVoice->loopStart;
+#ifdef _16_BIT_SAMPLES
+ temp >>= 1;
+#endif
if (temp != 0) {
temp = temp << NUM_PHASE_FRAC_BITS;
if (intFrame.frame.phaseIncrement > temp) {
diff --git a/arm-wt-22k/lib_src/wt_22khz.c b/arm-wt-22k/lib_src/wt_22khz.c
index 33c11e1..5091f74 100644
--- a/arm-wt-22k/lib_src/wt_22khz.c
+++ b/arm-wt-22k/lib_src/wt_22khz.c
@@ -14697,7 +14697,8 @@ const EAS_U32 eas_sampleOffsets[] =
0x00033c53, 0x00033c69, 0x00033c7e, 0x00033c93, 0x00033ca8, 0x00033cbd
};
#else //_16_BIT_SAMPLES
-const EAS_SAMPLE eas_samples[] =
+/* NOTE: this array should have size of at least eas_sampleOffsets[last_element] + eas_sampleLengths[last_element] */
+const EAS_SAMPLE eas_samples[0x00033cbd + 20] =
{
0, 0, -768, -1024, -1536, -2048, -2560, -3072, -3072, -2816, -2048, -768, 768, 1792, 2560, 3584,
4096, 4096, 3840, 3072, 2304, 1024, -1024, -3072, -4608, -5376, -5376, -4864, -4608, -3840, -2560, -768,