AOMediaCodec / av1-avif

AV1 Image File Format Specification - ISO-BMFF/HEIF derivative
https://aomediacodec.github.io/av1-avif/
BSD 2-Clause "Simplified" License
450 stars 40 forks source link

A typo in "Metadata OBUs, if present, shall match the values given in other item properties, such as the PixelInformationProperty or ColourInformationBox." #156

Open wantehchang opened 3 years ago

wantehchang commented 3 years ago

Section 2.2.1. AV1 Item Configuration Property says:

The syntax and semantics of the AV1 Item Configuration Property are identical to those of the AV1CodecConfigurationBox defined in [AV1-ISOBMFF], with the following constraints:

  • ...
  • Metadata OBUs, if present, shall match the values given in other item properties, such as the PixelInformationProperty or ColourInformationBox.

I have a question about the last list item. None of the AV1 Metadata OBUs contains information equivalent to the PixelInformationProperty or the nclx type of ColourInformationBox. So the last list item apparently contains a typo. But I don't know how to correct it.

wantehchang commented 3 years ago

Since this list item is in v1.0.0 and is not new, we don't need to fix this in the new version of the spec.

cconcolato commented 3 years ago

Thanks for the report. You're correct. I think it was intended to say something along the lines of: information in OBUs (Sequence Header, Metadata) shall match information in properties, if a property exists that carries the same type of information.

cconcolato commented 2 years ago

The question is more complex than I initially thought, as it depends on the property:

wantehchang commented 2 years ago

Hi Cyril,

Thank you for taking a look. I would like to comment on the first two bullet points in your comment.

  1. Since the bit depth information is available in the AV1CodecConfigurationBox, and the AVIF spec already requires that the AV1CodecConfigurationBox match the sequence header OBU, the AVIF spec can simply say the Pixel Information property, if present, shall match the bit depth information in the AV1CodecConfigurationBox. libavif checks this in the avifDecoderItemValidateAV1() function in libavif/src/read.c:
static avifResult avifDecoderItemValidateAV1(const avifDecoderItem * item, avifDiagnostics * diag, const avifStrictFlags strictFlags)
{
    const avifProperty * av1CProp = avifPropertyArrayFind(&item->properties, "av1C");
    ...
    const avifProperty * pixiProp = avifPropertyArrayFind(&item->properties, "pixi");
    ...
    if (pixiProp) {
        const uint32_t av1CDepth = avifCodecConfigurationBoxGetDepth(&av1CProp->u.av1C);
        for (uint8_t i = 0; i < pixiProp->u.pixi.planeCount; ++i) {
            if (pixiProp->u.pixi.planeDepths[i] != av1CDepth) {
                // pixi depth must match av1C depth
                avifDiagnosticsPrintf(diag,
                                      "Item ID %u depth specified by pixi property [%u] does not match av1C property depth [%u]",
                                      item->id,
                                      pixiProp->u.pixi.planeDepths[i],
                                      av1CDepth);
                return AVIF_RESULT_BMFF_PARSE_FAILED;
            }
        }
    }
  1. Since MIAF Sec. 7.3.6.4 already says the following about the colour information property:

The colour information property takes precedence over any colour information in the image bitstream, i.e. if the property is present, colour information in the bitstream shall be ignored.

the AVIF spec does not need to describe the relation between a colour information property of type nclx and the sequence header OBU.