shithub: opus

Download patch

ref: a20500db0b694ebc3c24e72b72031f57abe42518
parent: 9dff02188c03bdeabda9e6131d579e8208e769fd
author: Jean-Marc Valin <[email protected]>
date: Tue Jun 16 12:45:23 EDT 2009

ietf doc: stereo description

--- a/doc/ietf/draft-valin-celt-codec.xml
+++ b/doc/ietf/draft-valin-celt-codec.xml
@@ -148,7 +148,7 @@
 <t>
 The CELT codec does not use a standard <spanx style="emph">bit-packer</spanx>, 
 but rather uses a range coder to pack both integers and entropy-coded symbols. 
-The bit-stream generated by the encoder contains (in the same order) the 
+In mono mode, the bit-stream generated by the encoder contains (in the same order) the 
 following parameters:
 </t>
 
@@ -523,6 +523,22 @@
 
 </section>
 
+
+<section anchor="stereo" title="Stereo support">
+<t>
+When encoding a stereo stream, some parameters are shared across the left and right channels, while others are transmitted for each channel, or jointly encoded. All the flags for the features, transients and pitch (pitch period and gains) are transmitted only one copy. The coarse and fine energy parameters are transmitted separately for each channel.
+</t>
+
+<t>
+The main difference between mono and stereo coding is the PVQ coding of the normalised vectors. For bands of N=3 or N=4 samples, the PVQ coding is performed separately for left and right, with only one (joint) pitch bit and the left channel of each band encoded before the right channel of the same band. Each band always uses the same number of pulses for left as for right. For bands of N>=5 samples, a normalised mid-side (M-S) encoding is used. Let L and R be the normalised vector of a certain band for the left and right channels, respectively. The mid and side vectors are computed as M=L+R and S=L-R and no longer have unit norm.
+</t>
+
+<t>
+From M and S, an angular parameter theta=2/pi*atan2(||S||, ||M||) is computed. It is quantised on a scale from 0 to 1 with an intervals of 2^-qb, where qb = (b-2*(N-1)*(40-log2_frac(N,4)))/(32*(N-1)), b is the number of bits allocated to the band, and log2_frac() is defined in <xref target="cwrs.c">cwrs.c</xref>. Let m=M/||M|| and s=S/||S||, m and s are separately encoded with the PVQ encoder described in <xref target="pvq"></xref>. The number of bits allocated to m and s depends on the value of theta.
+</t>
+</section>
+
+
 <section anchor="synthesis" title="Synthesis">
 <t>
 After all the quantisation is completed, the quantised energy is used along with the 
@@ -545,8 +561,8 @@
 If during the decoding process a decoded integer value is out of the specified range
 (it can happen due to a minimal amount of redundancy when incoding large integers with
 the range coder), then the decoder knows there has been an error in the coding, 
-decoding or transmission and SHOULD take measures to conceal the error and/or report
-that a problem has occured.
+decoding, or transmission and SHOULD take measures to conceal the error and/or report
+to the application that a problem has occured.
 </t>
 
 <section anchor="Range Decoder" title="Range Decoder">