]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added code comment on how to generate default tables
authorYann Collet <cyan@fb.com>
Tue, 13 Feb 2018 18:02:25 +0000 (10:02 -0800)
committerYann Collet <cyan@fb.com>
Tue, 13 Feb 2018 18:02:25 +0000 (10:02 -0800)
as suggested by @terrelln

lib/decompress/zstd_decompress.c

index d65dd5fd91fb1d488e198a20a8775511bd4c9eb8..36dfc6376268553cbbe8873741e69f506e6f56b1 100644 (file)
@@ -667,6 +667,15 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
     }
 }
 
+/* Default FSE distribution tables.
+ * These are pre-calculated FSE decoding tables using default distributions as defined in specification :
+ * https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#default-distributions
+ * They were generated programmatically with following method :
+ * - start from default distributions, present in /lib/common/zstd_internal.h
+ * - generate tables normally, using ZSTD_buildFSETable()
+ * - printout the content of tables
+ * - pretify output, report below, test with fuzzer to ensure it's correct */
+
 /* Default FSE distribution table for Literal Lengths */
 static const ZSTD_seqSymbol LL_defaultDTable[(1<<LL_DEFAULTNORMLOG)+1] = {
      {  1,  1,  1, LL_DEFAULTNORMLOG},  /* header : fastMode, tableLog */