From b469e601f635bf55ce6cdbd16c713638f1c0d4fd Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 9 Jun 2009 14:17:05 -0400 Subject: [PATCH] cwrs documentation --- doc/ietf/draft-valin-celt-codec.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ietf/draft-valin-celt-codec.xml b/doc/ietf/draft-valin-celt-codec.xml index c31b5c3c..927ddabe 100644 --- a/doc/ietf/draft-valin-celt-codec.xml +++ b/doc/ietf/draft-valin-celt-codec.xml @@ -370,7 +370,14 @@ The search is performed by alg_quant() (vq.c).
-Derf?? The index is encoded by encode_pulses() (cwrs.c). +The best PVQ codeword is encoded by encode_pulses() (cwrs.c). +The codeword is converted to a unique index in the same way as specified in +. The indexing is based on the calculation of V(N,K) (denoted N(L,K) in ), which is the number of possible combinations of K pulses +in N samples. The number of combinations can be computed recursively as +V(N,K) = V(N+1,K) + V(N,K+1) + V(N+1,K+1), with V(N,0) = 1 and V(0,K) = 0 for K != 0. +There are many different ways to compute V(N,K), including pre-compute tables and direct +use of the recursive formulation. The reference implementation applies the recursive +formulation one line (or column) at a time to save on memory use.