CN113473154B - Video encoding method, video decoding method, video encoding device, video decoding device and storage medium - Google Patents

Video encoding method, video decoding method, video encoding device, video decoding device and storage medium Download PDF

Info

Publication number
CN113473154B
CN113473154B CN202110735696.2A CN202110735696A CN113473154B CN 113473154 B CN113473154 B CN 113473154B CN 202110735696 A CN202110735696 A CN 202110735696A CN 113473154 B CN113473154 B CN 113473154B
Authority
CN
China
Prior art keywords
indication information
codeword
video
quantization
coefficients
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110735696.2A
Other languages
Chinese (zh)
Other versions
CN113473154A (en
Inventor
魏亮
陈方栋
王莉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Gaohang Intellectual Property Operation Co ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202110735696.2A priority Critical patent/CN113473154B/en
Publication of CN113473154A publication Critical patent/CN113473154A/en
Application granted granted Critical
Publication of CN113473154B publication Critical patent/CN113473154B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/94Vector quantisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the application discloses a video coding method, a video decoding method, a video coding device, a video decoding device and a storage medium, and belongs to the technical field of multimedia. In the embodiment of the application, a vector quantization method may be adopted to quantize coefficients to be encoded in a plurality of transform coefficient matrices to obtain corresponding first indication information, and then a video code stream of a target video is generated according to a plurality of code word indication information including the first indication information. Subsequently, the decoding end can decode the vector quantized coefficient according to the first indication information. Therefore, the embodiment of the application provides a video coding and decoding method based on vector quantization, the application of the vector quantization in video coding and decoding is realized, and compared with scalar quantization and network coding quantization, the quantization performance is improved, and further the performance of the video coding and decoding is improved.

Description

视频编码、视频解码方法、装置及存储介质Video encoding, video decoding method, device and storage medium

技术领域technical field

本申请涉及多媒体技术领域,特别涉及一种视频编码、视频解码方法、装置及存储介质。The present application relates to the field of multimedia technologies, and in particular to a video encoding and decoding method, device and storage medium.

背景技术Background technique

随着多媒体技术的发展,视频编码技术得到广泛重视。在对视频进行编码时,需要将视频的残差信号进行离散余弦变换,从而得到变换系数矩阵。之后,将变换系数矩阵中包括的变换系数进行量化,进而根据量化结果确定视频码流。目前,量化技术主要包括标量量化、矢量量化和网格编码量化,其中,标量量化和网格编码量化已经广泛的应用于视频编解码中,但是矢量量化还未能在视频编解码中进行应用,基于此,亟需提供一种基于矢量量化技术的视频编解码方法。With the development of multimedia technology, video coding technology has been widely valued. When encoding a video, it is necessary to perform a discrete cosine transform on the residual signal of the video, so as to obtain a transform coefficient matrix. Afterwards, the transform coefficients included in the transform coefficient matrix are quantized, and then the video code stream is determined according to the quantization result. At present, quantization techniques mainly include scalar quantization, vector quantization and trellis coding quantization. Among them, scalar quantization and trellis coding quantization have been widely used in video coding and decoding, but vector quantization has not yet been applied in video coding and decoding. Based on this, it is urgent to provide a video encoding and decoding method based on vector quantization technology.

发明内容Contents of the invention

本申请实施例提供了一种视频编码、视频解码方法、装置及存储介质,可以获取目标视频对应的多个变换系数矩阵,将多个变换系数矩阵中包括的变换系数进行量化,根据量化结果得到视频码流。所述技术方案如下:Embodiments of the present application provide a video encoding, video decoding method, device, and storage medium, which can obtain multiple transform coefficient matrices corresponding to the target video, quantize the transform coefficients included in the multiple transform coefficient matrices, and obtain Video stream. Described technical scheme is as follows:

一方面,提供了一种视频编码方法,其特征在于,所述方法包括:In one aspect, a video encoding method is provided, wherein the method comprises:

获取目标视频对应的多个变换系数矩阵,所述多个变换系数矩阵中的每个变换系数矩阵中包括多个待编码系数;Acquiring a plurality of transformation coefficient matrices corresponding to the target video, each of the plurality of transformation coefficient matrices includes a plurality of coefficients to be encoded;

对所述多个变换系数矩阵中的待编码系数进行量化,得到多个码字指示信息,所述多个码字指示信息用于指示对待编码系数进行量化时得到的量化结果,所述多个码字指示信息中包括第一指示信息,所述第一指示信息用于指示对待编码系数进行矢量量化时得到的码字;Quantizing the coefficients to be encoded in the plurality of transformation coefficient matrices to obtain a plurality of codeword indication information, the plurality of codeword indication information is used to indicate the quantization results obtained when quantizing the coefficients to be encoded, the plurality of The codeword indication information includes first indication information, and the first indication information is used to indicate a codeword obtained when the coefficient to be coded is vector quantized;

根据所述多个码字指示信息,生成所述目标视频的视频码流。Generate a video code stream of the target video according to the multiple codeword indication information.

可选地,所述对所述多个变换系数矩阵中的待编码系数进行量化,得到多个码字指示信息,包括:Optionally, said quantizing the coefficients to be encoded in the plurality of transformation coefficient matrices to obtain a plurality of codeword indication information includes:

对所述多个变换系数矩阵中的每个变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个变换系数矩阵对应的至少一个码字信息,其中,所述混合量化包括矢量量化和除矢量量化之外的其他量化,每个变换系数矩阵对应的至少一个码字信息包括所述第一指示信息,所述第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。Perform vector quantization or mixed quantization on multiple coefficients to be encoded in each of the multiple transform coefficient matrices to obtain at least one codeword information corresponding to each transform coefficient matrix, wherein the mixed quantization includes For vector quantization and quantization other than vector quantization, at least one codeword information corresponding to each transform coefficient matrix includes the first indication information, and the first indication information is used to indicate that all or A codeword obtained during vector quantization of some of the coefficients to be encoded.

可选地,所述对所述多个变换系数矩阵中的待编码系数进行量化,包括:Optionally, the quantizing the coefficients to be encoded in the plurality of transformation coefficient matrices includes:

对所述多个变换系数矩阵中满足矢量量化条件的每个目标变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个目标变换系数矩阵对应的至少一个码字指示信息,其中,所述混合量化包括矢量量化和除矢量量化之外的其他量化,每个目标变换系数矩阵对应的至少一个码字信息包括所述第一指示信息,所述第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。performing vector quantization or mixed quantization on a plurality of coefficients to be encoded in each target transform coefficient matrix that satisfies the vector quantization condition among the plurality of transform coefficient matrices, to obtain at least one codeword indication information corresponding to each target transform coefficient matrix, Wherein, the mixed quantization includes vector quantization and quantization other than vector quantization, and at least one codeword information corresponding to each target transform coefficient matrix includes the first indication information, and the first indication information is used to indicate the Codewords obtained during vector quantization of all or part of the coefficients to be encoded in the corresponding transformation coefficient matrix.

可选地,所述多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵内包括的全部变换系数。Optionally, the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices are all the transform coefficients included in the corresponding transform coefficient matrix.

可选地,所述矢量量化条件包括变换系数矩阵的行数达到第一行数阈值,或者,变换系数矩阵的列数达到第一列数阈值,或者变换系数矩阵的面积达到第一面积阈值中的至少一种。Optionally, the vector quantization condition includes that the number of rows of the transformation coefficient matrix reaches the first row number threshold, or the number of columns of the transformation coefficient matrix reaches the first column number threshold, or the area of the transformation coefficient matrix reaches the first area threshold at least one of .

可选地,所述多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵中第一区域内的变换系数,所述第一区域是通过基于扫描区域的系数编码SRCC技术扫描得到的区域。Optionally, the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices are transform coefficients in a first area of the corresponding transform coefficient matrix, and the first area is obtained by scanning an area based on The coefficients are coded by the SRCC technique to scan the resulting area.

可选地,所述矢量量化条件包括变换系数矩阵中的第一区域的行数达到第二行数阈值,或者,变换系数矩阵中的第一区域的列数达到第二列数阈值,或者变换系数矩阵中的第一区域的面积达到第二面积阈值中的至少一种。Optionally, the vector quantization condition includes that the number of rows in the first region in the transform coefficient matrix reaches the second row number threshold, or that the column number in the first region in the transform coefficient matrix reaches the second column number threshold, or the transformation The area of the first region in the coefficient matrix reaches at least one of the second area thresholds.

可选地,所述目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量量化开关标识,所述矢量量化开关标识用于指示对应的至少一个码字信息中是否包含有通过矢量量化得到的第一指示信息。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate that in the corresponding at least one codeword information Whether it contains the first indication information obtained through vector quantization.

可选地,所述目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量个数或矢量量化次数,所述矢量个数或所述矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video corresponds to the number of vectors or the number of vector quantization times, and the number of vectors or the number of times of vector quantization is used to indicate The corresponding at least one codeword indicates the number of first indication information included in the information.

可选地,所述目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息还对应有矢量量化起始位置,所述矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video also corresponds to a vector quantization start position, and the vector quantization start position is used to indicate the corresponding at least one codeword The position of the first first indication message in the word indication message.

可选地,所述对所述多个变换系数矩阵中的待编码系数进行量化,包括:Optionally, the quantizing the coefficients to be encoded in the plurality of transformation coefficient matrices includes:

如果第一变换系数矩阵中的待编码系数的个数为码字维数的N倍,则根据所述第一变换系数矩阵中的全部待编码系数生成N个输入信号矢量,所述N为正整数,所述输入信号矢量的维数等于所述码字维数,所述第一变换系数矩阵为所述多个变换系数矩阵中的任一个,或者,所述第一变换系数矩阵为所述多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be encoded in the first transformation coefficient matrix is N times the codeword dimension, then N input signal vectors are generated according to all coefficients to be encoded in the first transformation coefficient matrix, and N is positive Integer, the dimension of the input signal vector is equal to the dimension of the codeword, the first transformation coefficient matrix is any one of the plurality of transformation coefficient matrices, or the first transformation coefficient matrix is the Transform coefficient matrices satisfying vector quantization conditions among the plurality of transform coefficient matrices;

确定所述N个输入信号矢量中每个输入信号矢量对应的第一指示信息;determining first indication information corresponding to each of the N input signal vectors;

将确定的N个第一指示信息作为所述第一变换系数矩阵对应的至少一个码字指示信息。The determined N pieces of first indication information are used as at least one codeword indication information corresponding to the first transformation coefficient matrix.

可选地,所述对所述多个变换系数矩阵中的待编码系数进行量化,包括:Optionally, the quantizing the coefficients to be encoded in the plurality of transformation coefficient matrices includes:

如果第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍,则根据所述第一变换系数矩阵中的部分待编码系数和所述码字维数,生成M个输入信号矢量,所述输入信号矢量的维数等于所述码字维数,所述第一变换系数矩阵为所述多个变换系数矩阵中的任一个,或者,所述第一变换系数矩阵为所述多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be coded in the first transform coefficient matrix is not an integer multiple of the codeword dimension, then M coefficients are generated according to part of the coefficients to be coded in the first transform coefficient matrix and the codeword dimension An input signal vector, the dimension of the input signal vector is equal to the dimension of the code word, the first transformation coefficient matrix is any one of the plurality of transformation coefficient matrices, or the first transformation coefficient matrix is Transform coefficient matrices satisfying vector quantization conditions among the plurality of transform coefficient matrices;

确定所述M个输入信号矢量中每个输入信号矢量对应的第一指示信息,并对所述第一变换系数矩阵中的剩余待编码系数进行非矢量量化的其他量化,以得到剩余待编码系数对应的第二指示信息;Determine the first indication information corresponding to each input signal vector in the M input signal vectors, and perform non-vector quantization on the remaining coefficients to be encoded in the first transform coefficient matrix to obtain the remaining coefficients to be encoded Corresponding second instruction information;

将确定的第一指示信息和第二指示信息作为所述第一变换系数矩阵对应的多个码字指示信息。The determined first indication information and second indication information are used as indication information of multiple codewords corresponding to the first transformation coefficient matrix.

可选地,所述对多个变换系数矩阵中的待编码系数进行量化,包括:Optionally, said quantizing the coefficients to be coded in multiple transformation coefficient matrices includes:

如果第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍,则根据所述第一变换系数矩阵中的全部待编码系数和所述码字维数,生成R个输入信号矢量,所述输入信号矢量的维数等于所述码字维数,且所述R个输入信号矢量中的一个输入信号矢量中包括一个或多个系数填充值,所述第一变换系数矩阵为所述多个变换系数矩阵中的任一个,或者,所述第一变换系数矩阵为所述多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be coded in the first transformation coefficient matrix is not an integer multiple of the codeword dimension, then according to all the coefficients to be coded in the first transformation coefficient matrix and the codeword dimension, generate R An input signal vector, the dimension of the input signal vector is equal to the dimension of the codeword, and one of the R input signal vectors includes one or more coefficient filling values, and the first transform coefficient The matrix is any one of the plurality of transform coefficient matrices, or the first transform coefficient matrix is a transform coefficient matrix satisfying vector quantization conditions among the plurality of transform coefficient matrices;

确定所述R个输入信号矢量中每个输入信号矢量对应的第一指示信息;determining first indication information corresponding to each input signal vector in the R input signal vectors;

将确定的R个第一指示信息作为所述第一变换系数矩阵对应的至少一个码字指示信息。The determined R pieces of first indication information are used as at least one codeword indication information corresponding to the first transform coefficient matrix.

可选地,所述第一指示信息为码字索引、码字索引指示信息或码字包含的码字分量的指示信息。Optionally, the first indication information is a codeword index, codeword index indication information, or indication information of a codeword component included in the codeword.

可选地,所述码字索引为一维索引值,或者所述码字索引为多维索引坐标。Optionally, the codeword index is a one-dimensional index value, or the codeword index is a multidimensional index coordinate.

可选地,所述目标视频的视频码流包括矢量量化的使能标识,所述矢量量化的使能标识用于指示所述目标视频的视频码流是否支持矢量量化。Optionally, the video code stream of the target video includes a vector quantization enable flag, and the vector quantization enable flag is used to indicate whether the video code stream of the target video supports vector quantization.

可选地,所述目标视频的视频码流中包含有至少一个矢量维数,所述至少一个矢量维数用于指示所述目标视频的视频码流中的各个第一指示信息所指示的码字的维数。Optionally, the video code stream of the target video contains at least one vector dimension, and the at least one vector dimension is used to indicate the code indicated by each first indication information in the video code stream of the target video. Dimensions of words.

可选地,所述目标视频的视频码流中还包括至少一个码书索引,所述至少一个码书索引用于指示在确定所述目标视频的视频码流中的各个第一指示信息对应的码字时所采用的码书。Optionally, the video code stream of the target video further includes at least one codebook index, and the at least one codebook index is used to indicate the corresponding first indication information in the video code stream of the target video. The codebook used when codewording.

另一方面,提供了一种视频解码方法,其特征在于,所述方法包括:On the other hand, a video decoding method is provided, wherein the method comprises:

获取目标视频的视频码流,所述目标视频的视频码流包括多个码字指示信息,所述多个码字指示信息用于指示对目标视频对应的多个变换系数矩阵中的待编码系数进行量化时得到的量化结果,所述多个码字指示信息中包括第一指示信息,所述第一指示信息用于指示对待编码系数进行矢量量化时得到的码字,所述多个变换系数矩阵中的每个变换系数矩阵包括多个待编码系数;Acquire the video code stream of the target video, the video code stream of the target video includes a plurality of codeword indication information, and the multiple codeword indication information is used to indicate the coefficients to be encoded in the plurality of transformation coefficient matrices corresponding to the target video Quantization results obtained when quantization is performed, the plurality of codeword indication information includes first indication information, and the first indication information is used to indicate codewords obtained when vector quantization is performed on coefficients to be encoded, and the plurality of transform coefficients Each transformation coefficient matrix in the matrix includes a plurality of coefficients to be encoded;

根据所述多个码字指示信息,获取所述目标视频的解码数据。Acquire decoded data of the target video according to the plurality of codeword indication information.

可选地,所述对所述多个码字指示信息为多个第一指示信息,所述根据所述多个码字指示信息,获取所述目标视频的解码数据,包括:Optionally, the instruction information for the plurality of codewords is a plurality of first instruction information, and the obtaining the decoded data of the target video according to the plurality of codeword instruction information includes:

获取所述多个第一指示信息中每个第一指示信息对应的码字;Acquiring a codeword corresponding to each first indication information in the plurality of first indication information;

根据获取到的多个码字,生成所述目标视频的解码数据。Generate decoded data of the target video according to the acquired multiple codewords.

可选地,所述根据获取到的多个码字,生成所述目标视频的解码数据,包括:Optionally, the generating the decoded data of the target video according to the obtained multiple codewords includes:

将所述多个码字作为反量化重建值,或者,对所述多个码字进行处理,得到反量化重建值;Using the multiple codewords as dequantized reconstruction values, or processing the multiple codewords to obtain dequantized reconstruction values;

根据所述反量化重建值生成所述目标视频的解码数据。Generate decoded data of the target video according to the dequantized reconstruction value.

可选地,所述多个码字指示信息包括多个第一指示信息和多个第二指示信息,所述第二指示信息用于指示通过非矢量量化的其他量化得到的量化结果;Optionally, the plurality of codeword indication information includes a plurality of first indication information and a plurality of second indication information, and the second indication information is used to indicate quantization results obtained through other quantizations other than vector quantization;

所述根据所述多个码字指示信息,获取所述目标视频的解码数据,包括:The obtaining the decoded data of the target video according to the plurality of codeword indication information includes:

获取所述多个第一指示信息中每个第一指示信息对应的码字,以及获取所述多个第二指示信息中每个第二指示信息对应的量化结果;Acquire a codeword corresponding to each first indication information in the plurality of first indication information, and acquire a quantization result corresponding to each second indication information in the plurality of second indication information;

根据获取到的多个码字和每个第二指示信息对应的量化结果,生成所述目标视频的解码数据。Generate the decoded data of the target video according to the acquired multiple codewords and the quantization result corresponding to each second indication information.

可选地,所述第一指示信息为码字索引、码字索引指示信息或码字包含的码字分量的指示信息。Optionally, the first indication information is a codeword index, codeword index indication information, or indication information of a codeword component included in the codeword.

可选地,所述目标视频的视频码流中还包括至少一个码书索引,所述至少一个码书索引用于指示在确定所述多个码字指示信息中的各个第一指示信息对应的码字时所采用的码书。Optionally, the video code stream of the target video further includes at least one codebook index, and the at least one codebook index is used to indicate the corresponding first indication information in determining the plurality of codeword indication information The codebook used when codewording.

可选地,所述目标视频的视频码流还包括矢量量化的使能标识,所述矢量量化的使能标识用于指示所述目标视频的视频码流是否支持矢量量化。Optionally, the video code stream of the target video further includes a vector quantization enable flag, and the vector quantization enable flag is used to indicate whether the video code stream of the target video supports vector quantization.

可选地,所述目标视频的视频码流包括的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量量化开关标识,所述矢量量化开关标识用于指示对应的至少一个码字信息中是否包含有通过矢量量化得到的第一指示信息。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix among the plurality of codeword indication information included in the video code stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate Whether the corresponding at least one piece of codeword information includes the first indication information obtained through vector quantization.

可选地,所述目标视频的视频码流包括的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量个数或矢量量化次数,所述矢量个数或所述矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the plurality of codeword indication information included in the video code stream of the target video corresponds to the number of vectors or the number of times of vector quantization, and the number of vectors or The number of times of vector quantization is used to indicate the number of first indication information included in the corresponding at least one codeword indication information.

可选地,每个变换系数矩阵对应的至少一个码字指示信息还对应有矢量量化起始位置,所述矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。Optionally, the at least one codeword indication information corresponding to each transformation coefficient matrix also corresponds to a vector quantization start position, and the vector quantization start position is used to indicate the first and the first number in the corresponding at least one codeword indication information. - indicates the location of the information.

可选地,所述目标视频的视频码流中包含有至少一个矢量维数,所述至少一个矢量维数用于指示所述目标视频的视频码流中的各个第一指示信息所指示的码字的维数。Optionally, the video code stream of the target video contains at least one vector dimension, and the at least one vector dimension is used to indicate the code indicated by each first indication information in the video code stream of the target video. Dimensions of words.

另一方面,提供了一种视频编码装置,所述装置包括:In another aspect, a video encoding device is provided, the device comprising:

获取模块,用于获取目标视频对应的多个变换系数矩阵,所述多个变换系数矩阵中的每个变换系数矩阵中包括多个待编码系数;An acquisition module, configured to acquire a plurality of transform coefficient matrices corresponding to the target video, where each transform coefficient matrix in the plurality of transform coefficient matrices includes a plurality of coefficients to be encoded;

量化模块,用于对所述多个变换系数矩阵中的待编码系数进行量化,得到多个码字指示信息,所述多个码字指示信息用于指示对待编码系数进行量化时得到的量化结果,所述多个码字指示信息中包括第一指示信息,所述第一指示信息用于指示对待编码系数进行矢量量化时得到的码字;A quantization module, configured to quantize the coefficients to be encoded in the plurality of transformation coefficient matrices to obtain a plurality of codeword indication information, and the plurality of codeword indication information is used to indicate the quantization results obtained when the coefficients to be encoded are quantized , the plurality of codeword indication information includes first indication information, and the first indication information is used to indicate a codeword obtained when vector quantization is performed on a coefficient to be encoded;

生成模块,用于根据所述多个码字指示信息,生成所述目标视频的视频码流。A generating module, configured to generate a video code stream of the target video according to the multiple codeword indication information.

可选地,所述量化模块主要用于:Optionally, the quantization module is mainly used for:

对所述多个变换系数矩阵中的每个变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个变换系数矩阵对应的至少一个码字信息,其中,所述混合量化包括矢量量化和除矢量量化之外的其他量化,每个变换系数矩阵对应的至少一个码字信息包括所述第一指示信息,所述第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。Perform vector quantization or mixed quantization on multiple coefficients to be encoded in each of the multiple transform coefficient matrices to obtain at least one codeword information corresponding to each transform coefficient matrix, wherein the mixed quantization includes For vector quantization and quantization other than vector quantization, at least one codeword information corresponding to each transform coefficient matrix includes the first indication information, and the first indication information is used to indicate that all or A codeword obtained during vector quantization of some of the coefficients to be encoded.

可选地,所述量化模块还用于:Optionally, the quantization module is also used for:

对所述多个变换系数矩阵中满足矢量量化条件的每个目标变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个目标变换系数矩阵对应的至少一个码字指示信息,其中,所述混合量化包括矢量量化和除矢量量化之外的其他量化,每个目标变换系数矩阵对应的至少一个码字信息包括所述第一指示信息,所述第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。performing vector quantization or mixed quantization on a plurality of coefficients to be encoded in each target transform coefficient matrix that satisfies the vector quantization condition among the plurality of transform coefficient matrices, to obtain at least one codeword indication information corresponding to each target transform coefficient matrix, Wherein, the mixed quantization includes vector quantization and quantization other than vector quantization, and at least one codeword information corresponding to each target transform coefficient matrix includes the first indication information, and the first indication information is used to indicate the Codewords obtained during vector quantization of all or part of the coefficients to be encoded in the corresponding transformation coefficient matrix.

可选地,所述多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵内包括的全部变换系数。Optionally, the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices are all the transform coefficients included in the corresponding transform coefficient matrix.

可选地,所述矢量量化条件包括变换系数矩阵的行数达到第一行数阈值,或者,变换系数矩阵的列数达到第一列数阈值,或者变换系数矩阵的面积达到第一面积阈值中的至少一种。Optionally, the vector quantization condition includes that the number of rows of the transformation coefficient matrix reaches the first row number threshold, or the number of columns of the transformation coefficient matrix reaches the first column number threshold, or the area of the transformation coefficient matrix reaches the first area threshold at least one of .

可选地,所述多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵中第一区域内的变换系数,所述第一区域是通过基于扫描区域的系数编码SRCC技术扫描得到的区域。Optionally, the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices are transform coefficients in a first area of the corresponding transform coefficient matrix, and the first area is obtained by scanning an area based on The coefficients are coded by the SRCC technique to scan the resulting area.

可选地,所述矢量量化条件包括变换系数矩阵中的第一区域的行数达到第二行数阈值,或者,变换系数矩阵中的第一区域的列数达到第二列数阈值,或者变换系数矩阵中的第一区域的面积达到第二面积阈值中的至少一种。Optionally, the vector quantization condition includes that the number of rows in the first region in the transform coefficient matrix reaches the second row number threshold, or that the column number in the first region in the transform coefficient matrix reaches the second column number threshold, or the transformation The area of the first region in the coefficient matrix reaches at least one of the second area thresholds.

可选地,所述目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量量化开关标识,所述矢量量化开关标识用于指示对应的至少一个码字信息中是否包含有通过矢量量化得到的第一指示信息。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate that in the corresponding at least one codeword information Whether it contains the first indication information obtained through vector quantization.

可选地,所述目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量个数或矢量量化次数,所述矢量个数或所述矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video corresponds to the number of vectors or the number of vector quantization times, and the number of vectors or the number of times of vector quantization is used to indicate The corresponding at least one codeword indicates the number of first indication information included in the information.

可选地,所述目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息还对应有矢量量化起始位置,所述矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video also corresponds to a vector quantization start position, and the vector quantization start position is used to indicate the corresponding at least one codeword The position of the first first indication message in the word indication message.

可选地,所述量化模块还用于:Optionally, the quantization module is also used for:

如果第一变换系数矩阵中的待编码系数的个数为码字维数的N倍,则根据所述第一变换系数矩阵中的全部待编码系数生成N个输入信号矢量,所述N为正整数,所述输入信号矢量的维数等于所述码字维数,所述第一变换系数矩阵为所述多个变换系数矩阵中的任一个,或者,所述第一变换系数矩阵为所述多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be encoded in the first transformation coefficient matrix is N times the codeword dimension, then N input signal vectors are generated according to all coefficients to be encoded in the first transformation coefficient matrix, and N is positive Integer, the dimension of the input signal vector is equal to the dimension of the codeword, the first transformation coefficient matrix is any one of the plurality of transformation coefficient matrices, or the first transformation coefficient matrix is the Transform coefficient matrices satisfying vector quantization conditions among the plurality of transform coefficient matrices;

确定所述N个输入信号矢量中每个输入信号矢量对应的第一指示信息;determining first indication information corresponding to each of the N input signal vectors;

将确定的N个第一指示信息作为所述第一变换系数矩阵对应的至少一个码字指示信息。The determined N pieces of first indication information are used as at least one codeword indication information corresponding to the first transformation coefficient matrix.

可选地,所述量化模块还用于:Optionally, the quantization module is also used for:

如果第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍,则根据所述第一变换系数矩阵中的部分待编码系数和所述码字维数,生成M个输入信号矢量,所述输入信号矢量的维数等于所述码字维数,所述第一变换系数矩阵为所述多个变换系数矩阵中的任一个,或者,所述第一变换系数矩阵为所述多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be coded in the first transform coefficient matrix is not an integer multiple of the codeword dimension, then M coefficients are generated according to part of the coefficients to be coded in the first transform coefficient matrix and the codeword dimension An input signal vector, the dimension of the input signal vector is equal to the dimension of the code word, the first transformation coefficient matrix is any one of the plurality of transformation coefficient matrices, or the first transformation coefficient matrix is Transform coefficient matrices satisfying vector quantization conditions among the plurality of transform coefficient matrices;

确定所述M个输入信号矢量中每个输入信号矢量对应的第一指示信息,并对所述第一变换系数矩阵中的剩余待编码系数进行非矢量量化的其他量化,以得到剩余待编码系数对应的第二指示信息;Determine the first indication information corresponding to each input signal vector in the M input signal vectors, and perform non-vector quantization on the remaining coefficients to be encoded in the first transform coefficient matrix to obtain the remaining coefficients to be encoded Corresponding second instruction information;

将确定的第一指示信息和第二指示信息作为所述第一变换系数矩阵对应的多个码字指示信息。The determined first indication information and second indication information are used as indication information of multiple codewords corresponding to the first transformation coefficient matrix.

可选地,所述量化模块还用于:Optionally, the quantization module is also used for:

如果第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍,则根据所述第一变换系数矩阵中的全部待编码系数和所述码字维数,生成R个输入信号矢量,所述输入信号矢量的维数等于所述码字维数,且所述R个输入信号矢量中的一个输入信号矢量中包括一个或多个系数填充值,所述第一变换系数矩阵为所述多个变换系数矩阵中的任一个,或者,所述第一变换系数矩阵为所述多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be coded in the first transformation coefficient matrix is not an integer multiple of the codeword dimension, then according to all the coefficients to be coded in the first transformation coefficient matrix and the codeword dimension, generate R An input signal vector, the dimension of the input signal vector is equal to the dimension of the codeword, and one of the R input signal vectors includes one or more coefficient filling values, and the first transform coefficient The matrix is any one of the plurality of transform coefficient matrices, or the first transform coefficient matrix is a transform coefficient matrix satisfying vector quantization conditions among the plurality of transform coefficient matrices;

确定所述R个输入信号矢量中每个输入信号矢量对应的第一指示信息;determining first indication information corresponding to each input signal vector in the R input signal vectors;

将确定的R个第一指示信息作为所述第一变换系数矩阵对应的至少一个码字指示信息。The determined R pieces of first indication information are used as at least one codeword indication information corresponding to the first transform coefficient matrix.

可选地,所述第一指示信息为码字索引、码字索引指示信息或码字包含的码字分量的指示信息。Optionally, the first indication information is a codeword index, codeword index indication information, or indication information of a codeword component included in the codeword.

可选地,所述码字索引为一维索引值,或者所述码字索引为多维索引坐标。Optionally, the codeword index is a one-dimensional index value, or the codeword index is a multidimensional index coordinate.

可选地,所述目标视频的视频码流包括矢量量化的使能标识,所述矢量量化的使能标识用于指示所述目标视频的视频码流是否支持矢量量化。Optionally, the video code stream of the target video includes a vector quantization enable flag, and the vector quantization enable flag is used to indicate whether the video code stream of the target video supports vector quantization.

可选地,所述目标视频的视频码流中包含有至少一个矢量维数,所述至少一个矢量维数用于指示所述目标视频的视频码流中的各个第一指示信息所指示的码字的维数。Optionally, the video code stream of the target video contains at least one vector dimension, and the at least one vector dimension is used to indicate the code indicated by each first indication information in the video code stream of the target video. Dimensions of words.

可选地,所述目标视频的视频码流中还包括至少一个码书索引,所述至少一个码书索引用于指示在确定所述目标视频的视频码流中的各个第一指示信息对应的码字时所采用的码书。Optionally, the video code stream of the target video further includes at least one codebook index, and the at least one codebook index is used to indicate the corresponding first indication information in the video code stream of the target video. The codebook used when codewording.

另一方面,提供了一种视频解码装置,所述装置包括:In another aspect, a video decoding device is provided, the device comprising:

第一获取模块,用于获取目标视频的视频码流,所述目标视频的视频码流包括多个码字指示信息,所述多个码字指示信息用于指示对目标视频对应的多个变换系数矩阵中的待编码系数进行量化时得到的量化结果,所述多个码字指示信息中包括第一指示信息,所述第一指示信息用于指示对待编码系数进行矢量量化时得到的码字,所述多个变换系数矩阵中的每个变换系数矩阵包括多个待编码系数;The first acquisition module is used to acquire the video code stream of the target video, the video code stream of the target video includes a plurality of codeword indication information, and the multiple codeword indication information is used to indicate multiple transformations corresponding to the target video Quantization results obtained when the coefficients to be encoded in the coefficient matrix are quantized, the plurality of codeword indication information includes first indication information, and the first indication information is used to indicate the codewords obtained when the coefficients to be encoded are vector quantized , each of the plurality of transform coefficient matrices includes a plurality of coefficients to be encoded;

第二获取模块,用于根据所述多个码字指示信息,获取所述目标视频的解码数据。The second acquiring module is configured to acquire decoded data of the target video according to the multiple codeword indication information.

可选地,所述多个码字指示信息为多个第一指示信息,所述第二获取模块主要用于:Optionally, the plurality of codeword indication information is a plurality of first indication information, and the second acquisition module is mainly used for:

获取所述多个第一指示信息中每个第一指示信息对应的码字;Acquiring a codeword corresponding to each first indication information in the plurality of first indication information;

根据获取到的多个码字,生成所述目标视频的解码数据。Generate decoded data of the target video according to the acquired multiple codewords.

可选地,所述第二获取模块主要用于:Optionally, the second acquisition module is mainly used for:

将所述多个码字作为反量化重建值,或者,对所述多个码字进行处理,得到反量化重建值;Using the multiple codewords as dequantized reconstruction values, or processing the multiple codewords to obtain dequantized reconstruction values;

根据所述反量化重建值生成所述目标视频的解码数据。Generate decoded data of the target video according to the dequantized reconstruction value.

可选地,所述多个码字指示信息包括多个第一指示信息和多个第二指示信息,所述第二指示信息用于指示通过非矢量量化的其他量化得到的量化结果;所述第二获取模块还主要用于:Optionally, the plurality of codeword indication information includes a plurality of first indication information and a plurality of second indication information, and the second indication information is used to indicate quantization results obtained through other quantizations other than vector quantization; the The second acquisition module is also mainly used for:

获取所述多个第一指示信息中每个第一指示信息对应的码字,以及获取所述多个第二指示信息中每个第二指示信息对应的量化结果;Acquire a codeword corresponding to each first indication information in the plurality of first indication information, and acquire a quantization result corresponding to each second indication information in the plurality of second indication information;

根据获取到的多个码字和每个第二指示信息对应的量化结果,生成所述目标视频的解码数据。Generate the decoded data of the target video according to the acquired multiple codewords and the quantization result corresponding to each second indication information.

可选地,所述第一指示信息为码字索引、码字索引指示信息或码字包含的码字分量的指示信息。Optionally, the first indication information is a codeword index, codeword index indication information, or indication information of a codeword component included in the codeword.

可选地,所述目标视频的视频码流中还包括至少一个码书索引,所述至少一个码书索引用于指示在确定所述多个码字指示信息中的各个第一指示信息对应的码字时所采用的码书。Optionally, the video code stream of the target video further includes at least one codebook index, and the at least one codebook index is used to indicate the corresponding first indication information in determining the plurality of codeword indication information The codebook used when codewording.

可选地,所述目标视频的视频码流还包括矢量量化的使能标识,所述矢量量化的使能标识用于指示所述目标视频的视频码流是否支持矢量量化。Optionally, the video code stream of the target video further includes a vector quantization enable flag, and the vector quantization enable flag is used to indicate whether the video code stream of the target video supports vector quantization.

可选地,所述目标视频的视频码流包括的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量量化开关标识,所述矢量量化开关标识用于指示对应的至少一个码字信息中是否包含有通过矢量量化得到的第一指示信息。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix among the plurality of codeword indication information included in the video code stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate Whether the corresponding at least one piece of codeword information includes the first indication information obtained through vector quantization.

可选地,所述目标视频的视频码流包括的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量个数或矢量量化次数,所述矢量个数或所述矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the plurality of codeword indication information included in the video code stream of the target video corresponds to the number of vectors or the number of times of vector quantization, and the number of vectors or The number of times of vector quantization is used to indicate the number of first indication information included in the corresponding at least one codeword indication information.

可选地,每个变换系数矩阵对应的至少一个码字指示信息还对应有矢量量化起始位置,所述矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。Optionally, the at least one codeword indication information corresponding to each transformation coefficient matrix also corresponds to a vector quantization start position, and the vector quantization start position is used to indicate the first and the first number in the corresponding at least one codeword indication information. - indicates the location of the information.

可选地,所述目标视频的视频码流中包含有至少一个矢量维数,所述至少一个矢量维数用于指示所述目标视频的视频码流中的各个第一指示信息所指示的码字的维数。Optionally, the video code stream of the target video contains at least one vector dimension, and the at least one vector dimension is used to indicate the code indicated by each first indication information in the video code stream of the target video. Dimensions of words.

另一方面,提供了一种视频编码装置,所述装置包括:In another aspect, a video encoding device is provided, the device comprising:

处理器;processor;

用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;

其中,所述处理器执行所述存储器中的可执行指令来执行上述视频编码方法。Wherein, the processor executes the executable instructions in the memory to implement the above video encoding method.

另一方面,提供了一种视频解码装置,所述装置包括:In another aspect, a video decoding device is provided, the device comprising:

处理器;processor;

用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;

其中,所述处理器执行所述存储器中的可执行指令来执行上述视频解码方法。Wherein, the processor executes the executable instructions in the memory to execute the above video decoding method.

另一方面,提供了一种计算机可读存储介质,所述存储介质内存储有计算机程序,所述计算机程序被计算机执行时实现上述所述视频编码方法或视频解码方法的步骤。In another aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a computer, the steps of the above-mentioned video encoding method or video decoding method are realized.

另一方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述的视频编码或视频解码方法的步骤。In another aspect, there is provided a computer program product including instructions, which, when run on a computer, causes the computer to execute the steps of the above video encoding or video decoding method.

本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:

在本申请实施例中,可以采用矢量量化的方法对多个变换系数矩阵中的待编码系数进行量化,以得到对应的第一指示信息,进而根据包含有第一指示信息的多个码字指示信息生成目标视频的视频码流。后续,解码端就能够根据第一指示信息对矢量量化的系数进行解码。由此可见,本申请实施例提供了一种基于矢量量化的视频编解码方法,实现了矢量量化在视频编解码中的应用,相较于标量量化和网络编码量化,提高了量化性能,进而提升了视频编解码的性能。In this embodiment of the present application, the vector quantization method may be used to quantize the coefficients to be encoded in multiple transformation coefficient matrices to obtain the corresponding first indication information, and then indicate according to the multiple codewords containing the first indication information The information generates the video code stream of the target video. Subsequently, the decoding end can decode the vector quantized coefficients according to the first indication information. It can be seen that the embodiment of the present application provides a video encoding and decoding method based on vector quantization, which realizes the application of vector quantization in video encoding and decoding. Compared with scalar quantization and network coding quantization, the quantization performance is improved, thereby improving The performance of video codec.

附图说明Description of drawings

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

图1是本申请实施例提供的一种视频编解码所涉及的系统架构图;FIG. 1 is a system architecture diagram related to a video codec provided by an embodiment of the present application;

图2是本申请实施例提供的一种视频编码方法的流程图;FIG. 2 is a flow chart of a video encoding method provided by an embodiment of the present application;

图3是本申请实施例提供的一种扫描区域的示意图;Fig. 3 is a schematic diagram of a scanning area provided by an embodiment of the present application;

图4是本申请实施例提供的一种视频解码方法的流程图;FIG. 4 is a flow chart of a video decoding method provided by an embodiment of the present application;

图5是本申请实施例提供的一种视频编码装置的结构图;FIG. 5 is a structural diagram of a video encoding device provided by an embodiment of the present application;

图6是本申请实施例提供的一种视频解码装置的结构图;FIG. 6 is a structural diagram of a video decoding device provided by an embodiment of the present application;

图7是本申请实施例提供的一种用于视频编码或视频解码的服务器的结构示意图。Fig. 7 is a schematic structural diagram of a server for video encoding or video decoding provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.

在对本申请实施例进行详细的解释说明之前,先对本申请实施例涉及的系统架构进行介绍。Before explaining the embodiment of the present application in detail, the system architecture involved in the embodiment of the present application is firstly introduced.

图1是本申请实施例提供的一种视频编码、视频解码方法所涉及的系统架构图。如图1所示,该系统视频编码设备101和视频解码设备102。其中,视频编码设备101和视频解码设备102可以进行通信。FIG. 1 is a system architecture diagram involved in a video encoding and video decoding method provided by an embodiment of the present application. As shown in FIG. 1 , the system video encoding device 101 and video decoding device 102 . Wherein, the video encoding device 101 and the video decoding device 102 can communicate.

视频编码设备101用于获取视频信号,并根据视频信号获取多个变换系数矩阵,进而通过本申请实施例提供的方法对多个变换系数矩阵中的待编码系数进行量化、编码,从而得到视频码流。将生成的视频码流发送至视频解码设备102。The video coding device 101 is used to obtain a video signal, and obtain a plurality of transformation coefficient matrices according to the video signal, and then quantize and encode the coefficients to be encoded in the plurality of transformation coefficient matrices through the method provided in the embodiment of the present application, thereby obtaining a video code flow. Send the generated video code stream to the video decoding device 102 .

其中,视频编码设备101可以包括预测模块1011、变换模块1012、量化模块1013和熵编码模块1014。Wherein, the video coding device 101 may include a prediction module 1011 , a transformation module 1012 , a quantization module 1013 and an entropy coding module 1014 .

其中,预测模块1011包括帧内预测单元和帧间预测单元,其中,帧内预测单元可以利用当前编码块周围的已编码块的重建像素对当前编码块的像素进行预测,从而得到预测块;帧间预测单元可以利用时域上邻近的已编码图像帧的重建像素对当前未编码的图像帧的像素进行预测,从而得到预测块。预测模块1011可以通过上述任一种预测单元得到预测块,之后,根据当前编码块和该预测块计算残差信号。Wherein, the prediction module 1011 includes an intra-frame prediction unit and an inter-frame prediction unit, wherein the intra-frame prediction unit can use the reconstructed pixels of the coded blocks around the current coded block to predict the pixels of the current coded block, so as to obtain the predicted block; frame The inter-prediction unit can use reconstructed pixels of adjacent encoded image frames in time domain to predict the pixels of the current unencoded image frame, so as to obtain the prediction block. The prediction module 1011 may obtain a prediction block through any one of the above prediction units, and then calculate a residual signal according to the current coding block and the prediction block.

变换模块1012将图像的残差信号映射至变换域,以得到变换系数矩阵,从而使得图像在变换域的能量更集中,去除信号的频域相关性。The transform module 1012 maps the residual signal of the image to the transform domain to obtain a transform coefficient matrix, so that the energy of the image in the transform domain is more concentrated, and the frequency domain correlation of the signal is removed.

量化模块1013将变换模块1012得到的变换系数矩阵中的待编码系数映射为码字,这种映射是一个“多对一”的过程,该过程不可逆,会带来信号损失。但优点是能够大幅度缩减信号的取值范围,从而能够用少量的符号给出原始信号较好的近似,提高压缩率。The quantization module 1013 maps the coefficients to be encoded in the transformation coefficient matrix obtained by the transformation module 1012 into codewords. This mapping is a "many-to-one" process, which is irreversible and will cause signal loss. But the advantage is that it can greatly reduce the value range of the signal, so that a small number of symbols can be used to give a better approximation of the original signal and improve the compression rate.

熵编码模块1014是基于信息熵原理的无损编码方式,将量化模块1013映射得到的码字对应的码字索引或是其他用于指示码字的信息等转变为一个二进制码流,从而生成视频码流。The entropy coding module 1014 is a lossless coding method based on the principle of information entropy, which converts the codeword index corresponding to the codeword mapped by the quantization module 1013 or other information used to indicate the codeword into a binary code stream, thereby generating a video code flow.

视频解码设备102接收视频编码设备101发送的视频码流,并根据视频码流中包含的码字指示信息对视频码流进行解码,从而得到解码数据。The video decoding device 102 receives the video code stream sent by the video coding device 101, and decodes the video code stream according to the codeword indication information included in the video code stream, so as to obtain decoded data.

其中,视频解码设备102可以包括熵解码模块1021、反量化模块1022、反变换模块1023、重建模块1024和滤波模块1025。Wherein, the video decoding device 102 may include an entropy decoding module 1021 , an inverse quantization module 1022 , an inverse transformation module 1023 , a reconstruction module 1024 and a filtering module 1025 .

其中,熵解码模块1021用于接收视频编码设备101发送的视频码流,由于该视频码流是熵编码模块1014通过对码字指示信息进行转换得到的二进制码流,所以,熵解码模块1021可以对该视频码流进行熵解码,以得到该视频码流包含的码字指示信息。Wherein, the entropy decoding module 1021 is used to receive the video code stream sent by the video coding device 101, since the video code stream is a binary code stream obtained by the entropy coding module 1014 by converting the codeword indication information, the entropy decoding module 1021 can Entropy decoding is performed on the video code stream to obtain codeword indication information included in the video code stream.

反量化模块1022用于将熵解码模块1021得到的码字指示信息进行反量化,得到反量化重建值。The inverse quantization module 1022 is configured to inverse quantize the codeword indication information obtained by the entropy decoding module 1021 to obtain an inverse quantization reconstruction value.

反变换模块1023用于将反量化模块1022得到的反量化重建值进行DCT反变换,从而得到多个变换系数矩阵。The inverse transformation module 1023 is configured to perform DCT inverse transformation on the inverse quantization reconstruction value obtained by the inverse quantization module 1022, so as to obtain a plurality of transformation coefficient matrices.

重建模块1024用于根据反变换模块1023得到的多个变换系数矩阵生成重建图像。The reconstruction module 1024 is configured to generate a reconstructed image according to the plurality of transformation coefficient matrices obtained by the inverse transformation module 1023 .

滤波模块1025用于将重建模块1024获得的重建图像进行图像增强,使得重建图像更接近原始图像,同时消减块效应和振铃效应的影响,提升重建图像的质量。The filtering module 1025 is used to perform image enhancement on the reconstructed image obtained by the reconstruction module 1024, so that the reconstructed image is closer to the original image, and at the same time reduce the influence of block effect and ringing effect, and improve the quality of the reconstructed image.

需要说明的是,在本申请实施例中,视频编码设备101可以是一个终端设备,例如,智能手机、平板电脑、笔记本电脑、台式计算机,视频编码设备101也可以是一个服务器或一个服务器集群。视频解码设备102可以是一个终端设备,例如,平板电脑、台式计算机等终端设备,视频解码设备102也可以是一个服务器或服务器集群,本申请实施例对此不做限定。It should be noted that, in this embodiment of the application, the video encoding device 101 may be a terminal device, for example, a smart phone, a tablet computer, a notebook computer, or a desktop computer, and the video encoding device 101 may also be a server or a server cluster. The video decoding device 102 may be a terminal device, for example, a terminal device such as a tablet computer or a desktop computer, and the video decoding device 102 may also be a server or a server cluster, which is not limited in this embodiment of the present application.

接下来对本申请实施例提供的视频编码方法进行介绍。Next, the video coding method provided by the embodiment of the present application will be introduced.

图2是本申请实施例提供的一种视频编码方法的流程图。该方法可以应用于前述系统架构中的视频编码设备,如图2所示,该方法包括以下步骤:FIG. 2 is a flow chart of a video coding method provided by an embodiment of the present application. The method can be applied to the video encoding device in the aforementioned system architecture, as shown in Figure 2, the method includes the following steps:

步骤201:获取目标视频对应的多个变换系数矩阵,多个变换系数矩阵中的每个变换系数矩阵中包括多个待编码系数。Step 201: Obtain a plurality of transformation coefficient matrices corresponding to the target video, and each transformation coefficient matrix in the plurality of transformation coefficient matrices includes a plurality of coefficients to be encoded.

在本申请实施例中,对目标视频的残差信号进行DCT(Discrete CosineTransform,离散余弦变换)变换。在变换过程中,对目标视频中的每一帧视频图像的每个TB(Transform Block,变换块)进行DCT变换,得到每个TB对应的变换系数矩阵。这样,对于一帧视频图像可以得到一个或多个变换系数矩阵。In the embodiment of the present application, DCT (Discrete Cosine Transform, Discrete Cosine Transform) transformation is performed on the residual signal of the target video. During the transformation process, DCT transformation is performed on each TB (Transform Block, transformation block) of each frame of video image in the target video to obtain a transformation coefficient matrix corresponding to each TB. In this way, one or more transformation coefficient matrices can be obtained for one frame of video image.

在本申请实施例中,该多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数。In the embodiment of the present application, each of the plurality of transform coefficient matrices includes a plurality of coefficients to be encoded.

其中,在一种可能的实现方式中,多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数可以为相应变换系数矩阵内包括的全部变换系数。Wherein, in a possible implementation manner, the multiple coefficients to be encoded included in each of the multiple transform coefficient matrices may be all transform coefficients included in the corresponding transform coefficient matrix.

可选地,在另一种可能的实现方式中,每个变换系数矩阵中包括的多个待编码系数可以为相应变换系数矩阵中第一区域内的变换系数,其中,第一区域是通过基于扫描区域的系数编码SRCC技术扫描得到的区域。Optionally, in another possible implementation manner, the plurality of coefficients to be encoded included in each transform coefficient matrix may be the transform coefficients in the first area of the corresponding transform coefficient matrix, where the first area is obtained by The coefficients of the scanned area encode the area scanned by the SRCC technique.

也即是,在本申请实施例中,视频编码设备可以通过SRCC技术确定TB的变换系数矩阵中最右面的非零系数的横坐标SRx和最下面的非零系数的纵坐标SRy,利用(SRx,SRy)来确定该变换系数矩阵中需要扫描的扫描区域,也即,第一区域,如图3所示,之后,对(SRx,SRy)确定的第一区域内的变换系数进行编码。That is, in the embodiment of the present application, the video encoding device can determine the abscissa SRx of the rightmost non-zero coefficient and the ordinate SRy of the bottom non-zero coefficient in the transformation coefficient matrix of the TB through the SRCC technology, using (SRx , SRy) to determine the scanning area to be scanned in the transform coefficient matrix, that is, the first area, as shown in FIG. 3 , and then encode the transform coefficients in the first area determined by (SRx, SRy).

步骤202:对多个变换系数矩阵中的待编码系数进行量化,得到多个码字指示信息,多个码字指示信息用于指示对待编码系数进行量化时得到的量化结果,多个码字指示信息中包括第一指示信息,第一指示信息用于指示对待编码系数进行矢量量化时得到的码字。Step 202: Quantize the coefficients to be encoded in multiple transformation coefficient matrices to obtain multiple codeword indication information, the multiple codeword indication information is used to indicate the quantization results obtained when the coefficients to be encoded are quantized, and the multiple codeword indication information The information includes first indication information, and the first indication information is used to indicate a codeword obtained when vector quantization is performed on the coefficient to be encoded.

由前述步骤201中可知,每个变换系数矩阵包括多个待编码系数,基于此,视频编码设备可以对每个变换系数矩阵中的多个待编码系数进行量化。It can be known from the foregoing step 201 that each transform coefficient matrix includes multiple coefficients to be encoded, based on this, the video encoding device may quantize the multiple coefficients to be encoded in each transform coefficient matrix.

示例性地,在一种可能的实现方式中,视频编码设备对多个变换系数矩阵中的每个变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个变换系数矩阵对应的至少一个码字信息,其中,混合量化包括矢量量化和除矢量量化之外的其他量化,每个变换系数矩阵对应的至少一个码字信息包括第一指示信息,该第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。Exemplarily, in a possible implementation manner, the video coding device performs vector quantization or mixed quantization on multiple coefficients to be encoded in each of the multiple transform coefficient matrices to obtain the corresponding At least one piece of codeword information, wherein the hybrid quantization includes vector quantization and quantization other than vector quantization, and the at least one piece of codeword information corresponding to each transform coefficient matrix includes first indication information, which is used to indicate A codeword obtained during vector quantization of all or part of the coefficients to be encoded in the corresponding transformation coefficient matrix.

其中,以多个变换系数矩阵中的第一变换系数矩阵为例,视频编码设备可以判断第一变换系数矩阵中的待编码系数的个数是否为码字维数的N倍,如果第一变换系数矩阵中的待编码系数的个数为码字维数的N倍,则根据第一变换系数矩阵中的全部待编码系数生成N个输入信号矢量,N为正整数,输入信号矢量的维数等于码字维数,确定N个输入信号矢量中每个输入信号矢量对应的第一指示信息;将确定的N个第一指示信息作为第一变换系数矩阵对应的至少一个码字指示信息。Wherein, taking the first transform coefficient matrix among the plurality of transform coefficient matrices as an example, the video encoding device may determine whether the number of coefficients to be encoded in the first transform coefficient matrix is N times the dimension of the code word, if the first transform The number of coefficients to be coded in the coefficient matrix is N times the codeword dimension, then generate N input signal vectors according to all coefficients to be coded in the first transformation coefficient matrix, N is a positive integer, and the dimension of the input signal vector Equal to the codeword dimension, determine the first indication information corresponding to each input signal vector in the N input signal vectors; use the determined N first indication information as at least one codeword indication information corresponding to the first transform coefficient matrix.

需要说明的是,码字维数是指预设的进行矢量量化时所要采用的参考码书中包括的码字的维数。其中,该参考码书中包括多个码字,每个码字均为该码字维数的矢量。例如,码字维数可以为8、16等。并且,在本申请实施例中,每个码字可以对应有一个码字指示信息。It should be noted that the dimension of the codeword refers to the dimension of the codeword included in the preset reference codebook to be used when performing vector quantization. Wherein, the reference codebook includes a plurality of codewords, and each codeword is a vector of the dimensionality of the codeword. For example, the codeword dimension can be 8, 16, etc. Moreover, in the embodiment of the present application, each codeword may correspond to one codeword indication information.

如果第一变换系数矩阵中包含的待编码系数的个数为码字维数的整数倍,则说明第一变换系数矩阵中包含的待编码系数正好能够组成N个该码字维数的矢量,基于此,视频编码设备可以根据该码字维数,生成N个输入信号矢量。If the number of coefficients to be encoded contained in the first transformation coefficient matrix is an integer multiple of the codeword dimension, it means that the coefficients to be encoded contained in the first transformation coefficient matrix can just form N vectors of the codeword dimension, Based on this, the video coding device can generate N input signal vectors according to the codeword dimension.

例如,假设码字维数为8,第一变换系数矩阵中包含的待编码系数的个数为24,则根据该码字维数,第一变换系数矩阵中的24个待编码系数可以组成3个8维的输入信号矢量。For example, assuming that the codeword dimension is 8, and the number of coefficients to be encoded contained in the first transform coefficient matrix is 24, then according to the codeword dimension, the 24 coefficients to be encoded in the first transform coefficient matrix can form 3 An 8-dimensional input signal vector.

在得到N个输入信号矢量之后,视频编码设备可以从参考码书包含的码字中查找与每个输入信号矢量相匹配的码字,进而根据查找到的每个输入信号矢量对应的码字获取相应码字的指示信息,将得到的指示信息作为相应输入信号矢量对应的第一指示信息。之后,视频编码设备可以将每个输入信号矢量对应的第一指示信息作为该第一变换系数矩阵对应的多个码字指示信息。After obtaining the N input signal vectors, the video encoding device can search the codewords that match each input signal vector from the codewords contained in the reference codebook, and then obtain For the indication information of the corresponding codeword, the obtained indication information is used as the first indication information corresponding to the corresponding input signal vector. Afterwards, the video coding device may use the first indication information corresponding to each input signal vector as the multiple codeword indication information corresponding to the first transformation coefficient matrix.

其中,该第一指示信息可以为码字索引、码字索引指示信息或码字包含的码字分量的指示信息。Wherein, the first indication information may be a codeword index, codeword index indication information, or indication information of a codeword component included in the codeword.

其中,当第一指示信息为码字索引时,该码字索引可以为一维索引值,或者也可以为多维索引坐标。例如,对于聚类型码书,码字的码字索引即为一个一维索引值,也即,通过一个具体索引值就能对应到一个码字;对于晶格型码书,一个码字对应一个多维索引坐标,例如,索引坐标(i,j)对应一个码字。Wherein, when the first indication information is a codeword index, the codeword index may be a one-dimensional index value, or may also be a multi-dimensional index coordinate. For example, for a cluster type codebook, the codeword index of a codeword is a one-dimensional index value, that is, a specific index value can correspond to a codeword; for a lattice type codebook, a codeword corresponds to a Multi-dimensional index coordinates, for example, index coordinates (i, j) correspond to a codeword.

当第一指示信息为码字索引指示信息时,码字索引指示信息可以为码字索引的相关信息,也即,该码字索引指示信息能够指示一个码字索引。例如,某本码书中包含31个码字,将这31个码字分成5组,对每一组进行编号,第一组编号0,第二组编号为1,第三组编号为2,第四组编号为3,第五组编号为4;同时,第一组内的码字为1,第二组内的码字为2和3,第三组内的码字为4至7,第四组内的码字为8至15,第五组内的码字为16至31。根据每一组内的码字的位置可以得到每一组内的码字的组内偏移量,之后,根据每个码字所在组的组号和组内偏移量得到相应码字对应的码字索引对应的码字索引指示信息,其中,该码字索引指示信息包括码字所在组的组号和组内偏移量。When the first indication information is the codeword index indication information, the codeword index indication information may be information related to the codeword index, that is, the codeword index indication information can indicate a codeword index. For example, a certain codebook contains 31 codewords, divide these 31 codewords into 5 groups, and number each group, the first group is numbered 0, the second group is numbered 1, the third group is numbered 2, The fourth group is numbered 3, and the fifth group is numbered 4; meanwhile, the codewords in the first group are 1, the codewords in the second group are 2 and 3, and the codewords in the third group are 4 to 7, The codewords in the fourth group are 8 to 15, and the codewords in the fifth group are 16 to 31. According to the position of the codeword in each group, the group offset of the codeword in each group can be obtained, and then, according to the group number and the group offset of each codeword, the corresponding codeword can be obtained. Codeword index indication information corresponding to the codeword index, where the codeword index indication information includes the group number of the group where the codeword is located and the offset within the group.

当第一指示信息为码字包含的码字分量的指示信息时,码字分量的指示信息可以是对码字包含的码字分量直接进行编码得到信息。例如,在某些特殊构造的码书中,人为设计的一些码字,一个码字中各个码字分量可能均为整数,在这种情况下,可以直接对码字中的各个码字分量进行编码,得到码字分量的指示信息。When the first indication information is indication information of codeword components included in the codeword, the indication information of codeword components may be information obtained by directly encoding the codeword components included in the codeword. For example, in some specially constructed codebooks, for some artificially designed codewords, each codeword component in a codeword may be an integer. In this case, each codeword component in the codeword can be directly Encoding to obtain the indication information of the codeword component.

可选地,如果第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍,则可以对第一变化系数矩阵中的待编码系数进行全部矢量量化,也可以对第一变换系数矩阵中的待编码系数进行混合量化。Optionally, if the number of coefficients to be coded in the first transformation coefficient matrix is not an integer multiple of the dimension of the codeword, then vector quantization can be performed on all the coefficients to be coded in the first transformation coefficient matrix, or the second Coefficients to be coded in a transformation coefficient matrix are mixed and quantized.

其中,若对第一变化系数矩阵中的待编码系数进行全部矢量量化,则根据第一变换系数矩阵中的全部待编码系数和码字维数,生成R个输入信号矢量,输入信号矢量的维数等于码字维数。其中,R个输入信号矢量中的一个输入信号矢量中包括一个或多个系数填充值。之后,确定R个输入信号矢量中每个输入信号矢量对应的第一指示信息。将确定的R个第一指示信息作为第一变换系数矩阵对应的至少一个码字指示信息。Wherein, if vector quantization is performed on all the coefficients to be coded in the first transform coefficient matrix, R input signal vectors are generated according to all coefficients to be coded and codeword dimensions in the first transform coefficient matrix, and the dimension of the input signal vector The number is equal to the codeword dimension. Wherein, one of the R input signal vectors includes one or more coefficient filling values. Afterwards, the first indication information corresponding to each input signal vector in the R input signal vectors is determined. The determined R pieces of first indication information are used as at least one codeword indication information corresponding to the first transform coefficient matrix.

其中,如果第一变换系数矩阵中包含的待编码系数的个数不为码字维数的整数倍,则说明第一变换系数矩阵中的待编码系数不能组成整数个该码字维数的矢量。在这种情况下,如果要对该多个待编码系数进行全部的矢量量化,则视频编码设备可以首先计算待编码系数的个数除以码字维数后得到的整数r和余数t,之后,视频编码设备可以根据该第一变换系数矩阵包含的多个待编码系数生成R个输入信号矢量,此时,R=r+1,且最后一个输入信号矢量内可以包括(码字维数-t)个系数填充值。Wherein, if the number of coefficients to be encoded contained in the first transformation coefficient matrix is not an integer multiple of the dimension of the codeword, it means that the coefficients to be encoded in the first transformation coefficient matrix cannot form an integer number of vectors of the dimension of the codeword . In this case, if all vector quantization is to be performed on the plurality of coefficients to be encoded, the video encoding device may first calculate the integer r and the remainder t obtained by dividing the number of coefficients to be encoded by the dimension of the codeword, and then , the video encoding device can generate R input signal vectors according to a plurality of coefficients to be encoded contained in the first transform coefficient matrix, at this time, R=r+1, and the last input signal vector can include (codeword dimension- t) coefficient filling values.

例如,第一变换系数矩阵中包含有20个待编码系数,而码字维数是8,计算20除以8得到整数2和余数4,则根据这20个待编码系数可以生成3个8维的输入信号矢量,其中,3个输入信号矢量中的最后一个输入信号矢量将包含有4个系数填充值。For example, the first transformation coefficient matrix contains 20 coefficients to be coded, and the dimension of the code word is 8, calculate 20 divided by 8 to get the integer 2 and the remainder 4, then three 8-dimensional The input signal vector of , wherein, the last input signal vector among the 3 input signal vectors will contain 4 coefficient padding values.

在得到输入信号矢量之后,对于每个输入信号矢量,视频编码设备可以参考上述介绍的方式确定每个输入信号矢量对应的第一指示信息,并将确定出的每个输入信号矢量对应的第一指示信息作为该第一变换系数矩阵对应的至少一个码字指示信息。After obtaining the input signal vector, for each input signal vector, the video encoding device can refer to the above introduction to determine the first indication information corresponding to each input signal vector, and use the determined first indication information corresponding to each input signal vector The indication information is used as at least one codeword indication information corresponding to the first transformation coefficient matrix.

可选地,在第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍的情况下,如果对第一变化系数矩阵中的待编码系数进行混合量化,则视频编码设备可以根据第一变换系数矩阵中的部分待编码系数和码字维数,生成M个输入信号矢量,输入信号矢量的维数等于码字维数。之后,确定M个输入信号矢量中每个输入信号矢量对应的第一指示信息,并对第一变换系数矩阵中的剩余待编码系数进行非矢量量化的其他量化,以得到剩余待编码系数分别对应的第二指示信息。Optionally, when the number of coefficients to be encoded in the first transformation coefficient matrix is not an integer multiple of the codeword dimension, if mixed quantization is performed on the coefficients to be encoded in the first variable coefficient matrix, the video encoding The device may generate M input signal vectors according to some of the coefficients to be encoded in the first transformation coefficient matrix and the dimension of the codeword, where the dimension of the input signal vector is equal to the dimension of the codeword. Afterwards, the first indication information corresponding to each input signal vector among the M input signal vectors is determined, and other quantization other than vector quantization is performed on the remaining coefficients to be encoded in the first transformation coefficient matrix, so as to obtain the remaining coefficients to be encoded corresponding to The second instruction message for .

其中,视频编码设备可以首先计算待编码系数的个数除以码字维数后得到的整数r和余数t,之后,视频编码设备可以根据该第一变换系数矩阵包含的多个待编码系数生成M个该码字维数的输入信号矢量,此时,M=r。对于剩余的t个待编码系数,则可以采用非矢量量化的其他量化对其进行量化,从而得到每个待编码系数对应的第二指示信息。如此,对第一变换系数矩阵中包含的多个待编码系数中的部分待编码系数进行了矢量量化,得到了对应的第一指示信息,对部分待编码系数进行了非矢量量化的其他量化,得到了对应的第二指示信息。在此基础上,视频编码设备可以将得到的第一指示信息和第二指示信息作为该第一变换系数矩阵对应的多个码字指示信息。Wherein, the video coding device may firstly calculate the integer r and the remainder t obtained by dividing the number of coefficients to be coded by the codeword dimension, and then the video coding device may generate M input signal vectors of the codeword dimension, at this time, M=r. For the remaining t coefficients to be encoded, other quantization other than vector quantization may be used to quantize them, so as to obtain the second indication information corresponding to each coefficient to be encoded. In this way, vector quantization is performed on some coefficients to be encoded among the plurality of coefficients to be encoded contained in the first transformation coefficient matrix, corresponding first indication information is obtained, and other quantization other than vector quantization is performed on some coefficients to be encoded, The corresponding second indication information is obtained. On this basis, the video coding device may use the obtained first indication information and second indication information as the multiple codeword indication information corresponding to the first transform coefficient matrix.

例如,第一变换系数矩阵中的待编码系数为20个系数,而矢量的维数是8,矢量的个数是3,在这种情况下,将第一变换系数矩阵中的20个待编码系数前16个待编码系数生成2个8维的输入信号矢量,获取每个输入信号矢量对应的第一指示信息,并将剩余的4个待编码系数进行非矢量量化的其他量化,得到对应的第二指示信息。可选地,也可以对第一变换系数矩阵中的20个待编码系数前4个待编码系数进行非矢量量化的其他量化,得到对应的第二指示信息,将剩余16个待编码系数组成2个8维的输入信号矢量。其中,2个输入信号矢量中每个信号矢量对应第一指示信息。之后,将确定的2个第一指示信息和第二指示信息作为第一变换系数矩阵对应的多个码字指示信息。For example, the coefficients to be encoded in the first transformation coefficient matrix are 20 coefficients, and the dimension of the vector is 8, and the number of vectors is 3. In this case, the 20 coefficients to be encoded in the first transformation coefficient matrix The first 16 coefficients to be encoded generate two 8-dimensional input signal vectors, obtain the first indication information corresponding to each input signal vector, and perform non-vector quantization on the remaining 4 coefficients to be encoded to obtain the corresponding Second instruction message. Optionally, other quantization other than vector quantization may be performed on the first 4 coefficients to be coded of the 20 coefficients to be coded in the first transformation coefficient matrix to obtain the corresponding second indication information, and the remaining 16 coefficients to be coded to form 2 An 8-dimensional input signal vector. Wherein, each signal vector in the two input signal vectors corresponds to the first indication information. Afterwards, the determined two pieces of first indication information and second indication information are used as multiple codeword indication information corresponding to the first transformation coefficient matrix.

需要说明的是,在上述混合量化的过程中,对于矢量量化后剩余的待编码系数,视频编码设备进行的非矢量量化的其他量化可以是指标量量化或网格编码量化或其他量化中的至少一种,本申请实施例对此不做限定。It should be noted that, in the process of mixed quantization described above, for the remaining coefficients to be encoded after vector quantization, the non-vector quantization performed by the video encoding device may be index quantity quantization, trellis coding quantization or other quantization. One, which is not limited in this embodiment of the present application.

可选地,在另一种可能的实现方式中,视频编码设备可以对多个变换系数矩阵中满足矢量量化条件的每个目标变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个目标变换系数矩阵对应的至少一个码字指示信息。其中,混合量化包括矢量量化和除矢量量化之外的其他量化,每个目标变换系数矩阵对应的至少一个码字信息包括第一指示信息,第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。Optionally, in another possible implementation manner, the video encoding device may perform vector quantization or mixed quantization on multiple coefficients to be encoded in each target transform coefficient matrix that satisfies the vector quantization condition among the multiple transform coefficient matrices, At least one codeword indication information corresponding to each target transformation coefficient matrix is obtained. Wherein, mixed quantization includes vector quantization and quantization other than vector quantization, and at least one codeword information corresponding to each target transform coefficient matrix includes first indication information, and the first indication information is used to indicate the A codeword obtained during vector quantization of all or part of the coefficients to be coded.

需要说明的是,由前述步骤201中的介绍可知,多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数可以为相应变换系数矩阵中包括的全部变换系数,也可以为相应变换系数矩阵中第一区域内的变换系数。其中,当多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵中包括的全部变换系数时,该矢量量化条件可以包括变换系数矩阵的行数达到第一行数阈值,或者,变换系数矩阵的列数达到第一列数阈值,或者变换系数矩阵的面积达到第一面积阈值中的至少一种。也就是说,对于任一个变换系数矩阵,如果该变换系数矩阵满足上述条件中的一种或多种,则可以对相应变换系数矩阵中的全部变换系数进行矢量量化或混合量化。其中,变换系数矩阵的面积是指变换系数矩阵的行数与列数的乘积。It should be noted that, as can be seen from the introduction in the aforementioned step 201, the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices may be all the transform coefficients included in the corresponding transform coefficient matrix, or may be Transform coefficients in the first region of the corresponding transform coefficient matrix. Wherein, when the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices is all the transform coefficients included in the corresponding transform coefficient matrix, the vector quantization condition may include that the number of rows of the transform coefficient matrix reaches the first At least one of the row number threshold, or the column number of the transformation coefficient matrix reaching the first column number threshold, or the area of the transformation coefficient matrix reaching the first area threshold. That is to say, for any transform coefficient matrix, if the transform coefficient matrix satisfies one or more of the above conditions, vector quantization or mixed quantization can be performed on all the transform coefficients in the corresponding transform coefficient matrix. Wherein, the area of the transformation coefficient matrix refers to the product of the number of rows and the number of columns of the transformation coefficient matrix.

可选地,当多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵中的第一区域内的变换系数时,该矢量量化条件可以包括第一区域的行数达到第二行数阈值,或者,变换系数矩阵中的第一区域的列数达到第二列数阈值,或者变换系数矩阵中的第一区域的面积达到第二面积阈值中的至少一种。也就是说,对于任一个变换系数矩阵,如果该变换系数矩阵中的第一区域满足上述条件中的一种或多种,则可以对相应变换系数矩阵中的第一区域内包含的变换系数进行矢量量化或混合量化。其中,第一区域的面积是指第一区域的行数与列数的乘积。Optionally, when the multiple coefficients to be encoded included in each of the multiple transform coefficient matrices are transform coefficients in the first region of the corresponding transform coefficient matrix, the vector quantization condition may include the first region The number of rows in the transform coefficient matrix reaches the second row number threshold, or the column number of the first region in the transform coefficient matrix reaches the second column number threshold, or the area of the first region in the transform coefficient matrix reaches at least one of the second area thresholds kind. That is to say, for any transformation coefficient matrix, if the first region in the transformation coefficient matrix satisfies one or more of the above conditions, the transformation coefficients contained in the first region in the corresponding transformation coefficient matrix can be Vector quantization or hybrid quantization. Wherein, the area of the first region refers to the product of the number of rows and the number of columns of the first region.

在本申请实施例中,视频编码设备可以通过上述介绍的矢量量化条件,从多个变换系数矩阵中获取满足矢量量化条件的目标变换系数矩阵。对于每个目标变换系数矩阵,视频编码设备均可以参考前述对第一变换系数矩阵中的待编码系数的量化方法,对各个目标变换系数矩阵中包含的待编码系数进行矢量量化或混合量化。而对于不满足矢量量化条件的变化系数矩阵,则视频编码设备可以采用除矢量量化和混合量化之外的其他量化方式对其中的待编码系数进行量化,例如,采用标量量化或网格编码量化进行量化,本申请实施例对此不做限定。这样,满足矢量量化条件的目标变换系数矩阵对应的至少一个码字指示信息有可能均为第一指示信息,也有可能包含有第一指示信息和采用非矢量量化的其他量化方式得到的第二指示信息。不满足矢量量化条件的变换系数矩阵对应的至少一个码字指示信息则将均为采用非矢量量化的其他量化方式得到的第二指示信息,也即,不包含有第一指示信息。In the embodiment of the present application, the video encoding device may acquire a target transform coefficient matrix satisfying the vector quantization condition from multiple transform coefficient matrices by using the vector quantization condition introduced above. For each target transform coefficient matrix, the video encoding device may perform vector quantization or mixed quantization on the coefficients to be encoded contained in each target transform coefficient matrix by referring to the aforementioned quantization method for the coefficients to be encoded in the first transform coefficient matrix. For variable coefficient matrices that do not meet the vector quantization conditions, the video coding device can quantize the coefficients to be encoded in other quantization methods except vector quantization and mixed quantization, for example, scalar quantization or trellis coding quantization. Quantification, which is not limited in this embodiment of the present application. In this way, the at least one codeword indication information corresponding to the target transformation coefficient matrix that satisfies the vector quantization condition may be the first indication information, or may include the first indication information and the second indication obtained by using other quantization methods other than vector quantization information. The at least one codeword indication information corresponding to the transformation coefficient matrix that does not meet the vector quantization condition will be the second indication information obtained by other quantization methods other than vector quantization, that is, the first indication information will not be included.

上述仅是本申请实施例给出的两种矢量量化条件的可能实现方式,可选地,该矢量量化条件也可以为根据变换系数矩阵对应的TB的块划分信息确定的条件,或者是根据具体的量化方式所对应的量化参数设置的条件,或者是其他条件,本申请实施例对此不做限定。The above are only two possible implementations of the vector quantization conditions given in the embodiment of the present application. Optionally, the vector quantization conditions may also be conditions determined according to the block division information of the TB corresponding to the transform coefficient matrix, or according to specific The conditions for setting the quantization parameters corresponding to the quantization mode, or other conditions, are not limited in this embodiment of the present application.

步骤203:根据多个码字指示信息,生成目标视频的视频码流。Step 203: Generate a video code stream of the target video according to multiple codeword indication information.

在本申请实施例中,对目标视频对应的多个变换系数矩阵中的待编码系数进行量化,得到多个码字指示信息之后,视频编码设备可以根据多个码字指示信息,生成目标视频的视频码流。In the embodiment of the present application, after quantizing the coefficients to be encoded in the multiple transformation coefficient matrices corresponding to the target video, and obtaining multiple codeword indication information, the video encoding device can generate the target video according to the multiple codeword indication information. Video stream.

示例性地,视频编码设备可以按照各个变换系数矩阵对应的TB的先后顺序,对每个变换系数矩阵对应的至少一个码字指示信息进行二进制编码,从而得到该目标视频的视频码流。Exemplarily, the video coding device may perform binary coding on at least one codeword indication information corresponding to each transform coefficient matrix according to the sequence of TBs corresponding to each transform coefficient matrix, so as to obtain the video code stream of the target video.

可选地,由前述步骤202中介绍可知,每个变换系数矩阵中的待编码系数可能是全部进行了矢量量化,也可能是部分进行了矢量量化,或者是完全没有进行矢量量化。这样,每个变换系数矩阵对应的至少一个码字指示信息有可能均为第一指示信息,也有可能包含第一指示信息和诸如第二指示信息之类的其他量化方法对应的指示信息,或者,也有可能不包含有第一指示信息。基于此,在本申请实施例中,视频编码设备在对每个变换系数矩阵对应的至少一个码字指示信息进行二进制编码之后,还可以在每个变换系数矩阵对应的至少一个码字指示信息之前添加对应的矢量量化开关标识,以得到目标视频的视频码流。其中,该矢量量化开关标识可以用于标识对应的至少一个码字指示信息是否包含有通过矢量量化得到的第一指示信息。Optionally, it can be seen from the introduction in the foregoing step 202 that the coefficients to be encoded in each transformation coefficient matrix may all be vector quantized, or may be partially vector quantized, or not vector quantized at all. In this way, at least one codeword indication information corresponding to each transformation coefficient matrix may be the first indication information, and may also include the first indication information and indication information corresponding to other quantization methods such as the second indication information, or, It is also possible that the first indication information is not included. Based on this, in the embodiment of the present application, after the video encoding device performs binary coding on at least one codeword indication information corresponding to each transformation coefficient matrix, it may also Add the corresponding vector quantization switch identifier to obtain the video code stream of the target video. Wherein, the vector quantization switch identifier may be used to identify whether the corresponding at least one codeword indication information includes the first indication information obtained through vector quantization.

可选地,视频编码设备在对每个变换系数矩阵对应的至少一个码字指示信息进行二进制编码之后,还可以在每个变换系数矩阵对应的至少一个码字指示信息之前添加对应的矢量个数或矢量量化次数,以生成目标视频的视频码流,其中,矢量个数或矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。Optionally, after the video encoding device performs binary coding on at least one codeword indication information corresponding to each transformation coefficient matrix, it may also add the corresponding vector number before the at least one codeword indication information corresponding to each transformation coefficient matrix or the number of vector quantizations to generate a video code stream of the target video, wherein the number of vectors or the number of vector quantizations is used to indicate the number of first indication information contained in the corresponding at least one codeword indication information.

例如,当某个变换系数矩阵中的待编码系数组成了4个输入信号矢量,根据这4个输入信号矢量得到了4个码字,进而根据4个码字得到了4个第一指示信息,此时,矢量个数或矢量量化次数即为4。For example, when the coefficients to be encoded in a transformation coefficient matrix form 4 input signal vectors, 4 codewords are obtained according to the 4 input signal vectors, and 4 first indication information are obtained according to the 4 codewords, At this time, the number of vectors or the number of times of vector quantization is 4.

可选地,还可以在每个变换系数矩阵对应的至少一个码字指示信息之前添加对应的矢量量化起始位置,矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。这样,当某个变换系数矩阵对应的至少一个码字指示信息中既包含第一指示信息,同时还包含其他指示信息时,即可以通过该矢量量化起始位置获知从什么位置开始为矢量量化得到的第一指示信息。在此基础上,如果还对应有矢量个数时,即能够根据该矢量量化起始位置和矢量量化个数,确定出变换系数矩阵对应的至少一个码字指示信息中的哪几个指示信息为第一指示信息,以方便后续进行解码。Optionally, a corresponding vector quantization start position may also be added before at least one codeword indication information corresponding to each transform coefficient matrix, and the vector quantization start position is used to indicate the first of the corresponding at least one codeword indication information The location of the first indication message. In this way, when at least one codeword indication information corresponding to a certain transformation coefficient matrix contains both the first indication information and other indication information, the vector quantization start position can be used to know from which position the vector quantization is obtained. The first indication of the . On this basis, if there is also a corresponding number of vectors, it can be determined according to the vector quantization start position and the number of vector quantizations, which of the at least one codeword indication information corresponding to the transformation coefficient matrix is The first indication information is used to facilitate subsequent decoding.

可选地,目标视频的视频码流还可以包括矢量量化的使能标识,矢量量化的使能标识用于指示目标视频的视频码流是否支持矢量量化。也即,如果在对目标视频对应的多个变换系数矩阵中待编码系数进行量化的过程中支持采用矢量量化或混合量化的方法,则可以在该目标视频的视频码流包括的多个码字指示信息之前添加矢量量化的使能标识。这样,后续解码端即可以通过该使能标识获知该目标视频的视频码流是否支持矢量量化。Optionally, the video code stream of the target video may further include a vector quantization enable flag, and the vector quantization enable flag is used to indicate whether the video code stream of the target video supports vector quantization. That is, if vector quantization or mixed quantization is supported in the process of quantizing the coefficients to be encoded in multiple transformation coefficient matrices corresponding to the target video, multiple codewords included in the video code stream of the target video Add the enable flag of vector quantization before the instruction information. In this way, the subsequent decoding end can know whether the video code stream of the target video supports vector quantization through the enabling flag.

可选地,目标视频的视频码流中还可以包含有至少一个矢量维数,至少一个矢量维数用于指示目标视频的视频码流中的各个第一指示信息所指示的码字的维数。Optionally, the video code stream of the target video may also contain at least one vector dimension, at least one vector dimension is used to indicate the dimension of the codeword indicated by each first indication information in the video code stream of the target video .

其中,如果在对各个变换系数矩阵中的多个待编码系数进行矢量量化时所采用的的码字维数是相同的,则该目标视频的视频码流中将包括一个矢量维数,在这种情况下,可以将该矢量维数添加在该目标视频的视频码流包含的多个码字指示信息之前。Wherein, if the codeword dimensions used when performing vector quantization on multiple coefficients to be encoded in each transformation coefficient matrix are the same, then the video code stream of the target video will include a vector dimension, where In this case, the vector dimension can be added before the multiple codeword indication information contained in the video code stream of the target video.

如果在对不同变换系数矩阵中的多个待编码系数进行矢量量化时所采用的码字维数有的相同有的不同,且对同一变换系数矩阵中的待编码系数进行矢量量化时采用的码字维数是相同的,则该目标视频的视频码流中可以包括多个矢量维数,此时,每个变换系数矩阵对应的至少一个码字指示信息之前可以添加一个对应的矢量维数。If the dimensions of codewords used in vector quantization of multiple coefficients to be coded in different transform coefficient matrices are the same or different, and the code word dimension used in vector quantization of coefficients to be coded in the same transform coefficient matrix If the word dimensions are the same, the video code stream of the target video may include multiple vector dimensions. At this time, a corresponding vector dimension may be added before at least one codeword indication information corresponding to each transformation coefficient matrix.

例如,目标视频对应有10个变换系数矩阵,其中,有5个变换系数矩阵中的待编码系数是采用8维的码字进行的矢量量化,另外5个变换系数矩阵中的待编码系数是采用16维的码字进行的矢量量化。在这种情况下,该目标视频的视频码流中将包括两种矢量维数,分别为8和16,并且,可以在每个变换系数矩阵对应的至少一个码字指示信息之前添加对应的矢量维数。For example, the target video corresponds to 10 transformation coefficient matrices, among which, the coefficients to be encoded in 5 transformation coefficient matrices are vector quantized using 8-dimensional codewords, and the coefficients to be encoded in the other 5 transformation coefficient matrices are vector quantized using Vector quantization of 16-dimensional codewords. In this case, the video code stream of the target video will include two kinds of vector dimensions, which are 8 and 16 respectively, and the corresponding vector can be added before at least one codeword indicating information corresponding to each transform coefficient matrix dimension.

如果对变换系数矩阵中的多个待编码系数进行矢量量化时所采用的码字维数也有可能不同,则该目标视频的视频码流中可以包括多个矢量维数。在这种情况下,可以为每个变换系数矩阵对应的至少一个码字指示信息中包括的第一指示信息绑定对应的矢量维数。If the dimensionality of codewords used when performing vector quantization on multiple coefficients to be encoded in the transformation coefficient matrix may also be different, the video code stream of the target video may include multiple vector dimensions. In this case, the first indication information included in the at least one codeword indication information corresponding to each transformation coefficient matrix may be bound with the corresponding vector dimension.

例如,某个变换系数矩阵中的部分待编码系数采用的是8维的码字进行的矢量量化,部分待编码系数采用的是16维的码字进行的矢量量化,此时,对于通过8维码字量化得到的第一指示信息,可以为其绑定矢量维数8,对于通过16维的码字量化得到的第一指示信息,则可以绑定矢量维数16。For example, some of the coefficients to be encoded in a transformation coefficient matrix are vector quantized by using 8-dimensional codewords, and some of the coefficients to be encoded are vector quantized by using 16-dimensional codewords. The first indication information obtained through codeword quantization may be bound to a vector dimension of 8, and the first indication information obtained through 16-dimensional codeword quantization may be bound to a vector dimension of 16.

可选地,目标视频的视频码流中还可以包括至少一个码书索引,至少一个码书索引用于指示在确定目标视频的视频码流中的各个第一指示信息对应的码字时所采用的码书。Optionally, the video code stream of the target video may also include at least one codebook index, at least one codebook index is used to indicate the codeword used when determining the codeword corresponding to each first indication information in the video code stream of the target video codebook.

其中,当采用相同的码书对多个变换系数矩阵中的每个变换系数矩阵中的多个待编码系数进行矢量量化时,则该目标视频的视频码流将包括一个码书索引。此时,可以在目标视频的视频码流包含的多个码字指示信息之前添加该码书索引,以便后续解码端根据该码书索引获取相应地码书对该目标视频的视频码流进行解码。Wherein, when the same codebook is used to perform vector quantization on multiple coefficients to be encoded in each of the multiple transform coefficient matrices, the video code stream of the target video will include a codebook index. At this time, the codebook index can be added before the multiple codeword indication information contained in the video code stream of the target video, so that the subsequent decoder can obtain the corresponding codebook according to the code book index to decode the video code stream of the target video .

当采用不同的码书对多个变换系数矩阵中的待编码系数进行矢量量化,且同一个变换系数矩阵中的待编码系数所采用的码书相同时,该目标视频的视频码流中将包括多个码书索引。在这种情况下,可以在每个变换系数矩阵对应的至少一个码字指示信息之前添加对应的码书索引,以指示相应地变换系数矩阵中的各个第一指示信息是通过哪个码书量化得到。When different codebooks are used to vector quantize the coefficients to be encoded in multiple transform coefficient matrices, and the codebooks used by the coefficients to be encoded in the same transform coefficient matrix are the same, the video code stream of the target video will include Multiple codebook indexes. In this case, a corresponding codebook index may be added before at least one codeword indication information corresponding to each transformation coefficient matrix to indicate which codebook quantization is used to obtain each first indication information in the corresponding transformation coefficient matrix .

当对变换系数矩阵中包括的多个待编码系数也采用不同码书进行矢量量化时,该目标视频的视频码流中也将包括多个码书索引。在这种情况下,可以为每个变换系数矩阵对应的至少一个码字指示信息包括的第一指示信息绑定对应的码书索引,以指示相应的第一指示信息是通过哪个码书量化得到。When vector quantization is performed on multiple coefficients to be encoded included in the transformation coefficient matrix using different codebooks, the video code stream of the target video will also include multiple codebook indexes. In this case, the first indication information included in at least one codeword indication information corresponding to each transformation coefficient matrix can be bound to the corresponding codebook index to indicate which codebook the corresponding first indication information is obtained by quantization .

需要说明的是,该目标视频的视频码流中可以包括矢量量化开关标识、矢量量化的使能标识、矢量个数或矢量量化次数、矢量量化起始位置、矢量维数以及码书索引中的一个或多个,本申请实施例对此不做限定。It should be noted that the video code stream of the target video may include the vector quantization switch identifier, the vector quantization enable identifier, the number of vectors or the number of times of vector quantization, the starting position of vector quantization, the number of vector dimensions, and the codebook index. One or more, which is not limited in this embodiment of the present application.

在本申请实施例中,采用矢量量化的方法对多个变换系数矩阵中的待编码系数进行量化,以得到对应的第一指示信息,进而根据包含有第一指示信息的多个码字指示信息生成目标视频的视频码流。后续,解码端就能够根据第一指示信息对矢量量化的系数进行解码。由此可见,本申请实施例提供了一种基于矢量量化的视频编解码方法,实现了矢量量化在视频编解码中的应用,相较于标量量化和网络编码量化,提高了量化性能,进而提升了视频编解码的性能。In the embodiment of the present application, the vector quantization method is used to quantize the coefficients to be encoded in multiple transformation coefficient matrices to obtain the corresponding first indication information, and then indicate the information according to the multiple codewords containing the first indication information Generate the video code stream of the target video. Subsequently, the decoding end can decode the vector quantized coefficients according to the first indication information. It can be seen that the embodiment of the present application provides a video encoding and decoding method based on vector quantization, which realizes the application of vector quantization in video encoding and decoding. Compared with scalar quantization and network coding quantization, the quantization performance is improved, thereby improving The performance of video codec.

当通过上述方法对目标视频进行编码得到目标视频的视频码流之后,视频编码设备可以将该目标视频的视频码流发送至视频解码设备。接下来。视频解码设备可以通过本申请实施例提供的视频解码方法对该目标视频的视频码流进行解码。After the target video is encoded by the above method to obtain the video code stream of the target video, the video encoding device may send the video code stream of the target video to the video decoding device. next. The video decoding device may decode the video code stream of the target video by using the video decoding method provided in the embodiment of the present application.

图4是本申请实施例提供的一种视频解码方法的流程图。该方法可以应用于图1所示的系统架构中的视频解码设备,如图4所示,该方法包括以下步骤:FIG. 4 is a flowchart of a video decoding method provided by an embodiment of the present application. The method can be applied to the video decoding device in the system architecture shown in Figure 1, as shown in Figure 4, the method includes the following steps:

步骤401:获取目标视频的视频码流,目标视频的视频码流包括多个码字指示信息,该多个码字指示信息中包括第一指示信息,第一指示信息用于指示对待编码系数进行矢量量化时得到的码字。Step 401: Obtain the video code stream of the target video. The video code stream of the target video includes a plurality of codeword indication information, and the multiple codeword indication information includes first indication information, and the first indication information is used to indicate the encoding coefficient to be coded. The codeword obtained during vector quantization.

视频解码设备接收视频编码设备发送的目标视频的视频码流,或者,视频解码设备也可以从存储设备中获取视频编码设备发送至该存储设备的目标视频的视频码流。The video decoding device receives the video code stream of the target video sent by the video coding device, or the video decoding device may also acquire the video code stream of the target video sent to the storage device by the video coding device from the storage device.

其中,该目标视频的视频码流包括多个码字指示信息,该多个码字指示信息包括第一指示信息。也即,该目标视频的视频码流是通过对该目标视频对应的多个变换系数矩阵包括的待编码系数进行部分或全部矢量量化得到的。其中,该多个码字指示信息的可能实现方式可以参考前述实施例中步骤202中的说明,本申请实施例在此不再赘述。Wherein, the video code stream of the target video includes multiple codeword indication information, and the multiple codeword indication information includes first indication information. That is, the video code stream of the target video is obtained by vector quantizing part or all of the coefficients to be encoded included in the plurality of transform coefficient matrices corresponding to the target video. Wherein, for possible implementation manners of the multiple codeword indication information, reference may be made to the description in step 202 in the foregoing embodiments, and the embodiments of the present application are not repeated here.

可选地,该目标视频的视频码流中还可以包括矢量量化开关标识、矢量量化的使能标识、矢量个数或矢量量化次数、矢量量化起始位置、矢量维数以及码书索引中的一个或多个,详细说明参见前述实施例中的步骤203中的说明,本申请实施例在此不再赘述。Optionally, the video code stream of the target video may also include vector quantization switch identifier, vector quantization enable identifier, vector number or vector quantization times, vector quantization start position, vector dimension and codebook index For one or more details, refer to the description in step 203 in the foregoing embodiments for details, and details are not repeated in this embodiment of the present application.

步骤402:根据多个码字指示信息,获取目标视频的解码数据。Step 402: Obtain decoded data of the target video according to multiple codeword indication information.

视频解码设备在获取到目标视频的视频码流之后,可以从该视频码流的第一个码字指示信息开始依次对各个码字指示信息进行反量化,以得到各个码字指示信息对应的量化结果,进而根据得到的量化结果,生成目标视频的解码数据。其中,码字指示信息对应的量化结果可能是第一指示信息对应的码字,也可能是第二指示信息对应的量化结果。After the video decoding device acquires the video code stream of the target video, it can sequentially dequantize each code word indication information starting from the first code word indication information of the video code stream, so as to obtain the quantization corresponding to each code word indication information As a result, decoded data of the target video is further generated based on the obtained quantization result. The quantization result corresponding to the codeword indication information may be the codeword corresponding to the first indication information, or the quantization result corresponding to the second indication information.

由前述步骤202中的介绍可知,该目标视频的视频码流的多个码字指示信息可能全部为第一指示信息,也可能包含有第一指示信息和其他指示信息。基于此,在本申请实施例中,可以通过以下两种实现方式来获取目标视频的解码数据。It can be seen from the introduction in the foregoing step 202 that the plurality of codeword indication information of the video code stream of the target video may all be the first indication information, or may include the first indication information and other indication information. Based on this, in the embodiment of the present application, the decoded data of the target video may be obtained through the following two implementation manners.

在第一种实现方式中,当多个码字指示信息均全部为第一指示信息时,视频解码设备可以依次获取多个第一指示信息中每个第一指示信息对应的码字;根据获取到的多个码字,生成目标视频的解码数据。In the first implementation manner, when the plurality of codeword indication information are all the first indication information, the video decoding device may sequentially acquire the codeword corresponding to each first indication information in the plurality of first indication information; multiple codewords to generate the decoded data of the target video.

示例性地,视频解码设备首先获取用于对多个第一指示信息进行反量化的码书,进而根据获取的码书对各个第一指示信息进行反量化,以得到每个第一指示信息对应的码字。Exemplarily, the video decoding device first acquires a codebook for dequantizing multiple first indication information, and then dequantizes each first indication information according to the acquired codebook, so as to obtain the corresponding codeword.

在第一种可能的情况中,多个第一指示信息均采用相同的码书量化得到,这样,视频编码设备和视频解码设备可以预先约定所采用的目标码书,此时,视频解码设备获取目标码书。之后,视频解码设备可以从该目标码书中获取每个第一指示信息对应的码字。In the first possible situation, the plurality of first indication information are quantized by using the same codebook. In this way, the video encoding device and the video decoding device can pre-agreed on the target codebook to be used. At this time, the video decoding device obtains target codebook. Afterwards, the video decoding device may acquire a codeword corresponding to each piece of first indication information from the target codebook.

在第二种可能的情况中,该多个第一指示信息采用不同的码书量化得到,且该多个码字指示信息中对应同一个变换系数矩阵的至少一个第一指示信息将对应有相同的码书索引。此时,视频解码设备在依次对各个第一指示信息进行反量化时,当检测到第一个码书索引时,即根据该码书索引获取一个目标码书,并采用该目标码书对该码书索引之后的第一指示信息进行反量化,直到检测到下一个码书索引时,再获取下一个码书索引对应的目标码书,进而根据最新获取到的目标码书对下一个码书索引之后的第一指示信息进行反量化,以此类推。In the second possible situation, the multiple first indications are quantized using different codebooks, and at least one of the multiple codeword indications corresponding to the same transformation coefficient matrix will correspond to the same codebook index. At this time, when the video decoding device inversely quantizes each first indication information in turn, when the first codebook index is detected, it obtains a target codebook according to the codebook index, and uses the target codebook to The first indication information after the codebook index is dequantized until the next codebook index is detected, and then the target codebook corresponding to the next codebook index is obtained, and then the next codebook is processed according to the latest acquired target codebook The first indication information after the index is dequantized, and so on.

在第三种可能的情况中,该多个第一指示信息采用不同的码书量化得到,其中,每个第一指示信息均绑定有用于指示自身所对应的码书的码书索引。在这种情况下,视频解码设备根据每个第一指示信息绑定的用于指示自身所对应的码书的码书索引获取相应第一指示信息所对应的码书。之后,视频解码设备可以从每个第一指示信息对应的码书中获取相应第一指示信息所对应的码字。In a third possible situation, the plurality of first indication information is quantized by using different codebooks, where each first indication information is bound with a codebook index used to indicate its corresponding codebook. In this case, the video decoding device obtains the codebook corresponding to the corresponding first indication information according to the codebook index bound with each first indication information and used to indicate the codebook corresponding to itself. Afterwards, the video decoding device may acquire the codeword corresponding to the corresponding first indication information from the codebook corresponding to each first indication information.

需要说明的是,在根据获取到目标码书对应的第一指示信息进行反量化时,视频解码设备可以根据该第一指示信息,从对应的目标码书中获取该第一指示信息对应的码字。It should be noted that, when inverse quantization is performed according to the obtained first indication information corresponding to the target codebook, the video decoding device may acquire the code corresponding to the first indication information from the corresponding target codebook according to the first indication information. Character.

其中,当第一指示信息为码字索引,且该码字索引为一维索引值时,由于一个索引值就能够对应一个码字,所以视频解码设备中可以存储有索引值和码字之间的映射关系,这样,视频解码设备可以通过查表的方式获取每个码字索引对应的码字,从而得到每个第一指示信息对应的码字。Wherein, when the first indication information is a codeword index, and when the codeword index is a one-dimensional index value, since one index value can correspond to one codeword, the video decoding device can store the information between the index value and the codeword In this way, the video decoding device can obtain the codeword corresponding to each codeword index by looking up a table, so as to obtain the codeword corresponding to each first indication information.

当第一指示信息为码字索引,且该码字索引为多维索引坐标时,视频解码设备,可以根据多维索引坐标,通过相关公式确定码字索引对应的码字。When the first indication information is a codeword index, and the codeword index is a multidimensional index coordinate, the video decoding device may determine a codeword corresponding to the codeword index through a correlation formula according to the multidimensional index coordinate.

当第一指示信息为码字索引指示信息时,视频解码设备可以先根据该码字索引指示信息获取对应的码字索引,进而根据该码字索引获取对应的码字。When the first indication information is codeword index indication information, the video decoding device may first acquire a corresponding codeword index according to the codeword index indication information, and then acquire a corresponding codeword according to the codeword index.

示例性地,仍以前述介绍的码字索引指示信息包括码字组号和偏移量为例,视频解码设备可以根据码字索引指示信息中包括的组号和组内偏移量,通过下述公式计算得到码字索引。Exemplarily, still taking the aforementioned codeword index indication information including the codeword group number and offset as an example, the video decoding device may use the following codeword index indication information according to the group number and group offset included in the The above formula is used to calculate the codeword index.

码字索引=(1<<组号)+组内偏移量-1Codeword index=(1<<group number)+offset within the group-1

在得到码字索引之后,视频解码设备可以根据该码字索引,从码字索引与码字的映射关系表中获取对应的码字。After obtaining the codeword index, the video decoding device may obtain the corresponding codeword from the codeword index-to-codeword mapping relationship table according to the codeword index.

当第一指示信息为码字包含的码字分量的指示信息时,视频解码设备可以通过码字分量的指示信息获取码字分量,进而将获取到的码字分量组成码字。When the first indication information is indication information of codeword components included in the codeword, the video decoding device may acquire the codeword components through the indication information of the codeword components, and then form the acquired codeword components into a codeword.

例如,如前述实施例中介绍第一指示信息为对码字的各个码字分量进行编码得到的码字分量的指示信息,在这种情况下,视频解码设备可以直接对各个码字分量的指示信息进行解码,从而得到对应的码字分量,并将得到的码字分量组成码字。For example, as described in the foregoing embodiments, the first indication information is the indication information of codeword components obtained by encoding each codeword component of the codeword. In this case, the video decoding device can directly indicate each codeword component The information is decoded to obtain corresponding codeword components, and the obtained codeword components are composed into codewords.

在得到每个第一指示信息对应的码字之后,视频解码设备可以根据该多个码字,生成目标视频的解码数据。After obtaining the codewords corresponding to each first indication information, the video decoding device may generate decoded data of the target video according to the multiple codewords.

在一种实现方式中,将多个码字直接作为反量化重建值,视频解码设备根据多个码字的反量化重建值,生成目标视频的解码数据。In an implementation manner, the multiple codewords are directly used as dequantized reconstruction values, and the video decoding device generates decoded data of the target video according to the dequantized reconstruction values of the multiple codewords.

可选地,在一种可能的实现方式中,将多个码字分别通过相关公式计算,生成多个码字对应的反量化重建值。例如,可以在码字上乘以一个数,或者加上一个数,或者做移位操作,来生成码字对应的反量化重建值。之后,视频解码设备根据通过计算多个码字之后得到的反量化重建值,生成目标视频的解码数据。Optionally, in a possible implementation manner, multiple codewords are respectively calculated through correlation formulas to generate inverse quantization reconstruction values corresponding to the multiple codewords. For example, the codeword can be multiplied by a number, or a number can be added, or a shift operation can be performed to generate an inverse quantization reconstruction value corresponding to the codeword. Afterwards, the video decoding device generates decoded data of the target video according to the dequantized reconstruction value obtained after calculating a plurality of codewords.

可选地,在第二种实现方式中,当多个码字指示信息包括第一指示信息和第二指示信息时,视频解码设备可以获取多个第一指示信息中每个第一指示信息对应的码字,以及获取多个第二指示信息中每个第二指示信息对应的量化结果;根据获取到的多个码字和每个第二指示信息对应的量化结果,生成目标视频的解码数据。Optionally, in the second implementation manner, when the multiple codeword indication information includes the first indication information and the second indication information, the video decoding device may obtain the corresponding first indication information among the multiple first indication information. codeword, and obtain a quantization result corresponding to each second indication information in a plurality of second indication information; generate the decoded data of the target video according to the obtained multiple codewords and the quantization result corresponding to each second indication information .

其中,在该种实现方式中,该目标视频的视频码流包括的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息可以对应有矢量量化开关标识,该矢量量化开关标识用于指示对应的至少一个码字信息中是否包含有通过矢量量化得到的第一指示信息。Wherein, in this implementation manner, at least one codeword indication information corresponding to each transformation coefficient matrix among the plurality of codeword indication information included in the video code stream of the target video may correspond to a vector quantization switch identifier, and the vector quantization switch The identifier is used to indicate whether the corresponding at least one codeword information contains the first indication information obtained through vector quantization.

基于此,在第一种可能的情况中,每个变换系数矩阵对应的至少一个码字指示信息均为第一指示信息,这样,该至少一个码字指示信息对应的矢量量化开关标识将能够标识该至少一个码字指示信息均为第一指示信息还是均为第二指示信息。在这种情况下,视频解码设备在对多个码字指示信息进行反量化时,当检测到矢量量化开关标识为开启标识时,则可以获知该矢量量化开关标识后的码字指示信息为第一指示信息。之后,视频解码设备可以参考第一种实现方式中介绍的方法,获取对该矢量量化开关标识后的每个第一指示信息进行反量化的码书,并从获取的码书中获取每个第一指示信息对应的码字,直到检测到下一个矢量量化开关标识时,如果下一个矢量量化开关标识仍为开启标识,则可以继续参考上述操作进行处理,如果下一个矢量量化开关标识为关闭标识,则视频解码设备可以获知下一个矢量量化开关标识后的码字指示信息为第二指示信息,这样,视频解码设备可以基于非矢量量化的其他量化方法依次对下一个矢量量化开关标识后的第二指示信息进行反量化,直到再次检测到矢量量化开关标识,以此类推。Based on this, in the first possible situation, at least one codeword indication information corresponding to each transformation coefficient matrix is the first indication information, so that the vector quantization switch identification corresponding to the at least one codeword indication information will be able to identify Whether the at least one codeword indication information is all first indication information or all is second indication information. In this case, when the video decoding device dequantizes a plurality of codeword indication information, when it detects that the vector quantization switch flag is turned on, it can know that the codeword indication information after the vector quantization switch flag is the first 1. Instructions. Afterwards, the video decoding device may refer to the method introduced in the first implementation manner to obtain a codebook for inverse quantization of each first indication information marked by the vector quantization switch, and obtain each first indication information from the obtained codebook A codeword corresponding to the indication information, until the next vector quantization switch flag is detected, if the next vector quantization switch flag is still on, you can continue to refer to the above operations for processing, if the next vector quantization switch flag is off , then the video decoding device can learn that the codeword indication information after the next vector quantization switch identification is the second indication information, so that the video decoding device can sequentially perform the first code word after the next vector quantization switch identification based on other quantization methods other than vector quantization The second instruction information is dequantized until the vector quantization switch flag is detected again, and so on.

可选地,在上述第一种可能的情况中,每个变换系数矩阵对应的至少一个码字指示信息还可以对应有矢量个数或矢量化次数,该矢量个数或矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。这样,当视频解码设备在检测到矢量量化开关标识为开启标识之后,还可以获取该矢量个数或矢量量化次数,并根据该矢量个数或矢量量化次数,获知该矢量量化开关标识之后的几个码字指示信息为一个变换系数矩阵对应的第一指示信息。Optionally, in the first possible situation above, at least one codeword indication information corresponding to each transformation coefficient matrix may also correspond to the number of vectors or the number of vectorization times, and the number of vectors or the number of vectorization times is used to indicate The corresponding at least one codeword indicates the number of first indication information included in the information. In this way, after the video decoding device detects that the vector quantization switch flag is turned on, it can also obtain the number of vectors or the number of times of vector quantization, and according to the number of vectors or the number of times of vector quantization, know the number of times after the logo of the vector quantization switch. The codeword indication information is the first indication information corresponding to a transform coefficient matrix.

在第二种可能的情况中,每个变换系数矩阵对应的至少一个码字指示信息中可能既包含第一指示信息同时还包含第二指示信息,在这种情况下,每个变换系数矩阵对应的至少一个码字指示信息也可以对应有矢量个数或矢量化次数。此时,在一种可能的实现方式中,视频解码设备和视频编码设备可以事先约定每个矢量量化开关标识后的前a个均为第一指示信息,其中,a即为该矢量个数或矢量量化次数。在此基础上,视频解码设备在检测到矢量量化开关标识为开启标识之后,获取该开启标识后的前a个码字指示信息,此时,该前a个码字指示信息均为第一指示信息。之后,视频解码设备可以采用前述介绍的获取码书的方式,获取前a个第一指示信息对应的码书,进而从获取的码书中每个第一指示信息对应的码字。在得到每个第一指示信息对应的码字之后,如果还未检测到下一个矢量量化开关标识,则说明剩余的码字指示信息为第二指示信息,此时,视频解码设备可以基于非矢量量化的其他量化方法对剩余的第二指示信息进行反量化,以得到对应的量化结果,直到检测到下一个矢量量化开关标识时,参考上述操作进行处理。In the second possible situation, at least one codeword indication information corresponding to each transformation coefficient matrix may contain both the first indication information and the second indication information. In this case, each transformation coefficient matrix corresponds to The at least one codeword indication information of may also correspond to the number of vectors or the number of times of vectorization. At this point, in a possible implementation manner, the video decoding device and the video encoding device may agree in advance that the first a after each vector quantization switch identifier is the first indication information, where a is the vector number or Vector quantization times. On this basis, after the video decoding device detects that the vector quantization switch flag is an on flag, it acquires the indication information of the previous a codewords after the flag is turned on, and at this time, the indication information of the previous a codewords are all first indications information. Afterwards, the video decoding device can use the method of acquiring codebooks described above to acquire the codebooks corresponding to the previous a first indication information, and then obtain the codewords corresponding to each first indication information from the acquired codebooks. After obtaining the codeword corresponding to each first indication information, if the next vector quantization switch identifier has not been detected, it means that the remaining codeword indication information is the second indication information. At this time, the video decoding device can be based on non-vector quantization Other quantization methods of quantization perform inverse quantization on the remaining second indication information to obtain corresponding quantization results, until the next vector quantization switch flag is detected, refer to the above operations for processing.

可选地,在上述第二种可能的情况中,在另一种可能的实现方式中,每个变换系数矩阵对应的至少一个码字指示信息不仅对应有矢量个数或矢量化次数,还对应有矢量量化起始位置,该矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。基于此,视频解码设备在检测到矢量量化开关标识为开启标识之后,可以根据该矢量量化起始位置确定从该开启标识之后的第一个码字指示信息开始,第几个码字指示信息为第一指示信息,也即,确定该开启标识之后的第一个第一指示信息在哪里。这样,对于第一个指示信息之前的码字指示信息,视频解码设备基于非矢量量化的其他量化方法对其进行反量化,以得到对应的量化结果。之后,根据矢量个数或矢量量化次数从第一个第一指示信息起获取相应数量的码字指示信息,这些获取的码字指示信息即为第一指示信息,参考前述方法获取这些第一指示信息对应的码书,进而从获取到的码书中获取每个第一指示信息对应的码字。在得到每个第一指示信息对应的码字之后,如果还未检测到下一个矢量量化开关标识,则说明剩余的码字指示信息为第二指示信息,此时,视频解码设备可以基于非矢量量化的其他量化方法对剩余的第二指示信息进行反量化,以得到对应的量化结果,直到检测到下一个矢量量化开关标识时,参考上述操作进行处理。Optionally, in the second possible situation above, in another possible implementation, at least one codeword indication information corresponding to each transformation coefficient matrix not only corresponds to the number of vectors or the number of times of vectorization, but also corresponds to There is a vector quantization start position, and the vector quantization start position is used to indicate the position of the first first indication information in the corresponding at least one codeword indication information. Based on this, after the video decoding device detects that the vector quantization switch flag is an on flag, it can determine, according to the vector quantization start position, which codeword indication information to start from the first codeword indication information after the on flag is The first indication information, that is, determine where is the first first indication information after the activation flag. In this way, for the codeword indication information before the first indication information, the video decoding device performs inverse quantization based on other quantization methods other than vector quantization to obtain corresponding quantization results. Afterwards, according to the number of vectors or the number of times of vector quantization, a corresponding number of codeword indication information is obtained from the first first indication information, and these acquired codeword indication information is the first indication information, and these first indications are obtained by referring to the aforementioned method The codebook corresponding to the information, and then obtain the codeword corresponding to each first indication information from the obtained codebook. After obtaining the codeword corresponding to each first indication information, if the next vector quantization switch identifier has not been detected, it means that the remaining codeword indication information is the second indication information. At this time, the video decoding device can be based on non-vector quantization Other quantization methods of quantization perform inverse quantization on the remaining second indication information to obtain corresponding quantization results, until the next vector quantization switch flag is detected, refer to the above operations for processing.

在得到多个码字指示信息中每个码字指示信息对应的量化结果之后,视频解码设备可以参考前述第一种实现方式中介绍的方法,根据每个量化结果得到反量化重建值,进而根据反量化重建值,生成该目标视频的解码数据,本申请实施例在此不再赘述。After obtaining the quantization result corresponding to each codeword indication information in the plurality of codeword indication information, the video decoding device can refer to the method introduced in the first implementation mode above to obtain an inverse quantization reconstruction value according to each quantization result, and then according to Dequantize the reconstructed value to generate the decoded data of the target video, which will not be repeated in this embodiment of the present application.

需要说明的是,在上述第一种实现方式和第二种实现方式中,目标视频的视频码流中还可以包含有至少一个矢量维数。It should be noted that, in the first implementation manner and the second implementation manner above, the video code stream of the target video may further include at least one vector dimension.

其中,当目标视频的视频码流的多个码字指示信息之前包含一个矢量维数时,视频解码设备在检测到该矢量维数之后,可以获悉该视频码流包含的多个码字指示信息中的第一指示信息对应的码字维数。在目标视频的视频码流不携带码书索引的情况下,视频解码设备也可以通过该矢量维数确定对应的码书,本申请实施例对此不做限定。Wherein, when the multiple codeword indication information of the video code stream of the target video contains a vector dimension before, the video decoding device can learn the multiple codeword indication information contained in the video code stream after detecting the vector dimension The codeword dimension corresponding to the first indication information in . In the case that the video code stream of the target video does not carry a codebook index, the video decoding device may also determine the corresponding codebook through the vector dimension, which is not limited in this embodiment of the present application.

当目标视频的视频码流的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息之前对应有一个矢量维数时,视频解码设备在检测到一个矢量维数之后,即可以获知该矢量维数与下一个矢量维数之间的码字指示信息中的第一指示信息对应的码字维数。When at least one codeword indication information corresponding to each transformation coefficient matrix in the multiple codeword indication information of the video code stream of the target video is preceded by a vector dimension, after the video decoding device detects a vector dimension, that is The codeword dimension corresponding to the first indication information in the codeword indication information between the vector dimension and the next vector dimension may be known.

当目标视频的视频码流的多个码字指示信息中的每个第一指示信息均绑定有一个矢量维数时,视频解码设备在对每个第一指示信息进行反量化时,即能够通过相应第一指示信息对应的矢量维数获知该第一指示信息对应的码字的码字维数。此时,该矢量维数还能用于指示绑定的码字指示信息为通过矢量量化得到的第一指示信息。When each first indication information among the multiple codeword indication information of the video code stream of the target video is bound with a vector dimension, when the video decoding device dequantizes each first indication information, it can The codeword dimension of the codeword corresponding to the first indication information is obtained through the vector dimension corresponding to the first indication information. At this time, the vector dimension can also be used to indicate that the bundled codeword indication information is the first indication information obtained through vector quantization.

可选地,在本申请实施例中,目标视频的视频码流包含的多个码字指示信息之前还可以包含矢量量化的使能标识,这样,当视频解码设备开始对该目标视频的视频码流进行解码时,通过该使能标识即能够获知该目标视频的视频码流是否支持矢量量化。Optionally, in this embodiment of the application, the multiple codeword indication information contained in the video code stream of the target video may also contain a vector quantization enable flag, so that when the video decoding device starts to code the video code of the target video When the stream is being decoded, whether the video code stream of the target video supports vector quantization can be known through the enable flag.

在本申请实施例中,目标视频的视频码流中包含有多个码字指示信息,且多个码字指示信息中包含有通过矢量量化得到的第一指示信息,视频解码设备可以根据第一指示信息生成视频码流对应的解码数据,由此可见,本申请实施例提供了一种基于矢量量化的视频解码方法,实现了矢量量化在视频解码中的应用,由于视频解码设备能够对矢量量化得到的视频码流进行解码,因此,视频编码设备也就可以通过矢量量化的方式来生成视频码流,这样,相较于标量量化和网络编码量化,提高了量化性能,进而提升了视频编解码的性能。In this embodiment of the present application, the video code stream of the target video contains a plurality of codeword indication information, and the plurality of codeword indication information includes the first indication information obtained through vector quantization, and the video decoding device can be based on the first The instruction information generates the decoded data corresponding to the video code stream. It can be seen that the embodiment of the present application provides a video decoding method based on vector quantization, which realizes the application of vector quantization in video decoding. Since the video decoding device can perform vector quantization The obtained video code stream is decoded, therefore, the video coding device can also generate the video code stream by means of vector quantization. In this way, compared with scalar quantization and network coding quantization, the quantization performance is improved, and the video codec is further improved. performance.

接下来,对本申请实施例提供的一种视频编码装置进行介绍。Next, a video encoding device provided by an embodiment of the present application is introduced.

参见图5,本申请实施例提供了一种视频编码装置500,该装置500包括:Referring to FIG. 5, an embodiment of the present application provides a video encoding device 500, which includes:

获取模块501,用于获取目标视频对应的多个变换系数矩阵,多个变换系数矩阵中的每个变换系数矩阵中包括多个待编码系数;An acquisition module 501, configured to acquire a plurality of transform coefficient matrices corresponding to the target video, each of the plurality of transform coefficient matrices includes a plurality of coefficients to be encoded;

量化模块502,用于对多个变换系数矩阵中的待编码系数进行量化,得到多个码字指示信息,多个码字指示信息用于指示对待编码系数进行量化时得到的量化结果,多个码字指示信息中包括第一指示信息,第一指示信息用于指示对待编码系数进行矢量量化时得到的码字;The quantization module 502 is configured to quantize the coefficients to be encoded in multiple transform coefficient matrices to obtain multiple codeword indication information, the multiple codeword indication information is used to indicate the quantization results obtained when the coefficients to be encoded are quantized, and the multiple The codeword indication information includes first indication information, and the first indication information is used to indicate the codeword obtained when the coefficient to be coded is vector quantized;

生成模块503,用于根据多个码字指示信息,生成目标视频的视频码流。The generation module 503 is configured to generate a video code stream of the target video according to multiple codeword indication information.

可选地,量化模块502主要用于:Optionally, the quantization module 502 is mainly used for:

对多个变换系数矩阵中的每个变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个变换系数矩阵对应的至少一个码字信息,其中,混合量化包括矢量量化和除矢量量化之外的其他量化,每个变换系数矩阵对应的至少一个码字信息包括第一指示信息,第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。Perform vector quantization or mixed quantization on a plurality of coefficients to be encoded in each of the plurality of transform coefficient matrices to obtain at least one codeword information corresponding to each transform coefficient matrix, wherein the mixed quantization includes vector quantization and division For quantization other than vector quantization, at least one codeword information corresponding to each transformation coefficient matrix includes first indication information, and the first indication information is used to indicate the vector quantization of all or part of the coefficients to be encoded in the corresponding transformation coefficient matrix The code word obtained in the process.

可选地,量化模块502还用于:Optionally, the quantization module 502 is also used for:

对多个变换系数矩阵中满足矢量量化条件的每个目标变换系数矩阵中的多个待编码系数进行矢量量化或混合量化,得到每个目标变换系数矩阵对应的至少一个码字指示信息,其中,混合量化包括矢量量化和除矢量量化之外的其他量化,每个目标变换系数矩阵对应的至少一个码字信息包括第一指示信息,第一指示信息用于指示对相应变换系数矩阵中的全部或部分待编码系数进行矢量量化的过程中得到的码字。Perform vector quantization or mixed quantization on a plurality of coefficients to be encoded in each target transform coefficient matrix satisfying the vector quantization condition among the plurality of transform coefficient matrices, and obtain at least one codeword indication information corresponding to each target transform coefficient matrix, wherein, Hybrid quantization includes vector quantization and quantization other than vector quantization, and at least one codeword information corresponding to each target transform coefficient matrix includes first indication information, and the first indication information is used to indicate that all or A codeword obtained during vector quantization of some of the coefficients to be encoded.

可选地,多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵内包括的全部变换系数。Optionally, the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices are all the transform coefficients included in the corresponding transform coefficient matrix.

可选地,矢量量化条件包括变换系数矩阵的行数达到第一行数阈值,或者,变换系数矩阵的列数达到第一列数阈值,或者变换系数矩阵的面积达到第一面积阈值中的至少一种。Optionally, the vector quantization condition includes that the number of rows of the transform coefficient matrix reaches the first row number threshold, or the number of columns of the transform coefficient matrix reaches the first column number threshold, or the area of the transform coefficient matrix reaches at least one of the first area thresholds A sort of.

可选地,多个变换系数矩阵中的每个变换系数矩阵中包括的多个待编码系数为相应变换系数矩阵中第一区域内的变换系数,第一区域是通过基于扫描区域的系数编码SRCC技术扫描得到的区域。Optionally, the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices are transform coefficients in the first area of the corresponding transform coefficient matrix, and the first area is coded by scanning area-based coefficient SRCC The area scanned by technology.

可选地,矢量量化条件包括变换系数矩阵中的第一区域的行数达到第二行数阈值,或者,变换系数矩阵中的第一区域的列数达到第二列数阈值,或者变换系数矩阵中的第一区域的面积达到第二面积阈值中的至少一种。Optionally, the vector quantization condition includes that the number of rows in the first region in the transform coefficient matrix reaches the second row number threshold, or that the column number in the first region in the transform coefficient matrix reaches the second column number threshold, or that the transform coefficient matrix The area of the first region in reaches at least one of the second area thresholds.

可选地,目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量量化开关标识,矢量量化开关标识用于指示对应的至少一个码字信息中是否包含有通过矢量量化得到的第一指示信息。Optionally, at least one codeword indication information corresponding to each transform coefficient matrix in the video code stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate whether the corresponding at least one codeword information contains The first indication information obtained by vector quantization.

可选地,目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量个数或矢量量化次数,矢量个数或所述矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video corresponds to the number of vectors or the number of times of vector quantization, and the number of vectors or the number of times of vector quantization is used to indicate the corresponding at least one The number of first indication information included in the codeword indication information.

可选地,目标视频的视频码流中每个变换系数矩阵对应的至少一个码字指示信息还对应有矢量量化起始位置,矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the video code stream of the target video also corresponds to a vector quantization start position, and the vector quantization start position is used to indicate the corresponding at least one codeword indication information The position of the first first indication message of .

可选地,量化模块502还用于:Optionally, the quantization module 502 is also used for:

如果第一变换系数矩阵中的待编码系数的个数为码字维数的N倍,则根据第一变换系数矩阵中的全部待编码系数生成N个输入信号矢量,N为正整数,输入信号矢量的维数等于码字维数,第一变换系数矩阵为多个变换系数矩阵中的任一个,或者,第一变换系数矩阵为多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be encoded in the first transformation coefficient matrix is N times the codeword dimension, then N input signal vectors are generated according to all coefficients to be encoded in the first transformation coefficient matrix, N is a positive integer, and the input signal The dimension of the vector is equal to the dimension of the code word, the first transformation coefficient matrix is any one of a plurality of transformation coefficient matrices, or the first transformation coefficient matrix is a transformation coefficient matrix satisfying the vector quantization condition among the plurality of transformation coefficient matrices;

确定N个输入信号矢量中每个输入信号矢量对应的第一指示信息;Determine the first indication information corresponding to each input signal vector in the N input signal vectors;

将确定的N个第一指示信息作为第一变换系数矩阵对应的至少一个码字指示信息。The determined N pieces of first indication information are used as at least one codeword indication information corresponding to the first transformation coefficient matrix.

可选地,量化模块502还用于:Optionally, the quantization module 502 is also used for:

如果第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍,则根据第一变换系数矩阵中的部分待编码系数和码字维数,生成M个输入信号矢量,输入信号矢量的维数等于码字维数,第一变换系数矩阵为多个变换系数矩阵中的任一个,或者,第一变换系数矩阵为多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be coded in the first transform coefficient matrix is not an integer multiple of the codeword dimension, M input signal vectors are generated according to the partial codeword coefficients and the codeword dimension in the first transform coefficient matrix, The dimension of the input signal vector is equal to the dimension of the code word, the first transform coefficient matrix is any one of multiple transform coefficient matrices, or the first transform coefficient matrix is a transform coefficient matrix satisfying the vector quantization condition among the multiple transform coefficient matrices ;

确定M个输入信号矢量中每个输入信号矢量对应的第一指示信息,并对第一变换系数矩阵中的剩余待编码系数进行非矢量量化的其他量化,以得到剩余待编码系数对应的第二指示信息;Determine the first indication information corresponding to each input signal vector in the M input signal vectors, and perform non-vector quantization on the remaining coefficients to be encoded in the first transformation coefficient matrix, so as to obtain the second instructions;

将确定的第一指示信息和第二指示信息作为第一变换系数矩阵对应的多个码字指示信息。The determined first indication information and second indication information are used as indication information of a plurality of codewords corresponding to the first transformation coefficient matrix.

可选地,量化模块502还用于:Optionally, the quantization module 502 is also used for:

如果第一变换系数矩阵中的待编码系数的个数不为码字维数的整数倍,则根据第一变换系数矩阵中的全部待编码系数和码字维数,生成R个输入信号矢量,输入信号矢量的维数等于码字维数,且R个输入信号矢量中的一个输入信号矢量中包括一个或多个系数填充值,第一变换系数矩阵为多个变换系数矩阵中的任一个,或者,第一变换系数矩阵为多个变换系数矩阵中满足矢量量化条件的变换系数矩阵;If the number of coefficients to be encoded in the first transformation coefficient matrix is not an integer multiple of the codeword dimension, then R input signal vectors are generated according to all coefficients to be encoded and the codeword dimension in the first transformation coefficient matrix, The dimensionality of the input signal vector is equal to the codeword dimensionality, and one of the R input signal vectors includes one or more coefficient filling values, and the first transform coefficient matrix is any one of a plurality of transform coefficient matrices, Alternatively, the first transformation coefficient matrix is a transformation coefficient matrix that satisfies the vector quantization condition among the plurality of transformation coefficient matrices;

确定R个输入信号矢量中每个输入信号矢量对应的第一指示信息;Determine the first indication information corresponding to each input signal vector in the R input signal vectors;

将确定的R个第一指示信息作为第一变换系数矩阵对应的至少一个码字指示信息。The determined R pieces of first indication information are used as at least one codeword indication information corresponding to the first transformation coefficient matrix.

可选地,第一指示信息为码字索引、码字索引指示信息或码字包含的码字分量的指示信息。Optionally, the first indication information is a codeword index, codeword index indication information, or indication information of a codeword component included in the codeword.

可选地,码字索引为一维索引值,或者码字索引为多维索引坐标。Optionally, the codeword index is a one-dimensional index value, or the codeword index is a multidimensional index coordinate.

可选地,目标视频的视频码流包括矢量量化的使能标识,矢量量化的使能标识用于指示目标视频的视频码流是否支持矢量量化。Optionally, the video code stream of the target video includes a vector quantization enabling flag, and the vector quantization enabling flag is used to indicate whether the video code stream of the target video supports vector quantization.

可选地,目标视频的视频码流中包含有至少一个矢量维数,至少一个矢量维数用于指示目标视频的视频码流中的各个第一指示信息所指示的码字的维数。Optionally, the video code stream of the target video contains at least one vector dimension, and the at least one vector dimension is used to indicate the dimension of the codewords indicated by each first indication information in the video code stream of the target video.

可选地,目标视频的视频码流中还包括至少一个码书索引,至少一个码书索引用于指示在确定目标视频的视频码流中的各个第一指示信息对应的码字时所采用的码书。Optionally, the video code stream of the target video further includes at least one codebook index, and the at least one codebook index is used to indicate the codeword used when determining the codeword corresponding to each first indication information in the video code stream of the target video code book.

接下来,对本申请实施例提供的一种视频解码装置进行介绍。Next, a video decoding device provided by an embodiment of the present application is introduced.

参见图6,本申请实施例提供了一种视频编码装置600,该装置600包括:Referring to FIG. 6, an embodiment of the present application provides a video encoding device 600, which includes:

第一获取模块601,用于获取目标视频的视频码流,目标视频的视频码流包括多个码字指示信息,多个码字指示信息用于指示对目标视频对应的多个变换系数矩阵中的待编码系数进行量化时得到的量化结果,多个码字指示信息中包括第一指示信息,第一指示信息用于指示对待编码系数进行矢量量化时得到的码字,多个变换系数矩阵中的每个变换系数矩阵包括多个待编码系数;The first acquisition module 601 is configured to acquire the video code stream of the target video, the video code stream of the target video includes a plurality of codeword indication information, and the plurality of codeword indication information is used to indicate a plurality of transformation coefficient matrices corresponding to the target video The quantization result obtained when the coefficient to be encoded is quantized, the plurality of codeword indication information includes the first indication information, the first indication information is used to indicate the codeword obtained when the coefficient to be encoded is vector quantized, and the plurality of transform coefficient matrices Each transformation coefficient matrix of includes a plurality of coefficients to be coded;

第二获取模块602,用于根据多个码字指示信息,获取目标视频的解码数据。The second acquiring module 602 is configured to acquire decoded data of the target video according to multiple codeword indication information.

可选地,多个码字指示信息为多个第一指示信息,第二获取模块602主要用于:Optionally, the multiple codeword indication information is multiple first indication information, and the second obtaining module 602 is mainly used for:

获取多个第一指示信息中每个第一指示信息对应的码字;Acquiring a codeword corresponding to each first indication information in the plurality of first indication information;

根据获取到的多个码字,生成目标视频的解码数据。Generate decoded data of the target video according to the acquired multiple codewords.

可选地,第二获取模块602主要用于:Optionally, the second acquiring module 602 is mainly used for:

将多个码字作为反量化重建值,或者,对多个码字进行处理,得到反量化重建值;Using multiple codewords as dequantized reconstruction values, or processing multiple codewords to obtain dequantized reconstruction values;

根据反量化重建值生成所述目标视频的解码数据。The decoded data of the target video is generated according to the dequantized reconstruction value.

可选地,多个码字指示信息包括多个第一指示信息和多个第二指示信息,第二指示信息用于指示通过非矢量量化的其他量化得到的量化结果;第二获取模块602还主要用于:Optionally, the plurality of codeword indication information includes a plurality of first indication information and a plurality of second indication information, and the second indication information is used to indicate quantization results obtained through other quantizations other than vector quantization; the second obtaining module 602 also Mainly used:

获取多个第一指示信息中每个第一指示信息对应的码字,以及获取多个第二指示信息中每个第二指示信息对应的量化结果;Acquiring a codeword corresponding to each first indication information in a plurality of first indication information, and acquiring a quantization result corresponding to each second indication information in a plurality of second indication information;

根据获取到的多个码字和每个第二指示信息对应的量化结果,生成目标视频的解码数据。The decoded data of the target video is generated according to the obtained multiple codewords and the quantization result corresponding to each second indication information.

可选地,第一指示信息为码字索引、码字索引指示信息或码字包含的码字分量的指示信息。Optionally, the first indication information is a codeword index, codeword index indication information, or indication information of a codeword component included in the codeword.

可选地,目标视频的视频码流中还包括至少一个码书索引,至少一个码书索引用于指示在确定多个码字指示信息中的各个第一指示信息对应的码字时所采用的码书。Optionally, the video code stream of the target video further includes at least one codebook index, at least one codebook index is used to indicate the codeword used when determining the codeword corresponding to each first indication information among the multiple codeword indication information code book.

可选地,目标视频的视频码流还包括矢量量化的使能标识,矢量量化的使能标识用于指示目标视频的视频码流是否支持矢量量化。Optionally, the video code stream of the target video further includes a vector quantization enable flag, and the vector quantization enable flag is used to indicate whether the video code stream of the target video supports vector quantization.

可选地,目标视频的视频码流包括的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量量化开关标识,矢量量化开关标识用于指示对应的至少一个码字信息中是否包含有通过矢量量化得到的第一指示信息。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix among the plurality of codeword indication information included in the video code stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate at least one corresponding Whether the codeword information includes the first indication information obtained through vector quantization.

可选地,目标视频的视频码流包括的多个码字指示信息中每个变换系数矩阵对应的至少一个码字指示信息对应有矢量个数或矢量量化次数,矢量个数或矢量量化次数用于指示对应的至少一个码字指示信息中包含的第一指示信息的个数。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix in the multiple codeword indication information included in the video code stream of the target video corresponds to the number of vectors or the number of times of vector quantization, and the number of vectors or the number of times of vector quantization is represented by Indicates the number of first indication information included in the corresponding at least one codeword indication information.

可选地,每个变换系数矩阵对应的至少一个码字指示信息还对应有矢量量化起始位置,矢量量化起始位置用于指示对应的至少一个码字指示信息中的第一个第一指示信息的位置。Optionally, at least one codeword indication information corresponding to each transformation coefficient matrix also corresponds to a vector quantization start position, and the vector quantization start position is used to indicate the first first indication in the corresponding at least one codeword indication information The location of the information.

可选地,目标视频的视频码流中包含有至少一个矢量维数,至少一个矢量维数用于指示目标视频的视频码流中的各个第一指示信息所指示的码字的维数。Optionally, the video code stream of the target video contains at least one vector dimension, and the at least one vector dimension is used to indicate the dimension of the codewords indicated by each first indication information in the video code stream of the target video.

综上所述,在本申请实施例中,可以采用矢量量化的方法对多个变换系数矩阵中的待编码系数进行量化,以得到对应的第一指示信息,进而根据包含有第一指示信息的多个码字指示信息生成目标视频的视频码流。后续,解码端就能够根据第一指示信息对矢量量化的系数进行解码。由此可见,本申请实施例提供了一种基于矢量量化的视频编解码方法,实现了矢量量化在视频编解码中的应用,相较于标量量化和网络编码量化,提高了量化性能,进而提升了视频编解码的性能。To sum up, in the embodiment of the present application, the vector quantization method can be used to quantize the coefficients to be encoded in multiple transformation coefficient matrices to obtain the corresponding first indication information, and then according to the Multiple codewords indicate information to generate a video code stream of the target video. Subsequently, the decoding end can decode the vector quantized coefficients according to the first indication information. It can be seen that the embodiment of the present application provides a video encoding and decoding method based on vector quantization, which realizes the application of vector quantization in video encoding and decoding. Compared with scalar quantization and network coding quantization, the quantization performance is improved, thereby improving The performance of video codec.

需要说明的是,上述实施例提供的视频编码、视频解码装置在视频编码、视频解码时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的视频编码、视频解码装置与视频编码、视频解码方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that, the video encoding and video decoding devices provided in the above-mentioned embodiments only use the division of the above-mentioned functional modules for illustration during video encoding and video decoding. In practical applications, the above-mentioned functions can be assigned by different The functional modules are completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the video encoding and video decoding apparatuses provided in the above embodiments belong to the same concept as the video encoding and video decoding method embodiments, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.

图7是根据一示例性实施例示出的一种的服务器结构示意图。上述实施例中的视频编码或者视频解码服务器的功能即可以通过图7中所示的服务器来实现。该服务器可以是后台服务器集群中的服务器。具体来讲:Fig. 7 is a schematic structural diagram of a server according to an exemplary embodiment. The functions of the video encoding or video decoding server in the above embodiments can be implemented by the server shown in FIG. 7 . The server may be a server in a background server cluster. Specifically:

服务器700包括中央处理单元(Central Processing Unit,CPU)701、包括随机存取存储器(Random Access Memory,RAM)702和只读存储器(Read-Only Memory,ROM)703的系统存储器704,以及连接系统存储器704和中央处理单元701的系统总线705。服务器700还包括帮助计算机内的各个器件之间传输信息的基本输入/输出系统(Input/Output,I/O系统)706,和用于存储操作系统713、应用程序714和其他程序模块715的大容量存储设备707。The server 700 includes a central processing unit (Central Processing Unit, CPU) 701, a system memory 704 including a random access memory (Random Access Memory, RAM) 702 and a read-only memory (Read-Only Memory, ROM) 703, and a connection system memory 704 and the system bus 705 of the central processing unit 701. The server 700 also includes a basic input/output system (Input/Output, I/O system) 706 that helps to transmit information between various devices in the computer, and a large computer for storing operating systems 713, application programs 714, and other program modules 715. capacity storage device 707 .

基本输入/输出系统706包括有用于显示信息的显示器708和用于用户输入信息的诸如鼠标、键盘之类的输入设备709。其中显示器708和输入设备709都通过连接到系统总线705的输入输出控制器710连接到中央处理单元701。基本输入/输出系统706还可以包括输入输出控制器710以用于接收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入输出控制器710还提供输出到显示屏、打印机或其他类型的输出设备。The basic input/output system 706 includes a display 708 for displaying information and an input device 709 such as a mouse and a keyboard for user input of information. Both the display 708 and the input device 709 are connected to the central processing unit 701 through the input and output controller 710 connected to the system bus 705 . The basic input/output system 706 may also include an input output controller 710 for receiving and processing input from a number of other devices such as a keyboard, mouse, or electronic stylus. Similarly, input output controller 710 also provides output to a display screen, printer, or other type of output device.

大容量存储设备707通过连接到系统总线705的大容量存储控制器(未示出)连接到中央处理单元701。大容量存储设备707及其相关联的计算机可读介质为服务器700提供非易失性存储。也就是说,大容量存储设备707可以包括诸如硬盘或者CD-ROM(CompactDisc Read-Only Memory,紧凑型光盘只读储存器)驱动器之类的计算机可读介质(未示出)。Mass storage device 707 is connected to central processing unit 701 through a mass storage controller (not shown) connected to system bus 705 . Mass storage device 707 and its associated computer-readable media provide non-volatile storage for server 700 . That is to say, the mass storage device 707 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory, Compact Disc Read-Only Memory) drive.

不失一般性,计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM(Erasable Programmable Read Only Memory,可擦除可编程只读存储器)、EEPROM(Electrically Erasable Programmable Read Only Memory,带电可擦可编程只读存储器)、闪存或其他固态存储设备,CD-ROM、DVD(Digital Versatile Disc,数字通用光盘)或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知计算机存储介质不局限于上述几种。上述的系统存储器704和大容量存储设备707可以统称为存储器。Without loss of generality, computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read Only Memory, erasable programmable read-only memory), EEPROM (Electrically Erasable Programmable Read Only Memory, electrically erasable programmable read-only memory), flash memory or other solid-state storage Device, CD-ROM, DVD (Digital Versatile Disc, Digital Versatile Disc) or other optical storage, cassette, tape, disk storage or other magnetic storage device. Certainly, those skilled in the art know that the computer storage medium is not limited to the above-mentioned ones. The above-mentioned system memory 704 and mass storage device 707 may be collectively referred to as memory.

根据本申请的各种实施例,服务器700还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即服务器700可以通过连接在系统总线705上的网络接口单元711连接到网络712,或者说,也可以使用网络接口单元711来连接到其他类型的网络或远程计算机系统(未示出)。According to various embodiments of the present application, the server 700 can also run on a remote computer connected to the network through a network such as the Internet. That is to say, the server 700 can be connected to the network 712 through the network interface unit 711 connected to the system bus 705, or in other words, the network interface unit 711 can also be used to connect to other types of networks or remote computer systems (not shown).

上述存储器还包括一个或者一个以上的程序,一个或者一个以上程序存储于存储器中,被配置由CPU执行。所述一个或者一个以上程序包含用于进行本申请实施例提供的视频编码、视频解码方法的指令。The above-mentioned memory also includes one or more programs, one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the video encoding and video decoding methods provided by the embodiments of the present application.

本申请实施例还提供了一种计算机可读存储介质,当该存储介质中的指令由服务器的处理器执行时,使得服务器能够执行上述实施例提供的视频编码、视频解码方法。例如,该计算机可读存储介质可以是ROM、RAM、CD-ROM、磁带、软盘和光数据存储设备等。值得注意的是,本申请实施例提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。The embodiment of the present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the server, the server can execute the video encoding and video decoding methods provided in the foregoing embodiments. For example, the computer readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like. It should be noted that the computer-readable storage medium mentioned in the embodiment of the present application may be a non-volatile storage medium, in other words, may be a non-transitory storage medium.

应当理解的是,实现上述实施例的全部或部分步骤可以通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。所述计算机指令可以存储在上述计算机可读存储介质中。It should be understood that all or part of the steps for implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the above-mentioned computer-readable storage medium.

也即是,在一些实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例提供的视频编码或视频解码方法。That is, in some embodiments, there is also provided a computer program product including instructions, which, when run on a computer, causes the computer to execute the video encoding or video decoding methods provided in the above embodiments.

以上所述并不用以限制本申请实施例,凡在本申请实施例的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请实施例的保护范围之内。The above description is not intended to limit the embodiments of the present application, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included within the scope of protection of the embodiments of the present application.

Claims (30)

1. A method of video encoding, the method comprising:
obtaining a plurality of transformation coefficient matrixes corresponding to a target video, wherein each transformation coefficient matrix in the plurality of transformation coefficient matrixes comprises a plurality of coefficients to be coded;
quantizing a coefficient to be coded in the multiple transformation coefficient matrixes to obtain multiple code word indication information, wherein the multiple code word indication information is used for indicating a quantization result obtained when the coefficient to be coded is quantized, the multiple code word indication information comprises first indication information, and the first indication information is used for indicating a code word obtained when the coefficient to be coded is subjected to vector quantization;
generating a video code stream of the target video according to the plurality of code word indication information;
the quantizing the coefficients to be encoded in the plurality of transform coefficient matrices includes:
if the number of the coefficients to be coded in a first transformation coefficient matrix is N times of the dimension of the code word, generating N input signal vectors according to all the coefficients to be coded in the first transformation coefficient matrix, wherein N is a positive integer, the dimension of the input signal vector is equal to the dimension of the code word, and the first transformation coefficient matrix is any one of the plurality of transformation coefficient matrices, or the first transformation coefficient matrix is the transformation coefficient matrix which meets the vector quantization condition in the plurality of transformation coefficient matrices; determining first indication information corresponding to each input signal vector in the N input signal vectors; and taking the determined N pieces of first indication information as at least one piece of code word indication information corresponding to the first transformation coefficient matrix.
2. The method according to claim 1, wherein the quantizing the coefficients to be encoded in the plurality of transform coefficient matrices to obtain a plurality of codeword indication information includes:
and performing vector quantization or mixed quantization on a plurality of coefficients to be coded in each of the plurality of transform coefficient matrices to obtain at least one piece of codeword information corresponding to each transform coefficient matrix, wherein the mixed quantization includes vector quantization and other quantization except for vector quantization, the at least one piece of codeword information corresponding to each transform coefficient matrix includes the first indication information, and the first indication information is used for indicating codewords obtained in the process of performing vector quantization on all or part of coefficients to be coded in the corresponding transform coefficient matrix.
3. The method according to claim 1, wherein the quantizing the coefficients to be encoded in the plurality of transform coefficient matrices to obtain a plurality of codeword indication information includes:
and performing vector quantization or mixed quantization on a plurality of coefficients to be coded in each target transform coefficient matrix which meets the vector quantization condition in the plurality of transform coefficient matrices to obtain at least one piece of codeword indication information corresponding to each target transform coefficient matrix, wherein the mixed quantization comprises vector quantization and other quantization except for the vector quantization, the at least one piece of codeword information corresponding to each target transform coefficient matrix comprises the first indication information, and the first indication information is used for indicating codewords obtained in the process of performing the vector quantization on all or part of the coefficients to be coded in the corresponding transform coefficient matrix.
4. The method of claim 3, wherein the plurality of coefficients to be encoded included in each of the plurality of matrices of transform coefficients is all transform coefficients included in the respective matrix of transform coefficients.
5. The method of claim 4, wherein the vector quantization condition comprises at least one of a number of rows of the matrix of transform coefficients reaching a first row number threshold, a number of columns of the matrix of transform coefficients reaching a first column number threshold, or an area of the matrix of transform coefficients reaching a first area threshold.
6. The method of claim 3, wherein the plurality of coefficients to be encoded included in each of the plurality of transform coefficient matrices are transform coefficients in a first region of the corresponding transform coefficient matrix, the first region being a region scanned by a scanning region-based coefficient coding (SRCC) technique.
7. The method of claim 6, wherein the vector quantization condition comprises at least one of a number of rows of a first region in the transform coefficient matrix reaching a second row number threshold, or a number of columns of the first region in the transform coefficient matrix reaching a second column number threshold, or an area of the first region in the transform coefficient matrix reaching a second area threshold.
8. The method according to claim 3, wherein the at least one codeword indication information corresponding to each transform coefficient matrix in the video stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate whether the corresponding at least one codeword information includes the first indication information obtained by vector quantization.
9. The method according to claim 2 or 3, wherein the at least one codeword indication information corresponding to each transform coefficient matrix in the video code stream of the target video corresponds to a vector number or a vector quantization number, and the vector number or the vector quantization number is used to indicate the number of the first indication information included in the corresponding at least one codeword indication information.
10. The method according to claim 9, wherein at least one codeword indication information corresponding to each transform coefficient matrix in the video stream of the target video further corresponds to a vector quantization start position, and the vector quantization start position is used to indicate a position of a first indication information in the corresponding at least one codeword indication information.
11. The method of claim 1, wherein quantizing the coefficients to be encoded in the plurality of transform coefficient matrices, further comprises:
if the number of the coefficients to be coded in the first transformation coefficient matrix is not integer times of the number of dimensions of the code word, generating M input signal vectors according to part of the coefficients to be coded in the first transformation coefficient matrix and the number of dimensions of the code word, wherein the number of dimensions of the input signal vectors is equal to the number of dimensions of the code word;
determining first indication information corresponding to each input signal vector in the M input signal vectors, and performing other non-vector quantization on the residual coefficients to be coded in the first transform coefficient matrix to obtain second indication information corresponding to the residual coefficients to be coded;
and taking the determined first indication information and the second indication information as a plurality of code word indication information corresponding to the first transformation coefficient matrix.
12. The method of claim 1, wherein quantizing the coefficients to be encoded in the plurality of transform coefficient matrices, further comprises:
if the number of the coefficients to be coded in the first transformation coefficient matrix is not an integer multiple of the code word dimension, generating R input signal vectors according to all the coefficients to be coded in the first transformation coefficient matrix and the code word dimension, wherein the dimension of the input signal vector is equal to the code word dimension, and one input signal vector in the R input signal vectors comprises one or more coefficient filling values;
determining first indication information corresponding to each input signal vector in the R input signal vectors;
and taking the determined R pieces of first indication information as at least one piece of code word indication information corresponding to the first transformation coefficient matrix.
13. The method according to claim 1, wherein the first indication information is a codeword index, codeword index indication information, or indication information of codeword components included in a codeword, and the codeword index is a one-dimensional index value or the codeword index is a multi-dimensional index coordinate.
14. The method of claim 1, wherein the video bitstream of the target video comprises an enable flag of vector quantization, and wherein the enable flag of vector quantization is used to indicate whether the video bitstream of the target video supports vector quantization.
15. The method of claim 1, wherein at least one vector dimension is included in the video code stream of the target video, and the at least one vector dimension is used to indicate a dimension of the codeword indicated by each first indication information in the video code stream of the target video.
16. The method according to claim 1, wherein the video stream of the target video further includes at least one codebook index, and the at least one codebook index is used for indicating a codebook adopted when determining a codeword corresponding to each first indication information in the video stream of the target video.
17. A method of video decoding, the method comprising:
the method comprises the steps of obtaining a video code stream of a target video, wherein the video code stream of the target video comprises a plurality of code word indication information, the code word indication information is used for indicating a quantization result obtained when a coefficient to be coded in a plurality of transformation coefficient matrixes corresponding to the target video is quantized, the code word indication information comprises a plurality of first indication information and a plurality of second indication information, the first indication information is used for indicating a code word obtained when the coefficient to be coded is subjected to vector quantization, the second indication information is used for indicating a quantization result obtained through other quantization which is not subjected to vector quantization, and each transformation coefficient matrix in the transformation coefficient matrixes comprises a plurality of coefficients to be coded;
acquiring decoding data of the target video according to the plurality of code word indication information;
the obtaining of the decoded data of the target video according to the multiple codeword indication information includes:
acquiring a code word corresponding to each first indication information in the plurality of first indication information, and acquiring a quantization result corresponding to each second indication information in the plurality of second indication information;
and generating the decoded data of the target video according to the acquired multiple code words and the quantization result corresponding to each piece of second indication information.
18. The method of claim 17, wherein the plurality of codeword indication information is a plurality of first indication information, and the obtaining the decoded data of the target video according to the plurality of codeword indication information comprises:
acquiring a code word corresponding to each piece of first indication information in the plurality of pieces of first indication information;
and generating the decoding data of the target video according to the acquired multiple code words.
19. The method according to claim 18, wherein the generating decoded data of the target video according to the obtained multiple code words comprises:
taking the multiple code words as inverse quantization reconstruction values, or processing the multiple code words to obtain inverse quantization reconstruction values;
and generating the decoding data of the target video according to the inverse quantization reconstruction value.
20. The method according to any of claims 17-19, wherein the first indication information is a codeword index, codeword index indication information, or indication information of codeword components included in a codeword, and the codeword index is a one-dimensional index value, or the codeword index is a multi-dimensional index coordinate.
21. The method of claim 17, further comprising at least one codebook index in the video bitstream of the target video, wherein the at least one codebook index is used to indicate a codebook used in determining the codeword corresponding to each first indication information in the plurality of codeword indication information.
22. The method of claim 17, wherein the video bitstream of the target video further comprises an enable flag for vector quantization, and wherein the enable flag for vector quantization is used to indicate whether the video bitstream of the target video supports vector quantization.
23. The method according to claim 17, 19 or 22, wherein at least one codeword indication information corresponding to each transform coefficient matrix in a plurality of codeword indication information included in the video stream of the target video corresponds to a vector quantization switch identifier, and the vector quantization switch identifier is used to indicate whether the corresponding at least one codeword information includes the first indication information obtained by vector quantization.
24. The method of claim 17, wherein at least one of the codeword indication information corresponding to each transform coefficient matrix in the multiple codeword indication information included in the video stream of the target video corresponds to a vector number or a vector quantization time, and the vector number or the vector quantization time is used to indicate a number of the first indication information included in the corresponding at least one codeword indication information.
25. The method of claim 24, wherein the at least one codeword indication corresponding to each transform coefficient matrix further corresponds to a vector quantization start position, and the vector quantization start position is used to indicate a position of a first indication information in the corresponding at least one codeword indication information.
26. The method of claim 17, wherein at least one vector dimension is included in the video stream of the target video, and the at least one vector dimension is used to indicate a dimension of a codeword indicated by each first indication information in the video stream of the target video.
27. A video encoding apparatus, characterized in that the apparatus comprises:
the video coding device comprises an acquisition module, a coding module and a decoding module, wherein the acquisition module is used for acquiring a plurality of transformation coefficient matrixes corresponding to a target video, and each transformation coefficient matrix in the plurality of transformation coefficient matrixes comprises a plurality of coefficients to be coded;
the quantization module is configured to quantize coefficients to be encoded in the multiple transform coefficient matrices to obtain multiple codeword indication information, where the multiple codeword indication information is used to indicate a quantization result obtained when the coefficients to be encoded are quantized, the multiple codeword indication information includes first indication information, and the first indication information is used to indicate a codeword obtained when the coefficients to be encoded are vector quantized;
the generating module is used for generating a video code stream of the target video according to the multiple code word indicating information;
the quantization module is configured to generate N input signal vectors according to all the coefficients to be encoded in a first transform coefficient matrix if the number of the coefficients to be encoded in the first transform coefficient matrix is N times of a codeword dimension, where N is a positive integer, the dimension of the input signal vector is equal to the codeword dimension, the first transform coefficient matrix is any one of the transform coefficient matrices, or the first transform coefficient matrix is a transform coefficient matrix satisfying a vector quantization condition among the transform coefficient matrices; determining first indication information corresponding to each input signal vector in the N input signal vectors; and taking the determined N pieces of first indication information as at least one piece of code word indication information corresponding to the first transformation coefficient matrix.
28. A video decoding apparatus, characterized in that the apparatus comprises:
the video code stream of the target video comprises a plurality of code word indication information, the plurality of code word indication information are used for indicating quantization results obtained when coefficients to be coded in a plurality of transformation coefficient matrixes corresponding to the target video are quantized, the plurality of code word indication information comprise a plurality of first indication information and a plurality of second indication information, the first indication information is used for indicating code words obtained when the coefficients to be coded are subjected to vector quantization, the second indication information is used for indicating quantization results obtained through other quantization which is not subjected to vector quantization, and each transformation coefficient matrix in the plurality of transformation coefficient matrixes comprises a plurality of coefficients to be coded;
a second obtaining module, configured to obtain, according to the multiple codeword indication information, decoded data of the target video;
the second obtaining module is configured to obtain a codeword corresponding to each of the plurality of first indication information, and obtain a quantization result corresponding to each of the plurality of second indication information; and generating the decoded data of the target video according to the acquired multiple code words and the quantization result corresponding to each piece of second indication information.
29. A computer-readable storage medium, in which a computer program is stored, which, when executed by a computer, implements the video encoding method of any one of claims 1 to 16.
30. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when executed by a computer, the computer program implements the video decoding method according to any one of claims 17 to 26.
CN202110735696.2A 2021-06-30 2021-06-30 Video encoding method, video decoding method, video encoding device, video decoding device and storage medium Active CN113473154B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110735696.2A CN113473154B (en) 2021-06-30 2021-06-30 Video encoding method, video decoding method, video encoding device, video decoding device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110735696.2A CN113473154B (en) 2021-06-30 2021-06-30 Video encoding method, video decoding method, video encoding device, video decoding device and storage medium

Publications (2)

Publication Number Publication Date
CN113473154A CN113473154A (en) 2021-10-01
CN113473154B true CN113473154B (en) 2022-11-22

Family

ID=77876393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110735696.2A Active CN113473154B (en) 2021-06-30 2021-06-30 Video encoding method, video decoding method, video encoding device, video decoding device and storage medium

Country Status (1)

Country Link
CN (1) CN113473154B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117416369A (en) * 2023-11-30 2024-01-19 广州市启宏普浩企业管理服务有限公司 A kind of abnormal driving behavior warning method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR0178195B1 (en) * 1995-03-28 1999-05-01 배순훈 Apparatus for encoding an image signal using vector quantization technique
CN101430881B (en) * 2008-11-10 2013-04-17 华为技术有限公司 Encoding, decoding and encoding/decoding method, encoding/decoding system and correlated apparatus
CN103546759A (en) * 2013-10-29 2014-01-29 沈阳工业大学 An Image Compression Coding Method Based on the Combination of Wavelet Packet and Vector Quantization
CN104661035B (en) * 2015-02-11 2018-05-29 北京大学 Compression method, system and the video-frequency compression method of video local feature description

Also Published As

Publication number Publication date
CN113473154A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
US12256089B2 (en) Coded-block-flag coding and derivation
TWI520619B (en) Bypass bins for reference index coding in video coding
US11949868B2 (en) Method and device for selecting context model of quantization coefficient end flag bit
WO2018103568A1 (en) Methods of encoding and decoding cloud desktop content, device, and system
CN106797472A (en) Method for encoding a digital image and associated decoding method, device and computer program
RU2008142358A (en) METHOD AND SYSTEM FOR CODING AND DECODING INFORMATION RELATED TO VIDEO COMPRESSION
US20110033126A1 (en) Method for improving the performance of embedded graphics coding
US11606557B2 (en) Method and apparatus for performing low complexity computation in transform kernel for video compression
CN121262374A (en) Method and apparatus for selecting coding mode for coding/decoding residual block
EP3507799A1 (en) Quantizer with index coding and bit scheduling
WO2013159705A1 (en) Encoding/decoding method, video sequence stream encoding/decoding method, and device corresponding thereto
CN110710208A (en) Embed information about EOB location
KR20110043684A (en) Methods, systems, and apparatus for compressing or decompressing digital signals
CN121942197A (en) Method, apparatus and medium for visual data processing
CN113473154B (en) Video encoding method, video decoding method, video encoding device, video decoding device and storage medium
US20210021871A1 (en) Method and apparatus for performing low-complexity operation of transform kernel for video compression
CN104519368A (en) Image encoding and decoding reconstruction methods and devices
EP3190793A1 (en) Method for re-encoding image and apparatus therefor
CN116668691A (en) A picture compression transmission method, device and terminal equipment
CN113141505B (en) A video data encoding method and device
US20250330591A1 (en) Intra prediction method and apparatus, video encoding method and apparatus, video decoding method and apparatus, and system
CN104661035B (en) Compression method, system and the video-frequency compression method of video local feature description
CN113840144A (en) Image component prediction method, encoder, decoder, and computer storage medium
CN116600123B (en) Video encoding method and device, video decoding method and device and electronic equipment
WO2025153016A1 (en) Method, apparatus, and medium for visual data processing

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20260130

Address after: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Country or region after: China

Address before: Hangzhou City, Zhejiang province 310051 Binjiang District Qianmo Road No. 555

Patentee before: Hangzhou Hikvision Digital Technology Co.,Ltd.

Country or region before: China