aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-26 07:25:12 +0000
committerFilippos Karapetis2009-05-26 07:25:12 +0000
commit5e94e688e96760acc6f2f78cbff9d2e970b3fad0 (patch)
tree3868580816baa190a63d971bb035ba49e9b74749
parent4cc2d06b154736f35e050dda19cfd3ba9dff7f97 (diff)
downloadscummvm-rg350-5e94e688e96760acc6f2f78cbff9d2e970b3fad0.tar.gz
scummvm-rg350-5e94e688e96760acc6f2f78cbff9d2e970b3fad0.tar.bz2
scummvm-rg350-5e94e688e96760acc6f2f78cbff9d2e970b3fad0.zip
Reserve some space in the Huffman tree arrays before starting to decode the Huffman trees. Hopefully, this will speed up the tree constructing phase somewhat
svn-id: r40900
-rw-r--r--graphics/video/smk_decoder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/graphics/video/smk_decoder.cpp b/graphics/video/smk_decoder.cpp
index 3d83bbd8ea..7c8ec9a855 100644
--- a/graphics/video/smk_decoder.cpp
+++ b/graphics/video/smk_decoder.cpp
@@ -123,6 +123,7 @@ public:
uint32 bit = _bs.getBit();
assert(bit);
+ _tree.reserve(256);
decodeTree(0);
bit = _bs.getBit();
@@ -227,6 +228,7 @@ BigHuffmanTree::BigHuffmanTree(BitStream &bs)
_last[0] = _last[1] = _last[2] = 0xffffffff;
+ _tree.reserve(256);
decodeTree(0, 0);
bit = _bs.getBit();
assert(!bit);