正規のハフマン表現からルックアップ テーブルを構築するコードである inftrees.c で、作成者は次のように記述します。
/* replicate for those indices with low len bits equal to huff */
incr = 1U << (len - drop);
fill = 1U << curr;
min = fill; /* save offset to next table */
do {
fill -= incr;
next[(huff >> drop) + fill] = here;
} while (fill != 0);
/* backwards increment the len-bit code huff */
incr = 1U << (len - 1);
while (huff & incr)
incr >>= 1;
if (incr != 0) {
huff &= incr - 1;
huff += incr;
}
else
huff = 0
コメントを何度も読んでも、ドロップの意味がわかりました。もう 1 つの質問は、作者がハフマン コードを構築するためにどのような方法を使用しているのかということです。後方増分とは何ですか?
説明してくれませんか、ありがとう。