DecodeGain_G729

Decodes the adaptive and fixed-codebook gains.

Syntax

IppStatus ippsDecodeGain_G729_16s (Ipp32s energy, Ipp16s* pPastEnergy, const Ipp16s* pQuaIndex, Ipp16s* pGain);

IppStatus ippsDecodeGain_G729I_16s(Ipp32s energy, Ipp16s valGainAttenuation, Ipp16s* pPastEnergy, const Ipp16s* pQuaIndex, Ipp16s* pGain);

Parameters

energy

Input energy of the codeword.

pPastEnergy

Pointer to the input/output vector (in Q14) of the log-energies for fixed codebook contributions of the 4 previous subframes.

pQuaIndex

NULL for frame erasure; otherwise, pointer to the vector of codebook indices: pQuaIndex [0] - first stage codebook index ,pQuaIndex [1] - second stage codebook index.

valGainAttenuation

Attenuation factor for the gains in case of frame erasure (pQuaIndex = NULL).

pGain

Pointer to the input/output decoded gain: pGain[0] - adaptive (pitch) gain, pGain[1] - fixed codebook gain.

Description

The function ippsDecodeGain_G729 is declared in the ippsc.h file. This function decodes the adaptive and fixed-codebook gains. The fixed codebook gain gc can be expressed as follows:

gc = γg'c,

where g'c is a predicted gain based on previous fixed codebook energies, and γ is a correction factor. The predicted gain is obtained by predicting the log-energy of the current fixed-codebook contribution from the log-energy of the previous fixed-codebook contribution, using the 4th order MA predictor with coefficients [0.68, 0.58, 0.34, 0.19].

The adaptive codebook gain and the factor are vector-quantized using conjugate structured codebooks. The first element in each codebook represents the quantized adaptive-codebook gain and the second element represents the quantized fixed-codebook. In case of frame erasure, the gains are the attenuated versions of the previous gains.

ippsDecodeGain_G729_16s. The two-stage conjugate structured two-dimensional codebook is used: first stage in 3 bits and second stage in 4 bits. In case of frame erasure, factors 0.9 and 0.98 in Q15 are used for attenuation of the adaptive and fixed codebook gains, respectively.

ippsDecodeGain_G729I_16s. The new 6-bit conjugate structured codebook is used. In case of frame erasure, the factor given by valGainAttenuation is used for attenuation of both the adaptive and fixed codebook gains.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when one of the specified pointers is NULL.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.