aboutsummaryrefslogtreecommitdiff
path: root/video/codecs/svq1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'video/codecs/svq1.cpp')
-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;
}