Lines Matching +full:1 +full:br +full:- +full:100

3 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
18 <li><a href="#Chapter8">Streaming compression - HowTo</a></li>
19 <li><a href="#Chapter9">Streaming decompression - HowTo</a></li>
30 <li><a href="#Chapter20">Buffer-less and synchronous inner streaming functions</a></li>
31 <li><a href="#Chapter21">Buffer-less streaming compression (synchronous mode)</a></li>
32 <li><a href="#Chapter22">Buffer-less streaming decompression (synchronous mode)</a></li>
38 real-time compression scenarios at zlib-level and better compression ratios.
39 The zstd compression library provides in-memory compression and decompression
42 The library supports regular compression levels from 1 up to ZSTD_maxCLevel(),
43 which is currently 22. Levels >= 20, labeled `--ultra`, should be used with
49 - a single step (described as Simple API)
50 - a single step, reusing a context (described as Explicit context)
51 - unbounded multiple steps (described as Streaming compression)
55 - a single step (described as Simple dictionary API)
56 - a single step, reusing a dictionary (described as Bulk-processing
62 Advanced experimental APIs should never be used with a dynamically-linked
65 <BR></pre>
70 </b><p> Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE).
71 </p></pre><BR>
75 </p></pre><BR>
86 </p></pre><BR>
95 </p></pre><BR>
97 <pre><b>#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
98 #define ZSTD_CONTENTSIZE_ERROR (0ULL - 2)
103 @return : - decompressed size of `src` frame content, if known
104 - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined
105- ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)
106 note 1 : a 0 return value means the frame is valid but "empty".
113 …note 3 : decompressed size is always present when compression is completed using single-pass funct…
115 note 4 : decompressed size can be very large (64-bits value),
122 </p></pre><BR>
130 </p></pre><BR>
138 </p></pre><BR>
140 …ize) ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) </…
141 …essBound(size_t srcSize); </b>/*!< maximum compressed size in worst case single-pass scenario */<b>
147 </pre></b><BR>
152 and re-use it for each successive compression operation.
154 Note : re-using context is just a speed / resource optimization.
156 Note 2 : In multi-threaded environments,
162 </pre></b><BR>
174 </p></pre><BR>
178 and re-use it for each successive compression operation.
184 </pre></b><BR>
192 </p></pre><BR>
196 <pre><b>typedef enum { ZSTD_fast=1,
208 </b></pre><BR>
214 * See ZSTD_CCtx_refCDict() for more info (superseded-by-cdict). */
215 …ZSTD_c_compressionLevel=100, </b>/* Set compression parameters according to pre-defined cLevel tab…
220 * Note 1 : it's possible to pass a negative compression level.
228 …ZSTD_c_windowLog=101, </b>/* Maximum allowed back-reference distance, expressed as power of 2.<…
237 * Resulting memory usage is (1 << (hashLog+2)).
242 ZSTD_c_chainLog=103, </b>/* Size of the multi-probe search table, as a power of 2.<b>
243 * Resulting memory usage is (1 << (chainLog+2)).
287 * default: windowlog - 7.
298 … * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
299 … * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
305 …SizeFlag=200, </b>/* Content size will be written into frame header _whenever known_ (default:1)<b>
309 …ZSTD_c_checksumFlag=201, </b>/* A 32-bits checksum of content is written at end of frame (default:…
310 …DFlag=202, </b>/* When applicable, dictionary's ID is written into frame header (default:1) */<b>
312 </b>/* multi-threading parameters */<b>
313 …</b>/* These parameters are only active if multi-threading is enabled (compiled with build macro Z…
314 … * Otherwise, trying to set any other value than default (0) will be a no-op and return an error.
315 * In a situation where it's unknown if the linked library supports multi-threading or not,
316 …* setting ZSTD_c_nbWorkers to any value >= 1 and consulting the return value provides a quick way …
319 … * When nbWorkers >= 1, triggers asynchronous mode when invoking ZSTD_compressStream*() :
325 … * Default value is `0`, aka "single-threaded mode" : no worker is spawned,
327 …ize=401, </b>/* Size of a compression job. This value is enforced only when nbWorkers >= 1.<b>
335 * This value is enforced only when nbWorkers >= 1.
338 … * - 0 means "default" : value will be determined by the library, depending on strategy
339 * - 1 means "no overlap"
340 * - 9 means "full overlap", using a full window size.
342 …l window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:no overlap; 0:defau…
382 </b></pre><BR>
388 </b></pre><BR>
393 - an error status field, which must be tested using ZSTD_isError()
394 - lower and upper bounds, both inclusive
396 </p></pre><BR>
403 Exception : when using multi-threading mode (nbWorkers >= 1),
409 </p></pre><BR>
416 Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame.
426 </p></pre><BR>
429 ZSTD_reset_session_only = 1,
433 </b></pre><BR>
436 - The session : will stop compressing current frame, and make CCtx ready to start a new one.
442 - The parameters : changes all parameters back to "default".
446 - Both : similar to resetting the session, followed by resetting parameters.
448 </p></pre><BR>
456 - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()
457 - The function is always blocking, returns when compression is completed.
462 </p></pre><BR>
468 ZSTD_d_windowLogMax=100, </b>/* Select a size limit (in power of 2) beyond which<b>
471 …ameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.
472 … * By default, a decompression context accepts window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT).
491 </b></pre><BR>
496 - an error status field, which must be tested using ZSTD_isError()
497 - both lower and upper bounds, inclusive
499 </p></pre><BR>
508 </p></pre><BR>
516 </p></pre><BR>
525 </b></pre><BR>
531 </b></pre><BR>
532 <a name="Chapter8"></a><h2>Streaming compression - HowTo</h2><pre>
536 …It is recommended to re-use ZSTD_CStream since it will play nicer with system's memory, by re-usin…
543 it will re-use the same sticky parameters as previous compression session.
566 using ZSTD_compressStream2() with ZSTD_e_flush. `output->pos` will be updated.
567 …Note that, if `output->size` is too small, a single invocation with ZSTD_e_flush might not be enou…
590 <BR></pre>
593 </b></pre><BR>
596 </pre></b><BR>
599 ZSTD_e_flush=1, </b>/* flush any data provided so far,<b>
609 </pre></b><BR>
615 - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()
616- Compression parameters cannot be changed once compression is started (save a list of exceptions …
617 - output->pos must be <= dstCapacity, input->pos must be <= srcSize
618- output->pos and input->pos will be updated. They are guaranteed to remain below their respective…
619 - endOp must be a valid directive
620- When nbWorkers==0 (default), function is blocking : it completes its job before returning to cal…
621- When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to …
623 …theless guarantees forward progress : it will return only after it reads or write at least 1+ byte.
624- Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, t…
625 - @return provides a minimum amount of data remaining to be flushed from internal buffers
630 - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),
635 </p></pre><BR>
638 </b></pre><BR>
640 </b></pre><BR>
645 * the next read size (if non-zero and not an error). ZSTD_compressStream2()
646 * returns the minimum nb of bytes left to flush (if non-zero and not an error).
658 </p></pre><BR>
660 <a name="Chapter9"></a><h2>Streaming decompression - HowTo</h2><pre>
663 ZSTD_DStream objects can be re-used multiple times.
684 <BR></pre>
687 </b></pre><BR>
690 </pre></b><BR>
691 <h3>Streaming decompression functions</h3><pre></pre><b><pre></pre></b><BR>
693 </b></pre><BR>
695 </b></pre><BR>
709 </p></pre><BR>
720 </p></pre><BR>
730 …Dict can be created once and shared by multiple threads concurrently, since its usage is read-only.
732 …Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not dupl…
737 </p></pre><BR>
742 </p></pre><BR>
752 </p></pre><BR>
757 </p></pre><BR>
762 </p></pre><BR>
770 </p></pre><BR>
777 It can still be loaded, but as a content-only dictionary.
778 </p></pre><BR>
783 Non-conformant dictionaries can still be loaded, but as content-only dictionaries.
784 </p></pre><BR>
789 Non-conformant dictionaries can still be loaded, but as content-only dictionaries.
790 </p></pre><BR>
796 - The frame does not require a dictionary to be decoded (most common case).
797- The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hid…
798 Note : this use case also happens when using a non-conformant dictionary.
799- `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if…
800 - This is not a Zstandard frame.
802 </p></pre><BR>
808 ZSTD_reset_session_and_parameters. Prefixes are single-use.
809 <BR></pre>
815 Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,
816 meaning "return to no-dictionary mode".
817 Note 1 : Dictionary is sticky, it will be used for all future compressed frames.
818 To return to "no-dictionary" situation, load a NULL dictionary (or reset parameters).
820 It's also a CPU consuming operation, with non-negligible impact on latency.
828 </p></pre><BR>
834 The parameters ignored are labelled as "superseded-by-cdict" in the ZSTD_cParameter enum docs.
835 The ignored parameters will be used again if the CCtx is returned to no-dictionary mode.
838 Special : Referencing a NULL CDict means "return to no-dictionary mode".
839 Note 1 : Currently, only one dictionary can be managed.
842 </p></pre><BR>
846 </b><p> Reference a prefix (single-usage dictionary) for next compressed frame.
853 Note 1 : Prefix buffer is referenced. It **must** outlive compression.
859 It's a CPU consuming operation, with non-negligible impact on latency.
863 </p></pre><BR>
870 Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,
871 meaning "return to no-dictionary mode".
872 Note 1 : Loading a dictionary involves building tables,
873 which has a non-negligible impact on CPU usage and latency.
880 </p></pre><BR>
893 Note 1 : Currently, only one dictionary can be managed.
895 Special: referencing a NULL DDict means "return to no-dictionary mode".
898 </p></pre><BR>
902 </b><p> Reference a prefix (single-usage dictionary) to decompress next frame.
908 Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary
917 </p></pre><BR>
927 </p></pre><BR>
936 <BR></pre>
960 * rep == 1 --> offset == repeat_offset_1
961 * rep == 2 --> offset == repeat_offset_2
962 * rep == 3 --> offset == repeat_offset_3
964 * rep == 1 --> offset == repeat_offset_2
965 * rep == 2 --> offset == repeat_offset_3
966 * rep == 3 --> offset == repeat_offset_1 - 1
974 </b></pre><BR>
984 </b></pre><BR>
986 int contentSizeFlag; </b>/**< 1: content size will be in frame header (when known) */<b>
987 …int checksumFlag; </b>/**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame…
988 …int noDictIDFlag; </b>/**< 1: no dictID will be saved into frame header (dictID is only useful …
990 </b></pre><BR>
995 </b></pre><BR>
998 …ZSTD_dct_rawContent = 1, </b>/* ensures dictionary is always loaded as rawContent, even if it star…
1001 </b></pre><BR>
1004 …ZSTD_dlm_byRef = 1 </b>/**< Reference dictionary content -- the dictionary buffer must outlive …
1006 </b></pre><BR>
1009 …ZSTD_f_zstd1_magicless = 1 </b>/* Variant of zstd frame format, without initial 4-bytes magic num…
1013 </b></pre><BR>
1017 ZSTD_d_ignoreChecksum = 1
1019 </b></pre><BR>
1023 ZSTD_rmd_refMultipleDDicts = 1
1025 </b></pre><BR>
1034 * - The contents of the CDict can be copied into the working context. This
1037 * the compression faster per-byte of input. However, the initial copy of
1042 * - The CDict's tables can be used in-place. In this model, compression is
1044 * tables. However, this model incurs no start-up cost (as long as the
1048 * - The CDict's tables are not used at all, and instead we use the working
1060 ZSTD_dictForceAttach = 1, </b>/* Never copy the dictionary. */<b>
1064 </b></pre><BR>
1069 …ZSTD_lcm_huffman = 1, </b>/**< Always attempt Huffman compression. Uncompressed literals wil…
1073 </b></pre><BR>
1080 ZSTD_ps_enable = 1, </b>/* Force-enable the feature */<b>
1083 </b></pre><BR>
1090 @return : - decompressed size of all data in all successive frames
1091 - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN
1092 - if an error occurred: ZSTD_CONTENTSIZE_ERROR
1094 …note 1 : decompressed size is an optional field, that may not be present, especially in streaming …
1098 note 3 : decompressed size can be very large (64-bits value),
1107 </p></pre><BR>
1113 @return : - upper-bound for the decompressed size of all data in all successive frames
1114 - if an error occurred: ZSTD_CONTENTSIZE_ERROR
1116 note 1 : an error can occur if `src` contains an invalid or incorrectly formatted frame.
1117 …note 2 : the upper-bound is exact when the decompressed size field is available in every ZSTD enc…
1119 …note 3 : when the decompressed size field isn't available, the upper-bound for that frame is calc…
1120 upper-bound = # blocks * min(128 KB, Window_Size)
1122 </p></pre><BR>
1128 </p></pre><BR>
1132 …ZSTD_sf_explicitBlockDelimiters = 1 </b>/* Representation of ZSTD_Sequence contains explicit bl…
1134 </b></pre><BR>
1149 </p></pre><BR>
1162 </p></pre><BR>
1180 …behavior. If ZSTD_c_validateSequences == 1, then if sequence is invalid (see doc/zstd_compression_…
1184- ZSTD_c_minMatch MUST be set as less than or equal to the smallest match generated by the match f…
1185- ZSTD_c_compressionLevel accordingly adjusts the strength of the entropy coder, as it would in ty…
1186- ZSTD_c_windowLog affects offset validation: this function will return an error at higher debug l…
1189 …Note: Repcodes are, as of now, always re-calculated within this function, so ZSTD_Sequence::rep is…
1194 </p></pre><BR>
1200 Skippable frames begin with a a 4-byte magic number. There are 16 possible choices of magic number,
1206 …with a 4-byte unsigned int, or if the parameter magicVariant is greater than 15 (and therefore inv…
1210 </p></pre><BR>
1217 i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. This can be NULL if the caller is not interested
1224 </p></pre><BR>
1229 </p></pre><BR>
1244 Therefore, the estimation is only guaranteed for single-shot compressions, not streaming.
1256 Note 2 : only single-threaded compression is supported.
1257 ZSTD_estimateCCtxSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1.
1259 </p></pre><BR>
1270 …tParameter(). Only single-threaded compression is supported. This function will return an error co…
1271 Note : CStream size estimation is only correct for single-threaded compression.
1278 </p></pre><BR>
1287 </p></pre><BR>
1291 </b><p> Initialize an object using a pre-allocated fixed-size buffer.
1293 Provided pointer *must be 8-bytes aligned*.
1306 Limitation 1 : currently not compatible with internal dictionary creation, triggered by
1308 Limitation 2 : static cctx currently not compatible with multi-threading.
1311 </p></pre><BR>
1314 </b></pre><BR>
1327 </p></pre><BR>
1342 </p></pre><BR>
1352 </p></pre><BR>
1357 </p></pre><BR>
1360 </b><p> same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-comp…
1361 All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0
1362 </p></pre><BR>
1367 </p></pre><BR>
1375 </p></pre><BR>
1386 </p></pre><BR>
1397 </p></pre><BR>
1402 </p></pre><BR>
1408 </p></pre><BR>
1413 </p></pre><BR>
1420 </p></pre><BR>
1425 - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure
1426 - ZSTD_CCtxParams_setParameter() : Push parameters one by one into
1430 - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to
1434 - ZSTD_compressStream2() : Do compression using the CCtx.
1435 - ZSTD_freeCCtxParams() : Free the memory, accept NULL pointer.
1438 for static allocation of CCtx for single-threaded compression.
1440 </p></pre><BR>
1445 </p></pre><BR>
1451 </p></pre><BR>
1457 </p></pre><BR>
1467 </p></pre><BR>
1474 </p></pre><BR>
1481 if nbWorkers>=1, new parameters will be picked up at next job,
1484 </p></pre><BR>
1496 </p></pre><BR>
1505 </p></pre><BR>
1512 </p></pre><BR>
1519 </p></pre><BR>
1526 </p></pre><BR>
1531 </p></pre><BR>
1536 …This parameter is only useful in streaming mode, since no internal buffer is allocated in single-p…
1537 …By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT)
1540 </p></pre><BR>
1547 </p></pre><BR>
1553 This instruction is mandatory to decode data without a fully-formed header,
1556 </p></pre><BR>
1567 </p></pre><BR>
1572 <BR></pre>
1574 <h3>Advanced Streaming compression functions</h3><pre></pre><b><pre></pre></b><BR>
1590 </p></pre><BR>
1607 </p></pre><BR>
1616 // Pseudocode: Set each zstd parameter and leave the rest as-is.
1628 </p></pre><BR>
1639 </p></pre><BR>
1648 // Pseudocode: Set each zstd frame parameter and leave the rest as-is.
1660 </p></pre><BR>
1672 This is typically useful to skip dictionary loading stage, since it will re-use it in-place.
1681 </p></pre><BR>
1691 </b></pre><BR>
1694 Useful for multithreading scenarios (nbWorkers >= 1).
1705 </p></pre><BR>
1707 <h3>Advanced Streaming decompression functions</h3><pre></pre><b><pre></pre></b><BR>
1716 </p></pre><BR>
1726 </p></pre><BR>
1732 re-use decompression parameters from previous init; saves dictionary loading
1735 </p></pre><BR>
1737 <a name="Chapter20"></a><h2>Buffer-less and synchronous inner streaming functions</h2><pre>
1742 <BR></pre>
1744 <a name="Chapter21"></a><h2>Buffer-less streaming compression (synchronous mode)</h2><pre>
1747 ZSTD_CCtx object can be re-used multiple times within successive compression operations.
1755 - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only.
1756 - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks.
1757- Caller must ensure there is enough space in `dst` to store compressed data under worst case scen…
1760- ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to max…
1762- ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps.
1769 `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress again.
1770 <BR></pre>
1772 <h3>Buffer-less streaming compression functions</h3><pre></pre><b><pre>ZSTDLIB_STATIC_API size_t ZS…
1776 </pre></b><BR>
1778 </b></pre><BR>
1779 <a name="Chapter22"></a><h2>Buffer-less streaming decompression (synchronous mode)</h2><pre>
1782 A ZSTD_DCtx object can be re-used multiple times.
1793 such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`).
1803 …or that previous contiguous segment is large enough to properly handle maximum back-reference dist…
1808 …which can @return an error code if required value is too large for current system (in 32-bits mode…
1818 as long as the encoder and decoder progress in "lock-step",
1840 Skippable frames allow integration of user-defined data into a flow of concatenated frames.
1843 a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F
1844 b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits
1845 c) Frame Content - any content (User Data) of length equal to Frame Size
1846 For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame.
1848 <BR></pre>
1850 <h3>Buffer-less streaming decompression functions</h3><pre></pre><b><pre>typedef enum { ZSTD_frame,…
1860 </pre></b><BR>
1871 </p></pre><BR>
1874 </b></pre><BR>
1877 …e metadata cost is typically ~12 bytes, which can be non-negligible for very small blocks (< 100 b…
1881 - Compressing and decompressing require a context structure
1883 - It is necessary to init context before starting
1887 - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB
1891- When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero)…
1900 </p></pre><BR>
1905 …); </b>/**< insert uncompressed block into `dctx` history. Useful for multi-blocks decompression.…
1906 </pre></b><BR>