From: Ulrich Kunitz Date: Mon, 22 Oct 2018 21:46:43 +0000 (+0200) Subject: Clarify special case of offset history update X-Git-Tag: v1.3.8~68^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7942caff083f8c76085208c8a34812c337ad820;p=thirdparty%2Fzstd.git 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. --- diff --git a/doc/zstd_compression_format.md b/doc/zstd_compression_format.md index e562e628b..eacf76252 100644 --- a/doc/zstd_compression_format.md +++ b/doc/zstd_compression_format.md @@ -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 ----------------