现在的位置: 首页 > 综合 > 正文

x264基于经验和感觉的码率控制策略

2013年03月01日 ⁄ 综合 ⁄ 共 1649字 ⁄ 字号 评论关闭

 前提:
      1 high-complexity or high-motion scenes,细节将不会很明显,此时高qp也是浪费
      2 where motion compensation works
      well,在景物边沿的失真,只需在一帧中去掉,以后就都不会有.在这里投入有限的bits可以获得最好的图像质量性价比
      3 已经编码一frame,可以预测其他qp下所需bit数.预测距离越远越不精确
      4随着frame重要性降低,他们只配用更大的qp,i ,p ,参考b ,disposable b.依次降低
      5H.264支持1frame内不同mb使用不同qp,x264不支持,而由rc返回统一qp。但有那个功能函数存在那个函数仅精确到每一行mb变一次qp
      所以rc策略如下:
      2pass:
      step1 1pass编码,由qp推断某qp下framesize *0.6符合目标frame size的限制,得到这个qp
      step2 修改qp 以满足requested total size(total是指整个Gop的大小,分段先编一边再一边)
      step3 encode根据实际大小值修正预测的qp,并额外增加short-term
      compensation,针对开始和结束部分没有很多bits余地的位置.
      1pass:  abr (average bit rate )
      step1 用半尺寸快速运动估计和SATD residuals 替换1st pass中相关部分,获得预测
      step2 用之前的样本估计scale
      step3 Overflow compensation 和2pass相似 限制filesize 牺牲图像质量
      1pass,:constant bitrate (VBV compliant)!!!
      VBV是指:   Video Buffer Verifier
      The Video Buffer Verifier (VBV) is a model hypothetical decoder buffer
      that will not overflow or underflow when fed a conforming MPEG bit stream.
        包含2个因素.size和造成的delay
      step1  same as abr
      step2 Scaling factor is based on a local average (dependent on VBV buffer
      size) instead of all past frames
      step3 stricter Overflow compensation  ,  additional term to hard limit the
      QPs if the VBV is near empty. no hard limit is done for a full
      VBV这里更加严格的空限制,防止没有bits可以送出,破坏了cbr的传输
      1pass, constant ratefactor:      Constant Rate Factor (or Constant
Quality)
      (1) Same as ABR.
      (2) The scaling factor is a constant based on the --crf argument.
      (3) No overflow compensation is done.

      ratefactor是指:
      constant quantizer:
      QPs are simply based on frame type.

      RC中的蛋鸡悖论:为了计算当前帧中宏块的
      RDO,需利用已定qp确定当前帧或宏块的cost预测每个宏块的mode mv ref等.
      ratecontrol是在确定mode mv ref后决定qp,在此之前qp不能获得。
      于是rdo与rc不知道先做哪个了.

抱歉!评论已关闭.