From 1a4f884b2398bfee59df01579dd280751aed4ccb Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Wed, 28 Oct 2015 17:09:11 -0700 Subject: [PATCH] Define the maximum number of bytes transforms may add to a word This value is useful in implementing the decoder since we can know ahead-of-time what size buffer is needed to contain the output of a transformed word. --- docs/draft-alakuijala-brotli-07.nroff | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/draft-alakuijala-brotli-07.nroff b/docs/draft-alakuijala-brotli-07.nroff index 890140a..4f4a965 100644 --- a/docs/draft-alakuijala-brotli-07.nroff +++ b/docs/draft-alakuijala-brotli-07.nroff @@ -5703,6 +5703,11 @@ sequences that represent the 121 transforms are then concatenated to a single sequence of bytes. The length of that sequence is 648 bytes, and the zlib CRC is 0x3d965f81. +The maximum number of additional bytes that a transform may add to a base word +is 13 bytes, based on the prefix and suffix values found in transform ID 73. +Since the largest base word is 24 bytes in length, a buffer of (24 + 13) bytes +is sufficient to store any transformed words (not counting a terminating zero). + .nf ID Prefix Transform Suffix -- ------ --------- ------