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.

Query regarding sub frame synchronization mode for H264 encoder and decoder on Netra DM816x

Encoder

Version: 01.00.04

For low latency, I am using the encoder in sub frame synchronization mode for input and output. Out put data synchronization is based on slices. I am configuring the encoder with 

                        outputDataMode            = IVIDEO_SLICEMODE;

                        sliceMode                       = IH264_SLICEMODE_MBUNIT;

                        sliceUnitSize                  = 1020;

I have seen that , if the encoded number of bytes for a slice is very small (< 1024 bytes) it combines the output with next slices and give out together. Hence we need to wait for the already encoded slice to get out, till the next few slices are encoded . Encoded slices are not given out  individually. This leads to increase in latency.

Questions: 

  • Is there any later version of encoder where this issue is addressed?
  • Is this limitation coming from the encoder implementation only or based on some other limitation posed by hardware?

Decoder:

Version: 01.00.00

In sub-frame synchronization mode (for input), H264 decoder has been configured with 

                                    inputDataMode      =  IVIDEO_SLICEMODE;

and for output decoder has been configured with 

                                    outputDataMode           = IVIDEO_NUMROWS;

                                     numOutputDataUnits = 17;

My observation is that for slice input, if any slice size if less than 1024 bytes, decoder treats that as end of frame. To avoid that I need to combine multiple slices together and provide to the decoder which increases the latency of the system.

For sub frame output when the decoder is configured with numOutputDataUnits = 17, it gives out decoded output in multiple of numOutputDataUnits (17, 34, 51 MB rows etc). It does not give out slices individually most of the time and hence latency increases.

Questions: 

  • Is there any later version of decoder where these issues are addressed?
  • Are these limitations coming from the decoder implementation only or based on some other limitation posed by hardware?

Regards,

Swapan

  • Hi Swapan,

    Your encoder setting   "sliceMode = IH264_SLICEMODE_MBUNIT" means, you are configuring encoder to create a slices based on number of MBs(1020MBs per slice) and not based on bytes. If you want encoder to generate slice for of each 1020 bytes, set sliceMode = IH264_SLICEMODE_BYTES.


    and for decoder

    >if any slice size if less than 1024 bytes, decoder treats that as end of frame. 

    This is the behaviour with latest decoder also.

    >with numOutputDataUnits = 17, it gives out decoded output in multiple of numOutputDataUnits (17, 34, 51 MB rows etc). It does not give out slices individually 

    This is how decoder is expected to behave. numOutputDataUnits is the freqeuncy in MB rows, the decoder outputs rows.

    If you want decoder notification for every row, set numOutputDataUnits = 1. 

    Ram


  • Hi Ram,

    Thanks for your response.

    I want to clarify few things what I asked for.

    I want to use the encoder in IH264_SLICEMODE_MBUNIT only and my slice size is 1020 MBs only (8 slices per frame for 1080P resolution). When the video complexity is very low, say video encoder generates very small amount of bytes (say 300 bytes), in that case encoder does not give out the encoded bit stream for that slice immediately, instead it combine it with the next slices and give the output. I get less than 8 notifications.

    For decoder when I configure numOutputDataUnits = 17 for 1080P resolution video I should expect 4 notification per frame. But what I am observing, I get less than 4 notification per frame and the number of notification per frame varies for different frames decoded from the bit stream.

    Is there any work around for the decoder to be used when the slice size is less than 1024 bytes and not treating that as end of frame. I don't want to combine multiple slices together as it increases the latency.

    Regards,

    Swapan

  • Hi Swapan,

    This is a limitation of encode and decoder. We can not notify encoded slices immediately, rather we wait for 1KB of data encoding to be finished  then  notify all the slices present in that 1KB together. we have kept this limitation to ease the implementation and improve the overall cycle performance of encoder and decoder. So in worst case a slice will be notified with a delay of time take n to encode 1KB of data.

    May I please know for what application you are trying this?

    Regards
    Deepak Poddar 

  • Deepak,

    Thanks for your response. I am trying this for a ultra low latency streaming server and client application. With this limitation when there is a very low complexity video the system latency will go high.

    What I understand from your response that this limitation is put in the encoder/decoder implementation only. No constraints from the HDVICPs. Is that true? 

    Is there any configuration available for the encoder so that the minimum slice output size if at least 1KB.

    The other limitation what I mentioned on the decoder output size (giving output in multiple of configured number of rows), can you please look into that as well.

    Regards,

    Swapan

  • Swapan,

    Please change the encoder configuration as below and see if you can achieve.

    sliceMode = IH264_SLICEMODE_MBUNIT  IH264_SLICEMODE_BYTES

    sliceUnitSize                  = 1020 1024

    By  doing so, each slice size would be of size 1k bytes.

    Thanks.

  • I don't want to wait for 1k bytes data. Even if the bytes generated per slice (in IH264_SLICEMODE_MBUNIT mode ) is less than 1K bytes, can i get the output immediately?

  • Swapan , I believe that is not possible!!

    Deepak, Any comments on this?


    Thanks.