How petrosgeorgiouu/huffcompression-lab works
This is a C++17 Huffman file codec. The principal workflow is a user invoking compression or decompression on files: compression scans byte frequencies, builds and serializes a Huffman tree, then writes encoded data; decompression reads the archive header and tree, then decodes blocks to an output file. The repository also documents corpus-ratio measurement and whole-file performance benchmarks. Core call relationships are supported by the sampled compression and decoder code and the SOURCE INDEX; unsampled decompression and measurement links rely on README documentation, so their internal steps are not expanded.
Main entry points: Compression.cpp Compressor · Decompression.cpp Decompressor · HuffmanTree.cpp Huffman tree · huff.cpp Compression CLI
Components 18
Codec workflows
- Compression CLI
apps/huff.cpp - Compressor
src/Compression.cpp - Decompression CLI
apps/dehuff.cpp - Decompressor
src/Decompression.cpp
Encoding internals
- Frequency scan
src/FrequencyTable.cpp - Huffman tree
src/HuffmanTree.cpp - Priority queue
include/huffman/UniquePtrPriorityQueue.hpp - Bit writer
src/BitWriter.cpp
Decoding internals
- Bit reader
src/BitReader.cpp - Huffman decoder
src/HuffmanDecoder.cpp
Measurements
- Corpus measurements
benchmarks/corpus.cpp - Performance benchmarks
benchmarks
Other components
- User
- Input file
- Huffman archive
- Decoded file
- Text corpus
- Benchmark workloads
Connections 20
- User → Compression CLI: invokes
apps/huff.cpp - Compression CLI → Compressor: calls
apps/huff.cpp - Compressor → Input file: reads
src/Compression.cpp - Compressor → Frequency scan: scans frequencies
src/Compression.cpp - Compressor → Huffman tree: builds tree
src/Compression.cpp - Huffman tree → Priority queue: uses queue
src/HuffmanTree.cpp - Compressor → Bit writer: writes archive
src/Compression.cpp - Huffman tree → Bit writer: serializes tree
src/HuffmanTree.cpp - Compressor → Huffman archive: writes
src/Compression.cpp - User → Decompression CLI: invokes
README.md - Decompression CLI → Decompressor: calls
README.md - Decompressor → Huffman archive: reads
README.md - Decompressor → Bit reader: reads bits
src/Decompression.cpp - Decompressor → Huffman decoder: decodes with
src/Decompression.cpp - Huffman decoder → Bit reader: consumes bits
src/HuffmanDecoder.cpp - Decompressor → Decoded file: writes
README.md - User → Corpus measurements: runs
README.md - Corpus measurements → Text corpus: measures
README.md - User → Performance benchmarks: runs
README.md - Performance benchmarks → Benchmark workloads: processes
README.md