[go: up one dir, main page]

CN104853191B - A Fast Encoding Method for HEVC - Google Patents

A Fast Encoding Method for HEVC Download PDF

Info

Publication number
CN104853191B
CN104853191B CN201510225448.8A CN201510225448A CN104853191B CN 104853191 B CN104853191 B CN 104853191B CN 201510225448 A CN201510225448 A CN 201510225448A CN 104853191 B CN104853191 B CN 104853191B
Authority
CN
China
Prior art keywords
coding unit
maximum coding
current
unit
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510225448.8A
Other languages
Chinese (zh)
Other versions
CN104853191A (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.)
Shenzhen Weier Vision Technology Co ltd
Original Assignee
Ningbo 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 Ningbo University filed Critical Ningbo University
Priority to CN201510225448.8A priority Critical patent/CN104853191B/en
Publication of CN104853191A publication Critical patent/CN104853191A/en
Application granted granted Critical
Publication of CN104853191B publication Critical patent/CN104853191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明公开了一种HEVC的快速编码方法,其充分利用了编码过程中的最大编码单元与其所在的帧的前向参考帧中坐标位置相同的最大编码单元的时域相似度、与其左边相邻最大编码单元的空域相似度、与其上边相邻最大编码单元的空域相似度,来计算P帧或B帧中的最大编码单元的深度预测值,然后利用最大编码单元的深度预测值与深度遍历区间的一一对应关系确定最大编码单元的深度遍历区间,在深度遍历区间内对最大编码单元以及其内的各个编码单元进行编码,在编码过程中对P帧或B帧中满足条件的最大编码单元及满足条件的各个编码单元进行快速预测模式选择,减少了不必要的深度和预测模式遍历,从而在保证视频质量的前提下,降低了视频编码的计算复杂度。

The invention discloses a HEVC fast encoding method, which makes full use of the time-domain similarity of the largest coding unit in the encoding process and the largest coding unit with the same coordinate position in the forward reference frame of the frame where it is located, and the adjacent left side of the largest coding unit The spatial similarity of the largest coding unit and the spatial similarity of the adjacent largest coding unit above it are used to calculate the depth prediction value of the largest coding unit in the P frame or B frame, and then use the depth prediction value and depth of the largest coding unit to traverse the interval The one-to-one correspondence relationship determines the depth traversal interval of the largest coding unit, encodes the largest coding unit and each coding unit in the depth traversal interval, and encodes the largest coding unit that meets the conditions in the P frame or B frame during the encoding process And each coding unit that meets the conditions performs fast prediction mode selection, which reduces unnecessary depth and prediction mode traversal, thereby reducing the computational complexity of video coding on the premise of ensuring video quality.

Description

一种HEVC的快速编码方法A Fast Encoding Method for HEVC

技术领域technical field

本发明涉及一种视频编码技术,尤其是涉及一种HEVC的快速编码方法。The present invention relates to a video coding technology, in particular to a HEVC fast coding method.

背景技术Background technique

随着多媒体与网络技术的飞速发展,MPEG-2、MPEG-4和H.264/AVC等视频编码标准已难以满足用户对超高清视频的高效压缩与传输的要求。国际标准组织ITU-T的VCEG和ISO/IEC的MPEG联合成立了JCT-VC(Joint Collaborative Team on Video Coding),研究并制定了高性能视频编码(High Efficiency Video Coding,HEVC)标准。与H.264/AVC相比,HEVC已基本实现编码效率提高一倍的目标;但由于HEVC在编码结构上采用了尺寸更大的编码块和四叉树编码结构等技术,因此导致了编码复杂度显著增加。With the rapid development of multimedia and network technology, video coding standards such as MPEG-2, MPEG-4, and H.264/AVC have been difficult to meet users' requirements for efficient compression and transmission of ultra-high-definition video. VCEG of the International Standard Organization ITU-T and MPEG of ISO/IEC jointly established JCT-VC (Joint Collaborative Team on Video Coding) to research and formulate the High Efficiency Video Coding (HEVC) standard. Compared with H.264/AVC, HEVC has basically achieved the goal of doubling the coding efficiency; however, because HEVC uses technologies such as larger coding blocks and quadtree coding structures in the coding structure, it leads to complex coding. significantly increased.

HEVC测试模型(HEVC Test Model,HM)中一个最大编码单元(Largest CodingUnit,LCU)的四叉树结构划分需要采用递归的方式对深度值进行0到3的全遍历。图1给出了一个LCU最终分割形式的确定过程,其需要计算1+4+4×4+4×4×4=85次率失真(Rate-distortion Optimization,RDO)代价,而且每个编码单元(Coding Unit,CU)还要进行帧内、帧间各种预测单元(Prediction Unit,PU)预测模式的遍历。显然,整个LCU的裁剪过程使得编码端的计算复杂度非常之大。Hou等人利用率失真代价确定的阈值来提前终止CU的分割,该方法因未能终止大尺寸CU的预测模式的选择过程,而导致其降低复杂度的能力非常有限。Shen等人通过加权时空域相邻的LCU的深度值预测当前LCU的深度范围(DepthRange,DR),可减少LCU的遍历深度个数,但其未考虑视频序列之间的区别,其采用的固定权重并不适用所有视频序列,其预测的深度范围仍需进一步的改善。Xiong等人利用光流法计算金字塔运动发散(Pyramid Motion Divergence,PMD)的特征值决定CU的分割情况,在一定程度上降低了复杂度,但其未仔细考虑运动矢量间的相关性,导致其编码率失真性能并不佳。The quadtree structure division of a Largest Coding Unit (LCU) in the HEVC Test Model (HEVC Test Model, HM) needs to use a recursive method to perform a full traversal of the depth value from 0 to 3. Figure 1 shows the process of determining the final partition form of an LCU, which needs to calculate 1+4+4×4+4×4×4=85 Rate-distortion Optimization (RDO) costs, and each coding unit (Coding Unit, CU) also performs intra-frame and inter-frame traversal of various prediction unit (Prediction Unit, PU) prediction modes. Obviously, the clipping process of the entire LCU makes the computational complexity of the encoding end very large. Hou et al. used the threshold determined by the rate-distortion cost to terminate the partitioning of the CU early. This method failed to terminate the selection process of the prediction mode of the large-sized CU, so its ability to reduce complexity was very limited. Shen et al. predict the depth range (DepthRange, DR) of the current LCU by weighting the depth values of adjacent LCUs in the space-time domain, which can reduce the number of traversal depths of the LCU, but it does not consider the difference between video sequences. It uses a fixed Weights are not applicable to all video sequences, and the depth range of its prediction still needs further improvement. Xiong et al. used the optical flow method to calculate the eigenvalues of Pyramid Motion Divergence (PMD) to determine the segmentation of the CU, which reduced the complexity to a certain extent, but did not carefully consider the correlation between motion vectors, resulting in its The rate-distortion performance is not good.

发明内容Contents of the invention

本发明所要解决的技术问题是提供一种HEVC的快速编码方法,其在保证视频质量的前提下,能够有效地降低编码复杂度。The technical problem to be solved by the present invention is to provide a fast encoding method of HEVC, which can effectively reduce encoding complexity under the premise of ensuring video quality.

本发明解决上述技术问题所采用的技术方案为:一种HEVC的快速编码方法,其特征在于包括以下步骤:The technical solution adopted by the present invention to solve the above-mentioned technical problems is: a fast encoding method of HEVC, which is characterized in that it comprises the following steps:

①将高清视频中当前待处理的帧定义为当前帧;① Define the current frame to be processed in the high-definition video as the current frame;

②将当前帧中当前待编码的最大编码单元定义为当前最大编码单元;②Define the largest coding unit currently to be encoded in the current frame as the current largest coding unit;

③根据当前帧的帧类型及当前最大编码单元在当前帧中的位置,确定当前最大编码单元的所有预测用的最大编码单元;然后将由当前最大编码单元的所有预测用的最大编码单元构成的集合定义为当前最大编码单元的预测集合,并记为Ω,其中,Ω为空集或Ω中所包含的最大编码单元为L、T和COL中的至少一个,L表示当前最大编码单元的左边相邻最大编码单元,T表示当前最大编码单元的上边相邻最大编码单元,COL表示当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元;③ According to the frame type of the current frame and the position of the current largest coding unit in the current frame, determine the largest coding unit for all predictions of the current largest coding unit; Defined as the prediction set of the current largest coding unit, and recorded as Ω, where Ω is an empty set or the largest coding unit contained in Ω is at least one of L, T, and COL, and L represents the left phase of the current largest coding unit Adjacent to the largest coding unit, T indicates the upper adjacent largest coding unit of the current largest coding unit, and COL indicates the largest coding unit in the forward reference frame of the current frame with the same coordinate position as the current largest coding unit;

④令Dpred表示当前最大编码单元的深度预测值,然后确立Dpred的值与当前最大编码单元的深度遍历区间的一一对应关系,其中,Dpred的值不存在或Dpred的值为实数,且0≤Dpred≤3;④ Let D pred represent the depth prediction value of the current largest coding unit, and then establish a one-to-one correspondence between the value of D pred and the depth traversal interval of the current largest coding unit, wherein the value of D pred does not exist or the value of D pred is a real number , and 0≤D pred ≤3;

⑤如果Ω为空集或Ω中所包含的最大编码单元为L、T和COL中的一个或Ω中所包含的最大编码单元为L、T和COL中的两个,则确定Dpred的值不存在,然后执行步骤⑦;如果Ω中所包含的最大编码单元为L、T和COL,则确定Dpred的值为实数,且0≤Dpred≤3,然后执行步骤⑥;⑤ If Ω is an empty set or the largest coding unit contained in Ω is one of L, T and COL or the largest coding unit contained in Ω is two of L, T and COL, then determine the value of D pred Does not exist, then perform step ⑦; if the largest coding unit contained in Ω is L, T and COL, then determine that the value of D pred is a real number, and 0≤D pred ≤3, then perform step ⑥;

⑥通过获取当前最大编码单元与T的空域相似度TAS、当前最大编码单元与L的空域相似度LAS、当前最大编码单元与COL的时域相似度TS,计算Dpred的值,其中,1≤m≤3,1≤i≤256,且m和i均为整数,ωm表示Ω中的第m个最大编码单元所占的权重,当m=1时ωm=LAS,当m=2时ωm=TAS,当m=3时ωm=TS,表示Ω中的第m个最大编码单元中的第i个尺寸大小为4×4的基本存储单元的深度值;⑥ Calculate the value of D pred by obtaining the spatial similarity TAS between the current largest coding unit and T, the spatial similarity LAS between the current largest coding unit and L, and the temporal similarity TS between the current largest coding unit and COL, Among them, 1≤m≤3, 1≤i≤256, and both m and i are integers, ω m represents the weight occupied by the mth largest coding unit in Ω, when m=1, ω m =LAS, when ω m =TAS when m=2, ω m =TS when m=3, Indicates the depth value of the i-th basic storage unit with a size of 4×4 in the m-th largest coding unit in Ω;

⑦根据Dpred的值与当前最大编码单元的深度遍历区间的一一对应关系,确定当前最大编码单元的深度遍历区间;然后根据当前最大编码单元的深度遍历区间对当前最大编码单元以及当前最大编码单元内的各个编码单元进行编码,在编码过程中,若当前最大编码单元所在的帧为高清视频中的P帧或B帧,则当当前最大编码单元或当前最大编码单元内的每个编码单元的平均时空域人眼恰可察觉失真值小于设定的低阈值T1或大于设定的高阈值T2,则对当前最大编码单元或当前最大编码单元内的每个编码单元进行快速预测模式的选择,对当前最大编码单元或当前最大编码单元内的每个编码单元分别用skip、merge、inter2N×2N和intra2N×2N预测模式进行遍历编码,选取率失真代价值最小的预测模式作为最优预测模式;⑦ Determine the depth traversal interval of the current largest coding unit according to the one-to-one correspondence between the value of D pred and the depth traversal interval of the current largest coding unit; Each coding unit in the unit is encoded. During the encoding process, if the frame where the current largest coding unit is located is a P frame or a B frame in high-definition video, then when the current largest coding unit or each coding unit in the current largest coding unit If the average spatio-temporal distortion value detectable by the human eye is less than the set low threshold T 1 or greater than the set high threshold T 2 , the fast prediction mode is performed on the current largest coding unit or each coding unit within the current largest coding unit The selection of the current largest coding unit or each coding unit in the current largest coding unit is traversed by skip, merge, inter2N×2N and intra2N×2N prediction modes, and the prediction mode with the smallest rate-distortion cost is selected as the optimal predictive model;

⑧将当前帧中下一个待编码的最大编码单元作为当前最大编码单元,然后返回步骤③继续执行,直至当前帧中的所有最大编码单元均编码完毕;⑧Using the next largest coding unit to be encoded in the current frame as the current largest coding unit, and then returning to step ③ to continue until all the largest coding units in the current frame are encoded;

⑨将高清视频中下一帧待处理的帧作为当前帧,然后返回步骤②继续执行,直至高清视频中的所有帧均处理完毕,至此完成了高清视频的快速编码。⑨Take the next frame to be processed in the high-definition video as the current frame, and then return to step ② to continue until all the frames in the high-definition video are processed, and the fast encoding of high-definition video is completed.

所述的步骤③中当前最大编码单元的所有预测用的最大编码单元的确定过程为:The process of determining the LCU for all predictions of the current LCU in step ③ is as follows:

如果当前帧为高清视频中的I帧,则当当前最大编码单元为当前帧中的第1个最大编码单元时,确定当前最大编码单元没有预测用的最大编码单元;当当前最大编码单元为当前帧的第1列最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的上边相邻最大编码单元T为当前最大编码单元的预测用的最大编码单元;当当前最大编码单元为当前帧的第1行最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L为当前最大编码单元的预测用的最大编码单元;当当前最大编码单元为当前帧中除第1列最大编码单元和第1行最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L和上边相邻最大编码单元T均为当前最大编码单元的预测用的最大编码单元;If the current frame is an I frame in a high-definition video, when the current largest coding unit is the first largest coding unit in the current frame, it is determined that the current largest coding unit does not have a prediction largest coding unit; when the current largest coding unit is the current largest coding unit When there are other largest coding units in the largest coding unit in the first column of the frame except the first largest coding unit, determine the upper adjacent largest coding unit T of the current largest coding unit as the largest coding unit for prediction of the current largest coding unit; When the current largest coding unit is the remaining largest coding unit except the first largest coding unit in the first row of the largest coding unit of the current frame, determine that the left adjacent largest coding unit L of the current largest coding unit is the current largest coding unit The largest coding unit for prediction; when the current largest coding unit is the remaining largest coding unit in the current frame except the largest coding unit in the first column and the largest coding unit in the first row, determine the largest coding unit adjacent to the left of the current largest coding unit L and the upper adjacent largest coding unit T are the largest coding units used for prediction of the current largest coding unit;

如果当前帧为高清视频中的P帧或B帧,则当当前最大编码单元为当前帧中的第1个最大编码单元时,确定当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL为当前最大编码单元的预测用的最大编码单元;当当前最大编码单元为当前帧的第1列最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的上边相邻最大编码单元T和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL均为当前最大编码单元的预测用的最大编码单元;当当前最大编码单元为当前帧的第1行最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL均为当前最大编码单元的预测用的最大编码单元;当当前最大编码单元为当前帧中除第1列最大编码单元和第1行最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L和上边相邻最大编码单元T及当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL均为当前最大编码单元的预测用的最大编码单元。If the current frame is a P frame or B frame in high-definition video, when the current maximum coding unit is the first maximum coding unit in the current frame, determine the coordinate position of the current frame's forward reference frame and the current maximum coding unit The same largest coding unit COL is the largest coding unit used for prediction of the current largest coding unit; when the current largest coding unit is the remaining largest coding unit except the first largest coding unit in the first column of the largest coding unit of the current frame, Determine that the upper adjacent largest coding unit T of the current largest coding unit and the largest coding unit COL at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame are the largest coding units for prediction of the current largest coding unit; When the current largest coding unit is the remaining largest coding unit except the first largest coding unit in the first row of the largest coding unit of the current frame, determine the left adjacent largest coding unit L of the current largest coding unit and the forward direction of the current frame The largest coding unit COL at the same coordinate position as the current largest coding unit in the reference frame is the largest coding unit used for prediction of the current largest coding unit; when the current largest coding unit is the largest coding unit and the first When determining the remaining LCUs other than the LCU, determine the coordinates of the LCU L adjacent to the current LCU, the LCU T adjacent to the upper side, and the current LCU in the forward reference frame of the current frame. The same largest coding unit COL is the largest coding unit used for prediction of the current largest coding unit.

所述的步骤④中Dpred的值与当前最大编码单元的深度遍历区间的一一对应关系为:当Dpred=0时,当前最大编码单元的深度遍历区间为[0,0];当0<Dpred≤0.5时,当前最大编码单元的深度遍历区间为[0,1];当0.5<Dpred≤1.5时,当前最大编码单元的深度遍历区间为[0,2];当1.5<Dpred≤2.5时,当前最大编码单元的深度遍历区间为[1,3];当2.5<Dpred≤3时,当前最大编码单元的深度遍历区间为[2,3];当Dpred的值不存在时,当前最大编码单元的深度遍历区间为[0,3]。The one-to-one correspondence between the value of D pred in step ④ and the depth traversal interval of the current largest coding unit is: when D pred = 0, the depth traversal interval of the current largest coding unit is [0,0]; when 0 <D pred ≤0.5, the depth traversal interval of the current largest coding unit is [0,1]; when 0.5<D pred ≤1.5, the depth traversal interval of the current largest coding unit is [0,2]; when 1.5<D When pred ≤ 2.5, the depth traversal interval of the current largest coding unit is [1,3]; when 2.5<D pred ≤3, the depth traversal interval of the current largest coding unit is [2,3]; when the value of D pred is not When it exists, the depth traversal interval of the current LCU is [0,3].

所述的步骤⑥的具体过程为:The concrete process of described step 6. is:

⑥-1、计算当前最大编码单元的左边相邻最大编码单元L和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元的左边相邻最大编码单元L-COL之间的平均深度差,记为ADD1,并计算当前最大编码单元的上边相邻最大编码单元T和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元的上边相邻最大编码单元T-COL之间的平均深度差,记为ADD2,然后计算ADD1与ADD2的平均值,记为ADD,ADD=(ADD1+ADD2)/2;其中,1≤i≤256,且为整数,表示L中的第i个尺寸大小为4×4的基本存储单元的深度值,表示L-COL中的第i个尺寸大小为4×4的基本存储单元的深度值,表示T中的第i个尺寸大小为4×4的基本存储单元的深度值,表示T-COL中的第i个尺寸大小为4×4的基本存储单元的深度值,的取值范围均为[0,3],且为整数,符号“||”为取绝对值符号;⑥-1. Calculate the difference between the left adjacent largest coding unit L of the current largest coding unit and the left adjacent largest coding unit L-COL of the largest coding unit at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame The average depth difference between , denoted as ADD1, And calculate the average between the upper adjacent largest coding unit T of the current largest coding unit and the upper adjacent largest coding unit T-COL of the largest coding unit at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame Depth difference, denoted as ADD2, Then calculate the average value of ADD1 and ADD2, denoted as ADD, ADD=(ADD1+ADD2)/2; wherein, 1≤i≤256, and is an integer, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in L, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in L-COL, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in T, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in T-COL, The value range of is [0,3], and it is an integer, and the symbol "||" is the absolute value symbol;

⑥-2、计算当前最大编码单元与当前最大编码单元的上边相邻最大编码单元T的空域相似度,记为TAS,TAS=0.05×ADD+0.25;并计算当前最大编码单元与当前最大编码单元的左边相邻最大编码单元L的空域相似度,记为LAS,LAS=0.05×ADD+0.25;同时,计算当前最大编码单元与当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL的时域相似度,记为TS,TS=-0.1×ADD+0.5;⑥-2. Calculate the spatial similarity between the current largest coding unit and the upper adjacent largest coding unit T of the current largest coding unit, denoted as TAS, TAS=0.05×ADD+0.25; and calculate the current largest coding unit and the current largest coding unit The spatial similarity of the adjacent largest coding unit L on the left side of , denoted as LAS, LAS=0.05×ADD+0.25; at the same time, calculate the coordinate position of the current largest coding unit and the forward reference frame of the current frame to be the same as the current largest coding unit The time-domain similarity of the largest coding unit COL of , denoted as TS, TS=-0.1×ADD+0.5;

⑥-3、计算Dpred的值,其中,1≤m≤3,且为整数,ωm表示Ω中的第m个最大编码单元所占的权重,当m=1时ωm=LAS,当m=2时ωm=TAS,当m=3时ωm=TS,表示Ω中的第m个最大编码单元中的第i个尺寸大小为4×4的基本存储单元的深度值。⑥-3. Calculate the value of D pred , Wherein, 1≤m≤3, and is an integer, ω m represents the weight occupied by the mth largest coding unit in Ω, when m=1, ω m =LAS, when m=2, ω m =TAS, when When m=3, ω m =TS, Indicates the depth value of the i-th basic storage unit with a size of 4×4 in the m-th LCU in Ω.

所述的步骤⑦中根据当前最大编码单元的深度遍历区间对当前最大编码单元以及当前最大编码单元内的各个编码单元进行编码的具体过程为:The specific process of encoding the current largest coding unit and each coding unit in the current largest coding unit according to the depth traversal interval of the current largest coding unit in step ⑦ is as follows:

⑦-1、将当前最大编码单元的深度遍历区间内当前待处理的编码单元定义为当前编码单元,将当前编码单元所在的层定义为当前层;⑦-1. Define the current coding unit to be processed in the depth traversal interval of the current largest coding unit as the current coding unit, and define the layer where the current coding unit is located as the current layer;

⑦-2、用JNDts表示当前编码单元的平均时空域人眼恰可察觉失真值,如果当前帧为高清视频中的I帧,则确定JNDts的值不存在,然后执行步骤⑦-3;如果当前帧为高清视频中的P帧或B帧,则计算JNDts的值,然后执行步骤⑦-3,其中,(x,y)表示当前编码单元中的像素点的坐标位置,0≤x≤K-1,0≤y≤G-1,且都为整数,K表示当前编码单元中一行像素点的总个数,G表示当前编码单元中一列像素点的总个数,JND(x,y)表示当前编码单元中坐标位置为(x,y)的像素点的时空域人眼恰可察觉失真值;⑦-2. Use JND ts to represent the average spatiotemporal distortion value of the current coding unit that can be detected by human eyes. If the current frame is an I frame in a high-definition video, determine that the value of JND ts does not exist, and then perform step ⑦-3; If the current frame is a P frame or B frame in high-definition video, calculate the value of JND ts , Then execute step ⑦-3, where (x, y) represents the coordinate position of the pixel in the current coding unit, 0≤x≤K-1, 0≤y≤G-1, and they are all integers, and K represents the current The total number of pixels in a row in the coding unit, G represents the total number of pixels in a column in the current coding unit, JND(x, y) represents the space-time domain of the pixel at the coordinate position (x, y) in the current coding unit Distortion values are just perceivable by the human eye;

⑦-3、当JNDts的值不存在时,对当前编码单元分别用intra2N×2N和intraN×N预测模式进行编码,选取率失真代价值最小的预测模式作为当前编码单元的最优预测模式,然后执行步骤⑦-4;当JNDts的值存在时,判断JNDts的值是否小于设定的低阈值T1或大于设定的高阈值T2,如果是,则判定当前编码单元进行快速预测模式的选择,对当前编码单元分别用skip、merge、inter2N×2N和intra2N×2N预测模式进行遍历编码,选取率失真代价值最小的预测模式作为当前编码单元的最优预测模式,然后执行步骤⑦-4;否则,判定当前编码单元不进行快速预测模式的选择,对当前编码单元分别用skip、merge、inter2N×2N、inter2N×N、interN×2N、AMP、intra2N×2N和intraN×N预测模式进行全遍历编码,选取率失真代价值最小的预测模式作为当前编码单元的最优预测模式,然后执行步骤⑦-4;其中,inter2N×2N、inter2N×N、interN×2N、intra2N×2N和intraN×N中的N的值为当前编码单元中一行像素点或一列像素点的总个数的一半;⑦-3. When the value of JND ts does not exist, encode the current coding unit with intra2N×2N and intraN×N prediction modes respectively, and select the prediction mode with the smallest rate-distortion cost as the optimal prediction mode of the current coding unit, Then execute step ⑦-4; when the value of JND ts exists, judge whether the value of JND ts is less than the set low threshold T 1 or greater than the set high threshold T 2 , if so, determine whether the current coding unit performs fast prediction Mode selection: use skip, merge, inter2N×2N and intra2N×2N prediction modes for the current coding unit to perform traversal coding, select the prediction mode with the smallest rate-distortion cost as the optimal prediction mode for the current coding unit, and then perform step ⑦ -4; otherwise, it is determined that the current coding unit does not select the fast prediction mode, and the current coding unit uses skip, merge, inter2N×2N, inter2N×N, interN×2N, AMP, intra2N×2N and intraN×N prediction modes respectively Perform full traversal coding, select the prediction mode with the smallest rate-distortion cost as the optimal prediction mode of the current coding unit, and then perform step ⑦-4; among them, inter2N×2N, inter2N×N, interN×2N, intra2N×2N and intraN The value of N in ×N is half of the total number of pixels in a row or a column of pixels in the current coding unit;

⑦-4、判断当前编码单元的深度值是否小于当前最大编码单元的深度遍历区间的最大值,如果是,则将当前编码单元进一步分割为四个尺寸大小相同的下一层编码单元,然后将该下一层编码单元中当前待处理的编码单元作为当前编码单元,将当前编码单元所在的层作为当前层,再返回步骤⑦-2继续执行;否则,确定当前编码单元编码过程结束,然后执行步骤⑦-5;⑦-4. Determine whether the depth value of the current coding unit is less than the maximum value of the depth traversal interval of the current largest coding unit, and if so, further divide the current coding unit into four next-layer coding units of the same size, and then divide the The coding unit currently to be processed in the coding unit of the next layer is taken as the current coding unit, and the layer where the current coding unit is located is taken as the current layer, and then return to step ⑦-2 to continue execution; otherwise, determine that the coding process of the current coding unit is over, and then execute Step ⑦-5;

⑦-5、判断当前最大编码单元的深度遍历区间内的所有编码单元是否均处理完毕,如果是,则确定当前最大编码单元编码过程结束,然后执行步骤⑧;否则,判断当前层中的四个编码单元是否均处理完毕,如果当前层中的四个编码单元均处理完毕,则将当前层的上一层编码单元中下一个待处理的编码单元作为当前编码单元,并将当前编码单元所在的层作为当前层,然后返回步骤⑦-2继续执行,如果当前层中的四个编码单元未处理完毕,则将当前层中下一个待处理的编码单元作为当前编码单元,并将当前编码单元所在的层作为当前层,然后返回步骤⑦-2继续执行。⑦-5. Determine whether all the coding units in the depth traversal interval of the current largest coding unit have been processed. If so, determine that the encoding process of the current largest coding unit is completed, and then perform step ⑧; otherwise, determine whether the four coding units in the current layer Whether all the coding units have been processed. If all the four coding units in the current layer have been processed, the next coding unit to be processed in the coding units of the upper layer of the current layer is used as the current coding unit, and the current coding unit is located Layer as the current layer, and then return to step ⑦-2 to continue execution. If the four coding units in the current layer have not been processed, take the next coding unit to be processed in the current layer as the current coding unit, and set the current coding unit where layer as the current layer, and then return to step ⑦-2 to continue.

所述的步骤⑦-3中取T1=3.5,取T2=10。In the step ⑦-3, T 1 =3.5 and T 2 =10.

与现有技术相比,本发明的优点在于:Compared with the prior art, the present invention has the advantages of:

1)本发明方法充分利用了高清视频编码过程中的最大编码单元和该最大编码单元所在的帧的前向参考帧中坐标位置相同的最大编码单元的时域相似度以及最大编码单元与该最大编码单元的左边相邻最大编码单元的空域相似度、最大编码单元与该最大编码单元的上边相邻最大编码单元的空域相似度,来计算高清视频中的P帧或B帧中的最大编码单元的深度预测值,然后利用最大编码单元的深度预测值与深度遍历区间的一一对应关系确定最大编码单元的深度遍历区间,在深度遍历区间内对最大编码单元以及最大编码单元内的各个编码单元进行编码,在编码过程中对P帧或B帧中满足条件的最大编码单元及最大编码单元内满足条件的各个编码单元进行快速预测模式选择,有效地减少了分割过程中的不必要的深度遍历以及预测过程中的不必要的预测模式遍历,从而在保证视频质量的前提下,降低了视频编码的计算复杂度。1) The method of the present invention makes full use of the time-domain similarity between the LCU and the LCU with the same coordinate position in the forward reference frame of the frame where the LCU is located in the high-definition video coding process and the LCU and the LCU. The spatial similarity of the left adjacent largest coding unit of the coding unit, the spatial similarity of the largest coding unit and the upper adjacent largest coding unit of the largest coding unit, to calculate the largest coding unit in the P frame or B frame in the high-definition video Then use the one-to-one correspondence between the depth prediction value of the largest coding unit and the depth traversal interval to determine the depth traversal interval of the largest coding unit, and in the depth traversal interval, the largest coding unit and each coding unit in the largest coding unit Encoding, during the encoding process, fast prediction mode selection is performed on the maximum coding unit that meets the conditions in the P frame or B frame and each coding unit that meets the conditions in the maximum coding unit, effectively reducing unnecessary depth traversal during the segmentation process And unnecessary prediction mode traversal in the prediction process, thereby reducing the computational complexity of video coding under the premise of ensuring video quality.

2)本发明方法在深度遍历区间范围内进行遍历编码的过程中,利用编码单元的平均时空域人眼恰可察觉失真值指导预测模式的快速选择,减少了不必要的预测模式遍历,从而降低了视频编码的计算复杂度。2) In the process of traversal encoding within the depth traversal interval, the method of the present invention utilizes the average spatio-temporal domain distortion value of the encoding unit to guide the rapid selection of the prediction mode, thereby reducing unnecessary traversal of the prediction mode, thereby reducing the the computational complexity of video coding.

附图说明Description of drawings

图1为HEVC测试模型HM中一个最大编码单元的预测和分割过程示意图;Figure 1 is a schematic diagram of the prediction and segmentation process of a LCU in the HEVC test model HM;

图2为本发明方法的总体实现框图;Fig. 2 is the overall realization block diagram of the inventive method;

图3为一个最大编码单元C和该最大编码单元C的左边相邻最大编码单元L、该最大编码单元C的上边相邻最大编码单元T、该最大编码单元C所在的帧的前向参考帧中与该最大编码单元C的坐标位置相同的最大编码单元COL的位置关系;Figure 3 is a maximum coding unit C and the left adjacent maximum coding unit L of the maximum coding unit C, the upper adjacent maximum coding unit T of the maximum coding unit C, and the forward reference frame of the frame where the maximum coding unit C is located The positional relationship of the largest coding unit COL that is the same as the coordinate position of the largest coding unit C;

图4a为BasketballDrive(1920×1080)序列在QP=32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图;Fig. 4a is a schematic diagram of the statistical relationship between the average spatiotemporal distortion value of the coding unit just perceivable to the human eye and the best prediction mode of the coding unit when QP=32 and the number of coding frames is 50 for the BasketballDrive (1920×1080) sequence;

图4b为BlowingBubbles(416×240)序列在QP=32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图;Figure 4b is a schematic diagram of the statistical relationship between the average spatio-temporal distortion value of the coding unit just perceivable by human eyes and the best prediction mode of the coding unit when the sequence of BlowingBubbles (416×240) has QP=32 and the number of coding frames is 50 frames;

图4c为Traffic(2560×1600)序列在QP=32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图;Figure 4c is a schematic diagram of the statistical relationship between the average spatio-temporal distortion value of the coding unit just perceivable by human eyes and the best prediction mode of the coding unit when the Traffic (2560×1600) sequence has QP=32 and the number of coding frames is 50 frames;

图4d为RaceHorsesC(832×480)序列在QP=32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图;Figure 4d is a schematic diagram of the statistical relationship between the average spatio-temporal distortion value of the coding unit just perceivable by human eyes and the best prediction mode of the coding unit when QP=32 and the number of coding frames is 50 for the RaceHorsesC (832×480) sequence;

图5为利用本发明方法分别在低延时编码结构和随机访问编码结构下相较于利用HM9.0原始编码方法对表1所列的测试序列进行编码100帧的时间节约百分比情况图;Fig. 5 is compared with utilizing the HM9.0 original coding method to encode the time saving percentage of 100 frames of the test sequence listed in Table 1 under the low-delay coding structure and the random access coding structure using the method of the present invention;

图6a给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对PeopleOnStreet测试序列(2560×1600)进行编码100帧的率失真性能曲线对比图;Figure 6a shows a comparison of the rate-distortion performance curves of encoding 100 frames of the PeopleOnStreet test sequence (2560×1600) using the method of the present invention and the original encoding method of HM9.0 under the low-delay encoding structure;

图6b给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对Kimono测试序列(1920×1080)进行编码100帧的率失真性能曲线对比图;Figure 6b shows a comparison of rate-distortion performance curves for encoding Kimono test sequences (1920×1080) for 100 frames using the method of the present invention and using the HM9.0 original encoding method under the low-delay encoding structure;

图6c给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对PartyScene测试序列(832×480)进行编码100帧的率失真性能曲线对比图;Figure 6c shows a comparison of rate-distortion performance curves for encoding 100 frames of the PartyScene test sequence (832×480) using the method of the present invention and the original encoding method of HM9.0 under the low-delay encoding structure;

图6d给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对BlowingBubbles测试序列(416×240)进行编码100帧的率失真性能曲线对比图;Figure 6d shows a comparison of the rate-distortion performance curves of encoding 100 frames of the BlowingBubbles test sequence (416×240) using the method of the present invention and the original encoding method of HM9.0 under the low-delay encoding structure;

图7a为利用HM9.0原始编码方法在低延时编码结构下在量化参数QP=32的条件下对Johnny测试序列中的第6帧(1280×720)进行编码后的四叉树分割结果示意图;Figure 7a is a schematic diagram of the quadtree segmentation results after encoding the sixth frame (1280×720) in the Johnny test sequence under the low-latency encoding structure and the quantization parameter QP=32 using the HM9.0 original encoding method ;

图7b为利用本发明方法在低延时编码结构下在量化参数QP=32的条件下对Johnny测试序列中的第6帧(1280×720)进行编码后的四叉树分割结果示意图。Fig. 7b is a schematic diagram of the quadtree segmentation result after encoding the sixth frame (1280×720) in the Johnny test sequence under the condition of the quantization parameter QP=32 under the low-delay encoding structure by the method of the present invention.

具体实施方式detailed description

以下结合附图实施例对本发明作进一步详细描述。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.

本发明提出的一种HEVC的快速编码方法,其总体实现框图如图2所示,其包括以下步骤:A kind of fast encoding method of HEVC proposed by the present invention, its overall realization block diagram is as shown in Figure 2, and it comprises the following steps:

①将高清视频中当前待处理的帧定义为当前帧。① Define the current frame to be processed in the high-definition video as the current frame.

高清视频编码中有I帧、P帧和B帧,其中,I帧属于视频编码的关键帧,属于I帧图像组,不利用时域信息,采用帧内编码;P帧采用前向参考的方式进行帧内和帧间编码,属于非I帧图像组;B帧采用前向和后向双向参考的方式进行帧内和帧间编码,也属于非I帧图像组。There are I frame, P frame and B frame in high-definition video coding. Among them, I frame belongs to the key frame of video coding and belongs to the I frame image group. It does not use time domain information and adopts intra frame coding; P frame adopts the way of forward reference Intra-frame and inter-frame encoding is performed, which belongs to the non-I-frame image group; B-frame uses forward and backward bidirectional reference methods for intra-frame and inter-frame encoding, and also belongs to the non-I-frame image group.

②将当前帧中当前待编码的最大编码单元定义为当前最大编码单元。② Define the current largest coding unit to be encoded in the current frame as the current largest coding unit.

HEVC测试模型HM中采用从小尺寸编码单元到大尺寸编码单元的递归的方式进行编码,编码单元的尺寸大小有8×8、16×16、32×32和64×64。其中,64×64的编码单元称为编码过程中的最大编码单元。The HEVC test model HM adopts a recursive coding method from small-size coding units to large-size coding units. The sizes of coding units are 8×8, 16×16, 32×32 and 64×64. Wherein, a 64×64 coding unit is called a maximum coding unit in an encoding process.

③根据当前帧的帧类型及当前最大编码单元在当前帧中的位置,确定当前最大编码单元的所有预测用的最大编码单元;然后将由当前最大编码单元的所有预测用的最大编码单元构成的集合定义为当前最大编码单元的预测集合,并记为Ω,其中,Ω为空集或Ω中所包含的最大编码单元为L、T和COL中的至少一个即Ω={T}或Ω={L}或Ω={COL}或Ω={L,T}或Ω={T,COL}或Ω={L,COL}或Ω={L,T,COL},L表示当前最大编码单元的左边相邻最大编码单元,T表示当前最大编码单元的上边相邻最大编码单元,COL表示当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元。图3给出了一个最大编码单元C和该最大编码单元C的左边相邻最大编码单元L、该最大编码单元C的上边相邻最大编码单元T、该最大编码单元C所在的帧的前向参考帧中与该最大编码单元C的坐标位置相同的最大编码单元COL的位置关系。③ According to the frame type of the current frame and the position of the current largest coding unit in the current frame, determine the largest coding unit for all predictions of the current largest coding unit; Defined as the prediction set of the current largest coding unit, and recorded as Ω, where Ω is an empty set or the largest coding unit contained in Ω is at least one of L, T and COL, that is, Ω={T} or Ω={ L} or Ω={COL} or Ω={L,T} or Ω={T,COL} or Ω={L,COL} or Ω={L,T,COL}, L represents the current largest coding unit The largest coding unit adjacent to the left, T indicates the upper adjacent largest coding unit of the current largest coding unit, and COL indicates the largest coding unit at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame. Figure 3 shows a maximum coding unit C, the left adjacent maximum coding unit L of the maximum coding unit C, the upper adjacent maximum coding unit T of the maximum coding unit C, and the forward direction of the frame where the maximum coding unit C is located. The positional relationship of the largest coding unit COL at the same coordinate position as the largest coding unit C in the reference frame.

在此具体实施例中,步骤③中当前最大编码单元的所有预测用的最大编码单元的确定过程为:In this specific embodiment, the determination process of all prediction LCUs of the current LCU in step ③ is as follows:

如果当前帧为高清视频中的I帧,则当当前最大编码单元为当前帧中的第1个最大编码单元时,确定当前最大编码单元没有预测用的最大编码单元,即Ω为空集;当当前最大编码单元为当前帧的第1列最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的上边相邻最大编码单元T为当前最大编码单元的预测用的最大编码单元,即Ω={T};当当前最大编码单元为当前帧的第1行最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L为当前最大编码单元的预测用的最大编码单元,即Ω={L};当当前最大编码单元为当前帧中除第1列最大编码单元和第1行最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L和上边相邻最大编码单元T均为当前最大编码单元的预测用的最大编码单元,即Ω={L,T}。If the current frame is an I frame in a high-definition video, when the current largest coding unit is the first largest coding unit in the current frame, it is determined that the current largest coding unit has no largest coding unit for prediction, that is, Ω is an empty set; when When the current largest coding unit is the remaining largest coding unit except the first largest coding unit in the first column of the largest coding unit of the current frame, determine that the upper adjacent largest coding unit T of the current largest coding unit is the prediction of the current largest coding unit The largest coding unit used, that is, Ω={T}; when the current largest coding unit is the remaining largest coding units except the first largest coding unit in the first row of the current frame, determine the current largest coding unit The left adjacent largest coding unit L is the largest coding unit for prediction of the current largest coding unit, that is, Ω={L}; when the current largest coding unit is the largest coding unit except the first column and the first row of the current frame When there are other LCUs outside the LCU, it is determined that the LCU L adjacent to the current LCU and the LCU T adjacent to the upper side are the LCUs used for prediction of the current LCU, that is, Ω={L,T }.

如果当前帧为高清视频中的P帧或B帧,则当当前最大编码单元为当前帧中的第1个最大编码单元时,确定当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL为当前最大编码单元的预测用的最大编码单元,即Ω={COL};当当前最大编码单元为当前帧的第1列最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的上边相邻最大编码单元T和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL均为当前最大编码单元的预测用的最大编码单元,即Ω={T,COL};当当前最大编码单元为当前帧的第1行最大编码单元中除第1个最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL均为当前最大编码单元的预测用的最大编码单元,即Ω={L,COL};当当前最大编码单元为当前帧中除第1列最大编码单元和第1行最大编码单元外的其余最大编码单元时,确定当前最大编码单元的左边相邻最大编码单元L和上边相邻最大编码单元T及当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL均为当前最大编码单元的预测用的最大编码单元,即Ω={L,T,COL}。If the current frame is a P frame or B frame in high-definition video, when the current maximum coding unit is the first maximum coding unit in the current frame, determine the coordinate position of the current frame's forward reference frame and the current maximum coding unit The same largest coding unit COL is the largest coding unit used for prediction of the current largest coding unit, that is, Ω={COL}; when the current largest coding unit is the largest coding unit in the first column of the current frame except the first largest coding unit When determining the remaining largest coding units of the current largest coding unit, it is determined that the upper adjacent largest coding unit T of the current largest coding unit and the largest coding unit COL at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame are all of the current largest coding unit The largest coding unit for prediction, that is, Ω={T,COL}; when the current largest coding unit is the remaining largest coding units in the first row of the largest coding unit of the current frame except the first largest coding unit, determine the current largest coding unit The largest coding unit L adjacent to the left of the coding unit and the largest coding unit COL at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame are both the largest coding units for prediction of the current largest coding unit, that is, Ω= {L,COL}; When the current largest coding unit is the remaining largest coding unit in the current frame except the largest coding unit in the first column and the largest coding unit in the first row, determine the left adjacent largest coding unit L of the current largest coding unit The largest coding unit COL that is at the same coordinate position as the current largest coding unit in the upper adjacent largest coding unit T and the forward reference frame of the current frame is the largest coding unit for prediction of the current largest coding unit, that is, Ω={L ,T,COL}.

④令Dpred表示当前最大编码单元的深度预测值,然后确立Dpred的值与当前最大编码单元的深度遍历区间的一一对应关系,其中,Dpred的值不存在或Dpred的值为实数,且0≤Dpred≤3。④ Let D pred represent the depth prediction value of the current largest coding unit, and then establish a one-to-one correspondence between the value of D pred and the depth traversal interval of the current largest coding unit, wherein the value of D pred does not exist or the value of D pred is a real number , and 0≤D pred ≤3.

在此具体实施例中,步骤④中Dpred的值与当前最大编码单元的深度遍历区间的一一对应关系为:当Dpred=0时,当前最大编码单元的深度遍历区间为[0,0];当0<Dpred≤0.5时,当前最大编码单元的深度遍历区间为[0,1];当0.5<Dpred≤1.5时,当前最大编码单元的深度遍历区间为[0,2];当1.5<Dpred≤2.5时,当前最大编码单元的深度遍历区间为[1,3];当2.5<Dpred≤3时,当前最大编码单元的深度遍历区间为[2,3];当Dpred的值不存在时,当前最大编码单元的深度遍历区间为[0,3]。In this specific embodiment, the one-to-one correspondence between the value of D pred in step ④ and the depth traversal interval of the current largest coding unit is: when D pred = 0, the depth traversal interval of the current largest coding unit is [0,0 ]; when 0<D pred ≤0.5, the depth traversal interval of the current largest coding unit is [0,1]; when 0.5<D pred ≤1.5, the depth traversal interval of the current largest coding unit is [0,2]; When 1.5<D pred ≤2.5, the depth traversal interval of the current largest coding unit is [1,3]; when 2.5<D pred ≤3, the depth traversal interval of the current largest coding unit is [2,3]; when D When the value of pred does not exist, the depth traversal interval of the current largest coding unit is [0,3].

在此,Dpred的值需要通过L、T和COL三个最大编码单元内尺寸大小为4×4块的深度值的平均值加权计算得到,因此,若Ω中不包含三个最大编码单元,即若Ω为空集或包含一个最大编码单元或包含两个最大编码单元,则认为Dpred的值不存在,因而定义当Dpred不存在时,当前最大编码单元的深度遍历区间为[0,3];而若Ω中包含三个最大编码单元,则Dpred为实数,且0≤Dpred≤3。Here, the value of D pred needs to be calculated by weighting the average value of the depth values of the 4×4 blocks in the three largest coding units of L, T, and COL. Therefore, if Ω does not include three largest coding units, That is, if Ω is an empty set or contains one LCU or two LCUs, then the value of D pred is considered not to exist. Therefore, when D pred does not exist, the depth traversal interval of the current LCU is defined as [0, 3]; and if Ω contains three LCUs, then D pred is a real number, and 0≤D pred ≤3.

⑤如果Ω为空集或Ω中所包含的最大编码单元为L、T和COL中的一个或Ω中所包含的最大编码单元为L、T和COL中的两个,则确定Dpred的值不存在,然后执行步骤⑦;如果Ω中所包含的最大编码单元为L、T和COL,则确定Dpred的值为实数,且0≤Dpred≤3,然后执行步骤⑥。⑤ If Ω is an empty set or the largest coding unit contained in Ω is one of L, T and COL or the largest coding unit contained in Ω is two of L, T and COL, then determine the value of D pred does not exist, then perform step ⑦; if the largest coding unit contained in Ω is L, T and COL, then determine that the value of D pred is a real number, and 0≤D pred ≤3, and then perform step ⑥.

⑥通过获取当前最大编码单元与T的空域相似度TAS、当前最大编码单元与L的空域相似度LAS、当前最大编码单元与COL的时域相似度TS,计算Dpred的值,其中,1≤m≤3,1≤i≤256,且m和i均为整数,ωm表示Ω中的第m个最大编码单元所占的权重,当m=1时ωm=LAS,当m=2时ωm=TAS,当m=3时ωm=TS,表示Ω中的第m个最大编码单元中的第i个尺寸大小为4×4的基本存储单元的深度值。⑥ Calculate the value of D pred by obtaining the spatial similarity TAS between the current largest coding unit and T, the spatial similarity LAS between the current largest coding unit and L, and the temporal similarity TS between the current largest coding unit and COL, Among them, 1≤m≤3, 1≤i≤256, and both m and i are integers, ω m represents the weight occupied by the mth largest coding unit in Ω, when m=1, ω m =LAS, when ω m =TAS when m=2, ω m =TS when m=3, Indicates the depth value of the i-th basic storage unit with a size of 4×4 in the m-th LCU in Ω.

在此具体实施例中,步骤⑥的具体过程为:In this specific embodiment, the concrete process of step 6. is:

⑥-1、计算当前最大编码单元的左边相邻最大编码单元L和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元的左边相邻最大编码单元L-COL之间的平均深度差,记为ADD1,并计算当前最大编码单元的上边相邻最大编码单元T和当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元的上边相邻最大编码单元T-COL之间的平均深度差,记为ADD2,然后计算ADD1与ADD2的平均值,记为ADD,ADD=(ADD1+ADD2)/2;其中,1≤i≤256,且为整数,表示L中的第i个尺寸大小为4×4的基本存储单元的深度值,表示L-COL中的第i个尺寸大小为4×4的基本存储单元的深度值,表示T中的第i个尺寸大小为4×4的基本存储单元的深度值,表示T-COL中的第i个尺寸大小为4×4的基本存储单元的深度值,的取值范围均为[0,3],且为整数,符号“||”为取绝对值符号。⑥-1. Calculate the difference between the left adjacent largest coding unit L of the current largest coding unit and the left adjacent largest coding unit L-COL of the largest coding unit at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame The average depth difference between , denoted as ADD1, And calculate the average between the upper adjacent largest coding unit T of the current largest coding unit and the upper adjacent largest coding unit T-COL of the largest coding unit at the same coordinate position as the current largest coding unit in the forward reference frame of the current frame Depth difference, denoted as ADD2, Then calculate the average value of ADD1 and ADD2, denoted as ADD, ADD=(ADD1+ADD2)/2; wherein, 1≤i≤256, and is an integer, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in L, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in L-COL, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in T, Indicates the depth value of the i-th basic storage unit whose size is 4×4 in T-COL, The value range of is [0,3], and it is an integer, and the symbol "||" is the absolute value symbol.

⑥-2、计算当前最大编码单元与当前最大编码单元的上边相邻最大编码单元T的空域相似度,记为TAS,TAS=0.05×ADD+0.25;并计算当前最大编码单元与当前最大编码单元的左边相邻最大编码单元L的空域相似度,记为LAS,LAS=0.05×ADD+0.25;同时,计算当前最大编码单元与当前帧的前向参考帧中与当前最大编码单元的坐标位置相同的最大编码单元COL的时域相似度,记为TS,TS=-0.1×ADD+0.5。⑥-2. Calculate the spatial similarity between the current largest coding unit and the upper adjacent largest coding unit T of the current largest coding unit, denoted as TAS, TAS=0.05×ADD+0.25; and calculate the current largest coding unit and the current largest coding unit The spatial similarity of the adjacent largest coding unit L on the left side of , denoted as LAS, LAS=0.05×ADD+0.25; at the same time, calculate the coordinate position of the current largest coding unit and the forward reference frame of the current frame to be the same as the current largest coding unit The time-domain similarity of the largest coding unit COL is denoted as TS, TS=-0.1×ADD+0.5.

⑥-3、计算Dpred的值,其中,1≤m≤3,且为整数,ωm表示Ω中的第m个最大编码单元所占的权重,当m=1时ωm=LAS,当m=2时ωm=TAS,当m=3时ωm=TS,表示Ω中的第m个最大编码单元中的第i个尺寸大小为4×4的基本存储单元的深度值。⑥-3. Calculate the value of D pred , Wherein, 1≤m≤3, and is an integer, ω m represents the weight occupied by the mth largest coding unit in Ω, when m=1, ω m =LAS, when m=2, ω m =TAS, when When m=3, ω m =TS, Indicates the depth value of the i-th basic storage unit with a size of 4×4 in the m-th LCU in Ω.

⑦根据Dpred的值与当前最大编码单元的深度遍历区间的一一对应关系,确定当前最大编码单元的深度遍历区间;然后根据当前最大编码单元的深度遍历区间对当前最大编码单元以及当前最大编码单元内的各个编码单元进行编码,在编码过程中,若当前最大编码单元所在的帧为高清视频中的P帧或B帧,则当当前最大编码单元或当前最大编码单元内的每个编码单元的平均时空域人眼恰可察觉失真值小于设定的低阈值T1或大于设定的高阈值T2,则对当前最大编码单元或当前最大编码单元内的每个编码单元进行快速预测模式的选择,对当前最大编码单元或当前最大编码单元内的每个编码单元分别用skip、merge、inter2N×2N和intra2N×2N预测模式进行遍历编码,选取率失真代价值最小的预测模式作为最优预测模式。⑦ Determine the depth traversal interval of the current largest coding unit according to the one-to-one correspondence between the value of D pred and the depth traversal interval of the current largest coding unit; Each coding unit in the unit is encoded. During the encoding process, if the frame where the current largest coding unit is located is a P frame or a B frame in high-definition video, then when the current largest coding unit or each coding unit in the current largest coding unit If the average spatio-temporal distortion value detectable by the human eye is less than the set low threshold T 1 or greater than the set high threshold T 2 , the fast prediction mode is performed on the current largest coding unit or each coding unit within the current largest coding unit The selection of the current largest coding unit or each coding unit in the current largest coding unit is traversed by skip, merge, inter2N×2N and intra2N×2N prediction modes, and the prediction mode with the smallest rate-distortion cost is selected as the optimal predictive mode.

在此具体实施例中,步骤⑦中根据当前最大编码单元的深度遍历区间对当前最大编码单元以及当前最大编码单元内的各个编码单元进行编码的具体过程为:In this specific embodiment, the specific process of encoding the current largest coding unit and each coding unit in the current largest coding unit according to the depth traversal interval of the current largest coding unit in step ⑦ is as follows:

⑦-1、将当前最大编码单元的深度遍历区间内当前待处理的编码单元定义为当前编码单元,将当前编码单元所在的层定义为当前层。⑦-1. Define the current coding unit to be processed in the depth traversal interval of the current largest coding unit as the current coding unit, and define the layer where the current coding unit is located as the current layer.

⑦-2、用JNDts表示当前编码单元的平均时空域人眼恰可察觉失真值,如果当前帧为高清视频中的I帧,则确定JNDts的值不存在,然后执行步骤⑦-3;如果当前帧为高清视频中的P帧或B帧,则计算JNDts的值,然后执行步骤⑦-3,其中,(x,y)表示当前编码单元中的像素点的坐标位置,0≤x≤K-1,0≤y≤G-1,且都为整数,K表示当前编码单元中一行像素点的总个数,G表示当前编码单元中一列像素点的总个数,JND(x,y)表示当前编码单元中坐标位置为(x,y)的像素点的时空域人眼恰可察觉失真值,JND(x,y)的值采用现有技术获取。⑦-2. Use JND ts to represent the average spatiotemporal distortion value of the current coding unit that can be detected by human eyes. If the current frame is an I frame in a high-definition video, determine that the value of JND ts does not exist, and then perform step ⑦-3; If the current frame is a P frame or B frame in high-definition video, calculate the value of JND ts , Then execute step ⑦-3, where (x, y) represents the coordinate position of the pixel in the current coding unit, 0≤x≤K-1, 0≤y≤G-1, and they are all integers, and K represents the current The total number of pixels in a row in the coding unit, G represents the total number of pixels in a column in the current coding unit, JND(x, y) represents the space-time domain of the pixel at the coordinate position (x, y) in the current coding unit Human eyes can just detect the distortion value, and the value of JND(x, y) is obtained by using existing technology.

⑦-3、当JNDts的值不存在时,对当前编码单元分别用intra2N×2N和intraN×N预测模式进行编码,选取率失真代价值最小的预测模式作为当前编码单元的最优预测模式,然后执行步骤⑦-4;当JNDts的值存在时,判断JNDts的值是否小于设定的低阈值T1或大于设定的高阈值T2,如果是,则判定当前编码单元进行快速预测模式的选择,对当前编码单元分别用skip、merge、inter2N×2N和intra2N×2N预测模式进行遍历编码,选取率失真代价值最小的预测模式作为当前编码单元的最优预测模式,然后执行步骤⑦-4;否则,判定当前编码单元不进行快速预测模式的选择,对当前编码单元分别用skip、merge、inter2N×2N、inter2N×N、interN×2N、AMP(Asymmetric Motion Partitioning,非对称运动分割)、intra2N×2N和intraN×N预测模式进行全遍历编码,选取率失真代价值最小的预测模式作为当前编码单元的最优预测模式,然后执行步骤⑦-4;其中,inter2N×2N、inter2N×N、interN×2N、intra2N×2N和intraN×N中的N的值为当前编码单元中一行像素点或一列像素点的总个数的一半。⑦-3. When the value of JND ts does not exist, encode the current coding unit with intra2N×2N and intraN×N prediction modes respectively, and select the prediction mode with the smallest rate-distortion cost as the optimal prediction mode of the current coding unit, Then execute step ⑦-4; when the value of JND ts exists, judge whether the value of JND ts is less than the set low threshold T 1 or greater than the set high threshold T 2 , if so, determine whether the current coding unit performs fast prediction Mode selection: use skip, merge, inter2N×2N and intra2N×2N prediction modes for the current coding unit to perform traversal coding, select the prediction mode with the smallest rate-distortion cost as the optimal prediction mode for the current coding unit, and then perform step ⑦ -4; otherwise, it is determined that the current coding unit does not select the fast prediction mode, and use skip, merge, inter2N×2N, inter2N×N, interN×2N, AMP (Asymmetric Motion Partitioning, asymmetric motion partition) for the current coding unit respectively , intra2N×2N and intraN×N prediction modes for full traversal coding, select the prediction mode with the smallest rate-distortion cost as the optimal prediction mode of the current coding unit, and then perform steps ⑦-4; among them, inter2N×2N, inter2N×N The value of N in , interN×2N, intra2N×2N and intraN×N is half of the total number of pixels in a row or a column in the current coding unit.

在此,取T1=3.5,取T2=10,T1的具体值与T2的具体值是通过建立当前编码单元的平均时空域人眼恰可察觉失真值与当前编码单元的最优预测模式(即率失真代价值最小的预测模式)间的统计关系,利用统计关系确定的。Here, take T 1 =3.5, take T 2 =10, the specific values of T 1 and T 2 are determined by establishing the average spatiotemporal distortion value of the current coding unit and the optimal value of the current coding unit. The statistical relationship between the prediction modes (that is, the prediction mode with the smallest rate-distortion cost value) is determined by using the statistical relationship.

由于视频编码的预测模式随着区域以及当前帧和参考帧的差别程度不同而不同,而人眼恰可察觉失真模型表明人眼不可察觉的最大失真,包括空域人眼恰可察觉失真模型和时域人眼恰可察觉失真模型,空域人眼恰可察觉失真模型表明人眼对相对亮度比绝对亮度更敏感,纹理掩膜则表明纹理区域比平坦区域可隐藏更多失真;时域人眼恰可察觉失真模型则表明前后两帧差别越大,可隐藏的失真越大。因此可以通过人眼恰可察觉失真模型指导帧间预测模式的选择。图4a给出了BasketballDrive序列在量化参数等于32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图;图4b给出了BlowingBubbles序列在量化参数等于32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图;图4c给出了Traffic序列在量化参数等于32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图;图4d给出了RaceHorses序列在量化参数等于32、编码帧数为50帧时编码单元的平均时空域人眼恰可察觉失真值与编码单元的最佳预测模式间的统计关系示意图。根据图4a到图4d的统计分析,当时空域人眼恰可察觉失真值较小或者较大时,部分预测模式所占比例很小,可以排除这些预测模式。因此,在本发明中当JNDts的值小于设定的低阈值T1或大于设定的高阈值T2时,当前编码单元进行快速预测模式的选择,对skip、merge、inter2N×2N和intra2N×2N预测模式进行遍历编码,选择一个最优的预测模式。Since the prediction mode of video coding varies with the region and the degree of difference between the current frame and the reference frame, the human-eye just perceptible distortion model indicates the maximum distortion that the human eye cannot perceive, including the spatial domain human-eye just perceptible distortion model and temporal The human eye is just perceptible to the human eye in the domain domain, and the distortion model in the spatial domain is just perceptible to the human eye, which shows that the human eye is more sensitive to relative brightness than absolute brightness. The texture mask shows that textured areas can hide more distortion than flat areas; The perceivable distortion model shows that the greater the difference between the two frames before and after, the greater the distortion that can be hidden. Therefore, the selection of the inter-frame prediction mode can be guided by the perceptible distortion model of human eyes. Figure 4a shows a schematic diagram of the statistical relationship between the average spatio-temporal distortion value of the encoding unit and the best prediction mode of the encoding unit when the quantization parameter is equal to 32 and the number of encoding frames is 50 for the BasketballDrive sequence; Figure 4b shows A schematic diagram of the statistical relationship between the average spatio-temporal distortion value of the coding unit just perceptible to the human eye and the best prediction mode of the coding unit when the quantization parameter is equal to 32 and the number of coding frames is 50 for the BlowingBubbles sequence is shown; When the quantization parameter is equal to 32 and the number of encoded frames is 50 frames, the statistical relationship between the average spatio-temporal distortion value of the encoding unit and the best prediction mode of the encoding unit is shown; Figure 4d shows the quantization of the RaceHorses sequence When the parameter is equal to 32 and the number of encoding frames is 50 frames, it is a schematic diagram of the statistical relationship between the average spatio-temporal distortion value of the coding unit just perceptible to the human eye and the best prediction mode of the coding unit. According to the statistical analysis in Fig. 4a to Fig. 4d, when the distortion value can be detected by human eyes in the time-space domain is small or large, the proportion of some prediction modes is very small, and these prediction modes can be excluded. Therefore, in the present invention, when the value of JND ts is less than the set low threshold T 1 or greater than the set high threshold T 2 , the current coding unit selects the fast prediction mode, skip, merge, inter2N×2N and intra2N ×2N prediction mode is traversed and encoded, and an optimal prediction mode is selected.

⑦-4、判断当前编码单元的深度值是否小于当前最大编码单元的深度遍历区间的最大值,如果是,则将当前编码单元进一步分割为四个尺寸大小相同的下一层编码单元,然后将该下一层编码单元中当前待处理的编码单元作为当前编码单元,将当前编码单元所在的层作为当前层,再返回步骤⑦-2继续执行;否则,确定当前编码单元编码过程结束,然后执行步骤⑦-5。⑦-4. Determine whether the depth value of the current coding unit is less than the maximum value of the depth traversal interval of the current largest coding unit, and if so, further divide the current coding unit into four next-layer coding units of the same size, and then divide the The coding unit currently to be processed in the coding unit of the next layer is taken as the current coding unit, and the layer where the current coding unit is located is taken as the current layer, and then return to step ⑦-2 to continue execution; otherwise, determine that the coding process of the current coding unit is over, and then execute Step ⑦-5.

⑦-5、判断当前最大编码单元的深度遍历区间内的所有编码单元是否均处理完毕,如果是,则确定当前最大编码单元编码过程结束,然后执行步骤⑧;否则,判断当前层中的四个编码单元是否均处理完毕,如果当前层中的四个编码单元均处理完毕,则将当前层的上一层编码单元中下一个待处理的编码单元作为当前编码单元,并将当前编码单元所在的层作为当前层,然后返回步骤⑦-2继续执行,如果当前层中的四个编码单元未处理完毕,则将当前层中下一个待处理的编码单元作为当前编码单元,并将当前编码单元所在的层作为当前层,然后返回步骤⑦-2继续执行。⑦-5. Determine whether all the coding units in the depth traversal interval of the current largest coding unit have been processed. If so, determine that the encoding process of the current largest coding unit is completed, and then perform step ⑧; otherwise, determine whether the four coding units in the current layer Whether all the coding units have been processed. If all the four coding units in the current layer have been processed, the next coding unit to be processed in the coding units of the upper layer of the current layer is used as the current coding unit, and the current coding unit is located Layer as the current layer, and then return to step ⑦-2 to continue execution. If the four coding units in the current layer have not been processed, take the next coding unit to be processed in the current layer as the current coding unit, and set the current coding unit where layer as the current layer, and then return to step ⑦-2 to continue.

⑧将当前帧中下一个待编码的最大编码单元作为当前最大编码单元,然后返回步骤③继续执行,直至当前帧中的所有最大编码单元均编码完毕。⑧ Use the next largest coding unit to be encoded in the current frame as the current largest coding unit, and then return to step ③ to continue until all the largest coding units in the current frame are encoded.

⑨将高清视频中下一帧待处理的帧作为当前帧,然后返回步骤②继续执行,直至高清视频中的所有帧均处理完毕,至此完成了高清视频的快速编码。⑨Take the next frame to be processed in the high-definition video as the current frame, and then return to step ② to continue until all the frames in the high-definition video are processed, and the fast encoding of high-definition video is completed.

以下为对本发明方法进行测试,以进一步说明本发明方法的有效性和可行性。The method of the present invention is tested below to further illustrate the effectiveness and feasibility of the method of the present invention.

本发明方法选取HEVC的HM9.0作为测试模型;硬件配置为CPU intel core i5-2500,主频3.30GHz、内存8G的PC,操作系统为Windows7,开发工具为Microsoft VisualStudio 2008。采用低延时和随机访问编码结构,选取所有测试序列在量化参数QP为22、27、32和37四种情况下进行测试,测试帧数为100帧,非I帧图像组包含8帧非I帧,I帧周期为32。采用BD-PSNR(delta peak signal-to-noise rate)、BDBR(deltabit rate)和ΔT作为本发明方法的评价指标。BD-PSNR表示相同码率条件下PSNR的变化量,BDBR表示相同PSNR条件下码率的变化百分比,ΔT(%)用来表示编码时间变化的百分比,其中,Tp和THM对应表示采用本发明方法和HM9.0算法的编码时间。The inventive method selects HM9.0 of HEVC as the test model; the hardware configuration is a CPU intel core i5-2500, a PC with a main frequency of 3.30GHz and a memory of 8G, the operating system is Windows7, and the development tool is Microsoft VisualStudio 2008. Adopt low-latency and random access coding structure, select all test sequences to test under the four conditions of quantization parameters QP 22, 27, 32 and 37, the number of test frames is 100 frames, and the non-I frame image group contains 8 non-I frames frame, the I frame period is 32. Using BD-PSNR ( delta peak signal-to-noise rate), BDBR ( deltabit rate) and ΔT as the evaluation index of the method of the present invention. BD-PSNR represents the amount of change in PSNR under the same code rate conditions, BDBR represents the percentage change in code rate under the same PSNR conditions, ΔT(%) is used to represent the percentage change in encoding time, Wherein, T p and T HM correspond to represent the encoding time of adopting the method of the present invention and the HM9.0 algorithm.

表1给出了本发明方法选用的测试序列。表2给出了采用本发明方法对表1列出的测试序列进行编码100帧的编码性能情况,即BD-PSNR、BDBR和ΔT的数值,从表2可以看出,本发明方法在低延时编码结构下,BDBR仅增加1.71%,BD-PSNR仅仅降低0.058dB,时间节省41.35%;在随机访问编码结构下,BDBR仅增加1.06%,BD-PSNR仅下降0.037dB,时间节省41.43%;与HM9.0相比,本发明方法无论在低延时编码结构还是在随机访问编码结构下,视频质量基本保持不变,但是大大降低了视频编码的计算复杂度。Table 1 shows the test sequences selected by the method of the present invention. Table 2 shows the coding performance of 100 frames encoded by the method of the present invention to the test sequences listed in Table 1, that is, the values of BD-PSNR, BDBR and ΔT. As can be seen from Table 2, the method of the present invention has a low latency Under the temporal coding structure, BDBR only increased by 1.71%, BD-PSNR decreased by only 0.058dB, and the time was saved by 41.35%; under the random access coding structure, BDBR was only increased by 1.06%, BD-PSNR was only decreased by 0.037dB, and the time was saved by 41.43%; Compared with HM9.0, the method of the present invention basically keeps the video quality unchanged no matter in the low-delay coding structure or the random access coding structure, but greatly reduces the computational complexity of video coding.

图5给出了利用本发明方法分别在低延时编码结构和随机访问编码结构下相较于利用HM9.0原始编码方法对表1所列的测试序列进行编码100帧的时间节约百分比情况图。从图5可以看出,两种编码结构下的平均时间节省比重相近,都达到40%以上。因此,本发明方法降低编码的计算复杂度非常明显。Fig. 5 has provided and compared with using the HM9.0 original coding method to encode the test sequence listed in Table 1 under the low-latency coding structure and the random access coding structure by using the method of the present invention, the time saving percentage situation diagram of 100 frames is shown . It can be seen from Figure 5 that the average time saving ratios under the two encoding structures are similar, both reaching over 40%. Therefore, the method of the present invention reduces the computational complexity of encoding very obviously.

图6a给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对PeopleOnStreet测试序列(2560×1600)进行编码100帧的率失真性能曲线对比图;图6b给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对Kimono测试序列(1920×1080)进行编码100帧的率失真性能曲线对比图;图6c给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对PartyScene测试序列(832×480)进行编码100帧的率失真性能曲线对比图;图6d给出了利用本发明方法和利用HM9.0原始编码方法在低延时编码结构下对BlowingBubbles测试序列(416×240)进行编码100帧的率失真性能曲线对比图。从图6a至图6d中可以看出,利用本发明方法相比于HM9.0原始编码方法,率失真性能曲线基本重合,说明利用本发明方法和HM9.0原始编码方法进行编码后的视频质量基本保持不变。Figure 6a shows a comparison of rate-distortion performance curves for encoding 100 frames of the PeopleOnStreet test sequence (2560×1600) using the method of the present invention and the original encoding method of HM9.0 under a low-delay encoding structure; Figure 6b provides Using the method of the present invention and utilizing the HM9.0 original encoding method to encode the Kimono test sequence (1920 × 1080) under the low-delay encoding structure, the rate-distortion performance curve comparison diagram of 100 frames; Fig. Using the HM9.0 original encoding method to encode the PartyScene test sequence (832×480) under the low-delay encoding structure, the comparison chart of the rate-distortion performance curve of 100 frames; The encoding method encodes the BlowingBubbles test sequence (416×240) under the low-latency encoding structure and compares the rate-distortion performance curves of 100 frames. It can be seen from Figures 6a to 6d that the rate-distortion performance curves of the method of the present invention and the original encoding method of HM9.0 basically overlap, indicating the video quality after encoding by the method of the present invention and the original encoding method of HM9.0 remain largely unchanged.

图7a给出了利用HM9.0原始编码方法在低延时编码结构下在量化参数QP=32的条件下对Johnny测试序列中的第6帧(1280×720)进行编码后的四叉树分割结果示意图;图7b给出了利用本发明方法在低延时编码结构下在量化参数QP=32的条件下对Johnny测试序列中的第6帧(1280×720)进行编码后的四叉树分割结果示意图。图7a和图7b中的黑色方框代表两者编码单元分割的不同之处,黑色竖线或者横线代表两者预测模式的不同之处。从图7a和图7b中可以看出,本发明方法较HM9.0原始编码方法,编码单元的分割深度和预测单元的预测模式基本一致,虽有少数不匹配,但不匹配之处编码单元的分割深度和预测单元的预测模式相近。因此,能够充分说明利用本发明方法进行编码的整体率失真性能保持稳定。Figure 7a shows the quadtree segmentation after encoding the sixth frame (1280×720) in the Johnny test sequence using the HM9.0 original encoding method under the low-latency encoding structure and the quantization parameter QP=32 Result schematic diagram; Fig. 7 b has provided the quadtree division after the 6th frame (1280 * 720) in the Johnny test sequence is encoded under the condition of quantization parameter QP=32 by using the method of the present invention under the low delay coding structure Schematic diagram of the results. The black boxes in FIG. 7a and FIG. 7b represent the differences between the two coding unit divisions, and the black vertical or horizontal lines represent the differences between the two prediction modes. It can be seen from Fig. 7a and Fig. 7b that compared with the original encoding method of HM9.0, the segmentation depth of the coding unit and the prediction mode of the prediction unit are basically the same in the method of the present invention. The split depth is similar to the prediction mode of the PU. Therefore, it can be fully demonstrated that the overall rate-distortion performance of encoding using the method of the present invention remains stable.

表1本发明方法选用的测试序列The test sequence that table 1 method of the present invention selects for use

序列名称sequence name 分辨率resolution 帧数number of frames 帧率frame rate 比特深度bit depth TrafficTraffic 2560×16002560×1600 150150 30fps30fps 88 PeopleOnStreetPeopleOnStreet 2560×16002560×1600 150150 30fps30fps 88 KimonoKimono 1920×10801920×1080 240240 24fps24fps 88 CactusCactus 1920×10801920×1080 500500 50fps50fps 88 ParkSceneParkScene 1920×10801920×1080 240240 24fps24fps 88 BasketballDriveBasketballDrive 1920×10801920×1080 500500 50fps50fps 88 BQTerraceBQ Terrace 1920×10801920×1080 600600 60fps60fps 88 PartyScenePartyScene 832×480832×480 500500 50fps50fps 88 RaceHorsesCRace Horses C 832×480832×480 300300 30fps30fps 88 BasketballDrillBasketball Drill 832×480832×480 500500 50fps50fps 88 BQMallBQMall 832×480832×480 600600 60fps60fps 88 RaceHorsesRace Horses 416×240416×240 300300 30fps30fps 88 BlowingBubblesBlowing Bubbles 416×240416×240 500500 50fps50fps 88 BasketballPassBasketball Pass 416×240416×240 500500 50fps50fps 88 Vidyo1Vidyo1 1280×7201280×720 600600 60fps60fps 88 Vidyo3Vidyo3 1280×7201280×720 600600 60fps60fps 88 Vidyo4Vidyo4 1280×7201280×720 600600 60fps60fps 88 JohnnyJohnny 1280×7201280×720 600600 60fps60fps 88 FourPeopleFourPeople 1280×7201280×720 600600 60fps60fps 88

KristenAndSaraKristen And Sara 1280×7201280×720 600600 60fps60fps 88

表2采用本发明方法对表1列出的测试序列进行编码100帧的编码性能情况Table 2 adopts the inventive method to encode the coding performance situation of 100 frames to the test sequence listed in table 1

Claims (5)

1. a kind of HEVC fast encoding method, it is characterised in that comprise the following steps:
1. it is present frame by frame definition currently pending in HD video;
2. current maximum coding unit to be encoded in present frame is defined as current maximum coding unit;
3. the position according to the frame type and current maximum coding unit of present frame in the current frame, it is determined that current maximum coding is single The maximum coding unit of all predictions of member;Then will be single by the maximum coding of all predictions of current maximum coding unit The set that member is constituted is defined as the prediction sets of current maximum coding unit, and is designated as Ω, wherein, Ω in empty set or Ω by wrapping The maximum coding unit contained is at least one in L, T and COL, and L represents the adjacent maximum volume in the left side of current maximum coding unit Code unit, T represents the adjacent maximum coding unit in the top of current maximum coding unit, and COL represents the forward reference frame of present frame In coordinate position identical maximum coding unit with current maximum coding unit;
4. D is madepredThe depth prediction value of current maximum coding unit is represented, D is then establishedpredValue and current maximum coding it is single The interval one-to-one relationship of the extreme saturation of member, wherein, DpredValue be not present or DpredValue be real number, and 0≤Dpred≤ 3;
If 5. Ω is that the maximum coding unit included in empty set or Ω is included in one or Ω in L, T and COL Maximum coding unit is two in L, T and COL, it is determined that DpredValue be not present, then perform step 7.;If institute in Ω Comprising maximum coding unit be L, T and COL, it is determined that DpredValue be real number, and 0≤Dpred≤ 3, then perform step 6.;
6. by obtaining current maximum coding unit and T spatial domain similarity TAS, current maximum coding unit and L spatial domain phase Like degree LAS, current maximum coding unit and COL time domain similarity TS, D is calculatedpredValue,Wherein, 1≤m≤3,1≤i≤256, and m and i are integer, ωmRepresent in Ω M-th of maximum coding unit shared by weight, the ω as m=1m=LAS, the ω as m=2m=TAS, the ω as m=3m= TS,Represent depth of i-th of the size in m-th of maximum coding unit in Ω for 4 × 4 basic unit of storage Angle value;
The detailed process of described step 6. is:
6. -1, calculate in the adjacent maximum coding unit L in the left side of current maximum coding unit and the forward reference frame of present frame with Between the adjacent maximum coding unit L-COL in the left side of the coordinate position identical maximum coding unit of current maximum coding unit Mean depth is poor, is designated as ADD1,And calculate the upper of current maximum coding unit In the forward reference frame of the adjacent maximum coding unit T in side and present frame with the coordinate position identical of current maximum coding unit most Mean depth between the adjacent maximum coding unit T-COL in top of big coding unit is poor, is designated as ADD2,Then ADD1 and ADD2 average value is calculated, ADD, ADD=(ADD1+ is designated as ADD2)/2;Wherein, 1≤i≤256, and be integer,Represent the basic storage that i-th of size in L is 4 × 4 The depth value of unit,Depth value of i-th of the size in L-COL for 4 × 4 basic unit of storage is represented,Depth value of i-th of the size in T for 4 × 4 basic unit of storage is represented,Represent in T-COL The depth value for the basic unit of storage that i-th of size is 4 × 4, Span be [0,3], and for integer, symbol " | | " is the symbol that takes absolute value;
6. current maximum coding unit maximum coding unit T adjacent with the top of current maximum coding unit spatial domain -2, is calculated Similarity, is designated as TAS, TAS=0.05 × ADD+0.25;And calculate current maximum coding unit and current maximum coding unit The adjacent maximum coding unit L in left side spatial domain similarity, is designated as LAS, LAS=0.05 × ADD+0.25;Meanwhile, calculate currently most Coordinate position identical maximum coding in the forward reference frame of big coding unit and present frame with current maximum coding unit is single First COL time domain similarity, is designated as TS, TS=-0.1 × ADD+0.5;
6. D -3, is calculatedpredValue,Wherein, 1≤m≤3, and be integer, ωmTable Show the weight shared by m-th of maximum coding unit in Ω, the ω as m=1m=LAS, the ω as m=2m=TAS, as m=3 ωm=TS,Represent the basic storage list that i-th of size in m-th of maximum coding unit in Ω is 4 × 4 The depth value of member;
7. according to DpredValue and current maximum coding unit the interval one-to-one relationship of extreme saturation, it is determined that current maximum The extreme saturation of coding unit is interval;Then it is interval single to current maximum coding according to the extreme saturation of current maximum coding unit Each coding unit in member and current maximum coding unit is encoded, in an encoding process, if current maximum coding is single Frame where member is P frames or B frames in HD video, then when every in current maximum coding unit or current maximum coding unit The average time-space domain human eye of individual coding unit just perceives the Low threshold T that distortion value is less than setting1Or more than the high threshold of setting T2, then the choosing of fast prediction pattern is carried out to each coding unit in current maximum coding unit or current maximum coding unit Select, to each coding unit in current maximum coding unit or current maximum coding unit respectively with skip, merge, Inter2N × 2N and intra2N × 2N predictive modes carry out traversal coding, choose the minimum predictive mode of rate distortion costs value and make For optimal prediction modes;
8. 3. next maximum coding unit to be encoded in present frame, as current maximum coding unit, is then back to step Continue executing with, until all maximum coding units in present frame are encoded and finished;
9. the pending frame of next frame in HD video is then back to step and 2. continued executing with as present frame, until high definition All frames in video are disposed, and so far complete the fast coding of HD video.
2. a kind of HEVC according to claim 1 fast encoding method, it is characterised in that described step 3. in it is current The determination process of the maximum coding unit of all predictions of maximum coding unit is:
If present frame is the I frames in HD video, the 1st maximum coding in current maximum coding unit is present frame During unit, it is determined that the maximum coding unit that current maximum coding unit is not previously predicted;When current maximum coding unit is current In 1st row maximum coding unit of frame during remaining maximum coding unit in addition to the 1st maximum coding unit, it is determined that current maximum The adjacent maximum coding unit T in top of coding unit is the maximum coding unit of the prediction of current maximum coding unit;When work as Preceding maximum coding unit is compiled for remaining maximum in the 1st row maximum coding unit of present frame in addition to the 1st maximum coding unit During code unit, it is determined that the adjacent maximum coding unit L in the left side of current maximum coding unit is the prediction of current maximum coding unit Maximum coding unit;Except the 1st row maximum coding unit and the 1st row maximum are compiled in current maximum coding unit is present frame During remaining maximum coding unit outside code unit, it is determined that the adjacent maximum coding unit L in the left side of current maximum coding unit and upper The adjacent maximum coding unit T in side is the maximum coding unit of the prediction of current maximum coding unit;
If present frame is the P frames or B frames in HD video, the 1st in current maximum coding unit is present frame is most During big coding unit, determine that the coordinate position identical maximum in the forward reference frame of present frame with current maximum coding unit is compiled Code unit COL is the maximum coding unit of the prediction of current maximum coding unit;When current maximum coding unit is present frame The 1st row maximum coding unit in remaining maximum coding unit in addition to the 1st maximum coding unit when, maximum compiled it is determined that current Coordinate bit with current maximum coding unit in the code adjacent maximum coding unit T in top of unit and the forward reference frame of present frame Put the maximum coding unit that identical maximum coding unit COL is the prediction of current maximum coding unit;When current maximum Coding unit is remaining maximum coding unit in the 1st row maximum coding unit of present frame in addition to the 1st maximum coding unit When, it is determined that in the current adjacent maximum coding unit L in the left side of maximum coding unit and the forward reference frame of present frame with it is current most The coordinate position identical maximum coding unit COL of big coding unit is the maximum volume of the prediction of current maximum coding unit Code unit;In current maximum coding unit is present frame in addition to the 1st row maximum coding unit and the 1st row maximum coding unit During remaining maximum coding unit, it is determined that the adjacent maximum coding unit L in the left side and the adjacent maximum in top of current maximum coding unit With the coordinate position identical maximum coding unit of current maximum coding unit in the forward reference frame of coding unit T and present frame COL is the maximum coding unit of the prediction of current maximum coding unit.
3. a kind of HEVC according to claim 1 or 2 fast encoding method, it is characterised in that described step 4. in DpredValue and the interval one-to-one relationship of extreme saturation of current maximum coding unit be:Work as DpredIt is current maximum when=0 The extreme saturation interval of coding unit is [0,0];When 0<DpredWhen≤0.5, the extreme saturation of current maximum coding unit is interval For [0,1];When 0.5<DpredWhen≤1.5, the extreme saturation interval of current maximum coding unit is [0,2];When 1.5<Dpred≤ When 2.5, the extreme saturation interval of current maximum coding unit is [1,3];When 2.5<DpredWhen≤3, current maximum coding unit Extreme saturation interval be [2,3];Work as DpredValue when being not present, the extreme saturation interval of current maximum coding unit for [0, 3]。
4. a kind of HEVC according to claim 1 fast encoding method, it is characterised in that described step 7. middle basis Interval each in current maximum coding unit and current maximum coding unit of the extreme saturation of current maximum coding unit The detailed process that coding unit is encoded is:
7. -1, by the extreme saturation of current maximum coding unit it is interval in currently pending coding unit be defined as present encoding Unit, current layer is defined as by the layer where current coded unit;
7. -2, JND is usedtsRepresent that the average time-space domain human eye of current coded unit just perceives distortion value, if present frame is height I frames in clear video, it is determined that JNDtsValue be not present, then perform step 7. -3;If present frame is the P in HD video Frame or B frames, then calculate JNDtsValue,Then step is performed 7. -3, wherein, (x, y) is represented The coordinate position of pixel in current coded unit, 0≤x≤K-1,0≤y≤G-1, and be all integer, K represents present encoding The total number of one-row pixels point in unit, G represents the total number of a row pixel in current coded unit, and JND (x, y) represents to work as Coordinate position just perceives distortion value for the time-space domain human eye of the pixel of (x, y) in preceding coding unit;
7. -3, JND is worked astsValue when being not present, mould is predicted with intra2N × 2N and intraN × N respectively to current coded unit Formula is encoded, and chooses the minimum predictive mode of rate distortion costs values as the optimal prediction modes of current coded unit, then Perform step 7. -4;Work as JNDtsValue in the presence of, judge JNDtsValue whether be less than setting Low threshold T1Or more than setting High threshold T2, if it is, judging that current coded unit carries out the selection of fast prediction pattern, current coded unit is used respectively Skip, merge, inter2N × 2N and intra2N × 2N predictive modes carry out traversal coding, choose rate distortion costs value minimum Predictive mode as the optimal prediction modes of current coded unit, then perform step 7. -4;Otherwise, it is determined that present encoding list Member uses skip, merge, inter2N × 2N, inter2N respectively without the selection of fast prediction pattern to current coded unit × N, interN × 2N, AMP, intra2N × 2N and intraN × N predictive modes carry out full traversal coding, selection rate distortion generation Minimum predictive mode is worth as the optimal prediction modes of current coded unit, step 7. -4 is then performed;Wherein, The value of N in inter2N × 2N, inter2N × N, interN × 2N, intra2N × 2N and intraN × N is present encoding list The half of the total number of one-row pixels point or a row pixel in member;
7. -4, judge whether the depth value of current coded unit is less than the interval maximum of extreme saturation of current maximum coding unit Value, if it is, current coded unit is divided further into next layer of coding unit of four size identicals, then will Currently pending coding unit is as current coded unit in the next layer of coding unit, by the layer where current coded unit As current layer, return again to step and 7. -2 continue executing with;Otherwise, it determines current coded unit cataloged procedure terminates, then perform Step 7. -5;
7. -5, judge whether all coding units in the extreme saturation interval of current maximum coding unit are disposed, such as It is really, it is determined that current maximum coding unit cataloged procedure terminates, and then performs step 8.;Otherwise, four in current layer are judged Whether individual coding unit is disposed, if four in current layer coding unit is disposed, by the upper of current layer Next pending coding unit is as current coded unit in one layer of coding unit, and by the layer where current coded unit As current layer, it is then back to step and 7. -2 continues executing with, finished if four in current layer coding unit is untreated, will Next pending coding unit is as current coded unit in current layer, and using the layer where current coded unit as working as Front layer, is then back to step and 7. -2 continues executing with.
5. a kind of HEVC according to claim 4 fast encoding method, it is characterised in that 7. described step takes T in -31 =3.5, take T2=10.
CN201510225448.8A 2015-05-06 2015-05-06 A Fast Encoding Method for HEVC Active CN104853191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510225448.8A CN104853191B (en) 2015-05-06 2015-05-06 A Fast Encoding Method for HEVC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510225448.8A CN104853191B (en) 2015-05-06 2015-05-06 A Fast Encoding Method for HEVC

Publications (2)

Publication Number Publication Date
CN104853191A CN104853191A (en) 2015-08-19
CN104853191B true CN104853191B (en) 2017-09-05

Family

ID=53852507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510225448.8A Active CN104853191B (en) 2015-05-06 2015-05-06 A Fast Encoding Method for HEVC

Country Status (1)

Country Link
CN (1) CN104853191B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254887B (en) * 2016-08-31 2019-04-09 天津大学 A Fast Method for Deep Video Coding
CN108737841B (en) 2017-04-21 2020-11-24 腾讯科技(深圳)有限公司 Coding unit depth determination method and device
CN108012150B (en) * 2017-12-14 2020-05-05 湖南兴天电子科技有限公司 Video interframe coding method and device
CN110113600B (en) 2018-02-01 2022-08-26 腾讯科技(深圳)有限公司 Video encoding method, video encoding device, computer-readable storage medium, and computer apparatus
CN109168000B (en) * 2018-10-09 2021-02-12 北京佳讯飞鸿电气股份有限公司 HEVC intra-frame prediction rapid algorithm based on RC prediction
CN110446040A (en) * 2019-07-30 2019-11-12 暨南大学 A kind of inter-frame encoding methods and system suitable for HEVC standard
CN113596455A (en) * 2019-09-23 2021-11-02 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment
CN112866693B (en) * 2021-03-25 2023-03-24 北京百度网讯科技有限公司 Method and device for dividing coding unit CU, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533355A (en) * 2013-10-10 2014-01-22 宁波大学 Quick coding method for HEVC (high efficiency video coding)
CN103873861A (en) * 2014-02-24 2014-06-18 西南交通大学 Coding mode selection method for HEVC (high efficiency video coding)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9247266B2 (en) * 2011-04-18 2016-01-26 Texas Instruments Incorporated Temporal motion data candidate derivation in video coding
US9237343B2 (en) * 2012-12-13 2016-01-12 Mitsubishi Electric Research Laboratories, Inc. Perceptually coding images and videos

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533355A (en) * 2013-10-10 2014-01-22 宁波大学 Quick coding method for HEVC (high efficiency video coding)
CN103873861A (en) * 2014-02-24 2014-06-18 西南交通大学 Coding mode selection method for HEVC (high efficiency video coding)

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Feng Shao et al.Asymmetric Coding of Multi-View Video Plus Depth Based 3-D Video for View Rendering.《IEEE TRANSACTIONS ON MULTIMEDIA》.2012,第14卷(第1期),全文. *
基于纹理分解的变换域JND模型及图像编码方法;郑明魁 等;《通信学报》;20140630;第35卷(第6期);全文 *

Also Published As

Publication number Publication date
CN104853191A (en) 2015-08-19

Similar Documents

Publication Publication Date Title
CN104853191B (en) A Fast Encoding Method for HEVC
CN103188496B (en) Based on the method for coding quick movement estimation video of motion vector distribution prediction
CN103546749B (en) Method for optimizing HEVC (high efficiency video coding) residual coding by using residual coefficient distribution features and bayes theorem
CN103634606B (en) Video encoding method and apparatus
CN106937116B (en) Low-complexity video coding method based on adaptive learning of random training set
CN107623850B (en) A Fast Screen Content Coding Method Based on Spatiotemporal Correlation
CN103533359B (en) One is bit rate control method H.264
CN104811696B (en) A kind of coding method of video data and device
CN102186070A (en) Method for realizing rapid video coding by adopting hierarchical structure anticipation
CN105141954A (en) HEVC interframe coding quick mode selection method
CN103546758B (en) A kind of fast deep graphic sequence inter mode decision fractal coding
CN103888762B (en) Video coding framework based on HEVC standard
CN105120274A (en) Apparatus and method for encoding image
JP7610233B2 (en) METHOD AND APPARATUS FOR PREDICTIVE VIDEO CODING
CN101938657A (en) Coding Unit Adaptive Partitioning Method in High Efficiency Video Coding
KR20110010324A (en) Image encoding method and apparatus, image decoding method and apparatus
CN103533355B (en) A kind of HEVC fast encoding method
CN105681808B (en) A kind of high-speed decision method of SCC interframe encodes unit mode
CN101729891A (en) Method for encoding multi-view depth video
CN110365975A (en) A kind of AVS2 video encoding and decoding standard prioritization scheme
CN101304529A (en) Method and device for selecting macroblock mode
CN109819260A (en) Video Steganography Method and Device Based on Multi-Embedding Domain Fusion
CN109151467A (en) Screen content based on image block activity encodes interframe mode quick selecting method
CN101867818B (en) Selection method and device of macroblock mode
CN110446040A (en) A kind of inter-frame encoding methods and system suitable for HEVC standard

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate 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: 20190812

Address after: Room 1,020, Nanxun Science and Technology Pioneering Park, No. 666 Chaoyang Road, Nanxun District, Huzhou City, Zhejiang Province, 313000

Patentee after: Huzhou You Yan Intellectual Property Service Co.,Ltd.

Address before: 315211 Zhejiang Province, Ningbo Jiangbei District Fenghua Road No. 818

Patentee before: Ningbo University

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210512

Address after: 518057 Room 101, building 1, building 10, Maqueling Industrial Zone, Maling community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Weier Vision Technology Co.,Ltd.

Address before: 313000 room 1020, science and Technology Pioneer Park, 666 Chaoyang Road, Nanxun Town, Nanxun District, Huzhou, Zhejiang.

Patentee before: Huzhou You Yan Intellectual Property Service Co.,Ltd.

TR01 Transfer of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A fast coding method of hevc

Effective date of registration: 20220125

Granted publication date: 20170905

Pledgee: Bank of Jiangsu Limited by Share Ltd. Shenzhen branch

Pledgor: Shenzhen Weier Vision Technology Co.,Ltd.

Registration number: Y2022440020017

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20230111

Granted publication date: 20170905

Pledgee: Bank of Jiangsu Limited by Share Ltd. Shenzhen branch

Pledgor: Shenzhen Weier Vision Technology Co.,Ltd.

Registration number: Y2022440020017

PC01 Cancellation of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Fast Coding Method for HEVC

Effective date of registration: 20230116

Granted publication date: 20170905

Pledgee: Bank of Jiangsu Limited by Share Ltd. Shenzhen branch

Pledgor: Shenzhen Weier Vision Technology Co.,Ltd.

Registration number: Y2023440020009

PE01 Entry into force of the registration of the contract for pledge of patent right