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.

How can I get slice information of encoder?

Hi everyone,

     I can do H.264 encode in slice mode.  I need to know every slice information for RTP transmit.

Slice information includes slice size (in bytes), slice numbers etc.  So, can I get these infomation

in TI H.264 encoder in runtime? And how?  Please give me some advices.  Thanks.

Sincerely,

James

  • Hi,

         I found encoder has the structure: IH264ENC_MetaDataFormatNaluInfo.  But has no idea

    where I can get this slice information.  Do I need to parse the bitstream externally to get the

    slice information?  But it will waste A8 resource.  Or I can get these information more directly?

    Could anyone give me some advices?  Thanks.

    Sincerely,

    James

  • Hi,

         I tried to set

    staticParams->videnc2Params.outputDataMode = IVIDEO_SLICEMODE;
    staticParams->videnc2Params.numOutputDataUnits = 1;

         But it appeared:

     [m3video] ERROR: XDM_UNSUPPORTEDPARAM = 14,
     [m3video] ERROR: XDM_FATALERROR = 15
     [m3video] ERROR: IH264ENC_IMPROPER_DATASYNC_SETTING = 19,

    What's wrong with it?  Could anyone give me some advices?  Thanks.

    Sincerely,

    James

  • Hi James,

    You need to operate the codec in DataSync mode which requires to be provided with some implemented call back functions from app.

    More details on this can be found on the thread of http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/144961.aspx#530490

    Though the codec is different, the mechanism is same.

    Let me know if anything is not clear.

  • James,

    If you want to generate streams with slices you have to set the below parameters

    staticParams->sliceMode (This a part of extended create time parameters)

    dynamicParams->sliceSize (This a part of extended run time parameters)

    More details of this parameter can be found in the link

    http://processors.wiki.ti.com/index.php/H.264_DM36x_Ver_2.1_Codec

    If you are interested in low latency applications you can get some information from link below

    http://processors.wiki.ti.com/index.php/DM36x_H.264_encoder_FAQ#How_to_use_DM36x_H.264_Encoder_Low_latency_call_back_APIs_for_achieving_slice_level_captue_and_encode.C2.A0.3F

    Regarding the error, could you post the rest of encoder parameters?

  • Hi Adhithya,

    As James is working with HDVICP2 and M3 based codec the following might be of more help and not confusing.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/144961.aspx#530490

    Regards,

    Venu

  • Hi Venu,

    I was not aware of the platform. No issues.

    James,

    you can ignore my earlier post

  • Hi Venu,

         I found in encoder cfg file, there were following setting messages:

    InputDataMode            = 3        # Process entire frame. Only supported value is 3.
    OutputDataMode           = 3        # Encode entire frame into a bitstream in single call. Only supported value is 3.

    So, only supported value is 3.  Is it right?  So I can not set OutputDataMode = IVIDEO_SLICEMODE?

    In fact, I try to set

        staticParams->videnc2Params.inputDataMode = IVIDEO_NUMROWS;
        staticParams->videnc2Params.outputDataMode = IVIDEO_SLICEMODE;
        staticParams->videnc2Params.numOutputDataUnits = 1;

    in RDK 1.6.0.11 use case, then resulted:

     [m3video]  23987: ENCODE: Create in progress ... !!!
     [m3video]  24149: ENCODE: Creating CH0 of 1920 x 1080, pitch = (16384, 32768) [PROGRESSIVE] [TILED      ], bitrate = 1000 Kbps ...
     [m3video] 24151:!ERROR!:ENCLINK::links_m3video/iva_enc/encLink_h264.c:[178]::INTERNAL ERROR:-1
     [m3video] ALGCONTROL FAILED:CMD:1
     [m3video]
     [m3video] 24151:ERR::linkID:10000020::channelID:0::errorCode:-5::FileName:links_m3video/iva_enc/encLink_h264.c::linuNum:808::errorCondition:(algStatus == XDM_EOK)
     [m3video]  24153: Assertion @ Line: 681 in links_m3video/iva_enc/encLink_common.c: retVal == ENC_LINK_S_SUCCESS : failed !!

    So, what's wrong with it?  Thanks.

    Sincerely,

    James

  • Hi James,

    leave the cfg files, those are age old cfg files.

    As you are interested in only generating multiple slices whose information you know do not set

    staticParams->videnc2Params.inputDataMode = IVIDEO_NUMROWS; Let it be full frame mode

    If you see the log the ALGControl is failing.

    As we have set the staticParams->videnc2Params.outputDataMode = IVIDEO_SLICEMODE;

    the codec expects the putDataFxn of the dynamicParams->videnc2Params. to be a Non NULL.

    Basically it is the function pointer used as call-back by the codec when ever the staticParams->videnc2Params.numOutputDataUnits of slices are encoded by codec providing the information run time.

    This mechanism of call-back is called DataSync and can be there for both input and output.

    I dont think the current RDK has got the support for the DataSync or Call-back from the codec but one can always implement/add these functions.

    Regards,

    Venu