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. validator库参数校验

    目录 validator库参数校验若干实用技巧 基本示例 翻译校验错误提示信息 自定义错误提示信息的字段名 自定义结构体校验方法 自定义字段校验方法 自定义翻译方法 validator库参数校验若干实 ...

  2. SpEL表达式注入

    一.内容简介 Spring Expression Language(简称SpEL)是一种强大的表达式语言,支持在运行时查询和操作对象图.语言语法类似于Unified EL,但提供了额外的功能,特别是方 ...

  3. Envoy 部署类型

    目录 Envoy 网络拓扑及请求流程 1. 术语 2. 网络拓扑 3. 配置 4. 更高层的架构 5. 请求流程 1. Listener TCP 接收 2. 侦听器过滤器链和网络过滤器链匹配 3.TL ...

  4. HDU(1420)Prepared for New Acmer(JAVA语言)【快速幂模板】

    思路:快速幂裸题. //注意用long,否则会超范围 Problem Description 集训进行了将近2个礼拜,这段时间以恢复性训练为主,我一直在密切关注大家的训练情况,目前为止,对大家的表现相 ...

  5. Docker备份Gitlab容器以及还原数据

    概述 今天,我们将学习如何快速地对docker容器进行快捷备份.恢复和迁移.Docker是一个开源平台,用于自动化部署应用,以通过快捷的途径在称之为容器的轻量级软件层下打包.发布和运行这些应用.它使得 ...

  6. [游记]2020/CSP - S总结

    2020 / C S P − S 总 结 2020/CSP - S总结 2020/CSP−S总结 这年的 C S P CSP CSP考的不是很理想,本来稳进的 C S P − J CSP-J CSP− ...

  7. .NET 6 Preview 3 中 ASP.NET Core 的更新和改进

    原文:bit.ly/2Qb56NP 作者:Daniel Roth 译者:精致码农-王亮 .NET 6 预览版 3 现已推出,其中包括许多对新的 ASP.NET Core 改进.以下是本次预览版的新内容 ...

  8. python基础(三):元组

    什么是元组 有时候你需要创建一系列不可修改的元素,元组可以满足这种需求.Python将不能修改的值称为不可变的,而不可变的列表被称为元组. 元组的定义和访问 元组使用圆括号来定义,我们已经知道:元组也 ...

  9. 【CTF】XCTF 我们的秘密是绿色的 writeup

    题目来源:SSCTF-2017 题目链接:https://adworld.xctf.org.cn/task/answer?type=misc&number=1&grade=1& ...

  10. 会议更流畅,表情更生动!视频生成编码 VS 国际最新 VVC 标准

    阿里云视频云的标准与实现团队与香港城市大学联合开发了基于 AI 生成的人脸视频压缩体系,相比于 VVC 标准,两者质量相当时可以取得 40%-65% 的码率节省,旨在用最前沿的技术,普惠视频通话.视频 ...