Store images as YUV instead of RGB when possible

NEW
Unassigned

Status

()

Core
ImageLib
3 years ago
3 years ago

People

(Reporter: seth, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gfx-noted])

(Reporter)

Description

3 years ago
Since images in YUV format can consume half the memory of the same image in RGB format, we should store images in YUV form when possible. In particular, since JPEGs are natively YUV, we can store them as YUV losslessly.

There's broad support for YUV textures on most GPUs, but our software rendering backends aren't compatible with YUV, so we'll only be able to do this with layerized images.

Let's consider this a metabug for implementing this feature, because there are several things that need to be done:

- We need to add support for YUV images to the SurfaceCache, RasterImage, and imgFrame.

- We need to update nsJPEGDecoder to support generating YUV images.

- We should look into support downscale-during-decode in combination with YUV output.

- We need to update our image layerization heuristics to ensure that we can use YUV image surfaces whenever possible.

- We need to look into whether we need to support any devices that do not support YUV textures, and if so, detect that situation and disable them.
Whiteboard: [gfx-noted]
You need to log in before you can comment on or make changes to this bug.