AVIF files tagged with full range are decoded as limited range
Categories
(Core :: Graphics: ImageLib, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: TD-Linux, Assigned: tongyuan200097)
References
Details
Attachments
(5 files)
The colors on the attached AVIF should match the attached PNG.
Reporter | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
4:2:0 YUV version
Comment 3•4 years ago
|
||
As far as I can tell the colors do match now, and this code looks correct. If I'm missing something, please let me know.
The attached images are all highly saturated colors so the difference is not very visible.
The range info is correctly set but ignored during conversion from YUV to RGB. The libyuv::U444ToARGB
functions or likely are all for limited range YUV data. In the version of libyuv firefox currently using there's only libyuv::J444ToARGB
which is the full range version of libyuv::I444ToARGB
, and the other two are missing. They are added recently to libyuv. (libyuv::F444ToARGB
as the full range version of libyuv::H444ToARGB
in this change, and libyuv::V444ToARGB
as the full range version of libyuv::U444ToARGB
in this change) Moreover, AVIF supports much more colorspaces than firefox currently have (see here), and there's plan in libyuv to provide the ability to generate custom constants, to cover most colorspaces.
This is a full range AVIF image, tagged as BT.709 color primary, sRGB transfer function, BT.601 matrix coefficients (the same color configuration of JPEG). The background color of the four areas should be what the text says respectively.
A quick fix for ConvertYCbCrToRGB32 to use full range convert functions for full range data.
Current version of libyuv Firefox have only supports BT.601 full range.
In the long term, we should update libyuv to get support on other colorspaces as well.
Updated•4 years ago
|
Comment 7•4 years ago
|
||
Thanks for the additional info! I'll take a look at this soon.
Comment 8•4 years ago
|
||
If there is a patch being reviewed, then I think this bug should be reopened. The status is confusing right now.
Comment 9•4 years ago
|
||
I should be able to review the change this week, hopefully
Updated•4 years ago
|
Comment 10•4 years ago
|
||
Looks like it'll be beginning of next week (Mar 8)
Comment 11•4 years ago
|
||
Thanks again for this submission. I've looked it over, and it's definitely something we'll incorporate, but as you mention there are additional pieces we need from an updated libyuv first, so I'll be coming back to this once that's done. Unfortunately it may take a bit of effort since it's been awhile since we've updated and in the meantime libyuv has switched from gyp (which we support as part of mozbuild) to gn (which we do not, yet).
Assignee | ||
Comment 13•3 years ago
|
||
I'm not familiar with either moz-build or gn, so I'm not able to update libyuv and make it work.
However this bug is blocking enable of AVIF by default for quite long, so I backported necessary changes from new version of libyuv to fix this bug.
We should still update libyuv to get new features, including one-step 10/12 bit convert functions, bilinear UV scaling, unclamped limited range coefficients, performance improvement on arm64, and probably more.
Comment 14•3 years ago
|
||
This is great! I'd looked a bit at doing the backport, but didn't have enough familiarity with libyuv to get it done in a reasonable amount of time compared to upgrading, so this is very helpful!
I'll take a look at this hopefully by the middle of this week.
Comment 15•3 years ago
|
||
bugherder |
Description
•