Commit 20614c1e authored by johan's avatar johan

Fix array-bound compiler warning

parent bdb7c387
......@@ -202,6 +202,11 @@ void computeLP(word16_t signal[], word16_t LPCoefficientsQ12[], word32_t reflect
}
/* apply lag window on the autocorrelation coefficients spec 3.2.1 eq7 */
/* this check shall be useless but it makes some compiler happy */
if (autoCorrelationCoefficientsNumber>NB_LSP_COEFF+3) {
autoCorrelationCoefficientsNumber = NB_LSP_COEFF+3;
}
for (i=1; i<autoCorrelationCoefficientsNumber; i++) {
autoCorrelationCoefficients[i] = MULT16_32_P15(wlag[i], autoCorrelationCoefficients[i]); /* wlag in Q15 */
//autoCorrelationCoefficients[i] = MULT32_32_Q31(wlag[i], autoCorrelationCoefficients[i]); /* wlag in Q31 */
......
......@@ -148,7 +148,7 @@ void bcg729Encoder(bcg729EncoderChannelContextStruct *encoderChannelContext, int
/* use the whole signal Buffer for windowing and autocorrelation */
/* autoCorrelation Coefficients are computed and used internally, in case of VAD we must compute and retrieve 13 coefficients, compute only 11 when VAD is disabled */
computeLP(encoderChannelContext->signalBuffer, LPCoefficients, reflectionCoefficients, autoCorrelationCoefficients, noLagAutoCorrelationCoefficients, &autoCorrelationCoefficientsScale, (encoderChannelContext->VADChannelContext != NULL)?NB_LSP_COEFF+3:NB_LSP_COEFF+1);
computeLP(encoderChannelContext->signalBuffer, LPCoefficients, reflectionCoefficients, autoCorrelationCoefficients, noLagAutoCorrelationCoefficients, &autoCorrelationCoefficientsScale, (encoderChannelContext->VADChannelContext != NULL)?(NB_LSP_COEFF+3):(NB_LSP_COEFF+1));
/*** compute LSP: it might fail, get the previous one in this case ***/
if (!LP2LSPConversion(LPCoefficients, LSPCoefficients)) {
/* unable to find the 10 roots repeat previous LSP */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment