Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 19 additions & 8 deletions tests/proto/arbitrary_obu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
// source code in the PATENTS file, you can obtain it at
// www.aomedia.org/license/patent.

syntax = "proto2";
edition = "2023";

package libiamf_proto;

import "obu_header.proto";

option features.enum_type = CLOSED;

enum ArbitraryObuType {
option allow_alias = true;

OBU_IA_INVALID = 0;
OBU_IA_CODEC_CONFIG = 1;
OBU_IA_AUDIO_ELEMENT = 2;
Expand All @@ -40,7 +44,8 @@ enum ArbitraryObuType {
OBU_IA_AUDIO_FRAME_ID_15 = 22;
OBU_IA_AUDIO_FRAME_ID_16 = 23;
OBU_IA_AUDIO_FRAME_ID_17 = 24;
OBU_IA_RESERVED_24 = 25;
OBU_IA_RESERVED_24 = 25 [deprecated = true];
OBU_IA_METADATA = 25;
OBU_IA_RESERVED_25 = 26;
OBU_IA_RESERVED_26 = 27;
OBU_IA_RESERVED_27 = 28;
Expand All @@ -52,7 +57,11 @@ enum ArbitraryObuType {

enum InsertionHook {
INSERTION_HOOK_INVALID = 0;
// Places this before the canonical descriptors. In an MP4 context, this would
// be early in the "IACB" box.
INSERTION_HOOK_BEFORE_DESCRIPTORS = 1;
// Places this after the canonical descriptors. In an MP4 context, this would
// be late in the "IACB" box.
INSERTION_HOOK_AFTER_DESCRIPTORS = 2;
INSERTION_HOOK_AFTER_IA_SEQUENCE_HEADER = 3;
INSERTION_HOOK_AFTER_CODEC_CONFIGS = 4;
Expand All @@ -64,13 +73,15 @@ enum InsertionHook {
}

message ArbitraryObuMetadata {
optional InsertionHook insertion_hook = 1;
optional ArbitraryObuType obu_type = 4;
optional ObuHeaderMetadata obu_header = 2;
optional bytes payload = 3;
InsertionHook insertion_hook = 1;
ArbitraryObuType obu_type = 4;
ObuHeaderMetadata obu_header = 2;
bytes payload = 3;

// Used to force the bitstream to be invalid when this OBU is inserted.
optional bool invalidates_bitstream = 5;
bool invalidates_bitstream = 5;

// Used to control the temporal unit when using the *_AT_TICK insertion hooks.
// Ignored otherwise.
optional int64 insertion_tick = 6;
int64 insertion_tick = 6;
}
107 changes: 70 additions & 37 deletions tests/proto/audio_element.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,41 @@
// source code in the PATENTS file, you can obtain it at
// www.aomedia.org/license/patent.

syntax = "proto2";
edition = "2023";

package libiamf_proto;

import "obu_header.proto";
import "param_definitions.proto";

option features.enum_type = CLOSED;

enum AudioElementType {
AUDIO_ELEMENT_INVALID = 0;
AUDIO_ELEMENT_CHANNEL_BASED = 1;
AUDIO_ELEMENT_SCENE_BASED = 2;
AUDIO_ELEMENT_OBJECT_BASED = 3;
}

message ParamDefinitionExtension {
optional uint32 param_definition_size = 1;
optional bytes param_definition_bytes = 2;
// `param_definition_size` is ignored. The value in the bitstream is inferred
// based on the size of `param_definition_bytes`.
uint32 param_definition_size = 1 [deprecated = true];
bytes param_definition_bytes = 2;
}

message AudioElementParam {
optional uint32 deprecated_param_definition_type = 1 [deprecated = true];
optional ParamDefinitionType param_definition_type = 5;
uint32 deprecated_param_definition_type = 1 [deprecated = true];

ParamDefinitionType param_definition_type = 5;

oneof param_definition {
DemixingParamDefinition demixing_param = 2;
ReconGainParamDefinition recon_gain_param = 3;
ParamDefinitionExtension param_definition_extension = 4;
}

// Next ID: 6
}

// Valid proto enums start at index 1, which are different from the
Expand Down Expand Up @@ -70,27 +79,36 @@ enum ExpandedLoudspeakerLayout {
EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_SI = 11;
EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_TP_SI = 12;
EXPANDED_LOUDSPEAKER_LAYOUT_TOP_6_CH = 13;
EXPANDED_LOUDSPEAKER_LAYOUT_RESERVED_13 = 14;
EXPANDED_LOUDSPEAKER_LAYOUT_10_2_9_3_CH = 14;
EXPANDED_LOUDSPEAKER_LAYOUT_LFE_PAIR = 15;
EXPANDED_LOUDSPEAKER_LAYOUT_BOTTOM_3_CH = 16;
EXPANDED_LOUDSPEAKER_LAYOUT_7_1_5_4_CH = 17;
EXPANDED_LOUDSPEAKER_LAYOUT_BOTTOM_4_CH = 18;
EXPANDED_LOUDSPEAKER_LAYOUT_TOP_1_CH = 19;
EXPANDED_LOUDSPEAKER_LAYOUT_TOP_5_CH = 20;
EXPANDED_LOUDSPEAKER_LAYOUT_RESERVED_255 = 256;
}

message ChannelAudioLayerConfig {
optional uint32 deprecated_loudspeaker_layout = 1 [deprecated = true];
optional LoudspeakerLayout loudspeaker_layout = 10;
optional uint32 output_gain_is_present_flag = 2;
optional uint32 recon_gain_is_present_flag = 3;
optional uint32 reserved_a = 4;
optional uint32 substream_count = 5;
optional uint32 coupled_substream_count = 6;
optional uint32 output_gain_flag = 7;
optional uint32 reserved_b = 8;
optional int32 output_gain = 9;
optional ExpandedLoudspeakerLayout expanded_loudspeaker_layout = 11;
uint32 deprecated_loudspeaker_layout = 1 [deprecated = true];

LoudspeakerLayout loudspeaker_layout = 10;
uint32 output_gain_is_present_flag = 2;
uint32 recon_gain_is_present_flag = 3;
uint32 reserved_a = 4;
uint32 substream_count = 5;
uint32 coupled_substream_count = 6;
uint32 output_gain_flag = 7;
uint32 reserved_b = 8;
int32 output_gain = 9;
ExpandedLoudspeakerLayout expanded_loudspeaker_layout = 11;
}

message ScalableChannelLayoutConfig {
optional uint32 num_layers = 1;
optional uint32 reserved = 2;
// `num_layers` is ignored. The value in the bitstream is inferred based on
// the number of `channel_audio_layer_configs`.
uint32 num_layers = 1 [deprecated = true];
uint32 reserved = 2;
repeated ChannelAudioLayerConfig channel_audio_layer_configs = 3;
}

Expand All @@ -101,44 +119,59 @@ enum AmbisonicsMode {
}

message AmbisonicsMonoConfig {
optional uint32 output_channel_count = 1;
optional uint32 substream_count = 2;
repeated uint32 channel_mapping = 3 [packed = true];
uint32 output_channel_count = 1;
uint32 substream_count = 2;
repeated uint32 channel_mapping = 3;
}

message AmbisonicsProjectionConfig {
optional uint32 output_channel_count = 1;
optional uint32 substream_count = 2;
optional uint32 coupled_substream_count = 3;
repeated int32 demixing_matrix = 4 [packed = true];
uint32 output_channel_count = 1;
uint32 substream_count = 2;
uint32 coupled_substream_count = 3;
repeated int32 demixing_matrix = 4;
}

message AmbisonicsConfig {
optional AmbisonicsMode ambisonics_mode = 1;
AmbisonicsMode ambisonics_mode = 1;

oneof ambisonics_config {
AmbisonicsMonoConfig ambisonics_mono_config = 2;
AmbisonicsProjectionConfig ambisonics_projection_config = 3;
}
}

message ObjectsConfig {
uint32 num_objects = 1;
bytes objects_config_extension_bytes = 2;
}

message AudioElementConfigExtension {
optional uint32 audio_element_config_size = 1;
optional bytes audio_element_config_bytes = 2;
// `audio_element_config_size` is ignored. The value in the bitstream is
// inferred based on the size of `audio_element_config_bytes`.
uint32 audio_element_config_size = 1 [deprecated = true];
bytes audio_element_config_bytes = 2;
}

message AudioElementObuMetadata {
optional uint32 audio_element_id = 1;
optional AudioElementType audio_element_type = 2;
optional uint32 reserved = 3;
optional uint32 codec_config_id = 4;
optional uint32 num_substreams = 5;
repeated uint32 audio_substream_ids = 6 [packed = true];
optional uint32 num_parameters = 7;
uint32 audio_element_id = 1;
AudioElementType audio_element_type = 2;
uint32 reserved = 3;
uint32 codec_config_id = 4;
// `num_substreams` is ignored. The value in the bitstream is inferred based
// on the number of `audio_substream_ids`.
uint32 num_substreams = 5 [deprecated = true];
repeated uint32 audio_substream_ids = 6;
// `num_parameters` is ignored. The value in the bitstream is inferred based
// on the number of `audio_element_params`.
uint32 num_parameters = 7 [deprecated = true];
repeated AudioElementParam audio_element_params = 8;

oneof config {
ScalableChannelLayoutConfig scalable_channel_layout_config = 9;
AmbisonicsConfig ambisonics_config = 10;
AudioElementConfigExtension audio_element_config_extension = 11;
ObjectsConfig objects_config = 13;
}
optional ObuHeaderMetadata obu_header = 12;

ObuHeaderMetadata obu_header = 12;
}
Loading
Loading