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.

GOP pattern of H.264 HP encoder

I am testing the above encoder having Build ID: 01.00.00.01 and have some question about the GOP pattern.

I would like to generate GOP pattern IBBPBBPBBPBBPBBP in display order, which we use in our existing software. However, not only I cannot succeed in doing so, but also I cannot even generate constant size GOP. If IDR interval is 15, IDRs are generated at 0, 13, 28, 43. That is, 13 for the first GOP size, and then 15 for the rest. If IDR interval is 18, IDRs are generated at 0, 16, 34, 52. That is, 15 for the first GOP size, and then 18 for the rest. Here I am using interframe interval equal to 3.

1. Is there any way we can make the encoder to generate GOPs of the same size and preferrably the pattern I desired above?

I also tried to force the encoder to generate IDR, but failed to make it work. It causes dead lock.

2. Is forcing IDR supported in this release?

Dongning

  • Can you please tell the device you are referring?

    With Regards,

    Pramod

  • Hi Pramond,

    Thank you for your reply. We are using C6678.

    Dongning

  • Hi Dongning,

    There are no issues with GOP interval, you need to check it in display order not in decoding order. I guess in decode order you will be seeing such pattern mentioned by you.

    Please use below method/process to set forceIDR

          if( !(numFramesEncoded%10)){  //Forces IDR for every 10th Frame

                lDynamicParams.videnc2DynamicParams.forceFrame = IVIDEO_IDR_FRAME;

                retValue = H264HPVENC_control(handle, XDM_SETPARAMS,

                                    (H264HPVENC_DynamicParams *)&lDynamicParams,

                                     (H264HPVENC_Status *)&lstatus);

          }

     

                retValue = H264HPVENC_encodeFrame(handle,&lInputBufDesc,

                                                 &outputBufDesc,&linArgs,&loutArgs);

     

          if( !(numFramesEncoded%10)){  //Forces IDR for every 10th Frame

                lDynamicParams.videnc2DynamicParams.forceFrame = IVIDEO_NA_FRAME;

                retValue = H264HPVENC_control(handle, XDM_SETPARAMS,

                                    (H264HPVENC_DynamicParams *)&lDynamicParams,

                                     (H264HPVENC_Status *)&lstatus);

          }

    Best Regards

    Rama Mohana Reddy

  • Hi Dongning,

    As far as I know HP encoder produces frames always in decoding order.

    params.gopStructure is responsible for GOP in play order. It can be:

    IH264HP_GOPSTRUCTURE_NONUNIFORM and IH264HP_GOPSTRUCTURE_UNIFORM

    In case of non-uniform you will get frames from encoder in decoding order: IPBBPBBPBBPBBPBB that corresponds to play order IBBPBBPBBPBBPBBP

    In case of uniform you will get frames from encoder in decoding order: IBBPBBPBBPBBPBBPBB that corresponds to play order BBIBBPBBPBBPBBPBBPBB

    More detailied you can read in ih264hpvenc.h file and in HP encoder user's guide.

    To help you with IDR question it is better to give us your HP encoder configuration. The following parameters are responsible for IDR:

    IDRFrameInterval  - 0: Only first I frame as IDR, 1: All I frames are IDR, 2: 1 out of 2 I frames are IDR starting from first I frame

    intraFrameInterval - The number of frames between two I frames. 0: IPPPP..., 1: IIII..., 2: IPIPIPIPI, 3: IPPIPPIPPI or IPBIPBIPBI, etc.

    Andrey Lisnevich