Skip to content

By Huffmantree and HuffmantreeCode come true FILE COMPRESS AND DECOMPRESS

Notifications You must be signed in to change notification settings

wuye251/CompressAndDeCompress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello world!!!

目前压缩 步骤:

1. 统计各个字符出现的次数
2. 用小堆排序,获得从小到大的字符排序数组
3. 依据排序数组从下向上构建哈夫曼树
4. 访问各个路径生成哈夫曼编码
5. 将源文件内容转为二进制的字符,字节信息为哈夫曼编码拼接而成
6. 写入压缩文件内容:
	- 压缩前文件的后缀信息
	- 哈夫曼编码的对照信息
	- 原文件内容长度 以及压缩文件编码

目前测试txt png 可以进行压缩 mp4类型的压缩率不高

- txt 压缩率 根据文件大小而定(因为存在配置信息如 哈夫曼编码信息) 如果数据不大 那么压缩率不高  基本压缩率在80%左右
- png 压缩率在90%
- MP4 在99.8% ...  T_T 

待优化

- 大文件压缩实现较慢  时间复杂度较高
- 配置信息 如何处理压缩

About

By Huffmantree and HuffmantreeCode come true FILE COMPRESS AND DECOMPRESS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages