12-bit JPEG Codec on NVIDIA GPU
Updated:
Fastvideo's 12-bit JPEG codec extends our fully parallel Baseline CUDA JPEG codec to 12 bits per channel and runs entirely on the NVIDIA GPU. It keeps the high dynamic range of modern sensors and produces DICOM-conformant streams, which makes it a fit for RAW workflows, digital cinema and medical imaging.
Features
- Compliant with the 12-bit extension of the JPEG standard and with libjpeg / libjpeg-turbo
- Encode/decode of 12-bit grayscale and colour images of arbitrary width and height; HDR support
- Subsampling 4:4:4, 4:2:2, 4:2:0; quality 1–100; standard luma/chroma quantization and Huffman tables
- Input 12/16-bit PGM/YUV, 36/48-bit PPM/BMP; input/output from RAM/HDD/RAID/SSD/GPU; continuous data mode
- Floating-point colour transform, 2D DCT and quantization for higher accuracy
- DICOM-conformant JPEG streams; read/edit/write any EXIF section; FFmpeg MJPEG read/write (LGPL v2.1); OpenGL viewer
- Windows and Linux; tuned for the latest NVIDIA GPUs
12-bit JPEG benchmarks on NVIDIA GeForce RTX 4090
Test image: a ~50 MPix 14-bit RAW frame from a Canon 5DSR converted to a 36-bit colour PPM at 8736×5856. Encoding times, quality 90, all computations on GPU, timings exclude I/O, single-image mode:
| Mode | Encoding time (8736×5856, 36-bit) |
|---|---|
| Colour 4:4:4 | ~ 8.6 ms |
| Colour 4:2:2 | ~ 5.9 ms |
| Colour 4:2:0 | ~ 5.8 ms |
| Grayscale | ~ 3.9 ms |
Who needs a 12-bit JPEG codec
JPEG can carry either 8 or 12 bits per channel, and 12-bit preserves image quality that 8-bit loses. Since modern cameras capture 12 bits or more, the codec is useful for RAW image and video processing, digital cinema, and medical imaging with DICOM (X-ray, ultrasound, endoscopy, microscopy).
Part of the Fastvideo SDK
The 12-bit JPEG codec is a module of our CUDA Image & Video Processing SDK, so high-bit-depth JPEG coding can be the final stage of a full GPU pipeline.