Input: an intra-frame or a residue picture after motion compensation.
Task: Code the input picture into a bitstream and decode the picture from the generated bitstream.
Specifications: Implement a transform-based codec, consisting transform, quantization, and entropy coding. The block size can be 8x8, 16x16, or other reasonable sizes. As in most existing image/video codecs, you can use 2D DCT. A simple uniform quantizer could be used for verification purpose. For the entropy coding, you can use either Huffman coding or arithmetic coding
README
运行main函数,注意main函数用到了下面的Normalize函数
指定待处理的图片,依次对图片进行一下变换:
一、灰度化
二、8 * 8 DCT变换(这一步r)如果加上一个掩模可以去除图片中人眼不敏感的高频分量,从而进一步压缩图片
三、量化处理(采用JPEG亮度量化表,将DCT举证除以量化码表),由于量化后有取整操作,因此是有损压缩图片
四、Huffman编码,编码得到的比特流序列比原序列更加短小,进一步提高传输效率
五、发送方比特流序列传输(将上一步得到的比特流进行传输)
%中间对比了直接传输图片的比特