Skip to content

AVIF files with MC=0,8,16,17 in nclx color box and YUV 4:2:0 #2771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wantehchang opened this issue Apr 18, 2025 · 1 comment
Open

AVIF files with MC=0,8,16,17 in nclx color box and YUV 4:2:0 #2771

wantehchang opened this issue Apr 18, 2025 · 1 comment

Comments

@wantehchang
Copy link
Collaborator

The AV1 specification has the following requirement:

If matrix_coefficients is equal to MC_IDENTITY, it is a requirement of bitstream conformance that subsampling_x is equal to 0 and subsampling_y is equal to 0.

libavif/src/write.c checks a generalization of this requirement:

If matrix_coefficients in the nclx color box is equal to 0 (the identity matrix), the YUV format shall be equal to 4:4:4.

The rationale behind the generalized requirement is that when the identity matrix is used, the Y plane contains G samples, the U plane contains B samples, the V plane contains R samples, and it does not make sense to subsample the U and V planes.

In ITU-T H.265 (V10) (07/2024), I found two requirements similar to the AV1 requirement:

matrix_coeffs shall not be equal to 0, 16, or 17 unless both of the following conditions are true:
– BitDepthC is equal to BitDepthY.
– chroma_format_idc is equal to 3 (the 4:4:4 chroma format).

and

matrix_coeffs shall not be equal to 8 unless one of the following conditions is true:
– BitDepthC is equal to BitDepthY,
– BitDepthC is equal to BitDepthY + 1 and chroma_format_idc is equal to 3 (the 4:4:4 chroma format).

I wonder if we should impose similar requirements on AV1 and AVIF for matrix coefficients 8, 16, and 17.

I attached a ZIP file containing two AVIF files that violated our generalized requirement. The AVIF files have CICP 1/1/0 and 1/13/0 respectively and use the YUV 4:2:0 format.

identity-420-avif.zip

@y-guyon
Copy link
Collaborator

y-guyon commented Apr 20, 2025

I wonder if we should impose similar requirements on AV1 and AVIF for matrix coefficients 8, 16, and 17.

At encoding, decoding, or both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants