Set chroma_sample_position only for YUV 4:2:0#41
Merged
kornelski merged 1 commit intokornelski:mainfrom Sep 10, 2021
Merged
Conversation
The chroma_sample_position syntax element is only used for YUV 4:2:0 in the AV1 bitstream. So set chroma_sample_position to ChromaSamplePosition::Unknown for all other YUV formats, including monochrome (YUV 4:0:0). Note: For still images, the most common chroma sample position in practice is the "center" position. Unfortunately the AV1 specification does not have a value for the "center" chroma sample position. See AOMediaCodec/av1-avif#88 and AOMediaCodec/av1-spec#308. This pull request preserves the ChromaSamplePosition::Colocated value that is currently used, but it is likely to be incorrect when YUV 4:2:0 is supported.
Contributor
Author
|
@kornelski Please review. Thanks! |
Owner
|
Thanks. I'm not planning to support chroma subsampling of color channels ever. If I remember correctly, this chroma setting was only a workaround for lack of monochrome encoding. |
Contributor
Author
|
I see. I guess older versions of rav1e could not encode monochrome (YUV 4:0:0) images. The current version of rav1e encodes alpha images as monochrome correctly. The current cavif-rs code uses only |
Owner
|
Yes, please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The chroma_sample_position syntax element is only used for YUV 4:2:0 in
the AV1 bitstream. So set chroma_sample_position to
ChromaSamplePosition::Unknown for all other YUV formats, including
monochrome (YUV 4:0:0).
Note: For still images, the most common chroma sample position in
practice is the "center" position. Unfortunately the AV1 specification
does not have a value for the "center" chroma sample position. See
AOMediaCodec/av1-avif#88 and
AOMediaCodec/av1-spec#308. This pull request
preserves the ChromaSamplePosition::Colocated value that is currently
used, but it is likely to be incorrect when YUV 4:2:0 is supported.