Closed cconcolato closed 1 year ago
Yes, color_range
is always defined in an AV1 bitstream, either coded or with a default value of 1.
The colr
box definition is:
class ColourInformationBox extends Box('colr'){
unsigned int(32) colour_type;
if (colour_type == 'nclx') /* on-screen colours */
{
unsigned int(16) colour_primaries;
unsigned int(16) transfer_characteristics;
unsigned int(16) matrix_coefficients;
unsigned int(1) full_range_flag;
unsigned int(7) reserved = 0;
}
else if (colour_type == 'rICC')
{
ICC_profile; // restricted ICC profile
}
else if (colour_type == 'prof')
{
ICC_profile; // unrestricted ICC profile
}
}
So yes, there is a value for full_range_flag
. I don't think it makes sense for it to have a different value than the one in the bitstream.
The group discussed this issue and proposes to add a note indicating that it is fine not to have color information in the bitstream but in that case the colr
box shall be present and should not have values 2/2/2
I found a technical complication. The color_config() part of the AV1 sequence header OBU is defined as follows:
color_config( ) { Type
...
color_description_present_flag f(1)
if ( color_description_present_flag ) {
color_primaries f(8)
transfer_characteristics f(8)
matrix_coefficients f(8)
} else {
color_primaries = CP_UNSPECIFIED
transfer_characteristics = TC_UNSPECIFIED
matrix_coefficients = MC_UNSPECIFIED
}
Note that CP_UNSPECIFIED
, TC_UNSPECIFIED
, and MC_UNSPECIFIED
are all equal to 2.
The subject of this issue is to deal with the color_description_present_flag == 0 case. One can see that the color_description_present_flag == 1 && color_primaries/transfer_characteristics/matrix_coefficients == 2/2/2 case is essentially the same as the color_description_present_flag == 0 case. Therefore, the spec probably should also address the case when color_description_present_flag is equal to 1 but color_primaries, transfer_characteristics, or matrix_coefficients is equal to 2 (unspecified).
The current spec says:
It's unclear what values should be used when color_description_present_flag is 0. Should the
nclx
box declare values 2/2/2/0? Is it allowed to declare values other than 2/2/2, like 1/13/6, to override at the container-level the unknown color space from the elementary stream? That seems in line with the spirit of ISOBMFF which says:What about the color range? Can it be overriden?