aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2005-12-09 22:04:28 +0000
committerMax Horn2005-12-09 22:04:28 +0000
commit3107d08f271f9606210dca05db72ace13fe37afc (patch)
tree93b6889e5481f336f57da270c2c01532b0b632b1 /sound
parente0e1dcda08ba26674e3f988594535ce542f44925 (diff)
downloadscummvm-rg350-3107d08f271f9606210dca05db72ace13fe37afc.tar.gz
scummvm-rg350-3107d08f271f9606210dca05db72ace13fe37afc.tar.bz2
scummvm-rg350-3107d08f271f9606210dca05db72ace13fe37afc.zip
Unified IMA code a little bit
svn-id: r19767
Diffstat (limited to 'sound')
-rw-r--r--sound/adpcm.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/adpcm.cpp b/sound/adpcm.cpp
index bae635547e..e777a243b2 100644
--- a/sound/adpcm.cpp
+++ b/sound/adpcm.cpp
@@ -166,8 +166,8 @@ int16 ADPCMInputStream::decodeOKI(byte code) {
_status.stepIndex += stepAdjust(code);
if (_status.stepIndex < 0)
_status.stepIndex = 0;
- if (_status.stepIndex > 48)
- _status.stepIndex = 48;
+ if (_status.stepIndex > ARRAYSIZE(okiStepSize) - 1)
+ _status.stepIndex = ARRAYSIZE(okiStepSize) - 1;
// * 16 effectively converts 12-bit input to 16-bit output
return samp * 16;
@@ -213,8 +213,8 @@ int16 ADPCMInputStream::decodeMSIMA(byte code) {
_status.stepIndex += stepAdjust(code);
if (_status.stepIndex < 0)
_status.stepIndex = 0;
- if (_status.stepIndex > 88)
- _status.stepIndex = 88;
+ if (_status.stepIndex > ARRAYSIZE(imaStepTable) - 1)
+ _status.stepIndex = ARRAYSIZE(imaStepTable) - 1;
return samp;
}