aboutsummaryrefslogtreecommitdiff
path: root/video/codecs
diff options
context:
space:
mode:
authorD G Turner2012-04-05 00:10:20 +0100
committerD G Turner2012-04-08 03:29:17 +0100
commita3fb8867d050561a963df122a3e2d2510fd78d54 (patch)
tree98f231d610249a10b7a7dca0253c9522dfdc2e7d /video/codecs
parentb99565d701dd2dc9b355b0d43b4d8119c2b1085e (diff)
downloadscummvm-rg350-a3fb8867d050561a963df122a3e2d2510fd78d54.tar.gz
scummvm-rg350-a3fb8867d050561a963df122a3e2d2510fd78d54.tar.bz2
scummvm-rg350-a3fb8867d050561a963df122a3e2d2510fd78d54.zip
VIDEO: Fix remaining missing code (getVlc2()) in SVQ1 Codec.
Diffstat (limited to 'video/codecs')
-rw-r--r--video/codecs/svq1.cpp38
1 files changed, 7 insertions, 31 deletions
diff --git a/video/codecs/svq1.cpp b/video/codecs/svq1.cpp
index 8d3673bcfe..9d05a8dcf0 100644
--- a/video/codecs/svq1.cpp
+++ b/video/codecs/svq1.cpp
@@ -59,46 +59,22 @@ struct VLC {
* = (max_vlc_length + bits - 1) / bits
*/
static int getVlc2(Common::BitStream *s, int16 (*table)[2], int bits, int maxDepth) {
- //FIXME - Change this code to working with BitStream...
- //GetBitContext *s
- //int reIndex;
- //int reCache;
- //int index;
- int code = 0;
- //int n;
-
-/* FIXME
- reIndex = s->index;
- reCache = READ_LE_UINT32(s->buffer + (reIndex >> 3)) >> (reIndex & 0x07);
- index = reCache & (0xffffffff >> (32 - bits));
- code = table[index][0];
- n = table[index][1];
-
- if (maxDepth > 1 && n < 0){
- reIndex += bits;
- reCache = READ_LE_UINT32(s->buffer + (reIndex >> 3)) >> (reIndex & 0x07);
-
- int nbBits = -n;
-
- index = (reCache & (0xffffffff >> (32 - nbBits))) + code;
+ int index = s->getBits(bits);
+ int code = table[index][0];
+ int n = table[index][1];
+
+ if (maxDepth > 1 && n < 0) {
+ index = s->getBits(-n) + code;
code = table[index][0];
n = table[index][1];
if(maxDepth > 2 && n < 0) {
- reIndex += nbBits;
- reCache = READ_LE_UINT32(s->buffer + (reIndex >> 3)) >> (reIndex & 0x07);
-
- nbBits = -n;
-
- index = (reCache & (0xffffffff >> (32 - nbBits))) + code;
+ index = s->getBits(-n) + code;
code = table[index][0];
n = table[index][1];
}
}
- reCache >>= n;
- s->index = reIndex + n;
-*/
return code;
}