[Speex-dev] Decoding multiple encoded frames
darren.longhorn at redembedded.com
Tue Oct 14 01:57:51 PDT 2008
Keith Kyzivat wrote:
> Caveat: Take what I'm saying with a grain of salt -- I haven't actually
> written any code that decodes speex frames myself, though I have written
> code using Jean-Marc's Speexdsp lib.
> Comments below inline
> On Thu, Oct 9, 2008 at 9:28 AM, Darren Longhorn
> <darren.longhorn at redembedded.com
> <mailto:darren.longhorn at redembedded.com>> wrote:
> I think I still didn't fully understand. As a test I encoded some frames
> (wideband, with quality set to 8), each were 70 bytes. I then did three
> - passed half of it to the decoder
> - passed exactly one frame to the decoder
> - I passed two concatenated frames to the decoder.
> In all cases speex_decode_int returned 0.
> Unless I misunderstood what you say above, I think it should have
> returned 0 only for the third test, -1 for the second test and perhaps
> -2 for the first test?
> From what I can tell, here is what happens, and why (I think) you're
> receiving 0 for all three tests:
> 1. You pass in half the samples as the 'bits' arg. Speex looks at 1
> frame worth of those bits and decodes them, decoded result in 'pcm'.
> 2. You pass in exactly 1 frame of data as the 'bits' arg. Speex
> looks at 1 frame worth of those bits (which is all there,
> exactly), decodes them, stores decoded result in 'pcm'.
> 3. You pass in 2 frames of data as the 'bits' arg. Speex looks at 1
> frame worth of those bits (which, again, is all there), decodes
> them, stores decoded result in 'pcm'.
> When there is no more data to decode, then speex will return -1. I'm
> also thinking that you'd need to somehow change what 'bits' points to
> (advancing the pointer to the next frame)... Or then again, I could be
> entirely wrong here -- I haven't actually written any speex_decode_int
> code myself (though I have maintained it, and the speex linkages for the
> project I've worked on).
It sounds plausible, but doesn't seem to agree with what Jean-Marc said?
More information about the Speex-dev