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. 开源一个比雪花算法更好用的ID生成算法(雪花漂移)

    比雪花算法更好用的ID生成算法(单机或分布式唯一ID) 转载及版权声明 本人从未在博客园之外的网站,发表过本算法长文,其它网站所现文章,均属他人拷贝之作. 所有拷贝之作,均须保留项目开源链接,否则禁止 ...

  2. 使用 Github Actions artifact 在 workflow job 之间共享数据

    (AgileConfig)[https://github.com/kklldog/AgileConfig] 在使用 react 编写UI后,变成了一个彻彻底底的前后端分离的项目,上一次解决了把reac ...

  3. 【图像处理】OpenCV+Python图像处理入门教程(六)图像平滑处理

    相信很多小伙伴都听过"滤波器"这个词,在通信领域,滤波器能够去除噪声信号等频率成分,然而在我们OpenCV中,"滤波"并不是对频率进行筛选去除,而是实现了图像的 ...

  4. [Fundamental of Power Electronics]-PART I-2.稳态变换器原理分析-2.3 Boost 变换器实例

    2.3 Boost 变换器实例 图2.13(a)所示的Boost变换器器是另一个众所周知的开关模式变换器,其能够产生幅值大于直流输入电压的直流输出电压.图2.13(b)给出了使用MOSFET和二极管的 ...

  5. redis常用数据类型对应的数据结构

    redis的数据类型都是通过多种数据结构来实现,主要是出于时间和空间的考虑,当数据量小的时候通过数组下标访问最快,占用内存最小[压缩列表是数组的变种,允许存储的数据大小不同] 因为数组需要占用连续的内 ...

  6. BUAAOO第三单元总结

    JML理论基础 JML规定了一些语法,用这些语法可以描述一个方法,一个类的行为,理论基础是离散数学吧 JML常用语法 前置条件: 使用 require + 表达式 ,表达式一般为布尔表达式 副作用: ...

  7. Spring Boot 2.4 新特性,全新的Cron表达式处理机制

    说起 cron 表达式大家一定不陌生,我们常用来作为定时任务执行策略规则. 在 Spring Boot 框架中 cron 表达式主要配合 @Scheduled 注解在应用程序中使用. 在 Spring ...

  8. 【笔记】《Redis设计与实现》chapter10 RDB持久化

    chapter10 RDB持久化 10.1 RDB文件的创建和载入 有两个Redis命令可以用于生成RDB文件,SAVE和BGSAVE SAVE阻塞服务器进程进行RDB文件的创建,BGSAVE则创建服 ...

  9. Python:读写文件(I/O) | 组织文件

    1. I/O 概述  程序与用户交互涉及到程序的输入输出(I/O) 一种类型是字符串,通过input() 和 print() 函数以及数据类型转换类函数如(int()),实现数据的输入输出. 另一种类 ...

  10. 一致性哈希做负载均衡,基于dubbo的简化版本,超级简单容易理解!!!

    一致性哈希算法原理以及做分布式存储.一定先看:一致性哈希算法 dubbo提供了四种负载均衡实现:权重随机算法,最少活跃调用数算法,一致性哈希算法,加权轮询算法. 本文基于开源项目:guide-rpc- ...