登录
首页 » Visual C++ » GifCodec

GifCodec

于 2015-01-17 发布 文件大小:428KB
0 85
下载积分: 1 下载次数: 7

代码说明:

  参考网上的资料写的gif编解码。 编码用gdi解析常用图片格式,然后组装成gif 解码吧gif的每一帧转换成dib gif文件格式网上有很多介绍 gif用的变长lzw压缩算法: 没弄懂原理,只知道过程。压缩取一个字符作为后缀,看看字符串是否存在。存在,用对应的编码作为前缀继续取;不存在把字符串添加到字典,前缀添加到输出流,后缀作为前缀继续取。解压取一个编码看看字典中是否存在。存在用对应的字符串的第一个字符作为后缀,看看当前字符串是否存在,不存在添加到字典中,后缀作为前缀,前缀对应的字符串添加到输出流,继续取;编码不存在,前缀对应的字符串的第一个字符作为后缀(这时当前字符串肯定不存在,字典中下一个可用编码肯定等于刚取出的编码),字符串添加到字典中,编码作为前缀,前缀对应的字符串添加到输出流,继续取。 编码流转换成字节流是按位从低到高的,window是小端模式(低字节在低地址),字节内低位在右边。 24位dib转换成8位dib时使用的八叉树算法 图片拉伸时参考的网上的双线性插值算法。 字典满了位数加一,位数是12时不加(Online reference materials written gif codec. Encoded using gdi resolve common image formats, and then assembled into a gif Each frame decode it into a gif dib There are many online gif file format introduced gif lzw with variable length compression algorithm: Did not understand the principle, only know the process. Compression takes a character as a suffix, and see if there is a string. Exist as a prefix to continue to take with the corresponding encoding there is no string to add to the dictionary, a prefix added to the output stream, the suffix as a prefix to continue to take. Take a look at extracting coding dictionary exists. Exist with the corresponding first character string as a suffix to see the current string exists, there is no add to the dictionary, the suffix as a prefix, the corresponding string to the output stream, continue to take coding does not exist, prefix corresponding first character string as a suffix (when the current string certainly does not exis)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696524资源总数
  • 103827会员总数
  • 23今日下载