CN104104955B - The decoding method and device of a kind of image block - Google Patents

The decoding method and device of a kind of image block Download PDF

Info

Publication number
CN104104955B
CN104104955B CN201310123316.5A CN201310123316A CN104104955B CN 104104955 B CN104104955 B CN 104104955B CN 201310123316 A CN201310123316 A CN 201310123316A CN 104104955 B CN104104955 B CN 104104955B
Authority
CN
China
Prior art keywords
block
division
target block
motion information
motion
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
CN201310123316.5A
Other languages
Chinese (zh)
Other versions
CN104104955A (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.)
MIGU Culture Technology 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 CN201310123316.5A priority Critical patent/CN104104955B/en
Publication of CN104104955A publication Critical patent/CN104104955A/en
Application granted granted Critical
Publication of CN104104955B publication Critical patent/CN104104955B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明提供一种图像块的编解码方法和装置。编码方法包括编码器确定目标块的参考块以及参考块的运动信息;所述参考块中的采样点与所述目标块中的采样点一一对应;所述编码器采用所述参考块的运动信息对所述参考块进行运动补偿,得到残差块;所述编码器将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分;所述编码器根据所述运动划分的结果对所述目标块进行编码。与当前的视频编解码器比较,在保证同样视频质量的前提下,本发明实施例可以提高压缩性能。

The invention provides a codec method and device for an image block. The encoding method includes that the encoder determines the reference block of the target block and the motion information of the reference block; the sampling points in the reference block correspond to the sampling points in the target block; the encoder adopts the motion information of the reference block information to perform motion compensation on the reference block to obtain a residual block; the encoder compares the value of each sampling point in the residual block with the division threshold value determined by the encoder, and according to each The comparison result of the sampling points performs motion division on the target block; the encoder encodes the target block according to the result of the motion division. Compared with the current video codec, the embodiment of the present invention can improve the compression performance under the premise of ensuring the same video quality.

Description

一种图像块的编解码方法和装置Method and device for encoding and decoding image blocks

技术领域technical field

本发明涉及视频图像信号编解码技术,尤其涉及一种图像块的编解码方法和装置。The present invention relates to video image signal encoding and decoding technology, in particular to an image block encoding and decoding method and device.

背景技术Background technique

视频信号本身所固有的冗余信息分为空间冗余信息和时间冗余信息。空间冗余信息可以通过正交变换编码的方式去除,时间冗余信息可以通过运动补偿的方法去除。在当前通用的运动补偿算法中,对一个视频块,会预先定义一种或几种划分方式。The inherent redundant information of the video signal itself is divided into spatial redundant information and temporal redundant information. Spatial redundant information can be removed by orthogonal transform coding, and temporal redundant information can be removed by motion compensation. In the current common motion compensation algorithm, one or several division methods are predefined for a video block.

现有技术中的划分方式是固定的,例如,H.264/AVC标准中定义的划分方式是对称的,如对一个16x16的视频宏块,可以划分为16x16、8x16、16x8或8x8等;HEVC标准中定义的划分方式除了2Nx2N,Nx2N,2NxN和NxN的对称划分外,还包括非对称的划分,如除了上述的四种划分方式之外,还可以包括2N×nU、2N×nD、nL×2N或nR×2N等。The division method in the prior art is fixed. For example, the division method defined in the H.264/AVC standard is symmetrical. For example, a 16x16 video macroblock can be divided into 16x16, 8x16, 16x8 or 8x8, etc.; HEVC In addition to the symmetric division of 2Nx2N, Nx2N, 2NxN and NxN, the division methods defined in the standard also include asymmetric division. For example, in addition to the above four division methods, it can also include 2N×nU, 2N×nD, nL× 2N or nR×2N etc.

采用固定的划分方式,无法准确描述运动物体边界,编码器或解码器也就无法获取准确的运动信息,从而不能进行准确的运动补偿预测,导致压缩性能受损。With a fixed division method, the boundaries of moving objects cannot be accurately described, and the encoder or decoder cannot obtain accurate motion information, so that accurate motion compensation prediction cannot be performed, resulting in impaired compression performance.

发明内容Contents of the invention

有鉴于此,本发明实施例提供了一种图像块的编解码方法和装置,用以解决现有技术中存在的因图像块划分无法准确体现物体运动引起的压缩性能受损的问题。In view of this, the embodiments of the present invention provide a method and device for encoding and decoding image blocks, which are used to solve the problem in the prior art that the compression performance is damaged due to the fact that the division of image blocks cannot accurately reflect the movement of objects.

第一方面,提供了一种图像块编码方法,所述方法包括:In a first aspect, an image block encoding method is provided, the method comprising:

编码器确定目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;The encoder determines a reference block of the target block and motion information of the reference block, and the sampling points in the reference block correspond to the sampling points in the target block;

所述编码器采用所述参考块的运动信息对所述参考块进行运动补偿,得到残差块;The encoder uses the motion information of the reference block to perform motion compensation on the reference block to obtain a residual block;

所述编码器将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分;The encoder compares the value of each sampling point in the residual block with the division threshold value determined by the encoder, and performs motion division on the target block according to the comparison result of each sampling point ;

所述编码器根据所述运动划分的结果对所述目标块进行编码。The encoder encodes the target block according to the result of the motion division.

根据本发明第一方面实施例的图像块编码方法,可以有效地提高运动补偿的精度和性能,进而提升视频信号的压缩效果。According to the image block coding method of the embodiment of the first aspect of the present invention, the precision and performance of motion compensation can be effectively improved, thereby improving the compression effect of video signals.

结合第一方面,在第一方面的第一种可能的实现方式中,所述划分门限值为所述残差块中的全部残差值的均值;或,所述划分门限值为所述残差块中的全部残差值的中值。With reference to the first aspect, in a first possible implementation manner of the first aspect, the division threshold is an average value of all residual values in the residual block; or, the division threshold is all The median of all residual values in the residual block described above.

结合上述任意之一实施例的本发明第一方面实施例第二种可能实现的方式中,所述所述编码器将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据比较结果对所述目标块进行运动划分包括:In the second possible implementation manner of the embodiment of the first aspect of the present invention combined with any one of the above embodiments, the encoder compares the value of each sampling point in the residual block with the value determined by the encoder Comparing the division threshold value, and performing motion division on the target block according to the comparison result includes:

如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

结合上述任意之一实施例的本发明第一方面实施例第三种可能实现的方式中,所述所述编码器将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据比较结果对所述目标块进行运动划分包括:In a third possible implementation manner of the embodiment of the first aspect of the present invention combined with any one of the above embodiments, the encoder compares the value of each sampling point in the residual block with the value determined by the encoder Comparing the division threshold value, and performing motion division on the target block according to the comparison result includes:

如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

结合上述任意之一实施例的本发明第一方面实施例第四种可能实现的方式中,所述编码器确定参考块的运动信息,包括:In a fourth possible implementation manner of the embodiment of the first aspect of the present invention combined with any one of the above embodiments, the encoder determines the motion information of the reference block, including:

当所述编码器按照非分层编码方式对所述原视频块进行编码时,获取如下项中的至少一项做为所述参考块运动信息:When the encoder encodes the original video block in a non-hierarchical encoding manner, at least one of the following items is acquired as the reference block motion information:

与所述原视频块空间相邻的视频块的运动信息;Motion information of video blocks spatially adjacent to the original video block;

与所述原视频块时间相邻的视频块的运动信息。Motion information of video blocks temporally adjacent to the original video block.

结合上述任意之一实施例的本发明第一方面实施例第五种可能实现的方式中,所述确定目标块的参考块,包括:In a fifth possible implementation manner of the embodiment of the first aspect of the present invention combined with any one of the above embodiments, the determination of the reference block of the target block includes:

当所述编码器按照分层编码方式对所述原视频块进行编码时,根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the original video block according to the layered encoding method, the reference block is determined according to the corresponding image block of the target block in the low-quality layered reconstruction image:

其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像。Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than that of the reconstructed image of the layer where the target block is located.

结合上述任意之一实施例的本发明第一方面实施例第六种可能实现的方式中,所述确定参考块的运动信息,包括:In the sixth possible implementation manner of the embodiment of the first aspect of the present invention combined with any one of the above embodiments, the determination of the motion information of the reference block includes:

当所述编码器按照分层编码方式对所述原视频块进行编码时,获取如下项中的至少一项做为所述参考块的运动信息:When the encoder encodes the original video block in a layered encoding manner, at least one of the following items is acquired as the motion information of the reference block:

与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block;

与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block;

参考块的运动信息;Motion information of the reference block;

与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block;

与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block.

结合上述任意之一实施例的本发明第一方面实施例第七种可能实现的方式中,所述确定目标块的参考块,包括:In the seventh possible implementation manner of the embodiment of the first aspect of the present invention combined with any one of the above embodiments, the determination of the reference block of the target block includes:

当所述编码器按照非分层编码方式对所述目标块进行编码时,将存储的参考帧中的第三图像块确定为参考块,所述第三图像块是指在设定的失真度量下,所述存储的参考帧中的具有与所述目标块的失真度量最小的图像块。When the encoder encodes the target block in a non-hierarchical encoding manner, the third image block in the stored reference frame is determined as a reference block, and the third image block refers to the set distortion metric Next, the image block in the stored reference frame has the smallest distortion metric with the target block.

根据本发明实施例的一种图像块的编码方法,可以有效地提高运动补偿的精度和性能,进而提升视频信号的压缩效果;同时可以提高运动补偿的效率,减小由此带来的运算复杂度要求。According to an image block coding method according to an embodiment of the present invention, the accuracy and performance of motion compensation can be effectively improved, thereby improving the compression effect of video signals; at the same time, the efficiency of motion compensation can be improved, and the resulting computational complexity can be reduced degree requirements.

第二方面,提供了一种图像块解码方法,所述方法包括:In a second aspect, a method for decoding an image block is provided, the method comprising:

解码器确定目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;The decoder determines the reference block of the target block and the motion information of the reference block, and the sampling points in the reference block are in one-to-one correspondence with the sampling points in the target block;

所述解码器采用所述参考块的运动信息对所述参考块进行运动补偿,得到残差块;The decoder uses the motion information of the reference block to perform motion compensation on the reference block to obtain a residual block;

所述解码器将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分;The decoder compares the value of each sampling point in the residual block with the division threshold value determined by the decoder, and performs motion division on the target block according to the comparison result of each sampling point ;

所述解码器根据所述运动划分的结果对所述目标块进行解码。The decoder decodes the target block according to the result of the motion division.

结合第二方面,在第二方面的第一种可能的实现方式中,所述划分门限值为所述残差块中的全部残差值的均值;或,所述划分门限值为所述残差块中的全部残差值的中值。With reference to the second aspect, in a first possible implementation manner of the second aspect, the division threshold is an average value of all residual values in the residual block; or, the division threshold is all The median of all residual values in the residual block described above.

结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述所述解码器将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据比较结果对所述目标块进行运动划分包括:With reference to the second aspect or the first possible implementation of the second aspect, in the second possible implementation of the second aspect, the decoder converts the value of each sampling point in the residual block to Comparing with the division threshold value determined by the decoder, and performing motion division on the target block according to the comparison result includes:

如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

结合第二方面或第二方面的第一种至第二种任一种可能的实现方式,在第二方面的第三种可能的实现方式中,所述所述解码器将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据比较结果对所述目标块进行运动划分包括:With reference to the second aspect or any of the first to second possible implementation manners of the second aspect, in a third possible implementation manner of the second aspect, the decoder converts the residual block The value of each sampling point is compared with the division threshold value determined by the decoder, and performing motion division on the target block according to the comparison result includes:

如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

结合上述任意之一实施例的本发明第二方面实施例第四种可能实现的方式中,所述确定目标块的参考块,包括:In the fourth possible implementation manner of the embodiment of the second aspect of the present invention combined with any one of the above embodiments, the determination of the reference block of the target block includes:

当所述编码器按照分层编码方式对所述原视频块进行编码时,所述解码器根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the original video block in a layered encoding manner, the decoder determines the reference block according to the image block corresponding to the target block in the low-quality layered reconstruction image:

其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像。Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than that of the reconstructed image of the layer where the target block is located.

结合上述任意之一实施例的本发明第二方面实施例第五种可能实现的方式中,所述确定参考块的运动信息,包括:In a fifth possible implementation manner of the embodiment of the second aspect of the present invention combined with any one of the above embodiments, the determination of the motion information of the reference block includes:

当所述编码器按照分层编码方式对所述原视频块进行编码时,所述解码器获取如下项中的至少一项做为所述参考块运动信息:When the encoder encodes the original video block in a layered encoding manner, the decoder acquires at least one of the following items as the reference block motion information:

与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block;

与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block;

参考块的运动信息;Motion information of the reference block;

与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block;

与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block.

结合上述任意之一实施例的本发明第二方面实施例第六种可能实现的方式中,所述确定目标块的参考块,包括:In the sixth possible implementation manner of the embodiment of the second aspect of the present invention combined with any one of the above embodiments, the determination of the reference block of the target block includes:

当所述编码器按照非分层编码方式对所述目标块进行编码时,所述解码器将存储的参考帧中的第三图像块确定为参考块,所述第三图像块是指在设定的失真度量下,所述存储的参考帧中的具有与所述目标块的失真度量最小的图像块。When the encoder encodes the target block in a non-hierarchical encoding manner, the decoder determines the third image block in the stored reference frame as a reference block, and the third image block refers to the set Under a certain distortion metric, the image block in the stored reference frame has the smallest distortion metric with respect to the target block.

本发明第三方面的实施例提供了一种图像块的划分装置,所述装置位于编码器中,所述装置包括:The embodiment of the third aspect of the present invention provides a device for dividing an image block, the device is located in an encoder, and the device includes:

获取模块,用于获取目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;An acquisition module, configured to acquire a reference block of the target block and motion information of the reference block, where sampling points in the reference block correspond to sampling points in the target block;

运动补偿模块,用于采用所述获取模块获取的所述运动信息对所述获取模块获取的所述参考块进行运动补偿,得到残差块;a motion compensation module, configured to perform motion compensation on the reference block acquired by the acquisition module by using the motion information acquired by the acquisition module to obtain a residual block;

运动划分模块,用于将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分;a motion division module, configured to compare the value of each sampling point in the residual block with the division threshold value determined by the encoder, and perform a process on the target block according to the comparison result of each sampling point sport division;

编码模块,用于根据所述运动划分的结果对所述目标块进行编码。An encoding module, configured to encode the target block according to the result of the motion division.

结合第三方面,在第三方面的第一种可能的实现方式中,所述获取模块具体用于:With reference to the third aspect, in a first possible implementation manner of the third aspect, the acquiring module is specifically configured to:

获取所述原视频块的参考块;Obtain a reference block of the original video block;

当所述编码器按照分层编码方式对所述原视频块进行编码时,获取如下项中的至少一项做为所述参考块的运动信息:When the encoder encodes the original video block in a layered encoding manner, at least one of the following items is acquired as the motion information of the reference block:

与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block;

与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block;

参考块的运动信息;Motion information of the reference block;

与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block;

与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block.

结合第三方面,在第三方面的第二种可能的实现方式中,所述获取模块具体用于:With reference to the third aspect, in a second possible implementation manner of the third aspect, the acquiring module is specifically configured to:

当所述编码器按照分层编码方式对所述原视频块进行编码时,根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the original video block according to the layered encoding method, the reference block is determined according to the corresponding image block of the target block in the low-quality layered reconstruction image:

其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像;Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than the reconstructed image of the layer where the target block is located;

获取所述参考块的运动信息。Acquire motion information of the reference block.

结合第三方面或第三方面的第一种至第二种任一种可能的实现方式,在第三方面的第三种可能的实现方式中,所述运动划分模块具体用于:With reference to the third aspect or any of the first to second possible implementation manners of the third aspect, in a third possible implementation manner of the third aspect, the motion division module is specifically configured to:

将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较;Comparing the value of each sampling point in the residual block with the division threshold value determined by the encoder;

如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

结合第三方面或第三方面的第一种至第二种任一种可能的实现方式,在第三方面的第四种可能的实现方式中,所述运动划分模块具体用于:With reference to the third aspect or any one of the first to second possible implementations of the third aspect, in a fourth possible implementation of the third aspect, the motion division module is specifically configured to:

将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较;Comparing the value of each sampling point in the residual block with the division threshold value determined by the encoder;

如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

第四方面,提供了一种图像块的划分装置,其特征在于,所述装置位于解码器中,所述装置包括:In a fourth aspect, a device for dividing an image block is provided, wherein the device is located in a decoder, and the device includes:

获取模块,用于获取目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;An acquisition module, configured to acquire a reference block of the target block and motion information of the reference block, where sampling points in the reference block correspond to sampling points in the target block;

运动补偿模块,用于采用所述获取模块获取的所述运动信息对所述获取模块获取的所述参考块进行运动补偿,得到残差块;a motion compensation module, configured to perform motion compensation on the reference block acquired by the acquisition module by using the motion information acquired by the acquisition module to obtain a residual block;

运动划分模块,用于将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分;a motion division module, configured to compare the value of each sampling point in the residual block with the division threshold value determined by the decoder, and perform a process on the target block according to the comparison result of each sampling point sport division;

解码模块,用于根据所述运动划分的结果对所述目标块进行解码。A decoding module, configured to decode the target block according to the result of the motion division.

结合第四方面,在第四方面的第一种可能的实现方式中,所述获取模块具体用于:With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the acquiring module is specifically configured to:

获取所述原视频块的参考块;Obtain a reference block of the original video block;

当所述编码器按照分层编码方式对所述原视频块进行编码时,获取如下项中的至少一项做为所述参考块的运动信息:When the encoder encodes the original video block in a layered encoding manner, at least one of the following items is acquired as the motion information of the reference block:

与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block;

与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block;

参考块的运动信息;Motion information of the reference block;

与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block;

与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block.

结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述获取模块具体用于:With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in the second possible implementation manner of the fourth aspect, the acquiring module is specifically configured to:

当所述编码器按照分层编码方式对所述原视频块进行编码时,根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the original video block according to the layered encoding method, the reference block is determined according to the corresponding image block of the target block in the low-quality layered reconstruction image:

其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像;Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than the reconstructed image of the layer where the target block is located;

获取所述参考块的运动信息。Acquire motion information of the reference block.

结合第四方面或第四方面的第一种至第二种任一种可能的实现方式,在第四方面的第三种可能的实现方式中,所述运动划分模块具体用于:With reference to the fourth aspect or any of the first to second possible implementations of the fourth aspect, in a third possible implementation of the fourth aspect, the motion division module is specifically configured to:

将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较;Comparing the value of each sampling point in the residual block with the division threshold value determined by the encoder;

如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

结合上述任意之一实施例的本发明第四方面实施例第四种可能实现的方式中,所述运动划分模块具体用于:In a fourth possible implementation manner of the fourth aspect embodiment of the present invention combined with any one of the above embodiments, the motion division module is specifically used for:

将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较;Comparing the value of each sampling point in the residual block with the division threshold value determined by the encoder;

如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block;

如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.

通过上述技术方案,采用可用运动信息对参考块进行运动补偿,并对运动补偿得到的残差块进行统计分析,根据统计分析的结果对参考块进行划分,可以完成对参考块的自适应划分,通过自适应划分可以获取更准确的运动信息,进而可以进行准确的运动补偿预测,提高压缩性能。Through the above technical solution, the available motion information is used to perform motion compensation on the reference block, and the residual block obtained by motion compensation is statistically analyzed, and the reference block is divided according to the result of the statistical analysis, so that the adaptive division of the reference block can be completed. More accurate motion information can be obtained through adaptive division, and then accurate motion compensation prediction can be performed to improve compression performance.

附图说明Description of drawings

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

图1为本发明实施例提供的一种图像块编码方法的流程示意图;FIG. 1 is a schematic flowchart of an image block encoding method provided by an embodiment of the present invention;

图2为本发明实施例提供的另一种图像块编码方法的流程示意图;FIG. 2 is a schematic flowchart of another image block encoding method provided by an embodiment of the present invention;

图3为本发明实施例中自适应划分的生成示意图;FIG. 3 is a schematic diagram of generation of adaptive division in an embodiment of the present invention;

图4为本发明实施例中根据划分方式得到率失真代价值的流程示意图;Fig. 4 is a schematic flow chart of obtaining the rate-distortion cost value according to the division method in the embodiment of the present invention;

图5为采用现有技术中HEVC完成视频划分与采用本发明实施例的自适应划分完成视频划分的比较示意图;FIG. 5 is a schematic diagram of comparison between video division completed by HEVC in the prior art and video division completed by adaptive division in an embodiment of the present invention;

图6为本发明实施例提供的一种编码方法的流程示意图;FIG. 6 is a schematic flowchart of an encoding method provided by an embodiment of the present invention;

图7为图6对应的编码器的结构示意图;FIG. 7 is a schematic structural diagram of the encoder corresponding to FIG. 6;

图8为本发明实施例提供的一种解码方法的流程示意图;FIG. 8 is a schematic flowchart of a decoding method provided by an embodiment of the present invention;

图9为图8对应的解码器的结构示意图;FIG. 9 is a schematic structural diagram of the decoder corresponding to FIG. 8;

图10为本发明实施例提供的一种编码器的图像块的划分装置的结构示意图。FIG. 10 is a schematic structural diagram of an apparatus for dividing an image block of an encoder according to an embodiment of the present invention.

图11为本发明实施例提供的一种解码器的图像块的划分装置的结构示意图。FIG. 11 is a schematic structural diagram of an apparatus for dividing an image block of a decoder according to an embodiment of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

图1为本发明实施例提供的一种视频块的划分方法的流程示意图,包括:Fig. 1 is a schematic flow chart of a video block division method provided by an embodiment of the present invention, including:

11:编码器确定目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应。11: The encoder determines the reference block of the target block and the motion information of the reference block, and the sampling points in the reference block are in one-to-one correspondence with the sampling points in the target block.

在本发明的一个实施例中,例如,可以对输入对于增强层中的当前编码单元(可以是规则形状或不规则形状),确定可用运动信息In one embodiment of the present invention, for example, the available motion information can be determined for the current coding unit (which can be regular shape or irregular shape) in the enhancement layer

对增强层中的当前编码单元,找到对应的基本层编码单元并取得基本层编码单元的相关编码信息,包括但并不限于运动信息等。For the current coding unit in the enhancement layer, find the corresponding base layer coding unit and obtain related coding information of the base layer coding unit, including but not limited to motion information.

确定可用运动信息列表中的运动信息。运动信息列表中的运动信息主要来自三个方面:增强层中当前编码单元的空间相邻的运动信息;增强层中当前编码单元的时间相邻的运动信息;增强层中当前编码单元对应的基本层编码单元的运动信息。可用运动信息包括但并不局限于以上三个方面,例如对应的基本层单元的空间和时间运动信息也可加入可用运动信息列表。运动信息列表中的运动信息数量可以是预先约定的数目或从码流中取得,其中的运动信息可以有相同的或必须是不同的。Identify the workout in the list of available workouts. The motion information in the motion information list mainly comes from three aspects: the spatially adjacent motion information of the current coding unit in the enhancement layer; the temporally adjacent motion information of the current coding unit in the enhancement layer; the basic Motion information of layer coding units. The available motion information includes but is not limited to the above three aspects, for example, the spatial and temporal motion information of the corresponding base layer unit can also be added to the list of available motion information. The number of motion information in the motion information list can be a pre-agreed number or obtained from the code stream, and the motion information therein can be the same or must be different.

在本发明的一个实施例中,当对应块与目标块分辨率相同时,将对应块作为参考块,否则将对应块进行重采样,将重采样后的图像块作为参考块。重采样的目的是改变对应块的分辨率,使其与目标块相同。In one embodiment of the present invention, when the resolution of the corresponding block is the same as that of the target block, the corresponding block is used as the reference block; otherwise, the corresponding block is resampled, and the resampled image block is used as the reference block. The purpose of resampling is to change the resolution of the corresponding block to be the same as the target block.

在本发明的一个实施例中,对应块的坐标与大小与目标块的坐标与大小存在对应关系。In an embodiment of the present invention, there is a corresponding relationship between the coordinates and the size of the corresponding block and the coordinates and size of the target block.

在本发明的一个实施例中,可以对输入的视频进行划分,不失一般性,假设得到大小为64×64的多个不重叠的视频块,对要编码的一个64×64的视频块可以称为原视频块。In one embodiment of the present invention, the input video can be divided. Without loss of generality, assuming that a plurality of non-overlapping video blocks with a size of 64×64 are obtained, a 64×64 video block to be encoded can be Called the original video block.

在编码端,编码器可以对该原视频块进行编码得到比特流,在解码端,解码器可以对接收的比特流进行解码以恢复该原视频块。At the encoding end, the encoder can encode the original video block to obtain a bit stream, and at the decoding end, the decoder can decode the received bit stream to restore the original video block.

另外,该64x64大小的视频块仅为一种示例,实际应用中的当前视频块也可以是其他大小。In addition, the video block with a size of 64x64 is only an example, and the current video block in an actual application may also be of other sizes.

可用运动信息是指当前可得的运动信息,例如,在编码侧,可用运动信息包括但并不限于原视频块的相邻的已编码的视频块的运动信息。The available motion information refers to the currently available motion information. For example, on the encoding side, the available motion information includes but not limited to the motion information of the adjacent coded video blocks of the original video block.

具体的,对于编码器,在非分层视频编码应用中,可用运动信息包括但不限于如下项中的至少一项:Specifically, for an encoder, in a non-hierarchical video coding application, the available motion information includes but is not limited to at least one of the following items:

与原视频块空间相邻的视频块的运动信息;Motion information of video blocks spatially adjacent to the original video block;

与原视频块时间相邻的视频块的运动信息。Motion information of video blocks temporally adjacent to the original video block.

在分层视频编码应用中,可用运动信息包括但不限于如下项中的至少一项:In layered video coding applications, available motion information includes, but is not limited to, at least one of the following:

与原视频块空间相邻的视频块的运动信息;Motion information of video blocks spatially adjacent to the original video block;

与原视频块时间相邻的视频块的运动信息;Motion information of video blocks temporally adjacent to the original video block;

第一视频块的运动信息;motion information of the first video block;

与第一视频块空间相邻的视频块的运动信息;motion information for video blocks spatially adjacent to the first video block;

与第一视频块时间相邻的视频块的运动信息;motion information for video blocks temporally adjacent to the first video block;

其中,第一视频块是指第一分层中与原视频块对应的视频块,第一分层是指时间、空间、信噪比中的至少一项的分辨率低于原视频块所在分层的分层。例如,原视频块所在的分层为增强层,第一分层是指基本层。Wherein, the first video block refers to the video block corresponding to the original video block in the first layer, and the first layer refers to that the resolution of at least one of time, space, and signal-to-noise ratio is lower than that of the original video block. layering of layers. For example, the layer where the original video block is located is the enhancement layer, and the first layer refers to the base layer.

本发明实施例中,在时间分层和/或信噪比分层时,基本层和增强层中“对应的”视频块是指位置相同的视频块,如在时间分层时,基本层和增强层在进行编码时采用的帧的时间间隔不同,但采用的视频块位于相同的位置,如基本层编码的帧号分别为0,2,4,6...,增强层编码的帧号分别为0,1,2,3...,第一视频块位于基本层的第2帧,且位置为(x0~xn,y0~ym),原视频块位于增强层的第1帧且位置也为(x0~xn,y0~ym)。在空间分层时,基本层和增强层中“对应的”视频块是指像素数量及位置之间的相互关系符合空间分辨率的视频块,例如,增强层与基本层的空间分辨率之比为2∶1,那么假设第一视频块的位置为(x0~xn,y0~ym),则原视频块的位置为(x0/2~xn/2,y0/2~ym/2)。In the embodiment of the present invention, when temporal layering and/or signal-to-noise ratio layering are performed, the "corresponding" video blocks in the base layer and the enhancement layer refer to video blocks with the same position. For example, when temporal layering, the base layer and the enhancement layer The time intervals of frames used by the enhancement layer are different when encoding, but the video blocks used are located at the same position. For example, the frame numbers of the base layer encoding are 0, 2, 4, 6..., and the frame numbers of the enhancement layer encoding They are 0, 1, 2, 3..., the first video block is located in the second frame of the base layer, and its position is (x0~xn, y0~ym), and the original video block is located in the first frame of the enhancement layer and its position It is also (x0~xn, y0~ym). In spatial layering, the "corresponding" video blocks in the base layer and enhancement layer are video blocks whose number of pixels and their positions correspond to the spatial resolution, e.g., the ratio of the spatial resolution of the enhancement layer to the base layer is 2:1, then assuming that the position of the first video block is (x0-xn, y0-ym), then the position of the original video block is (x0/2-xn/2, y0/2-ym/2).

可以理解的是,上述可用运动信息只是一种示例,还可以是其它方式得到的运动信息,例如,可以对原视频块的时间和/或空间相邻的视频块的运动信息进行加权处理等得到的运动信息,甚至可以是独立于原视频块的时间和/或空间相邻的视频块的运动信息。It can be understood that the above-mentioned available motion information is only an example, and it can also be obtained in other ways, for example, it can be obtained by weighting the motion information of temporally and/or spatially adjacent video blocks of the original video block, etc. The motion information of the original video block may even be independent of the motion information of temporally and/or spatially adjacent video blocks of the original video block.

上述的运动信息包括但不限于如下项中的至少一项:运动矢量,例如运动矢量在x方向和y方向的分量数值;预测模式,例如单向预测或者双向预测;以及,参考图像帧在参考图像列表中的索引等。The above-mentioned motion information includes but not limited to at least one of the following items: motion vector, such as component values of the motion vector in the x direction and y direction; prediction mode, such as unidirectional prediction or bidirectional prediction; and, the reference image frame in the reference Indexes in image lists, etc.

对于解码器,可以在接收的比特流中得到可用运动信息。例如,编码器和解码器可以将上述的可用运动信息组成可用运动信息列表,每个可用运动信息在该可用运动信息列表中具有一个索引,编码器输出给解码器的比特流中可以包括编码器采用的可用运动信息的索引,解码器根据该可用运动信息的索引通过查找可用运动信息列表,得到可用运动信息。或者,解码器接收的比特流中也可以直接包含对可用运动信息进行编码后的比特,通过解码比特得到可用运动信息。For the decoder, the available motion information is available in the received bitstream. For example, the encoder and the decoder can form the above available motion information into an available motion information list, each available motion information has an index in the available motion information list, and the bit stream output from the encoder to the decoder can include the encoder The index of the available motion information is used, and the decoder obtains the available motion information by searching the available motion information list according to the index of the available motion information. Alternatively, the bit stream received by the decoder may also directly include bits encoded with the available motion information, and the available motion information may be obtained by decoding the bits.

即,可选的,对于解码器,所述获取原视频块的可用运动信息,包括:That is, optionally, for the decoder, the acquisition of the available motion information of the original video block includes:

所述解码器从所述比特流中获取可用运动信息;the decoder obtains available motion information from the bitstream;

其中,所述比特流中包括所述可用运动信息索引,以根据所述可用运动信息的索引,以及预先建立的与编码器相同的可用运动信息列表,查找确定所述可用运动信息;或者,Wherein, the bit stream includes the available motion information index, so as to search and determine the available motion information according to the available motion information index and the pre-established list of available motion information same as the encoder; or,

所述比特流中包括所述可用运动信息的编码后的比特,通过解码得到所述可用运动信息。The bit stream includes encoded bits of the available motion information, and the available motion information is obtained through decoding.

上述的参考块是编码端和解码端均可得的,使得编码器采用的参考块与解码器采用的参考块是相同的。The aforementioned reference blocks are available at both the encoding end and the decoding end, so that the reference blocks used by the encoder and the reference blocks used by the decoder are the same.

在分层编码时,可以在编码器和解码器中预先定义参考块,具体可以将与原视频块具有相同空间分辨率的视频块确定为参考块。During layered coding, a reference block can be predefined in the encoder and decoder, specifically, a video block with the same spatial resolution as the original video block can be determined as the reference block.

在非分层编码时,参考块可以存储的参考帧中获取。对于编码器,该原视频块是可得的,因此可以将存储的参考帧中与原视频块的划分最接近的一个视频块确定为参考块。之后,在编码得到的比特流中可以包括原视频块与参考块之间的相对位移信息,使得解码器根据该相对位移信息获取参考块。例如,在非分层编码应用中,由于编码端原视频块可得,直接使用原视频块作运动补偿划分得到划分一,使用帧存储器中的某一视频块作为参考块作运动补偿划分可以得到划分二,编码器选择最佳参考块就是在某一失真准则下,对此参考块的划分二相对于划分一的失真最小,最佳参考块与当前视频块之间的相对位移以及参考块在帧存诸器中的位置一起被定义为划分矢量(partition vector)或形状矢量(shape vector);在分层编码应用中,由于基本层和增强层的强相关性,第二视频块(第二视频块的定义可以参见后续描述)可以是参考块的一个的选择,当然,此时参考块的选取也可以采用类似于非分层编码应用中,在帧存储器中找到一个参考块。In non-hierarchical coding, reference blocks can be obtained from stored reference frames. For the encoder, the original video block is available, so a video block in the stored reference frame that is closest to the division of the original video block can be determined as the reference block. Afterwards, relative displacement information between the original video block and the reference block may be included in the encoded bit stream, so that the decoder obtains the reference block according to the relative displacement information. For example, in non-hierarchical coding applications, since the original video block at the encoding end is available, the original video block is directly used for motion compensation division to obtain division 1, and a certain video block in the frame memory is used as a reference block for motion compensation division to obtain Division 2, the encoder selects the best reference block is under a certain distortion criterion, the distortion of the division 2 of the reference block is the smallest relative to the division 1, the relative displacement between the best reference block and the current video block and the reference block in The positions in the frame registers are defined together as a partition vector or a shape vector; in layered coding applications, due to the strong correlation between the base layer and the enhancement layer, the second video block (second The definition of the video block can refer to the subsequent description) can be a selection of a reference block, of course, the selection of the reference block at this time can also be similar to the non-hierarchical coding application, find a reference block in the frame memory.

即,对于编码器,可选的,获取原视频块的参考块,包括:That is, for the encoder, optionally, obtain the reference block of the original video block, including:

当所述编码器在分层编码时,将第二视频块确定为参考块,所述第二视频块与所述原视频块具有相同的空间分辨率,其中,所述第二视频块是指第二分层中与原视频块对应的视频块,所述第二分层是指时间和/或信噪比的分辨率低于所述原视频块所在分层的分层,或者,所述第二视频块是指第三分层中上采样的与所述原视频块对应的视频块,所述第三分层是指空间分辨率低于所述原视频块所在分层的分层;或者,When the encoder is performing layered encoding, the second video block is determined as a reference block, and the second video block has the same spatial resolution as the original video block, wherein the second video block refers to A video block corresponding to the original video block in the second layer, where the second layer refers to a layer whose time and/or signal-to-noise ratio resolution is lower than the layer where the original video block is located, or, the The second video block refers to the video block corresponding to the original video block upsampled in the third layer, and the third layer refers to a layer whose spatial resolution is lower than the layer where the original video block is located; or,

当所述编码器在非分层编码时,将存储的参考帧中的第三视频块确定为参考块,所述第三视频块是指在设定的划分失真度量下,具有与所述原视频块的划分最接近划分的视频块。When the encoder is performing non-hierarchical encoding, the third video block in the stored reference frame is determined as a reference block, and the third video block refers to a set of division distortion metrics that have the same The division of the video block is closest to the divided video block.

对于解码器,可选的,获取原视频块的参考块,包括:For the decoder, optionally, obtain the reference block of the original video block, including:

在分层编码时,所述解码器将编码器和解码器预先约定的参考块确定为所述解码器采用的参考块(此时的参考块由编解码器推知,并不需要额外的比特花费);或者,During layered encoding, the decoder determines the reference block agreed upon by the encoder and decoder in advance as the reference block used by the decoder (the reference block at this time is inferred by the codec and does not require additional bit cost );or,

在非分层编码时,所述比特流中包含用于指示编码器采用的参考块的指示信息,所述解码器根据所述指示信息确定所述解码器采用的参考块,其中,如果所述参考块由一个视频块组成,所述指示信息包括所述参考块所在参考帧在帧存储器中的位置索引,以及所述参考块与所述原视频块的相对位移;或者,如果所述参考块由多个视频块加权而成,所述指示信息包括每个视频块所在参考帧在帧存储器中的位置索引,每个视频块与原视频块的相对位移,和每个视频块的权重。In non-hierarchical encoding, the bit stream contains indication information for indicating the reference block used by the encoder, and the decoder determines the reference block used by the decoder according to the indication information, wherein if the The reference block is composed of a video block, and the indication information includes the position index of the reference frame where the reference block is located in the frame memory, and the relative displacement between the reference block and the original video block; or, if the reference block It is formed by weighting multiple video blocks, and the indication information includes the position index of the reference frame where each video block is located in the frame memory, the relative displacement between each video block and the original video block, and the weight of each video block.

在获取可用运动信息和参考块后,所述第一设备可以根据所述可用运动信息,对所述参考块进行自适应划分。After obtaining the available motion information and the reference block, the first device may adaptively divide the reference block according to the available motion information.

其中,自适应划分是指不限于现有技术中固定划分方式,例如不限于H.264/AVC的对称划分方式,也不限于HEVC的非对称划分方式,本发明实施例提出的自适应划分并不限于矩形划分,可以是任意划分形状。Wherein, the adaptive partitioning refers to not being limited to the fixed partitioning method in the prior art, for example, not limited to the symmetric partitioning method of H.264/AVC, nor limited to the asymmetrical partitioning method of HEVC. It is not limited to rectangular division, and may be any division shape.

上述的自适应划分可以是根据运动补偿进行的,即,可选的,所述根据所述可用运动信息,对所述参考块进行自适应划分,包括:The above adaptive division may be performed based on motion compensation, that is, optionally, the adaptive division of the reference block according to the available motion information includes:

根据所述可用运动信息,采用运动补偿方式,对所述参考块进行自适应划分。Adaptively divide the reference block in a motion compensation manner according to the available motion information.

可选的,所述根据所述可用运动信息,采用运动补偿方式,对所述参考块进行自适应划分,包括:Optionally, the adaptive division of the reference block by using motion compensation according to the available motion information includes:

12:所述编码器采用所述参考块的运动信息对所述参考块进行运动补偿,得到残差块。12: The encoder uses the motion information of the reference block to perform motion compensation on the reference block to obtain a residual block.

13:所述编码器将所述残差块中每一个采样点的值与所述编码器确定的13: The encoder compares the value of each sampling point in the residual block with the value determined by the encoder

划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标dividing the threshold value for comparison, and according to the comparison result of each of the sampling points for the target

块进行运动划分。blocks for motion division.

其中,残差块的中值是指将所有残差块的数值进行排序,然后取中间的Among them, the median value of the residual block refers to sorting the values of all residual blocks, and then taking the middle value

数据。data.

在本发明的一个实施例中,将残差块的值小于残差块的中值的像素组成In one embodiment of the present invention, the pixels whose value of the residual block is smaller than the median value of the residual block are composed of

的划分为划分0,否则为划分1。is partition 0, otherwise partition 1.

在本发明的一个实施例中,将残差块的值小于等于残差块的中值的像素In one embodiment of the present invention, pixels whose value is less than or equal to the median value of the residual block

组成的划分为划分0,否则为划分1。A composed partition is partition 0, otherwise partition 1.

14:所述编码器根据所述运动划分的结果对所述目标块进行编码。14: The encoder encodes the target block according to the result of the motion division.

其中,每个或每组可用运动信息可以对应一种划分方式。可以理解的是,每组可用运动信息是指包括至少两个可用运动信息;一种划分方式可以划分得到两个或至少三个的视频块。Wherein, each or each group of available motion information may correspond to a division manner. It can be understood that each group of available motion information includes at least two pieces of available motion information; a division manner may divide to obtain two or at least three video blocks.

在本发明的一个实施例中,根据运动划分对目标块进行编码,包括:In one embodiment of the present invention, encoding the target block according to the motion division includes:

通过运动估计确定所述两个运动划分的运动信息;determining motion information for the two motion partitions by motion estimation;

根据所确定的运动信息,对所述两个运动划分进行运动补偿得到所述目标块的预测,以及根据所述预测计算得到所述目标块的残差;performing motion compensation on the two motion divisions according to the determined motion information to obtain a prediction of the target block, and calculating a residual of the target block according to the prediction;

将所述两个运动划分的运动信息以及所述目标块的残差写入码流。Writing the motion information of the two motion divisions and the residual of the target block into a code stream.

例如,当每个可用运动信息对应一种划分方式时,可以是根据该一个可用运动信息,得到一个残差块,根据该一个残差块的统计分析,划分得到两个视频块,或者至少三个视频块。或者,For example, when each available motion information corresponds to a division method, a residual block may be obtained according to the available motion information, and two video blocks, or at least three video blocks. or,

当每组可用运动信息对应一种划分方式时,可以是根据至少两个运动信息,得到至少两个残差块,根据该至少两个残差块的统计分析,划分得到至少三个视频块。上述划分时对每个残差块进行统计分析时,可以设置一个或至少两个阈值。When each group of available motion information corresponds to a division method, at least two residual blocks may be obtained according to at least two pieces of motion information, and at least three video blocks may be obtained through statistical analysis of the at least two residual blocks. When performing statistical analysis on each residual block during the above division, one or at least two thresholds can be set.

由于运动补偿模块是现有视频编解码器中普遍使用的模块,因此一方面本发明实施例提出的实现方式可以充分利用现有技术,增强本发明实施例的应用广度以及成熟度;另一方面采用运动补偿模块实现自适应划分可以降低运算复杂度,将运动复杂度限定在可接受的范围。Since the motion compensation module is a commonly used module in existing video codecs, on the one hand, the implementation methods proposed by the embodiments of the present invention can make full use of existing technologies to enhance the application breadth and maturity of the embodiments of the present invention; on the other hand Using the motion compensation module to implement adaptive division can reduce the computational complexity and limit the motion complexity to an acceptable range.

可选的,当为编码器时,在根据可用运动信息对参考块进行自适应划分后,还可以包括:Optionally, when it is an encoder, after adaptively dividing the reference block according to the available motion information, it may also include:

所述编码器根据对所述参考块的自适应划分,确定所述原视频块的划分方式;The encoder determines the division method of the original video block according to the adaptive division of the reference block;

所述编码器根据所述原视频块的划分方式,对所述原视频块进行划分以及编码,得到编码后的比特流并输出给解码器。The encoder divides and encodes the original video block according to the division manner of the original video block, obtains an encoded bit stream and outputs it to a decoder.

上述的根据对参考块的自适应划分,确定原视频的划分方式可以是指:由于每个可用运动信息或其组合可以对应一种对参考块的自适应划分,在确定一种自适应划分后,可以将该自适应划分应用到原视频块中,之后再采用该划分对原视频块进行划分和编码,得到一种评价值,将评价值最优的划分方式确定为原视频块的划分方式。该评价值包括但不限于率失真代价值。According to the above-mentioned adaptive division of the reference block, determining the division method of the original video may refer to: since each available motion information or its combination can correspond to an adaptive division of the reference block, after determining an adaptive division , the adaptive division can be applied to the original video block, and then the original video block can be divided and encoded by this division to obtain an evaluation value, and the division method with the best evaluation value can be determined as the division method of the original video block . The evaluation value includes but not limited to the rate-distortion penalty value.

在确定出原视频块的划分方式后,可以采用该划分方式对原视频块进行划分以及编码,编码后的比特流中可以包括:划分方式对应的比特,该划分方式表明为自适应划分;运动信息对应的比特,该比特可以是运动信息在可用运动信息列表中的索引,如,MV0在可用运动信息列表中的索引为0,那么该运动信息对应的比特为0,或者,该运动信息对应的比特可以就是对MV0直接进行编码后的比特。可以理解的是,此处以一个可用运动信息(MV0)对应一种划分方式为例,可选的,当划分方式是对应至少两个可用运动信息时,则包括至少两个可用运动信息对应的比特,例如包括至少两个可用运行信息在可用运动信息列表中的索引,或者直接对可用运动信息进行编码后的比特。After determining the division method of the original video block, the division method can be used to divide and encode the original video block, and the coded bit stream can include: bits corresponding to the division method, which indicates adaptive division; The bit corresponding to the information, the bit can be the index of the motion information in the available motion information list, for example, if the index of MV0 in the available motion information list is 0, then the bit corresponding to the motion information is 0, or the motion information corresponds to The bits of may be the bits directly encoded on MV0. It can be understood that, here, one available motion information (MVO) corresponds to one division mode as an example. Optionally, when the division mode corresponds to at least two available motion information, bits corresponding to at least two available motion information are included. , for example, including at least two indexes of the available running information in the available motion information list, or directly encoded bits of the available motion information.

上述给出了当第一设备为编码器时的划分方式,在编码器端由于需要从多种可能的划分方式中确定出一种最终的划分方式,因此存在上述的代价值比较过程。而对于解码器,由于编码器会在输出的比特流中包含划分方式以及运动信息,解码器可以直接从该比特流中确定出划分方式和运动信息,采用这些信息进行解码,以恢复原视频块。The above gives the division method when the first device is an encoder. At the encoder side, it is necessary to determine a final division method from multiple possible division methods, so there is the above-mentioned cost value comparison process. For the decoder, since the encoder will include the division method and motion information in the output bit stream, the decoder can directly determine the division mode and motion information from the bit stream, and use these information to decode to restore the original video block .

即,可选的,对于解码器,所述方法还包括:That is, optionally, for the decoder, the method further includes:

所述解码器接收比特流;the decoder receives a bitstream;

所述解码器根据对所述参考块的自适应划分,对所述比特流进行解码,以恢复所述原视频块。The decoder decodes the bit stream according to the adaptive division of the reference block, so as to restore the original video block.

本实施例通过采用可用运动信息完成对参考块的自适应划分,在编码端对参考块的自适应划分可以应用到原视频块中,使得原视频块完成自适应划分,在解码端可以根据对参考块的自适应划分恢复原视频块,通过自适应划分可以获取更准确的运动信息,进而可以进行准确的运动补偿预测,提高压缩性能。In this embodiment, the adaptive division of the reference block is completed by using the available motion information, and the adaptive division of the reference block at the encoding end can be applied to the original video block, so that the original video block can be adaptively divided, and the decoding end can be based on the The adaptive division of the reference block restores the original video block, and more accurate motion information can be obtained through adaptive division, and then accurate motion compensation prediction can be performed to improve compression performance.

参见图2,本发明实施例提供了一种编码器确定原视频块的划分方式的流程示意图,不失一般性,在本实施例中假设原视频块有两个划分。将残差块中每一个采样点的值与编码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对目标块进行运动划分。Referring to FIG. 2 , an embodiment of the present invention provides a schematic flow chart of an encoder determining a division method of an original video block. Without loss of generality, in this embodiment, it is assumed that the original video block has two divisions. The value of each sampling point in the residual block is compared with the division threshold value determined by the encoder, and motion division is performed on the target block according to the comparison result of each sampling point.

其中,残差块的中值是指将所有残差块的数值进行排序,然后取中间的数据;。Among them, the median value of the residual block refers to sorting the values of all residual blocks, and then taking the middle data;.

或对原视频块进行迭代的四叉树分割,然后在分割后的视频块上作两个划分。本实施例可以包括:Or perform iterative quadtree segmentation on the original video block, and then make two divisions on the divided video block. This embodiment can include:

21:对应每个可用运动信息,采用该可用运动信息对参考块进行运动补偿,得到残差块;21: Corresponding to each available motion information, use the available motion information to perform motion compensation on the reference block to obtain a residual block;

例如,采用的一个可用运动信息为MV0,那么可以首先采用该MV0对参考块进行运动补偿,得到相应的残差块。For example, if the available motion information used is MV0, then the MV0 may be firstly used to perform motion compensation on the reference block to obtain the corresponding residual block.

参见图3,以分层编码为例,上述的采用可用运动信息对参考块进行运动补偿可以包括:Referring to FIG. 3 , taking layered coding as an example, the above-mentioned motion compensation for the reference block using the available motion information may include:

第0步,确定增强层的原视频块的可用运动信息(图3中示出3个运动信息,MV0,MV1和MV2);The 0th step, determine the available motion information of the former video block of enhancement layer (show 3 motion information among Fig. 3, MV0, MV1 and MV2);

第1步,假设参考块为基本层的第一视频块,第一视频块是指基本层中与原视频块对应的视频块;Step 1, assuming that the reference block is the first video block of the base layer, the first video block refers to the video block corresponding to the original video block in the base layer;

第一视频块所包含的图像内容与原视频所包含的图像内容强相关,这种强相关是基于分层编码中视频编码信号的强相关性。The image content contained in the first video block is strongly correlated with the image content contained in the original video, and this strong correlation is based on the strong correlation of video coding signals in layered coding.

在本发明的一个实施例中,第一视频块的内容和原视频的内容是非常相似的。例如都是对一个物体的同一部分进行编码等。In one embodiment of the present invention, the content of the first video block is very similar to the content of the original video. For example, they all encode the same part of an object.

第2步,使用一个可用运动信息(如MV0),对参考块进行运动补偿得到预测块;Step 2, using an available motion information (such as MV0), perform motion compensation on the reference block to obtain the prediction block;

第3步,预测块与参考块相减得到残差块。In step 3, the prediction block is subtracted from the reference block to obtain a residual block.

22:对该残差块进行统计分析,得到参考块的该可用运动信息对应的划分方式。22: Perform statistical analysis on the residual block to obtain a division method corresponding to the available motion information of the reference block.

本实施例以每个可用运动信息对应一种划分方式为例,可以理解的是,也可以是一组可用运动信息对应一种划分方式。In this embodiment, each available motion information corresponds to a division manner as an example. It can be understood that a group of available motion information may also correspond to a division manner.

参见图3,22的具体内容可以包括:Referring to Figure 3, the specific content of 22 may include:

第4步,对残差块进行统计分析;Step 4, perform statistical analysis on the residual block;

第5步,根据统计分析的结果得到该可用运动信息对应的划分方式。Step 5: According to the result of the statistical analysis, the division method corresponding to the available motion information is obtained.

该统计分析是基于视频块的图像内容,依据具有不同运动信息的图像内容分属不同划分区域的原理,例如,图像内容包括A和B,对于一个好的划分算法,当A和B具有相同运动信息时其属于同一个划分块,当A和B具有不同运动信息时,其分别属于不同的划分块。The statistical analysis is based on the image content of the video block, according to the principle that the image content with different motion information belongs to different division areas, for example, the image content includes A and B, for a good division algorithm, when A and B have the same motion When A and B have different motion information, they belong to different division blocks.

由于上述的统计分析是基于图像内容的运动信息,因此当图像内容具有不同的运动信息时,将具有不同的划分方式,即划分具有自适应的特点。Since the above statistical analysis is based on the motion information of the image content, when the image content has different motion information, there will be different division methods, that is, the division has the feature of self-adaptation.

具体的,统计分析包括但不限于:计算残差块像素的绝对值均值,并将此均值作为阈值,通过残差块像素绝对值与此阈值的比较确定划分方式;或者,通过计算残差块像素的梯度值确定划分方式;计算残差块像素的中值,或者计算残差块像素的平均值。Specifically, the statistical analysis includes but is not limited to: calculating the mean value of the absolute value of the pixels of the residual block, using this mean value as a threshold, and determining the division method by comparing the absolute value of the pixels of the residual block with this threshold; or, by calculating The gradient value of the pixel determines the division method; calculate the median value of the pixels of the residual block, or calculate the average value of the pixels of the residual block.

例如,当某个残差块像素的绝对值超过计算得到的均值阈值,那么该像素与不超过阈值的像素属于不同的划分。或者,某个残差块像素的梯度值超过预设的阈值,那么该梯度值两侧的像素属于不同的划分。For example, when the absolute value of a residual block pixel exceeds the calculated average threshold, then the pixel belongs to a different division from the pixels that do not exceed the threshold. Or, if the gradient value of a residual block pixel exceeds a preset threshold, then the pixels on both sides of the gradient value belong to different divisions.

参见图3,以划分后的图像块为两块为例,图3左下角给出了一个具体的划分结果的例子。该划分是在参考块上的划分。Referring to FIG. 3 , taking the divided image block as two blocks as an example, a specific example of the division result is given in the lower left corner of FIG. 3 . This division is a division on a reference block.

23:将参考块的划分应用到原视频块上。23: Apply the division of the reference block to the original video block.

参见图3的第6步,将与参考块相同的划分方式用于划分原视频块,如图3的右上角所示。Referring to step 6 in FIG. 3 , the same division method as the reference block is used to divide the original video block, as shown in the upper right corner of FIG. 3 .

上述描述了MV0的划分方式,类似的,可以得到MV1和MV2的划分方式。其中,可用运动信息与划分方式是一一对应的。The above describes the division method of MV0, similarly, the division methods of MV1 and MV2 can be obtained. There is a one-to-one correspondence between the available motion information and the division method.

可以理解的是,本实施例以三个运动信息为例,本发明实施例的方法并不限于该三个运动信息,该运动信息可以是多个,该多个运动信息可以组成一个列表,称为运动信息列表,并且每个运动信息在该运动信息列表中可以对应唯一的索引,因此,每个运动信息可以具有一个运动信息索引。It can be understood that this embodiment takes three motion information as an example, the method in the embodiment of the present invention is not limited to the three motion information, the motion information may be multiple, and the multiple motion information may form a list, called is a motion information list, and each motion information may correspond to a unique index in the motion information list, therefore, each motion information may have a motion information index.

24:采用每种划分方式对原视频块进行编码,得到每种划分方式对应的评价值,将评价值最优的划分方式确定为原视频块的划分方式。24: Encoding the original video block by using each division method, obtaining the evaluation value corresponding to each division method, and determining the division method with the best evaluation value as the division method of the original video block.

其中,评价值可以是指率失真代价值,此时,评价值最优是指率失真代价值最小。可以理解的是,该评价值并不限于率失真代价值,例如还可以根据残差值,确定每种划分方式对应的残差值,将残差值最小的划分方式确定为最终划分方式。本发明实施例以率失真代价值为例。Wherein, the evaluation value may refer to the rate-distortion cost value, and in this case, the optimal evaluation value refers to the smallest rate-distortion cost value. It can be understood that the evaluation value is not limited to the rate-distortion cost value. For example, the residual value corresponding to each division method may be determined according to the residual value, and the division method with the smallest residual value is determined as the final division method. In this embodiment of the present invention, the rate-distortion cost is used as an example.

如上所示,每种运动信息将对应一种划分方式,根据每种划分方式又可以得到一个率失真代价值,在计算出所有运动信息分别对应的率失真代价值后,就可以确定出最终划分方式。例如,采用MV0对应的划分方式得到的率失真代价值为cost0,采用MV1对应的划分方式得到的率失真代价值为costl,采用MV2对应的划分方式得到的率失真代价值为cost2,假设cost0最小,那么可以将MV0对应的划分方式确定为最终划分方式。As shown above, each type of motion information will correspond to a division method, and a rate-distortion cost value can be obtained according to each division method. After calculating the rate-distortion cost values corresponding to all motion information, the final division can be determined. Way. For example, the rate-distortion cost value obtained by using the division method corresponding to MV0 is cost0, the rate-distortion cost value obtained by using the division method corresponding to MV1 is cost1, and the rate-distortion cost value obtained by using the division method corresponding to MV2 is cost2, assuming that cost0 is the smallest , then the division method corresponding to MV0 can be determined as the final division method.

本实施例在自适应划分时采用运动补偿模块,由于运动补偿模块是通用模块,可以降低运动复杂度以及提高适用性。In this embodiment, a motion compensation module is used in the adaptive division. Since the motion compensation module is a general-purpose module, motion complexity can be reduced and applicability can be improved.

可选的,参见图4,采用每种划分方式对原视频块进行编码,得到每种划分方式对应的率失真代价值,可以包括:Optionally, referring to FIG. 4, each division method is used to encode the original video block, and the rate-distortion cost value corresponding to each division method is obtained, which may include:

41:对应每种划分方式,得到划分后的视频块,并确定每个划分后的视频块的运动信息;41: Corresponding to each division method, the divided video blocks are obtained, and the motion information of each divided video block is determined;

可选的,可以对每个划分后的视频块进行运动估计,得到对应的运动信息。例如,假设对原视频块划分后得到两个视频块,分别为第一视频块和第二视频块,那么,可以对第一视频块进行运动估计,得到第一视频块对应的运动信息,以及,对第二视频块进行运动估计,得到第二视频块对应的运动信息。或者,Optionally, motion estimation may be performed on each divided video block to obtain corresponding motion information. For example, assuming that two video blocks are obtained after dividing the original video block, which are respectively the first video block and the second video block, then the motion estimation can be performed on the first video block to obtain the corresponding motion information of the first video block, and , performing motion estimation on the second video block to obtain motion information corresponding to the second video block. or,

可选的,也可以将采用的可用运动信息作为与该可用运动信息相邻的划分后的视频块的运动信息。例如,采用的运动信息为MV0,假设划分后与该MV0相邻的视频块为第一视频块(如图3的划分后的左侧的视频块),那么第一视频块的运动信息可以确定为MV0,类似的,如图3的划分后的右侧的视频块的运动信息可以确定为MV1。Optionally, the available motion information may also be used as the motion information of the divided video blocks adjacent to the available motion information. For example, the motion information used is MV0, assuming that the video block adjacent to the MV0 after division is the first video block (such as the video block on the left side after division as shown in Figure 3), then the motion information of the first video block can be determined is MV0, and similarly, the motion information of the video block on the right side after division as shown in FIG. 3 can be determined as MV1.

42:根据每个划分后的视频块的运动信息,对所述每个划分后的视频块进行运动补偿,得到所述每个划分后的视频块的预测块,以及所述每个划分后的视频块的预测块与所述每个划分后的视频块的残差块;42: Perform motion compensation on each divided video block according to the motion information of each divided video block, to obtain a prediction block of each divided video block, and each divided video block a prediction block of the video block and a residual block of each divided video block;

例如,划分后的视频块为第一视频块和第二视频块,两个视频块对应的运动信息为第一运动信息和第二运动信息,那么可以采用第一运动信息对第一图像块进行运动补偿,得到第一预测块,第一预测块是第一视频块的预测块,并得到第一预测块与第一视频块的残差块,该残差块可以称为第一残差块;类似的,可以采用第二运动信息对第二视频块进行运动补偿,得到第二预测块,第二预测块是第二视频块的预测块,并得到第二预测块与第二视频块的残差块,该残差块可以称为第二残差块。For example, the divided video blocks are the first video block and the second video block, and the motion information corresponding to the two video blocks is the first motion information and the second motion information, then the first motion information can be used to perform Motion compensation, obtain the first prediction block, the first prediction block is the prediction block of the first video block, and obtain the residual block between the first prediction block and the first video block, the residual block may be called the first residual block ; Similarly, the second motion information can be used to perform motion compensation on the second video block to obtain the second prediction block, the second prediction block is the prediction block of the second video block, and the relationship between the second prediction block and the second video block is obtained A residual block, which may be called a second residual block.

可以理解的是,本发明实施例中运动补偿时得到预测块以及残差块的具体内容,以及运动估计得到运动信息的具体内容可以参见现有技术中运动补偿和运动估计的具体内容,在此不再赘述。It can be understood that, in the embodiment of the present invention, the specific content of the prediction block and the residual block obtained during motion compensation, and the specific content of the motion information obtained by motion estimation can refer to the specific content of motion compensation and motion estimation in the prior art, here No longer.

43:根据每个划分后的视频块对应的残差块,进行正交变换、量化、逆量化和逆正交变换后,得到所述原视频块的重构的残差块。43: Obtain a reconstructed residual block of the original video block after performing orthogonal transformation, quantization, inverse quantization, and inverse orthogonal transformation according to the residual block corresponding to each divided video block.

可选的,正交变换可以是规则形状变换,例如,矩形变换,当采用规则形状变换时,可以先对每个划分后得到的残差块进行拼合,得到原视频块对应的规则残差块,如将第一残差块和第二残差块进行拼合,之后再对拼合后的残差块进行正交变换等。或者,Optionally, the orthogonal transformation may be a regular shape transformation, for example, a rectangular transformation. When a regular shape transformation is used, the residual blocks obtained after each division may be first combined to obtain a regular residual block corresponding to the original video block , such as combining the first residual block and the second residual block, and then performing an orthogonal transformation on the combined residual block. or,

正交变换也可以是非规则形状变换,此时,可以分别对第一残差块和第二残差块进行正交变换等。The orthogonal transformation may also be an irregular shape transformation, and in this case, the orthogonal transformation may be performed on the first residual block and the second residual block respectively.

残差块经正交变换,量化,扫描后得到一维的量化变换系数;对量化变换系数作相应的逆扫描,逆量化,逆正交变换得到原视频块的重构的残差块。The residual block is subjected to orthogonal transformation, quantization, and scanning to obtain one-dimensional quantized transformation coefficients; corresponding inverse scanning, inverse quantization, and inverse orthogonal transformation are performed on the quantized transformation coefficients to obtain the reconstructed residual block of the original video block.

44:根据所述每个划分后的视频块的预测块得到原视频块的预测块,根据所述原视频块的预测块以及所述原视频块的重构的残差块,得到重构的原视频块。44: Obtain the predicted block of the original video block according to the predicted block of each divided video block, and obtain the reconstructed residual block according to the predicted block of the original video block and the reconstructed residual block of the original video block raw video chunks.

其中,可以将第一预测块和第二预测块进行拼合后得到源视频块的预测块,之后,再将源视频块的预测块与该原视频块的重构的残差块相加,得到重构的原视频块。Wherein, the first predicted block and the second predicted block can be combined to obtain the predicted block of the source video block, and then the predicted block of the source video block is added to the reconstructed residual block of the original video block to obtain Reconstructed raw video chunks.

另外,重构的原视频块/帧经后处理(包括但并不限于去块效应等)后可以作为参考帧存入帧存储器,供后面的编码图像帧运动估计时使用。In addition, after post-processing (including but not limited to deblocking, etc.), the reconstructed original video block/frame can be stored as a reference frame in the frame memory for use in motion estimation of subsequent coded image frames.

45:比较所述重构的原视频块与所述原视频块,得到编码失真,并通过所述自适应划分对应的编码模式对原视频块进行编码得到编码比特,根据编码失真和编码比特,得到率失真代价值。45: Comparing the reconstructed original video block with the original video block to obtain encoding distortion, and encoding the original video block through the encoding mode corresponding to the adaptive division to obtain encoding bits, according to encoding distortion and encoding bits, Get the rate-distortion cost value.

上述的编码失真可以通过比较重构的原视频块与原视频块得到。The above coding distortion can be obtained by comparing the reconstructed original video block with the original video block.

上述的编码比特可以包括:表明划分方式为自适应划分的比特,表明原视频块的划分方式对应的可用运动信息的比特。The above coding bits may include: bits indicating that the division mode is adaptive division, and bits indicating available motion information corresponding to the division mode of the original video block.

可用运动信息可以组成可用运动信息列表,上述编码比特中包含的运动信息可以是可用运动信息的索引,或者直接对采用的运动信息进行编码。划分后的视频块的运动信息可以是直接编码得到的信息,或者也可以是与最终划分方式对应的可用运动信息的差值信息。The available motion information may form an available motion information list, and the motion information contained in the coded bits may be an index of the available motion information, or directly encode the adopted motion information. The motion information of the divided video block may be the information obtained by direct encoding, or may be the difference information of the available motion information corresponding to the final division manner.

即,可选的,所述编码比特包括:That is, optionally, the coded bits include:

划分方式对应的比特,所述划分方式表明划分为自适应划分;以及,Bits corresponding to the division mode, the division mode indicates that the division is adaptive division; and,

第一可用运动信息对应的比特,所述第一可用运动信息对应的比特为所述第一可用运动信息在所述可用运动信息列表中的索引,或者,所述第一可用运动信息对应的比特为对所述第一可用运动信息进行编码后的比特。A bit corresponding to the first available motion information, where the bit corresponding to the first available motion information is an index of the first available motion information in the available motion information list, or, the bit corresponding to the first available motion information are bits after encoding the first available motion information.

例如,生成最终划分(即确定出的原视频块的划分方式)的运动信息为MV0,假设MV0在运动信息列表中的索引为0,那么该编码比特中包含的划分方式对应的运动信息为0;可以理解的是,当划分方式对应的是一组可用运动信息,编码时需要对该一组可用运动信息进行编码。For example, the motion information for generating the final partition (that is, the determined division method of the original video block) is MV0, assuming that the index of MV0 in the motion information list is 0, then the motion information corresponding to the division method contained in the coded bits is 0 ; It can be understood that when the division mode corresponds to a group of available motion information, the group of available motion information needs to be encoded during encoding.

进一步的,如果对划分后的每个视频块进行运动估计,编码比特还可以包括每个划分后的视频块的运动信息对应的比特,该运动信息对应的比特包括但不限于:直接编码得到的比特,或者用于生成划分的运动信息与划分后每个图像块对应的运动信息的差分值的编码比特。以差分值为例,例如,划分后的视频块为第一视频块和第二视频块,第一视频块对应的运动信息为第一运动信息,第二视频块对应的运动信息为第二运动信息,用于生成划分的运动信息集合为{MV0,MV1,MV2},假设第一运动信息与运动信息集合中MV0最为接近,而第二运动信息与运动信息集合中MV1最为接近,那么还包括MV0与第一运动信息的差分值以及MV1与第二运动信息的差分值。所述的最为接近是指使用运动信息集合中的某个运动信息对第一或第二运动信息进行编码时,相应的索引以及x和y方向的差分值需要的比特数最少.例如,假设第一运动信息为NMV,对应上述的三个运动信息MV0、MV1和MV3可以得到:(1)索引值0,NMV(x)-MV0(x),NMV(y)-MV0(y);(2)索引值1,NMV(x)-MV1(x),NMV(y)-MV1(y);(3)索引值2,NMV(x)-MV2(x),NMV(y)-MV2(y);分别对上述三种信息进行编码,得到三种编码后的比特,假设对(1)的编码比特开销最小,则MV0为NMV的最接近的运动信息。上述的(x)和(y)分别表示相应运动信息的x和y方向的值,如NMV(x)表示NMV在x方向的值,NMV(y)表示NMV在y方向的值。另外,编码比特还可以包括:正交变换的结构信息,子结构的全零系数指示,和量化的正交变换系数等。Further, if motion estimation is performed on each divided video block, the coded bits may also include bits corresponding to the motion information of each divided video block, and the bits corresponding to the motion information include but are not limited to: bits, or encoding bits used to generate a difference value between divided motion information and motion information corresponding to each divided image block. Taking the difference value as an example, for example, the divided video blocks are the first video block and the second video block, the motion information corresponding to the first video block is the first motion information, and the motion information corresponding to the second video block is the second motion information, the motion information set used to generate division is {MV0, MV1, MV2}, assuming that the first motion information is the closest to MV0 in the motion information set, and the second motion information is the closest to MV1 in the motion information set, then it also includes The difference between MV0 and the first motion information and the difference between MV1 and the second motion information. The closest means that when using a certain motion information in the motion information set to encode the first or second motion information, the corresponding index and the difference values in the x and y directions require the least number of bits. For example, assuming that the first One motion information is NMV, corresponding to the above three motion information MV0, MV1 and MV3 can be obtained: (1) index value 0, NMV(x)-MV0(x), NMV(y)-MV0(y); (2 ) index value 1, NMV(x)-MV1(x), NMV(y)-MV1(y); (3) index value 2, NMV(x)-MV2(x), NMV(y)-MV2(y ); respectively encode the above three kinds of information to obtain three kinds of encoded bits, assuming that the encoding bit overhead of (1) is the smallest, then MV0 is the closest motion information of NMV. The above (x) and (y) respectively represent the values of the corresponding motion information in the x and y directions, for example, NMV(x) represents the value of the NMV in the x direction, and NMV(y) represents the value of the NMV in the y direction. In addition, the coded bits may also include: structure information of the orthogonal transformation, all-zero coefficient indication of the substructure, quantized orthogonal transformation coefficients, and the like.

得到编码失真和编码比特之后,就可以得到率失真代价值。其中,率失真代价值不仅包括失真度量还包括该失真对应的编码比特的比特数,例如,采用MV0对应的划分方式得到的编码失真与采用MV1对应的划分方式得到的编码失真有相同的失真度量,但MV0对应的划分方式得到的编码比特的比特数小于MV1对应的划分方式得到的编码比特的比特数,那么可以确定MV0对应的划分方式对应的率失真代价值小于MV1对应的划分方式对应的率失真代价值。After obtaining the coding distortion and coding bits, the rate-distortion cost value can be obtained. Wherein, the rate-distortion cost value includes not only the distortion metric but also the number of coded bits corresponding to the distortion. For example, the coding distortion obtained by using the division method corresponding to MV0 has the same distortion metric as the coding distortion obtained by using the division method corresponding to MV1 , but the number of coded bits obtained by the division method corresponding to MV0 is less than the number of coded bits obtained by the division method corresponding to MV1, then it can be determined that the rate-distortion cost value corresponding to the division method corresponding to MV0 is less than that corresponding to the division method corresponding to MV1 Rate-distortion cost value.

本实施例通过在编码时采用运动信息的索引,可以降低比特开销。当有新的运动信息编码方法可以进一步提高运动信息的编码效率时,本发明提出的思想仍然适用。In this embodiment, the bit overhead can be reduced by using the index of the motion information during encoding. When there is a new motion information encoding method that can further improve the encoding efficiency of the motion information, the idea proposed by the present invention is still applicable.

通过上述描述可以完成对原视频块的自适应划分,例如,参见图5,图5左侧为现有的HEVC划分的一个例子,图5右侧为采用本发明实施例完成的划分,其中两个例子中都是曲线右侧所在的范围为运动物体,左侧为静止背景。从图5可以看出,现有的HEVC划分尽管对原视频块进行了深层次的划分仍不能准确的描述运动物体,因而降低预测准确性,影响压缩性能,而采用本发明实施例的方式,可以有效地将运动物体划分出来,提高预测准确性,进而提高压缩性能。The adaptive division of the original video block can be completed through the above description. For example, referring to FIG. 5, the left side of FIG. 5 is an example of existing HEVC division, and the right side of FIG. In each example, the range on the right side of the curve is the moving object, and the left side is the static background. It can be seen from FIG. 5 that although the existing HEVC division has carried out deep divisions on the original video block, it still cannot accurately describe the moving object, thus reducing the prediction accuracy and affecting the compression performance. However, using the method of the embodiment of the present invention, It can effectively divide moving objects, improve prediction accuracy, and then improve compression performance.

在确定出原视频块的划分方式后,可以根据该划分方式完成编码。例如,参见图6以及对应的图7的结构示意图,为本发明实施例提出的一种编码方法的流程示意图,包括:After the division method of the original video block is determined, encoding can be completed according to the division method. For example, referring to FIG. 6 and the corresponding structural diagram of FIG. 7, it is a schematic flowchart of an encoding method proposed by an embodiment of the present invention, including:

61:采用原视频块的划分方式对原视频块进行划分,得到划分后的视频块;61: Divide the original video block by using the division method of the original video block to obtain divided video blocks;

确定原视频块的划分方式的具体内容可以参见上述图2所示的实施例。For the specific content of determining the division manner of the original video block, refer to the above embodiment shown in FIG. 2 .

该步骤可以由图7所示的划分模块完成。This step can be completed by the division module shown in FIG. 7 .

62:对每个划分后的视频块进行运动补偿,得到每个视频块对应的预测块,以及每个视频块对应的预测块与该视频块的残差块;62: Perform motion compensation on each divided video block to obtain a prediction block corresponding to each video block, and a residual block between the prediction block corresponding to each video block and the video block;

该步骤可以由图7所示的运动补偿模块完成,可以得到残差块,另外,在预测时还可以得到标头信息,标头信息包括预测模式、每个划分后的视频块的分割大小、运动信息等。This step can be completed by the motion compensation module shown in Figure 7, and the residual block can be obtained. In addition, header information can also be obtained during prediction. The header information includes the prediction mode, the division size of each divided video block, sports information, etc.

63:对残差块进行正交变换、量化和系数扫描后得到残差编码;63: Obtain residual coding after performing orthogonal transformation, quantization and coefficient scanning on the residual block;

残差编码包括:正交变换的结构信息,子结构的全零系数指示,和量化的正交变换系数等。Residual coding includes: structure information of orthogonal transformation, all-zero coefficient indication of substructure, and quantized orthogonal transformation coefficients, etc.

该步骤可以分别由图7所示的正交变换模块、量化模块和系数扫描模块完成。This step can be completed by the orthogonal transformation module, the quantization module and the coefficient scanning module shown in FIG. 7 respectively.

64:对残差编码和标头信息进行熵编码,得到编码后的比特流,之后输出给解码器。64: Perform entropy coding on the residual coding and the header information to obtain the coded bit stream, and then output it to the decoder.

该步骤可以由图7所示的熵编码模块完成。This step can be completed by the entropy encoding module shown in FIG. 7 .

另外,经重构的视频块可以保存在帧存储件中,以用于后续视频帧的编码参考。如图7所示,还可以包括逆量化模块、逆正交变换模块、帧存储件。Additionally, the reconstructed video blocks may be stored in a frame store for encoding reference of subsequent video frames. As shown in FIG. 7 , an inverse quantization module, an inverse orthogonal transformation module, and a frame storage unit may also be included.

上述描述了编码侧的行为,相应的解码侧的行为可以如下实施例。The above describes the behavior of the encoding side, and the corresponding behavior of the decoding side can be implemented as follows.

参见图8及对应的结构示意图图9,解码器执行的流程可以包括:Referring to FIG. 8 and the corresponding structural schematic diagram in FIG. 9, the process executed by the decoder may include:

81:解码器对接收的比特流进行熵解码。81: The decoder performs entropy decoding on the received bit stream.

该步骤可以由图9所示的熵解码模块完成,得到标头信息和1维系数。This step can be completed by the entropy decoding module shown in FIG. 9 to obtain header information and 1-dimensional coefficients.

82:解码器对参考块进行划分。82: The decoder divides the reference block.

该步骤可以具体包括:This step can specifically include:

从接收的比特流(如上述的标头信息)中获取可用运动信息。假设包含的是可用运动信息索引时,可以根据该可用运动信息索引在预先建立的与编码器相同的可用运动信息列表中进行查找,确定所述可用运动信息;The available motion information is obtained from the received bitstream (such as the header information described above). Assuming that the available motion information index is included, the available motion information can be determined by searching in the pre-established list of available motion information that is the same as that of the encoder according to the available motion information index;

采用所述可用运动信息,对所述参考块进行运动补偿,得到残差块;performing motion compensation on the reference block by using the available motion information to obtain a residual block;

对所述残差块进行统计分析,得到所述可用运动信息对应的划分方式;Perform statistical analysis on the residual block to obtain a division method corresponding to the available motion information;

采用所述可用运动信息对应的划分方式对所述参考块进行划分,得到划分后的视频块。The reference block is divided by using a division manner corresponding to the available motion information to obtain divided video blocks.

该步骤可以由图9所示的划分模块完成。该划分模块采用的参考块的获取可以如上述实施例所述,如将预先定义的视频块确定为参考块,或者将存储的参考帧中的一个视频块确定为参考块。This step can be completed by the division module shown in FIG. 9 . The acquisition of the reference block used by the division module may be as described in the above embodiments, such as determining a predefined video block as a reference block, or determining a video block in a stored reference frame as a reference block.

83:解码器根据标头信息对划分后的视频块进行预测,得到预测块。83: The decoder predicts the divided video block according to the header information to obtain the predicted block.

该步骤可以由图9所示的运动补偿模块完成,得到预测块。This step can be completed by the motion compensation module shown in FIG. 9 to obtain a prediction block.

84:解码器对一维系数进行系数扫描、逆量化、逆正交变换,得到重构的残差块。84: The decoder performs coefficient scanning, inverse quantization, and inverse orthogonal transformation on the one-dimensional coefficients to obtain a reconstructed residual block.

该步骤可以由图9所示的系数扫描模块、逆量化模块、逆正交变换模块完成,得到重构的残差块。This step can be completed by the coefficient scanning module, the inverse quantization module, and the inverse orthogonal transformation module shown in FIG. 9 to obtain a reconstructed residual block.

85:根据预测块和重构的残差块得到重构的块。85: Obtain a reconstructed block according to the predicted block and the reconstructed residual block.

该步骤可以由图9的重构模块完成。该重构的块也就是恢复出的原视频块。可以理解的是,由于存在编码损失等原因,恢复出的原视频块与编码器进行编码的原视频块并非完全相同。This step can be completed by the reconstruction module in FIG. 9 . The reconstructed block is also the restored original video block. It can be understood that, due to reasons such as encoding loss, the restored original video block is not exactly the same as the original video block encoded by the encoder.

之后,在当前解码帧的所有视频块都完成上述的81~85的处理后,可以得到重构的解码帧,再对重构的解码帧进行后处理并放入参考帧缓存,去除编码带来的图像损伤,提升主观图像质量。Afterwards, after all the video blocks of the current decoded frame have completed the above-mentioned 81-85 processing, the reconstructed decoded frame can be obtained, and then the reconstructed decoded frame is post-processed and put into the reference frame buffer to remove the coding brought image damage and improve subjective image quality.

需要说明的是,上述实施例中,以分层编码为例,可以理解的是,本发明实施例并不限于分层编码,也可以应用在单层编码时。与分层编码不同的是,在单层编码时参考块通过划分矢量确定。It should be noted that, in the foregoing embodiments, layered coding is used as an example. It should be understood that the embodiments of the present invention are not limited to layered coding, and may also be applied to single-layer coding. Different from layered coding, the reference block is determined by dividing vectors during single-layer coding.

上述的预测单元可以采用单向预测或双向预测,对于双向预测,预测像素的生成由两个预测信号加权而成。进一步的,预测单元采用的预测信号可以至少为三个,由至少三个的预测信号加权得到预测像素。The above-mentioned prediction unit may adopt unidirectional prediction or bidirectional prediction, and for bidirectional prediction, generation of prediction pixels is weighted by two prediction signals. Further, there may be at least three prediction signals used by the prediction unit, and the prediction pixels are obtained by weighting the at least three prediction signals.

在本发明的一个实施例中,在视频编码技术中,利用像素的空间相关性去除冗余信息是一个行之有效的技术。这种冗余性体现在运动信息上,就是运动矢量之间的强相关性。具体的说,由于这种冗余性,相邻的不同运动块之间的运动矢量值是十分接近的。In an embodiment of the present invention, in video coding technology, using the spatial correlation of pixels to remove redundant information is an effective technology. This redundancy is reflected in motion information, which is the strong correlation between motion vectors. Specifically, due to this redundancy, the motion vector values between different adjacent motion blocks are very close.

利用相邻块运动矢量之间的强相关性,本发明通过使用邻近块的运动矢量对当前编/解码单元进行运动补偿并对产生的运动补偿残差的统计特性进行分析。由于当前编/解码单元中,不同的运动物体有不同的运动特性,运用同一个运动矢量作运动补偿必将产生统计特性不同的残差。利用残差的统计特性即可对不同的运动物体作出有效的划分。Utilizing the strong correlation between the motion vectors of adjacent blocks, the present invention uses the motion vectors of adjacent blocks to perform motion compensation on the current encoding/decoding unit and analyzes the statistical characteristics of the generated motion compensation residuals. Since different moving objects have different motion characteristics in the current encoding/decoding unit, using the same motion vector for motion compensation will inevitably produce residuals with different statistical characteristics. Different moving objects can be effectively divided by using the statistical properties of the residual.

另一方面,由于运动估计/补偿模块是目前视频编解码器中的通用模块,其工作性能和实现已被广泛研究和优化,运算复杂度完全可以满足视频编解码器的要求。On the other hand, since the motion estimation/compensation module is a common module in current video codecs, its working performance and implementation have been extensively researched and optimized, and the computational complexity can fully meet the requirements of video codecs.

在下面的描述中,我们将给出一个基于本发明的具体实施例。为方便理解,本实施例是基于分层编码的结构。但是就本发明本身而言,这是一个通用的编码技术,并不一定被局限于分层编码的结构。In the following description, we will give a specific embodiment based on the present invention. For ease of understanding, this embodiment is based on a layered coding structure. But as far as the present invention itself is concerned, this is a general coding technique and is not necessarily limited to a layered coding structure.

在分层编码结构中,一个视频信号被分为基本层和增强层。其中基本层的时间,空间或质量分辨率小于增强层。In a layered coding structure, a video signal is divided into a base layer and an enhancement layer. Wherein the temporal, spatial or quality resolution of the base layer is smaller than that of the enhancement layer.

在本发明的一个实施例中,在编码器侧,In one embodiment of the present invention, on the encoder side,

在分层视频编码中,假设基本层具有和增强层一样的分辨率。在空间分层编码时,上述的假设似乎不成立,但此时前面假设的基本层定义为经过上采样以后的基本层,仍具有和增强层一样的空间分辨率。In layered video coding, it is assumed that the base layer has the same resolution as the enhancement layer. In spatial layered coding, the above assumption does not seem to hold true, but at this time the previously assumed base layer is defined as the up-sampled base layer, which still has the same spatial resolution as the enhancement layer.

本发明通过调整运动补偿残差的统计特性门限值等方法,可以将增强层中的当前编码单元分割成多个划分。不失一般性,下面的描述假设将当前编码单元分割成两个划分,多个划分的情况可以此类推。具体的划分个数可以由编解码端预先约定,也可以由编码器写入码流而解码器通过解析码流得到。The present invention can divide the current coding unit in the enhancement layer into multiple partitions by adjusting the statistical characteristic threshold value of the motion compensation residual. Without loss of generality, the following description assumes that the current coding unit is divided into two partitions, and the case of multiple partitions can be deduced by analogy. The specific number of divisions can be pre-agreed by the codec end, or can be written by the encoder to the code stream and obtained by the decoder by parsing the code stream.

编码器的操作可以概括为如下步骤:The operation of the encoder can be summarized as the following steps:

第一步:对于增强层中的当前编码单元(可以是规则形状或不规则形状),确定可用运动信息Step 1: For the current coding unit (which can be regular or irregular shape) in the enhancement layer, determine the available motion information

对增强层中的当前编码单元,找到对应的基本层编码单元并取得基本层编码单元的相关编码信息,包括但并不限于运动信息等。For the current coding unit in the enhancement layer, find the corresponding base layer coding unit and obtain related coding information of the base layer coding unit, including but not limited to motion information.

确定可用运动信息列表中的运动信息。运动信息列表中的运动信息主要来自三个方面:增强层中当前编码单元的空间相邻的运动信息;增强层中当前编码单元的时间相邻的运动信息;增强层中当前编码单元对应的基本层编码单元的运动信息。可用运动信息包括但并不局限于以上三个方面,例如对应的基本层单元的空间和时间运动信息也可加入可用运动信息列表。运动信息列表中的运动信息数量可以是预先约定的数目或从码流中取得,其中的运动信息可以有相同的或必须是不同的。Identify the workout in the list of available workouts. The motion information in the motion information list mainly comes from three aspects: the spatially adjacent motion information of the current coding unit in the enhancement layer; the temporally adjacent motion information of the current coding unit in the enhancement layer; the basic Motion information of layer coding units. The available motion information includes but is not limited to the above three aspects, for example, the spatial and temporal motion information of the corresponding base layer unit can also be added to the list of available motion information. The number of motion information in the motion information list can be a pre-agreed number or obtained from the code stream, and the motion information therein can be the same or must be different.

第二步:对于运动信息列表中的一个运动信息,生成划分Step 2: For a motion information in the motion information list, generate a partition

使用此运动信息对整个当前增强层编码单元进行运动补偿,得到相应的残差。Use this motion information to perform motion compensation on the entire current enhancement layer coding unit to obtain a corresponding residual.

对从上一步骤中产生的残差进行统计分析,例如可以计算得到残差的中值。Perform a statistical analysis on the residuals from the previous step, e.g. the median of the residuals can be calculated.

利用从上一步骤中产生的统计特性(例如中值作为划分的门限值),对从步骤1中得到的残差生成划分(如定义由相应残差小于中值的像素组成的划分为划分0,否则为划分1)。Using the statistical properties generated from the previous step (such as the median value as the threshold value of the partition), generate a partition for the residual obtained in step 1 (such as defining a partition composed of pixels whose corresponding residual is less than the median value as partition 0, otherwise it is partition 1).

第三步:对于第二步中生成的划分The third step: For the division generated in the second step

可以进一步作运动估计:运动估计可以使用各种快速算法来减少运算复杂度。Motion estimation can be further performed: Motion estimation can use various fast algorithms to reduce computational complexity.

运动估计中的率失真函数估算需要具体的运动矢量的编码方法,可以使用充分利用了运动信息相关性的编码算法。例如,可以通过对第一步中生成的运动矢量列表中的索引编码的方式。具体的运动矢量编码方法需要的比特数将计入率失真函数的计算。Estimation of the rate-distortion function in motion estimation requires a specific encoding method of the motion vector, and an encoding algorithm that fully utilizes the correlation of motion information can be used. For example, it may be by encoding the index in the motion vector list generated in the first step. The number of bits required by a specific motion vector coding method will be included in the calculation of the rate-distortion function.

率失真代价值最小的运动矢量为最终的运动矢量。使用这个运动矢量对当前编码单元做运动补偿,生成运动补偿残差。The motion vector with the smallest rate-distortion cost value is the final motion vector. Use this motion vector to perform motion compensation on the current coding unit to generate a motion compensation residual.

第四步:对于第三步中生成的运动补偿残差,应用正交变换去除空间冗余。由于当前编码单元的形状不一定是规则形状,正交变换也不一定采用规则形状(目前的视频编码标准中均采用规则形状的正交变换)。Step 4: For the motion compensation residual generated in Step 3, an orthogonal transformation is applied to remove spatial redundancy. Since the shape of the current coding unit is not necessarily a regular shape, the orthogonal transformation does not necessarily adopt a regular shape (current video coding standards all use regular-shaped orthogonal transformation).

第五步:对第四步的正交变换系数进行反向量化和逆向正交变换后得到重建的残差(如果第四步得到的所有正交变换系数为0,则定义此时的重建残差为0),加上从第三步得到的运动补偿值,并经限幅操作后可以得到当前编码单元的编码重建。通过与编码前的原始当前编码单元像素值相比较可以得到编码失真。对当前编码单元的比特编码进行估算,包括:用于生成划分的运动矢量在第一步中的运动矢量列表中的索引;如果进一步作运动估计,参考运动矢量的索引,以及最终的运动矢量与参考运动矢量的差分值;正交变换的结构信息,子结构的全零系数指示,和量化的正交变换系数。综合编码失真和比特耗费,可得到此运动信息划分的率失真代价值。Step 5: Perform inverse quantization and inverse orthogonal transformation on the orthogonal transformation coefficients in the fourth step to obtain the reconstructed residual (if all the orthogonal transformation coefficients obtained in the fourth step are 0, define the reconstruction residual at this time The difference is 0), add the motion compensation value obtained from the third step, and perform the clipping operation to obtain the coding reconstruction of the current coding unit. Coding distortion can be obtained by comparing with the original current coding unit pixel value before encoding. Estimate the bit coding of the current coding unit, including: the index used to generate the divided motion vector in the motion vector list in the first step; if further motion estimation is performed, the index of the reference motion vector, and the final motion vector and The differential value of the reference motion vector; the structure information of the orthogonal transform, the all-zero coefficient indication of the substructure, and the quantized orthogonal transform coefficients. Combining coding distortion and bit consumption, the rate-distortion cost value of this motion information division can be obtained.

第六步:如果第二步运动信息列表中所有的运动信息及其划分都已经被估算,选择率失真代价最小的划分作为当前编码单元的最终划分。否则,重复步骤二到五。Step 6: If all the motion information and its divisions in the motion information list in the second step have been estimated, select the division with the smallest rate-distortion cost as the final division of the current coding unit. Otherwise, repeat steps two to five.

第七步:对当前编码单元的最终划分,经熵编码模块将当前编码单元的编码比特写入输出比特流,包括:用于生成划分的运动矢量在第一步中生成的运动矢量列表中的索引;如果进一步作运动估计,包括参考运动矢量的索引,以及最终的运动矢量与参考运动矢量的差分值;正交变换的结构信息,子结构的全零系数指示,和量化的正交变换系数等。Step 7: For the final division of the current coding unit, write the coded bits of the current coding unit into the output bit stream through the entropy coding module, including: the motion vector used to generate the division is in the motion vector list generated in the first step Index; if further motion estimation is performed, it includes the index of the reference motion vector, and the difference value between the final motion vector and the reference motion vector; the structure information of the orthogonal transformation, the all-zero coefficient indication of the substructure, and the quantized orthogonal transformation coefficient Wait.

第八步:当前编码帧的所有编码单元都完成后,可以对重建的编码帧的进行后处理操作,去除编码带来的图像损伤,提升主观图像质量。Step 8: After all the coding units of the current coded frame are completed, post-processing operations can be performed on the reconstructed coded frame to remove image damage caused by coding and improve subjective image quality.

以上算法通过一个分层编码中对增强层帧进行编码的例子,描述了本发明的算法流程。如前所述,本发明是一个通用编码算法,既可以应用在分层编码的场景中,在也可以应用在单层视频编码的场景中。在单层视频编码时,需要一个类似于分层视频编码中对应的上采样的基本层的编码单元的参考编码单元,以此参考编码单元作基础估算出当前编码单元的划分。利用视频信号的时间相关性,此参考编码单元可以在已经重建的参考帧中寻找。对此参考编码单元的编码可以采用类似于运动矢量编码的方法,即编码此参考编码单元所在参考图像的列表,在列表中的位置索引,以及此参考编码单元相对于当前编码单元的位移。为了区别于运动矢量,这个信息可以被定义为形状矢量或划分矢量。The above algorithm describes the algorithm flow of the present invention through an example of encoding enhancement layer frames in layered encoding. As mentioned above, the present invention is a general coding algorithm, which can be applied in both layered coding and single-layer video coding. In single-layer video coding, a reference coding unit similar to the corresponding up-sampled coding unit of the base layer in layered video coding is needed, and the division of the current coding unit is estimated based on the reference coding unit. Using the temporal correlation of the video signal, the reference CU can be found in the reconstructed reference frame. The encoding of the reference CU can adopt a method similar to motion vector encoding, that is, encoding the reference picture list where the reference CU is located, the position index in the list, and the displacement of the reference CU relative to the current CU. To distinguish from motion vectors, this information can be defined as shape vectors or partition vectors.

以上算法适用于单向和双向预测的情形。对于双向预测,运动补偿的过程要比单向预测的过程复杂一些:预测像素的生成是由两个预测信号加权而成;而且运动估计过程也要比单向预测复杂的多,因此要求的运算复杂度也要比单向预测要高。The above algorithm is applicable to the case of one-way and two-way prediction. For bidirectional prediction, the process of motion compensation is more complicated than that of unidirectional prediction: the generation of predicted pixels is weighted by two prediction signals; and the process of motion estimation is much more complicated than that of unidirectional prediction, so the required operation The complexity is also higher than unidirectional prediction.

进一步推广,本发明可以应用于有多个预测信号的情形:在这种应用场景下,预测像素的是由多个预测信号加权生成。Further extension, the present invention can be applied to a situation where there are multiple prediction signals: in this application scenario, a prediction pixel is generated by weighting multiple prediction signals.

补充说明在本发明应用于分层编码的例子中,上述的编码算法也具有广义性。在分层编码技术中,可以有两类技术。其一是基于编码单元的技术,即增强层的编码单元对基本层的信息重用是基于基本层的编码单元级的;另一个是基于基本层生成的参考帧级的技术,即重建的基本层经处理后置入增强层的参考帧缓存,而增强层的编码单元对基本层的信息重用是基于参考帧缓存中的基本层参考帧的。本发明应用于分层编码的例子可以通用于以上两类技术中,仅有的区别在于基本层运动矢量信息的获取上:在基于编码单元的技术中,基本层运动矢量信息的获取比较直接,运动信息有直接的对应关系;在基于参考帧级的技术中,基本层运动矢量信息需要一个影射,转换成增强层参考帧缓存中的运动信息后,就也可以被方便的参考了。Supplementary Note In the example where the present invention is applied to layered coding, the above-mentioned coding algorithm also has a broad meaning. Among layered coding techniques, there can be two types of techniques. One is based on the coding unit technology, that is, the information reuse of the coding unit of the enhancement layer to the base layer is based on the coding unit level of the base layer; the other is a technology based on the reference frame level generated by the base layer, that is, the reconstructed base layer After processing, it is placed into the reference frame buffer of the enhancement layer, and the information reuse of the coding unit of the enhancement layer for the base layer is based on the reference frame of the base layer in the reference frame buffer. The example of the application of the present invention to layered coding can be generally used in the above two types of technologies, the only difference is in the acquisition of the basic layer motion vector information: in the technology based on coding units, the acquisition of the basic layer motion vector information is relatively straightforward, The motion information has a direct correspondence; in the technology based on the reference frame level, the motion vector information of the base layer needs a mapping, and after being converted into the motion information in the reference frame buffer of the enhancement layer, it can also be conveniently referred to.

最后,上面的本发明实施例的描述为通用描述,并不特指某一种特殊实现方式。比如对熵编码的具体实现并没有作具体限定:可以是变长编码;也可以是算数编码。对于算数编码来说,既可以是二进制算数编码,也可以是通用算数编码。Finally, the above descriptions of the embodiments of the present invention are general descriptions, and do not specifically refer to a specific implementation manner. For example, there is no specific limitation on the specific implementation of entropy coding: it can be variable-length coding; it can also be arithmetic coding. For arithmetic coding, it can be either binary arithmetic coding or universal arithmetic coding.

在本发明的一个实施例中,在解码侧,In one embodiment of the present invention, on the decoding side,

接收到编码比特流后,解码器解析比特流并按照解析到的语法元素进行相应的解码重建操作。具体的步骤和流程如下。After receiving the encoded bit stream, the decoder parses the bit stream and performs corresponding decoding and reconstruction operations according to the parsed syntax elements. The specific steps and process are as follows.

第一步:对于增强层中的当前编码单元(可以是规则形状或不规则形状),确定可用运动信息Step 1: For the current coding unit (which can be regular or irregular shape) in the enhancement layer, determine the available motion information

对增强层中的当前编码单元,找到对应的基本层编码单元并取得基本层编码单元的相关编码信息,包括但并不限于运动信息等。For the current coding unit in the enhancement layer, find the corresponding base layer coding unit and obtain related coding information of the base layer coding unit, including but not limited to motion information.

确定可用运动信息列表中的运动信息。运动信息列表中的运动信息主要来自三个方面:增强层中当前编码单元的空间相邻的运动信息;增强层中当前编码单元的时间相邻的运动信息;增强层中当前编码单元对应的基本层编码单元的运动信息。可用运动信息包括但并不局限于以上三个方面,例如对应的基本层单元的空间和时间运动信息也可加入可用运动信息列表。运动信息列表中的运动信息数量可以是预先约定的数目或从码流中取得,其中的运动信息可以有相同的或必须是不同的。Identify the workout in the list of available workouts. The motion information in the motion information list mainly comes from three aspects: the spatially adjacent motion information of the current coding unit in the enhancement layer; the temporally adjacent motion information of the current coding unit in the enhancement layer; the basic Motion information of layer coding units. The available motion information includes but is not limited to the above three aspects, for example, the spatial and temporal motion information of the corresponding base layer unit can also be added to the list of available motion information. The number of motion information in the motion information list can be a pre-agreed number or obtained from the code stream, and the motion information therein can be the same or must be different.

第二步:解析码流中的运动信息索引,并从运动信息列表中取得相应的运动信息,使用此运动信息生成划分Step 2: Analyze the motion information index in the code stream, obtain the corresponding motion information from the motion information list, and use this motion information to generate partitions

使用此运动信息对整个当前增强层编码单元进行运动补偿,得到相应的残差。Use this motion information to perform motion compensation on the entire current enhancement layer coding unit to obtain a corresponding residual.

对从上一步骤中产生的残差进行统计分析,例如可以计算得到残差的中值。Perform a statistical analysis on the residuals from the previous step, e.g. the median of the residuals can be calculated.

利用从上一步骤中产生的统计特性(例如中值作为门限值),对从步骤1中得到的残差生成划分(如定义由相应残差小于中值的像素组成的划分为划分0,否则为划分1)。Using the statistical properties generated from the previous step (e.g., the median value as a threshold value), generate partitions for the residuals obtained from step 1 (e.g., define a partition consisting of pixels whose corresponding residuals are less than the median value as partition 0, Otherwise, partition 1).

第三步:对于第二步中生成的划分,进一步解析码流确定每一个划分的精确运动信息;并使用得到的运动信息得到当前编码单元各划分的运动补偿Step 3: For the divisions generated in the second step, further analyze the code stream to determine the precise motion information of each division; and use the obtained motion information to obtain the motion compensation of each division of the current coding unit

第四步:解析码流得到当前编码单元的残差,包括正交变换的结构,子结构的全零系数指示,量化的正交变换系数等。Step 4: Analyze the code stream to obtain the residual of the current coding unit, including the structure of the orthogonal transformation, the all-zero coefficient indication of the substructure, the quantized orthogonal transformation coefficient, and the like.

第五步:对第四步的正交变换系数进行反向量化和逆向正交变换后得到重建残差(如果第四步得到的所有正交变换系数为0,则定义此时的重建残差为0),加上从第三步得到的运动补偿值,并经限幅操作后可以得到当前编码单元的重建。Step 5: Perform inverse quantization and inverse orthogonal transformation on the orthogonal transformation coefficients in the fourth step to obtain the reconstruction residual (if all the orthogonal transformation coefficients obtained in the fourth step are 0, define the reconstruction residual at this time is 0), add the motion compensation value obtained from the third step, and perform the clipping operation to obtain the reconstruction of the current coding unit.

第六步:当前编码帧的所有编码单元都完成后,可以对重建的编码帧的进行后处理操作,去除编码带来的图像损伤,提升主观图像质量。Step 6: After all the coding units of the current coded frame are completed, post-processing operations can be performed on the reconstructed coded frame to remove image damage caused by coding and improve subjective image quality.

上述对方法流程进行了描述,相应的,本发明实施例还提供了用于执行上述方法的装置。The method flow is described above, and correspondingly, the embodiment of the present invention also provides an apparatus for executing the above method.

参见图10,本发明实施例提供了一种图像块的划分装置10,该装置可以位于编码器中,该装置10包括获取模块101、运动补偿模块102、运动划分模块103和编码模块104;获取模块101用于获取目标块的参考块以及参考块的运动信息,参考块中的采样点与目标块中的采样点一一对应;运动补偿模块102用于采用获取模块101获取的运动信息对获取模块101获取的参考块进行运动补偿,得到残差块;运动划分模块103用于将运动补偿模块102中得到的残差块中每一个采样点的值与编码器确定的划分门限值进行比较,并根据每一个采样点的比较结果对目标块进行运动划分;编码模块104,用于根据运动划分模块103得到的运动划分的结果对目标块进行编码。Referring to FIG. 10 , an embodiment of the present invention provides an image block division device 10, which can be located in an encoder, and the device 10 includes an acquisition module 101, a motion compensation module 102, a motion division module 103, and an encoding module 104; The module 101 is used to obtain the reference block of the target block and the motion information of the reference block, and the sampling points in the reference block correspond to the sampling points in the target block; the motion compensation module 102 is used to use the motion information obtained by the obtaining module 101 to obtain The reference block obtained by module 101 is motion compensated to obtain a residual block; the motion division module 103 is used to compare the value of each sampling point in the residual block obtained in the motion compensation module 102 with the division threshold value determined by the encoder , and perform motion division on the target block according to the comparison result of each sampling point; the encoding module 104 is configured to encode the target block according to the motion division result obtained by the motion division module 103 .

参加图11,本发明实施例提供了一种图像块的划分装置11,该装置可以位于编码器中,该装置10包括获取模块111、运动补偿模块112、运动划分模块113和编码模块114;获取模块111用于获取目标块的参考块以及参考块的运动信息,参考块中的采样点与目标块中的采样点一一对应;运动补偿模块112用于采用获取模块111获取的运动信息对获取模块111获取的参考块进行运动补偿,得到残差块;运动划分模块113用于将运动补偿模块112中得到的残差块中每一个采样点的值与解码器确定的划分门限值进行比较,并根据每一个采样点的比较结果对目标块进行运动划分;解码模块114,用于根据运动划分模块113得到的运动划分的结果对目标块进行解码。Referring to Fig. 11, an embodiment of the present invention provides an image block division device 11, which can be located in an encoder, and the device 10 includes an acquisition module 111, a motion compensation module 112, a motion division module 113 and an encoding module 114; Module 111 is used to obtain the reference block of the target block and the motion information of the reference block, and the sampling points in the reference block correspond to the sampling points in the target block; the motion compensation module 112 is used to obtain The reference block obtained by the module 111 is motion compensated to obtain a residual block; the motion division module 113 is used to compare the value of each sampling point in the residual block obtained in the motion compensation module 112 with the division threshold value determined by the decoder , and perform motion division on the target block according to the comparison result of each sampling point; the decoding module 114 is configured to decode the target block according to the motion division result obtained by the motion division module 113 .

在硬件实现上,上述的获取模块、运动划分模块运动补偿模块、编码模块和解码模块可以具体由处理器完成,处理器可以为中央处理单元(CPU)、微处理器、单片机等。上述的获取模块可以具体为接收器或收发器。In terms of hardware implementation, the above acquisition module, motion division module, motion compensation module, encoding module and decoding module can be specifically completed by a processor, and the processor can be a central processing unit (CPU), a microprocessor, a single-chip microcomputer, etc. The above acquisition module may specifically be a receiver or a transceiver.

进一步的,本发明实施例还可以提供一种编码器,包括上述位于编码器中的划分装置,还可以包括运动补偿模块、正交变换单元、量化单元、系数扫描单元和熵编码单元。具体内容可以参见图7。Further, the embodiment of the present invention may also provide an encoder, including the above-mentioned division device located in the encoder, and may also include a motion compensation module, an orthogonal transformation unit, a quantization unit, a coefficient scanning unit, and an entropy encoding unit. See Figure 7 for details.

进一步的,本发明实施例还可以提供一种解码器,包括上述位于解码器中的划分装置,还可以包括熵解码单元、系数扫描单元、逆量化单元、逆正交变换单元、预测单元、重构单元等。具体内容可以参见图9。Further, the embodiment of the present invention may also provide a decoder, including the above-mentioned dividing device located in the decoder, and may also include an entropy decoding unit, a coefficient scanning unit, an inverse quantization unit, an inverse orthogonal transformation unit, a prediction unit, a weighting unit, structural unit, etc. See Figure 9 for details.

本实施例通过采用可用运动信息对参考块进行运动补偿,并对运动补偿得到的残差块进行统计分析,根据统计分析的结果对参考块进行划分,可以完成对参考块的自适应划分,通过自适应划分可以获取更准确的运动信息,进而可以进行准确的运动补偿预测,提高压缩性能。In this embodiment, motion compensation is performed on the reference block by using the available motion information, statistical analysis is performed on the residual block obtained by motion compensation, and the reference block is divided according to the result of the statistical analysis, so that the adaptive division of the reference block can be completed. Adaptive division can obtain more accurate motion information, and then can perform accurate motion compensation prediction and improve compression performance.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .

以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still understand the foregoing The technical solutions described in each embodiment are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the application.

Claims (23)

1.一种图像块编码方法,其特征在于,所述方法包括:1. An image block coding method, characterized in that the method comprises: 编码器确定目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;The encoder determines a reference block of the target block and motion information of the reference block, and the sampling points in the reference block correspond to the sampling points in the target block; 所述编码器采用所述参考块的运动信息对所述参考块进行运动补偿,得到残差块;The encoder uses the motion information of the reference block to perform motion compensation on the reference block to obtain a residual block; 所述编码器将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分,所述划分门限值为所述残差块中的全部残差值的中值;The encoder compares the value of each sampling point in the residual block with the division threshold value determined by the encoder, and performs motion division on the target block according to the comparison result of each sampling point , the division threshold value is the median value of all residual values in the residual block; 所述编码器根据所述运动划分的结果对所述目标块进行编码。The encoder encodes the target block according to the result of the motion division. 2.根据权利要求1所述的方法,其特征在于,所述编码器将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分包括:2. The method according to claim 1, wherein the encoder compares the value of each sampling point in the residual block with the division threshold value determined by the encoder, and according to each The comparison result of the sampling points performing motion division on the target block includes: 如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block. 3.根据权利要求1所述的方法,其特征在于,所述编码器将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据比较结果对所述目标块进行运动划分包括:3. The method according to claim 1, wherein the encoder compares the value of each sampling point in the residual block with the division threshold value determined by the encoder, and according to the comparison result Performing motion division on the target block includes: 如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block. 4.根据权利要求1-3任意一项所述的方法,其特征在于,所述编码器确定参考块的运动信息,包括:4. The method according to any one of claims 1-3, wherein the encoder determines the motion information of the reference block, comprising: 当所述编码器按照非分层编码方式对所述目标块进行编码时,获取如下项中的至少一项做为所述参考块运动信息:When the encoder encodes the target block in a non-hierarchical encoding manner, at least one of the following items is acquired as the reference block motion information: 与所述目标块空间相邻的视频块的运动信息;motion information of video blocks spatially adjacent to the target block; 与所述目标块时间相邻的视频块的运动信息。Motion information of video blocks temporally adjacent to the target block. 5.根据权利要求1-3任意一项所述的方法,其特征在于,所述确定目标块的参考块,包括:5. The method according to any one of claims 1-3, wherein said determining the reference block of the target block comprises: 当所述编码器按照分层编码方式对所述目标块进行编码时,根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the target block in a layered encoding manner, the reference block is determined according to a corresponding image block of the target block in a low-quality layered reconstruction image: 其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像。Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than that of the reconstructed image of the layer where the target block is located. 6.根据权利要求1-3任意一项所述的方法,其特征在于,所述确定参考块的运动信息,包括:6. The method according to any one of claims 1-3, wherein the determining the motion information of the reference block comprises: 当所述编码器按照分层编码方式对所述目标块进行编码时,获取如下项中的至少一项做为所述参考块的运动信息:When the encoder encodes the target block in a layered encoding manner, at least one of the following items is acquired as the motion information of the reference block: 与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block; 与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block; 参考块的运动信息;Motion information of the reference block; 与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block; 与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block. 7.根据权利要求1-3任一项所述的方法,其特征在于,所述确定目标块的参考块,包括:7. The method according to any one of claims 1-3, wherein the determining the reference block of the target block comprises: 当所述编码器按照非分层编码方式对所述目标块进行编码时,将存储的参考帧中的第三图像块确定为参考块,所述第三图像块是指在设定的失真度量下,所述存储的参考帧中的具有与所述目标块的失真度量最小的图像块。When the encoder encodes the target block in a non-hierarchical encoding manner, the third image block in the stored reference frame is determined as a reference block, and the third image block refers to the set distortion metric Next, the image block in the stored reference frame has the smallest distortion metric with the target block. 8.一种图像块解码方法,其特征在于,所述方法包括:8. An image block decoding method, characterized in that the method comprises: 解码器确定目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;The decoder determines the reference block of the target block and the motion information of the reference block, and the sampling points in the reference block are in one-to-one correspondence with the sampling points in the target block; 所述解码器采用所述参考块的运动信息对所述参考块进行运动补偿,得到残差块;The decoder uses the motion information of the reference block to perform motion compensation on the reference block to obtain a residual block; 所述解码器将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分,所述划分门限值为所述残差块中的全部残差值的中值;The decoder compares the value of each sampling point in the residual block with the division threshold value determined by the decoder, and performs motion division on the target block according to the comparison result of each sampling point , the division threshold value is the median value of all residual values in the residual block; 所述解码器根据所述运动划分的结果对所述目标块进行解码。The decoder decodes the target block according to the result of the motion division. 9.根据权利要求8所述的方法,其特征在于,所述解码器将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分包括:9. The method according to claim 8, wherein the decoder compares the value of each sampling point in the residual block with the division threshold value determined by the decoder, and according to each The comparison result of the sampling points performing motion division on the target block includes: 如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block. 10.根据权利要求8所述的方法,其特征在于,所述解码器将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分包括:10. The method according to claim 8, wherein the decoder compares the value of each sampling point in the residual block with the division threshold value determined by the decoder, and according to each The comparison result of the sampling points performing motion division on the target block includes: 如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block. 11.根据权利要求8-10任意一项所述的方法,其特征在于,所述确定目标块的参考块,包括:11. The method according to any one of claims 8-10, wherein the determining the reference block of the target block comprises: 当编码器按照分层编码方式对所述目标块进行编码时,所述解码器根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the target block in a layered encoding manner, the decoder determines the reference block according to a corresponding image block of the target block in a low-quality layered reconstruction image: 其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像。Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than that of the reconstructed image of the layer where the target block is located. 12.根据权利要求8-10任意一项所述的方法,其特征在于,所述确定参考块的运动信息,包括:12. The method according to any one of claims 8-10, wherein said determining the motion information of the reference block comprises: 当编码器按照分层编码方式对所述目标块进行编码时,所述解码器获取如下项中的至少一项做为所述参考块运动信息:When the encoder encodes the target block in a layered encoding manner, the decoder acquires at least one of the following items as the reference block motion information: 与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block; 与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block; 参考块的运动信息;Motion information of the reference block; 与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block; 与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block. 13.根据权利要求8-10任一项所述的方法,其特征在于,所述确定目标块的参考块,包括:13. The method according to any one of claims 8-10, wherein the determining the reference block of the target block comprises: 当编码器按照非分层编码方式对所述目标块进行编码时,所述解码器将存储的参考帧中的第三图像块确定为参考块,所述第三图像块是指在设定的失真度量下,所述存储的参考帧中的具有与所述目标块的失真度量最小的图像块。When the encoder encodes the target block in a non-hierarchical encoding manner, the decoder determines the third image block in the stored reference frame as the reference block, and the third image block refers to the set Under the distortion metric, the image block in the stored reference frame has the smallest distortion metric with respect to the target block. 14.一种图像块的划分装置,其特征在于,所述装置位于编码器中,所述装置包括:14. A device for dividing an image block, characterized in that the device is located in an encoder, and the device includes: 获取模块,用于获取目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;An acquisition module, configured to acquire a reference block of the target block and motion information of the reference block, where sampling points in the reference block correspond to sampling points in the target block; 运动补偿模块,用于采用所述获取模块获取的所述运动信息对所述获取模块获取的所述参考块进行运动补偿,得到残差块;a motion compensation module, configured to perform motion compensation on the reference block acquired by the acquisition module by using the motion information acquired by the acquisition module to obtain a residual block; 运动划分模块,用于将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分,所述划分门限值为所述残差块中的全部残差值的中值;a motion division module, configured to compare the value of each sampling point in the residual block with the division threshold value determined by the encoder, and perform a process on the target block according to the comparison result of each sampling point motion division, the division threshold value is the median value of all residual values in the residual block; 编码模块,用于根据所述运动划分的结果对所述目标块进行编码。An encoding module, configured to encode the target block according to the result of the motion division. 15.根据权利要求14所述的装置,其特征在于,所述获取模块具体用于:15. The device according to claim 14, wherein the acquiring module is specifically used for: 获取所述目标块的参考块;Obtain a reference block of the target block; 当所述编码器按照分层编码方式对所述目标块进行编码时,获取如下项中的至少一项做为所述参考块的运动信息:When the encoder encodes the target block in a layered encoding manner, at least one of the following items is acquired as the motion information of the reference block: 与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block; 与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block; 参考块的运动信息;Motion information of the reference block; 与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block; 与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block. 16.根据权利要求14所述的装置,其特征在于,所述获取模块具体用于:16. The device according to claim 14, wherein the acquiring module is specifically used for: 当所述编码器按照分层编码方式对所述目标块进行编码时,根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the target block in a layered encoding manner, the reference block is determined according to a corresponding image block of the target block in a low-quality layered reconstruction image: 其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像;Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than the reconstructed image of the layer where the target block is located; 获取所述参考块的运动信息。Acquire motion information of the reference block. 17.根据权利要求14-16任意一项所述的装置,其特征在于,所述运动划分模块具体用于:17. The device according to any one of claims 14-16, wherein the motion division module is specifically used for: 将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较;Comparing the value of each sampling point in the residual block with the division threshold value determined by the encoder; 如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block. 18.根据权利要求14-16任意一项所述的装置,其特征在于,所述运动划分模块具体用于:18. The device according to any one of claims 14-16, wherein the motion division module is specifically used for: 将所述残差块中每一个采样点的值与所述编码器确定的划分门限值进行比较;Comparing the value of each sampling point in the residual block with the division threshold value determined by the encoder; 如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block. 19.一种图像块的划分装置,其特征在于,所述装置位于解码器中,所述装置包括:19. A device for dividing an image block, characterized in that the device is located in a decoder, and the device comprises: 获取模块,用于获取目标块的参考块以及参考块的运动信息,所述参考块中的采样点与所述目标块中的采样点一一对应;An acquisition module, configured to acquire a reference block of the target block and motion information of the reference block, where sampling points in the reference block correspond to sampling points in the target block; 运动补偿模块,用于采用所述获取模块获取的所述运动信息对所述获取模块获取的所述参考块进行运动补偿,得到残差块;a motion compensation module, configured to perform motion compensation on the reference block acquired by the acquisition module by using the motion information acquired by the acquisition module to obtain a residual block; 运动划分模块,用于将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较,并根据每一个所述采样点的比较结果对所述目标块进行运动划分,所述划分门限值为所述残差块中的全部残差值的中值;a motion division module, configured to compare the value of each sampling point in the residual block with the division threshold value determined by the decoder, and perform a process on the target block according to the comparison result of each sampling point motion division, the division threshold value is the median value of all residual values in the residual block; 解码模块,用于根据所述运动划分的结果对所述目标块进行解码。A decoding module, configured to decode the target block according to the result of the motion division. 20.如权利要求19所述的装置,其特征在于,所述获取模块具体用于:20. The device according to claim 19, wherein the acquiring module is specifically configured to: 获取所述目标块的参考块;Obtain a reference block of the target block; 当编码器按照分层编码方式对所述目标块进行编码时,获取如下项中的至少一项做为所述参考块的运动信息:When the encoder encodes the target block in a layered encoding manner, at least one of the following items is acquired as the motion information of the reference block: 与所述目标块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the target block; 与所述目标块时间相邻的图像块的运动信息;Motion information of image blocks temporally adjacent to the target block; 参考块的运动信息;Motion information of the reference block; 与所述参考块空间相邻的图像块的运动信息;Motion information of image blocks spatially adjacent to the reference block; 与所述参考块时间相邻的图像块的运动信息。Motion information of image blocks temporally adjacent to the reference block. 21.根据权利要求19所述的装置,其特征在于,所述获取模块具体用于:21. The device according to claim 19, wherein the acquiring module is specifically used for: 当编码器按照分层编码方式对所述目标块进行编码时,根据低质量分层重建图像中所述目标块的对应图像块确定所述参考块:When the encoder encodes the target block according to the layered coding method, the reference block is determined according to the corresponding image block of the target block in the low-quality layered reconstruction image: 其中,所述低质量分层重建图像的空间分辨率、信噪比的至少一项指标低于所述目标块所在分层的重建图像;Wherein, at least one index of spatial resolution and signal-to-noise ratio of the low-quality layered reconstructed image is lower than the reconstructed image of the layer where the target block is located; 获取所述参考块的运动信息。Acquire motion information of the reference block. 22.根据权利要求19-21任意一项所述的装置,其特征在于,所述运动划分模块具体用于:22. The device according to any one of claims 19-21, wherein the motion division module is specifically used for: 将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较;comparing the value of each sampling point in the residual block with the division threshold value determined by the decoder; 如果所述残差块中的采样点的值大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is greater than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值不大于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is not greater than the division threshold, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block. 23.根据权利要求19-21任意一项所述的装置,其特征在于,所述运动划分模块具体用于:23. The device according to any one of claims 19-21, wherein the motion division module is specifically used for: 将所述残差块中每一个采样点的值与所述解码器确定的划分门限值进行比较;comparing the value of each sampling point in the residual block with the division threshold value determined by the decoder; 如果所述残差块中的采样点的值不小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第一运动划分;If the value of the sampling point in the residual block is not less than the division threshold value, then determine that the corresponding sampling point in the target block belongs to the first motion division of the target block; 如果所述残差块中的采样点的值小于所述划分门限值,则确定所述目标块中对应的采样点属于所述目标块的第二运动划分。If the value of the sampling point in the residual block is smaller than the division threshold value, it is determined that the corresponding sampling point in the target block belongs to the second motion division of the target block.
CN201310123316.5A 2013-04-10 2013-04-10 The decoding method and device of a kind of image block Active CN104104955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310123316.5A CN104104955B (en) 2013-04-10 2013-04-10 The decoding method and device of a kind of image block

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310123316.5A CN104104955B (en) 2013-04-10 2013-04-10 The decoding method and device of a kind of image block

Publications (2)

Publication Number Publication Date
CN104104955A CN104104955A (en) 2014-10-15
CN104104955B true CN104104955B (en) 2017-11-17

Family

ID=51672712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310123316.5A Active CN104104955B (en) 2013-04-10 2013-04-10 The decoding method and device of a kind of image block

Country Status (1)

Country Link
CN (1) CN104104955B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572673B (en) * 2019-09-27 2024-04-09 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, storage medium and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7098959B2 (en) * 2002-09-10 2006-08-29 Kabushiki Kaisha Toshiba Frame interpolation and apparatus using frame interpolation
CN101873500A (en) * 2009-04-24 2010-10-27 华为技术有限公司 Inter-frame predictive encoding method, inter-frame predictive decoding method and device
WO2010144408A1 (en) * 2009-06-11 2010-12-16 Motorola Mobility, Inc. Digital image compression by adaptive macroblock resolution coding
US20110170608A1 (en) * 2010-01-08 2011-07-14 Xun Shi Method and device for video transcoding using quad-tree based mode selection
CN102611891A (en) * 2012-02-07 2012-07-25 中国电子科技集团公司第三研究所 Method for directly performing transform coding in transform domain
CN104104966A (en) * 2013-04-08 2014-10-15 华为技术有限公司 Video block dividing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7098959B2 (en) * 2002-09-10 2006-08-29 Kabushiki Kaisha Toshiba Frame interpolation and apparatus using frame interpolation
CN101873500A (en) * 2009-04-24 2010-10-27 华为技术有限公司 Inter-frame predictive encoding method, inter-frame predictive decoding method and device
WO2010144408A1 (en) * 2009-06-11 2010-12-16 Motorola Mobility, Inc. Digital image compression by adaptive macroblock resolution coding
US20110170608A1 (en) * 2010-01-08 2011-07-14 Xun Shi Method and device for video transcoding using quad-tree based mode selection
CN102611891A (en) * 2012-02-07 2012-07-25 中国电子科技集团公司第三研究所 Method for directly performing transform coding in transform domain
CN104104966A (en) * 2013-04-08 2014-10-15 华为技术有限公司 Video block dividing method and device

Also Published As

Publication number Publication date
CN104104955A (en) 2014-10-15

Similar Documents

Publication Publication Date Title
JP6275889B2 (en) Method and apparatus for encoding / decoding motion vectors based on reduced predicted motion vector candidates
RU2559738C2 (en) Method and device for encoding/decoding of motion vector
CN112602324B (en) Block horizontal geometric partitioning
CN110557631B (en) Image prediction method and related equipment
CN101610413B (en) Video encoding/decoding method and device
KR102027474B1 (en) Method and apparatus for encoding/decoding image by using motion vector of previous block as motion vector of current block
KR20110045950A (en) Method and apparatus for encoding and decoding an image with reference to a plurality of frames
KR20110017302A (en) Image coding, decoding method and apparatus using accuracy control of motion vector
WO2017201678A1 (en) Image prediction method and related device
CN104104966B (en) The division methods and device of video block
CN104104955B (en) The decoding method and device of a kind of image block
JP6935553B2 (en) Methods and Devices for Coding / Decoding Motion Vectors Based on Reduced Predicted Motion Vector Candidates

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201217

Address after: Room 400, building 5, No.11 Deshengmenwai street, Xicheng District, Beijing 100032 (Desheng Park)

Patentee after: Migu cultural technology Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right