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.

H.264 Decoder SubFrame Processing Question (getDataFxn)

Hello - 

We have a question regarding subFrame processing with the H.264 Decoder (H264VDEC_TI DEV.500.V.H264AVC.D.HP.IVAHD.02.00.08.00).

We are using release DVRRDK_03.50.00.05 on a DM8168 board.

The encoded data is 1080P60.  We have the encoded frames broken into four slices.  This is produced by the DM8168 H.264 Encoder, and works fine when streaming to VLC using Live 555.

The first_mb_in_slice for the four slices are 0, 2048, 4096 and 6144 respectively.

We are feeding the decoder data slices using the getDataFxn callback.  This is working fine up to the point where we have fed the decoder all the data/slices for the current frame.  But the decoder does not exit the process call as expected until you give it the first slice of the following encoded frame.  

The strange thing is that the last slice submitted must be re-submitted.  So for example, the sequence that the decoder seems to want is:

Enter Decoder Process Call
 - Submit slice 0 of frame 0 via getDataFxn
 - Submit slice 1 of frame 0 via getDataFxn
 - Submit slice 2 of frame 0 via getDataFxn
 - Submit slice 3 of frame 0 via getDataFxn
 - Submit slice 0 of frame 1 via getDataFxn  (required to make decoder happy)
Exit Decoder Process Call
Enter Decoder Process Call
 - Submit slice 0 of frame 1 via getDataFxn  (again)
 - Submit slice 1 of frame 1 via getDataFxn
 - Submit slice 2 of frame 1 via getDataFxn
 - Submit slice 3 of frame 1 via getDataFxn
 - Submit slice 0 of frame 2 via getDataFxn
Exit Decoder Process Call

<CONTINUES WITH THIS PATTERN>

We would like the decoder to exit the process call when all the data for the current frame is provided.

If we try to force the decoder to exit the process by setting the dataSyncDesc->numBlocks = 0 in the getDataFxn callback immediately following the getDataFxn callback where the last encoded slice of the current frame was given to the decoder, then the decoder exits the process call and gives the error:

outArgs->viddec3OutArgs.extendedError for channel 0 Error: 0x4004000

Our Questions:

1. What sequence/method is required to get the decoder to exit the process call in a good state after giving it all the data/slices from one encoded frame?  

2. How does the decoder detect that it has all the data required for one complete encoded frame and then exits the process call?

3. Could this be a result of how we are encoding the data?

Thank you for your help.

/****************************************************************************************/

Here are the static parameters for decoder subFrame processing setup we are using:

// Required per E2E Forum thread

staticParams->processCallLevel = IH264VDEC_FIELDLEVELPROCESSCALL;

// Specify that the input will be presented in slices.

staticParams->viddec3Params.inputDataMode = IVIDEO_SLICEMODE;

// Specify that the stream will contain start codes

staticParams->bitStreamFormat = IH264VDEC_BYTE_STREAM_FORMAT;

/****************************************************************************************/

  • Hi David,

                   I have verified in standalone decoder by giving only slices of 1st frame and observed that the decoder is exiting properly. You need to keep a separator at the end of every frame in your slice sizes file given to the decoder. Once refer to H264Dec_getDataNALUnits fucntion in TestAppDecSupport.c file(This file will be present in RTSC package) for better understanding. The decoder detects the end of frame based on the number of MBs it has decoded.

    Thanks & Regards,

    Suresh

  • Hi, David

    You have the encoded frames broken into four slices. I want to use the subframe whic the inputMode is IVIDEO_NUMROWS.

    I should set the getDataFxn and the getDatahandle, is it right?

    How to set the them?

    Can you help me? Thanks .