以下都是RC_BITRATE_MODE模式的处理流程。

一、帧级码控计算整体框架图

openh264码控笔记二(帧级QP的计算)

二、帧级QP的计算公式

QStep = (IntraComplexity * CmplxRatio)/(TargetBits * 100)

IntraComplexity参数根据上一帧单帧长度和历史帧平均QP确定。

计算公式为:IntraComplexity(i)=0.8*IntraComplexity(i-1)+0.2*QStep*FrameDqBits

CmplxRatio参数根据历史帧的SAD(绝对残差和)确定。

计算公式为:CmplxRatio(i)=0.8*SAD(i-1)+0.2*SAD(i)

TargetBits当前帧可分配的码率。

1)IntraComplexity参数计算

RcUpdateIntraComplexity (sWelsEncCtx* pEncCtx)

RcUpdateFrameComplexity (sWelsEncCtx* pEncCtx)

openh264码控笔记二(帧级QP的计算)

2)CmplxRatio参数计算

RcCalculateIdrQp (sWelsEncCtx* pEncCtx) 

RcCalculatePictureQp (sWelsEncCtx* pEncCtx)

openh264码控笔记二(帧级QP的计算)

3)TargetBits参数计算

RcDecideTargetBits (sWelsEncCtx* pEncCtx)函数

openh264码控笔记二(帧级QP的计算)

 

另外WelsRcPictureInitGom实际计算帧级QP的值。WelsRcPictureInfoUpdateGom更新码控的参数,用于后续再次调用WelsRcPictureInitGom时,计算帧级QP的值。

4)WelsRcPictureInitGom

openh264码控笔记二(帧级QP的计算)

5)WelsRcPictureInfoUpdateGom

openh264码控笔记二(帧级QP的计算)

相关文章:

  • 2022-12-23
  • 2021-11-12
  • 2022-02-14
  • 2021-05-12
  • 2021-12-19
  • 2021-10-23
  • 2021-08-02
猜你喜欢
  • 2021-06-16
  • 2022-12-23
  • 2022-01-05
  • 2021-04-05
  • 2022-12-23
  • 2021-06-27
  • 2021-04-15
相关资源
相似解决方案