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); } }
public void set(HuffLeaf in_leaf) { this.pNode = null; this.pLeaf = in_leaf; }
public void set(HuffNode in_node) { this.pLeaf = null; this.pNode = in_node; }
public HuffWrap() { this.pNode = null; this.pLeaf = null; }