aboutsummaryrefslogtreecommitdiff
path: root/video/bink_decoder.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2019-04-08 19:24:00 +0200
committerFilippos Karapetis2019-04-13 16:24:25 +0300
commit0f57aea2df2a1272b57de896e2f6aad80809e5d3 (patch)
tree3d39b80c59af9cfaab7663e24c5c8d21e3293101 /video/bink_decoder.cpp
parentae9eeb731f435d16f2bb9ae69d48ce60c3a47fa3 (diff)
downloadscummvm-rg350-0f57aea2df2a1272b57de896e2f6aad80809e5d3.tar.gz
scummvm-rg350-0f57aea2df2a1272b57de896e2f6aad80809e5d3.tar.bz2
scummvm-rg350-0f57aea2df2a1272b57de896e2f6aad80809e5d3.zip
COMMON: Use a prefix table to speed up the Huffman decoder
Symbols for codes shorter than the prefix table index width are stored in the table. All the entries in the table with an index starting with the code are set to the symbol value. That way, when decoding it is possible to get the number of bits corresponding to the table width from the bitstream and directly find the symbol value. Longer code still need to be searched for in the codes list.
Diffstat (limited to 'video/bink_decoder.cpp')
-rw-r--r--video/bink_decoder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/bink_decoder.cpp b/video/bink_decoder.cpp
index 406c6e4d34..4074043768 100644
--- a/video/bink_decoder.cpp
+++ b/video/bink_decoder.cpp
@@ -594,7 +594,7 @@ void BinkDecoder::BinkVideoTrack::deinitBundles() {
void BinkDecoder::BinkVideoTrack::initHuffman() {
for (int i = 0; i < 16; i++)
- _huffman[i] = new Common::Huffman(binkHuffmanLengths[i][15], 16, binkHuffmanCodes[i], binkHuffmanLengths[i]);
+ _huffman[i] = new Common::Huffman<Common::BitStream32LELSB>(binkHuffmanLengths[i][15], 16, binkHuffmanCodes[i], binkHuffmanLengths[i]);
}
byte BinkDecoder::BinkVideoTrack::getHuffmanSymbol(VideoFrame &video, Huffman &huffman) {