]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
minor doc update
authorYann Collet <yann.collet.73@gmail.com>
Mon, 16 Dec 2024 07:07:31 +0000 (23:07 -0800)
committerYann Collet <cyan@fb.com>
Fri, 20 Dec 2024 18:36:59 +0000 (10:36 -0800)
lib/zstd.h
tests/fullbench.c

index 435fe34d4332974b241590e39322d1d656a8fe4f..6218a5d0cca3e928821f765883d57072404212ee 100644 (file)
@@ -1665,13 +1665,14 @@ ZSTD_compressSequences(ZSTD_CCtx* cctx,
  * aka all literals already extracted and laid out into a single continuous buffer.
  * This can be useful if the process generating the sequences also happens to generate the buffer of literals,
  * thus skipping an extraction + caching stage.
- * It's essentially a speed optimization when the right conditions are met,
+ * It's merely a speed optimization when the right conditions are met,
  * but it also features the following limitations:
  * - Only supports explicit delimiter mode
  * - Supports 1 block only (max input 128 KB)
  * - Not compatible with frame checksum, which must disabled
  * - Can fail (return an error) when input data cannot be compress sufficiently
- * Also, to be valid, @litSize must be equal to the sum of all @.litLength fields in @inSeqs.
+ * - @litSize must be == sum of all @.litLength fields in @inSeqs. Discrepancy will generate an error.
+ * - the buffer @literals must be larger than @litSize by at least 8 bytes.
  * @return : final compressed size, or a ZSTD error code.
  */
 ZSTDLIB_STATIC_API size_t
@@ -2301,9 +2302,12 @@ ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const vo
 #define ZSTD_c_maxBlockSize ZSTD_c_experimentalParam18
 
 /* ZSTD_c_searchForExternalRepcodes
+ * Note: for now, this param only has an effect if ZSTD_c_blockDelimiters is
+ * set to ZSTD_sf_explicitBlockDelimiters. That may change in the future.
+ *
  * This parameter affects how zstd parses external sequences, such as sequences
- * provided through the compressSequences() API or from an external block-level
- * sequence producer.
+ * provided through compressSequences() and variant API
+ * or from an external block-level sequence producer.
  *
  * If set to ZSTD_ps_enable, the library will check for repeated offsets in
  * external sequences, even if those repcodes are not explicitly indicated in
@@ -2317,10 +2321,7 @@ ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const vo
  * compression ratio.
  *
  * The default value is ZSTD_ps_auto, for which the library will enable/disable
- * based on compression level.
- *
- * Note: for now, this param only has an effect if ZSTD_c_blockDelimiters is
- * set to ZSTD_sf_explicitBlockDelimiters. That may change in the future.
+ * based on compression level (currently: level<10 disables, level>=10 enables).
  */
 #define ZSTD_c_searchForExternalRepcodes ZSTD_c_experimentalParam19
 
index 919ae2742da87ed0a51a907bffd64c2298040c0c..09c42615482fe9007925b6af2ccceebc8d0b75ea 100644 (file)
@@ -617,6 +617,9 @@ local_compressSequencesAndLiterals(const void* input, size_t inputSize,
     const void* literals = (ip+=nbSeqs * sizeof(ZSTD_Sequence));
     ZSTD_CCtx_reset(g_zcc, ZSTD_reset_session_and_parameters);
     ZSTD_CCtx_setParameter(g_zcc, ZSTD_c_blockDelimiters, ZSTD_sf_explicitBlockDelimiters);
+# if 0 /* for tests */
+    ZSTD_CCtx_setParameter(g_zcc, ZSTD_c_searchForExternalRepcodes, ZSTD_ps_enable);
+#endif
     assert(8 + nbSeqs * sizeof(ZSTD_Sequence) + nbLiterals == inputSize); (void)inputSize;
     (void)payload;