<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
  <!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
  <title>Codecs for Jingle Audio</title>
  <abstract>This document describes implementation considerations related to audio codecs for use in Jingle RTP sessions.</abstract>
  &LEGALNOTICE;
  <number>0266</number>
  <status>Draft</status>
  <interim/>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XMPP Core</spec>
    <spec>XEP-0167</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>N/A</shortname>
  <discuss>jingle</discuss>
  &stpeter;
  <revision>
    <version>1.1rc1</version>
    <date>2013-03-01</date>
    <initials>psa</initials>
    <remark><p>Updated to reflect standardization of the Opus codec; changed client conformance to also recommend (but not require) support for Opus.</p></remark>
  </revision>
  <revision>
    <version>1.0</version>
    <date>2011-10-04</date>
    <initials>psa</initials>
    <remark><p>Per a vote of the XMPP Council, advanced specification from Experimental to Draft.</p></remark>
  </revision>
  <revision>
    <version>0.6</version>
    <date>2011-06-27</date>
    <initials>psa</initials>
    <remark><p>Clarified that the codec descriptions are non-normative.</p></remark>
  </revision>
  <revision>
    <version>0.5</version>
    <date>2011-06-12</date>
    <initials>psa</initials>
    <remark><p>Moved video codecs to XEP-0299.</p></remark>
  </revision>
  <revision>
    <version>0.4</version>
    <date>2011-06-09</date>
    <initials>psa</initials>
    <remark><p>Recommended G.711 as mandatory-to-implement for audio.</p></remark>
  </revision>
  <revision>
    <version>0.3</version>
    <date>2011-01-12</date>
    <initials>psa</initials>
    <remark><p>Added information about the Opus audio codec.</p></remark>
  </revision>
  <revision>
    <version>0.2</version>
    <date>2009-04-23</date>
    <initials>psa</initials>
    <remark><p>Added information about the Dirac video codec.</p></remark>
  </revision>
  <revision>
    <version>0.1</version>
    <date>2009-04-08</date>
    <initials>psa</initials>
    <remark><p>Initial published version.</p></remark>
  </revision>
  <revision>
    <version>0.0.4</version>
    <date>2009-04-04</date>
    <initials>psa</initials>
    <remark><p>Clarified status of H.264.</p></remark>
  </revision>
  <revision>
    <version>0.0.3</version>
    <date>2009-04-02</date>
    <initials>psa</initials>
    <remark><p>Rewrote document based on developer feedback and Council discussion.</p></remark>
  </revision>
  <revision>
    <version>0.0.2</version>
    <date>2009-03-04</date>
    <initials>psa</initials>
    <remark><p>Added more information about video codecs.</p></remark>
  </revision>
  <revision>
    <version>0.0.1</version>
    <date>2009-03-04</date>
    <initials>psa</initials>
    <remark><p>First draft, copied from XEP-0167 with slight revisions and addition of requirements section.</p></remark>
  </revision>
</header>

<section1 topic='Introduction' anchor='intro'>
  <p>&xep0167; defines the &xep0166; signalling exchanges needed to establish voice chat and other audio sessions using the Real-time Transport Protocol &rfc3550;; however, it does not specify which audio codecs are mandatory-to-implement, since the state of codec technologies is more fluid than the signalling interactions. This document fills that gap by providing guidance to Jingle developers regarding audio codecs.</p>
  <p>Because codec technologies are typically subject to patents, the topics discussed here are controversial. This document attempts to steer a middle path between (1) specifying mandatory-to-implement technologies that realistically will not be implemented and deployed and (2) providing guidelines that, while realistic, do not encourage the implementation and deployment of patent-clear technologies.</p>
</section1>

<section1 topic='Basic Considerations' anchor='basics'>
  <p>The ideal audio codec would meet the following criteria:</p>
  <dl>
    <di><dt>Quality</dt><dd>The encoding quality is acceptable for deployment among XMPP users.</dd></di>
    <di><dt>Packetization</dt><dd>The specification of the codec clearly defines packetization of data for sending over RTP.</dd></di>
    <di><dt>Availability</dt><dd>The codec can be implemented on a wide variety of computing platforms and is commonly used in Internet or other systems.</dd></di>
    <di><dt>Patents</dt><dd>The codec is patent-clear. <note>The term patent-clear does not necessarily mean that no patents have ever been applied for or granted regarding a technology, or that the technology is completely free from patents (since such a judgment is nearly impossible to make, and is outside the purview of the XMPP developer community and the XMPP Standards Foundation); the term means only that those who implement the technology are generally understood to be relatively safe from the threat of patent litigation, either because any relevant patents have expired, were filed in a defensive manner, or are made available under suitable royalty-free licenses.</note> (Although most XMPP developers would prefer to implement codecs that are patent-clear, such options are not always widely implemented and deployed.)</dd></di>
  </dl>
  <p>Unfortunately, not all codecs meet those criteria. In the remainder of this document we discuss the audio codecs that are most appropriate for implementation in Jingle RTP applications.</p>
</section1>

<section1 topic='Codecs' anchor='codecs'>
  <p>This section is non-normative. Future versions of this specification might provide information about additional codecs not listed here.</p>
  <section2 topic='G.711' anchor='codecs-g711'>
    <p>G.711 refers to the Pulse Code Modulation (PCM) codec defined in &ITU; recommendation G.711, which is widely used on the public switched telephone network (PSTN) and by many voice over Internet Protocol (VoIP) providers. There are two versions: the &#956;-law ("U-law") version is widely deployed in North America and in Japan, whereas the A-law version is widely deployed in the rest of the world. The following table summarizes the available information about G.711.</p>
    <table caption='Codec Considerations for G.711'>
      <tr>
        <th>Quality</th>
        <th>Packetization</th>
        <th>Availability</th>
        <th>Patents</th>
      </tr>
      <tr>
        <td>Good quality; no wide-band mode.</td>
        <td>See &rfc5391;.</td>
        <td>Commonly deployed in both PSTN and VoIP systems.</td>
        <td>Developed in 1972; patents have expired.</td>
      </tr>
    </table>
  </section2>
  <section2 topic='Opus' anchor='codecs-opus'>
    <p>The Opus codec was developed within the IETF's <link url='http://tools.ietf.org/wg/codec/'>Codec Working Group</link> and has been published as &rfc6716;. In essence it combines the best features of CELT (developed by Jean-Marc Valin, the creator of Speex) and SILK (created by and widely used in the Skype service). The following table summarizes the available information about Opus.</p>
    <table caption='Codec Considerations for Opus'>
      <tr>
        <th>Quality</th>
        <th>Packetization</th>
        <th>Availability</th>
        <th>Patents</th>
      </tr>
      <tr>
        <td>Extremely high quality; can be used for wide-band audio; very robust in the face of packet loss.</td>
        <td>See &opusrtp;.</td>
        <td>In accordance with IETF IPR rules, the codec is covered under a simplified BSD license. See RFC 6716 for details. Starting to be more commonly deployed, and the SILK codec on which it is partly based is very widely deployed.</td>
        <td>Designed to be patent-clear, although IPR claims have been filed.</td>
      </tr>
    </table>
  </section2>
  <section2 topic='Speex' anchor='codecs-speex'>
    <p>According to the speex.org website, the Speex codec is "an Open Source/Free Software  patent-free audio compression format designed for speech". Speex was developed by Jean-Marc Valin and is maintained by the <link url='http://www.xiph.org/'>Xiph.org Foundation</link>. The following table summarizes the available information about Speex.</p>
    <table caption='Codec Considerations for Speex'>
      <tr>
        <th>Quality</th>
        <th>Packetization</th>
          <th>Availability</th>
        <th>Patents</th>
      </tr>
      <tr>
        <td>Good quality; optimized for voice; can be used for wide-band audio.</td>
        <td>See &rfc5574;.</td>
        <td>Freely downloadable under a revised BSD license at &lt;<link url='http://speex.org/'>http://speex.org/</link>&gt; and commonly deployed on Internet (VoIP) systems; not commonly deployed on non-Internet systems.</td>
        <td>Designed to be patent-clear.</td>
      </tr>
    </table>
  </section2>
</section1>

<section1 topic='Guidance for Implementers' anchor='impl'>
  <p>This section is non-normative.</p>
  <p>Given that Opus and G.711 are patent-clear, freely implementable, and commonly deployed, implementers are encouraged to consider including support for both codecs in audio applications of Jingle RTP sessions. Discussion on the jingle@xmpp.org mailing list indicates a slight preference for G.711 because it is easily available and so widely deployed (e.g., in SIP networks and the PSTN). Opus has effectively superseded Speex, and implementers are strongly encouraged to include support for Opus rather than Speex among the "open" codecs.</p>
</section1>

<section1 topic='Mandatory-to-Implement Codecs' anchor='mti'>
  <p>As of January 2013, this document makes the following recommendations:</p>
  <ol>
    <li>Jingle clients MUST implement G.711 (i.e., both PCMU and PCMA) and SHOULD implement Opus.</li>
    <li>Gateways between Jingle networks and other networks (e.g., SIP networks and the PSTN) MUST implement either PCMU or PCMA (and preferably both).</li>
  </ol>
  <p>Naturally, clients and gateways can implement additional codecs, such as those listed in this document.</p>
</section1>

<section1 topic='Security Considerations' anchor='security'>
  <p>For security considerations related to Jingle RTP sessions, refer to <cite>XEP-0167</cite>. This document introduces no new security considerations. See also the security considerations described in the relevant codec specifications.</p>
</section1>

<section1 topic='IANA Considerations' anchor='iana'>
  <p>This document requires no interaction with &IANA;.</p>
</section1>

<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  <p>This document requires no interaction with the &REGISTRAR;.</p>
</section1>

<section1 topic='Acknowledgements' anchor='ack'>
  <p>Thanks to Olivier Crête, Dave Cridland, Florian Jensen, Justin Karneges, Evgeniy Khramtsov, Marcus Lundblad, Tobias Markmann, Jean-Marc Valin, Pedro Melo, Jack Moffitt, Jeff Muller, Jehan Pagès, Arc Riley, Kevin Smith, Remko Tronçon, Justin Uberti, and Paul Witty for their feedback.</p>
</section1>
</xep>
