[Speex-dev] re: decoder issue in sb_celp

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Mar 14 15:51:03 PDT 2007


> Thanks for looking into this- I think I needed to give you a
> bit more info!  Sorry for such a vague initial report.
> 
> So most of these problems seem to be coming
> from the lsp_to_lpc function.  In particular the following:
>             xout1 = xin1 - 2.f*x_freq[i2] * *n1 + *n2;
>             xout2 = xin2 - 2.f*x_freq[i2+1] * *n3 + *n4;
> 
> ... in the floating point version this code can produce xout1 or
> xout2 that go to INF.

Well, the question is where does the problem come from. To give INF on
the output, there would need to be a problem with the input. Checked that?

> That is the main issue- I have also seen the IIR filter go wonky
> occasionally, which is what is corrupting st->mem_sp.  

Well, they would if the filter is bad (read unstable).

> Usually
> this is just because there are some odd values in st->interp_qlpc.
> However it seems like it can also just happen sometimes as
> output of the _mm_mul_ps multiply goes to INF (this can also
> happen in the non-sse code).  I am working on figuring out why
> this is happening.

Can you leave SSE out of that for now?

> With the new changes also filter_ratio went to 0 in one of my
> tests, in part because rh was INF.  This is around the section
> where I think you made changes to how you calculate st->pi_gain[sub].
> This caused scale to go to INF further down in the code when
> scale is calculated.  Again, this I think stems from the lpc function
> producing some INF and IND values so I think that is just a symptom.
> 
> I can add bounds checking to the SSE code but I don't know
> what to do regarding the lpc code.
> When this happens the easy fix is to just reset the upper band to
> VERY_SMALL and also to reset mem_sp but I am hoping that this
> won't be needed if the lpc values were in the right range.

Bounds checking and resets aren't the way to go. Fixing the source of
the problem is. Did you actually test with speexenc/speexdec BTW. I'm
beginning to suspect you're writing an application that simply corrupts
the Speex state/stack and causes it do to all kinds of strange things.

	Jean-Marc



More information about the Speex-dev mailing list