Subject: More header compression comments

From: Martin Thomson <[email-masked]>
Date: Tue, 27 Aug 2013 13:31:17 -0700

I've been going through this, and it occurred that most cases for
header indexing use an arrangement where a 0 value indicates a
literal, and 1+ is an index.

[a] So, why not start header table indexing at 1 and save the confusion.

[b] There's only one place where 0-based indexing is used, and that is
for index toggling.  I have a suggestion for that too.

Rather than have an opcode for the reference set toggling, simply
start the encoding of a header block with a 0-terminated list of
header table indexes to toggle.  Then you can reclaim a bit from the
front of the other opcodes.

[c] If you want to get crazy and are comfortable with requiring strict
ordering, you can reduce the need for two-byte references by having
each item in the list be a delta from the previous item.

Thus, where you want to toggle the first, twenty-third and 120th
entries, you would start the header block with: 1, 22, 97, 0.

Of course, this is probably not that useful if you don't think that
there is any value in having a large number of entries in the header
table.

--Martin