From 66e7816833b831751a4609a01c0116f54340ac9d Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Sat, 4 Jul 2009 22:22:18 -0400 Subject: [PATCH] ietf doc: stereo and other details --- doc/ietf/draft-valin-celt-codec.xml | 39 +++++++++++++---------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/doc/ietf/draft-valin-celt-codec.xml b/doc/ietf/draft-valin-celt-codec.xml index 13b55ccf..07719820 100644 --- a/doc/ietf/draft-valin-celt-codec.xml +++ b/doc/ietf/draft-valin-celt-codec.xml @@ -51,12 +51,7 @@ - - - + General @@ -217,7 +212,10 @@ based on three parameters: -The mode data that is created defines how the encoder and the decoder operate. More specifically, the following information is contained in the mode object: +The frame size can be any even number of samples from 64 to 512, inclusively. +The sampling rate must be between 32000 Hz and 96000 Hz. The mode data that is +created defines how the encoder and the decoder operate. More specifically, the +following information is contained in the mode object: Frame size @@ -879,7 +877,11 @@ The main difference between mono and stereo coding is the PVQ coding of the norm -From M and S, an angular parameter theta=2/pi*atan2(||S||, ||M||) is computed. It is quantized on a scale from 0 to 1 with an interval 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 cwrs.c. Let m=M/||M|| and s=S/||S||; m and s are separately encoded with the PVQ encoder described in . The number of bits allocated to m and s depends on the value of itheta, which is a fixed-point (Q14) representation of theta. The value of itheta needs to be treated in a bit-exact manner since both the encoder and decoder rely on it to infer the bit allocation. The number of bits allocated to coding m is obtained by: +From M and S, an angular parameter theta=2/pi*atan2(||S||, ||M||) is computed. The theta parameter is converted to a Q14 fixed-point parameter itheta, which is quantized on a scale from 0 to 1 with an interval 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 cwrs.c. From here on, the value of itheta MUST be treated in a bit-exact manner since +both the encoder and decoder rely on it to infer the bit allocation. + + +Let m=M/||M|| and s=S/||S||; m and s are separately encoded with the PVQ encoder described in . The number of bits allocated to m and s depends on the value of itheta. The number of bits allocated to coding m is obtained by: @@ -887,10 +889,13 @@ From M and S, an angular parameter theta=2/pi*atan2(||S||, ||M||) is computed. I imid = bitexact_cos(itheta); iside = bitexact_cos(16384-itheta); delta = (N-1)*(log2_frac(iside,6)-log2_frac(imid,6))>>2; +qalloc = log2_frac((1<<qb)+1,4); mbits = (b-qalloc/2-delta)/2; +where bitexact_cos() is a fixed-point cosine approximation that MUST be bit-exact with the reference implementation +in mathops.h. @@ -1151,6 +1156,7 @@ as the encoder. The IMDCT and windowing are performed by mdct_backward the signal is de-emphasized using the inverse of the pre-emphasis filter used in the encoder: 1/A(z)=1/(1-alpha_p*z^-1). +
@@ -1200,17 +1206,6 @@ about both the original signal and the bit-stream plaintext.
-
@@ -1222,7 +1217,7 @@ This document has no actions for IANA.
-The authors would also like to thank the CELT users who contributed source code, feature requests, suggestions or comments. Many thanks to Christopher "Monty" Montgomery for critical listening and help in the tuning phase. +The authors would also like to thank the CELT users who contributed patches, feature requests, suggestions or comments. Many thanks to Christopher "Monty" Montgomery for critical listening and help in the tuning phase.
@@ -1325,8 +1320,8 @@ The authors would also like to thank the CELT users who contributed source code,
-This appendix contains the complete source code for a reference -implementation of the CELT codec written in C. This floating-point +This appendix contains the complete source code for a floating-point +reference implementation of the CELT codec written in C. This implementation is derived from the implementation available on the , which can be compiled for either floating-point or fixed-point architectures.