Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCode ¶
GenerateCode generate code in reversed format. This method can be used for deflate header written
func GenerateCode2 ¶
func GenerateCode2(lens []uint32)
GenerateCode2 generate code in reversed format. Result will be inplace. reuseCache should be
Types ¶
type LenLimitedCode ¶
type LenLimitedCode struct {
// contains filtered or unexported fields
}
LenLimitedCode implements a code length limited algorithm huffman tree generator.
func NewLenLimitedCode ¶
func NewLenLimitedCode() *LenLimitedCode
NewLenLimitedCode creates a new LenLimitedCode instance
type MoffatHuffmanCode ¶
type MoffatHuffmanCode struct{}
MoffatHuffmanCode implements In-Place Calculation of Minimum-Redundancy Codes. Check http://hjemmesider.diku.dk/~jyrki/Paper/WADS95.pdf .
func (*MoffatHuffmanCode) Generate ¶
func (m *MoffatHuffmanCode) Generate(histogram []uint32)
Generate huffman tree from histogram and write tree codes into codes.
type TreeGenerator ¶
type TreeGenerator interface { // Generate huffman tree from histogram and write tree codes into codes. Generate(maxLens int, histogram []uint32, codeLens []uint32) (num int) }
TreeGenerator generate code's lengths from the histogram A huffman tree generator must be reused due to memory allocation overhead.