哈夫曼编码在文件压缩中的应用
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
南京邮电大学
毕业论文
题目哈夫曼编码在文件压缩中的应用专业计算机科学与技术(计算机通信)学生姓名
班级学号****** ********
指导教师孙知信
指导单位物联网学院
日期:年月日至年月日
毕业设计(论文)原创性声明
本人郑重声明:所提交的毕业设计(论文),是本人在导师指导下,独立进行研究工作所取得的成果。除文中已注明引用的内容外,本毕业设计(论文)不包含任何其他个人或集体已经发表或撰写过的作品成果。对本研究做出过重要贡献的个人和集体,均已在文中以明确方式标明并表示了谢意。
论文作者签名:
日期:年月日
摘要
在信息技术飞速发展的今天,大数据量的信息会给存储器的存储容量,通信干线信道的带宽,以及计算机的处理速度增加极大的压力。单纯靠增加存储器容量,提高信道带宽以及计算机的处理速度等方法来解决这个问题是不现实的,这时就要考虑压缩。压缩的关键在于编码,如果在对数据进行编码时,对于常见的数据,编码器输出较短的码字;而对于少见的数据则用较长的码字表示,就能够实现压缩。压缩机制是一种很方便的发明,尤其是对网络用户,因为它可以减小文件中的比特和字节总数,使文件能够通过较慢的互联网连接实现更快传输,此外还可以减少文件的磁盘占用空间。在下载了文件后,计算机可使用WinZip或Stuffit这样的程序来展开文件,将其复原到原始大小。如果一切正常,展开的文件与压缩前的原始文件将完全相同。
哈夫曼压缩一般用来压缩文本和程序文件。哈夫曼压缩属于可变代码长度算法一族。意思是个体符号(例如,文本文件中的字符)用一个特定长度的位序列替代。因此,在文件中出现频率高的符号,使用短的位序列,而那些很少出现的符号,则用较长的位序列。本课题使用哈夫曼编码方法实现对文本、图像或其他格式文件进行压缩和解压缩,研究各种文件类型在采用哈夫曼编码进行压缩的差别,并寻找一种使用哈夫曼编码对任意文件进行压缩和解压缩的解决方案。
本论文着重介绍了现有的哈夫曼编码现状,利用哈夫曼编码的原理,利用C++编写程序压缩软件,在针对文本压缩的基础上丰富对图片进行压缩的功能,然后再尝试对声音和视频压缩进行尝试。
关键词:压缩压缩算法哈夫曼编码
ABSTRACT
In today's rapid development of information technology, the bandwidth of the channel of the large amount of data will give memory storage capacity, communication lines, as well as computer processing speed increased a great deal of pressure. Simple to solve this problem by increasing the memory capacity, channel bandwidth and computer processing speed is unrealistic, then we must consider compression. Compression lies in coding, to encode data, for the common data, the encoder outputs a shorter codeword; rare data with a longer codeword, it is possible to achieve compression. Compression mechanism is a very convenient form of the present invention, especially the users of the network, because it can reduce the total number of bits and bytes in the file so that the file can be slower Internet connections to achieve faster transmission, and in addition can reduce the file disk space. Download file, the computer can use the program WinZip or Stuffit to expand the file, restoring it to its original size. If all goes well, the expanded file with the original file will be exactly the same before compression.
Huffman compression used to compress text and program files. Is a variable code length Huffman compression algorithm family. The meaning is the alternative bit sequence with a specific length of the individual symbols (e.g., the characters in the text file). Therefore, the high frequency symbols appear in the file, using a short sequence of bits, and those who rarely symbol, with a longer sequence of bits. This topic text, images, or other format file compression and decompression using Huffman coding method to study a variety of file types in the Huffman coding compression difference, and find a Huffman coding for any file compression and decompression solution.
The paper focuses on the the existing Huffman coding status quo, Huffman coding principle, the use of C + + write a program compression software compression for text compression based on the rich picture, and then try to sound and The video compression to try it.
Key words: Compression Compression algorithm Huffman coding