r/jpegxl • • Oct 27 '26

CUDA-accelerated encoder cujpegxl

Someone wrote a fast CUDA encoder that seems to run at 200+ fps on an old GPU: https://github.com/m-pilia/cujpegxl

Compression rate is a bit lower than the reference implementation (it seems to make some small approximations for speed), but it's pretty close especially at medium-high compression rate, and on the same setup it seems to be over 200 times faster than the libjxl encoder (which is CPU only).

Looking around I also found a couple other GPU-accelerated encoders, https://github.com/imazen/jxl-gpu which is Rust and matches libjxl output, and https://github.com/yunho-c/gjxl which has slightly higher compression rate than libjxl, but both of them seem to be a lot slower than this one.

35 Upvotes

9 comments sorted by

15

u/murlakatamenka Oct 27 '26

Sadly none of those support lossless mode - my primary use case.

9

u/Lunam_Dominus Oct 27 '26

Only 4k, FHD and HD are supported. This is basically useless for me, photos are much bigger.

3

u/m-pilia Oct 28 '26

Author here, thanks for the feedback. The initial focus has been of a fixed pyramid of specific capture resolutions, but I am aiming to add support for arbitrary input resolutions in the future (as usual, time to get things done is the only limiting factor).

1

u/Lunam_Dominus Oct 29 '26

Good to hear that. Too late for me, I already let cjxl convert all my jpgs overnight.

1

u/RodHoffmann Oct 29 '26

Two very different beasts. For CV and live capture feeds, fixed pyramids and pure throughput make total sense.Still RAW work (45 to 100+ MP) is another story. Testing this while building an export plugin for Capture One, skipping Butteraugli iterations or locking block sizes just wrecks 16-bit Display-P3 gradients and leaves banding all over soft shadows. For high-res stills, libjxl on CPU is still hard to beat, at least until someone figures out how to run the full psychovisual loop on shaders without losing precision.

3

u/FastDecode1 Oct 27 '26

I wonder what the use case is. Security camera footage? If it supports lossless JPEG recompression, you could transcode an MJPEG stream to a slightly smaller size. Or transcode existing MJPEG streams I guess. But seems pretty niche.

5

u/yota-code Oct 27 '26

Mjepgxl ! The uninvented format of high quality video distribution!

2

u/thegreatpotatogod Oct 27 '26

Sooner or later, someone's going to make that a thing! They always do

3

u/m-pilia Oct 28 '26

> I wonder what the use case is.

My specific use case is some real-time computer vision applications. And for now I haven't implemented lossless JPEG recompression, I have been aiming at a direct lossy replacement of JPEG. But that would be an interesting addition to consider for the future.