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.

encoding H264 BP or MP on DM368

On the DM368EVM, I am trying to encode video in H264 BP instead of HP. This is what I am doing:

   IH264VENC_Params h264params = {
     Venc1_Params_DEFAULT,
    66,    //profileIdc
    IH264VENC_LEVEL_50,    //levelIdc
      0,   //Log2MaxFrameNumMinus4
      0,  //ConstraintSetFlag
      1,  //entropyMode
      1,  //transform8x8FlagIntraFrame
      0,  //transform8x8FlagInterFrame
      0,  //enableVUIparams
      0,  //meAlgo
      1,  //seqScalingFlag        // 1 as default
      0,   //encQuality
      0,  //enableARM926Tcm
      0,  //enableDDRbuff
      0,  //sliceMode
      0,  //numTemporalLayers
      0,  //svcSyntaxEnable
      0, //EnableLongTermFrame
      IH264VENC_TI_ENTIREFRAME,  //outputDataMode
      1,  //sliceFormat
    };
h264params.videncParams.size = sizeof(IH264VENC_Params);

encode1.hVe1 = Venc1_create( encode1.hEngine, "h264enc", (VIDENC1_Params*)&h264params, &encode1.dynParams );

It's always failing with 66=baseline, 77=main, but it works just fine with 100=HighProfile.

Any idea why it's failing ?

Thanks.

  • It is failing because of below two settings. Make them 0 and it should work in baseline profile.

          1,  //entropyMode
          1,  //seqScalingFlag        // 1 as default

    Please refer Appendix B Error Description for further details.

  • Hi Ritesh,

    It's still failing with both entropyMode and seqScalingFlag set to 0.

    How could I get a detailed description when it's failing?

    Thanks!

    Olivier

  • Hi 

    Transform8x8 is also not allowed in   Base profile. 

    To know the which parameter is going wrong please debug codec library it will print more information parameters.

    You can also refer http://e2e.ti.com/support/embedded/multimedia_software_codecs/f/356/t/115354.aspx#500511 

    Thanks,

    Veeranna

  • Hi Veeranna,

    I tried all this, bit it's still failing, and I am not exactly sure how to debug the issue to get useful information.

    If I change profileIdc to 100, it then work just fine.

    Could-it be a memory problem ?

    I can encode fine in HP 1080P.

    Thanks, Olivier

  • Got it, working now both in BP, MP and HP.

    I had to do this:

        IH264VENC_Params h264params = IH264VENC_PARAMS;
        h264params.videncParams = Venc1_Params_DEFAULT;
        h264params.profileIdc = 77;                 /*!< pofile IDC (66=baseline, 77=main, 88=extended, 100=HighProfile) */
        h264params.levelIdc = 41;                    /*!< level idc */
        h264params.Log2MaxFrameNumMinus4 = 0;         /*!< Set the maximum frame number value  */
        h264params.ConstraintSetFlag = 0;             /*!< ConstraintSetFlags */
        h264params.entropyMode = 0;                    /*!< entropy mode flag 0-CAVLC, 1-CABAC */
        h264params.transform8x8FlagIntraFrame = 0;    /*!< Flag for 8x8 Transform in Inter frames*/
        h264params.transform8x8FlagInterFrame = 0;    /*!< Flag for 8x8 Transform in Intra Frames*/
        h264params.enableVUIparams = 0;                /*!< Enable VUI Parameters */
        h264params.meAlgo = 0;                        /*!< Reserved */
        h264params.seqScalingFlag = 0;                 /*!< Sequence Scaling Matrix Present Flag */
                                                            /*!< = Disable, 1 = Auto, 2 = Low, 3 = Moderate, 4 = Reserved */
        h264params.encQuality = 0;                     /*!< 0 => version 1.1 backward compatible mode, 2 => Platinum mode,
                                                                       1 => Full feature, high Quality (It is depreciated due to performance reasons) */
        h264params.enableARM926Tcm = 0;              /*!< 0 -> do not use ARM926 TCM, 1 -> use ARM926 TCM */
        h264params.enableDDRbuff= 0;                /*!< 0 -> do not use DDR, 1 -> use DDR instead of IMCOP */
        h264params.sliceMode = 0;                    /*!< 0 -> no multiple slices, 1 -> multiple slices - bits/slice  */
                                                    /*!< 2 -> multiple slices-MBs/slice,3 -> multiple slices - Rows/slice*/
        h264params.numTemporalLayers= 0;             /* Number of temporal layers
                                                                0 -> one layer (Base layer)
                                                                1 -> two layers
                                                                2 -> three layers
                                                                3 -> four layers
                                                            255 -> Chain free P frames */
        h264params.svcSyntaxEnable = 0;               /* SVC and MMCO enable/disable
                                                        0 -> SVC disabled short term ref frames used
                                                        1 -> SVC enabled short term ref frames used
                                                        2 -> SVC disabled long term ref frames used
                                                        3 -> SVC enabled long term ref frames used*/
        h264params.EnableLongTermFrame = 0;            /* Flag to enable/disable long term reference frame */
        h264params.outputDataMode = IH264VENC_TI_ENTIREFRAME;    /* 0 -> low latency, encoded streams produced after N (configurable) slices encode,*/
                                                       /* 1 -> encoded stream produce at the end of frame */
        h264params.sliceFormat = 1;                  /* 0 -> encoded stream in NAL unit format, */
                                                    /* 1 -> encoded stream in bytes stream format */

       h264params.videncParams = encode1.params;
       h264params.videncParams.size = sizeof(IH264VENC_Params);
        encode1.hVe1 = Venc1_create( encode1.hEngine, "h264enc", (VIDENC1_Params*)&h264params, &encode1.dynParams );

    Thanks for your help!
    Olivier