CN102761742B - Transform block division methods, transform block divides coding method and the coding/decoding method of parameter - Google Patents
Transform block division methods, transform block divides coding method and the coding/decoding method of parameter Download PDFInfo
- Publication number
- CN102761742B CN102761742B CN201210227646.4A CN201210227646A CN102761742B CN 102761742 B CN102761742 B CN 102761742B CN 201210227646 A CN201210227646 A CN 201210227646A CN 102761742 B CN102761742 B CN 102761742B
- Authority
- CN
- China
- Prior art keywords
- block
- transform block
- size
- division
- parameter
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/119—Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明提供一种变换块划分方法,变换块的划分参数编码方法和解码方法。变换块划分方法包括:获取预设变换块的尺寸的最小值;对变换块的进行非方形划分时,若所述变换块的宽或高等于所述预设变换块的尺寸的最小值,则停止对所述变换块进行划分。本发明实施例在对变换块进行非方形划分时,在变换块的宽或高其中之一等于预设变换块的尺寸最小值时,停止划分。
The invention provides a transformation block division method, a division parameter coding method and a decoding method of the transformation block. The transformation block division method includes: obtaining the minimum value of the size of the preset transformation block; when performing non-square division on the transformation block, if the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, then Stop dividing the transform block. In the embodiment of the present invention, when performing non-square division on the transformation block, when one of the width or height of the transformation block is equal to the minimum size of the preset transformation block, the division is stopped.
Description
技术领域technical field
本发明实施例涉及图像编码技术,尤其涉及一种变换块划分方法,变换块划分参数的编码方法及解码方法。Embodiments of the present invention relate to image coding technology, and in particular, to a transform block division method, an encoding method and a decoding method of transform block division parameters.
背景技术Background technique
为减少视频传输所占用的带宽,需要对视频数据进行编码处理,其中,帧间压缩方法就是一种常见的视频编码技术,其可以对待传输视频图像进行压缩处理,减少视频传输的数据。In order to reduce the bandwidth occupied by video transmission, video data needs to be encoded. Among them, the inter-frame compression method is a common video encoding technology, which can compress the video image to be transmitted and reduce the data of video transmission.
帧间压缩方法是基于运动估计的一种视频编码技术,视频编码端对视频图像进行编码的过程包括:首先,将待编码图像块划分成若干个大小相等的子图像块;然后,针对每个子图像块,在参考图像中搜索与当前子图像块最匹配的图像块作为预测块;其后,将该子图像块与预测块的相应像素值相减得到残差,并将得到的各子图像块对应的残差组合在一起,得到图像块的残差;然后将图像块的残差经变换与量化后得到的值进行熵编码;最后,将熵编码得到的比特流和运动矢量信息一并发给解码端,其中,运动矢量信息表示当前子图像块与预测块的位置差。解码端接收到编码端发送的比特流和运动矢量信息后,进行与编码端相反的处理过程,即可得到相应的图像块的原始数据。目前,在对图像编码过程中,对图像块的残差进行变换,是利用变换块(也称变化矩阵)对残差进行变换处理,得到变换系数矩阵,以去除图像块的冗余信息,提高图像块的编码效率。由于图像块的残差存在不同的分布规律,使用某一特定尺寸的变换块对其进行变换处理往往达不到较好的变换效果,因此需要使用不同尺寸的变换块来对图像块的残差进行变换处理,以获得最佳的变换效果。The inter-frame compression method is a video coding technology based on motion estimation. The process of encoding video images at the video encoding end includes: first, dividing the image block to be encoded into several equal-sized sub-image blocks; then, for each sub-image block Image block, search for the image block that best matches the current sub-image block in the reference image as the prediction block; then, subtract the sub-image block from the corresponding pixel value of the prediction block to obtain a residual, and obtain each sub-image The residuals corresponding to the blocks are combined to obtain the residuals of the image blocks; then the values obtained by transforming and quantizing the residuals of the image blocks are entropy encoded; finally, the bit stream and motion vector information obtained by the entropy encoding are concurrently To the decoding end, wherein the motion vector information represents the position difference between the current sub-image block and the prediction block. After receiving the bit stream and motion vector information sent by the encoding end, the decoding end performs the opposite process to that of the encoding end to obtain the original data of the corresponding image block. At present, in the process of image coding, the residual of the image block is transformed by using the transformation block (also called the change matrix) to transform the residual to obtain the transformation coefficient matrix to remove the redundant information of the image block and improve Coding efficiency of image blocks. Due to the different distribution rules of the residuals of image blocks, using a transformation block of a certain size to transform them often does not achieve a good transformation effect, so it is necessary to use transformation blocks of different sizes to transform the residuals of image blocks. Perform transformation processing to obtain the best transformation effect.
现有图像块编码过程中,需要对变换块进行划分,以获得适合对图像块的残差进行变换处理的变换块,其中,变换块的初始尺寸通常为方形,即变换块的高和宽相等。传统方法对变换块划分时,是采用方形划分,即将变换块划分成多个宽和高相等的方形子变换块,然后利用方形变换块对图像块的残差进行变换处理。In the existing image block encoding process, it is necessary to divide the transformation block to obtain a transformation block suitable for transforming the residual of the image block, wherein the initial size of the transformation block is usually square, that is, the height and width of the transformation block are equal . When the traditional method divides the transformation block, it adopts square division, that is, divides the transformation block into multiple square sub-transformation blocks with equal width and height, and then uses the square transformation block to transform the residual of the image block.
由于图像块在进行划分时,会采用水平划分、垂直划分等非方形划分方式,且这种非方形划分会体现图像块的纹理信息,此时,若采用方形变换块对图像块的残差进行变换处理时,方形变换块就有可能跨越相邻的两个子图像块对应的残差,由于相邻两个子图像块对应的残差会存在跳跃性的变换,此时采用方形变换块进行变换时,就会使得变换作用减弱,不能有效去除图像块的冗余信息,降低编码效率。为此,现有技术也提出了一种采用非方形变换块对图像块的残差进行变换处理的方法,其中,在对变换块进行划分时,按照与图像块一致的划分方式,将划分得到的子变换块形状与子图像块尺寸一致,这样,就可以避免采用方形变换块对图像块的残差处理时存在的不能有效去除图像块的冗余信息的问题。此外,在对变换块进行划分过程中,需要对变换块的划分参数进行编码,每个变换块需要编码变换块的划分参数,以表示变换块是否需要划分。Because when the image block is divided, non-square division methods such as horizontal division and vertical division will be used, and this non-square division will reflect the texture information of the image block. At this time, if the square transformation block is used to perform During the transformation process, the square transformation block may span the residuals corresponding to the two adjacent sub-image blocks. Since the residuals corresponding to the two adjacent sub-image blocks will have jumpy transformations, at this time, when the square transformation block is used for transformation , it will make the transformation effect weaken, and the redundant information of the image block cannot be effectively removed, and the coding efficiency will be reduced. For this reason, the prior art also proposes a method for transforming the residual of an image block by using a non-square transform block, wherein, when dividing the transform block, the division method is consistent with the image block, and the division is obtained by The shape of the sub-transform block is consistent with the size of the sub-image block, so that the problem of not being able to effectively remove redundant information of the image block exists when the square transform block is used to process the residual of the image block. In addition, in the process of dividing the transformation block, the division parameter of the transformation block needs to be encoded, and each transformation block needs to encode the division parameter of the transformation block to indicate whether the transformation block needs to be divided.
但是,对变换进行划分时,通常会预设变换块的尺寸的最小值,而现有采用非方变换块的变换块划分过程中,是将变换块的宽和高均划分到预设变换块的尺寸的最小值时,才会停止划分,这样,在对变换块进行划分时,可能会存在同时采用水平划分、垂直划分或水平划分与垂直划分交叉的划分方式,变换块参数的编码复杂,导致变换块的划分逻辑复杂,划分出的变换块也会影响图像块的编码效率,增加编码的复杂度。However, when dividing the transformation, the minimum value of the size of the transformation block is usually preset, while the existing transformation block division process using non-square transformation blocks divides the width and height of the transformation block into preset transformation blocks When the minimum value of the size of , the division will stop. In this way, when dividing the transformation block, there may be a division method that uses horizontal division, vertical division, or horizontal division and vertical division at the same time. The encoding of the transformation block parameters is complicated. As a result, the division logic of the transform block is complicated, and the divided transform block will also affect the encoding efficiency of the image block, increasing the complexity of encoding.
发明内容Contents of the invention
本发明实施例提供一种变换块划分方法,变换块划分参数的编码方法及解码方法,可有效对变换块进行划分,提高图像块的编码效率。Embodiments of the present invention provide a transformation block division method, a coding method and a decoding method of transformation block division parameters, which can effectively divide transformation blocks and improve the coding efficiency of image blocks.
本发明实施例提供一种变换块划分方法,包括:An embodiment of the present invention provides a transformation block division method, including:
获取预设变换块的尺寸的最小值;Obtain the minimum value of the size of the preset transformation block;
对变换块的进行非方形划分时,若所述变换块的宽或高等于所述预设变换块的尺寸的最小值,则停止对所述变换块进行划分;When performing non-square division of the transformation block, if the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, then stop dividing the transformation block;
其中,所述非方形划分是指将图像块或变换块划分成宽和高不等的划分方法。Wherein, the non-square division refers to a division method of dividing an image block or a transform block into widths and heights.
本发明实施例另提供一种变换块划分参数的编码方法,包括:An embodiment of the present invention further provides a coding method for transforming block division parameters, including:
获取预设变换块的尺寸的最小值;Obtain the minimum value of the size of the preset transformation block;
根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否编码变换块的划分参数;According to the relationship between the size of the transform block and the minimum value of the size of the preset transform block, determine whether to encode the division parameter of the transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
本发明实施例还提供一种变换块划分参数的解码方法,其特征在于,包括:The embodiment of the present invention also provides a decoding method for transforming block division parameters, which is characterized in that it includes:
获取预设变换块的尺寸的最小值;Obtain the minimum value of the size of the preset transformation block;
根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否解码变换块的划分参数;According to the relationship between the size of the transform block and the minimum value of the size of the preset transform block, determine whether to decode the division parameter of the transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
此外,本发明实施例还提供一种变换块划分装置,包括:In addition, an embodiment of the present invention also provides an apparatus for dividing transform blocks, including:
尺寸获取模块,用于获取预设变换块的尺寸的最小值;a size obtaining module, configured to obtain the minimum value of the size of the preset transformation block;
变换块划分模块,用于对变换块的进行非方形划分时,若所述变换块的宽或高等于所述预设变换块的尺寸的最小值,则停止对所述变换块进行划分;A transformation block division module, configured to stop dividing the transformation block if the width or height of the transformation block is equal to the minimum size of the preset transformation block when performing non-square division of the transformation block;
其中,所述预设变换块的尺寸的最小值为变换块的宽或高的最小值,或者宽和高之和的平均值的最小值;所述非方形划分是指将图像块或变换块划分成宽和高不等的划分方法。Wherein, the minimum value of the size of the preset transformation block is the minimum value of the width or height of the transformation block, or the minimum value of the average value of the sum of width and height; the non-square division refers to dividing the image block or the transformation block Divide into division methods ranging in width and height.
本发明实施例提供一种变换块划分参数的编码装置,包括:An embodiment of the present invention provides an encoding device for transforming block division parameters, including:
尺寸获取模块,用于获取预设变换块的尺寸的最小值;a size obtaining module, configured to obtain the minimum value of the size of the preset transformation block;
参数编码模块,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否编码变换块的划分参数;A parameter encoding module, configured to determine whether to encode the division parameter of the transform block according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
本发明实施例提供一种变换块划分参数的解码装置,包括:An embodiment of the present invention provides a decoding device for transforming block division parameters, including:
尺寸获取模块,用于获取预设变换块的尺寸的最小值;a size obtaining module, configured to obtain the minimum value of the size of the preset transformation block;
参数解码模块,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否解码变换块的划分参数;A parameter decoding module, configured to judge whether to decode the division parameter of the transform block according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
本发明实施例提供一种图像编解码系统,包括:An embodiment of the present invention provides an image encoding and decoding system, including:
变换块划分参数的编码装置,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否编码变换块的划分参数;An encoding device for transform block division parameters, configured to determine whether to encode the division parameters of the transform block according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block;
变换块划分参数的解码装置,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否解码变换块的划分参数;The decoding device of the transformation block division parameter is used to judge whether to decode the division parameter of the transformation block according to the relationship between the size of the transformation block and the minimum value of the size of the preset transformation block;
其中,所述变换块的划分参数用于表示对变换块进行划分或不进行划分Wherein, the division parameter of the transform block is used to indicate whether to divide the transform block or not to divide
本发明实施例提供的变换块划分方法,变换块划分参数的编码方法及解码方法,在对变换块进行非方形划分时,只要变换块的宽或高其中之一等于预设变换块的尺寸的最小值,就停止对变换块的划分,提高图像块的编码效率。The transformation block division method provided by the embodiment of the present invention, the encoding method and decoding method of the transformation block division parameters, when performing non-square division on the transformation block, as long as one of the width or height of the transformation block is equal to the size of the preset transformation block If it is the minimum value, the division of the transform block is stopped, and the coding efficiency of the image block is improved.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1a-图1d为图像块采用对称划分方式进行划分的结构示意图;Figures 1a-1d are structural schematic diagrams of image blocks divided by symmetrical division;
图2a-图2d为图像块采用非对称划分方式进行划分的结构示意图;Fig. 2a-Fig. 2d are structural schematic diagrams of image blocks divided by asymmetrical division;
图3a-图3c为图像块使用的变化块的尺寸示意图;Fig. 3a-Fig. 3c are schematic diagrams of the size of the change block used by the image block;
图4为本发明实施例一提供的变换块划分方法的流程示意图;FIG. 4 is a schematic flowchart of a transform block division method provided by Embodiment 1 of the present invention;
图5为本发明实施例二提供的变换块划分方法的流程示意图;FIG. 5 is a schematic flowchart of a transform block division method provided in Embodiment 2 of the present invention;
图6为本发明实施例三提供的变换块划分方法流程示意图;FIG. 6 is a schematic flowchart of a transform block division method provided by Embodiment 3 of the present invention;
图7为本发明实施例四提供的变换块划分参数的编码方法流程示意图;FIG. 7 is a schematic flowchart of a method for encoding transformation block division parameters provided by Embodiment 4 of the present invention;
图8为本发明实施例五提供的变换块划分参数的解码方法的流程示意图;FIG. 8 is a schematic flowchart of a decoding method for transform block division parameters provided in Embodiment 5 of the present invention;
图9为本发明实施例六提供的变换块划分装置结构示意图;FIG. 9 is a schematic structural diagram of an apparatus for dividing transform blocks according to Embodiment 6 of the present invention;
图10为本发明实施例七提供的变换块划分装置结构示意图;FIG. 10 is a schematic structural diagram of an apparatus for dividing transform blocks provided by Embodiment 7 of the present invention;
图11为本发明实施例八提供的变换块划分装置结构示意图;FIG. 11 is a schematic structural diagram of an apparatus for dividing transform blocks provided by Embodiment 8 of the present invention;
图12为本发明实施例九提供的变换块划分装置的结构示意图;FIG. 12 is a schematic structural diagram of an apparatus for dividing transform blocks provided by Embodiment 9 of the present invention;
图13为本发明实施例十提供的变换块划分参数的编码装置的结构示意图;FIG. 13 is a schematic structural diagram of an encoding device for transforming block division parameters provided by Embodiment 10 of the present invention;
图14为本发明实施例十一提供的变换块划分参数的编码装置的结构示意图;FIG. 14 is a schematic structural diagram of an encoding device for transforming block division parameters provided by Embodiment 11 of the present invention;
图15为本发明实施例十二提供的变换块划分参数的编码装置的结构示意图;FIG. 15 is a schematic structural diagram of an encoding device for transforming block division parameters provided by Embodiment 12 of the present invention;
图16为本发明实施例十三提供的变换块划分参数的解码装置的结构示意图;FIG. 16 is a schematic structural diagram of a decoding device for transforming block division parameters provided by Embodiment 13 of the present invention;
图17为本发明实施例十四提供的变换块划分参数的解码装置的结构示意图;FIG. 17 is a schematic structural diagram of a decoding device for transforming block division parameters provided by Embodiment 14 of the present invention;
图18为本发明实施例十五提供的变换块划分参数的解码装置的结构示意图;FIG. 18 is a schematic structural diagram of a decoding device for transforming block division parameters provided by Embodiment 15 of the present invention;
图19为本发明实施例十六提供的图像编解码系统的结构示意图。FIG. 19 is a schematic structural diagram of an image encoding and decoding system provided by Embodiment 16 of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages 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 accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are the Some, but not all, embodiments are invented. 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.
为便于对本发明实施例技术方案的理解,下面首先对视频编码中图像块的划分、变换块的划分分别给予说明。In order to facilitate the understanding of the technical solutions of the embodiments of the present invention, the division of image blocks and the division of transformation blocks in video coding are firstly described below.
图像块的划分:The division of image blocks:
在现有的视频编码系统和解码标准中,如移动图像专家组(MovingPictureExperts Group,MPEG),增强视频编码(Advanced Video Coding,H.264/AVC),一个图像块,或称为宏块(macroblock)、超宏块(super-macroblock)等,可被划分为若干个子图像块,这些子图像块的尺寸为16x16、16x8、8x16、8x8、8x4、4x8、4x4等,子图像块以这些尺寸进行运动估计和运动补偿,图像的编码端需要将标识图像块划分方式的码字发送给图像的解码端,以便图像的解码端获知图像编码端的划分方式,并根据该划分方式和运动矢量信息,确定相应的预测块。在现有的视频编解码标准中这些子图像块均为NXM(N和M均为大于0的整数)的矩形块,并且N和M具有倍数关系。In existing video coding systems and decoding standards, such as Moving Picture Experts Group (Moving Picture Experts Group, MPEG), Enhanced Video Coding (Advanced Video Coding, H.264/AVC), an image block, or macroblock (macroblock) ), super-macroblock (super-macroblock), etc., can be divided into several sub-image blocks, the size of these sub-image blocks is 16x16, 16x8, 8x16, 8x8, 8x4, 4x8, 4x4, etc. Motion estimation and motion compensation, the encoding end of the image needs to send the codeword identifying the division method of the image block to the decoding end of the image, so that the decoding end of the image can know the division method of the image encoding end, and according to the division method and motion vector information, determine corresponding prediction block. In the existing video coding and decoding standards, these sub-image blocks are rectangular blocks of NXM (both N and M are integers greater than 0), and N and M have a multiple relationship.
其中,图像块被划分成子图像块的常用方式有:2Nx2N划分方式,图像块只包含一个子图像块,即该图像块不被划分成更小的子图像块,如图1a所示;2NxN划分方式,将图像块划分成上下两个等大的子图像块,如图1b所示;Nx2N划分方式,将图像块划分成左右两个等大的子图像块,如图1c所示;NxN划分方式,将图像块划分成四个等大的子图像块,如图1d所示。上述各划分方式中,N为任意正整数,且上述划分方式均为对称划分方式。Among them, the commonly used ways for an image block to be divided into sub-image blocks are: 2Nx2N division method, the image block only contains one sub-image block, that is, the image block is not divided into smaller sub-image blocks, as shown in Figure 1a; 2NxN division method, divide the image block into two sub-image blocks of equal size up and down, as shown in Figure 1b; Nx2N division method, divide the image block into two sub-image blocks of equal size on the left and right, as shown in Figure 1c; NxN division In this way, the image block is divided into four sub-image blocks of equal size, as shown in Fig. 1d. In each of the above division methods, N is any positive integer, and the above division methods are all symmetrical division methods.
此外,图像块还可以采用非对称划分方式,如图2a至图2d所示,其中,图2a和2b所示划分方式将一个图像块划分成上下两个不等大的矩形子图像块;图2c和2d所示划分方式将一个图像块划分成左右两个不等大的矩形子图像块。具体地,图2a所示为采用2NxnU划分方式,其中n=0.5N,该划分方式划分出的两个子图像块中,上边的子图像块2Nx0.5N,下边的子图像块为2Nx1.5N,其中,2NxnU中的U表示图像划分线相对该图像块的垂直平分线上移,2NxnU表示图像划分线相对该图像块的垂直平分线上移n,其中,n=x*N,其中x大于或等于0并小于或者等于1;图2b所示为采用2NxnD划分方式,其中n=0.5N,该划分方式划分出的两个子图像块中,上边的子图像块为2Nx1.5N,下边的子图像块为2Nx0.5N,其中,2NxnD中的D表示图像划分线相对该图像块的垂直平分线下移,2NxnD表示图像划分线相对该图像块的垂直平分线下移n,其中,n=x*N,其中x大于或等于0并小于或者等于1;图2c所示为采用nLx2N划分方式,其中n=0.5N,该划分方式划分出的两个子图像块中,左边的子图像块为0.5Nx2N,其中,nLx2N中的L表示图像划分线相对该图像块的垂直平分线左移,nLx2N表示表示图像划分线相对该图像块的垂直平分线左移n,其中,n=x*N,x大于或等于0并小于或者等于1,右边的子图像块为1.5Nx2N;图2d所示为采用nRx2N划分方式,其中n=0.5N,该划分方式划分出的两个子图像块中,左边的子图像块为1.5Nx2N,右边的子图像块为0.5Nx2N,nRx2N中的R表示图像划分线相对该图像块的垂直平分线右移,nRx2N表示表示图像划分线相对该图像块的垂直平分线右移n,其中,n=x*N,x大于或等于0并小于或者等于1。In addition, the image block can also use an asymmetrical division method, as shown in Figure 2a to Figure 2d, wherein, the division method shown in Figure 2a and 2b divides an image block into two upper and lower rectangular sub-image blocks of unequal size; The division methods shown in 2c and 2d divide an image block into two left and right rectangular sub-image blocks of unequal size. Specifically, Fig. 2a shows a 2NxnU division method, where n=0.5N, among the two sub-image blocks divided by this division method, the upper sub-image block is 2Nx0.5N, and the lower sub-image block is 2Nx1.5N, Among them, U in 2NxnU means that the image dividing line moves relative to the vertical bisector of the image block, and 2NxnU means that the image dividing line moves n relative to the vertical bisector of the image block, where n=x*N, where x is greater than or Equal to 0 and less than or equal to 1; Figure 2b shows the use of 2NxnD division method, where n=0.5N, in the two sub-image blocks divided by this division method, the upper sub-image block is 2Nx1.5N, and the lower sub-image The block is 2Nx0.5N, where D in 2NxnD means that the image dividing line moves down relative to the vertical bisector of the image block, and 2NxnD means that the image dividing line moves down by n relative to the vertical bisector of the image block, where n=x* N, where x is greater than or equal to 0 and less than or equal to 1; Figure 2c shows the nLx2N division method, where n=0.5N, in the two sub-image blocks divided by this division method, the left sub-image block is 0.5Nx2N , where, L in nLx2N means that the image dividing line moves left relative to the vertical bisector of the image block, nLx2N means that the image dividing line moves left n relative to the vertical bisector of the image block, where n=x*N, x is greater than Or equal to 0 and less than or equal to 1, the sub-image block on the right is 1.5Nx2N; Figure 2d shows the nRx2N division method, where n=0.5N, among the two sub-image blocks divided by this division method, the left sub-image The block size is 1.5Nx2N, and the sub-image block on the right is 0.5Nx2N. The R in nRx2N means that the image dividing line moves to the right relative to the vertical bisector of the image block, and nRx2N means that the image dividing line moves right by n relative to the vertical bisector of the image block. , where n=x*N, x is greater than or equal to 0 and less than or equal to 1.
在上述图像块的划分方式中,通过水平划分线将图像块划分成沿垂直方向排列的多个子图像块,这时候采用的划分方向为水平划分方向,上述2NxN划分方式、2NxnU划分方式、2NxnD划分方式统称为水平划分方式;而通过垂直划分线将图像块划分成沿水平方向排列的多个子图像块为垂直划分方式,这时候采用的划分方向为垂直划分方向,上述Nx2N划分方式、nLx2N划分方式、nRx2N划分方式统称垂直划分方式;同时通过水平划分线和垂直划分线,将图像块划分成四个子图像块,这时候采用的划分方向则为水平和垂直划分方向,上述NxN划分方式为水平和垂直划分方式。其中水平划分方式和垂直划分方式称为非方形划分方式,划分后的各子图像块为非方形结构,而水平和垂直划分方式称为方形划分方式,划分后的各子图像块为方形结构。In the division method of the above-mentioned image block, the image block is divided into a plurality of sub-image blocks arranged in the vertical direction through the horizontal division line. At this time, the division direction adopted is the horizontal division direction. The method is collectively referred to as the horizontal division method; and the vertical division method is to divide the image block into multiple sub-image blocks arranged in the horizontal direction through the vertical division line, and the division direction adopted at this time is the vertical division direction. , nRx2N division methods are collectively referred to as the vertical division method; at the same time, the image block is divided into four sub-image blocks through the horizontal division line and the vertical division line, and the division direction adopted at this time is the horizontal and vertical division directions. vertical division. The horizontal division method and the vertical division method are called non-square division methods, and each divided sub-image block has a non-square structure, while the horizontal and vertical division methods are called a square division method, and each divided sub-image block has a square structure.
图像块编码过程中,需要查询划分后的子图像块的预测块,因此,上述图像块的划分方式中,也可以用预测块的类型来指代,图像块的划分方式与预测块类型对应。During the encoding process of the image block, it is necessary to query the prediction block of the divided sub-image block. Therefore, the above division method of the image block can also be referred to by the type of the prediction block, and the division method of the image block corresponds to the type of the prediction block.
在采用非方形划分方式的图像块划分中,划分方式可反映图像块所处区域的纹理信息,当图像块使用水平划分方式时图像块所处区域的纹理更倾向于具有水平纹理的特征,当图像块使用垂直划分方式时图像块所处区域的纹理更倾向于具有垂直纹理的特征。若采用与图像纹理特征相匹配的变换块的形状可以进一步提高变换编码的效率,具体地,当图像块使用水平划分方式时,变换块为水平长条形状以适应具有水平纹理的特征的变换编码;当图像块使用垂直划分方式时,变换块为垂直长条形状以适应具有垂直纹理的特征的变换编码。因此,可在对变换块进行划分时,也可采用非方形划分方式,将变换块划分成与子图像块一致的非方形结构,以与图像块的纹理特征匹配,提高图像块的编码效率。In the image block division using a non-square division method, the division method can reflect the texture information of the area where the image block is located. When the image block is divided horizontally, the texture of the area where the image block is located tends to have the characteristics of horizontal texture. When When the image block is divided vertically, the texture of the area where the image block is located tends to have the characteristics of vertical texture. The efficiency of transformation coding can be further improved if the shape of the transformation block matching the image texture features is adopted. Specifically, when the image block is divided horizontally, the transformation block is in the shape of a horizontal strip to adapt to the transformation coding with the characteristics of horizontal texture. ; When the image block is divided vertically, the transformation block is in the shape of a vertical strip to adapt to the transformation coding with the feature of vertical texture. Therefore, when dividing the transformation block, a non-square division method can also be used to divide the transformation block into a non-square structure consistent with the sub-image blocks, so as to match the texture features of the image blocks and improve the coding efficiency of the image blocks.
变换块划分:Transform block division:
在视频编码和解码技术中,可以使用变换块(即变换矩阵)去除图像块的残差的相关性,即去除图像块的冗余信息,以便提高编码效率,图像块中的数据块的变换通常采用二维变换,即在编码端将数据块的残差信息分别与一个NXM的变换矩阵及其转置矩阵相乘,相乘之后得到的是变换系数。上述步骤可以使用以下公式描述:In video coding and decoding technology, you can use the transformation block (that is, the transformation matrix) to remove the correlation of the residual of the image block, that is, to remove the redundant information of the image block, in order to improve the coding efficiency. The transformation of the data block in the image block is usually Two-dimensional transformation is used, that is, the residual information of the data block is multiplied by an NXM transformation matrix and its transpose matrix at the encoding end, and the transformation coefficients are obtained after the multiplication. The above steps can be described using the following formula:
f=T'×C×Tf=T'×C×T
其中,C代表数据块的残差信息,T和T'代表变换矩阵和变换矩阵的转置矩阵,f代表数据块的残差信息经变换后得到的变换系数矩阵。其中,变换矩阵可以是离散余弦变换(Discrete Cosine Transform,DCT)矩阵、整数变换(Integer Transform)矩阵、KL变换(Karhunen Lòeve Transform,KLT)矩阵等,其中,KLT可以更好的考虑图像块或图像块残差的纹理信息。Wherein, C represents the residual information of the data block, T and T' represent the transformation matrix and the transposition matrix of the transformation matrix, and f represents the transformation coefficient matrix obtained after the transformation of the residual information of the data block. Among them, the transformation matrix can be a discrete cosine transformation (Discrete Cosine Transform, DCT) matrix, an integer transformation (Integer Transform) matrix, a KL transformation (Karhunen Lòeve Transform, KLT) matrix, etc., wherein KLT can better consider image blocks or image Texture information for block residuals.
对图像块的残差信息进行上述处理相当于将图像块的残差信息从空域转换至频域,且经处理后得到的变换系数矩阵集中于低频区域;编码端对图像块的残差信息进行上述变换之后,对变换后得到的变换系数矩阵再进行量化、熵编码等处理后,将熵编码得到的比特流发送给解码端。Performing the above processing on the residual information of the image block is equivalent to converting the residual information of the image block from the spatial domain to the frequency domain, and the transformation coefficient matrix obtained after processing is concentrated in the low-frequency area; After the above transformation, quantization, entropy coding and other processing are performed on the transformation coefficient matrix obtained after transformation, and the bit stream obtained by entropy coding is sent to the decoding end.
为了使解码端知道编码端所采用的变换矩阵类型和尺寸,通常,编码端会将表示当前图像块所使用的变换矩阵的指示信息发送给解码端,解码端根据上述指示信息确定编码端采用的变换矩阵,根据变换矩阵的特点(变换矩阵的正交性等),对编码端发送的比特流进行解码得到变换系数矩阵,将变换系数矩阵与变换矩阵及其转置矩阵相乘,可恢复得到与编码端近似一致的数据块的残差信息。上述步骤可以使用以下公式描述:In order for the decoding end to know the type and size of the transformation matrix used by the encoding end, usually, the encoding end will send indication information indicating the transformation matrix used by the current image block to the decoding end, and the decoding end determines the transformation matrix used by the encoding end according to the above indication information. The transformation matrix, according to the characteristics of the transformation matrix (orthogonality of the transformation matrix, etc.), decodes the bit stream sent by the encoder to obtain the transformation coefficient matrix, and multiplies the transformation coefficient matrix with the transformation matrix and its transpose matrix, which can be recovered to obtain The residual information of the data block approximately consistent with the encoding end. The above steps can be described using the following formula:
C=T×f×T',C=T×f×T',
其中,C代表数据块的残差信息,T和T'代表变换矩阵和变换矩阵的转置矩阵,f代表解码端得到的变换系数矩阵。Wherein, C represents the residual information of the data block, T and T' represent the transformation matrix and the transposition matrix of the transformation matrix, and f represents the transformation coefficient matrix obtained by the decoding end.
由于图像块的残差可能存在不同的分布规律,使用某一特定尺寸的变换矩阵往往达不到好的变换效果,因此,需要对图像块的残差尝试使用不同尺寸的变换块,因此,对于一个2Nx2N的图像块可以使用尺寸为2Nx2N的变换矩阵,也可以使用尺寸为NxN的变换矩阵、或尺寸为0.5Nx0.5N的变换矩阵,因此,为有效地表示图像块如何使用不同尺寸的变换矩阵,可以使用树形标识方法,当标识图像块使用的变换块尺寸时,码流中第一层有用于标识图像块是否使用尺寸为2Nx2N变换矩阵的指示位,如果图像块使用尺寸为2Nx2N变换矩阵(如图3a所示),则该指示位为0;如果图像块不使用2Nx2N变换时,则该指示位为1,表示需要将尺寸为2Nx2N变换矩阵进一步划分成四个尺寸为NxN的变换矩阵,并在码流第二层结构中用4个比特分别标识每一个尺寸为NxN的变换矩阵是否进一步划分;如果图像块使用如图3b所示的变换结构时,4个比特都为0,表示每一个尺寸为NxN的变换矩阵不再进一步划分;当选用如图3c所示的变换结构时,则4个比特中有2个比特为0,2个比特为1,2个比特为0表示对左下和右上的尺寸为NxN的变换矩阵不再进行划分;2个比特为1表示需要对左上和右下的尺寸为NxN的变换矩阵需要进一步划分,得到尺寸为0.5Nx0.5N的变换矩阵;然后在码流第三层结构中用4个比特表示是否需要对左上的尺寸为0.5Nx0.5N的变换矩阵进行进一步划分,用4个比特表示是否需要对右下的尺寸为0.5Nx0.5N的变换矩阵进行进一步划分,如果图像块使用如图3c所示的变换结构时,上述4+4个比特都为0,表示不再进一步划分。通过上述在码流中逐层标识可以有效的及灵活的表示出图像块和子图像块使用的变换尺寸。Since the residuals of image blocks may have different distribution rules, using a transformation matrix of a certain size often cannot achieve a good transformation effect. Therefore, it is necessary to try to use different sizes of transformation blocks for the residuals of image blocks. Therefore, for A 2Nx2N image block can use a transformation matrix with a size of 2Nx2N, a transformation matrix with a size of NxN, or a transformation matrix with a size of 0.5Nx0.5N. Therefore, in order to effectively represent how an image block uses a transformation matrix of different sizes , you can use the tree identification method. When identifying the size of the transformation block used by the image block, the first layer in the code stream has an indicator bit for identifying whether the image block uses a transformation matrix with a size of 2Nx2N. If the image block uses a transformation matrix with a size of 2Nx2N (As shown in Figure 3a), the indicator bit is 0; if the image block does not use 2Nx2N transformation, the indicator bit is 1, indicating that the transformation matrix with a size of 2Nx2N needs to be further divided into four transformation matrices with a size of NxN , and use 4 bits in the second layer structure of the code stream to identify whether each transformation matrix with a size of NxN is further divided; if the image block uses the transformation structure shown in Figure 3b, all 4 bits are 0, indicating Each transformation matrix with a size of NxN will not be further divided; when the transformation structure shown in Figure 3c is selected, 2 of the 4 bits are 0, 2 bits are 1, and 2 bits are 0. The transformation matrix of size NxN in the lower left and upper right is no longer divided; 2 bits of 1 indicate that the transformation matrix of size NxN in the upper left and lower right needs to be further divided to obtain a transformation matrix with a size of 0.5Nx0.5N; then In the third layer structure of the code stream, 4 bits are used to indicate whether the transformation matrix with a size of 0.5Nx0.5N on the upper left needs to be further divided, and 4 bits are used to indicate whether the transformation matrix with a size of 0.5Nx0.5N to the lower right needs to be transformed The matrix is further divided. If the image block uses the transformation structure shown in FIG. 3c, the above 4+4 bits are all 0, indicating that no further division will be made. Through the above layer-by-layer identification in the code stream, the transformation size used by the image block and the sub-image block can be effectively and flexibly indicated.
可以看出,在对图像块的残差进行变换处理时,需要对变换块进行划分,以获得图像块所使用的变换块的尺寸,获得最佳的变换效果,消除图像块的冗余信息,提供图像块的编码效率。It can be seen that when transforming the residual of the image block, the transform block needs to be divided to obtain the size of the transform block used by the image block, obtain the best transform effect, and eliminate redundant information of the image block. Provides coding efficiency for image blocks.
在对变换块进行划分时,可将变换块划分成等于图像块或小于图像块的尺寸,且在在变换块的编码和解码过程中,通常预设变换块允许的划分层数,及预设变换块的尺寸的最小值,其中,变换块允许的划分层数即是指变换块可使用的最多划分层数,例如图像编码设备和图像解码设备预先设定最多可使用两层划分,若变换块初始划分的尺寸为2Nx2N,变换块可由第0层划分至第1层,变换块的尺寸由2Nx2N变为NxN。或者,图像编码设备也可以在码流中写入标识最多可使用的划分层数的指示信息,以便通知图像解码设备该最多可使用的划分层数,例如在图像编码设备和图像解码设备中预先设定最小变换块尺寸为0.5N,若变换块的尺寸为NxN,当变换块划分至0.5Nx0.5N时变换块不再继续划分。When dividing the transformation block, the transformation block can be divided into a size equal to or smaller than the image block, and in the encoding and decoding process of the transformation block, the number of division layers allowed by the transformation block is usually preset, and the preset The minimum value of the size of the transformation block, where the number of division layers allowed by the transformation block refers to the maximum number of division layers that can be used by the transformation block. The initial division size of the block is 2Nx2N, the transformation block can be divided from the 0th layer to the 1st layer, and the size of the transformation block is changed from 2Nx2N to NxN. Alternatively, the image coding device may also write indication information identifying the maximum number of divisional layers that can be used in the code stream, so as to notify the image decoding device of the maximum number of divisional layers that can be used, for example, in the image coding device and the image decoding device in advance The minimum transformation block size is set to 0.5N. If the size of the transformation block is NxN, when the transformation block is divided to 0.5Nx0.5N, the transformation block will not be further divided.
上述两种方法也可结合使用,例如,图像编码设备和图像解码设备预先设定最多可使用三层划分,预设变换块的尺寸的最小值为0.5N。若变换块初始划分的尺寸为2Nx2N,则变换块可由第0层划分至第2层,其尺寸由2Nx2N划分为NxN进而再继续划分为0.5Nx0.5N。若变换块初始划分的尺寸为NxN,则变换块可由第0层划分至第1层,其尺寸由NxN变换0.5Nx0.5N,此时由于变换块尺寸已经达到预设变换块的尺寸的最小值,此时变换块不再继续划分。The above two methods can also be used in combination. For example, the image encoding device and the image decoding device preset that a maximum of three layers can be used, and the minimum value of the preset transform block size is 0.5N. If the size of the transform block initially divided is 2Nx2N, the transform block can be divided from layer 0 to layer 2, and its size is divided from 2Nx2N to NxN and further divided into 0.5Nx0.5N. If the initial division size of the transformation block is NxN, the transformation block can be divided from layer 0 to layer 1, and its size is transformed from NxN to 0.5Nx0.5N. At this time, the size of the transformation block has reached the minimum size of the preset transformation block , at this time the transform block is no longer divided.
实际应用中,变换块的划分可采用四叉树(quadtree)划分方式或二叉树(binarytree)划分方式进行划分,其中,四叉树划分是指变换块按一分为四的方式划分,划分后的变换块尺寸相同,即所有变换块划分后的宽均相等,所有变换块划分后的高均相等;二叉树划分方式是指变换块按一分为二的方式划分,划分后的每个变换块尺寸相同。In practical applications, the division of the transformation block can be divided by quadtree or binary tree division. The quadtree division means that the transformation block is divided into four, and the divided The size of the transformation block is the same, that is, the width of all transformation blocks after division is equal, and the height of all transformation blocks after division is equal; the binary tree division method means that the transformation block is divided into two, and the size of each transformation block after division same.
此外,为与图像块的纹理特性匹配,在对变换块进行划分时,也可采用与图像块一致的划分方式,即采用非方形划分方式对变换块进行划分,但是,现有对变换块进行非方形划分时,需要将变换块的两边的尺寸均等于预设变换块的尺寸的最小值时,才停止划分,例如,2Mx2M的变换块采用非方形划分时,由2Mx2M划分为0.5Mx2M,并由0.25MxM划分为0.25Mx0.25M时,假设预设变换块的最小尺寸为0.25M时,则0.25MxM的变换块会继续划分为0.25Mx0.25M。这种划分方法的问题在于,变换块沿不等于最小尺寸的边进行划分得到的变换块的形状,即变换块的宽高比,与划分前的变换块的形状不一致。这种不一致会影响变换块的编码效率,并且会导致变换块在非方形划分时同时存在三种划分方向:水平划分方向(变换块由2Mx2M划分为0.5Mx2M),水平和垂直划分方向(变换块由0.5Mx2M划分为0.25MxM)和垂直划分方向(变换块由0.25MxM划分为0.25Mx0.25M),这会导致划分逻辑复杂度的增加,而且编码端还需尝试0.25Mx0.25M变换块的编码效率,也会增加编码端的复杂度。本实施例中,对变换块进行划分时可采用与图像块一样的划分方式,并采用一分为四的四叉树方式进行划分。In addition, in order to match the texture characteristics of the image block, when dividing the transformation block, the same division method as the image block can also be adopted, that is, the transformation block is divided in a non-square division method. However, the existing transformation block In the case of non-square division, the size of both sides of the transformation block needs to be equal to the minimum value of the size of the preset transformation block before stopping the division. For example, when the transformation block of 2Mx2M is divided into non-square division, it is divided from 2Mx2M to 0.5Mx2M, and When dividing from 0.25MxM to 0.25Mx0.25M, assuming that the minimum size of the preset transform block is 0.25M, the 0.25MxM transform block will continue to be divided into 0.25Mx0.25M. The problem with this division method is that the shape of the transformation block obtained by dividing the transformation block along the side not equal to the minimum size, that is, the aspect ratio of the transformation block, is inconsistent with the shape of the transformation block before division. This inconsistency will affect the coding efficiency of the transformation block, and will cause the transformation block to have three division directions at the same time in the non-square division: the horizontal division direction (the transformation block is divided from 2Mx2M to 0.5Mx2M), the horizontal and vertical division directions (the transformation block Divided by 0.5Mx2M into 0.25MxM) and vertical division direction (the transformation block is divided into 0.25Mx0.25M by 0.25MxM), which will lead to an increase in the logical complexity of the division, and the encoding end needs to try the encoding of the 0.25Mx0.25M transformation block Efficiency will also increase the complexity of the encoding side. In this embodiment, the same division method as that of the image block can be used when dividing the transform block, and a quadtree method of dividing one into four can be used for division.
本发明实施例在对采用非方形划分方式对变换块进行划分时,只要变换块的宽或高等于预设变换块的尺寸的最小值时,就停止对变换块进行划分,以提高变换块的编码效率。下面将以具体实施例对变换块的划分进行说明。In the embodiment of the present invention, when the transformation block is divided by a non-square division method, as long as the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, the division of the transformation block is stopped, so as to improve the efficiency of the transformation block. Coding efficiency. The division of transform blocks will be described below with specific embodiments.
图4为本发明实施例一提供的变换块划分方法的流程示意图。如图4所示,本实施例方法可包括以下步骤:FIG. 4 is a schematic flowchart of a transform block division method provided by Embodiment 1 of the present invention. As shown in Figure 4, the method of this embodiment may include the following steps:
步骤101、获取预设变换块的尺寸的最小值;Step 101. Obtain the minimum value of the size of the preset transformation block;
步骤102、对变换块的进行非方形划分时,若变换块的宽或高等于预设变换块的尺寸的最小值,则停止对变换块进行划分;Step 102. When performing non-square division of the transformation block, if the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, stop dividing the transformation block;
其中,预设变换块的尺寸的最小值为变换块的宽或高的最小值,或者变换块的宽和高之和的平均值的最小值;非方形划分是指将图像块或变换块划分成宽和高不等的划分方法。Among them, the minimum value of the size of the preset transformation block is the minimum value of the width or height of the transformation block, or the minimum value of the average value of the sum of the width and height of the transformation block; non-square division refers to dividing the image block or transformation block Divide into different width and height.
本实施例可应用于图像的编解码处理中,可对变换块进行划分,以获得满足对图像块的残差进行变换处理的变换块的尺寸,具体地,当图像块采用非方形划分时,只要变换块的宽或高等于预设变换块的尺寸的最小值,就停止对变化块的划分,这样,划分后的变换块均为宽和高形状一致,即宽高比例关系一致,图像块的编码效率会得到提高。This embodiment can be applied to image encoding and decoding processing, and the transformation block can be divided to obtain the size of the transformation block that satisfies the transformation processing of the residual of the image block. Specifically, when the image block is divided into non-square, As long as the width or height of the transformation block is equal to the minimum size of the preset transformation block, the division of the transformation block will stop. In this way, the width and height of the divided transformation blocks are all consistent in shape, that is, the ratio of width to height is consistent, and the image block The coding efficiency will be improved.
综上,本发明实施例提供的变换块划分方法,在对变换块进行非方形划分时,只要变换块的宽或高其中之一等于预设变换块的尺寸的最小值,就停止对变换块的划分,可使得划分后的各变换块形状一致,提高图像块的变换编码效率。To sum up, the transformation block division method provided by the embodiment of the present invention, when performing non-square division on the transformation block, as long as one of the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, the transformation block is stopped. The division can make the shape of each divided transform block consistent, and improve the transform coding efficiency of the image block.
图5为本发明实施例二提供的变换块划分方法的流程示意图。如图5所示,本实施例对变换块进行划分时,可包括以下步骤:FIG. 5 is a schematic flowchart of a transform block division method provided by Embodiment 2 of the present invention. As shown in FIG. 5, when this embodiment divides the transform block, the following steps may be included:
步骤201、判断是否对变换块采用非方形划分,是则执行步骤203,否则,执行步骤202;Step 201, judging whether to use non-square division for the transform block, if yes, execute step 203, otherwise, execute step 202;
步骤202、采用方形划分方式对该变换块进行划分,直到变换块的尺寸等于预设变换块的最小尺寸时,停止划分,结束;Step 202: Divide the transformation block by using a square division method until the size of the transformation block is equal to the minimum size of the preset transformation block, stop dividing and end;
步骤203、对该变换块进行非方形划分,判断划分后的变换块的宽或高其中之一是否等于预设变换块的尺寸的最小值,是则停止对变换块的划分,结束,否则,继续执行步骤203,直到划分后的变换块的宽或高其中之一等于预设变换块的尺寸的最小值。Step 203: Perform non-square division on the transform block, and judge whether one of the width or height of the divided transform block is equal to the minimum size of the preset transform block, if yes, stop dividing the transform block, and end, otherwise, Step 203 is continued until one of the width or height of the divided transform block is equal to the minimum size of the preset transform block.
本领域技术人员可以理解,变换块的初始尺寸均为方形,即宽和高相等,当变换块采用非方形划分时,是由方形划分成非方形,此时,初始变换块的宽将被划分为原来的四分之一,或高将被划分为原来的四分之一,因此,由方形划分至非方形划分的前提条件在于变换块的初始尺寸至少为预设变换块的尺寸的最小值的4倍,即只有在变换块的宽或高至少为预设变换块的尺寸的最小值的4倍时,才对变换块进行非方形划分,否则,采用方形划分。Those skilled in the art can understand that the initial size of the transformation block is square, that is, the width and height are equal. When the transformation block is divided into non-square, it is divided from square to non-square. At this time, the width of the initial transformation block will be divided It is a quarter of the original, or the height will be divided into a quarter of the original, therefore, the prerequisite for partitioning from square to non-square is that the initial size of the transform block is at least the minimum value of the size of the preset transform block 4 times of , that is, only when the width or height of the transform block is at least 4 times the minimum value of the size of the preset transform block, the transform block is divided into a non-square shape, otherwise, the transform block is divided into a square shape.
具体的,假设图像块的尺寸为2Mx2M,预设变换块的尺寸的最大值为2M、预设变换块的尺寸的最小值为0.5M,变换块的尺寸的初始值等于图像块的尺寸,变换块允许划分的划分层数为3层,图像块的划分方式为Nx2N,由于变换块的初始值为2Mx2M,2M为预设变换块的尺寸的最小值0.5M的4倍,因此变换块可以采用与图像块一致的非方形划分方式,即采用Nx2N的水平划分方式,对变换块进行非方形划分。而当变换块的初始尺寸为MxM,预设变换块的尺寸的最小值为0.5M,由于变换块的尺寸为预设变换块的尺寸的最小值的2倍,则此时对变换块采用方形划分,即将MxM的变换块划分成0.5Mx0.5M的变换块。Specifically, assuming that the size of the image block is 2Mx2M, the maximum value of the size of the preset transform block is 2M, the minimum value of the size of the preset transform block is 0.5M, and the initial value of the size of the transform block is equal to the size of the image block, transform The number of division layers allowed to be divided into blocks is 3 layers, and the division method of image blocks is Nx2N. Since the initial value of the transformation block is 2Mx2M, and 2M is 4 times the minimum value of 0.5M for the size of the preset transformation block, the transformation block can be used The non-square division method consistent with the image block, that is, the Nx2N horizontal division method is used to perform non-square division on the transform block. And when the initial size of the transform block is MxM, the minimum size of the preset transform block is 0.5M, since the size of the transform block is twice the minimum size of the preset transform block, then the transform block is square Divide, that is, divide the MxM transform block into 0.5Mx0.5M transform blocks.
实际应用中,由于图像块对应的变换块的最大尺寸要小于或等于图像块的尺寸,而预设变换块的尺寸的最大值可能小于图像块的尺寸,因此,图像块对应的最大变换块的尺寸可能等于图像块的尺寸或者预设变换块的最大尺寸。因此,在判断对变换块是否进行非方形划分时,还需要判断变换块的尺寸与预设图像块的尺寸的最大值之间的关系,以确定变换块的划分方式。具体地,当图像块采用水平划分,变换块的宽等于变换块的高,且变换块的宽和高之和的平均值小于或等于预设变换块的尺寸的最大值时,采用水平划分方式,对变换块进行划分,使得划分后的变换块的宽等于划分前变换块的宽,划分后的变换块的高小于划分前变换块的高;当图像块采用垂直划分,变换块的宽等于变换块的高,且变换块的宽和高之和的平均值小于预设变换块的尺寸的最大值时,采用垂直划分方式,对变换块进行划分,使得划分后的变换块的宽小于划分前变换块的高,划分后的变换块的高等于划分前变换块的高;当图像块采用水平划分或垂直划分,变换块的宽和高不等,且变换块的宽和高之和的平均值大于预设变换块的尺寸的最大值时,采用水平划分或垂直划分,使得划分后的变换块的宽小于划分前变换块的宽,划分后的变换块的高小于划分前变换块的高。除此之外,可采用方形划分方式,对变换块进行划分。In practical applications, since the maximum size of the transformation block corresponding to the image block is smaller than or equal to the size of the image block, and the maximum size of the preset transformation block may be smaller than the size of the image block, therefore, the maximum size of the transformation block corresponding to the image block The size may be equal to the size of the image block or the maximum size of a preset transform block. Therefore, when judging whether to divide the transformation block into a non-square shape, it is also necessary to judge the relationship between the size of the transformation block and the maximum size of the preset image block, so as to determine the division method of the transformation block. Specifically, when the image block is divided horizontally, the width of the transformation block is equal to the height of the transformation block, and the average value of the sum of the width and height of the transformation block is less than or equal to the maximum size of the preset transformation block, the horizontal division method is adopted , divide the transformation block so that the width of the transformed transformation block after division is equal to the width of the transformation block before division, and the height of the transformation block after division is smaller than the height of the transformation block before division; when the image block is divided vertically, the width of the transformation block is equal to The height of the transformation block, and the average value of the sum of the width and height of the transformation block is less than the maximum value of the size of the preset transformation block, the vertical division method is used to divide the transformation block, so that the width of the divided transformation block is smaller than the division The height of the previous transformation block, the height of the transformed transformation block after division is equal to the height of the transformation block before division; when the image block is divided horizontally or vertically, the width and height of the transformation block are different, and the sum of the width and height of the transformation block is When the average value is greater than the maximum size of the preset transformation block, horizontal division or vertical division is adopted, so that the width of the divided transformation block is smaller than the width of the transformation block before division, and the height of the divided transformation block is smaller than that of the transformation block before division. high. In addition, a square division manner may be used to divide the transform block.
当图像块划分方式为水平划分,变换块的宽等于划分前的变换块的高,且划分前的变换块的划分前的宽和高的平均值小于或等于预设的变换块最大尺寸时,所述划分后的变换块采用非方形变换,且所述的非方形变换的宽等于所述划分前的变换块的宽,所述的非方形变换的高小于所述划分前的变换块的高;When the image block division method is horizontal division, the width of the transformation block is equal to the height of the transformation block before division, and the average value of the width and height of the transformation block before division is less than or equal to the preset maximum size of the transformation block, The divided transformation block adopts non-square transformation, and the width of the non-square transformation is equal to the width of the transformation block before the division, and the height of the non-square transformation is smaller than the height of the transformation block before the division ;
当图像块划分方式为垂直划分方式,划分前的变换块的宽等于划分前的变换块的高,且划分前的变换块的宽和高的平均值小于或等于预设的变换块最大尺寸时,所述划分后的变换块采用非方形变换,且所述的非方形变换的高等于所述划分前的变换块的高,所述非方形变换的宽小于所述划分前的变换块的宽;When the image block division method is vertical division, the width of the transformation block before division is equal to the height of the transformation block before division, and the average value of the width and height of the transformation block before division is less than or equal to the preset maximum size of the transformation block , the divided transformation block adopts non-square transformation, and the height of the non-square transformation is equal to the height of the transformation block before the division, and the width of the non-square transformation is smaller than the width of the transformation block before the division ;
当图像块划分方式为水平划分方式或垂直划分方式,划分前的变换块的宽不等于划分前的变换块的高,且划分前的变换块的宽和高的平均值大于预设的变换块最大尺寸时,所述变换块采用非方形变换,且所述的非方形变换的高小于所述划分前的变换块的高,所述非方形变换的宽小于所述划分前的变换块的宽。When the image block division method is horizontal division method or vertical division method, the width of the transformation block before division is not equal to the height of the transformation block before division, and the average value of the width and height of the transformation block before division is greater than the preset transformation block At the maximum size, the transform block adopts non-square transform, and the height of the non-square transform is smaller than the height of the transform block before division, and the width of the non-square transform is smaller than the width of the transform block before division .
上述本发明各实施例中,在对变换块进行非方形划分时,还可结合变换块允许划分的预设划分层数,确定是否停止对变换块进行划分。具体地,本实施例在对变换块进行划分时,还包括以下步骤:获取变换块允许划分的划分层数,其中,对变换块进行非方形划分,并在变换块的宽或高等于预设变换块的尺寸的最小值时,停止对变换块的划分具体可为:对变换块进行非方形划分,并在变换块的划分层数小于预设划分层数,且变换块的宽或高等于预设变换块的尺寸的最小值时,停止对变换块的划分。In the above-mentioned embodiments of the present invention, when performing non-square division on the transformation block, it may also be determined whether to stop dividing the transformation block in combination with the preset number of division layers allowed for division of the transformation block. Specifically, when dividing the transformation block in this embodiment, the following steps are further included: obtaining the number of division layers allowed for the transformation block, wherein, performing non-square division on the transformation block, and when the width or height of the transformation block is equal to the preset When the size of the transform block is at the minimum value, stopping the division of the transform block can be specifically: performing non-square division on the transform block, and when the number of division layers of the transformation block is less than the preset number of division layers, and the width or height of the transformation block is equal to When the minimum value of the size of the transform block is preset, the division of the transform block is stopped.
假设图像块的尺寸为2Mx2M,预设变换块的尺寸的最大值为M、预设变换块的尺寸的最小值为0.25M,变换块的尺寸的初始值等于图像块的尺寸,变换块允许划分的划分层数为4层,图像块划分方式为Nx2N。由于变换块的初始值为2Mx2M,其尺寸大于预设变换块的尺寸的最大值,因此变换块的尺寸由2Mx2M划分至MxM,划分层数由第0层变为第1层;由于预设变换块的尺寸最小值为0.25M,变换块可以继续划分,由第1层划分至第2层,其尺寸由MxM变为0.25MxM,由于变换块的宽等于预设变换块的尺寸的最小值0.25M,此时变换块不再继续划分。Suppose the size of the image block is 2Mx2M, the maximum size of the preset transformation block is M, the minimum value of the preset transformation block size is 0.25M, the initial value of the size of the transformation block is equal to the size of the image block, and the transformation block allows division The number of divided layers is 4, and the image block division method is Nx2N. Since the initial value of the transformation block is 2Mx2M, its size is larger than the maximum size of the preset transformation block, so the size of the transformation block is divided from 2Mx2M to MxM, and the number of division layers is changed from layer 0 to layer 1; due to the preset transformation The minimum size of the block is 0.25M, and the transformation block can continue to be divided from the first layer to the second layer, and its size changes from MxM to 0.25MxM, because the width of the transformation block is equal to the minimum value of the size of the preset transformation block 0.25 M, at this time, the transform block is no longer divided.
图6为本发明实施例三提供的变换块划分方法流程示意图。具体地,如图6所示,本实施例方法可包括以下步骤:FIG. 6 is a schematic flowchart of a transform block division method provided by Embodiment 3 of the present invention. Specifically, as shown in Figure 6, the method of this embodiment may include the following steps:
步骤301、获取图像块的尺寸、图像块的划分方式以及预设变换块的尺寸的最大值,所述图像块的尺寸为图像块的宽和高的平均值,所述预设变换块的尺寸的最大值为变换块的宽或高的最大值,或者为变换块的宽和高之和的平均值;Step 301, obtain the maximum value of the size of the image block, the division method of the image block, and the size of the preset transformation block, the size of the image block is the average value of the width and height of the image block, and the size of the preset transformation block The maximum value of is the maximum value of the width or height of the transform block, or the average value of the sum of the width and height of the transform block;
步骤302、根据图像块的尺寸,以及预设变换块的尺寸的最大值,获得第一参数,所述第一参数用于表示所述图像块对应的最大变换块的尺寸,所述变换块的尺寸为变换块的宽和高的平均值;Step 302: Obtain a first parameter according to the size of the image block and the maximum value of the size of the preset transformation block, the first parameter is used to represent the size of the largest transformation block corresponding to the image block, and the size of the transformation block The size is the average of the width and height of the transformed block;
步骤303、根据图像块的划分方式、所述第一参数以及所述预设变换块的尺寸的最小值,获得第二参数,所述第二参数用于表示所述图像块对应的最小变换块的尺寸是否大于所述预设变换块的尺寸的最小值;Step 303: Obtain a second parameter according to the division method of the image block, the first parameter, and the minimum size of the preset transform block, and the second parameter is used to represent the smallest transform block corresponding to the image block Whether the size of is greater than the minimum value of the size of the preset transform block;
步骤304、根据所述第二参数,判断是否对所述变换块进行非方形划分,是,则执行步骤306,否则,执行步骤305;Step 304, according to the second parameter, judge whether to perform non-square division on the transform block, if yes, execute step 306, otherwise, execute step 305;
步骤305、采用方形划分方式对该变换块进行划分,直到变换块的尺寸等于预设变换块的最小尺寸时,停止划分,结束;Step 305: Divide the transformation block by using a square division method until the size of the transformation block is equal to the minimum size of the preset transformation block, stop dividing, and end;
步骤306、对该变换块进行非方形划分,判断划分后的变换块的宽或高其中之一是否等于预设变换块的尺寸的最小值,是则停止对变换块的划分,结束,否则,继续执行步骤304,直到划分后的变换块的宽或高其中之一等于预设变换块的尺寸的最小值。Step 306: Perform non-square division on the transform block, and judge whether one of the width or height of the divided transform block is equal to the minimum size of the preset transform block, if yes, stop dividing the transform block, and end, otherwise, Continue to execute step 304 until one of the width or height of the divided transform block is equal to the minimum size of the preset transform block.
本实施例中,上述步骤302中,根据图像块的尺寸,以及预设变换块的尺寸的最大值,获得第一参数包括:当所述图像块的尺寸大于所述预设变换块的尺寸的最大值时,所述第一参数等于所述预设变换块的尺寸的最大值;当所述图像块的尺寸小于所述预设变换块的尺寸的最大值时,所述第一参数等于所述图像块的尺寸;当所述图像块的尺寸等于所述预设变换块的尺寸的最大值时,所述第一参数等于所述图像块的尺寸。In this embodiment, in the above step 302, according to the size of the image block and the maximum value of the size of the preset transformation block, obtaining the first parameter includes: when the size of the image block is larger than the size of the preset transformation block When the maximum value, the first parameter is equal to the maximum value of the size of the preset transformation block; when the size of the image block is smaller than the maximum value of the size of the preset transformation block, the first parameter is equal to the maximum value of the size of the preset transformation block The size of the image block; when the size of the image block is equal to the maximum value of the size of the preset transform block, the first parameter is equal to the size of the image block.
本实施例中,图像块的尺寸、变换块的尺寸、预设变换块的尺寸的最大值以及预设变换块的尺寸的最小值均采以2为基数的对数表示,其中,上述步骤303中,述根据图像块的划分方式、所述第一参数以及所述预设变换块的尺寸的最小值,获得第二参数包括:当所述图像块的划分方式为采用非方形划分,且所述第一参数的值大于预设变换块的尺寸的最小值加1时,将所述第二参数的值置为1,否则将所述第二参数的值置为0。In this embodiment, the size of the image block, the size of the transformation block, the maximum value of the size of the preset transformation block, and the minimum value of the size of the preset transformation block are all represented by logarithms with base 2, wherein the above step 303 In the above, according to the division method of the image block, the first parameter and the minimum value of the size of the preset transformation block, obtaining the second parameter includes: when the division method of the image block is non-square division, and the When the value of the first parameter is greater than the minimum value of the size of the preset transform block plus 1, the value of the second parameter is set to 1; otherwise, the value of the second parameter is set to 0.
本实施例中,上述步骤304中,根据所述第二参数,判断是否对所述变换块进行非方形划分包括:当所述第二参数的值为1时,判断对所述变换块采用非方形划分,否则,对所述变换块采用方形划分;其中,所述方形划分是指将图像块或变换块划分成宽和高不等的划分方法。In this embodiment, in the above step 304, according to the second parameter, judging whether to perform non-square division on the transform block includes: when the value of the second parameter is 1, judging whether to use a non-square partition on the transform block Square division, otherwise, adopt square division for the transformation block; wherein, the square division refers to a division method of dividing the image block or the transformation block into different widths and heights.
下面以对尺寸为32x32的图像块的变换块的尺寸划分过程为例,本发明实施例的原理和实现做更详细的说明。The principle and implementation of the embodiment of the present invention will be described in more detail below by taking the process of dividing the size of a transform block of an image block with a size of 32x32 as an example.
设图像块的尺寸为32x32,图像块的划分方式为垂直划分方式,即图像块划分方式为Nx2N、nLNx2N、nRx2N其中一种,预设变换块的尺寸的最大值为32,预设变换块的尺寸的最小值为4,预设变换块允许的划分层数为4层。其中,图像块的尺寸、变换块的尺寸、预设变换块的尺寸的最大值和最小值均采用以2为基数的对数表示,具体地,图像块的尺寸以log2CbSize表示,图像块的尺寸与log2CbSize的关系可表示为:图像块的尺寸=1<<log2CbSize;变换块的宽和高使用参数log2TrafoHeight和log2TrafoWidth表示,变换块的高与log2TrafoHeight的关系可表示为:变换块的高=1<<log2TrafoHeight;变换块的宽与log2TrafoWidth的关系可表示为:变换块的宽=1<<log2TrafoWidth;预设变换块的尺寸的最大值以Log2MaxTrafoSize表示,变换块的尺寸的最大值与Log2MaxTrafoSize的关系可表示为:变换块的尺寸的最大值=1<<Log2MaxTrafoSize;预设变换块的尺寸的最小值以Log2MinTrafoSize表示,变换块的尺寸的最小值与Log2MinTrafoSize的关系可表示为:变换块的尺寸的最小值=1<<Log2MinTrafoSize,因此,本实例中,log2CbSize、log2TrafoHeight和log2TrafoWidth的初始值均为5,Log2MaxTrafoSize=5,Log2MinTrafoSize=2。Suppose the size of the image block is 32x32, the division method of the image block is the vertical division method, that is, the division method of the image block is one of Nx2N, nLNx2N, nRx2N, the maximum size of the preset transformation block is 32, and the preset transformation block The minimum value of the size is 4, and the number of division layers allowed by the preset transform block is 4 layers. Among them, the size of the image block, the size of the transformation block, and the maximum and minimum values of the size of the preset transformation block are expressed by logarithms with base 2. Specifically, the size of the image block is expressed by log2CbSize, and the size of the image block The relationship with log2CbSize can be expressed as: the size of the image block=1<<log2CbSize; the width and height of the transformation block are represented by the parameters log2TrafoHeight and log2TrafoWidth, and the relationship between the height of the transformation block and log2TrafoHeight can be expressed as: the height of the transformation block=1< <log2TrafoHeight; the relationship between the width of the transformation block and log2TrafoWidth can be expressed as: the width of the transformation block=1<<log2TrafoWidth; the maximum value of the size of the preset transformation block is represented by Log2MaxTrafoSize, and the relationship between the maximum size of the transformation block and Log2MaxTrafoSize can be It is expressed as: the maximum value of the size of the transformation block=1<<Log2MaxTrafoSize; the minimum value of the size of the preset transformation block is represented by Log2MinTrafoSize, and the relationship between the minimum value of the size of the transformation block and Log2MinTrafoSize can be expressed as: the minimum size of the transformation block Value=1<<Log2MinTrafoSize, therefore, in this example, the initial values of log2CbSize, log2TrafoHeight and log2TrafoWidth are all 5, Log2MaxTrafoSize=5, Log2MinTrafoSize=2.
此外,变换块的尺寸也可以log2TrafoSize表示,用来表示变换块的宽和高的平均值,因此,log2TrafoSize与log2TrafoHeight和log2TrafoWidth的关系可表示为:log2TrafoSize=(log2TrafoHeight+log2TrafoHeight)>>1,即log2TrafoSize为log2TrafoHeight和log2TrafoWidth的平均值。In addition, the size of the transformation block can also be represented by log2TrafoSize, which is used to represent the average width and height of the transformation block. Therefore, the relationship between log2TrafoSize, log2TrafoHeight and log2TrafoWidth can be expressed as: log2TrafoSize=(log2TrafoHeight+log2TrafoHeight)>>1, that is, log2TrafoSize It is the average of log2TrafoHeight and log2TrafoWidth.
本实例各尺寸以指数表示的运算操作中,"<<"代表向左移位操作,1<<log2TrafoHeight等价于2log2TrafoHeight操作;1<<log2TrafoWidth等价于2log2TrafoWidth操作;1<<log2TrafoSize等价于2log2TrafoSize操作;">>"代表向右移位操作,(log2TrafoHeight+log2TrafoHeight)>>1等价于(log2TrafoHeight+log2TrafoHeight)/2操作。In the calculation operation of each size expressed by the index in this example, "<<" represents the left shift operation, 1<<log2TrafoHeight is equivalent to 2log2TrafoHeight operation; 1<<log2TrafoWidth is equivalent to 2log2TrafoWidth operation; 1<<log2TrafoSize is equivalent to 2log2TrafoSize operation; ">>" represents a right shift operation, (log2TrafoHeight+log2TrafoHeight)>>1 is equivalent to (log2TrafoHeight+log2TrafoHeight)/2 operation.
本实例中,当变换块被划分成更小的子变换块时,变换块尺寸的变化可通过对参数log2TrafoHeight、log2TrafoWidth和log2TrafoSize数值的加减得以体现。例如,当前变换块的尺寸为16x16时,log2TrafoHeight的值为4,log2TrafoWidth的值为4,log2TrafoSize的值为4,当变换块划分成16x4的子变换块时,划分后的变换块的尺寸变为16x4,此时log2TrafoWidth的值不变仍为4,log2TrafoHeight的值变为2,log2TrafoSize的值变为3。In this example, when the transform block is divided into smaller sub-transform blocks, the change of the transform block size can be reflected by adding or subtracting the values of the parameters log2TrafoHeight, log2TrafoWidth and log2TrafoSize. For example, when the size of the current transformation block is 16x16, the value of log2TrafoHeight is 4, the value of log2TrafoWidth is 4, and the value of log2TrafoSize is 4. When the transformation block is divided into 16x4 sub-transformation blocks, the size of the divided transformation block becomes 16x4, at this time, the value of log2TrafoWidth remains unchanged at 4, the value of log2TrafoHeight becomes 2, and the value of log2TrafoSize becomes 3.
本实例中,变换块的划分采用一分为四的方式进行划分,当变换块采用非方形划分时,划分后的变换块的一边的长度就会为另一边长度的4倍,因此,当对变换块进行非方形划分时,划分后的变换块的宽大于高时,就会存在以下关系:log2TrafoWidth=log2TrafoHeight+2,当划分后的变换块的宽小于高时,log2TrafoHeight=log2TrafoWidth+2。In this example, the division of the transformation block is divided into four. When the transformation block is divided into non-square, the length of one side of the divided transformation block will be four times the length of the other side. Therefore, when the When the transformation block is divided into non-square, when the width of the divided transformation block is greater than the height, the following relationship will exist: log2TrafoWidth=log2TrafoHeight+2, when the width of the divided transformation block is smaller than the height, log2TrafoHeight=log2TrafoWidth+2.
由于变换块的尺寸以指数形式表示时,变换块的尺寸log2TrafoSize为宽(log2TrafoWidth)和高(log2TrafoHeight)的平均值,即log2TrafoSize=(log2TrafoHeight+log2TrafoHeight)>>1。因此,当变换块的宽或高等于预设变换块的尺寸的最小值时,log2TrafoSize=Log2MinTrafoSize+1。Since the size of the transformation block is expressed in exponential form, the size of the transformation block log2TrafoSize is the average value of the width (log2TrafoWidth) and height (log2TrafoHeight), that is, log2TrafoSize=(log2TrafoHeight+log2TrafoHeight)>>1. Therefore, when the width or height of the transform block is equal to the minimum size of the preset transform block, log2TrafoSize=Log2MinTrafoSize+1.
因此,在图像编解码过程中,对变换块进行非方形划分,且log2TrafoSize的值等于Log2MinTrafoSize+1时,就会停止对变换块的划分;而在图像的编解码过程中,有可能对变换块进行方形划分,而在方形划分时,log2TrafoSize的值需要等于Log2MinTrafoSize时,变换块才会停止划分,因此在编码和解码过程中可引入变量Log2MinTrafoSizePlus1来判断变换块是否采用非方形划分,当Log2MinTrafoSizePlus1等于1时,变换块可允许采用非方形划分,在编解码系统中,对变换块是否进行非方形划分有限定,例如,变换块尺寸为一定尺寸,例如8x8时,且变换块的最小尺寸为4时,就不能再进行非方形变换,因此,在满足该限定情况下,需要对变换块做进一步划分时,可采用非方形划分;Log2MinTrafoSizePlus1等于0时,变换不允许采用非方形划分,而采用方形划分,且无论变换块是采用非方形划分还是采用方形划分,都在log2TrafoSize=Log2MinTrafoSize+Log2MinTrafoSizePlus1时,变换块才停止划分。其中,所述的Log2MinTrafoSizePlus1就为上述的第二参数。Therefore, in the process of image encoding and decoding, when the transformation block is divided into non-square, and the value of log2TrafoSize is equal to Log2MinTrafoSize+1, the division of the transformation block will be stopped; and in the process of image encoding and decoding, it is possible to divide the transformation block Carry out square division, and in the square division, the value of log2TrafoSize needs to be equal to Log2MinTrafoSize, the transformation block will stop dividing, so the variable Log2MinTrafoSizePlus1 can be introduced in the process of encoding and decoding to determine whether the transformation block adopts non-square division, when Log2MinTrafoSizePlus1 is equal to 1 When , the transformation block can be divided into non-square parts. In the codec system, there are restrictions on whether the transformation block can be divided into non-square parts. For example, when the size of the transformation block is a certain size, such as 8x8, and the minimum size of the transformation block is 4 , then non-square transformation can no longer be performed. Therefore, when the limit is satisfied, when the transformation block needs to be further divided, non-square division can be used; when Log2MinTrafoSizePlus1 is equal to 0, non-square division is not allowed for transformation, and square division is used. , and no matter whether the transform block is divided into non-square or square, the transform block will stop dividing when log2TrafoSize=Log2MinTrafoSize+Log2MinTrafoSizePlus1. Wherein, the Log2MinTrafoSizePlus1 is the above-mentioned second parameter.
本实例中,在对变换块进行划分时,变换块的宽或高至少为预设变换块的尺寸的最小值的4倍时,才停止对变换块进行划分。而在图像块的编解码过程中,还会预先设置变换块的尺寸的最大值,因此,当变换块的尺寸大于预设变换块的尺寸的最大值时,变换块就需要进行划分,被划分成尺寸更小的变换块。In this example, when the transform block is divided, the transform block will not be divided until the width or height of the transform block is at least 4 times the minimum size of the preset transform block. In the encoding and decoding process of the image block, the maximum value of the size of the transformation block is also preset. Therefore, when the size of the transformation block is larger than the maximum size of the preset transformation block, the transformation block needs to be divided. into smaller transformed blocks.
由于图像块采用的变换块最大尺寸为等于图像块的尺寸,因此,在确定变换块是否采用非方形划分前,还需要确定图像块对应的变换块的最大尺寸,即确定采用非方形划分的变换块初始的划分尺寸。设变换块初始的划分尺寸为Log2MaxTrafoSizeInCu,由于变换块的初始值等于图像块的尺寸log2CbSize,因此当log2CbSize大于预设变换块的尺寸的最大值Log2MaxTrafoSize时,Log2MaxTrafoSizeInCu的值等于Log2MaxTrafoSize;否则,log2CbSize等于或小于预设变换块的尺寸的最大值Log2MaxTrafoSize时,Log2MaxTrafoSizeInCu的值等于log2CbSize,用数学形式可表示如下:Since the maximum size of the transformation block used by the image block is equal to the size of the image block, before determining whether the transformation block adopts non-square division, it is also necessary to determine the maximum size of the transformation block corresponding to the image block, that is, to determine the transformation using non-square division The initial division size of the block. Let the initial division size of the transformation block be Log2MaxTrafoSizeInCu, since the initial value of the transformation block is equal to the size log2CbSize of the image block, when log2CbSize is greater than the maximum value Log2MaxTrafoSize of the preset transformation block, the value of Log2MaxTrafoSizeInCu is equal to Log2MaxTrafoSize; otherwise, log2CbSize is equal to or When it is smaller than the maximum value Log2MaxTrafoSize of the size of the preset transformation block, the value of Log2MaxTrafoSizeInCu is equal to log2CbSize, which can be expressed in mathematical form as follows:
Log2MaxTrafoSizeInCu=log2CbSize>Log2MaxTrafoSize?Log2MaxTrafoSize:log2CbSize。Log2MaxTrafoSizeInCu=log2CbSize>Log2MaxTrafoSize? Log2MaxTrafoSize:log2CbSize.
由此可知变换块的初始尺寸至少为预设变换块的尺寸的最小值的4倍可表示为Log2MaxTrafoSizeInCu>(Log2MinTrafoSize+1),即Log2MaxTrafoSizeInCu的值至少为(Log2MinTrafoSize+1),由于Log2MaxTrafoSizeInCu、Log2MinTrafoSize等参数均以指数形式表示,可知此时变换块的初始尺寸至少为预设变换块的尺寸的最小值的4倍。It can be seen that the initial size of the transformation block is at least 4 times the minimum size of the preset transformation block, which can be expressed as Log2MaxTrafoSizeInCu>(Log2MinTrafoSize+1), that is, the value of Log2MaxTrafoSizeInCu is at least (Log2MinTrafoSize+1), because Log2MaxTrafoSizeInCu, Log2MinTrafoSize, etc. The parameters are all expressed in exponential form, it can be seen that the initial size of the transformation block at this time is at least 4 times the minimum value of the size of the preset transformation block.
由于变换块采用非方形划分的前提条件是图像块采用了水平划分方式或垂直划分方式。在本发明中除了可以使用水平划分方式(2NxN,2NxnU,2NxnD)和垂直划分方式(Nx2N,nLx2N,nRx2N)还可以使用2Nx2N和NxN的方形划分方式,因此设PART2Nx2N、PART NxN分别代表图像块采用2Nx2N和NxN划分方式,以下条件满足时变换块采用非方形划分(即Log2MaxTrafoSizeInCu的值为1),否则变换块不采用非方形划分(即Log2MaxTrafoSizeInCu的值为0):The precondition for the non-square division of the transform block is that the image block adopts a horizontal division mode or a vertical division mode. In the present invention, in addition to the horizontal division method (2NxN, 2NxnU, 2NxnD) and the vertical division method (Nx2N, nLx2N, nRx2N), the square division method of 2Nx2N and NxN can also be used, so let PART2Nx2N and PART NxN represent the image block respectively. 2Nx2N and NxN division methods, when the following conditions are met, the transformation block adopts non-square division (that is, the value of Log2MaxTrafoSizeInCu is 1), otherwise the transformation block does not adopt non-square division (that is, the value of Log2MaxTrafoSizeInCu is 0):
if(nsrqt_enabled_flag&&Log2MaxTrafoSizeInCu>(Log2MinTrafoSize+1)&&PartMode!=PART_2NX2N&&PartMode!=PART_NXN)if(nsrqt_enabled_flag&&Log2MaxTrafoSizeInCu>(Log2MinTrafoSize+1)&&PartMode!=PART_2NX2N&&PartMode!=PART_NXN)
其中nsrqt enabled flag为允许编解码过程中使用非方形划分的标志位。Among them, nsrqt enabled flag is a flag bit that allows the use of non-square division in the process of encoding and decoding.
当变换块的尺寸大于预设变换块的尺寸的最小值的4倍时(即log2TrafoSize>(Log2MinTrafoSize+Log2MinTrafoSizePlus1)),图像编码端需写入变换块划分参数,解码端需解析变换块的划分参数;否则(即log2TrafoSize==(Log2MinTrafoSize+Log2MinTrafoSizePlus1))编码端不写入变换块的划分参数,解码端不解码变换块的划分参数。编码端和解码端对变换块划分参数的编码和解码将在后面实施例进行详细说明。When the size of the transformation block is greater than 4 times the minimum size of the preset transformation block (ie log2TrafoSize>(Log2MinTrafoSize+Log2MinTrafoSizePlus1)), the image encoding end needs to write the transformation block division parameters, and the decoding end needs to analyze the transformation block division parameters ; Otherwise (ie log2TrafoSize==(Log2MinTrafoSize+Log2MinTrafoSizePlus1)) the encoder does not write the division parameters of the transformation block, and the decoder does not decode the division parameters of the transformation block. The encoding and decoding of the transformation block division parameters by the encoding end and the decoding end will be described in detail in the following embodiments.
通过该实例可以看出,通过第二参数,就可以确定变换块是否采用方形划分,并确定划分后的变换块的尺寸。本领域技术人员可以理解,第二参数是为便于图像编码而采用的一个中间变量,实际应用中可根据需要获得该第二参数,并不限于上述所述的第二参数的获取方法。It can be seen from this example that, through the second parameter, it can be determined whether the transform block is divided into squares, and the size of the divided transform block can be determined. Those skilled in the art can understand that the second parameter is an intermediate variable used to facilitate image coding, and the second parameter can be obtained as required in practical applications, and is not limited to the method for obtaining the second parameter described above.
上述本发明实施例中,对变换块的划分是指对图像块的亮度块的划分,实际应用中,图像块中的色度块为亮度块的一半,因此,在对图像块中的色度块进行划分时,还包括以下步骤:In the above-mentioned embodiments of the present invention, the division of the transformation block refers to the division of the brightness block of the image block. In practical applications, the chrominance block in the image block is half of the brightness block. Therefore, the chrominance block in the image block When the block is divided, the following steps are also included:
获取图像块对应的色度块的最大变换块的尺寸;Obtain the size of the largest transform block of the chrominance block corresponding to the image block;
判断的变换块中色度块对应的变换块的尺寸是否超过所述图像块对应的色度块的最大变换块的尺寸,是则将所述划分后的变换块中色度块对应的变换尺寸重置为所述图像块对应的色度块的最大变换块的尺寸。Whether the size of the transform block corresponding to the chroma block in the determined transform block exceeds the size of the largest transform block of the chroma block corresponding to the image block, and if so, the transform size corresponding to the chroma block in the divided transform block Reset to the largest transform block size of the chroma block corresponding to the image block.
本领域技术人员可以理解,上述的图像块对应色度块的最大变换块的尺寸,就是图像块对应的最大变换块是图像块所允许使用的尺寸最大的变换块的尺寸的一半,当图像块的尺寸小于或等于预设变换块的尺寸的最大值时,图像块对应的最大变换块的尺寸就为图像块的尺寸,反之,其就等于预设变换块的尺寸的最大值。Those skilled in the art can understand that the size of the largest transform block corresponding to the chrominance block of the above-mentioned image block means that the largest transform block corresponding to the image block is half the size of the largest transform block allowed to be used by the image block. When the size of is less than or equal to the maximum size of the preset transform block, the size of the largest transform block corresponding to the image block is the size of the image block, otherwise, it is equal to the maximum size of the preset transform block.
为便于对色度块划分进行说明,下面以视频编解码系统中4:2:0格式的视频的编解码过程中,色度块的划分进行说明。其中,所述的4:2:0格式是指视频中色度分量的尺寸是亮度分量的一半,例如若视频的尺寸为416x240,则一幅图像中亮度的尺寸为416x240,色度的尺寸为208x120。由于视频图像均是以块为单位进行编码,因此在4:2:0格式编码时色度块的尺寸始终为亮度块尺寸的一半,例如亮度块的尺寸为32x32,色度块的尺寸为16x16。在上述的变换块编解码过程中,色度的变换块尺寸和亮度的变换块尺寸遵循同样的关系,如当亮度的变换块尺寸为8x8时,色度的变换块尺寸为4x4。To facilitate the description of the division of chrominance blocks, the division of chrominance blocks during the encoding and decoding process of video in 4:2:0 format in the video encoding and decoding system will be described below. Wherein, the 4:2:0 format means that the size of the chrominance component in the video is half of the brightness component. For example, if the size of the video is 416x240, the size of the brightness in an image is 416x240, and the size of the chrominance is 208x120. Since video images are encoded in units of blocks, the size of a chroma block is always half the size of a luma block when encoding in the 4:2:0 format, for example, the size of a luma block is 32x32, and the size of a chroma block is 16x16 . In the above transform block encoding and decoding process, the transform block size of chroma and the transform block size of luma follow the same relationship, for example, when the transform block size of luma is 8x8, the transform block size of chroma is 4x4.
由于在编解码系统中通常会预设变换块的尺寸的最小值,如预设变换块的尺寸的最小值为4,因此当色度的变换块尺寸根据亮度的变换块尺寸减半时有可能会导致色度的变换块尺寸小于预设变换块的尺寸的最小值,例如当亮度的变换块尺寸为4x4时,色度的变换块尺寸为2x2,此时色度的变换块尺寸已经小于预设变换块的尺寸的最小值4。在这种情况下,需要对色度的变换块尺寸进行重置,将色度的变换块尺寸重置为与亮度的变换块尺寸一致,即将其尺寸重置为4x4。Since the minimum value of the size of the transform block is usually preset in the codec system, for example, the minimum value of the size of the preset transform block is 4, so when the size of the transform block of the chroma is halved according to the size of the transform block of the luma, it is possible It will cause the size of the chroma transformation block to be smaller than the minimum size of the preset transformation block. For example, when the size of the luma transformation block is 4x4, the size of the chroma transformation block is 2x2. At this time, the size of the chroma transformation block is already smaller than the preset size. Let the minimum value of the transform block size be 4. In this case, it is necessary to reset the size of the transform block of the chroma, and reset the size of the transform block of the chroma to be consistent with the size of the transform block of the luma, that is, reset the size to 4x4.
当变换块采用非方形划分时,会再增加几种额外的情况。设预设变换块的尺寸的最小值为4。可知当变换块采用非方形划分时,其所对应的最小的变换块尺寸为16x4或4x16。当亮度的变换块尺寸为16x4或4x16时,色度的变换块尺寸为8x2或2x8,此时需要对色度的变换块尺寸进行重置。但重置过程还需要考虑当前图像块中色度块所允许使用的变换块尺寸。When the transformation block adopts non-square division, several additional cases will be added. Let the minimum value of the size of the default transform block be 4. It can be seen that when the transform block is divided into non-square, the corresponding minimum transform block size is 16x4 or 4x16. When the size of the luma transform block is 16x4 or 4x16, and the size of the chroma transform block is 8x2 or 2x8, the size of the chroma transform block needs to be reset. However, the resetting process also needs to consider the transform block size allowed by the chroma block in the current image block.
具体的,当图像块尺寸为32x32时,且预设的最大的变换块尺寸为32x32,图像块采用水平划分方式。此时,亮度块可采用的最大的变换块尺寸为32,其所对应的变化块可从32x32划分至16x16再进一步划分至16x4。色度块可采用的最大的变换块尺寸为16,由于色度的变换块尺寸始终按亮度的变换块尺寸减半,因此其所对应的变化块可从16x16划分至16x4再进一步划分至8x2。由于8x2已经小于预设变换块的尺寸的最小值,需要将其变换块尺寸进行重置。由于色度块可采用的最大的变换块尺寸为16,此时可将色度的变换块尺寸重置为16x4。Specifically, when the image block size is 32x32, and the preset maximum transform block size is 32x32, the image block is divided horizontally. At this time, the maximum transform block size that can be used by the luma block is 32, and the corresponding transform block can be divided from 32x32 to 16x16 and further divided to 16x4. The maximum transform block size that can be used by a chroma block is 16. Since the transform block size of chroma is always halved by the size of luma transform block, the corresponding transform block can be divided from 16x16 to 16x4 and further divided to 8x2. Since 8x2 is already smaller than the minimum size of the preset transform block, the size of the transform block needs to be reset. Since the maximum transform block size that can be used by the chroma block is 16, the transform block size of the chroma can be reset to 16x4 at this time.
当图像块尺寸为16x16时,且预设的最大的变换块尺寸为32x32,图像块采用水平划分方式。此时,亮度块可采用的最大的变换块尺寸为16,其所对应的变化块可从16x16划分至16x4。色度块可采用的最大的变换块尺寸为8,由于色度的变换块尺寸始终按亮度的变换块尺寸减半,因此其所对应的变化块可从8x8划分至8x2。由于8x2已经小于预设变换块的尺寸的最小值,需要将其变换块尺寸进行重置。由于色度块可采用的最大的变换块尺寸为8,此时没法将色度的变换块尺寸重置为16x4,因此只能将色度块的尺寸重置为8x8。When the image block size is 16x16, and the preset maximum transform block size is 32x32, the image block is divided horizontally. At this time, the maximum transform block size that can be used by the luma block is 16, and the corresponding transform block can be divided from 16x16 to 16x4. The maximum transform block size that can be used by a chroma block is 8. Since the size of a chroma transform block is always halved by the size of a luma transform block, the corresponding transform block can be divided from 8x8 to 8x2. Since 8x2 is already smaller than the minimum size of the preset transform block, the size of the transform block needs to be reset. Since the maximum transform block size that can be used by the chroma block is 8, the size of the transform block of the chroma cannot be reset to 16x4 at this time, so the size of the chroma block can only be reset to 8x8.
综上所述,可知在4:2:0格式编码的情况下,若变换块采用非方形划分方式,色度的变换块尺寸存在以下额外的判断步骤:判断变换块的尺寸是否已经达到最小的变换块尺寸;若变换块的尺寸已经达到最小的变换块尺寸,获得当前图像块对应的最大的变换块尺寸;根据色度块的变换块尺寸判断其尺寸是否会超过当前图像块对应的最大的变换块尺寸,若超过则将其尺寸重置为预设的值。To sum up, it can be seen that in the case of 4:2:0 format encoding, if the transformation block adopts a non-square division method, the following additional judgment steps exist for the size of the transformation block of chroma: determine whether the size of the transformation block has reached the minimum Transform block size; if the size of the transform block has reached the minimum transform block size, obtain the maximum transform block size corresponding to the current image block; judge whether its size will exceed the maximum corresponding to the current image block according to the transform block size of the chroma block Transform the block size, if it exceeds, reset its size to the preset value.
本实施例中,鉴于变换块划分时,只要变换块的宽或高其中之一等于预设变换块的尺寸的最小值,就停止对变换块的划分,在视频编解码系统中,可根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,对变换块的划分参数进行编码或解码。下面将以不同的实施例分别加以说明。In this embodiment, when the transform block is divided, as long as one of the width or height of the transform block is equal to the minimum value of the size of the preset transform block, the division of the transform block is stopped. In the video codec system, according to the transform The relationship between the size of the block and the minimum value of the size of the preset transform block encodes or decodes the division parameters of the transform block. Different embodiments will be described below.
图7为本发明实施例四提供的变换块划分参数的编码方法流程示意图。本实施例可在视频编解码系统中的编码端,对变换块的划分参数进行编码,具体地,如图7所示,本实施例可包括以下步骤:FIG. 7 is a schematic flowchart of a method for encoding transformation block division parameters provided by Embodiment 4 of the present invention. This embodiment can encode the division parameters of the transform block at the encoding end in the video codec system. Specifically, as shown in FIG. 7, this embodiment can include the following steps:
步骤401、获取预设变换块的尺寸的最小值;Step 401. Obtain the minimum value of the size of the preset transformation block;
步骤402、根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否编码变换块的划分参数;Step 402, according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block, determine whether to encode the division parameters of the transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
本实施例中,上述步骤402具体可包括:当变换块采用非方形划分,且所述变换块的宽或高等于所述预设变换块的尺寸的最小值时,判断不需要编码变换块的划分参数,否则,编码变换块的划分参数。In this embodiment, the above-mentioned step 402 may specifically include: when the transformation block adopts non-square division, and the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, judging that the transformation block does not need to be coded partition parameter, otherwise, the partition parameter of the coded transform block.
本实施例中,上述步骤402也可包括:根据第二参数,判断是否编码变换块的划分参数,其中,所述第二参数用于表示图像块对应的最小变换块的尺寸是否大于所述预设变换块的尺寸的最小值。In this embodiment, the above step 402 may also include: judging whether to encode the division parameter of the transformation block according to the second parameter, wherein the second parameter is used to indicate whether the size of the smallest transformation block corresponding to the image block is larger than the predetermined Sets the minimum size of the transform block.
其中,第二参数可通过以下步骤获得:Among them, the second parameter can be obtained through the following steps:
获取图像块的尺寸、图像块的划分方式以及预设变换块的尺寸的最大值;Obtain the size of the image block, the division method of the image block, and the maximum value of the size of the preset transformation block;
根据图像块的尺寸,以及预设变换块的尺寸的最大值,获得第一参数,所述第一参数用于表示所述图像块对应的最大变换块的尺寸;According to the size of the image block and the maximum value of the size of the preset transformation block, a first parameter is obtained, and the first parameter is used to indicate the size of the largest transformation block corresponding to the image block;
根据图像块的划分方式、所述第一参数以及所述预设变换块的尺寸的最小值,获得第二参数。The second parameter is obtained according to the division manner of the image block, the first parameter, and the minimum value of the size of the preset transformation block.
本实施例中,根据第二参数,判断是否编码变换块的划分参数包括:In this embodiment, according to the second parameter, the division parameters for judging whether to encode and transform the block include:
当所述变换块的尺寸大于预设变换块的尺寸的最小值加所述第二参数时,编码变换块的划分参数,否则,不需要编码变换块的划分参数。When the size of the transformation block is greater than the minimum value of the size of the preset transformation block plus the second parameter, the division parameter of the transformation block is encoded; otherwise, the division parameter of the transformation block does not need to be encoded.
本实施例中第二参数以及第一参数的获取与上述本发明变换块划分方法实施例中的相同,在此不再赘述。The acquisition of the second parameter and the first parameter in this embodiment is the same as that in the embodiment of the transformation block division method of the present invention described above, and will not be repeated here.
在编解码系统中,通常会设置有变换块可划分的划分层数的最大值,即预设划分层数,因此,在对变换块的划分参数进行编码时,还可包括以下步骤:获取变换块允许划分的预设划分层数;当变换块的划分层数等于所述预设划分层数时,判断不需要编码变换块的划分参数。在变换块编码过程中,只要变换块的尺寸或划分层数任一条件满足上述要求时,即不需要再对变换块的划分参数进行编码,即变换块不需要划分参数,表示变换块不需要划分。In the codec system, the maximum value of the number of division layers that can be divided by the transformation block is usually set, that is, the preset number of division layers. Therefore, when encoding the division parameters of the transformation block, the following steps may also be included: obtaining the transformation The preset number of division layers allowed for the block to be divided; when the number of division layers of the transform block is equal to the preset number of division layers, it is determined that the division parameters of the transform block do not need to be coded. In the process of transform block encoding, as long as any condition of the size of the transform block or the number of division layers meets the above requirements, it is not necessary to encode the division parameters of the transformation block, that is, the transformation block does not need division parameters, which means that the transformation block does not need divided.
相应地,本发明实施例还提供一种变换块划分参数的解码方法。Correspondingly, the embodiment of the present invention also provides a decoding method of transform block division parameters.
图8为本发明实施例五提供的变换块划分参数的解码方法的流程示意图。如图8所示,本实施例变换块的解码方法可包括以下步骤:FIG. 8 is a schematic flowchart of a decoding method for transform block division parameters provided by Embodiment 5 of the present invention. As shown in FIG. 8, the decoding method of the transform block in this embodiment may include the following steps:
步骤501、获取预设变换块的尺寸的最小值;Step 501. Obtain the minimum value of the size of a preset transform block;
步骤502、根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否解码变换块的划分参数;Step 502, according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block, determine whether to decode the division parameter of the transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
本实施例解码方法实际上是与上述编码方法对应的过程,具体地,上述步骤502中,根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否解码变换块的划分参数可包括:The decoding method in this embodiment is actually a process corresponding to the above encoding method. Specifically, in the above step 502, it is judged whether to decode the transform according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block. Block partitioning parameters can include:
当变换块采用非方形变换,且所述变换块的宽或高等于预设的变换块的尺寸的最小值时,判断不需要解码变换块的划分参数,否则,解码变换块的划分参数。When the transformation block adopts non-square transformation, and the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, it is judged that the division parameter of the transformation block does not need to be decoded; otherwise, the division parameter of the transformation block is decoded.
此外,实际解码过程中,上述步骤502具体可包括:根据第二参数,判断是否解码变换块的划分参数,所述第二参数用于表示图像块对应的最小变换块的尺寸是否大于所述预设变换块的尺寸的最小值。In addition, in the actual decoding process, the above step 502 may specifically include: judging whether to decode the division parameter of the transformation block according to the second parameter, the second parameter is used to indicate whether the size of the smallest transformation block corresponding to the image block is larger than the predetermined Sets the minimum size of the transform block.
上述的第二参数可通过以下步骤获得:获取图像块的尺寸、图像块的划分方式以及预设变换块的尺寸的最大值;根据图像块的尺寸,以及预设变换块的尺寸的最大值,获得第一参数,所述第一参数用于表示所述图像块对应的最大变换块的尺寸;根据图像块的划分方式、所述第一参数以及所述预设变换块的尺寸的最小值,获得第二参数。所述根据第二参数,判断是否解码变换块的划分参数包括:当所述变换块的尺寸大于预设变换块的尺寸的最小值加所述第二参数时,解码变换块的划分参数。The above-mentioned second parameter can be obtained through the following steps: obtain the size of the image block, the division method of the image block, and the maximum value of the size of the preset transformation block; according to the size of the image block and the maximum value of the size of the preset transformation block, Obtain a first parameter, the first parameter is used to represent the size of the largest transform block corresponding to the image block; according to the division method of the image block, the first parameter and the minimum value of the size of the preset transform block, Get the second parameter. The judging whether to decode the division parameter of the transform block according to the second parameter includes: decoding the division parameter of the transform block when the size of the transform block is greater than the minimum value of the size of the preset transform block plus the second parameter.
此外,本实施例解码方法还可包括:In addition, the decoding method of this embodiment may also include:
获取变换块允许划分的预设划分层数;Obtain the preset number of division layers allowed for the transformation block;
当变换块的划分层数等于所述预设划分层数时,判断不需要解码变换块的划分参数。When the number of division layers of the transform block is equal to the preset number of division layers, it is determined that the division parameters of the transform block do not need to be decoded.
在解码过程中,当变换块的划分层数已达到预设划分层数时,即可停止对变换块划分参数的解码。During the decoding process, when the number of division layers of the transform block has reached the preset number of division layers, the decoding of the division parameters of the transform block can be stopped.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.
图9为本发明实施例六提供的变换块划分装置结构示意图。如图9所示,本实施例变换块划分装置可包括:FIG. 9 is a schematic structural diagram of an apparatus for dividing transform blocks according to Embodiment 6 of the present invention. As shown in FIG. 9, the apparatus for dividing transform blocks in this embodiment may include:
尺寸获取模块1,用于获取预设变换块的尺寸的最小值;A size obtaining module 1, configured to obtain the minimum value of the size of the preset transformation block;
变换块划分模块2,用于对变换块的进行非方形划分时,若所述变换块的宽或高等于所述预设变换块的尺寸的最小值,则停止对所述变换块进行划分;The transformation block division module 2 is used for performing non-square division on the transformation block, if the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block, then stop dividing the transformation block;
其中,所述预设变换块的尺寸的最小值为变换块的宽或高的最小值,或者宽和高之和的平均值的最小值;所述非方形划分是指将图像块或变换块划分成宽和高不等的划分方法。Wherein, the minimum value of the size of the preset transformation block is the minimum value of the width or height of the transformation block, or the minimum value of the average value of the sum of width and height; the non-square division refers to dividing the image block or the transformation block Divide into division methods ranging in width and height.
本实施例变换块划分装置基于上述本发明变换块划分方法的步骤,实现对变换块的划分,其具体实现过程可参见上述本发明方法实施例的说明,在此不再赘述。The apparatus for dividing transform blocks in this embodiment realizes the division of transform blocks based on the steps of the method for dividing transform blocks in the present invention. For the specific implementation process, refer to the description of the method embodiments of the present invention described above, which will not be repeated here.
图10为本发明实施例七提供的变换块划分装置结构示意图。如图10所示,在上述图9所示图示基础上,本实施例还可包括:FIG. 10 is a schematic structural diagram of an apparatus for dividing transform blocks provided by Embodiment 7 of the present invention. As shown in Figure 10, on the basis of the illustration shown in Figure 9 above, this embodiment may further include:
划分判断模块3,用于判断是否对所述变换块进行非方形划分。A partition judging module 3, configured to judge whether to perform non-square partition on the transform block.
如图10所示,该划分判断模块3具体可包括:As shown in Figure 10, the division judgment module 3 may specifically include:
划分方式获取单元31,用于获取图像块的划分方式;A division method obtaining unit 31, configured to obtain the division method of the image block;
第一判断单元32,用于当图像块采用水平划分,所述变换块的宽等于变换块的高,所述变换块的宽和高之和的平均值小于或等于预设变换块的尺寸的最大值,且所述变换块的宽或高至少为所述预设变换块的尺寸的最小值的4倍时,判断对所述变换块采用非方形划分,使得划分后的变换块的宽等于划分前变换块的宽,划分后的变换块的高小于划分前变换块的高;The first judging unit 32 is configured to: when the image block is divided horizontally, the width of the transformation block is equal to the height of the transformation block, and the average value of the sum of the width and height of the transformation block is less than or equal to the size of the preset transformation block When the maximum value, and the width or height of the transform block is at least 4 times the minimum value of the size of the preset transform block, it is judged that the transform block is divided into a non-square, so that the width of the divided transform block is equal to The width of the transformation block before division, and the height of the transformation block after division is smaller than the height of the transformation block before division;
第二判断单元33,用于当图像块采用垂直划分,所述变换块的宽等于变换块的高,所述变换块的宽和高之和的平均值小于预设变换块的尺寸的最大值,且所述变换块的宽或高至少为所述预设变换块的尺寸的最小值的4倍时,判断对所述变换块采用非方形划分,使得划分后的变换块的宽小于划分前变换块的高,划分后的变换块的高等于划分前变换块的高;The second judging unit 33 is used for when the image block is divided vertically, the width of the transformation block is equal to the height of the transformation block, and the average value of the sum of the width and height of the transformation block is smaller than the maximum value of the size of the preset transformation block , and the width or height of the transform block is at least 4 times the minimum size of the preset transform block, it is determined that the transform block is divided into a non-square shape, so that the width of the transformed block after division is smaller than that before division The height of the transformation block, the height of the transformed transformation block after division is equal to the height of the transformation block before division;
第三判断单元34,用于当图像块采用水平划分或垂直划分,所述变换块的宽和高不等,所述变换块的宽和高之和的平均值大于预设变换块的尺寸的最大值,且所述变换块的宽或高至少为所述预设变换块的尺寸的最小值的4倍时,判断对所述变换块采用非方形划分,使得划分后的变换块的宽小于划分前变换块的宽,划分后的变换块的高小于划分前变换块的高。The third judging unit 34 is used for when the image block is divided horizontally or vertically, the width and height of the transformation block are not equal, and the average value of the sum of the width and height of the transformation block is greater than the size of the preset transformation block maximum value, and the width or height of the transform block is at least 4 times the minimum value of the size of the preset transform block, it is judged that the transform block is divided into a non-square shape, so that the width of the transformed transform block after division is less than The width of the transform block before division, and the height of the transform block after division is smaller than the height of the transform block before division.
图11为本发明实施例八提供的变换块划分装置结构示意图。与上述图10所示实施例不同的是,如图11所示,本实施例中,所述的划分判断模块3具体包括:FIG. 11 is a schematic structural diagram of an apparatus for dividing transform blocks provided by Embodiment 8 of the present invention. Different from the above-mentioned embodiment shown in FIG. 10, as shown in FIG. 11, in this embodiment, the division judgment module 3 specifically includes:
第一获取单元35,用于获取图像块的尺寸、图像块的划分方式以及预设变换块的尺寸的最大值,所述图像块的尺寸为图像块的宽和高的平均值,所述预设变换块的尺寸的最大值为变换块的宽和高的最大值,或者宽和高之和的平均值的最小值;The first acquiring unit 35 is configured to acquire the size of the image block, the division method of the image block and the maximum value of the size of the preset transformation block, the size of the image block is the average value of the width and height of the image block, and the preset Let the maximum value of the size of the transformation block be the maximum value of the width and height of the transformation block, or the minimum value of the average value of the sum of width and height;
第一参数获取单元36,用于根据图像块的尺寸,以及预设变换块的尺寸的最大值,获得第一参数,所述第一参数用于表示所述图像块对应的最大变换块的尺寸,所述变换块的尺寸为变换块的宽和高的平均值;The first parameter obtaining unit 36 is configured to obtain a first parameter according to the size of the image block and the maximum value of the size of the preset transformation block, and the first parameter is used to represent the size of the largest transformation block corresponding to the image block , the size of the transform block is the average value of the width and height of the transform block;
第二参数获取单元37,用于根据图像块的划分方式、所述第一参数以及所述预设变换块的尺寸的最小值,获得第二参数,所述第二参数用于表示所述图像块对应的最小变换块的尺寸是否大于所述预设变换块的尺寸的最小值;The second parameter acquisition unit 37 is configured to obtain a second parameter according to the division method of the image block, the first parameter and the minimum value of the size of the preset transformation block, and the second parameter is used to represent the image whether the size of the smallest transform block corresponding to the block is greater than the minimum size of the preset transform block;
划分判断单元38,用于根据所述第二参数,判断是否对所述变换块进行非方形划分。The division determination unit 38 is configured to determine whether to perform non-square division on the transform block according to the second parameter.
本实施例中,第一参数获取单元36,具体用于当所述图像块的尺寸大于所述预设变换块的尺寸的最大值时,所述第一参数等于所述预设变换块的尺寸的最大值;当所述图像块的尺寸小于所述预设变换块的尺寸的最大值时,所述第一参数等于所述图像块的尺寸;以及当所述图像块的尺寸等于所述预设变换块的尺寸的最大值时,所述第一参数等于所述图像块的尺寸。In this embodiment, the first parameter acquiring unit 36 is specifically configured to: when the size of the image block is greater than the maximum size of the preset transform block, the first parameter is equal to the size of the preset transform block the maximum value of the image block; when the size of the image block is smaller than the maximum value of the size of the preset transform block, the first parameter is equal to the size of the image block; and when the size of the image block is equal to the preset When the maximum value of the size of the transformation block is assumed, the first parameter is equal to the size of the image block.
本实施例中,图像块的尺寸、变换块的尺寸、预设变换块的尺寸的最大值以及预设变换块的尺寸的最小值均采以2为基数的对数表示;且各尺寸用指数表示时,上述的第二参数获取单元37,具体可用于当所述图像块的划分方式为采用非方形划分,且所述第一参数的值大于预设变换块的尺寸的最小值加1时,将所述第二参数的值置为1,否则将所述第二参数的值置为0;上述的划分判断单元38,具体可用于当所述第二参数的值为1时,判断允许对所述变换块采用非方形划分,否则,对所述变换块采用方形划分;In this embodiment, the size of the image block, the size of the transform block, the maximum value of the size of the preset transform block, and the minimum value of the size of the preset transform block are all represented by a logarithm with base 2; and each size is represented by an exponent When expressing, the above-mentioned second parameter acquisition unit 37 can be specifically used when the division method of the image block is to adopt non-square division, and the value of the first parameter is greater than the minimum value of the size of the preset transformation block plus 1 , set the value of the second parameter to 1, otherwise set the value of the second parameter to 0; the above-mentioned division judgment unit 38 can be specifically used to determine whether the second parameter is allowed when the value of the second parameter is 1 Using non-square partitioning for the transform block, otherwise, using square partitioning for the transform block;
其中,所述方形划分是指将图像块或变换块划分成宽和高不等的划分方法。Wherein, the square division refers to a division method of dividing an image block or a transformation block into widths and heights.
图12为本发明实施例九提供的变换块划分装置的结构示意图。在上述图9、图10或图11所示实施例基础上,如图12所示,本实施例还可包括:FIG. 12 is a schematic structural diagram of an apparatus for dividing transform blocks according to Embodiment 9 of the present invention. On the basis of the above embodiments shown in FIG. 9 , FIG. 10 or FIG. 11 , as shown in FIG. 12 , this embodiment may further include:
划分参数获取模块4,用于获取变换块允许划分的预设划分层数;A division parameter acquisition module 4, configured to acquire the preset number of division layers allowed to be divided by the transform block;
所述变换块划分模块2,具体可用于对变换块进行非方形划分,并在所述变换块的划分层数小于预设划分层数,且所述变换块的宽或高等于预设变换块的尺寸的最小值时,停止对所述变换块的划分。The transformation block division module 2 can specifically be used to perform non-square division on the transformation block, and the number of division layers of the transformation block is less than the preset number of division layers, and the width or height of the transformation block is equal to the preset transformation block When the minimum value of the size of , stop dividing the transform block.
此外,如图12所示,本实施例还可包括:In addition, as shown in Figure 12, this embodiment may also include:
色度变换块尺寸获取模块5,用于获取图像块对应的色度块的最大变换块的尺寸;Chroma transformation block size acquisition module 5, used to obtain the size of the largest transformation block of the chrominance block corresponding to the image block;
色度变换块重置模块6,用于判断划分后的变换块中色度块对应的变换块的尺寸是否超过所述图像块对应的色度块的最大变换块的尺寸,是则将所述划分后的变换块中色度块对应的变换尺寸重置为所述图像块对应的色度块的最大变换块的尺寸。The chroma transform block reset module 6 is used to judge whether the size of the transform block corresponding to the chroma block in the divided transform block exceeds the size of the largest transform block of the chroma block corresponding to the image block, and if so, the The transform size corresponding to the chroma block in the divided transform block is reset to the size of the largest transform block of the chroma block corresponding to the image block.
上述本发明变换块划分装置各实施例具体实现过程可参见上述本发明变换块划分方法实施例的说明,在此不再赘述。For the specific implementation process of each embodiment of the transform block division device of the present invention, refer to the description of the embodiment of the transform block division method of the present invention above, and details are not repeated here.
图13为本发明实施例十提供的变换块划分参数的编码装置的结构示意图。如图13所示,本实施例编码装置包括:FIG. 13 is a schematic structural diagram of an encoding device for transforming block division parameters provided by Embodiment 10 of the present invention. As shown in Figure 13, the encoding device of this embodiment includes:
尺寸获取模块10,用于获取预设变换块的尺寸的最小值;A size acquiring module 10, configured to acquire a minimum value of the size of a preset transform block;
参数编码模块20,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否编码变换块的划分参数;A parameter encoding module 20, configured to determine whether to encode the division parameters of the transform block according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
本实施例中,上述的参数编码模块20,具体可用于当变换块采用非方形划分,且所述变换块的宽或高等于所述预设变换块的尺寸的最小值时,判断不需要编码变换块的划分参数,否则,编码变换块的划分参数。In this embodiment, the above-mentioned parameter encoding module 20 can specifically be used to determine that encoding is not required when the transformation block is divided into non-square, and the width or height of the transformation block is equal to the minimum value of the size of the preset transformation block. The partition parameter of the transform block, otherwise, the partition parameter of the encoded transform block.
图14为本发明实施例十一提供的变换块划分参数的编码装置的结构示意图。本实施例中,参数编码模块20,具体可用于根据第二参数,判断是否编码变换块的划分参数。具体,如图14所示,本实施例还可包括:FIG. 14 is a schematic structural diagram of an encoding device for transforming block division parameters provided by Embodiment 11 of the present invention. In this embodiment, the parameter encoding module 20 may specifically be configured to determine whether to encode the division parameter of the transform block according to the second parameter. Specifically, as shown in Figure 14, this embodiment may also include:
第二获取单元210,用于获取图像块的尺寸、图像块的划分方式以及预设变换块的尺寸的最大值;The second acquiring unit 210 is configured to acquire the size of the image block, the division method of the image block and the maximum value of the size of the preset transformation block;
第一参数获取单元211,用于根据图像块的尺寸,以及预设变换块的尺寸的最大值,获得第一参数;The first parameter obtaining unit 211 is configured to obtain the first parameter according to the size of the image block and the maximum value of the size of the preset transformation block;
第二参数获取单元212,用于根据图像块的划分方式、所述第一参数以及所述预设变换块的尺寸的最小值,获得第二参数。The second parameter obtaining unit 212 is configured to obtain the second parameter according to the division method of the image block, the first parameter and the minimum value of the size of the preset transformation block.
本实施例中,所述第二参数用于表示图像块对应的最小变换块的尺寸是否大于所述预设变换块的尺寸的最小值;所述第一参数用于表示所述图像块对应的最大变换块的尺寸。In this embodiment, the second parameter is used to indicate whether the size of the smallest transform block corresponding to the image block is greater than the minimum size of the preset transform block; the first parameter is used to indicate whether the size of the smallest transform block corresponding to the image block The size of the largest transform block.
本实施例中,上述的参数编码模块20,具体可用于当所述变换块的尺寸大于预设变换块的尺寸的最小值加所述第二参数时,编码变换块的划分参数,否则,不需要编码变换块的划分参数。In this embodiment, the above-mentioned parameter encoding module 20 can specifically be used to encode the division parameters of the transform block when the size of the transform block is greater than the minimum value of the size of the preset transform block plus the second parameter; otherwise, not The partition parameters of the coded transform block are required.
图15为本发明实施例十二提供的变换块划分参数的编码装置的结构示意图。在上述图13或图14所示实施例基础上,如图14所示,本实施例还可包括:FIG. 15 is a schematic structural diagram of an encoding device for transforming block division parameters provided by Embodiment 12 of the present invention. On the basis of the above embodiment shown in FIG. 13 or FIG. 14, as shown in FIG. 14, this embodiment may further include:
划分参数获取模块30,用于获取变换块允许划分的预设划分层数;A division parameter acquisition module 30, configured to acquire the preset number of division layers allowed for division of the transform block;
所述参数编码模块20,具体用于当变换块的划分层数等于所述预设划分层数时,判断不需要编码变换块的划分参数。The parameter encoding module 20 is specifically configured to determine that it is not necessary to encode the division parameters of the transformation block when the number of division layers of the transformation block is equal to the preset number of division levels.
上述本发明变换块划分参数的编码装置具体实现过程可参见上述本发明变换块划分参数的编码方法实施例,在此不再赘述。For the specific implementation process of the device for encoding transform block division parameters of the present invention, refer to the embodiment of the encoding method for transform block division parameters of the present invention described above, which will not be repeated here.
图16为本发明实施例十三提供的变换块划分参数的解码装置的结构示意图。如图16所示,本实施例解码装置可包括:FIG. 16 is a schematic structural diagram of a decoding apparatus for transforming block division parameters provided by Embodiment 13 of the present invention. As shown in Figure 16, the decoding device in this embodiment may include:
尺寸获取模块40,用于获取预设变换块的尺寸的最小值;A size acquiring module 40, configured to acquire the minimum value of the size of the preset transform block;
参数解码模块50,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否解码变换块的划分参数;The parameter decoding module 50 is configured to judge whether to decode the division parameter of the transform block according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block;
所述变换块的划分参数用于表示对变换块进行划分或不进行划分。The division parameter of the transform block is used to indicate whether to divide the transform block or not.
本实施例中,上述的参数解码模块50,具体可用于当变换块采用非方形变换,且所述变换块的宽或高等于预设的变换块的尺寸的最小值时,判断不需要解码变换块的划分参数,否则,解码变换块的划分参数。In this embodiment, the above-mentioned parameter decoding module 50 can specifically be used to determine that no decoding transformation is required when the transformation block adopts non-square transformation, and the width or height of the transformation block is equal to the minimum value of the preset transformation block size. The partition parameter of the block, otherwise, the partition parameter of the decoded transformed block.
图17为本发明实施例十四提供的变换块划分参数的解码装置的结构示意图。与上述图16所示实施例技术方案不同的是,本实施例中,参数解码模块50,具体用于根据第二参数,判断是否解码变换块的划分参数。具体地,如图17所示,本实施例还可包括:FIG. 17 is a schematic structural diagram of a decoding apparatus for transforming block division parameters provided by Embodiment 14 of the present invention. Different from the technical solution of the above-mentioned embodiment shown in FIG. 16 , in this embodiment, the parameter decoding module 50 is specifically configured to judge whether to decode the division parameter of the transformation block according to the second parameter. Specifically, as shown in Figure 17, this embodiment may also include:
第二获取单元510,用于获取图像块的尺寸、图像块的划分方式以及预设变换块的尺寸的最大值;The second obtaining unit 510 is configured to obtain the size of the image block, the division method of the image block and the maximum value of the size of the preset transformation block;
第一参数获取单元511,用于根据图像块的尺寸,以及预设变换块的尺寸的最大值,获得第一参数;The first parameter obtaining unit 511 is configured to obtain the first parameter according to the size of the image block and the maximum value of the size of the preset transformation block;
第二参数获取单元512,用于根据图像块的划分方式、所述第一参数以及所述预设变换块的尺寸的最小值,获得第二参数。The second parameter obtaining unit 512 is configured to obtain the second parameter according to the division method of the image block, the first parameter and the minimum size of the preset transformation block.
本实施例中,上述的第二参数用于表示图像块对应的最小变换块的尺寸是否大于所述预设变换块的尺寸的最小值;上述的第一参数用于表示所述图像块对应的最大变换块的尺寸。其中,参数解码模块50,具体用于当所述变换块的尺寸大于预设变换块的尺寸的最小值加所述第二参数时,解码变换块的划分参数。In this embodiment, the above-mentioned second parameter is used to indicate whether the size of the smallest transform block corresponding to the image block is greater than the minimum size of the preset transform block; the above-mentioned first parameter is used to indicate whether the size of the image block corresponds to The size of the largest transform block. Wherein, the parameter decoding module 50 is specifically configured to decode the division parameter of the transform block when the size of the transform block is greater than the minimum value of the size of the preset transform block plus the second parameter.
图18为本发明实施例十五提供的变换块划分参数的解码装置的结构示意图。在上述图16或图17所示实施例技术方案基础上,如图18所示,本实施例还可包括:FIG. 18 is a schematic structural diagram of a decoding apparatus for transforming block division parameters provided by Embodiment 15 of the present invention. On the basis of the technical solution of the above embodiment shown in Figure 16 or Figure 17, as shown in Figure 18, this embodiment may further include:
划分参数获取模块60,用于获取变换块允许划分的预设划分层数;A division parameter acquisition module 60, configured to acquire the preset number of division layers allowed for division of the transform block;
所述参数解码模块50,具体可用于当变换块的划分层数等于所述预设划分层数时,判断不需要解码变换块的划分参数。The parameter decoding module 50 can be specifically configured to determine that the division parameters of the transformation block do not need to be decoded when the number of division layers of the transformation block is equal to the preset number of division levels.
上述本发明变换块划分参数的解码装置具体实现过程可参见上述本发明变换块划分参数的解码方法实施例,在此不再赘述。For the specific implementation process of the decoding device for transforming block division parameters of the present invention, refer to the above-mentioned embodiment of the decoding method for transform block division parameters of the present invention, which will not be repeated here.
图19为本发明实施例十六提供的图像编解码系统的结构示意图。如图19所示,本实施例图像编解码系统包括:FIG. 19 is a schematic structural diagram of an image encoding and decoding system provided by Embodiment 16 of the present invention. As shown in Figure 19, the image encoding and decoding system of this embodiment includes:
变换块划分参数的编码装置100,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否编码变换块的划分参数;The encoding device 100 for transform block division parameters is configured to determine whether to encode the division parameters of the transform block according to the relationship between the size of the transform block and the minimum value of the size of the preset transform block;
变换块划分参数的解码装置200,用于根据变换块的尺寸与所述预设变换块的尺寸的最小值之间的关系,判断是否解码变换块的划分参数;The decoding device 200 of the transformation block division parameter is used to determine whether to decode the division parameter of the transformation block according to the relationship between the size of the transformation block and the minimum value of the size of the preset transformation block;
其中,所述变换块的划分参数用于表示对变换块进行划分或不进行划分Wherein, the division parameter of the transform block is used to indicate whether to divide the transform block or not to divide
本实施例中,变换块划分参数的编码装置100具体可采用上述本发明实施例提供的变换块划分参数的编码装置,具体可参考图13、图14或图15所示实施例的说明;变换块划分参数的解码装置200具体可采用上述本发明实施例提供的变换块划分参数的解码装置,具体可参考图16、图17或图18所示实施例的说明,在此不再赘述。In this embodiment, the encoding device 100 for transforming block division parameters can specifically adopt the encoding device for transforming block division parameters provided by the above-mentioned embodiments of the present invention, and can refer to the description of the embodiment shown in FIG. 13 , FIG. 14 or FIG. 15 for details; The block division parameter decoding device 200 can specifically adopt the above-mentioned decoding device for transforming block division parameters provided by the embodiment of the present invention, and for details, refer to the description of the embodiment shown in FIG. 16 , FIG. 17 or FIG. 18 , which will not be repeated here.
本领域技术人员可以理解,本实施例图像编解码系统对图像进行编码过程中的其他处理过程,例如对图像块进行分解、对图像块进行量化以及熵编码等过程与现有图像编解码系统实现过程相同或类似,在此不再赘述。Those skilled in the art can understand that other processing processes in the process of encoding images by the image encoding and decoding system in this embodiment, such as decomposing image blocks, quantizing image blocks, and entropy encoding, are similar to existing image encoding and decoding systems. The process is the same or similar, and will not be repeated here.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.
Claims (40)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210227646.4A CN102761742B (en) | 2012-07-03 | 2012-07-03 | Transform block division methods, transform block divides coding method and the coding/decoding method of parameter |
| PCT/CN2013/078613 WO2014005500A1 (en) | 2012-07-03 | 2013-07-01 | Transform block division method and transform block division parameter encoding/ decoding method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210227646.4A CN102761742B (en) | 2012-07-03 | 2012-07-03 | Transform block division methods, transform block divides coding method and the coding/decoding method of parameter |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102761742A CN102761742A (en) | 2012-10-31 |
| CN102761742B true CN102761742B (en) | 2017-06-06 |
Family
ID=47056046
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201210227646.4A Active CN102761742B (en) | 2012-07-03 | 2012-07-03 | Transform block division methods, transform block divides coding method and the coding/decoding method of parameter |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN102761742B (en) |
| WO (1) | WO2014005500A1 (en) |
Families Citing this family (19)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102761742B (en) * | 2012-07-03 | 2017-06-06 | 华为技术有限公司 | Transform block division methods, transform block divides coding method and the coding/decoding method of parameter |
| CN102970535A (en) * | 2012-11-13 | 2013-03-13 | 鸿富锦精密工业(深圳)有限公司 | Image cutting system and method |
| CN102970534A (en) * | 2012-11-13 | 2013-03-13 | 鸿富锦精密工业(深圳)有限公司 | Image cutting system and method |
| CN102970532A (en) * | 2012-11-13 | 2013-03-13 | 鸿富锦精密工业(深圳)有限公司 | Image cutting system and method |
| CN102970533A (en) * | 2012-11-13 | 2013-03-13 | 鸿富锦精密工业(深圳)有限公司 | Image cutting system and method |
| CN105284110B (en) * | 2013-07-31 | 2019-04-23 | 太阳专利托管公司 | Image encoding method and picture coding device |
| CN107566848B (en) * | 2016-06-30 | 2020-04-14 | 华为技术有限公司 | Method and device for encoding and decoding |
| RU2018131580A (en) * | 2016-12-26 | 2021-01-26 | Нек Корпорейшн | VIDEO ENCODING METHOD, VIDEO DECODING METHOD, VIDEO ENCODING DEVICE, VIDEO DECODING DEVICE AND PROGRAM |
| US10536724B2 (en) * | 2016-12-26 | 2020-01-14 | Nec Corporation | Video encoding method, video decoding method, video encoding device, video decoding device, and program |
| EP3383044A1 (en) | 2017-03-27 | 2018-10-03 | Thomson Licensing | Reducing redundancy between tree types |
| EP3383045A1 (en) * | 2017-03-27 | 2018-10-03 | Thomson Licensing | Multiple splits prioritizing for fast encoding |
| JP2021518077A (en) * | 2018-04-01 | 2021-07-29 | エルジー エレクトロニクス インコーポレイティド | Video processing method and equipment for this |
| WO2019234605A1 (en) | 2018-06-05 | 2019-12-12 | Beijing Bytedance Network Technology Co., Ltd. | Extended quad-tree with asymmetric sub-blocks and different tree for chroma |
| CN111050184A (en) * | 2018-10-15 | 2020-04-21 | 华为技术有限公司 | Image block dividing method and device |
| CN111327894B (en) * | 2018-12-15 | 2022-05-17 | 华为技术有限公司 | Block division method, video coding and decoding method and video coder and decoder |
| CN111327899A (en) * | 2018-12-16 | 2020-06-23 | 华为技术有限公司 | Video decoder and corresponding method |
| US11528480B2 (en) * | 2019-06-19 | 2022-12-13 | Lg Electronics Inc. | Image encoding/decoding method and device using adaptive size limiting of chroma block and bitstream transmission method |
| CN112135147B (en) * | 2019-06-24 | 2023-02-28 | 杭州海康威视数字技术股份有限公司 | Encoding method, decoding method and device |
| CN120128704A (en) * | 2023-12-08 | 2025-06-10 | 腾讯科技(深圳)有限公司 | Image processing method, device, equipment and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101389026A (en) * | 2007-09-12 | 2009-03-18 | 索尼株式会社 | Image coding apparatus and image coding method |
| CN101500161A (en) * | 2008-01-31 | 2009-08-05 | 华为技术有限公司 | Inter-frame prediction method and apparatus based on adaptive block transformation |
| CN101686395A (en) * | 2005-07-21 | 2010-03-31 | Lg电子株式会社 | Method of encoding and decoding video signals |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101232625A (en) * | 2008-02-26 | 2008-07-30 | 吉林大学 | An Efficient Multi-Dimensional Video Stream Encoding and Decoding Method |
| EA029414B1 (en) * | 2009-04-08 | 2018-03-30 | Шарп Кабусики Кайся | Video frame encoding apparatus and video frame decoding apparatus |
| KR101484280B1 (en) * | 2009-12-08 | 2015-01-20 | 삼성전자주식회사 | Method and apparatus for video encoding by motion prediction using arbitrary partition, and method and apparatus for video decoding by motion compensation using arbitrary partition |
| US20110176611A1 (en) * | 2010-01-15 | 2011-07-21 | Yu-Wen Huang | Methods for decoder-side motion vector derivation |
| CN102761742B (en) * | 2012-07-03 | 2017-06-06 | 华为技术有限公司 | Transform block division methods, transform block divides coding method and the coding/decoding method of parameter |
-
2012
- 2012-07-03 CN CN201210227646.4A patent/CN102761742B/en active Active
-
2013
- 2013-07-01 WO PCT/CN2013/078613 patent/WO2014005500A1/en active Application Filing
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101686395A (en) * | 2005-07-21 | 2010-03-31 | Lg电子株式会社 | Method of encoding and decoding video signals |
| CN101389026A (en) * | 2007-09-12 | 2009-03-18 | 索尼株式会社 | Image coding apparatus and image coding method |
| CN101500161A (en) * | 2008-01-31 | 2009-08-05 | 华为技术有限公司 | Inter-frame prediction method and apparatus based on adaptive block transformation |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102761742A (en) | 2012-10-31 |
| WO2014005500A1 (en) | 2014-01-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102761742B (en) | Transform block division methods, transform block divides coding method and the coding/decoding method of parameter | |
| CN102970526B (en) | A kind of method obtaining transform block size and module | |
| CN102957907B (en) | The acquisition methods of a kind of transform block positional information and module | |
| JP6553769B2 (en) | Color difference video decoding method | |
| CN107623853B (en) | Video encoding and decoding method and non-transitory computer-readable storage medium | |
| CN102742277B (en) | Method and apparatus for encoding video based on scanning order of hierarchical data units and method and apparatus for decoding video based on scanning order of hierarchical data units | |
| TWI715506B (en) | Method for encoding image in intra prediction, method for decoding image in intra prediction and computer-readable medium storing encoded video information | |
| CN102685487B (en) | Image coding and decoding methods, image coding and decoding equipment and network system | |
| CN108028942B (en) | Pixel prediction method, encoding method, decoding method, device thereof, and storage medium | |
| KR101737861B1 (en) | Apparatus and method for dct size decision based on transform depth | |
| CN102857755B (en) | The method and apparatus determining transform block size | |
| CN107431815A (en) | Method and device for processing video signal | |
| KR20110046016A (en) | Method and apparatus for encoding residual block, method and apparatus for decoding | |
| CN103108177B (en) | Method for encoding images and picture coding device | |
| KR20110112224A (en) | Method and apparatus for encoding and decoding information about an encoding mode | |
| JP5469931B2 (en) | Video decoding method, video encoding method | |
| KR101604035B1 (en) | Method and apparatus for decoding an image | |
| KR101604033B1 (en) | Method and apparatus for decoding an image | |
| KR101604038B1 (en) | Method and apparatus for encoding residual block, and method and apparatus for decoding residual block | |
| KR20120005931A (en) | Video encoding and decoding method and apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C41 | Transfer of patent application or patent right or utility model | ||
| TA01 | Transfer of patent application right |
Effective date of registration: 20170220 Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Applicant after: HUAWEI Technologies Co., Ltd. Applicant after: Tsinghua University Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Applicant before: HUAWEI Technologies Co., Ltd. |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |