From 220f60fd6026ce176c7ec62d200811f62f22d0ff Mon Sep 17 00:00:00 2001 From: D G Turner Date: Tue, 10 Apr 2012 06:17:38 +0100 Subject: AUDIO: Clean up QDM2 getVlc2() function. --- audio/decoders/qdm2.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'audio/decoders') 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; } -- cgit v1.2.3