Skip to content

Commit baec346

Browse files
committed
Fix regression introduced ny commit 4aca6a6
1 parent e9d5cc6 commit baec346

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/entropy/TPAQPredictor.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ namespace kanzi
303303
uint hashSize = HASH_SIZE;
304304
uint extraMem = (T == true) ? 1 : 0;
305305
uint bufferSize = BUFFER_SIZE;
306-
uint bsVersion = 6;
306+
uint bsVersion = 7;
307307

308308
if (ctx != nullptr) {
309309
// Block size requested by the user
@@ -341,10 +341,12 @@ namespace kanzi
341341
bsVersion = ctx->getInt("bsVersion", bsVersion);
342342
}
343343

344-
// The ring buffer and hash table use bit masks for indexing.
345-
// Normalize their sizes to powers of two before creating the masks.
346-
bufferSize = 1u << Global::_log2(bufferSize);
347-
hashSize = 1u << Global::_log2(hashSize);
344+
if (bsVersion > 6) {
345+
// The ring buffer and hash table use bit masks for indexing.
346+
// Normalize their sizes to powers of two before creating the masks.
347+
bufferSize = 1u << Global::_log2(bufferSize);
348+
hashSize = 1u << Global::_log2(hashSize);
349+
}
348350

349351
mixersSize <<= (2 * extraMem);
350352
statesSize <<= (2 * extraMem);

0 commit comments

Comments
 (0)