/*

		CELP Context Initialisation
		
*/

#ifdef CELP_USE_CONTEXT
void celp_context_init(struct celp_context *c)
{
	static float lspold[MAXNO] = {.03f, .05f, .09f, .13f, .19f,
								  .23f, .29f, .33f, .39f, .44f };
	
	c->CELP_cbindex = 0;
	c->CELP_gindex = 0;
	c->CELP_idb = 0;
	c->CELP_nseg = 0;
	c->CELP_pindex = 0;
	c->CELP_frame = 0;
	c->CELP_tauptr = 0;
	c->CELP_minptr = 0;
	c->CELP_plevel1 = 0;
	c->CELP_plevel2 = 0;
	
	c->CELP_syndavg = 0.0f;	
#ifdef CELP_PROTECT
	c->CELP_syncBit = 1;
#endif

	c->DCODTAU_lptr = 0;
	
	c->DELAY_first = TRUE;

	memcpy(c->INTANALY_lspold, lspold, sizeof lspold);
	
	memcpy(c->INTSYNTH_lspold, lspold, sizeof lspold);
	
	c->LDELAY_first = TRUE;
	
	c->PSEARCH_oldptr = 1;
}
#endif