Eliminate the last non-static pointer from the LPC-mode encoder structures.

The API permits the caller to freely copy the codec state on their
own, but this can't work if there are any any position dependant pointers
in the codec state.
This commit is contained in:
Gregory Maxwell 2011-09-06 22:58:01 -04:00
parent f451b33b16
commit 16b25e908a
5 changed files with 14 additions and 17 deletions

View file

@ -62,7 +62,7 @@ TIC(ENCODE_FRAME)
/* Voice Activity Detection */
/****************************/
TIC(VAD)
ret = silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf - 1 );
ret = silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1 );
TOC(VAD)
/**************************************************/
@ -91,12 +91,12 @@ TOC(VAD)
/***************************************/
/* Ensure smooth bandwidth transitions */
/***************************************/
silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf - 1, psEnc->sCmn.frame_length );
silk_LP_variable_cutoff( &psEnc->sCmn.sLP, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length );
/*******************************************/
/* Copy new frame to front of input buffer */
/*******************************************/
SKP_short2float_array( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf - 1, psEnc->sCmn.frame_length );
SKP_short2float_array( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length );
/* Add tiny signal to avoid high CPU load from denormalized floating point numbers */
for( i = 0; i < 8; i++ ) {