Lossless segmentation-map compression toolkit with two binaries:
encoder: encodes input maps into a compressed bitstreamdecoder: decodes compressed bitstreams back to output maps
Install a C++ compiler and build tools.
- macOS (Xcode Command Line Tools):
xcode-select --install- Linux (example for Debian/Ubuntu):
sudo apt update
sudo apt install -y g++ make cmakeIf you already have this repository locally, skip this section.
mkdir -p ~/workspace
cd ~/workspace
git clone <your-repo-url> losslesssegmentationmapcompression
cd losslesssegmentationmapcompressionFrom the repository root:
makeThis builds:
./encoder./decoder
To clean artifacts:
make cleanFrom the repository root:
mkdir -p build
cd build
cmake ..
cmake --build . -jBinaries are generated in the build output directory.
From the repository root (for Makefile build):
./encoder -i input.yuv -o output.bin -r 1024 -c 2048 -f 1 -s 0 -t 400./decoder -i output.bin -o recover.yuv-i: input file (.yuv)-o: output bitstream file-r: rows-c: cols-f: frame count-s: skip frame count-t: type (400or420)
-i: encoded input file (.bin)-o: reconstructed output file (.yuv)
source/
commonlib/
third_party/
encoder/
decoder/
Makefile
CMakeLists.txt
- The codebase currently compiles with warnings on strict flags; binaries are still produced.
- If
cmakeis unavailable, use the Makefile flow (make).
- Runyu Yang, Junqi Liao, Hyomin Choi, Fabien Racapé, and Ivan V. Bajić
- Amir Said and William A. Pearlman
Reference implementation files:
source/arithmetic_coder/third_party/arithmetic_codec.hsource/arithmetic_coder/third_party/arithmetic_codec.cpp
If you use this repository in academic work, please cite both this project and the original arithmetic coding reference.
@article{yang2026context,
title={Context Adaptive Extended Chain Coding for Semantic Map Compression},
author={Yang, Runyu and Liao, Junqi and Choi, Hyomin and Racapé, Fabien and Bajić, Ivan V.},
journal={arXiv preprint arXiv:2603.03073},
year={2026},
url={https://arxiv.org/pdf/2603.03073}
}@incollection{said2003arithmetic,
author = {Amir Said},
title = {Arithmetic Coding},
booktitle = {Lossless Compression Handbook},
editor = {Khalid Sayood},
pages = {101--152},
year = {2003},
publisher = {Academic Press}
}