aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2015-11-02 03:34:42 -0800
committerJoe Tsai <joetsai@digital-static.net>2015-11-02 03:35:39 -0800
commit2421ed928f23b9fd2f16b5b51355c85d74fab481 (patch)
tree3a6c72afab0880203aaf8e8fe323ad0f505b538c /docs
parent1a50dc9b0ff1f57c9ef3f595205cd81be0170eb2 (diff)
downloadbrotli-2421ed928f23b9fd2f16b5b51355c85d74fab481.zip
brotli-2421ed928f23b9fd2f16b5b51355c85d74fab481.tar.gz
brotli-2421ed928f23b9fd2f16b5b51355c85d74fab481.tar.bz2
Clarify pseudo-code in Section 10.
Diffstat (limited to 'docs')
-rw-r--r--docs/draft-alakuijala-brotli-07.nroff25
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