Search code examples
matlabencodingcompressionhuffman-code

What type of entropy encoder does the MATLAB save() function use? I.e. how does that function work?


I am working on a compression project, and I used the default save() function in Matlab for the purpose of lossless (entropy) encoding. The transform module is all figured out.

I used the save() function to encode a 3d array that includes a bunch of zeros. I am sure that Matlab is using some kind of lossless compression with the save() function since, when I save that array, it ends up taking far less space than an array, say, containing no zeros at all. I had no success finding out what type of entropy encoding schemes are behind the function. Because it is a core part of the algorithm, I think I must at least know what is behind the function.

Plus, if you know any other type of entropy encoder that would do a better job in compressing a 3d array that contains zeros, I would really appreciate you sharing. Or, if you think I could easily write the code for that myself, then please let me know.


Solution

  • The v7 format uses deflate.

    The v7.3 format uses the HDF5 format, which supports gzip (deflate) and szip compression. It also has an option to not compress.