lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
# Send one empty static block to give enough lookahead for inflate.
# This takes 10 bits, of which 7 may remain in the bit buffer.
# The current inflate code requires 9 bits of lookahead. If the
# last two codes for the previous block (real code plus EOB) were coded
# on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
# the last real code. In this case we send two empty static blocks instead
# of one. (There are no problems if the previous block is stored or fixed.)
# To simplify the code, we assume the worst case of last real code encoded
# on one bit only.
Send one empty static block to give enough lookahead for inflate.
This takes 10 bits, of which 7 may remain in the bit buffer.
The current inflate code requires 9 bits of lookahead. If the
last two codes for the previous block (real code plus EOB) were coded
on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
the last real code. In this case we send two empty static blocks instead
of one. (There are no problems if the previous block is stored or fixed.)
To simplify the code, we assume the worst case of last real code encoded
on one bit only.
Send one empty static block to give enough lookahead for inflate . This takes 10 bits of which 7 may remain in the bit buffer . The current inflate code requires 9 bits of lookahead . If the last two codes for the previous block ( real code plus EOB ) were coded on 5 bits or less inflate may have only 5 + 3 bits of lookahead to decode the last real code . In this case we send two empty static blocks instead of one . ( There are no problems if the previous block is stored or fixed . ) To simplify the code we assume the worst case of last real code encoded on one bit only .
def _tr_align(s)
    send_bits(s, STATIC_TREES << 1, 3)
    send_bits(s, @@static_ltree[END_BLOCK].fc, @@static_ltree[END_BLOCK].dl)
    bi_flush(s)
    if (1 + s.last_eob_len + 10 - s.bi_valid < 9)
      send_bits(s, STATIC_TREES << 1, 3)
      send_bits(s, @@static_ltree[END_BLOCK].fc, @@static_ltree[END_BLOCK].dl)
      bi_flush(s)
    end
    s.last_eob_len = 7
  end
def _tr_align ( s ) send_bits ( s , STATIC_TREES << 1 , 3 ) send_bits ( s , @@static_ltree [ END_BLOCK ] . fc , @@static_ltree [ END_BLOCK ] . dl ) bi_flush ( s ) if ( 1 + s . last_eob_len + 10 - s . bi_valid < 9 ) send_bits ( s , STATIC_TREES << 1 , 3 ) send_bits ( s , @@static_ltree [ END_BLOCK ] . fc , @@static_ltree [ END_BLOCK ] . dl ) bi_flush ( s ) end s . last_eob_len = 7 end
Send one empty static block to give enough lookahead for inflate.
Send one empty static block to give enough lookahead for inflate .
s
<not_specific>