DSPRelated.com
Forums

About G.728.

Started by aihaojun January 17, 2001
I am doing G.728 Annex G. CODEC.
Our coder can pass all test serials correctly.
But my decoder can pass the test serials in DISK4, which is for step by step
test.
When I test my decoder using the 'cw1.bin' in DISK1, many problem was
presented.
cw1.bin is used when post-filter is disabled. The first frame is error. The
difference is 1.

The correct result is : 0001 fffa fffd fffc fffb
My result is : 0002 fffa fffe fffc fffA
Because it is post-filter disable, so I output the speech from DeSynthesis
Block.
Below is my C source code , which translate the ST blockfloat to Speech.
Have a bug in them? Please help me.

#ifndef PostFilter
int tmp1,tmp2;
nlstmp=(*DECODERptr).nlsst-3;
if(nlstmp>0)
{
for(i=0;i<IDIM;i++)
output[i]=((*DECODERptr).st[i]>>nlstmp);
}
else
{
for(i=0;i<IDIM;i++)
{
tmp2=(*DECODERptr).st[i]<<-nlstmp;
if(tmp2>32767) tmp22767;
else if(tmp2<-32768) tmp2=-32768;
output[i]=tmp2;
}
} aihaojun




Ai Hao Jun-

Just a very quick guess, but how can an int on C54xx be > 32767? An int on
C54xx is 16-bit, so it is limited to -32768..32767. Comparing to see if a
variable declared as type int is > 32767 would be an "always FALSE" proposition.

Probably you need some .asm code here, to take advantage of the C54xx device's
saturation mode.

Jeff Brower
DSP sw/hw engineer
Signalogic On Wed, 17 Jan 2001, aihaojun <> wrote:
>I am doing G.728 Annex G. CODEC.
>Our coder can pass all test serials correctly.
>But my decoder can pass the test serials in DISK4, which is for step by step
test.
>When I test my decoder using the 'cw1.bin' in DISK1, many problem was
presented.
>cw1.bin is used when post-filter is disabled. The first frame is error. The
difference is 1.
>
>The correct result is : 0001 fffa fffd fffc fffb
>My result is : 0002 fffa fffe fffc fffA
>Because it is post-filter disable, so I output the speech from DeSynthesis
Block.
>Below is my C source code , which translate the ST blockfloat to Speech.
>Have a bug in them? Please help me.
>
>#ifndef PostFilter
> int tmp1,tmp2;
> nlstmp=(*DECODERptr).nlsst-3;
> if(nlstmp>0)
> {
> for(i=0;i<IDIM;i++)
> output[i]=((*DECODERptr).st[i]>>nlstmp);
> }
> else
> {
> for(i=0;i<IDIM;i++)
> {
> tmp2=(*DECODERptr).st[i]<<-nlstmp;
> if(tmp2>32767) tmp22767;
> else if(tmp2<-32768) tmp2=-32768;
> output[i]=tmp2;
> }
> } > aihaojun
>