Merge pull request #1142 from terrelln/better-dict

[cover] Small compression ratio improvement
This commit is contained in:
Yann Collet 2018-05-18 17:19:13 -07:00 committed by GitHub
commit ca06a1d82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -620,7 +620,7 @@ static size_t COVER_buildDictionary(const COVER_ctx_t *ctx, U32 *freqs,
/* Divide the data up into epochs of equal size. /* Divide the data up into epochs of equal size.
* We will select at least one segment from each epoch. * We will select at least one segment from each epoch.
*/ */
const U32 epochs = (U32)(dictBufferCapacity / parameters.k); const U32 epochs = MAX(1, (U32)(dictBufferCapacity / parameters.k / 4));
const U32 epochSize = (U32)(ctx->suffixSize / epochs); const U32 epochSize = (U32)(ctx->suffixSize / epochs);
size_t epoch; size_t epoch;
DISPLAYLEVEL(2, "Breaking content into %u epochs of size %u\n", epochs, DISPLAYLEVEL(2, "Breaking content into %u epochs of size %u\n", epochs,