]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Clarify special case of offset history update
authorUlrich Kunitz <ulikunitz@users.noreply.github.com>
Mon, 22 Oct 2018 21:46:43 +0000 (23:46 +0200)
committerUlrich Kunitz <ulikunitz@users.noreply.github.com>
Mon, 22 Oct 2018 21:46:43 +0000 (23:46 +0200)
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.

doc/zstd_compression_format.md

index e562e628bc9ceec8e56da9d8be44dac2e49a406b..eacf762529e216d1da8ac447f39c34cac06946fa 100644 (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
 ----------------