aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2015-10-29 08:32:11 -0700
committerJoe Tsai <joetsai@digital-static.net>2015-10-29 08:32:11 -0700
commit0e4cb52a8b457a58d8d8660437f0e6ac8e806fcd (patch)
tree2e6137a703f61ee3a896baa6aff566a659c11098 /docs
parent6db33debac15f95f89dc9d3c0d748daa0a3f0b4e (diff)
downloadbrotli-0e4cb52a8b457a58d8d8660437f0e6ac8e806fcd.zip
brotli-0e4cb52a8b457a58d8d8660437f0e6ac8e806fcd.tar.gz
brotli-0e4cb52a8b457a58d8d8660437f0e6ac8e806fcd.tar.bz2
Clarify Section 7.1.
* Provide exhaustive list of all the ways the last two bytes can be sourced from. * Also make a clear connection in this section that there are only 64 context IDs for literals. This is important for the indexing math in context maps to make sense.
Diffstat (limited to 'docs')
-rw-r--r--docs/draft-alakuijala-brotli-07.nroff9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/draft-alakuijala-brotli-07.nroff b/docs/draft-alakuijala-brotli-07.nroff
index 1ab0a17..496cce8 100644
--- a/docs/draft-alakuijala-brotli-07.nroff
+++ b/docs/draft-alakuijala-brotli-07.nroff
@@ -1062,8 +1062,9 @@ code in the array of literal and distance prefix codes.
The context for encoding the next literal is defined by the last
two bytes in the stream (p1, p2, where p1 is the most recent
-byte), regardless if these bytes are produced by backward
-references or by literal insertions. At the start of the stream
+byte), regardless of whether these bytes are produced by
+uncompressed meta-blocks, backward references, static dictionary
+references, or by literal insertions. At the start of the stream
p1 and p2 are initialized to zero.
There are four methods, called context modes, to compute the
@@ -1159,6 +1160,10 @@ uncompressed byte the context IDs can be computed as follows:
For Signed: Context ID = (Lut2[p1] << 3) | Lut2[p2]
.fi
+From the lookup tables defined above and the operations to compute the
+context IDs, we can see that context IDs for literals are in the range
+of 0..63.
+
The context modes LSB6, MSB6, UTF8, and Signed are denoted by
integers 0, 1, 2, 3.