Search code examples
compressionmp4image-compressioninformation-theorylossy-compression

good compression method or library for time-sequence of float matrix (mp4 for int matrix case though)


question

Suppose I have a sequence of float matrix, which has strong temporal correlation. How to compress such a float matrix sequence? I think, it could be nice if there is a method which considers both spatial and temporal correlation as in mp4.

actual problem

I have two sequences, uint8 matrix sequence (RGB Image) and float matrix sequence (Depth Image). The uint8 matrix sequence can be compressed very well by mp4. And, I want to do the similar thing for float sequence because it's size is huge.


Solution

  • For a sequence of floats that are slowly changing, as you imply, the easiest thing to do is subtract the previous value from all but the first value. Then take those differences and send only the significant portion. "Significant" is defined by what you know about your data and the accuracy of the samples. Then use a lossless compressor on that (e.g. gzip).