Performance
This page reports what the JPEG encoder delivers in a working system, measured at the far end of the chain rather than in simulation. The encoder runs in an HDMI to USB video adapter on a Lattice CertusPro-NX: HDMI video enters the encoder, the codestream leaves the device as a USB video class stream, and a Linux host counts what arrives. The source is a quantumdata M42h generator, which supplies the video and the photographs.
Two figures describe a JPEG encoder in a video system. The compression ratio says how much smaller the image became; the bit rate says what the link behind it has to carry. Both are given here, over the quality scale and over seventeen photographs.
| Encoder | prt_jpeg_enc v2.0 |
| Device | LFCPNX-100 |
| Pixel rate | 4 pixels per clock at 150 MHz |
| Video | HDMI, RGB 8 bit, converted to YCbCr 4:2:2 |
| Formats | 3840 × 2160p60 and 1920 × 1080p60 |
| Read out over | USB 3 SuperSpeed, USB video class |
| Per measurement | 300 frames captured at the host |
Figure 1: every picture on this page left the encoder as JPEG and was captured at the host (click on the image to enlarge it)
One photograph across the quality scale
Quality sets the quantization tables, on the scale of the Independent JPEG Group: 50 is the table of the JPEG standard, higher keeps more of the image and costs more bytes. The photograph below is Plansee, a lake below a forested mountain, which holds a fair amount of detail. Every point runs at 60.00 frames per second.
Compression
video bytes in : codestream bytes out
Bit rate
what leaves the USB port, at 60 frames per second
Figure 2: compression and bit rate of one photograph over the quality scale
| Quality | Compression | Codestream per frame | Bit rate |
|---|---|---|---|
| 20 | 42 : 1 | 391 kB | 23.4 MB/s |
| 30 | 33 : 1 | 494 kB | 29.7 MB/s |
| 40 | 28 : 1 | 587 kB | 35.2 MB/s |
| 50 | 24 : 1 | 679 kB | 40.7 MB/s |
| 60 | 20 : 1 | 791 kB | 47.4 MB/s |
| 70 | 17 : 1 | 968 kB | 58.1 MB/s |
| 75 | 15 : 1 | 1.08 MB | 64.7 MB/s |
| 80 | 13 : 1 | 1.27 MB | 76.0 MB/s |
| 85 | 10 : 1 | 1.54 MB | 91.8 MB/s |
| 90 | 8 : 1 | 2.01 MB | 120.7 MB/s |
| Quality | Compression | Codestream per frame | Bit rate |
|---|---|---|---|
| 20 | 37 : 1 | 111 kB | 6.7 MB/s |
| 30 | 28 : 1 | 144 kB | 8.6 MB/s |
| 40 | 24 : 1 | 171 kB | 10.3 MB/s |
| 50 | 20 : 1 | 198 kB | 11.9 MB/s |
| 60 | 18 : 1 | 228 kB | 13.7 MB/s |
| 70 | 15 : 1 | 275 kB | 16.5 MB/s |
| 75 | 13 : 1 | 306 kB | 18.3 MB/s |
| 80 | 11 : 1 | 353 kB | 21.2 MB/s |
| 85 | 9 : 1 | 419 kB | 25.1 MB/s |
| 90 | 7 : 1 | 536 kB | 32.2 MB/s |
Test pictures
Compression is a property of the picture as much as of the encoder. The seventeen test pictures below come from the generator's own library and were encoded at 3840 × 2160p60 at three quality settings. A portrait against a quiet background and a canal in Amsterdam are four times apart at the same setting. All of them run at 60.00 frames per second.
What the three settings mean for the picture:
- Quality 25 — the smallest files on this page. The picture holds up, but the compression starts to show where the image is smooth and even, such as skin or a clear sky, and in fine detail against a flat background.
- Quality 50 — the quantization tables of the JPEG standard itself, the point the scale is defined around. On the pictures here it is the setting where the compression stops being visible.
- Quality 75 — the setting most photo software writes by default. Artefacts are hard to find without looking for them, at roughly twice the bandwidth of quality 25.
Each setting has two columns: Ratio is the compression, video bytes in against codestream bytes out, and Bandwidth is what that costs on the link at 60 frames per second.
Figure 3: the same face across the quality scale. Block artefacts show first in smooth skin, on the cheek and the forehead: plainly at quality 10, faintly at 25, and no longer at 50. Above 50 the picture does not visibly change; the setting buys margin. Shown at full size, straight from the encoder (click on the image to enlarge it)
| Picture | Quality 25 | Quality 50 | Quality 75 | ||||
|---|---|---|---|---|---|---|---|
| Ratio | Bandwidth | Ratio | Bandwidth | Ratio | Bandwidth | ||
![]() |
Portrait | 81 : 1 | 12.3 MB/s | 64 : 1 | 15.4 MB/s | 47 : 1 | 21.1 MB/s |
![]() |
Cruise ship | 64 : 1 | 15.5 MB/s | 48 : 1 | 20.8 MB/s | 34 : 1 | 28.8 MB/s |
![]() |
Oktoberfest | 61 : 1 | 16.2 MB/s | 44 : 1 | 22.3 MB/s | 28 : 1 | 35.1 MB/s |
![]() |
Winter mountain | 61 : 1 | 16.3 MB/s | 40 : 1 | 24.7 MB/s | 26 : 1 | 38.1 MB/s |
![]() |
Face colour patches | 51 : 1 | 19.3 MB/s | 36 : 1 | 27.0 MB/s | 25 : 1 | 39.1 MB/s |
![]() |
Winery | 49 : 1 | 20.2 MB/s | 32 : 1 | 30.6 MB/s | 20 : 1 | 47.7 MB/s |
![]() |
Zugspitze | 49 : 1 | 19.9 MB/s | 33 : 1 | 29.8 MB/s | 19 : 1 | 50.0 MB/s |
![]() |
Flowers | 47 : 1 | 21.0 MB/s | 31 : 1 | 31.3 MB/s | 20 : 1 | 47.4 MB/s |
![]() |
Harbor | 47 : 1 | 20.8 MB/s | 31 : 1 | 31.8 MB/s | 20 : 1 | 48.0 MB/s |
![]() |
Mountains | 47 : 1 | 20.8 MB/s | 31 : 1 | 31.4 MB/s | 20 : 1 | 47.7 MB/s |
![]() |
Sausalito | 41 : 1 | 24.2 MB/s | 27 : 1 | 35.7 MB/s | 19 : 1 | 52.1 MB/s |
![]() |
Forest | 38 : 1 | 25.6 MB/s | 23 : 1 | 42.1 MB/s | 14 : 1 | 67.9 MB/s |
![]() |
Plansee | 37 : 1 | 26.7 MB/s | 24 : 1 | 40.7 MB/s | 15 : 1 | 65.1 MB/s |
![]() |
Heidelberg | 30 : 1 | 32.2 MB/s | 20 : 1 | 49.6 MB/s | 13 : 1 | 75.3 MB/s |
![]() |
Tree in mono | 26 : 1 | 37.6 MB/s | 17 : 1 | 55.7 MB/s | 12 : 1 | 79.9 MB/s |
![]() |
Las Vegas | 24 : 1 | 40.5 MB/s | 16 : 1 | 61.7 MB/s | 10 : 1 | 94.1 MB/s |
![]() |
Amsterdam | 18 : 1 | 54.2 MB/s | 12 : 1 | 82.3 MB/s | 8 : 1 | 122.1 MB/s |
















