Skip to content

Conversation

@wantehchang
Copy link
Contributor

@wantehchang wantehchang commented Apr 4, 2022

Fix #129.


Preview | Diff

@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch from e7dc5d5 to 09c653f Compare April 4, 2022 16:57
@cconcolato
Copy link
Collaborator

The changes in the first part (#126) implement what was suggested in the issue. We realize this is a normative change with potential backwards compatibility issues. We need to check with implementations.

For the codecs parameter changes (#129), we would prefer:

  • bullet point lists and indentation for readability
  • having the range conditions separate as they do not dependent on the color present flag
    This is also a normative change but fixing a case where there was conflicting information between the codecs parameter and the bitstream. We need careful review.

In both cases, we should document before and after behavior.

@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch from 09c653f to 0d05719 Compare June 13, 2022 16:50
@wantehchang
Copy link
Contributor Author

Here is a screen shot of the first change in this pull request:
Screenshot from 2022-06-13 09-53-19

Here is a screen shot of the second change in this pull request. My change ends with the paragraph "The videoFullRangeFlag is represented by a single digit." The screen shot includes a few paragraphs below and the table of default values as context.

Screenshot from 2022-06-13 09-51-48

@cconcolato
Copy link
Collaborator

We should update the PR again to cover the case of monochrome and chromaSubsampling. They cannot be present if the following fields are omitted (and vice versa).

@cconcolato
Copy link
Collaborator

The codecs parameter is also allowed to omit the trailing values if the colr box or the sequence header OBU contains the default values.

@cconcolato
Copy link
Collaborator

We also need to document the before and after cases, showing possible backwards compatibility changes.

@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch from 0d05719 to 5e7c696 Compare August 8, 2022 16:49
@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch 3 times, most recently from 2eb4e0f to 3d430f4 Compare October 10, 2022 23:53
@wantehchang
Copy link
Contributor Author

The new version of the pull request has addressed all the review comments except the following:

  • The value of the videoFullRangeFlag is not specified separately. This results in a little duplicate text but I think overall this is clearer.
  • I didn't document the before and after cases, showing possible backwards compatibility changes.

@podborski
Copy link
Member

Question, should videoFullRangeFlag be color_range here as well? (similar fix as in HDR10+ pull request?) What about other terms?

@wantehchang
Copy link
Contributor Author

Screenshot of the top half of Section 5:

image

@wantehchang
Copy link
Contributor Author

Screenshot of the bottom half of Section 5:

image

@cconcolato
Copy link
Collaborator

We should split the PR into 2:

  • one clarifying the colr box and Config OBU part
  • one clarifying the codecs string

@cconcolato
Copy link
Collaborator

cconcolato commented Nov 14, 2022

For the colr, I suggest we clarify along the lines of this document.

The summary for colr is that:

  • it may be absent, it is not recommended
  • when it is present, its values are authoritative and may match the SH but may override them, but in the end the values in colr may still be 2/2/2 for cases like DV.

@cconcolato
Copy link
Collaborator

Regarding the codecs string part, the added sentence seems wrong:

If any of the colorPrimaries, transferCharacteristics, and matrixCoefficients parameter values equals 02 (unspecified), it SHALL be set to the default value below .

It does not enable 2/2/2 for DV for example. Also the "it" is not clear. Simply deleting the sentence is good, or moving it into the "if colr box is absent.
We could add a note that says: if you explicitly want 2/2/2 in the codecs string, you should use a colr box with these 2/2/2 values.

@wantehchang
Copy link
Contributor Author

I wrote the pull request #167 to clarify the colr box.

@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch from 3d430f4 to 41a67a8 Compare May 15, 2023 16:43
@wantehchang wantehchang changed the title Clarify 'colr' box and color info in codecs string Clarify the color info in the codecs string May 15, 2023
@wantehchang
Copy link
Contributor Author

I updated this pull request to the current main branch and edited the subject line and commit message accordingly. This pull request now addresses #129 only.

@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch 2 times, most recently from 141ac84 to 523bc57 Compare June 26, 2023 01:59
@cconcolato
Copy link
Collaborator

Some notes on the PR:

  • we note that there are colr boxes with other types than nclx (e.g. nclc, or prof). The PR considers that anything else that nclx requires going into the bitstream. Is that what we want? Probably.
  • There are different tools processing codecs strings: MPD generator, players, ... We wonder how complex the generation of the codecs string should be for MPD generator (assuming more work can be done by encoder/packager, when creating the MP4 file from the OBU stream). The alternative would be to never read the sequence header? How many files would this invalidate?
  • Maybe we should add a note that if you use a color space that is not registered in CICP, if you don't explicitly code 2/2/2 either in the sequence header (with color description present flag = 1) or in the colr box, you will get a codecs string that declares BT 709. Writers should act accordingly.

@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch from 523bc57 to 9a066ee Compare August 7, 2023 17:34
@podborski
Copy link
Member

Maybe one more thing to consider. The HLS spec. also defines a VIDEO-RANGE as

VIDEO-RANGE definition VIDEO-RANGE
  The value is an enumerated-string; valid strings are SDR, HLG and
  PQ.

  The value MUST be SDR if the video in the Variant Stream is
  encoded using one of the following reference opto-electronic
  transfer characteristic functions specified by the
  TransferCharacteristics code point: [[CICP](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#ref-CICP)] 1, 6, 13, 14, 15.  Note
  that different TransferCharacteristics code points can use the
  same transfer function.

 The value MUST be HLG if the video in the Variant Stream is
  encoded using a reference opto-electronic transfer characteristic
  function specified by the TransferCharacteristics code point 18,
  or consists of such video mixed with video qualifying as SDR (see
  above).

  The value MUST be PQ if the video in the Variant Stream is encoded
  using a reference opto-electronic transfer characteristic function
  specified by the TransferCharacteristics code point 16, or
  consists of such video mixed with video qualifying as SDR or HLG
  (see above).

  This attribute is OPTIONAL.  Its absence implies a value of SDR.
  Clients that do not recognize the attribute value SHOULD NOT
  select the Variant Stream.

I think it would be useful if we at least add a note, mentioning that care needs to be taken as the VIDEO-RANGE attribute in HLS groups certain transfer characteristics CICP values into 3 buckets (SDR,HLG,PQ) and codecs string is signaling similar information.

@cconcolato
Copy link
Collaborator

We could add a note that says:
NOTE: when the colr box is present, it simplifies the task of the codecs parameter generator, and is encouraged.

@wantehchang
Copy link
Contributor Author

I added the NOTE that Cyril suggested. I also move the common text about color_range to a separate bullet point.

@wantehchang
Copy link
Contributor Author

Cyril,

I have some questions about your comment on Jul 10.

  • we note that there are colr boxes with other types than nclx (e.g. nclc, or prof).

I assume "nclc" is a typo for "'rICC".

The PR considers that anything else that nclx requires going into the bitstream. Is that what we want? Probably.

Could you clarify what you meant by "anything else that nclx requires going into the bitstream"? I wonder if you meant to say "anything other than nclx requires going into the bitstream".

By "going into the bitstream", you meant going into the Sequence Header OBU, right?

  • Maybe we should add a note that if you use a color space that is not registered in CICP, if you don't explicitly code 2/2/2 either in the sequence header (with color description present flag = 1) or in the colr box, you will get a codecs string that declares BT 709. Writers should act accordingly.

Would you still like me to add this note?

Thanks.

If color_description_present_flag is set to 0 in the Sequence Header
OBU, the colorPrimaries, transferCharacteristics, matrixCoefficients
parameter values SHOULD be set to the default values 01.01.01.

This change maintains backward compatibility with v1.2.0, which says
(after paraphrasing):

  if color_description_present_flag is set to 0, the colorPrimaries,
  transferCharacteristics, matrixCoefficients, and videoFullRangeFlag
  parameter values SHOULD not be set, defaulting to the values
  01.01.01.0.

NOTE: The color_range flag is always present in the Sequence Header
OBU, so the current draft specifies that the videoFullRangeFlag
parameter value SHALL be set to the color_range flag in the Sequence
Header OBU.
to be consistent with the prevalent style in this section.
@wantehchang wantehchang force-pushed the issue-129-codecs-parameter-string-note branch from c23000b to 7fc9dea Compare September 22, 2023 17:29
@wantehchang
Copy link
Contributor Author

Dimitri wrote:

Maybe one more thing to consider. The HLS spec. also defines a VIDEO-RANGE [...snipped...]

I think it would be useful if we at least add a note, mentioning that care needs to be taken as the VIDEO-RANGE attribute in HLS groups certain transfer characteristics CICP values into 3 buckets (SDR,HLG,PQ) and codecs string is signaling similar information.

Should I add the note that Dimitri suggested?

The HLS spec that Dimitri mentioned is still an Internet Draft. It seems premature to mention it.

@cconcolato
Copy link
Collaborator

I assume "nclc" is a typo for "'rICC".

No. This was an example. nclc exists, typically in QuickTime files.

@cconcolato
Copy link
Collaborator

Could you clarify what you meant by "anything else that nclx requires going into the bitstream"? I wonder if you meant to say "anything other than nclx requires going into the bitstream".

Yes, that's what I meant.

By "going into the bitstream", you meant going into the Sequence Header OBU, right?

Yes.

@cconcolato
Copy link
Collaborator

Would you still like me to add this note?

Yes, that couldn't hurt.

@cconcolato
Copy link
Collaborator

Should I add the note that Dimitri suggested?

No. We said that Dimitri will open a separate issue to discuss HLS. Let's not overload this PR too much.

@wantehchang
Copy link
Contributor Author

OK, I have addressed all the comments on this pull request.

@cconcolato
Copy link
Collaborator

Unless objections in the coming days I will merge this PR. Thank you @wantehchang

@podborski podborski mentioned this pull request Oct 3, 2023

The videoFullRangeFlag is represented by a single digit.

<assert>If the codecs parameter string ends with ".0.110.01.01.01.0" (containing all the default values below), that trailing part of the string SHOULD be omitted</assert>.

Choose a reason for hiding this comment

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

Maybe this could be changed from SHOULD to MAY? I think it would be an implementers choice to include it or not.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the comment. It's a SHOULD rather than a MAY because it is inefficient to include all the default values. But in the end, it's an implementer's choice. The SHOULD just gives more indication as to what needs to be done than a MAY. Unless we have a use case that needs to include the default values, I think we should keep the SHOULD.

@cconcolato
Copy link
Collaborator

Yes
No

What are you commenting on?

@cconcolato cconcolato merged commit 014d8ea into AOMediaCodec:main Nov 27, 2023
github-actions bot added a commit that referenced this pull request Nov 27, 2023
…tring-note

SHA: 014d8ea
Reason: push, by cconcolato

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

codecs parameter and color config

4 participants