1// Copyright (c) 2023, Alliance for Open Media. All rights reserved 2// 3// This source code is subject to the terms of the BSD 3-Clause Clear License 4// and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear 5// License was not distributed with this source code in the LICENSE file, you 6// can obtain it at www.aomedia.org/license/software-license/bsd-3-c-c. If the 7// Alliance for Open Media Patent License 1.0 was not distributed with this 8// source code in the PATENTS file, you can obtain it at 9// www.aomedia.org/license/patent. 10 11syntax = "proto2"; 12 13package iamf_tools_cli_proto; 14 15import "iamf/cli/proto/obu_header.proto"; 16import "iamf/cli/proto/param_definitions.proto"; 17 18enum AudioElementType { 19 AUDIO_ELEMENT_INVALID = 0; 20 AUDIO_ELEMENT_CHANNEL_BASED = 1; 21 AUDIO_ELEMENT_SCENE_BASED = 2; 22} 23 24message ParamDefinitionExtension { 25 optional uint32 param_definition_size = 1; 26 optional bytes param_definition_bytes = 2; 27} 28 29message AudioElementParam { 30 optional uint32 deprecated_param_definition_type = 1 [deprecated = true]; 31 optional ParamDefinitionType param_definition_type = 5; 32 oneof param_definition { 33 DemixingParamDefinition demixing_param = 2; 34 ReconGainParamDefinition recon_gain_param = 3; 35 ParamDefinitionExtension param_definition_extension = 4; 36 } 37 38 // Next ID: 6 39} 40 41// Valid proto enums start at index 1, which are different from the 42// corresponding enums in C++, e.g. kLayoutMono = 0. 43enum LoudspeakerLayout { 44 LOUDSPEAKER_LAYOUT_INVALID = 0; 45 LOUDSPEAKER_LAYOUT_MONO = 1; 46 LOUDSPEAKER_LAYOUT_STEREO = 2; 47 LOUDSPEAKER_LAYOUT_5_1_CH = 3; 48 LOUDSPEAKER_LAYOUT_5_1_2_CH = 4; 49 LOUDSPEAKER_LAYOUT_5_1_4_CH = 5; 50 LOUDSPEAKER_LAYOUT_7_1_CH = 6; 51 LOUDSPEAKER_LAYOUT_7_1_2_CH = 7; 52 LOUDSPEAKER_LAYOUT_7_1_4_CH = 8; 53 LOUDSPEAKER_LAYOUT_3_1_2_CH = 9; 54 LOUDSPEAKER_LAYOUT_BINAURAL = 10; 55 LOUDSPEAKER_LAYOUT_RESERVED_10 = 11; 56 LOUDSPEAKER_LAYOUT_RESERVED_14 = 15; 57 LOUDSPEAKER_LAYOUT_EXPANDED = 16; 58} 59 60enum ExpandedLoudspeakerLayout { 61 EXPANDED_LOUDSPEAKER_LAYOUT_INVALID = 0; 62 EXPANDED_LOUDSPEAKER_LAYOUT_LFE = 1; 63 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_S = 2; 64 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_SS = 3; 65 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_RS = 4; 66 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_TF = 5; 67 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_TB = 6; 68 EXPANDED_LOUDSPEAKER_LAYOUT_TOP_4_CH = 7; 69 EXPANDED_LOUDSPEAKER_LAYOUT_3_0_CH = 8; 70 EXPANDED_LOUDSPEAKER_LAYOUT_9_1_6_CH = 9; 71 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_F = 10; 72 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_SI = 11; 73 EXPANDED_LOUDSPEAKER_LAYOUT_STEREO_TP_SI = 12; 74 EXPANDED_LOUDSPEAKER_LAYOUT_TOP_6_CH = 13; 75 EXPANDED_LOUDSPEAKER_LAYOUT_RESERVED_13 = 14; 76 EXPANDED_LOUDSPEAKER_LAYOUT_RESERVED_255 = 256; 77} 78 79message ChannelAudioLayerConfig { 80 optional uint32 deprecated_loudspeaker_layout = 1 [deprecated = true]; 81 optional LoudspeakerLayout loudspeaker_layout = 10; 82 optional uint32 output_gain_is_present_flag = 2; 83 optional uint32 recon_gain_is_present_flag = 3; 84 optional uint32 reserved_a = 4; 85 optional uint32 substream_count = 5; 86 optional uint32 coupled_substream_count = 6; 87 optional uint32 output_gain_flag = 7; 88 optional uint32 reserved_b = 8; 89 optional int32 output_gain = 9; 90 optional ExpandedLoudspeakerLayout expanded_loudspeaker_layout = 11; 91} 92 93message ScalableChannelLayoutConfig { 94 optional uint32 num_layers = 1; 95 optional uint32 reserved = 2; 96 repeated ChannelAudioLayerConfig channel_audio_layer_configs = 3; 97} 98 99enum AmbisonicsMode { 100 AMBISONICS_MODE_INVALID = 0; 101 AMBISONICS_MODE_MONO = 1; 102 AMBISONICS_MODE_PROJECTION = 2; 103} 104 105message AmbisonicsMonoConfig { 106 optional uint32 output_channel_count = 1; 107 optional uint32 substream_count = 2; 108 repeated uint32 channel_mapping = 3 [packed = true]; 109} 110 111message AmbisonicsProjectionConfig { 112 optional uint32 output_channel_count = 1; 113 optional uint32 substream_count = 2; 114 optional uint32 coupled_substream_count = 3; 115 repeated int32 demixing_matrix = 4 [packed = true]; 116} 117 118message AmbisonicsConfig { 119 optional AmbisonicsMode ambisonics_mode = 1; 120 oneof ambisonics_config { 121 AmbisonicsMonoConfig ambisonics_mono_config = 2; 122 AmbisonicsProjectionConfig ambisonics_projection_config = 3; 123 } 124} 125 126message AudioElementConfigExtension { 127 optional uint32 audio_element_config_size = 1; 128 optional bytes audio_element_config_bytes = 2; 129} 130 131message AudioElementObuMetadata { 132 optional uint32 audio_element_id = 1; 133 optional AudioElementType audio_element_type = 2; 134 optional uint32 reserved = 3; 135 optional uint32 codec_config_id = 4; 136 optional uint32 num_substreams = 5; 137 repeated uint32 audio_substream_ids = 6 [packed = true]; 138 optional uint32 num_parameters = 7; 139 repeated AudioElementParam audio_element_params = 8; 140 oneof config { 141 ScalableChannelLayoutConfig scalable_channel_layout_config = 9; 142 AmbisonicsConfig ambisonics_config = 10; 143 AudioElementConfigExtension audio_element_config_extension = 11; 144 } 145 optional ObuHeaderMetadata obu_header = 12; 146} 147