diff --git a/source/libsmackerdec/include/SmackerDecoder.h b/source/libsmackerdec/include/SmackerDecoder.h index f35fdc0fc3..a43481648b 100644 --- a/source/libsmackerdec/include/SmackerDecoder.h +++ b/source/libsmackerdec/include/SmackerDecoder.h @@ -48,7 +48,7 @@ #include #include "FileStream.h" #include "BitReader.h" -#include +#include "collections.h" // exportable interface struct SmackerHandle @@ -140,25 +140,25 @@ class SmackerDecoder uint32_t treeSize; uint32_t mMapSize, MClrSize, fullSize, typeSize; - std::vector mmap_tbl; - std::vector mclr_tbl; - std::vector full_tbl; - std::vector type_tbl; + GrowArray mmap_tbl; + GrowArray mclr_tbl; + GrowArray full_tbl; + GrowArray type_tbl; int mmap_last[3], mclr_last[3], full_last[3], type_last[3]; - std::vector frameSizes; - std::vector frameFlags; + GrowArray frameSizes; + GrowArray frameFlags; uint32_t currentFrame; int32_t nextPos; int32_t firstFrameFilePos; bool DecodeHeaderTrees(); - int DecodeHeaderTree(SmackerCommon::BitReader &bits, std::vector &recodes, int *last, int size); + int DecodeHeaderTree(SmackerCommon::BitReader &bits, GrowArray &recodes, int *last, int size); int DecodeTree(SmackerCommon::BitReader &bits, HuffContext *hc, uint32_t prefix, int length); int DecodeBigTree(SmackerCommon::BitReader &bits, HuffContext *hc, DBCtx *ctx); - int GetCode(SmackerCommon::BitReader &bits, std::vector &recode, int *last); + int GetCode(SmackerCommon::BitReader &bits, GrowArray &recode, int *last); int ReadPacket(); int DecodeFrame(uint32_t frameSize); void GetFrameSize(uint32_t &width, uint32_t &height); diff --git a/source/libsmackerdec/src/SmackerDecoder.cpp b/source/libsmackerdec/src/SmackerDecoder.cpp index ee206a4bb5..6031f58377 100644 --- a/source/libsmackerdec/src/SmackerDecoder.cpp +++ b/source/libsmackerdec/src/SmackerDecoder.cpp @@ -50,7 +50,7 @@ #include "compat.h" #include "baselayer.h" -std::vector classInstances; +GrowArray classInstances; SmackerHandle Smacker_Open(const char* fileName) { @@ -248,9 +248,9 @@ typedef struct HuffContext { int maxlength; int current; - std::vector bits; - std::vector lengths; - std::vector values; + GrowArray bits; + GrowArray lengths; + GrowArray values; } HuffContext; @@ -258,19 +258,19 @@ typedef struct HuffContext { typedef struct DBCtx { SmackerCommon::VLCtable v1; SmackerCommon::VLCtable v2; - std::vector recode1, recode2; + GrowArray recode1, recode2; int escapes[3]; int *last; int lcur; } DBCtx; -static void last_reset(std::vector &recode, int *last) { +static void last_reset(GrowArray &recode, int *last) { recode[last[0]] = recode[last[1]] = recode[last[2]] = 0; } /* get code and update history */ -int SmackerDecoder::GetCode(SmackerCommon::BitReader &bits, std::vector &recode, int *last) +int SmackerDecoder::GetCode(SmackerCommon::BitReader &bits, GrowArray &recode, int *last) { int *table = &recode[0]; @@ -540,7 +540,7 @@ int SmackerDecoder::DecodeBigTree(SmackerCommon::BitReader &bits, HuffContext *h /** * Store large tree as Libav's vlc codes */ -int SmackerDecoder::DecodeHeaderTree(SmackerCommon::BitReader &bits, std::vector &recodes, int *last, int size) +int SmackerDecoder::DecodeHeaderTree(SmackerCommon::BitReader &bits, GrowArray &recodes, int *last, int size) { HuffContext huff; HuffContext tmp1, tmp2;