CN108200431A - A kind of video frequency coding rate controls frame-layer Bit distribution method - Google Patents
A kind of video frequency coding rate controls frame-layer Bit distribution method Download PDFInfo
- Publication number
- CN108200431A CN108200431A CN201711297946.9A CN201711297946A CN108200431A CN 108200431 A CN108200431 A CN 108200431A CN 201711297946 A CN201711297946 A CN 201711297946A CN 108200431 A CN108200431 A CN 108200431A
- Authority
- CN
- China
- Prior art keywords
- bits
- frame
- buffer
- image
- formula
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000004364 calculation method Methods 0.000 claims abstract description 9
- 230000009466 transformation Effects 0.000 claims description 6
- 230000003139 buffering effect Effects 0.000 abstract 2
- 238000005516 engineering process Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000013139 quantization Methods 0.000 description 3
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 239000002360 explosive Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/146—Data rate or code amount at the encoder output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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 an image region, e.g. an object
- H04N19/172—Methods 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 an image region, e.g. an object the region being a picture, frame or field
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/184—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/70—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
技术领域technical field
本发明属于视频编解码领域,更具体地说,涉及一种视频编码码率控制帧层比特分配方法。The invention belongs to the field of video coding and decoding, and more specifically relates to a video coding bit rate control frame layer bit allocation method.
背景技术Background technique
人类70%的信息是通过眼睛获取的,所以说百闻不如一见。人的视觉能对环境的变化做出直接的反映。随着现代信息处理技术和数字存储技术的发展和应用,视频已成为传送、记录和重现信息的高效媒体之一。为了满足人们对高质量视频消费的需求,数字视频已从现在的720P转向到了1080P,甚至4K×2K级,目前8K×4K级的视频技术也在开发中。数字视频的帧频从30fps提高到了60fps和120fps,甚至朝240fps的目标迈进。由于高清晰度和高帧频的视频包含了巨大的信息量,因此描述这些视频所需的数据量也非常大,视频流量呈现出爆炸式的增长。由于视频中存在着大量的空间冗余、时间冗余、统计冗余、视觉冗余、结构冗余、知识冗余和图像冗余等信息,如果能通过采取预测、变换、量化和熵编码等方式去除这些冗余信息,即可实现对视频数据的压缩编码。70% of human information is obtained through eyes, so it is better to see it than to hear it. Human vision can directly respond to changes in the environment. With the development and application of modern information processing technology and digital storage technology, video has become one of the efficient media for transmitting, recording and reproducing information. In order to meet people's demand for high-quality video consumption, digital video has shifted from the current 720P to 1080P, and even 4K×2K. At present, 8K×4K video technology is also under development. The frame rate of digital video has been increased from 30fps to 60fps and 120fps, even towards the goal of 240fps. Since high-definition and high-frame-rate videos contain a huge amount of information, the amount of data required to describe these videos is also very large, and video traffic has shown explosive growth. Due to the existence of a large amount of spatial redundancy, temporal redundancy, statistical redundancy, visual redundancy, structural redundancy, knowledge redundancy and image redundancy in video, if prediction, transformation, quantization and entropy coding can be used to By removing these redundant information, the video data can be compressed and encoded.
由于高性能视频压缩编码是缓解持续增长的视频数据对通信网络传输和存储压力的关键技术之一,因此,视频编码技术在最近几十年里得到了飞速的发展,国内和国际标准化组织相继制定了很多国际视频编码标准。ITU-T和ISO于2013年1月联合发布了新一代国际视频编码标准-高效率视频编码(High Efficiency Video Coding,HEVC)。HEVC与大多数视频编码标准一样,也采用了预测加变换的混合编码框架,附图1是HEVC标准的编码框架。由于在每个视频编码模块中引入了新的编码技术,如高精度运动补偿、运动估计合并、基于语义的熵编码、自适应环路滤波等新技术,大大提高了HEVC的编码效率。Since high-performance video compression coding is one of the key technologies to alleviate the pressure of continuously growing video data on communication network transmission and storage, video coding technology has developed rapidly in recent decades, and domestic and international standardization organizations have successively formulated There are many international video coding standards. ITU-T and ISO jointly released a new generation of international video coding standard - High Efficiency Video Coding (HEVC) in January 2013. HEVC, like most video coding standards, also adopts a hybrid coding framework of prediction and transformation. Attached Figure 1 is the coding framework of the HEVC standard. Due to the introduction of new coding technologies in each video coding module, such as high-precision motion compensation, motion estimation merging, semantic-based entropy coding, adaptive loop filtering and other new technologies, the coding efficiency of HEVC is greatly improved.
在视频通信中,由于通信网中的传输资源有限,如果视频编码器输出码流比特率过大,会导致发送端输出缓冲区上溢,使得视频传输延迟或丢帧,接收端解码播放时,视频会出现间断或不连续的现象;如果视频压缩比大,编码端输出码流比特率小,既不能充分利用传输信道资源,又会造成解码视频质量的下降,在解码后的视频中会出现方块效应或边缘轮廓模糊的现象。解决上述问题的主要手段是在视频编码器中采用码率控制技术。码率控制不但能够提高信道的利用率,还能保证较高的视频编码质量,因此,码率控制算法对视频编码的应用和视频正常通信传输有着重要的意义,是当前视频编码器不可或缺的重要组成部分。In video communication, due to the limited transmission resources in the communication network, if the bit rate of the video encoder output code stream is too high, the output buffer at the sending end will overflow, causing video transmission delay or frame loss. When the receiving end decodes and plays, The video will appear intermittent or discontinuous; if the video compression ratio is high and the output bit rate of the encoding end is small, the transmission channel resources cannot be fully utilized, and the quality of the decoded video will decrease. Blocking or fuzzy edges. The main means to solve the above problems is to use bit rate control technology in the video encoder. Rate control can not only improve the utilization rate of the channel, but also ensure high video coding quality. Therefore, the rate control algorithm is of great significance to the application of video coding and normal video communication transmission, and is indispensable for current video encoders. important parts of.
码率控制过程可以分成两个步骤。第一步是对每一层的编码单元分配合适数量的比特,通常包括图像组(Group Of Pictures,GOP)层、帧层和基本编码单元层。编码器根据缓冲区的占有情况对每一层分配合适数量的比特。第二步是通过确定编码端的量化参数达到对每一层预先分配的比特数。The rate control process can be divided into two steps. The first step is to allocate an appropriate number of bits to the coding units of each layer, which usually includes a group of pictures (Group Of Pictures, GOP) layer, a frame layer and a basic coding unit layer. The encoder allocates an appropriate number of bits to each layer based on buffer occupancy. The second step is to achieve the pre-allocated number of bits for each layer by determining the quantization parameters at the encoding end.
一个性能良好的码率控制算法,可以在精确的达到目标码率的同时,使得编码失真最小,因此码率控制问题被转化成如公式(1)所示的率失真优化(RDO,Rate DistortionOptimization)问题,即编码器在编码比特数不超过目标比特数的情况下,选择使失真最小的参数作为最优编码参数。公式(1)中的{Para}表示编码参数集合,包括模式、运动信息、预测参数、量化参数等;λ是拉格朗日乘子,即R-D(Rate-Distortion)曲线的斜率绝对值。A rate control algorithm with good performance can minimize the encoding distortion while accurately reaching the target bit rate, so the rate control problem is transformed into a rate-distortion optimization (RDO, Rate DistortionOptimization) as shown in formula (1) The problem is that the encoder selects the parameter that minimizes the distortion as the optimal encoding parameter when the number of encoded bits does not exceed the target number of bits. {Para} in formula (1) represents a set of coding parameters, including mode, motion information, prediction parameters, quantization parameters, etc.; λ is the Lagrangian multiplier, that is, the absolute value of the slope of the R-D (Rate-Distortion) curve.
为了提高编码的灵活性,编码器可以自由选择各种编码参数的组合。由于选择不同的参数会直接影响最终视频的编码比特率,所以码率控制算法是通过在编码参数集合中选择合适的编码参数,从而达到目标码率。In order to improve the flexibility of encoding, the encoder can freely choose the combination of various encoding parameters. Since the selection of different parameters will directly affect the encoding bit rate of the final video, the bit rate control algorithm is to select the appropriate encoding parameters in the encoding parameter set to achieve the target bit rate.
HEVC采用了一种新颖的基于R-λ模型的λ域码率控制算法,使用双曲线模型来精确刻画编码算法中的R-D码率失真模型,通过公式(2)计算得到视频经压缩编码后的失真,其中,R表示压缩后的比特率,用每像素消耗的比特(bit per pixel,bpp)来表示;C和K是和视频序列内容特性相关的模型参数,不同视频序列,C和K的取值不同。HEVC adopts a novel λ-domain rate control algorithm based on the R-λ model, uses the hyperbolic model to accurately describe the R-D rate-distortion model in the encoding algorithm, and calculates the compressed and encoded video by formula (2). Distortion, where R represents the compressed bit rate, represented by the bit consumed per pixel (bit per pixel, bpp); C and K are model parameters related to the content characteristics of the video sequence, different video sequences, C and K The values are different.
D(R)=CR-K (2)D(R)=CR -K (2)
码率控制就是在R-D码率失真模型基础上,建立码率R和编码使用的拉格朗日乘子λ之间的数学关系,并利用调整λ的方法达到所期望的目标码率。公式(3)可以计算出拉格朗日乘子λ,其中α=CK,β=-K-1。α和β这两个参数与视频序列的内容特性相关,不同序列具有不同的取值。由公式(3)进一步得到码率R与λ关系,如公式(4)所示。Rate control is based on the R-D rate-distortion model to establish the mathematical relationship between the rate R and the Lagrangian multiplier λ used for encoding, and use the method of adjusting λ to achieve the desired target rate. Formula (3) can calculate the Lagrangian multiplier λ, where α=CK, β=-K-1. The two parameters α and β are related to the content characteristics of the video sequence, and different sequences have different values. The relationship between code rate R and λ is further obtained from formula (3), as shown in formula (4).
由公式(4)可知码率R完全由拉格朗日乘子λ所决定。λ与R-D曲线的关系示意图如附图2所示。λ是由所有实际工作点凸包络决定的R-D曲线的斜率绝对值。码率R和拉格朗日乘子λ之间存在着一一对应关系。由于R-D曲线是凸函数,基于某个λ值计算的最小化公式(1)等效于使用斜率绝对值为λ值的直线去逼近R-D曲线,而该直线仅会和R-D曲线相切于一点。因此,λ值可以直接决定码率R和视频失真D。It can be seen from formula (4) that the code rate R is completely determined by the Lagrangian multiplier λ. The schematic diagram of the relationship between λ and the R-D curve is shown in Figure 2. λ is the absolute value of the slope of the R-D curve determined by the convex envelope of all actual operating points. There is a one-to-one correspondence between the code rate R and the Lagrange multiplier λ. Since the R-D curve is a convex function, the minimization formula (1) calculated based on a certain λ value is equivalent to using a straight line whose slope absolute value is the λ value to approximate the R-D curve, and the straight line will only be tangent to the R-D curve at one point. Therefore, the λ value can directly determine the code rate R and video distortion D.
为了达到所分配的某个目标码率R,编码器将根据公式(1)确定相关联的λ值,并将其用于编码过程。当编码使用的λ值确定后,所有其他的编码参数均通过率失真优化获得。To achieve a certain assigned target code rate R, the encoder will determine the associated λ value according to equation (1) and use it in the encoding process. After the λ value used for encoding is determined, all other encoding parameters are obtained through rate-distortion optimization.
HEVC码率控制的比特分配是在图像组(GOP)层、帧层和基本编码单元层三个层次进行的。帧层的目标比特数根据R-λ模型码率控制算法中帧层固定权重并按照公式(5)进行分配。The bit allocation of HEVC code rate control is carried out at three levels: group of picture (GOP) layer, frame layer and basic coding unit layer. The target number of bits of the frame layer is allocated according to formula (5) according to the fixed weight of the frame layer in the rate control algorithm of the R-λ model.
其中,TCurrPic是当前帧的分配比特数,TGOP是当前图像组(GOP)的分配比特数,CodedGOP表示GOP中已编码的比特数,表示当前图像帧在R-λ模型码率控制算法中的帧层固定权重,为GOP中所有未编码图像的比特分配权重。Wherein, T CurrPic is the number of allocated bits of the current frame, T GOP is the number of allocated bits of the current group of pictures (GOP), Coded GOP represents the number of bits encoded in the GOP, Indicates the frame layer fixed weight of the current image frame in the R-λ model rate control algorithm, Assign weights to the bits of all uncoded pictures in the GOP.
由上述可知,由于图像组中的每一帧目标比特都是根据所对应的编码结构和编码顺序提前确定的,且是固定的权重数值,没有考虑到视频序列的图像本身的复杂度,也没有考虑缓冲区的状态,从而导致了比特分配不合理。It can be seen from the above that since the target bits of each frame in the image group are determined in advance according to the corresponding encoding structure and encoding sequence, and are fixed weight values, the complexity of the image itself in the video sequence is not considered, and there is no Consider the state of the buffer, resulting in unreasonable allocation of bits.
发明内容Contents of the invention
本发明旨在解决以上现有技术的问题。提出了一种比特分配合理的视频编码码率控制帧层比特分配方法。本发明的技术方案如下:The present invention aims to solve the above problems of the prior art. A reasonable bit allocation method for video coding rate control frame layer bit allocation is proposed. Technical scheme of the present invention is as follows:
一种视频编码码率控制帧层比特分配方法,其包括以下具体步骤:A video coding rate control frame layer bit allocation method, which comprises the following specific steps:
步骤1、输入视频,对视频的帧层图像纹理进行分析,得到图像信息熵EI,最小变换域绝对误差之和SATD值;Step 1, input a video, analyze the frame layer image texture of the video, obtain the image information entropy EI, the minimum sum of absolute errors in the transform domain SATD value;
步骤2、根据得到的EI和SATD值,以及R-λ模型码率控制算法中帧层固定权重计算出各帧图像的比特分配权重ωpic;Step 2. According to the obtained EI and SATD values, and the fixed weight of the frame layer in the R-λ model rate control algorithm Calculate the bit allocation weight ω pic of each frame image;
步骤3、根据公式(1)计算出帧层分配的比特数;Step 3, calculate the number of bits allocated by the frame layer according to formula (1);
其中,TCurrPic是当前帧分配的比特数;TGOP是当前图像组GOP分配的比特数;CodedGOP表示GOP中已编码的比特数;ωpic为当前帧的比特分配权重;为GOP中所有未编码图像的比特分配权重。Wherein, T CurrPic is the number of bits allocated by the current frame; T GOP is the number of bits allocated by the current group of pictures GOP; Coded GOP represents the number of bits encoded in the GOP; ω pic is the bit allocation weight of the current frame; Assign weights to the bits of all uncoded pictures in the GOP.
步骤4、分析视频编码缓冲区的状态,通过设置缓冲区充盈度,计算出缓冲区的反馈比特;Step 4, analyzing the state of the video encoding buffer, calculating the feedback bit of the buffer by setting the buffer fullness;
步骤5、根据步骤3计算出的帧层分配比特数TCurrPic和缓冲区的反馈比特ΔT,计算出当前帧应分配的比特数。Step 5. Calculate the number of bits to be allocated for the current frame according to the number of allocated bits T CurrPic at the frame layer calculated in Step 3 and the feedback bits Δ T of the buffer.
进一步的,所述步骤1中的图像信息熵EI采用公式(2)计算得到。Further, the image information entropy EI in the step 1 is calculated by formula (2).
其中,p(x)是图像x灰度级出现的概率,N为图像最大的灰度级。Among them, p(x) is the probability of occurrence of image x gray level, and N is the maximum gray level of the image.
进一步的,步骤1中的最小变换域绝对误差之和SATD值由公式(3)计算得到。Further, the SATD value of the minimum sum of absolute errors in transform domain in step 1 is calculated by formula (3).
其中,M为像素块的行和列的像素个数,hi,j为像素块经过哈达玛变换后的对应值。Wherein, M is the number of pixels in the row and column of the pixel block, and h i, j are the corresponding values of the pixel block after Hadamard transformation.
进一步的,所述步骤2中的帧层比特分配权重ωpic由公式(4)计算得到。Further, the frame layer bit allocation weight ω pic in the step 2 is calculated by formula (4).
其中,EIi是当前帧图像的信息熵;SATDi为当前帧图像的最小变换域绝对误差之和;表示当前帧图像在R-λ模型码率控制算法中帧层固定权重;a,b为加权系数,这两个系数值大于0且小于1。Among them, EI i is the information entropy of the current frame image; SATD i is the sum of the minimum transform domain absolute errors of the current frame image; Indicates that the current frame image has a fixed weight at the frame layer in the R-λ model rate control algorithm; a and b are weighting coefficients, and the values of these two coefficients are greater than 0 and less than 1.
进一步的,所述步骤4中缓冲区的反馈比特计算过程如下:Further, the feedback bit calculation process of the buffer in the step 4 is as follows:
计算出已编码图像帧分配得到的目标比特数,计算已编码图像帧实际编码过程中消耗的比特数,求该两个比特数的绝对差和,然后通过公式(5)计算出缓冲区剩余的比特数。Calculate the target number of bits allocated by the coded image frame, calculate the number of bits consumed in the actual encoding process of the coded image frame, find the absolute difference sum of the two bits, and then calculate the rest of the buffer by formula (5) number of bits.
其中,Tbufleft是缓冲区剩余比特数;i表示已编码帧的序号;n是当前待编码帧的序号;是当前图像组GOP中已编码图像帧分配得到的比特数;是当前图像组中已编码图像实际消耗的比特数;为了避免缓冲区溢出,在编码一图像帧之前,先设定一个目标缓冲级L,使得编码完成后缓冲区充盈度尽量逼近该值,目标缓冲级L的计算公式如(6)所示。Among them, T bufleft is the number of remaining bits in the buffer; i represents the sequence number of the encoded frame; n is the sequence number of the current frame to be encoded; is the number of bits allocated to the encoded picture frame in the current picture group GOP; is the actual number of bits consumed by the encoded image in the current image group; in order to avoid buffer overflow, before encoding an image frame, first set a target buffer level L, so that the buffer fullness after encoding is as close as possible to this value, the target The calculation formula of the buffer level L is shown in (6).
L=μ×Bd (6)L=μ×B d (6)
Bd=R/f (7) Bd = R/f (7)
其中,系数μ为0~1之间的某个值;Bd为缓冲区的大小;R为信道速率,该值可预先在配置文件中设置;f为帧率。Among them, the coefficient μ is a certain value between 0 and 1; B d is the size of the buffer; R is the channel rate, which can be pre-set in the configuration file; f is the frame rate.
缓冲区的反馈比特的计算公式如(8)所示。The formula for calculating the feedback bits of the buffer is shown in (8).
ΔT=η×(L-Tbufleft) (8) ΔT =η×(LT bufleft ) (8)
其中,ΔT表示缓冲区的反馈比特;系数η为0~1之间的某个值;L为目标缓冲级;Tbufleft表示缓冲区剩余比特数。Among them, Δ T represents the feedback bit of the buffer; the coefficient η is a value between 0 and 1; L is the target buffer level; T bufleft represents the number of remaining bits in the buffer.
基于缓冲区充盈度分配的比特数TCurrPicbuf采用公式(9)计算得到。The number of bits T CurrPicbuf allocated based on the buffer fullness is calculated by formula (9).
进一步的,所述步骤5通过采用基于综合因子的分配权重,缓冲区反馈比特加权平均的方法,得到最终帧层比特的分配公式如(10)所示。Further, the step 5 obtains the final frame layer bit allocation formula as shown in (10) by adopting the allocation weight based on the comprehensive factor and the buffer feedback bit weighted average method.
TCurrPicfal=γ×TCurrPic+(1-γ)×TCurrPicbuf (10)T CurrPicfal = γ×T CurrPic + (1-γ)×T CurrPicbuf (10)
其中,TCurrPicfal表示当前帧最终被分配的比特数;TCurrPic是根据基于综合因子的分配权重为当前帧分配的比特数;TCurrPicbuf是基于缓冲区充盈度分配的比特数;γ为加权系数,其取值范围在0~1之间,根据不同配置文件选取该值。Among them, T CurrPicfal represents the number of bits finally allocated to the current frame; T CurrPic is the number of bits allocated for the current frame according to the allocation weight based on the comprehensive factor; T CurrPicbuf is the number of bits allocated based on the buffer fullness; γ is the weighting coefficient, Its value ranges from 0 to 1, and the value is selected according to different configuration files.
联立公式(1)、(9)和(10),得到如(11)所示的TCurrPicfal的计算公式。Combine formulas (1), (9) and (10) to obtain the calculation formula of T CurrPicfal as shown in (11).
本发明的优点及有益效果如下:Advantage of the present invention and beneficial effect are as follows:
本发明解决了目前视频编码中码率控制算法没有考虑视频序列图像本身的复杂度,也没有考虑编码器缓冲区的状态,从而导致比特分配不合理的问题。本发明通过计算图像信息熵和最小变换域绝对误差之和,结合R-λ模型码率控制算法中帧层固定权重,构建了基于综合因子的分配权重,通过分析缓冲区充盈度,计算出缓冲区的反馈比特,推导出当前帧最终被分配比特数的计算公式。采用本发明提出的帧层比特分配方法,可以改进帧层的比特分配,提高比特分配的合理性,提升码率控制的精度。The invention solves the problem that the code rate control algorithm in the current video encoding does not consider the complexity of the video sequence image itself, nor the state of the encoder buffer area, which leads to unreasonable bit allocation. The present invention calculates the sum of the image information entropy and the absolute error of the minimum transformation domain, combined with the fixed weight of the frame layer in the R-λ model code rate control algorithm, constructs the distribution weight based on the comprehensive factor, and calculates the buffer by analyzing the fullness of the buffer The feedback bits of the area, deduce the calculation formula of the final allocated bits of the current frame. By adopting the frame layer bit allocation method proposed by the present invention, the frame layer bit allocation can be improved, the rationality of bit allocation can be improved, and the accuracy of code rate control can be improved.
附图说明Description of drawings
图1是本发明提供实施例视频编码标准HEVC的编码框架示意图;FIG. 1 is a schematic diagram of a coding framework of the video coding standard HEVC according to an embodiment of the present invention;
图2为拉格朗日乘子λ与R-D曲线的关系示意图;Figure 2 is a schematic diagram of the relationship between the Lagrange multiplier λ and the R-D curve;
图3为本发明实施方式中的一种视频编码码率控制帧层比特分配方法流程图。FIG. 3 is a flow chart of a video coding rate control frame layer bit allocation method in an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、详细地描述。所描述的实施例仅仅是本发明的一部分实施例。The technical solutions in the embodiments of the present invention will be described clearly and in detail below with reference to the drawings in the embodiments of the present invention. The described embodiments are only some of the embodiments of the invention.
本发明解决上述问题的技术方案是:The technical scheme that the present invention solves the above problems is:
步骤一、对帧层的图像纹理进行分析,得到图像信息熵EI(Entropy Information)以及最小变换域绝对误差之和SATD(Sum of Absolute Transformed Difference)值;Step 1. Analyze the image texture of the frame layer to obtain the image information entropy EI (Entropy Information) and the minimum sum of absolute errors in the transform domain SATD (Sum of Absolute Transformed Difference) value;
步骤二、根据得到的EI和SATD,以及R-λ模型码率控制算法中帧层固定权重计算各帧图像的比特分配权重ωpic;Step 2. According to the obtained EI and SATD, and the fixed weight of the frame layer in the R-λ model rate control algorithm Calculate the bit allocation weight ω pic of each frame image;
步骤三、根据如下公式(1)计算出帧层分配的比特数。Step 3: Calculate the number of bits allocated by the frame layer according to the following formula (1).
其中,TCurrPic是当前帧的分配比特数;TGOP是当前图像组(GOP)的分配比特数;CodedGOP表示GOP中已编码的比特数;ωpic为当前帧的比特分配权重;为GOP中所有未编码图像的比特分配权重。Wherein, T CurrPic is the number of allocated bits of the current frame; T GOP is the number of allocated bits of the current group of pictures (GOP); Coded GOP represents the number of bits encoded in the GOP; ω pic is the bit allocation weight of the current frame; Assign weights to the bits of all uncoded pictures in the GOP.
步骤四、通过分析视频编码端的缓冲区状态,并设置缓冲区的充盈度,计算出缓冲区的反馈比特。Step 4: Calculate the feedback bits of the buffer by analyzing the buffer status of the video encoding end and setting the fullness of the buffer.
根据公式(2)和公式(3)分别计算得到图像信息熵EI以及最小变换域绝对误差之和SATD。根据EI、SATD以及当前帧图像在R-λ模型码率控制算法中帧层固定权重采用公式(4)得到基于综合因子的分配权重ωpic。According to formula (2) and formula (3), the image information entropy EI and the minimum sum of absolute errors in transform domain SATD are calculated respectively. According to EI, SATD and the current frame image, the frame layer fixed weight in the R-λ model rate control algorithm Formula (4) is used to obtain the distribution weight ω pic based on the comprehensive factor.
其中,p(x)是图像x灰度级出现的概率;N为最大灰度级;M为像素块行列的像素个数;hi,j为像素块经过哈达玛变换后的对应值;a,b为加权系数,其取值范围在0~1之间。Among them, p(x) is the probability of the gray level of image x; N is the maximum gray level; M is the number of pixels in the rows and columns of the pixel block; h i, j are the corresponding values of the pixel block after Hadamard transformation; a , b is a weighting coefficient, and its value range is between 0 and 1.
按照公式(5)~(8)计算得到缓冲区的反馈比特ΔT。The feedback bit Δ T of the buffer is calculated according to formulas (5)-(8).
Bd=R/f (5)B d =R/f (5)
L=μ×Bd (6)L=μ×B d (6)
ΔT=η×(L-Tbufleft) (8) ΔT =η×(LT bufleft ) (8)
其中,Bd为缓冲区的大小;R为信道速率,其值可预先在配置文件中设置;f为帧率;ΔT表示缓冲区的反馈比特;系数μ与η的取值大于0且小于1;L为目标缓冲级;Tbufleft表示缓冲区剩余数据量;Tbufleft是缓冲区剩余数据量;i表示已编码帧的序号;n是当前编码帧的序号;是在当前图像组(GOP)中为已编码的图像帧分配获取的比特数;为在当前图像组中为已经编码的图像帧实际消耗的比特数。Among them, B d is the size of the buffer; R is the channel rate, its value can be set in the configuration file in advance; f is the frame rate; Δ T represents the feedback bit of the buffer; 1; L is the target buffer level; T bufleft indicates the amount of remaining data in the buffer; T bufleft is the amount of remaining data in the buffer; i indicates the serial number of the encoded frame; n is the serial number of the current encoded frame; is the number of bits allocated for the encoded image frame in the current group of pictures (GOP); is the actual number of bits consumed for encoded image frames in the current image group.
最终的帧层比特数根据如下的公式(9)计算得到。The final number of frame layer bits is calculated according to the following formula (9).
其中,TCurrPicfal表示当前帧最终被分配的比特数;TGOP是当前GOP的分配比特数;CodedGOP表示GOP中已编码的比特数;ωpic为当前帧的比特分配权重;为GOP中所有未编码图像的比特分配权重;R是信道速率,其值可预先在配置文件中设置,f是帧率;ΔT为缓冲区的反馈比特;γ为加权系数,其取值范围在0~1之间,根据不同配置文件选取其值。Among them, T CurrPicfal represents the number of bits that the current frame is finally allocated; T GOP is the number of allocated bits of the current GOP; Coded GOP represents the number of encoded bits in the GOP; ω pic is the bit allocation weight of the current frame; Assign weights to the bits of all uncoded images in the GOP; R is the channel rate, its value can be set in the configuration file in advance, f is the frame rate; Δ T is the feedback bit of the buffer; γ is the weighting coefficient, and its value range Between 0 and 1, select its value according to different configuration files.
实施例:Example:
一种基于综合因子和缓冲区状态的视频编码码率控制帧层比特分配方法,该方法在视频编码的码率控制过程中,针对不同视频序列的纹理特征,通过计算图像信息熵和最小变换域绝对误差之和,再结合R-λ模型码率控制算法中帧层固定权重,构建出基于综合因子的分配权重,并考虑视频编码的缓冲区充盈度,推导出当前帧最终被分配比特数的计算公式。本发明可以提高帧层比特分配的合理性,提升码率控制的精度,改善率失真性能。A video coding rate control frame layer bit allocation method based on comprehensive factors and buffer states. In the process of video coding rate control, the method aims at texture features of different video sequences by calculating image information entropy and minimum transform domain The sum of absolute errors, combined with the fixed weight of the frame layer in the R-λ model rate control algorithm, constructs the distribution weight based on the comprehensive factor, and considers the buffer fullness of video coding, and derives the final number of bits allocated for the current frame. calculation formula. The present invention can improve the rationality of frame layer bit allocation, improve the accuracy of code rate control, and improve rate-distortion performance.
以上这些实施例应理解为仅用于说明本发明而不用于限制本发明的保护范围。在阅读了本发明的记载的内容之后,技术人员可以对本发明作各种改动或修改,这些等效变化和修饰同样落入本发明权利要求所限定的范围。The above embodiments should be understood as only for illustrating the present invention but not for limiting the protection scope of the present invention. After reading the contents of the present invention, skilled persons can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711297946.9A CN108200431B (en) | 2017-12-08 | 2017-12-08 | Bit allocation method for video coding code rate control frame layer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711297946.9A CN108200431B (en) | 2017-12-08 | 2017-12-08 | Bit allocation method for video coding code rate control frame layer |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108200431A true CN108200431A (en) | 2018-06-22 |
CN108200431B CN108200431B (en) | 2021-11-16 |
Family
ID=62573741
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711297946.9A Active CN108200431B (en) | 2017-12-08 | 2017-12-08 | Bit allocation method for video coding code rate control frame layer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108200431B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110708548A (en) * | 2019-10-14 | 2020-01-17 | 福建天晴在线互动科技有限公司 | Method for bit allocation in panoramic video frame |
CN110876060A (en) * | 2018-08-31 | 2020-03-10 | 网宿科技股份有限公司 | A code rate adjustment method and device in a coding process |
WO2021083286A1 (en) * | 2019-10-31 | 2021-05-06 | Oppo广东移动通信有限公司 | Bit rate control method and device, and computer storage medium |
CN112954348A (en) * | 2021-02-20 | 2021-06-11 | 浙江商汤科技开发有限公司 | Video encoding method and apparatus, electronic device, and storage medium |
CN113286145A (en) * | 2021-04-26 | 2021-08-20 | 维沃移动通信有限公司 | Video coding method and device and electronic equipment |
CN113973205A (en) * | 2021-10-21 | 2022-01-25 | 重庆邮电大学 | Code rate control bit distribution method based on video content characteristics and storage medium |
CN116132679A (en) * | 2022-11-18 | 2023-05-16 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
CN117692645A (en) * | 2024-01-15 | 2024-03-12 | 中国科学技术大学 | Code rate control coding method, system, equipment and medium based on rate distortion model |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000505615A (en) * | 1996-02-26 | 2000-05-09 | サーノフ コーポレイション | Dynamic coding rate control in block-based video coding systems |
CN101895759A (en) * | 2010-07-28 | 2010-11-24 | 南京信息工程大学 | H.264 code rate control method |
CN106231305A (en) * | 2016-07-26 | 2016-12-14 | 中国科学院自动化研究所 | Full I-frame video bit rate control method based on gradient and control system |
-
2017
- 2017-12-08 CN CN201711297946.9A patent/CN108200431B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000505615A (en) * | 1996-02-26 | 2000-05-09 | サーノフ コーポレイション | Dynamic coding rate control in block-based video coding systems |
CN101895759A (en) * | 2010-07-28 | 2010-11-24 | 南京信息工程大学 | H.264 code rate control method |
CN106231305A (en) * | 2016-07-26 | 2016-12-14 | 中国科学院自动化研究所 | Full I-frame video bit rate control method based on gradient and control system |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110876060A (en) * | 2018-08-31 | 2020-03-10 | 网宿科技股份有限公司 | A code rate adjustment method and device in a coding process |
CN110876060B (en) * | 2018-08-31 | 2022-07-15 | 网宿科技股份有限公司 | A code rate adjustment method and device in a coding process |
CN110708548A (en) * | 2019-10-14 | 2020-01-17 | 福建天晴在线互动科技有限公司 | Method for bit allocation in panoramic video frame |
WO2021083286A1 (en) * | 2019-10-31 | 2021-05-06 | Oppo广东移动通信有限公司 | Bit rate control method and device, and computer storage medium |
CN112954348B (en) * | 2021-02-20 | 2024-04-02 | 浙江商汤科技开发有限公司 | Video encoding method and device, electronic equipment and storage medium |
CN112954348A (en) * | 2021-02-20 | 2021-06-11 | 浙江商汤科技开发有限公司 | Video encoding method and apparatus, electronic device, and storage medium |
CN113286145A (en) * | 2021-04-26 | 2021-08-20 | 维沃移动通信有限公司 | Video coding method and device and electronic equipment |
CN113286145B (en) * | 2021-04-26 | 2022-07-22 | 维沃移动通信有限公司 | Video coding method and device and electronic equipment |
WO2022228375A1 (en) * | 2021-04-26 | 2022-11-03 | 维沃移动通信有限公司 | Video coding method and apparatus, and electronic device |
CN113973205B (en) * | 2021-10-21 | 2024-11-22 | 北京新医汇众科技中心(有限合伙) | Bit rate control allocation method and storage medium based on video content characteristics |
CN113973205A (en) * | 2021-10-21 | 2022-01-25 | 重庆邮电大学 | Code rate control bit distribution method based on video content characteristics and storage medium |
CN116684609A (en) * | 2022-11-18 | 2023-09-01 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
CN116760987A (en) * | 2022-11-18 | 2023-09-15 | 杭州海康威视数字技术股份有限公司 | Image coding and decoding method, device and storage medium |
CN116132679A (en) * | 2022-11-18 | 2023-05-16 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
WO2024104382A1 (en) * | 2022-11-18 | 2024-05-23 | 杭州海康威视数字技术股份有限公司 | Image encoding method and apparatus, image decoding method and apparatus, and storage medium |
CN116760987B (en) * | 2022-11-18 | 2024-12-31 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
CN116132679B (en) * | 2022-11-18 | 2024-12-31 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
CN116684609B (en) * | 2022-11-18 | 2025-01-28 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
CN117692645A (en) * | 2024-01-15 | 2024-03-12 | 中国科学技术大学 | Code rate control coding method, system, equipment and medium based on rate distortion model |
CN117692645B (en) * | 2024-01-15 | 2025-07-15 | 中国科学技术大学 | Rate control encoding method, system, device and medium based on rate distortion model |
Also Published As
Publication number | Publication date |
---|---|
CN108200431B (en) | 2021-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108200431B (en) | Bit allocation method for video coding code rate control frame layer | |
WO2021244341A1 (en) | Picture coding method and apparatus, electronic device and computer readable storage medium | |
CN100512432C (en) | Video data transmission system | |
CN1151685C (en) | Appts. and method for optimizing rate control in coding system | |
US5473377A (en) | Method for quantizing intra-block DC transform coefficients using the human visual characteristics | |
US10616594B2 (en) | Picture encoding device and picture encoding method | |
CN108924554B (en) | A Rate Distortion Optimization Method for Panoramic Video Coding Based on Spherical Weighted Structural Similarity | |
US20100098162A1 (en) | System and Method for Bit-Allocation in Video Coding | |
CN1274446A (en) | Appts. and method for macroblock based rate control in coding system | |
CN108810530A (en) | A kind of AVC bit rate control methods based on human visual system | |
CN102761741A (en) | Video encoding code rate control system and method on basis of caches at encoding and decoding ends | |
CN104994387B (en) | A kind of bit rate control method of fused images feature | |
US20240040127A1 (en) | Video encoding method and apparatus and electronic device | |
CN112218084B (en) | High-efficiency video coding standard frame-level code rate control method facing surveillance video | |
JPH09200758A (en) | Image encoder | |
CN113973205B (en) | Bit rate control allocation method and storage medium based on video content characteristics | |
CN110087078B (en) | Image component block compressed sensing-oriented measurement end observation efficiency regulation and control method | |
CN108737826B (en) | Video coding method and device | |
Guo et al. | Convex optimization based bit allocation for light field compression under weighting and consistency constraints | |
CN110800298A (en) | Code rate allocation method, code rate control method, encoder, and recording medium | |
CN114339241B (en) | Video bit rate control method | |
KR100543608B1 (en) | Object based bit rate control method and apparatus | |
US11825088B2 (en) | Adaptively encoding video frames based on complexity | |
CN114827607A (en) | Improved big data video high-fidelity transmission coding regulation and control method | |
US8971393B2 (en) | Encoder |
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 | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250124 Address after: 518000 1104, Building A, Zhiyun Industrial Park, No. 13, Huaxing Road, Henglang Community, Longhua District, Shenzhen, Guangdong Province Patentee after: Shenzhen Hongyue Enterprise Management Consulting Co.,Ltd. Country or region after: China Address before: 400065 Chongwen Road, Nanshan Street, Nanan District, Chongqing Patentee before: CHONGQING University OF POSTS AND TELECOMMUNICATIONS Country or region before: China |
|
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250331 Address after: Room 2403, 24th Floor, Avic Building, No.10 East Third Ring Middle Road, Chaoyang District, Beijing 100020 Patentee after: Beijing Huarui Chengye Management Consulting Co.,Ltd. Country or region after: China Address before: 518000 1104, Building A, Zhiyun Industrial Park, No. 13, Huaxing Road, Henglang Community, Longhua District, Shenzhen, Guangdong Province Patentee before: Shenzhen Hongyue Enterprise Management Consulting Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |