How does WinRAR perform a compression ratio check?

爱⌒轻易说出口 提交于 2019-12-05 01:53:22

问题


E.g. how can it tell that a 4GB text file can be compressed to, say, 200MB? Obviously, it doesn't read all of the contents in 2 or so seconds... so what kind of predictive algorithm(s) does it use?


回答1:


They use variant of Prediction by partial matching (PPM) called PPMd. Look at wiki




回答2:


It takes usually -log(x) + log(2) bits to compress x bits. However this is a highly theoretical value and it depends heavenly on the data you want to compress. For your data you have to record each character and frequency and insert it in the formula. For example try only 3 character first. You want to look for shannon-code.



来源:https://stackoverflow.com/questions/5450489/how-does-winrar-perform-a-compression-ratio-check

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!