Пример #1
0
        public void generateCodes(BitStream bs, int index, int depth)
        {
            return;             //skip this not nessecary for our purposes

            if (index < 0)
            {
                HuffLeaf rLeaf = this.m_huffLeaves[-(index + 1)];
                rLeaf.code    = BitStream.LEToInt32(bs.dataBuffer);
                rLeaf.numBits = depth;
            }
            else
            {
                HuffNode rNode = this.m_huffNodes[index];
                int      pos   = bs.getCurPos();
                bs.writeFlag(false);
                this.generateCodes(bs, rNode.index0, depth + 1);

                bs.setCurPos(pos);
                bs.writeFlag(true);
                this.generateCodes(bs, rNode.index1, depth + 1);

                bs.setCurPos(pos);
            }
        }
Пример #2
0
 public void set(HuffLeaf in_leaf)
 {
     this.pNode = null; this.pLeaf = in_leaf;
 }
Пример #3
0
 public void set(HuffNode in_node)
 {
     this.pLeaf = null; this.pNode = in_node;
 }
Пример #4
0
 public HuffWrap()
 {
     this.pNode = null; this.pLeaf = null;
 }