


技术领域technical field
本发明涉及图象编码技术领域,尤其涉及在编解码中实现量化的技术。The invention relates to the technical field of image coding, in particular to the technology for realizing quantization in coding and decoding.
发明背景Background of the invention
在图象编解码技术中,使用量化矩阵来对变换后的系数进行量化,量化后的数据再经过熵编码得到压缩编码后的码流。可以通过调整量化矩阵中的系数来控制编码后的图象的质量。In image coding and decoding technology, a quantization matrix is used to quantize the transformed coefficients, and the quantized data is entropy coded to obtain a coded stream after compression. The quality of the encoded image can be controlled by adjusting the coefficients in the quantization matrix.
所述的图象包括静止图象、活动图象的一幅、活动图象相邻两幅图象之残差图象以及活动图象中任意幅图象经过运算所得之目标图象。The images include a still image, one of the moving images, a residual image of two adjacent images of the moving image, and a target image obtained by computing any image in the moving image.
在编码中,对于变换系数的量化操作通常是通过量化矩阵实现的,例如可以采用下式进行量化:In coding, the quantization operation for transform coefficients is usually implemented through a quantization matrix, for example, the following formula can be used for quantization:
其中,Coe(i,j)为图象块经过变换后的第(i,j)位置像素的值,简称为变换系数,QM为量化矩阵,QM(i,j)为量化矩阵的系数值,Q(i,j)为量化取整后的变换系数值,简称为量化后系数值,[·]为取整计算。Among them, Coe(i, j) is the value of the pixel at the (i, j)th position after the transformation of the image block, referred to as the transformation coefficient, QM is the quantization matrix, and QM(i, j) is the coefficient value of the quantization matrix, Q(i, j) is the transform coefficient value after quantization and rounding, referred to as the coefficient value after quantization, and [·] is rounding calculation.
由于不同内容的图象的细节代表不同图象的频率,且人眼对图象不同部分的主观感觉不同,因此,针对不同内容的图象,应当采用不同的符合人眼特性的量化方法。Since the details of images with different contents represent the frequency of different images, and the subjective perception of different parts of the image is different to the human eye, therefore, different quantization methods that conform to the characteristics of the human eye should be used for images with different contents.
目前,在JPEG(联合图象专家组),MPEG1(MPEG,运动图象专家组),MPEG2,MPEG4等图象编码标准中,对于编码图象的量化均采用固定的量化矩阵实现,其中,在JPEG图象编码标准中是将量化矩阵放在图象头,而在MPEG1、MPEG2、MPEG4等图象编码标准中则是将量化矩阵放在序列头中;因此,对于序列图象而言,MPEG图象编码标准的量化矩阵是每个序列拥有一个,即针对同一序列采用同一个固定的量化矩阵实现针对图象的量化处理。At present, in image coding standards such as JPEG (Joint Photographic Experts Group), MPEG1 (MPEG, Motion Picture Experts Group), MPEG2, MPEG4, all adopt fixed quantization matrix to realize for the quantization of coded image, wherein, in In the JPEG image coding standard, the quantization matrix is placed in the image header, while in the image coding standards such as MPEG1, MPEG2, and MPEG4, the quantization matrix is placed in the sequence header; therefore, for sequence images, MPEG There is one quantization matrix for each sequence in the image coding standard, that is, the same fixed quantization matrix is used for the same sequence to realize the quantization process for the image.
由于人眼在观看图象时对图象质量的评价是按照人眼察觉到的图象主观质量进行评价的。因而,只有采用符合人眼的视觉特性的量化方法对图象进行量化处理,才能获得较好的主观图象质量。即针对一个图象序列来说,需要选择适合的量化矩阵对其进行量化处理,这样,才能够获得令人满意的主观图象质量。Because the human eye evaluates the image quality according to the subjective quality of the image perceived by the human eye when watching the image. Therefore, only by using a quantization method that conforms to the visual characteristics of the human eye to quantize the image, can better subjective image quality be obtained. That is, for an image sequence, it is necessary to select a suitable quantization matrix for quantization processing, so that satisfactory subjective image quality can be obtained.
然而,由于在一个序列中的图象内容并不是完全相同,会有较大的变化,即在同一个图象序列中各图象的细节各不相同,因此,如果对于整个序列的所有图象均采用同一个量化矩阵实现量化处理,显然无法达到最佳的量化编码后的图象主观质量。However, since the image content in a sequence is not exactly the same, there will be large changes, that is, the details of each image in the same image sequence are different, so if for all the images in the entire sequence Both use the same quantization matrix to implement quantization processing, which obviously cannot achieve the best subjective quality of quantized and coded images.
为此,在H.264/AVC中,在序列头和图象头都提供用户自定义的量化矩阵,以便于可以在图象级改变量化矩阵,以更好地符合视频序列图象之间的内容变化比较大的特点。For this reason, in H.264/AVC, user-defined quantization matrices are provided in both the sequence header and the image header, so that the quantization matrix can be changed at the image level to better conform to the gap between video sequence images. The characteristics of relatively large changes in content.
下面对目前图象编码标准中常用的几种具有代表性质的量化矩阵实现方法进行描述:The following is a description of several representative quantization matrix implementation methods commonly used in current image coding standards:
(1)JPEG中的量化矩阵(1) Quantization matrix in JPEG
在JPEG标准中,只有8×8一种DCT(离散余弦变换)的变换尺寸,因此量化矩阵大小也是8×8,共有64个量化系数,对于图象的亮度分量和色度分量采用不同的量化矩阵,亮度分量的量化矩阵为:In the JPEG standard, there is only one DCT (discrete cosine transform) transformation size of 8×8, so the size of the quantization matrix is also 8×8, with a total of 64 quantization coefficients, and different quantization is used for the brightness and chrominance components of the image Matrix, the quantization matrix of the brightness component is:
QM_Y=[16,11,10,16,24,40,51,61,QM_Y=[16, 11, 10, 16, 24, 40, 51, 61,
12,12,14,19,26,58,60,55, 12, 12, 14, 19, 26, 58, 60, 55,
14,13,16,24,40,57,69,56, 14, 13, 16, 24, 40, 57, 69, 56,
14,17,22,29,51,87,80,62, 14, 17, 22, 29, 51, 87, 80, 62,
18,22,37,56,68,109,103,77, 18, 22, 37, 56, 68, 109, 103, 77,
24,35,55,64,81,104,113,92, 24, 35, 55, 64, 81, 104, 113, 92,
49,64,78,87,103,121,120,101, 49, 64, 78, 87, 103, 121, 120, 101,
72,92,95,98,112,100,103,99];72, 92, 95, 98, 112, 100, 103, 99];
色度分量的量化矩阵为:The quantization matrix for the chroma components is:
QM_C =[17,18,24,47,99,99,99,99,QM_C = [17, 18, 24, 47, 99, 99, 99, 99,
18,21,26,66,99,99,99,99, 18, 21, 26, 66, 99, 99, 99, 99,
24,26,56,99,99,99,99,99,24, 26, 56, 99, 99, 99, 99, 99,
47,66,99,99,99,99,99,99, 47, 66, 99, 99, 99, 99, 99, 99,
99,99,99,99,99,99,99,99,99, 99, 99, 99, 99, 99, 99, 99,
99,99,99,99,99,99,99,99,99, 99, 99, 99, 99, 99, 99, 99,
99,99,99,99,99,99,99,99,99, 99, 99, 99, 99, 99, 99, 99,
99,99,99,99,99,99,99,99];99,99,99,99,99,99,99,99];
JPEG的量化矩阵的所有系数值均放在图象头中,每幅图象只有一个量度量化矩阵和色度量化矩阵。All the coefficient values of the quantization matrix of JPEG are placed in the image header, and each image has only one quantization matrix and chrominance quantization matrix.
(2)MPEG2(2)MPEG2
在MPEG2标准中,只有8×8一种DCT变换尺寸,因此量化矩阵大小也是8×8,共有64个量化系数。对于编码图象分别采用帧内量化矩阵与帧间量化矩阵,其中,帧内量化矩阵为:In the MPEG2 standard, there is only one DCT transformation size of 8×8, so the size of the quantization matrix is also 8×8, and there are 64 quantization coefficients in total. The intra-frame quantization matrix and the inter-frame quantization matrix are respectively used for the coded image, wherein the intra-frame quantization matrix is:
QM_INTRA=[8,16,19,22,26,27,29,34,QM_INTRA=[8, 16, 19, 22, 26, 27, 29, 34,
16,16,22,24,27,29,34,37, 16, 16, 22, 24, 27, 29, 34, 37,
19,22,26,27,29,34,34,38, 19, 22, 26, 27, 29, 34, 34, 38,
22,22,26,27,29,34,37,40,22, 22, 26, 27, 29, 34, 37, 40,
22,26,27,29,32,35,40,48,22, 26, 27, 29, 32, 35, 40, 48,
26,27,29,32,35,40,48,58,26, 27, 29, 32, 35, 40, 48, 58,
26,27,29,34,38,46,56,69,26, 27, 29, 34, 38, 46, 56, 69,
27,29,35,38,46,56,69,83];27, 29, 35, 38, 46, 56, 69, 83];
帧间量化矩阵为:The inter-frame quantization matrix is:
QC_INTER=[16,16,16,16,16,16,16,16,QC_INTER=[16, 16, 16, 16, 16, 16, 16, 16,
16,16,16,16,16,16,16,16, 16, 16, 16, 16, 16, 16, 16, 16,
16,16,16,16,16,16,16,16, 16, 16, 16, 16, 16, 16, 16, 16,
16,16,16,16,16,16,16,16, 16, 16, 16, 16, 16, 16, 16, 16,
16,16,16,16,16,16,16,16, 16, 16, 16, 16, 16, 16, 16, 16,
16,16,16,16,16,16,16,16, 16, 16, 16, 16, 16, 16, 16, 16,
16,16,16,16,16,16,16,16, 16, 16, 16, 16, 16, 16, 16, 16,
16,16,16,16,16,16,16,16];16, 16, 16, 16, 16, 16, 16, 16];
MPEG2只允许每个序列中的所有图象只拥有一个帧内量化矩阵和一个帧间量化矩阵,所有的量化矩阵的64个系数值都是放在序列头。MPEG2也允许用户自定义量化矩阵,自定义的量化矩阵在序列扩展头中。MPEG2 only allows all images in each sequence to have only one intra-frame quantization matrix and one inter-frame quantization matrix, and the 64 coefficient values of all quantization matrices are placed in the sequence header. MPEG2 also allows users to customize the quantization matrix, and the custom quantization matrix is in the sequence extension header.
(3)H.264/AVC标准(3) H.264/AVC standard
在H.264/AVC标准中,有8×8和4×4两种DCT变换尺寸,因此也有与之对应的8×8和4×4两组量化矩阵。对8×8的量化矩阵,共64个系数对不同的频率分量进行量化的缩放;对4×4的矩阵,共16个系数对不同的频率分量进行量化的缩放。In the H.264/AVC standard, there are two DCT transformation sizes of 8×8 and 4×4, so there are also two corresponding quantization matrices of 8×8 and 4×4. For an 8×8 quantization matrix, a total of 64 coefficients quantize and scale different frequency components; for a 4×4 matrix, a total of 16 coefficients quantize and scale different frequency components.
在H.264/AVC High Profile标准中,在序列头和图象头语法中都有量化矩阵。对于4×4的块和8×8的块都有与之对应的量化矩阵。因此,H.264/AVC High Profile允许每个序列的所有图象都拥有同样的量化矩阵,也允许同一序列的不同图象拥有不同的量化矩阵,但是在同一序列的一个图象编码过程中只能使用同一量化矩阵。In the H.264/AVC High Profile standard, there are quantization matrices in the sequence header and image header syntax. There are corresponding quantization matrices for both 4×4 blocks and 8×8 blocks. Therefore, H.264/AVC High Profile allows all images in each sequence to have the same quantization matrix, and also allows different images in the same sequence to have different quantization matrices, but only The same quantization matrix can be used.
因此,在视频编码过程中,通过对量化矩阵的调整可以灵活的控制编码图象的质量。Therefore, in the video coding process, the quality of coded images can be flexibly controlled by adjusting the quantization matrix.
所述的对编码图象质量的控制,是通过对序列头和图象头中量化矩阵系数的调整来控制编码图象的质量。The control of the coded image quality is to control the coded image quality by adjusting the quantization matrix coefficients in the sequence header and the image header.
所述的量化矩阵形式为M×N(M,N=2,4,8,16或其它尺寸)。对于不同尺寸的变换,将有与之对应的量化矩阵。The quantization matrix is in the form of M×N (M, N=2, 4, 8, 16 or other sizes). For transforms of different sizes, there will be corresponding quantization matrices.
目前,在视频编码过程中,是在序列头和图象头中包含整个量化矩阵的所有系数值或者量化矩阵系数值的相关变换值。所述的量化矩阵系数值为图象块变换系数值的对应值,对于图象块变换系数的每一个值,在量化矩阵中都会有一个量化系数值与其相对应。类似的,所述的量化矩阵系数值的相关变换值是指在量化矩阵中存放的可以是量化放缩的原始数值也可以是此数值的相关变换值,例如,与默认矩阵的差值等形式。At present, in the process of video encoding, all coefficient values of the entire quantization matrix or related transformation values of the coefficient values of the quantization matrix are contained in the sequence header and the picture header. The quantization matrix coefficient value is the corresponding value of the transformation coefficient value of the image block. For each value of the transformation coefficient of the image block, there will be a quantization coefficient value corresponding to it in the quantization matrix. Similarly, the relevant transformation value of the quantization matrix coefficient value refers to the original value stored in the quantization matrix, which can be the original value of quantization and scaling, or the relevant transformation value of this value, for example, the difference with the default matrix, etc. .
从上述各种编码方法的具体量化实现方法可以看出,在实际应用过程中,现有技术提供的实现方案,一方面对一个编码图象质量的控制需要调整整个量化矩阵中各个频率分量对应的数值,增加了用户的处理复杂度;另一方面,在传递相应的矩阵系数值的过程中还会带来一定的比特开销,影响系统中图象的编码效率和传输性能。It can be seen from the specific quantization implementation methods of the above-mentioned various encoding methods that in the actual application process, the implementation solutions provided by the prior art, on the one hand, need to adjust the corresponding frequency components of each frequency component in the entire quantization matrix to control the quality of an encoded image. The numerical value increases the processing complexity of the user; on the other hand, a certain bit overhead will be brought in the process of transmitting the corresponding matrix coefficient value, which will affect the encoding efficiency and transmission performance of the image in the system.
发明内容Contents of the invention
本发明实施例提供了一种在编解码中的实现量化的方法和装置,使得在量化过程中仅需要在码流中写入少量的参数,即可实现量化处理,有效提高了编码效率,并可以保证编码后的图象的主观质量。Embodiments of the present invention provide a method and device for realizing quantization in encoding and decoding, so that only a small number of parameters need to be written in the code stream during the quantization process to realize quantization processing, effectively improving the encoding efficiency, and The subjective quality of the encoded image can be guaranteed.
本发明实施例提供了一种在编解码中的实现量化的方法,包括:An embodiment of the present invention provides a method for realizing quantization in encoding and decoding, including:
为系数矩阵频带中的每一个频率区域分别分配相应的频带参数,为不同频带参数在系数矩阵中的分布结构分别分配相应的频带分布参数,根据所述频带参数和频带分布参数建立与所述系数矩阵唯一对应的参数模型;Assigning corresponding frequency band parameters to each frequency region in the coefficient matrix frequency bands, respectively assigning corresponding frequency band distribution parameters to the distribution structure of different frequency band parameters in the coefficient matrix, and establishing a relationship with the coefficients according to the frequency band parameters and the frequency band distribution parameters. The only parameter model corresponding to the matrix;
根据参数模型得到频带参数分布结构对应的频带分布参数以及频带参数的取值,并计算获得频带加权系数;Obtain the frequency band distribution parameters corresponding to the frequency band parameter distribution structure and the value of the frequency band parameters according to the parameter model, and calculate and obtain the frequency band weighting coefficient;
由频带加权系数计算更新所述的系数矩阵获得更新后的系数矩阵;calculating and updating the coefficient matrix by frequency band weighting coefficients to obtain an updated coefficient matrix;
利用更新后的系数矩阵进行编解码的量化处理。The quantization processing of encoding and decoding is performed by using the updated coefficient matrix.
本发明实施例提供了一种在编码中的实现量化的方法,包括:An embodiment of the present invention provides a method for realizing quantization in encoding, including:
根据参数模型对应的模型参数信息生成对应的码流参数,所述的参数模型与系数矩阵唯一对应,且所述的参数模型的建立方式包括:为系数矩阵频带中的每一个频率区域分别分配对应的频带参数,为不同频带参数在系数矩阵中的分布结构分别分配对应的频带分布参数,根据系数矩阵中的频带参数和频带分布参数建立参数模型,所述的模型参数包含频带参数和频带分布参数;Corresponding code stream parameters are generated according to the model parameter information corresponding to the parameter model, the parameter model is uniquely corresponding to the coefficient matrix, and the establishment method of the parameter model includes: assigning corresponding to each frequency region in the frequency band of the coefficient matrix The frequency band parameters of different frequency band parameters are assigned corresponding frequency band distribution parameters for the distribution structure of different frequency band parameters in the coefficient matrix, and the parameter model is established according to the frequency band parameters and frequency band distribution parameters in the coefficient matrix, and the described model parameters include frequency band parameters and frequency band distribution parameters ;
将所述的码流参数写入独立的编码单元头结构。Write the code stream parameters into an independent coding unit header structure.
本发明实施例提供了一种在解码中的实现量化的方法,包括:An embodiment of the present invention provides a method for realizing quantization in decoding, including:
根据编码单元头中的码流参数确定其对应的系数矩阵,所述的码流参数为根据参数模型对应的模型参数信息生成,所述的参数模型与所述系数矩阵唯一对应,且所述的参数模型的建立方式包括:为系数矩阵频带中的每一个频率区域分别分配对应的频带参数,为不同频带参数在系数矩阵中的分布结构分别分配对应的频带分布参数,根据系数矩阵中的频带参数和频带分布参数建立参数模型;Determine the corresponding coefficient matrix according to the code stream parameters in the coding unit header, the code stream parameters are generated according to the model parameter information corresponding to the parameter model, the parameter model is uniquely corresponding to the coefficient matrix, and the The establishment method of the parameter model includes: assigning corresponding frequency band parameters to each frequency region in the coefficient matrix frequency band, respectively assigning corresponding frequency band distribution parameters to the distribution structure of different frequency band parameters in the coefficient matrix, according to the frequency band parameters in the coefficient matrix Establish a parametric model with frequency band distribution parameters;
利用该系数矩阵对编码单元进行量化处理。The coding unit is quantized by using the coefficient matrix.
本发明实施例提供了一种编码端的参数量化装置,包括:An embodiment of the present invention provides a parameter quantization device at the encoding end, including:
量化参数模型存储器,用于存储编码端需要的参数模型包含的模型参数信息,所述的模型参数包含系数矩阵的频带参数和频带分布参数,所述的参数模型的建立方式包括:为系数矩阵频带中的每一个频率区域分别分配对应的频带参数,为不同频带参数在系数矩阵中的分布结构分别分配对应的频带分布参数,根据系数矩阵中的频带参数和频带分布参数建立参数模型;The quantization parameter model memory is used to store the model parameter information contained in the parameter model required by the encoder. The model parameter includes the frequency band parameter and the frequency band distribution parameter of the coefficient matrix. The establishment method of the parameter model includes: the coefficient matrix frequency band Each frequency region in is assigned corresponding frequency band parameters respectively, assigns corresponding frequency band distribution parameters respectively to the distribution structure of different frequency band parameters in the coefficient matrix, and establishes a parameter model according to the frequency band parameters and frequency band distribution parameters in the coefficient matrix;
参数加权量化处理器,用于获取量化参数模型存储器保存的模型参数,根据所述模型参数对图象数据进行量化处理;A parameter weighted quantization processor, used to obtain the model parameters stored in the quantization parameter model memory, and perform quantization processing on the image data according to the model parameters;
模型码流参数处理器,用于将参数加权量化处理器量化图象处理过程中采用的模型参数转换为码流参数,并写入码流中,即写入独立的编码单元头结构中。The model code stream parameter processor is used to convert the model parameters used in the quantization image processing process of the parameter weighted quantization processor into code stream parameters, and write them into the code stream, that is, write them into the independent coding unit header structure.
本发明实施例提供了一种解码端的参数解量化装置,包括:An embodiment of the present invention provides a parameter dequantization device at the decoding end, including:
模型码流参数处理器,用于从码流读取码流参数,根据所述码流参数确定对应的模型参数;A model code stream parameter processor, configured to read code stream parameters from the code stream, and determine corresponding model parameters according to the code stream parameters;
量化参数模型存储器,用于存储模型码流参数处理器获取的模型参数信息,所述的模型参数包含系数矩阵的频带参数和频带分布参数;Quantization parameter model memory, used to store model parameter information obtained by the model stream parameter processor, the model parameters include frequency band parameters and frequency band distribution parameters of the coefficient matrix;
参数加权反量化处理器,用于量化参数模型存储器中获取模型参数信息,并利用所述模型参数信息对图象数据进行反量化操作。The parameter weighted dequantization processor is used to obtain model parameter information from the quantization parameter model memory, and use the model parameter information to perform dequantization operation on image data.
由本发明实施例提供的参数模型量化技术方案可以看出,本发明实施例的实现使得在量化编码过程中仅需要在码流中写入少量的参数,在高层编码单元中使用少量比特就可以使低层次编码单元获得量化矩阵从而有效节省编码处理过程中使用的比特数量;进一步地,因节省了编码比特的使用还可以令编码效率大提高,并可以保证编码后的图象的主观质量。From the parameter model quantization technical solution provided by the embodiment of the present invention, it can be seen that the implementation of the embodiment of the present invention requires only a small number of parameters to be written in the code stream during the quantization coding process, and a small number of bits can be used in the high-level coding unit to make The low-level coding unit obtains the quantization matrix to effectively save the number of bits used in the coding process; further, the coding efficiency can be greatly improved due to the saving of coding bits, and the subjective quality of the coded image can be guaranteed.
附图简要说明Brief description of the drawings
图1(a)为本发明实施例中的模型参数分布结构示意图一;Fig. 1 (a) is the first schematic diagram of the model parameter distribution structure in the embodiment of the present invention;
图1(b)为本发明实施例中的模型参数分布结构示意图二;Fig. 1 (b) is the second schematic diagram of the model parameter distribution structure in the embodiment of the present invention;
图2为本发明实施例所述方法的具体实现过程示意图;FIG. 2 is a schematic diagram of a specific implementation process of the method described in the embodiment of the present invention;
图3为本发明实施例提供的所述装置的具体实现结构示意图。Fig. 3 is a schematic structural diagram of a specific realization of the device provided by the embodiment of the present invention.
实施本发明的方式Modes of Carrying Out the Invention
本发明实施例中,一方面可以通过参数模型控制编码图象质量,以及提升人眼关注的图象部分的图象质量;另一方面,应用本发明实施例只需要在高层语法结构中增加很小的比特开销就可以达到在低层语法结构中获得量化矩阵的目的。In the embodiment of the present invention, on the one hand, the coded image quality can be controlled through the parameter model, and the image quality of the image part that human eyes pay attention to can be improved; on the other hand, the application of the embodiment of the present invention only needs to add a lot of A small bit overhead can achieve the purpose of obtaining the quantization matrix in the low-level syntax structure.
具体一点讲,如图1(a)所示,本发明实施例是将变换系数的不同频带,模型化为只需要若干参数来表示的参数模型形式,该参数模型包括:频带参数分布结构(即频带分布参数)和频带参数。其中,所述的频带参数分布结构可以是一个数字或索引值,代表不同的频带参数分布情况、或频带参数在矩阵中的索引集合、或频带参数在矩阵中的位置分布集合;所述的频带参数是指在不同的频带上代表该频带上的所有加权系数的信息,频带参数可以是一个数字或索引值,代表频率加权量,以及是正向加权,还是负向加权,其中,Specifically, as shown in Figure 1(a), the embodiment of the present invention models the different frequency bands of the transform coefficients into a parametric model form that only needs a few parameters to represent, and the parametric model includes: frequency band parameter distribution structure (i.e. frequency band distribution parameters) and frequency band parameters. Wherein, the frequency band parameter distribution structure can be a number or an index value, representing different frequency band parameter distribution situations, or index sets of frequency band parameters in the matrix, or position distribution sets of frequency band parameters in the matrix; the frequency band The parameter refers to the information representing all weighting coefficients on the frequency band in different frequency bands. The frequency band parameter can be a number or an index value, representing the frequency weighting amount, and whether it is positive weighting or negative weighting. Among them,
加权系数Coe定义为:The weighting coefficient Coe is defined as:
其中,T为确定的阈值,大于该阈值为正向加权,小于该阈值为负向加权。具体通过对人眼感兴趣的频率进行加权,从而可以提高对人眼关注部分的图象质量。Wherein, T is a determined threshold, and if it is greater than this threshold, it is positive weighting, and if it is less than this threshold, it is negative weighting. Specifically, by weighting the frequencies that are of interest to the human eye, the image quality of the portion that is of interest to the human eye can be improved.
本发明实施例提供了一种在编解码中实现量化的方法,具体的实现过程包括:The embodiment of the present invention provides a method for implementing quantization in encoding and decoding, and the specific implementation process includes:
(1)首先,将量化矩阵频带信息进行参数模型化;(1) First, perform parameter modeling on the frequency band information of the quantization matrix;
其中,所述的量化矩阵频带信息包括量化矩阵的频带划分和量化矩阵频带中的值的分布等信息;即将量化矩阵进行频带划分,将划分的频带区域用参数表示,频带参数分布用模式结构表示,所述的参数模型包括但不限于频带参数分布结构(即频带分布参数)和频带参数取值等信息。Wherein, the quantization matrix frequency band information includes information such as the frequency band division of the quantization matrix and the distribution of values in the quantization matrix frequency band; the quantization matrix is about to be divided into frequency bands, and the divided frequency band areas are represented by parameters, and the frequency band parameter distribution is represented by a pattern structure , the parameter model includes but not limited to information such as frequency band parameter distribution structure (ie frequency band distribution parameters) and frequency band parameter values.
(2)之后,由得到的参数模型计算获得相应的量化加权系数,即频带加权系数;(2) Afterwards, the corresponding quantization weighting coefficients, i.e. frequency band weighting coefficients, are calculated by the obtained parameter model;
具体为,根据模型化后的量化矩阵对应的参数模型确定频带参数分布结构和频带参数的取值,进而根据频带参数分布的结构和频带参数的取值计算得到频带量化加权系数;Specifically, determine the frequency band parameter distribution structure and the value of the frequency band parameter according to the parameter model corresponding to the quantization matrix after modeling, and then calculate and obtain the frequency band quantization weighting coefficient according to the structure of the frequency band parameter distribution and the value of the frequency band parameter;
所述的量化加权系数,包括正向加权和负向加权,正向加权是指变换系数频率分量经过加权系数加权后得到了增强,负向加权是指变换系数频率分量经过加权系数加权后得到了减弱。The quantized weighting coefficients include positive weighting and negative weighting. Positive weighting means that the frequency components of the transform coefficients are enhanced after being weighted by the weighting coefficients. Negative weighting means that the frequency components of the transform coefficients are weighted by the weighting coefficients. weakened.
(3)最后,采用量化加权系数计算更新过程(1)中所述的初始量化矩阵,从而获得新的量化矩阵,进而可以使用更新后的新的量化矩阵对图象变换系数进行量化;(3) Finally, the initial quantization matrix described in the update process (1) is calculated by using quantization weighting coefficients, thereby obtaining a new quantization matrix, and then the image transform coefficients can be quantized using the updated new quantization matrix;
具体为,由频带量化加权系数和频带分布结构对量化矩阵进行加权计算得到新的频带量化值,并更新初始量化矩阵;使用更新的量化矩阵对图象变换系数进行量化;对量化矩阵的加权计算包括但不限于加、减、乘、除、移位或滤波等数学形式运算。Specifically, the quantization matrix is weighted and calculated by the frequency band quantization weighting coefficient and the frequency band distribution structure to obtain a new frequency band quantization value, and the initial quantization matrix is updated; the image transformation coefficient is quantized using the updated quantization matrix; the weighted calculation of the quantization matrix Including, but not limited to, mathematical operations such as addition, subtraction, multiplication, division, shifting, or filtering.
本发明实施例还提供了一种在编解码中使用参数模型实现量化码流编解码处理的方法,该方法在具体实现过程中主要包括:The embodiment of the present invention also provides a method of using a parameter model in encoding and decoding to realize encoding and decoding processing of quantized code streams. The method mainly includes in the specific implementation process:
(一)在编码端或码流发送端的处理过程:(1) The processing process at the encoding end or code stream sending end:
(1)首先,由参数模型或者参数模型经任何形式的变换值计算得到相应的码流参数;(1) First, the corresponding code stream parameters are obtained by calculating the parameter model or the parameter model through any form of transformation value;
具体为由确定的参数模型得到模型参数,包括但不限于频带分布结构、频带参数取值等,将模型参数通过变换变成码流参数形式,其中所述的变换是指将一种参数集合A转换为另外一种适合于码流存储的参数集合B;Specifically, the model parameters are obtained from the determined parameter model, including but not limited to the frequency band distribution structure, the value of the frequency band parameters, etc., and the model parameters are transformed into the code stream parameter form, wherein the transformation refers to a parameter set A Convert to another parameter set B suitable for code stream storage;
即:B{x1,x2,...xM}=Ψ(A{x1,x2,...xN}),其中,M,N分别为变换前后的参数集合数目,M与N可以相等,也可以不相等;但变换Ψ必须是一种可逆变换,即:A{x1,x2,...xN}=Ψ-1(B{x1,x2,...xM})。That is: B{x1 , x2 ,...xM }=Ψ(A{x1 , x2 ,...xN }), where M and N are the number of parameter sets before and after transformation, and M It can be equal to or not equal to N; but the transformation Ψ must be a reversible transformation, namely: A{x1 , x2 ,...xN }=Ψ-1 (B{x1 , x2 ,. .. xM }).
(2)之后,再将参数模型码流参数写入编码单元头结构中;(2) Afterwards, write the parameter model code stream parameters into the coding unit header structure;
具体为将参数模型码流参数写入编码单元头结构,每个码流参数分配若干比特,其中:Specifically, the code stream parameters of the parameter model are written into the coding unit header structure, and each code stream parameter is allocated several bits, among which:
所述的比特分配,可以按照固定比特分配,也可以按照可变比特分配;The bit allocation may be based on fixed bit allocation or variable bit allocation;
所述的编码单元包括但不限于序列,图组,图、条带、宏块等独立的编码单元结构;The coding unit includes, but is not limited to, independent coding unit structures such as a sequence, a group of pictures, a picture, a slice, and a macroblock;
所述的头结构是指编码单元的语法头信息,如序列头、图组头、帧头、条带头、宏块头等。The header structure refers to the syntax header information of the coding unit, such as sequence header, picture group header, frame header, slice header, macroblock header and so on.
(二)在解码端或码流接收端的处理:(2) Processing at the decoding end or code stream receiving end:
根据编码单元中的码流参数确定编码单元对应的模型参数,进而根据前面所述的建立参数模型方法确定编码单元对应的系数矩阵,并利用所述系数矩阵对相应的编码单元进行量化处理;Determine the model parameters corresponding to the coding unit according to the code stream parameters in the coding unit, and then determine the coefficient matrix corresponding to the coding unit according to the above-mentioned method for establishing a parameter model, and use the coefficient matrix to perform quantization processing on the corresponding coding unit;
例如,根据在序列头中写入若干比特的码流参数,从而使每幅图象通过计算获得默认的序列量化矩阵;根据在图象头中写入若干比特的码流参数,从而使每幅图象通过计算获得独立的量化矩阵;For example, according to the code stream parameters of several bits written in the sequence header, so that each picture can obtain the default sequence quantization matrix through calculation; according to the code stream parameters of several bits written in the picture header, so that each picture The image obtains an independent quantization matrix through calculation;
在码流接收端,还可以将从高层编码单元的头结构中获取码流参数作为低层编码单元的码流参数的参考,进而确定低层编码单元对应的系数矩阵,并利用所述系数矩阵对相应的编码单元进行量化处理;At the code stream receiving end, the code stream parameters obtained from the header structure of the high-level coding unit can also be used as a reference for the code stream parameters of the low-level coding unit, and then the coefficient matrix corresponding to the low-level coding unit is determined, and the corresponding The coding unit performs quantization processing;
所述的高层编码单元和低层编码单元是独立编码的码流单元结构,低层编码单元是高层编码单元的一个子集,或者是高层编码单元的一个子集的子集,如条带(slice)是图象(picture)的子集,宏块(macroblcok)是条带的子集,则宏块是图象子集的子集;The high-level coding unit and the low-level coding unit are independently coded stream unit structures, and the low-level coding unit is a subset of the high-level coding unit, or a subset of a subset of the high-level coding unit, such as a slice Is a subset of the image (picture), macroblock (macroblcok) is a subset of the slice, then the macroblock is a subset of the image subset;
将高层编码单元的码流参数作为低层编码单元的码流参数的参考的应用举例如下:Examples of applications that use the code stream parameters of the high-level coding unit as a reference for the code stream parameters of the low-level coding unit are as follows:
(1)可以根据在图象头中写入若干比特的码流参数,使图象中的宏块获得默认的图象量化矩阵;即根据图象头中的码流参数确定图象级的模型参数,每个宏块的量化矩阵可以参考图象级的模型参数计算得到,该处理具体可以为:直接利用图象头中的码流参数计算得到宏块的量化矩阵,或者,将所述的图象头中的码流参数根据该宏块的信息(如能量信息等)按照设定的转换方式进行转换获得该宏块的模型参数,进而计算获得该宏块的量化矩阵;(1) The macroblock in the image can obtain the default image quantization matrix according to the code stream parameters of several bits written in the image header; that is, the image-level model can be determined according to the code stream parameters in the image header Parameters, the quantization matrix of each macroblock can be calculated with reference to the model parameters of the image level. The code stream parameters in the image header are converted according to the information of the macroblock (such as energy information, etc.) according to the conversion mode set to obtain the model parameters of the macroblock, and then calculate and obtain the quantization matrix of the macroblock;
(2)还可以根据在图象头中写入若干比特的码流参数,确定图象级的模型参数,在图象中的某些区域的量化矩阵可以参考图象级的模型参数计算得到,具体为图象中的一类区域直接利用所述的模型参数计算该类区域的量化矩阵,或者,将所述的模型参数根据该类区域的信息(如能量信息等)按照设定的转换方式进行转换获得该类区域的模型参数,进而计算获得该类区域的量化矩阵。这样,对于每个特定区域无需增加任何比特,就可以拥有独立的量化矩阵。所述的分类区域类型包括但不限于块、宏块、条带,以及特定对象(即指定对象)等。(2) It is also possible to determine the model parameters of the image level according to the bit stream parameters written in the image header, and the quantization matrix of some regions in the image can be calculated with reference to the model parameters of the image level, Specifically, a type of area in the image directly uses the model parameters to calculate the quantization matrix of this type of area, or converts the described model parameters according to the information (such as energy information, etc.) of this type of area according to the set conversion method Perform conversion to obtain the model parameters of this type of area, and then calculate and obtain the quantization matrix of this type of area. In this way, it is possible to have independent quantization matrices for each specific region without adding any bits. The types of classified areas include, but are not limited to, blocks, macroblocks, slices, and specific objects (namely designated objects).
为便于对本发明实施例的理解,下面将结合图2对本发明实施例的具体实现过程进行详细的说明。To facilitate the understanding of the embodiment of the present invention, the specific implementation process of the embodiment of the present invention will be described in detail below with reference to FIG. 2 .
本发明实施例提供的在编解码中进行参数模型量化过程的实现如图2所示,具体包括:The implementation of the parameter model quantization process in encoding and decoding provided by the embodiment of the present invention is shown in Figure 2, specifically including:
在编码端的处理过程包括:The processing on the encoding side includes:
步骤21:将量化矩阵频带信息进行参数模型化;Step 21: Parameterize the frequency band information of the quantization matrix into a parameter model;
根据量化矩阵的变换系数的特性以及人眼视觉特性将系数矩阵划分为若干个频带,每个频带代表不同大小的系数频率,也代表不同类型的系数频率;频带划分可以按照正向加权区域、负向加权区域、不变区域划分;也可以按照变换系数频率大小或者变换系数频率类型划分;系数块可以是为M×N(M,N=2,4,8,16或其它尺寸);对于变换系数频带中的每一个频率区域,分配一个参数表示,对于不同参数在变换系数矩阵中的分布结构分配一种频带分布参数;According to the characteristics of the transformation coefficients of the quantization matrix and the characteristics of human vision, the coefficient matrix is divided into several frequency bands. Each frequency band represents the frequency of coefficients of different sizes, and also represents the frequency of coefficients of different types; Divide into the weighted area and the invariant area; it can also be divided according to the frequency of the transform coefficient or the frequency type of the transform coefficient; the coefficient block can be M×N (M, N=2, 4, 8, 16 or other sizes); for transform Each frequency region in the coefficient frequency band is assigned a parameter representation, and a frequency band distribution parameter is assigned to the distribution structure of different parameters in the transformation coefficient matrix;
步骤22:由参数模型计算得到频带加权系数;Step 22: Obtain the frequency band weighting coefficient by calculating the parameter model;
步骤23:由频带加权系数更新初始的量化矩阵计算得到新的量化矩阵,并使用更新的量化矩阵对图象变换系数进行量化;Step 23: update the initial quantization matrix by the frequency band weighting coefficients to calculate a new quantization matrix, and use the updated quantization matrix to quantize the image transform coefficients;
步骤24:由参数模型对应的模型参数或者模型参数的变换值得到相应的码流参数;Step 24: Obtain the corresponding code stream parameters from the model parameters corresponding to the parameter model or the transformed values of the model parameters;
步骤25:将所述的码流参数写入编码单元头结构中;Step 25: Write the code stream parameters into the coding unit header structure;
即在编码时,将模型参数按照参数集合映射方法变换成模型参数比特流,存储在码流中的编码单元头结构中;That is, during encoding, the model parameters are converted into model parameter bit streams according to the parameter set mapping method, and stored in the coding unit header structure in the code stream;
在解码端的处理过程包括:The processing at the decoding end includes:
步骤26:根据收到的码流中的码流参数确定当前宏块的量化矩阵;Step 26: Determine the quantization matrix of the current macroblock according to the code stream parameters in the received code stream;
即在解码时,首先从独立编码单元头结构中取出模型参数比特流,按照语法结构定义得到各个模型参数比特,按照参数集合逆映射还原出模型参数,再根据模型参数中的频带参数分布结构、频带参数、以及是正向加权还是逆向加权来计算得到加权系数矩阵,将加权系数矩阵作用到量化矩阵上得到更新了的量化矩阵,对每个编码单元例如宏块都可以计算其独立的量化矩阵。That is, when decoding, firstly, the model parameter bit stream is taken out from the independent coding unit header structure, and each model parameter bit is obtained according to the syntax structure definition, and the model parameters are restored according to the inverse mapping of the parameter set, and then according to the frequency band parameter distribution structure, The weighting coefficient matrix is obtained by calculating the frequency band parameters and whether it is forward weighted or reverse weighted, and the weighted coefficient matrix is applied to the quantization matrix to obtain an updated quantization matrix. For each coding unit such as a macroblock, its independent quantization matrix can be calculated.
为便于对本发明实施例的理解,下面仍参照图1(a)所示,以8×8图象块、6个模型参数为例显示的几种参数分布结构,其中,每一种参数分布结构,对应于不同的频段划分方式,即对应一种频带分布参数q_mode;同一参数分布结构中,每一频段分配一个参数,因此,通过频带分布参数q_mode和频带参数(p1~ph)则可以唯一确定一种参数量化模型(参数模型)。In order to facilitate the understanding of the embodiments of the present invention, the following still refers to several parameter distribution structures shown in Fig. 1(a), taking 8×8 image blocks and 6 model parameters as examples, wherein each parameter distribution structure , corresponding to different frequency band division methods, that is, corresponding to a frequency band distribution parameter q_mode; in the same parameter distribution structure, each frequency band is assigned a parameter, so the frequency band distribution parameter q_mode and frequency band parameters (p1~ph) can be uniquely determined A parameter quantization model (parametric model).
相应的参数量化模型实施例1:Corresponding parameter quantization model embodiment 1:
如图1(a)中给出了8×8矩阵,6个频带参数(q_para[i],i=1…6),4个频带分布参数(q_mode=0…3)的量化参数模型例子。Figure 1(a) shows an example of quantization parameter model of 8×8 matrix, 6 frequency band parameters (q_para[i], i=1...6), and 4 frequency band distribution parameters (q_mode=0...3).
即图1(a)中,分配了6个参数(pl,pa,pb,pc,pd,ph)分别代表了6个频段,每一个8×8矩阵中,参数(pl,pa,pb,pc,pd,ph)在矩阵中的分布位置都不同,即对应一种分布模型,该分布模型用频带分布参数q_mode表示。That is, in Figure 1(a), 6 parameters (pl, pa, pb, pc, pd, ph) are assigned to represent 6 frequency bands, and in each 8×8 matrix, the parameters (pl, pa, pb, pc , pd, ph) have different distribution positions in the matrix, which corresponds to a distribution model, which is represented by the frequency band distribution parameter q_mode.
例如,图1(a)中共列出4种分布模型,即频带分布参数q_mode可以取值为0、1、2、3。For example, there are four distribution models listed in Figure 1(a), that is, the frequency band distribution parameter q_mode can take values of 0, 1, 2, and 3.
即相应的量化模型表示为:That is, the corresponding quantization model is expressed as:
WQx,y[i]=(q_mode,q_para[i])i=1…6,x,y=0...7;WQx,y [i]=(q_mode,q_para[i]) i=1...6, x,y=0...7;
或者,or,
WQx,y[i]=(q_para[i],q_mode)i=1…6,x,y=0...7。WQx,y [i]=(q_para[i],q_mode)i=1...6, x,y=0...7.
其中,WQ为加权量化参数矩阵,i为量化系数频带分组索引,即量化参数索引。x,y为加权量化参数在加权量化矩阵WQ中的分布位置,其值由q_mode所确定的频带分布模型决定,具体参照图1(a)所示。Wherein, WQ is a weighted quantization parameter matrix, and i is a quantization coefficient frequency band group index, that is, a quantization parameter index. x, y are the distribution positions of the weighted quantization parameters in the weighted quantization matrix WQ, and their values are determined by the frequency band distribution model determined by q_mode, as shown in Fig. 1(a) for details.
参数量化模型实施例2:Parameter quantization model embodiment 2:
如图1(b)中给出了8×8矩阵,7个频带参数(q_para[i],i=1…7),4个频带分布参数的量化参数模型例子。As shown in Fig. 1(b), an example of quantization parameter model of 8×8 matrix, 7 frequency band parameters (q_para[i], i=1...7), and 4 frequency band distribution parameters is given.
即在如图1(b)中,给出了一个7个参数分布结构的例子,其中,7个参数(pdc,pl,pa,pb,pc,pd,ph)分别代表了7个频带;此时,相应的参数量化模型即可以表示为:That is, in Figure 1(b), an example of a distribution structure of 7 parameters is given, where the 7 parameters (pdc, pl, pa, pb, pc, pd, ph) represent 7 frequency bands respectively; When , the corresponding parameter quantization model can be expressed as:
WQx,y[i]=(q_mode,q_para[i])i=1…7,x,y=0...7;WQx,y [i]=(q_mode,q_para[i]) i=1...7, x,y=0...7;
或者,or,
WQx,y[i]=(q_para[i],q_mode)i=1…7,x,y=0...7。WQx,y [i]=(q_para[i],q_mode)i=1...7, x,y=0...7.
因此,具有n个频带参数的参数量化模型可以表示为:Therefore, a parametric quantization model with n band parameters can be expressed as:
WQx,y[i]=(q_mode,q_para[i]),i=1…n,x=0...M-1,y=0...N-1 (2)WQx, y [i]=(q_mode, q_para[i]), i=1...n, x=0...M-1, y=0...N-1 (2)
或者,or,
WQx,y[i]=(q_para[i],q_mode)i=1…n,x=0...M-1,y=0...N-1 (3)WQx, y [i]=(q_para[i], q_mode) i=1...n, x=0...M-1, y=0...N-1 (3)
其中,n<M×N(M,N=2,4,8,16或其它尺寸,M,N为变换系数块矩阵或量化矩阵的尺寸)。Wherein, n<M×N (M, N=2, 4, 8, 16 or other sizes, M, N are sizes of transform coefficient block matrix or quantization matrix).
参数量化模型实施例3:Parameter Quantization Model Embodiment 3:
如图1(a)中给出了8×8矩阵,4组6个频带参数(q_para[i],i=1…6),4个频带分布参数(q_mode=0…3)的量化参数模型例子。As shown in Figure 1(a), an 8×8 matrix, 4 groups of 6 frequency band parameters (q_para[i], i=1...6), and a quantization parameter model of 4 frequency band distribution parameters (q_mode=0...3) example.
其中,q_para[i],i=1…n为一组频带参数,每给定一组q_para[i]的值,i=1…n,即确定了一个参数集合,参数集合索引记为wq_paramk;Among them, q_para[i], i=1...n is a group of frequency band parameters, each given a set of q_para[i] values, i=1...n, that is, a parameter set is determined, and the parameter set index is recorded as wq_paramk ;
以图1(a)所示的6频带参数模型为例,对于不同的频带参数(p1,pa,pb,pc,pd,ph)取值,可以得到不同频带参数的参数集合,例如:Taking the 6-band parameter model shown in Figure 1(a) as an example, for different frequency-band parameters (p1, pa, pb, pc, pd, ph) values, parameter sets of different frequency-band parameters can be obtained, for example:
第1组频带参数:wq_param1=(pl1,pa1,pb1,pc1,pd1,ph1)The first group of frequency band parameters: wq_param1 = (pl1 , pa1 , pb1 , pc1 , pd1 , ph1 )
=(128,98,106,116,116,128)= (128, 98, 106, 116, 116, 128)
第2组频带参数:wq_param2=(pl2,pa2,pb2,pc2,pd2,ph2)=(135,143,143,160,160,213)The second group of frequency band parameters: wq_param2 =(pl2 , pa2 , pb2 , pc2 , pd2 , ph2 )=(135, 143, 143, 160, 160, 213)
第3组频带参数:wq_param3=(pl3,pa3,pb3,pc3,pd3,ph3)=(128,167,154,141,141,128)The third group of frequency band parameters: wq_param3 = (pl3 , pa3 , pb3 , pc3 , pd3 , ph3 ) = (128, 167, 154, 141, 141, 128)
第4组频带参数:wq_param4=(pl4,pa4,pb4,pc4,pd4,ph4)The fourth group of frequency band parameters: wq_param4 =(pl4 , pa4 , pb4 , pc4 , pd4 , ph4 )
=(122,115,115,102,102,78)=(122,115,115,102,102,78)
因此,具有n个频带参数的参数量化模型也可以表示为如下参数集合索引形式,即:Therefore, the parameter quantization model with n frequency band parameters can also be expressed as the following parameter set index form, namely:
WQx,y[i]=(q_mode,wq_paramk),其中,k=1…K为参数集合索引值,x=0...M-1,y=0...N-1;(4)WQx, y [i]=(q_mode, wq_paramk ), wherein, k=1...K is the parameter set index value, x=0...M-1, y=0...N-1; (4 )
或者,or,
WQx,y[i]=(wq_paramk,q_mode),其中,下标k=1…K为参数集合索引值,x=0...M-1,y=0...N-1。(5)WQx, y [i]=(wq_paramk , q_mode), where subscripts k=1...K are parameter set index values, x=0...M-1, y=0...N-1. (5)
对于图1(a),假设q_mode=0,即使用图1(a)中的第1个参数分布方式,则对于第一组参数:wq_param1=(128,98,106,116,116,128),对应的8×8矩阵,6个频带参数的量化参数模型WQx,y[i]就可以表示为:For Figure 1(a), assuming q_mode=0, that is, using the first parameter distribution in Figure 1(a), then for the first group of parameters: wq_param1 = (128, 98, 106, 116, 116, 128 ), the corresponding 8×8 matrix, the quantization parameter model WQx, y [i] of 6 frequency band parameters can be expressed as:
WQx,y[i]=(q_mode,wq_param1)=(0,128,98,106,116,116,128)(6)WQx, y [i] = (q_mode, wq_param1 ) = (0, 128, 98, 106, 116, 116, 128) (6)
或者,or,
WQx,y[i]=(wq_param1,q_mode)=(128,98,106,116,116,128,0)(7)WQx, y [i] = (wq_param1 , q_mode) = (128, 98, 106, 116, 116, 128, 0) (7)
对应于式(6)或(7)表示的量化参数模型,根据图1(a)中的第1个参数分布方式q_mode=0,对应的频带加权系数矩阵为:Corresponding to the quantization parameter model represented by formula (6) or (7), according to the first parameter distribution mode q_mode=0 in Fig. 1(a), the corresponding frequency band weighting coefficient matrix is:
对于图1(a),假设q_mode=1,即使用图1(a)中的第2个参数分布方式,则对于第2组参数:wq_param2=(135,143,143,160,160,213),对应的8×8矩阵,6个频带参数的量化参数模型WQx,y[i]就可以表示为:For Figure 1(a), assuming q_mode=1, that is, using the second parameter distribution method in Figure 1(a), then for the second group of parameters: wq_param2 =(135,143,143,160,160,213 ), the corresponding 8×8 matrix, the quantization parameter model WQx, y [i] of 6 frequency band parameters can be expressed as:
WQx,y[i]=(q_mode,wq_param2)WQx, y [i] = (q_mode, wq_param2 )
=(1,135,143,143,160,160,213)(9)=(1,135,143,143,160,160,213)(9)
或者,or,
WQx,y[i]=(wq_param2,q_mode)WQx, y [i] = (wq_param2 , q_mode)
=(135,143,143,160,160,213,1)(10)=(135, 143, 143, 160, 160, 213, 1)(10)
对应于式(9)或(10)表示的量化参数模型,图1(a)中的第2个参数分布方式q_mode=1,对应的频带加权系数矩阵为:Corresponding to the quantization parameter model represented by formula (9) or (10), the second parameter distribution mode q_mode=1 in Fig. 1(a), the corresponding frequency band weighting coefficient matrix is:
对应于第1组参数:wq_param1=(128,98,106,116,116,128)和第2组参数:wq_param2=(135,143,143,160,160,213),以及图1(a)中的4种参数分布方式,可以列出对应的8个典型频带加权系数矩阵分别为:Corresponding to the first group of parameters: wq_param1 = (128, 98, 106, 116, 116, 128) and the second group of parameters: wq_param2 = (135, 143, 143, 160, 160, 213), and Fig. 1 ( For the four parameter distribution methods in a), the corresponding eight typical frequency band weighting coefficient matrices can be listed as follows:
对应于第1组参数:wq_param1,q_mode=0…3Corresponding to the first group of parameters: wq_param1 , q_mode=0...3
Coe(wq_param1q_mode=0) Coe(wq_param1q_mode=1)Coe(wq_param1 q_mode=0) Coe(wq_param1 q_mode=1)
=[128 128 128 116 116 116 128 128 =[128 128 128 116 116 116 128 128=[128 128 128 116 116 116 128 128 =[128 128 128 116 116 116 128 128
128 128 116 116 116 116 128 128 128 128 116 116 116 116 128 128128 128 116 116 116 116 128 128 128 128 116 116 116 116 128 128
128 116 106 106 98 98 128 128 128 116 106 106 106 98 128 128128 116 106 106 98 98 128 128 128 116 106 106 106 98 128 128
116 116 106 106 98 128 128 128 116 116 106 106 98 128 128 128116 116 106 106 98 128 128 128 116 116 106 106 98 128 128 128
116 116 98 98 128 128 128 128 116 116 106 98 128 128 128 128116 116 98 98 128 128 128 128 116 116 106 98 128 128 128 128
116 116 98 128 128 128 128 128 116 116 98 128 128 128 128 128116 116 98 128 128 128 128 128 116 116 98 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128] 128 128 128 128 128 128 128 128]128 128 128 128 128 128 128 128] 128 128 128 128 128 128 128 128]
Coe(wq_param1 q_mode=2) Coe(wq_param1 q_mode=3)Coe(wq_param1 q_mode=2) Coe(wq_param1 q_mode=3)
=[128 128 128 116 116 116 128 128 =[128 128 128 116 106 98 128 128=[128 128 128 116 116 116 128 128 =[128 128 128 116 106 98 128 128
128 128 116 116 116 106 128 128 128 128 116 116 106 98 128 128128 128 116 116 116 106 128 128 128 128 116 116 106 98 128 128
128 116 116 116 106 98 128 128 128 116 116 116 106 98 128 128128 116 116 116 106 98 128 128 128 116 116 116 106 98 128 128
116 116 116 106 98 128 128 128 116 116 116 116 106 128 128 128116 116 116 106 98 128 128 128 116 116 116 116 106 128 128 128
116 116 106 98 128 128 128 128 106 106 106 106 128 128 128 128116 116 106 98 128 128 128 128 106 106 106 106 128 128 128 128
116 106 98 128 128 128 128 128 98 98 98 128 128 128 128 128116 106 98 128 128 128 128 128 98 98 98 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128] 128 128 128 128 128 128 128 128]128 128 128 128 128 128 128 128] 128 128 128 128 128 128 128 128]
对应于第2组参数:wq_param2,q_mode=0…3Corresponding to the second group of parameters: wq_param2 , q_mode=0...3
Coe(wq_param2 q_mode=0) Coe(wq_param2 q_mode=2)Coe(wq_param2 q_mode=0) Coe(wq_param2 q_mode=2)
=[135 135 135 160 160 160 213 213 =[135 135 135 160 160 160 213 213=[135 135 135 160 160 160 213 213 =[135 135 135 160 160 160 213 213
135 135 160 160 160 160 213 213 135 135 160 160 160 143 213 213135 135 160 160 160 160 213 213 135 135 160 160 160 143 213 213
135 160 143 143 143 143 213 213 135 160 160 160 143 143 213 213135 160 143 143 143 143 213 213 135 160 160 160 143 143 213 213
160 160 143 143 143 213 213 213 160 160 160 143 143 213 213 213160 160 143 143 143 213 213 213 160 160 160 143 143 213 213 213
160 160 143 143 213 213 213 213 160 160 143 143 213 213 213 213160 160 143 143 213 213 213 213 160 160 143 143 213 213 213 213
160 160 143 213 213 213 213 213 160 143 143 213 213 213 213 213160 160 143 213 213 213 213 213 160 143 143 213 213 213 213 213
213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213
213 213 213 213 213 213 213 213] 213 213 213 213 213 213 213 213]213 213 213 213 213 213 213 213] 213 213 213 213 213 213 213 213]
Coe(wq_param2 q_mode=1) Coe(wq_param2 q_mode=3)Coe(wq_param2 q_mode=1) Coe(wq_param2 q_mode=3)
=[135 135 135 160 160 160 213 213 =[135 135 135 160 143 143 213 213=[135 135 135 160 160 160 213 213 =[135 135 135 160 143 143 213 213
135 135 160 160 160 160 213 213 135 135 160 160 143 143 213 213135 135 160 160 160 160 213 213 135 135 160 160 143 143 213 213
135 160 143 143 143 143 213 213 135 160 160 160 143 143 213 213135 160 143 143 143 143 213 213 135 160 160 160 143 143 213 213
160 160 143 143 143 213 213 213 160 160 160 160 143 213 213 213160 160 143 143 143 213 213 213 160 160 160 160 143 213 213 213
160 160 143 143 213 213 213 213 143 143 143 143 213 213 213 213160 160 143 143 213 213 213 213 143 143 143 143 213 213 213 213
160 160 143 213 213 213 213 213 143 143 143 213 213 213 213 213160 160 143 213 213 213 213 213 143 143 143 213 213 213 213 213
213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213
213 213 213 213 213 213 213 213] 213 213 213 213 213 213 213 213]213 213 213 213 213 213 213 213] 213 213 213 213 213 213 213 213]
根据量化参数模型实现量化码流编解码处理实施例一:Embodiment 1 of implementing quantized code stream encoding and decoding processing according to the quantization parameter model:
在编码端:On the encoding side:
假设参数量化模型使用如式(2)的表示方式,基于图1(a)所示的6参数模型,假定编码单元头结构为图像头,则相应的在编码端的处理过程具体可以包括以下处理步骤:Assuming that the parameter quantization model uses the expression method of formula (2), based on the 6-parameter model shown in Figure 1(a), assuming that the coding unit header structure is an image header, the corresponding processing at the encoding end may specifically include the following processing steps :
(1)由模型参数(q_mode,q_para[i])i=1…6,计算得到频带加权系数;若取加权阈值T=10,则当q_para[i]大于T时为正向加权,小于T时为负向加权;(1) Calculate the frequency band weighting coefficient from the model parameters (q_mode, q_para[i]) i=1...6; if the weighted threshold T=10, then when q_para[i] is greater than T, it is positively weighted, and less than T is negatively weighted;
例如,分布方式q_mode=0的一种6参数量化模型为:For example, a 6-parameter quantization model with distribution q_mode=0 is:
(q_mode=0,q_para[1~6])=(0,0,3,2,1,1,-1);(q_mode=0, q_para[1~6])=(0, 0, 3, 2, 1, 1, -1);
则频带参数为:q_para[1~6]=(10,13,12,11,11,9)。Then the frequency band parameter is: q_para[1˜6]=(10, 13, 12, 11, 11, 9).
(2)由频带加权系数计算得到新的量化矩阵,使用更新后的新的量化矩阵进行量化;(2) A new quantization matrix is obtained by calculating the frequency band weighting coefficient, and quantization is performed using the updated new quantization matrix;
由(q_mode,q_para[i])i=1…6得到的频带加权系数矩阵为:The frequency band weighting coefficient matrix obtained by (q_mode, q_para[i])i=1...6 is:
若加权系数矩阵的作用方式为乘法,则QM*=QM×[coe],其中,QM*为更新的量化矩阵;If the mode of action of the weighting coefficient matrix is multiplication, then QM* =QM×[coe], wherein, QM* is the updated quantization matrix;
(3)将量化模型频带分布参数q_mode与频带参数q_para[1~6]变成码流参数,码流编码假设采用se(v)编码;(3) Change the quantization model frequency band distribution parameter q_mode and frequency band parameter q_para[1~6] into code stream parameters, and the code stream encoding assumes se(v) encoding;
(q_mode=0,q_para[1~6])=(0,0,3,2,1,1,-1),用se(v)编码方式编码;(q_mode=0, q_para[1~6])=(0, 0, 3, 2, 1, 1, -1), encoded by se(v) encoding method;
(4)将模型编码码流参数写入到图象头(picture_header)中。(4) Write the code stream parameters of the model into the picture header (picture_header).
在解码端:On the decoding side:
对应前面的编码处理方式,在解码端相应的处理包括:Corresponding to the previous encoding processing method, the corresponding processing at the decoding end includes:
(1)从图象头中提取并解析出模型参数,(q_mode,q_para[i])i=1…6=(0,0,3,2,1,1,-1)(1) Extract and parse the model parameters from the image header, (q_mode, q_para[i]) i=1...6=(0, 0, 3, 2, 1, 1, -1)
(2)模型参数(q_mode,q_para[1~6])得到频带加权系数矩阵[coe],例如(q_mode=0,q_para[1~6])=(0,0,3,2,1,1,-1)。(2) Model parameters (q_mode, q_para[1~6]) to obtain the frequency band weighting coefficient matrix [coe], for example (q_mode=0, q_para[1~6])=(0,0,3,2,1,1 ,-1).
(3)由频带加权系数矩阵[coe]根据QM*=QM×[coe]计算得到当前帧的量化矩阵QM*,从而得到帧级自适应的量化矩阵。(3) Calculate the quantization matrix QM* of the current frame from the frequency band weighting coefficient matrix [coe] according to QM* =QM×[coe], thereby obtaining a frame-level adaptive quantization matrix.
根据量化参数模型实现量化码流编解码处理实施例二:Embodiment 2 of implementing quantized code stream encoding and decoding processing according to the quantization parameter model:
在编码端:On the encoding side:
假设参数量化模型使用如式(4)的表示方式,基于图1(a)所示的6参数模型,假定编码单元头结构为图像头,则相应的在编码端的处理过程具体可以包括以下步骤:Assuming that the parameter quantization model uses the expression method of formula (4), based on the 6-parameter model shown in Figure 1(a), assuming that the coding unit header structure is an image header, the corresponding processing at the encoding end may specifically include the following steps:
(1)由量化参数模型WQx,y[i]=(q_mode,wq_paramk)计算得到频带加权系数,其中,k=1…K,x=0...M-1,y=0...N-1;(1) Calculate the frequency band weighting coefficients from the quantization parameter model WQx, y [i]=(q_mode, wq_paramk ), where k=1...K, x=0...M-1, y=0.. .N-1;
若取加权阈值T=128,则当q_para[i]大于128时为正向加权,小于128时为负向加权;If the weighted threshold T=128, then when q_para[i] is greater than 128, it is positive weighting, and when it is less than 128, it is negative weighting;
例如,对于分布方式q_mode=0,使用参数组为wq_param1=(128,98,106,116,116,128),即参数索引值为1的6参数量化模型为:For example, for the distribution mode q_mode=0, the parameter set is wq_param1 = (128, 98, 106, 116, 116, 128), that is, the 6-parameter quantization model with a parameter index value of 1 is:
WQx,y[i]=(q_mode,wq_param1)=(0,128,98,106,116,116,128)因此频带参数为:wq_param1=(128,98,106,116,116,128);WQx, y [i] = (q_mode, wq_param1 ) = (0, 128, 98, 106, 116, 116, 128) so the frequency band parameter is: wq_param1 = (128, 98, 106, 116, 116, 128 );
若以T=128为所有6个加权参数的阈值,则写入码流的模型参数可以表示为:(q_mode=0,q_para[1~6])=(0,0,-30,-22,-12,-12,0);If T=128 is the threshold value of all 6 weighting parameters, then the model parameters written into the code stream can be expressed as: (q_mode=0, q_para[1~6])=(0, 0, -30, -22, -12, -12, 0);
(2)由频带加权系数计算得到新的量化矩阵,使用更新后的新的量化矩阵进行量化;(2) A new quantization matrix is obtained by calculating the frequency band weighting coefficient, and quantization is performed using the updated new quantization matrix;
由WQx,y[i]=(q_mode,wq_param1)得到的频带加权系数矩阵为:The frequency band weighting coefficient matrix obtained by WQx, y [i]=(q_mode, wq_param1 ) is:
若加权系数矩阵的作用方式为乘法,则QM*=QM×[coe],其中,若QM为量化矩阵,则QM*为更新的量化矩阵;若QM为系数放缩矩阵,则QM*为更新的系数放缩矩阵;If the function of the weighting coefficient matrix is multiplication, then QM* =QM×[coe], wherein, if QM is a quantization matrix, then QM* is an updated quantization matrix; if QM is a coefficient scaling matrix, then QM* is an update The coefficient scaling matrix of ;
(3)将量化模型频带分布参数q_mode与频带参数q_para[1~6]变成码流参数,(q_mode=0,q_para[1~6])=(0,0,-30,-22,-12,-12),然后对码流编码假设采用se(v)编码方式编码。(3) Change the quantization model frequency band distribution parameter q_mode and frequency band parameter q_para[1~6] into code stream parameters, (q_mode=0, q_para[1~6])=(0,0,-30,-22,- 12, -12), and then assume that the code stream is encoded by se(v) encoding.
(4)将模型编码码流参数q_mode,q_para[1~6]写入到图象头(picture_header)中;也可以将模型编码码流参数q_mode,wq_param1写入到图象头(picture_header)中。(4) Write the model code stream parameters q_mode, q_para[1~6] into the picture header (picture_header); you can also write the model code stream parameters q_mode, wq_param1 into the picture header (picture_header) .
在解码端:On the decoding side:
对应前面的编码处理方式,在解码端相应的处理包括:Corresponding to the previous encoding processing method, the corresponding processing at the decoding end includes:
(1)从图象头中提取并解析出模型码流参数,(q_mode,wq_param1)或(q_mode,q_para[i])i=1…6=(0,0,-30,-22,-12,-12,0)(1) Extract and parse the model stream parameters from the image header, (q_mode, wq_param1 ) or (q_mode, q_para[i])i=1...6=(0,0,-30,-22,- 12, -12, 0)
(2)由模型码流参数(q_mode,q_para[1~6])得到频带加权系数矩阵[coe],例如:(q_mode=0,q_para[1~6])=(0,0,-30,-22,-12,-12,0)。(2) Obtain the frequency band weighting coefficient matrix [coe] by the model stream parameter (q_mode, q_para[1~6]), for example: (q_mode=0, q_para[1~6])=(0,0,-30, -22, -12, -12, 0).
若以T=128为所有6个加权参数的阈值,则解码得到的频带参数为,wq_param1=(128,98,106,116,116,128)。If T=128 is used as the threshold value of all 6 weighting parameters, the frequency band parameter obtained by decoding is wq_param1 =(128, 98, 106, 116, 116, 128).
解码得到的量化参数模型为:The quantization parameter model obtained by decoding is:
WQx,y[i]=(q_mode,wq_param1)=(0,128,98,106,116,116,128)根据量化参数模型计算得到频带加权系数矩阵[coe],则为:WQx, y [i]=(q_mode, wq_param1 )=(0,128,98,106,116,116,128) calculate the frequency band weighting coefficient matrix [coe] according to the quantization parameter model, then it is:
(3)由频带加权系数矩阵[coe]根据QM*=QM×[coe]计算得到当前帧的更新的反量化矩阵或逆放缩矩阵QM*;(3) Calculate the updated inverse quantization matrix or inverse scaling matrix QM* of the current frame according to QM* =QM×[coe] by the frequency band weighting coefficient matrix [coe];
若QM为反量化矩阵,则QM*为更新的反量化矩阵;若QM为系数逆放缩矩阵,则QM*为更新的系数逆放缩矩阵。If QM is an inverse quantization matrix, then QM* is an updated inverse quantization matrix; if QM is a coefficient inverse scaling matrix, then QM* is an updated coefficient inverse scaling matrix.
本发明实施例还包括一种在图象等编解码中的参数量化装置,该装置的结构图如图3所示,具体包括编码端的参数量化器(即编码端的参数量化装置)和解码端的参数解量化器(即解码端的参数解量化装置),下面将分别对两者进行详细说明。The embodiment of the present invention also includes a parameter quantization device in encoding and decoding such as images. The structure diagram of the device is shown in Figure 3, which specifically includes a parameter quantizer at the encoding end (that is, a parameter quantization device at the encoding end) and a parameter quantization device at the decoding end. The dequantizer (that is, the parameter dequantization device at the decoding end), both of which will be described in detail below.
(一)编码端的参数量化器(1) Parameter quantizer at the encoding end
其用于在编码端完成参数加权量化处理,主要由参数加权量化处理器、量化参数模型存储器、参数量化模型码流参数处理器组成,其中,It is used to complete parameter weighted quantization processing at the encoding end, and is mainly composed of a parameter weighted quantization processor, a quantization parameter model memory, and a parameter quantization model code stream parameter processor, among which,
(1)量化参数模型存储器(1) Quantization parameter model memory
用于存储编码端需要的参数量化模型参数信息,具体可以包括:It is used to store the parameter information of the parameter quantization model required by the encoder, which can specifically include:
若干个频带参数集存储单元:用于存储编码端的频带参数,系数矩阵频带划分的每一组参数就存储在一个频带参数集存储单元中;频带参数集存储单元数目可以根据存储的频带参数组数所确定;在编码端量化器中,该频带参数集存储单元的数目可以根据实际需要进行增减。Several frequency band parameter set storage units: used to store the frequency band parameters of the encoding end, each group of parameters of the coefficient matrix frequency band division is stored in a frequency band parameter set storage unit; the number of frequency band parameter set storage units can be based on the number of frequency band parameter groups stored determined; in the quantizer at the encoding end, the number of storage units of the frequency band parameter set can be increased or decreased according to actual needs.
参数集单元地址索引存储器:用于存储所有编码端的频带参数集存储单元地址信息;通过该地址,量化参数模型存储器可以读取对应的频带参数集存储单元中存储的一组频带参数集的值。Parameter set unit address index memory: used to store the address information of the frequency band parameter set storage unit of all encoders; through this address, the quantization parameter model memory can read the value of a group of frequency band parameter sets stored in the corresponding frequency band parameter set storage unit.
频带分布参数存储单元:用于存储模型参数包含的频带分布参数,例如,用于存储作为频带分布参数的图1(a)和图1(b)所示的分布模型矩阵。Frequency band distribution parameter storage unit: for storing the frequency band distribution parameters included in the model parameters, for example, for storing the distribution model matrix shown in Fig. 1(a) and Fig. 1(b) as the frequency band distribution parameters.
在编码端的量化参数模型存储器中,还可以包括模型参数控制器,用于控制量化模型参数的变化;典型地,该控制器可以直接控制读取频带参数集存储单元中信息;或者,根据参数集单元地址索引存储器中的地址信息,间接控制读取频带参数集存储单元中的信息;该控制器还可以控制读取频带分布参数存储单元中的信息。In the quantization parameter model memory at the encoding end, a model parameter controller may also be included to control the change of quantization model parameters; typically, the controller may directly control the reading of information in the frequency band parameter set storage unit; or, according to the parameter set The unit address indexes the address information in the memory, and indirectly controls the reading of the information in the frequency band parameter set storage unit; the controller can also control the reading of the information in the frequency band distribution parameter storage unit.
另外,还需要说明以下三点:In addition, the following three points need to be explained:
1、以上量化参数模型存储器可以放在编码端量化器中的存储模块中,也可以从量化器中独立出来,作为编码端独立的存储单元;1. The above quantization parameter model memory can be placed in the storage module of the quantizer at the encoding end, or can be separated from the quantizer as an independent storage unit at the encoding end;
2、显然,n个频带参数集存储单元在物理存储器中存储空间可以以不连续的方式存放;通过参数集地址索引存储器,可以很容易的寻址到某个频带参数集存储单元的首地址;2. Obviously, the storage space of n frequency band parameter set storage units in the physical memory can be stored in a discontinuous manner; through the parameter set address index memory, the first address of a certain frequency band parameter set storage unit can be easily addressed;
3、频带分布参数存储单元、频带参数集存储单元或参数集地址索引存储器在物理存储器中的存储空间可以以连续的方式存放,也可以以不连续的方式存放。3. The storage space of the frequency band distribution parameter storage unit, the frequency band parameter set storage unit or the parameter set address index memory in the physical memory can be stored in a continuous manner or in a discontinuous manner.
(2)参数加权量化处理器(2) Parameter weighted quantization processor
用于编码端从量化参数模型存储器获取参数模型包含的频带参数和分布参数,并计算频带加权系数矩阵、量化矩阵或缩放矩阵,完成编码端的图像量化操作过程;该处理器具体可以包括,It is used for the encoding end to obtain the frequency band parameters and distribution parameters contained in the parameter model from the quantization parameter model memory, and calculate the frequency band weighting coefficient matrix, quantization matrix or scaling matrix, and complete the image quantization operation process of the encoding end; the processor may specifically include,
频带加权系数计算单元:用于根据量化参数模型存储器中存储的频带参数和频带分布参数计算频带加权系数矩阵。Frequency band weighting coefficient calculation unit: used to calculate the frequency band weighting coefficient matrix according to the frequency band parameters and frequency band distribution parameters stored in the quantization parameter model memory.
量化操作矩阵计算和更新单元:用于根据所述的频带加权系数计算单元计算获得的频带加权系数矩阵,计算和更新当前量化操作矩阵,包括量化矩阵或缩放变换矩阵;对所述量化矩阵或缩放变换的加权计算包括但不限于加、减、乘、除、移位或滤波等数学形式运算。Quantization operation matrix calculation and update unit: used to calculate and update the current quantization operation matrix according to the frequency band weighting coefficient matrix calculated by the frequency band weighting coefficient calculation unit, including quantization matrix or scaling transformation matrix; The weighting calculation of transformation includes, but is not limited to, mathematical operations such as addition, subtraction, multiplication, division, shifting, or filtering.
量化计算单元:使用更新后的量化操作矩阵,包括更新后的量化矩阵或缩放变换矩阵,完成图像数据的量化操作。Quantization calculation unit: use the updated quantization operation matrix, including the updated quantization matrix or scaling transformation matrix, to complete the quantization operation of the image data.
(3)模型码流参数处理器(3) Model stream parameter processor
用于将编码端用到的量化模型参数变换为适合在编码码流中存储的码流参数;所述的码流参数存储在编码码流中独立编码单元的头结构中,该处理器具体可以包括,It is used to transform the quantization model parameters used by the encoding end into code stream parameters suitable for storage in the code stream; the code stream parameters are stored in the header structure of the independent coding unit in the code stream, and the processor can specifically include,
模型码流参数处理单元:用于读取当前编码端量化参数模型存储器中的参数信息,包括频带参数值或频带参数存储单元的地址或索引值,以及频带分布参数值;根据读取的模型参数值计算适合于码流中存储的码流参数;例如,可以采用差分编码器或se(v)编码器等形式实现所述的处理操作。Model code stream parameter processing unit: used to read the parameter information in the quantization parameter model memory of the current encoding end, including the frequency band parameter value or the address or index value of the frequency band parameter storage unit, and the frequency band distribution parameter value; according to the read model parameters The value calculation is suitable for the code stream parameters stored in the code stream; for example, the above processing operation can be implemented in the form of a differential coder or a se(v) coder.
码流参数存储单元:用于将模型码流参数处理单元输出的模型参数的码流参数写入到独立编码单元头结构中;包括但不限于序列头、图像组头、图像头、条带头、宏块头、块头等。Code stream parameter storage unit: used to write the code stream parameters of the model parameters output by the model code stream parameter processing unit into the independent coding unit header structure; including but not limited to sequence header, picture group header, picture header, strip header, Macroblock header, block header, etc.
(二)解码端的参数解量化器(2) Parameter dequantizer at the decoding end
其用于为解码端完成参数加权反量化的装置,主要包括量化参数模型存储器、参数加权反量化处理器、参数量化模型码流参数处理器,其中,It is a device for completing parameter weighted dequantization for the decoding end, mainly including a quantization parameter model memory, a parameter weighted dequantization processor, and a parameter quantization model stream parameter processor, wherein,
(1)量化参数模型存储器(1) Quantization parameter model memory
其用于存储解码端需要的量化参数模型包含的模型参数信息,具体可以包括:若干个频带参数集存储单元、参数集单元地址索引存储器、频带分布参数存储单元;It is used to store the model parameter information contained in the quantization parameter model required by the decoding end, and may specifically include: several frequency band parameter set storage units, parameter set unit address index memory, and frequency band distribution parameter storage unit;
解码端该量化参数模型存储器与编码端的量化参数模型存储器工作原理和功能完全相同;所不同的是,在解码端,该量化参数模型存储器不包括模型参数控制器:而对量化参数模型存储器中的模型参数信息的更新控制来自于模型码流参数处理器的计算结果。The working principle and function of the quantization parameter model memory at the decoding end are exactly the same as those at the encoding end; the difference is that at the decoding end, the quantization parameter model memory does not include a model parameter controller: while for the quantization parameter model memory in the The update control of the model parameter information comes from the calculation result of the model stream parameter processor.
(2)参数加权反量化处理器(2) Parameter weighted dequantization processor
其用于解码端从量化参数模型存储器获取模型参数包含的频带参数和分布参数,并计算频带加权系数矩阵、反量化矩阵或反缩放矩阵,以完成解码端的图像反量化操作过程;反量化的图像数据送到图像解码器的下一个单元中处理,如反变换处理单元等;It is used at the decoding end to obtain the frequency band parameters and distribution parameters contained in the model parameters from the quantization parameter model memory, and calculate the frequency band weighting coefficient matrix, inverse quantization matrix or inverse scaling matrix to complete the image inverse quantization operation process at the decoding end; the inverse quantized image The data is sent to the next unit of the image decoder for processing, such as the inverse transformation processing unit, etc.;
所述的参数加权反量化处理器具体可以包括:The parameter weighted inverse quantization processor specifically may include:
频带加权系数计算单元:用于根据量化参数模型存储器中的频带参数和频带分布参数计算频带加权系数矩阵;Frequency band weighting coefficient calculation unit: used to calculate the frequency band weighting coefficient matrix according to the frequency band parameters and frequency band distribution parameters in the quantization parameter model memory;
反量化操作矩阵计算和更新单元:用于根据频带加权系数矩阵,计算和更新当前反量化操作矩阵,包括反量化矩阵或反缩放变换矩阵;对所述的反量化矩阵或反缩放变换矩阵的加权计算包括但不限于加、减、乘、除、移位或滤波等数学形式运算;Inverse quantization operation matrix calculation and update unit: used to calculate and update the current inverse quantization operation matrix according to the frequency band weighting coefficient matrix, including inverse quantization matrix or inverse scaling transformation matrix; weighting the inverse quantization matrix or inverse scaling transformation matrix Calculations include, but are not limited to, mathematical operations such as addition, subtraction, multiplication, division, shifting, or filtering;
反量化计算单元:使用更新后的反量化操作矩阵,包括反量化矩阵或反缩放变换矩阵,完成图像数据的反量化操作。Inverse quantization calculation unit: use the updated inverse quantization operation matrix, including inverse quantization matrix or inverse scaling transformation matrix, to complete the inverse quantization operation of image data.
(3)模型码流参数处理器(3) Model stream parameter processor
其用于读取存储在编码码流中的量化模型的码流参数信息,转化为量化模型参数后送到量化模型存储器中更新或暂存;It is used to read the code stream parameter information of the quantized model stored in the encoded code stream, convert it into quantized model parameters and send it to the quantized model memory for updating or temporary storage;
该模型码流参数处理器具体可以包括,The model stream parameter processor may specifically include:
码流参数读取单元:用于从接收到的码流的独立编码单元头结构中读取码流参数;所述的独立编码单元头结构包括但不限于序列头、图像组头、图像头、条带头、宏块头、块头等。Code stream parameter reading unit: used to read the code stream parameters from the independent coding unit header structure of the received code stream; the independent coding unit header structure includes but not limited to sequence header, picture group header, picture header, Slice header, macroblock header, block header, etc.
模型码流参数处理单元:用于将所述码流参数读取单元读取的模型码流参数信息转换为模型参数信息,包括频带参数值或频带参数的索引值、以及频带分布模型参数值;之后,将转换得到的量化模型参数值发送到量化参数模型存储器中更新或暂存。Model code stream parameter processing unit: used to convert the model code stream parameter information read by the code stream parameter reading unit into model parameter information, including frequency band parameter values or index values of frequency band parameters, and frequency band distribution model parameter values; Afterwards, the converted quantized model parameter values are sent to the quantized parameter model memory for updating or temporary storage.
计算转换器根据编码端的采用的形式,具体可以采用差分编码器或se(v)编码器等形式。According to the form adopted by the encoding end, the calculation converter may specifically adopt a form such as a differential encoder or a se(v) encoder.
综上所述,本发明实施例中,通过参数模型取代量化矩阵模型,从而使得对于图象变换系数的量化采用参数化的量化形式,只要控制若干参数就可以得到符合人眼视觉特性的量化矩阵,使得用户可以通过几个参数而不是通过量化矩阵就可以控制编码图象的质量。而且,由于无需在码流中存储较大的量化矩阵信息,仅仅需要存储若干个对应的参数信息即可,因此,编码效率大大提高;同时,还由于仅使用若干个参数便可以完成对图象变换系数的量化计算,使得还可以很容易地令量化操作适应图象的内容信息特征,即在编码码率相当的条件下,可以方便地保留图象的细节信息,从而提升量化编码后图象的主观质量。To sum up, in the embodiment of the present invention, the quantization matrix model is replaced by the parameter model, so that the quantization of the image transformation coefficient adopts a parametric quantization form, and a quantization matrix that conforms to the visual characteristics of the human eye can be obtained as long as several parameters are controlled. , so that the user can control the quality of the encoded image through several parameters rather than through the quantization matrix. Moreover, because there is no need to store large quantization matrix information in the code stream, only a few corresponding parameter information need to be stored, so the coding efficiency is greatly improved; at the same time, because only a few parameters can be used to complete the image The quantization calculation of transform coefficients makes it easy to adapt the quantization operation to the content information characteristics of the image, that is, under the condition of equivalent coding bit rate, the detailed information of the image can be easily preserved, thereby improving the quantized and encoded image. subjective quality.
总之,本发明实施例所述的方法或装置具有如下优点:In a word, the method or device described in the embodiment of the present invention has the following advantages:
(1)在相同的编码码率下,采用量化参数模型编码保留了图象的细节信息,提高了编码图象的主观质量;(1) Under the same coding rate, the detailed information of the image is preserved by adopting the quantization parameter model coding, and the subjective quality of the coded image is improved;
(2)提供给用户一种灵活地改变图象主观质量的方法;(2) Provide users with a method to flexibly change the subjective quality of images;
(3)提供了一种在高层编码单元中使用少量比特就可以使低层次编码单元获得量化矩阵的方法,并且可以节省比特率,提高编码效率。(3) It provides a method for obtaining a quantization matrix for a low-level coding unit by using a small number of bits in a high-level coding unit, which can save bit rates and improve coding efficiency.
而且,经实验证明,在图象编码过程中,在同样的编码码率条件下,使用本发明实施例所述方法明显地提高了图象的主观质量。Moreover, it has been proved by experiments that in the process of image encoding, under the same encoding bit rate condition, using the method described in the embodiment of the present invention can obviously improve the subjective quality of the image.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 200710087419CN101039421A (en) | 2006-03-16 | 2007-03-16 | Method and apparatus for realizing quantization in coding/decoding process |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN200610064857.5 | 2006-03-16 | ||
| CN200610064857 | 2006-03-16 | ||
| CN 200710087419CN101039421A (en) | 2006-03-16 | 2007-03-16 | Method and apparatus for realizing quantization in coding/decoding process |
| Publication Number | Publication Date |
|---|---|
| CN101039421Atrue CN101039421A (en) | 2007-09-19 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 200710087419PendingCN101039421A (en) | 2006-03-16 | 2007-03-16 | Method and apparatus for realizing quantization in coding/decoding process |
| Country | Link |
|---|---|
| CN (1) | CN101039421A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101540901B (en)* | 2008-03-20 | 2011-04-06 | 华为技术有限公司 | Method and device for coding/decoding |
| CN101854535B (en)* | 2009-03-31 | 2011-10-05 | 郑州大学 | Embedded Video Encoder Quantization Method |
| CN102223527A (en)* | 2010-04-13 | 2011-10-19 | 华为技术有限公司 | Weighting quant coding and decoding methods of frequency band and apparatus thereof |
| CN102281446A (en)* | 2011-09-20 | 2011-12-14 | 西南交通大学 | Visual-perception-characteristic-based quantification method in distributed video coding |
| CN101911699B (en)* | 2008-01-09 | 2012-12-12 | 摩托罗拉移动公司 | Method and apparatus for highly scalable intra-frame video coding |
| WO2013064109A1 (en)* | 2011-11-04 | 2013-05-10 | 华为技术有限公司 | Image coding and decoding method and device |
| WO2013067949A1 (en)* | 2011-11-08 | 2013-05-16 | 华为技术有限公司 | Matrix encoding method and device thereof, and matrix decoding method and device thereof |
| CN103716623A (en)* | 2013-12-17 | 2014-04-09 | 北京大学深圳研究生院 | Video compression encoding-and-decoding method and encoder-decoder on the basis of weighting quantification |
| CN103765788A (en)* | 2011-08-23 | 2014-04-30 | 联发科技(新加坡)私人有限公司 | Method and system for processing transform blocks according to quantization matrix in video coding |
| CN105282552A (en)* | 2010-12-09 | 2016-01-27 | 索尼公司 | Image processing device and image processing method |
| CN105519108A (en)* | 2012-01-09 | 2016-04-20 | 华为技术有限公司 | Weighted prediction method and device for quantization matrix coding |
| CN106611432A (en)* | 2015-10-21 | 2017-05-03 | 深圳市腾讯计算机系统有限公司 | Picture format conversion method, device and system |
| CN107071419A (en)* | 2011-11-07 | 2017-08-18 | 佳能株式会社 | Image encoding apparatus and method and image decoding apparatus and method |
| CN107483947A (en)* | 2012-01-30 | 2017-12-15 | 三星电子株式会社 | Video encoding and decoding device and non-transitory computer readable storage medium |
| US10257514B2 (en) | 2014-07-24 | 2019-04-09 | Huawei Technologies Co., Ltd. | Adaptive dequantization method and apparatus in video coding |
| TWI730659B (en)* | 2019-03-10 | 2021-06-11 | 聯發科技股份有限公司 | Method and apparatus of the quantization matrix computation and representation for video coding |
| WO2021197158A1 (en)* | 2020-03-31 | 2021-10-07 | 华为技术有限公司 | Image processing method and image processing device |
| CN116760988A (en)* | 2023-08-18 | 2023-09-15 | 瀚博半导体(上海)有限公司 | Video coding method and device based on human visual system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101911699B (en)* | 2008-01-09 | 2012-12-12 | 摩托罗拉移动公司 | Method and apparatus for highly scalable intra-frame video coding |
| CN101540901B (en)* | 2008-03-20 | 2011-04-06 | 华为技术有限公司 | Method and device for coding/decoding |
| CN101854535B (en)* | 2009-03-31 | 2011-10-05 | 郑州大学 | Embedded Video Encoder Quantization Method |
| CN102223527A (en)* | 2010-04-13 | 2011-10-19 | 华为技术有限公司 | Weighting quant coding and decoding methods of frequency band and apparatus thereof |
| CN102223527B (en)* | 2010-04-13 | 2013-04-17 | 华为技术有限公司 | Weighting quantification coding and decoding methods of frequency band and apparatus thereof |
| CN105791842A (en)* | 2010-12-09 | 2016-07-20 | 索尼公司 | Image processing device and image processing method |
| CN105282552A (en)* | 2010-12-09 | 2016-01-27 | 索尼公司 | Image processing device and image processing method |
| US10218977B2 (en) | 2011-08-23 | 2019-02-26 | Hfi Innovation Inc. | Method and system of transform block processing according to quantization matrix in video coding |
| US9560347B2 (en) | 2011-08-23 | 2017-01-31 | Hfi Innovation Inc. | Method and system of transform block processing according to quantization matrix in video coding |
| CN103765788A (en)* | 2011-08-23 | 2014-04-30 | 联发科技(新加坡)私人有限公司 | Method and system for processing transform blocks according to quantization matrix in video coding |
| CN103765788B (en)* | 2011-08-23 | 2015-08-05 | 联发科技(新加坡)私人有限公司 | Method and system for processing transform blocks according to quantization matrix in video coding |
| CN102281446A (en)* | 2011-09-20 | 2011-12-14 | 西南交通大学 | Visual-perception-characteristic-based quantification method in distributed video coding |
| US9667958B2 (en) | 2011-11-04 | 2017-05-30 | Huawei Technologies Co., Ltd. | Image coding and decoding methods and apparatuses |
| US10091531B2 (en) | 2011-11-04 | 2018-10-02 | Huawei Technologies Co., Ltd. | Image coding and decoding methods and apparatuses |
| WO2013064109A1 (en)* | 2011-11-04 | 2013-05-10 | 华为技术有限公司 | Image coding and decoding method and device |
| US10750192B2 (en) | 2011-11-07 | 2020-08-18 | Canon Kabushiki Kaisha | Image coding apparatus, image coding method, image decoding apparatus, image decoding method, and storage medium |
| CN107071419B (en)* | 2011-11-07 | 2019-12-20 | 佳能株式会社 | Image encoding apparatus and method, and image decoding apparatus and method |
| CN107071419A (en)* | 2011-11-07 | 2017-08-18 | 佳能株式会社 | Image encoding apparatus and method and image decoding apparatus and method |
| US10652554B2 (en) | 2011-11-07 | 2020-05-12 | Canon Kabushiki Kaisha | Image coding apparatus, image coding method, image decoding apparatus, image decoding method, and storage medium |
| US10645401B2 (en) | 2011-11-07 | 2020-05-05 | Canon Kabushiki Kaisha | Image coding apparatus, image coding method, image decoding apparatus, image decoding method, and storage medium |
| US10742982B2 (en) | 2011-11-08 | 2020-08-11 | Huawei Technologies Co., Ltd. | Method and apparatus for coding matrix and method and apparatus for decoding matrix |
| WO2013067949A1 (en)* | 2011-11-08 | 2013-05-16 | 华为技术有限公司 | Matrix encoding method and device thereof, and matrix decoding method and device thereof |
| US9565429B2 (en) | 2011-11-08 | 2017-02-07 | Huawei Technologies Co., Ltd. | Method and apparatus for coding matrix and method and apparatus for decoding matrix |
| US10123016B2 (en) | 2011-11-08 | 2018-11-06 | Huawei Technologies Co., Ltd. | Method and apparatus for coding matrix and method and apparatus for decoding matrix |
| US11265547B2 (en) | 2011-11-08 | 2022-03-01 | Huawei Technologies Co., Ltd. | Method and apparatus for coding matrix and method and apparatus for decoding matrix |
| CN105519108A (en)* | 2012-01-09 | 2016-04-20 | 华为技术有限公司 | Weighted prediction method and device for quantization matrix coding |
| CN107483947A (en)* | 2012-01-30 | 2017-12-15 | 三星电子株式会社 | Video encoding and decoding device and non-transitory computer readable storage medium |
| CN107623853B (en)* | 2012-01-30 | 2020-07-03 | 三星电子株式会社 | Video encoding and decoding method and non-transitory computer-readable storage medium |
| CN107483947B (en)* | 2012-01-30 | 2020-04-07 | 三星电子株式会社 | Video encoding and decoding apparatus and non-transitory computer-readable storage medium |
| CN107623853A (en)* | 2012-01-30 | 2018-01-23 | 三星电子株式会社 | Video encoding and decoding method and non-transitory computer readable storage medium |
| CN103716623A (en)* | 2013-12-17 | 2014-04-09 | 北京大学深圳研究生院 | Video compression encoding-and-decoding method and encoder-decoder on the basis of weighting quantification |
| CN103716623B (en)* | 2013-12-17 | 2017-02-15 | 北京大学深圳研究生院 | Video compression encoding-and-decoding method and encoder-decoder on the basis of weighting quantification |
| US10257514B2 (en) | 2014-07-24 | 2019-04-09 | Huawei Technologies Co., Ltd. | Adaptive dequantization method and apparatus in video coding |
| CN106611432A (en)* | 2015-10-21 | 2017-05-03 | 深圳市腾讯计算机系统有限公司 | Picture format conversion method, device and system |
| CN106611432B (en)* | 2015-10-21 | 2020-09-04 | 深圳市腾讯计算机系统有限公司 | Picture format conversion method, device and system |
| TWI730659B (en)* | 2019-03-10 | 2021-06-11 | 聯發科技股份有限公司 | Method and apparatus of the quantization matrix computation and representation for video coding |
| US12095993B2 (en) | 2019-03-10 | 2024-09-17 | Hfi Innovation Inc. | Method and apparatus of the quantization matrix computation and representation for video coding |
| WO2021197158A1 (en)* | 2020-03-31 | 2021-10-07 | 华为技术有限公司 | Image processing method and image processing device |
| US12022078B2 (en) | 2020-03-31 | 2024-06-25 | Huawei Technologies Co., Ltd. | Picture processing method and apparatus |
| CN116760988A (en)* | 2023-08-18 | 2023-09-15 | 瀚博半导体(上海)有限公司 | Video coding method and device based on human visual system |
| CN116760988B (en)* | 2023-08-18 | 2023-11-10 | 瀚博半导体(上海)有限公司 | Video coding method and device based on human visual system |
| Publication | Publication Date | Title |
|---|---|---|
| CN101039421A (en) | Method and apparatus for realizing quantization in coding/decoding process | |
| CN1297148C (en) | Animation image encoding transmission system, animation image encoding transmission method, suitable encoding device, decoding device, encoding method, decoding method and program used in the system and method | |
| CN1206864C (en) | Association rate distortion optimized code rate control method and apparatus thereof | |
| CN1251518C (en) | Digital signal conversion method and digital signal conversion device | |
| CN1204751C (en) | Coded data converting method, recoding method, recoding system and data recording medium | |
| CN1251515C (en) | Image code processing device and image code processing program | |
| CN1335724A (en) | Coding apparatus and coding method | |
| CN1867034A (en) | Image signal processing apparatus, camera system and image signal processing method | |
| CN1159916C (en) | Moving image coding apparatus and method thereof | |
| CN1701616A (en) | Image information encoding device and method, and image information decoding device and method | |
| CN1874409A (en) | Image signal processing apparatus, camera system and image signal processing method | |
| CN1703096A (en) | Prediction encoder/decoder, prediction encoding/decoding method, and recording medium | |
| CN1922886A (en) | Image encoding method, its device, and its control program | |
| CN1719905A (en) | Coding apparatus, coding method, coding method program, and recording medium recording the coding method program | |
| CN1299560A (en) | Image coding method, image coding/decoding method, image coder, or image recording/reproducing apparatus | |
| CN1578468A (en) | Video decoding apparatus | |
| CN1993993A (en) | Image processing device, program thereof, and method thereof | |
| CN1898965A (en) | Moving image encoding method and apparatus | |
| CN1509575A (en) | Image encoding method and image decoding method | |
| CN1288641A (en) | Video Signal encoding method, video signal encoder, and program recorded medium | |
| CN1835548A (en) | Decoding apparatus, decoding method and program product therefor | |
| CN1744720A (en) | Variable length decoding device | |
| CN1364033A (en) | A High Performance Coding and Compression System for Dynamic Image Information | |
| CN101039435A (en) | Method and apparatus for realizing self-adaptive scanning in image coding process | |
| CN1662069A (en) | Encoding/decoding method of image and video signal |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
| WD01 | Invention patent application deemed withdrawn after publication |