+ Pack buffers from 2 bytes size for easy package framing❗
++ zeroes elimination and adaptable compression in one step
(click to expand)
-
Usual compressors cannot succeed on very small buffers (2...100 bytes), because they add translation information to the data:
echo "try this" | gzip -c | wc -c 29 echo "Compress this normal line with 42 letters." | gzip -c | wc -c 63 echo "Compress this text and see how long it is afterwards. Today is a beautiful day. This example consists of 117 letters." | gzip -c | wc -c 117
-
TiP is an adaptable very-short-buffer packer, suitable for embedded devices. Like COBS it removes all zeroes from the data, but additionally tries data compression.
-
The TiP worst-case overhead is 1 byte per each starting 7 bytes (+14%) or 1 byte for 3 uncompressable data bytes (+33%), but the expected average packed size is about 50% or less of the unpacked data. (For comparism: COBS adds 1 byte overhead per each starting 255 bytes, but does not compress at all.)
-
Like TCOBS, TiP can already compress 2 bytes into 1 byte but is expected to do better on arbitrary data (similar to samples) with a bit more computing effort.
--> Experimental state!
+ You can try it out!
- C-Code usable on embedded devices inside src folder containing:
- idTable.c - a generated data specific translation table
- ti_pack.c and ti_unpack.c - separately or together compilable
- PC apps:
ti_generate
- tiny generator to create a suitableidTable.c
fileti_pack
- tiny pack using the pack C code mainly for teststi_unpack
- tiny unpack using the unpack C code mainly for tests
See the Tip User Manual.
- Create
tipTable.h
Generatorti_generate
. - Create
pack.c
andunpack.c
and test. - Write Tip User Manual.
- Selectable unreplacable converter bit count (6 or 7).
- Optimization for unreplacables.
- Improve
ti_generate
to optimize pattern selection. - Extend ti_generate to find best settings automatically.
- Build
tip
executable, which accepts stdin and writes to stdout. - Write extensive tests.
- Write fuzzy tests.
- Remove 65528 bytes limitation.
- Compare automatic with:
- Improve TiP pack code for speed and less RAM usage.
- Write TiP unpack code in Go.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Thomas Höhenleitner - th@seerose.net
Project Link: https://github.com/rokath/tip