ส่วนนี้เค้ากำลังจะบอกว่า ต่อไปนี้เค้ากำลังจะทำอะไรต่อ
// please address any bugs discovered in this code
// to the author: karl malbrain, karl_m@acm.org <<<<<< ถ้าเจอบักปรึกษาได้ที่ E mail นี้เลย
// link bit-level I/O
void arc_put1 (unsigned bit); การประกาศตัวแปร arc_put1 ชนิด unsigned bit
unsigned arc_get1 ();
// This code is adapted from Professor Vitter's
// article, Design and Analysis of Dynamic Huffman Codes,
// which appeared in JACM October 1987
// A design trade-off has been made to simplify the
// code: a node's block is determined dynamically,
// and the implicit tree structure is maintained,
// e.g. explicit node numbers are also implicit.
// Dynamic huffman table weight ranking
// is maintained per Professor Vitter's
// invariant (*) for algorithm FGK:
// leaves preceed internal nodes of the
// same weight in a non-decreasing ranking
// of weights using implicit node numbers:
// 1) leaves slide over internal nodes, internal nodes
// swap over groups of leaves, leaves are swapped
// into group leader position, but two internal
// nodes never change positions relative
// to one another.
// 2) weights are incremented by 2:
// leaves always have even weight values;
// internal nodes always have odd values.
// 3) even node numbers are always right children;
// odd numbers are left children in the tree.
// node 2 * HuffSize - 1 is always the tree root;
// node HuffEsc is the escape node;
// the tree is initialized by creating an
// escape node as the root.
// each new leaf symbol is paired with a new escape
// node into the previous escape node in the tree,
// until the last symbol which takes over the
// tree position of the escape node, and
// HuffEsc is left at zero.
// overall table size: 2 * HuffSize
// huff_init(alphabet_size, potential symbols used)
// huff_encode(next_symbol)
// next_symbol = huff_decode()
// huff_scale(by_bits) -- scale weights and rebalance tree