This code was copied from the png decoder but it is only applicable to the png decoder because it produces output in rgb order. Whereas the avif decoder produces data in BGR order.
Differential Revision: https://phabricator.services.mozilla.com/D220088
This code was copied from the png decoder but it is only applicable to the png decoder because it produces output in rgb order. Whereas the avif decoder produces data in BGR order.
Differential Revision: https://phabricator.services.mozilla.com/D220088
Color management is usually handled in the SurfacePipe, but SurfacePipe is RGB(A) only, and qcms can only operator on grayscale images in grayscale format, not RGB(A). So we must handle the qcms operation in the decoder. This is the same as how the png decoder handles this same situation. One additional wrinkle is that gfx::ConvertYCbCrToRGB32 only outputs RGB even for grayscale input data so we have to create an intermediate grayscale copy of the data for qcms to work on.
Recording command lines here that were used to create the test in case it needs to be modified or extended in the future.
Convert png to grayscale or grayscale + alpha
ffmpeg -i file.png -pix_fmt gray file-gray.png
ffmpeg -i file.png -pix_fmt ya8 file-gray.png
Extract icc profile from png
exiftool -icc_profile -b -w icc file.png
Add icc profile to png
exiftool "-icc_profile<=profile.icc" file.png
Encode avif using provided icc profile in file
avifenc --icc profile.icc input.png output.avif
Differential Revision: https://phabricator.services.mozilla.com/D220101
ConvertYCbCrToRGB32 was doing the premultiplied conversion, which happens before the surface pipe, which is where color management happens.
Differential Revision: https://phabricator.services.mozilla.com/D220517
Initially, the YCbCrUtils and yuv_convert APIs asserted success
internally. With recent changes, those assertions were removed. This
patch reintroduces those assertions on the caller's side instead, except
the `ConvertToRGBA` in ImageConversion.cpp.
Differential Revision: https://phabricator.services.mozilla.com/D216191
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
Differential Revision: https://phabricator.services.mozilla.com/D216228
This patch replaces `ConvertYCbCrAToARGB` with `ConvertYCbCrToRGB32` in
`nsAVIFDecoder`, as image scaling is not required.
Differential Revision: https://phabricator.services.mozilla.com/D215985
It is useful/necessary for WebCodecs image decoding support to be able
to calculate a frame count for the encoded image without actually
decoding every frame. It needs to be able to provide results without the
complete buffer as well.
Differential Revision: https://phabricator.services.mozilla.com/D212831
It is useful/necessary for WebCodecs image decoding support to be able
to calculate a frame count for the encoded image without actually
decoding every frame. It needs to be able to provide results without the
complete buffer as well.
Differential Revision: https://phabricator.services.mozilla.com/D212831
GVST is how these probes sent data in Fenix and is now unnecessary (and doesn't send data in Fenix release) since Firefox Desktop has direct access to Glean. We therefore need to clean them up in some capacity.
Following the recommendations from the GeckoView Streaming (GVST) validation effort, this is a pure Glean api implementation of the metrics that fell under network in geckoview streaming.
Because these were all categorical histograms, to retain previous functionality we've added parallel instrumentation in Glean.
Differential Revision: https://phabricator.services.mozilla.com/D201024
We can't actually enable the warning because there are some warnings generated by includes coming from outside of imagelib.
Note that change in AOMDecoder::Init is actually a behaviour change: the new behaviour is to return the error code if we fail to decode the alpha image. This matches what we do for the dav1d decoder.
Depends on D173000
Differential Revision: https://phabricator.services.mozilla.com/D173001
And also make it return a better result when mDecoder already exists, Complete is not what we want to return.
Depends on D172994
Differential Revision: https://phabricator.services.mozilla.com/D172998
Because it has the same name as the base class function Decoder::Decode but different arguments, which is confusing.
Depends on D172998
Differential Revision: https://phabricator.services.mozilla.com/D173000
This prevents a crash that would occur if a redecode of an animated AVIF happened after changing the `sequences.enabled` pref from `true` to `false`.
Differential Revision: https://phabricator.services.mozilla.com/D170190
The iterator used to read from an AVIF sample index will return `true` from
`HasNext()` even if the next sample is incomplete. We should error completely
out of the decode when this happens, so that we are always guaranteed to have a
sample to decode when there is no error in the parser.
Differential Revision: https://phabricator.services.mozilla.com/D168643
This fixes an assertion failure due to the assumption before Bug 1682662 that
all metadata decodes will completely decode a sample. That is no longer the case
because telemetry for image sizes can be sent without a full decode.
Differential Revision: https://phabricator.services.mozilla.com/D168645