The rate control in x265 is the same as x264's implementation, which is mostly empirical. It includes one two-pass and three one-pass modes(ABR, CRF and CQP). We describe ABR and CRF modes below.

Average Bitrate(ABR)

This is a one-pass scheme which produces near-constant quality within a specified file size. The ABR mode is implemented as follows:

  1. Run a fast motion estimation algorithm over a half-resolution version of current frame and then get SATD[i].
  2. Calculate blurred complexity of current frame  according to SATD[i].
    blurredComplexity [i] =  cplxsum [i] / ( cplxcount [i] )
    cplxsum [i]   = cplxsum [i - 1]  ∗ 0.5 + SATD [i]
    cplxcount [i] = cplxcount [i - 1]  ∗ 0.5 + 1
  3. Calculate qscale of current frame according to blurredComplexity [i] .
     qscale [i] =  blurredComplexity [i] ^ (1 - qcomp)
  4. Clip qscale [i] twice in order to get it more accurate.
    qscale [i] =  qscale[i] / rateFactor[i]
    qscale [i] = qscale[i] ∗ overflow
    rateFactor [i] = wanted_bits_windows[i] / cplxsum[i]
    overflow = clip3f(1 + (totalBits - wanted_bits) / abr_buffer, 0.5, 2)
  5. Call clipQscale function to guarantee that the buffer is in a reasonable state by the end of the lookahead.
  6. Calculate QP according to qscale.
    QP = 12 + 6 * log2 (qscale[i] / 0.85)

Constant Rate Factor(CRF)

The CRF mode is a one-pass mode that is optimal if the user specifies quality instead of bitrate. It is the same as ABR, except that the scaling factor is a constant and no overflow compensation is done. The steps are given below:

  1. Run a fast motion estimation algorithm over a half-resolution version of current frame and then get SATD[i].
  2. Calculate blurred complexity of current frame  according to SATD[i].
    blurredComplexity [i] =  cplxsum [i] / ( cplxcount [i] )
    cplxsum [i]   = cplxsum [i - 1]  ∗ 0.5 + SATD [i]
    cplxcount [i] = cplxcount [i - 1]  ∗ 0.5 + 1
  3. Calculate qscale of current frame according to blurredComplexity [i].
     qscale [i] =  blurredComplexity [i] ^ (1 - qcomp)
  4. Scale qscale [i] with a constant.
    qscale [i] =  qscale[i] / rateFactor
  5. Call clipQscale function to guarantee that the buffer is in a reasonable state by the end of the lookahead.
  6. Calculate QP according to qscale.
    QP = 12 + 6 * log2 (qscale[i] / 0.85)

Introduction to x265 Rate Control Algorithm的更多相关文章

  1. ieee80211 phy1: Failed to select rate control algorithm

    /************************************************************************ * ieee80211 phy1: Failed t ...

  2. A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning

    A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning by Jason Brownlee on S ...

  3. VBV Rate Control

    Part 1 <06/05/07 12:08pm> Manao | he is negating a float by printing it, adding a "-" ...

  4. Deep Learning-Based Video Coding: A Review and A Case Study

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! 1.Abstract: 本文主要介绍的是2015年以来关于深度图像/视频编码的代表性工作,主要可以分为两类:深度编码方案以及基于传统编码方 ...

  5. 嵌入式系统添加无线wifi模块

    开发环境:fl2440开发板,linux3.0内核,交叉编译器路径/opt/buildroot-2011.11/arm920t/usr/bin/arm-linux-,无线网卡RT3070 平时开发板联 ...

  6. FreeBSD_11-系统管理——{Part_4 - 内核参数定制}

    特别提醒:自行定制的内核,必須经过全方位测试无誤后,方能用于生产环境 基于:/usr/src/sys/amd64/conf/GENERIC cpu HAMMER ident TEST_kernel # ...

  7. S3C2440实现wifi、3G上网和迷你无线路由的制作(一)

    S3C2440实现wifi.3G上网和迷你无线路由的制作 fulinux 凌云实验室 本文将通过ARM.linux平台,借助RT2070/RT3070芯片的无线模块(或使用RT2070/RT3070芯 ...

  8. ubuntu12.04下编译Linux tina 2.1/android经验

    用的是osboxes下的vdi. 编译Linux 1. 不能在root用户下操作 2. 执行 make kernel_menuconfig 报错,需要 apt-get install zlib1g z ...

  9. 使用RT3070使开发板上网

    原文地址:http://www.cnblogs.com/NickQ/p/8973880.html 使开发板上网 USB驱动部分 在arch/arm/mach-s3c2440/mach-smdk2440 ...

随机推荐

  1. GoPath模式和GoMoudle模式的相爱相杀

    相信看我文章的文章的童鞋,golang版本已经是1.3版本以上.如果你的版本还停留在1.3以下,那这篇文章可以做为你的提升之法. go moudle的前世今生 前世-gopath gopath是什么 ...

  2. C++单重继承分析

    code[class*="language-"], pre[class*="language-"] { color: rgba(51, 51, 51, 1); ...

  3. 历史性突破:使用 .net core 日处理消息量超过 1.7 万条!

    业余时间用 .net core 写了一个在线客服系统.并在博客园写了一个系列的文章,写介绍这个开发过程: .net core 和 WPF 开发升讯威在线客服系统:目录 https://blog.she ...

  4. Java学习之随机数的用法

    •前言 随机数的产生在一些代码中很常用,也是我们必须要掌握的. 而 Java 中产生随机数的方法主要有三种: new Random() Math.random() currentTimeMillis( ...

  5. Java中的三大特性 - 超详细篇

    前言 大家好啊,我是汤圆,今天给大家带来的是<Java中的三大特性 - 超详细篇>,希望对大家有帮助,谢谢 这一节的内容可能有点多,大家可以选择性的来看 简介 Java的三大特性:封装.继 ...

  6. Linux 软链接link/ln -s

    在Linux中,链接分为软的和硬的,至于两者之间有什么差别,大家可以参考下https://www.ibm.com/developerworks/cn/linux/l-cn-hardandsymb-li ...

  7. Dynamics CRM字段安全配置文件

    在实施Dynamics CRM的过程中,有些需求会提到部分字段针对特殊的人员或者团队进行显示.更新以及创建的需求的控制.这里我们就需要用到字段安全性文件这个功能.此功能针对具体实体的字段进行配置可以达 ...

  8. MindSpore函数拟合

    技术背景 在前面一篇博客中我们介绍过基于docker的mindspore编程环境配置,这里我们基于这个环境,使用mindspore来拟合一个线性的函数,演示一下mindspore的基本用法. 环境准备 ...

  9. 跨域库herryPostMessage.js的一些优化,多iframe跨域

    旧库见文章:https://www.cnblogs.com/wuhairui/p/14595893.html 新版库主要做了下多个iframe和父页面交互的优化.主要使用构造函数的方式将多个ifram ...

  10. Unity 渲染流水线 :CPU与GPU合作创造的艺术wfd

    前言 对于Unity渲染流程的理解可以帮助我们更好对Unity场景进行性能消耗的分析,进而更好的提升场景渲染的效率,最后提升游戏整体的性能表现 Unity的游戏画面的最终的呈现是由CPU与GPU相互配 ...