CN114339220A - A kind of image data encoding method - Google Patents
A kind of image data encoding method Download PDFInfo
- Publication number
- CN114339220A CN114339220A CN202111672788.7A CN202111672788A CN114339220A CN 114339220 A CN114339220 A CN 114339220A CN 202111672788 A CN202111672788 A CN 202111672788A CN 114339220 A CN114339220 A CN 114339220A
- Authority
- CN
- China
- Prior art keywords
- division
- coding unit
- coding
- image data
- encoding
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 71
- 239000011159 matrix material Substances 0.000 claims abstract description 58
- 238000006243 chemical reaction Methods 0.000 claims abstract description 15
- 230000015654 memory Effects 0.000 claims description 33
- 238000005192 partition Methods 0.000 claims 9
- 238000003491 array Methods 0.000 description 2
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000004904 shortening Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明提供了一种图像数据编码方法,包括:获取待编码图像数据的各编码单元;对各编码单元进行频率域转换,得到各编码单元的编码矩阵;根据编码矩阵分别确定各编码单元的纹理特征;根据纹理特征分别确定各编码单元的候选划分方式;对于各编码单元,依次遍历编码单元对应的候选划分方式,确定各编码单元对应的划分方式;结合各编码单元的划分方式对待编码图像数据进行编码,得到编码结果,通过执行本发明提供的图像数据编码方法,可以通过编码单元对应的编码矩阵确定出编码单元的纹理特征,根据编码单元的纹理特征对编码单元的划分方式进行限定,进而减少了对划分方式的遍历次数,缩短了图像数据编码的时间。
The invention provides an image data encoding method, which includes: acquiring each encoding unit of image data to be encoded; performing frequency domain conversion on each encoding unit to obtain an encoding matrix of each encoding unit; and determining the texture of each encoding unit according to the encoding matrix. According to the texture features, the candidate division methods of each coding unit are respectively determined; for each coding unit, the candidate division methods corresponding to the coding units are traversed in turn, and the corresponding division methods of each coding unit are determined; Encoding is performed to obtain an encoding result, and by executing the image data encoding method provided by the present invention, the texture feature of the encoding unit can be determined by the encoding matrix corresponding to the encoding unit, and the division mode of the encoding unit is limited according to the texture feature of the encoding unit, and then The number of times of traversing the division method is reduced, and the time for encoding the image data is shortened.
Description
技术领域technical field
本发明属于多媒体领域,具体涉及到一种图像数据编码方法。The invention belongs to the field of multimedia, and in particular relates to an image data encoding method.
背景技术Background technique
目前国际上主流的视频编码协议标准有H.264、H.265/HEVC、H.266/VVC,我国主流的音视频编码协议标准有AV1、AVS2、AVS3,H.266/VVC是国际正在制定的新一代视频编码协议标准,AVS3是我国正在制定的新一代音视频编码协议标准,新一代音视频编码标准在视频压缩性能方面有着很大的提高。At present, the mainstream video coding protocol standards in the world are H.264, H.265/HEVC, H.266/VVC, and the mainstream audio and video coding protocol standards in my country are AV1, AVS2, AVS3, and H.266/VVC is being developed internationally. AVS3 is a new generation of audio and video coding protocol standards being developed in my country. The new generation of audio and video coding standards has greatly improved video compression performance.
但是压缩性能的提升往往带来的是较高的时间复杂度为代价,在AVS3的音视频编码过程中确定一个图像块的划分方式,需要对所有的划分方式进行遍历,计算每种划分方式对应的率失真代价(rate distortion cost,RD cost),比较各个率失真代价后才能确定该图像块的最优划分方式,导致AVS3视频编码具有较高的时间复杂度。However, the improvement of compression performance often comes at the expense of higher time complexity. To determine the division method of an image block in the audio and video coding process of AVS3, it is necessary to traverse all the division methods and calculate the corresponding The rate distortion cost (RD cost) is the rate distortion cost, and the optimal division method of the image block can only be determined after comparing each rate distortion cost, resulting in high time complexity of AVS3 video coding.
发明内容SUMMARY OF THE INVENTION
因此,针对现有技术中的问题,本发明提供一种图像数据编码方法,用以解决现有技术中存在的问题。Therefore, in view of the problems in the prior art, the present invention provides an image data encoding method to solve the problems in the prior art.
第一方面,本发明提供一种图像数据编码方法,包括:获取待编码图像数据的各编码单元;对各编码单元进行频率域转换,得到各编码单元的编码矩阵;根据编码矩阵分别确定各编码单元的纹理特征;根据纹理特征分别确定各编码单元的候选划分方式;对于各编码单元,依次遍历编码单元对应的候选划分方式,确定各编码单元对应的划分方式;结合各编码单元的划分方式对待编码图像数据进行编码,得到编码结果。In a first aspect, the present invention provides an image data encoding method, comprising: acquiring each encoding unit of image data to be encoded; performing frequency domain conversion on each encoding unit to obtain an encoding matrix of each encoding unit; and determining each encoding unit according to the encoding matrix. The texture feature of the unit; determine the candidate division method of each coding unit according to the texture feature; for each coding unit, traverse the candidate division method corresponding to the coding unit in turn to determine the corresponding division method of each coding unit; combine the division method of each coding unit to treat The encoded image data is encoded to obtain an encoded result.
可选的,在本发明提供的图像数据编码方法中,根据编码矩阵分别确定编码单元的纹理特征,包括:确定编码矩阵中的横向元素数组和纵向元素数组;根据横向元素数组中各元素的绝对值和与纵向元素数组中各元素的绝对值和的比值确定编码单元的纹理特征。Optionally, in the image data encoding method provided by the present invention, the texture features of the encoding units are respectively determined according to the encoding matrix, including: determining the horizontal element array and the vertical element array in the encoding matrix; The ratio of the sum of the values to the sum of the absolute values of the elements in the vertical element array determines the texture characteristics of the coding unit.
可选的,在本发明提供的图像数据编码方法中,纹理特征包括水平纹理,根据纹理特征分别确定编码单元的候选划分方式,包括:若纹理特征为水平纹理,将不划分、水平扩展四叉树划分和水平二叉树划分确定为编码单元的候选划分方式。Optionally, in the image data encoding method provided by the present invention, the texture features include horizontal textures, and the candidate division modes of the coding units are respectively determined according to the texture features, including: if the texture features are horizontal textures, no division and horizontal expansion Tree division and horizontal binary tree division are determined as candidate division manners of coding units.
可选的,在本发明提供的图像数据编码方法中,纹理特征包括垂直纹理,根据纹理特征分别确定编码单元的候选划分方式,包括:若纹理特征为垂直纹理,将不划分、垂直扩展四叉树划分和垂直二叉树划分确定为编码单元的候选划分方式。Optionally, in the image data encoding method provided by the present invention, the texture features include vertical textures, and the candidate division modes of the coding units are respectively determined according to the texture features, including: if the texture features are vertical textures, no division and vertical expansion Tree division and vertical binary tree division are determined as candidate division methods of coding units.
可选的,在本发明提供的图像数据编码方法中,获取待编码图像的编码单元的步骤之后,对编码单元进行频率域转换的步骤之前,还包括:确定编码单元信息;根据编码单元信息确定编码单元的大小,若编码单元的大小等于第一预设值,则执行对编码单元进行频率域转化的步骤。Optionally, in the image data encoding method provided by the present invention, after the step of acquiring the encoding unit of the image to be encoded, and before the step of performing frequency domain conversion on the encoding unit, the method further includes: determining encoding unit information; determining according to the encoding unit information. The size of the coding unit. If the size of the coding unit is equal to the first preset value, the step of performing frequency domain conversion on the coding unit is performed.
可选的,在本发明提供的图像数据编码方法中,还包括:若编码单元的大小大于或小于第一预设值,将不划分、四叉树划分、水平扩展四叉树划分、垂直扩展四叉树划分、水平二叉树划分和垂直二叉树划分确定为编码单元的候选划分方式;执行遍历编码单元对应的候选划分方式,确定各编码单元对应的划分方式的步骤。Optionally, in the image data encoding method provided by the present invention, it further includes: if the size of the encoding unit is larger or smaller than the first preset value, no division, quadtree division, horizontal expansion quadtree division, vertical expansion are performed. The quadtree division, the horizontal binary tree division and the vertical binary tree division are determined as candidate division modes of the coding unit; the step of traversing the candidate division modes corresponding to the coding units to determine the division mode corresponding to each coding unit is performed.
可选的,在本发明提供的图像数据编码方法中,对编码单元进行频率域转换,得到编码单元的编码矩阵的步骤之后,根据编码矩阵确定编码单元的纹理特征的步骤之前,还包括:根据编码矩阵提取复杂度系数矩阵;若复杂度系数矩阵中各元素的绝对值的和小于第二预设值,则执行编码矩阵确定编码单元的纹理特征的步骤。Optionally, in the image data encoding method provided by the present invention, after the step of performing frequency domain conversion on the encoding unit to obtain the encoding matrix of the encoding unit, and before the step of determining the texture feature of the encoding unit according to the encoding matrix, the method further includes: The coding matrix extracts the complexity coefficient matrix; if the sum of the absolute values of the elements in the complexity coefficient matrix is less than the second preset value, the coding matrix determines the texture feature of the coding unit.
可选的,在本发明提供的图像数据编码方法中,还包括:若复杂度系数矩阵中各元素的绝对值的和大于或等于第二预设值,将不划分、四叉树划分、水平扩展四叉树划分、垂直扩展四叉树划分、水平二叉树划分和垂直二叉树划分确定为编码单元的候选划分方式;执行依次遍历编码单元对应的候选划分方式,确定各编码单元对应的划分方式的步骤。Optionally, in the image data encoding method provided by the present invention, it also includes: if the sum of the absolute values of the elements in the complexity coefficient matrix is greater than or equal to the second preset value, no division, quadtree division, horizontal The extended quad-tree division, the vertically extended quad-tree division, the horizontal binary tree division, and the vertical binary tree division are determined as the candidate division modes of the coding unit; the steps of traversing the candidate division modes corresponding to the coding units in turn, and determining the corresponding division modes of each coding unit are performed. .
第二方面,本发明提供了一种计算机可读存储介质,该计算机可读存储介质存储计算机指令,计算机指令被处理器执行如本发明提供的图像数据编码方法。In a second aspect, the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions are executed by a processor according to the image data encoding method provided by the present invention.
第三方面,本发明提供一种计算机设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,从而执行如本发明提供的图像数据编码方法。In a third aspect, the present invention provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are processed by the at least one processor The image data encoding method as provided by the present invention is executed by the processor.
本发明技术方案,具有如下优点:The technical scheme of the present invention has the following advantages:
本发明提供的图像数据编码方法,获取待编码图像数据的各编码单元,通过对编码单元进行频率域转换,得到各编码单元的编码矩阵,通过编码矩阵确定出各编码单元的纹理特征,根据各编码单元的纹理特征对各编码单元的划分方式进行了限定,减少了各编码单元划分方式的数量,根据限定后的划分方式为各编码单元确定最终的划分方式,减少了对划分方式的遍历次数,进而缩短了图像数据编码的时间。In the image data encoding method provided by the present invention, each encoding unit of the image data to be encoded is obtained, the encoding matrix of each encoding unit is obtained by performing frequency domain conversion on the encoding unit, the texture feature of each encoding unit is determined by the encoding matrix, and the The texture feature of the coding unit defines the division mode of each coding unit, which reduces the number of division modes of each coding unit, and determines the final division mode for each coding unit according to the limited division mode, which reduces the number of traversals for the division mode. , thereby shortening the encoding time of image data.
附图说明Description of drawings
为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the specific embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the specific embodiments or the prior art. Obviously, the accompanying drawings in the following description The drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
图1为本发明实施例中图像数据编码方法的一个具体实例的流程图;1 is a flowchart of a specific example of an image data encoding method in an embodiment of the present invention;
图2为本发明实施例中图像数据编码方法的一个具体实例的流程图;2 is a flowchart of a specific example of an image data encoding method in an embodiment of the present invention;
图3为本发明实施例中图像数据编码装置的一个具体实例的结构示意图;3 is a schematic structural diagram of a specific example of an image data encoding apparatus in an embodiment of the present invention;
图4为本发明实施例中计算机设备的一个具体实例的结构示意图。FIG. 4 is a schematic structural diagram of a specific example of a computer device in an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
除非上下文明确要求,否则整个说明书和权利要求书中的“包括”、“包含”等类似词语应当解释为包含的含义而不是排他或穷举的含义;也就是说,是“包括但不限于”的含义。Unless clearly required by the context, words such as "including", "comprising" and the like throughout the specification and claims should be construed in an inclusive rather than an exclusive or exhaustive sense; that is, "including but not limited to" meaning.
在本发明的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本发明的描述中,除非另有说明,“多个”的含义是两个或两个以上。In the description of the present invention, it should be understood that the terms "first", "second" and the like are used for descriptive purposes only, and should not be construed as indicating or implying relative importance. Also, in the description of the present invention, unless otherwise specified, "plurality" means two or more.
此外,下面所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
本发明实施例提供图像数据编码方法,如图1所示,该方法包括:An embodiment of the present invention provides a method for encoding image data. As shown in FIG. 1 , the method includes:
步骤S1:获取待编码图像数据的各编码单元。Step S1: Obtain each coding unit of the image data to be coded.
在一可选实施例中,在通过标准音视频编码协议(AVS3)对待编码图像数据进行编码的过程中,待编码图像数据被划分为若干个互不重叠的编码树单元(LCU或CTU),再对编码树单元进行递归划分,得到多个编码单元(CU)。In an optional embodiment, in the process of encoding the image data to be encoded by the standard audio and video coding protocol (AVS3), the image data to be encoded is divided into several non-overlapping coding tree units (LCU or CTU), Then recursively divide the coding tree unit to obtain multiple coding units (CUs).
步骤S2:对各编码单元进行频率域转换,得到各编码单元的编码矩阵。Step S2: Perform frequency domain conversion on each coding unit to obtain a coding matrix of each coding unit.
在一可选实施例中,使用离散余弦变换对各编码单元进行频率域转换,得到与各编码单元相对应的编码矩阵。In an optional embodiment, discrete cosine transform is used to perform frequency domain conversion on each coding unit to obtain a coding matrix corresponding to each coding unit.
离散余弦变换具有正交变换性质,且其变换阵的基向量近似于托普利茨矩阵的特征向量,可以体现图像信号的相关特性,在图像信号变换的确定的变换矩阵正交变换中,离散余弦变换是一种准最佳变换,通过执行离散余弦变换可以提高图像信号的转换效率。The discrete cosine transform has the property of orthogonal transformation, and the basis vector of its transformation matrix is similar to the eigenvector of the Toeplitz matrix, which can reflect the relevant characteristics of the image signal. Cosine transform is a quasi-optimal transform, and the conversion efficiency of image signals can be improved by performing discrete cosine transform.
步骤S3:根据各编码矩阵分别确定各编码单元的纹理特征。Step S3: Determine the texture feature of each coding unit according to each coding matrix.
纹理特征包括纹理方向,纹理方向包括水平方向和垂直方向。The texture feature includes the texture direction, and the texture direction includes the horizontal direction and the vertical direction.
步骤S4:根据纹理特征分别确定各编码单元的候选划分方式。Step S4: Determine the candidate division manner of each coding unit according to the texture feature.
在一可选实施例中,若纹理方向为水平方向,则倾向水平划分,若纹理方向为垂直方向则倾向垂直划分。In an optional embodiment, if the texture direction is the horizontal direction, the horizontal division is preferred, and if the texture direction is the vertical direction, the vertical division is preferred.
在一可选实施例中,标准音视频编码协议为编码单元的划分提供了六种方式,具体为:不划分、四叉树划分、水平扩展四叉树划分、垂直扩展四叉树划分、水平二叉树划分和垂直二叉树划分,在通过标准音视频编码协议对编码单元的编码过程中,需要对六种划分方式进行遍历,通过比较各方式下的率失真来决定最终的划分方式。In an optional embodiment, the standard audio and video coding protocol provides six ways for the division of coding units, specifically: no division, quadtree division, horizontally extended quadtree division, vertically extended quadtree division, horizontal Binary tree division and vertical binary tree division, in the process of coding the coding unit through the standard audio and video coding protocol, it is necessary to traverse the six division methods, and determine the final division method by comparing the rate distortion of each method.
若一个编码单元的纹理特征为水平纹理,则将不划分、水平扩展四叉树划分和水平二叉树划分这三种划分方式确定为该编码单元的候选划分方式;若一个编码单元的纹理特征为垂直纹理,则将不划分、垂直扩展四叉树划分和垂直二叉树划分这三种划分方式确定为该编码单元的候选划分方式。If the texture feature of a coding unit is a horizontal texture, the three division modes of no division, horizontally extended quadtree division and horizontal binary tree division are determined as the candidate division modes of the coding unit; if the texture feature of a coding unit is vertical texture, three division modes of no division, vertically extended quadtree division, and vertical binary tree division are determined as candidate division modes of the coding unit.
通过执行本步骤,将原本标准音视频编码协议提供的六种划分方式依照编码单元的纹理特征进行了初步筛选,减少了对编码单元划分方式的遍历次数,降低了待编码图像数据的编码时间复杂度。By performing this step, the six division methods provided by the original standard audio and video coding protocol are preliminarily screened according to the texture characteristics of the coding unit, which reduces the number of traversal times of the coding unit division methods and reduces the coding time complexity of the image data to be coded. Spend.
步骤S5:对于各编码单元,依次遍历编码单元对应的候选划分方式,确定各编码单元对应的划分方式。Step S5: For each coding unit, traverse the candidate division modes corresponding to the coding units in sequence, and determine the division mode corresponding to each coding unit.
在一可选实施例中,通过对确定好的候选划分方式进行遍历,计算各划分方式下的率失真值,对各划分方式下的率失真值进行比较,将对应率失真值最小的划分方式确定为该编码单元的划分方式。In an optional embodiment, by traversing the determined candidate division modes, calculating the rate-distortion value under each division mode, comparing the rate-distortion values under each division mode, and determining the division mode corresponding to the smallest rate-distortion value. Determines the division method of the coding unit.
步骤S6:结合各编码单元的划分方式对待编码图像数据进行编码,得到编码结果。Step S6: Encoding the image data to be encoded in combination with the division manner of each encoding unit to obtain an encoding result.
在一可选实施例中,使用标准音视频编码协议中的编码部分,结合各编码单元的划分方式对待编码图像数据进行编码。In an optional embodiment, the encoding part in the standard audio and video encoding protocol is used to encode the image data to be encoded in combination with the division method of each encoding unit.
在本发明实施例中,通过对编码单元进行频率域转换,得到各编码单元的编码矩阵,通过编码矩阵确定出各编码单元的纹理特征,根据各编码单元的纹理特征对各编码单元的划分方式进行了限定,减少了各编码单元划分方式的数量,根据限定后的划分方式为各编码单元确定最终的划分方式,减少了对划分方式的遍历次数,进而缩短了图像数据编码的时间。In the embodiment of the present invention, the coding matrix of each coding unit is obtained by performing frequency domain conversion on the coding unit, the texture feature of each coding unit is determined by the coding matrix, and the division method of each coding unit is divided according to the texture feature of each coding unit The limitation is carried out to reduce the number of division modes of each coding unit, and the final division mode is determined for each coding unit according to the defined division mode, which reduces the number of traversal times for the division modes, thereby shortening the time for encoding image data.
在一可选实施例中,根据编码矩阵分别确定编码单元的纹理特征,包括:In an optional embodiment, the texture features of the coding units are respectively determined according to the coding matrix, including:
首先,确定编码矩阵中的横向元素数组和纵向元素数组。First, determine the horizontal element array and vertical element array in the encoding matrix.
在一可选实施例中,编码矩阵中不同位置的值对应不同频率下的能量值,编码矩阵中属于同一行的元素数组可以反映编码单元的水平纹理,编码矩阵中属于同一列的元素数组可以反映编码单元的垂直纹理,示例性地,可以将编码矩阵中(1,0),(2,0),(3,0)这三个位置上的元素确定为横向元素数组,将编码矩阵中(0,1),(0,2),(0,3)这三个位置上的元素确定为纵向元素数组。In an optional embodiment, the values at different positions in the coding matrix correspond to energy values at different frequencies, the element arrays belonging to the same row in the coding matrix can reflect the horizontal texture of the coding unit, and the element arrays belonging to the same column in the coding matrix can be Reflecting the vertical texture of the coding unit, for example, the elements at the three positions (1, 0), (2, 0), and (3, 0) in the coding matrix may be determined as a horizontal element array, and the coding matrix The elements at the three positions (0, 1), (0, 2), (0, 3) are determined as a vertical element array.
然后,根据横向元素数组中各元素的绝对值和与纵向元素数组中各元素的绝对值和的比值确定编码单元的纹理特征。Then, the texture feature of the coding unit is determined according to the ratio of the absolute value sum of each element in the horizontal element array to the absolute value sum of each element in the vertical element array.
在一可选实施例中,计算一个编码矩阵中横向元素数组各元素的绝对值和与纵向元素数组各元素的绝对值和的比值,设定横向阈值和纵向阈值,横向阈值和纵向阈值可根据实例需求进行设定,若该比值大于横向阈值,则将该编码矩阵对应编码单元的图像纹理确定为水平纹理。In an optional embodiment, calculate the absolute value sum of each element of the horizontal element array in an encoding matrix and the ratio of the absolute value sum of each element of the vertical element array, set the horizontal threshold value and the vertical threshold value, and the horizontal threshold value and the vertical threshold value can be based on The instance needs to be set. If the ratio is greater than the horizontal threshold, the image texture of the coding unit corresponding to the coding matrix is determined as the horizontal texture.
若该比值小于纵向阈值,则将该编码矩阵对应编码单元的图像纹理确定为垂直纹理。If the ratio is smaller than the vertical threshold, the image texture of the coding unit corresponding to the coding matrix is determined as a vertical texture.
若该比值大于或等于横向阈值且小于或等于纵向阈值,将不划分、四叉树划分、水平扩展四叉树划分、垂直扩展四叉树划分、水平二叉树划分和垂直二叉树划分确定为编码单元的候选划分方式,执行上述步骤S5,示例性地,可以将横向阈值设定为5,纵向阈值设定为3,。If the ratio is greater than or equal to the horizontal threshold and less than or equal to the vertical threshold, no division, quadtree division, horizontally extended quadtree division, vertically extended quadtree division, horizontal binary tree division, and vertical binary tree division are determined as coding units. For the candidate division mode, the above step S5 is executed, for example, the horizontal threshold may be set to 5, and the vertical threshold may be set to 3.
在一可选实施例中,在上述步骤S1之后,上述步骤S2之前,还包括:In an optional embodiment, after the above step S1 and before the above step S2, the method further includes:
首先,确定编码单元信息。First, coding unit information is determined.
在一可选实施例中,编码树单元信息中包括编码单元信息,在标准音视频协议对图像数据进行编码的过程中,可以获取到编码树单元信息,通过编码树单元信息可以确定编码单元信息。In an optional embodiment, the coding tree unit information includes coding unit information, and in the process of encoding the image data by a standard audio and video protocol, the coding tree unit information can be obtained, and the coding unit information can be determined by the coding tree unit information. .
然后,根据编码单元信息确定编码单元的大小,若编码单元的大小等于第一预设值,则执行上述步骤S2。Then, the size of the coding unit is determined according to the coding unit information, and if the size of the coding unit is equal to the first preset value, the foregoing step S2 is performed.
在一可选实施例中,第一预设值可以按照实际需求进行设定,示例性地,第一预设值可以设定为64×64,编码单元信息包括该编码单元的尺寸大小,若编码单元的大小等于64×64,则执行上述步骤S2。In an optional embodiment, the first preset value may be set according to actual requirements. Exemplarily, the first preset value may be set to 64×64, and the coding unit information includes the size of the coding unit. If the size of the coding unit is equal to 64×64, the above step S2 is performed.
若编码单元的大小大于或小于64×64,将不划分、四叉树划分、水平扩展四叉树划分、垂直扩展四叉树划分、水平二叉树划分和垂直二叉树划分确定为编码单元的候选划分方式,执行上述步骤S5。If the size of the coding unit is larger or smaller than 64×64, no division, quadtree division, horizontally extended quadtree division, vertically extended quadtree division, horizontal binary tree division, and vertical binary tree division are determined as the candidate division methods of the coding unit , and execute the above step S5.
在一可选实施例中,在上述步骤S2之后,上述步骤S3之前,还包括:In an optional embodiment, after the above step S2 and before the above step S3, the method further includes:
首先,根据编码矩阵提取复杂度系数矩阵。First, the complexity coefficient matrix is extracted from the coding matrix.
在一可选实施例中,编码矩阵的行列数与该编码矩阵对应编码单元的尺寸一致,若一个编码单元的大小尺寸为64×64,则该编码单元对应的编码矩阵为一个行列都是64的矩阵,经过实验验证,在此64×64的编码矩阵中,取以(1,1)为最左上角,以(8,8)为最右下角一共64个元素组成8×8矩阵,通过该8×8矩阵可以反应出编码单元的图像复杂程度,将此8×8矩阵确定为复杂度系数矩阵。In an optional embodiment, the number of rows and columns of the coding matrix is consistent with the size of the coding unit corresponding to the coding matrix. If the size of a coding unit is 64×64, then the coding matrix corresponding to the coding unit is that a row and column are all 64. The matrix of The 8×8 matrix can reflect the image complexity of the coding unit, and the 8×8 matrix is determined as the complexity coefficient matrix.
然后,若复杂度系数矩阵中各元素的绝对值的和小于第二预设值,则执行上述步骤S3。Then, if the sum of the absolute values of the elements in the complexity coefficient matrix is smaller than the second preset value, the above-mentioned step S3 is performed.
在一可选实施例中,根据实际需求设定第二预设值,示例性地,第二预设值可以设定为1,若复杂度系数矩阵中各元素的绝对值的和小于1则执行上述步骤S3。In an optional embodiment, the second preset value is set according to actual requirements. Exemplarily, the second preset value can be set to 1. If the sum of the absolute values of the elements in the complexity coefficient matrix is less than 1, then Perform the above step S3.
若复杂度系数矩阵中各元素的绝对值的和大于或等于1,将不划分、四叉树划分、水平扩展四叉树划分、垂直扩展四叉树划分、水平二叉树划分和垂直二叉树划分确定为编码单元的候选划分方式,执行上述步骤S5。If the sum of the absolute values of the elements in the complexity coefficient matrix is greater than or equal to 1, no division, quadtree division, horizontally extended quadtree division, vertically extended quadtree division, horizontal binary tree division and vertical binary tree division are determined as For the candidate division mode of the coding unit, perform the above step S5.
在一可选实施例中,本发明实施例提供的图像数据编码方法应用于AVS3标准官方参考软件HPM6.0,符合AVS3编码规范,可以对不同格式视频数据进行编解码。In an optional embodiment, the image data encoding method provided by the embodiment of the present invention is applied to the official reference software HPM6.0 of the AVS3 standard, which conforms to the AVS3 encoding specification and can encode and decode video data in different formats.
在一可选实施例中,提供一种图像数据编码方法,具体流程如图2所示,该方法的步骤为:In an optional embodiment, an image data encoding method is provided. The specific process is shown in FIG. 2 . The steps of the method are:
(1)获取编码树单元(LCU)中编码单元(CU)的信息,其中包括编码单元的大小信息,获取编码树单元中编码单元信息的详细内容参见上述实施例中对步骤S1的描述,在此不再赘述。(1) Obtain the information of the coding unit (CU) in the coding tree unit (LCU), including the size information of the coding unit. For details of obtaining the coding unit information in the coding tree unit, refer to the description of step S1 in the above-mentioned embodiment. This will not be repeated here.
(2)判断编码单元的大小是否为64×64,若编码单元的大小是64×64则执行步骤(3),若编码单元的大小不是64×64,使用标准音视频编码协议中的划分部分对编码单元进行划分,完成划分后执行步骤(7)。(2) Determine whether the size of the coding unit is 64×64. If the size of the coding unit is 64×64, execute step (3). If the size of the coding unit is not 64×64, use the division part in the standard audio and video coding protocol. The coding unit is divided, and step (7) is performed after the division is completed.
(3)对编码单元进行离散余弦变换(DCT),得到编码单元对应的DCT系数,详细内容参见上述实施例中对编码矩阵的描述,在此不再赘述。(3) Discrete cosine transform (DCT) is performed on the coding unit to obtain DCT coefficients corresponding to the coding unit. For details, refer to the description of the coding matrix in the above embodiment, and details are not repeated here.
(4)判断编码单元的复杂度,判断编码单元复杂度的步骤参见上述实施例中的描述,在此不再赘述,若判断编码单元的复杂度为简单则执行步骤(5);若判断编码单元的复杂度为复杂,使用标准音视频编码协议中的划分部分对编码单元进行划分,完成划分后执行步骤(7)。(4) Judging the complexity of the coding unit, the steps of judging the complexity of the coding unit refer to the description in the above-mentioned embodiment, and will not repeat them here, if the complexity of the judging coding unit is simple, then execute step (5); The complexity of the unit is complex, and the coding unit is divided by using the division part in the standard audio and video coding protocol, and step (7) is performed after the division is completed.
(5)判断编码单元是否满足横竖纹特性,详细内容参见上述实施例中对确定编码单元纹理特征步骤的描述,在此不再赘述,若可以确定编码单元纹理特征则编码单元满足横竖纹特性,进而执行步骤(6);若无法确定编码单元纹理特征则编码单元不满足横竖纹特性,使用标准音视频编码协议中的划分部分对编码单元进行划分,完成划分后执行步骤(7)。(5) Judging whether the coding unit satisfies the horizontal and vertical stripe characteristics, refer to the description of the step of determining the texture feature of the coding unit in the above-mentioned embodiment for details, and will not repeat them here. If the texture feature of the coding unit can be determined, the coding unit satisfies the horizontal and vertical stripe characteristics, Then perform step (6); if the texture feature of the coding unit cannot be determined, the coding unit does not meet the horizontal and vertical stripe characteristics, use the division part in the standard audio and video coding protocol to divide the coding unit, and perform step (7) after the division is completed.
(6)根据编码单元的横竖纹特性进行特定方式判决,对特定方式进行遍历确定最终划分方式,根据横竖纹特性确定最终划分方式的详细内容参见上述实施例中对步骤S4、步骤S5的描述,在此不再赘述。(6) Judgment of a specific mode is carried out according to the horizontal and vertical stripe characteristics of the coding unit, the specific mode is traversed to determine the final division mode, and the details of determining the final division mode according to the horizontal and vertical stripe characteristics refer to the description of step S4 and step S5 in the above-mentioned embodiment, It is not repeated here.
(7)判断编码树单元中是否还有编码单元未获得最终划分方式,若还有编码单元未获得最终划分方式,返回步骤(1)进行;若编码树单元中所有的编码单元均获得最终划分方式则使用标准音视频编码协议中的编码部分,结合最终划分方式对待编码图像数据进行编码。(7) judge whether there are coding units in the coding tree unit that have not obtained the final division mode, if there are still coding units that have not obtained the final division mode, return to step (1) to carry out; if all coding units in the coding tree unit have obtained the final division The method uses the encoding part in the standard audio and video encoding protocol, combined with the final division method to encode the image data to be encoded.
本发明实施例提供一种图像数据编码装置,如图3所示,该装置包括:An embodiment of the present invention provides an image data encoding apparatus. As shown in FIG. 3 , the apparatus includes:
信息获取模块31,用于获取待编码图像数据的各编码单元,详细内容参见上述实施例中对步骤S1的描述,在此不再赘述。The
转换模块32,用于对各编码单元进行频率域转换,得到各编码单元的编码矩阵,详细内容参见上述实施例中对步骤S2的描述,在此不再赘述。The
纹理判定模块33,用于根据编码矩阵分别确定各编码单元的纹理特征,详细内容参见上述实施例中对步骤S3的描述,在此不再赘述。The
候选确定模块34,用于根据纹理特征分别确定各编码单元的候选划分方式,详细内容参见上述实施例中对步骤S4的描述,在此不再赘述。The
划分确定模块35,用于对于各编码单元,依次遍历编码单元对应的候选划分方式,确定各编码单元对应的划分方式,详细内容参见上述实施例中对步骤S5的描述,在此不再赘述。The
编码模块36,用于结合各编码单元的划分方式对待编码图像数据进行编码,得到编码结果,详细内容参见上述实施例中对步骤S6的描述,在此不再赘述。The
关于一种图像数据编码装置的具体限定以及有益效果可以参见上文中对于图像数据编码方法的限定,在此不再赘述。上述图像数据编码装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitations and beneficial effects of an image data encoding apparatus, reference may be made to the above limitations on the image data encoding method, which will not be repeated here. Each module in the above-mentioned image data encoding apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
本发明实施例还提供了一种非暂态计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的图像数据编码方法。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存储器(Flash Memory)、硬盘(Hard DiskDrive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;所述存储介质还可以包括上述种类的存储器的组合。Embodiments of the present invention further provide a non-transitory computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the image data encoding method in any of the foregoing method embodiments. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a flash memory (Flash Memory), a hard disk (Hard) DiskDrive, abbreviation: HDD) or solid-state drive (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memories.
本发明实施例还提供一种计算机设备,如图4所示,该计算机设备可以包括至少一个处理器41、至少一个通信接口42、至少一个通信总线43和至少一个存储器44,其中,通信接口42可以包括显示屏(Display)、键盘(Keyboard),可选通信接口42还可以包括标准的有线接口、无线接口。存储器44可以是高速RAM存储器(Random Access Memory,易挥发性随机存取存储器),也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器44可选的还可以是至少一个位于远离前述处理器41的存储装置。存储器44中存储应用程序,且处理器41调用存储器44中存储的程序代码,以用于执行上述任意发明实施例的步骤。An embodiment of the present invention further provides a computer device. As shown in FIG. 4 , the computer device may include at least one
其中,通信总线43可以是外设部件互连标准(peripheral componentinterconnect,简称PCI)总线或扩展工业标准结构(extended industry standardarchitecture,简称EISA)总线等。通信总线43可以分为地址总线、数据总线、控制总线等。为便于表示,图4中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The
其中,存储器44可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器也可以包括非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(英文:hard diskdrive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器34还可以包括上述种类的存储器的组合。The
其中,处理器41可以是中央处理器(英文:central processing unit,缩写:CPU),网络处理器(英文:network processor,缩写:NP)或者CPU和NP的组合。The
其中,处理器41还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic arraylogic,缩写:GAL)或其任意组合。The
可选地,存储器44还用于存储程序指令。处理器41可以调用程序指令,实现如本发明图1实施例中所示的图像数据编码方法。Optionally,
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111672788.7A CN114339220A (en) | 2021-12-31 | 2021-12-31 | A kind of image data encoding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111672788.7A CN114339220A (en) | 2021-12-31 | 2021-12-31 | A kind of image data encoding method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114339220A true CN114339220A (en) | 2022-04-12 |
Family
ID=81021009
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111672788.7A Pending CN114339220A (en) | 2021-12-31 | 2021-12-31 | A kind of image data encoding method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114339220A (en) |
-
2021
- 2021-12-31 CN CN202111672788.7A patent/CN114339220A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015032350A1 (en) | Image compression method and device using block-matching | |
WO2015124058A1 (en) | Coding and decoding method and device | |
CN107565971B (en) | Data compression method and device | |
CN111669582B (en) | Method, encoding end, decoding end and system for encoding and decoding | |
CN110636313A (en) | Transformation and quadratic transformation matrix training method, encoder and related device | |
US8170334B2 (en) | Image processing systems employing image compression and accelerated image decompression | |
WO2019085942A1 (en) | Sao mode decision-making method, apparatus, electronic device and readable storage medium | |
KR20220024966A (en) | Coding Signaling of Transform Skipped Blocks | |
JP2014131332A (en) | Harmony of coefficient coding in hevc | |
US20120033886A1 (en) | Image processing systems employing image compression | |
EP3343446A1 (en) | Method and apparatus for encoding and decoding lists of pixels | |
CN111432212B (en) | Intra-frame division method, system and storage medium based on texture feature | |
CN110352599A (en) | Method and apparatus for video processing | |
CN110913225A (en) | Image encoding method, image encoding device, electronic device, and computer-readable storage medium | |
US20120033881A1 (en) | Image processing systems employing image compression and accelerated decompression | |
CN114339220A (en) | A kind of image data encoding method | |
CN107682699A (en) | A kind of nearly Lossless Image Compression method | |
WO2014000443A1 (en) | Image data compression and decompression method and device | |
US11166021B2 (en) | Methods and apparatuses for coding and decoding mode information and electronic device | |
CN113489983B (en) | Method and device for determining block coding parameters based on correlation comparison | |
CN116934573A (en) | Data reading and writing method, storage medium and electronic equipment | |
CN114365492B (en) | Residual coefficient coding and decoding | |
CN111669579B (en) | Method, encoding end, decoding end and system for encoding and decoding | |
CN114882133B (en) | Image encoding and decoding method, system, device and medium | |
CN111787320B (en) | Transform coding system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |