diff --git a/.gitignore b/.gitignore index 9fa3b1bf..c4c9282b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ *.exe *.out *.app + +# Visual solution files +*.suo +*.user diff --git a/lib/fse.c b/lib/fse.c index a1aeea52..1f61a0a4 100644 --- a/lib/fse.c +++ b/lib/fse.c @@ -560,45 +560,9 @@ int FSE_compareRankT(const void* r1, const void* r2) return 2 * (R1->count < R2->count) - 1; } -#if 0 -static void FSE_adjustNormSlow(short* norm, int pointsToRemove, const unsigned* count, U32 maxSymbolValue) -{ - rank_t rank[FSE_MAX_SYMBOL_VALUE+1]; - U32 s; - - /* Init */ - for (s=0; s<=maxSymbolValue; s++) - { - rank[s].id = s; - rank[s].count = count[s]; - if (norm[s] <= 1) rank[s].count = 0; - } - - /* Sort according to count */ - qsort(rank, maxSymbolValue+1, sizeof(rank_t), FSE_compareRankT); - - while(pointsToRemove) - { - int newRank = 1; - norm[rank[0].id]--; - rank[0].count = (rank[0].count * 3) >> 2; - if (norm[rank[0].id] == 1) rank[0].count = 0; - while (rank[newRank].count > rank[newRank-1].count) - { - rank_t r = rank[newRank-1]; - rank[newRank-1] = rank[newRank]; - rank[newRank] = r; - newRank++; - } - pointsToRemove--; - } -} - -#else - static size_t FSE_adjustNormSlow(short* norm, int pointsToRemove, const unsigned* count, U32 maxSymbolValue) { - rank_t rank[FSE_MAX_SYMBOL_VALUE+1]; + rank_t rank[FSE_MAX_SYMBOL_VALUE+2]; U32 s; /* Init */ @@ -608,6 +572,8 @@ static size_t FSE_adjustNormSlow(short* norm, int pointsToRemove, const unsigned rank[s].count = count[s]; if (norm[s] <= 1) rank[s].count = 0; } + rank[maxSymbolValue+1].id = 0; + rank[maxSymbolValue+1].count = 0; /* ensures comparison ends here in worst case */ /* Sort according to count */ qsort(rank, maxSymbolValue+1, sizeof(rank_t), FSE_compareRankT); @@ -634,7 +600,6 @@ static size_t FSE_adjustNormSlow(short* norm, int pointsToRemove, const unsigned return 0; } -#endif size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, @@ -676,8 +641,7 @@ size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, short proba = (short)((count[s]*step) >> scale); if (proba<8) { - U64 restToBeat; - restToBeat = vStep * rtbTable[proba]; + U64 restToBeat = vStep * rtbTable[proba]; proba += (count[s]*step) - ((U64)proba< restToBeat; } if (proba > largestP) @@ -691,9 +655,8 @@ size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, } if (-stillToDistribute >= (normalizedCounter[largest] >> 1)) { - size_t errorCode; /* corner case, need to converge towards normalization with caution */ - errorCode = FSE_adjustNormSlow(normalizedCounter, -stillToDistribute, count, maxSymbolValue); + size_t errorCode = FSE_adjustNormSlow(normalizedCounter, -stillToDistribute, count, maxSymbolValue); if (FSE_isError(errorCode)) return errorCode; //FSE_adjustNormSlow(normalizedCounter, -stillToDistribute, count, maxSymbolValue); } @@ -1247,7 +1210,7 @@ size_t FSE_decompress(void* dst, size_t maxDstSize, const void* cSrc, size_t cSr const BYTE* const istart = (const BYTE*)cSrc; const BYTE* ip = istart; short counting[FSE_MAX_SYMBOL_VALUE+1]; - FSE_decode_t DTable[FSE_MAX_TABLESIZE]; + FSE_decode_t DTable[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)]; unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE; unsigned tableLog; size_t errorCode, fastMode; diff --git a/lib/zstd.c b/lib/zstd.c index 48c4025b..6d5ceeca 100644 --- a/lib/zstd.c +++ b/lib/zstd.c @@ -924,14 +924,12 @@ static const BYTE* ZSTD_updateMatch(U32* table, const BYTE* p, const BYTE* start static int ZSTD_checkMatch(const BYTE* match, const BYTE* ip) { - //return *(U32*)match == *(U32*)ip; return ZSTD_read32(match) == ZSTD_read32(ip); } static size_t ZSTD_compressBlock(void* ctx, void* dst, size_t maxDstSize, const void* src, size_t srcSize) { - // Local Variables cctxi_t* srt = (cctxi_t*) ctx; U32* HashTable = (U32*)(srt->hashTable); void* workplace = srt->workplace; diff --git a/visual/2012/fullbench/fullbench.vcxproj.user b/visual/2012/fullbench/fullbench.vcxproj.user deleted file mode 100644 index 7cbb3216..00000000 --- a/visual/2012/fullbench/fullbench.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/visual/2012/fuzzer/fuzzer.vcxproj.user b/visual/2012/fuzzer/fuzzer.vcxproj.user deleted file mode 100644 index 7cbb3216..00000000 --- a/visual/2012/fuzzer/fuzzer.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/visual/2012/zstd.sln b/visual/2012/zstd.sln old mode 100644 new mode 100755 index 95eb56ed..2b5eb989 --- a/visual/2012/zstd.sln +++ b/visual/2012/zstd.sln @@ -9,46 +9,32 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fullbench", "fullbench\full EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Debug|Win32.ActiveCfg = Debug|Win32 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Debug|Win32.Build.0 = Debug|Win32 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Debug|x64.ActiveCfg = Debug|x64 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Debug|x64.Build.0 = Debug|x64 - {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Release|Mixed Platforms.Build.0 = Release|Win32 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Release|Win32.ActiveCfg = Release|Win32 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Release|Win32.Build.0 = Release|Win32 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Release|x64.ActiveCfg = Release|x64 {4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C}.Release|x64.Build.0 = Release|x64 - {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Debug|Win32.ActiveCfg = Debug|Win32 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Debug|Win32.Build.0 = Debug|Win32 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Debug|x64.ActiveCfg = Debug|x64 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Debug|x64.Build.0 = Debug|x64 - {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Release|Mixed Platforms.Build.0 = Release|Win32 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Release|Win32.ActiveCfg = Release|Win32 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Release|Win32.Build.0 = Release|Win32 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Release|x64.ActiveCfg = Release|x64 {6FD4352B-346C-4703-96EA-D4A8B9A6976E}.Release|x64.Build.0 = Release|x64 - {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Debug|Win32.ActiveCfg = Debug|Win32 {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Debug|Win32.Build.0 = Debug|Win32 {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Debug|x64.ActiveCfg = Debug|x64 {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Debug|x64.Build.0 = Debug|x64 - {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Release|Mixed Platforms.Build.0 = Release|Win32 {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Release|Win32.ActiveCfg = Release|Win32 {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Release|Win32.Build.0 = Release|Win32 {61ABD629-1CC8-4FD7-9281-6B8DBB9D3DF8}.Release|x64.ActiveCfg = Release|x64 diff --git a/visual/2012/zstd.v11.suo b/visual/2012/zstd.v11.suo deleted file mode 100644 index 40882be5..00000000 Binary files a/visual/2012/zstd.v11.suo and /dev/null differ diff --git a/visual/2012/zstd/zstd.vcxproj.user b/visual/2012/zstd/zstd.vcxproj.user deleted file mode 100644 index 7cbb3216..00000000 --- a/visual/2012/zstd/zstd.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file