read_obu_header set temporal/spatial_layer_id to 0 Have read_obu_header() set the temporal_layer_id and spatial_layer_id fields of ObuHeader to 0 when has_extension is false. This implements the following descriptions in Section 6.2.3 of the AV1 spec: ... When temporal_id is not present, temporal_id is inferred to be equal to 0. ... When spatial_id is not present, spatial_id is inferred to be equal to 0. BUG=aomedia:2801 Change-Id: I537d8f53e1d7a853eefbf28ab6081f97833146c6
diff --git a/av1/common/obu_util.c b/av1/common/obu_util.c index 7d2694b..3e35d71 100644 --- a/av1/common/obu_util.c +++ b/av1/common/obu_util.c
@@ -89,6 +89,9 @@ // extension_header_reserved_3bits must be set to 0. return AOM_CODEC_CORRUPT_FRAME; } + } else { + header->temporal_layer_id = 0; + header->spatial_layer_id = 0; } return AOM_CODEC_OK;
diff --git a/av1/common/obu_util.h b/av1/common/obu_util.h index 7c56904..adf3568 100644 --- a/av1/common/obu_util.h +++ b/av1/common/obu_util.h
@@ -22,9 +22,9 @@ // optional OBU extension header) in the bitstream. OBU_TYPE type; int has_size_field; - int has_extension; - // The following fields come from the OBU extension header and therefore are - // only used if has_extension is true. + int has_extension; // Whether the optional OBU extension header is present. + // The following fields come from the OBU extension header. They are set to 0 + // if has_extension is false. int temporal_layer_id; int spatial_layer_id; } ObuHeader;