!48 Fix entropy repeat mode bug
Merge pull request !48 from 一去_二三里/master
This commit is contained in:
commit
f975b92392
@ -0,0 +1,53 @@
|
||||
From 923e5ad3f5573cd68f792ebad49c24ecaa0c3ad0 Mon Sep 17 00:00:00 2001
|
||||
From: Sen Huang <senhuang96@fb.com>
|
||||
Date: Mon, 7 Jun 2021 00:32:03 -0700
|
||||
Subject: [PATCH 0721/1000] Fix entropy repeat mode bug
|
||||
|
||||
---
|
||||
lib/compress/zstd_compress.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c
|
||||
index 6afecfa1..dafe3cbd 100644
|
||||
--- a/lib/compress/zstd_compress.c
|
||||
+++ b/lib/compress/zstd_compress.c
|
||||
@@ -3332,6 +3332,7 @@ static size_t ZSTD_estimateBlockSize(const BYTE* literals, size_t litSize,
|
||||
*/
|
||||
static size_t ZSTD_buildEntropyStatisticsAndEstimateSubBlockSize(seqStore_t* seqStore, const ZSTD_CCtx* zc) {
|
||||
ZSTD_entropyCTablesMetadata_t entropyMetadata;
|
||||
+ DEBUGLOG(6, "ZSTD_buildEntropyStatisticsAndEstimateSubBlockSize()");
|
||||
FORWARD_IF_ERROR(ZSTD_buildBlockEntropyStats(seqStore,
|
||||
&zc->blockState.prevCBlock->entropy,
|
||||
&zc->blockState.nextCBlock->entropy,
|
||||
@@ -3510,9 +3511,6 @@ static size_t ZSTD_compressSeqStore_singleBlock(ZSTD_CCtx* zc, seqStore_t* const
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if (zc->blockState.prevCBlock->entropy.fse.offcode_repeatMode == FSE_repeat_valid)
|
||||
- zc->blockState.prevCBlock->entropy.fse.offcode_repeatMode = FSE_repeat_check;
|
||||
-
|
||||
if (cSeqsSize == 0) {
|
||||
cSize = ZSTD_noCompressBlock(op, dstCapacity, ip, srcSize, lastBlock);
|
||||
FORWARD_IF_ERROR(cSize, "Nocompress block failed");
|
||||
@@ -3529,6 +3527,10 @@ static size_t ZSTD_compressSeqStore_singleBlock(ZSTD_CCtx* zc, seqStore_t* const
|
||||
cSize = ZSTD_blockHeaderSize + cSeqsSize;
|
||||
DEBUGLOG(4, "Writing out compressed block, size: %zu", cSize);
|
||||
}
|
||||
+
|
||||
+ if (zc->blockState.prevCBlock->entropy.fse.offcode_repeatMode == FSE_repeat_valid)
|
||||
+ zc->blockState.prevCBlock->entropy.fse.offcode_repeatMode = FSE_repeat_check;
|
||||
+
|
||||
return cSize;
|
||||
}
|
||||
|
||||
@@ -3564,6 +3566,7 @@ static void ZSTD_deriveBlockSplitsHelper(seqStoreSplits* splits, size_t startIdx
|
||||
size_t midIdx = (startIdx + endIdx)/2;
|
||||
|
||||
if (endIdx - startIdx < MIN_SEQUENCES_BLOCK_SPLITTING || splits->idx >= MAX_NB_SPLITS) {
|
||||
+ DEBUGLOG(6, "ZSTD_deriveBlockSplitsHelper: Too few sequences");
|
||||
return;
|
||||
}
|
||||
ZSTD_deriveSeqStoreChunk(&fullSeqStoreChunk, origSeqStore, startIdx, endIdx);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Name: zstd
|
||||
Version: 1.5.0
|
||||
Release: 12
|
||||
Release: 13
|
||||
Summary: A fast lossless compression algorithm
|
||||
License: BSD and GPLv2
|
||||
URL: https://github.com/facebook/zstd
|
||||
@ -17,6 +17,7 @@ Patch6: backport-zstd-1.5.0-patch-6-fix-a-determinism-bug-with-the-DUBT
|
||||
Patch7: patch-7-add-test-case.patch
|
||||
Patch8: patch-8-fix-extra-newline-gets-printes-out-when-compressing-multiple-files.patch
|
||||
Patch9: patch-9-add-test-c-result-print.patch
|
||||
Patch10: backport-zstd-1.5.0-patch-10-fix-entropy-repeat-mode-bug.patch
|
||||
|
||||
BuildRequires: gtest-devel gcc-c++ pkg-config
|
||||
|
||||
@ -95,6 +96,9 @@ install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1
|
||||
%{_mandir}/man1/*.1*
|
||||
|
||||
%changelog
|
||||
* Mon Dec 13 2021 zhangxiao <zhangxiao131@huawei.com> - 1.5.0.13
|
||||
* fix entropy repeat mode bug
|
||||
|
||||
* Fri Dec 13 2021 liushiyuan <liushiyuan2@huawei.com> - 1.5.0.12
|
||||
* add test c result print
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user