Skip to content

Commit

Permalink
Merge pull request #61 from Cyan4973/dev
Browse files Browse the repository at this point in the history
v0.3.2
  • Loading branch information
Cyan4973 committed Nov 2, 2015
2 parents da8557e + ee34cdf commit 43194f9
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# ################################################################

# Version number
export VERSION := 0.3.1
export VERSION := 0.3.2

PRGDIR = programs
ZSTDDIR = lib
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.3.2
Fixed Visual Studio

v0.3.1 :
Small compression ratio improvement

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
[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
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).
Expand Down
32 changes: 21 additions & 11 deletions lib/huff0.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ size_t HUF_buildCTable (HUF_CElt* tree, const U32* count, U32 maxSymbolValue, U3
U16 min = 0;
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 >>= 1;
}
Expand Down Expand Up @@ -1027,18 +1027,23 @@ size_t HUF_readDTableX4 (U32* DTable, const void* src, size_t srcSize)
U32 nextRankVal = 0;
U32 w, consumed;
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
U32* rankVal0 = rankVal[0];
for (w=1; w<=maxW; w++)
{
U32 current = nextRankVal;
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,
sortedSymbol, sizeOfSort,
rankStart0, rankVal, maxW,
Expand Down Expand Up @@ -1394,18 +1399,23 @@ size_t HUF_readDTableX6 (U32* DTable, const void* src, size_t srcSize)
U32 nextRankVal = 0;
U32 w, consumed;
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
U32* rankVal0 = rankVal[0];
for (w=1; w<=maxW; w++)
{
U32 current = nextRankVal;
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 */
{
HUF_DDescX6* DDescription = (HUF_DDescX6*)(DTable+1);
Expand Down
2 changes: 1 addition & 1 deletion lib/zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern "C" {
***************************************/
#define ZSTD_VERSION_MAJOR 0 /* for breaking interface changes */
#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)
unsigned ZSTD_versionNumber (void);

Expand Down
8 changes: 4 additions & 4 deletions lib/zstdhc_static.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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 11 */
{ 21, 21, 20, 5, 5, ZSTD_HC_lazy }, /* level 11 */
{ 22, 20, 22, 6, 5, ZSTD_HC_lazy }, /* level 12 */
{ 22, 21, 22, 6, 5, ZSTD_HC_lazy }, /* level 13 */
{ 23, 21, 22, 6, 5, ZSTD_HC_lazy }, /* level 14 */
{ 23, 21, 23, 7, 5, ZSTD_HC_lazy }, /* level 15 */
{ 23, 22, 22, 6, 5, ZSTD_HC_lazy }, /* level 16 */
{ 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, 23, 23, 8, 5, ZSTD_HC_lazy }, /* level 20 */
{ 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, 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 */
};

Expand Down
2 changes: 1 addition & 1 deletion programs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
# ##########################################################################

VERSION?= 0.3.1
VERSION?= 0.3.2

DESTDIR?=
PREFIX ?= /usr/local
Expand Down
2 changes: 1 addition & 1 deletion visual/2012/fullbench/fullbench.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<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>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down
2 changes: 1 addition & 1 deletion visual/2012/fuzzer/fuzzer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<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>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down
2 changes: 1 addition & 1 deletion visual/2012/zstd/zstd.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<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>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down

0 comments on commit 43194f9

Please sign in to comment.