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
else
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 array of literal context modes, CMODE[]
read NTREESL
@ -1750,7 +1750,8 @@ The decoding algorithm that produces the uncompressed data is as follows:
save previous block type
read block count using HTREE_BLEN_I and set 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
if BLEN_L is zero
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
look up context mode CMODE[BTYPE_L]
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
if number of uncompressed bytes produced in the loop for
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
decrement BLEN_D
compute context ID, CIDD from CLEN
read distance code using HTREED[CMAPD[4 * BTYPE_D + CIDD]]
compute distance by distance short code substitution
move backwards distance bytes in the uncompressed data and
copy CLEN bytes from this position to the uncompressed
stream, or look up the static dictionary word, transform
the word as directed, and copy the result to the
uncompressed stream
read distance code using HTREED[CMAPD[4*BTYPE_D + CIDD]]
if distance code is not zero,
and distance is not a static dictionary reference,
push distance to the ring buffer of last distances
if distance is less than the max allowed distance plus one
move backwards distance bytes in the uncompressed data,
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 not ISLAST
.fi