[go: up one dir, main page]

CN102215395B - Video coding and decoding method and device - Google Patents

Video coding and decoding method and device Download PDF

Info

Publication number
CN102215395B
CN102215395B CN 201010237812 CN201010237812A CN102215395B CN 102215395 B CN102215395 B CN 102215395B CN 201010237812 CN201010237812 CN 201010237812 CN 201010237812 A CN201010237812 A CN 201010237812A CN 102215395 B CN102215395 B CN 102215395B
Authority
CN
China
Prior art keywords
image block
sub
motion vector
block
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN 201010237812
Other languages
Chinese (zh)
Other versions
CN102215395A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN 201010237812 priority Critical patent/CN102215395B/en
Publication of CN102215395A publication Critical patent/CN102215395A/en
Application granted granted Critical
Publication of CN102215395B publication Critical patent/CN102215395B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

一种编码方法,包括:在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量;根据所述运动矢量和所述参考运动矢量,得到运动矢量差值;将所述运动矢量差值写入到码流中,并发送给解码端。本发明实施例还提供了一种执行所述编码方法的编码装置。

An encoding method, comprising: selecting an irregular division mode among a plurality of preset irregular division modes to irregularly divide an image block to be encoded to obtain at least two different sub-image blocks, and according to the sub-image blocks Obtain the reference image block of the sub-image block according to the pixel value of the sub-image block; obtain the motion vector of the sub-image block of the image block to be encoded according to the reference image block; obtain the motion vector of the sub-image block of the image block to be encoded; Obtain the reference motion vector of the sub-image block from the encoded peripheral block; obtain the motion vector difference value according to the motion vector and the reference motion vector; write the motion vector difference value into the code stream and send it to the decoder end. The embodiment of the present invention also provides an encoding device for executing the encoding method.

Description

一种视频编解码方法和装置A video encoding and decoding method and device

技术领域 technical field

本发明涉及视频编解码领域,特别涉及一种不规则子图像块划分的视频编解码方法和装置。The invention relates to the field of video codec, in particular to a video codec method and device for dividing irregular sub-image blocks.

背景技术 Background technique

在现有的视频编解码技术中,一般都是通过将当前帧图像的图像块的像素值与参考图像块的像素值作差得到残差矩阵,然后将得到的残差矩阵经过量化,变换和熵编码后写入码流中,与运动矢量信息一起传送给解码端。而解码端则从得到的码流中读取比特流,然后经过反量化、反变换,得到相应的残差,然后再根据码流中的运动矢量信息,获取当前图像块的参考图像块,将当前图像块的残差与参考图像块的像素值相加,得到当前图像块的像素值。In the existing video coding and decoding technology, the residual matrix is generally obtained by making a difference between the pixel value of the image block of the current frame image and the pixel value of the reference image block, and then the obtained residual matrix is quantized, transformed and After entropy encoding, it is written into the code stream and sent to the decoding end together with the motion vector information. The decoding end reads the bit stream from the obtained code stream, and then undergoes inverse quantization and inverse transformation to obtain the corresponding residual, and then obtains the reference image block of the current image block according to the motion vector information in the code stream, and converts The residual of the current image block is added to the pixel value of the reference image block to obtain the pixel value of the current image block.

在现有技术的编解码过程中,无论是残差的计算,还是参考图像块的查找,都是以图像块的子图像块为单位进行的,而现有技术也出现了相应的用于划分子图像块的规则划分和不规则划分技术。规则划分是将图像块划分成完全相同的正方形子图像块,其优点是各种参数的获取比较简单,比如用于预测参考图像位置的参考运动矢量,但其缺点就是完全相同的正方形子图像块的形状往往与图像中的物体轮廓相差很大,从而提高了编解码中像素预测的难度。相应的,不规则划分技术则是将图像块划分成形状各异的长方形、三角形、甚至五边形及不规则四边形,以适应不同种类的图像的要求,可以极大地解决规则划分成的像素预测方面的问题,但是相应的,由于形状的不规则,非规则划分技术也面对着用于计算图像块的运动矢量的参考运动矢量参数的难题。In the encoding and decoding process of the prior art, both the calculation of the residual and the search of the reference image block are carried out in units of the sub-image blocks of the image block, and there are corresponding methods for dividing Regular division and irregular division technology of sub-image blocks. Regular division is to divide the image block into identical square sub-image blocks. Its advantage is that the acquisition of various parameters is relatively simple, such as the reference motion vector used to predict the position of the reference image, but its disadvantage is that the exact same square sub-image blocks The shape of the image is often very different from the outline of the object in the image, which increases the difficulty of pixel prediction in encoding and decoding. Correspondingly, the irregular division technology is to divide the image block into rectangles, triangles, even pentagons and irregular quadrilaterals of different shapes, so as to meet the requirements of different types of images, which can greatly solve the pixel prediction problem of regular division. However, correspondingly, due to the irregular shape, the non-regular division technology also faces the problem of reference motion vector parameters used to calculate the motion vector of the image block.

因此,有必要提供一种编解码方法和装置,以可以简单的获得不规则划分中的子图像块的参考运动矢量。Therefore, it is necessary to provide an encoding and decoding method and device for simply obtaining reference motion vectors of sub-image blocks in irregular division.

发明内容Contents of the invention

本发明实施例提供了一种编码方法,包括:在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;根据所述待编码图像块的子图像块的已编码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量;根据所述运动矢量和所述参考运动矢量,得到运动矢量差值;将所述运动矢量差值写入到码流中,并发送给解码端。本发明实施例还提供了一种执行所述编码方法的编码装置。An embodiment of the present invention provides an encoding method, comprising: selecting an irregular division mode among a plurality of preset irregular division modes to divide an image block to be encoded irregularly to obtain at least two different sub-image blocks, Obtain the reference image block of the sub-image block according to the pixel value of the sub-image block; obtain the motion vector of the sub-image block of the image block to be encoded according to the reference image block; obtain the motion vector of the sub-image block of the image block to be encoded according to the image block to be encoded The coded peripheral block of the sub-image block and the irregular division method of the image block obtain the reference motion vector of the sub-image block; according to the motion vector and the reference motion vector, a motion vector difference is obtained; the motion vector The vector difference is written into the code stream and sent to the decoder. The embodiment of the present invention also provides an encoding device for executing the encoding method.

本发明实施例还相应的提供了一种解码方法,包括从码流中获得图像块的不规则划分方式,获得待解码的图像块的子图像块的运动矢量差值;从所述待解码图像块的子图像块的已解码的周边块和待解码图像块的不规则划分方式,获得子图像块的参考运动矢量;根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;根据所述运动矢量获得所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码,本发明实施例还提供了一种执行所述解码方法的解码装置。The embodiment of the present invention also provides a corresponding decoding method, including obtaining the irregular division mode of the image block from the code stream, and obtaining the motion vector difference value of the sub-image block of the image block to be decoded; from the image to be decoded According to the irregular division method of the decoded peripheral blocks of the sub-image block and the image block to be decoded, the reference motion vector of the sub-image block is obtained; according to the reference motion vector of the sub-image block and the difference value of the motion vector, the The motion vector of the sub-image block; obtain the reference image block of the sub-image block according to the motion vector, and decode the sub-image block according to the reference sub-image block, the embodiment of the present invention also provides a A decoding device for performing the decoding method.

采用本发明实施例提供的编解码方法和装置,可以在一定的条件下简化参考运动矢量的获得和计算,节省了编解码系统的资源,提高了效率。The encoding and decoding method and device provided by the embodiment of the present invention can simplify the acquisition and calculation of the reference motion vector under certain conditions, save the resources of the encoding and decoding system, and improve the efficiency.

附图说明 Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.

图1所示为本发明实施例所提供的编码方法的示意图;FIG. 1 is a schematic diagram of an encoding method provided by an embodiment of the present invention;

图2所示为本发明实施例所提供的不规则划分方法的示意图;FIG. 2 is a schematic diagram of an irregular division method provided by an embodiment of the present invention;

图3所示为本发明实施例中的待编码块的周边块分布示意图;FIG. 3 is a schematic diagram showing the distribution of surrounding blocks of a block to be encoded in an embodiment of the present invention;

图4所示为本发明实施例所提供的编码装置的示意图;FIG. 4 is a schematic diagram of an encoding device provided by an embodiment of the present invention;

图5所示为本发明实施例所提供的解码方法的示意图;FIG. 5 is a schematic diagram of a decoding method provided by an embodiment of the present invention;

图6所示为本发明实施例所提供的解码装置的示意图。FIG. 6 is a schematic diagram of a decoding device provided by an embodiment of the present invention.

具体实施方式 Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

请参照图1,本发明实施例提供了一种视频编码方法,其包括:Referring to Fig. 1, an embodiment of the present invention provides a video coding method, which includes:

步骤101:在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;Step 101: Select an irregular division method among the preset irregular division methods to divide the image block to be coded irregularly to obtain at least two different sub-image blocks, and obtain according to the pixel values of the sub-image blocks a reference image block of the sub-image block;

在本发明实施例中,所述对待编码图像块进行不规则划分,包含了四种不规则划分方式,请参照图2a~2d,这四种划分方式分别为以45度或者135度划分线将待编码图像块划分成一个三角形的子图像块和一个五边形的子图像块(分别标识为Mode0和Mode1),以及以垂直的划分线和水平的划分线将待编码的图像块划分成两个尺寸不一致矩形的子图像块(分别标识为Mode2和Mode3),其中的参数n即为不规则划分的位置参数,用于表示所述划分线与所述待解码的图像块的交点的距离。In the embodiment of the present invention, the irregular division of the image block to be coded includes four irregular division methods, please refer to Figures 2a to 2d, these four division methods are divided into The image block to be encoded is divided into a triangular sub-image block and a pentagonal sub-image block (respectively identified as Mode0 and Mode1), and the image block to be encoded is divided into two by vertical dividing lines and horizontal dividing lines. Rectangular sub-image blocks with inconsistent sizes (respectively identified as Mode2 and Mode3), where the parameter n is an irregularly divided position parameter, which is used to indicate the distance between the dividing line and the intersection point of the image block to be decoded.

在上述划分方案中,当图像块采用图2a和图2b所示的划分方式时,如果n的值为0,则图像块被划分为两个三角形。由于图像块均由像素组成,因此Mode0和Mode1所对应的135度边界线及45度边界线是指由沿子图像块间的边界的像素组成的近似于135度和45度的线。In the above division scheme, when the division method shown in Fig. 2a and Fig. 2b is adopted for the image block, if the value of n is 0, the image block is divided into two triangles. Since the image blocks are composed of pixels, the 135-degree boundary line and the 45-degree boundary line corresponding to Mode0 and Mode1 refer to lines approximately 135-degree and 45-degree composed of pixels along the boundaries between sub-image blocks.

而所述本发明实施例中的不规则划分方式的选取、位置参数的确认、以及参考图像块的确认,可以通过将预设的不规则划分方式、以及可以选用的位置参数全部尝试一边,并搜索到相应的最佳参考图像块,最后将结果进行比较,从中选取最佳方案。在本发明实施例中,所述最佳方案可以为划分出来的子图像块与搜索到的参考图像块像素最接近的划分方式及相应的位置参数,当然也可以根据其他需求对这一最佳方案进行调整。The selection of the irregular division method, the confirmation of the position parameter, and the confirmation of the reference image block in the embodiment of the present invention can be done by trying all the preset irregular division mode and the selectable position parameters, and The corresponding optimal reference image block is searched, and finally the results are compared to select the best solution. In the embodiment of the present invention, the optimal solution may be the division method and corresponding position parameters of the divided sub-image blocks closest to the searched reference image block pixels. Of course, this optimal solution may also be adjusted according to other requirements The plan is adjusted.

步骤102:,根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;Step 102: Obtain a motion vector of a sub-image block of the image block to be encoded according to the reference image block;

步骤103:根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量;Step 103: Obtain a reference motion vector of the sub-image block according to the coded surrounding blocks of the sub-image block of the image block to be encoded;

具体的:specific:

首先,判断所述已编码的周边块是否符合预设的条件,在本发明实施例中,所述预设的条件包括:First, it is judged whether the encoded peripheral blocks meet the preset conditions. In the embodiment of the present invention, the preset conditions include:

所述周边块采用了与待编码的图像块相同的不规则划分方式;The surrounding blocks adopt the same irregular division method as the image block to be coded;

所述周边块的参考图像块与所述子图像块的参考图像块处于同一个图像中。The reference image block of the peripheral block and the reference image block of the sub-image block are in the same image.

然后,如果有唯一的一个周边块满足预设的条件,则所述子图像块的参考运动矢量等于所述满足条件的周边块的运动矢量。Then, if there is only one peripheral block that satisfies the preset condition, the reference motion vector of the sub-image block is equal to the motion vector of the peripheral block that satisfies the condition.

如果所述已编码的周边块中有多个满足上述条件,则所述子图像块的参考运动矢量等于满足条件的周边块中的位置参数与待编码图像块最接近的那一个周边块的运动矢量。在本发明实施例中,所述最接近可以为位置参数间的差值最小,或者位置参数间的差值的绝对值最小。If more than one of the coded peripheral blocks meets the above conditions, the reference motion vector of the sub-image block is equal to the motion of the peripheral block whose position parameter is closest to the image block to be coded among the peripheral blocks that meet the conditions vector. In the embodiment of the present invention, the closest may be that the difference between the location parameters is the smallest, or the absolute value of the difference between the location parameters is the smallest.

如果有多个满足条件的周边块的位置参数相同,且同样接近于所述待编码的图像块的位置参数,则所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值,或周边块的运动矢量的平均值取整。If the position parameters of multiple satisfying surrounding blocks are the same and are also close to the position parameters of the image block to be encoded, the reference motion vector of the sub-image block is the same as that of the multiple satisfying surrounding blocks. The average value of motion vectors, or the average value of motion vectors of surrounding blocks is rounded.

在本发明实施例中,所述位置参数的接近与否可以从数值上进行判断,比如差值。In the embodiment of the present invention, whether the location parameter is close or not can be judged numerically, such as a difference.

步骤104:根据所述运动矢量和所述参考运动矢量,得到运动矢量差值;Step 104: Obtain a motion vector difference according to the motion vector and the reference motion vector;

其中,在本发明实施例中,所述根据所述运动适量和所述参考运动矢量得到运动矢量差值,可以通过将二者做差得到,在其他可选择的实施例中,也可以通过其他的数学方法,建立运动矢量差值与运动矢量和参考运动矢量二者之间的逻辑关系,比如相除、对数计算等。Wherein, in the embodiment of the present invention, the motion vector difference obtained according to the appropriate amount of motion and the reference motion vector can be obtained by making a difference between the two, and in other optional embodiments, it can also be obtained by other Mathematical methods to establish the logical relationship between the motion vector difference and the motion vector and the reference motion vector, such as division, logarithmic calculation, etc.

步骤105:将所述运动矢量差值写入到码流中。Step 105: Write the motion vector difference into the code stream.

采用本发明实施例所提供的编码方法,在预设的条件下,直接根据子图像块的运动矢量、子图像块所在图像块的不规则划分方式、子图像块周边块的不规则划分方式来获得子图像块的参考运动矢量,相较于现有技术中的复杂计算,可以有效地节省编码比特数,提高编码效率。Using the encoding method provided by the embodiment of the present invention, under preset conditions, directly according to the motion vector of the sub-image block, the irregular division mode of the image block where the sub-image block is located, and the irregular division mode of the surrounding blocks of the sub-image block Obtaining the reference motion vector of the sub-image block can effectively save the number of coding bits and improve the coding efficiency compared with the complicated calculation in the prior art.

需要指出的是,上述方案中的图像块、子图像块和周边块的参考图像块是为了叙述方便定义的名词。上述方案中的图像块是指图像编码的基本单位,一个图像块中可以包含一个到若干个子图像块。在现有的视频编解码技术中,图像块可以为宏块,大小为16x16,此时子图像块被称为子块,大小可以为16x16,16x8,8x16,8x8,8x4,4x8,4x4,或本发明所指出的不规则划分的块;图像块还可以为超宏块,大小为32x32。此时子图像块为宏块或宏块中的子块,大小可以为32x32,32x16,16x32,16x16,16x8,8x16,8x8,8x4,4x8,4x4,或本发明所指出的不规则划分的块。It should be pointed out that the image blocks, sub-image blocks and reference image blocks of surrounding blocks in the above solution are nouns defined for convenience of description. The image block in the above solutions refers to the basic unit of image coding, and one image block may contain one to several sub-image blocks. In the existing video coding and decoding technology, the image block can be a macroblock with a size of 16x16. At this time, the sub-image block is called a sub-block, and the size can be 16x16, 16x8, 8x16, 8x8, 8x4, 4x8, 4x4, or The irregularly divided blocks pointed out in the present invention; image blocks can also be super macroblocks with a size of 32x32. At this time, the sub-image block is a macroblock or a sub-block in a macroblock, and the size can be 32x32, 32x16, 16x32, 16x16, 16x8, 8x16, 8x8, 8x4, 4x8, 4x4, or the irregularly divided blocks pointed out by the present invention .

周边块是指与当前图像块,或当前子图像块块邻近的图像块或子图像块。其与当前图像块,或当前子图像块块的位置关系可以为相邻,或间隔固定的像素值。当前子图像块的周边块可以为图像块,或子图像块。The surrounding blocks refer to image blocks or sub-image blocks adjacent to the current image block or the current sub-image block. The positional relationship between it and the current image block, or the current sub-image block can be adjacent, or pixel values at a fixed interval. The surrounding blocks of the current sub-image block may be image blocks or sub-image blocks.

周边块的参考图像块可以为上述的图像块,或上述的子图像块。因此,若当前子图像块的周边块为图像块时,则当前子图像块的周边块的参考图像块可以为图像块;若当前子图像块的周边块为子图像块时,则当前子图像块的周边块的参考图像块可以为子图像块。The reference image blocks of the surrounding blocks may be the above-mentioned image blocks, or the above-mentioned sub-image blocks. Therefore, if the surrounding blocks of the current sub-image block are image blocks, the reference image blocks of the surrounding blocks of the current sub-image block can be image blocks; if the surrounding blocks of the current sub-image block are sub-image blocks, the current sub-image The reference image blocks of the peripheral blocks of the block may be sub-image blocks.

以下将给出一个进一步的实现方案。A further implementation will be given below.

以下实现方案中,由于当前图像块或子图像块的周边块可以为图像块,或子图像块,为便于描述统称为图像块,所有图像块的大小可以不一致,所有图像块的形状或划分方式可以不一致,图像块的大小按现有技术的方法确定。In the following implementation schemes, since the surrounding blocks of the current image block or sub-image block can be image blocks or sub-image blocks, they are collectively referred to as image blocks for the convenience of description. The sizes of all image blocks may be inconsistent, and the shapes or division methods of all image blocks It can be inconsistent, and the size of the image block is determined according to the method in the prior art.

如图3所示,设有图像块A,B,C,D和E。其中E为当前图像块,A为E的左相邻块,B为E的上相邻块,C为E的右上相邻块,D为E的左上相邻块。As shown in Figure 3, there are image blocks A, B, C, D and E. Where E is the current image block, A is the left adjacent block of E, B is the upper adjacent block of E, C is the upper right adjacent block of E, and D is the upper left adjacent block of E.

设图像块A,B,C,D的运动矢量为mvA,mvB,mvC,mvD。设图像块A,B,C,D和E的参考帧索引值为refA,refB,refC,refD和refE。Let the motion vectors of image blocks A, B, C, and D be mvA, mvB, mvC, and mvD. Suppose the reference frame index values of image blocks A, B, C, D and E are refA, refB, refC, refD and refE.

参考帧索引值指的是图像块的参考图像块所在的图像在视频序列中的位置。当两个图像块的参考帧索引值相同时,这两个图像块的参考图像块位于同一图像中。The reference frame index value refers to the position in the video sequence of the image where the reference image block of the image block is located. When the reference frame index values of two image blocks are the same, the reference image blocks of the two image blocks are located in the same image.

设图像块A,B,C,D和E的非规则块划分方式为ModeA,ModeB,ModeC,ModeD和ModeE。It is assumed that the irregular block division methods of the image blocks A, B, C, D and E are ModeA, ModeB, ModeC, ModeD and ModeE.

若图像块A,或,B,或,C,或D不可得或不使用非规则块划分,则设ModeA,或,ModeB,或,ModeC,或,ModeD的值为-1。If the image block A, or, B, or, C, or D is unavailable or does not use irregular block division, set the value of ModeA, or, ModeB, or, ModeC, or, ModeD to -1.

设图像块A,B,C,D和E的非规则块划分位置参数为posA,posB,posC,posD和posE。Let the irregular block division position parameters of image blocks A, B, C, D and E be posA, posB, posC, posD and posE.

若图像块A,或,B,或,C,或D不可得或不使用非规则块划分,则设posA,或,posB,或,posC,或,posD的值为一个足够大的数,如10000。If the image block A, or, B, or, C, or D is not available or does not use irregular block division, then set posA, or, posB, or, posC, or, the value of posD is a sufficiently large number, such as 10000.

当前图像块E的参考运动矢量(或成为预测运动矢量,predicted motionvector)为mvpE。The reference motion vector (or predictive motion vector, predicted motion vector) of the current image block E is mvpE.

mvpE的求取方法如下:The calculation method of mvpE is as follows:

若refA与refE值相等且A与E采用了相同不规则划分方式,则设CondionA值为1,否则CondionA值0,表达式为:ConditonA=(refA==refE)&&(ModeA==ModeE)。If the values of refA and refE are equal and A and E adopt the same irregular division method, set the value of CondionA to 1, otherwise the value of CondionA is 0, the expression is: ConditonA=(refA==refE)&&(ModeA==ModeE).

若refB与refE值相等且B与E采用了相同不规则划分方式,则设CondionB值为1,否则CondionB值0,表达式为:ConditonB=(refB==refE)&&(ModeB==ModeE)。If the values of refB and refE are equal and B and E adopt the same irregular division method, then set the value of CondionB to 1, otherwise the value of CondionB is 0, the expression is: ConditonB=(refB==refE)&&(ModeB==ModeE).

若refC与refE值相等且C与E采用了相同不规则划分方式,则设CondionC值为1,否则CondionC值0,表达式为:ConditonC=(refC==refE)&&(ModeC==ModeE)。If the values of refC and refE are equal and C and E adopt the same irregular division method, then set the value of CondionC to 1, otherwise the value of CondionC is 0, the expression is: ConditonC=(refC==refE)&&(ModeC==ModeE).

若refD与refE值相等且D与E采用了相同不规则划分方式,则设CondionD值为1,否则CondionD值0,表达式为:ConditonD=(refD==refE)&&(ModeD==ModeE)。If the values of refD and refE are equal and D and E adopt the same irregular division method, then set the value of CondionD to 1, otherwise the value of CondionD is 0, the expression is: ConditonD=(refD==refE)&&(ModeD==ModeE).

若ConditonA==1且ConditonB==0且ConditonC==0,则mvpE=mvA;If ConditonA==1 and ConditonB==0 and ConditonC==0, then mvpE=mvA;

若ConditonA==0且ConditonB==1且ConditonC==0,则mvpE=mvB;If ConditonA==0 and ConditonB==1 and ConditonC==0, then mvpE=mvB;

若ConditonA==0且ConditonB==0且ConditonC==1,则mvpE=mvC;If ConditonA==0 and ConditonB==0 and ConditonC==1, then mvpE=mvC;

若ConditonA,ConditonB和ConditonC有一个以上的值为1,则取相应的ConditonX值为1的图像块X的位置参数posX(X可以为A,或,B,或,C),分别计算posE与这些图像块位置参数(posX)的差值的绝对值,将能获得最小差值的绝对值图像块的运动矢量mvX(X可以为A,或,B,或,C)赋值给mvpE;If ConditonA, ConditonB and ConditonC have more than one value of 1, then get the position parameter posX of the image block X whose ConditonX value is 1 (X can be A, or, B, or, C), calculate posE and these respectively The absolute value of the difference of the image block position parameter (posX), the motion vector mvX (X can be A, or, B, or, C) of the absolute value image block that can obtain the smallest difference is assigned to mvpE;

若ConditonA,ConditonB和ConditonC有一个以上的值为1,且图像块X的位置参数posX(X可以为A,或,B,或,C)均相等且与posE的差值的绝对值均能获得最小差值的绝对值,则mvpE等于这些图像块的运动矢量的平均值,或mvpE等于这些图像块的运动矢量的平均值取整。If ConditonA, ConditonB and ConditonC have more than one value of 1, and the position parameter posX (X can be A, or, B, or, C) of the image block X is equal and the absolute value of the difference with posE can be obtained The absolute value of the minimum difference, then mvpE is equal to the average value of the motion vectors of these image blocks, or mvpE is equal to the average value of the motion vectors of these image blocks and rounded.

相应的,请参照图3,本发明实施例还提供一种相应的编码装置,以执行本发明所提供的编码方法,其包括:Correspondingly, please refer to FIG. 3 , the embodiment of the present invention also provides a corresponding encoding device to implement the encoding method provided by the present invention, which includes:

不规则划分模块210,用于在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;The irregular division module 210 is configured to select an irregular division mode among a plurality of preset irregular division modes to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, and according to the sub-image The pixel value of the block obtains the reference image block of the sub-image block;

运动矢量获得模块220,用于根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;A motion vector obtaining module 220, configured to obtain a motion vector of a sub-image block of the image block to be encoded according to the reference image block;

参考运动矢量获得模块230,根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量;The reference motion vector obtaining module 230 obtains the reference motion vector of the sub-image block according to the coded surrounding blocks of the sub-image block of the image block to be encoded;

所述根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量包括:The obtaining the reference motion vector of the sub-image block according to the encoded peripheral blocks of the sub-image block of the image block to be encoded includes:

选择符合预设条件的周边块;Select surrounding blocks that meet preset conditions;

根据所述符合预设条件的周边块来获得图像块的参考运动矢量,其中,Obtaining the reference motion vector of the image block according to the surrounding blocks meeting the preset conditions, wherein,

所述预设的条件包括:The preset conditions include:

所述周边块采用了与待编码的图像块相同的不规则划分方式;The surrounding blocks adopt the same irregular division method as the image block to be coded;

所述周边块的参考图像块与所述子图像块的参考图像块处于同一个图像中。The reference image block of the peripheral block and the reference image block of the sub-image block are in the same image.

然后,如果有唯一的一个周边块满足预设的条件,则所述子图像块的参考运动矢量等于所述满足条件的周边块的运动矢量。Then, if there is only one peripheral block that satisfies the preset condition, the reference motion vector of the sub-image block is equal to the motion vector of the peripheral block that satisfies the condition.

如果所述已编码的周边块中有多个满足上述条件,则所述子图像块的参考运动矢量等于满足条件的周边块中不规则划分的位置参数与待编码图像块最接近的那一个周边块的运动矢量,在本发明实施例中,所述最接近可以为位置参数的差值最小,或者位置参数的绝对值的差值最小。If more than one of the coded peripheral blocks meets the above conditions, the reference motion vector of the sub-image block is equal to the one whose irregularly divided position parameter is closest to the image block to be coded among the peripheral blocks that meet the conditions The motion vector of the block, in the embodiment of the present invention, the closest may be the smallest difference between position parameters, or the smallest difference between the absolute values of position parameters.

如果有多个满足条件的周边块的位置参数相同,且同样接近于所述待编码的图像块的位置参数,则所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值,或所述多个满足条件的周边块的运动矢量的平均值取整。If the position parameters of multiple satisfying surrounding blocks are the same and are also close to the position parameters of the image block to be encoded, the reference motion vector of the sub-image block is the same as that of the multiple satisfying surrounding blocks. The average value of the motion vectors, or the average value of the motion vectors of the plurality of surrounding blocks satisfying the condition is rounded.

运动矢量差值获得模块240,用于将所述运动矢量和所述参考运动矢量做差,得到运动矢量差值;A motion vector difference obtaining module 240, configured to make a difference between the motion vector and the reference motion vector to obtain a motion vector difference;

运动矢量差值写入模块250,用于将所述运动矢量差值写入到码流中。The motion vector difference value writing module 250 is configured to write the motion vector difference value into the code stream.

请参照图4,本发明还提供一种解码方法,其包括Referring to Fig. 4, the present invention also provides a decoding method, which includes

步骤301:从码流中获得待解码的图像块的子图像块的运动矢量差值;Step 301: Obtain the motion vector difference of the sub-image block of the image block to be decoded from the code stream;

步骤302:根据所述待解码图像块的子图像块的已解码的周边块,获得子图像块的参考运动矢量;Step 302: Obtain a reference motion vector of the sub-image block according to the decoded surrounding blocks of the sub-image block of the image block to be decoded;

具体的:specific:

首先,判断所述已解码的周边块是否符合预设的条件,在本发明实施例中,所述预设的条件包括:First, it is judged whether the decoded peripheral block meets the preset condition. In the embodiment of the present invention, the preset condition includes:

所述周边块采用了与待解码的图像块相同的不规则划分方式;The peripheral block adopts the same irregular division method as the image block to be decoded;

所述周边块的参考图像块与所述子图像块的参考图像块处于同一个图像中。The reference image block of the peripheral block and the reference image block of the sub-image block are in the same image.

然后,如果有唯一的一个周边块满足预设的条件,则所述子图像块的参考运动矢量等于所述满足条件的周边块的运动矢量。Then, if there is only one peripheral block that satisfies the preset condition, the reference motion vector of the sub-image block is equal to the motion vector of the peripheral block that satisfies the condition.

如果所述已解码的周边块中有多个满足上述条件,则所述子图像块的参考运动矢量等于满足条件的周边块中的位置参数与待解码图像块最接近的那一个周边块的运动矢量,在本发明实施例中,所述最接近可以为位置参数间的差值最小,或者位置参数间的差值的绝对值最小。If more than one of the decoded peripheral blocks meets the above conditions, the reference motion vector of the sub-image block is equal to the motion of the peripheral block whose position parameter is closest to the image block to be decoded among the peripheral blocks that satisfy the condition Vector, in the embodiment of the present invention, the closest may be that the difference between the position parameters is the smallest, or the absolute value of the difference between the position parameters is the smallest.

如果有多个满足条件的周边块的位置参数相同,则所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值,或周边块的运动矢量的平均值取整。If the position parameters of multiple surrounding blocks satisfying the condition are the same, the reference motion vector of the sub-image block is the average value of the motion vectors of the multiple surrounding blocks satisfying the condition, or the average value of the motion vectors of the surrounding blocks Rounding.

步骤303:根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;Step 303: Obtain the motion vector of the sub-image block according to the reference motion vector of the sub-image block and the motion vector difference;

所述根据所述运动矢量差值和所述参考运动矢量得到运动矢量差值,可以按照编码端的运动矢量差值的生成方法进行逆运算得到,可以为所述运动矢量差值和所述参考运动矢量之和,或所述运动矢量差值和所述参考运动矢量之积等。The motion vector difference obtained according to the motion vector difference and the reference motion vector can be obtained by inverse operation according to the generation method of the motion vector difference at the encoding end, which can be the motion vector difference and the reference motion vector sum, or the product of the motion vector difference and the reference motion vector, etc.

步骤304:根据所述运动矢量查找所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码。Step 304: Find a reference image block of the sub-image block according to the motion vector, and decode the sub-image block according to the reference sub-image block.

需要指出的是,上述方案中的图像块、子图像块和周边块的参考图像块是为了叙述方便定义的名词。上述方案中的图像块是指图像编码的基本单位,一个图像块中可以包含一个到若干个子图像块。在现有的视频编解码技术中,图像块可以为宏块,大小为16x16,此时子图像块被称为子块,大小可以为16x16,16x8,8x16,8x8,8x4,4x8,4x4;图像块还可以为超宏块,大小为32x32。此时子图像块为宏块或宏块中的子块,大小可以为32x32,32x16,16x32,16x16,16x8,8x16,8x8,8x4,4x8,4x4。It should be pointed out that the image blocks, sub-image blocks and reference image blocks of surrounding blocks in the above solution are nouns defined for convenience of description. The image block in the above solutions refers to the basic unit of image coding, and one image block may contain one to several sub-image blocks. In the existing video codec technology, the image block can be a macroblock with a size of 16x16. At this time, the sub-image block is called a sub-block, and the size can be 16x16, 16x8, 8x16, 8x8, 8x4, 4x8, 4x4; A block can also be a super macroblock, with a size of 32x32. At this time, the sub-image block is a macroblock or a sub-block in a macroblock, and the size can be 32x32, 32x16, 16x32, 16x16, 16x8, 8x16, 8x8, 8x4, 4x8, 4x4.

周边块是指与当前图像块,或当前子图像块块邻近的图像块或子图像块。其与当前图像块,或当前子图像块块的位置关系可以为相邻,或间隔固定的像素值。当前子图像块的周边块可以为图像块,或子图像块。The surrounding blocks refer to image blocks or sub-image blocks adjacent to the current image block or the current sub-image block. The positional relationship between it and the current image block, or the current sub-image block can be adjacent, or pixel values at a fixed interval. The surrounding blocks of the current sub-image block may be image blocks or sub-image blocks.

周边块的参考图像块可以为上述的图像块,或上述的子图像块。因此,若当前子图像块的周边块为图像块时,则当前子图像块的周边块的参考图像块可以为图像块;若当前子图像块的周边块为子图像块时,则当前子图像块的周边块的参考图像块可以为子图像块。The reference image blocks of the surrounding blocks may be the above-mentioned image blocks, or the above-mentioned sub-image blocks. Therefore, if the surrounding blocks of the current sub-image block are image blocks, the reference image blocks of the surrounding blocks of the current sub-image block can be image blocks; if the surrounding blocks of the current sub-image block are sub-image blocks, the current sub-image The reference image blocks of the peripheral blocks of the block may be sub-image blocks.

进一步的,further,

请参照图3,设有图像块A,B,C,D和E。其中E为当前图像块,A为E的左相邻块,B为E的上相邻块,C为E的右上相邻块,D为E的左上相邻块。Referring to FIG. 3 , image blocks A, B, C, D and E are provided. Where E is the current image block, A is the left adjacent block of E, B is the upper adjacent block of E, C is the upper right adjacent block of E, and D is the upper left adjacent block of E.

设图像块A,B,C,D的运动矢量为mvA,mvB,mvC,mvD。设图像块A,B,C,D和E的参考帧索引值为refA,refB,refC,refD和refE。Let the motion vectors of image blocks A, B, C, and D be mvA, mvB, mvC, and mvD. Suppose the reference frame index values of image blocks A, B, C, D and E are refA, refB, refC, refD and refE.

参考帧索引值指的是图像块的参考图像块所在的图像在视频序列中的位置。当两个图像块的参考帧索引值相同时,这两个图像块的参考图像块位于同一图像中。The reference frame index value refers to the position in the video sequence of the image where the reference image block of the image block is located. When the reference frame index values of two image blocks are the same, the reference image blocks of the two image blocks are located in the same image.

设图像块A,B,C,D和E的非规则块划分方式为ModeA,ModeB,ModeC,ModeD和ModeE。It is assumed that the irregular block division methods of the image blocks A, B, C, D and E are ModeA, ModeB, ModeC, ModeD and ModeE.

若图像块A,或,B,或,C,或D不可得或不使用非规则块划分,则设ModeA,或,ModeB,或,ModeC,或,ModeD的值为-1。If the image block A, or, B, or, C, or D is unavailable or does not use irregular block division, set the value of ModeA, or, ModeB, or, ModeC, or, ModeD to -1.

设图像块A,B,C,D和E的非规则块划分位置参数为posA,posB,posC,posD和posE。Let the irregular block division position parameters of image blocks A, B, C, D and E be posA, posB, posC, posD and posE.

若图像块A,或,B,或,C,或D不可得或不使用非规则块划分,则设posA,或,posB,或,posC,或,posD的值为一个足够大的数,如10000。If the image block A, or, B, or, C, or D is not available or does not use irregular block division, then set posA, or, posB, or, posC, or, the value of posD is a sufficiently large number, such as 10000.

当前图像块E的参考运动矢量(或成为预测运动矢量,predicted motionvector)为mvpE。The reference motion vector (or predictive motion vector, predicted motion vector) of the current image block E is mvpE.

mvpE的求取方法如下:The calculation method of mvpE is as follows:

若refA与refE值相等且A与E采用了相同不规则划分方式,则设CondionA值为1,否则CondionA值0,表达式为:ConditonA=(refA==refE)&&(ModeA==ModeE)。If the values of refA and refE are equal and A and E adopt the same irregular division method, set the value of CondionA to 1, otherwise the value of CondionA is 0, the expression is: ConditonA=(refA==refE)&&(ModeA==ModeE).

若refB与refE值相等且B与E采用了相同不规则划分方式,则设CondionB值为1,否则CondionB值0,表达式为:ConditonB=(refB==refE)&&(ModeB==ModeE)。If the values of refB and refE are equal and B and E adopt the same irregular division method, then set the value of CondionB to 1, otherwise the value of CondionB is 0, the expression is: ConditonB=(refB==refE)&&(ModeB==ModeE).

若refC与refE值相等且C与E采用了相同不规则划分方式,则设CondionC值为1,否则CondionC值0,表达式为:ConditonC=(refC==refE)&&(ModeC==ModeE)。If the values of refC and refE are equal and C and E adopt the same irregular division method, then set the value of CondionC to 1, otherwise the value of CondionC is 0, the expression is: ConditonC=(refC==refE)&&(ModeC==ModeE).

若refD与refE值相等且D与E采用了相同不规则划分方式,则设CondionD值为1,否则CondionD值0,表达式为:ConditonD=(refD==refE)&&(ModeD==ModeE)。If the values of refD and refE are equal and D and E adopt the same irregular division method, then set the value of CondionD to 1, otherwise the value of CondionD is 0, the expression is: ConditonD=(refD==refE)&&(ModeD==ModeE).

若ConditonA==1且ConditonB==0且ConditonC==0,则mvpE=mvA;If ConditonA==1 and ConditonB==0 and ConditonC==0, then mvpE=mvA;

若ConditonA==0且ConditonB==1且ConditonC==0,则mvpE=mvB;If ConditonA==0 and ConditonB==1 and ConditonC==0, then mvpE=mvB;

若ConditonA==0且ConditonB==0且ConditonC==1,则mvpE=mvC;If ConditonA==0 and ConditonB==0 and ConditonC==1, then mvpE=mvC;

若ConditonA,ConditonB和ConditonC有一个以上的值为1,则取相应的ConditonX值为1的图像块X的位置参数posX(X可以为A,或,B,或,C),分别计算posE与这些图像块位置参数(posX)的差值的绝对值,将能获得最小差值的绝对值图像块的运动矢量mvX(X可以为A,或,B,或,C)赋值给mvpE;If ConditonA, ConditonB and ConditonC have more than one value of 1, then get the position parameter posX of the image block X whose ConditonX value is 1 (X can be A, or, B, or, C), calculate posE and these respectively The absolute value of the difference of the image block position parameter (posX), the motion vector mvX (X can be A, or, B, or, C) of the absolute value image block that can obtain the smallest difference is assigned to mvpE;

若ConditonA,ConditonB和ConditonC有一个以上的值为1,且图像块X的位置参数posX(X可以为A,或,B,或,C)均相等且与posE的差值的绝对值均能获得最小差值的绝对值,则mvpE等于这些图像块的运动矢量的平均值,或mvpE等于这些图像块的运动矢量的平均值取整。If ConditonA, ConditonB and ConditonC have more than one value of 1, and the position parameter posX (X can be A, or, B, or, C) of the image block X is equal and the absolute value of the difference with posE can be obtained The absolute value of the minimum difference, then mvpE is equal to the average value of the motion vectors of these image blocks, or mvpE is equal to the average value of the motion vectors of these image blocks and rounded.

请参照图5,本发明实施例还提供一种解码装置400,用于执行上述解码程序,其包括:Please refer to FIG. 5 , the embodiment of the present invention also provides a decoding device 400 for executing the above decoding program, which includes:

运动矢量差值获得模块410,用于从码流中获得待解码的图像块的子图像块的运动矢量差值;The motion vector difference obtaining module 410 is used to obtain the motion vector difference of the sub-image block of the image block to be decoded from the code stream;

参考运动矢量获得模块420,用于根据所述待解码图像块的子图像块的已解码的周边块,获得子图像块的参考运动矢量;A reference motion vector obtaining module 420, configured to obtain a reference motion vector of a sub-image block of the image block to be decoded according to decoded surrounding blocks of the sub-image block;

具体的:specific:

首先,参考运动矢量获得模块420判断所述已解码的周边块是否符合预设的条件,在本发明实施例中,所述预设的条件包括:First, the reference motion vector obtaining module 420 judges whether the decoded peripheral blocks meet the preset conditions. In the embodiment of the present invention, the preset conditions include:

所述周边块采用了与待解码的图像块相同的不规则划分方式;The peripheral block adopts the same irregular division method as the image block to be decoded;

所述周边块的参考图像块与所述子图像块的参考图像块处于同一个图像中。The reference image block of the peripheral block and the reference image block of the sub-image block are in the same image.

然后,如果有唯一的一个周边块满足预设的条件,则所述子图像块的参考运动矢量等于所述满足条件的周边块的运动矢量。Then, if there is only one peripheral block that satisfies the preset condition, the reference motion vector of the sub-image block is equal to the motion vector of the peripheral block that satisfies the condition.

如果所述已解码的周边块中有多个满足上述条件,则所述子图像块的参考运动矢量等于满足条件的周边块中不规则划分的位置参数与待解码图像块最接近的那一个周边块的运动矢量,在本发明实施例中,所述最接近可以为位置参数的差值最小,或者位置参数的绝对值的差值最小。If more than one of the decoded surrounding blocks satisfies the above conditions, the reference motion vector of the sub-image block is equal to the surrounding block whose irregularly divided position parameter is closest to the image block to be decoded among the surrounding blocks that meet the conditions The motion vector of the block, in the embodiment of the present invention, the closest may be the smallest difference between position parameters, or the smallest difference between the absolute values of position parameters.

如果有多个满足条件的周边块的位置参数相同,且同样接近于所述待解码的图像块的位置参数,则所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值,或所述多个满足条件的周边块的运动矢量的平均值取整。If the position parameters of multiple satisfying surrounding blocks are the same and are also close to the position parameters of the image block to be decoded, the reference motion vector of the sub-image block is the reference motion vector of the multiple satisfying surrounding blocks The average value of the motion vectors, or the average value of the motion vectors of the plurality of surrounding blocks satisfying the condition is rounded.

运动矢量获得模块430,用于根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;A motion vector obtaining module 430, configured to obtain the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block;

解码模块440,用于根据所述运动矢量查找所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码。The decoding module 440 is configured to search for a reference image block of the sub-image block according to the motion vector, and decode the sub-image block according to the reference sub-image block.

在本发明实施例所提供的编码方法或解码方法中,根据图像内容或纹理的连续性,本发明还提供了又一种根据待编码或待解码图像块的子图像块的已编码/已解码的周边块,获得子图像块的参考运动矢量的方法,所述方法包括:In the encoding method or decoding method provided by the embodiment of the present invention, according to the continuity of the image content or texture, the present invention also provides another encoding/decoding method based on the sub-image block of the image block to be encoded or decoded A method for obtaining a reference motion vector of a sub-image block, the method comprising:

首先,判断所述已编码/已解码的周边块是否符合预设的条件;First, judging whether the encoded/decoded peripheral blocks meet a preset condition;

在本发明实施例中,所述预设的条件包括:所述周边块采用了与待编码/待解码的图像块相同的不规则划分方式。In the embodiment of the present invention, the preset condition includes: the peripheral block adopts the same irregular division method as the image block to be encoded/decoded.

其中,当待编码/待解码图像块采用的是图2(d)中所示的通过水平划分线将图像块划分成两个子图像块的水平划分方式时,如果待编码/待解码图像块的左相邻块也采用了水平划分方式,则根据当前编码/解码图像块的左相邻块的运动矢量获得当前图像块的参考运动矢量;如果待编码/待解码图像块的左相邻块没有采用水平划分方式且当前编码图像块的上相邻块采用了水平划分方式,则根据待编码/待解码图像块的上相邻块的运动矢量获得待编码/待解码图像块的参考运动矢量。Wherein, when the image block to be coded/decoded adopts the horizontal division method of dividing the image block into two sub-image blocks by the horizontal dividing line shown in Fig. 2(d), if the image block to be coded/decoded The left adjacent block also adopts the horizontal partition method, then obtain the reference motion vector of the current image block according to the motion vector of the left adjacent block of the current coded/decoded image block; if the left adjacent block of the image block to be encoded/decoded does not have If the horizontal division mode is adopted and the upper adjacent block of the currently encoded image block adopts the horizontal division mode, then the reference motion vector of the image block to be encoded/decoded is obtained according to the motion vector of the upper adjacent block of the image block to be encoded/decoded.

当待编码/待解码图像块采用图2(c)中所示的通过垂直划分线将图像块划分成两个子图像块的垂直划分方式时,如果待编码/待解码图像块的上相邻块也采用了垂直划分方式,则根据待编码/待解码图像块的上相邻块的运动矢量获得待编码/待解码的图像块的参考运动矢量;若待编码/待解码图像块的上相邻块没有采用垂直划分方式而待编码/待解码图像块的左相邻块采用了垂直划分方式,则根据待编码/待解码图像块左边的相邻图像块的运动矢量获得待编码/待解码图像块的参考运动矢量。When the image block to be coded/decoded adopts the vertical division method of dividing the image block into two sub-image blocks by the vertical division line shown in Fig. 2(c), if the upper adjacent block of the image block to be coded/decoded The vertical division method is also adopted, and the reference motion vector of the image block to be encoded/decoded is obtained according to the motion vector of the upper adjacent block of the image block to be encoded/decoded; if the upper adjacent block of the image block to be encoded/decoded If the block does not use the vertical division method and the left adjacent block of the image block to be encoded/decoded adopts the vertical division method, then the image to be encoded/decoded is obtained according to the motion vector of the adjacent image block to the left of the image block to be encoded/decoded The block's reference motion vector.

进一步的,上述根据待编码/待解码图像块的上边或左边的相邻图像块的运动矢量获得当前图像块的参考运动矢量的方法可以为:Further, the method for obtaining the reference motion vector of the current image block according to the motion vectors of the adjacent image blocks above or to the left of the image block to be encoded/decoded may be:

当待编码/待解码图像块采用的是图2(d)中所示的通过水平划分线将图像块划分成两个子图像块的水平划分方式时,如果待编码/待解码图像块的左相邻块也采用了水平划分方式,则待编码/待解码图像块的参考运动矢量等于所述待编码/待解码图像块的左相邻块的运动矢量;如果待编码/待解码图像块的左相邻块没有采用水平划分方式且当前待编码/待解码的图像块的上相邻块采用了水平划分方式,则待编码/待解码图像块的参考运动矢量等于待编码/待解码图像块的上相邻块的运动矢量;When the image block to be encoded/decoded adopts the horizontal division method of dividing the image block into two sub-image blocks by the horizontal dividing line shown in Figure 2(d), if the left phase of the image block to be encoded/decoded The adjacent block also adopts the horizontal division method, then the reference motion vector of the image block to be encoded/decoded is equal to the motion vector of the left adjacent block of the image block to be encoded/decoded; if the left adjacent block of the image block to be encoded/decoded If the adjacent block does not adopt the horizontal division method and the upper adjacent block of the current image block to be encoded/decoded adopts the horizontal division method, then the reference motion vector of the image block to be encoded/decoded is equal to the reference motion vector of the image block to be encoded/decoded The motion vector of the upper adjacent block;

当待编码/待解码图像块采用图2(c)中所示的通过垂直划分线将图像块划分成两个子图像块的划分方式时,如果待编码/待解码图像块的上相邻块也采用了垂直划分方式,则待编码/待解码的图像块的参考运动矢量等于待编码/待解码图像块上相邻块的运动矢量;若待编码/待解码图像块的上相邻块没有采用垂直划分方式而待编码/待解码图像块的左相邻块采用了垂直划分方式,则待编码/待解码图像块的参考运动矢量等于待编码/待解码图像块的左相邻块的运动矢量。When the image block to be encoded/decoded is divided into two sub-image blocks by the vertical dividing line shown in Fig. 2(c), if the upper adjacent block of the image block to be encoded/decoded is also If the vertical division method is adopted, the reference motion vector of the image block to be encoded/decoded is equal to the motion vector of the adjacent block on the image block to be encoded/decoded; if the upper adjacent block of the image block to be encoded/decoded is not used Vertical division method and the left adjacent block of the image block to be encoded/decoded adopts the vertical division method, then the reference motion vector of the image block to be encoded/decoded is equal to the motion vector of the left adjacent block of the image block to be encoded/decoded .

需要理解,在本实施例中所述的水平划分方式和垂直划分方式包括将图像块划分成两个不等大小的矩形子图像块的不规则划分方式,以及将图像块均匀划分成两个相等的图像块的规则划分方式(16x8或8x16)。It should be understood that the horizontal division method and the vertical division method described in this embodiment include the irregular division method of dividing the image block into two rectangular sub-image blocks of different sizes, and the even division of the image block into two equal sub-image blocks. The regular division of image blocks (16x8 or 8x16).

当待编码/待解码图像块采用图2(a)或图2(b)中所示的方法将图像块划分成一个三角形及一个五边形时,可根据当待编码/待解码图像块周边块中采用了与待编码/待解码图像块的不规则划分方式相同的周边块的运动矢量式求取待编码/待解码图像块的参考运动矢量。When the image block to be encoded/decoded is divided into a triangle and a pentagon using the method shown in Figure 2(a) or Figure 2(b), the surrounding area of the image block to be encoded/decoded can be The reference motion vector of the image block to be encoded/decoded is obtained by using the motion vector formula of the surrounding blocks in the same irregular division mode as the image block to be encoded/decoded.

作为可选择的实施例,本发明还提供一种根据待编码/待解码图像块的上边或左边的相邻图像块的运动矢量获得当前图像块的参考运动矢量的方法:As an optional embodiment, the present invention also provides a method for obtaining the reference motion vector of the current image block according to the motion vectors of the adjacent image blocks above or to the left of the image block to be encoded/decoded:

根据当前图像块的参考帧索引值,及当前图像块上相邻块的参考帧索引值及其运动矢量,获得当前图像块的参考运动适量;或者According to the reference frame index value of the current image block, and the reference frame index value of the adjacent block on the current image block and its motion vector, obtain the reference motion amount of the current image block; or

根据当前图像块的参考帧索引值,以及当前图像块左相邻块(即处于当前图像块左方的周边块)的参考帧索引值及其运动矢量,获得当前图像块的参考运动矢量。The reference motion vector of the current image block is obtained according to the reference frame index value of the current image block, and the reference frame index value of the left adjacent block of the current image block (ie, the peripheral block on the left side of the current image block) and its motion vector.

以下将给出一个进一步的实现方案。A further implementation will be given below.

以下实现方案中,由于当前图像块或子图像块的周边块可以为图像块,或子图像块,为便于描述统称为图像块,所有图像块的大小可以不一致,所有图像块的形状或划分方式可以不一致,图像块的大小按现有技术的方法确定。In the following implementation schemes, since the surrounding blocks of the current image block or sub-image block can be image blocks or sub-image blocks, they are collectively referred to as image blocks for the convenience of description. The sizes of all image blocks may be inconsistent, and the shapes or division methods of all image blocks It can be inconsistent, and the size of the image block is determined according to the method in the prior art.

如图3所示,设有图像块A,B,C,D和E。其中E为当前图像块,A为E的左相邻块,B为E的上相邻块,C为E的右上相邻块,D为E的左上相邻块。As shown in Figure 3, there are image blocks A, B, C, D and E. Where E is the current image block, A is the left adjacent block of E, B is the upper adjacent block of E, C is the upper right adjacent block of E, and D is the upper left adjacent block of E.

当前图像块采用了非规则划分,图像块被划分为两个子图像块,设当前图像块第一或第二个子图像块E的参考运动矢量(或成为预测运动矢量,predicted motion vector)为mvpE。The current image block adopts irregular division, and the image block is divided into two sub-image blocks. The reference motion vector (or predictive motion vector, predicted motion vector) of the first or second sub-image block E of the current image block is mvpE.

若图像块A,或,B,或,C,或D不可得或不使用非规则块划分,则设ModeA,或,ModeB,或,ModeC,或,ModeD的值为-1。If the image block A, or, B, or, C, or D is unavailable or does not use irregular block division, set the value of ModeA, or, ModeB, or, ModeC, or, ModeD to -1.

若图像块A,B,C,D采用了非规则划分方式,则图像块A,B,C,D被划分为两个子图像块,设采用了非规则划分方式的图像块A,B,C,D的运动矢量为mvA,mvB,mvC,mvD,设上述图像块A,B,C,D和E对应的子图像块的参考帧索引值为refA,refB,refC,refD和refE。If image blocks A, B, C, and D are divided irregularly, then image blocks A, B, C, and D are divided into two sub-image blocks. , the motion vectors of D are mvA, mvB, mvC, mvD, and the reference frame index values of the sub-image blocks corresponding to the above-mentioned image blocks A, B, C, D, and E are refA, refB, refC, refD, and refE.

参考帧索引值指的是图像块或子图像块的参考图像块所在的图像在视频序列中的位置。当两个图像块或子图像块的参考帧索引值相同时,这两个图像块或子图像块的参考图像块位于同一图像中。The reference frame index value refers to the position in the video sequence of the image where the reference image block of the image block or sub-image block is located. When the reference frame index values of two image blocks or sub-image blocks are the same, the reference image blocks of the two image blocks or sub-image blocks are located in the same image.

若ModeE为水平划分方式,且ModeA也为水平划分方式,则mvpE的求取方法可以为:If ModeE is a horizontal division method, and ModeA is also a horizontal division method, the calculation method of mvpE can be as follows:

mvpE=mvAmvpE=mvA

或,mvpE=((refE+1)×mvA×768/(refA+1)+384)/768Or, mvpE=((refE+1)×mvA×768/(refA+1)+384)/768

上述公示((refE+1)×mvA×768/(refA+1)+384)/768实际上是对mvA进行缩放,将块A运动矢量缩放至与当前块E所指向的参考图像。The above publicity ((refE+1)×mvA×768/(refA+1)+384)/768 actually scales mvA, and scales the motion vector of block A to the reference image pointed to by the current block E.

若ModeE为水平划分方式,ModeA不为水平划分方式而ModeB为水平划分方式,则mvpE的求取方法可以为:If ModeE is a horizontal division method, ModeA is not a horizontal division method, and ModeB is a horizontal division method, then the method for obtaining mvpE can be:

mvpE=mvBmvpE=mvB

或,mvpE=((refE+1)×mvB×768/(refB+1)+384)/768Or, mvpE=((refE+1)×mvB×768/(refB+1)+384)/768

上述公式((refE+1)×mvB×768/(refB+1)+384)/768实际上是对mvB进行缩放,将块B运动矢量缩放至与当前块E所指向的参考图像。The above formula ((refE+1)×mvB×768/(refB+1)+384)/768 actually scales mvB, and scales the motion vector of block B to the reference image pointed to by the current block E.

若ModeE为垂直划分方式,且ModeB也为垂直划分方式,则mvpE的求取方法可以为:If ModeE is a vertical division method, and ModeB is also a vertical division method, the calculation method of mvpE can be as follows:

mvpE=mvBmvpE=mvB

或,mvpE=((refE+1)×mvB×768/(refB+1)+384)/768Or, mvpE=((refE+1)×mvB×768/(refB+1)+384)/768

上述公示((refE+1)×mvB×768/(refB+1)+384)/768实际上是对mvB进行缩放,将块B运动矢量缩放至与当前块E所指向的参考图像。The above publicity ((refE+1)×mvB×768/(refB+1)+384)/768 actually scales mvB, and scales the motion vector of block B to the reference image pointed to by the current block E.

若ModeE为垂直划分方式,ModeB不为垂直划分方式且ModeA为垂直划分方式,则mvpE的求取方法可以为:If ModeE is a vertical division mode, ModeB is not a vertical division mode, and ModeA is a vertical division mode, then the mvpE calculation method can be as follows:

mvpE=mvAmvpE=mvA

或,mvpE=((refE+1)×mvA×768/(refA+1)+384)/768Or, mvpE=((refE+1)×mvA×768/(refA+1)+384)/768

上述公式((refE+1)×mvA×768/(refA+1)+384)/768实际上是对mvA进行缩放,将块A运动矢量缩放至与当前块E所指向的参考图像。The above formula ((refE+1)×mvA×768/(refA+1)+384)/768 actually scales mvA, and scales the motion vector of block A to the reference image pointed to by the current block E.

本发明对于图像块的参考矢量的获得还提供了其他的可选择的实施例,在以下实现方案中,由于当前图像块或子图像块的周边块可以为图像块,或子图像块,为便于描述统称为图像块,所有图像块的大小可以不一致,所有图像块的形状或划分方式可以不一致,图像块的大小按现有技术的方法确定。The present invention also provides other optional embodiments for obtaining the reference vector of the image block. In the following implementation schemes, since the surrounding blocks of the current image block or sub-image block can be image blocks or sub-image blocks, for convenience The descriptions are collectively referred to as image blocks. The sizes of all image blocks may be inconsistent, and the shapes or division methods of all image blocks may be inconsistent. The size of image blocks is determined according to methods in the prior art.

如图3所示,设有图像块A,B,C,D和E。其中E为当前图像块,A为E的左相邻块,B为E的上相邻块,C为E的右上相邻块,D为E的左上相邻块。As shown in Figure 3, there are image blocks A, B, C, D and E. Where E is the current image block, A is the left adjacent block of E, B is the upper adjacent block of E, C is the upper right adjacent block of E, and D is the upper left adjacent block of E.

当前图像块采用了非规则划分,图像块被划分为两个子图像块,设当前图像块第一或第二个子图像块E的参考运动矢量(或成为预测运动矢量,predicted motion vector)为mvpE。The current image block adopts irregular division, and the image block is divided into two sub-image blocks. The reference motion vector (or predictive motion vector, predicted motion vector) of the first or second sub-image block E of the current image block is mvpE.

若图像块A,或,B,或,C,或D不可得或不使用非规则块划分,则设ModeA,或,ModeB,或,ModeC,或,ModeD的值为-1。If the image block A, or, B, or, C, or D is unavailable or does not use irregular block division, set the value of ModeA, or, ModeB, or, ModeC, or, ModeD to -1.

若图像块A,B,C,D采用了非规则划分方式,则图像块A,B,C,D被划分为两个子图像块(,设采用了非规则划分方式的图像块A,B,C,D的运动矢量为mvA,mvB,mvC,mvD,设上述图像块A,B,C,D和E对应的子图像块的参考帧索引值为refA,refB,refC,refD和refE)。If the image blocks A, B, C, and D have adopted an irregular division method, then the image blocks A, B, C, and D are divided into two sub-image blocks (, assuming that the image blocks A, B, and The motion vectors of C and D are mvA, mvB, mvC, and mvD, and the reference frame index values of the sub-image blocks corresponding to the above-mentioned image blocks A, B, C, D, and E are refA, refB, refC, refD, and refE).

若ModeE为水平划分方式,且ModeA也为水平划分方式,则设图像块E第一个、第二个子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),设图像块A第一个、第二个子图像块的参考运动矢量为(mvA_y1,mvA_x1)和(mvA_y2,mvA_x2),(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2)的求取方法可以为:If ModeE is a horizontal division mode, and ModeA is also a horizontal division mode, then the reference motion vectors of the first and second sub-image blocks of image block E are (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), and image block A The reference motion vectors of the first and second sub-image blocks are (mvA_y1, mvA_x1) and (mvA_y2, mvA_x2), (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2) can be obtained by:

mvpE_y1=mvA_y1mvpE_y1=mvA_y1

mvpE_x1=mvA_x1mvpE_x1=mvA_x1

mvpE_y2=mvA_y2mvpE_y2=mvA_y2

mvpE_x2=mvA_x2mvpE_x2 = mvA_x2

若ModeE为水平划分方式,ModeA不为水平划分方式,同时ModeB为水平划分方式。设图像块E第一个、第二个子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),设图像块B第一个、第二个子图像块的参考运动矢量为(mvB_y1,mvB_x1)和(mvB_y2,mvB_x2)。此时,图像块B(上相邻块)的下半部分(即图像块B第二个子图像块)与当前图像块E同属一个物体的可能性较大,这两个图像块的运动矢量关联度较高。因此,(mvpE_y1,mvpE_x1)的求取方法可以为:If ModeE is the horizontal division mode, ModeA is not the horizontal division mode, and ModeB is the horizontal division mode. The reference motion vectors of the first and second sub-image blocks of image block E are (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), and the reference motion vectors of the first and second sub-image blocks of image block B are (mvB_y1 , mvB_x1) and (mvB_y2, mvB_x2). At this time, the lower half of the image block B (the upper adjacent block) (that is, the second sub-image block of the image block B) and the current image block E are more likely to belong to the same object, and the motion vectors of the two image blocks are correlated higher degree. Therefore, the calculation method of (mvpE_y1, mvpE_x1) can be:

mvpE_y1=mvB_y2mvpE_y1=mvB_y2

mvpE_x1=mvB_x2mvpE_x1=mvB_x2

在上述场景中,图像块E的第二个子图像块(即图像块E的下半部分)运动矢量与图像块B运动矢量关联度较小,此时使用该子图像块左边块的运动矢量,也就是图像块A的与图像块E相邻的部分的运动矢量更为合适。在这里,设图像块A的与图像块E的第二子图像块相邻的部分的运动矢量为(mvA_yclose,mvA_xclose)。因此,(mvpE_y2,mvpE_x2)的求取方法可以为:In the above scenario, the motion vector of the second sub-image block of the image block E (ie, the lower half of the image block E) is less correlated with the motion vector of the image block B. At this time, the motion vector of the left block of the sub-image block is used, That is, the motion vector of the part of the image block A adjacent to the image block E is more appropriate. Here, let the motion vector of the part of the image block A adjacent to the second sub-image block of the image block E be (mvA_yclose, mvA_xclose). Therefore, the calculation method of (mvpE_y2, mvpE_x2) can be:

mvpE_y2=mvA_yclosemvpE_y2 = mvA_yclose

mvpE_x2=mvA_xclosemvpE_x2 = mvA_xclose

若ModeE为垂直划分方式,且ModeA也为垂直划分方式,则设图像块E第一个、第二个子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),设图像块B第一个、第二个子图像块的参考运动矢量为(mvB_y1,mvB_x1)和(mvB_y2,mvB_x2),(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2)的求取方法可以为:If ModeE is a vertical division mode, and ModeA is also a vertical division mode, the reference motion vectors of the first and second sub-image blocks of image block E are (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), and image block B The reference motion vectors of the first and second sub-image blocks are (mvB_y1, mvB_x1) and (mvB_y2, mvB_x2), (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2) can be obtained as follows:

mvpE_y1=mvB_y1mvpE_y1=mvB_y1

mvpE_x1=mvB_x1mvpE_x1=mvB_x1

mvpE_y2=mvB_y2mvpE_y2=mvB_y2

mvpE_x2=mvB_x2mvpE_x2=mvB_x2

若ModeE为垂直划分方式,ModeB既不采用垂直划分方式,而ModeA为垂直划分方式。设图像块E第一个、第二个子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),设图像块B第一个、第二个子图像块的参考运动矢量为(mvA_y1,mvA_x1)和(mvA_y2,mvA_x2)。此时,图像块A(左相邻块)的右半部分(即图像块A第二个子图像块)与当前图像块E同属一个物体的可能性较大,这两个图像块的运动矢量关联度较高。因此,(mvpE_y1,mvpE_x1)的求取方法可以为:If ModeE adopts the vertical division mode, ModeB neither adopts the vertical division mode, but ModeA adopts the vertical division mode. The reference motion vectors of the first and second sub-image blocks of image block E are (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), and the reference motion vectors of the first and second sub-image blocks of image block B are (mvA_y1 , mvA_x1) and (mvA_y2, mvA_x2). At this time, the right half of image block A (the left adjacent block) (that is, the second sub-image block of image block A) and the current image block E are more likely to belong to the same object, and the motion vectors of these two image blocks are associated higher degree. Therefore, the calculation method of (mvpE_y1, mvpE_x1) can be:

mvpE_y1=mvA_y2mvpE_y1=mvA_y2

mvpE_x1=mvA_x2mvpE_x1=mvA_x2

在上述场景中,图像块E的第二个子图像块(即图像块E的右部分)运动矢量与图像块A运动矢量关联度较小,此时使用该子图像块上相邻块的运动矢量,也就是上相邻块B的与图像块E靠近的部分的运动矢量更为合适。设图像块B的与图像块E靠近得部分的运动矢量为(mvB_yclose,mvB_xclose),因此,(mvpE_y2,mvpE_x2)的求取方法可以为:In the above scenario, the motion vector of the second sub-image block of image block E (that is, the right part of image block E) is less correlated with the motion vector of image block A, and at this time, the motion vector of the adjacent block on the sub-image block is used , that is, the motion vector of the part of the upper adjacent block B that is close to the image block E is more appropriate. Let the motion vector of the part of the image block B close to the image block E be (mvB_yclose, mvB_xclose), therefore, the method of obtaining (mvpE_y2, mvpE_x2) can be:

mvpE_y2=mvA_yclosemvpE_y2 = mvA_yclose

mvpE_x2=mvA_xclosemvpE_x2 = mvA_xclose

若ModeE为左上至右下划分模式,即采用图2(a)所示划分方式,且图像块A(左相邻块)、B(上相邻块)、D(左上相邻块)中有且仅有一个采用与ModeE相同的划分方式,则设该采用与ModeE相同的划分方式的图像块的第一和第二个图像块的运动矢量分别为(mvX_y1,mvX_x1)、(mvX_y2,mvX_x2),设图像块E的第一、第二子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),则(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2)的求取方法为:If ModeE is the upper left to lower right division mode, the division method shown in Figure 2(a) is adopted, and image blocks A (left adjacent block), B (upper adjacent block), and D (upper left adjacent block) have And there is only one that adopts the same division mode as ModeE, then the motion vectors of the first and second image blocks of the image block that adopts the same division mode as ModeE are respectively (mvX_y1, mvX_x1), (mvX_y2, mvX_x2) , the reference motion vectors of the first and second sub-image blocks of the image block E are (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), then (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2) are calculated as follows:

mvpE_y1=mvX_y1mvpE_y1=mvX_y1

mvpE_x1=mvX_x1mvpE_x1=mvX_x1

mvpE_y2=mvX_y2mvpE_y2=mvX_y2

mvpE_x2=mvX_x2mvpE_x2=mvX_x2

若A、B、D中有一个以上图像块采用与ModeE相同的划分模式,但仅有一个图像块的参考帧索引值与当前图像块参考帧索引值相同,则设该与当前图像块的划分方式相同且参考帧索引值相同的图像块的第一和第二子图像块运动矢量为(mvX_y1,mvX_x1)、(mvX_y2,mvX_x2),设图像块E第一个、第二个子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),X可以为A或B或D,则(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2)的求取方法为:If more than one image block in A, B, and D adopts the same division mode as ModeE, but the reference frame index value of only one image block is the same as the reference frame index value of the current image block, then the division of the image block with the current image block is set The motion vectors of the first and second sub-image blocks of the image block with the same method and the same reference frame index value are (mvX_y1, mvX_x1), (mvX_y2, mvX_x2), and the reference of the first and second sub-image blocks of the image block E The motion vectors are (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), X can be A or B or D, then (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2) are calculated as:

mvpE_y1=mvX_y1mvpE_y1=mvX_y1

mvpE_x1=mvX_x1mvpE_x1=mvX_x1

mvpE_y2=mvX_y2mvpE_y2=mvX_y2

mvpE_x2=mvX_x2mvpE_x2=mvX_x2

若ModeE为右上至左下划分模式,即采用图2(b)所示划分方式,且图像块A、B、C中有且仅有一个采用与ModeE相同的划分模式,则设该采用与ModeE相同的划分模式的图像块的第一和第二子图像的块运动矢量为(mvX_y1,mvX_x1)、(mvX_y2,mvX_x2),设图像块E第一个、第二个子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),x可以为A或B或C,则(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2)的求取方法为:If ModeE is the upper right to lower left division mode, that is, the division method shown in Figure 2(b) is adopted, and one and only one of the image blocks A, B, and C adopts the same division mode as ModeE, then it is assumed that the mode is the same as ModeE The block motion vectors of the first and second sub-images of the image block of the division mode are (mvX_y1, mvX_x1), (mvX_y2, mvX_x2), and the reference motion vectors of the first and second sub-image blocks of the image block E are ( mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), x can be A, B or C, then (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2) are calculated as:

mvpE_y1=mvX_y1mvpE_y1=mvX_y1

mvpE_x1=mvX_x1mvpE_x1=mvX_x1

mvpE_y2=mvX_y2mvpE_y2=mvX_y2

mvpE_x2=mvX_x2mvpE_x2=mvX_x2

若A、B、C中有一个以上图像块采用与ModeE相同的划分模式,但仅有一个图像块的参考帧索引值与当前图像块参考帧索引值相同,则设该与当前图像块的划分方式相同且参考帧索引值相同的图像块的第一和第二子图像块的运动矢量为(mvX_y1,mvX_x1)、(mvX_y2,mvX_x2),X可以为A或B或C,设图像块E第一个、第二个子图像块的参考运动矢量为(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2),则(mvpE_y1,mvpE_x1)和(mvpE_y2,mvpE_x2)的求取方法为:If there is more than one image block in A, B, and C that adopts the same division mode as ModeE, but the reference frame index value of only one image block is the same as the reference frame index value of the current image block, then the division of the current image block is set The motion vectors of the first and second sub-image blocks of the image block with the same mode and the same reference frame index value are (mvX_y1, mvX_x1), (mvX_y2, mvX_x2), X can be A or B or C, and the image block E is the first The reference motion vectors of one and the second sub-image block are (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2), then (mvpE_y1, mvpE_x1) and (mvpE_y2, mvpE_x2) are calculated as follows:

mvpE_y1=mvX_y1mvpE_y1=mvX_y1

mvpE_x1=mvX_x1mvpE_x1=mvX_x1

mvpE_y2=mvX_y2mvpE_y2=mvX_y2

mvpE_x2=mvX_x2mvpE_x2=mvX_x2

在上述方法中,还可以根据待编码/待解码图像块的子图像块的已编码/已解码的周边块,及待编码/待解码图像块的不规则划分方式获得子图像块的参考运动矢量。In the above method, the reference motion vector of the sub-image block can also be obtained according to the encoded/decoded surrounding blocks of the sub-image block of the image block to be encoded/decoded, and the irregular division method of the image block to be encoded/decoded .

具体方法为:设待编码/待解码图像块的子图像块的已编码/已解码的周边块为图3所示A、B、C和D。若待编码/待解码图像块采用水平划分方式或垂直划分方式,则选取周边块A和B的运动矢量用于获得待编码/待解码图像块的子图像块的参考运动矢量;若待编码/待解码图像块采用图2(a)所示划分方式,则选取周边块A,B和C的运动矢量用于获得待编码/待解码图像块的子图像块的参考运动矢量;若待编码/待解码图像块采用图2(b)所示划分方式,则选取周边块A,B和D的运动矢量用于获得待编码/待解码图像块的子图像块的参考运动矢量。The specific method is as follows: the coded/decoded surrounding blocks of the sub-image block of the image block to be encoded/decoded are A, B, C and D shown in FIG. 3 . If the image block to be encoded/decoded adopts a horizontal division method or a vertical division method, the motion vectors of the surrounding blocks A and B are selected to obtain the reference motion vector of the sub-image block of the image block to be encoded/decoded; if the image block to be encoded/decoded The image block to be decoded adopts the division method shown in Fig. 2 (a), then the motion vectors of the peripheral blocks A, B and C are selected for obtaining the reference motion vector of the sub-image block of the image block to be encoded/decoded; The image block to be decoded adopts the division method shown in FIG. 2(b), then the motion vectors of the surrounding blocks A, B and D are selected to obtain the reference motion vectors of the sub-image blocks of the image block to be encoded/decoded.

采用本发明实施例提供的编解码方法和装置,可以在一定的条件下简化参考运动矢量的获得和计算,节省了编解码系统的资源,提高了效率。The encoding and decoding method and device provided by the embodiment of the present invention can simplify the acquisition and calculation of the reference motion vector under certain conditions, save the resources of the encoding and decoding system, and improve the efficiency.

以上对本发明实施例所提供的多级交换网和系统进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The multi-level switching network and system provided by the embodiments of the present invention are described above in detail. In this paper, specific examples are used to illustrate the principles and implementation modes of the present invention. The descriptions of the above embodiments are only used to help understand the present invention. method and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. Invention Limitations.

Claims (28)

1.一种编码方法,其特征在于,包括:  1. A coding method, characterized in that, comprising: 在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  Select one of the preset irregular division methods to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, and obtain the sub-image blocks according to the pixel values of the sub-image blocks. the reference image block of the image block; 根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量;  According to the reference image block, the motion vector of the sub-image block of the image block to be encoded is obtained; according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded , to obtain the reference motion vector of the sub-image block; 根据所述运动矢量和所述参考运动矢量,得到运动矢量差值;  Obtaining a motion vector difference according to the motion vector and the reference motion vector; 将所述运动矢量差值写入到码流中,  Write the motion vector difference into the code stream, 其中,所述根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded, obtaining the reference motion vector of the sub-image block includes: 选择符合预设条件的周边块,根据所述符合预设条件的周边块来获得图像块的参考运动矢量,其中,所述预设的条件包括:  Select the surrounding blocks that meet the preset conditions, and obtain the reference motion vector of the image block according to the surrounding blocks that meet the preset conditions, wherein the preset conditions include: 所述周边块采用了与待编码的图像块相同的不规则划分方式;  The surrounding block adopts the same irregular division method as the image block to be coded; 所述周边块的参考图像块与所述子图像块的参考图像块处于同一个图像中。  The reference image block of the peripheral block and the reference image block of the sub-image block are in the same image. the 2.如权利要求1中所述的编码方法,其特征在于,如果有唯一的一个周边块满足预设的条件,则所述子图像块的参考运动矢量等于所述满足条件的周边块的运动矢量。  2. The encoding method according to claim 1, wherein if there is only one peripheral block that meets the preset condition, the reference motion vector of the sub-image block is equal to the motion of the peripheral block that satisfies the condition vector. the 3.如权利要求1中所述的编码方法,其特征在于,如果所述已编码的周边块中有多个满足所述预设条件,则所述子图像块的参考运动矢量等于在满足条件的周边块中的位置参数与待编码图像块的位置参数的差值最小的那一个周边块的运动矢量,或所述子图像块的参考运动矢量等于在满足条件的周边块中的位置参数与待编码图像块的位置参数的差值绝对值最小的那一个周边块的运动矢量。  3. The encoding method as claimed in claim 1, wherein if a plurality of the encoded peripheral blocks satisfy the preset condition, the reference motion vector of the sub-image block is equal to The motion vector of the neighboring block with the smallest difference between the position parameter of the surrounding block and the position parameter of the image block to be encoded, or the reference motion vector of the sub-image block is equal to the position parameter and The motion vector of the neighboring block with the smallest absolute value of the position parameter difference of the image block to be coded. the 4.如权利要求3中所述的编码方法,其特征在于,如果有多个满足条件的周边块的位置参数相同且在满足条件的周边块中的位置参数与待编码图像块的位置参数的差值绝对值最小,或如果有多个满足条件的周边块的位置参数相同且在满足条件的周边块中的位置参数与待编码图像块的位置参数的差值绝对值最小,则所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值,或所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值取整。  4. encoding method as claimed in claim 3, it is characterized in that, if the position parameter of a plurality of surrounding blocks that satisfy the condition is identical and the position parameter in the surrounding block that satisfies the condition is the same as the position parameter of the image block to be encoded The absolute value of the difference is the smallest, or if there are multiple surrounding blocks that meet the condition and the position parameters are the same and the absolute value of the difference between the position parameters in the surrounding blocks that meets the condition and the position parameter of the image block to be encoded is the smallest, then the sub The reference motion vector of the image block is obtained by taking the average value of the motion vectors of the plurality of surrounding blocks satisfying the conditions, or the reference motion vector of the sub-image block is obtained by taking the average value of the motion vectors of the plurality of surrounding blocks satisfying the conditions all. the 5.一种编码方法,其特征在于,包括:  5. A coding method, characterized in that, comprising: 在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  Select one of the preset irregular division methods to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, and obtain the sub-image blocks according to the pixel values of the sub-image blocks. the reference image block of the image block; 根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量;  According to the reference image block, the motion vector of the sub-image block of the image block to be encoded is obtained; according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded , to obtain the reference motion vector of the sub-image block; 根据所述运动矢量和所述参考运动矢量,得到运动矢量差值;  Obtaining a motion vector difference according to the motion vector and the reference motion vector; 将所述运动矢量差值写入到码流中,  Write the motion vector difference into the code stream, 其中,所述根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded, obtaining the reference motion vector of the sub-image block includes: 当待编码的图像块的不规则划分方式为水平划分方式时,  When the irregular division method of the image block to be encoded is a horizontal division method, 若所述待编码的图像块的左相邻块的不规则划分方式为水平划分方式时,则根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the left adjacent block of the image block to be encoded is a horizontal division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the left adjacent block; 若所述待编码的图像块的左相邻块的不规则划分方式不为水平划分方式,而所述待编码的图像块的上相邻块的不规则划分方式为水平划分方式时,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the left adjacent block of the image block to be encoded is not a horizontal division mode, and the irregular division mode of the upper adjacent block of the image block to be encoded is a horizontal division mode, then according to The reference motion vector of the sub-image block of the current image block is obtained from the motion vector of the sub-image block of the upper adjacent block. the 6.一种编码方法,其特征在于,包括:  6. A coding method, characterized in that, comprising: 在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  Select one of the preset irregular division methods to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, and obtain the sub-image blocks according to the pixel values of the sub-image blocks. the reference image block of the image block; 根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量;  According to the reference image block, the motion vector of the sub-image block of the image block to be encoded is obtained; according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded , to obtain the reference motion vector of the sub-image block; 根据所述运动矢量和所述参考运动矢量,得到运动矢量差值;  Obtaining a motion vector difference according to the motion vector and the reference motion vector; 将所述运动矢量差值写入到码流中,  Write the motion vector difference into the code stream, 其中,所述根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded, obtaining the reference motion vector of the sub-image block includes: 当待编码的图像块的不规则划分方式为垂直划分方式时,  When the irregular division method of the image block to be encoded is a vertical division method, 若所述待编码的图像块的上相邻块的不规则划分方式为垂直划分方式,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the upper adjacent block of the image block to be encoded is a vertical division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the upper adjacent block; 若所述待编码的图像块的上相邻块的不规则划分方式不为垂直划分方式,而所述待编码的图像块的左相邻块的不规则划分方式为垂直划分方式时,根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the upper adjacent block of the image block to be encoded is not vertical division mode, and the irregular division mode of the left adjacent block of the image block to be encoded is vertical division mode, according to the left The motion vector of the sub-image block of the adjacent block obtains the reference motion vector of the sub-image block of the current image block. the 7.一种编码方法,其特征在于,包括:  7. A coding method, characterized in that, comprising: 在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  Select one of the preset irregular division methods to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, and obtain the sub-image blocks according to the pixel values of the sub-image blocks. the reference image block of the image block; 根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量;  According to the reference image block, the motion vector of the sub-image block of the image block to be encoded is obtained; according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded , to obtain the reference motion vector of the sub-image block; 根据所述运动矢量和所述参考运动矢量,得到运动矢量差值;  Obtaining a motion vector difference according to the motion vector and the reference motion vector; 将所述运动矢量差值写入到码流中,  Write the motion vector difference into the code stream, 其中,所述根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division method of the image block to be encoded, obtaining the reference motion vector of the sub-image block includes: 所述待编码的图像块的不规则划分方式将图像块划分为两个三角形、或一个三角形和一个五边形、或两个四边形时,若所述待编码的图像块的周边块仅有一个图像块划分方式与所述待编码的图像块的不规则划分方式相同,则根据该图像块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;或者  When the irregular division method of the image block to be encoded divides the image block into two triangles, or a triangle and a pentagon, or two quadrilaterals, if there is only one peripheral block of the image block to be encoded The image block division method is the same as the irregular division method of the image block to be encoded, then the reference motion vector of the sub-image block of the current image block is obtained according to the motion vector of the sub-image block of the image block; or 若所述待编码的图像块的周边块中有多个图像块的划分方式与所述待编码的图像块的不规则划分方式相同,则根据所述多个图像块中的与待编码图像块的参考帧索引值相同的图像块的子图像块的运动矢量获得所述待编码的图像块的参考运动矢量。  If there are a plurality of image blocks in the surrounding blocks of the image block to be encoded that are divided in the same manner as the irregular division of the image block to be encoded, then according to the image blocks among the image blocks to be encoded The reference motion vector of the image block to be coded is obtained from the motion vector of the sub-image block of the image block whose reference frame index value is the same. the 8.如权利要求5、6或7所述的编码方法,其特征在于,所述根据左相邻块或上相邻块的子图像块的运动矢量获得所述待编码的图像块的子图像块的参考运动矢量的方法包括:  8. The encoding method according to claim 5, 6 or 7, wherein the sub-image of the image block to be encoded is obtained according to the motion vector of the sub-image block of the left adjacent block or the upper adjacent block Methods for referencing motion vectors for blocks include: 所述待编码的图像块的子图像块的参考运动矢量等于左边或上边图像块的子图像块的运动矢量;或  The reference motion vector of the sub-image block of the image block to be encoded is equal to the motion vector of the sub-image block of the left or upper image block; or 将左相邻块或上相邻块的字图像块的运动矢量缩放至所述待编码的图像块的子图像块所指向的参考图像,根据所述缩放后的运动矢量,获得所述待编码的图像块的子图像块的参考运动矢量。  Scaling the motion vector of the sub-image block of the left adjacent block or the upper adjacent block to the reference image pointed to by the sub-image block of the image block to be encoded, and obtaining the image to be encoded according to the scaled motion vector The reference motion vector of the sub-image block of the image block. the 9.一种编码装置,其特征在于,包括:  9. An encoding device, characterized in that, comprising: 不规则划分模块,用于在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  The irregular division module is used to select an irregular division mode among a plurality of preset irregular division modes to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, according to the sub-image blocks Obtain the reference image block of the sub-image block with the pixel value; 运动矢量获得模块,用于根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;  A motion vector obtaining module, configured to obtain a motion vector of a sub-image block of the image block to be encoded according to the reference image block; 参考运动矢量获得模块,用于根据所述待编码图像块的子图像块的已编  The reference motion vector obtaining module is used for encoding according to the sub-image block of the image block to be encoded 码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运 动矢量,所述根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量包括:选择符合预设条件的周边块;根据所述符合预设条件的周边块来获得图像块的参考运动矢量,其中,所述预设的条件包括:所述周边块采用了与待编码的图像块相同的不规则划分方式;所述周边块的参考图像块与所述子图像块的参考图像块处于同一个图像中;  According to the irregular division method of the surrounding blocks of the code and the image block to be encoded, the reference motion vector of the sub-image block is obtained, and the obtained sub-image block is obtained according to the coded surrounding blocks of the sub-image block of the image block to be encoded. The reference motion vector includes: selecting a surrounding block that meets the preset condition; and obtaining the reference motion vector of the image block according to the surrounding block that meets the preset condition, wherein the preset condition includes: the surrounding block adopts the same The image blocks to be encoded are divided in the same irregular manner; the reference image blocks of the surrounding blocks and the reference image blocks of the sub-image blocks are in the same image; 运动矢量差值获得模块,用于将所述运动矢量和所述参考运动矢量做差,得到运动矢量差值;  A motion vector difference obtaining module, configured to make a difference between the motion vector and the reference motion vector to obtain a motion vector difference; 运动矢量差值写入模块,用于将所述运动矢量差值写入到码流中。  The motion vector difference value writing module is used to write the motion vector difference value into the code stream. the 10.如权利要求9中所述的编码装置,其特征在于,如果有唯一的一个周边块满足预设的条件,则所述子图像块的参考运动矢量等于所述满足条件的周边块的运动矢量。  10. The encoding device according to claim 9, wherein if there is only one peripheral block that satisfies a preset condition, the reference motion vector of the sub-image block is equal to the motion of the peripheral block that satisfies the condition vector. the 11.如权利要求9中所述的编码装置,其特征在于,如果所述已编码的周边块中有多个满足所述预设条件,则所述子图像块的参考运动矢量等于在满足条件的周边块中不规则划分的位置参数与待编码图像块的位置参数的差值最小的那一个周边块的运动矢量,或在满足条件的周边块中的位置参数与待编码图像块的位置参数的差值绝对值最小的那一个周边块的运动矢量。  11. The encoding device according to claim 9, wherein if more than one of the encoded peripheral blocks satisfy the preset condition, the reference motion vector of the sub-image block is equal to The motion vector of the neighboring block with the smallest difference between the irregularly divided position parameter and the position parameter of the image block to be coded, or the position parameter in the surrounding block that satisfies the condition and the position parameter of the image block to be coded The motion vector of the surrounding block whose absolute value of the difference is the smallest. the 12.如权利要求11中所述的编码装置,其特征在于,如果有多个满足条件的周边块的位置参数相同且在满足条件的周边块中的位置参数与待编码图像块的位置参数的差值绝对值最小,或如果有多个满足条件的周边块的位置参数相同且在满足条件的周边块中的位置参数与待编码图像块的位置参数的差值绝对值最小,则所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值,或所述子图像块的参考运 动矢量取所述多个满足条件的周边块的运动矢量的平均值取整。  12. The encoding device as claimed in claim 11, wherein if the position parameters of a plurality of surrounding blocks satisfying the condition are the same and the position parameters in the surrounding blocks satisfying the condition are the same as the position parameters of the image block to be encoded The absolute value of the difference is the smallest, or if there are multiple surrounding blocks that meet the condition and the position parameters are the same and the absolute value of the difference between the position parameters in the surrounding blocks that meets the condition and the position parameter of the image block to be encoded is the smallest, then the sub The reference motion vector of the image block takes the average value of the motion vectors of the plurality of surrounding blocks that meet the conditions, or the reference motion vector of the sub-image block takes the average value of the motion vectors of the multiple surrounding blocks that meet the conditions Rounding. the 13.一种编码装置,其特征在于,包括:  13. An encoding device, characterized in that, comprising: 不规则划分模块,用于在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  The irregular division module is used to select an irregular division mode among a plurality of preset irregular division modes to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, according to the sub-image blocks Obtain the reference image block of the sub-image block with the pixel value; 运动矢量获得模块,用于根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;  A motion vector obtaining module, configured to obtain a motion vector of a sub-image block of the image block to be encoded according to the reference image block; 参考运动矢量获得模块,用于根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量,  The reference motion vector obtaining module is used to obtain the reference motion vector of the sub-image block according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division mode of the image block to be encoded, 其中,所述根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block according to the encoded peripheral blocks of the sub-image block of the image block to be encoded comprises: 当待编码的图像块的不规则划分方式为水平划分方式时,  When the irregular division method of the image block to be encoded is a horizontal division method, 若所述待编码的图像块的左相邻块的不规则划分方式为水平划分方式时,则根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the left adjacent block of the image block to be encoded is a horizontal division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the left adjacent block; 若所述待编码的图像块的左相邻块的不规则划分方式不为水平划分方式,而所述待编码的图像块的上相邻块的不规则划分方式为水平划分方式时,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the left adjacent block of the image block to be encoded is not a horizontal division mode, and the irregular division mode of the upper adjacent block of the image block to be encoded is a horizontal division mode, then according to The reference motion vector of the sub-image block of the current image block is obtained from the motion vector of the sub-image block of the upper adjacent block. the 14.一种编码装置,其特征在于,包括:  14. An encoding device, characterized in that, comprising: 不规则划分模块,用于在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  The irregular division module is used to select an irregular division mode among a plurality of preset irregular division modes to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, according to the sub-image blocks Obtain the reference image block of the sub-image block with the pixel value; 运动矢量获得模块,用于根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;  A motion vector obtaining module, configured to obtain a motion vector of a sub-image block of the image block to be encoded according to the reference image block; 参考运动矢量获得模块,用于根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量,  The reference motion vector obtaining module is used to obtain the reference motion vector of the sub-image block according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division mode of the image block to be encoded, 其中,所述根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block according to the encoded peripheral blocks of the sub-image block of the image block to be encoded comprises: 当待编码的图像块的不规则划分方式为垂直划分方式时,  When the irregular division method of the image block to be encoded is a vertical division method, 若所述待编码的图像块的上相邻块的不规则划分方式为垂直划分方式,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the upper adjacent block of the image block to be encoded is a vertical division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the upper adjacent block; 若所述待编码的图像块的上相邻块的不规则划分方式不为垂直划分方式,而所述待编码的图像块的左相邻块的不规则划分方式为垂直划分方式时,根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the upper adjacent block of the image block to be encoded is not vertical division mode, and the irregular division mode of the left adjacent block of the image block to be encoded is vertical division mode, according to the left The motion vector of the sub-image block of the adjacent block obtains the reference motion vector of the sub-image block of the current image block. the 15.一种编码装置,其特征在于,包括:  15. An encoding device, characterized in that, comprising: 不规则划分模块,用于在预设的多个不规则划分方式中选取一个不规则划分方式对待编码的图像块进行不规则划分,得到至少两个不同的子图像块,根据所述子图像块的像素值获得所述子图像块的参考图像块;  The irregular division module is used to select an irregular division mode among a plurality of preset irregular division modes to irregularly divide the image block to be coded to obtain at least two different sub-image blocks, according to the sub-image blocks Obtain the reference image block of the sub-image block with the pixel value; 运动矢量获得模块,用于根据所述参考图像块,获得所述待编码的图像块的子图像块的运动矢量;  A motion vector obtaining module, configured to obtain a motion vector of a sub-image block of the image block to be encoded according to the reference image block; 参考运动矢量获得模块,用于根据所述待编码图像块的子图像块的已编码的周边块和待编码图像块的不规则划分方式,获得子图像块的参考运动矢量,  The reference motion vector obtaining module is used to obtain the reference motion vector of the sub-image block according to the coded peripheral blocks of the sub-image block of the image block to be encoded and the irregular division mode of the image block to be encoded, 其中,所述根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block according to the encoded peripheral blocks of the sub-image block of the image block to be encoded comprises: 所述待编码的图像块的不规则划分方式将图像块划分为两个三角形、或一个三角形和一个五边形、或两个四边形时,若所述待编码的图像块的周边块仅有一个图像块划分方式与所述待编码的图像块的不规则划分方式相同,则根据该图像块的子图像块的运动矢量获得当前图像块的子图 像块的参考运动矢量;或者  When the irregular division method of the image block to be encoded divides the image block into two triangles, or a triangle and a pentagon, or two quadrilaterals, if there is only one peripheral block of the image block to be encoded The image block division method is the same as the irregular division method of the image block to be encoded, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the image block; or 若所述待编码的图像块的周边块中有多个图像块的划分方式与所述待编码的图像块的不规则划分方式相同,则根据所述多个图像块中的与待编码图像块的参考帧索引值相同的图像块的子图像块的运动矢量获得所述待编码的图像块的参考运动矢量。  If there are a plurality of image blocks in the surrounding blocks of the image block to be encoded that are divided in the same manner as the irregular division of the image block to be encoded, then according to the image blocks among the image blocks to be encoded The reference motion vector of the image block to be coded is obtained from the motion vector of the sub-image block of the image block whose reference frame index value is the same. the 16.如权利要求13、14或15中所述的编码装置,其特征在于,所述根据所述待编码图像块的子图像块的已编码的周边块,获得子图像块的参考运动矢量包括:  16. The encoding device according to claim 13, 14 or 15, wherein said obtaining the reference motion vector of the sub-image block according to the coded surrounding blocks of the sub-image block of the image block to be encoded comprises : 所述待编码的图像块的不规则划分方式将图像块划分为两个三角形、或一个三角形和一个五边形、或两个四边形时,若所述待编码的图像块的周边块仅有一个图像块划分方式与所述待编码的图像块的不规则划分方式相同,则根据该图像块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;或者  When the irregular division method of the image block to be encoded divides the image block into two triangles, or a triangle and a pentagon, or two quadrilaterals, if there is only one peripheral block of the image block to be encoded The image block division method is the same as the irregular division method of the image block to be encoded, then the reference motion vector of the sub-image block of the current image block is obtained according to the motion vector of the sub-image block of the image block; or 若所述待编码的图像块的周边块中有多个图像块的划分方式与所述待编码的图像块的不规则划分方式相同,则根据所述多个图像块中的与待编码图像块的参考帧索引值相同的图像块的子图像块的运动矢量获得所述待编码的图像块的参考运动矢量。  If there are a plurality of image blocks in the surrounding blocks of the image block to be encoded that are divided in the same manner as the irregular division of the image block to be encoded, then according to the image blocks among the image blocks to be encoded The reference motion vector of the image block to be coded is obtained from the motion vector of the sub-image block of the image block whose reference frame index value is the same. the 17.一种解码方法,其特征在于,包括:  17. A decoding method, characterized in that, comprising: 从码流中获得待解码的图像块的不规则划分方式;  Obtain the irregular division method of the image block to be decoded from the code stream; 从码流中获得待解码的图像块的子图像块的运动矢量差值;  Obtain the motion vector difference value of the sub-image block of the image block to be decoded from the code stream; 从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量;  Obtain the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block; 根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;  Obtaining the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block; 根据所述运动矢量获得所述子图像块的参考图像块,并根据所述参考子 图象块对所述子图像块进行解码,  obtaining a reference image block of the sub-image block according to the motion vector, and decoding the sub-image block according to the reference sub-image block, 其中,所述从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block includes: 选择符合预设条件的周边块;根据所述符合预设条件的周边块来获得图像块的参考运动矢量,其中,  Select a surrounding block that meets the preset condition; obtain a reference motion vector of the image block according to the surrounding block that meets the preset condition, wherein, 所述预设的条件包括:所述周边块采用了与待解码的图像块相同的不规则划分方式;所述周边块的参考图像块与所述子图像块的参考图像块处于同一个图像中。  The preset conditions include: the peripheral block adopts the same irregular division method as the image block to be decoded; the reference image block of the peripheral block and the reference image block of the sub-image block are in the same image . the 18.如权利要求17中所述的解码方法,其特征在于,如果有唯一的一个周边块满足预设的条件,则所述子图像块的参考运动矢量等于所述满足条件的周边块的运动矢量。  18. The decoding method according to claim 17, wherein if there is only one peripheral block that satisfies the preset condition, the reference motion vector of the sub-image block is equal to the motion of the peripheral block that satisfies the condition vector. the 19.如权利要求17中所述的解码方法,其特征在于,如果所述已解码的周边块中有多个满足所述预设条件,则所述子图像块的参考运动矢量等于在满足条件的周边块中的位置参数与待解码图像块的位置参数的差值最小的那一个周边块的运动矢量,或在满足条件的周边块中的位置参数与待解码图像块的位置参数的差值绝对值最小的那一个周边块的运动矢量。  19. The decoding method according to claim 17, wherein if multiple of the decoded peripheral blocks meet the preset condition, the reference motion vector of the sub-image block is equal to The motion vector of the neighboring block with the smallest difference between the position parameters in the surrounding blocks and the position parameters of the image block to be decoded, or the difference between the position parameters in the surrounding blocks that meet the conditions and the position parameters of the image block to be decoded The motion vector of the surrounding block with the smallest absolute value. the 20.如权利要求19中所述的解码方法,其特征在于,如果有多个满足条件的周边块的位置参数相同且在满足条件的周边块中的位置参数与待解码图像块的位置参数的差值绝对值最小,或如果有多个满足条件的周边块的位置参数相同且在满足条件的周边块中的位置参数与待解码图像块的位置参数的差值绝对值最小,则所述子图像块的参考运动矢量取所述多个满足条件的周边块的运动矢量的平均值,或所述子图像块的参考运 动矢量取所述多个满足条件的周边块的运动矢量的平均值取整。  20. The decoding method as claimed in claim 19, wherein if the position parameters of a plurality of surrounding blocks satisfying the conditions are the same and the position parameters in the surrounding blocks satisfying the conditions are the same as the position parameters of the image block to be decoded The absolute value of the difference is the smallest, or if there are multiple surrounding blocks that meet the condition with the same position parameters and the absolute value of the difference between the position parameters in the surrounding blocks that meet the conditions and the position parameter of the image block to be decoded is the smallest, then the sub The reference motion vector of the image block takes the average value of the motion vectors of the plurality of surrounding blocks that meet the conditions, or the reference motion vector of the sub-image block takes the average value of the motion vectors of the multiple surrounding blocks that meet the conditions Rounding. the 21.一种解码方法,其特征在于,包括:  21. A decoding method, characterized in that, comprising: 从码流中获得待解码的图像块的不规则划分方式;  Obtain the irregular division method of the image block to be decoded from the code stream; 从码流中获得待解码的图像块的子图像块的运动矢量差值;  Obtain the motion vector difference value of the sub-image block of the image block to be decoded from the code stream; 从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量;  Obtain the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block; 根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;  Obtaining the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block; 根据所述运动矢量获得所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码,  obtaining a reference image block of the sub-image block according to the motion vector, and decoding the sub-image block according to the reference sub-image block, 其中,所述从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block includes: 当待解码的图像块的不规则划分方式为水平划分方式时,  When the irregular division method of the image block to be decoded is a horizontal division method, 若所述待解码的图像块的左相邻块的不规则划分方式为水平划分方式时,则根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the left adjacent block of the image block to be decoded is a horizontal division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the left adjacent block; 若所述待解码的图像块的左相邻块的不规则划分方式不为水平划分方式,而所述待解码的图像块的上相邻块的不规则划分方式为水平划分方式时,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the left adjacent block of the image block to be decoded is not a horizontal division mode, and the irregular division mode of the upper adjacent block of the image block to be decoded is a horizontal division mode, then according to The reference motion vector of the sub-image block of the current image block is obtained from the motion vector of the sub-image block of the upper adjacent block. the 22.一种解码方法,其特征在于,包括:  22. A decoding method, characterized in that, comprising: 从码流中获得待解码的图像块的不规则划分方式;  Obtain the irregular division method of the image block to be decoded from the code stream; 从码流中获得待解码的图像块的子图像块的运动矢量差值;  Obtain the motion vector difference value of the sub-image block of the image block to be decoded from the code stream; 从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量;  Obtain the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block; 根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;  Obtaining the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block; 根据所述运动矢量获得所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码,  obtaining a reference image block of the sub-image block according to the motion vector, and decoding the sub-image block according to the reference sub-image block, 其中,所述从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block includes: 当待解码的图像块的不规则划分方式为垂直划分方式时,  When the irregular division mode of the image block to be decoded is vertical division mode, 若所述待解码的图像块的上相邻块的不规则划分方式为垂直划分方式,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the upper adjacent block of the image block to be decoded is a vertical division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the upper adjacent block; 若所述待解码的图像块的上相邻块的不规则划分方式不为垂直划分方式,而所述待解码的图像块的左相邻块的不规则划分方式为垂直划分方式时,根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the upper adjacent block of the image block to be decoded is not a vertical division mode, and the irregular division mode of the left adjacent block of the image block to be decoded is a vertical division mode, according to the left The motion vector of the sub-image block of the adjacent block obtains the reference motion vector of the sub-image block of the current image block. the 23.一种解码方法,其特征在于,包括:  23. A decoding method, characterized in that, comprising: 从码流中获得待解码的图像块的不规则划分方式;  Obtain the irregular division method of the image block to be decoded from the code stream; 从码流中获得待解码的图像块的子图像块的运动矢量差值;  Obtain the motion vector difference value of the sub-image block of the image block to be decoded from the code stream; 从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量;  Obtain the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block; 根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;  Obtaining the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block; 根据所述运动矢量获得所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码,  obtaining a reference image block of the sub-image block according to the motion vector, and decoding the sub-image block according to the reference sub-image block, 其中,所述从所述待解码图像块的子图像块的已解码的周边块和图像块的不规则划分方式,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block from the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block includes: 所述待解码的图像块的不规则划分方式将图像块划分为两个三角形、或一个三角形和一个五边形、或两个四边形时,若所述待解码的图像块的 周边块仅有一个图像块划分方式与所述待解码的图像块的不规则划分方式相同,则根据该图像块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;或者  When the irregular division method of the image block to be decoded divides the image block into two triangles, or a triangle and a pentagon, or two quadrilaterals, if there is only one peripheral block of the image block to be decoded The image block division method is the same as the irregular division method of the image block to be decoded, then the reference motion vector of the sub-image block of the current image block is obtained according to the motion vector of the sub-image block of the image block; or 若所述待解码的图像块的周边块中有多个图像块的划分方式与所述待解码的图像块的不规则划分方式相同,则根据所述多个图像块中的与待解码图像块的参考帧索引值相同的图像块的子图像块的运动矢量获得所述待解码的图像块的参考运动矢量。  If there are a plurality of image blocks in the peripheral blocks of the image block to be decoded that are divided in the same manner as the irregular division method of the image block to be decoded, then according to the image block among the image blocks to be decoded The reference motion vector of the image block to be decoded is obtained by using the motion vector of the sub-image block of the image block with the same reference frame index value. the 24.如权利要求21、22或23所述的解码方法,所述根据左相临块或上相邻块的子图像块的运动矢量获得所述待解码的图像块的子图像块的参考运动矢量的方法包括:  24. The decoding method according to claim 21, 22 or 23, wherein the reference motion of the sub-image block of the image block to be decoded is obtained according to the motion vector of the sub-image block of the left adjacent block or the upper adjacent block Vector methods include: 所述待解码的图像块的子图像块的参考运动矢量等于左边或上边图像块的子图像块的运动矢量;或  The reference motion vector of the sub-image block of the image block to be decoded is equal to the motion vector of the sub-image block of the left or upper image block; or 将左相邻块或上相邻块的字图像块的运动矢量缩放至所述待解码的图像块的子图像块所指向的参考图像,根据所述缩放后的运动矢量,获得所述待解码的图像块的子图像块的参考运动矢量。  Scaling the motion vector of the word image block of the left adjacent block or the upper adjacent block to the reference image pointed to by the sub-image block of the image block to be decoded, and obtaining the image block to be decoded according to the scaled motion vector The reference motion vector of the sub-image block of the image block. the 25.一种解码装置,其特征在于,包括:  25. A decoding device, characterized in that, comprising: 运动矢量差值获得模块,用于从码流中获得待解码的图像块的子图像块的运动矢量差值;  The motion vector difference obtaining module is used to obtain the motion vector difference of the sub-image block of the image block to be decoded from the code stream; 参考运动矢量获得模块,用于根据所述待解码图像块的子图像块的已解码的周边块和待解码图像块的不规则划分方式,获得子图像块的参考运动矢量;  The reference motion vector obtaining module is used to obtain the reference motion vector of the sub-image block according to the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block to be decoded; 运动矢量获得模块,用于根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;  A motion vector obtaining module, configured to obtain the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block; 解码模块,用于根据所述运动矢量查找所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码,  A decoding module, configured to search for a reference image block of the sub-image block according to the motion vector, and decode the sub-image block according to the reference sub-image block, 其中,所述根据所述待解码图像块的子图像块的已解码的周边块,获得子 图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block according to the decoded peripheral blocks of the sub-image block of the image block to be decoded includes: 当待解码的图像块的不规则划分方式为水平划分方式时,  When the irregular division method of the image block to be decoded is a horizontal division method, 若所述待解码的图像块的左相邻块的不规则划分方式为水平划分方式时,则根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the left adjacent block of the image block to be decoded is a horizontal division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the left adjacent block; 若所述待解码的图像块的左相邻块的不规则划分方式不为水平划分方式,而所述待解码的图像块的上相邻块的不规则划分方式为水平划分方式时,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the left adjacent block of the image block to be decoded is not a horizontal division mode, and the irregular division mode of the upper adjacent block of the image block to be decoded is a horizontal division mode, then according to The reference motion vector of the sub-image block of the current image block is obtained from the motion vector of the sub-image block of the upper adjacent block. the 26.一种解码装置,其特征在于,包括:  26. A decoding device, characterized in that, comprising: 运动矢量差值获得模块,用于从码流中获得待解码的图像块的子图像块的运动矢量差值;  The motion vector difference obtaining module is used to obtain the motion vector difference of the sub-image block of the image block to be decoded from the code stream; 参考运动矢量获得模块,用于根据所述待解码图像块的子图像块的已解码的周边块和待解码图像块的不规则划分方式,获得子图像块的参考运动矢量;  The reference motion vector obtaining module is used to obtain the reference motion vector of the sub-image block according to the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block to be decoded; 运动矢量获得模块,用于根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;  A motion vector obtaining module, configured to obtain the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block; 解码模块,用于根据所述运动矢量查找所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码,  A decoding module, configured to search for a reference image block of the sub-image block according to the motion vector, and decode the sub-image block according to the reference sub-image block, 其中,所述根据所述待解码图像块的子图像块的已解码的周边块,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block according to the decoded peripheral blocks of the sub-image block of the image block to be decoded includes: 当待解码的图像块的不规则划分方式为垂直划分方式时,  When the irregular division mode of the image block to be decoded is vertical division mode, 若所述待解码的图像块的上相邻块的不规则划分方式为垂直划分方式,则根据上相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;  If the irregular division mode of the upper adjacent block of the image block to be decoded is a vertical division mode, then obtain the reference motion vector of the sub-image block of the current image block according to the motion vector of the sub-image block of the upper adjacent block; 若所述待解码的图像块的上相邻块的不规则划分方式不为垂直划分方式,而所述待解码的图像块的左相邻块的不规则划分方式为垂直划分方式时,根据左相邻块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量。  If the irregular division mode of the upper adjacent block of the image block to be decoded is not a vertical division mode, and the irregular division mode of the left adjacent block of the image block to be decoded is a vertical division mode, according to the left The motion vector of the sub-image block of the adjacent block obtains the reference motion vector of the sub-image block of the current image block. the 27.一种解码装置,其特征在于,包括:  27. A decoding device, characterized in that, comprising: 运动矢量差值获得模块,用于从码流中获得待解码的图像块的子图像块的运动矢量差值;  The motion vector difference obtaining module is used to obtain the motion vector difference of the sub-image block of the image block to be decoded from the code stream; 参考运动矢量获得模块,用于根据所述待解码图像块的子图像块的已解码的周边块和待解码图像块的不规则划分方式,获得子图像块的参考运动矢量;  The reference motion vector obtaining module is used to obtain the reference motion vector of the sub-image block according to the decoded peripheral blocks of the sub-image block of the image block to be decoded and the irregular division method of the image block to be decoded; 运动矢量获得模块,用于根据所述子图像块的参考运动矢量和运动矢量差值,得到所述子图像块的运动矢量;  A motion vector obtaining module, configured to obtain the motion vector of the sub-image block according to the reference motion vector and the motion vector difference of the sub-image block; 解码模块,用于根据所述运动矢量查找所述子图像块的参考图像块,并根据所述参考子图象块对所述子图像块进行解码,  A decoding module, configured to search for a reference image block of the sub-image block according to the motion vector, and decode the sub-image block according to the reference sub-image block, 其中,所述根据所述待解码图像块的子图像块的已解码的周边块,获得子图像块的参考运动矢量包括:  Wherein, said obtaining the reference motion vector of the sub-image block according to the decoded peripheral blocks of the sub-image block of the image block to be decoded includes: 所述待解码的图像块的不规则划分方式将图像块划分为两个三角形、或一个三角形和一个五边形、或两个四边形时,若所述待解码的图像块的周边块仅有一个图像块划分方式与所述待解码的图像块的不规则划分方式相同,则根据该图像块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;或者  When the irregular division method of the image block to be decoded divides the image block into two triangles, or a triangle and a pentagon, or two quadrilaterals, if there is only one peripheral block of the image block to be decoded The image block division method is the same as the irregular division method of the image block to be decoded, then the reference motion vector of the sub-image block of the current image block is obtained according to the motion vector of the sub-image block of the image block; or 若所述待解码的图像块的周边块中有多个图像块的划分方式与所述待解码的图像块的不规则划分方式相同,则根据所述多个图像块中的与待解码图像块的参考帧索引值相同的图像块的子图像块的运动矢量获得所述待解码的图像块的参考运动矢量。  If there are a plurality of image blocks in the peripheral blocks of the image block to be decoded that are divided in the same manner as the irregular division method of the image block to be decoded, then according to the image block among the image blocks to be decoded The reference motion vector of the image block to be decoded is obtained by using the motion vector of the sub-image block of the image block with the same reference frame index value. the 28.如权利要求25、26或27中所述的解码装置,其特征在于,所述根据 所述待解码图像块的子图像块的已解码的周边块,获得子图像块的参考运动矢量包括:  28. The decoding device as claimed in claim 25, 26 or 27, wherein said obtaining the reference motion vector of the sub-image block according to the decoded peripheral blocks of the sub-image block of the image block to be decoded comprises : 所述待解码的图像块的不规则划分方式将图像块划分为两个三角形、或一个三角形和一个五边形、或两个四边形时,若所述待解码的图像块的周边块仅有一个图像块划分方式与所述待解码的图像块的不规则划分方式相同,则根据该图像块的子图像块的运动矢量获得当前图像块的子图像块的参考运动矢量;或者  When the irregular division method of the image block to be decoded divides the image block into two triangles, or a triangle and a pentagon, or two quadrilaterals, if there is only one peripheral block of the image block to be decoded The image block division method is the same as the irregular division method of the image block to be decoded, then the reference motion vector of the sub-image block of the current image block is obtained according to the motion vector of the sub-image block of the image block; or 若所述待解码的图像块的周边块中有多个图像块的划分方式与所述待解码的图像块的不规则划分方式相同,则根据所述多个图像块中的与待解码图像块的参考帧索引值相同的图像块的子图像块的运动矢量获得所述待解码的图像块的参考运动矢量。  If there are a plurality of image blocks in the peripheral blocks of the image block to be decoded that are divided in the same manner as the irregular division method of the image block to be decoded, then according to the image block among the image blocks to be decoded The reference motion vector of the image block to be decoded is obtained by using the motion vector of the sub-image block of the image block with the same reference frame index value. the
CN 201010237812 2010-04-09 2010-07-19 Video coding and decoding method and device Active CN102215395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010237812 CN102215395B (en) 2010-04-09 2010-07-19 Video coding and decoding method and device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201010147575 2010-04-09
CN201010147575.8 2010-04-09
CN 201010237812 CN102215395B (en) 2010-04-09 2010-07-19 Video coding and decoding method and device

Publications (2)

Publication Number Publication Date
CN102215395A CN102215395A (en) 2011-10-12
CN102215395B true CN102215395B (en) 2013-10-09

Family

ID=44746492

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010237812 Active CN102215395B (en) 2010-04-09 2010-07-19 Video coding and decoding method and device

Country Status (1)

Country Link
CN (1) CN102215395B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208381A (en) * 2014-06-25 2015-12-30 中兴通讯股份有限公司 Video coding method and apparatus
US10349023B2 (en) * 2014-07-01 2019-07-09 Sony Corporation Image processing apparatus and method
CN104284188B (en) 2014-10-11 2018-03-13 华为技术有限公司 Prediction Block Division Method, Encoding Device, and Decoding Device
CN117294837A (en) * 2018-04-02 2023-12-26 深圳市大疆创新科技有限公司 Image processing method and image processing device
CN112468825B (en) * 2018-12-28 2022-04-26 杭州海康威视数字技术股份有限公司 Coding and decoding method and equipment thereof
CN111357290B (en) 2019-01-03 2023-08-22 北京大学 Video image processing method and device
CN110061813B (en) * 2019-04-09 2022-10-04 惠州市仲恺Tcl智融科技小额贷款股份有限公司 Data encoding method, data decoding method and related devices
CN115176463A (en) * 2019-12-30 2022-10-11 抖音视界有限公司 Motion vector difference for blocks with geometric segmentation
CN121462767A (en) 2020-04-09 2026-02-03 抖音视界有限公司 Motion vector difference for blocks with geometric segmentation

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072356A (en) * 2006-05-12 2007-11-14 中国科学院计算技术研究所 Motion vector predicating method
CN101127913A (en) * 2006-08-18 2008-02-20 富士通株式会社 Inter prediction processor with a mechanism to provide the location of the reference motion vector
CN101263713A (en) * 2005-09-16 2008-09-10 索尼电子有限公司 Naturally shaped areas for motion compensation
CN101621693A (en) * 2009-07-31 2010-01-06 重庆大学 Frame frequency lifting method for combining target partition and irregular block compensation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101263713A (en) * 2005-09-16 2008-09-10 索尼电子有限公司 Naturally shaped areas for motion compensation
CN101072356A (en) * 2006-05-12 2007-11-14 中国科学院计算技术研究所 Motion vector predicating method
CN101127913A (en) * 2006-08-18 2008-02-20 富士通株式会社 Inter prediction processor with a mechanism to provide the location of the reference motion vector
CN101621693A (en) * 2009-07-31 2010-01-06 重庆大学 Frame frequency lifting method for combining target partition and irregular block compensation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Kenneth Vermeirsch etc..New Macroblock Bipartitioning Modes for Inter Coding.《ITU - Telecommunications Standardization Sector,STUDY GROUP 16 Question 6,Video Coding Experts Group (VCEG),34th Meeting: Antalya, Turkey》.2008,
Kenneth Vermeirsch etc..New Macroblock Bipartitioning Modes for Inter Coding.《ITU- Telecommunications Standardization Sector,STUDY GROUP 16 Question 6,Video Coding Experts Group (VCEG),34th Meeting: Antalya, Turkey》.2008, *

Also Published As

Publication number Publication date
CN102215395A (en) 2011-10-12

Similar Documents

Publication Publication Date Title
CN102215395B (en) Video coding and decoding method and device
CN102823244B (en) Video encoding and decoding method and apparatus
TWI619382B (en) Apparatus of decoding image
CA2877229C (en) Method and apparatus for encoding/decoding motion vector
KR102334151B1 (en) Image prediction method and related device
CN104967857B (en) Method and apparatus for encoding/decoding images
CN101014125B (en) Method and device for determining intra prediction mode
CN109068142B (en) 360-degree video intra-frame prediction rapid decision-making method, device, coder-decoder and medium
CN104967846A (en) Method and apparatus for encoding video, and method and apparatus for decoding video
CN110557631A (en) Image prediction method and related equipment
AU2010313997A1 (en) Method and apparatus for encoding and decoding coding unit of picture boundary
CN106851292A (en) For the method for the decoding image of infra-frame prediction
JP2023052767A (en) Video processing method and encoder
WO2016180129A1 (en) Prediction mode selection method, apparatus and device
CN103327327B (en) For the inter prediction encoding unit selection method of high-performance video coding HEVC
CN103067704A (en) Video coding method and system based on skipping of coding unit layer in advance
WO2021031225A1 (en) Motion vector derivation method and apparatus, and electronic device
CN111699689B (en) Video processing method, device and equipment
AU2013201913B2 (en) Method and apparatus for encoding and decoding coding unit of picture boundary
AU2013201857A1 (en) Method and apparatus for encoding/decoding motion vector

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