Skip to content

Commit

Permalink
LZMA2: HT: default hashSize <= dictSize; -m3/-m4 lzma settings no mor…
Browse files Browse the repository at this point in the history
…e explicily specify hashsize (in order to improve LimitCompressionMemory results)

git-svn-id: https://freearc.svn.sourceforge.net/svnroot/freearc@637 3a4f7f31-9599-433d-91b1-573e8b61252c
  • Loading branch information
bulatz committed Sep 23, 2009
1 parent 182ef48 commit 7f2cf74
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Compression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ builtinMethodSubsts = [
, ";Binary files compression with fast decompression"
, "1binary = tor:3"
, "2binary = tor: 96m:h64m"
, "3binary = lzma: 96m:h64m:fast :mc8"
, "4binary = lzma: 96m:h64m:normal:mc16"
, "3binary = lzma: 96m:fast :mc8"
, "4binary = lzma: 96m:normal:mc16"
, "5binary = lzma: 16m:max"
, "6binary = lzma: 32m:max"
, "7binary = lzma: 64m:max"
Expand Down
2 changes: 1 addition & 1 deletion Compression/LZMA2/C/LzmaEnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void LzmaEncProps_Normalize(CLzmaEncProps *p)
if (p->hashSize == 0)
{
UInt32 hs = rounddown_to_power_of (p->dictSize, 2);
p->hashSize = p->btMode==MF_HashTable? p->dictSize/sizeof(CLzRef)*2-1
p->hashSize = p->btMode==MF_HashTable? p->dictSize/sizeof(CLzRef) // for hashSize <= dictSize
: p->numHashBytes==2 ? 64*kb
: hs<=64*kb ? 64*kb
: hs<=32*mb ? hs/2
Expand Down
2 changes: 1 addition & 1 deletion Compression/LZMA2/C_LZMA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ MemSize calcDictSize (LZMA_METHOD *p, MemSize mem)
case kBT3: return (MemSize)floor(mem4/11.5);
case kBT4: return (MemSize)floor(mem4/11.5);
case kHC4: return (MemSize)floor(mem4/7.5);
case kHT4: return (MemSize)floor(mem4/1.75); //// äåôîëòíûé õåø - äî 2x, ñì. LzmaEncProps_Normalize
case kHT4: return (MemSize)floor(mem4/2.25);
}
}
return 0;
Expand Down

0 comments on commit 7f2cf74

Please sign in to comment.