Closed Bug 1906720 Opened 11 months ago Closed 10 months ago

Use same interface to convert YUV data w/ or w/out alpha to BGR* buffer

Categories

(Core :: Graphics, task, P1)

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

Details

Attachments

(7 files)

Since PlanarAlphaData is included in PlanarYCbCrData, ConvertYCbCrAToARGB(const layers::PlanarYCbCrData& aYCbCr, const layers::PlanarAlphaData& aAlpha, ... ) can be reduced to ConvertYCbCrAToARGB(const layers::PlanarYCbCrData& aYCbCr, ...) and it makes sense to have a general API to convert the given YUV data into a BGRA buffer.

Depends on D215159

Depends on D215952

Depends on D215953

Summary: Create a general API to convert YUV data w/ or w/out alpha to a BGRA buffer → Extend YUV-to-BGR conversion with alpha data
Attachment #9411593 - Attachment description: Bug 1906720 - Simplify t0-8-bit-color conversion → Bug 1906720 - Simplify to-8-bit-color YUV data conversion
Attachment #9411597 - Attachment description: Bug 1906720 - Create a API to convert YUV(A) to BGRA buffer → Bug 1906720 - Create a YUV(A)-to-BGR* conversion function

Currently, ConvertYCbCrAToARGB is only used in nsAVIFDecoder and the
usage doesn't scale the image, so ConvertYCbCrAToARGB can be replaced
with the ConvertYCbCrToRGB32 introduced in the previous patch.

Depends on D215956

Summary: Extend YUV-to-BGR conversion with alpha data → Use same interface to convert YUV data w/ or w/out alpha to BGR* buffer
Attachment #9411597 - Attachment description: Bug 1906720 - Create a YUV(A)-to-BGR* conversion function → Bug 1906720 - Introduce ConvertYCbCrToRGB32 for unified YUV to BGRA/BGRX conversion
Attachment #9411660 - Attachment description: Bug 1906720 - Replace ConvertYCbCrAToARGB w/ ConvertYCbCrToRGB32 → Bug 1906720 - Replace ConvertYCbCrAToARGB with ConvertYCbCrToRGB32 in nsAVIFDecoder

This patch simplifies the code path in nsAVIFDecoder. Previously,
nsAVIFDecoder relied on both ConvertYCbCrToRGB and
ConvertYCbCrToRGB32 to convert YUV data to BGRX or BGRA, depending on
the presence of an alpha channel. With recent changes, nsAVIFDecoder
can now use ConvertYCbCrToRGB32 exclusively to streamline the
conversion process.

Depends on D215985

Attachment #9411598 - Attachment description: Bug 1906720 - Remove ConvertYCbCrToRGBInternal → Bug 1906720 - Embed ConvertYCbCrToRGBInternal into ConvertYCbCrToRGB
Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8f96ec16bcec Simplify to-8-bit-color YUV data conversion r=gfx-reviewers,nical https://hg.mozilla.org/integration/autoland/rev/3050cc69ee08 Move YUV-to-RGB scaling conversion into a helper r=gfx-reviewers,nical https://hg.mozilla.org/integration/autoland/rev/a98ee51e1b1f Move YUV-to-RGB conversion into a helper r=gfx-reviewers,nical https://hg.mozilla.org/integration/autoland/rev/0bccf07f3774 Introduce ConvertYCbCrToRGB32 for unified YUV to BGRA/BGRX conversion r=gfx-reviewers,nical https://hg.mozilla.org/integration/autoland/rev/90cdcc49bcbd Replace ConvertYCbCrAToARGB with ConvertYCbCrToRGB32 in nsAVIFDecoder r=gfx-reviewers,nical https://hg.mozilla.org/integration/autoland/rev/745b3e3d9636 Simplify nsAVIFDecoder by using ConvertYCbCrToRGB32 exclusively r=gfx-reviewers,nical https://hg.mozilla.org/integration/autoland/rev/20f587028f0e Embed ConvertYCbCrToRGBInternal into ConvertYCbCrToRGB r=gfx-reviewers,nical
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: