This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

G722 Ti Codec Problems

Other Parts Discussed in Thread: OMAP3530

Hi all,

this is my first post. I defelop on a beagleboard with the OMAP3530. I try to get running the g722 Codec. The problem is that the decoded data is not correct. The engine starts and the codec decodes the file I give to it, but the result is not correct. The output file has the same size as the original file but I don't hear the voice, which should be. I hear some strange sounds :D  The file which I try to decode is the file of the g722 package.

So hier is my code:

...

CERuntime_init();
Engine_Handle engineHandle = Engine_open(ENGINE_NAME,NULL,NULL);

ISPHDEC1_Params g722Params;
g722Params.size = sizeof(ISPHDEC1_Params);
g722Params.tablesPtr = NULL;
g722Params.codecSelection = 1;
g722Params.bitRate = 0;

SPHDEC1_Handle decoderHandle = SPHDEC1_create(engineHandle, SPHDECNAME,&g722Params);

Memory_AllocParams memparam = Memory_DEFAULTPARAMS;
memparam.type = Memory_CONTIGPOOL;

XDM1_SingleBufDesc inbuf;
inbuf.buf = (XDAS_Int8*) Memory_alloc(40*sizeof(XDAS_Int16), &memparam);
inbuf.bufSize =40*sizeof(XDAS_Int16);

XDM1_SingleBufDesc outbuf;
outbuf.buf = (XDAS_Int8*) Memory_alloc(160*sizeof(XDAS_Int16), &memparam);
outbuf.bufSize = 160*sizeof(XDAS_Int16);

ISPHDEC1_InArgs inArgs;

inArgs.size = sizeof(ISPHDEC1_InArgs);
inArgs.frameType = ISPHDEC1_FTYPE_SPEECHGOOD;

while(!feof(inFile))
{
inBytesRead = fread(inbuf.buf, sizeof(XDAS_Int16), 40, fin);
if (feof(fin))
{
printf("end of file\n");
break;
}

SPHDEC1_process(decoderHandle, &inbuffer, &outBuffer, &inargs, NULL);

fwrite(outbuf.buf, sizeof(XDAS_Int16), 160, fout);
}
...

So what is my mistake? Please help me!

Thanks

Nawata
  • Hi,

      Please set the codecSelection to NON-ITU mode as given below

    g722Params.codecSelection = 0;

    ITU mode is used only for verifying the codec with ITU streams. This does not include QMF, hence you are not able to get proper output at the end of the decoder.

    regards,

    Venkat

     

  • Normal 0 21 false false false MicrosoftInternetExplorer4

  •  

    Hi, thank you for fast replay.

    I apologise for my bad English.

    I have changed the codecSelection parameter to 0 and I have changed the outArgs parameter of the process function, from NULL to a valid outArgs variable. So now I can hear the voice after decode but it still sounds a little bit strange.

     Now I have tested the encoder, too. But if I encode a file and decode it, than I hear again strange sounds. What do I disregard?

     

    Thanks!!!

  • Hi,

      Can you please share your encoder input, encoder output and decoder output. We will look into the outputs and try to make out the possible errors in the configuration or codec usage.

    regards,

    Venkat

  • Hi Venkat,

    I tested my code again now. I think I have fixed the problem. When I started the decode, I get CMEM ERORRS. After I set ALL InArgs and OutArgs parameter it works! I think so :). Here my InArgs and OutArgs parameter:

     

    decParams.size = sizeof(ISPHDEC1_Params);
        decParams.tablesPtr = NULL;
        decParams.codecSelection = 0;
        decParams.bitRate = 0;

    decInargs.size = sizeof(ISPHDEC1_InArgs);
        decInargs.frameType = ISPHDEC1_FTYPE_SPEECHGOOD;

        decOutargs.size = sizeof(ISPHDEC1_OutArgs);
        decOutargs.extendedError = NULL;
        decOutargs.dataSize = 160 *sizeof(XDAS_Int16);

     

    And befor I call the process funktion I set the inargs.data field

     

    decInargs.data = outbuf;
            SPHDEC1_process(decHandle,&encbuf,&outbuf,&decInargs,&decOutargs);

    Is this right? Thank you!!!

    7282.speeche_out.txt

    5584.speecheEnc.txt

    5826.speecheOrig.txt

  • Hi,

    I have found an other problem. If I deklare the field decPrams after the call of the funktion CERuntime_init() than I get also cmem errors ...

    Why it is so?

    Thank you