Commit 3e632744 authored by Tom Finegan's avatar Tom Finegan

OBU type/metadata disambiguation.

- OBU_TD => OBU_TEMPORAL_DELIMITER
- METADATA_TYPE => OBU_METADATA_TYPE
- Prefix OBU_METADATA_TYPE enum vals with "OBU_".

BUG=aomedia:1046

Change-Id: I0c63d36b77905520e427e6b77fbf4cbedabc7e51
parent 3afbf3fb
......@@ -484,7 +484,7 @@ aom_codec_err_t aom_codec_control_(aom_codec_ctx_t *ctx, int ctrl_id, ...);
/*!\brief OBU types. */
typedef enum ATTRIBUTE_PACKED {
OBU_SEQUENCE_HEADER = 1,
OBU_TD = 2,
OBU_TEMPORAL_DELIMITER = 2,
OBU_FRAME_HEADER = 3,
OBU_TILE_GROUP = 4,
OBU_METADATA = 5,
......@@ -493,10 +493,10 @@ typedef enum ATTRIBUTE_PACKED {
/*!\brief OBU metadata types. */
typedef enum {
METADATA_TYPE_PRIVATE_DATA = 0,
METADATA_TYPE_HDR_CLL = 1,
METADATA_TYPE_HDR_MDCV = 2,
} METADATA_TYPE;
OBU_METADATA_TYPE_PRIVATE_DATA = 0,
OBU_METADATA_TYPE_HDR_CLL = 1,
OBU_METADATA_TYPE_HDR_MDCV = 2,
} OBU_METADATA_TYPE;
/*!@} - end defgroup codec*/
#ifdef __cplusplus
......
......@@ -1331,7 +1331,8 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
memmove(ctx->pending_cx_data + PRE_OBU_SIZE_BYTES + 1,
ctx->pending_cx_data, ctx->pending_cx_data_sz);
obu_size = write_obu_header(
OBU_TD, 0, (uint8_t *)(ctx->pending_cx_data + PRE_OBU_SIZE_BYTES));
OBU_TEMPORAL_DELIMITER, 0,
(uint8_t *)(ctx->pending_cx_data + PRE_OBU_SIZE_BYTES));
obu_size += write_temporal_delimiter_obu();
#if CONFIG_ADD_4BYTES_OBUSIZE
mem_put_le32(ctx->pending_cx_data, obu_size);
......
......@@ -3865,16 +3865,16 @@ static void read_metadata_hdr_mdcv(const uint8_t *data) {
}
static size_t read_metadata(const uint8_t *data, size_t sz) {
METADATA_TYPE metadata_type;
OBU_METADATA_TYPE metadata_type;
assert(sz >= 2);
metadata_type = (METADATA_TYPE)mem_get_le16(data);
metadata_type = (OBU_METADATA_TYPE)mem_get_le16(data);
if (metadata_type == METADATA_TYPE_PRIVATE_DATA) {
if (metadata_type == OBU_METADATA_TYPE_PRIVATE_DATA) {
read_metadata_private_data(data + 2, sz - 2);
} else if (metadata_type == METADATA_TYPE_HDR_CLL) {
} else if (metadata_type == OBU_METADATA_TYPE_HDR_CLL) {
read_metadata_hdr_cll(data + 2);
} else if (metadata_type == METADATA_TYPE_HDR_MDCV) {
} else if (metadata_type == OBU_METADATA_TYPE_HDR_MDCV) {
read_metadata_hdr_mdcv(data + 2);
}
......@@ -3912,7 +3912,9 @@ void av1_decode_frame_from_obus(struct AV1Decoder *pbi, const uint8_t *data,
data += (PRE_OBU_SIZE_BYTES + obu_header_size);
switch (obu_type) {
case OBU_TD: obu_payload_size = read_temporal_delimiter_obu(); break;
case OBU_TEMPORAL_DELIMITER:
obu_payload_size = read_temporal_delimiter_obu();
break;
case OBU_SEQUENCE_HEADER:
obu_payload_size = read_sequence_header_obu(pbi, &rb);
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment