lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
# Construct the Huffman tree for the bit lengths and return the index in
# bl_order of the last bit length code to send.
Construct the Huffman tree for the bit lengths and return the index in
bl_order of the last bit length code to send.
Construct the Huffman tree for the bit lengths and return the index in bl_order of the last bit length code to send .
def build_bl_tree(s)
    scan_tree(s, s.dyn_ltree, s.l_desc.max_code)
    scan_tree(s, s.dyn_dtree, s.d_desc.max_code)
    build_tree(s, s.bl_desc)
    max_blindex = 0
    (BL_CODES-1).downto(3) do |i|
      max_blindex = i
      break if s.bl_tree[@@bl_order[i]].dl != 0
    end
    s.opt_len += 3*(max_blindex+1) + 5+5+4
    max_blindex
  end
def build_bl_tree ( s ) scan_tree ( s , s . dyn_ltree , s . l_desc . max_code ) scan_tree ( s , s . dyn_dtree , s . d_desc . max_code ) build_tree ( s , s . bl_desc ) max_blindex = 0 ( BL_CODES - 1 ) . downto ( 3 ) do | i | max_blindex = i break if s . bl_tree [ @@bl_order [ i ] ] . dl != 0 end s . opt_len += 3 * ( max_blindex + 1 ) + 5 + 5 + 4 max_blindex end
Construct the Huffman tree for the bit lengths and return the index in
bl_order of the last bit length code to send.
Construct the Huffman tree for the bit lengths and return the index in bl_order of the last bit length code to send .
s
<not_specific>