CN102387364B - A Fast Intra-Frame Mode Selection Algorithm - Google Patents
A Fast Intra-Frame Mode Selection Algorithm Download PDFInfo
- Publication number
- CN102387364B CN102387364B CN 201110331804 CN201110331804A CN102387364B CN 102387364 B CN102387364 B CN 102387364B CN 201110331804 CN201110331804 CN 201110331804 CN 201110331804 A CN201110331804 A CN 201110331804A CN 102387364 B CN102387364 B CN 102387364B
- Authority
- CN
- China
- Prior art keywords
- mode
- block
- best prediction
- edge direction
- luma
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
技术领域 technical field
本发明属于音视频编解码技术领域,根据自身特点并结合AVS的帧内预测技术及H.264/AVC的一些帧内预测算法,从而提出的一种低复杂度的快速帧内模式选择算法。 The present invention belongs to the field of audio and video coding and decoding technology. According to its own characteristics and combined with the intra-frame prediction technology of AVS and some intra-frame prediction algorithms of H.264/AVC, a low-complexity fast intra-frame mode selection algorithm is proposed.
背景技术 Background technique
AVS(Audio Video coding Standard)是我国自主制定,拥有自主知识产权的音视频编码技术标准。AVS采用了一系列先进技术以提高视频压缩效率,包括:帧内预测、帧间预测、运动估计、运动补偿、变换量化、熵编码、环路滤波、率失真优化(Rate Distortion Optimization,RDO)等关键技术。其中RDO的计算量非常大,而各种编码模式都要进行耗时的RDO运算以求得最佳模式。帧内模式预测全搜索算法保证了最佳的压缩效率以及图像质量,但是庞大的计算量成为它一个致命的弊端,再加上帧间编码和帧内编码都要进行帧内预测,帧内预测也是压缩编码过程中一个相当耗时的模块。因此,如何降低帧内模式选择算法的复杂度是需要考虑的一个重要问题。 AVS (Audio Video coding Standard) is an audio and video coding technology standard independently formulated by my country with independent intellectual property rights. AVS adopts a series of advanced technologies to improve video compression efficiency, including: intra prediction, inter prediction, motion estimation, motion compensation, transform quantization, entropy coding, loop filtering, rate distortion optimization (Rate Distortion Optimization, RDO), etc. key technologies. Among them, the calculation amount of RDO is very large, and various coding modes must perform time-consuming RDO calculations to obtain the best mode. The intra-frame mode prediction full search algorithm guarantees the best compression efficiency and image quality, but the huge amount of calculation has become a fatal drawback of it. In addition, both inter-frame coding and intra-frame coding must perform intra-frame prediction, intra-frame prediction It is also a rather time-consuming module in the compression encoding process. Therefore, how to reduce the complexity of the intra mode selection algorithm is an important issue that needs to be considered.
目前,国内外对H.264/AVC帧内模式选择算法进行了大量的研究,并取得了显著的成果。其中比较典型的算法有: Feng Pan等人提出的基于局部边缘方向信息的快速帧内模式选择算法,最早利用Sobel算子计算每个像素点的边缘方向矢量,然后利用边缘方向矢量求得每一个块的边缘方向直方图,最后通过该直方图的分布特点,选择出可能性比较大的几个模式作为候选模式。利用不同方向预测模式下的率失真代价之间的相关性,有选择性的跳过不太可能的预测模式,从而缩小候选模式范围。结合Feng Pan的算法提出的快速帧内预测模式选择新方法,它利用了块边缘的参考像素的特征,对绝对差值平均值设定一个阈值,提前确定最佳预测模式。这些算法普遍问题就是算法复杂度较高,运算量大,不利于在硬件平台实时实现。 At present, a lot of research has been done on the H.264/AVC intra-frame mode selection algorithm at home and abroad, and remarkable results have been obtained. Among the more typical algorithms are: The fast intra-frame mode selection algorithm based on local edge direction information proposed by Feng Pan et al. first uses the Sobel operator to calculate the edge direction vector of each pixel, and then uses the edge direction vector to obtain the edge direction histogram of each block. Finally, according to the distribution characteristics of the histogram, several patterns with relatively high probability are selected as candidate patterns. Using the correlation between the rate-distortion costs in different directional prediction modes, we selectively skip less likely prediction modes, thereby narrowing down the range of candidate modes. Combined with Feng Pan's algorithm, a new method for fast intra-frame prediction mode selection is proposed. It uses the characteristics of reference pixels at the edge of the block, sets a threshold for the average value of absolute difference, and determines the best prediction mode in advance. The general problem of these algorithms is that the complexity of the algorithm is high, and the amount of calculation is large, which is not conducive to real-time implementation on the hardware platform.
本发明通过研究AVS的帧内预测技术以及H.264/AVC的一些帧内预测算法,并根据自身特点提出一种低复杂度的快速帧内模式选择算法,充分利用了相邻块模式的相关性和块内亮度变化的方向性,大大缩短了计算量。 The present invention studies the intra-frame prediction technology of AVS and some intra-frame prediction algorithms of H.264/AVC, and proposes a low-complexity fast intra-frame mode selection algorithm according to its own characteristics, making full use of the correlation between adjacent block modes and the directionality of brightness changes within the block, greatly reducing the amount of calculation.
发明内容 Contents of the invention
本发明的目的是提供一种利用相邻块最佳模式的相关性和块内亮度变化的方向性来进行模式预判,并结合Feng Pan算法,缩小候选模式范围,在不影响编码性能的前提下,既没有增加复杂计算,还有效的提高了编码速度。 The purpose of the present invention is to provide a mode prediction using the correlation of the best mode of the adjacent block and the directionality of the brightness change in the block, and combine the Feng Pan algorithm to narrow the range of candidate modes without affecting the coding performance. In this way, it does not increase complex calculations, but also effectively improves the encoding speed.
1. 本发明的技术方案是:一种快速帧内模式选择算法,其特征在于包括以下步骤: 1. The technical solution of the present invention is: a kind of fast intra-frame mode selection algorithm, it is characterized in that comprising the following steps:
步骤1 采用块水平方向和垂直方向判断准则,判断亮度块的最佳预测模式是否属于模式0或模式1,否则进入步骤2; Step 1 Use the block horizontal direction and vertical direction judgment criteria to judge whether the best prediction mode of the luma block belongs to mode 0 or mode 1, otherwise go to step 2;
步骤2 利用相邻块的空间相关性判断亮度块是否属于模式2、模式3或模式4; Step 2 Use the spatial correlation of adjacent blocks to judge whether the brightness block belongs to mode 2, mode 3 or mode 4;
步骤2.1如果亮度块的左边块和上边块都不存在,判断亮度块的最佳预测模式为模式2,否则执行步骤2.2; Step 2.1 If neither the left block nor the upper block of the luminance block exists, judge that the best prediction mode of the luminance block is mode 2, otherwise perform step 2.2;
步骤2.2如果只有亮度块的上边块存在,则选择亮度块的候选模式为所述上边块的模式或DC模式,;计算所述上边块的模式和模式2对应的匹配误差值J上和JDC,选择所述J上和JDC的较小值对应的模式为亮度块的最佳预测模式;否则执行步骤2.3; Step 2.2 If only the upper block of the luminance block exists, select the candidate mode of the luminance block as the mode or DC mode of the upper block; calculate the matching error value J and J DC corresponding to the mode of the upper block and mode 2 , select the mode corresponding to the smaller value of J and J DC as the best prediction mode for the luma block; otherwise, perform step 2.3;
步骤2.3如果只有亮度块的左边块存在,亮度块的候选模式为所述左边块的模式或DC模式;计算所述左边块的模式和模式2对应的匹配误差值J左和JDC,选择所述J左和JDC的较小值对应的模式为亮度块的最佳预测模式;否则执行步骤2.4; Step 2.3 If only the left block of the luminance block exists, the candidate mode of the luminance block is the mode of the left block or the DC mode; calculate the matching error values Jleft and JDC corresponding to the mode of the left block and mode 2, and select the The mode corresponding to the smaller value of J left and J DC is the best prediction mode of the luma block; otherwise, perform step 2.4;
步骤2.4如果亮度块的左边块和上边块都存在,选择左边块的模式或上边块的模式为亮度块的候选模式,计算阈值,取J左和J上的较小值与比较,若小于,则所述较小值对应的模式为亮度块的最佳预测模式,否则执行步骤3。 Step 2.4 If both the left block and the upper block of the luminance block exist, select the mode of the left block or the mode of the upper block as the candidate mode of the luminance block, and calculate the threshold , taking the smaller value of Jleft and Jup with compare, if less than , then the mode corresponding to the smaller value is the best prediction mode for the luma block, otherwise step 3 is performed.
步骤3采用基于边缘方向直方图的快速选择算法判断亮度块的最佳预测模式; Step 3 Use the fast selection algorithm based on the edge direction histogram to judge the best prediction mode of the luma block;
步骤3.1 对输入亮度块的原始图像像素点按采样比例为2:1进行亚采样; Step 3.1 subsampling the original image pixels of the input brightness block with a sampling ratio of 2:1;
步骤3.2 定义边缘矢量,构建边缘方向直方图; Step 3.2 Define the edge vector and construct the edge direction histogram;
步骤3.3通过判断亮度块边缘方向直方图是否有单峰性确定亮度块的最佳预测模式; Step 3.3 Determine the best prediction mode of the luma block by judging whether the edge direction histogram of the luma block has unimodality;
所述步骤1中的块水平方向和垂直方向判断准则为:分别计算水平方向和垂直方向上16个像素对的差值和,并结合边缘方向角度进行判断,其具体步骤为: The criteria for judging the horizontal direction and vertical direction of the block in the step 1 are: respectively calculate the difference sum of 16 pixel pairs in the horizontal direction and the vertical direction, and judge in combination with the edge direction angle. The specific steps are:
步骤1.1 将8x8亮度块分成4个4x4块,分别标记为、、、,其定义为: Step 1.1 Divide the 8x8 luma block into four 4x4 blocks, labeled as , , , , which is defined as:
其中Sx,y为各个像素对的值; Wherein S x, y is the value of each pixel pair;
步骤1.2 设定垂直方向参数和水平方向参数分别为和,其定义为: Step 1.2 Set the vertical and horizontal parameters as and , which is defined as:
步骤1.3 利用边缘方向角度信息判断边缘方向,令、分别表示垂直边缘方向角度和水平边缘方向角度,定义为: Step 1.3 Use the edge direction angle information to judge the edge direction, so that , Denote the vertical edge direction angle and the horizontal edge direction angle respectively, defined as:
步骤1.4设定阈值,根据规则进行判断: Step 1.4 Set Threshold , judge according to the rules:
当,且时,为水平方向,判断亮度块的最佳预测模式为模式0; when ,and When , it is the horizontal direction, and the best prediction mode for judging the brightness block is mode 0;
当,且时,为垂直方向,判断亮度块的最佳预测模式为模式1。 when ,and When is the vertical direction, it is judged that the best prediction mode of the luma block is mode 1.
所述步骤3.3的具体步骤为: The concrete steps of described step 3.3 are:
步骤3.3.1计算边缘方向直方图中的幅值最大值,其对应的模式为; Step 3.3.1 Calculate the maximum value of the magnitude in the edge direction histogram , and its corresponding pattern is ;
步骤3.3.2 如果当小于阈值,选择其最佳模式为模式2,否则执行步骤3.3.3; Step 3.3.2 If and when less than threshold , choose its best mode as mode 2, otherwise go to step 3.3.3;
步骤3.3.3 计算直方图中的幅值次最大值,其对应的模式为; Step 3.3.3 Calculate the second maximum value in the histogram , and its corresponding pattern is ;
步骤3.3.4 计算两种模式的幅值之差 ;当大于阈值时,选择幅值最大值对应的模式为亮度块的最佳预测模式;否则比较模式和模式2对应匹配误差值,选择较小的匹配误差值对应的模式为亮度块的最佳预测模式。 Step 3.3.4 Calculate the difference between the amplitudes of the two modes ;when greater than the threshold , select the mode corresponding to the maximum value of the amplitude is the best prediction mode for luma blocks; otherwise compare modes The matching error value corresponds to mode 2, and the mode corresponding to the smaller matching error value is selected as the best prediction mode for the luma block.
本发明的有益效果是:首先根据块水平方向和垂直方向判断准则进行水平和垂直方向的判断,由于模式0和模式1出现的概率比模式3和模式4高,而且模式0和模式1有很强的方向性,判断起来也相对容易,可以利用此步骤快速确定亮度块属于模式0或模式1,降低了算法的复杂性;再者利用相邻块的空间相关性判断亮度块的模式,该算法适宜进行计算机的快速计算,其算法复杂性也较低;最后利用于边缘方向直方图的快速选择算法进行判断。其综合利用了相邻块模式的相关性和块内亮度变化的方向性,大大缩短了计算量,且具有很好的实用性。 The beneficial effect of the present invention is: at first carry out the judgment of horizontal direction and vertical direction according to judging criterion of block horizontal direction and vertical direction, because the probability that pattern 0 and pattern 1 occur is higher than pattern 3 and pattern 4, and pattern 0 and pattern 1 have very big difference. Strong directionality makes it relatively easy to judge. This step can be used to quickly determine whether the brightness block belongs to mode 0 or mode 1, which reduces the complexity of the algorithm; moreover, the spatial correlation of adjacent blocks is used to judge the mode of the brightness block. The algorithm is suitable for fast computer calculation, and its algorithm complexity is low; finally, it uses the fast selection algorithm of the edge direction histogram to judge. It comprehensively utilizes the correlation of adjacent block modes and the directionality of luminance change in a block, greatly reduces the amount of calculation, and has good practicability. the
附图说明 Description of drawings
图1 快速帧内模式选择算法流程图; Figure 1 Flowchart of fast intra mode selection algorithm;
图2 基于边缘方向直方图快速选择算法流程图。 Fig. 2 Flowchart of fast selection algorithm based on edge direction histogram.
具体实施方式 Detailed ways
下面结合附图和实例做进一步说明。 Further description will be made below in conjunction with accompanying drawings and examples.
AVS亮度块的5种预测模式,分别是模式0(垂直) 、模式1(水平)、模式2(DC)、模式3(左下)、模式4(右下),其中模式0、模式1、模式3、模式4这四种模式是具有方向性的,可以根据块内亮度变化的方向性来快速估计块内边缘方向,所以可以对上述四个有方向性的模式进行判断。一般情况下,模式0和模式1出现的概率比模式3和模式4高,而且模式0和模式1有很强的方向性,所以判断起来也相对容易。 The 5 prediction modes of AVS luma blocks are mode 0 (vertical), mode 1 (horizontal), mode 2 (DC), mode 3 (bottom left), mode 4 (bottom right), where mode 0, mode 1, mode 3. Mode 4 These four modes are directional, and the direction of the edge in the block can be quickly estimated according to the directionality of the brightness change in the block, so the above four directional modes can be judged. In general, the occurrence probability of mode 0 and mode 1 is higher than that of mode 3 and mode 4, and mode 0 and mode 1 have strong directionality, so it is relatively easy to judge.
根据块水平方向和垂直方向判断准则进行水平和垂直方向的判断,可以确定要判断的亮度块是否属于这两种预测模式。 Judgment in the horizontal direction and vertical direction is performed according to the block horizontal direction and vertical direction judgment criteria, and it can be determined whether the brightness block to be judged belongs to these two prediction modes.
A、判别亮度块是否属于模式0或模式1:分别计算水平方向和垂直方向上16个像素对的差值和,并结合边缘方向角度来判断其方向。 A. Determine whether the brightness block belongs to mode 0 or mode 1: Calculate the difference sum of 16 pixel pairs in the horizontal direction and the vertical direction respectively, and determine its direction in combination with the edge direction angle.
将一个8x8亮度块分成4个4x4块,分别令作、、、,定义如下: Divide an 8x8 luminance block into four 4x4 blocks, respectively as , , , , defined as follows:
其中Sx,y为各个像素对的值; Wherein S x, y is the value of each pixel pair;
模式0和模式1有很强的方向性,为了获得该亮度块的边缘方向信息,令,分别表示垂直方向参数和水平方向参数,定义如下: Mode 0 and mode 1 have strong directionality, in order to obtain the edge direction information of the brightness block, make , Denote the vertical direction parameter and the horizontal direction parameter respectively, defined as follows:
利用边缘方向角度信息可以更精确的判断边缘方向,令、分别表示垂直边缘方向角度和水平边缘方向角度,定义如下: The edge direction can be judged more accurately by using the edge direction angle information, so that , represent the vertical edge direction angle and the horizontal edge direction angle respectively, and are defined as follows:
其中、中较大者作为分母,设定阈值,然后根据、、、进行下面规则进行判断: in , The larger one is used as the denominator, and the threshold is set , and then according to , , , Carry out the following rules to judge:
当,时,为水平方向,则为亮度块最佳预测模式为模式0; when , When is the horizontal direction, the best prediction mode for the luma block is mode 0;
当,时,为垂直方向,则度块最佳预测模式为模式1. when , When is the vertical direction, the best prediction mode of the degree block is mode 1.
B、利用相邻块的空间相关性判断亮度块是否属于模式2、模式3或模式4。 B. Use the spatial correlation of adjacent blocks to judge whether the brightness block belongs to mode 2, mode 3 or mode 4.
判断准则如下: The judgment criteria are as follows:
(1)如果亮度块的左边块和上边块都不存在,设此时为状态一,则认为亮度块的最佳预测模式为模式2(DC),结束搜索,否则执行步骤(2); (1) If neither the left block nor the upper block of the luminance block exists, it is assumed that the state is 1 at this time, then the best prediction mode of the luminance block is considered to be mode 2 (DC), and the search ends, otherwise, step (2) is performed;
(2)如果只有亮度块的上边块存在(因为存在,所以上边块的编码和预测模式都是已知的,左边块预测模式也是一样的),设此时为状态二,则亮度块的候选模式为上边块模式或DC模式;计算上边块模式和DC模式对应的匹配误差值J上和JDC,选择J上和JDC的较小值对应的模式为亮度块的最佳预测模式;否则执行步骤(3); (2) If only the upper block of the luminance block exists (because it exists, the encoding and prediction modes of the upper block are known, and the prediction mode of the left block is the same), set this time as state 2, then the candidate of the luminance block The mode is the upper block mode or the DC mode; calculate the matching error values J up and J DC corresponding to the upper side block mode and the DC mode, and select the mode corresponding to the smaller value of J up and J DC as the best prediction mode of the luma block; otherwise Execute step (3);
(3)如果亮度块的只有左边块存在,设此时为状态三,则选择亮度块的候选模式为左边块模式或DC模式;计算左边块模式和DC模式对应的匹配误差值J左和JDC,选择J左和JDC的较小值对应的模式为亮度块的最佳预测模式;否则执行步骤(4); (3) If only the left block of the luminance block exists, set it as state 3 at this time, then select the candidate mode of the luminance block as the left block mode or DC mode; calculate the matching error values J left and J corresponding to the left block mode and DC mode DC , select the mode corresponding to the smaller value of J left and J DC as the best prediction mode of the luma block; otherwise, perform step (4);
(4)如果亮度块的左边块和上边块都存在,设此时为状态四,计算匹配误差值J值, (4) If both the left block and the upper block of the luminance block exist, set this time as state four, and calculate the matching error value J value,
其中:表示对应模式下原始块和重构块的对应像素值差值的平方和,表示残差块经过熵编码后得到的码流的码率,为拉格朗日乘因子,与量化系数有关。定义如下: in: Indicates the sum of squares of the corresponding pixel value differences between the original block and the reconstructed block in the corresponding mode, Indicates the code rate of the code stream obtained after the residual block is entropy coded, is the Lagrange multiplication factor, which is related to the quantization coefficient. It is defined as follows:
其中:表示重构块的像素值,表示原始块的像素值; in: represents the pixel value of the reconstructed block, Represents the pixel value of the original block;
根据J左和J上计算阈值,并将左边块模式或上边块模式作为亮度块的候选模式。 Compute thresholds based on J left and J up , and take the left block mode or the upper block mode as the candidate mode of the luma block.
其中J左和J上分别表示左边块和上边块的匹配误差值。将二者中较小者与进行比较,如果小于,则选择该较小值所对应块的模式为亮度块最佳预测模式,结束搜索,否则采用C中的基于边缘方向直方图的快速选择算法。 Among them, J left and J up represent the matching error values of the left block and the upper block respectively. Combine the smaller of the two with compare, if less than , then select the mode of the block corresponding to the smaller value as the best prediction mode of the brightness block, and end the search; otherwise, adopt the fast selection algorithm based on the edge direction histogram in C.
C.基于边缘方向直方图的快速选择算法判断亮度块的最佳预测模式; C. A fast selection algorithm based on the edge direction histogram to judge the best prediction mode of the brightness block;
第一步:对亮度块的像素点进行采样。 Step 1: Sampling the pixels of the brightness block.
对输入的亮度块的原始图像像素点进行2:1亚采样,使得采样后的像素点个数是采样前的一半。由于亚采样后的像素值是由左右相邻两个像素点的值求平均得到,且相邻像素点的空间相关性很强,所以亚采样处理后的数据不仅保持了原图像的数据特征,同时也大幅度降低了计算时间。 Perform 2:1 sub-sampling on the original image pixels of the input brightness block, so that the number of pixels after sampling is half of that before sampling. Since the pixel value after subsampling is obtained by averaging the values of two adjacent pixels on the left and right, and the spatial correlation of adjacent pixels is very strong, the data after subsampling not only maintains the data characteristics of the original image, At the same time, the calculation time is greatly reduced.
第二步:定义边缘方向矢量、构建边缘方向直方图。 The second step: define the edge direction vector and construct the edge direction histogram.
本发明利用sobel算子计算每个像素点的边缘方向矢量。sobel算子有两个卷积内核分别表示水平方向和垂直方向的差异程度。对于一个亮度块采样后的任意像素点,定义其边缘矢量为:,其中: The present invention uses a sobel operator to calculate the edge direction vector of each pixel. The sobel operator has two convolution kernels to represent the degree of difference in the horizontal and vertical directions, respectively. For any pixel after a brightness block is sampled , defining its edge vector as: ,in:
和分别表示垂直方向和水平方向分量,边缘矢量的幅值可以近似定义为: and represent the vertical and horizontal components respectively, and the magnitude of the edge vector can be approximately defined as:
边缘矢量方向可以定义为: The edge vector direction can be defined as:
, ,
由于亮度块的帧内预测模式中模式0(垂直)、模式1(水平)、模式3(左下)以及模式4(右下)是基于方向的预测模式,所以把整个预测方向划分为四个帧内预测选择区间,对应区间内的像素点集合用表示,例如包含水平预测模式1的预测区间,则属于该模式的像素点集合为,其它以此类推。 Since mode 0 (vertical), mode 1 (horizontal), mode 3 (lower left) and mode 4 (lower right) in the intra prediction mode of the luma block are direction-based prediction modes, the entire prediction direction is divided into four frames Intra-prediction selection interval , corresponding to the set of pixel points in the interval Represents, for example, the prediction interval containing horizontal forecast mode 1 , then the set of pixels belonging to this mode is , and so on.
此处令,为直方图中每种预测模式所对应的加和值,即对于采样后的像素点,分别判断其属于哪种模式,然后将相同模式的向量的模相加得到。 order here , is the sum value corresponding to each prediction mode in the histogram, that is, for the sampled pixel, judge which mode it belongs to, and then add the moduli of the vectors of the same mode to get .
其中为某种模式的像素点的集合,由此来建立边缘方向直方图。 in It is a collection of pixels of a certain pattern, so as to establish an edge direction histogram.
第三步:判定并选择亮度块的最佳预测模式。 Step 3: Determine and select the best prediction mode for the luma block.
由于Pan方案中都是选择边缘方向直方图中幅值最大的一个模式,再加上一个DC模式,但是实际DC模式只在块的方向性不明显的时候相对有效,所以可以通过判断该亮度块的方向性是否明显从而确定要不要采用DC模式。通常情况下,方向性比较明显的块在直方图上会表现比较明显的单峰性,因此,判断一个亮度块方向性是否明显就转化为判断其边缘方向直方图是否有单峰性的问题。本发明通过以下方法进行判断: Since the Pan scheme always selects the mode with the largest amplitude in the edge direction histogram, plus a DC mode, but the actual DC mode is relatively effective only when the directionality of the block is not obvious, so it can be judged by judging the brightness of the block Whether the directionality is obvious to determine whether to use DC mode. Usually, a block with obvious directionality will show obvious unimodality on the histogram. Therefore, judging whether the directionality of a brightness block is obvious is transformed into a problem of judging whether its edge direction histogram has unimodality. The present invention judges by following method:
(1) 求出边缘方向直方图中的幅值最大值,对应的模式为(为模式0-模式4中的一种) (1) Find the maximum value in the edge direction histogram, and the corresponding mode is ( One of mode 0-mode 4)
(2) 当小于阈值(取720)时,直接采用模式2,否则进行下一步; (2) when less than threshold ( Take 720), directly adopt mode 2, otherwise proceed to the next step;
(3) 求直方图中的幅值次最大值,其对应的模式为(为模式0-模式4中的一种);则 (3) Find the second maximum value in the histogram , and its corresponding pattern is ( is one of mode 0-mode 4); then
为两种模式的幅值之差,当大于阈值(取950)时,认为有单峰性,直接选择幅值最大值对应的模式为亮度块的最佳预测模式;否则比较模式和模式2对应匹配误差值,选择其中较小的匹配误差值对应的模式为亮度块的最佳预测模式。 is the difference between the amplitudes of the two modes, when greater than the threshold ( When taking 950), it is considered to have unimodality, and directly select the mode corresponding to the maximum value of the amplitude is the best prediction mode for the luma block; otherwise compare Mode and mode 2 correspond to the matching error value, and the mode corresponding to the smaller matching error value is selected as the best prediction mode for the luma block.
是通过大量实验测试而得,本专利给出各阈值的参考值,取720,取950。 yes Obtained through a large number of experimental tests, this patent gives reference values for each threshold, Take 720, Take 950.
本发明的算法适应于计算机的快速实现,其算法步骤如图1所示: Algorithm of the present invention is adapted to the rapid realization of computer, and its algorithm step is as shown in Figure 1:
步骤S101 判断当前亮度块的变化方向是否为水平方向或垂直方向,如果是,则执行步骤S102,否则执行步骤S103; Step S101 judges whether the change direction of the current brightness block is horizontal or vertical, if yes, execute step S102, otherwise execute step S103;
步骤S102 若亮度块的变化方向为水平方向则判最佳预测模式为模式0,若其变化方向为垂直方向则判最佳预测模式为模式1,结束搜索; Step S102: If the change direction of the luminance block is in the horizontal direction, the best prediction mode is judged as mode 0; if the change direction of the brightness block is in the vertical direction, the best prediction mode is judged to be mode 1, and the search ends;
步骤S103 判断当前亮度块的左相邻块和上相邻块是否都存在,如果不是,则执行步骤S104,否则执行步骤S105; Step S103 judges whether the left adjacent block and the upper adjacent block of the current luminance block all exist, if not, then execute step S104, otherwise execute step S105;
步骤S104 确定各状态对应的最佳模式并结束搜索; Step S104 determines the best mode corresponding to each state and ends the search;
步骤S105 如果当前亮度块的左相邻块和上相邻块都存在,将左边块和上边块模式中较小者对应的匹配误差值与阈值TH2比较; Step S105 If both the left adjacent block and the upper adjacent block of the current luminance block exist, compare the matching error value corresponding to the smaller one of the left block and the upper block mode with the threshold TH2;
步骤S106 若小于阈值,则执行步骤S107,否则执行步骤S108; Step S106 If less than the threshold , then execute step S107, otherwise execute step S108;
步骤S107 选择较小的匹配误差值对应的模式为亮度块的最佳预测模式并结束搜索; Step S107 selects the mode corresponding to the smaller matching error value as the best prediction mode of the luma block and ends the search;
步骤S108 采用基于边缘方向直方图快速选择算法进行模式选择。 Step S108 adopts the fast selection algorithm based on the edge direction histogram to select the mode.
基于边缘方向直方图快速选择算法具体如图2所示: The quick selection algorithm based on the edge direction histogram is shown in Figure 2:
步骤S201对亮度块的原始图像像素点进行2:1亚采样; Step S201 carries out 2:1 sub-sampling to the original image pixel of the brightness block;
步骤S202 选取第一个采样点后的像素点; Step S202 selects the pixel after the first sampling point;
步骤S203 判断是否遍历该亮度块所有亚采样像素点?(通过步骤S202中是否存在下一个像素点来判断)如果是,则执行步骤S207,否则,执行步骤S204; Step S203 Determine whether to traverse all the sub-sampled pixels of the brightness block? (Judging by whether there is a next pixel in step S202) If yes, execute step S207, otherwise, execute step S204;
步骤S204 计算像素点的边缘方向矢量; Step S204 calculates the edge direction vector of the pixel;
步骤S205 计算构建边缘方向直方图; Step S205 calculates and constructs the edge direction histogram;
步骤S206 继续选取下一个像素点,重复步骤203; Step S206 continues to select the next pixel point, repeating step 203;
步骤S207 选取边缘方向直方图中的幅值最大值对应的模式,以及 Step S207 Select the maximum value of the amplitude in the edge direction histogram corresponding mode ,as well as
边缘方向直方图中的幅值次最大值对应的模式; Magnitude submaximum in edge orientation histogram corresponding mode ;
步骤S208 判断是否小于阈值,如果是,则执行步骤S209,否则执行步骤S210; Step S208 Judgment Is it less than the threshold , if yes, execute step S209, otherwise execute step S210;
步骤S209 确定亮度块的最佳预测模式为模式2,结束搜索; Step S209 determines that the best prediction mode of the luma block is mode 2, and ends the search;
步骤S210 判断是否大于阈值,如果是,则执行步骤S211,否则执行步骤S212; Step S210 Judgment Is it greater than the threshold , if yes, execute step S211, otherwise execute step S212;
步骤S211 确定亮度块的最佳预测模式为,结束搜索; Step S211 determines that the best prediction mode of the luma block is , end the search;
步骤S212 选择模式2和中对应的匹配误差值J较小者为亮度块的最佳预测模式,结束搜索。 Step S212 select mode 2 and Among them, the one with the smaller matching error value J is the best prediction mode of the luma block, and the search ends.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110331804 CN102387364B (en) | 2011-10-27 | 2011-10-27 | A Fast Intra-Frame Mode Selection Algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110331804 CN102387364B (en) | 2011-10-27 | 2011-10-27 | A Fast Intra-Frame Mode Selection Algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102387364A CN102387364A (en) | 2012-03-21 |
CN102387364B true CN102387364B (en) | 2013-10-23 |
Family
ID=45826258
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201110331804 Expired - Fee Related CN102387364B (en) | 2011-10-27 | 2011-10-27 | A Fast Intra-Frame Mode Selection Algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102387364B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103686166B (en) * | 2013-11-18 | 2017-05-17 | 深圳市云宙多媒体技术有限公司 | Fast prediction mode selection method and system based on correlation analysis |
CN106162175A (en) * | 2015-03-26 | 2016-11-23 | 北京君正集成电路股份有限公司 | Method for choosing frame inner forecast mode and device |
CN107071405B (en) * | 2016-10-27 | 2019-09-17 | 浙江大华技术股份有限公司 | A kind of method for video coding and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101217663A (en) * | 2008-01-09 | 2008-07-09 | 上海华平信息技术股份有限公司 | A quick selecting method of the encode mode of image pixel block for the encoder |
CN101309408A (en) * | 2008-06-13 | 2008-11-19 | 青岛海信电子产业控股股份有限公司 | Lightness block selection method of intra-frame prediction mode |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007503775A (en) * | 2003-08-26 | 2007-02-22 | トムソン ライセンシング | Method and apparatus for encoding hybrid intra-inter coded blocks |
-
2011
- 2011-10-27 CN CN 201110331804 patent/CN102387364B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101217663A (en) * | 2008-01-09 | 2008-07-09 | 上海华平信息技术股份有限公司 | A quick selecting method of the encode mode of image pixel block for the encoder |
CN101309408A (en) * | 2008-06-13 | 2008-11-19 | 青岛海信电子产业控股股份有限公司 | Lightness block selection method of intra-frame prediction mode |
Also Published As
Publication number | Publication date |
---|---|
CN102387364A (en) | 2012-03-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103327325B (en) | The quick self-adapted system of selection of intra prediction mode based on HEVC standard | |
CN101815218B (en) | Method for coding quick movement estimation video based on macro block characteristics | |
CN105141954B (en) | A kind of HEVC interframe encodes fast schema selection method | |
CN102186070B (en) | Method for realizing rapid video coding by adopting hierarchical structure anticipation | |
CN103188496B (en) | Based on the method for coding quick movement estimation video of motion vector distribution prediction | |
CN102984521B (en) | High-efficiency video coding inter-frame mode judging method based on temporal relativity | |
CN100586184C (en) | Infra-frame prediction method | |
CN104796694B (en) | Optimization intraframe video coding method based on video texture information | |
CN103491334B (en) | Video transcode method from H264 to HEVC based on region feature analysis | |
CN102665078A (en) | Intra prediction mode decision based on direction vector for HEVC (High Efficiency Video Coding) | |
CN101964906A (en) | Rapid intra-frame prediction method and device based on texture characteristics | |
CN101304529A (en) | Method and device for selecting macroblock mode | |
CN102740073B (en) | Coding method and device | |
CN102724509A (en) | Method and device for selecting optimal intra-frame coding mode for video sequence | |
WO2011110088A1 (en) | Method and divece for video predictive encoding | |
CN104853191B (en) | A Fast Encoding Method for HEVC | |
CN101184233A (en) | A method of digital video compression coding based on CFRFS | |
CN102186081B (en) | H.264 intra-frame mode selection method based on gradient vector | |
CN102164283A (en) | A Subpixel Motion Estimation Method Based on AVS | |
CN101754022A (en) | Motion estimation method with low complexity | |
CN105187826A (en) | Rapid intra-frame mode decision method specific to high efficiency video coding standard | |
CN102387364B (en) | A Fast Intra-Frame Mode Selection Algorithm | |
CN102075757B (en) | Video foreground object coding method by taking boundary detection as motion estimation reference | |
CN101867818B (en) | Selection method and device of macroblock mode | |
CN103974077B (en) | Quick integer motion estimation searching method used for H.264 coding |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20131023 Termination date: 20151027 |
|
EXPY | Termination of patent right or utility model |