News for hackers. Stuff that matters.
Re:Heatshrink: Data compression library for embedded/real-ti... by vbezhenar on Thursday September 30, 2021 @03:35AM (#28704015)
What would be a good approach to compress not just a steam of arbitrary bytes, but a stream of 4-byte numbers which are similar to each other (like some sensor output)?
Re:Heatshrink: Data compression library for embedded/real-ti... by formerly_proven on Thursday September 30, 2021 @06:05AM (#28704687)
Look into time-series compression. Delta-encoding, mentioned by sibling, is a very old but effective technique also known as differential PCM. You can also delta-encode delta-encoded values, which works especially well for values whose delta is constant (classic example: timestamped data). The advantage of these over general purpose compressors is that they require basically no resources to implement. TFA is "low memory usage (as low as 50 bytes)", but delta encoding needs just one register.
Re:Heatshrink: Data compression library for embedded/real-ti... by nitrogen on Thursday September 30, 2021 @05:44AM (#28704598)
You could start by encoding the deltas using variable length encoding, so a 0 delta could be as little as 1 bit. But anything off-the-shelf should be able to compress this type of data well.