Merge pull request #61 from Cyan4973/dev

v0.3.2
dev
Yann Collet 2015-11-02 12:46:42 +01:00
commit 43194f918d
10 changed files with 38 additions and 24 deletions

View File

@ -32,7 +32,7 @@
# ################################################################ # ################################################################
# Version number # Version number
export VERSION := 0.3.1 export VERSION := 0.3.2
PRGDIR = programs PRGDIR = programs
ZSTDDIR = lib ZSTDDIR = lib

3
NEWS
View File

@ -1,3 +1,6 @@
v0.3.2
Fixed Visual Studio
v0.3.1 : v0.3.1 :
Small compression ratio improvement Small compression ratio improvement

View File

@ -23,12 +23,13 @@ For a taste of its performance, here are a few benchmark numbers from a number o
[zlib]:http://www.zlib.net/ [zlib]:http://www.zlib.net/
[LZ4]:http://www.lz4.org/ [LZ4]:http://www.lz4.org/
Zstd can also offer stronger compression ratio at the cost of compression speed. Compression speed is highly configurable, by small increment, to fit different situations. Note however that decompression speed is preserved and remain roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib]. The following test is run on a Core i7-3930K CPU @ 4.5GHz, using [lzbench], an open-source in-memory benchmark by inikep. Zstd can also offer stronger compression ratio at the cost of compression speed. Speed / Ratio trade-off is configurable by small increment, to fit different situations. Note however that decompression speed is preserved and remain roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib]. The following test is run on a Core i7-3930K CPU @ 4.5GHz, using [lzbench], an open-source in-memory benchmark by inikep, on the [Silesia compression corpus](http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia)
[lzbench]:https://github.com/inikep/lzbench [lzbench]:https://github.com/inikep/lzbench
Compression Ratio vs Speed | Decompression Speed
Compression Speed vs Ratio | Decompression Speed
---------------------------|-------------------- ---------------------------|--------------------
![Compression Ratio vs Speed](images/CSpeed.png "Compression Ratio vs Speed") | ![Decompression Speed](images/DSpeed.png "Decompression Speed") ![Compression Speed vs Ratio](images/CSpeed.png "Compression Speed vs Ratio") | ![Decompression Speed](images/DSpeed.png "Decompression Speed")
Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entrop library](https://github.com/Cyan4973/FiniteStateEntropy). Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entrop library](https://github.com/Cyan4973/FiniteStateEntropy).

View File

@ -362,7 +362,7 @@ size_t HUF_buildCTable (HUF_CElt* tree, const U32* count, U32 maxSymbolValue, U3
U16 min = 0; U16 min = 0;
for (n=maxNbBits; n>0; n--) for (n=maxNbBits; n>0; n--)
{ {
valPerRank[n] = min; // get starting value within each rank valPerRank[n] = min; /* get starting value within each rank */
min += nbPerRank[n]; min += nbPerRank[n];
min >>= 1; min >>= 1;
} }
@ -1027,17 +1027,22 @@ size_t HUF_readDTableX4 (U32* DTable, const void* src, size_t srcSize)
U32 nextRankVal = 0; U32 nextRankVal = 0;
U32 w, consumed; U32 w, consumed;
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */ const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
U32* rankVal0 = rankVal[0];
for (w=1; w<=maxW; w++) for (w=1; w<=maxW; w++)
{ {
U32 current = nextRankVal; U32 current = nextRankVal;
nextRankVal += rankStats[w] << (w+rescale); nextRankVal += rankStats[w] << (w+rescale);
rankVal[0][w] = current; rankVal0[w] = current;
}
for (consumed = minBits; consumed <= memLog - minBits; consumed++)
{
U32* rankValPtr = rankVal[consumed];
for (w = 1; w <= maxW; w++)
{
rankValPtr[w] = rankVal0[w] >> consumed;
}
} }
for (consumed=minBits; consumed <= memLog-minBits; consumed++)
for (w=1; w<=maxW; w++)
rankVal[consumed][w] = rankVal[0][w] >> consumed;
} }
HUF_fillDTableX4(dt, memLog, HUF_fillDTableX4(dt, memLog,
sortedSymbol, sizeOfSort, sortedSymbol, sizeOfSort,
@ -1394,17 +1399,22 @@ size_t HUF_readDTableX6 (U32* DTable, const void* src, size_t srcSize)
U32 nextRankVal = 0; U32 nextRankVal = 0;
U32 w, consumed; U32 w, consumed;
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */ const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
U32* rankVal0 = rankVal[0];
for (w=1; w<=maxW; w++) for (w=1; w<=maxW; w++)
{ {
U32 current = nextRankVal; U32 current = nextRankVal;
nextRankVal += rankStats[w] << (w+rescale); nextRankVal += rankStats[w] << (w+rescale);
rankVal[0][w] = current; rankVal0[w] = current;
}
for (consumed = minBits; consumed <= memLog - minBits; consumed++)
{
U32* rankValPtr = rankVal[consumed];
for (w = 1; w <= maxW; w++)
{
rankValPtr[w] = rankVal0[w] >> consumed;
}
} }
for (consumed=minBits; consumed <= memLog-minBits; consumed++)
for (w=1; w<=maxW; w++)
rankVal[consumed][w] = rankVal[0][w] >> consumed;
} }
/* fill tables */ /* fill tables */
{ {

View File

@ -48,7 +48,7 @@ extern "C" {
***************************************/ ***************************************/
#define ZSTD_VERSION_MAJOR 0 /* for breaking interface changes */ #define ZSTD_VERSION_MAJOR 0 /* for breaking interface changes */
#define ZSTD_VERSION_MINOR 3 /* for new (non-breaking) interface capabilities */ #define ZSTD_VERSION_MINOR 3 /* for new (non-breaking) interface capabilities */
#define ZSTD_VERSION_RELEASE 0 /* for tweaks, bug-fixes, or development */ #define ZSTD_VERSION_RELEASE 2 /* for tweaks, bug-fixes, or development */
#define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE) #define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
unsigned ZSTD_versionNumber (void); unsigned ZSTD_versionNumber (void);

View File

@ -105,21 +105,21 @@ static const ZSTD_HC_parameters ZSTD_HC_defaultParameters[ZSTD_HC_MAX_CLEVEL+1]
{ 21, 19, 20, 4, 5, ZSTD_HC_lazy }, /* level 8 */ { 21, 19, 20, 4, 5, ZSTD_HC_lazy }, /* level 8 */
{ 21, 19, 20, 5, 5, ZSTD_HC_lazy }, /* level 9 */ { 21, 19, 20, 5, 5, ZSTD_HC_lazy }, /* level 9 */
{ 21, 20, 20, 5, 5, ZSTD_HC_lazy }, /* level 10 */ { 21, 20, 20, 5, 5, ZSTD_HC_lazy }, /* level 10 */
{ 21, 20, 20, 5, 5, ZSTD_HC_lazy }, /* level 11 */ { 21, 21, 20, 5, 5, ZSTD_HC_lazy }, /* level 11 */
{ 22, 20, 22, 6, 5, ZSTD_HC_lazy }, /* level 12 */ { 22, 20, 22, 6, 5, ZSTD_HC_lazy }, /* level 12 */
{ 22, 21, 22, 6, 5, ZSTD_HC_lazy }, /* level 13 */ { 22, 21, 22, 6, 5, ZSTD_HC_lazy }, /* level 13 */
{ 23, 21, 22, 6, 5, ZSTD_HC_lazy }, /* level 14 */ { 23, 21, 22, 6, 5, ZSTD_HC_lazy }, /* level 14 */
{ 23, 21, 23, 7, 5, ZSTD_HC_lazy }, /* level 15 */ { 23, 21, 23, 7, 5, ZSTD_HC_lazy }, /* level 15 */
{ 23, 22, 22, 6, 5, ZSTD_HC_lazy }, /* level 16 */ { 23, 22, 22, 6, 5, ZSTD_HC_lazy }, /* level 16 */
{ 23, 22, 22, 7, 5, ZSTD_HC_lazy }, /* level 17 */ { 23, 22, 22, 7, 5, ZSTD_HC_lazy }, /* level 17 */
{ 23, 22, 23, 7, 5, ZSTD_HC_lazy }, /* level 18 */ { 23, 23, 22, 7, 5, ZSTD_HC_lazy }, /* level 18 */
{ 23, 22, 23, 8, 5, ZSTD_HC_lazy }, /* level 19 */ { 23, 22, 23, 8, 5, ZSTD_HC_lazy }, /* level 19 */
{ 23, 23, 23, 8, 5, ZSTD_HC_lazy }, /* level 20 */ { 23, 23, 23, 8, 5, ZSTD_HC_lazy }, /* level 20 */
{ 23, 23, 23, 8, 5, ZSTD_HC_lazy }, /* level 21 */ { 23, 23, 23, 8, 5, ZSTD_HC_lazy }, /* level 21 */
{ 24, 23, 23, 8, 5, ZSTD_HC_lazy }, /* level 22 */ { 24, 24, 24, 8, 5, ZSTD_HC_lazy }, /* level 22 */
{ 24, 23, 23, 9, 5, ZSTD_HC_lazy }, /* level 23 */ { 24, 23, 23, 9, 5, ZSTD_HC_lazy }, /* level 23 */
{ 24, 24, 24, 9, 5, ZSTD_HC_lazy }, /* level 24 */ { 24, 24, 24, 9, 5, ZSTD_HC_lazy }, /* level 24 */
{ 24, 24, 24, 10, 5, ZSTD_HC_lazy }, /* level 25 */ { 24, 24, 24, 9, 5, ZSTD_HC_lazy }, /* level 25 */
{ 24, 24, 24, 10, 5, ZSTD_HC_lazy }, /* level 26 */ /* ZSTD_HC_MAX_CLEVEL */ { 24, 24, 24, 10, 5, ZSTD_HC_lazy }, /* level 26 */ /* ZSTD_HC_MAX_CLEVEL */
}; };

View File

@ -30,7 +30,7 @@
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode # fullbench32: Same as fullbench, but forced to compile in 32-bits mode
# ########################################################################## # ##########################################################################
VERSION?= 0.3.1 VERSION?= 0.3.2
DESTDIR?= DESTDIR?=
PREFIX ?= /usr/local PREFIX ?= /usr/local

View File

@ -78,7 +78,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath> <IncludePath>$(SolutionDir)..\..\lib\legacy;$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis> <RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -78,7 +78,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath> <IncludePath>$(SolutionDir)..\..\lib\legacy;$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis> <RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -109,7 +109,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath> <IncludePath>$(SolutionDir)..\..\programs\legacy;$(SolutionDir)..\..\lib\legacy;$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis> <RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">