diff options
-rw-r--r-- | docs/draft-alakuijala-brotli-07.nroff | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/docs/draft-alakuijala-brotli-07.nroff b/docs/draft-alakuijala-brotli-07.nroff index fa02035..8cf92ab 100644 --- a/docs/draft-alakuijala-brotli-07.nroff +++ b/docs/draft-alakuijala-brotli-07.nroff @@ -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 |