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 15enum ChannelLabel { 16 CHANNEL_LABEL_INVALID = 0; 17 reserved 1; // Reserved for potential "omitted" label. 18 // Mono channels. 19 CHANNEL_LABEL_MONO = 2; 20 // Stereo or binaural channels. 21 CHANNEL_LABEL_L_2 = 3; 22 CHANNEL_LABEL_R_2 = 4; 23 // Centre channel common to several layouts (e.g. 3.1.2, 5.x.y, 7.x.y). 24 CHANNEL_LABEL_CENTRE = 6; 25 // LFE channel common to several layouts (e.g. 3.1.2, 5.1.y, 7.1.y, 9.1.6). 26 CHANNEL_LABEL_LFE = 7; 27 // 3.1.2 surround channels. 28 CHANNEL_LABEL_L_3 = 8; 29 CHANNEL_LABEL_R_3 = 9; 30 CHANNEL_LABEL_LTF_3 = 10; 31 CHANNEL_LABEL_RTF_3 = 11; 32 // 5.x.y surround channels. 33 CHANNEL_LABEL_L_5 = 14; 34 CHANNEL_LABEL_R_5 = 15; 35 CHANNEL_LABEL_LS_5 = 16; 36 CHANNEL_LABEL_RS_5 = 17; 37 // Common channels between 5.1.2 and 7.1.2. 38 CHANNEL_LABEL_LTF_2 = 22; 39 CHANNEL_LABEL_RTF_2 = 23; 40 // Common channels between 5.1.4 and 7.1.4. 41 CHANNEL_LABEL_LTF_4 = 26; 42 CHANNEL_LABEL_RTF_4 = 27; 43 CHANNEL_LABEL_LTB_4 = 28; 44 CHANNEL_LABEL_RTB_4 = 29; 45 // 7.x.y surround channels. 46 CHANNEL_LABEL_L_7 = 32; 47 CHANNEL_LABEL_R_7 = 33; 48 CHANNEL_LABEL_LSS_7 = 34; 49 CHANNEL_LABEL_RSS_7 = 35; 50 CHANNEL_LABEL_LRS_7 = 36; 51 CHANNEL_LABEL_RRS_7 = 37; 52 // 9.1.6 surround channels. 53 CHANNEL_LABEL_FLC = 42; 54 CHANNEL_LABEL_FC = 43; 55 CHANNEL_LABEL_FRC = 44; 56 CHANNEL_LABEL_FL = 45; 57 CHANNEL_LABEL_FR = 46; 58 CHANNEL_LABEL_SI_L = 47; 59 CHANNEL_LABEL_SI_R = 48; 60 CHANNEL_LABEL_BL = 49; 61 CHANNEL_LABEL_BR = 50; 62 CHANNEL_LABEL_TP_FL = 51; 63 CHANNEL_LABEL_TP_FR = 52; 64 CHANNEL_LABEL_TP_SI_L = 53; 65 CHANNEL_LABEL_TP_SI_R = 54; 66 CHANNEL_LABEL_TP_BL = 55; 67 CHANNEL_LABEL_TP_BR = 56; 68 // Reserved for possible use of demixed labels. 69 reserved 5, 12, 13, 18 to 21, 24, 25, 30, 31, 38 to 41; 70 // Reserved for channel-based labels. 71 reserved 57 to 999; 72 73 CHANNEL_LABEL_A_0 = 1000; 74 CHANNEL_LABEL_A_1 = 1001; 75 CHANNEL_LABEL_A_2 = 1002; 76 CHANNEL_LABEL_A_3 = 1003; 77 CHANNEL_LABEL_A_4 = 1004; 78 CHANNEL_LABEL_A_5 = 1005; 79 CHANNEL_LABEL_A_6 = 1006; 80 CHANNEL_LABEL_A_7 = 1007; 81 CHANNEL_LABEL_A_8 = 1008; 82 CHANNEL_LABEL_A_9 = 1009; 83 CHANNEL_LABEL_A_10 = 1010; 84 CHANNEL_LABEL_A_11 = 1011; 85 CHANNEL_LABEL_A_12 = 1012; 86 CHANNEL_LABEL_A_13 = 1013; 87 CHANNEL_LABEL_A_14 = 1014; 88 CHANNEL_LABEL_A_15 = 1015; 89 CHANNEL_LABEL_A_16 = 1016; 90 CHANNEL_LABEL_A_17 = 1017; 91 CHANNEL_LABEL_A_18 = 1018; 92 CHANNEL_LABEL_A_19 = 1019; 93 CHANNEL_LABEL_A_20 = 1020; 94 CHANNEL_LABEL_A_21 = 1021; 95 CHANNEL_LABEL_A_22 = 1022; 96 CHANNEL_LABEL_A_23 = 1023; 97 CHANNEL_LABEL_A_24 = 1024; 98 reserved 1025 to 1224; // Reserved for future ambisonics channels. 99 100 // Next ID: 57 (channel-based) or 1025 (ambisonics). 101} 102 103message ChannelMetadata { 104 // Used to map the index of the channel in an ADM or WAV file. Ignored when 105 // data comes from other sources. 106 optional uint32 channel_id = 1; 107 108 // The IAMF-based channel label. 109 optional ChannelLabel channel_label = 2; 110} 111 112message AudioFrameObuMetadata { 113 reserved 2, 3; 114 115 optional string wav_filename = 1; 116 117 // Controls whether the number of samples required to pad the final frame are 118 // automatically added to the `samples_to_trim_at_end` value. 119 // 120 // When `true` `samples_to_trim_at_end` matches `num_samples_to_trim_at_end` 121 // in the OBU header. If the actual value is too small to account for padding, 122 // then encoding will fail. This is useful to closely represent the value in 123 // the OBU (rarely needed). 124 // 125 // When `false` `num_samples_to_trim_at_end` will be incremented by the 126 // amount of required padding and may not match the OBU header value. This is 127 // useful to closely represent the trimming applied to the original audio 128 // content (typically recommended). 129 // 130 // Typically the recommended settings are: 131 // - samples_to_trim_at_end_includes_padding: false 132 // - samples_to_trim_at_end: 0 133 // These settings will automatically insert the correct padding to create a 134 // valid final frame and avoid trimming the original audio content. 135 optional bool samples_to_trim_at_end_includes_padding = 9 [default = true]; 136 optional uint32 samples_to_trim_at_end = 4; 137 138 // Controls whether the number of samples required by codec delay for the 139 // initial first frames are automatically added to the 140 // `samples_to_trim_at_start` value. 141 // 142 // When `true` `samples_to_trim_at_start` relates directly to 143 // `samples_to_trim_at_start`s in the initial OBU header. If the actual 144 // value is too small to account for codec delay, then encoding will fail. 145 // This is useful to closely represent the values in the initial OBUs (rarely 146 // needed). 147 // 148 // When `false` `samples_to_trim_at_start` will be incremented by the 149 // amount of required for the codec delay and may not match the OBU header 150 // value. This is useful to closely represent the trimming applied to the 151 // original audio content (typically recommended). 152 // 153 // Typically the recommended settings are: 154 // - samples_to_trim_at_start_includes_codec_delay: false 155 // - samples_to_trim_at_start: 0 156 // These settings will automatically insert the correct codec delay to create 157 // a valid final frame and avoid trimming the original audio content. 158 optional bool samples_to_trim_at_start_includes_codec_delay = 10 159 [default = true]; 160 optional uint32 samples_to_trim_at_start = 5; 161 162 // ID of the audio element whose substreams will be provided/mixed 163 // from the channels in this WAV file. 164 optional uint32 audio_element_id = 6; 165 166 // Channels used in this WAV file, in the order as described in [ITU2051-3] 167 // for loudspeaker layouts or ACN order for ambisonics. May be fewer than 168 // the total number of channels in the WAV file if only a subset is to be 169 // used. 170 repeated uint32 channel_ids = 7 [packed = true, deprecated = true]; 171 172 // Channel Labels, e.g. "L2", "Ls5". For ambisonics, use "A{ACN number}", 173 // e.g. "A0", "A13". Must be of the same length as `channel_ids`. 174 repeated string channel_labels = 8 [deprecated = true]; 175 176 // Prefer `channel_metadata` over `channel_ids` and `channel_labels`. 177 repeated ChannelMetadata channel_metadatas = 11; 178 179 // Next ID: 12 180} 181