CN110572661B - 一种面向4k/8k超高清视频编码的低延时码率控制方法 - Google Patents

一种面向4k/8k超高清视频编码的低延时码率控制方法 Download PDF

Info

Publication number
CN110572661B
CN110572661B CN201910936941.9A CN201910936941A CN110572661B CN 110572661 B CN110572661 B CN 110572661B CN 201910936941 A CN201910936941 A CN 201910936941A CN 110572661 B CN110572661 B CN 110572661B
Authority
CN
China
Prior art keywords
frame
buffer
calculating
coding
frames
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910936941.9A
Other languages
English (en)
Other versions
CN110572661A (zh
Inventor
廖义
谢亚光
李日
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Arcvideo Technology Co ltd
Original Assignee
Hangzhou Arcvideo Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Arcvideo Technology Co ltd filed Critical Hangzhou Arcvideo Technology Co ltd
Priority to CN201910936941.9A priority Critical patent/CN110572661B/zh
Publication of CN110572661A publication Critical patent/CN110572661A/zh
Application granted granted Critical
Publication of CN110572661B publication Critical patent/CN110572661B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/177Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a group of pictures [GOP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/184Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明公开了一种面向4K/8K超高清视频编码的低延时码率控制方法。它具体包括如下步骤:(1)将GOP的长度设为整数M,令常规缓冲区预测所用帧数为K;(2)计算GOP中第i帧编码时缓冲区预测所用帧数N(i);(3)利用Rq模型计算出第i、…、i+N(i)帧的预估比特数;(4)计算第i帧的目标缓冲区饱和度F(i),判断F(i)是否小于0.5,若是则令q(i)=q(i)*w,或者判断F(i)是否大于0.8,若是则令q(i)=q(i)/w,并重新执行步骤(3);否则选择当前q(i)作为当前帧的最优量化步长,并执行步骤(5);(5)获取最优量化步长对帧进行编码。本发明的有益效果是:将缓冲区预测所需帧数进行自适应调整,避免了GOP并行编码时缓冲区预测因为等待其他GOP的帧导致编码延时加大的问题。

Description

一种面向4K/8K超高清视频编码的低延时码率控制方法
技术领域
本发明涉及视频编码相关技术领域,尤其是指一种面向4K/8K超高清视频编码的低延时码率控制方法。
背景技术
随着网络通信和视频处理技术的快速发展,4K、8K和HDR(High Dynamic Range,高动态范围)等技术逐步成为人们对视觉体验的新需求。4K/8K视频的数据量大,对编码压缩性能要求比较高,目前国内外针对4K/8K视频采用的编码压缩标准主要有HEVC和AVS2,它们的压缩效率较高但是计算复杂度也偏大,而4K/8K的实时直播通常要求编码器的速度达到50帧/秒以上。因此,如何在一定的网络带宽和速度要求下提升视频输出稳定性是视频编码技术发展的一个关键。
码率控制属于视频编码的一个重要环节,它通过获取视频信源特性(如运动剧烈程度、图像纹理复杂度等)和可用网络带宽来计算视频中每一帧图像和该图像中的各个区域应该分配的比特数,指导编码器对视频进行编码,使输出的码流符合信道的传输,同时使输出的视频质量尽可能好。由于视频信源每帧的复杂度(比特数)不相同,而网络带宽则是恒定的,因此码率控制中需要设置缓冲区,使编码出的码流以恒定的码率(单位时间内的比特数)发送到网络中。
一方面,4K/8K视频的实时直播对性能的要求非常高,通常需要采用GOP并行编码,让不同的GOP(Group of Picture,图像组)分布到不同的节点进行编码,例如,对于2个节点的编码器且当GOP长度为50时,则将第1个GOP(第1~50帧)放置于第1个节点,第2个GOP(第51~100帧)放置于第2个节点,将第3个GOP(第101~150帧)再放置于第1个节点,将第4个GOP(第151~200帧)再放置于第2个节点,以此类推。另一方面,实时直播中端到端的延时也非常关键,现有方法将缓冲区预测所需帧数设置为固定值,如果第1个GOP的帧因为需要满足缓冲区预测所需帧数而等待第3个GOP的帧输入,则第1个GOP的帧输出延时会大大增加。
发明内容
本发明是为了克服现有技术中存在上述的不足,提供了一种降低编码延时的面向4K/8K超高清视频编码的低延时码率控制方法。
为了实现上述目的,本发明采用以下技术方案:
一种面向4K/8K超高清视频编码的低延时码率控制方法,具体包括如下步骤:
(1)将GOP的长度设为整数M,令常规缓冲区预测所用帧数为K,K=e*M,其中e的取值范围为(0,1);
(2)计算GOP中第i帧编码时缓冲区预测所用帧数N(i);
(3)利用Rq模型计算出第i、i+1、i+2、…、i+N(i)帧的预估比特数,分别标记为R(i)、R(i+1)、R(i+2)、…、R(i+N(i));
(4)计算第i帧的目标缓冲区饱和度F(i),判断F(i)是否小于0.5,若是则令q(i)=q(i)*w,并重新执行步骤(3);否则判断F(i)是否大于0.8,若是则令q(i)=q(i)/w,并重新执行步骤(3);否则选择当前q(i)作为当前帧的最优量化步长,并执行步骤(5),其中w的取值范围为(1,1.5);
(5)获取最优量化步长对帧进行编码。
当4K/8K超高清视频编码采用GOP并行编码时,因为需要满足缓冲区预测所需帧数而等待后续2个GOP的帧输入,增大了编码延时,本发明方法将缓冲区预测所需帧数进行自适应调整,避免了GOP并行编码时缓冲区预测因为等待其他GOP的帧导致编码延时加大的问题。
作为优选,在步骤(2)中,所述N(i)的大小会影响编码延时和缓冲区预测的精确度,为了避免因为等待后续2个GOP的帧输入而增加的延时,同时为了使当前缓冲区能够分析未来更多的帧以提升缓冲区预测精确度,编码时缓冲区预测所用帧数N(i)的计算公式如下:
Figure BDA0002221828460000031
作为优选,在步骤(3)中,利用Rq模型计算第k帧的预估比特数的公式如下:
Figure BDA0002221828460000032
其中a、b和c分别为模型参数,D(k)为第k帧的SATD,q(i)为第i帧的量化步长。
作为优选,在步骤(4)中,第i帧的目标缓冲区饱和度F(i)的计算公式如下:
Figure BDA0002221828460000033
其中F(i-1)为编码完第i-1帧的实际缓冲区饱和度,C为视频目标码率,Fr为编码帧率,R(t)为第t帧的预估比特数。
本发明的有益效果是:将缓冲区预测所需帧数进行自适应调整,避免了GOP并行编码时缓冲区预测因为等待其他GOP的帧导致编码延时加大的问题。
具体实施方式
下面结合具体实施方式对本发明做进一步的描述。
一种面向4K/8K超高清视频编码的低延时码率控制方法,具体包括如下步骤:
(1)将GOP的长度设为整数M,令常规缓冲区预测所用帧数为K,K=e*M,其中e的取值范围为(0,1);
(2)计算GOP中第i帧编码时缓冲区预测所用帧数N(i);N(i)的大小会影响编码延时和缓冲区预测的精确度,为了避免因为等待后续2个GOP的帧输入而增加的延时,同时为了使当前缓冲区能够分析未来更多的帧以提升缓冲区预测精确度,编码时缓冲区预测所用帧数N(i)的计算公式如下:
Figure BDA0002221828460000041
(3)利用Rq模型计算出第i、i+1、i+2、…、i+N(i)帧的预估比特数,分别标记为R(i)、R(i+1)、R(i+2)、…、R(i+N(i));利用Rq模型计算第k帧的预估比特数的公式如下:
Figure BDA0002221828460000042
其中a、b和c分别为模型参数,D(k)为第k帧的SATD(Sum of AbsoluteTransformed Difference,残差变换绝对值和),q(i)为第i帧的量化步长;
(4)计算第i帧的目标缓冲区饱和度F(i),判断F(i)是否小于0.5,若是则令q(i)=q(i)*w,并重新执行步骤(3);否则判断F(i)是否大于0.8,若是则令q(i)=q(i)/w,并重新执行步骤(3);否则选择当前q(i)作为当前帧的最优量化步长,并执行步骤(5),其中w的取值范围为(1,1.5),其中w的最优取值为1.01;第i帧的目标缓冲区饱和度F(i)的计算公式如下:
Figure BDA0002221828460000051
其中F(i-1)为编码完第i-1帧的实际缓冲区饱和度,C为视频目标码率,Fr为编码帧率,R(t)为第t帧的预估比特数;
由上述公式可知:如果缓冲区饱和度越小则说明各帧的码率太大,需要加大q(i)值来降低码率,如果缓冲区饱和度越大则说明各帧的码率太小,需要减小q(i)值来加大码率,最终获取一个最优的q(i)值使缓冲区饱和度控制在正常范围内;
(5)获取最优量化步长对帧进行编码。
当4K/8K超高清视频编码采用GOP并行编码时,因为需要满足缓冲区预测所需帧数而等待后续2个GOP的帧输入,增大了编码延时,本发明方法将缓冲区预测所需帧数进行自适应调整,避免了GOP并行编码时缓冲区预测因为等待其他GOP的帧导致编码延时加大的问题。本发明以HEVC/AVS2编码器为例进行实施,但并不局限于HEVC/AVS2,还可应用于H264、AVS、AVS3等编码器。

Claims (2)

1.一种面向4K/8K超高清视频编码的低延时码率控制方法,其特征是,具体包括如下步骤:
(1)将GOP的长度设为整数M,令常规缓冲区预测所用帧数为K,K=e*M,其中e的取值范围为(0,1);
(2)计算GOP中第i帧编码时缓冲区预测所用帧数N(i);所述N(i)的大小会影响编码延时和缓冲区预测的精确度,为了避免因为等待后续2个GOP的帧输入而增加的延时,同时为了使当前缓冲区能够分析未来更多的帧以提升缓冲区预测精确度,编码时缓冲区预测所用帧数N(i)的计算公式如下:
Figure FDA0003196033950000011
(3)利用Rq模型计算出第i、i+1、i+2、…、i+N(i)帧的预估比特数,分别标记为R(i)、R(i+1)、R(i+2)、…、R(i+N(i));利用Rq模型计算第k帧的预估比特数的公式如下:
Figure FDA0003196033950000012
其中a、b和c分别为模型参数,D(k)为第k帧的SATD,q(i)为第i帧的量化步长;
(4)计算第i帧的目标缓冲区饱和度F(i),判断F(i)是否小于0.5,若是则令q(i)=q(i)*w,并重新执行步骤(3);否则判断F(i)是否大于0.8,若是则令q(i)=q(i)/w,并重新执行步骤(3);否则选择当前q(i)作为当前帧的最优量化步长,并执行步骤(5),其中w的取值范围为(1,1.5);
(5)获取最优量化步长对帧进行编码。
2.根据权利要求1所述的一种面向4K/8K超高清视频编码的低延时码率控制方法,其特征是,在步骤(4)中,第i帧的目标缓冲区饱和度F(i)的计算公式如下:
Figure FDA0003196033950000021
其中F(i-1)为编码完第i-1帧的实际缓冲区饱和度,C为视频目标码率,Fr为编码帧率,R(t)为第t帧的预估比特数。
CN201910936941.9A 2019-09-29 2019-09-29 一种面向4k/8k超高清视频编码的低延时码率控制方法 Active CN110572661B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910936941.9A CN110572661B (zh) 2019-09-29 2019-09-29 一种面向4k/8k超高清视频编码的低延时码率控制方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910936941.9A CN110572661B (zh) 2019-09-29 2019-09-29 一种面向4k/8k超高清视频编码的低延时码率控制方法

Publications (2)

Publication Number Publication Date
CN110572661A CN110572661A (zh) 2019-12-13
CN110572661B true CN110572661B (zh) 2021-10-26

Family

ID=68783359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910936941.9A Active CN110572661B (zh) 2019-09-29 2019-09-29 一种面向4k/8k超高清视频编码的低延时码率控制方法

Country Status (1)

Country Link
CN (1) CN110572661B (zh)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999049664A1 (en) * 1998-03-20 1999-09-30 Sgs-Thomson Microelectronics Asia Pacific (Pte) Ltd. Moving pictures encoding with constant overall bit rate
CN100574427C (zh) * 2005-08-26 2009-12-23 华中科技大学 视频编码比特率的控制方法

Also Published As

Publication number Publication date
CN110572661A (zh) 2019-12-13

Similar Documents

Publication Publication Date Title
JP4390112B2 (ja) ビデオシーケンスのレートを制御する方法及び装置並びにビデオ符号化装置
CN101835042B (zh) 基于无反馈速率控制的Wyner-Ziv视频编码***及方法
US20100195715A1 (en) Method and apparatus for adaptive frame prediction
CN103533359B (zh) 一种h.264码率控制方法
CN107197279A (zh) 快速宏块增量量化参数的决定
JP2012178864A (ja) 多層ビデオ設計のためのレート制御
CN106993190B (zh) 软硬件协同编码方法及***
CN105681793A (zh) 基于视频内容复杂度自适应的极低延迟高性能视频编码帧内码率控制方法
CN106937112A (zh) 基于h.264视频压缩标准的码率控制方法
CN110351552B (zh) 视频编码中一种快速编码方法
CN108989818B (zh) 一种图像编码参数调整方法及装置
CN105187832B (zh) 基于2.5g无线网络移动视频码率控制方法
CN112218084B (zh) 面向监控视频的高效视频编码标准帧级码率控制方法
CN102724507B (zh) 一种gpu加速编码器码率控制方法
CN110572661B (zh) 一种面向4k/8k超高清视频编码的低延时码率控制方法
CN101605250A (zh) 码率控制中确定初始量化步长的方法
CN110971900A (zh) 一种适用于4k、8k超高清运动平缓视频的码率控制方法
CN110677664B (zh) 一种面向4k/8k超高清视频编码的低抖动码率控制方法
CN110662045B (zh) 一种面向8k的avs2超高清视频编码码率控制方法
US20070071092A1 (en) System and method for open loop spatial prediction in a video encoder
Sofke et al. Dynamic quality control for transform domain Wyner-Ziv video coding
Guo et al. Quality-progressive coding for high bit-rate background frames on surveillance videos
CN112995667B (zh) 一种增强型R-Lambda码率控制方法
CN113596483B (zh) 一种编码树单元的参数确定方法及***
CN103533348A (zh) 基于视觉感知的多视点快速模式选择方法

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant