Hi, I'm trying to encode a stereo speex file on the blackfin without much luck. This is a standalone application with no OS using the speex library provided in the blackfin multimedia sdk. I believe this library was ported to run using Visual DSP++ by Jean-Marc (may be wrong). I have mono encoding working fine, to add stereo encoding I just added a call to speex_encode_stereo_int() before I encode the mono channel. The data passed to speex_encode_stereo_int() is the two channels interleaved. The resulting file (after being wrapped in Ogg with channels set to two) is decoded as stereo but is missing the separation, ie. the two channels have been mixed but there is no intensity difference between left and right. I'm doing the decoding on a Linux box using speexdec. Basically, it looks as though it is mixing the channels correctly but ignoring/not recording the intensity stereo information. I've encoded the file using speexenc on a Linux box and it works correctly, I guess that just leaves my code and the speex library. Here's the snippet of code that's doing the encoding. int Speex::Encode() { speex_bits_reset(&bits); if (stereo) speex_encode_stereo_int(input, FRAME_SIZE, &bits); speex_encode_int(state, input, &bits); int bytes = speex_bits_write(&bits, output, length); return bytes; } Any clues on what this could be? Regards, Justin.
hmmm...never mind, it seems to be working now. Sorry for the noise. Justin.
On Tue 17 Apr 2007 02:15, Justin Clacherty pondered:> Hi, > > I'm trying to encode a stereo speex file on the blackfin without much > luck. This is a standalone application with no OS using the speex > library provided in the blackfin multimedia sdk. I believe this library > was ported to run using Visual DSP++ by Jean-Marc (may be wrong).Glad things are working - but to provide some clarifications - the Speex that is included in the Blackfin multimedia SDK is an __old__ (about ~2-3 years ago) version of speex that someone at ADI ported (not Jean-Marc - so don't blame him for anything). I think it was done the same time this was written (late 2004/early 2005): http://www.analog.com/UploadedFiles/Technical_Articles/296785076open_source.pdf So you might have some luck contacting those authors. Speex has gone through alot of improvements since then, and I don't think the speex you have produces a binary compatible bitstream with the current trunk/release (if you are not looking for compatibility with other systems, it doesn't matter). The current speex trunk/release does include a Blackfin version, which can be used in an non-OS environment, but must be compiled to gcc, not ADI's VDSP++, since it uses some pretty aggressive assembly optimisations, which VDSP++ can not digest (last time someone tried). If memory serves (which has been a little faulty recently), the VDSP++ implementation was ~30-40 MIPS range, and speex trunk is less than 1/2 of this with gcc. -Robin
> Speex has gone through alot of improvements since then, and I don't think the > speex you have produces a binary compatible bitstream with the current > trunk/release (if you are not looking for compatibility with other systems, > it doesn't matter).Just a note here. Speex has maintained bit-stream compatibility since pre-1.0 releases. I make lots of minor optimisations and improvements, but the bit-stream itself is frozen and has been since the end of 2002. So no need to worry about that. But other than that, it's true that the latest code is usually a better thing to use. Jean-Marc
Robin Getz wrote:> not Jean-Marc - so don't blame him for anythingThanks. Good to know the history, wasn't intending on blaming anyone. :)> Speex has gone through alot of improvements since then, and I don't think the > speex you have produces a binary compatible bitstream with the current > trunk/releaseThe library in the SDK is bitstream compatible. Works fine with the current speexdec and the windows and quicktime plugins.> If memory serves (which has been a little faulty recently), the VDSP++ > implementation was ~30-40 MIPS range, and speex trunk is less than 1/2 of > this with gcc. >Yes, I've seen the improvements on the blackfin and was hoping the latest SDK would have an updated port, but it didn't. I guess I should probably look at either porting the current trunk to VDSP++ or try using gcc. Justin.