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.

What’s the difference between the two function called TestApp_WriteOutputData?

hi:

The first TestApp_WriteOutputData below was got from project-

C66x_mpeg2vdec_02_02_01_08_ELF.

XDAS_Void TestApp_WriteOutputData(FILE *fOutFile,

    XDM_BufDesc * outputBufDesc,

    IVIDDEC2_OutArgs *outArgs)

  {

 

    XDAS_UInt8 *s;

    XDAS_Int32 i;

 

    for(i = 0; i < outArgs->displayBufs[0].numBufs; i++)

    {

      s = (XDAS_UInt8 *)outArgs->displayBufs[0].bufDesc[i].buf;

      fwrite (s, sizeof (Byte), outArgs->displayBufs[0].bufDesc[i].bufSize, fOutFile);

    }

 

    fflush (fOutFile);

    return;

  }

The second TestApp_WriteOutputData below was got from project-

100.V.H264HP.E.C6678.01.00.01.03_v1:

 

TestApp_WriteOutputData(outputBufDesc.descs[0].buf,

                        (loutArgs.videnc2OutArgs.bytesGenerated),foutFile);

                    fflush(stdout);

XDAS_Int16 TestApp_WriteOutputData(XDAS_Int8 *src,

                                   XDAS_Int32 uiBytesToWrite,

                                   FILE *fout)

{

 

    /*************************************************************************/

    /* Write the bitstream                                                   */

    /*************************************************************************/

    if(uiBytesToWrite != 0 )

    {

        fwrite(src,1,uiBytesToWrite,fout);

    }

    fflush(fout);

    return 0;

}

 

My question:

 

1.

What was the difference between the two TestApp_WriteOutputData in mpeg2 decoder and H264 encoder?

 

2.

In the first TestApp_WriteOutputData,Why the output bitstream comes from

 outArgs->displayBufs[0].bufDesc[i].buf?

 

But Why the output bitstream comes from outputBufDesc.descs[0].buf in the second

TestApp_WriteOutputData?

 

3.

When I called TI codec such as encoder or decoder,Which I could get right output stream from?

The first TestApp_WriteOutputData or the second?????

  • Hi Steve,

    Both implementations are correct.
    Here Decoder follows IVIDDEC2 interface and Encoder follows IVIDENC2 interface. (You can see this interface header files in the folder: xdais_7_23_00_06\packages\ti\xdais\dm )

    Based on decoder/encoder and interface versions, you need to use relevant writeoutputdata functions.

    Thanks and regards

    Sudheesh

  • Hi Sudheesh:

    thank you for reply,But I guess you didn't understand my meaning.

    In another way,I  expect you make a choice like below.

    When we call ti's codec such as encoder and decoder,where the output bitstream could be got from?

    1.

    can from outArgs->displayBufs[0].bufDesc[i].buf

    cannot from outputBufDesc.descs[0].buf

    2.

    cannot from outArgs->displayBufs[0].bufDesc[i].buf

    can from outputBufDesc.descs[0].buf

    3.

    can from outArgs->displayBufs[0].bufDesc[i].buf

    can from outputBufDesc.descs[0].buf  too.


  • Hi Steve,

    It is case 3.

    It depends on the interface that is used for encoder and decoder.
    Codec data sheet will provide XDM interface infomation.

    You can see xDAIS-DM user guide at this link .

    Thanks and regards

    Sudheesh