CN100581262C - Rate Control Method of Video Coding Based on ρ Domain - Google Patents

Rate Control Method of Video Coding Based on ρ Domain Download PDF

Info

Publication number
CN100581262C
CN100581262C CN 200810112629 CN200810112629A CN100581262C CN 100581262 C CN100581262 C CN 100581262C CN 200810112629 CN200810112629 CN 200810112629 CN 200810112629 A CN200810112629 A CN 200810112629A CN 100581262 C CN100581262 C CN 100581262C
Authority
CN
China
Prior art keywords
frame
bit rate
delta
gop
parameter
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.)
Expired - Fee Related
Application number
CN 200810112629
Other languages
Chinese (zh)
Other versions
CN101287123A (en
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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN 200810112629 priority Critical patent/CN100581262C/en
Publication of CN101287123A publication Critical patent/CN101287123A/en
Application granted granted Critical
Publication of CN100581262C publication Critical patent/CN100581262C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明涉及一种基于ρ域的视频编码码率控制方法,属于多媒体通信技术领域;本发明包括:根据给定的目标码率确定图像组(GOP)的比特率,并进一步按I帧(帧内帧)、P帧(单向预测帧)、B帧(双向预测帧)这3种类型,分别确定帧级的比特率分配;检测以前同类型帧的特征参数,预测出线性码率模型的斜率参数θ、模型截据差Δc,运动向量码率和残差系数量化后的熵编码码率的比值s,并计算出满足码率限制的零系数比例ρ;查询ρ-QP映射表获得量化参数QP,并以此QP编码当前视频帧;本发明的码率控制方法,简单实用,性能优越,兼容原有的视频编码标准。

Figure 200810112629

The present invention relates to a kind of video coding code rate control method based on ρ field, belongs to the technical field of multimedia communication; Intra frame), P frame (unidirectional predictive frame), B frame (bidirectional predictive frame), these three types determine the frame-level bit rate allocation respectively; detect the characteristic parameters of previous frames of the same type, and predict the linear code rate model The slope parameter θ, the model intercept difference Δc, the ratio s of the motion vector code rate and the entropy coding code rate after quantization of the residual coefficient, and calculate the zero coefficient ratio ρ that meets the code rate limit; query the ρ-QP mapping table to obtain the quantization parameter QP, and encode the current video frame with this QP; the code rate control method of the present invention is simple and practical, has superior performance, and is compatible with the original video coding standard.

Figure 200810112629

Description

基于ρ域的视频编码码率控制方法 Rate Control Method of Video Coding Based on ρ Domain

技术领域 technical field

本发明属于多媒体通信技术领域,特别涉及一种低复杂度的基于ρ域的视频编码码率控制方法。The invention belongs to the technical field of multimedia communication, and in particular relates to a low-complexity ρ-domain-based video coding rate control method.

背景技术 Background technique

在视频通信中,承载数据流的网络带宽都是时变、有限的,研究人员要考虑的因素不仅仅是纯粹的压缩效率,还要考虑信道带宽和信源速率的匹配关系,即对视频编码进行码率控制,以充分利用信道。对于现有的基于块的混合视频编码方案,如MPEG-4,已有的码率控制方法通常是从帧类型(I帧、P帧和B帧)、图像组(GOP)结构(IPP、IBP、IBBP等)、缓存限制、比特率模型、计算复杂度等角度入手,通过动态调整量化参数(QP)等编码器参数,逼近帧级或宏块级的期望比特数。但是,最新制定的视频编码标准H.264引入了很多新特性。一方面,包括帧内、帧间、跳过(SKIP)在内的21种预测模式,使针对以往的视频编码标准的码率控制算法精度大大下降,甚至失效。另一方面,率失真优化(RDO)使原本与运动向量无关的量化参数也与之产生了耦合,全局码率控制变得更加困难。更重要的是,在H.264中,QP作为RDO过程的输入,之后又要根据RDO的输出反过来估计最优的QP,这种全耦合的迭代优化的计算开销是实时编码中不可忍受的。In video communication, the network bandwidth carrying the data stream is time-varying and limited. The factors that researchers need to consider are not only the pure compression efficiency, but also the matching relationship between the channel bandwidth and the source rate. Rate control is performed to fully utilize the channel. For the existing block-based hybrid video coding schemes, such as MPEG-4, the existing rate control methods are usually based on frame types (I frames, P frames and B frames), group of pictures (GOP) structures (IPP, IBP) , IBBP, etc.), buffer limit, bit rate model, computational complexity and other perspectives, by dynamically adjusting encoder parameters such as quantization parameters (QP), approaching the expected number of bits at the frame level or macroblock level. However, the latest video coding standard H.264 introduces many new features. On the one hand, 21 prediction modes including intra-frame, inter-frame, and skip (SKIP) greatly reduce the accuracy of the rate control algorithm for previous video coding standards, or even fail. On the other hand, rate-distortion optimization (RDO) couples quantization parameters that are not related to motion vectors, making global rate control more difficult. More importantly, in H.264, QP is used as the input of the RDO process, and then the optimal QP must be estimated in reverse according to the output of RDO. The computational overhead of this fully coupled iterative optimization is unbearable in real-time coding .

Z.He等人发表在国际电气电子工程师协会杂志《针对视频技术的电路与系统》(IEEETrans.on Circuits and Systems for Video Technology)上的文章《变换编码中一个统一的率失真分析框架》(A unified rate-distortion analysis framework for transform coding)中指出:在视频编码中,每一个量化参数QP都对应一个固定的量化步长q,而量化步长q和零系数比例ρ之间又存在粗略的一一映射关系。那么,对于变换编码后的残差系数(I帧为帧内预测残差,P和B帧为运动补偿残差),可以由统计变换系数的分布而获得这个零系数比例ρ与自变量q的映射关系,即:Z.He and others published the article "A Unified Rate-Distortion Analysis Framework in Transform Coding" (A unified rate-distortion analysis framework for transform coding) pointed out: In video coding, each quantization parameter QP corresponds to a fixed quantization step size q, and there is a rough uniformity between the quantization step size q and the zero coefficient ratio ρ A mapping relationship. Then, for the residual coefficients after transform coding (I frame is intra-frame prediction residual, P and B frames are motion compensation residual), the ratio of zero coefficient ρ to independent variable q can be obtained by statistical distribution of transform coefficients Mapping relationship, namely:

ρρ (( qq )) == 11 LL ∫∫ -- 22 qq ++ 22 qq DD. 00 (( xx )) dxdx ++ 11 LL ∫∫ -- 2.52.5 qq ++ 2.52.5 qq DD. 11 (( xx )) dxdx

== 11 LL &Sigma;&Sigma; || xx || << 22 qq DD. 00 (( xx )) ++ 11 LL &Sigma;&Sigma; || xx || << 2.52.5 qq DD. 11 (( xx ))

其中,L是当前视频帧的系数个数,D0(x)和D1(x)是残差系数的离散余弦变换后的统计直方图(包括交流系数和直流系数)。这样,就以量化步长q为联系纽带获得了ρ-QP映射表。同时,Z.He在该篇文章中还提出了一个线性信源码率模型:Wherein, L is the number of coefficients of the current video frame, and D 0 (x) and D 1 (x) are statistical histograms (including AC coefficients and DC coefficients) after discrete cosine transform of residual coefficients. In this way, the ρ-QP mapping table is obtained with the quantization step size q as the link. At the same time, Z.He also proposed a linear source code rate model in this article:

R(ρ)=θ·(1-ρ)R(ρ)=θ·(1-ρ)

并将基于零系数比例的分析叫做ρ域分析。其中,θ是斜率参数,ρ是量化后零系数所占的比例,R是残差系数编码比特率,单位为比特/象素(bit per pixel,bpp)。这个模型的不足之处在于,此模型的精确性测试仅仅对国际图像编码标准JEPG,国际视频编码标准MPEG-2、H.263和MPEG-4适用,而对于零系数比例相对较大的视频编码标准H.264(较多的SKIP模式宏块、4x4整数变换及尺度变换等)并不十分适用,需要做进一步修正。And the analysis based on the ratio of zero coefficients is called ρ-domain analysis. Among them, θ is the slope parameter, ρ is the proportion of zero coefficients after quantization, and R is the residual coefficient coding bit rate, the unit is bit per pixel (bpp). The disadvantage of this model is that the accuracy test of this model is only applicable to the international image coding standard JEPG, the international video coding standard MPEG-2, H.263 and MPEG-4, but for video coding with a relatively large proportion of zero coefficients The standard H.264 (more SKIP mode macroblocks, 4x4 integer transformation and scale transformation, etc.) is not very suitable and needs to be further revised.

此外,对于低复杂度的视频编码码率控制方法,目前可查到的专利如下:In addition, for low-complexity video coding rate control methods, currently available patents are as follows:

(a)申请号为200610052814.5的专利公开了一种基于低内存消耗查询表的视频压缩码率控制方法;(a) Patent Application No. 200610052814.5 discloses a video compression code rate control method based on a low memory consumption lookup table;

(b)申请号为200510073985.1的专利公开了一种低复杂度的积分码率控制方法;(b) Patent Application No. 200510073985.1 discloses a low-complexity integrated code rate control method;

(c)申请号为200510135494.5的专利公开了一种基于视频序列局部运动的差分直方图统计的码率控制方法;(c) Patent Application No. 200510135494.5 discloses a bit rate control method based on differential histogram statistics of video sequence local motion;

这些码率控制方法虽然保证了低复杂度,但是抽取的视频内容特征描述方式不如ρ域特性更能体现视频内容的特征,对码率控制算法的精度有一定影响,因此需要找到一个既有较低计算复杂度,又有较高码率控制精度的通用控制方法。Although these rate control methods ensure low complexity, the extracted video content feature description method is not as good as the ρ-domain feature to reflect the characteristics of the video content, which has a certain impact on the accuracy of the rate control algorithm. Therefore, it is necessary to find an existing A general control method with low computational complexity and high bit rate control accuracy.

发明内容 Contents of the invention

本发明的目的是为克服已有技术的不足,基于视频内容的空域线性特性和时域连续性,提供一种低复杂度的基于ρ域的视频编码码率控制方法,具有简单实用,性能优越,计算复杂度和内存的需求极小的特点,不仅适合于以前的视频编码标准H.261、H.263、MPEG-2、MPEG-4,还适合最新的H.264标准。The purpose of the present invention is to overcome the deficiencies of the prior art, based on the spatial linear characteristics and time domain continuity of video content, to provide a low-complexity video coding rate control method based on ρ domain, which is simple and practical, and has superior performance , the computational complexity and memory requirements are extremely small, not only suitable for the previous video coding standards H.261, H.263, MPEG-2, MPEG-4, but also suitable for the latest H.264 standard.

本发明提出了一种基于ρ域的视频编码码率控制方法,其特征在于,给定目标码率

Figure C20081011262900061
(单位为比特/象素/秒),编码端基于ρ域模型进行GOP级和帧级的比特率(单位为比特/象素)分配算法来实现码率控制,具体包括以下步骤:The present invention proposes a video coding rate control method based on ρ domain, which is characterized in that the given target rate
Figure C20081011262900061
(the unit is bit/pixel/second), the coding end carries out the bit rate (unit is bit/pixel) distribution algorithm of GOP level and frame level based on the ρ domain model to realize code rate control, specifically comprises the following steps:

1)预编码一个图像组,获取码率控制方法初始的特征参数1) Pre-encode a group of images to obtain the initial characteristic parameters of the rate control method

以初始的量化参数QP编码视频序列的一组GOP帧,并在信息库中记录下每帧的特征参数{δi,ρi,θi,Δci,si},其中,字母下标i∈[1,LGOP]∩Z+表示本GOP中的编码帧号,取正整数;δi,ρi,θi,Δci分别为第i帧对应的ρ域模型中的残差纹理复杂度参数、零系数比例参数、码率模型斜率参数、码率模型截据差参数;si为第i帧中运动向量编码比特率Rj mv和残差系数量化后的熵编码比特率Rj coe的比值;Encode a group of GOP frames of the video sequence with the initial quantization parameter QP, and record the characteristic parameters {δ i , ρ i , θ i , Δc i , s i } of each frame in the information base, where the letter subscript i ∈[1, L GOP ] ∩Z + represents the coded frame number in this GOP , which takes a positive integer ; Degree parameter, zero coefficient ratio parameter, code rate model slope parameter, code rate model truncation difference parameter; s i is the motion vector coding bit rate R j mv in the i-th frame and the entropy coding bit rate R j after residual coefficient quantization The ratio of coe ;

2)根据目标码率计算GOP比特率预算2) Calculate the GOP bit rate budget based on the target bit rate

(21)计算一个GOP所能分配的比特率

Figure C20081011262900062
更新剩余可用比特率(首次运行时,等式右边的
Figure C20081011262900064
初始化为零);其中,LGOP为GOP长度(单位为帧),f为视频编码帧率(单位为帧/秒);(21) Calculate the bit rate that a GOP can allocate
Figure C20081011262900062
Update remaining available bitrates (on the first run, the right-hand side of the equation
Figure C20081011262900064
Initialization is zero); Wherein, L GOP is GOP length (unit is frame), and f is video encoding frame rate (unit is frame/second);

(22)如果视频帧类型为I帧(帧内帧),跳转到步骤3);(22) if the video frame type is an I frame (intra frame), jump to step 3);

如果帧类型为P帧(单向预测帧)或B帧(双向预测帧),跳转到步骤4)。If the frame type is P frame (unidirectional predictive frame) or B frame (bidirectional predictive frame), jump to step 4).

3)根据剩余可用比特率

Figure C20081011262900071
计算期望的I帧比特率
Figure C20081011262900072
和相应的零系数比例ρ,跳转到步骤5);3) According to the remaining available bit rate
Figure C20081011262900071
Calculate expected I-frame bitrate
Figure C20081011262900072
and the corresponding zero coefficient ratio ρ, jump to step 5);

4)根据剩余可用比特率

Figure C20081011262900073
计算期望的P帧或B帧比特率和相应的零系数比例ρ;4) According to the remaining available bit rate
Figure C20081011262900073
Calculate the expected P-frame or B-frame bit rate and the corresponding zero coefficient ratio ρ;

5)根据期望的零系数比例ρ估计当前帧的量化系数QPj 5) Estimate the quantization coefficient QP j of the current frame according to the expected zero coefficient ratio ρ

(51)查询ρ-QP映射表,获得从零系数比例ρ到量化参数QP的转换;(51) Query the ρ-QP mapping table to obtain the conversion from the zero coefficient ratio ρ to the quantization parameter QP;

(52)检测量化参数的变化幅度,将变化幅度限制在ΔQP内;(52) Detect the variation range of the quantization parameter, and limit the variation range within ΔQP;

6)以量化参数QPj编码当前视频帧6) Encode the current video frame with the quantization parameter QP j

(61)编码视频帧,获得该帧真实的输出比特率

Figure C20081011262900074
(61) Encode the video frame to obtain the real output bit rate of the frame
Figure C20081011262900074

(62)计算剩余可用比特率

Figure C20081011262900075
其中,符号max{·}表示取两个数中的最大值;(62) Calculate the remaining available bit rate
Figure C20081011262900075
Among them, the symbol max{ } means to take the maximum value of the two numbers;

7)在信息库中记录当前帧实际的编码特征参数,并根据帧号选择跳转位置:7) Record the actual encoding characteristic parameters of the current frame in the information base, and select the jump position according to the frame number:

(71)在信息库中保存当前帧的特征参数{δ,ρ,θ,Δc,s}(以备其后的视频帧的特征参数预测所需);(71) save the feature parameter {δ, ρ, θ, Δc, s} of the current frame in the information base (in order to prepare for the feature parameter prediction of the video frame thereafter);

(72)如果帧号j≠LGOP,则令j=j+1,跳转到步骤4);(72) If frame number j≠L GOP , then make j=j+1, jump to step 4);

(73)如果帧号j=LGOP,则令j=1,跳转到步骤2)。(73) If the frame number j=L GOP , set j=1, and jump to step 2).

本发明简单实用,性能优越,主要有以下有益效果:The present invention is simple and practical, has superior performance, and mainly has the following beneficial effects:

(a)对基于变换编码的视频码率控制提供了一个通用的处理框架,其中修正的ρ域比特率模型的形式更加通用,不仅适合于以前的视频编码标准H.261、H.263、MPEG-2、MPEG-4,还适合最新的H.264标准;(a) Provides a general processing framework for video rate control based on transform coding, in which the form of the modified ρ-domain bit rate model is more general, not only suitable for the previous video coding standards H.261, H.263, MPEG -2, MPEG-4, also suitable for the latest H.264 standard;

(b)本方法计算复杂度和内存的需求极小,仅仅对几个历史的空域线性特性ρ域模型参数样点值做线性回归,然后借助ρ变量,就可以预测出当前帧的编码码率;(b) The calculation complexity and memory requirements of this method are extremely small, and only a few historical spatial domain linear characteristics ρ domain model parameter sample values are linearly regressed, and then the encoding bit rate of the current frame can be predicted with the help of ρ variable ;

(c)预测过程不会有误差传递,并能跟随输入视频数据自适应地动态调整。(c) There will be no error propagation in the prediction process, and it can be adaptively and dynamically adjusted following the input video data.

附图说明 Description of drawings

图1为本发明基于ρ域的视频编码码率控制方法的流程框图。FIG. 1 is a block flow diagram of a video encoding rate control method based on ρ domain in the present invention.

具体实施方式 Detailed ways

本发明提出的一种基于ρ域的视频编码码率控制方法结合附图及实施例详细说明如下:A kind of ρ-domain-based video coding rate control method proposed by the present invention is described in detail as follows in conjunction with the accompanying drawings and embodiments:

在本发明中:In the present invention:

(a)空域线性特性由ρ域模型来刻画(为背景技术介绍中Z.He的线性信源码率模型的针对H.264的修正模型),(a) The linear characteristics of the space domain are described by the ρ domain model (the modified model for H.264 of the linear source code rate model of Z.He in the background technology introduction),

R(ρ)=θ·(1-ρ)+ΔcR(ρ)=θ·(1-ρ)+Δc

其中,ρ为量化后的零系数在当前帧中所占的比例、Δc为截距差,R(ρ)为在零系数比例ρ条件下的视频单帧的编码码率;模型斜率参数θ与当前帧的视频纹理复杂度δ有关,进一步由如下斜率-纹理复杂度模型定义Among them, ρ is the proportion of the quantized zero coefficient in the current frame, Δc is the intercept difference, and R(ρ) is the coding rate of a single video frame under the condition of the zero coefficient ratio ρ; the model slope parameter θ and The video texture complexity of the current frame is related to δ, which is further defined by the following slope-texture complexity model

θ=σ2·eα(1-δ) θ=σ 2 ·e α(1-δ)

其中,δ由归一化的平均绝对误差(MAD)来度量,即当前帧和预测帧间的所有残差系数绝对值之和再除以255。σ和α是模型参数。Among them, δ is measured by the normalized mean absolute error (MAD), that is, the sum of the absolute values of all residual coefficients between the current frame and the predicted frame is divided by 255. σ and α are model parameters.

(b)时域连续性由以前已编码帧的参数{θ,Δc,s}来表征;其中,θ,Δc为空域模型中的参数,s为一帧中运动向量码率和残差系数量化后的熵编码码率之比;(b) Temporal continuity is characterized by the parameters {θ, Δc, s} of previously encoded frames; where θ, Δc are parameters in the spatial domain model, and s is the motion vector code rate and residual coefficient quantization in a frame The ratio of the subsequent entropy encoding code rate;

本发明提出的方法,其特征在于,给定目标码率(单位为比特/象素/秒),编码端基于ρ域模型进行GOP级和帧级的比特率(单位为比特/象素)分配算法来实现码率控制,该方法流程如图1所示,具体包括以下步骤:The method proposed by the present invention is characterized in that, given the target code rate (the unit is bit/pixel/second), the coding end performs GOP-level and frame-level bit rate (unit is bit/pixel) allocation algorithm based on the ρ domain model to realize code rate control, and the process flow of this method is shown in Figure 1 , including the following steps:

1)预编码一个图像组,获取码率控制方法初始的特征参数1) Pre-encode a group of images to obtain the initial characteristic parameters of the rate control method

以初始的量化参数QP编码视频序列的一组GOP帧,并在信息库中记录下每帧的特征参数{δi,ρi,θi,Δci,si},其中,字母下标i∈[1,LGOP]∩Z+表示本GOP中的编码帧号,取正整数;δi,ρi,θi,Δci分别为第i帧对应的ρ域模型中的残差纹理复杂度参数、零系数比例参数、码率模型斜率参数、码率模型截据差参数;si为第i帧中运动向量编码比特率Rj mv和残差系数量化后的熵编码比特率Rj coe的比值;Encode a group of GOP frames of the video sequence with the initial quantization parameter QP, and record the characteristic parameters {δ i , ρ i , θ i , Δc i , s i } of each frame in the information base, where the letter subscript i ∈[1, L GOP ] ∩Z + represents the coded frame number in this GOP , which takes a positive integer ; Degree parameter, zero coefficient ratio parameter, code rate model slope parameter, code rate model truncation difference parameter; s i is the motion vector coding bit rate R j mv in the i-th frame and the entropy coding bit rate R j after residual coefficient quantization The ratio of coe ;

2)根据目标码率计算GOP比特率预算2) Calculate the GOP bit rate budget based on the target bit rate

(21)计算一个GOP所能分配的比特率更新剩余可用比特率

Figure C20081011262900083
(首次运行时,等式右边的初始化为零);其中,LGOP为GOP长度(单位为帧),f为视频编码帧率(单位为帧/秒);(21) Calculate the bit rate that a GOP can allocate Update remaining available bitrates
Figure C20081011262900083
(on the first run, the right-hand side of the equation Initialization is zero); Wherein, L GOP is GOP length (unit is frame), and f is video encoding frame rate (unit is frame/second);

(22)如果视频帧类型为I帧(帧内帧),跳转到步骤3);(22) if the video frame type is an I frame (intra frame), jump to step 3);

如果帧类型为P帧(单向预测帧)或B帧(双向预测帧),跳转到步骤4)。If the frame type is P frame (unidirectional predictive frame) or B frame (bidirectional predictive frame), jump to step 4).

3)根据剩余可用比特率

Figure C20081011262900085
计算期望的I帧比特率和相应的零系数比例ρ,跳转到步骤5);3) According to the remaining available bit rate
Figure C20081011262900085
Calculate expected I-frame bitrate and the corresponding zero coefficient ratio ρ, jump to step 5);

4)根据剩余可用比特率

Figure C20081011262900087
计算期望的P帧或B帧比特率和相应的零系数比例ρ;4) According to the remaining available bit rate
Figure C20081011262900087
Calculate the expected P-frame or B-frame bit rate and the corresponding zero coefficient ratio ρ;

5)根据期望的零系数比例ρ估计当前帧的量化系数QPj 5) Estimate the quantization coefficient QP j of the current frame according to the expected zero coefficient ratio ρ

(51)查询ρ-QP映射表,获得从零系数比例ρ到量化参数QP的转换;(51) Query the ρ-QP mapping table to obtain the conversion from the zero coefficient ratio ρ to the quantization parameter QP;

(52)检测量化参数的变化幅度,将变化幅度限制在ΔQP内;(52) Detect the variation range of the quantization parameter, and limit the variation range within ΔQP;

6)以量化参数QPj编码当前视频帧6) Encode the current video frame with the quantization parameter QP j

(61)编码视频帧,获得该帧真实的输出比特率 (61) Encode the video frame to obtain the real output bit rate of the frame

(62)计算剩余可用比特率

Figure C20081011262900089
其中,符号max{·}表示取两个数中的最大值;(62) Calculate the remaining available bit rate
Figure C20081011262900089
Among them, the symbol max{ } means to take the maximum value of the two numbers;

7)在信息库中记录当前帧实际的编码特征参数,并根据帧号选择跳转位置:7) Record the actual encoding characteristic parameters of the current frame in the information base, and select the jump position according to the frame number:

(71)在信息库中保存当前帧的特征参数{δ,ρ,θ,Δc,s}(以备其后的视频帧的特征参数预测所需);(71) save the feature parameter {δ, ρ, θ, Δc, s} of the current frame in the information base (in order to prepare for the feature parameter prediction of the video frame thereafter);

(72)如果帧号j≠LGOP,则令j=j+1,跳转到步骤4);(72) If frame number j≠L GOP , then make j=j+1, jump to step 4);

(73)如果帧号j=LGOP,则令j=1,跳转到步骤2)。(73) If the frame number j=L GOP , set j=1, and jump to step 2).

上述步骤3)中根据剩余可用比特率

Figure C20081011262900091
计算期望的I帧比特率
Figure C20081011262900092
和相应的零系数比例ρ,包括以下步骤:According to the remaining available bit rate in the above step 3)
Figure C20081011262900091
Calculate expected I-frame bitrate
Figure C20081011262900092
and the corresponding zero coefficient ratio ρ, including the following steps:

(31)计算期望的I帧比特率

Figure C20081011262900093
其中,wI,wP,wB分别为I、P、B类型的单帧视频期望比特率权重,1,γP,γB为它们在一个GOP中所占的数量;(31) Calculate the expected I frame bit rate
Figure C20081011262900093
Among them, w I , w P , w B are the expected bit rate weights of single-frame video of I, P, and B types respectively, 1, γ P , and γ B are the numbers they occupy in a GOP;

(32)更新当前I帧的特征参数{斜率θ、截距差Δc},即用当前I帧相邻的前一个I帧的特征参数{斜率θ、截距差Δc}作为当前帧的特征参数{斜率θ、截距差Δc};(32) Update the characteristic parameters {slope θ, intercept difference Δc} of the current I frame, that is, use the characteristic parameters {slope θ, intercept difference Δc} of the previous I frame adjacent to the current I frame as the characteristic parameters of the current frame {slope θ, intercept difference Δc};

(33)计算期望的零系数比例

Figure C20081011262900094
跳转到步骤5);其中,是视频帧包头的比特率;(33) Calculate the expected zero coefficient ratio
Figure C20081011262900094
Skip to step 5); where, is the bit rate of the video frame header;

上述步骤4)中根据剩余可用比特率

Figure C20081011262900096
计算期望的P帧或B帧比特率和相应的零系数比例ρ,具体包括以下步骤:According to the remaining available bit rate in the above step 4)
Figure C20081011262900096
Calculating the expected P-frame or B-frame bit rate and the corresponding zero coefficient ratio ρ, specifically includes the following steps:

(41)计算当前帧j的可用比特率;(41) Calculate the available bit rate of the current frame j;

(411)如果剩余可用比特率

Figure C20081011262900097
则进行跳帧处理(无需编码该帧);(411) If remaining available bitrate
Figure C20081011262900097
Then perform frame skip processing (no need to encode the frame);

(412)如果剩余可用比特率

Figure C20081011262900098
则(412) If remaining available bitrate
Figure C20081011262900098
but

(a)如果当前帧为P帧,则该帧分配到的期望比特率为:(a) If the current frame is a P frame, the expected bit rate allocated to the frame is:

Figure C20081011262900099
Figure C20081011262900099

该GOP中等待分配比特率的P帧数目减1:The number of P frames waiting to be assigned a bit rate in this GOP is reduced by 1:

γP=γP-1;γ P = γ P -1;

(b)如果当前帧为B帧,则该帧分配到的期望比特率为:(b) If the current frame is a B frame, the expected bit rate allocated to this frame is:

Figure C200810112629000910
Figure C200810112629000910

该GOP中等待分配比特率的B帧数目减1:The number of B-frames waiting to be assigned a bit rate in this GOP is reduced by 1:

γB=γB-1;γ B = γ B -1;

(42)检测以前同类型帧的特征参数,并更新当前帧的特征参数{斜率θ、截距差Δc和比特率比s};(42) Detect the feature parameters of previous frames of the same type, and update the feature parameters {slope θ, intercept difference Δc and bit rate ratio s} of the current frame;

(43)计算当前帧在期望比特率

Figure C200810112629000911
限制下对应的零系数比例:(43) Calculate the expected bit rate of the current frame
Figure C200810112629000911
The corresponding zero-coefficient ratio under the limit:

&rho;&rho; == 11 -- RR jj -- RR hdrhdr 11 ++ sthe s -- &Delta;c&Delta; c &theta;&theta;

上述步骤42)中检测以前同类型帧的特征参数,更新当前帧的特征参数{斜率θ、截距差Δc和比特率比s},具体包括以下步骤:In the above-mentioned step 42), the characteristic parameters of previous frames of the same type are detected, and the characteristic parameters {slope θ, intercept difference Δc and bit rate ratio s} of the current frame are updated, specifically comprising the following steps:

(421)将当前帧之前的N个最近的同类型视频帧作为预测参考帧,从信息库中取出与其对应的N组特征参数值{θi,δi,Δci,si},1≤i≤N,并转换为{lnθi,δi,Δci,si};其中,N为正整数,变量下标i∈Z+表示相邻的参考帧号;θi为第i个参考帧的线性码率模型斜率,δi为第i个参考帧的残差纹理复杂度;(421) Take the N nearest video frames of the same type before the current frame as prediction reference frames, and take out N sets of feature parameter values corresponding to them {θ i , δ i , Δci , s i } from the information base, 1≤ i≤N, and converted to {lnθ i , δ i , Δc i , s i }; where N is a positive integer, variable subscript i∈Z + represents the adjacent reference frame number; θ i is the i-th reference The slope of the linear code rate model of the frame, δ i is the residual texture complexity of the ith reference frame;

(422)将斜率-纹理复杂度模型线性化为(422) Linearize the slope-texture complexity model as

lnθ(δ)=2lnσ+α(1-δ)lnθ(δ)=2lnσ+α(1-δ)

并对上述N组样点值做最小二乘拟合,求取模型参数α和σ,并更新特征参数{θ,Δc,s}:And do the least squares fitting on the above N groups of sample point values, calculate the model parameters α and σ, and update the characteristic parameters {θ, Δc, s}:

(a)估计当前编码帧的斜率-纹理复杂度模型参数值(a) Estimate the slope-texture complexity model parameter value of the current coded frame

&alpha;&alpha; == &delta;&delta; &OverBar;&OverBar; (( lnln &Pi;&Pi; ii == 11 nno &theta;&theta; ii )) -- (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii lnln &theta;&theta; ii )) &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii 22 -- nno &delta;&delta; &OverBar;&OverBar; 22 ,,

&sigma;&sigma; == expexp [[ 11 nno (( lnln &Pi;&Pi; ii == 11 nno &theta;&theta; ii )) (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii 22 )) -- (( &delta;&delta; &OverBar;&OverBar; ++ 11 )) (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii lnln &theta;&theta; ii )) ++ nno &delta;&delta; &OverBar;&OverBar; (( lnln &Pi;&Pi; ii == 11 nno &theta;&theta; ii )) 22 (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii 22 -- nno &delta;&delta; &OverBar;&OverBar; 22 )) ]]

其中, &delta; &OverBar; = &Sigma; i = 1 N &delta; i N ; in, &delta; &OverBar; = &Sigma; i = 1 N &delta; i N ;

(b)更新当前帧的特征参数{θ,Δc,s}:(b) Update the feature parameters {θ, Δc, s} of the current frame:

ρ域比特率模型斜率值θ=σ2eα(1-δ)ρ domain bit rate model slope value θ=σ 2 e α(1-δ) ;

ρ域比特率模型截据差 &Delta;c = &Sigma; i = 1 N &Delta;c i / N ; ρ-domain bitrate model intercept difference &Delta; c = &Sigma; i = 1 N &Delta; c i / N ;

运动向量编码比特率和残差系数量化后的熵编码比特率的比值 s = &Sigma; i = 1 N s i / N . The ratio of motion vector coding bit rate to entropy coding bit rate after residual coefficient quantization the s = &Sigma; i = 1 N the s i / N .

本发明方法结合附图及实施例进一步详细的描述。The method of the present invention is further described in detail in conjunction with the accompanying drawings and embodiments.

本实施例的条件如下:The conditions of this embodiment are as follows:

设编码器采用国际视频编码标准H.264的参考软件JM;编码器GOP结构为IBPBP...,其中GOP长度为15;I、P、B帧类型的单帧期望比特数权重为wI=10,wP=1.5和wB=1,其在一个GOP中所占的数量分别为1、7和7;编码帧率f=30。测试序列采用标准化图像格式(CIF,352x288)的Foreman序列;Suppose encoder adopts the reference software JM of international video coding standard H.264; Encoder GOP structure is IBPBP..., and wherein GOP length is 15; I, P, the single frame expected bit number weight of B frame type is w I = 10, w P =1.5 and w B =1, the numbers they occupy in one GOP are 1, 7 and 7 respectively; the coding frame rate f=30. The test sequence adopts the Foreman sequence of the standardized image format (CIF, 352x288);

本实施例的方法为:给定目标码率

Figure C20081011262900111
(单位为比特/象素/秒),编码器可以基于ρ域模型进行GOP级和帧级的比特率(单位为比特/象素)分配算法来实现码率控制,具体包括以下步骤:The method of this embodiment is: given target code rate
Figure C20081011262900111
(unit is bit/pixel/second), the coder can carry out the bit rate (unit is bit/pixel) allocation algorithm of GOP level and frame level based on ρ domain model to realize code rate control, specifically comprise the following steps:

1)预编码一个图像组,获取码率控制方法初始的特征参数1) Pre-encode a group of images to obtain the initial characteristic parameters of the rate control method

以初始的量化参数QP=28来编码视频序列的一个GOP,并在信息库中记录下每帧的特征参数{δi,ρi,θi,Δci,si},其中,字母下标i∈[1,LGOP]∩Z+表示本GOP中的编码帧号,Z+表示取正整数;δi,ρi,θi,Δci分别为第i帧对应的ρ域模型中的残差纹理复杂度参数、零系数比例参数、码率模型斜率参数、码率模型截据差参数;si为第i帧中运动向量编码比特率Rj mv和残差系数量化后的熵编码比特率Rj coe的比值;Encode a GOP of the video sequence with the initial quantization parameter QP=28, and record the characteristic parameters {δ i , ρ i , θ i , Δci , s i } of each frame in the information base, where the letter subscript i∈[1, L GOP ]∩Z + indicates the coded frame number in this GOP, and Z + indicates a positive integer; δ i , ρ i , θ i , and Δc i are respectively Residual texture complexity parameter, zero coefficient scale parameter, code rate model slope parameter, code rate model truncation difference parameter; s i is the motion vector coding bit rate R j mv in the i-th frame and the entropy coding after quantization of the residual coefficient Ratio of bit rate R j coe ;

2)根据目标码率计算GOP比特率预算2) Calculate the GOP bit rate budget based on the target bit rate

(21)计算一个GOP所能分配的比特率更新剩余可用比特率

Figure C20081011262900113
(首次运行时,等式右边的
Figure C20081011262900114
初始化为零);(21) Calculate the bit rate that a GOP can allocate Update remaining available bitrates
Figure C20081011262900113
(on the first run, the right-hand side of the equation
Figure C20081011262900114
initialized to zero);

(22)如果视频帧类型为I帧,跳转到步骤3);(22) if the video frame type is an I frame, jump to step 3);

如果帧类型为P或B帧,跳转到步骤4)。If the frame type is P or B frame, go to step 4).

3)根据剩余可用比特率计算期望的I帧比特率

Figure C20081011262900116
和相应的零系数比例ρ,包括以下步骤:3) According to the remaining available bit rate Calculate expected I-frame bitrate
Figure C20081011262900116
and the corresponding zero coefficient ratio ρ, including the following steps:

(31)计算期望的I帧比特率

Figure C20081011262900117
(31) Calculate the expected I frame bit rate
Figure C20081011262900117

(32)更新当前I帧的特征参数{斜率θ、截距差Δc},即用当前I帧相邻的前一个I帧的特征参数{斜率θ、截距差Δc}作为当前帧的特征参数{斜率θ、截距差Δc};(32) Update the characteristic parameters {slope θ, intercept difference Δc} of the current I frame, that is, use the characteristic parameters {slope θ, intercept difference Δc} of the previous I frame adjacent to the current I frame as the characteristic parameters of the current frame {slope θ, intercept difference Δc};

(33)计算期望的零系数比例

Figure C20081011262900118
跳转到步骤5);其中,
Figure C20081011262900119
是视频帧包头的比特率;(33) Calculate the expected zero coefficient ratio
Figure C20081011262900118
Skip to step 5); where,
Figure C20081011262900119
is the bit rate of the video frame header;

4)根据剩余可用比特率

Figure C200810112629001110
计算期望的P帧或B帧比特率和相应的零系数比例ρ,包括以下步骤:4) According to the remaining available bit rate
Figure C200810112629001110
Calculating the expected P-frame or B-frame bit rate and the corresponding zero coefficient ratio ρ includes the following steps:

(41)计算当前帧j的可用比特率;(41) Calculate the available bit rate of the current frame j;

(411)如果剩余可用比特率

Figure C200810112629001111
则进行跳帧处理(无需编码该帧);(411) If remaining available bitrate
Figure C200810112629001111
Then perform frame skip processing (no need to encode the frame);

(412)如果剩余可用比特率

Figure C200810112629001112
则(412) If remaining available bitrate
Figure C200810112629001112
but

(a)如果当前帧为P帧,则该帧分配到的期望比特率为:(a) If the current frame is a P frame, the expected bit rate allocated to the frame is:

Figure C20081011262900121
Figure C20081011262900121

该GOP中等待分配比特率的P帧数目减一:The number of P frames waiting to be assigned a bit rate in this GOP is reduced by one:

γP=γP-1;γ P = γ P -1;

(b)如果当前帧为B帧,则该帧分配到的期望比特率为:(b) If the current frame is a B frame, the expected bit rate allocated to this frame is:

该GOP中等待分配比特率的B帧数目减一:The number of B-frames waiting to be assigned a bit rate in this GOP is reduced by one:

γB=γB-1;γ B = γ B -1;

(42)检测以前同类型帧的特征参数,并更新当前帧的特征参数{斜率θ、截距差Δc和比特率比s},即由当前帧最相邻的前两个同类型的帧的特征参数来预测(P帧由其前两个P帧来预测,B帧由其前两个B帧来预测)。(42) Detect the feature parameters of previous frames of the same type, and update the feature parameters {slope θ, intercept difference Δc, and bit rate ratio s} of the current frame, that is, from the previous two frames of the same type that are closest to the current frame feature parameters to predict (P frame is predicted by its previous two P frames, B frame is predicted by its previous two B frames).

(421)从信息库中取出与当前帧之前的2个最近的同类型视频帧对应的2组模型参数值{θ1,δ1,Δc1,s1},{θ2,δ2,Δc2,s2},并转换为{lnθ1,δ1,Δc1,s1},{lnθ2,δ2,Δc2,s2};其中,θ1,θ2分别为第1,2个参考帧的比特率模型斜率,δ1,δ2为第1,2个参考帧的残差纹理复杂度,Δc1,Δc2为第1,2个参考帧的线性码率模型的截据差,s1,s2为第1,2个参考帧的运动向量码率和残差系数量化后的熵编码码率的比值。(421) Take out from the information base two sets of model parameter values {θ 1 , δ 1 , Δc 1 , s 1 }, {θ 2 , δ 2 , Δc corresponding to the 2 closest video frames of the same type before the current frame 2 , s 2 }, and converted to {lnθ 1 , δ 1 , Δc 1 , s 1 }, {lnθ 2 , δ 2 , Δc 2 , s 2 }; where, θ 1 , θ 2 are the 1st, 2nd The slope of the bit rate model of each reference frame, δ 1 and δ 2 are the residual texture complexity of the first and second reference frames, Δc 1 and Δc 2 are the cutoffs of the linear code rate model of the first and second reference frames The difference, s 1 , s 2 is the ratio of the code rate of the motion vector of the first and second reference frames to the code rate of the entropy coding after the residual coefficient is quantized.

(422)用斜率-纹理复杂度模型线性化为(422) is linearized using the slope-texture complexity model as

lnθ(δ)=2lnσ+α(1-δ)lnθ(δ)=2lnσ+α(1-δ)

并对上述2组样点值做最小二乘拟合,求取模型参数α和σ,并更新特征参数{θ,Δc,s}:And do the least squares fitting on the above two sets of sample point values, calculate the model parameters α and σ, and update the characteristic parameters {θ, Δc, s}:

(a)估计当前编码帧的斜率-纹理复杂度模型模型参数值(a) Estimate the slope-texture complexity model parameter values of the current coded frame

&alpha;&alpha; == &delta;&delta; 11 ++ &delta;&delta; 22 22 (( lnln &theta;&theta; 11 &theta;&theta; 22 )) -- (( &Sigma;&Sigma; ii == 11 22 &delta;&delta; 22 lnln &theta;&theta; 22 )) (( &delta;&delta; 11 22 ++ &delta;&delta; 22 22 )) -- 22 (( &delta;&delta; 11 ++ &delta;&delta; 22 22 )) 22 ,,

&sigma;&sigma; == expexp [[ 11 22 (( lnln &theta;&theta; 11 &theta;&theta; 22 )) (( &delta;&delta; 11 22 ++ &delta;&delta; 22 22 )) -- (( &delta;&delta; 11 ++ &delta;&delta; 22 22 ++ 11 )) (( &Sigma;&Sigma; ii == 11 22 &delta;&delta; ii lnln &theta;&theta; ii )) ++ 22 (( &delta;&delta; 11 ++ &delta;&delta; 22 22 )) (( lnln &theta;&theta; 11 &theta;&theta; 22 )) 22 (( (( &delta;&delta; 11 22 ++ &delta;&delta; 22 22 )) -- 22 (( &delta;&delta; 11 ++ &delta;&delta; 22 22 )) 22 )) ]]

(b)更新当前帧的特征参数{θ,Δc,s}:(b) Update the feature parameters {θ, Δc, s} of the current frame:

ρ域码率模型斜率值θ=σ2eα(1-δ)ρ-domain code rate model slope value θ=σ 2 e α(1-δ) ;

ρ域码率模型截据差 &Delta;c = &Delta;c 1 + &Delta;c 2 2 ; ρ domain code rate model intercept difference &Delta; c = &Delta; c 1 + &Delta; c 2 2 ;

运动向量码率和残差系数量化后的熵编码码率的比值 s = s 1 + s 2 2 ; The ratio of motion vector code rate to entropy coding code rate after residual coefficient quantization the s = the s 1 + the s 2 2 ;

(43)计算当前帧在期望比特率

Figure C20081011262900132
限制下对应的零系数比例:(43) Calculate the expected bit rate of the current frame
Figure C20081011262900132
The corresponding zero-coefficient ratio under the limit:

&rho;&rho; == 11 -- RR jj -- RR hdrhdr 11 ++ sthe s -- &Delta;c&Delta; c &theta;&theta;

5)根据期望的零系数比例ρ估计当前帧的量化系数QPj 5) Estimate the quantization coefficient QP j of the current frame according to the expected zero coefficient ratio ρ

(51)查询ρ-QP映射表,获得从零系数比例ρ到量化参数QP的转换;其中,ρ-QP映射表由背景技术介绍的方式获得。(51) Query the ρ-QP mapping table to obtain the conversion from the zero coefficient ratio ρ to the quantization parameter QP; wherein, the ρ-QP mapping table is obtained by the method introduced in the background technology.

在本实施例下的ρ-QP映射表以CIF格式的中等运动复杂度的Foreman标准测试序列为例,对于I帧,其映射表如下:The ρ-QP mapping table under the present embodiment takes the Foreman standard test sequence of the medium motion complexity of the CIF format as an example, and for the I frame, its mapping table is as follows:

对于P帧和B帧,其映射表如下:For P frames and B frames, the mapping table is as follows:

Figure C20081011262900135
Figure C20081011262900135

Figure C20081011262900141
Figure C20081011262900141

即是说,检测计算出的ρ靠那个区间的边界最近,就取对应的QP值。举例来说,对于I帧,若ρ=0.953,那么其属于区间[0.951,0.95793],靠0.951最近,所以取0.951对应的量化参数33;That is to say, if the detected and calculated ρ is closest to the boundary of that interval, the corresponding QP value is taken. For example, for an I frame, if ρ=0.953, then it belongs to the interval [0.951, 0.95793], which is closest to 0.951, so the quantization parameter 33 corresponding to 0.951 is taken;

(52)检测量化参数的变化幅度,将限制在ΔQP=±2内;即是说,如果上一帧QP=26,但是步骤(51)给出来的QP=29(或23),那么最多只能取到QP=28(或24);如果步骤(51)给出来的QP=27,处于[24,28]范围内,所以当前帧不必限幅。(52) Detect the range of change of the quantization parameter, will limit in ΔQP=±2; Can get QP=28 (or 24); If step (51) gives QP=27, be in [24,28] range, so current frame does not need clipping.

6)以量化参数QPj编码当前视频帧6) Encode the current video frame with the quantization parameter QP j

(61)编码视频帧,获得该帧真实的输出比特率

Figure C20081011262900142
(61) Encode the video frame to obtain the real output bit rate of the frame
Figure C20081011262900142

(62)计算剩余可用比特率

Figure C20081011262900143
其中,符号max{·}表示取两个数中的最大值;(62) Calculate the remaining available bit rate
Figure C20081011262900143
Among them, the symbol max{ } means to take the maximum value of the two numbers;

7)在信息库中记录当前帧实际的编码特征参数,并根据帧号选择跳转位置7) Record the actual encoding feature parameters of the current frame in the information base, and select the jump position according to the frame number

(71)在信息库中保存当前帧的特征参数{δ,ρ,θ,Δc,s}(以备其后的视频帧的特征参数预测所需);(71) save the feature parameter {δ, ρ, θ, Δc, s} of the current frame in the information base (in order to prepare for the feature parameter prediction of the video frame thereafter);

(72)如果帧号j≠LGOP,则令j=j+1,跳转到步骤4);(72) If frame number j≠L GOP , then make j=j+1, jump to step 4);

(73)如果帧号j=LGOP,则令j=1,跳转到步骤2)。(73) If the frame number j=L GOP , set j=1, and jump to step 2).

尽管本发明已参照具体实施方式进行描述和举例说明,但是并不意味着本发明限于这些描述的实施方式。本发明以国际视频编码标准H.264为例进行说明,但是并不局限于此,但凡依本发明权利要求书范围所做的同等的变化及修饰,均属于专利保护范畴。Although the invention has been described and illustrated with reference to specific embodiments, it is not intended that the invention be limited to these described embodiments. The present invention is illustrated by taking the international video coding standard H.264 as an example, but it is not limited thereto. All equivalent changes and modifications made according to the scope of the claims of the present invention belong to the scope of patent protection.

Claims (4)

1.一种基于ρ域的视频码率控制方法,其特征在于,给定目标码率
Figure C2008101126290002C1
编码端基于ρ域模型依次进行图像组级和帧级的比特率分配算法来实现码率控制,具体包括以下步骤:
1. A video code rate control method based on ρ domain, characterized in that, a given target code rate
Figure C2008101126290002C1
Based on the ρ-domain model, the encoding end performs bit rate allocation algorithms at the group-of-picture level and frame-level to implement bit rate control, which specifically includes the following steps:
1)预编码一个图像组,获取码率控制方法初始的特征参数:1) Pre-encode a group of images to obtain the initial characteristic parameters of the rate control method: 以初始的量化参数QP编码视频序列的一组GOP帧,并在信息库中记录下每帧的特征参数{δi,ρi,θi,Δci,si},其中,字母下标i∈[1,LGOP]∩Z+表示本GOP中的编码帧号,Z+表示取正整数;δi,ρi,θi,Δci分别为第i帧对应的ρ域模型中的残差纹理复杂度参数、零系数比例参数、码率模型斜率参数、码率模型截据差参数;si为第i帧中运动向量编码比特率Rj mv和残差系数量化后的熵编码比特率Rj coe的比值;Encode a group of GOP frames of the video sequence with the initial quantization parameter QP, and record the characteristic parameters {δ i , ρ i , θ i , Δc i , s i } of each frame in the information base, where the letter subscript i ∈[1, L GOP ]∩Z + indicates the coded frame number in this GOP, Z + indicates a positive integer; δ i , ρ i , θ i , Δc i are the residuals Difference texture complexity parameter, zero coefficient scale parameter, code rate model slope parameter, code rate model truncation difference parameter; s i is the motion vector encoding bit rate R j mv in the i-th frame and the entropy encoding bit after quantization of the residual coefficient Ratio of the rate R j coe ; 2)根据目标码率计算GOP比特率预算:2) Calculate the GOP bit rate budget according to the target bit rate: (21)计算一个GOP所能分配到的比特率
Figure C2008101126290002C2
更新剩余可用比特率
Figure C2008101126290002C3
Figure C2008101126290002C4
初始化为零;其中,LGOP为GOP长度,f为视频编码帧率;
(21) Calculate the bit rate that a GOP can allocate
Figure C2008101126290002C2
Update remaining available bitrates
Figure C2008101126290002C3
Figure C2008101126290002C4
Initialized as zero; Wherein, L GOP is the GOP length, and f is the video coding frame rate;
(22)如果视频帧类型为I帧,跳转到步骤3);(22) if the video frame type is an I frame, jump to step 3); 如果帧类型为P帧或B帧,跳转到步骤4);If the frame type is P frame or B frame, jump to step 4); 3)根据剩余可用比特率
Figure C2008101126290002C5
计算期望的I帧比特率和相应的零系数比例ρ,跳转到步骤5);
3) According to the remaining available bit rate
Figure C2008101126290002C5
Calculate expected I-frame bitrate and the corresponding zero coefficient ratio ρ, jump to step 5);
4)根据剩余可用比特率
Figure C2008101126290002C7
计算期望的P帧或B帧比特率和相应的零系数比例ρ;
4) According to the remaining available bit rate
Figure C2008101126290002C7
Calculate the expected P-frame or B-frame bit rate and the corresponding zero coefficient ratio ρ;
5)根据期望的零系数比例ρ估计当前帧的量化系数QPj5) Estimate the quantization coefficient QP j of the current frame according to the expected zero coefficient ratio ρ: (51)查询ρ-QP映射表,获得从零系数比例ρ到量化参数QP的转换;(51) Query the ρ-QP mapping table to obtain the conversion from the zero coefficient ratio ρ to the quantization parameter QP; (52)检测量化参数的变化幅度,将变化幅度限制在ΔQP内;(52) Detect the variation range of the quantization parameter, and limit the variation range within ΔQP; 6)以量化参数QPj编码当前视频帧:6) Encode the current video frame with the quantization parameter QP j : (61)编码视频帧,获得该帧真实的输出比特率
Figure C2008101126290002C8
(61) Encode the video frame to obtain the real output bit rate of the frame
Figure C2008101126290002C8
;
(62)计算剩余可用比特率
Figure C2008101126290002C9
其中,符号max{·}表示取两个数中的最大值;
(62) Calculate the remaining available bit rate
Figure C2008101126290002C9
Among them, the symbol max{ } means to take the maximum value of the two numbers;
7)在信息库中记录当前帧实际的编码特征参数,并根据帧号选择跳转位置:7) Record the actual encoding characteristic parameters of the current frame in the information base, and select the jump position according to the frame number: (71)在信息库中保存当前帧的特征参数{δ,ρ,θ,Δc,s};(71) Save the feature parameter {δ, ρ, θ, Δc, s} of the current frame in the information base; (72)如果帧号j≠LGOP,则令j=j+1,跳转到步骤4);(72) If frame number j≠L GOP , then make j=j+1, jump to step 4); (73)如果帧号j=LGOP,则令j=1,跳转到步骤2)。(73) If the frame number j=L GOP , set j=1, and jump to step 2).
2.如权利要求1所述方法,其特征在于,所述步骤3)中根据剩余可用比特率
Figure C2008101126290002C10
计算期望的I帧比特率
Figure C2008101126290002C11
和相应的零系数比例ρ,包括以下步骤:
2. method as claimed in claim 1, is characterized in that, in described step 3) according to remaining available bit rate
Figure C2008101126290002C10
Calculate expected I-frame bitrate
Figure C2008101126290002C11
and the corresponding zero coefficient ratio ρ, including the following steps:
(31)计算期望的I帧比特率
Figure C2008101126290002C12
其中,wI,wP,wB分别为I、P和B类型的单帧视频期望的比特率权重,1,γP,γB为它们在一个GOP中所占的数量;
(31) Calculate the expected I frame bit rate
Figure C2008101126290002C12
Among them, w I , w P , w B are the expected bit rate weights of single-frame video of I, P and B types respectively, and 1, γ P , γ B are the numbers they occupy in a GOP;
(32)更新当前I帧的特征参数{斜率θ、截距差Δc},用当前I帧相邻的前一个I帧的特征参数{斜率θ、截距差Δc}作为当前帧的特征参数{斜率θ、截距差Δc};(32) Update the characteristic parameter {slope θ, intercept difference Δc} of the current I frame, and use the characteristic parameter {slope θ, intercept difference Δc} of the previous I frame adjacent to the current I frame as the characteristic parameter { Slope θ, intercept difference Δc}; (33)计算期望的零系数比例
Figure C2008101126290003C1
跳转到步骤5);其中,
Figure C2008101126290003C2
是视频帧包头的比特率。
(33) Calculate the expected zero coefficient ratio
Figure C2008101126290003C1
Skip to step 5); where,
Figure C2008101126290003C2
is the bitrate of the video frame header.
3.如权利要求1所述方法,其特征在于,所述步骤4)中根据剩余可用比特率
Figure C2008101126290003C3
计算期望的P帧或B帧比特率和相应的零系数比例ρ,具体包括以下步骤:
3. method as claimed in claim 1, is characterized in that, in described step 4) according to remaining available bit rate
Figure C2008101126290003C3
Calculating the expected P-frame or B-frame bit rate and the corresponding zero coefficient ratio ρ, specifically includes the following steps:
(41)计算当前帧j的可用比特率;(41) Calculate the available bit rate of the current frame j; (411)如果剩余可用比特率
Figure C2008101126290003C4
则进行跳帧处理;
(411) If remaining available bitrate
Figure C2008101126290003C4
Then perform frame skip processing;
(412)如果剩余可用比特率
Figure C2008101126290003C5
(412) If remaining available bitrate
Figure C2008101126290003C5
but
(a)如果当前帧为P帧,则该帧分配到的期望比特率为:(a) If the current frame is a P frame, the expected bit rate allocated to the frame is: 该GOP中等待分配比特率的P帧数目减1:The number of P frames waiting to be assigned a bit rate in this GOP is reduced by 1: γP=γP-1;γ P = γ P -1; (b)如果当前帧为B帧,则该帧分配到的期望比特率为:(b) If the current frame is a B frame, the expected bit rate allocated to this frame is:
Figure C2008101126290003C7
Figure C2008101126290003C7
该GOP中等待分配比特率的B帧数目减1:The number of B-frames waiting to be assigned a bit rate in this GOP is reduced by 1: γB=γB-1;γ B = γ B -1; (42)检测以前同类型帧的特征参数,并更新当前帧的特征参数{斜率θ、截距差Δc和比特率比s};(42) Detect the feature parameters of previous frames of the same type, and update the feature parameters {slope θ, intercept difference Δc and bit rate ratio s} of the current frame; (43)计算当前帧在期望比特率
Figure C2008101126290003C8
限制下对应的零系数比例:
(43) Calculate the expected bit rate of the current frame
Figure C2008101126290003C8
The corresponding zero-coefficient ratio under the limit:
&rho;&rho; == 11 -- RR jj -- RR hdrhdr 11 ++ sthe s -- &Delta;c&Delta; c &theta;&theta;
4.如权利要求3所述方法,其特征在于,所述步骤(42)中检测以前同类型帧的特征参数,更新当前帧的特征参数{斜率θ、截距差Δc和比特率比s},具体包括以下步骤:4. method as claimed in claim 3, it is characterized in that, in the described step (42), detect the feature parameter of same type frame before, update the feature parameter {slope θ, intercept difference Δc and bit rate ratio s} of current frame , including the following steps: (421)将当前帧之前的N个最近的同类型视频帧作为预测参考帧,从信息库中取出与其对应的N组特征参数值{θi,δi,Δci,si},1≤i≤N,并转换为{lnθi,δi,Δci,si};其中,N为正整数,变量下标i∈Z+表示相邻的参考帧号;θi为第i个参考帧的线性码率模型斜率,δi为第i个参考帧的残差纹理复杂度;(421) Take the N nearest video frames of the same type before the current frame as prediction reference frames, and take out N sets of feature parameter values corresponding to them {θ i , δ i , Δci , s i } from the information base, 1≤ i≤N, and converted to {lnθ i , δ i , Δc i , s i }; where N is a positive integer, variable subscript i∈Z + represents the adjacent reference frame number; θ i is the i-th reference The slope of the linear code rate model of the frame, δ i is the residual texture complexity of the ith reference frame; (422)将斜率-纹理复杂度模型线性化为:(422) Linearize the slope-texture complexity model as: lnθ(δ)=2lnσ+α(1-δ)lnθ(δ)=2lnσ+α(1-δ) 并对所述N组样点值做最小二乘拟合,求取模型参数α和σ,并更新特征参数{θ,Δc,s}:And do the least squares fitting on the N groups of sample point values, find the model parameters α and σ, and update the characteristic parameters {θ, Δc, s}: (a)估计当前编码帧的斜率-纹理复杂度模型参数值:(a) Estimate the slope-texture complexity model parameter values of the current coded frame: &alpha;&alpha; == &delta;&delta; &OverBar;&OverBar; (( lnln &Pi;&Pi; ii == 11 nno &theta;&theta; ii )) -- (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii lnln &theta;&theta; ii )) &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii 22 -- nno &delta;&delta; &OverBar;&OverBar; 22 ,, &sigma;&sigma; == expexp [[ 11 nno (( lnln &Pi;&Pi; ii == 11 nno &theta;&theta; ii )) (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii 22 )) -- (( &delta;&delta; &OverBar;&OverBar; ++ 11 )) (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii lnln &theta;&theta; ii )) ++ nno &delta;&delta; &OverBar;&OverBar; (( lnln &Pi;&Pi; ii == 11 nno &theta;&theta; ii )) 22 (( &Sigma;&Sigma; ii == 11 nno &delta;&delta; ii 22 -- nno &delta;&delta; &OverBar;&OverBar; 22 )) ]] 其中, &delta; &OverBar; = &Sigma; i = 1 N &delta; i N ; in, &delta; &OverBar; = &Sigma; i = 1 N &delta; i N ; (b)更新当前帧的特征参数{θ,Δc,s}:(b) Update the feature parameters {θ, Δc, s} of the current frame: ρ域比特率模型斜率值θ=σ2(1-δ)ρ-domain bit rate model slope value θ=σ 2(1-δ) ; ρ域比特率模型截据差 &Delta;c = &Sigma; i = 1 N &Delta; c i / N ; ρ-domain bitrate model intercept difference &Delta; c = &Sigma; i = 1 N &Delta; c i / N ; 运动向量编码比特率和残差系数量化后的熵编码比特率的比值 s = &Sigma; i = 1 N s i / N . The ratio of motion vector coding bit rate to entropy coding bit rate after residual coefficient quantization the s = &Sigma; i = 1 N the s i / N .
CN 200810112629 2008-05-23 2008-05-23 Rate Control Method of Video Coding Based on ρ Domain Expired - Fee Related CN100581262C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810112629 CN100581262C (en) 2008-05-23 2008-05-23 Rate Control Method of Video Coding Based on ρ Domain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810112629 CN100581262C (en) 2008-05-23 2008-05-23 Rate Control Method of Video Coding Based on ρ Domain

Publications (2)

Publication Number Publication Date
CN101287123A CN101287123A (en) 2008-10-15
CN100581262C true CN100581262C (en) 2010-01-13

Family

ID=40059055

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810112629 Expired - Fee Related CN100581262C (en) 2008-05-23 2008-05-23 Rate Control Method of Video Coding Based on ρ Domain

Country Status (1)

Country Link
CN (1) CN100581262C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10091504B2 (en) 2015-01-08 2018-10-02 Microsoft Technology Licensing, Llc Variations of rho-domain rate control

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102036062B (en) * 2009-09-29 2012-12-19 华为技术有限公司 Video coding method and device and electronic equipment
CN105407354A (en) * 2015-11-06 2016-03-16 济南草履虫电子科技有限公司 Video flicker suppression method through computer control
TWI554083B (en) * 2015-11-16 2016-10-11 晶睿通訊股份有限公司 Image processing method and camera thereof
CN106791848B (en) * 2016-12-20 2020-01-03 中国电建集团河南省电力勘测设计院有限公司 Two-Pass code rate control method based on HEVC
CN109561311A (en) * 2018-12-07 2019-04-02 莆田学院 A kind of 3 d video encoding bit rate control method and storage equipment based on the domain ρ
CN110198444B (en) * 2019-04-16 2021-07-09 浙江大华技术股份有限公司 Video frame encoding method, video frame encoding apparatus, and device having storage function
CN110740324B (en) * 2019-09-11 2023-03-31 浙江大华技术股份有限公司 Coding control method and related device
CN114422783B (en) * 2021-12-07 2024-04-12 网宿科技股份有限公司 Video encoding method, electronic device and storage medium
CN118900333A (en) * 2023-05-04 2024-11-05 腾讯科技(深圳)有限公司 Multimedia encoding method, device, equipment, medium and product

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种基于频域图像质量控制的自适应码率调整方法. 徐一凡,尔桂花,戴琼海.2004国际有线电视技术研讨会. 2004 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10091504B2 (en) 2015-01-08 2018-10-02 Microsoft Technology Licensing, Llc Variations of rho-domain rate control

Also Published As

Publication number Publication date
CN101287123A (en) 2008-10-15

Similar Documents

Publication Publication Date Title
CN100581262C (en) Rate Control Method of Video Coding Based on ρ Domain
CN102932641B (en) A kind of constant-quality bit rate control method
CN102026000B (en) Distributed video coding system with combined pixel domain-transform domain
CN102025999B (en) Fast Intra Prediction Method for Video Transcoding Based on Support Vector Machine
CN101141636A (en) Data rate control method and video signal encoder
KR20170089823A (en) Apparatus and method for coding/decoding image selectivly using descrete cosine/sine transtorm
JP2009540636A (en) Method and apparatus for adaptively determining a bit budget for encoding a video picture
CN103533359B (en) One is bit rate control method H.264
JP5897218B2 (en) Video encoding method and video encoding apparatus using this method
WO2004010702A1 (en) A bit-rate control method and device combined with rate-distortion optimization
CN101895758B (en) H.264 code rate control method based on frame complexity
CN108989802B (en) A method and system for quality estimation of HEVC video stream using inter-frame relationship
CN101242532A (en) A bit rate control method for multi-viewpoint video
CN103957410B (en) I-frame code rate control method based on residual frequency domain complexity
CN102158709A (en) Derivable motion compensation prediction method of decoding terminal
Pan et al. Frame-level Bit Allocation Optimization Based on<? brk?> Video Content Characteristics for HEVC
CN1502207A (en) Method of performing video encoding rate control using bit budget
CN101977323B (en) Distributed Video Coding Reconstruction Method Based on Video Spatial-Temporal Correlation Constraints
CN103618906B (en) A kind of H.264 bit rate control method of subjectively-based video quality
CN112218084A (en) Frame-level rate control method of high-efficiency video coding standard for surveillance video
CN104113761A (en) Code rate control method for video encoding and encoder
CN101179729A (en) A H.264 Macroblock Mode Selection Method Based on Statistical Classification of Inter Modes
CN103237221B (en) A kind of H.264 frame layer rate control method of structure based likeness coefficient
KR20110099554A (en) Quantization Parameter Determination Method of H.264 / ACC Coder Using Image Complexity and H.264 / ABC Coder Implementing It
CN100579227C (en) A system and method for selecting an intra prediction mode

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100113

CF01 Termination of patent right due to non-payment of annual fee