diff options
author | Yann Collet <cyan@fb.com> | 2020-09-28 11:39:00 -0700 |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2020-09-28 11:39:00 -0700 |
commit | ab89dda91d2c878c1f0638dabacf97b5a68ec361 (patch) | |
tree | a5ab16c82b416faadadb3961ad4cfe51b86bd6a7 /lib | |
parent | 89736e4e27358ed463c2482553cfae1b1176c797 (diff) | |
download | lz4-ab89dda91d2c878c1f0638dabacf97b5a68ec361.tar.gz lz4-ab89dda91d2c878c1f0638dabacf97b5a68ec361.tar.bz2 lz4-ab89dda91d2c878c1f0638dabacf97b5a68ec361.zip |
improved last literals run on LZ4_compress_destSize
applying new more accurate formula from LZ4_compress_HC_destSize()
also : fix some minor display issue in tests/frametest
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1185,8 +1185,8 @@ _last_literals: if (outputDirective == fillOutput) { /* adapt lastRun to fill 'dst' */ assert(olimit >= op); - lastRun = (size_t)(olimit-op) - 1; - lastRun -= (lastRun+240)/255; + lastRun = (size_t)(olimit-op) - 1/*token*/; + lastRun -= (lastRun + 256 - RUN_MASK) / 256; /*additional length tokens*/ } else { assert(outputDirective == limitedOutput); return 0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless fine */ |