Browse Source

Fix DTX init bug

- past autocorrelation coefficients can't be 0, set autocorrelation[0]
to 1 for the whole past buffer.
pull/2/head
Johan Pascal 11 years ago
parent
commit
52e10238f1
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/dtx.c

+ 6
- 0
src/dtx.c View File

@ -205,9 +205,15 @@ static uint8_t compareLPCFilters(word32_t *LPCoefficientsAutocorrelation, word32
/* */
/*****************************************************************************/
bcg729DTXChannelContextStruct *initBcg729DTXChannel() {
int i;
/* create the context structure */
bcg729DTXChannelContextStruct *DTXChannelContext = malloc(sizeof(bcg729DTXChannelContextStruct));
memset(DTXChannelContext, 0, sizeof(*DTXChannelContext)); /* set autocorrelation buffers to 0 */
/* avoid arithmetics problem: set past autocorrelation[0] to 1 */
for (i=0; i<7; i++) {
DTXChannelContext->autocorrelationCoefficients[i][0] = ONE_IN_Q30;
DTXChannelContext->autocorrelationCoefficientsScale[i] = 30;
}
DTXChannelContext->previousVADflag = 1; /* previous VAD flag must be initialised to VOICE */
DTXChannelContext->pseudoRandomSeed = CNG_DTX_RANDOM_SEED_INIT;


Loading…
Cancel
Save