]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
update documentation for decompressBound 1543/head
authorshakeelrao <shakeelrao79@gmail.com>
Sun, 3 Mar 2019 01:56:10 +0000 (17:56 -0800)
committershakeelrao <shakeelrao79@gmail.com>
Sun, 3 Mar 2019 01:56:10 +0000 (17:56 -0800)
lib/zstd.h

index 182ff376c7a1e0452f6e7700537e74c3cbeefe6a..a29c9669a11c95160dfd134442336ecbc77cd160 100644 (file)
@@ -1081,9 +1081,9 @@ typedef enum {
 ***************************************/
 
 /*! ZSTD_findDecompressedSize() :
- *  `src` should point the start of a series of ZSTD encoded and/or skippable frames
+ *  `src` should point to the start of a series of ZSTD encoded and/or skippable frames
  *  `srcSize` must be the _exact_ size of this series
- *       (i.e. there should be a frame boundary exactly at `srcSize` bytes after `src`)
+ *       (i.e. there should be a frame boundary at `src + srcSize`)
  *  @return : - decompressed size of all data in all successive frames
  *            - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN
  *            - if an error occurred: ZSTD_CONTENTSIZE_ERROR
@@ -1104,17 +1104,17 @@ typedef enum {
 ZSTDLIB_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
 
 /** ZSTD_decompressBound() :
- *  `src` should point the start of a series of ZSTD encoded and/or skippable frames
+ *  `src` should point to the start of a series of ZSTD encoded and/or skippable frames
  *  `srcSize` must be the _exact_ size of this series
- *       (i.e. there should be a frame boundary exactly at `srcSize` bytes after `src`)
- *  @return : - the maximum decompressed size of the compressed source
+ *       (i.e. there should be a frame boundary at `src + srcSize`)
+ *  @return : - upper-bound for the decompressed size of all data in all successive frames
  *            - if an error occured: ZSTD_CONTENTSIZE_ERROR
  *
- *  note 1  : an error can occur if `src` points to a legacy frame or an invalid/incorrectly formatted frame.
- *  note 2  : the bound is exact when Frame_Content_Size field is available in _every_ frame of `src`.
- *  note 3  : when Frame_Content_Size isn't provided, the upper-bound for that frame is calculated by:
+ *  note 1  : an error can occur if `src` contains a legacy frame or an invalid/incorrectly formatted frame.
+ *  note 2  : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`.
+ *            in this case, `ZSTD_findDecompressedSize` and `ZSTD_decompressBound` return the same value.
+ *  note 3  : when the decompressed size field isn't available, the upper-bound for that frame is calculated by:
  *              upper-bound = # blocks * min(128 KB, Window_Size)
- *  note 4  : we always use Frame_Content_Size to bound the decompressed frame size if it's present.
  */
 ZSTDLIB_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcSice);