Sign in

username:

password:



Not a member?

Search speechcoding



Search tips

Subscribe to speechcoding



speechcoding by Keywords

ACELP | ADPCM | AMBE | AMR | AMR-NB | CELP | Codebook | DTMF | G.723 | G.726 | G.729 | GSM | Interpolation | LPC | LSF | LSP | MELP | PCM | Perceptual | Pitch | PSOL | QCELP | Quantization | SMV | VAD | Vocoder

Discussion Groups

Discussion Groups | Speech Coding | decoding more than one channel with speex_encode_int()

Technical discussions related to Speech Coding (all itu and other vocoders, ACELP, CELP, AMR, etc)

  

Post a new Thread

decoding more than one channel with speex_encode_int() - "mas...@tin.it" - May 24 8:49:21 2006




The problem I met consist of two or more decode each one of them 
belong to a different channel.

I'm implementig a easy routine in which 
a buffer 160 element wide is create (called RBuffer[]) and fill of
sample described by 16 bit.
Once the "RBuffer[]" is full the buffer is 
passed to the encode function of speex like this:
     
speex_bits_reset(&bits1);
     speex_encode_int(encState,(spx_int16_t*)
&RBuffer[0], &bits1);
     nbBytes = speex_bits_write(&bits1, cbits, 
200);
Now compleated this first step I have to decode the encoded 
stream and insert the obteined samples in another 
buffer 160 element 
wide called "TBuffer[]" in this way:
     speex_bits_read_from
(&bits2, cbits, nbBytes);
     speex_decode_int(decState, &bits2, 
(spx_int16_t*)&TBuffer[0]); 
Clearly the two SpeexBits structure 
called "bits1" and "bits2" are initialized at the beginning in the 
main()
with this speex function: "speex_bits_init()".

This structure 
of the program works well. The problems begins when I introduce others 
decode.
To simulate two or three decode I take coefficients from the 
same "cbits" and insert the first decoded samples in 
"TBuffer[]" like 
in the previos example, while the second and third in a temporary 
buffer called "TBufferTemp[]":
     speex_bits_read_from(&bits3, 
cbits, nbBytes);
     speex_decode_int(decState, &bits3, (spx_int16_t*)
&TBufferTemp[0]);

     speex_bits_read_from(&bits4, cbits, nbBytes);
     speex_decode_int(decState, &bits4, (spx_int16_t*)&TBufferTemp[0]);
Clearly now the other SpeexBits structure called "bits3" and "bits4" 
are  initialized at the beginning in the main().

The problem I 
encountered is that the suond is bad and the presence of the last two 
decode functions disturbs the first.

I suppose that the content of 
"bits2", "bits3", "bits4" should be the same because the reading
is 
done from the same "cbits"
but it doesn't work in this way.... 
The 
pecularity is that "bits2" and "bits3" are different, and "bits4"
is 
null.

What I'm induced to think is that this functions have memory 
because whit the same input (cbits) give back different 
structures 
(bits2, bits3, bits4).

Someone knows how can I resolve this problem? 
What happen in this function?

Thanks a lot....



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )

Re: decoding more than one channel with speex_encode_int() - "Phil Frisbie, Jr." - May 24 14:31:45 2006

m...@tin.it wrote:

> 
> The problem I met consist of two or more decode each one of them 
> belong to a different channel.

You need a separate decoder states, not just bits structures.
-- 
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )