void UnpackV1() { uint[] leaf_nodes_weight; using (var enc = new MemoryStream (ReadEncoded())) leaf_nodes_weight = ReadWeightTable (enc, 0x100); var tree = new HuffmanTree (leaf_nodes_weight); byte[] packed = new byte[m_info.IntermediateLength]; HuffmanDecompress (tree, packed); m_output = new byte[Stride * (int)m_info.Height]; UnpackZeros (packed); ReverseAverageSampling(); }
void HuffmanDecompress(HuffmanTree tree, byte[] output) { for (int dst = 0; dst < output.Length; dst++) { output[dst] = (byte)tree.DecodeToken (this); } }