Skip to content

Commit 3e40a40

Browse files
authored
Initial commit with original version from 2015
Originally published through http://www.en-trust.at/wp-content/uploads/DataCompressor_dist.zip
0 parents  commit 3e40a40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+104983
-0
lines changed
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|x64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|Win32">
13+
<Configuration>Release</Configuration>
14+
<Platform>Win32</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<ProjectGuid>{E9CDFFB9-1FEC-4CCF-B91B-738AC4DCAC21}</ProjectGuid>
23+
<RootNamespace>DSEncCLI</RootNamespace>
24+
<ProjectName>DCCLI</ProjectName>
25+
</PropertyGroup>
26+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
28+
<ConfigurationType>Application</ConfigurationType>
29+
<UseDebugLibraries>true</UseDebugLibraries>
30+
<PlatformToolset>v120</PlatformToolset>
31+
<CharacterSet>NotSet</CharacterSet>
32+
</PropertyGroup>
33+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
34+
<ConfigurationType>Application</ConfigurationType>
35+
<UseDebugLibraries>true</UseDebugLibraries>
36+
<PlatformToolset>v120</PlatformToolset>
37+
<CharacterSet>NotSet</CharacterSet>
38+
</PropertyGroup>
39+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
40+
<ConfigurationType>Application</ConfigurationType>
41+
<UseDebugLibraries>false</UseDebugLibraries>
42+
<PlatformToolset>v120</PlatformToolset>
43+
<WholeProgramOptimization>true</WholeProgramOptimization>
44+
<CharacterSet>NotSet</CharacterSet>
45+
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
47+
<ConfigurationType>Application</ConfigurationType>
48+
<UseDebugLibraries>false</UseDebugLibraries>
49+
<PlatformToolset>v120</PlatformToolset>
50+
<WholeProgramOptimization>true</WholeProgramOptimization>
51+
<CharacterSet>NotSet</CharacterSet>
52+
</PropertyGroup>
53+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
54+
<ImportGroup Label="ExtensionSettings">
55+
</ImportGroup>
56+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
57+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
58+
</ImportGroup>
59+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
60+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61+
</ImportGroup>
62+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
63+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64+
</ImportGroup>
65+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
66+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
67+
</ImportGroup>
68+
<PropertyGroup Label="UserMacros" />
69+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
70+
<RunCodeAnalysis>false</RunCodeAnalysis>
71+
</PropertyGroup>
72+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
73+
<RunCodeAnalysis>false</RunCodeAnalysis>
74+
</PropertyGroup>
75+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
76+
<ClCompile>
77+
<WarningLevel>EnableAllWarnings</WarningLevel>
78+
<Optimization>Disabled</Optimization>
79+
<SDLCheck>true</SDLCheck>
80+
<DisableSpecificWarnings>4820;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
81+
<CompileAs>CompileAsC</CompileAs>
82+
<CompileAsManaged>false</CompileAsManaged>
83+
<CompileAsWinRT>false</CompileAsWinRT>
84+
<ExceptionHandling>false</ExceptionHandling>
85+
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
86+
<RuntimeTypeInfo>false</RuntimeTypeInfo>
87+
<EnablePREfast>false</EnablePREfast>
88+
<AdditionalIncludeDirectories>../../../common/inc;../../../DCIOLib/inc;../../../DCLib/inc;../../inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
89+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
90+
<TreatWarningAsError>true</TreatWarningAsError>
91+
</ClCompile>
92+
<Link>
93+
<GenerateDebugInformation>true</GenerateDebugInformation>
94+
<AdditionalDependencies>
95+
</AdditionalDependencies>
96+
<TurnOffAssemblyGeneration>false</TurnOffAssemblyGeneration>
97+
</Link>
98+
</ItemDefinitionGroup>
99+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
100+
<ClCompile>
101+
<WarningLevel>EnableAllWarnings</WarningLevel>
102+
<Optimization>Disabled</Optimization>
103+
<SDLCheck>true</SDLCheck>
104+
<DisableSpecificWarnings>4820;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
105+
<CompileAs>CompileAsC</CompileAs>
106+
<CompileAsManaged>false</CompileAsManaged>
107+
<CompileAsWinRT>false</CompileAsWinRT>
108+
<ExceptionHandling>false</ExceptionHandling>
109+
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
110+
<RuntimeTypeInfo>false</RuntimeTypeInfo>
111+
<EnablePREfast>false</EnablePREfast>
112+
<AdditionalIncludeDirectories>../../../common/inc;../../../DCIOLib/inc;../../../DCLib/inc;../../inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
113+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
114+
<TreatWarningAsError>true</TreatWarningAsError>
115+
</ClCompile>
116+
<Link>
117+
<GenerateDebugInformation>true</GenerateDebugInformation>
118+
<AdditionalDependencies>
119+
</AdditionalDependencies>
120+
<TurnOffAssemblyGeneration>false</TurnOffAssemblyGeneration>
121+
</Link>
122+
</ItemDefinitionGroup>
123+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
124+
<ClCompile>
125+
<WarningLevel>EnableAllWarnings</WarningLevel>
126+
<Optimization>MaxSpeed</Optimization>
127+
<FunctionLevelLinking>true</FunctionLevelLinking>
128+
<IntrinsicFunctions>true</IntrinsicFunctions>
129+
<SDLCheck>true</SDLCheck>
130+
<CompileAsManaged>false</CompileAsManaged>
131+
<CompileAsWinRT>false</CompileAsWinRT>
132+
<ExceptionHandling>false</ExceptionHandling>
133+
<CompileAs>CompileAsC</CompileAs>
134+
<DisableSpecificWarnings>4820;4996;4711;%(DisableSpecificWarnings)</DisableSpecificWarnings>
135+
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
136+
<RuntimeTypeInfo>false</RuntimeTypeInfo>
137+
<AdditionalIncludeDirectories>../../../common/inc;../../../DCIOLib/inc;../../../DCLib/inc;../../inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
138+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
139+
<FloatingPointModel>Fast</FloatingPointModel>
140+
<TreatWarningAsError>true</TreatWarningAsError>
141+
</ClCompile>
142+
<Link>
143+
<GenerateDebugInformation>false</GenerateDebugInformation>
144+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
145+
<OptimizeReferences>true</OptimizeReferences>
146+
<AdditionalDependencies />
147+
<TurnOffAssemblyGeneration>false</TurnOffAssemblyGeneration>
148+
</Link>
149+
</ItemDefinitionGroup>
150+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
151+
<ClCompile>
152+
<WarningLevel>EnableAllWarnings</WarningLevel>
153+
<Optimization>MaxSpeed</Optimization>
154+
<FunctionLevelLinking>true</FunctionLevelLinking>
155+
<IntrinsicFunctions>true</IntrinsicFunctions>
156+
<SDLCheck>true</SDLCheck>
157+
<CompileAsManaged>false</CompileAsManaged>
158+
<CompileAsWinRT>false</CompileAsWinRT>
159+
<ExceptionHandling>false</ExceptionHandling>
160+
<CompileAs>CompileAsC</CompileAs>
161+
<DisableSpecificWarnings>4820;4996;4711;%(DisableSpecificWarnings)</DisableSpecificWarnings>
162+
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
163+
<RuntimeTypeInfo>false</RuntimeTypeInfo>
164+
<AdditionalIncludeDirectories>../../../common/inc;../../../DCIOLib/inc;../../../DCLib/inc;../../inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
165+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
166+
<FloatingPointModel>Fast</FloatingPointModel>
167+
<TreatWarningAsError>true</TreatWarningAsError>
168+
</ClCompile>
169+
<Link>
170+
<GenerateDebugInformation>false</GenerateDebugInformation>
171+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
172+
<OptimizeReferences>true</OptimizeReferences>
173+
<AdditionalDependencies>
174+
</AdditionalDependencies>
175+
<TurnOffAssemblyGeneration>false</TurnOffAssemblyGeneration>
176+
</Link>
177+
</ItemDefinitionGroup>
178+
<ItemGroup>
179+
<ClInclude Include="..\..\inc\cli.h" />
180+
<ClInclude Include="..\..\inc\params.h" />
181+
<ClInclude Include="..\..\inc\prefix.h" />
182+
</ItemGroup>
183+
<ItemGroup>
184+
<ClCompile Include="..\..\src\cli.c" />
185+
<ClCompile Include="..\..\src\params.c" />
186+
<ClCompile Include="..\..\src\prefix.c" />
187+
</ItemGroup>
188+
<ItemGroup>
189+
<ProjectReference Include="..\..\..\DCLib\build\MSVC\DCLib.vcxproj">
190+
<Project>{6b8fa342-7c7b-4292-93bb-fccd8595e8db}</Project>
191+
</ProjectReference>
192+
</ItemGroup>
193+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
194+
<ImportGroup Label="ExtensionTargets">
195+
</ImportGroup>
196+
</Project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Quelldateien">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Headerdateien">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
</ItemGroup>
13+
<ItemGroup>
14+
<ClInclude Include="..\..\inc\cli.h">
15+
<Filter>Headerdateien</Filter>
16+
</ClInclude>
17+
<ClInclude Include="..\..\inc\params.h">
18+
<Filter>Headerdateien</Filter>
19+
</ClInclude>
20+
<ClInclude Include="..\..\inc\prefix.h">
21+
<Filter>Headerdateien</Filter>
22+
</ClInclude>
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ClCompile Include="..\..\src\cli.c">
26+
<Filter>Quelldateien</Filter>
27+
</ClCompile>
28+
<ClCompile Include="..\..\src\params.c">
29+
<Filter>Quelldateien</Filter>
30+
</ClCompile>
31+
<ClCompile Include="..\..\src\prefix.c">
32+
<Filter>Quelldateien</Filter>
33+
</ClCompile>
34+
</ItemGroup>
35+
</Project>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
COMMONMAKDIR = ../../../common/build/gcc
2+
COMMONMAK = $(COMMONMAKDIR)/common.mak
3+
include $(COMMONMAK)
4+
5+
SRCDIR = ../../src
6+
OBJDIR = ../../build/gcc
7+
DESTDIR = ../../../build/gcc
8+
9+
INCDIR = ../../inc
10+
COMMONINCDIR = ../../../common/inc
11+
INC = -I$(INCDIR) -I$(COMMONINCDIR)
12+
13+
EXTRA_LIB = DCLib
14+
EXTRA_LIB_PATH = ../../../$(EXTRA_LIB)
15+
EXTRA_LIB_BUILD_PATH = $(EXTRA_LIB_PATH)/build/gcc
16+
EXTRA_LIB_DIR = $(DESTDIR)
17+
EXTRA_LIB_FILE = $(EXTRA_LIB_DIR)/$(EXTRA_LIB).a
18+
EXTRA_LIB_INC_DIR = $(EXTRA_LIB_PATH)/inc
19+
INC += -I$(EXTRA_LIB_INC_DIR)
20+
21+
EXTRA_LIB_DEP = DCIOLib
22+
EXTRA_LIB_DEP_PATH = ../../../$(EXTRA_LIB_DEP)
23+
EXTRA_LIB_DEP_INC_DIR = $(EXTRA_LIB_DEP_PATH)/inc
24+
INC += -I$(EXTRA_LIB_DEP_INC_DIR)
25+
26+
LDFLAGS += -L$(EXTRA_LIB_DIR) $(EXTRA_LIB_FILE)
27+
28+
EXENAME = DCCLI
29+
EXEFILE = $(DESTDIR)/$(EXENAME)
30+
31+
TESTDATA_PATH = ../../testdata
32+
TESTDATA_INPUT = $(TESTDATA_PATH)/input.txt
33+
TESTDATA_OUTPUT = $(TESTDATA_PATH)/output.txt
34+
35+
CFLAGS += $(INC)
36+
37+
SRC = $(wildcard $(SRCDIR)/*.c)
38+
HDR = $(wildcard $(INCDIR)/*.h) $(wildcard $(COMMONINCDIR)/*.h)
39+
OBJ = $(addprefix $(OBJDIR)/, $(notdir $(SRC:.c=.o)))
40+
41+
all: release
42+
43+
debug: CFLAGS += $(DEBUG_CFLAGS)
44+
debug: LDFLAGS += $(DEBUG_LDFLAGS)
45+
debug: $(EXEFILE)
46+
47+
debugall: SUBTARGET = debugall
48+
debugall: debug
49+
50+
release: CFLAGS += $(RELEASE_CFLAGS)
51+
release: $(EXEFILE)
52+
53+
releaseall: SUBTARGET = releaseall
54+
releaseall: release
55+
56+
$(EXEFILE): $(OBJ) $(EXTRA_LIB_FILE)
57+
$(CC) $(filter-out $(EXTRA_LIB_FILE), $^) $(LDFLAGS) -o $@
58+
59+
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(HDR)
60+
$(CC) $(CFLAGS) $< -o $@
61+
62+
$(EXTRA_LIB_FILE): FORCE
63+
$(MAKE) -C $(EXTRA_LIB_BUILD_PATH) $(SUBTARGET)
64+
65+
clean:
66+
$(RM) $(OBJ) $(EXEFILE)
67+
68+
cleanall: clean cleansub
69+
70+
cleansub:
71+
$(MAKE) -C $(EXTRA_LIB_BUILD_PATH) cleanall
72+
73+
FORCE:
74+
75+
test: $(EXEFILE)
76+
$(EXEFILE) $(TESTDATA_INPUT) $(TESTDATA_OUTPUT) decode csv \# encode normalize \# encode diff \# encode seg \# encode bac adaptive \# decode bac adaptive \# decode seg \# decode diff \# decode normalize \# encode csv
77+
$(DIFF) "$(TESTDATA_INPUT)" "$(TESTDATA_OUTPUT)"

DataCompressor/DCCLI/doc/overview.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
DCCLI is a command line application which allows compressing and decompressing (referred to as encoding and decoding henceforth) files using DCLib.
2+
3+
Usage: <input file> <output file> <list of encoders/decoders with options>
4+
The list of encoders/decoders is separated by a separate #. Each encoder/decoder must specify either 'encode' or 'decode', followed by the encoder/decoder name. Options can be specified separately after that. They affect only encoder/decoder that precedes them in the command line. Options are specified as <name>=<value> or <name> for boolean options.
5+
Example: input.dat output.dat encode copy # decode copy blocksize=8
6+
7+
Notes on usage:
8+
* If a fractional number of bytes (i.e., a number of bits not divisible by eight) is written to the output file, decoding said output file later may lead to errors at the last byte when processing the superfluous bits at the end of the file
9+
* When using only one encoder/decoder, data read from the input file is processed and written directly (buffered) to the output file, requiring no additional memory. If, however, multiple encoders/decoders are used, data read from the input file is processed and written to a temporary buffer. For all but the last encoder/decoder, data is read from this temporary buffer, processed and written to another temporary buffer. For the last encoder/decoder, data from this temporary buffer is read, processed and written to the output file. Since all data is processed by one encoder/decoder after another, all intermediate data will be held in the described temporary buffers. Processing large files can therefore lead to high memory consumption
10+
* The size of the temporary buffers described above may be reduced at compile-time via TEMP_BUFFER_SIZE. However, since the buffers resize themselves automatically, TEMP_BUFFER_SIZE is only their initial size, which is no indicator of the acutal memory consumption when processing larger files with more than one encoder/decoder
11+
* The size of the input and output file buffers may be reduced at compile-time via READ_BUFFER_SIZE and WRITE_BUFFER_SIZE. Both are guaranteed to remain unchanged throughout the execution of the program

DataCompressor/DCCLI/inc/cli.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* DataCompressor command line interface (header)
2+
Part of DataCompressor
3+
Andreas Unterweger, 2013-2015 */
4+
5+
#ifndef _CLI_H
6+
#define _CLI_H
7+
8+
#include "bit_file_buffer.h"
9+
10+
typedef struct buffer_environment_t
11+
{
12+
FILE *in_file, *out_file;
13+
file_buffer_t *in_buf, *out_buf, *temp_read_buf, *temp_write_buf;
14+
bit_file_buffer_t *in_bit_buf, *out_bit_buf, *temp_read_bit_buf, *temp_write_bit_buf;
15+
} buffer_environment_t;
16+
17+
void InitBufferEnvironment(buffer_environment_t * const buffer_env);
18+
void UninitBufferEnvironment(buffer_environment_t * const buffer_env);
19+
20+
int InitBuffers(buffer_environment_t * const buffers, FILE * const error_log_file, const int use_temp_buffers);
21+
void UninitBuffers(buffer_environment_t * const buffers);
22+
23+
int main(const int argc, const char * const * const argv);
24+
25+
#endif

DataCompressor/DCCLI/inc/params.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* CLI parameter parsing and usage printing (header)
2+
Part of DataCompressor
3+
Andreas Unterweger, 2013-2015 */
4+
5+
#ifndef _PARAMS_H
6+
#define _PARAMS_H
7+
8+
#include "enc_dec.h"
9+
10+
#define MAX_OPTIONS 16
11+
12+
typedef struct parameters_t
13+
{
14+
size_t num_options;
15+
options_t *options[MAX_OPTIONS];
16+
FILE *error_log_file;
17+
} parameters_t;
18+
19+
int ProcessParameters(const int argc, const char * const * const argv, parameters_t * const parameters, FILE ** const in_file, FILE ** const out_file);
20+
21+
#endif

DataCompressor/DCCLI/inc/prefix.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Prefix formatting utilities (header)
2+
Part of DataCompressor
3+
Andreas Unterweger, 2015 */
4+
5+
#include "io.h"
6+
7+
void FormatFloatSI(const float value, char * const str);
8+
void FormatByte(const io_uint_t value, char * const str);

0 commit comments

Comments
 (0)