通过网络(远程屏幕广播应用程序)传输 JPEG 压缩的屏幕图块时,是否值得/推荐使用 zlib(或类似的)压缩?

发布于 2024-11-14 00:19:21 字数 442 浏览 2 评论 0原文

我开始用 C++(Windows 平台)实现某种远程截屏(类似 VNC)客户端/服务器软件,它只是通过网络传输屏幕更新(图像图块)。

在通过网络发送之前,屏幕被分成多个块,每个图块都被压缩为 JPEG(可能我会使用 libjpeg-turbo)。所以我的问题是,为这些(已经是 JPEG 压缩的)图块实现另一层压缩(无损)会好吗?例如使用 zlib?

我有一种感觉,zlib 不会在带宽方面提供任何显着的改进,因为 JPEG 文件已经被压缩了。我希望避免仅仅为了测试目的而投入更多的时间和金钱来实现额外的压缩层,所以我想听听您的建议。

PS:顺便问一下,除了将图块编码为 JPEG 之外,还有其他更好的选择吗?也许立即进行无损压缩?上述技术(将屏幕划分为图块 => 选择更新的图块 => 将它们压缩为 JPEG => 通过网络发送)是实现此类软件的好方法吗?

任何形式的输入将不胜感激!

I'm starting to implement some sort of remote screencasting (VNC-alike) client/server software in C++ (Windows platform), which just transmits the screen updates (image tiles) over the network.

The screen is divided in blocks and each tile is compressed into JPEG (probably I'll use libjpeg-turbo), before sending over network. So my question is, will it be good to implement another layer of compression (lossless) for these (already-JPEG-compressed) tiles, e.g. using zlib?

I have a feeling that zlib won't give any significant improvement in terms of bandwidth as the JPEG files will be already compressed. I'd like to avoid further time and money investment for implementing additional compression layer just for testing purposes, so I'd like to hear your suggestions.

P.S.: As a side question, are there any better alternatives than encoding tiles into JPEG? Maybe lossless compression right away? Is the above-mentioned technique (dividing screen into tiles => selecting updated tiles => compressing them into JPEG => sending over network) good way to implement such software?

Any kind of input would be much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独留℉清风醉 2024-11-21 00:19:21

JPEG 文件已经被压缩得几乎尽可能小。您可能会在标头上节省一些字节,但这可以通过额外压缩的开销来克服。

如果您需要进行快速检查来证明这一点,那么应该很容易压缩一组示例 jpeg 文件并看看有什么区别。

JPEG files are already compressed nearly as small as they can be. You might save a few bytes on the header, but that may be overcome by the overhead of the additional compression.

If you need to do a quick check just to prove the point, it should be easy to zip up a collection of sample jpeg files and see what the difference is.

我纯我任性 2024-11-21 00:19:21

完全没有必要。

更好的选择是使用这两种方法:对块中的颜色进行计数,并对少数颜色使用 zlib/rle/etc,对许多颜色使用 jpeg。这是非常基本的方法。我建议你看一下VNC的远程帧缓冲协议。

Absolutely unneccessary.

Better option is to use both methods: count the colors in the block and use zlib/rle/etc for few colors and jpeg for many. That's the very basic approach. I recommend you to take a look at the Remote Framebuffer Protocol of the VNC.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文