Brotli::Enc::BinaryTreeHasher
Inherits Reference < Object
Port of hash_to_binary_tree_inc.h (H10 instantiation: BUCKET_BITS 17, MAX_TREE_COMP_LENGTH 128, MAX_TREE_SEARCH_DEPTH 64). Each hash bucket holds a binary tree of sequences sharing the 4-byte hash, lexicographically sorted and max-heap by start position.
Constants
MAX_NUM_MATCHES_H10 = MAX_TREE_SEARCH_DEPTH + 64
MAX_TREE_COMP_LENGTH = 128
MAX_TREE_SEARCH_DEPTH = 64
Constructors
new(lgwin : Int32, num_nodes : Int32)
SourceInstance methods
common
Sourcefind_all_matches(dict : EncoderDictionary, data : Bytes, ring_buffer_mask : Int32, cur_ix : Int32, max_length : Int32, max_backward : Int32, dictionary_distance : Int32, params : Params, matches : Slice(BackwardMatch)) : Int32
hash_to_binary_tree_inc.h:202 — all matches at cur_ix, sorted by strictly increasing length and non-strictly increasing distance.
hash_type_length
Sourceleft_child_index(pos : Int32) : Int32
Sourceright_child_index(pos : Int32) : Int32
Sourcestitch_to_previous_block(num_bytes : Int32, position : Int32, ringbuffer : Bytes, ringbuffer_mask : Int32) : Nil
hash_to_binary_tree_inc.h:298
store_and_find_matches(data : Bytes, cur_ix : Int32, ring_buffer_mask : Int32, max_length : Int32, max_backward : Int32, best_len_in : Int32, matches : Slice(BackwardMatch) | Nil, mpos_in : Int32) : Tuple(Int32, Int32)
hash_to_binary_tree_inc.h:114 — stores the hash of the next 4 bytes and, in a single tree traversal, searches the bucket's tree for matches and re-roots it at the current position. Returns {best_len, match_count}; matches/mpos are unused when matches is nil.
store_lookahead
Sourcestore_range(data : Bytes, mask : Int32, ix_start : Int32, ix_end : Int32) : Nil
hash_to_binary_tree_inc.h:280