0Day Forums
Is there a faster lossy compression than JPEG? - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: C & C++ (https://zeroday.vip/Forum-C-C)
+--- Thread: Is there a faster lossy compression than JPEG? (/Thread-Is-there-a-faster-lossy-compression-than-JPEG)



Is there a faster lossy compression than JPEG? - Mrwashery4 - 07-27-2023

Is there a compression algorithm that is faster than JPEG yet well supported? I know about jpeg2000 but from what I've heard it's not really that much faster.

Edit: for compressing.

Edit2: It should run on Linux 32 bit and ideally it should be in C or C++.


RE: Is there a faster lossy compression than JPEG? - glutton875 - 07-27-2023

In what context? On a PC or a portable device?

From my experience you've got JPEG, JPEG2000, PNG, and ... uh, that's about it for "well-supported" image types in a broad context (lossy or not!)

(Hooray that GIF is on its way out.)


RE: Is there a faster lossy compression than JPEG? - blondiehfec - 07-27-2023

I think wavelet-based compression algorithms are in general slower than the ones using DCT. Maybe you should take a look at the JPEG XR and WebP formats.


RE: Is there a faster lossy compression than JPEG? - puddinglike819011 - 07-27-2023

Do you have MMX/SSE2 instructions available on your target architecture? If so, you might try [libjpeg-turbo](

[To see links please register here]

). Alternatively, can you compress the images with something like `zlib` and then offload the actual reduction to another machine? Is it imperative that actual lossy compression of the images take place on the embedded device itself?


RE: Is there a faster lossy compression than JPEG? - viaticum203656 - 07-27-2023

JPEG2000 isn't faster at all. Is it encoding or decoding that's not fast enough with jpeg? You could probably be alot faster by doing only 4x4 FDCT and IDCT on jpeg.

It's hard to find any documentation on IJG libjpeg, but if you use that, try lowering the quality setting, it might make it faster, also there seems to be a fast FDCT option.

Someone mentioned libjpeg-turbo that uses SIMD instructions and is compatible with the regular libjpeg. If that's an option for you, I think you should try it.


RE: Is there a faster lossy compression than JPEG? - anglicizedykfz - 07-27-2023

You could simply resize the image to a smaller one if you don't require the full image fidelity. Averaging every 2x2 block into a single pixel will reduce the size to 1/4 very quickly.


RE: Is there a faster lossy compression than JPEG? - rockcress679384 - 07-27-2023

Jpeg encoding and decoding should be *extremely* fast. You'll have a hard time finding a faster algorithm. If it's slow, your problem is probably not the format but a bad implementation of the encoder. Try the encoder from `libavcodec` in the `ffmpeg` project.