codec J.R. Combs, Ed. Internet-Draft Plex GmbH Intended status: Standards Track October 24, 2018 Expires: April 27, 2019 Extended Channel Layouts in an Ogg Opus Container draft-ietf-codec-extended-layouts-00 Abstract This document defines an extension to the Opus audio codec to encapsulate extended channel layouts using the Ogg format. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on April 27, 2019. Copyright Notice Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Combs Expires April 27, 2019 [Page 1] Internet-Draft Extended Opus Channel Layouts October 2018 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Extended Channel Layouts With Ogg Opus . . . . . . . . . . . 2 3.1. Channel Mapping Family 4 . . . . . . . . . . . . . . . . 3 3.2. Allowed Numbers of Channels . . . . . . . . . . . . . . . 3 4. Downmixing . . . . . . . . . . . . . . . . . . . . . . . . . 3 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 5 8. Normative References . . . . . . . . . . . . . . . . . . . . 5 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction For the purpose of this document, "Extended" audio channel layouts are channel layouts composed of standard, fixed speaker positions, which may not be listed in Section 5.1.1.2 of [RFC7845]. Ogg is a general purpose container, supporting audio, video, and other media. It can be used to encapsulate audio streams coded using the Opus codec. See [RFC6716] and [RFC7845] for technical details on the Opus codec and its encapsulation in the Ogg container respectively. This document extends the Ogg Opus format by defining a new channel mapping family for encoding extended channel layouts. The Ogg Opus format is extended indirectly by adding an item with value 4 to the IANA "Opus Channel Mapping Families" registry. When 4 is used as the Channel Mapping Family Number in an Ogg stream, the semantic meaning of the channels in the multichannel Opus stream is an extended layout defined in this document. This mapping can also be used in other contexts which make use of the channel mappings defined by the Opus Channel Mapping Families registry. 2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. 3. Extended Channel Layouts With Ogg Opus Extended channel layouts can be encapsulated in the Ogg format by encoding with the Opus codec and setting the channel mapping family value to 4 in the Ogg identification header (ID). A demuxer implementation encountering Channel Mapping Family 4 MUST interpret Combs Expires April 27, 2019 [Page 2] Internet-Draft Extended Opus Channel Layouts October 2018 the Opus stream as containing an extended layout with the format described in Section 3.1. 3.1. Channel Mapping Family 4 This channel mapping uses a new channel mapping table format. The format is based on the one defined in section 5.1.1 of [RFC7845], but with a different definition of the "Channel Mapping" field. The "Channel Mapping" field contains one octet per channel, which is constrained to be equal to M + N. Let 'index' be the position of this octet for a particular output channel. If 'index' is less than 2*M, the output MUST be taken from decoding stream ('index'/2) as stereo and selecting the left channel if 'index' is even, and the right channel if 'index' is odd. If 'index' is 2*M or larger, the output MUST be taken from decoding stream ('index' - M) as mono. Let 'channel' be the value of this octet. This value represents the bit position of this channel in the dwChannelMask member of [WAVEFORMATEXTENSIBLE]. For instance, SPEAKER_FRONT_LEFT is represented by the value 0, SPEAKER_FRONT_RIGHT as 1, and so on. 3.2. Allowed Numbers of Channels For channel mapping family 4, any integer number of channels between 1 and 18 is allowed. This corresponds to the channels named in [WAVEFORMATEXTENSIBLE]. 4. Downmixing The downmixing matrices in this section are only examples known to give acceptable results for stereo downmixing from most common extended layouts, but other mixing strategies will be allowed, e.g., to emphasize a certain panning. An Ogg Opus player MAY generate matrices using the algorithm described in this section to implement downmixing from most multichannel files using Channel Mapping Family 4. If any channels that are intended as part of a stereo pair (i.e. their names include LEFT or RIGHT) are present without the corresponding paired channel, this algorithm does not apply. Begin by generating a matrix of size 2x(number of input channels), filled with 0 coefficients. Combs Expires April 27, 2019 [Page 3] Internet-Draft Extended Opus Channel Layouts October 2018 If the FRONT_LEFT and FRONT_RIGHT channels are present, set their coefficients for the corresponding output channels to 1. If the FRONT_LEFT_OF_CENTER and FRONT_RIGHT_OF_CENTER channels are present, set their coefficients for the corresponding output channels to 1. If the FRONT_CENTER channel is present, set its coefficient for both output channels to 1/sqrt(2). If the BACK_CENTER channel is present, set its coefficient for both output channels to 1/2. If the LOW_FREQUENCY channel is present, set its coefficient for both output channels to 1/sqrt(2). If the BACK_LEFT and BACK_RIGHT channels are present, set their coefficients for the corresponding output channels to 1/sqrt(2). If the SIDE_LEFT and SIDE_RIGHT channels are present, set their coefficients for the corresponding output channels to 1/sqrt(2). Take the sum of all resulting coefficients for a single output channel. If this sum is greater than one, optionally divide all coefficients by it for normalization. 5. Security Considerations Implementations of the Ogg container need to take appropriate security considerations into account, as outlined in Section 10 of [RFC7845]. The extension defined in this document requires that semantic meaning be assigned to more channels than the existing Ogg format requires. Since more allocations will be required to encode and decode these semantically meaningful channels, care should be taken in any new allocation paths. Implementations MUST NOT overrun their allocated memory nor read from uninitialized memory when managing extended channel mappings. 6. IANA Considerations This document updates the IANA Media Types registry "Opus Channel Mapping Families" to add 1 new assignment. +-------+--------------------------+------------------------------+ | Value | Description | Reference | +-------+--------------------------+------------------------------+ | 4 | Extended channel layouts | Section 3.1 of this document | +-------+--------------------------+------------------------------+ Combs Expires April 27, 2019 [Page 4] Internet-Draft Extended Opus Channel Layouts October 2018 7. Acknowledgments Thanks to Jean-Marc Valin and Mark Harris for their guidance and valuable contributions to this document. 8. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC6716] Valin, JM., Vos, K., and T. Terriberry, "Definition of the Opus Audio Codec", RFC 6716, DOI 10.17487/RFC6716, September 2012, . [RFC7845] Terriberry, T., Lee, R., and R. Giles, "Ogg Encapsulation for the Opus Audio Codec", RFC 7845, DOI 10.17487/RFC7845, April 2016, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [WAVEFORMATEXTENSIBLE] Microsoft, "WAVEFORMATEXTENSIBLE structure", 1999, . Author's Address Rodger Combs (editor) Plex GmbH Email: rodger@plex.tv Combs Expires April 27, 2019 [Page 5]