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.

Questions about some H264 encoder terms

Hi,all:

Now I looked into the H264 HP encoder on C6678.My test project is 100.V.H264HP.E.C6678.01.00.01.03_v1.

I had two question that I couldn't understand.

1.

About slice mode configure.

According to the encoder.cfg file ,slice mode configure is like below:

# ##########################################################################################
#  Slice Mode Configuration
# ##########################################################################################
sliceCodingPreset            = 0 # Preset value for slice coding mode, 0 => deafult values, 1 => user defined
streamFormat                 = 0 # Type of bitstream to be encoded, 0 => Byte stream format, 1=> NALU format(without start code)
sliceMode                    = 1 # Type of slice coding, 0 => slice coding mode is frame based, 1 => Slices are controlled based upon number of Macroblocks
sliceUnitSize                = 600 # Number of macroblocks per slice

In above configure,I cannot understand the meaning of sliceCodingPreset and sliceMode.

What does that mean when its value is 0 or 1?

Especially for sliceMode,"slice coding mode is frame based"  what does that mean?

Another,"Slices are controlled based upon number of Macroblocks" what does this mean too?

it mean that the slices number are equal to the number of Macroblocks which is set in sliceUnitSize?

what's more I cannot understand why we need slice mode?

All of them I have no idea.

2.

Also with H264 encoder,When someone say "insert skip frame".What does that mean?

Why we need insert skip frame?I just know that skip frame can reduce the size of bit stream.

I cannot understand what is so called "insert skip frame".

I am a fresh man for H.264 encoder .Any help will be appreciated.

  • Hi Steve,

    1.
    Slice modes will be helpful if the user wants control in splitting frames into slices.
    One typical usage is in slice level call back feature availble with H264HP encoder.
    It is mainly used in low delay applications. Instead of waiting for entire frame to be encoded, slice level outputs will be given and the application can stitch that to complete frame or transfer to network layer.

    You can see the details regarding slice level parameters at:
    Page 100, IH264HPVENC_SliceCodingParams,H264_Encoder_C6678_UserGuide. (Available with doc section of codec release).

    See "Call Back function for NAL Units" at appendix B for more details regarding slice level call back.


    2. As you said skip frames or skip macroblocks are used to achieve bitstream compression. Bit rate control algorithms inside codec can  skip frames to meet the target bit rate if needed. You can see the rcAlgo option in encoder config file for different bit rate control options. CBR will insert skip frame if it is required to meet the target bit rate. User can choose rcAlgo=2, which is CBR without frameskips.

    Regards
    Sudheesh

  • Sudheesh:

    Could you give me a comparison between with slice mode and without slice mode?

    In my application,I used C6678 _ multicore DSP to encode YUV input data.I couldn't

    see any difference between with slice mode and without slice mode.

    The data flow and control flow of my encoder application was like this below:

    My chip was C6678,Supposed I encoded 720p YUV input data.

    As the datasheet said,it mostly need 2 cores to encode on channel 720p YUV data.

    Supposed they were core0 and core1.

    As ti employee Paula said,6678 usually take data partition approach.The entire YUV frame

    will be divided into N slices .The number of N was to be calculated.

    How to calculate?Usually there were two ways.

    One was default value.As you said the minimum of the slice number was core number.

    Because I need two cores to encode one channel 720p YUV data.So by default the number of

    slice was 2.In this situation,every core only processed one slice YUV data.

    The other way was by setting the value of slice number.If I apparently set slice number 6.

    In this way,every core would process 3 slice YUV data.

    (Here I wanted to ask you one question,Did the two kind of way delegate the difference between

    with slice mode and without slice mode,I didn't know how to prove that the codec was in slice mode.

    Also I didn't know how to prove hat the codec was not in slice mode.So I guessed that if you apparently

    set the value of slice number,it belonged to slice mode.Otherwise,if you wouldn't apparently set the

    value of slice number,you just used the default value _ 2 .Because considering that you need two cores

    to process one entire YUV frame.At least every core processed one slice.Above was only my guess.

    Would you give me a answer that how to prove your codec was or not was in slice mode?)

    Go back to the primary question.

    Would you give me a comparison between with slice mode and without slice mode?

    The reason that I said so many asides before the primary question was because I couldn't

    understand clearly the difference between with slice mode and without slice mode if I had no

    idea how to prove my codec was or not was in slice mode.

    Ok ,So much for that,Did you understand what I wanted to say above?Would you explain the

    difference between with slice mode and without slice mode according to my application example

    I said above.

    thanks,Any problem pleas let me know.

  • Hi Steve, If I am getting your questions correctly you want to know what are the differences advantages/disadvantages of using slices vs. frames and how could you check that you use slices?. If so, please see comments below.

    For checking if slices were used and the number of slices you can use a stream analyzer such as Elecard (snapshot of 4-slices clip attached).

    About the advantages of using slices are low delay scenarios as pointed by Sudheesh. Also, slices helps to parallelize the encoder/decoder and to distribute processing load across cores. One disadvantage is that in order to generate independently encode/decode slices, sup-pictures don’t use neighbors MBs information, then the tradeoff would be some video quality reduction in the slices borders and/or some compression efficiency penalty. Depending on the scenario (bitrate, content, #slices, etc) these trade-offs could be minimal an imperceptible to users or more notorious.

    Please let us know if this answer your question and/or if you have any further question.

    Paula

  • Hi,Paula:

    You have answered my question partly but not totally.

    The way you said how to check that you use slice mode is the right one I want.

    In fact I don't mean that you tell me the advantages and disadvantages.I just want you tell

    me advantages not disadvantages .Because in the current time I care advantages more

    than disadvantages with regarding to the using of slice mode.

    So I just want you tell me the advantages more and more specifically.The best thing is

    that you would give me some examples to tell the advantages of using slice mode.

    In other word, what I really want to know just have two points:

    point 1:

    Tell me the advantages of using slice mode.Actually you have said in the last post.

    I have know that.So it is no need to say again.

    point 2:

    Tell me the disadvantages of not using slice mode.

    Please note that I just want you tell me the disadvantages of not using slice mode not

    the disadvantages of using slice mode.

    I mean that if you want to say someone or something is very good.you must say it is so bad

    without someone or something.Not only from the head side but also from the tail side.

    So would you tell me the disadvantages of not using slice mode ?Supposed that I use

    the frame mode not slice mode.what i would lose?This is really what I most want to know!

    point 3:

    As a supplement to poin2,I want to ask you a question .

    Do you agree me that Keystone multicore device C6678 only support  slice mode h264 encoder and

    don't support  not using slice mode such as frame mode when more that two cores is used to encode

    one entire YUV frame.

    Let me explain a little.I want to say that if you meet the situation like below you must use slice mode and

    you cannot use frame mode. You cannot have any choice.The situation is like this:

    Supposed I want to encode 720p H264 ,I must use two cores as the performance of codec.So if I use two

    cores to encode one channel 720p.The entire YUV frame is divided into 2 slices at least.That mean that anyhow

    you must use slice mode ,because you must divide the entire YUV frame into at least 2 slices.

    I guess that is what so called slice mode.

    So this is the reason that I say in the above case or situation you must use slice mode and you cannot use

    so called frame mode.Do you agree with me?

  • Hi Steve,

    Your questions  are answered in another thread. Please see this link.

    Regards

    Sudheesh