AOMediaCodec / av1-avif

AV1 Image File Format Specification - ISO-BMFF/HEIF derivative
https://aomediacodec.github.io/av1-avif/
BSD 2-Clause "Simplified" License
463 stars 40 forks source link

AVIF, sRGB and CICP #77

Closed cconcolato closed 3 years ago

cconcolato commented 4 years ago

MIAF currently specifies:

For RGB encoding, sRGB should be assumed as indicated by colour_primaries equal to 1, transfer_characteristics equal to 13, matrix_coefficients equal to 0, and full_range_flag equal to 1.

In this context, MPEG/ITU issued a "Defect report for Video CICP (ISO/IEC 23091-2)" on 2019-10-11, N18912.

This raises 2 questions (at least): 1) what values should be used for AVIF when encoding sRGB content; 2) Given the default value in MIAF, should the AVIF spec be changed to mandate the colr to include the recommendations from question 1)?

aklemets commented 4 years ago

I have been assuming that the same requirements apply to AVIF. The requirements that you quoted appear in the "General requirements" section of MIAF, so they are not HEVC-specific and should apply to AVIF as well, unless AVIF has an explicit rule that overrides this MIAF requirement.

Given that this question came up, I think it would not hurt to add something to the AVIF spec that explicitly repeats this requirements, or at least references the text in the MIAF spec.

cconcolato commented 4 years ago

I agree that my quote applies to AVIF. The question, which came up in a discussion with @joedrago and libavif, is whether these default values make sense for AVIF; or if AVIF should recommend not to rely on default values and rely on explicit signaling with the colr box.

joedrago commented 4 years ago

I think the MIAF standard is correct in its guidance on signaling 1/13/0 for SRGB content, but the wording might imply a best practice for dealing with SRGB content, which it is merely being precise about that specific CICP signaling.

1/13/0 is signaling that the YUV planes packed into the AV1 stream are actually unconverted (identity) SRGB GBR planes. This is why the MIAF standard is technically correct; if you wanted to jam raw SRGB values into the AV1 encoder, this is the signal.

However, this probably shouldn't be considered a best practice, from my (limited) understanding of how video encoders leverage the Y channel significantly more than the Cb/Cr channels, and an implementer reading this standard looking for the "best" way to take their SRGB pixels and get them in an AVIF might be misled by this sentence and make bad decisions.

Assuming we're willing to be a bit more verbose in this standard, at least making it clear what this signaling really means and how this might impact encoding efficiency would be a big win. Coming up with a real "best practices" section for properly encoding SRGB into an efficient format with good signaling might be even better.

cconcolato commented 4 years ago

The MIAF specification was clarified to:

cconcolato commented 3 years ago

I would propose to close this issue with no action as all the changes are done in MIAF.