Home | History | Annotate | Download | only in bzip2

Lines Matching refs:tree

9 // A huffmanTree is a binary tree which is navigated, bit-by-bit to reach a
12 // nodes contains all the non-leaf nodes in the tree. nodes[0] is the
13 // root of the tree and nextNode contains the index of the next element
14 // of nodes to use when the tree is being constructed.
19 // A huffmanNode is a node in the tree. left and right contain indexes into the
20 // nodes slice of the tree. If left or right is invalidNodeValue then the child
24 // tree, but also two magic values for run-length encoding and an EOF symbol.
31 // invalidNodeValue is an invalid index which marks a leaf node in the tree.
34 // Decode reads bits from the given bitReader and navigates the tree until a
37 nodeIndex := uint16(0) // node 0 is the root of the tree.
74 // newHuffmanTree builds a Huffman tree from a slice containing the code
78 // each symbol (consider reflecting a tree down the middle, for
80 // efficiency of the tree, each of these trees is equally good. In
81 // order to minimize the amount of information needed to build a tree
82 // bzip2 uses a canonical tree so that it can be reconstructed given
187 // the Huffman tree at the given level. It returns the index of the newly
205 // There is a superfluous level in the Huffman tree indicating
215 // tree cannot encode anything and a length-1 tree can only
218 return 0, StructuralError("empty Huffman tree")
229 return 0, StructuralError("equal symbols in Huffman tree")