简体   繁体   English

面向分组的无损压缩库

[英]Packet oriented lossless compression library

Does anyone know of a free (non-GPL), decently performing compression library that supports packet oriented compression in C/C++? 有谁知道在C / C ++中支持面向数据包压缩的免费(非GPL),性能良好的压缩库?

With packet oriented, I mean the kind of feature QuickLZ (GPL) has, where multiple packets of a stream can be compressed and decompressed individually while a history is being maintained across packets to achieve sensible compression. 对于面向数据包,我的意思是QuickLZ (GPL)具有的功能,其中流的多个数据包可以单独压缩和解压缩,同时跨数据包维护历史记录以实现合理的压缩。

I'd favor compression ratio over CPU usage as long as the CPU usage isn't ridiculous, but I've had a hard time finding this feature at all, so anything is of interest. 只要CPU使用率不是很荒谬,我就赞成压缩比而不是CPU使用率,但我很难找到这个功能,所以任何事情都有意义。

zlib's main deflate() function takes a flush parameter, which allows various different flushing modes. zlib的主deflate()函数采用flush参数,允许各种不同的刷新模式。 If you pass Z_SYNC_FLUSH at the end of each packet, that should produce the desired effect. 如果您在每个数据包的末尾传递Z_SYNC_FLUSH,那么应产生所需的效果。

The details are explained in the zLib manual . 有关详细信息,请参阅zLib手册

bzip2 has flushing functionality as well, which might let you do this kind of thing. bzip2也具有刷新功能,可能会让你做这种事情。 See http://www.bzip.org/1.0.5/bzip2-manual-1.0.5.html#bzCompress http://www.bzip.org/1.0.5/bzip2-manual-1.0.5.html#bzCompress

Google's Snappy may be a good option, if you need speed more than compression and are just looking to save a moderate amount of space. 谷歌的Snappy可能是一个不错的选择,如果你需要速度而不是压缩,并且只是想节省适量的空间。

Alternatively, Ilia Muraviev put a small piece of compression code called BALZ in public domain some time ago. 另外,Ilia Muraviev不久前在公共领域中放了一小段压缩代码BALZ It is quite decent for many kinds of data. 它适用于多种数据。

Both of these support stream flushing and independent state variables to do multiple, concurrent streams across packets. 这两个都支持流刷新和独立状态变量来跨数据包执行多个并发流。

Google's new SPDY protocol uses zlib to compress individual messages, and maintains the zlib state for the life of the connection to achieve better compression. Google的新SPDY协议使用zlib压缩单个消息,并在连接的生命周期内维护zlib状态以实现更好的压缩。 I don't think there's a standalone library that handles this behavior exactly, but there are several open-source implementations of SPDY that could show you how it's done. 我不认为有一个独立的库可以完全处理这种行为,但有几个SPDY的开源实现可以告诉你它是如何完成的。

The public domain Crush algorithm by Ilia Muraviev has similar performance and compression ratio as QuickLZ has, Crush being a bit more powerful. Ilia Muraviev的公共领域Crush算法具有与QuickLZ相似的性能和压缩比,Crush功能更强大。 The algorithms are conceptually similar too, Crush containing a bit more tricks. 算法在概念上也是相似的,Crush包含更多技巧。
The BALZ algorithm that was already mentioned earlier is also by Ilia Muraviev. 之前已经提到过的BALZ算法也是由Ilia Muraviev提出的。
See http://compressme.net/ http://compressme.net/

may be you could use lzma compression SDK , it's written and placed in the public domain by Igor Pavlov. 也许你可以使用lzma压缩SDK ,它由Igor Pavlov编写并放置在公共领域。

And since it can compress stream files, and has memory to memory compression I think it's possible to compress packet stream (may be with some changes) but not sure. 并且由于它可以压缩流文件,并且具有内存到内存压缩,我认为可以压缩数据包流(可能有一些更改)但不确定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM