[Speex-dev] Stereo speex on Blackfin

Justin Clacherty justin at redfish-group.com
Mon Apr 16 23:15:17 PDT 2007


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.



More information about the Speex-dev mailing list