2

压缩 RGBA 32 位图像数据的最快算法是什么?我在 C 中工作,但很高兴看到其他编程语言的示例。

现在我正在使用 LZ4,但我正在考虑运行长度/增量编码。

无损编码,现实生活中的图像和计算机生成/剪贴画图像的混合。Alpha 通道始终存在,但通常是恒定的。

4

3 回答 3

3

我最终只使用了 LZ4。没有什么比这更快了,LZ4 通常至少减小了 50% 的尺寸。

于 2013-11-20T16:55:51.873 回答
1

Lossy or lossless?
"Real" images or computer graphics?
Do you actually have an alpha channel?

If you need lossless (or semi=lossless) then converting into YUV and compressing that will probably reduce by about 1/2 (after already having it in going to 2bytes/pixel) try Huffyuv

If you have real images then H264 can do very high compression and there are optomised libraries and HW support so it can be very fast.

If you have computer graphics type images with few colours but need to preserve edges, or you actually have an A channel then run length might be good - try splitting the image into per-colour frames first.

于 2012-10-07T02:24:36.330 回答
0

LZ4 是 LZ77 系列,它只有几行代码,但我自己从未做过,但我猜你是正确的运行长度或增量代码是最快的,也适合图像。还有snappy算法。最近我尝试使用 exdupe 实用程序来压缩我的虚拟机。这东西也快得不可思议:http ://www.exdupe.com 。exdupe 似乎使用了 rzip 东西:http ://encode.ru/threads/1354-Data-deduplication 。

于 2012-10-07T02:27:28.193 回答