go/src/compress/flate/huffman_code.go

type hcode

type huffmanEncoder

type literalNode

type levelInfo

// set sets the code and length of an hcode.
func (h *hcode) set(code uint16, length uint16) {}

func maxNode() literalNode {}

func newHuffmanEncoder(size int) *huffmanEncoder {}

// Generates a HuffmanCode corresponding to the fixed literal table.
func generateFixedLiteralEncoding() *huffmanEncoder {}

func generateFixedOffsetEncoding() *huffmanEncoder {}

var fixedLiteralEncoding

var fixedOffsetEncoding

func (h *huffmanEncoder) bitLength(freq []int32) int {}

const maxBitsLimit

// bitCounts computes the number of literals assigned to each bit size in the Huffman encoding.
// It is only called when list.length >= 3.
// The cases of 0, 1, and 2 literals are handled by special case code.
//
// list is an array of the literals with non-zero frequencies
// and their associated frequencies. The array is in order of increasing
// frequency and has as its last element a special element with frequency
// MaxInt32.
//
// maxBits is the maximum number of bits that should be used to encode any literal.
// It must be less than 16.
//
// bitCounts returns an integer slice in which slice[i] indicates the number of literals
// that should be encoded in i bits.
func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 {}

// Look at the leaves and assign them a bit count and an encoding as specified
// in RFC 1951 3.2.2
func (h *huffmanEncoder) assignEncodingAndSize(bitCount []int32, list []literalNode) {}

// Update this Huffman Code object to be the minimum code for the specified frequency count.
//
// freq is an array of frequencies, in which freq[i] gives the frequency of literal i.
// maxBits  The maximum number of bits to use for any literal.
func (h *huffmanEncoder) generate(freq []int32, maxBits int32) {}

type byLiteral

func (s *byLiteral) sort(a []literalNode) {}

func (s byLiteral) Len() int {}

func (s byLiteral) Less(i, j int) bool {}

func (s byLiteral) Swap(i, j int) {}

type byFreq

func (s *byFreq) sort(a []literalNode) {}

func (s byFreq) Len() int {}

func (s byFreq) Less(i, j int) bool {}

func (s byFreq) Swap(i, j int) {}

func reverseBits(number uint16, bitLength byte) uint16 {}