AOMediaCodec / av1-spec

AV1 Bitstream & Decoding Process Specification
https://aomedia.org/
Other
335 stars 69 forks source link

Initial value of `OperatingPointIdc` and OBU ordering #332

Open ajul opened 2 years ago

ajul commented 2 years ago

From Version 1.0.0 with Errata 1:

7.5. Ordering of OBUs says:

A temporal unit consists of a series of OBUs starting from a temporal delimiter, optional sequence headers, optional metadata OBUs, a sequence of one or more frame headers, each followed by zero or more tile group OBUs as well as optional padding OBUs.

The first temporal unit of a coded video sequence must contain one or more sequence header OBUs before the first frame header OBU.

If a temporal unit contains one or more sequence header OBUs, the first appearance of the sequence header OBU must be before the first frame header OBU.

One or more metadata and padding OBUs may appear in any order within an OBU sequence (unless constrained by semantics provided elsewhere in this specification).

This seems to imply that metadata and/or padding OBUs may appear before the first sequence header. Therefore, OperatingPointIdc might not have been set at the time these OBUs are read.

In particular, 5.3.1. General OBU syntax has this conditional:

if ( obu_type != OBU_SEQUENCE_HEADER &&
     obu_type != OBU_TEMPORAL_DELIMITER &&
     OperatingPointIdc != 0 &&
     obu_extension_flag == 1 )

which may depend on an undefined value of OperatingPointIdc for metadata and padding OBUs. Some possible solutions: