CN1263309C - Motion vector prediction method used for video coding - Google Patents
Motion vector prediction method used for video coding Download PDFInfo
- Publication number
- CN1263309C CN1263309C CN 03148030 CN03148030A CN1263309C CN 1263309 C CN1263309 C CN 1263309C CN 03148030 CN03148030 CN 03148030 CN 03148030 A CN03148030 A CN 03148030A CN 1263309 C CN1263309 C CN 1263309C
- Authority
- CN
- China
- Prior art keywords
- motion vector
- motion
- block
- reference frame
- prediction
- 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
- 239000013598 vector Substances 0.000 title claims abstract description 169
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000010586 diagram Methods 0.000 description 8
- 238000013139 quantization Methods 0.000 description 5
- 230000009466 transformation Effects 0.000 description 5
- 230000006835 compression Effects 0.000 description 3
- 238000007906 compression Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 2
- GNFTZDOKVXKIBK-UHFFFAOYSA-N 3-(2-methoxyethoxy)benzohydrazide Chemical compound COCCOC1=CC=CC(C(=O)NN)=C1 GNFTZDOKVXKIBK-UHFFFAOYSA-N 0.000 description 1
- 241001416181 Axis axis Species 0.000 description 1
- FGUUSXIOTUKUDN-IBGZPJMESA-N C1(=CC=CC=C1)N1C2=C(NC([C@H](C1)NC=1OC(=NN=1)C1=CC=CC=C1)=O)C=CC=C2 Chemical compound C1(=CC=CC=C1)N1C2=C(NC([C@H](C1)NC=1OC(=NN=1)C1=CC=CC=C1)=O)C=CC=C2 FGUUSXIOTUKUDN-IBGZPJMESA-N 0.000 description 1
- YTAHJIFKAKIKAV-XNMGPUDCSA-N [(1R)-3-morpholin-4-yl-1-phenylpropyl] N-[(3S)-2-oxo-5-phenyl-1,3-dihydro-1,4-benzodiazepin-3-yl]carbamate Chemical compound O=C1[C@H](N=C(C2=C(N1)C=CC=C2)C1=CC=CC=C1)NC(O[C@H](CCN1CCOCC1)C1=CC=CC=C1)=O YTAHJIFKAKIKAV-XNMGPUDCSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明公开了一种用于视频编码的运动矢量预测方法,该方法可以用于B帧中的直接编码模式,以获得更准确的运动矢量预测,从而更真实地体现视频中物体运动的、利用线性内插原理实现B帧中宏块的运动矢量预测。具体是:先获取后向参考帧各个块的运动矢量;针对每一个块的运动矢量,得到当前从前向参考帧到后向参考帧的运动轨迹;再根据该运动轨迹,获得当前图像中落在相应轨迹上最匹配的块,完成后向参考帧的全部块运动估计处理后,从当前图像中得到相应的运动矢量。本发明可以更真实地体现视频中物体的运动,获得更准确的运动矢量预测;与前向预测编码,后向预测编码相结合,可用实现一种新的预测编码类型。
The invention discloses a motion vector prediction method for video coding. The method can be used in the direct coding mode in B frames to obtain more accurate motion vector prediction, so as to more truly reflect the motion of objects in the video. The principle of linear interpolation realizes the motion vector prediction of macroblocks in B frames. Specifically: first obtain the motion vector of each block of the backward reference frame; for each block’s motion vector, obtain the current motion track from the forward reference frame to the backward reference frame; For the most matching block on the corresponding trajectory, after completing the motion estimation process of all blocks in the backward reference frame, the corresponding motion vector is obtained from the current image. The present invention can more truly embody the movement of the object in the video and obtain more accurate motion vector prediction; it can realize a new type of predictive coding by combining with forward predictive coding and backward predictive coding.
Description
技术领域technical field
本发明涉及一种用于视频编码的运动矢量预测方法,特别是指一种可以用于B帧中的直接编码模式,以获得更准确的运动矢量预测,从而更真实地体现视频中物体运动的、利用线性内插原理实现B帧中宏块的运动矢量预测的方法,属于数字音视频编码技术领域。The present invention relates to a motion vector prediction method for video coding, in particular to a direct coding mode that can be used in B frames to obtain more accurate motion vector prediction, so as to more truly reflect the motion of objects in the video . A method for realizing motion vector prediction of a macroblock in a B frame by using the principle of linear interpolation, belonging to the technical field of digital audio and video coding.
背景技术Background technique
高效的视频编解码技术是实现高质量、低成本多媒体数据存储与传输的关键。目前常用的编码方法有预测编码、正交变换编码、向量量化编码等等。这些方法都基于信号处理理论的,通常也称为第一代编码技术。现在比较流行的图像编码国际标准都基于这种编码理论,采用的是基于块匹配的运动补偿、离散余弦变换和量化相结合的编码方法。典型的有国际标准化组织/国际电工技术委员会第一联合技术组(ISO/IEC JTC1)推出的MPEG-1,MPEG-2和MPEG-4等国际标准,以及国际电信联盟(ITU-T)提出的H.26x系列推荐。这些视频编码标准在工业界得到了广泛应用。Efficient video codec technology is the key to realize high-quality, low-cost multimedia data storage and transmission. Currently commonly used coding methods include predictive coding, orthogonal transform coding, vector quantization coding, and so on. These methods are based on signal processing theory and are often called first-generation coding techniques. The more popular international standards for image coding are based on this coding theory, using a coding method based on block matching motion compensation, discrete cosine transform and quantization. Typically, there are international standards such as MPEG-1, MPEG-2 and MPEG-4 introduced by the International Organization for Standardization/International Electrotechnical Commission First Joint Technical Group (ISO/IEC JTC1), as well as international standards proposed by the International Telecommunication Union (ITU-T). H.26x series recommended. These video coding standards are widely used in the industry.
上述的视频编码标准都采用了混合视频编码(Hybrid Video Coding)策略,通常包括:预测、变换、量化和信息熵编码等四个主要模块。预测模块的主要功能是利用已经编码并重建的图像对当前要编码的图像进行预测(帧间预测),或者利用图像中已经编码并重建的图像块(或宏块)对当前要编码的图像块(或宏块)进行预测(帧内预测)。变换模块的主要功能是将输入的图像块变换到另外一个空间,使输入信号的能量尽可能地集中在低频变换系数上,进而降低图像块内元素之间的相关性,有利于压缩。量化模块的主要功能是将变换的系数映射到一个有利于编码的有限元素集上;信息熵编码模块的主要功能是根据统计规律,将量化后的变换系数用变长码表示。The above-mentioned video coding standards all adopt the hybrid video coding (Hybrid Video Coding) strategy, which usually includes four main modules: prediction, transformation, quantization and information entropy coding. The main function of the prediction module is to use the encoded and reconstructed image to predict the current image to be encoded (inter-frame prediction), or use the encoded and reconstructed image block (or macroblock) in the image to predict the current image block to be encoded (or macroblock) for prediction (intra prediction). The main function of the transformation module is to transform the input image block to another space, so that the energy of the input signal can be concentrated on the low-frequency transformation coefficients as much as possible, thereby reducing the correlation between elements in the image block and facilitating compression. The main function of the quantization module is to map the transformed coefficients to a finite element set that is beneficial to encoding; the main function of the information entropy coding module is to express the quantized transformation coefficients with variable-length codes according to statistical laws.
视频解码系统包含与视频编码相似的模块,主要通过将输入的码流通过熵解码、反量化、反变换等过程重建解码图像。除了上述模块外,视频编解码系统中通常还包含一些辅助的编码工具,这些工具也会对整个系统的编码性能(压缩比)做出贡献。The video decoding system includes modules similar to video encoding, and mainly reconstructs the decoded image by entropy decoding, inverse quantization, and inverse transformation of the input code stream. In addition to the above modules, the video codec system usually includes some auxiliary coding tools, and these tools will also contribute to the coding performance (compression ratio) of the entire system.
基于运动补偿预测的主要功能是消除视频序列在时间上的冗余。视频编码的大部分编码效率来自于预测模块。视频编码过程就是对视频序列的每一帧图像进行编码的过程。常用的视频编码系统对每一帧图像的编码是以宏块为基本单元进行的。在编码每一帧图像时,又可以分为帧内(I帧)编码、预测(P帧)编码和双向预测(B帧)编码等。一般来说,编码时,I帧、P帧和B帧编码是穿插进行的,比如按照IBBPBBP的顺序。The main function of prediction based on motion compensation is to eliminate the redundancy in time of the video sequence. Most of the coding efficiency in video coding comes from the prediction module. The video encoding process is the process of encoding each frame of the video sequence. Commonly used video coding systems encode each frame of image with a macroblock as the basic unit. When coding each frame of image, it can be divided into intra-frame (I frame) coding, predictive (P frame) coding and bidirectional predictive (B frame) coding, etc. Generally speaking, during encoding, I frame, P frame and B frame are encoded interspersedly, for example, in the order of IBBPBBP.
B帧的引入可以有效地解决运动物体之间或物体与背景之间由于不同的运动方向或运动速率而引起的“遮挡问题”。B帧的编码可以使得编码压缩效率达到200∶1以上的码率。对B帧中的宏块进行的编码包括:直接(Direct)、前向预测(Forward Prediction)、后向预测(BackwardPrediction)和双向预测(Bi-directional Prediction)四种模式。由于B帧技术需要同时进行前向与后向的运动估计,因此,运算复杂度较高;同时,为了区分前后向运动矢量,还要引入额外的标识信息。而采用Direct编码模式可以不对运动矢量信息进行编码,因此,可以减少编码运动矢量信息的比特,有效地提高编码效率。The introduction of B-frames can effectively solve the "occlusion problem" caused by different motion directions or speeds between moving objects or between objects and the background. The coding of the B frame can make the coding compression efficiency reach a code rate of more than 200:1. The coding of the macroblock in the B frame includes four modes: Direct, Forward Prediction, Backward Prediction and Bi-directional Prediction. Since the B-frame technology needs to perform forward and backward motion estimation at the same time, the computational complexity is relatively high; at the same time, in order to distinguish the forward and backward motion vectors, additional identification information must be introduced. However, the direct encoding mode may not encode the motion vector information, therefore, the bits for encoding the motion vector information may be reduced, and the encoding efficiency may be improved effectively.
在编码中,一个宏块是否采用Direct编码模式的关键在于:运动矢量的预测是否精确。传统的B帧编码中的直接模式采用时域相邻的宏块来实现运动矢量来预测。换言之,对B帧中某个宏块编码时,要通过后面第一个参考帧中相应位置宏块的运动矢量推导得到,因此,这种预测方式建立在相邻宏块具有相似的运动轨迹的假设基础上。但是由于当前宏块的运动并不完全取决于时域相邻宏块的运动,特别是在物体的边缘时,由于物体之间运动的相对偏移,这种预测往往会得到不准确的预测结果。运动补偿预测的块尺寸已经降至4×4时,这种情况将会更明显。In coding, the key to whether a macroblock adopts the Direct coding mode is whether the prediction of the motion vector is accurate. The direct mode in traditional B-frame coding uses adjacent macroblocks in time domain to realize motion vector prediction. In other words, when encoding a macroblock in a B frame, it must be derived from the motion vector of the corresponding macroblock in the first reference frame. Therefore, this prediction method is based on the fact that adjacent macroblocks have similar motion trajectories. on a hypothetical basis. However, since the motion of the current macroblock does not completely depend on the motion of adjacent macroblocks in the time domain, especially at the edge of objects, this kind of prediction often leads to inaccurate prediction results due to the relative offset of motion between objects. . This will be more pronounced when the block size for motion compensated prediction has been reduced to 4x4.
通过线性内插的方法可以部分回复视频中两个参考帧之间的图像;因此,这种方法可以应用到B帧编码中。参见图7,传统的线性内插技术是基于像素级来实现的,其中的B是需要内插的帧,而前后两个P帧是正常编码形成的;在解码时,可以简单地利用前后两个P帧来插出B帧,即每一块的位置与P帧的位置相对应,然后对前后P帧相应块的像素做线性加权。这种技术虽然能够有效地实现静态场景编码,但对于运动复杂的物体往往不能达到很好的效果。The image between two reference frames in the video can be partially restored by the method of linear interpolation; therefore, this method can be applied to B frame coding. Referring to Figure 7, the traditional linear interpolation technology is implemented based on the pixel level, where B is the frame that needs to be interpolated, and the two P frames before and after are formed by normal encoding; when decoding, you can simply use the two before and after P frames are used to interpolate B frames, that is, the position of each block corresponds to the position of the P frame, and then the pixels of the corresponding blocks of the previous and subsequent P frames are linearly weighted. Although this technology can effectively realize static scene encoding, it often cannot achieve good results for objects with complex motion.
有鉴于此,可以引进运动补偿内插的方法,通过内插运动矢量的方式来解决线性、匀速运动的物体的编码。然而由于运动的物体并不总是沿着直线运动,而且由于噪声或亮度的变化往往会造成运动矢量预测的不准确,特别是在运动物体上形成的不连续(如物体边缘部分)。In view of this, the method of motion compensation interpolation can be introduced to solve the coding of linear and uniform moving objects by interpolating motion vectors. However, the moving object does not always move along a straight line, and the motion vector prediction is often inaccurate due to noise or brightness changes, especially the discontinuity formed on the moving object (such as the edge part of the object).
发明内容Contents of the invention
本发明的主要目的在于提供一种用于视频编码的运动矢量预测方法,利用线性内插原理实现B帧中宏块的运动矢量预测,可以用于B帧中的Direct编码模式,以获得更准确的运动矢量预测,从而更真实地体现视频中物体的运动;同时与前向预测编码、后向预测编码相结合,实现一种新的预测编码类型。The main purpose of the present invention is to provide a kind of motion vector prediction method for video coding, utilize the linear interpolation principle to realize the motion vector prediction of macroblock in B frame, can be used in the Direct encoding mode in B frame, obtain more accurate Motion vector prediction, so as to reflect the motion of objects in the video more realistically; at the same time, it is combined with forward predictive coding and backward predictive coding to realize a new type of predictive coding.
本发明的目的是这样实现的:The purpose of the present invention is achieved like this:
通过相邻的两个参考帧之间的运动矢量预测要编码的B帧中各个宏块的运动矢量,对于B帧中某个宏块运动矢量的预测并不来自于后面第一个参考帧中相应的位置的宏块的运动矢量,如果该宏块处在后面第一个参考帧中某个宏块的运动轨迹上,则它的运动矢量与该宏块的运动轨迹相同。The motion vector of each macroblock in the B frame to be encoded is predicted by the motion vector between two adjacent reference frames, and the prediction of the motion vector of a macroblock in the B frame does not come from the first reference frame behind The motion vector of the macroblock at the corresponding position, if the macroblock is on the motion trajectory of a certain macroblock in the first reference frame later, its motion vector is the same as the motion trajectory of the macroblock.
为了更准确地估计B帧中各宏块的运动矢量,通过类似线性内插的方式来预测各宏块中每一运动估计块的运动矢量。当对B帧进行编码时,首先对后向参考帧的每一宏块预测方向都要进行预处理,通过后向参考帧相对于前向参考帧的运动轨迹,可以找到相应的B帧中的宏块。具体的预测方法是:In order to estimate the motion vector of each macroblock in the B frame more accurately, the motion vector of each motion estimation block in each macroblock is predicted by a method similar to linear interpolation. When encoding a B frame, the prediction direction of each macroblock in the backward reference frame must first be preprocessed, and the corresponding B frame can be found through the motion trajectory of the backward reference frame relative to the forward reference frame. macroblock. The specific prediction methods are:
1、获取后向参考帧各个块的运动矢量;1. Obtain the motion vector of each block of the backward reference frame;
2、针对每一个快的运动矢量,得到从前向参考帧到后向参考帧的运动轨迹;2. For each fast motion vector, obtain the motion trajectory from the forward reference frame to the backward reference frame;
3、利用该运动轨迹,计算出当前图像中落在此轨迹上的最匹配的块;3. Using the motion trajectory, calculate the most matching block falling on this trajectory in the current image;
4、完成后向参考帧的全部块运动估计处理后,将在当前图像中得到相应的运动矢量。4. After completing the motion estimation process of all blocks in the backward reference frame, the corresponding motion vector will be obtained in the current image.
由于图像的噪声和不同物体的不规则运动,可能会导致当前图像中一些块所“穿过”的运动矢量多于一个。这种情况下可以通过如下的方式之一来解决:Due to image noise and irregular motion of different objects, some blocks in the current image may "pass through" more than one motion vector. This situation can be resolved in one of the following ways:
第一种方法是:采用“就近原则”,针对时域上连续的图像的物体运动基本上呈线性关系,而且偏离另一帧相应的位置不会太大,因此可以考虑在空域上离当前位置最近的块所得的运动矢量作为候选矢量。The first method is: adopt the "proximity principle", the object motion for continuous images in the time domain is basically linear, and the deviation from the corresponding position of another frame will not be too large, so it can be considered that the distance from the current position in the space domain is The motion vector obtained from the nearest block is used as the candidate vector.
第二种方法是:采用“平均取值”的方法求取候选矢量;由于在很多情况下,在物体的边缘块往往会造成运动的“遮挡问题”,因此采用对“穿过”相应块的几个不同运动矢量求取平均值,将该求取平均值运动矢量作为候选矢量。The second method is: use the "average value" method to obtain the candidate vector; since in many cases, the edge blocks of the object often cause the "occlusion problem" of the motion, so the method of "passing through" the corresponding block is adopted. Several different motion vectors are averaged, and the averaged motion vector is used as a candidate vector.
另外,当一些块所“穿过”的运动矢量为零时,可以假设此块没有direct模式;或者利用空域预测的方式来预测运动矢量;或者利用前向运动矢量的方式来实现运动矢量的预测;或者利用零运动矢量的方式来预测运动矢量。In addition, when the motion vector "passed" by some blocks is zero, it can be assumed that this block has no direct mode; or use the spatial prediction method to predict the motion vector; or use the forward motion vector method to realize the prediction of the motion vector ; Or use the method of zero motion vector to predict the motion vector.
根据上述的技术方案可知:本发明可以更真实地体现视频中物体的运动,获得更准确的运动矢量预测;与前向预测编码,后向预测编码相结合,可用实现一种新的预测编码类型,其效果与传统B帧编码相似。According to the above-mentioned technical scheme, it can be seen that the present invention can more truly embody the motion of objects in the video and obtain more accurate motion vector prediction; it can be combined with forward predictive coding and backward predictive coding to realize a new type of predictive coding , and its effect is similar to traditional B-frame coding.
附图说明Description of drawings
图1为一个运动矢量穿过当前编码块的示意图;FIG. 1 is a schematic diagram of a motion vector passing through a current coding block;
图2为多个运动矢量穿过当前编码块的示意图;FIG. 2 is a schematic diagram of multiple motion vectors passing through a current coding block;
图3为本发明通过相邻的块来决定从多个矢量中选取真正的运动矢量的示意图;Fig. 3 is the schematic diagram that the present invention decides to select the real motion vector from a plurality of vectors through adjacent blocks;
图4为本发明通过相邻的块来预测运动矢量的示意图;FIG. 4 is a schematic diagram of predicting motion vectors through adjacent blocks in the present invention;
图5为相邻的块均没有运动矢量情况的示意图;Fig. 5 is the schematic diagram that all adjacent blocks have no motion vector situation;
图6为本发明利用前向运动矢量的延伸来预测运动矢量的示意图;FIG. 6 is a schematic diagram of predicting motion vectors using the extension of forward motion vectors in the present invention;
图7为现有的帧内插方式示意图;FIG. 7 is a schematic diagram of an existing frame interpolation method;
图8本发明实施例的流程图。Fig. 8 is a flowchart of an embodiment of the present invention.
具体实施方式Detailed ways
以下结合附图和具体的实施例对本发明作进一步的详细说明:Below in conjunction with accompanying drawing and specific embodiment the present invention is described in further detail:
请参见图1和图8,本发明对于当前编码块计算运动矢量的步骤:Please refer to Fig. 1 and Fig. 8, the present invention calculates the step of motion vector for current encoding block:
1.进行后向参考帧的运动估计,得到每一个n×n块的最佳运动矢量;1. Perform motion estimation on the backward reference frame to obtain the best motion vector for each n×n block;
2.预处理当前帧各n×n块的候选运动矢量;2. Preprocessing the candidate motion vectors of each n×n block of the current frame;
假设图像的宽与高分别为width、height。这总共有width/n x height/n个运动估计的块。对于后向参考帧中的每一n×n大小的块,假设其中心点的位置的运动矢量为其估计的运动矢量,沿着此运动矢量的方向得到运动的轨迹,并在当前帧中找到最匹配的块。Suppose the width and height of the image are width and height respectively. This has a total of width/n x height/n blocks of motion estimation. For each block of size n×n in the backward reference frame, assuming the motion vector of its central point is its estimated motion vector, the trajectory of motion is obtained along the direction of this motion vector, and found in the current frame best matching block.
当后向参考帧的每一n×n运动块的块运动矢量(假设从此n×n块的中间出发)穿过当前图像时,可以获取当前图像与此矢量的交点,然后计算出此交点会落在哪一个n×n块内,此块的前向运动矢量与后向参考帧的运动矢量方向一样,模为其1/2,当前块的后向运动矢量则方向相反,模为其1/2。When the block motion vector of each n×n motion block of the backward reference frame (assuming starting from the middle of this n×n block) passes through the current image, the intersection point of the current image and this vector can be obtained, and then the intersection point will be calculated Which n×n block falls in, the forward motion vector of this block is in the same direction as the motion vector of the backward reference frame, the modulus is 1/2, and the backward motion vector of the current block is in the opposite direction, and the modulus is 1 /2.
对于每一块做相对于参考帧的运动估计,对于不同的匹配块可以用给定的准则(如SAD,SSD等)来求得最佳的匹配块,并从当前图像中得到相应的运动矢量。For each block, do motion estimation relative to the reference frame. For different matching blocks, you can use a given criterion (such as SAD, SSD, etc.) to find the best matching block, and get the corresponding motion vector from the current image.
如果,当前、后向参考帧某一运动块的左上角位置为BACK_POS(x,y),其运动矢量为(mvx,mvy)(这里mvx、mvy为运动矢量为二维坐标轴上x,y轴方向上的值),则在前向参考帧中的位置FOR_POS(x,y)为:If the position of the upper left corner of a certain motion block in the current and backward reference frames is BACK_POS(x, y), its motion vector is (mvx, mvy) (where mvx and mvy are motion vectors for x, y on the two-dimensional coordinate axis axis direction), then the position FOR_POS(x, y) in the forward reference frame is:
FOR_POS(x,y)=BACK_POS(x-n/2,y-n/2)+(mvx,mvy);FOR_POS (x, y) = BACK_POS (x-n/2, y-n/2) + (mvx, mvy);
相应的当前块的位置CURR_POS(x,y)为:The corresponding current block position CURR_POS(x, y) is:
CURR_POS(x,y)=BACK_POS(x-n/2,y-n/2)+(mvx/2,mvy/2);CURR_POS (x, y) = BACK_POS (x-n/2, y-n/2) + (mvx/2, mvy/2);
由此,可以求得相应的块位置为CURR_BLOCK=CURR_POS(X,Y)/n,此块前向的运动矢量分别为(mvx/2,mvy/2),后向的运动矢量分别为(-mvx/2,-mvy/2)。Thus, the corresponding block position can be obtained as CURR_BLOCK=CURR_POS(X, Y)/n, the forward motion vectors of this block are respectively (mvx/2, mvy/2), and the backward motion vectors are respectively (- mvx/2, -mvy/2).
3.参见图2,当多个运动矢量指向同一估计块时,在经过上述处理后,在有的估计块上可能会得到两个或两个以上的运动矢量。此时,采用空域预测的方法来得到真正的运动矢量。具体是根据邻近的已经求得的运动矢量的块来选择最匹配的运动矢量,即通过对相邻块的运动矢量取均值,得出一个候选运动矢量,然后以该候选矢量为当前块的参考运动矢量。如图3所示,通过对相邻的块的运动矢量取均值的方式可以得出一个候选运动矢量,然后对当前块的多个运动矢量与候选矢量进行比较,最后取其方向最相近的块。其中,虚线的正方形代表相邻的块,实线的正方形代表当前的块,其中n1,n2为相邻块的运动矢量。由于有两个穿过当前块的运动矢量,因此可以找出与n1,n2矢量方向最相近的运动矢量。3. Referring to FIG. 2, when multiple motion vectors point to the same estimated block, after the above processing, two or more motion vectors may be obtained on some estimated blocks. At this time, the method of spatial domain prediction is used to obtain the real motion vector. Specifically, the best matching motion vector is selected according to the adjacent block with the obtained motion vector, that is, a candidate motion vector is obtained by taking the average value of the motion vectors of adjacent blocks, and then the candidate vector is used as the reference of the current block Motion vector. As shown in Figure 3, a candidate motion vector can be obtained by taking the average value of the motion vectors of adjacent blocks, and then compare multiple motion vectors of the current block with the candidate vectors, and finally select the block with the closest direction . Wherein, a square with a dotted line represents an adjacent block, and a square with a solid line represents a current block, where n1 and n2 are motion vectors of adjacent blocks. Since there are two motion vectors passing through the current block, the motion vector closest to the direction of the n1 and n2 vectors can be found.
4.对于没有运动矢量穿过,但相邻块有运动矢量时,可以采用空域预测的方式获得相应的运动矢量;如图4、5所示,通过对相邻块的运动矢量取均值的方式可以得出一个候选运动矢量,然后以候选矢量为当前块的参考运动矢量。即当前块的前后向运动矢量与参考运动矢量的方向一样,模也一样。参见图4,虚线的正方形代表相邻的块,实线的正方形代表当前的块,其中n1,n2为相邻块的运动矢量,而含有字符A的正方形代表没有运动矢量穿过当前块(实线的正方形);由于没有运动矢量穿过当前块,因此可以以n1,n2的矢量平均来作为当前块的运动矢量。参见图5,虚线的正方形代表相邻的块,实线的正方形代表当前的块,而含有字符A的正方形代表没有运动矢量穿过当前块(实线的正方形)。4. When there is no motion vector passing through, but there is a motion vector in the adjacent block, the corresponding motion vector can be obtained by means of spatial prediction; A candidate motion vector can be obtained, and then the candidate vector is used as the reference motion vector of the current block. That is, the forward and backward motion vector of the current block is in the same direction as the reference motion vector, and the modulus is also the same. Referring to Fig. 4, the square of dashed line represents the adjacent block, the square of solid line represents the current block, wherein n1, n2 are the motion vectors of adjacent blocks, and the square containing character A represents that no motion vector passes through the current block (real The square of the line); since no motion vector passes through the current block, the vector average of n1 and n2 can be used as the motion vector of the current block. Referring to FIG. 5 , the dotted squares represent adjacent blocks, the solid squares represent the current block, and the squares containing the character A represent no motion vectors passing through the current block (solid squares).
5.对于没有运动矢量穿过当前块且同时相邻块也没有运动矢量时,可以利用前向的运动矢量来处理;如图6所示,用前向参考帧相应位置块的运动矢量来作为当前块的参考运动矢量。即当前块的的前向运动矢量与参考运动矢量的方向相反,模一样。后向运动矢量的方向与参考向量的方向一样,模也一样。参见图6,其为本发明利用前向运动矢量的延伸来预测运动矢量的示意图;其中,虚线的正方形代表相邻的块,实线的正方形代表当前的块,而含有字符A的正方形代表没有运动矢量穿过当前块(实线的正方形),F表示前向参考帧运动矢量穿过当前块的情形。5. When no motion vector passes through the current block and there is no motion vector in the adjacent block at the same time, the forward motion vector can be used for processing; as shown in Figure 6, the motion vector of the corresponding position block of the forward reference frame is used as The reference motion vector for the current block. That is, the direction of the forward motion vector of the current block is opposite to that of the reference motion vector, exactly the same. The direction of the backward motion vector is the same as that of the reference vector, and the magnitude is the same. Referring to FIG. 6 , it is a schematic diagram of the present invention using the extension of the forward motion vector to predict the motion vector; wherein, the square with a dotted line represents an adjacent block, the square with a solid line represents the current block, and the square containing the character A represents no block. The motion vector passes through the current block (the square with the solid line), and F represents the situation where the motion vector of the forward reference frame passes through the current block.
6.如果当前向运动矢量的延伸也没有穿过该运动块时,则设其运动矢量为零。6. If the extension of the forward motion vector also does not pass through the motion block, then set its motion vector to zero.
参见图8,本发明的一个具体的处理流程是:Referring to Fig. 8, a specific processing flow of the present invention is:
步骤a:进行后向参考帧的运动估计,对该后向参考帧的每一个4×4块求出其运动轨迹;Step a: Carry out motion estimation of the backward reference frame, and obtain its motion trajectory for each 4×4 block of the backward reference frame;
步骤b:根据所述的运动轨迹,求出落入运动轨迹的当前帧的4×4块;Step b: According to the motion track, find the 4×4 block of the current frame falling into the motion track;
步骤c:如果已经计算完每个宏块的运动矢量,则结束;Step c: if the motion vector of each macroblock has been calculated, end;
步骤d:统计穿过当前4×4块的运动矢量的数目;Step d: Count the number of motion vectors passing through the current 4×4 block;
步骤e:如果该数目大于1,则采用空域预测的方法来得到真正的运动矢量,执行步d;Step e: if the number is greater than 1, then adopt the method of spatial domain prediction to obtain the real motion vector, and execute step d;
步骤f:如果该数目等于1,则设该运动矢量为当前块的运动矢量,执行步骤d;Step f: If the number is equal to 1, set the motion vector as the motion vector of the current block, and execute step d;
步骤g:如果该数目等于0,则进一步判断相邻块是否有运动矢量;Step g: if the number is equal to 0, then further judge whether there is a motion vector in the adjacent block;
步骤h:如果有,则利用相邻块进行空域预测,得到运动矢量;执行步骤d;Step h: if there is, then use the adjacent block to perform spatial prediction to obtain the motion vector; perform step d;
步骤i:如果没有,则进一步判断前向运动矢量的延伸是否通过当前块;Step i: If not, further judge whether the extension of the forward motion vector passes through the current block;
步骤j:如果是,则利用前向块的运动矢量作为当前块的运动矢量;执行步骤d;Step j: If yes, use the motion vector of the forward block as the motion vector of the current block; perform step d;
步骤k:如果不是,则设置当前块的运动矢量为零;执行步骤d。Step k: If not, set the motion vector of the current block to zero; execute step d.
最后应说明的是:以上实施例仅用以说明本发明而并非限制本发明所描述的技术方案;因此,尽管本说明书参照上述的各个实施例对本发明已进行了详细的说明,但是,本领域的普通技术人员应当理解,仍然可以对本发明进行修改或者等同替换;而一切不脱离本发明的精神和范围的技术方案及其改进,其均应涵盖在本发明的权利要求范围当中。Finally, it should be noted that: the above embodiments are only used to illustrate the present invention rather than limit the technical solutions described in the present invention; Those of ordinary skill in the art should understand that the present invention can still be modified or equivalently replaced; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention should be covered by the claims of the present invention.
Claims (5)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 03148030 CN1263309C (en) | 2003-06-27 | 2003-06-27 | Motion vector prediction method used for video coding |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 03148030 CN1263309C (en) | 2003-06-27 | 2003-06-27 | Motion vector prediction method used for video coding |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1568009A CN1568009A (en) | 2005-01-19 |
| CN1263309C true CN1263309C (en) | 2006-07-05 |
Family
ID=34472160
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 03148030 Expired - Fee Related CN1263309C (en) | 2003-06-27 | 2003-06-27 | Motion vector prediction method used for video coding |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1263309C (en) |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2006106039A1 (en) * | 2005-04-06 | 2006-10-12 | Thomson Licensing | Method and apparatus for encoding enhancement layer video data |
| JP2009200713A (en) * | 2008-02-20 | 2009-09-03 | Sony Corp | Image processing device, image processing method, and program |
| CN101635789B (en) * | 2008-07-21 | 2012-12-19 | 奇美电子股份有限公司 | Dynamic image compensation device and method |
| CN101686392B (en) * | 2008-09-24 | 2011-06-08 | 安凯(广州)微电子技术有限公司 | Image interpolation method, mobile multimedia processor and multimedia player terminal |
| US8971400B2 (en) * | 2010-04-14 | 2015-03-03 | Mediatek Inc. | Method for performing hybrid multihypothesis prediction during video coding of a coding unit, and associated apparatus |
| KR20120016991A (en) * | 2010-08-17 | 2012-02-27 | 오수미 | Interprediction Method |
| CN103327313B (en) * | 2012-03-21 | 2016-11-16 | 朱洪波 | high-order prediction mode in video coding |
| CN111698517B (en) * | 2020-06-29 | 2022-07-12 | Oppo广东移动通信有限公司 | Method, apparatus, electronic device and readable storage medium for determining motion vector |
-
2003
- 2003-06-27 CN CN 03148030 patent/CN1263309C/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| CN1568009A (en) | 2005-01-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9609322B2 (en) | Image encoding apparatus, image encoding method, image decoding apparatus, and image decoding method | |
| US7120197B2 (en) | Motion compensation loop with filtering | |
| CN1314272C (en) | Prediction method, apparatus, and medium for video encoder | |
| KR100897880B1 (en) | Bi-directional predicting method for video coding/decoding | |
| CN101783957B (en) | A video predictive coding method and device | |
| CN102077599B (en) | Apparatus and method for high-quality intra-mode prediction in a video encoder | |
| CN1526204A (en) | Interpolation of video compressed frames | |
| CN1674680A (en) | An enhanced in-frame predictive mode coding method | |
| CN1647540A (en) | Systems and methods for providing a single-layer video-encoded bitstream suitable for reduced-complexity decoding | |
| US20090016443A1 (en) | Inter mode determination method for video encoding | |
| WO2007077989A1 (en) | Video encoding method, decoding method, device thereof, program thereof, and storage medium containing the program | |
| US20090028241A1 (en) | Device and method of coding moving image and device and method of decoding moving image | |
| CN1209928C (en) | Inframe coding frame coding method using inframe prediction based on prediction blockgroup | |
| CN1615020A (en) | Method for pridicting sortable complex in frame | |
| CN1604650A (en) | Method for hierarchical motion estimation | |
| CN1206994A (en) | Signal encoding device and method, signal recording medium and signal transmission method | |
| CN1263309C (en) | Motion vector prediction method used for video coding | |
| CN1708134A (en) | Method and apparatus for estimating motion | |
| CN1941914A (en) | Method and apparatus for predicting DC coefficient in transform domain | |
| CN101072355B (en) | A Weighted Predictive Motion Compensation Method | |
| JP4642033B2 (en) | A method for obtaining a reference block of an image by an encoding method in which the number of reference frames is fixed. | |
| JP2000032468A (en) | Image encoding method and recording medium recording motion compensation mode selection program | |
| CN1271571C (en) | Prognostic image generating method used for video frequency coding | |
| CN1523897A (en) | Method and device for intra-frame prediction in video codec | |
| Dang | A high performance parallel architecture of H. 264 intra prediction for motion estimation |
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 | ||
| ASS | Succession or assignment of patent right |
Owner name: UNITED XINYUAN DIGITAL AUDIO-VIDEO TECHNOLOGY (BE Free format text: FORMER OWNER: INST. OF COMPUTING TECHN. ACADEMIA SINICA Effective date: 20080328 |
|
| C41 | Transfer of patent application or patent right or utility model | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20080328 Address after: Beijing city Haidian District East Road No. 1 Yingchuang power building block A room 701 Patentee after: Lianhe Xinyuan Digit Audio-Frequency Technology Co., Ltd., Beijing Address before: Digital room (Institute of Physics), Institute of computing, Chinese Academy of Sciences, South Road, Zhongguancun, Haidian District, Beijing 6, China Patentee before: Institute of Computing Technology, Chinese Academy of Sciences |
|
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20060705 Termination date: 20210627 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |