Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what compression algorithm to use for highly redundant data

This program uses sockets to transfer highly redundant 2D byte arrays (image like). While the transfer rate is comparatively high (10 Mbps), the arrays are also highly redundant (e.g. Each row may contain several consequently similar values). I have tried zlib and lz4 and the results were promising, however I still think of a better compression method and please remember that it should be relatively fast as in lz4. Any suggestions?

like image 267
beebee Avatar asked Aug 30 '13 16:08

beebee


People also ask

Which algorithm is best for data compression?

This is a basic example of run-length encoding; there are many schemes to reduce file size by eliminating redundancy. The Lempel–Ziv (LZ) compression methods are among the most popular algorithms for lossless storage.

Does compression reduce redundancy?

Lossless compression works by removing redundant data. These algorithms can usually reduce the number of bits required to store or transmit the data while guaranteeing that the original data can be perfectly reconstructed.

What are lossless compression algorithms used for?

Lossless compression algorithms are needed in cases where we want the reconstructed file output to be identical to the original output. Lossless compression is generally used for text compression: data such as database records, spreadsheets, and word processing files.

What type of data can be compressed using a lossless compression algorithm?

Lossless compression is generally used for so-called "discrete" data, such as database records, spreadsheets, word-processing files, and even some kinds of image and video information. Text compression is a significant area for lossless compression.


1 Answers

You should look at the PNG algorithms for filtering image data before compressing. They are simple to more sophisticated methods for predicting values in a 2D array based on previous values. To the extent that the predictions are good, the filtering can make for dramatic improvements in the subsequent compression step.

You should simply try these filters on your data, and then feed it to lz4.

like image 103
Mark Adler Avatar answered Oct 11 '22 18:10

Mark Adler