dropbox / lepton

Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
https://blogs.dropbox.com/tech/2016/07/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs/
Apache License 2.0
5.01k stars 355 forks source link

Help needed in understanding certain parts of the program. #135

Open supercmmetry opened 4 years ago

supercmmetry commented 4 years ago

I have been studying the paper for lepton compression, and I understood all the concepts. However, I found that there were more features in the source code like edge compression etc.

In the paper, the DC coefficients are encoded per EOB threshold and so are the AC coefficients, but I didn't find any EOB groups in the code.

Can anyone explain how the AC and DC coefficients are being compressed ?

It would be helpful if the sequence of compression operations are explained in gist.

xiaoxiongli commented 4 years ago

the dc predict is work well. the ac1x7/7x1 and ac7x7 is not good becaue of: 1)for 1x7/7x1 ac: if we encode the diff of 1x7/7x1ac and orignal ac, some of the jpeg work well and others not well. 2)for 7x7 ac: we predict the abs value of it, so if we encode diff between predict value and orignal value, we have to save one more bit, so the final result is not good.

so how to improve the predict to improve the compression rate is not easy.