Clarify pseudo-code in Section 10.

This commit is contained in:
Joe Tsai 2015-11-02 03:34:42 -08:00
parent 1a50dc9b0f
commit 2421ed928f

View File

@ -1728,7 +1728,7 @@ The decoding algorithm that produces the uncompressed data is as follows:
initialize second-to-last and last block types to 0 and 1 initialize second-to-last and last block types to 0 and 1
else else
set block type, BTYPE_i to 0 set block type, BTYPE_i to 0
set block count, BLEN_i to 268435456 set block count, BLEN_i to 16777216
read NPOSTFIX and NDIRECT read NPOSTFIX and NDIRECT
read array of literal context modes, CMODE[] read array of literal context modes, CMODE[]
read NTREESL read NTREESL
@ -1750,7 +1750,8 @@ The decoding algorithm that produces the uncompressed data is as follows:
save previous block type save previous block type
read block count using HTREE_BLEN_I and set BLEN_I read block count using HTREE_BLEN_I and set BLEN_I
decrement BLEN_I decrement BLEN_I
read insert and copy length, ILEN, CLEN using HTREEI[BTYPE_I] read insert-and-copy length symbol using HTREEI[BTYPE_I]
compute insert length, ILEN, and copy length, CLEN
loop for ILEN loop for ILEN
if BLEN_L is zero if BLEN_L is zero
read block type using HTREE_BTYPE_L and set BTYPE_L read block type using HTREE_BTYPE_L and set BTYPE_L
@ -1759,7 +1760,7 @@ The decoding algorithm that produces the uncompressed data is as follows:
decrement BLEN_L decrement BLEN_L
look up context mode CMODE[BTYPE_L] look up context mode CMODE[BTYPE_L]
compute context ID, CIDL from last two uncompressed bytes compute context ID, CIDL from last two uncompressed bytes
read literal using HTREEL[CMAPL[64 * BTYPE_L + CIDL]] read literal using HTREEL[CMAPL[64*BTYPE_L + CIDL]]
write literal to uncompressed stream write literal to uncompressed stream
if number of uncompressed bytes produced in the loop for if number of uncompressed bytes produced in the loop for
this meta-block is MLEN, then break from loop (in this this meta-block is MLEN, then break from loop (in this
@ -1773,13 +1774,17 @@ The decoding algorithm that produces the uncompressed data is as follows:
read block count using HTREE_BLEN_D and set BLEN_D read block count using HTREE_BLEN_D and set BLEN_D
decrement BLEN_D decrement BLEN_D
compute context ID, CIDD from CLEN compute context ID, CIDD from CLEN
read distance code using HTREED[CMAPD[4 * BTYPE_D + CIDD]] read distance code using HTREED[CMAPD[4*BTYPE_D + CIDD]]
compute distance by distance short code substitution if distance code is not zero,
move backwards distance bytes in the uncompressed data and and distance is not a static dictionary reference,
copy CLEN bytes from this position to the uncompressed push distance to the ring buffer of last distances
stream, or look up the static dictionary word, transform if distance is less than the max allowed distance plus one
the word as directed, and copy the result to the move backwards distance bytes in the uncompressed data,
uncompressed stream and copy CLEN bytes from this position to
the uncompressed stream
else
look up the static dictionary word, transform the word as
directed, and copy the result to the uncompressed stream
while number of uncompressed bytes for this meta-block < MLEN while number of uncompressed bytes for this meta-block < MLEN
while not ISLAST while not ISLAST
.fi .fi