Skip to content

Anabil66/compression-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEFLATE

Command line compression tool using DEFLATE and a custom archive format (.mzp).


Build

Requires:

  • g++
  • C++17 support

Using Makefile

make

Manual Build

If your environment does not support Makefiles:

Object File Compilation

g++ -std=c++17 -Iinclude -c src/lempel_ziv.cpp -o build/lempel_ziv.o

g++ -std=c++17 -Iinclude -c src/token_encoder.cpp -o build/token_encoder.o

g++ -std=c++17 -Iinclude -c src/bitwriter.cpp -o build/bitwriter.o

Build Compress Executable

g++ -std=c++17 -Iinclude src/compress.cpp \
build/lempel_ziv.o \
build/token_encoder.o \
build/bitwriter.o \
-o bin/compress.exe

Build Decompress Executable

g++ -std=c++17 -Iinclude src/decompress.cpp \
build/lempel_ziv.o \
build/token_encoder.o \
build/bitwriter.o \
-o bin/decompress.exe

Simpler Build

Compress

g++ -std=c++17 -Iinclude \
src/compress.cpp \
src/lempel_ziv.cpp \
src/token_encoder.cpp \
src/bitwriter.cpp \
-o bin/compress.exe

Decompress

g++ -std=c++17 -Iinclude \
src/decompress.cpp \
src/lempel_ziv.cpp \
src/token_encoder.cpp \
src/bitwriter.cpp \
-o bin/decompress.exe

Usage

Windows

Add:

.../DEFLATE/bin

to your system environment variables.

Otherwise, you must be inside:

.../DEFLATE/bin

to run the executables.

Executables should be run as:

./compress.exe
./decompress.exe

Help Command

Compress

compress help

Output:

Usage: compress <source> <destination>

Arguments:

source:
    path to the file/directory to compress

destination:
    path to directory where output will be written

    use . for current directory

Decompress

decompress help

Output:

Usage: decompress <source> <destination>

Arguments:

source:
    path to the .mzp file to decompress

destination:
    path to the directory where file will be extracted

    use . for current directory

Important

Always enclose paths in double quotes:

"./path/to/file"

to avoid path parsing issues.


Project Structure

include/
│
├── bitwriter.hpp
├── lempel_ziv.hpp
├── minheap.hpp
└── token_encoder.hpp

src/
│
├── bitwriter.cpp
├── compress.cpp
├── decompress.cpp
├── lempel_ziv.cpp
└── token_encoder.cpp

Future Improvements

  • Canonical Huffman encoding for LZ tokens
  • Better token parsing system
  • Lazy matching for LZ encoding optimization
  • Streaming decompression improvements
  • Better archive metadata handling

Author

Anabil Roy

About

A custom command line compression tool that uses the DEFLATE algorithm and a custom archive format(.mzp) to compress files/directories.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors