summaryrefslogtreecommitdiffstats
path: root/lib/lz4frame.h
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2019-04-11 22:43:40 (GMT)
committerGitHub <noreply@github.com>2019-04-11 22:43:40 (GMT)
commit780aac520b69d6369f4e3995624c37e56d75498d (patch)
tree7b192662cba336b688b23ea04fcd6f48cbb3fc48 /lib/lz4frame.h
parent723ba904e2393c69d01f6730bd8b4171e6182845 (diff)
parentbcb26565a732062759a2428e167e27ad3c2f6e96 (diff)
downloadlz4-780aac520b69d6369f4e3995624c37e56d75498d.zip
lz4-780aac520b69d6369f4e3995624c37e56d75498d.tar.gz
lz4-780aac520b69d6369f4e3995624c37e56d75498d.tar.bz2
Merge pull request #665 from lz4/dict
Dictionary compression
Diffstat (limited to 'lib/lz4frame.h')
-rw-r--r--lib/lz4frame.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h
index 2ada8b8..5c68628 100644
--- a/lib/lz4frame.h
+++ b/lib/lz4frame.h
@@ -524,10 +524,28 @@ LZ4FLIB_STATIC_API size_t LZ4F_getBlockSize(unsigned);
/**********************************
* Bulk processing dictionary API
*********************************/
+
+/* A Dictionary is useful for the compression of small messages (KB range).
+ * It dramatically improves compression efficiency.
+ *
+ * LZ4 can ingest any input as dictionary, though only the last 64 KB are useful.
+ * Best results are generally achieved by using Zstandard's Dictionary Builder
+ * to generate a high-quality dictionary from a set of samples.
+ *
+ * Loading a dictionary has a cost, since it involves construction of tables.
+ * The Bulk processing dictionary API makes it possible to share this cost
+ * over an arbitrary number of compression jobs, even concurrently,
+ * markedly improving compression latency for these cases.
+ *
+ * The same dictionary will have to be used on the decompression side
+ * for decoding to be successful.
+ * To help identify the correct dictionary at decoding stage,
+ * the frame header allows optional embedding of a dictID field.
+ */
typedef struct LZ4F_CDict_s LZ4F_CDict;
/*! LZ4_createCDict() :
- * When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once.
+ * When compressing multiple messages / blocks using the same dictionary, it's recommended to load it just once.
* LZ4_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay.
* LZ4_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only.
* `dictBuffer` can be released after LZ4_CDict creation, since its content is copied within CDict */