]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Clarify that there must be at least 2 weights, i.e. encoding all weights as 0 is...
authorelasota <1137273+elasota@users.noreply.github.com>
Thu, 9 Nov 2023 04:46:37 +0000 (23:46 -0500)
committerNick Terrell <nickrterrell@gmail.com>
Fri, 24 Nov 2023 21:49:40 +0000 (16:49 -0500)
doc/zstd_compression_format.md

index dbf409eac888e3156b460b2faaa7bc72cfb5e482..4a8d338b7a6a9bf62023cce1f5bac393038a180f 100644 (file)
@@ -1252,7 +1252,9 @@ Number_of_Bits = Weight ? (Max_Number_of_Bits + 1 - Weight) : 0
 ```
 When a literal value is not present, it receives a `Weight` of 0.
 The least frequent symbol receives a `Weight` of 1.
-If no symbol has a `Weight` of 1, then the data is considered corrupted.
+If no literal has a `Weight` of 1, then the data is considered corrupted.
+If there are not at least two literals with non-zero `Weight`, then the data
+is considered corrupted.
 The most frequent symbol receives a `Weight` anywhere between 1 and 11 (max).
 The last symbol's `Weight` is deduced from previously retrieved Weights,
 by completing to the nearest power of 2. It's necessarily non 0.