Skip to content
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

Allow libyuv to use identity matrix with YUV 4:0:0 #1488

Conversation

wantehchang
Copy link
Collaborator

Allow avifImageYUVToRGB() to convert YUV 4:0:0 with the identity matrix to RGB by using libyuv, similar to the Chromium CL https://chromium-review.googlesource.com/c/chromium/src/+/4727949.

Allow avifImageYUVToRGB() to convert YUV 4:0:0 with the identity matrix
to RGB by using libyuv, similar to the Chromium CL
https://chromium-review.googlesource.com/c/chromium/src/+/4727949.
// Allow the identity matrix to be used with YUV 4:0:0. Replace the identity matrix with
// MatrixCoefficients 6 (BT.601).
const avifBool yuv400WithIdentityMatrix = (image->yuvFormat == AVIF_PIXEL_FORMAT_YUV400) &&
(image->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_IDENTITY);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Chromium CL, the condition I used is just image->yuvFormat == AVIF_PIXEL_FORMAT_YUV400. I am planning to change Chromium to match this condition.

@wantehchang wantehchang merged commit 7a67c50 into AOMediaCodec:main Aug 2, 2023
14 checks passed
@wantehchang wantehchang deleted the allow-400-identity-matrix-with-libyuv branch August 2, 2023 22:39
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

Successfully merging this pull request may close these issues.

2 participants