Transform kernel selection method for video coding, calculation circuit for bit rate fitting
By calculating the code rate of the residual block transformation type in video coding and selecting the transformation type with the smallest code rate, the problem of poor selection of transformation types in video coding is solved, the coding complexity and time are reduced, and the coding efficiency is improved.
Patent Information
- Application Number
- CN202210200491.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-03-03
AI Technical Summary
In video coding, it is difficult for existing technologies to adaptively select the optimal transformation type, resulting in a complex rate-distortion optimization RDO process, which increases coding time and complexity and reduces coding efficiency.
By obtaining the residual block input data in the video image, calculate the code rate formula of the transformation type according to the basis function in the encoder, use multiple Laplacian matrices to perform weighted summation, obtain the update matrix, and calculate the code rate formula according to the code rate formula and The Laplace quadratic formula calculates the code rate after transformation, and selects the transformation type with the smallest code rate as the residual block transformation type in video coding.
It avoids the complex rate-distortion optimization RDO process, reduces coding time and complexity, improves coding efficiency, and achieves optimal transformation type selection for residual block adaptation.
Smart Images

Figure CN114845104B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video coding technology, and more specifically, to a transform kernel selection method, system, bit rate fitting calculation circuit, storage medium and terminal for video coding. Background Art
[0002] Video encoding refers to the process of converting a file in a certain video format into a file in another video format through a specific compression technology.
[0003] The introduction of multiple transform types in the field of video coding has improved the coding performance of video coding. However, there is also a problem that the transform type selected during video coding is not optimal and adaptive.
[0004] Based on the above problems, the present invention proposes a transform kernel selection method, system, rate fitting calculation circuit, storage medium and terminal for video coding, which can adaptively select a better transform type for the residual block according to the characteristics of the input residual, avoiding the complex rate distortion optimization RDO process; with a small performance loss, the encoding time and encoding complexity are reduced, and the encoding efficiency is improved. Summary of the invention
[0005] The embodiments of the present application provide a transform kernel selection method, system, rate fitting calculation circuit, storage medium and terminal for video coding. In order to have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a general review, nor is it intended to determine key / important components or describe the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a preface to the detailed description that follows.
[0006] In a first aspect, an embodiment of the present application provides a transform kernel selection method for video coding, the method comprising:
[0007] Obtain input data of a residual block in a video image;
[0008] Obtaining a code rate formula of a transform type of a residual block according to input data and a basis function of a transform type in an encoder;
[0009] Perform weighted summation on multiple Laplacian matrices to obtain an update matrix;
[0010] Calculate the bit rate of the transformed type after the residual block is transformed according to the bit rate formula of the transformed type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block;
[0011] The transform type with the smallest bit rate is selected as the transform type of the residual block in video coding.
[0012] Optionally, a code rate formula of the transform type of the residual block is obtained according to the input data and the basis function of the transform type in the encoder, including:
[0013] Perform a one-dimensional transformation on the input data and the basis function of the transformation type in the encoder to obtain a one-dimensional transformation result of the residual block;
[0014] According to the one-dimensional transformation result and the penalty strength, a code rate formula of the transformation type of the residual block is obtained.
[0015] Optionally, the bit rate of the transform type after the residual block is transformed is calculated according to the bit rate formula of the transform type, multiple Laplace matrices, the update matrix, and the Laplace quadratic formula of the residual block, including:
[0016] Substitute the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix;
[0017] According to the quadratic formula of the update matrix and the code rate formula of the transformation type, the code rate formula of the transformation type of the residual block corresponding to the update matrix is obtained.
[0018] Optionally, the method further includes:
[0019] Extracting update matrix weights according to a code rate formula of a transformation type of a residual block corresponding to the update matrix;
[0020] Fit update matrix weights based on penalty strength and multiple Laplacian matrices.
[0021] Optionally, the method further includes:
[0022] The weight of the updated matrix after fitting is selected by offline adjustment, and multiple residual weights corresponding to multiple Laplace matrices are determined.
[0023] Optionally, the method further includes:
[0024] Calculate the bit rate intermediate amount of the transformation type of the residual block according to the multiple residual weights, the multiple Laplace matrices and the Laplace quadratic formula of the residual block;
[0025] Calculate the bit rates of the transform types corresponding to the multiple Laplace matrices after the residual block is transformed according to the bit rate intermediate quantity of the transform type and the Laplace quadratic formula of the residual block;
[0026] The bit rates of the transformation types corresponding to the multiple Laplacian matrices are linearly combined to obtain the bit rate of the transformation type after the residual block is transformed.
[0027] Optionally, the transform type includes: discrete cosine type II transform, discrete cosine type VIII transform and / or discrete sine type VII transform.
[0028] In a second aspect, an embodiment of the present application provides a calculation circuit for code rate fitting, the circuit comprising a first-level circuit device and a second-level circuit device;
[0029] The first-stage circuit device includes four selectors, four shifters and four first adders, wherein one shifter and one selector are connected to the same first adder; after four input data of the residual block are shifted by the four shifters, selected by the four selectors, and added by the four first adders, four intermediate code rates of the transformation type of the residual block are obtained; the number of bits shifted by the shifter is determined by the residual weight of the Laplacian matrix;
[0030] The second-stage circuit device includes four multipliers, two second adders and one third adder, wherein two of the four multipliers are connected to one second adder, so that the four multipliers are connected to two second adders, and the two second adders connected to the four multipliers are connected to another third adder; the four intermediate code rates are respectively input into the four multipliers, so that the four intermediate code rates are multiplied by the four input data, and then added by the second adder and the third adder to obtain the code rate of the transformation type after the final residual block is transformed;
[0031] The residual weights of the Laplacian matrix are obtained by any of the above technical solutions.
[0032] In a third aspect, an embodiment of the present application provides a transform kernel selection system for video coding, the system comprising:
[0033] A residual data acquisition module, used to acquire input data of a residual block in a video image;
[0034] A code rate formula acquisition module, used to obtain a code rate formula of a transformation type of a residual block according to input data and a basis function of the transformation type in an encoder;
[0035] An update matrix acquisition module is used to perform weighted summation on multiple Laplace matrices to obtain an update matrix;
[0036] A bit rate calculation module is used to calculate the bit rate of the transform type after the residual block is transformed according to the bit rate formula of the transform type, multiple Laplace matrices, update matrices and the Laplace quadratic formula of the residual block; the bit rate of the transform type after the residual block is transformed according to the bit rate formula of the transform type, multiple Laplace matrices, update matrices and the Laplace quadratic formula of the residual block, including:
[0037] Substituting the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix;
[0038] According to the quadratic formula of the update matrix and the code rate formula of the transform type, obtaining the code rate formula of the transform type of the residual block corresponding to the update matrix;
[0039] Extracting an update matrix weight according to a code rate formula of the transformation type of the residual block corresponding to the update matrix;
[0040] Fitting the update matrix weights according to the penalty intensity and the multiple Laplace matrices;
[0041] Selecting the updated matrix weights after fitting by offline adjustment to determine a plurality of residual weights corresponding to the plurality of Laplace matrices;
[0042] Calculating a rate intermediate amount of the transform type of the residual block according to the plurality of residual weights, the plurality of Laplace matrices and a Laplace quadratic formula of the residual block;
[0043] Calculating the bit rate of the transform type corresponding to the multiple Laplace matrices after the residual block is transformed according to the bit rate intermediate amount of the transform type and the Laplace quadratic form formula of the residual block;
[0044] Linearly combining the bit rates of the transformation type corresponding to the multiple Laplacian matrices to obtain the bit rate of the transformation type after the residual block is transformed;
[0045] The transform type selection module is used to select the transform type with the smallest bit rate as the transform type of the residual block in video coding.
[0046] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0047] In a fifth aspect, an embodiment of the present application provides a terminal, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0048] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0049] In an embodiment of the present application, the transform kernel selection method for video coding first obtains the input data of the residual block in the video image; then obtains the code rate formula of the transform type of the residual block according to the input data and the basis function of the transform type in the encoder; then performs weighted summation of multiple Laplace matrices to obtain an update matrix; secondly, according to the code rate formula of the transform type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block, the code rate of the transform type after the residual block is transformed is calculated; finally, the transform type with the smallest code rate is selected as the transform type of the residual block in video coding. The present application can calculate the code rate of the transform type after the residual block is transformed according to the input data of the residual block, and select the transform type with the smallest code rate as the transform type of the residual block in video coding, and can adaptively select a better transform type for the residual block, avoiding the complex rate distortion optimization RDO process; with a small performance loss, the encoding time and encoding complexity are reduced, and the encoding efficiency is improved.
[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0052] Figure 1 It is a flowchart of a transform kernel selection method for video coding provided by an embodiment of the present application;
[0053] Figure 2 is a Laplacian matrix of a transform kernel selection method for video coding provided in an embodiment of the present application ~ Matrix diagram of
[0054] Figure 3 is a Laplacian matrix of a transform kernel selection method for video coding provided in an embodiment of the present application ~ Matrix diagram of
[0055] Figure 4 It is a circuit diagram of calculating the bit rate intermediate quantity H of a transform kernel selection method for video coding provided by an embodiment of the present application;
[0056] Figure 5 It is a circuit diagram of a transform kernel selection method for video coding provided by an embodiment of the present application for calculating the bit rate of the transform type corresponding to the Laplacian matrix;
[0057] Figure 6It is a flowchart of another transform kernel selection method for video coding provided by an embodiment of the present application;
[0058] Figure 7 It is a structural schematic diagram of a calculation circuit for bit rate fitting provided in an embodiment of the present application;
[0059] Figure 8 It is a structural schematic diagram of a transform kernel selection system for video coding provided by an embodiment of the present application;
[0060] Fig. 9 This is a terminal schematic diagram provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The following description and the drawings sufficiently illustrate specific embodiments of the invention to enable those skilled in the art to practice them.
[0062] It should be clear that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are only examples of systems and methods consistent with some aspects of the present invention as detailed in the attached claims.
[0064] In the description of the present invention, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In addition, in the description of the present invention, unless otherwise specified, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.
[0065] Transform coding is an important component of video coding and is also the main tool for improving video compression rate. The widely used coding type in the previous generation of encoders is discrete cosine type II transform (DCT-II), such as HEVC and AVS2; new transform types are introduced in the new generation of video coding protocols, including but not limited to discrete cosine type VIII transform (DCT-VIII) and discrete sine type VII transform (DST-VII). For residual blocks with certain characteristics, these new transform types can have higher energy concentration efficiency, and compared with the use of discrete cosine type II transform (DCT-II), these new transform types can provide higher compression rates.
[0066] In the first generation of the Alliance for Open Media Video 1 (AV1), the four basic transform types used are: DCT, ADST, flip-ADST and IDTX; the three transform types used in Versatile Video Coding (VVC) are: DCT-II, DCT-VIII and DST-VII; similarly, the three transform types used in the third generation of the Audio Video Coding Standard 3 (AVS3) are: DCT-II, DCT-VIII and DST-VII; the introduction of these transform types can provide encoders with 2% to 3% coding performance benefits. The introduction of multiple transform types improves coding performance while also bringing computational complexity. Compared with the previous generation of encoders that only use DCT-II, the new generation of encoders needs to choose from multiple transform types. The transform in the encoder is a two-dimensional transform. In order to reduce the complexity of calculation, the two-dimensional transform is generally split into two one-dimensional transforms (i.e., row transform and column transform) for the transform in the encoder. Each one-dimensional transform can select one of multiple transform types as the transform type used in actual encoding. For the first-generation Open Media Video Alliance AV1, each residual block needs to select a transform type from 4x4=16. For the multi-purpose video coding VVC and the third-generation audio and video coding standard AVS3, each residual block needs to select a transform type from 3x3=9. In conventional encoders, the rate-distortion optimization (RDO) method is generally used to select the transform type. The use of the rate-distortion optimization method to select the transform type has high complexity and large calculation delay, and is not suitable for scenarios that require real-time encoding and decoding.
[0067] In order to solve the problem of high complexity in the transformation kernel selection process, different encoding protocols have given different fast algorithms. At present, in the first generation of the Open Media Video Alliance AV1, a neural network can be used to select the transformation type. When using a neural network to select the transformation type, relevant information can be extracted from the residual block and input into the trained neural network. Different transformation types can be scored, some transformation types can be screened, and the remaining transformation types can be input into the rate distortion optimization (RDO) process to select the optimal transformation type. In the intra-frame coding of the multi-purpose video coding VVC, the relationship between different angle modes and transformation types can be obtained through statistics, and several fixed transformation types can be pre-set for each angle mode, thereby avoiding the rate distortion optimization (RDO) of all transformation types, and reducing the circuit complexity to a certain extent. These two methods can reduce the number of transformation types entering the rate-distortion optimization (RDO) process to a certain extent, but there are still obvious drawbacks. Although the neural network used in the first-generation Open Media Video Alliance AV1 is not large, the parameters in the neural network are all floating-point numbers, which results in a large amount of resources being consumed in hardware design to ensure the precision of floating-point numbers and the accuracy of the neural network. This results in a lot of resource overhead in the hardware. In the multi-purpose video coding VVC, although the complexity of the calculation is controlled, only a few fixed transformation types will be traversed for rate-distortion optimization (RDO) for each angle mode, which results in no guarantee that the selected change type is optimal and adaptive, reducing the performance of the encoder.
[0068] The present invention proposes a transform kernel selection method, device, storage medium and terminal for video coding. By implementing a specific algorithm, the code rate of the residual block after all transform types can be quickly predicted, and a better transform type can be adaptively selected for the residual block according to the characteristics of the input residual based on the code rate priority criterion. The method described in the present invention is applied to coding protocols with multi-core transform functions (such as multi-purpose video coding VVC, the first-generation open media video alliance AV1 and the third-generation audio and video coding standard AVS3, etc.), avoiding the complex rate-distortion optimization RDO process and reducing computing resources; with a small performance loss, the coding time and coding complexity are reduced, and the coding efficiency is improved.
[0069] The following will be combined with the attached Figure 1 -Attached Figure 6 , a transform kernel selection method for video encoding provided in an embodiment of the present application is introduced in detail.
[0070] See also Figure 1-5 , which is a flowchart of a transform kernel selection method for video coding provided by an embodiment of the present application. Figure 1-5As shown, the method of the embodiment of the present application may include the following steps:
[0071] S110, obtaining input data of the residual block in the video image.
[0072] In the embodiment of the present application, input data of the residual block in the video image is collected and analyzed and processed to adaptively select a better transformation type for the residual block.
[0073] S120, obtaining a code rate formula of the transformation type of the residual block according to the input data and the basis function of the transformation type in the encoder. Specifically, S120 includes:
[0074] S121, performing a one-dimensional transformation on the input data and the basis function of the transform type in the encoder to obtain a one-dimensional transformation result of the residual block. In the embodiment of the present application, the one-dimensional transformation result of the residual block obtained by combining the input data of the residual block with the basis function of the transform type is expressed by a one-dimensional transformation formula:
[0075]
[0076] Where i represents the i-th row of the transformation matrix determined by the basis function; T represents the transpose of the matrix; when Represents the basis functions of the discrete cosine type II transform When , the above one-dimensional transformation formula represents the one-dimensional transformation formula of discrete cosine II transformation type. Basis functions representing discrete sine type VII transforms When , the above one-dimensional transformation formula represents the one-dimensional transformation formula of discrete sine VII type transformation. When representing the basis function of discrete cosine VIII transform, the above one-dimensional transform formula represents the one-dimensional transform formula of discrete cosine VIII transform; x is input data, represents the transformation coefficient after the one-dimensional transformation of the i-th row; taking the 4-point transformation as an example, when x represents a column vector composed of 4 input data hour, Expressed as .
[0077] In the embodiment of the present application, it is necessary to obtain the basis function of the transform type in the encoder. When the transform type is discrete cosine II transform, the basis function of discrete cosine II transform is:
[0078]
[0079] When the transform type is discrete sine type VII transform, the basis function of discrete sine type VII transform is:
[0080]
[0081] In the basis functions of the above-mentioned discrete cosine II transform and discrete sine VII transform, j represents the jth frequency component, k represents the kth item in the jth frequency component; N is equivalent to n in the following content, and both represent the transformation size. When N=4, it represents a 4-point transformation, and when N=8, it represents an 8-point transformation.
[0082] In the integer transform used in the encoder, the transformation matrix of the discrete cosine type VIII transform has a certain duality with the transformation matrix of the discrete sine type VII transform. The transformation matrix of the discrete cosine type VIII transform can be directly obtained from the transformation matrix of the discrete sine type VII transform. The basis function of the discrete cosine type VIII transform can be directly obtained through the basis function of the above-mentioned discrete sine type VII transform. The basis function of the discrete cosine type VIII transform will not be described here.
[0083] In different coding standards, the transformation matrix of the same transformation type may not be the same. The difference between the basis functions of the transformation types between different coding standards lies in the difference in scaling factors. The basis functions of the transformation types between different coding standards present a multiple relationship.
[0084] S122, according to the one-dimensional transformation result and the penalty strength, obtain the code rate formula of the transformation type of the residual block. In the embodiment of the present application, the code rate formula of the transformation type of the predicted residual block is:
[0085]
[0086] Where C represents the bit rate; express The corresponding weight is also called penalty intensity or penalty weight.
[0087] when When C is 1, it represents the square sum of the transform coefficients, that is, the energy of the input data. The size of increases the penalty for the energy of a specific frequency. When setting from small to large, the high-frequency coefficients can be considered unimportant, and the penalty for high-frequency coefficients is increased. If the value is large, the bit rate C will be larger, and the transform type will be less likely to be selected. When setting from large to small, if i is at a small position, If the value is large, the bit rate C will be larger, and the transform type will be less likely to be selected. In the embodiment of the present application, the significance of transforming the residual block according to the transform type is the concentration of energy, that is, after the input residual block is transformed by the transform type, the energy of the residual block can be concentrated in the upper left corner, that is, at the position where i is smaller. The embodiment of the present application can be set in order from small to large The value of .
[0088] In the embodiment of the present application, multiple Laplace matrices can be used to obtain ,pass Calculate the bit rate of the residual block after being transformed by different transformation types.
[0089] S130, performing weighted summation on multiple Laplace matrices to obtain an update matrix. In the embodiment of the present application, for a Laplace matrix L, assuming that the eigenvalues and eigenvectors of the Laplace matrix L are respectively and , then according to the Laplace quadratic formula of the residual block, the expansion of the Laplace quadratic formula of the residual block is:
[0090]
[0091] The right side of this formula has the same value as the bit rate Very similar form. Since L is a Laplace matrix, and is the same, but and They are not necessarily the same or similar. and The same or similar, then the Laplace quadratic formula of the residual block is It is the same or similar to the code rate C.
[0092] In the embodiment of the present application, when the transform type is discrete cosine II transform, eight Laplace matrices very similar to the Laplace matrix L can be ~ Perform weighted summation to obtain the updated matrix F. Laplace matrix ~ When the transformation length is 8, Figure 2 As shown, the first row from left to right is the Laplace matrix to The second row from left to right is the Laplace matrix to The matrix diagram of the Laplacian matrix ~ Respectively expressed as:
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100] The Laplace matrix ~ The conditions that need to be met are: Laplace matrix ~ The characteristic vector is the basis function of the transformation type; the Laplacian matrix ~ itself should be sparse; the Laplacian matrix that satisfies these conditions ~ , so that the embodiment of the present application can use the Laplace matrix at a very low computational cost ~ Get the update matrix , the approximate value of the code rate C is obtained by using linear combination.
[0101] The Laplace matrices given for the same transform type have the same eigenvectors, and the eigenvectors are the same as the basis functions of the transform type. When the transform type is discrete cosine type II transform, the Laplace matrix ~ The expressions for the eigenvalues and eigenvectors of can be:
[0102]
[0103] Wherein, e represents the e-th Laplacian matrix.
[0104] In the embodiment of the present application, in order to make the Laplace quadratic form formula of the residual block The penalty intensity can be made equal to or similar to the bit rate C by linear fitting. With eigenvalue Same or similar, through 8 Laplacian matrices ~ The 8 eigenvalues of the updated matrix eigenvalues are obtained To linearly fit the penalty strength , Represents the eigenvalue corresponding to the e-th Laplacian matrix.
[0105] In the embodiment of the present application, when the transform type is discrete cosine type VIII transform and discrete sine type VII transform, the method of obtaining the update matrix and the method of obtaining the eigenvalue of the update matrix by weighted summing of multiple Laplace matrices is similar to the method of obtaining the update matrix and the eigenvalue of the update matrix when the transform type is discrete cosine type II transform, and will not be repeated here. For example, when the transform type is discrete sine type VII transform, 7 Laplace matrices can be selected ~ Perform weighted summation to obtain the update matrix of discrete sine V-II transform. Laplace matrix ~ When the transformation length is 8, Figure 3 As shown, the first row from left to right is the Laplace matrix to The second row from left to right is the Laplace matrix to The matrix diagram of the Laplacian matrix ~ It is expressed as:
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112]
[0113] Laplacian Matrix ~ is a sparse matrix; Laplacian matrix ~ The expressions for eigenvalues and eigenvectors are: .
[0114] S140, calculating the bit rate of the transformed type after the residual block is transformed according to the bit rate formula of the transformed type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block. Specifically, S140 includes:
[0115] S141, substitute the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix. In the embodiment of the present application, the Laplace quadratic formula of the residual block is: , update the matrix , then the quadratic formula of the update matrix is: .
[0116] S142, according to the quadratic formula of the update matrix and the code rate formula of the transformation type, obtain the code rate formula of the transformation type of the residual block corresponding to the update matrix. In the embodiment of the present application, the quadratic formula of the update matrix F is , the update matrix F is obtained by 8 Laplacian matrices ~ Obtained. The Laplace quadratic formula in the residual block And the code rate formula of the residual block Under the premise of being equal, the quadratic formula of the update matrix is also equal to the code rate formula of the transformation type of the residual block corresponding to the update matrix. The quadratic formula of the update matrix F is expanded to obtain the eigenvalue of the update matrix F (it can also be obtained through 8 Laplace matrices ~ Get the updated matrix eigenvalues) ,Will Substitute into the bit rate formula , = , get the code rate formula of the transformation type of the residual block corresponding to the update matrix .at this time, = .
[0117] S143, extracting the update matrix weight according to the code rate formula of the transformation type of the residual block corresponding to the update matrix. In the embodiment of the present application, according to the code rate formula of the transformation type of the residual block corresponding to the update matrix , extract update matrix weights , which can be adjusted The value of is used to fit the update matrix weight The value of .
[0118] S144, according to the penalty intensity and the multiple Laplace matrices, fit and update the matrix weights. Because in the process of linear fitting, the more basic Laplace matrices used, the higher the complexity of calculation. Therefore, in the embodiment of the present application, when the matrix weights are updated by Laplace matrix fitting, the number of Laplace matrices used can be set to no more than 3.
[0119] In the embodiment of the present application, when the transform type is discrete cosine transform and the transform size is 4-point transform, in order to increase the penalty intensity of high-frequency coefficients , the punishment intensity can be adjusted in turn Set to 1, 2, 4, 8, depending on the severity of the penalty Different values of the settings combined with the Laplace matrix and Fitting update matrix weights .
[0120] S145, selecting the updated matrix weight after fitting by offline adjustment, and determining multiple residual weights corresponding to multiple Laplace matrices. In the embodiment of the present application, selecting the updated matrix weight after fitting by offline adjustment can be: using two Laplace matrices and The L2 norm of the two Laplacian matrices is represented by and The similarity is calculated by traversing the interval (-100, 100) in Matlab with a step size of 0.5. All values of , select a set of weights corresponding to the minimum L2 norm as the Laplace matrix and The corresponding 2 residual weights.
[0121] In the embodiment of the present application, the The residual weight can be 2, The residual weight can also be 2.
[0122] S146, according to the multiple residual weights, the multiple Laplace matrices and the Laplace quadratic formula of the residual block, calculate the intermediate amount of the bit rate of the transformation type of the residual block. In the embodiment of the present application, the process of calculating the bit rate of the transformation type after the residual block is transformed by the Laplace matrix can be circuit optimized. Split into , Calculate the code rate of the transform type after the residual block is transformed; x is a column vector composed of 4 input data , the corresponding bit rate intermediate quantity H can be expressed as a vector .
[0123] In the embodiments of the present application, Figure 4 The circuit diagram shown is a calculation unit of the uniform rate intermediate quantity H designed with a 4-point discrete cosine II transform, which represents the multiplication of a one-dimensional vector and a 4×4 Laplace matrix. The Laplace matrix can be realized by configuring ctrl and The median bit rate When ctrl is equal to 0, the mux selector (i.e., data selector) can select the Laplace matrix The data is operated, and the data path is described as follows: Calculate the intermediate bit rate of the transform type of the residual block The process can be expressed as:
[0124]
[0125] Where 2 represents the Laplace matrix The residual weight of .
[0126] When ctrl is equal to 1, the mux selector can select the Laplacian matrix The data is operated. At this time, the data path is described as follows: Calculate the intermediate bit rate of the transform type of the residual block The process can be expressed as:
[0127]
[0128] Where 2 can represent the Laplace matrix The residual weight of .
[0129] S147, calculating the code rates of the transform types corresponding to the multiple Laplace matrices after the residual block is transformed according to the intermediate code rate of the transform type and the Laplace quadratic formula of the residual block. Figure 5 The circuit diagram is composed of four multipliers and three adders, which is used to realize the function of multiplying a one-dimensional row matrix and a one-dimensional column matrix. ) and the Laplace quadratic formula of the residual block , calculate the Laplacian matrix after the residual block transformation or The corresponding bit rate of the transform type:
[0130] .
[0131] S148, linearly combine the code rates of the transformation types corresponding to the multiple Laplacian matrices to obtain the code rate of the transformation type after the residual block is transformed. The code rate and Laplace matrix of the corresponding transform type The bit rates of the corresponding transform types are added together to obtain the bit rate of the transform type after the residual block is transformed.
[0132] In an embodiment of the present application, the transform type includes: discrete cosine II transform, discrete cosine VIII transform and / or discrete sine VII transform. When calculating the bit rate of the residual block after the transform type is transformed, the bit rate of the residual block after the discrete cosine II transform, the bit rate of the residual block after the discrete cosine VIII transform, and the bit rate of the residual block after the discrete sine VII transform are calculated in a similar manner, and can all be calculated in the above manner. The incomplete part of the process of calculating the bit rate of the residual block after a certain transform type is not repeated here.
[0133] S150, selecting the transform type with the smallest bit rate as the transform type of the residual block in video coding. In the embodiment of the present application, by comparing the bit rates of the residual block after discrete cosine II transform, discrete cosine VIII transform and discrete sine VII transform, the transform type with the smallest bit rate is selected as the transform type of the residual block in video coding.
[0134] In an embodiment of the present application, the transform kernel selection method for video coding first obtains the input data of the residual block in the video image; then obtains the code rate formula of the transform type of the residual block according to the input data and the basis function of the transform type in the encoder; then performs weighted summation of multiple Laplace matrices to obtain an update matrix; secondly, according to the code rate formula of the transform type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block, the code rate of the transform type after the residual block is transformed is calculated; finally, the transform type with the smallest code rate is selected as the transform type of the residual block in video coding. The present application can calculate the code rate of the transform type after the residual block is transformed according to the input data of the residual block, and select the transform type with the smallest code rate as the transform type of the residual block in video coding, and can adaptively select a better transform type for the residual block, avoiding the complex rate distortion optimization RDO process; with a small performance loss, the encoding time and encoding complexity are reduced, and the encoding efficiency is improved.
[0135] See also Figure 6 The present invention provides a flowchart of a method for selecting a transform kernel for video coding. Figure 6 As shown, the method of the embodiment of the present application may include the following steps:
[0136] S210, obtaining input data of a residual block in a video image;
[0137] S211, performing a one-dimensional transformation on the input data and the basis function of the transformation type in the encoder to obtain a one-dimensional transformation result of the residual block; the transformation type includes: discrete cosine II transform, discrete cosine VIII transform and / or discrete sine VII transform;
[0138] S212, obtaining a code rate formula of a transformation type of the residual block according to the one-dimensional transformation result and the penalty strength;
[0139] S213, performing weighted summation on multiple Laplace matrices to obtain an update matrix;
[0140] S214, substituting the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix;
[0141] S215, obtaining a code rate formula of the transform type of the residual block corresponding to the update matrix according to the quadratic formula of the update matrix and the code rate formula of the transform type;
[0142] S216, extracting the update matrix weight according to the code rate formula of the transformation type of the residual block corresponding to the update matrix;
[0143] S217, fitting and updating matrix weights according to the penalty intensity and multiple Laplace matrices;
[0144] S218, selecting the updated matrix weight after fitting by offline adjustment, and determining multiple residual weights corresponding to multiple Laplace matrices;
[0145] S219, calculating the intermediate bit rate of the transformation type of the residual block according to the multiple residual weights, the multiple Laplace matrices and the Laplace quadratic formula of the residual block;
[0146] S220, calculating the bit rates of the transform types corresponding to the multiple Laplace matrices after the residual block is transformed according to the bit rate intermediate amount of the transform type and the Laplace quadratic formula of the residual block;
[0147] S221, linearly combining the bit rates of the transformation types corresponding to the multiple Laplacian matrices to obtain the bit rate of the transformation type after the residual block is transformed;
[0148] S222, select the transform type with the smallest bit rate as the transform type of the residual block in video encoding.
[0149] In an embodiment of the present application, the transform kernel selection method for video coding first obtains the input data of the residual block in the video image; then obtains the code rate formula of the transform type of the residual block according to the input data and the basis function of the transform type in the encoder; then performs weighted summation of multiple Laplace matrices to obtain an update matrix; secondly, according to the code rate formula of the transform type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block, the code rate of the transform type after the residual block is transformed is calculated; finally, the transform type with the smallest code rate is selected as the transform type of the residual block in video coding. The present application can calculate the code rate of the transform type after the residual block is transformed according to the input data of the residual block, and select the transform type with the smallest code rate as the transform type of the residual block in video coding, and can adaptively select a better transform type for the residual block, avoiding the complex rate distortion optimization RDO process; with a small performance loss, the encoding time and encoding complexity are reduced, and the encoding efficiency is improved.
[0150] See also Figure 4 , Figure 5 and Figure 7 A schematic diagram of a calculation circuit for bit rate fitting is provided for an embodiment of the present application. Figure 4 , Figure 5 and Figure 7 As shown, the circuit of the embodiment of the present application includes: a first-level circuit device and a second-level circuit device.
[0151] The first-stage circuit device includes four selectors, four shifters and four first adders, wherein one shifter and one selector are connected to the same first adder; after four input data of the residual block are shifted by the four shifters, selected by the four selectors, and added by the four first adders, four intermediate code rates of the transformation type of the residual block are obtained; the number of bits shifted by the shifter is determined by the residual weight of the Laplacian matrix;
[0152] In the first-level circuit device of the embodiment of the present application, each of the four input data is shifted by each shifter; two of the four input data are selected by a selector to obtain one input data, so that the four selectors all select the input data; the input data shifted by a shifter is added to the input data selected by a selector by a first adder to obtain a code rate intermediate quantity of the transformation type of the residual block, thereby achieving the purpose of obtaining four code rate intermediate quantities of the transformation type of the residual block through four selectors, four shifters and four first adders.
[0153] Figure 4It is a first-level circuit device of the uniform rate intermediate quantity H designed by the discrete cosine II transform of the 4-point transform, which represents the multiplication of a one-dimensional vector and a 4×4 Laplace matrix. When Ctrl is 0, the mux selector (i.e., the selector described in this application) can select , Corresponding Laplace matrix , the Laplacian matrix The residual weight is 2, which corresponds to four shifters shifting the four input data left by one bit; at this time, the intermediate code rate H of the transformation type of the residual block can be expressed as:
[0154]
[0155] When Ctrl is 1, the mux selector can select , Corresponding Laplace matrix ; Laplacian matrix The residual weight is 2, which corresponds to four shifters shifting the four input data left by one bit; at this time, the intermediate code rate of the transformation type of the residual block can be expressed as:
[0156]
[0157] The residual weights of the Laplacian matrix are obtained by the method of the above embodiment.
[0158] The second-stage circuit device includes four multipliers, two second adders and one third adder, wherein two of the four multipliers are connected to one second adder, so that the four multipliers are connected to two second adders, and the two second adders connected to the four multipliers are connected to another third adder; the four intermediate code rates are respectively input into the four multipliers, so that the four intermediate code rates are multiplied by the four input data, and then added by the second adder and the third adder to obtain the code rate of the transformation type after the final residual block is transformed;
[0159] In the second-level circuit device of the embodiment of the present application, each of the four code rate intermediate quantities is input into a multiplier, in which each code rate intermediate quantity is multiplied by each of the four input data, and then the results of the multiplication of the two multipliers are added through a second adder, thereby adding the results of the multiplication of the four multipliers through two second adders; the results of the two second adders are added through a third adder to obtain the code rate of the transformation type after the residual block is transformed.
[0160] Figure 5The circuit diagram is composed of four multipliers, two second adders and one third adder, wherein the two second adders and the third adder can be the same adder, and the multiplier is used to realize the function of multiplying a one-dimensional row matrix and a one-dimensional column matrix. The Laplace matrix after the residual block transformation or The corresponding bit rate of the transform type:
[0161] .
[0162] In the embodiment of the present application, four intermediate code rates of the transformation type of the residual block are obtained by the first-level circuit device, and the four intermediate code rates are input into the second-level circuit device, and the second-level circuit device determines the code rate of the transformation type after the residual block is transformed according to the four intermediate code rates and four input data. The circuit described in the embodiment of the present application has a faster calculation process; avoids the complex rate distortion optimization RDO process; reduces the encoding time and encoding complexity with a small performance loss, and improves the encoding efficiency.
[0163] The following is a system embodiment of the present invention, which can be used to implement the method embodiment of the present invention. For details not disclosed in the system embodiment of the present invention, please refer to the method embodiment of the present invention.
[0164] See also Figure 8 , which shows a schematic diagram of a transform kernel selection system for video coding provided by an exemplary embodiment of the present invention. The system 1 includes: a residual data acquisition module 10, a bit rate formula acquisition module 20, an update matrix acquisition module 30, a bit rate calculation module 40 and a transform type selection module 50.
[0165] The residual data acquisition module 10 is used to obtain input data of the residual block in the video image;
[0166] A code rate formula acquisition module 20, used to acquire a code rate formula of a transform type of a residual block according to input data and a basis function of the transform type in an encoder;
[0167] An update matrix acquisition module 30 is used to perform weighted summation on multiple Laplace matrices to obtain an update matrix;
[0168] The bit rate calculation module 40 is used to calculate the bit rate of the transform type after the residual block is transformed according to the bit rate formula of the transform type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block; the bit rate of the transform type after the residual block is transformed according to the bit rate formula of the transform type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block, including:
[0169] Substituting the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix;
[0170] Obtaining a code rate formula of the transform type for the residual block corresponding to the update matrix according to a quadratic formula of the update matrix and a code rate formula of the transform type;
[0171] Extracting an update matrix weight according to a code rate formula of the transformation type of the residual block corresponding to the update matrix;
[0172] Fitting the update matrix weights according to the penalty intensity and the multiple Laplace matrices;
[0173] Selecting the updated matrix weights after fitting by offline adjustment to determine a plurality of residual weights corresponding to the plurality of Laplace matrices;
[0174] Calculating a rate intermediate amount of the transform type of the residual block according to the plurality of residual weights, the plurality of Laplace matrices and a Laplace quadratic formula of the residual block;
[0175] Calculating the bit rate of the transform type corresponding to the multiple Laplace matrices after the residual block is transformed according to the bit rate intermediate amount of the transform type and the Laplace quadratic form formula of the residual block;
[0176] Linearly combine the bit rates of the transformation type corresponding to the multiple Laplacian matrices to obtain the bit rate of the transformation type after the residual block is transformed.
[0177] The transform type selection module 50 is used to select the transform type with the minimum bit rate as the transform type of the residual block in video coding.
[0178] It should be noted that the transform core selection device for video coding provided in the above embodiment only uses the division of the above functional modules as an example when executing the transform core selection method for video coding. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the transform core selection device for video coding provided in the above embodiment and the transform core selection method for video coding belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0179] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0180] In an embodiment of the present application, the transform kernel selection system for video coding first obtains the input data of the residual block in the video image; then obtains the code rate formula of the transform type of the residual block according to the input data and the basis function of the transform type in the encoder; then performs weighted summation of multiple Laplace matrices to obtain an update matrix; secondly, according to the code rate formula of the transform type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block, the code rate of the transform type after the residual block is transformed is calculated; finally, the transform type with the smallest code rate is selected as the transform type of the residual block in video coding. The present application can calculate the code rate of the transform type after the residual block is transformed according to the input data of the residual block, and select the transform type with the smallest code rate as the transform type of the residual block in video coding, and can adaptively select a better transform type for the residual block, avoiding the complex rate distortion optimization RDO process; with a small performance loss, the encoding time and encoding complexity are reduced, and the encoding efficiency is improved.
[0181] The present invention also provides a computer-readable medium on which program instructions are stored. When the program instructions are executed by a processor, the transform kernel selection method for video coding provided by the above-mentioned various method embodiments is implemented.
[0182] The present invention also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the transform kernel selection method for video coding in the above-mentioned various method embodiments.
[0183] See also Fig. 9 , which is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. Fig. 9 As shown, the terminal 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0184] The communication bus 1002 is used to realize the connection and communication between these components.
[0185] The user interface 1003 may include a display screen (Display) and a camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
[0186] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0187] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts of the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.
[0188] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As Fig. 9 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an availability analysis application for vehicle running trajectory data.
[0189] exist Figure 8In the terminal 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call the transform kernel selection application for video encoding stored in the memory 1005, and specifically perform the following operations:
[0190] Obtain input data of a residual block in a video image;
[0191] Obtaining a code rate formula of a transform type of a residual block according to the input data and a basis function of the transform type in the encoder;
[0192] Perform weighted summation on multiple Laplacian matrices to obtain an update matrix;
[0193] Calculate the bit rate of the transformed type after the residual block is transformed according to the bit rate formula of the transformed type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block;
[0194] The transform type with the smallest bit rate is selected as the transform type of the residual block in video coding.
[0195] In one embodiment, when the processor 1001 executes the basis function of the transform type in the encoder according to the input data to obtain the code rate formula of the transform type of the residual block, the processor 1001 specifically performs the following operations:
[0196] Performing a one-dimensional transformation on the input data and the basis function of the transformation type in the encoder to obtain a one-dimensional transformation result of the residual block; the transformation type includes: discrete cosine type II transformation, discrete cosine type VIII transformation and / or discrete sine type VII transformation;
[0197] According to the one-dimensional transformation result and the penalty strength, a code rate formula of the transformation type of the residual block is obtained.
[0198] In one embodiment, when the processor 1001 calculates the bit rate of the transform type after the residual block is transformed according to the bit rate formula of the transform type, multiple Laplace matrices, the update matrix, and the Laplace quadratic formula of the residual block, the processor 1001 specifically performs the following operations:
[0199] Substitute the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix;
[0200] According to the quadratic formula of the update matrix and the code rate formula of the transformation type, the code rate formula of the transformation type of the residual block corresponding to the update matrix is obtained;
[0201] Extracting the update matrix weight according to the code rate formula of the transformation type of the residual block corresponding to the update matrix;
[0202] Fit and update matrix weights based on penalty intensity and multiple Laplace matrices;
[0203] Select the updated matrix weights after fitting by offline adjustment, and determine multiple residual weights corresponding to multiple Laplace matrices;
[0204] Calculate the bit rate intermediate amount of the transformation type of the residual block according to the multiple residual weights, the multiple Laplace matrices and the Laplace quadratic formula of the residual block;
[0205] Calculate the bit rates of the transform types corresponding to the multiple Laplace matrices after the residual block is transformed according to the bit rate intermediate quantity of the transform type and the Laplace quadratic formula of the residual block;
[0206] The bit rates of the transformation types corresponding to the multiple Laplacian matrices are linearly combined to obtain the bit rate of the transformation type after the residual block is transformed.
[0207] In an embodiment of the present application, the transform kernel selection method for video coding first obtains the input data of the residual block in the video image; then obtains the code rate formula of the transform type of the residual block according to the input data and the basis function of the transform type in the encoder; then performs weighted summation of multiple Laplace matrices to obtain an update matrix; secondly, according to the code rate formula of the transform type, multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block, the code rate of the transform type after the residual block is transformed is calculated; finally, the transform type with the smallest code rate is selected as the transform type of the residual block in video coding. The present application can calculate the code rate of the transform type after the residual block is transformed according to the input data of the residual block, and select the transform type with the smallest code rate as the transform type of the residual block in video coding, and can adaptively select a better transform type for the residual block, avoiding the complex rate distortion optimization RDO process; with a small performance loss, the encoding time and encoding complexity are reduced, and the encoding efficiency is improved.
[0208] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0209] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A transform kernel selection method for video coding, characterized in that: The following steps are involved: Obtain input data of a residual block in a video image; Perform a one-dimensional transformation according to the input data and a basis function of the transformation type in the encoder, and obtain a code rate formula of the transformation type of the residual block according to the one-dimensional transformation result and the penalty intensity; Perform weighted summation on multiple Laplacian matrices to obtain an update matrix; Calculating a code rate of the transform type after the residual block is transformed according to a code rate formula of the transform type, the multiple Laplace matrices, the update matrix, and a Laplace quadratic formula of the residual block; Selecting the transform type with the minimum bit rate as the transform type of the residual block in video coding; The calculating the bit rate of the transform type after the residual block is transformed according to the bit rate formula of the transform type, the multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block includes: Substituting the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix; According to the quadratic formula of the update matrix and the code rate formula of the transform type, obtaining the code rate formula of the transform type of the residual block corresponding to the update matrix; Extracting an update matrix weight according to a code rate formula of the transformation type of the residual block corresponding to the update matrix; Fitting the update matrix weights according to the penalty intensity and the multiple Laplace matrices; Selecting the updated matrix weights after fitting by offline adjustment to determine a plurality of residual weights corresponding to the plurality of Laplace matrices; Calculating a rate intermediate amount of the transform type of the residual block according to the plurality of residual weights, the plurality of Laplace matrices and a Laplace quadratic formula of the residual block; Calculating the bit rate of the transform type corresponding to the multiple Laplace matrices after the residual block is transformed according to the bit rate intermediate amount of the transform type and the Laplace quadratic form formula of the residual block; Linearly combine the bit rates of the transformation type corresponding to the multiple Laplacian matrices to obtain the bit rate of the transformation type after the residual block is transformed.
2. The transformation kernel selection method according to claim 1, characterized in that: The step of obtaining a code rate formula of the transform type of the residual block according to the input data and a basis function of the transform type in the encoder includes: Performing a one-dimensional transformation on the input data and a basis function of a transformation type in the encoder to obtain a one-dimensional transformation result of the residual block; A code rate formula of the transformation type of the residual block is obtained according to the one-dimensional transformation result and the penalty strength.
3. The transformation kernel selection method according to claim 1, characterized in that: The transform types include: discrete cosine type II transform, discrete cosine type VIII transform and / or discrete sine type VII transform.
4. A code rate fitting calculation circuit, characterized in that: The circuit includes a first-level circuit device and a second-level circuit device; The first-stage circuit device includes four selectors, four shifters and four first adders, wherein one shifter and one selector are connected to the same first adder; after four input data of the residual block are shifted by the four shifters, selected by the four selectors, and added by the four first adders, four intermediate code rates of the transformation type of the residual block are obtained; the number of bits shifted by the shifter is determined by the residual weight of the Laplacian matrix; The second-stage circuit device includes four multipliers, two second adders and one third adder, wherein two of the four multipliers are connected to one second adder, so that the four multipliers are connected to two second adders, and the two second adders connected to the four multipliers are connected to another third adder; the four intermediate code rates are respectively input into the four multipliers, so that the four intermediate code rates are multiplied by the four input data, and then added by the second adder and the third adder to obtain the code rate of the transformation type after the final residual block is transformed; The residual weights of the Laplacian matrix are obtained by the method of any one of claims 1 to 3 above.
5. A transform kernel selection system for video coding, characterized in that: include: A residual data acquisition module, used to acquire input data of a residual block in a video image; A code rate formula acquisition module, used to perform a one-dimensional transformation according to the input data and a basis function of the transformation type in the encoder, and to obtain a code rate formula of the transformation type of the residual block according to the one-dimensional transformation result and the penalty intensity; An update matrix acquisition module is used to perform weighted summation on multiple Laplace matrices to obtain an update matrix; A bit rate calculation module, configured to calculate a bit rate of the transform type after the residual block is transformed according to a bit rate formula of the transform type, the multiple Laplace matrices, the update matrix, and a Laplace quadratic formula of the residual block; The calculating the bit rate of the transform type after the residual block is transformed according to the bit rate formula of the transform type, the multiple Laplace matrices, the update matrix and the Laplace quadratic formula of the residual block includes: Substituting the update matrix into the Laplace quadratic formula of the residual block to obtain the quadratic formula of the update matrix; According to the quadratic formula of the update matrix and the code rate formula of the transform type, obtaining the code rate formula of the transform type of the residual block corresponding to the update matrix; Extracting an update matrix weight according to a code rate formula of the transformation type of the residual block corresponding to the update matrix; Fitting the update matrix weights according to the penalty intensity and the multiple Laplace matrices; Selecting the updated matrix weights after fitting by offline adjustment to determine a plurality of residual weights corresponding to the plurality of Laplace matrices; Calculating a rate intermediate amount of the transform type of the residual block according to the plurality of residual weights, the plurality of Laplace matrices and a Laplace quadratic formula of the residual block; Calculating the bit rate of the transform type corresponding to the multiple Laplace matrices after the residual block is transformed according to the bit rate intermediate amount of the transform type and the Laplace quadratic form formula of the residual block; Linearly combining the bit rates of the transformation type corresponding to the multiple Laplacian matrices to obtain the bit rate of the transformation type after the residual block is transformed; The transform type selection module is used to select the transform type with the smallest bit rate as the transform type of the residual block in video coding.
6. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 3.
7. A terminal, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 3.
