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.

DM36x H264dec: interlaced decoding fail

Hi,

My customer tried to use DM36x to decode h264 stream which is encoded with interlaced mode, but met below error. Would you pls kindly advise what we need to take care for decoding interlace frame?

IVIDDEC2_Status   extendedError = 0x200
IVIDDEC2_OutArgs decodedBufs.extendedError =0x201 ,Erroneous Mbs in curr frame: 792

The error code means as below:
0x1 IH264VDEC_EX_ERR_DANGLING_FLD Expecting second field but got a new frame number
Bit 9 1 - Applied concealment

I only found below info in codec user guide which is related to interlaced mode, but I don't know how we use this flag. Would you pls help?

After decoding first field of an interlaced frame, outBufsInUseFlag is set to 1.

  • Hi Chris,

    Looks like decoder did not get bitstream data for both fields of frame, one field data is missing. Please send us stream, we will verify at our end.

     

    Thanks,

    Veeranna

  • Hi Chris & Veeranan,

    How do you do?

    This is my test H.264 file, please check.

    5224.test.rar

     

    Thanks & regards.

     

    Archer

  • Hi Archer,

    Your attached stream has syntax issue, cabac_alignment_one_bit  field is Zero, but it should be zero. Because of this DM36x decoder is failing to decode properly.

     

    Thanks,

    Veeranna

  • Hi Veeranna,

    Thanks for your reply!

    The test stream was encodee by "dm365_h264enc_02_20_00_06_production" , and below is the configuration file, Would you like to tell me

     Which parameter control the 'cabac_alignment_one_bit ' bit?

     

    Thanks and regards.

     

    Archer

    ##########################################################################################
    # Parameters
    ##########################################################################################
    ImageWidth   = 704         # Image width in Pels, must be multiple of 16
    ImageHeight   = 576         # Image height in Pels, must be multiple of 16
    FrameRate   = 25000       # Frame Rate per second*1000 (1-100)
    BitRate    = 1572864      # Bitrate(bps)  #if ZERO=>> RC is OFF
    ChromaFormat   = 9           # 9 => XDM_YUV_420SP
    InterlacedVideo   = 1           # 0 => Progressive, 1 => Interlaced
    EnableVUIParam  = 0           # 0 => Disable VUI Parameters, 1 => Enable VUI parameters, 4 => encoded VUI buffer externally provided by Application user
    EnableBufSEI   = 0           # 1 => Enable Buffering Period SEI Message, 0 => Disable
    ME_Type    = 0           # 0 = Normal Search, 1 = Improved SKip MBs(performance will reduce)
    RC_PRESET   = 5           # 1 => Low Delay, 2 => Storage, 3 => 2 Pass, 4 => None, 5 => user defined
    ENC_PRESET   = 3           # 0 => default, 1 => High Quality, 2 => High Speed, 3 => user defined

    ##########################################################################################
    # Encoder Control
    ##########################################################################################
    ProfileIDC    = 100         # Profile IDC (66=baseline, 77=main, 88=extended, 100=HighProfile)
    LevelIDC    = 40          # Level IDC   (e.g. 20 = level 2.0)
    Log2MaxFrameNumMinus4 = 0           # Sets the maximum frame number (Aloowed values 0 -12)
    ConstraintFlag   = 0           # Bit 0 set/reset constraint flag 0, Bit 1 set/reset constraint flag 1,Bit 2 set/reset constraint flag 2,Bit 3 set/reset constraint flag 3
    IntraPeriod   = 30           # Period of I-Frames (0 -> only 1st one is I- Frame, 1 -> all I-Frames (range 0 - 255)
    IDRFramePeriod   = 30           # Period of IDR Frames (0 -> only 1st one is IDR- Frame, 1 -> all IDR-Frames (range 0 - 255) (IDR overrides I, if both periods match)
    LongTermRefreshInterval = 0           # Interval to refresh longterm reference frames.
    EnableLongTermFrame = 0           # 0 -> Disable using longterm reference frame, 1 -> Use longterm frame for reference
    FramesToEncode  = 240           # Number of frames to be coded
    SliceSize    = 18           # Size of each slice in bits
    RateControl   = 1           # 0 => CBR, 1 => VBR, 2 => Fixed QP, 3=> CVBR, 4=> FIXED_RC 5=> CBR custom1 6=> VBR custom1
    MaxDelay    = 2000        # Delay Parameter for Rate Control in milliseconds (>=100)
    QPInit    = 28          # Initial QP for RC (-1,0-51)
    QPISlice    = 28          # Quant. param for I Slices (0-51)
    QPSlice    = 28          # Quant. param for non - I slices (0-51)
    MaxQP    = 45          # Maximum value for QP (0-51)
    MinQP    = 0           # Minimum value for QP (0-51)
    MaxQPI    = 42          # Maximum value for QP for I frame(0-51)
    MinQPI    = 0           # Minimum value for QP for I frame(0-51)
    AirRate    = 0           # Number of Forced Intra MBs
    EntropyCodingMode  = 0           # Entropy Coding Mode (0 = CAVLC, 1 = CABAC)
    Transform8x8FlagIntra = 0           # 0 = Disable, 1 = Enable
    Transform8x8FlagInter = 0           # 0 = Disable, 1 = Enable
    SequenceScalingFlag  = 0           # 0 = Disable, 1 = Auto, 2 = Low, 3 = Moderate, 4 = Reserved , 5 = User Defined Scaling Matrices
    PerceptualRC   = 1           # 1 => Enable Perceptual QP modulation, 0 => Disable
    EncoderQuality   = 3 # 0 => version 1.1 backward compatible mode, 2 => Platinum mode, 1 => Full feature, high Quality (It is depreciated due to performance reasons)
    mvSADout    = 0           # 0->disable mvsad out, 1->enable mvsad out
    useARM926Tcm            = 0           # 0->do not use arm 926 tcm 1-> use arm 926 tcm
    enableROI               = 0           # 0->disable ROI 1-> enable ROI
    mapIMCOPtoDDR           = 0           # 0->do not use DDR 1-> use DDR instead of IMCOP 
    metaDataGenerateConsume = 0           # 0->Not in use, 1-> Generate Meta data, 2-> Use Metadata generated by other encoder.  
    sliceMode               = 3           # 0 -> no multiple slices, 1 -> multiple slices - bits/slice , 2 -> multiple slices-MBs/slice, 3 -> multiple slices - Rows/slice
    numTemporalLayers       = 0           # 0-> one layer, 1-> two layer, 2-> three layer, 3-> four layer, 255 -> Chain free P frames
    svcSyntaxEnable         = 0           # 0-> SVC off ST refframes, 1-> SVC on ST refframes, 2-> SVC off LT refframes, 3-> SVC on LT refframes,
    outputDataMode          = 1           # 0 -> low latency, encoded streams produced after N (configurable) slices encode, 1 -> encoded stream produce at the end of frame
    sliceFormat             = 1           # 0-> encoded stream in NAL unit format, 1 -> encoded stream in bytes stream format
    interlaceRefMode        = 0           # 0 = ARF (default mode), 1 = SPF, 2 = MRCF
    maxBitrateCVBR          = 2097152      # Max bit rate for CVBR RC algortihm
    enableGDR               = 0           # Flag to enable Gradual Decoder Refresh
    GDRduration             = 5           # GDR refresh duration                  
    GDRinterval             = 30          # Interval between GDR refresh          
    #########################################################################################
    # Loop filter parameters
    ##########################################################################################
    LoopFilterDisable       = 0           # Disable loop filter in slice header (0=Filter, 1=No Filter, 2 = Disable across Slice Boundaries)

     

     

                              

  • Hi Archer,

    If you are using DM36x H264 encoder, generated bitstream should not have any syntax error. Can you please conform you used above config param to generate the test.264 stream which you have sent to me? because in config CABAC is off but in stream CABAC is on.

    One simple step is test decoder is use testapp provided with codec package and run it for non-error bitstream. Conform the stream by opening it any analyzer, and elcard player will not show any error please use other analyzers.

    Thanks,

    Veeranna

  • Hi Veeranna,

    I did use analyzers to open the test H.264 bitstream not player. (And the test stream could be played in VLC well.)

    Now, I change the encoder's parameter EntropyCodingMode (Entropy Coding Mode (0 = CAVLC, 1 = CABAC)) to 1, 

    the bitstream encoded by it could be decode by DM36x decoder! But still, I donnot know the why!

    Hope you would like to give more detail about the problem!

     

    Thanks and regards.

     

    Archer

  • Hi Archer,

    You mean you are able decode the stream generated by TI's DM36x H264 encoder.  the stream test.264 which you sent to me has error, not sure you generated this using TI encoder or while storing some corruption happens. TI encoder will not generate stream with errors. Please share encoder config params and stream for both cases(one with error and other is without error decoded by decoder).

     

    Thanks,

    Veeranna

  • Hi Veeranna,

    This is the 'good' stream file I can decode,

    0714.a-good-stream.rar

     

    the '5224.test.rar' is the bit-stream I cannot decode, and the config I also supply above.

    Entorpycode=1 -> the bit-stream I can decode

    Entorpycode=0 -> the tough one I cannot decode

     

    Thanks and good day!

     

    Archer

  • Hi Archer,

    Sorry for delay, i was on leave.

    Are sure the stream ''5224.test.rar'' which is getting failed to decode is generated with Entorpycode=0?. In header CABAC is ON.

    please send us stream with Entorpycode=0, and it is getting failed. We have Decoder tested  for lot many streams.


  • Hi Veeranna,

     

    CABAC is on?!

    I check it.

     

    Thanks and good day.

     

    Archer