aboutsummaryrefslogtreecommitdiff
path: root/audio/decoders/qdm2.cpp
diff options
context:
space:
mode:
authorD G Turner2012-04-10 06:17:38 +0100
committerD G Turner2012-04-13 07:37:25 +0100
commit220f60fd6026ce176c7ec62d200811f62f22d0ff (patch)
tree434a86c70294bf9caa7f10bb1a5c94620f353ce2 /audio/decoders/qdm2.cpp
parentfa44707028f19a08c9f201278c0c8ffa7f27b4d8 (diff)
downloadscummvm-rg350-220f60fd6026ce176c7ec62d200811f62f22d0ff.tar.gz
scummvm-rg350-220f60fd6026ce176c7ec62d200811f62f22d0ff.tar.bz2
scummvm-rg350-220f60fd6026ce176c7ec62d200811f62f22d0ff.zip
AUDIO: Clean up QDM2 getVlc2() function.
Diffstat (limited to 'audio/decoders/qdm2.cpp')
-rw-r--r--audio/decoders/qdm2.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/audio/decoders/qdm2.cpp b/audio/decoders/qdm2.cpp
index 0388450bd2..749a0d64dd 100644
--- a/audio/decoders/qdm2.cpp
+++ b/audio/decoders/qdm2.cpp
@@ -1225,35 +1225,22 @@ void ff_mpa_synth_filter(int16 *synth_buf_ptr, int *synth_buf_offset,
* = (max_vlc_length + bits - 1) / bits
*/
static int getVlc2(Common::BitStream *s, int16 (*table)[2], int bits, int maxDepth) {
- int totalBits = 0;
- int index;
- int code;
- int n;
-
- index = s->peekBits(bits);
- code = table[index][0];
- n = table[index][1];
+ int index = s->getBits(bits);
+ int code = table[index][0];
+ int n = table[index][1];
if (maxDepth > 1 && n < 0) {
- totalBits += bits;
- s->skip(bits);
-
- index = s->peekBits(-n) + code;
+ index = s->getBits(-n) + code;
code = table[index][0];
n = table[index][1];
if(maxDepth > 2 && n < 0) {
- totalBits += -n;
- s->skip(-n);
-
- index = s->peekBits(-n) + code;
+ index = s->getBits(-n) + code;
code = table[index][0];
n = table[index][1];
}
}
- s->skip(totalBits + n);
-
return code;
}