<span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse">I have been working on a project importing Speex to a embedded platform for a while.<div>When I tried to shut down the macro TWO_PATH in Speex AEC to save space,</div>
<div>an error occurred. Dbf is undefined.</div><div><br></div><div>The 1.2rc1 code is like this</div><div><br></div><div><div> Dbf = 0;</div><div> See = 0; </div><div>#ifdef TWO_PATH</div><div> /* Difference in response, this is used to estimate the variance of our residual power estimate */</div>
<div> for (chan = 0; chan < C; chan++)</div><div> {</div><div> spectral_mul_accum(st->X, st->W+chan*N*K*M, st->Y+chan*N, N, M*K);</div><div> spx_ifft(st->fft_table, st->Y+chan*N, st->y+chan*N);</div>
<div> for (i=0;i<st->frame_size;i++)</div><div> st->e[chan*N+i] = st->e[chan*N+i+st->frame_size] - st->y[chan*N+i+st->frame_size];</div><div> Dbf += 10+mdf_inner_prod(st->e+chan*N, st->e+chan*N, st->frame_size);</div>
<div> for (i=0;i<st->frame_size;i++)</div><div> st->e[chan*N+i] = st->input[chan*st->frame_size+i] - st->y[chan*N+i+st->frame_size];</div><div> See += mdf_inner_prod(st->e+chan*N, st->e+chan*N, st->frame_size);</div>
<div> }</div><div>#endif</div><div><br></div><div>#ifndef TWO_PATH</div><div> Sff = See;</div><div>#endif</div></div><div><br></div><div><br></div><div>but after examining the code, and comparing it with former version of Speex AEC, I think</div>
<div>it should be like this, to enable both with or without TWO_PATH versions to work.</div><div>Is that so?</div><div><br></div><div><br></div><div><div><div> for (chan = 0; chan < C; chan++) </div><div> {</div>
<div><span style="white-space:pre-wrap">        </span> spectral_mul_accum(st->X, st->W+chan*N*K*M, st->Y+chan*N, N, M*K);</div><div><span style="white-space:pre-wrap">        </span> spx_ifft(st->fft_table, st->Y+chan*N, st->y+chan*N);</div>
<div> }</div><div><br></div><div> See = 0; </div><div>#ifdef TWO_PATH</div><div> Dbf = 0; </div><div><br></div><div> /* Difference in response, this is used to estimate the variance of our residual power estimate */</div>
<div> for (chan = 0; chan < C; chan++)</div><div> {</div><div> for (i=0;i<st->frame_size;i++)</div><div> st->e[chan*N+i] = SUB16(st->e[chan*N+i+st->frame_size], st->y[chan*N+i+st->frame_size]);</div>
<div> Dbf += 10+mdf_inner_prod(st->e+chan*N, st->e+chan*N, st->frame_size);</div><div> }</div><div>#endif</div><div><br></div><div> for (chan = 0; chan < C; chan++)</div><div> {</div><div><span style="white-space:pre-wrap">        </span> for (i=0;i<st->frame_size;i++)</div>
<div><span style="white-space:pre-wrap">                </span> st->e[chan*N+i] = SUB16(st->input[chan*st->frame_size+i], st->y[chan*N+i+st->frame_size]);</div><div><span style="white-space:pre-wrap">        </span> See += mdf_inner_prod(st->e+chan*N, st->e+chan*N, st->frame_size);</div>
<div> }</div><div><br></div><div>#ifndef TWO_PATH</div><div> Sff = See;</div><div>#endif</div></div></div></span>