Dear All
I ported the speex decoder in LPC2000 ARM7 family.
Because I fetched the .ogg file from and external MMC card, I can only red a
limited memory block
1) Can I decode only a block of a speex file at time ?
/*Create a new decoder state in narrowband mode*/
state = speex_decoder_init(&speex_nb_mode);
/*Set the perceptual enhancement on*/
tmp=1;
speex_decoder_ctl(state, SPEEX_SET_ENH, &tmp);
/* Get frame size */
speex_decoder_ctl(state, SPEEX_GET_FRAME_SIZE, &nbBytes);
/*Initialization of the structure that holds the bits*/
speex_bits_init(&bits);
do
{
lb = file_read(&file, nbBytes, (void *)cbits);
/*Copy the data into the bit-stream struct*/
speex_bits_read_from(&bits, cbits, nbBytes);
/*Decode the data*/
speex_decode(state, &bits, output);
/* now I reder the block */
render(output);
} while(lb); /* do */
2) What is the third parameter of the speex_bits_read_from function ? Can I put
there a fraction of the ogg. file size ?
I red the frame size from the speex_decoder_ctl "nbBytes", and than I
use it to get a frame from the input file. Is it right ?
3) With the previous code I get the error message
warning: Invalid mode encountered: corrupted stream?
Any suggestion ? Where I'm wrong ?
4) Do anyone know if and when will exist a full fixed point version of the speex
? and an optimized version for ARM7 ?
Thank you
Best Regards
Paolo
> I ported the speex decoder in LPC2000 ARM7 family. > Because I fetched the .ogg file from and external MMC card, I can only red a limited memory block > > 1) Can I decode only a block of a speex file at time ?Of course. That's actually the *only* way to do it.> lb = file_read(&file, nbBytes, (void *)cbits);This is *definitely* not how you read an Ogg file.> 2) What is the third parameter of the speex_bits_read_from function ? Can I put there a fraction of the ogg. file size ?It just tells how many bytes you want to copy in the SpeexBits struct.> I red the frame size from the speex_decoder_ctl "nbBytes", and than I use it to get a frame from the input file. Is it right ?I don't understand what you're doing exactly, but it's certainly not right.> 3) With the previous code I get the error message > warning: Invalid mode encountered: corrupted stream? > Any suggestion ? Where I'm wrong ?Everywhere. Look at sampledec to see how you need to decode.> 4) Do anyone know if and when will exist a full fixed point version of the speex ? and an optimized version for ARM7 ?There is. Most of the code is fixed-point already, there's only a handful of float operations left, mostly in wideband. As for optimizing for ARM7 (arch 4), you need to configure with --enable-arm4-asm. Jean-Marc