How firefares2005/frs works
FRS is a lossy image codec exposed through a command-line tool, a C++ facade, and Python bindings. The main workflow reads an image, encodes it into FRS bytes, and writes the result; decoding reads FRS bytes and writes a restored image. The README documents the codec stages and Python utilities, but most encoder and decoder implementations were not sampled, so internal stage links follow that documentation rather than inspected call sites.
Main entry points: main.cpp CLI · pyfrs.cpp Python bindings · encoder.cpp Image encoder · decoder.cpp Image decoder
Components 15
User interfaces
- CLI
src/main.cpp - C++ facade
frs.cpp - Python bindings
python_bind/pyfrs.cpp
Codec runtime
- Image encoder
src/encoder.cpp - Color conversion
src/encoder.cpp - Wavelet transform
src/wavelet.h - Subband quantization
src/encoder.cpp - SPIHT coding
src/spiht.h - Range coder
src/entropy.cpp - Image decoder
src/decoder.cpp
Image and format I/O
- Image I/O
src/image_io.cpp - FRS bytes
Python utilities
- Python utilities
python_bind/pyfrs.cpp
Other components
- Caller
- Image file
Connections 28
- Caller → CLI: invokes
- Caller → C++ facade: calls
- Caller → Python bindings: calls
- CLI → Image I/O: reads image
- CLI → Image encoder: encodes image
- Image encoder → FRS bytes: produces bytes
- CLI → FRS bytes: writes bytes
- CLI → FRS bytes: reads bytes
- CLI → Image decoder: decodes bytes
- CLI → Image I/O: writes image
- C++ facade → Image I/O: loads or saves
- C++ facade → Image encoder: encodes image
- C++ facade → Image decoder: decodes bytes
- Python bindings → C++ facade: calls facade
- Python bindings → Image encoder: encodes image
- Python bindings → Image decoder: decodes bytes
- Python bindings → Image I/O: writes image
- Image encoder → Color conversion: converts color
- Color conversion → Wavelet transform: transforms
- Wavelet transform → Subband quantization: provides coefficients
- Subband quantization → SPIHT coding: quantizes for
- SPIHT coding → Range coder: codes symbols
- Image decoder → Range coder: decodes symbols
- Image decoder → Wavelet transform: reconstructs image
- Python bindings → Python utilities: provides
- Python utilities → Image I/O: loads images
- Python utilities → Image encoder: benchmarks encode
- Python utilities → Image decoder: compares decode