+

CN102387364B - A Fast Intra-Frame Mode Selection Algorithm - Google Patents

A Fast Intra-Frame Mode Selection Algorithm Download PDF

Info

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
Application number
CN 201110331804
Other languages
Chinese (zh)
Other versions
CN102387364A (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.)
Jiangsu University
Original Assignee
Jiangsu 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 Jiangsu University filed Critical Jiangsu University
Priority to CN 201110331804 priority Critical patent/CN102387364B/en
Publication of CN102387364A publication Critical patent/CN102387364A/en
Application granted granted Critical
Publication of CN102387364B publication Critical patent/CN102387364B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a fast intra-frame mode selecting algorithm. The fast intra-frame mode selecting algorithm firstly carries out judgment in horizontal and vertical directions according to the judgment criteria of a block in the horizontal and vertical directions so as to fast determine whether a luminance block belongs to a mode 0 or a mode 1, judges the mode of the luminance block by using the space relevance of adjacent blocks, and finally fast selects an algorithm to carry out the judgment by using edge direction histograms; and the algorithm is suitable for carrying out fast calculation of computers and is lower in complexity. The algorithm comprehensively utilizes the relevance of the modes of the adjacent blocks and the directivity of luminance changing in the blocks, thus greatly shortening the calculated quantity and having good practicality.

Description

一种快速帧内模式选择算法A Fast Intra-Frame Mode Selection Algorithm

技术领域 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帧内模式选择算法进行了大量的研究,并取得了显著的成果。其中比较典型的算法有:                                                

Figure 2011103318046100002DEST_PATH_IMAGE001
Feng Pan等人提出的基于局部边缘方向信息的快速帧内模式选择算法,最早利用Sobel算子计算每个像素点的边缘方向矢量,然后利用边缘方向矢量求得每一个块的边缘方向直方图,最后通过该直方图的分布特点,选择出可能性比较大的几个模式作为候选模式。
Figure 823864DEST_PATH_IMAGE002
利用不同方向预测模式下的率失真代价之间的相关性,有选择性的跳过不太可能的预测模式,从而缩小候选模式范围。
Figure 2011103318046100002DEST_PATH_IMAGE003
结合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:
Figure 2011103318046100002DEST_PATH_IMAGE001
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.
Figure 823864DEST_PATH_IMAGE002
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.
Figure 2011103318046100002DEST_PATH_IMAGE003
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如果亮度块的左边块和上边块都存在,选择左边块的模式或上边块的模式为亮度块的候选模式,计算阈值

Figure 927955DEST_PATH_IMAGE004
,取J和J的较小值与
Figure 2011103318046100002DEST_PATH_IMAGE005
比较,若小于
Figure 271474DEST_PATH_IMAGE005
,则所述较小值对应的模式为亮度块的最佳预测模式,否则执行步骤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
Figure 927955DEST_PATH_IMAGE004
, taking the smaller value of Jleft and Jup with
Figure 2011103318046100002DEST_PATH_IMAGE005
compare, if less than
Figure 271474DEST_PATH_IMAGE005
, 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块,分别标记为

Figure 666683DEST_PATH_IMAGE006
Figure 2011103318046100002DEST_PATH_IMAGE007
Figure 2011103318046100002DEST_PATH_IMAGE009
,其定义为: Step 1.1 Divide the 8x8 luma block into four 4x4 blocks, labeled as
Figure 666683DEST_PATH_IMAGE006
,
Figure 2011103318046100002DEST_PATH_IMAGE007
, ,
Figure 2011103318046100002DEST_PATH_IMAGE009
, which is defined as:

Figure 128286DEST_PATH_IMAGE010
  
Figure 2011103318046100002DEST_PATH_IMAGE011
Figure 128286DEST_PATH_IMAGE010
  
Figure 2011103318046100002DEST_PATH_IMAGE011

     

其中Sx,y为各个像素对的值; Wherein S x, y is the value of each pixel pair;

步骤1.2 设定垂直方向参数和水平方向参数分别为

Figure 656537DEST_PATH_IMAGE014
Figure 2011103318046100002DEST_PATH_IMAGE015
,其定义为: Step 1.2 Set the vertical and horizontal parameters as
Figure 656537DEST_PATH_IMAGE014
and
Figure 2011103318046100002DEST_PATH_IMAGE015
, which is defined as:

Figure 13831DEST_PATH_IMAGE016
Figure 13831DEST_PATH_IMAGE016

     

步骤1.3 利用边缘方向角度信息判断边缘方向,令

Figure 2011103318046100002DEST_PATH_IMAGE019
分别表示垂直边缘方向角度和水平边缘方向角度,定义为: Step 1.3 Use the edge direction angle information to judge the edge direction, so that ,
Figure 2011103318046100002DEST_PATH_IMAGE019
Denote the vertical edge direction angle and the horizontal edge direction angle respectively, defined as:

Figure 512256DEST_PATH_IMAGE020
Figure 512256DEST_PATH_IMAGE020

Figure 2011103318046100002DEST_PATH_IMAGE021
Figure 2011103318046100002DEST_PATH_IMAGE021

步骤1.4设定阈值,根据规则进行判断: Step 1.4 Set Threshold , judge according to the rules:

Figure 2011103318046100002DEST_PATH_IMAGE023
,且
Figure 897287DEST_PATH_IMAGE024
时,为水平方向,判断亮度块的最佳预测模式为模式0; when
Figure 2011103318046100002DEST_PATH_IMAGE023
,and
Figure 897287DEST_PATH_IMAGE024
When , it is the horizontal direction, and the best prediction mode for judging the brightness block is mode 0;

Figure 2011103318046100002DEST_PATH_IMAGE025
,且时,为垂直方向,判断亮度块的最佳预测模式为模式1。 when
Figure 2011103318046100002DEST_PATH_IMAGE025
,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计算边缘方向直方图中的幅值最大值,其对应的模式为

Figure 132539DEST_PATH_IMAGE028
; Step 3.3.1 Calculate the maximum value of the magnitude in the edge direction histogram , and its corresponding pattern is
Figure 132539DEST_PATH_IMAGE028
;

步骤3.3.2 如果当小于阈值

Figure 2011103318046100002DEST_PATH_IMAGE029
,选择其最佳模式为模式2,否则执行步骤3.3.3; Step 3.3.2 If and when less than threshold
Figure 2011103318046100002DEST_PATH_IMAGE029
, choose its best mode as mode 2, otherwise go to step 3.3.3;

步骤3.3.3 计算直方图中的幅值次最大值

Figure 864183DEST_PATH_IMAGE030
,其对应的模式为
Figure 2011103318046100002DEST_PATH_IMAGE031
; Step 3.3.3 Calculate the second maximum value in the histogram
Figure 864183DEST_PATH_IMAGE030
, and its corresponding pattern is
Figure 2011103318046100002DEST_PATH_IMAGE031
;

步骤3.3.4 计算两种模式的幅值之差

Figure 137032DEST_PATH_IMAGE032
 ;当
Figure 2011103318046100002DEST_PATH_IMAGE033
大于阈值
Figure 52904DEST_PATH_IMAGE034
时,选择幅值最大值对应的模式
Figure 69402DEST_PATH_IMAGE028
为亮度块的最佳预测模式;否则比较模式
Figure 255795DEST_PATH_IMAGE028
和模式2对应匹配误差值,选择较小的匹配误差值对应的模式为亮度块的最佳预测模式。   Step 3.3.4 Calculate the difference between the amplitudes of the two modes
Figure 137032DEST_PATH_IMAGE032
;when
Figure 2011103318046100002DEST_PATH_IMAGE033
greater than the threshold
Figure 52904DEST_PATH_IMAGE034
, select the mode corresponding to the maximum value of the amplitude
Figure 69402DEST_PATH_IMAGE028
is the best prediction mode for luma blocks; otherwise compare modes
Figure 255795DEST_PATH_IMAGE028
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块,分别令作

Figure 965125DEST_PATH_IMAGE006
Figure 915763DEST_PATH_IMAGE007
Figure 985219DEST_PATH_IMAGE008
Figure 337703DEST_PATH_IMAGE009
,定义如下: Divide an 8x8 luminance block into four 4x4 blocks, respectively as
Figure 965125DEST_PATH_IMAGE006
,
Figure 915763DEST_PATH_IMAGE007
,
Figure 985219DEST_PATH_IMAGE008
,
Figure 337703DEST_PATH_IMAGE009
, defined as follows:

Figure 217935DEST_PATH_IMAGE010
  
Figure 344285DEST_PATH_IMAGE011
Figure 217935DEST_PATH_IMAGE010
  
Figure 344285DEST_PATH_IMAGE011

  

Figure 175155DEST_PATH_IMAGE013
  
Figure 175155DEST_PATH_IMAGE013

其中Sx,y为各个像素对的值; Wherein S x, y is the value of each pixel pair;

模式0和模式1有很强的方向性,为了获得该亮度块的边缘方向信息,令

Figure 475555DEST_PATH_IMAGE014
Figure 338469DEST_PATH_IMAGE015
分别表示垂直方向参数和水平方向参数,定义如下: Mode 0 and mode 1 have strong directionality, in order to obtain the edge direction information of the brightness block, make
Figure 475555DEST_PATH_IMAGE014
,
Figure 338469DEST_PATH_IMAGE015
Denote the vertical direction parameter and the horizontal direction parameter respectively, defined as follows:

Figure 251192DEST_PATH_IMAGE016
Figure 251192DEST_PATH_IMAGE016

Figure 312689DEST_PATH_IMAGE017
Figure 312689DEST_PATH_IMAGE017

利用边缘方向角度信息可以更精确的判断边缘方向,令

Figure 534723DEST_PATH_IMAGE018
Figure 134200DEST_PATH_IMAGE019
分别表示垂直边缘方向角度和水平边缘方向角度,定义如下: The edge direction can be judged more accurately by using the edge direction angle information, so that
Figure 534723DEST_PATH_IMAGE018
,
Figure 134200DEST_PATH_IMAGE019
represent the vertical edge direction angle and the horizontal edge direction angle respectively, and are defined as follows:

Figure 281465DEST_PATH_IMAGE021
Figure 281465DEST_PATH_IMAGE021

其中

Figure 147835DEST_PATH_IMAGE018
中较大者作为分母,设定阈值
Figure 551451DEST_PATH_IMAGE022
,然后根据
Figure 40070DEST_PATH_IMAGE014
Figure 338328DEST_PATH_IMAGE015
Figure 725447DEST_PATH_IMAGE018
Figure 783664DEST_PATH_IMAGE019
进行下面规则进行判断: in
Figure 147835DEST_PATH_IMAGE018
, The larger one is used as the denominator, and the threshold is set
Figure 551451DEST_PATH_IMAGE022
, and then according to
Figure 40070DEST_PATH_IMAGE014
,
Figure 338328DEST_PATH_IMAGE015
,
Figure 725447DEST_PATH_IMAGE018
,
Figure 783664DEST_PATH_IMAGE019
Carry out the following rules to judge:

Figure 611942DEST_PATH_IMAGE023
Figure 408997DEST_PATH_IMAGE024
时,为水平方向,则为亮度块最佳预测模式为模式0; when
Figure 611942DEST_PATH_IMAGE023
,
Figure 408997DEST_PATH_IMAGE024
When is the horizontal direction, the best prediction mode for the luma block is mode 0;

Figure 315959DEST_PATH_IMAGE026
时,为垂直方向,则度块最佳预测模式为模式1. when ,
Figure 315959DEST_PATH_IMAGE026
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,

Figure 2011103318046100002DEST_PATH_IMAGE035
Figure 2011103318046100002DEST_PATH_IMAGE035

 其中:

Figure 15056DEST_PATH_IMAGE036
表示对应模式下原始块和重构块的对应像素值差值的平方和,
Figure 2011103318046100002DEST_PATH_IMAGE037
表示残差块经过熵编码后得到的码流的码率,
Figure 45329DEST_PATH_IMAGE038
为拉格朗日乘因子,与量化系数有关。
Figure 829876DEST_PATH_IMAGE036
定义如下: in:
Figure 15056DEST_PATH_IMAGE036
Indicates the sum of squares of the corresponding pixel value differences between the original block and the reconstructed block in the corresponding mode,
Figure 2011103318046100002DEST_PATH_IMAGE037
Indicates the code rate of the code stream obtained after the residual block is entropy coded,
Figure 45329DEST_PATH_IMAGE038
is the Lagrange multiplication factor, which is related to the quantization coefficient.
Figure 829876DEST_PATH_IMAGE036
It is defined as follows:

Figure 2011103318046100002DEST_PATH_IMAGE039
Figure 2011103318046100002DEST_PATH_IMAGE039

其中:表示重构块的像素值,

Figure 2011103318046100002DEST_PATH_IMAGE041
表示原始块的像素值; in: represents the pixel value of the reconstructed block,
Figure 2011103318046100002DEST_PATH_IMAGE041
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.

Figure 296258DEST_PATH_IMAGE042
 
Figure 296258DEST_PATH_IMAGE042
 

其中J和J分别表示左边块和上边块的匹配误差值。将二者中较小者与

Figure 879686DEST_PATH_IMAGE005
进行比较,如果小于,则选择该较小值所对应块的模式为亮度块最佳预测模式,结束搜索,否则采用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
Figure 879686DEST_PATH_IMAGE005
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算子有两个卷积内核分别表示水平方向和垂直方向的差异程度。对于一个亮度块采样后的任意像素点

Figure 2011103318046100002DEST_PATH_IMAGE043
,定义其边缘矢量为:
Figure 239309DEST_PATH_IMAGE044
,其中: 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
Figure 2011103318046100002DEST_PATH_IMAGE043
, defining its edge vector as:
Figure 239309DEST_PATH_IMAGE044
,in:

Figure 2011103318046100002DEST_PATH_IMAGE045
Figure 2011103318046100002DEST_PATH_IMAGE045

Figure 175166DEST_PATH_IMAGE046
Figure 175166DEST_PATH_IMAGE046

Figure 2011103318046100002DEST_PATH_IMAGE047
Figure 183574DEST_PATH_IMAGE048
分别表示垂直方向和水平方向分量,边缘矢量的幅值可以近似定义为:
Figure 2011103318046100002DEST_PATH_IMAGE047
and
Figure 183574DEST_PATH_IMAGE048
represent the vertical and horizontal components respectively, and the magnitude of the edge vector can be approximately defined as:

Figure 2011103318046100002DEST_PATH_IMAGE049
Figure 2011103318046100002DEST_PATH_IMAGE049

边缘矢量方向可以定义为: The edge vector direction can be defined as:

Figure 361614DEST_PATH_IMAGE050
, 
Figure 2011103318046100002DEST_PATH_IMAGE051
Figure 361614DEST_PATH_IMAGE050
,
Figure 2011103318046100002DEST_PATH_IMAGE051

  由于亮度块的帧内预测模式中模式0(垂直)、模式1(水平)、模式3(左下)以及模式4(右下)是基于方向的预测模式,所以把整个预测方向划分为四个帧内预测选择区间

Figure 827493DEST_PATH_IMAGE052
,对应区间内的像素点集合用
Figure 2011103318046100002DEST_PATH_IMAGE053
表示,例如包含水平预测模式1的预测区间
Figure 495103DEST_PATH_IMAGE054
,则属于该模式的像素点集合为
Figure 2011103318046100002DEST_PATH_IMAGE055
,其它以此类推。 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
Figure 827493DEST_PATH_IMAGE052
, corresponding to the set of pixel points in the interval
Figure 2011103318046100002DEST_PATH_IMAGE053
Represents, for example, the prediction interval containing horizontal forecast mode 1
Figure 495103DEST_PATH_IMAGE054
, then the set of pixels belonging to this mode is
Figure 2011103318046100002DEST_PATH_IMAGE055
, and so on.

此处令

Figure 725227DEST_PATH_IMAGE056
,为直方图中每种预测模式所对应的加和值,即对于采样后的像素点,分别判断其属于哪种模式,然后将相同模式的向量的模相加得到
Figure 2011103318046100002DEST_PATH_IMAGE057
。 order here
Figure 725227DEST_PATH_IMAGE056
, 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
Figure 2011103318046100002DEST_PATH_IMAGE057
.

 

Figure 208424DEST_PATH_IMAGE058
 
Figure 208424DEST_PATH_IMAGE058

其中

Figure 89661DEST_PATH_IMAGE053
为某种模式的像素点的集合,由此来建立边缘方向直方图。 in
Figure 89661DEST_PATH_IMAGE053
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)    求出边缘方向直方图中的幅值最大值,对应的模式为

Figure 741222DEST_PATH_IMAGE028
Figure 724222DEST_PATH_IMAGE028
为模式0-模式4中的一种) (1) Find the maximum value in the edge direction histogram, and the corresponding mode is
Figure 741222DEST_PATH_IMAGE028
(
Figure 724222DEST_PATH_IMAGE028
One of mode 0-mode 4)

(2)    当

Figure 819565DEST_PATH_IMAGE027
小于阈值
Figure 306041DEST_PATH_IMAGE029
Figure 394083DEST_PATH_IMAGE029
取720)时,直接采用模式2,否则进行下一步; (2) when
Figure 819565DEST_PATH_IMAGE027
less than threshold
Figure 306041DEST_PATH_IMAGE029
(
Figure 394083DEST_PATH_IMAGE029
Take 720), directly adopt mode 2, otherwise proceed to the next step;

(3)    求直方图中的幅值次最大值

Figure 848067DEST_PATH_IMAGE030
,其对应的模式为
Figure 14048DEST_PATH_IMAGE031
为模式0-模式4中的一种);则 (3) Find the second maximum value in the histogram
Figure 848067DEST_PATH_IMAGE030
, and its corresponding pattern is (
Figure 14048DEST_PATH_IMAGE031
is one of mode 0-mode 4); then

Figure 459942DEST_PATH_IMAGE032
 
Figure 459942DEST_PATH_IMAGE032
 

Figure 214271DEST_PATH_IMAGE033
为两种模式的幅值之差,当大于阈值
Figure 100767DEST_PATH_IMAGE034
Figure 530611DEST_PATH_IMAGE034
取950)时,认为有单峰性,直接选择幅值最大值对应的模式
Figure 444341DEST_PATH_IMAGE028
为亮度块的最佳预测模式;否则比较
Figure 171994DEST_PATH_IMAGE028
模式和模式2对应匹配误差值,选择其中较小的匹配误差值对应的模式为亮度块的最佳预测模式。
Figure 214271DEST_PATH_IMAGE033
is the difference between the amplitudes of the two modes, when greater than the threshold
Figure 100767DEST_PATH_IMAGE034
(
Figure 530611DEST_PATH_IMAGE034
When taking 950), it is considered to have unimodality, and directly select the mode corresponding to the maximum value of the amplitude
Figure 444341DEST_PATH_IMAGE028
is the best prediction mode for the luma block; otherwise compare
Figure 171994DEST_PATH_IMAGE028
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.

Figure 815465DEST_PATH_IMAGE034
Figure 88315DEST_PATH_IMAGE029
通过大量实验测试而得,本专利给出各阈值的参考值,
Figure 505652DEST_PATH_IMAGE029
取720,
Figure 522149DEST_PATH_IMAGE034
取950。
Figure 815465DEST_PATH_IMAGE034
yes
Figure 88315DEST_PATH_IMAGE029
Obtained through a large number of experimental tests, this patent gives reference values for each threshold,
Figure 505652DEST_PATH_IMAGE029
Take 720,
Figure 522149DEST_PATH_IMAGE034
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 若小于阈值

Figure 2011103318046100002DEST_PATH_IMAGE059
,则执行步骤S107,否则执行步骤S108; Step S106 If less than the threshold
Figure 2011103318046100002DEST_PATH_IMAGE059
, 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 选取边缘方向直方图中的幅值最大值

Figure 207077DEST_PATH_IMAGE027
对应的模式
Figure 650828DEST_PATH_IMAGE060
,以及 Step S207 Select the maximum value of the amplitude in the edge direction histogram
Figure 207077DEST_PATH_IMAGE027
corresponding mode
Figure 650828DEST_PATH_IMAGE060
,as well as

边缘方向直方图中的幅值次最大值

Figure 555461DEST_PATH_IMAGE030
对应的模式
Figure 437967DEST_PATH_IMAGE031
; Magnitude submaximum in edge orientation histogram
Figure 555461DEST_PATH_IMAGE030
corresponding mode
Figure 437967DEST_PATH_IMAGE031
;

步骤S208 判断

Figure 728134DEST_PATH_IMAGE027
是否小于阈值
Figure 857633DEST_PATH_IMAGE029
,如果是,则执行步骤S209,否则执行步骤S210; Step S208 Judgment
Figure 728134DEST_PATH_IMAGE027
Is it less than the threshold
Figure 857633DEST_PATH_IMAGE029
, 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 判断

Figure 295567DEST_PATH_IMAGE032
是否大于阈值
Figure 653867DEST_PATH_IMAGE034
,如果是,则执行步骤S211,否则执行步骤S212; Step S210 Judgment
Figure 295567DEST_PATH_IMAGE032
Is it greater than the threshold
Figure 653867DEST_PATH_IMAGE034
, 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和

Figure 662723DEST_PATH_IMAGE060
中对应的匹配误差值J较小者为亮度块的最佳预测模式,结束搜索。 Step S212 select mode 2 and
Figure 662723DEST_PATH_IMAGE060
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)

1.一种快速帧内模式选择算法,其特征在于包括以下步骤: 1. A mode selection algorithm in a fast frame 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 of the upper block or the DC mode; calculate the matching error values 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如果亮度块的左边块和上边块都存在,选择左边块的模式或上边块的模式为亮度块的候选模式,计算阈值                                                
Figure 2011103318046100001DEST_PATH_IMAGE002
,取J和J的较小值与比较,若小于
Figure 398460DEST_PATH_IMAGE003
,则所述较小值对应的模式为亮度块的最佳预测模式,否则执行步骤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
Figure 2011103318046100001DEST_PATH_IMAGE002
, taking the smaller value of Jleft and Jup with compare, if less than
Figure 398460DEST_PATH_IMAGE003
, then the mode corresponding to the smaller value is the best prediction mode for the luma block, otherwise perform step 3;
步骤3采用基于边缘方向直方图的快速选择算法判断亮度块的最佳预测模式; Step 3 adopts the fast selection algorithm based on the edge direction histogram to judge the best prediction mode of the luma block;     步骤3.1 对输入亮度块的原始图像像素点进行亚采样; Step 3.1 subsampling the original image pixels of the input brightness block;     步骤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.
2.根据权利要求1所述的一种快速帧内模式选择算法,其特征在于:所述步骤1中的块水平方向和垂直方向判断准则为:分别计算水平方向和垂直方向上16个像素对的差值和,并结合边缘方向角度进行判断,其具体步骤为:  2. A kind of fast intra-frame mode selection algorithm according to claim 1, characterized in that: the block horizontal direction and vertical direction judging criteria in the step 1 are: respectively calculate 16 pixel pairs in the horizontal direction and the vertical direction The sum of the difference, and combined with the edge direction angle to judge, the specific steps are:  步骤1.1 将8x8亮度块分成4个4x4块,分别标记为
Figure 2011103318046100001DEST_PATH_IMAGE005
Figure 2011103318046100001DEST_PATH_IMAGE007
Figure 2011103318046100001DEST_PATH_IMAGE011
,其定义为:
Step 1.1 Divide the 8x8 luma block into four 4x4 blocks, labeled as
Figure 2011103318046100001DEST_PATH_IMAGE005
,
Figure 2011103318046100001DEST_PATH_IMAGE007
, ,
Figure 2011103318046100001DEST_PATH_IMAGE011
, which is defined as:
Figure 2011103318046100001DEST_PATH_IMAGE013
   
Figure 2011103318046100001DEST_PATH_IMAGE015
Figure 2011103318046100001DEST_PATH_IMAGE013
   
Figure 2011103318046100001DEST_PATH_IMAGE015
   
Figure 2011103318046100001DEST_PATH_IMAGE019
   
Figure 2011103318046100001DEST_PATH_IMAGE019
其中Sx,y为各个像素对的值; Wherein S x, y is the value of each pixel pair; 步骤1.2 设定垂直方向参数和水平方向参数分别为
Figure 2011103318046100001DEST_PATH_IMAGE021
Figure 2011103318046100001DEST_PATH_IMAGE023
,其定义为:
Step 1.2 Set the vertical and horizontal parameters as
Figure 2011103318046100001DEST_PATH_IMAGE021
and
Figure 2011103318046100001DEST_PATH_IMAGE023
, which is defined as:
Figure 2011103318046100001DEST_PATH_IMAGE025
Figure 2011103318046100001DEST_PATH_IMAGE025
    步骤1.3 利用边缘方向角度信息判断边缘方向,令
Figure 2011103318046100001DEST_PATH_IMAGE029
Figure 2011103318046100001DEST_PATH_IMAGE031
分别表示垂直边缘方向角度和水平边缘方向角度,定义为:
Step 1.3 Use the edge direction angle information to judge the edge direction, so that
Figure 2011103318046100001DEST_PATH_IMAGE029
,
Figure 2011103318046100001DEST_PATH_IMAGE031
Denote the vertical edge direction angle and the horizontal edge direction angle respectively, defined as:
Figure 2011103318046100001DEST_PATH_IMAGE035
Figure 2011103318046100001DEST_PATH_IMAGE035
步骤1.4设定阈值
Figure 2011103318046100001DEST_PATH_IMAGE036
,根据规则进行判断:
Step 1.4 Set Threshold
Figure 2011103318046100001DEST_PATH_IMAGE036
, judge according to the rules:
Figure DEST_PATH_IMAGE038
,且
Figure DEST_PATH_IMAGE040
时,为水平方向,判断亮度块的最佳预测模式为模式0;
when
Figure DEST_PATH_IMAGE038
,and
Figure DEST_PATH_IMAGE040
When , it is the horizontal direction, and the best prediction mode for judging the brightness block is mode 0;
Figure DEST_PATH_IMAGE042
,且
Figure DEST_PATH_IMAGE044
时,为垂直方向,判断亮度块的最佳预测模式为模式1。
when
Figure DEST_PATH_IMAGE042
,and
Figure DEST_PATH_IMAGE044
When is the vertical direction, it is judged that the best prediction mode of the luma block is mode 1.
3.根据权利要求1所述的一种快速帧内模式选择算法,其特征在于:所述步骤3.1的采样比例为2:1。 3. A fast intra-frame mode selection algorithm according to claim 1, characterized in that: the sampling ratio in step 3.1 is 2:1. 4.根据权利要求1所述的一种快速帧内模式选择算法,其特征在于:所述步骤3.3的具体步骤为: 4. a kind of fast intra-frame mode selection algorithm according to claim 1, is characterized in that: the concrete steps of described step 3.3 are: 步骤3.3.1计算边缘方向直方图中的幅值最大值,其对应的模式为
Figure 2011103318046100001DEST_PATH_IMAGE047
Step 3.3.1 Calculate the maximum value of the magnitude in the edge direction histogram , and its corresponding pattern is
Figure 2011103318046100001DEST_PATH_IMAGE047
;
步骤3.3.2 如果当小于阈值
Figure DEST_PATH_IMAGE048
,选择其最佳模式为模式2,否则执行步骤3.3.3;
Step 3.3.2 If and when less than threshold
Figure DEST_PATH_IMAGE048
, choose its best mode as mode 2, otherwise go to step 3.3.3;
步骤3.3.3 计算直方图中的幅值次最大值
Figure 2011103318046100001DEST_PATH_IMAGE049
,其对应的模式为
Step 3.3.3 Calculate the second maximum value in the histogram
Figure 2011103318046100001DEST_PATH_IMAGE049
, and its corresponding pattern is ;
步骤3.3.4 计算两种模式的幅值之差
Figure DEST_PATH_IMAGE052
 ;当大于阈值
Figure DEST_PATH_IMAGE054
时,选择幅值最大值对应的模式为亮度块的最佳预测模式;否则比较模式
Figure 553433DEST_PATH_IMAGE047
和模式2对应匹配误差值,选择较小的匹配误差值对应的模式为亮度块的最佳预测模式。
Step 3.3.4 Calculate the difference between the amplitudes of the two modes
Figure DEST_PATH_IMAGE052
;when greater than the threshold
Figure DEST_PATH_IMAGE054
, select the mode corresponding to the maximum value of the amplitude is the best prediction mode for luma blocks; otherwise compare modes
Figure 553433DEST_PATH_IMAGE047
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.
5.根据权利要求2所述的一种快速帧内模式选择算法,其特征在于:所述阈值
Figure 2011103318046100001DEST_PATH_IMAGE055
5. A kind of fast intra mode selection algorithm according to claim 2, characterized in that: the threshold
Figure 2011103318046100001DEST_PATH_IMAGE055
.
CN 201110331804 2011-10-27 2011-10-27 A Fast Intra-Frame Mode Selection Algorithm Expired - Fee Related CN102387364B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载