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.

AM572x: H.264 encoder configuration error on HDVICP2

Other Parts Discussed in Thread: AM5728

Hi,

I am using H.264 encoder (PSDK version 2.00.00) running on AM5728 processor. Configuring encoder width (maxWidth) as 1000 is failing with extended error code 0x4000c000. This issue is not seen for any other value for encoder width. Any suggestions as to what can be causing this?

Regards,

Shipra

  • I will forward this to the software team.
  • Hi Shipra,

    I've consulted the design team on this one. Their feedback will be posted here, when available.

    Best Regards,
    Yordan
  • Hi,

    Can share the complete configuration parameters along with the extErrorCode. Based on extErrorCode, it can be figured out what is the error.

    Regards

    Gajanan

  • Hi,

    Following are the configuration parameters and the extended error code.


    inputContentType : IVIDEO_PROGRESSIVE
    rcAlgo:IH264_RATECONTROL_PRC_LOW_DELAY
    rateControlParamsPreset:IH264_RATECONTROLPARAMS_USERDEFINED
    enablePRC:1
    maxWidth:1000
    maxHeight:1000

    dataEndianness:XDM_BYTE

    inputChromaFormat:XDM_YUV_420SP

    operatingMode:IVIDEO_ENCODE_ONLY
    profile:IH264_MAIN_PROFILE

    level:IH264_LEVEL_42
    inputDataMode:IVIDEO_ENTIREFRAME
    sliceCodingPreset:IH264_SLICECODING_DEFAULT
    outputDataMode:IVIDEO_ENTIREFRAME
    numInputDataUnits:1

    numOutputDataUnits:1

    metadataType[0]:IVIDEO_METADATAPLANE_NONE

    maxBitRate:-1

    minBitRate:100000

    rateControlPreset:IVIDEO_USER_DEFINED

    maxInterFrameInterval:3

    interCodingPreset:IH264_INTERCODING_DEFAULT

    intraCodingPreset:IH264_INTRACODING_DEFAULT

    entropyCodingMode:IH264_ENTROPYCODING_CABAC

    videnc2DynamicParams.targetFrameRate:30000

    videnc2DynamicParams.targetBitRate:6000000

    videnc2DynamicParams.intraFrameInterval:30

    videnc2DynamicParams.interFrameInterval:1

    extendedError:4000c000

    extErrorCode[0] = 0x0

    extErrorCode[1] = 0x0

    extErrorCode[2]= 0x0

    extErrorCode [3] = 0x0

    extErrorCode [4] = 0x0

    Regards,

    Shipra

  • Hi Shipra,

              By looking at the error code, this error is not coming from codec i guess. It should before codec.

    extendedError:4000c000 ==> XDM_UNSUPPORTEDPARAM  & XDM_FATALERROR

    You can check your framework for configuration issues.

    Based on parameters, I can tell you do some below modificaions - 

    rcAlgo:IH264_RATECONTROL_PRC

    OR

    rcAlgo:IH264_RATECONTROL_PRC_LOW_DELAY

    maxInterFrameInterval:1

    Regards

    Gajanan

  • Hi,

    I tried changing the parameters that you suggested but was still seeing the same error from the encoder.

    The error is coming from Videnc process call. Can you elaborate on "By looking at the error code, this error is not coming from codec i guess".

    Also, same configuration with just height and width being multiples of 16 works fine. So when you suggest "You can check your framework for configuration issues." , do you mean codec engine, tiler memory configuration etc.

    Regards,

    Shipra

  • Hi Shipra,

               You can check from where this error is coming. You are using PSDK framwork, so add some kind of log or print mesg to get this.

    If issue is related to width & height, then check what is expected behavior.  Encoder Codec supports non multiple of 16 but if some check condition is failing in PSDK before coming to codec, I am not sure. 

    So check & let me know if you required some more details.

    Regards

    Gajanan

  • Hi,

    Can you please point to where exactly in PSDK framework should i put the log or print mesg to get this information?

    Thanks & Regards,

    Shipra

  • Hi Shipra,

    I am never worked on PSDK framework. So not sure where to add the log or print.
    What is working & non working width, Height configuration you are using ??

    Regards
    Gajanan
  • Hi,

    All height and width which are multiple of 16 work. But if the width is multiple of only 8 this error is seen, the same behavior is not true for height.

    The entire sample encoder configuration for non-working case is provided earlier in this thread

    Regards,

    Shipra

  • Can you assign maxWidth to multiple of 16 and width to 1000 or any number (can be non multiple of 16 or multiple of 8) and try once?
  • Hi,

    I tried setting maxWidth to multiple of 16 and width to the actual width value. I am still getting the same error as before.

    Regards,

    Shipra

  • Are you changing any of the encoder parameter using control() call after create()?
  • Hi,

    We are setting IH264ENC_DynamicParams parmeters like videnc2DynamicParams, interCodingParams, rateControlParams and sliceCodingParams using control() call after create() call

    Regards,

    Shipra

  • Can you dump and share videnc2DynamicParams, interCodingParams, rateControlParams and sliceCodingParams? which will be very helpful for analyzing the issue
  • Hi,

    Please find the dump of the dynamic parameters below:

    videnc2DynamicParams.refFrameRate:30000
    videnc2DynamicParams.targetFrameRate:30000
    videnc2DynamicParams.targetBitRate:6000000
    videnc2DynamicParams.intraFrameInterval:30
    videnc2DynamicParams.generateHeader:0
    videnc2DynamicParams.forceFrame:-1
    videnc2DynamicParams.interFrameInterval:1
    videnc2DynamicParams.mvAccuracy:2
    videnc2DynamicParams.ignoreOutbufSizeFlag:1
    videnc2DynamicParams.sampleAspectRatioHeight:125
    videnc2DynamicParams.sampleAspectRatioWidth:224
    sliceCodingParams.sliceCodingPreset:0
    rateControlParams.rateControlParamsPreset:1
    rateControlParams.enablePRC:1
    rateControlParams.qpI:16
    rateControlParams.qpMaxI:25
    rateControlParams.qpMinI:16
    rateControlParams.qpP:12
    rateControlParams.qpMaxP:51
    rateControlParams.qpMinP:12
    rateControlParams.qpOffsetB:0
    rateControlParams.qpMinB:12
    rateControlParams.qpMaxB:51
    rateControlParams.qpOffsetB:0
    rateControlParams.allowFrameSkip:0
    rateControlParams.initialBufferLevel:6000000
    rateControlParams.HRDBufferSize:6000000
    rateControlParams.rcAlgo:1
    rateControlParams.enablePartialFrameSkip:0
    interCodingParams.interCodingPreset:0
    intraCodingParams.intraCodingPreset:0
    videnc2DynamicParams.inputHeight:1008
    videnc2DynamicParams.inputWidth:1000
    searchCenter.x:32767
    searchCenter.y:32767
    enableROI:0
    enableStaticMBCount:0
    sliceGroupChangeCycle:0

    Regards,
    Shipra
  • In the initial log that you shared you had set the maxWidth to 1000. What is the maxWidth value you tried while keeping the inputWidth to 1000?
  • Hi,

    I have tried with maxWidth set to 1000 as well as 1008 (nearest multiple of 16). With both of these the control() call is failing.

    Regards,

    Shipra

  • Hi,

    Any updates on the above issue?

    Regards,

    Shipra