GPU JPEG — JPEG Compression on the GPU

Updated:

GPU JPEG means running JPEG image compression and decompression on the graphics processor instead of the CPU. A JPEG image splits into thousands of independent blocks, so the algorithm maps naturally onto the many cores of an NVIDIA GPU: a GPU can compress a high-resolution image stream in real time while the CPU stays free for acquisition, camera control, and analysis. This page explains how JPEG is accelerated on the GPU and where it is used. For Fastvideo’s implementation, measured speed, and downloads, see the fastest JPEG codec on GPU.

Why compress JPEG on the GPU

Modern machine vision and cinema cameras produce image data faster than a CPU can compress it: a single 24 MPix sensor running at tens of frames per second generates gigabytes of data every second. A GPU JPEG codec keeps up with that stream in real time, compressing frames as they arrive instead of letting them pile up in memory. Because every stage runs on the GPU, the CPU stays free, and the compressed output is a small fraction of the raw size — which lowers storage cost and network bandwidth for recording, streaming, and remote workflows.

How JPEG is accelerated on the GPU

A JPEG image splits naturally into a large number of independent 8×8 and 16×16 blocks, and that structure maps directly onto the thousands of cores of an NVIDIA GPU. A full GPU implementation parallelizes every stage of the algorithm, including the RLE and Huffman entropy coding that is usually treated as strictly serial, so no part of the pipeline falls back to the CPU. The entropy codec is the hardest stage to parallelize, and it is what ultimately limits the throughput of any JPEG codec — accelerating it on the GPU is the core of a fast implementation. The color transform, 2D DCT, and quantization are computed in floating point and rounded afterwards, which keeps accuracy high.

Fast decoding on the GPU depends on restart markers embedded in the JPEG stream: they split the bitstream into independent segments that can be decoded in parallel. Restart markers are a standard, optional part of the JPEG specification, so files that carry them are ordinary, fully compliant JPEGs — any standard JPEG decoder, on any platform, reads them normally. A JPEG saved without restart markers is still a valid image, but it has no segments to decode in parallel and cannot be read as fast, however powerful the GPU.

What a GPU JPEG codec supports

Where GPU JPEG is used

Fastvideo GPU JPEG products

GPU JPEG is implemented in several Fastvideo products. For measured performance and downloads, start here:

See also all Fastvideo benchmarks and applications.

GPU JPEG FAQ

What is GPU JPEG?

GPU JPEG is JPEG image compression performed on a GPU instead of the CPU: thousands of cores encode the image blocks in parallel, which is many times faster than a CPU JPEG encoder.

Why is JPEG on GPU faster than on CPU?

A GPU runs the DCT, quantization and Huffman stages of many 8×8 blocks at once, and the image stays in GPU memory between stages, so there is no CPU bottleneck.

How to achieve good visual image quality in JPEG compression?

Use a high quality setting (about 90 or above) and full or light chroma subsampling (4:4:4 or 4:2:2); 4:2:0 gives smaller files at some color loss. Avoid re-compressing an already-compressed image.

What causes JPEG artifacts and where do they come from?

JPEG splits the image into 8×8 blocks and quantizes their DCT coefficients. Discarding high-frequency detail creates blocking (visible squares), ringing and mosquito noise near sharp edges, and color bleeding from chroma subsampling. Artifacts grow as quality drops or after repeated re-encoding.

Can JPEG store a color profile info?

Yes — a JPEG (JFIF) file can embed an ICC color profile in APP2 markers, so color-managed applications reproduce colors correctly. Some encoders omit it and many web pipelines strip it to save bytes.

Fyodor Serzhenko, Fastvideo

About the author

Fyodor Serzhenko, PhD, is the founder and CEO of Fastvideo. He earned his PhD at the Moscow Institute of Physics and Technology (MIPT) in 1993. Since 2009 he has led the development of Fastvideo’s GPU-accelerated image codecs and ISP modules, including the Fastvideo SDK. Connect on LinkedIn.

Why you can trust these results

Fastvideo has built GPU-accelerated image processing software since 2009. Our codecs comply with the standards they implement — JPEG (ITU-T T.81 / ISO IEC 10918) and JPEG2000 (ITU-T T.800 / ISO IEC 15444) — and our tools are open source on GitHub. Every performance figure we publish is reproducible: see our benchmark methodology, download the Fastvideo SDK benchmark report (PDF), and measure it on your own GPU.

Contact Form

This form collects your name and email. See our Privacy Policy for how we handle your personal data.