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

Add CSP_CENTER. #308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add CSP_CENTER. #308

wants to merge 1 commit into from

Conversation

tdaede
Copy link

@tdaede tdaede commented Aug 10, 2020

Please let me know if you'd like me to rebuild docs/ in this PR as well.

wantehchang added a commit to wantehchang/cavif-rs that referenced this pull request Sep 9, 2021
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.
@@ -461,9 +461,11 @@ that subsampling_x is equal to 0 and subsampling_y is equal to 0.
| 0 | CSP_UNKNOWN | Unknown (in this case the source video transfer function must be signaled outside the AV1 bitstream)
| 1 | CSP_VERTICAL | Horizontally co-located with (0, 0) luma sample, vertical position in the middle between two luma samples
| 2 | CSP_COLOCATED | co-located with (0, 0) luma sample
| 3 | CSP_RESERVED |
| 3 | CSP_CENTER | In the middle between four luma samples
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest changing the description to "In the center of a 2x2 block of luma samples" or "In the center of each 2x2 block of luma samples"

I also found that ITU-T H.273 (07/21) specifies Chroma420SampleLocType in Section 8.7 Chroma 4:2:0 sample location type. We can also note the correspondence:

  • CSP_VERTICAL is the same as Chroma420SampleLocType 0
  • CSP_COLOCATED is the same as Chroma420SampleLocType 2
  • CSP_CENTER is the same as Chroma420SampleLocType 1

Copy link
Collaborator

Choose a reason for hiding this comment

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

I discussed the description of CSP_CENTER with Adrian. We propose the following description, which is similar to the description for CSP_VERTICAL:

Horizontal position in the middle between two luma samples, vertical position in the middle between two luma samples

Copy link
Author

Choose a reason for hiding this comment

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

Updated to this description. We do have a reference to H.273 in the spec already also, so adding a correspondence might make sense (maybe as a table in a note, rather than extra columns in a table?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, the corresponence to Chroma420SampleLocType in H.273 could be added as a table in a note. Note sure if we should aim to minimize changes in the AV1 spec update and refrain from clarification changes.

07.bitstream.semantics.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@wantehchang wantehchang left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! I will send an email to the Codec WG to request review.

@leo-barnes
Copy link

Looks good to me!

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.

3 participants