Search code examples
algorithmmatlabcompressiondeflate

Deflate algorithm in Matlab


I need to make a Deflate code in Matlab. I understood how to make a file, comressed by matlab with matlab.io.hdf4.sd.getcompinfo and H5P.set_deflate(plist_id,level), but I guess that its not what exactly I want.

I need to compress bitstream of the image by Deflate and by my algorithm and compare output bitstreams. Maybe I just don't understand how to do it by standart functions? I need assistance anyway.


Solution

  • Just use the gzip already built in to MATLAB. If you really want just the deflate payload in the gzip file, then you can strip the gzip header and trailer.

    Your need to "compare output bitstreams" is odd. What are you looking for? Note that there can be many deflate compressions of the same input data that are all valid.