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.

Linux/TMS320DM368: H264 Encoder resetHDVICPEveryFrame

Part Number: TMS320DM368

Tool/software: Linux

I have been experiencing some intermittent issues running a system based on the DM368 utilizing both the JPEG and H264 encoders.  I have both encoders (JPEG and H264) in the same codec group ID because I don't have enough DMA channels to allocate them separately (I believe they both take 63 out of the 64 total channels separately, if you use the platinum H264 codec).

My question is regarding the H264 encoder parameters, specifically resetHDVICPEveryFrame.  I had previously had this value set to the default (1) but was experiencing issues where the H264 encoder seemed to hang or it would fail to encode a frame.  From looking at the codec manual, it appears that the resetHDVICPEveryFrame should be set to 2 instead of the default value of 1 when using the H264 and JPEG codecs.

Can someone confirm that a value of 2 is the correct value for my use case?  And, if a value of 2 is correct, is it feasible that an incorrect value of 1 for resetHDVICPEveryFrame could cause the H264 encoder to hang?(perhaps waiting for a DMA resource that was remapped)  Or is it feasible that the H264 encoder would fail to encode a frame because of this value being 1 instead of 2?

Thanks!

Randy Scheifele

  • Hi Randy,

    Can you give details of the below?

    1. Are you using IPNC-RDK. If yes what is the version? If not which software are you using?

    2. Version numbers of JPEG and H264 Encoders.

    3. Resolution of  h264 encoder and JPEG encoder.

    4. Do you see hang in very first frame?

  • Hi Prashanth,

    I am not using the IPNC-RDK.  I am using the latest dvsdk for the DM368 (version 4.03).  However, I have updated to the latest JPEG and H264 codecs provided by TI because they released new versions after the DVSDK.  I am using JPEG encoder version 1.00.00.12 and H264 encoder version 2.30.00.06.

    I am primarily using a resolution of 1920x1080 on the H264 encoder and 320x180 for the JPEG encoder.

    I am not seeing a hang on the first frame.  I have seen them hang after a day but have also observed them running continuously for 30 days until a hang.

     Thanks,

    Randy Scheifele

  • Hi Randy,
    Thanks for the details. Please share your H264 and JPEG encoders parameters. I will have a look into it.

  • Prashanth,

    JPEG encoder quality is set to 75.

    I grabbed what I thought were the most relevant H264 encoder params below. If you need others, let me know. Is there some helper function somewhere that dumps out the entire config?

    profileIdc = 100;
    levelIdc = 40;
    entropyMode = 1;
    transform8x8FlagIntraFrame = 1;
    transform8x8FlagInterFrame = 0;
    encQuality = 2;
    enableARM926Tcm = 0;
    enableDDRbuff = 0;

    airRate = 0;
    intraFrameQP = 28;
    interPFrameQP = 28;
    rcAlgo = 1;
    idrFrameInterval = 30;
    mvSADoutFlag = 1;
    resetHDVICPeveryFrame = 2;
    enableROI = 0;
  • Hi Randy,

    Can you please try making enableDDRbuff = 1; other parameters looks fine.

    Ideally resetHDVICPEveryFrame =1 should work. Once this works. resetHDVICPEveryFrame =2 will also work, if you set it to 2, it is optimised version.

  • Prashanth,

    Thanks for looking into this.  I can try and change enableDDRbuff to equal 1, but from the documentation it doesn't seem like it would help.  According to one of the TI wiki pages, enableDDRbuff "allows VICP based codec/algorithm to run in parallel to H.264 codec, subject to other resource like EDMA availability."  We can't run the JPEG and H.264 encoder in parallel because they are in the same codec group ID so they are run sequentially.  Will the enableDDRBuff attribute be useful in this case?

    -Randy

  • Randy,

    Yes you are right. enableDDRbuff will help when running in parallel. You can give a try.

    I have attached the debug library of H264 Encoder. It will give more information on where it has hung. Please share me the logs when it hangs. Full log will help.5282.h264venc_ti_arm926_debug.a.txt

    8424.ih264venc.h

    Rename the library to .a and use it in place of the current library you are using. Mean while, did you observe any hand when you set resetHDVICPEveryFrame = 2;

  • Prashanth,

    Thanks for the reply.

    Since I've changed the resetHDVICPEveryFrame parameter to 2, I have not seen this issue.  However, with the value of 1, my system could run for a month or longer before it had a problem (I'm currently at around 16 days with resetHDVICPEveryFrame=2).  I'm hesitant to change the value of the enableDDRbuff field because it doesn't seem to apply to our use case.  I agree, I could change it, but I'd like to have a rationale for making the change, especially because it takes so long to verify the new parameter value.

    Do you have access to any other documentation around the resetHDVICPEveryFrame parameter?  I'd really like to know what function it is performing under the hood.  The h264 encoder library is shipped as object code, so I can't look at the source myself to find out.

    -Randy

  • Randy,

    Nice to know you did not observe the issue after setting it to 2.  There is no such document for resetHDVICPEveryFrame. The brief info is in the h264encoder Userguide. You might have it. I have attached it here again.  When it takes long time to reproduce the issue you need not try out with enableDDRbuff.

    resetHDVICPEveryFrame = 1; will reload code & data assuming memories of HDVICP is overwritten by other codec

    resetHDVICPEveryFrame = 2; will assume no memory of HDVICP is overwritten but mapping of EDMA channels on TC i changed by different codec. Userguide recommends to set this flag to 2 when H264+JPEG running together.

    h264_encoder_dm365_userguide.pdf 

  • Hi Prashanth,

    You are correct, I already have the h264encoder User Guide.  That is the exact document that I read that prompted me to make the change from 1 to 2 for the resetHDVICPEveryFrame parameter.

    One thing I just noticed when reviewing the h264encoder User Guide, the latest version says it is 2.40.xx but the latest codec page from TI only has version 2.30.xx.  Is there a newer version of the encoder?

    -Randy

    Codec download: software-dl.ti.com/.../index_FDS.html

     

     

  • Hi Randy,

    Randy Scheifele said:
    One thing I just noticed when reviewing the h264encoder User Guide, the latest version says it is 2.40.xx but the latest codec page from TI only has version 2.30.xx.  Is there a newer version of the encoder?

    Yes, there is release of the codec 02.40.xx, this was done for some specific implementation. It should not effect you. What I recommend is to use 02.30.00.06(the latest GAed release), which is present in the web link shared by you.

  • Hi,

    I hope the above inputs were helpful in solving your issue. If the issue is solved then please close it by verifying answer.

    Regards,
    Anuj
    Pathpartner Technology Pvt Ltd.
  • Hi,

    I hope the above inputs were helpful in solving your issue. If the issue is solved then please close it by verifying answer.

    Regards,
    Anuj
    Pathpartner Technology Pvt Ltd.