All Projects → e-hengirmen → Huffman-Coding

e-hengirmen / Huffman-Coding

Licence: MIT license
A C++ compression program based on Huffman's lossless compression algorithm and decoder.

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Huffman-Coding

Lepton
Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
Stars: ✭ 4,918 (+5971.6%)
Mutual labels:  compression, decompression, compression-algorithm, lossless-compression-algorithm
huffman-javascript
Huffman encode/decode text
Stars: ✭ 20 (-75.31%)
Mutual labels:  huffman-coding, huffman-algorithm, huffman-tree, huffman-compression-algorithm
gpuhd
Massively Parallel Huffman Decoding on GPUs
Stars: ✭ 30 (-62.96%)
Mutual labels:  huffman, decompression, huffman-coding, huffman-decoder
decompress
Pure OCaml implementation of Zlib.
Stars: ✭ 103 (+27.16%)
Mutual labels:  compression, huffman, decompression
huffman-coding
A C++ compression and decompression program based on Huffman Coding.
Stars: ✭ 31 (-61.73%)
Mutual labels:  compression, decompression, huffman-coding
kanzi-cpp
Lossless data compression in C++
Stars: ✭ 60 (-25.93%)
Mutual labels:  compression, huffman, lossless-data-compression
raisin
A simple lightweight set of implementations and bindings for compression algorithms written in Go.
Stars: ✭ 17 (-79.01%)
Mutual labels:  compression, huffman, decompression
em inflate
Fast, small, in-memory inflate (zlib, deflate and gzip decompression)
Stars: ✭ 59 (-27.16%)
Mutual labels:  compression, huffman, compression-implementations
lzbase62
LZ77(LZSS) based compression algorithm in base62 for JavaScript.
Stars: ✭ 38 (-53.09%)
Mutual labels:  compression, compression-algorithm
Util
A collection of useful utility functions
Stars: ✭ 201 (+148.15%)
Mutual labels:  compression, decompression
image-comp-lib-rust
Image Compression Algorithm
Stars: ✭ 30 (-62.96%)
Mutual labels:  compression, compression-algorithm
EasyCompressor
⚡ A compression library that implements many compression algorithms such as LZ4, Zstd, LZMA, Snappy, Brotli, GZip, and Deflate. It helps you to improve performance by reducing Memory Usage and Network Traffic for caching.
Stars: ✭ 167 (+106.17%)
Mutual labels:  compression, decompression
Rust Brotli
Brotli compressor and decompressor written in rust that optionally avoids the stdlib
Stars: ✭ 504 (+522.22%)
Mutual labels:  compression, decompression
pyrus-cramjam
Thin Python wrapper to de/compression algorithms in Rust - lightweight & no dependencies
Stars: ✭ 40 (-50.62%)
Mutual labels:  compression, decompression
BrotliSharpLib
Full C# port of Brotli compression algorithm
Stars: ✭ 77 (-4.94%)
Mutual labels:  compression, decompression
Compress
Optimized Go Compression Packages
Stars: ✭ 2,478 (+2959.26%)
Mutual labels:  compression, decompression
Minlzma
The Minimal LZMA (minlzma) project aims to provide a minimalistic, cross-platform, highly commented, standards-compliant C library (minlzlib) for decompressing LZMA2-encapsulated compressed data in LZMA format within an XZ container, as can be generated with Python 3.6, 7-zip, and xzutils
Stars: ✭ 236 (+191.36%)
Mutual labels:  compression, decompression
Xz
Pure golang package for reading and writing xz-compressed files
Stars: ✭ 330 (+307.41%)
Mutual labels:  compression, decompression
Compressonator
Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs
Stars: ✭ 785 (+869.14%)
Mutual labels:  compression, decompression
Fflate
High performance (de)compression in an 8kB package
Stars: ✭ 547 (+575.31%)
Mutual labels:  compression, decompression

Huffman Coding

MIT License linkedin open issues closed issues

Self-made C++ file archiver and archive extractor programs based on Huffman's lossless compression algorithm

Table of Contents

How does it work?

You can check out documentation inside Compressor.cpp and Decompressor.cpp files to help you understand Huffman's algorithm's inner workings.

Compressor:

The Compressor is a 2-pass program. What I mean by this is that the Compressor reads input files twice.

In the first pass, the program counts usage frequency of every unique byte and creates a weighted translation tree for every used unique byte inversely proportional to its usage frequency and then writes this transformation info to the compressed file for decompression purposes

In the second pass, the program translates input files according to the translation tree and writes it to the newly created compressed file

Decompressor:

The Decompressor is a 1-pass program: The Decompressor first reads translation info and creates a binary tree from it. After this process is done, it uses this binary translation tree to decode the rest of the file

How to use it?

  1. Compile with make using your favourate shell:
make all
  1. After running make, you can use archive command below to compress the file you want:
  • To compress one file use:
./archive {{filename}}
  • To compress multiple files use:
./archive {{filename1}} {{filename2}} ...
  1. And to decompress a compressed file, use the extract command below:
./extract {{filename}}

Versions

  • Version 2.0(Latest Version)
    • Can compress any file and folder you want
    • Useful for educative purposes
    • Uses more functionalized structure
  • Version 1.0
    • Compresses multiple files
    • Version 1.0 can not be used to compress folders
  • Version 0.9
    • Compresses 1 file at a time
    • Version 0.9 can not be used to compress folders
    • Easier to understand
    • Useful for educative purposes
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].