<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16525" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Hi, I am using 1.2beta2 on a C5416 doing narrowband</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>in the decode function I am having a problem with the execution of my program vectoring off to random interrupts that are not used. I have tracked down the error to the highpass function called in nb_decode -very close to the end of the function-context:</DIV>
<DIV> </DIV>
<DIV>it is called here: ln 1719 for me</DIV>
<DIV> if (st->highpass_enabled)<BR> highpass(out, out, st->frameSize, (st->isWideband?HIGHPASS_WIDEBAND:HIGHPASS_NARROWBAND)|HIGHPASS_OUTPUT, st->mem_hp);<BR> /*for (i=0;i<st->frameSize;i++)<BR> printf ("%d\n", (int)st->frame[i]);*/</DIV>
<DIV> </DIV>
<DIV>here's the function:</DIV>
<DIV> </DIV>
<DIV>void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem)<BR>{<BR> int i;<BR>#ifdef FIXED_POINT<BR> const spx_word16_t Pcoef[5][3] = {{16384, -31313, 14991}, {16384, -31569, 15249}, {16384, -31677, 15328}, {16384, -32313, 15947}, {16384, -22446, 6537}};<BR> const spx_word16_t Zcoef[5][3] = {{15672, -31344, 15672}, {15802, -31601, 15802}, {15847, -31694, 15847}, {16162, -32322, 16162}, {14418, -28836, 14418}};<BR>#else<BR> const spx_word16_t Pcoef[5][3] = {{1.00000f, -1.91120f, 0.91498f}, {1.00000f, -1.92683f, 0.93071f}, {1.00000f, -1.93338f, 0.93553f}, {1.00000f, -1.97226f, 0.97332f}, {1.00000f, -1.37000f, 0.39900f}};<BR> const spx_word16_t Zcoef[5][3] = {{0.95654f, -1.91309f, 0.95654f}, {0.96446f, -1.92879f, 0.96446f}, {0.96723f, -1.93445f, 0.96723f}, {0.98645f, -1.97277f, 0.98645f}, {0.88000f, -1.76000f, 0.88000f}};<BR>#endif<BR> const spx_word16_t *den, *num;<BR> if (filtID>4)<BR> filtID=4;<BR> <BR> den = Pcoef[filtID]; num = Zcoef[filtID];<BR> /*return;*/<BR> for (i=0;i<len;i++)<BR> {<BR> spx_word16_t yi;<BR> spx_word32_t vout = ADD32(MULT16_16(num[0], x[i]),mem[0]);<BR> yi = EXTRACT16(SATURATE(PSHR32(vout,14),32767));<BR> mem[0] = ADD32(MAC16_16(mem[1], num[1],x[i]), SHL32(MULT16_32_Q15(-den[1],vout),1));<BR> mem[1] = ADD32(MULT16_16(num[2],x[i]), SHL32(MULT16_32_Q15(-den[2],vout),1));<BR> y[i] = yi;<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I can step into the function just fine, but when I run it, even just from the initial variable declarations to the top of that "for" loop I vector off. I am thinking this might have something to do with me making the state parameters static instead of running off a heap. these are the sizes and parameters I used:</DIV>
<DIV> </DIV>
<DIV>#ifdef STATIC_INIT<BR> #define ENC_WINBUF_SIZE 40<BR> #define ENC_EXCBUF_SIZE 306<BR> #define ENC_SWBUF_SIZE 306<BR> #define ENC_LAGWINDOW_SIZE 11<BR> #define ENC_OLD_LSP_SIZE 10<BR> #define ENC_OLD_QLSP_SIZE 10<BR> #define ENC_MEM_SP_SIZE 20<BR> #define ENC_MEM_SW_SIZE 20<BR> #define ENC_SW_WHOLE_SIZE 20<BR> #define ENC_MEM_EXC_SIZE 20<BR> #define ENC_MEM_EXC2_SIZE 20<BR> #define ENC_PI_GAIN_SIZE 8<BR> #define ENC_PITCH_SIZE 4</DIV>
<DIV> </DIV>
<DIV> #define DEC_EXCBUF_SIZE 500<BR> #define DEC_INTERP_QLPC_SIZE 10<BR> #define DEC_OLD_QLSP_SIZE 10<BR> #define DEC_MEM_SP_SIZE 20<BR> #define DEC_PI_GAIN_SIZE 8</DIV>
<DIV> </DIV>
<DIV> EncState enc_state;<BR> char enc_stack[NB_ENC_STACK];<BR> spx_word16_t enc_winbuf[ENC_WINBUF_SIZE];<BR> spx_word16_t enc_excbuf[ENC_EXCBUF_SIZE];<BR> spx_word16_t enc_swbuf[ENC_SWBUF_SIZE];<BR> spx_word16_t enc_lagwindow[ENC_LAGWINDOW_SIZE];<BR> spx_lsp_t enc_old_lsp[ENC_OLD_LSP_SIZE];<BR> spx_lsp_t enc_old_qlsp[ENC_OLD_QLSP_SIZE];<BR> spx_mem_t enc_mem_sp[ENC_MEM_SP_SIZE];<BR> spx_mem_t enc_mem_sw[ENC_MEM_SW_SIZE];<BR> spx_mem_t enc_mem_sw_whole[ENC_SW_WHOLE_SIZE];<BR> spx_mem_t enc_mem_exc[ENC_MEM_EXC_SIZE];<BR> spx_mem_t enc_memexc2[ENC_MEM_EXC2_SIZE];<BR> spx_word32_t enc_pi_gain[ENC_PI_GAIN_SIZE];<BR> int enc_pitch[ENC_PITCH_SIZE];</DIV>
<DIV> </DIV>
<DIV> DecState dec_state;<BR> char dec_stack[NB_DEC_STACK];<BR> spx_word16_t dec_excbuf[DEC_EXCBUF_SIZE];<BR> spx_coef_t dec_interp_qlpc[DEC_INTERP_QLPC_SIZE];<BR> spx_lsp_t dec_old_qlsp[DEC_OLD_QLSP_SIZE];<BR> spx_mem_t dec_mem_sp[DEC_MEM_SP_SIZE];<BR> spx_word32_t dec_pi_gain[DEC_PI_GAIN_SIZE];</DIV>
<DIV> </DIV>
<DIV>#endif </DIV>
<DIV> </DIV>
<DIV>I noticed that when inside the high pass function that len must be greater that 160 because I single stepped through it and I got to be greater than A0 and that I cannot read any of the variables passed as a parameter, they always show up as FP + some value. any thoughts on what might be going on? (FIXED_POINT is defined)</DIV>
<DIV> </DIV>
<DIV>-Mike</DIV>
<DIV> </DIV></BODY></HTML>