GPU Accelerated JPEG Rendering

Presented by Nathan Egge
Thursday 3:40 p.m.–4:25 p.m.
Target audience: Developer

Abstract

GPU Accelerated JPEG Rendering

JPEG is the de facto standard for natural image compression on the web. Most web browsers use the open source libjpeg-turbo for decoding JPEG files because a) it is libre software and b) there has been significant investment in SIMD optimization. However, in applications where the resulting image is immediately uploaded to the GPU for compositing (like in modern web browsers) this approach has two drawbacks:

  1. The full uncompressed image must be uploaded to the GPU
  2. Time spent decoding on the CPU robs computation from other tasks

These issues are exacerbated as more content is provided in high definition.

The jpeg_gpu project aims to solve both these problems by shifting the decode computation as early as possible to the GPU. Partially decoded JPEG data is uploaded as soon as the entropy coded symbols are read, and a set of pre-defined shaders complete the rest of the decode into a GPU texture. Depending on the resolution of the image and how much it is compressed, the speed-up can be significant.

This talk will cover how the jpeg_gpu library is designed to take maximum advantage of GPU parallelism. I will include a brief discussion of some trade-offs made when designing the shader routines based on experimentation. The real world performance of this approach will be discussed based on the integration of jpeg_gpu into the WebRenderer compositing engine in Servo.

Presented by

Nathan Egge

©2016 Linux Australia and linux.conf.au 2017. Linux is a registered trademark of Linus Torvalds. Site design by Takeflight. Image credits can be found on our Colophon.