1
0
mirror of https://github.com/facebook/zstd.git synced 2025-12-24 17:21:03 +03:00

Clarify special case of offset history update

If the current sequence has literal length of zero then an offset value
of three is handled in a special manner. While I implemented a golang
decoder I had to consult the educational decoder for clarification on
the update of the offset history in that case. This commit provides the
clarification that the offset value Repeated_Offset1-1 is handled as a
new offset is added to the offset history accordingly.
This commit is contained in:
Ulrich Kunitz
2018-10-22 23:46:43 +02:00
parent ca46afd72b
commit c7942caff0

View File

@@ -919,6 +919,10 @@ This means that when `Repeated_Offset1` (most recent) is used, history is unmodi
When `Repeated_Offset2` is used, it's swapped with `Repeated_Offset1`.
If any other offset is used, it becomes `Repeated_Offset1` and the rest are shift back by one.
In the case of an `offset_value` of 3 and the literal length of the current
sequence is zero the value `Repeasted_Offset1 - 1_byte` is a new offset,
becoming the lead of the offset history and the first two repeated offsets will
be shifted back.
Skippable Frames
----------------