diff options
author | Alexey Tourbin <alexey.tourbin@gmail.com> | 2018-04-24 22:40:12 (GMT) |
---|---|---|
committer | Alexey Tourbin <alexey.tourbin@gmail.com> | 2018-04-24 23:39:28 (GMT) |
commit | ff9b4cf82678f9643d256129d06098b692072584 (patch) | |
tree | 0787ff85c4b04d6cdc1d1860ff555c6f94da0c24 /tests | |
parent | 62d7cdcc741480842a0c217df7cb26ad3946ab32 (diff) | |
download | lz4-ff9b4cf82678f9643d256129d06098b692072584.zip lz4-ff9b4cf82678f9643d256129d06098b692072584.tar.gz lz4-ff9b4cf82678f9643d256129d06098b692072584.tar.bz2 |
lz4_Block_format.md: clarify on short inputs and restrictions
It occurred to me that the formula "The last 5 bytes are always
literals", on the list of "assumptions made by the decoder", is
remarkably ambiguous. Suppose the decoder is presented with 5 bytes.
Are they literals? It may seem that the decoder degenerates
to memcpy on short inputs. But of course the answer is no,
so the formula needs some clarification.
Parsing restrictions should be explained as well, otherwise they look
like arbitrary numbers. The 5-byte restriction has been mentioned
recently in connection with the shortcut in LZ4_decompress_generic,
so I add that. The second restriction is left to be explained
by the author.
I also took the liberty to explain that empty inputs "are either
unrepresentable or can be represented with a null byte". This wording
may actually have some merit: it leaves for the implementation,
as opposed to the spec, to decide whether the encoder can compress
empty inputs, and whether the decoder can produce an empty output
(which the implementation should further clarify).
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions