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.

CBR/VBR

Guru 20755 points

Hello,

 

I would appreciate your help in understanding VBR/CBR configurability in MPEG-4 and H.264 encoder for DM8168 platform:

  • CBR:
  1. Is it using stuffing bits ? is the stuffing bits used only with H.264 ?
  2. what values are for the stuffing bits: ones or zeros ?
  3. Is the HRD buffer size correspond to the time used for calculation of the constant bit rate ? Is the HRD used in both codecs?
  • VBR:
  1. There is something called HF-VBR in datasheet , while the xDM codec header file expose only 2 RC algorithms: PRC, PRC_LOW_DELAY.
    1. Is PRC same as VBR and low_delay same as CBR ?
    2. How to configure codec for HF-VBR instead of VBR  ?

 

H.264 Datasheet:

IVIDEO_LOW_DELAY

Constant Bit Rate (CBR)   control for video conferencing.

IVIDEO_STORAGE

IVIDEO_RATE_CONTROL_PRESET_DEFAULT  

Variable Bit Rate (VBR)   control for local storage (DVD) recording,

Default rate control preset   value.

IVIDEO_TWOPASS

Two pass rate control for   non-real time applications.

IVIDEO_NONE

No configurable video rate   control mechanism.

IVIDEO_USER_DEFINED

User defined configuration   using extended parameters.

H.264  xDM header file:

typedef enum

{

  IH264_RATECONTROL_PRC               = 0 ,        /**< Perceptual Rate Control,

                                                   * controls the QP @ MB level

                                                   */

  IH264_RATECONTROL_PRC_LOW_DELAY     = 1,         /** Low Delay Rate Control */

  IH264_RATECONTROL_DEFAULT = IH264_RATECONTROL_PRC/** Default rcAlgo is PRC  */

 

} IH264ENC_RateControlAlgo;

2. Is there a parameter for controlling of maximum and minimum values for VBR (there is something maybe for HF-VBR but I dont see how to configure codec for using HF-VBR as written in previous question) ?

3. Is There a parameter for controlling the time used for VBR bit rate calculation ? I did not find one.

Best Regards,

Ran

  • Ran

    I belive Yair replied you on this.

    regards

    Yashwant

  • Hi Yashwant,

    Can you please help filling the gaps ? The user's guide does not contain information for making this issue clear.

    Thank you very much,

    Ran

    codec\Rate control feature CBR support ? VBR support ? CVBR ? CBR Mechanism VBR mechanism min/max bitrate parameter ?
    H.264 Encoder YES, IVIDEO_LOW_DELAY ? YES, IVIDEO_STORAGE what is the enum for this? skip frame ? stuffing bits ? VBV\HRD? stuffing bits ? min/max only for cvbr ?
    MPEG-4 Encoder YES, IVIDEO_LOW_DELAY ? YES, IVIDEO_STORAGE what is the enum for this? skip frame ? stuffing bits ? VBV\HRD? stuffing bits ? none ??

  • Ran,

    I filled the table with information, pls have a look.

    codec\Rate control feature

    CBR support

    VBR support

    CVBR ?

    CBR Mechanism

    VBR mechanism

    min/max bitrate parameter ?

    H.264 Encoder

    YES, IVIDEO_LOW_DELAY

    YES, IVIDEO_STORAGE

    maxBitrate > 0 will enable this. Reccomended value 1.5 times of avg bitrate

    skip frame  and stuffing bits supported. Stuffing bits is enabled when minBitrate is set.

    Skip frame is not there by default (but you can enable it explicitly), also internal dynamics is different than CBR

    min/max only for cvbr  - YES

    MPEG-4 Encoder

    YES, IVIDEO_LOW_DELAY

    YES, IVIDEO_STORAGE

    Not supported

    skip frame . No stuffing bits supported.

    VBR does not allow skip frame.

    none

  • Hi Yashwant,

    Thank you very much!

    1. Note that H.264 user's guide say that maxBitRate is not supported, Is this note irrelevant ?

    2. Is it right to say that minimum bit rate always supported in all rate-control modes (for CBR that when minbirate is set, than stuffing bits are used)

    Regards,

    Ran

    maxBitRate

    XDAS_Int32

    Input

    Maximum bit rate for encoding in bits per second.Not supported in current version.

     

  • 1. I dont know which part this is writen, When I see the UG, it says -  I am looking at GA 2.0 encoder user guide, page 4-40.

     

    maxBitRate

    XDAS_Int32

    Input

    This parameter along with the

    IVIDENC2_DynamicParams ::

    targetBitRate

    is used to Enable/Disable High Fidelity Variable Bitrate (HFVBR/CVBR) Rate Control.

    2. minBitrate enables stuffing bits for all RC mode, which includes CBR,  VBR. This means that if the bitrate by any reason starts falling below the minBitrate, it will start inserting stuffing bytes.

    regards

    Yashwant

     

     

  • Hi Yashwant,

    If I can please ask one more thing on this issue...

    1. Using regular VBR you said there is no maxmum bit rate, only with CVBR. My question is if the VBV (or HRD) buffer size does not imply bit rate limitation (for all rate control)  ?

    2. What happens when CVBR reach maxbitrate: skip frames, or more quantization ?

    3. from above which bit rate , does CBR starts skipping frames. I found no menion of it in user's guide.

     

    Thank you very much!

    Ran

  • Ran,

    Answers inline

    1. The VBV size and maxPicsize will control the max instatnteneos bitrate. But this is not tha maxBitrate which we set for CVBR. Even in CVBR, the instanteneos bitrate may be higher than the maxbitrate. A good way to understand CVBR is to see below wiki which is for DM36x but equally applies for IVAHD.. http://processors.wiki.ti.com/index.php/H.264_DM36x_Ver_2.0_Codec#CVBR_Rate_control

    2. CVBR does not skip frame, it will keep the quantization level to a limit so that it does not go beyond the maxbitrate. 

    3. Its not that there is a bitrate limit from which CBR will start skipping frames. I suggest you see section 3.5 of this app note. Though this is based on DM365, the basic principle remains same for DM81x.  http://www.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraba9. Note that the API parameters names are diff than what used in DM81x, so pls dont relate that.

    regards

    Yashwant

    regards

    Yashwant

  • Hi Yashwant,

    Can you kindly check the following:

    1. "CVBR does not skip frame, it will keep the quantization level to a limit so that it does not go beyond the maxbitrate.". Does it mean it changes Quantization internally, so that it does not go beyond maximum bitrate ?

    2.according to table above,  MPEG-4 VBR does not have maximum bit rate control. Does it mean that it can get above target bit rate to any possible value ?  If this is the case it seems very problemtaic to use VBR. Isn't there a default value for VBR maximum bit rate, for example 10% above ? I didn't find any comments in UG about that. How therefore can we use VBR if it can get above target bit rate to any value whatsoever ?

    3. if qpmin is used for controlling the maximum bitrate in VBR, what is the forumal that can be used for that ?

    Regards,

    Ran