PNG:放气和zlib [英] PNG: deflate and zlib

查看:184
本文介绍了PNG:放气和zlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解PNG中的压缩-但我似乎是

I'm trying to understand compression in PNG - but I seem to

在网上找到很多矛盾的信息... 我想了解 -如何在带有链接列表的LZ77-part:哈希表中完成搜索?是在deflate中定义的吗?或在zlib中实现?可以选择搜索方式吗? -PNG编码器/解码器是否可以为压缩设置一些参数(策略,过滤器等),或者PNG是否有默认值? -LZ77-部分是否进行贪婪或懒惰评估?还是这个选项吗? -最后:2个霍夫曼树,它们是否在第三棵树中压缩,并且所有这三个树都已编码?还是只用它们的代码长度对两棵树进行编码?

find a lot of contradictory information online ... I would like to understand - how is searching done in the LZ77-part: hash table with linked lists? is this defined in deflate? or implemented in zlib? is there a choice of the search method? - can PNG encoders/decoders set some parameters for the compression (strategy, filter, etc.) or is there a default for PNG? - does the LZ77-part do greedy or lazy evaluation? or is this an option too? - and finally: the 2 Huffman trees, are they compressed in a third tree, and all three of them are encoded? or are the 2 trees encoded with only their codelengths?

zlib实现与其他deflate实现不同吗?也许那是我所有困惑的来源?

Is the zlib implementation different from other deflate implementations?? Perhaps that is where all my confusion comes from?

谢谢您的帮助!!我的新工作需要这个

Thank you for any help!! I need this for my new job

LuCu

推荐答案

PNG压缩位于 zlib 格式. zlib格式使用放气.通常使用的代码是 zlib库.

PNG compression is in the zlib format. The zlib format uses deflate. The code used is commonly the zlib library.

格式未指定用于压缩的算法. zlib库deflate算法使用哈希链在滑动窗口中搜索匹配的字符串. zlib的deflate需要几个参数来进行压缩调整-请参见 deflateInit2() .

The algorithm used for compression is not specified by the format. The zlib library deflate algorithm uses hash chains to search for matching strings in a sliding window. zlib's deflate takes several parameters for compression tuning -- see deflateInit2().

放气格式指定动态块前面的霍夫曼代码的压缩.文字/长度和距离代码的长度是游程长度,霍夫曼自己编码.

The deflate format specifies the compression of the Huffman codes at the front of dynamic blocks. The literal/length and distance code code lengths are run-length and Huffman coded themselves.

LZMA SDK Google的zopfli ,这两种方法都使用更密集的方法,这些方法需要更多时间才能获得较小的压缩增益.

There are other implementations of deflate compressors in the LZMA SDK and Google's zopfli, where both of those use more intensive approaches that take more time for small gains in compression.

这篇关于PNG:放气和zlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆