Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compression Libraries for ARM Cortex M3/4

Tags:

compression

I need a proven compression library for ARM cortex M3 or 4. I will use this library for compressing some data from the peripherals before shipping out of the IC.

Any pointers would be appreciated. I have so far looked at LZ4c but it is not easy to get it working on ARM.

like image 906
user4749 Avatar asked Jul 20 '12 06:07

user4749


4 Answers

https://github.com/pfalcon/uzlib is highly optimized, minimal library (based on the earlier tinf library), which works with the standard DEFLATE/zlib/gzip compression. It can work in both memory buffer and streaming mode for decompression (in the latter case it can process files of unlimited size). For compression, it implements a simpler compression algorithm, but still formats result as a zlib compatible bitstream, so any other software can decompress it.

The library wouldn't have any problems running on Cortex-M0 (depending on dictionary size used, for small-RAM systems, values less than default 32KB should be used).

It's used in MicroPython https://github.com/pfalcon/micropython , where with ~40KB of free RAM, an application written in Python can download tarballs over TLS connection and decompress them into the filesystem (the "upip" package manager).

like image 116
pfalcon Avatar answered Jan 03 '23 12:01

pfalcon


If you have a standard C compiler, you have many choices. zlib, lz4, libbzip2, lzma.

like image 27
Mark Adler Avatar answered Jan 03 '23 11:01

Mark Adler


I really like BCL, it is a light weight, easy to integrate library. I've used it on Cortex M3 and M4 parts.

like image 44
Nick Avatar answered Jan 03 '23 12:01

Nick


I have spent some time to integrate LZ4. It is a nice one, 20KB data is compressed in 0.5mSec using an ARM Cortex M4. Stack requirement is about 16Kb (configurable down to 4). Good one.

like image 44
user4749 Avatar answered Jan 03 '23 12:01

user4749