idnits 2.17.1 draft-ietf-codec-ambisonics-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 131 has weird spacing: '... order n = ...' == Line 132 has weird spacing: '... degree m = k...' -- The document date (March 27, 2017) is 2558 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 codec J. Skoglund 3 Internet-Draft M. Graczyk 4 Intended status: Standards Track Google Inc. 5 Expires: September 28, 2017 March 27, 2017 7 Ambisonics in an Ogg Opus Container 8 draft-ietf-codec-ambisonics-02 10 Abstract 12 This document defines an extension to the Ogg format to encapsulate 13 ambisonics coded using the Opus audio codec. 15 Status of This Memo 17 This Internet-Draft is submitted in full conformance with the 18 provisions of BCP 78 and BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF). Note that other groups may also distribute 22 working documents as Internet-Drafts. The list of current Internet- 23 Drafts is at http://datatracker.ietf.org/drafts/current/. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 This Internet-Draft will expire on September 28, 2017. 32 Copyright Notice 34 Copyright (c) 2017 IETF Trust and the persons identified as the 35 document authors. All rights reserved. 37 This document is subject to BCP 78 and the IETF Trust's Legal 38 Provisions Relating to IETF Documents 39 (http://trustee.ietf.org/license-info) in effect on the date of 40 publication of this document. Please review these documents 41 carefully, as they describe your rights and restrictions with respect 42 to this document. Code Components extracted from this document must 43 include Simplified BSD License text as described in Section 4.e of 44 the Trust Legal Provisions and are provided without warranty as 45 described in the Simplified BSD License. 47 Table of Contents 49 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 50 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 51 3. Ambisonics With Ogg Opus . . . . . . . . . . . . . . . . . . 3 52 3.1. Channel Mapping Family 2 . . . . . . . . . . . . . . . . 3 53 3.2. Channel Mapping Family 3 . . . . . . . . . . . . . . . . 4 54 4. Downmixing . . . . . . . . . . . . . . . . . . . . . . . . . 5 55 5. Security Considerations . . . . . . . . . . . . . . . . . . . 6 56 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 57 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 58 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 59 8.1. Normative References . . . . . . . . . . . . . . . . . . 7 60 8.2. Informative References . . . . . . . . . . . . . . . . . 7 61 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 63 1. Introduction 65 Ambisonics is a representation format for three dimensional sound 66 fields which can be used for surround sound and immersive virtual 67 reality playback. See [gerzon75] and [daniel04] for technical 68 details on the ambisonics format. For the purposes of this document, 69 ambisonics can be considered a multichannel audio stream. A separate 70 stereo stream can be used alongside the ambisonics in a head-tracked 71 virtual reality experience to provide so-called non-diegetic audio - 72 audio which should remain unchanged by listener head rotation; e.g., 73 narration or stereo music. Ogg is a general purpose container, 74 supporting audio, video, and other media. It can be used to 75 encapsulate audio streams coded using the Opus codec. See [RFC6716] 76 and [RFC7845] for technical details on the Opus codec and its 77 encapsulation in the Ogg container respectively. 79 This document extends the Ogg format by defining two new channel 80 mapping families for encoding ambisonics. The Ogg Opus format is 81 extended indirectly by adding an item with value 2 or 3 to the IANA 82 "Opus Channel Mapping Families" registry. When 2 or 3 are used as 83 the Channel Mapping Family Number in an Ogg stream, the semantic 84 meaning of the channels in the multichannel Opus stream is one of the 85 ambisonics layouts defined in this document. This mapping can also 86 be used in other contexts which make use of the channel mappings 87 defined by the Opus Channel Mapping Families registry. 89 2. Terminology 91 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 92 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 93 "OPTIONAL" in this document are to be interpreted as described in 94 [RFC2119]. 96 3. Ambisonics With Ogg Opus 98 Ambisonics can be encapsulated in the Ogg format by encoding with the 99 Opus codec and setting the channel mapping family value to 2 or 3 in 100 the Ogg identification header (ID). A demuxer implementation 101 encountering Channel Mapping Family 2 or Family 3 MUST interpret the 102 Opus stream as containing ambisonics with the format described in 103 Section 3.1 or Section 3.2, respectively. 105 3.1. Channel Mapping Family 2 107 Allowed numbers of channels: (1 + n)^2 + 2j for n = 0...14 and j = 0 108 or 1, where n denotes the (highest) ambisonic order and j whether or 109 not there is a separate non-diegetic stereo stream. This corresponds 110 to periphonic ambisonics from zeroth to fourteenth order plus 111 potentially two channels of non-diegetic stereo. Explicitly the 112 allowed number of channels are 1, 3, 4, 6, 9, 11, 16, 18, 25, 27, 36, 113 38, 49, 51, 64, 66, 81, 83, 100, 102, 121, 123, 144, 146, 169, 171, 114 196, 198, 225, 227. 116 This channel mapping uses the same channel mapping table format used 117 by channel mapping family 1. The output channels are ambisonic 118 components ordered in Ambisonic Channel Number (ACN) order, defined 119 in Figure 1, followed by two optional channels of non-diegetic stereo 120 indexed (left, right). 122 ACN = n * (n + 1) + m, 123 for order n and degree m. 125 Figure 1: Ambisonic Channel Number (ACN) 127 For the ambisonic channels the ACN component corresponds to channel 128 index as k = ACN. The reverse correspondence can also be computed 129 for an ambisonic channel with index k. 131 order n = floor(sqrt(k)), 132 degree m = k - n * (n + 1). 134 Figure 2: Ambisonic Degree and Order from ACN 136 Note that channel mapping family 2 allows for so-called mixed order 137 ambisonic representations where only a subset of the full ambisonic 138 order number of channels is used. By specifying the full number in 139 the channel count field, the inactive ACNs can then be indicated in 140 the channel mapping field using the index 255. 142 Ambisonic channels are expected to be normalized with Schmidt Semi- 143 Normalization (SN3D). The interpretation of the ambisonics signal as 144 well as detailed definitions of ACN channel ordering and SN3D 145 normalization are described in [ambix] Section 2.1. 147 3.2. Channel Mapping Family 3 149 Allowed numbers of channels: (1 + n)^2 + 2j for n = 0...12 and j = 0 150 or 1, where n denotes the (highest) ambisonic order and j whether or 151 not there is a separate non-diegetic stereo stream. This corresponds 152 to periphonic ambisonics from zeroth to twelfth order plus 153 potentially two channels of non-diegetic stereo. Explicitly the 154 allowed number of channels are 1, 3, 4, 6, 9, 11, 16, 18, 25, 27, 36, 155 38, 49, 51, 64, 66, 81, 83, 100, 102, 121, 123, 144, 146, 169, 171. 157 In this mapping, C output channels (the channel count) are generated 158 at the decoder by multiplying K = N + M decoded channels with a 159 designated demixing matrix, D, having C rows and K columns. Here, N 160 denotes the number of streams encoded and M the number of these which 161 are coupled to produce two channels. As for channel mapping family 2 162 this mapping family also allows for encoding and decoding of full 163 order ambisonics, mixed order ambisonics, and for non-diegetic stereo 164 channels, but also has the added flexibility of mixing channels. Let 165 X denote a column vector containing K decoded channels X1, X2, ..., 166 XK (from N streams), and let S denote a column vector containing C 167 output streams S1, S2, ..., SC. Then S = D X, i.e., 169 / \ / \ / \ 170 | S1 | | D11 D12 ... D1K | | X1 | 171 | S2 | | D21 D22 ... D2K | | X2 | 172 | ... | = | ... ... ... ... | | ... | 173 | SC | | DC1 DC2 ... DCK | | XK | 174 \ / \ / \ / 176 Figure 3: Demixing in Channel Mapping Family 3 178 The matrix MUST be provided as side information and MUST be stored in 179 the channel mapping table part of the identification header, c.f. 180 section 5.1.1 in [RFC7845]. The matrix replaces the need for a 181 channel mapping field and for channel mapping family 3 the mapping 182 table has the following layout: 184 0 1 2 3 185 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 186 +-+-+-+-+-+-+-+-+ 187 | Stream Count | 188 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 189 | Coupled Count | Demixing Matrix : 190 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 192 Figure 4: Channel Mapping Table for Channel Mapping Family 3 194 The fields in the channel mapping table have the following meaning: 196 1. Stream Count 'N' (8 bits, unsigned): 198 This is the total number of streams encoded in each Ogg packet. 200 2. Coupled Stream Count 'M' (8 bits, unsigned): 202 This is the number of the N streams whose decoders are to be 203 configured to produce two channels (stereo). 205 3. Demixing Matrix (16*K*C bits, signed): 207 The coefficients of the demixing matrix stored column-wise as 208 16-bit, signed, two's complement fixed-point values with 15 209 fractional bits (Q15). If needed, the output gain field can be 210 used for a normalization scale. For mixed order ambisonic 211 representations, the silent ACN channels are indicated by all 212 zeros in the corresponding rows of the demixing matrix. 214 Note that [RFC7845] specifies that the identification header cannot 215 exceed one "page", which is 65,025 octets. This limits the ambisonic 216 order to be lower than 12. Also note that the total output channel 217 number, C, MUST be set in the 3rd field of the identification header. 219 4. Downmixing 221 An Ogg Opus player MAY use the matrix in Figure 5 to implement 222 downmixing from multichannel files using channel mapping family 2 and 223 3, when there is no non-diegetic stereo. This downmixing is known to 224 give acceptable results for stereo downmixing from ambisonics. The 225 first and second ambisonic channels are known as "W" and "Y" 226 respectively. 228 / \ / \ / \ 229 | L | | 0.5 0.5 0.0 ... | | W | 230 | R | = | 0.5 -0.5 0.0 ... | | Y | 231 \ / \ / | ... | 232 \ / 234 Figure 5: Stereo Downmixing Matrix for Channel Mapping Family 2 and 3 235 - only Ambisonic Channels 237 The first ambisonic channel (W) is a mono audio stream which 238 represents the average audio signal over all directions. Since W is 239 not directional, Ogg Opus players MAY use W directly for mono 240 playback. 242 If a non-diegetic stereo track is present, the player MAY use the 243 matrix in Figure 6 for downmixing. Ls and Rs denote the two non- 244 diegetic stereo channels. 246 / \ / \ / \ 247 | L | | 0.25 0.25 0.0 ... 0.5 0.0 | | W | 248 | R | = | 0.25 -0.25 0.0 ... 0.0 0.5 | | Y | 249 \ / \ / | ... | 250 | Ls | 251 | Rs | 252 \ / 254 Figure 6: Stereo Downmixing Matrix for Channel Mapping Family 2 and 3 255 - Ambisonic Channels Plus a Non-diegetic Stereo Stream 257 5. Security Considerations 259 Implementations of the Ogg container need take appropriate security 260 considerations into account, as outlined in Section 10 of [RFC7845]. 261 The extension defined in this document requires that semantic meaning 262 be assigned to more channels than the existing Ogg format requires. 263 Since more allocations will be required to encode and decode these 264 semantically meaningful channels, care should be taken in any new 265 allocation paths. Implementations MUST NOT overrun their allocated 266 memory nor read from uninitialized memory when managing the ambisonic 267 channel mapping. 269 6. IANA Considerations 271 This document updates the IANA Media Types registry "Opus Channel 272 Mapping Families" to add two new assignments. 274 +-------+---------------------------+ 275 | Value | Reference | 276 +-------+---------------------------+ 277 | 2 | This Document Section 3.1 | 278 | | | 279 | 3 | This Document Section 3.2 | 280 +-------+---------------------------+ 282 7. Acknowledgments 284 Thanks to Timothy Terriberry, Jean-Marc Valin, Mark Harris, Marcin 285 Gorzel and Andrew Allen for their guidance and valuable contributions 286 to this document. 288 8. References 290 8.1. Normative References 292 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 293 Requirement Levels", BCP 14, RFC 2119, 294 DOI 10.17487/RFC2119, March 1997, 295 . 297 [RFC6716] Valin, JM., Vos, K., and T. Terriberry, "Definition of the 298 Opus Audio Codec", RFC 6716, DOI 10.17487/RFC6716, 299 September 2012, . 301 [RFC7845] Terriberry, T., Lee, R., and R. Giles, "Ogg Encapsulation 302 for the Opus Audio Codec", RFC 7845, DOI 10.17487/RFC7845, 303 April 2016, . 305 [ambix] Nachbar, C., Zotter, F., Deleflie, E., and A. Sontacchi, 306 "AMBIX - A SUGGESTED AMBISONICS FORMAT", June 2011, 307 . 310 8.2. Informative References 312 [gerzon75] 313 Gerzon, M., "Ambisonics. Part one: General system 314 description", August 1975, 315 . 318 [daniel04] 319 Daniel, J. and S. Moreau, "Further Study of Sound Field 320 Coding with Higher Order Ambisonics", May 2004, 321 . 324 Authors' Addresses 326 Jan Skoglund 327 Google Inc. 328 1600 Amphitheatre Parkway 329 Mountain View, CA 94043 330 USA 332 Email: jks@google.com 334 Michael Graczyk 335 Google Inc. 336 1600 Amphitheatre Parkway 337 Mountain View, CA 94043 338 USA 340 Email: mgraczyk@google.com