Forums

G.729 Codebook search for gain quantization and decoding

Started by Saloni Shah March 10, 2006

My query is regarding the pre selection process done for quantization of gains in section 3.9.2 of ITU-T recommendation for G.729 speech codec standard.

 Case 1. 

According to the draft, two fixed gain codebooks    and   are given. Each of them have two columns, first is quantized adaptive codebook gain   & second is quantized fixed codebook gain  

 Characteristics of   are:

   FONT face="Wingdings" size="1">      

Each of second column elements is greater than corresponding first column elements.

FONT face="Times New Roman" size="1">       This codebook has total 8 entries.

 Characteristics of    are:

   FONT face="Wingdings" size="1">       Each of first column elements is greater than corresponding first column elements.

FONT face="Times New Roman" size="1">       This codebook has total 16 entries.

 During preselection, a cluster of four vectors whose second elements are close to unquantized fixed codebook vector gc are chosen from   and  a cluster of eight vectors whose first elements are close to unquantized adaptive codebook vector gp are chosen from .

 hence exhaustive search is done on  50% of remaining vectors of these two codebooks, i.e, 4 X 8 = 32  possibilities to find combination of two indices GA for  and GB for  such that the mean square error of eq. 63 is minimized.

 Case 2.

 According to implementation of G.729 codec in C language given by ITU-T, the preselection  & quantization of gains is done as follows:

The gain codebooks given are fixed, one is thr1 of length 4, which contains only quantized value for  , and other is thr2 of length 8 which contains value only for  

 , the indices for  preselection are derived  from these codebooks only.

The value of predicted fixed codebook gain  is checked first.

If  is positive, following some mathematical criteria indices indice1 ( which is between 1- 4) is selected from thr1 codebook & indice2 ( which is between 1- 8) is selected from thr2 codebook. These indices indices1 & indices2 are used to find GA & GB from gain codebooks   and , 

The differences in both of these criteria are: 

The no of codebooks used & their lengths. 

The required vectors indices GA & GB  which minimizes the mean squared error are selected directly amongst all given vectors of codebooks    and , while in 2ndcase it is derived from indices found amongst codebooks thr1 & thr2. 

Why the implementation method differs in such a way from the proposed one, could anyone explain please?

Also, for decoding the adaptive codebook vector, while finding the frac part for T2 the equation is:

frac = P2 - 2 - 3((P2 + 2)/3 - 1)                                             (Page 27)

but this equation when solved shall always give the value -1 . Why so ?

Regards,

Saloni