]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Merge branch 'dev' into hufCompress 1047/head
authorYann Collet <cyan@fb.com>
Wed, 14 Mar 2018 23:11:25 +0000 (16:11 -0700)
committerYann Collet <cyan@fb.com>
Wed, 14 Mar 2018 23:11:25 +0000 (16:11 -0700)
1  2 
lib/compress/zstd_compress.c
lib/decompress/huf_decompress.c

index b7f4f7811420e01947549084fdfb49fe999853ce,c461fa44353f56258c4121823eaefae22373af29..1431de2388047a07119dd20c3024d741386c8cd2
@@@ -1393,10 -1407,14 +1407,13 @@@ static size_t ZSTD_compressLiterals (ZS
      memcpy(nextEntropy->hufCTable, prevEntropy->hufCTable,
             sizeof(prevEntropy->hufCTable));
  
+     if (disableLiteralCompression)
+         return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
      /* small ? don't even attempt compression (speed opt) */
 -#   define LITERAL_NOENTROPY 63
 -    {   size_t const minLitSize = (prevEntropy->hufCTable_repeatMode == HUF_repeat_valid) ? 6 : LITERAL_NOENTROPY;
 -        if (srcSize <= minLitSize)
 -            return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
 +#   define COMPRESS_LITERALS_SIZE_MIN 63
 +    {   size_t const minLitSize = (prevEntropy->hufCTable_repeatMode == HUF_repeat_valid) ? 6 : COMPRESS_LITERALS_SIZE_MIN;
 +        if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
      }
  
      if (dstCapacity < lhSize+1) return ERROR(dstSize_tooSmall);   /* not enough space for compression */
Simple merge