]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Merge remote-tracking branch 'refs/remotes/Cyan4973/v05x' into v05x
authorinikep <inikep@gmail.com>
Wed, 3 Feb 2016 16:29:40 +0000 (17:29 +0100)
committerinikep <inikep@gmail.com>
Wed, 3 Feb 2016 16:29:40 +0000 (17:29 +0100)
# Conflicts:
# lib/zstd_compress.c
# lib/zstd_static.h

1  2 
lib/zstd_compress.c
lib/zstd_decompress.c
lib/zstd_static.h

index 71ff02e7b93db231ff2882be4ed6999d66187182,f4ddb910fdfde9cce871e6d8226ed5c5db93443d..d88bac8ca20ce07df52d9ff84c77b440e370e1e8
@@@ -1997,9 -1980,8 +2002,8 @@@ static size_t ZSTD_compressContinue_int
      }
  
      /* preemptive overflow correction */
-     if (zc->lowLimit > (1<<30))
-     {
+     if (zc->lowLimit > (1<<30)) {
 -        U32 btplus = (zc->params.strategy == ZSTD_btlazy2);
 +        U32 btplus = (zc->params.strategy == ZSTD_btlazy2) || (zc->params.strategy == ZSTD_opt_bt);
          U32 contentMask = (1 << (zc->params.contentLog - btplus)) - 1;
          U32 newLowLimit = zc->lowLimit & contentMask;   /* preserve position % contentSize */
          U32 correction = zc->lowLimit - newLowLimit;
Simple merge
index 9997d67d9f48b798f244c774f5515666b9b895ac,4a36f1e8ad56d19e97a30951646844fd4bb30708..ad52b581930be58d70b7106dca6ac6e9c8b00abf
@@@ -82,6 -82,9 +82,9 @@@ typedef struc
  /* *************************************
  *  Advanced functions
  ***************************************/
 -#define ZSTD_MAX_CLEVEL 20
++#define ZSTD_MAX_CLEVEL 24
+ ZSTDLIB_API unsigned ZSTD_maxCLevel (void);
  /*! ZSTD_getParams
  *   @return ZSTD_parameters structure for a selected compression level and srcSize.
  *   @srcSizeHint value is optional, select 0 if not known */
@@@ -217,34 -203,26 +203,27 @@@ ZSTDLIB_API size_t ZSTD_decompressConti
  /* **************************************
  *  Block functions
  ****************************************/
- /*!Block functions produce and decode raw zstd blocks, without frame metadata.
-    Frame headers won't be generated.
-    User will have to save and regenerate fields required to regenerate data, such as block sizes.
-    A few rules to respect :
-    - Uncompressed block size must be <= 128 KB
-    - Compressing or decompressing requires a context structure
-      + Use ZSTD_createXCtx() to create them
-    - It is necessary to init context before starting
-      + compression : ZSTD_compressBegin()
-      + decompression : ZSTD_decompressBegin()
-      + variants _usingDict() are also allowed
-      + copyXCtx() works too
-    - When a block is considered not compressible enough, ZSTD_compressBlock() result will be zero.
-      In which case, nothing is produced into `dst`.
-      + User must test for such outcome and deal directly with uncompressed data
-      + ZSTD_decompressBlock() doesn't accept uncompressed data as input !!
+ /*! Block functions produce and decode raw zstd blocks, without frame metadata.
+     User will have to save and regenerate necessary information to regenerate data, such as block sizes.
+     A few rules to respect :
+     - Uncompressed block size must be <= 128 KB
+     - Compressing or decompressing requires a context structure
+       + Use ZSTD_createCCtx() and ZSTD_createDCtx()
+     - It is necessary to init context before starting
+       + compression : ZSTD_compressBegin()
+       + decompression : ZSTD_decompressBegin()
+       + variants _usingDict() are also allowed
+       + copyCCtx() and copyDCtx() work too
+     - When a block is considered not compressible enough, ZSTD_compressBlock() result will be zero.
+       In which case, nothing is produced into @dst.
+       + User must test for such outcome and deal directly with uncompressed data
+       + ZSTD_decompressBlock() doesn't accept uncompressed data as input !!
  */
  
- size_t ZSTD_compressBlock  (ZSTD_CCtx* cctx, void* dst, size_t maxDstSize, const void* src, size_t srcSize);
- size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* src, size_t srcSize);
 +
- /* *************************************
- *  Pre-defined compression levels
- ***************************************/
- #define ZSTD_MAX_CLEVEL 24
- ZSTDLIB_API unsigned ZSTD_maxCLevel (void);
+ size_t ZSTD_compressBlock  (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
+ size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
  
  
  /* *************************************