AVS2 inverse transformation device and method
By designing the AVS2 inverse transformation device, the residual matrix is spliced into a square matrix and transformed, the problem that AVS2 cannot be implemented by multiplexing the existing decoder is solved, and the efficient inverse transformation process is realized and the processing performance is improved.
Patent Information
- Application Number
- CN201910940173.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-30
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2039-09-30
AI Technical Summary
In the prior art, AVS2 cannot be implemented by multiplexing existing audio and video decoders, mainly because mainstream decoders only support square transform blocks and not rectangular transform blocks.
An AVS2 inverse transformation device and method is designed, and the inverse transformation process is realized by splicing multiple residual matrices into residual square matrix and using a specific inverse transformation coefficient matrix to perform column and row transformation. The device includes a control module, a matrix acquisition module, a matrix splicing module, a coefficient selection module and a calculation module. Through the coordinated work of these modules, the inverse transformation can be realized by multiplexing existing audio and video decoders.
This method does not require a separate decoder for AVS2, and can multiplex existing decoders, reducing the number of processing 4×4 transform blocks, thereby improving processing performance and without adding additional resource overhead in hardware implementation.
Smart Images

Figure CN112584157B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of video compression, and relates to an inverse transformation device, and in particular to an AVS2 inverse transformation device and method. Background Art
[0002] AVS (Audio Video coding Standard) is the abbreviation of audio and video coding standards, and the latest AVS standard is AVS2. AVS2 is my country's second-generation source coding standard with independent intellectual property rights. It is the abbreviation of the advanced audio and video coding series standards for information technology. It includes four main technical standards such as system, video, audio, and digital copyright management, as well as supporting standards such as compliance testing. The coding efficiency of the AVS2 standard is twice that of AVS1, which is equivalent to the international standards of the same period. In the field of scene coding, the efficiency is twice that of the international standards of the same period.
[0003] Traditional audio and video standards, such as HEVC, H264, and VP6, all use square transform blocks in the video encoding and decoding process. Unlike traditional audio and video standards, AVS2 adds rectangular transform blocks in the encoding and decoding process. According to the latest national standards, AVS2 currently supports five types of square transform blocks, 4×4, 8×8, 16×16, 32×32, and 64×64, and four types of rectangular transform blocks, 16×4, 4×16, 32×8, and 8×32. However, the current mainstream audio and video decoders only support square transform blocks but not rectangular transform blocks during the decoding process, so AVS2 cannot be implemented by reusing existing audio and video decoders. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide an AVS2 inverse transformation device and method for solving the problem in the prior art that AVS2 cannot be implemented by multiplexing existing audio and video decoders.
[0005] To achieve the above-mentioned purpose and other related purposes, the present invention provides an AVS2 inverse transform device, which includes: a control module, used to control the AVS2 inverse transform device to implement AVS2 inverse transform; a matrix acquisition module, connected to the control module, used to obtain multiple residual matrices; each residual matrix is an M2×M1 matrix; wherein M1 and M2 are both positive integers; a matrix splicing module, connected to the control module and the matrix acquisition module respectively, used to splice at least 2 of the residual matrices to form a residual square matrix; a coefficient selection module, connected to the control module, used to select a first inverse transform coefficient matrix and a second inverse transform coefficient matrix according to the residual matrix; the second inverse transform coefficient matrix is an M2×M2 matrix; the first inverse transform coefficient matrix is an M1×M1 matrix; a calculation module, connected to the control module, the coefficient selection module, and the matrix splicing module respectively, used to use the second inverse transform coefficient matrix to perform column transformation on the residual square matrix to obtain an intermediate matrix, and use the first inverse transform coefficient matrix to perform row transformation on the intermediate matrix to obtain a residual sample matrix.
[0006] In one embodiment of the present invention, the AVS2 inverse transformation device further includes: a storage module, connected to the control module and the calculation module respectively, and used to store the intermediate matrix by column and read the intermediate matrix by row.
[0007] In one embodiment of the present invention, the calculation module includes: at least one calculation unit, which is connected to the coefficient selection module and the matrix splicing module respectively, and is used to implement multiplication and addition operations between vectors; the calculation unit is a primary butterfly calculator.
[0008] In one embodiment of the present invention, the calculation module also includes: a column segment division unit, which is respectively connected to the matrix splicing module and the calculation unit, and is used to divide each column of the residual matrix into N1 column segments of length M2, where N1 is a positive integer; the calculation unit uses the transpose of the second inverse transformation coefficient matrix to perform column transformation on each of the column segments to obtain a column vector corresponding to each of the column segments; a column vector splicing unit, which is connected to the calculation unit, and splices all the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix.
[0009] In one embodiment of the present invention, the calculation module also includes: a row segment division unit, which is respectively connected to the matrix splicing module and the calculation unit, and is used to divide each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; the calculation unit uses the first inverse transformation coefficient matrix to perform row transformation on each of the row segments to obtain a row vector corresponding to each of the row segments; a row vector splicing unit, which is connected to the calculation unit, and splices all the row vectors according to the row number and / or column number of the row vector to obtain the residual sample matrix.
[0010] The present invention also provides an AVS2 inverse transformation method, which includes: obtaining multiple residual matrices; each residual matrix is an M2×M1 matrix; wherein M1 and M2 are both positive integers; splicing at least 2 of the residual matrices to form a residual square matrix; selecting the corresponding first inverse transformation coefficient matrix and second inverse transformation coefficient matrix according to the residual matrix; the second inverse transformation coefficient matrix is an M2×M2 matrix; the first inverse transformation coefficient matrix is an M1×M1 matrix; using the second inverse transformation coefficient matrix to perform column transformation on the residual square matrix to obtain an intermediate matrix; using the first inverse transformation coefficient matrix to perform row transformation on the intermediate matrix to obtain a residual sample matrix.
[0011] In one embodiment of the present invention, the AVS2 inverse transformation method further includes: storing the intermediate matrix in a storage module by column; and reading the intermediate matrix from the storage module by row.
[0012] In one embodiment of the present invention, the row transformation and the column transformation are implemented by multiplication and addition operations between vectors; and the multiplication and addition operations are implemented by a butterfly operation.
[0013] In one embodiment of the present invention, a method for implementing column transformation of the residual matrix using the second inverse transformation coefficient matrix includes: if the dimension of the second inverse transformation coefficient matrix is the same as that of the residual matrix, multiplying the transpose of the second inverse transformation coefficient matrix by the residual matrix to obtain the intermediate matrix.
[0014] In one embodiment of the present invention, a method for implementing column transformation of the residual matrix using the second inverse transformation coefficient matrix includes: dividing each column of the residual matrix into N1 column segments of length M2, where N1 is a positive integer; performing column transformation on each of the column segments using the transpose of the second inverse transformation coefficient matrix to obtain a column vector corresponding to each of the column segments; and splicing all of the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix.
[0015] In one embodiment of the present invention, a method for implementing row transformation of the intermediate matrix using the first inverse transformation coefficient matrix includes: if the dimension of the first inverse transformation coefficient matrix is the same as the dimension of the intermediate matrix, multiplying the intermediate matrix by the first inverse transformation coefficient matrix to obtain the residual sample matrix.
[0016] In one embodiment of the present invention, a method for implementing row transformation of the intermediate matrix using the first inverse transformation coefficient matrix includes: dividing each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; using the first inverse transformation coefficient matrix to perform row transformation on each of the row segments to obtain a row vector corresponding to each of the row segments; splicing all the row vectors according to the row number and / or column number of the row vector to obtain the residual sample matrix.
[0017] As described above, the AVS2 inverse transformation device and method described in the present invention have the following beneficial effects:
[0018] In the present invention, at least two of the residual matrices are concatenated to form a residual square matrix, and the residual square matrix can reuse the existing audio and video decoder to achieve inverse transformation, without the need to design a separate decoder for AVS2;
[0019] In the present invention, the AVS2 inverse transform is implemented by performing column transform on the residual square matrix and row transform on the intermediate matrix. Both the residual square matrix and the intermediate matrix are square matrices. Therefore, compared with the prior art, no additional resource overhead is required in hardware implementation, and the control flow of the entire system does not need to increase the control of rectangular transformation.
[0020] Compared with the existing AVS2 inverse transform, the AVS2 inverse transform device of the present invention reduces the number of 4×4 transform blocks to be processed, thereby improving the processing performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 Shown is a schematic structural diagram of the AVS2 inverse transformation device of the present invention in a specific embodiment.
[0022] Figure 2 The diagram shows the matrix transformation architecture in the existing AVS2 inverse transformation process.
[0023] Figure 3 Shown is a schematic diagram of the structure of the calculation module in the AVS2 inverse transformation device of the present invention in a specific embodiment.
[0024] Figure 4 Shown is a schematic diagram of the structure of the calculation module in the AVS2 inverse transformation device of the present invention in a specific embodiment.
[0025] Figure 5 Shown is a schematic diagram of the structure of the calculation unit in the AVS2 inverse transformation device of the present invention in a specific embodiment.
[0026] Figure 6 Shown is a matrix transformation architecture diagram of the AVS2 inverse transformation process described in the present invention in a specific embodiment.
[0027] Figure 7 Shown is a matrix transformation architecture diagram of the AVS2 inverse transformation process described in the present invention in a specific embodiment.
[0028] Figure 8 Shown is a flow chart of the AVS2 inverse transformation method according to a specific embodiment of the present invention.
[0029] Fig. 9 Shown is a flow chart of step S4 of the AVS2 inverse transformation method in a specific embodiment of the present invention.
[0030] Fig.10 Shown is a flow chart of step S5 of the AVS2 inverse transformation method in a specific embodiment of the present invention.
[0031] Component number description
[0032] 100 AVS2 reverse conversion device
[0033] 110 Control module
[0034] 120 Matrix acquisition module
[0035] 130 matrix splicing module
[0036] 140 Coefficient selection module
[0037] 150 Computing Modules
[0038] 151 Computing Units
[0039] 152 Column segment division unit
[0040] 153 Column vector concatenation unit
[0041] 154 Line segment division unit
[0042] 155 row vector concatenation unit
[0043] 160 Storage Module
[0044] 210 Second inverse transform coefficient matrix
[0045] 220 Residual Matrix
[0046] 230 Intermediate Matrix
[0047] 240 First inverse transform coefficient matrix
[0048] 250 residual sample matrix
[0049] 610 Transpose of the second inverse transform coefficient matrix
[0050] 620 residual matrix
[0051] 621 First residual matrix
[0052] 6211 First column segment
[0053] 622 Second residual matrix
[0054] 623 The third residual matrix
[0055] 624 Fourth residual matrix
[0056] 630 Intermediate Matrix
[0057] 6311 First column vector
[0058] 640 Intermediate matrix read by row
[0059] 6411 First line segment
[0060] 6412 Second line
[0061] 6413 The third line
[0062] 6414 Fourth line
[0063] 650 First inverse transform coefficient matrix
[0064] 660 residual sample matrix
[0065] 6611 First row vector
[0066] 6612 Second row vector
[0067] 6613 The third row vector
[0068] 6614 Fourth row vector
[0069] 710 Transpose of the second inverse transform coefficient matrix
[0070] 720 residual matrix
[0071] 721 First residual matrix
[0072] 7211 First column segment
[0073] 722 Second residual matrix
[0074] 7221 Second column
[0075] 723 The third residual matrix
[0076] 7231 The third column
[0077] 724 Fourth residual matrix
[0078] 7241 Fourth column
[0079] 730 Intermediate Matrix
[0080] 7311 First column vector
[0081] 7321 Second column vector
[0082] 7331 The third column vector
[0083] 7341 The fourth column vector
[0084] 740 Intermediate matrix read by row
[0085] 7411 First line segment
[0086] 750 First inverse transform coefficient matrix
[0087] 760 residual sample matrix
[0088] 7611 First row vector
[0089] Steps S1 to S5
[0090] Steps S41 to S43
[0091] Steps S51 to S53 DETAILED DESCRIPTION
[0092] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0093] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0094] Traditional audio and video standards, such as HEVC, H264, and VP9, all use square transform blocks in the video encoding and decoding process. Unlike traditional audio and video standards, AVS2 adds rectangular transform blocks (also known as rectangular transform blocks) in the encoding and decoding process. According to the latest national standards, the inverse transform blocks currently supported by AVS2 include five square transform blocks of 4×4, 8×8, 16×16, 32×32, and 64×64, and four rectangular transform blocks of 16×4, 4×16, 32×8, and 8×32. However, the current mainstream audio and video decoders only support square transform blocks but not rectangular transform blocks during the decoding process, so AVS2 cannot be implemented by reusing existing audio and video decoders. At present, the decoder of AVS2 needs to support both square transform and rectangular transform in hardware implementation, which increases additional resource overhead; accordingly, the control flow of the entire system increases the control of rectangular transform, which increases the workload of the control module. In addition, for AVS2 inverse transform, the processing performance of 4×4 blocks is the worst, and in order to support rectangular transform, a large number of 4×4 processing blocks need to be added in existing audio and video decoders, which leads to performance degradation.
[0095] In order to solve the above problems, the present invention provides an AVS2 inverse transformation device and method. In the present invention, at least two of the residual matrices are spliced to form a residual square matrix, and the residual square matrix can reuse the existing audio and video decoder to achieve inverse transformation, without the need to design a separate decoder for AVS2; wherein the residual matrix is also called a residual coefficient matrix or a transformation coefficient matrix. In addition, the AVS2 inverse transformation is achieved by performing a column transformation on the residual square matrix and a row transformation on the intermediate matrix. Both the residual square matrix and the intermediate matrix are square matrices, so there is no need to increase additional resource overhead in hardware implementation compared to the prior art, and the control flow of the entire system does not need to increase the control of rectangular transformation (also known as rectangular transformation); compared with the existing AVS2 inverse transformation, the AVS2 inverse transformation device of the present invention reduces the number of 4×4 processing blocks, thereby improving processing performance.
[0096] See also Figure 1 In one embodiment of the present invention, the AVS2 inverse transformation device 100 comprises:
[0097] A control module 110, used for controlling the AVS2 inverse transformation device 100 to implement AVS2 inverse transformation;
[0098] The matrix acquisition module 120 is connected to the control module 110 and is used to obtain a residual matrix, which is obtained by dequantizing the compressed bit stream. The residual matrix is an M2×M1 matrix; wherein M1 and M2 are both positive integers. In particular, the residual matrix is a 16×4 matrix (representing a 16-row 4-column matrix), a 4×16 matrix (representing a 4-row 16-column matrix), a 32×8 matrix (representing a 32-row 8-column matrix) or an 8×32 matrix (representing an 8-row 32-column matrix).
[0099] The matrix splicing module 130 is connected to the control module 110 and the matrix acquisition module 120 respectively, and is used to splice at least two of the residual matrices to form a residual square matrix. The splicing refers to the process of simply splicing matrices to obtain a square matrix. Preferably, the residual matrices involved in the splicing are adjacent residual matrices. If M2>M1 of the residual matrix, that is, the number of rows of the residual matrix is greater than the number of columns, it is preferred to splice the residual matrix row by row. For example, if the residual matrix is a 16×4 matrix, and the four residual matrices are A, B, C and D, they are spliced row by row to obtain a 16×16 square matrix [ABCD]. If M2<M1 of the residual matrix, that is, the number of rows of the residual matrix is less than the number of columns, it is preferred to splice the residual matrix column by column. For example, if the residual matrix is an 8×32 matrix, and the four residual matrices are A', B', C' and D', the four adjacent residual matrices can be concatenated column by column to obtain a 32×32 square matrix. In particular, for the residual square matrix of M2=M1, there is no need to concatenate them, and the inverse transformation can be directly completed using the existing square inverse transformation method.
[0100] The coefficient selection module 140 is connected to the control module and is used to select a first inverse transformation coefficient matrix and a second inverse transformation coefficient matrix; the second inverse transformation coefficient matrix is an M2×M2 matrix; the first inverse transformation coefficient matrix is an M1×M1 matrix. AVS2 standard provides a total of 6 inverse transformation coefficient matrices, namely S4, D4, T4, T8, T 16 and T 32 The coefficient selection module 140 selects the second inverse transformation coefficient matrix from the above six inverse transformation coefficient matrices according to the number of rows of the residual matrix, and selects the first inverse transformation coefficient matrix from the above six inverse transformation coefficient matrices according to the number of columns of the residual matrix.
[0101] The calculation module 150 is connected to the control module, the coefficient selection module, and the matrix splicing module, respectively, and is used to use the second inverse transformation coefficient matrix to perform column transformation on the residual square matrix to obtain an intermediate matrix, and use the first inverse transformation coefficient matrix to perform row transformation on the intermediate matrix to obtain a residual sample matrix. The residual sample matrix is the output result of the inverse transformation and is used in the subsequent image reconstruction process.
[0102] The inverse transformation process is specified in AVS2 as in The second inverse transformation coefficient matrix T M2 The transpose of M1 is the first inverse transformation coefficient matrix, CoeffMatrix is the residual matrix, and W is the residual sample matrix obtained by the inverse transformation. Specifically, the above inverse transformation process is implemented in two steps:
[0103] 1. Using the second inverse transformation coefficient matrix, the residual square matrix is transformed into an intermediate square matrix. The calculation formula of the column transformation is: The intermediate matrix V is a matrix of M2×M1.
[0104] 2. Use the first inverse transformation coefficient matrix to perform row transformation on the intermediate matrix to obtain the residual sample matrix W. The calculation formula of the row transformation is W = V × T M1 , the residual sample matrix W is an M2×M1 matrix.
[0105] In some embodiments, for a rectangular residual matrix, the corresponding inverse transformation coefficient matrix is directly used to perform column transformation on the residual matrix to obtain an intermediate matrix, and the corresponding inverse transformation coefficient matrix is used to perform row transformation on the intermediate matrix to obtain the residual sample matrix. For example, the residual matrix is a 16×4 (corresponding to 16 rows and 4 columns) matrix, see Figure 2, showing the transformation architecture diagram of the matrix in the inverse transformation process. In the column transformation process, the second inverse transformation coefficient matrix 210 is a 16×16 matrix, and the transpose 210 of the second inverse transformation coefficient matrix is used to perform column transformation on each column of the residual matrix 220 to obtain the intermediate matrix 230 and store the intermediate matrix 230 in a memory. In the row transformation process, the intermediate matrix 230 is read and the first inverse transformation coefficient matrix 240 is multiplied by the intermediate matrix 230 to obtain the residual sample matrix 250. Among them, the first inverse transformation coefficient matrix is a 4×4 matrix. In this process, the throughput rate of the row transformation is 16 points / clk, and the throughput rate of the column transformation is 4 points / clk. The two throughput rates are different, so it will lead to a reduction in hardware performance; wherein clk is the time required for the calculator to perform a calculation. In addition, the memory used in the above inverse transformation process should support the storage of rectangular matrices, while most of the memories in many video decoders only support square storage, so it is necessary to change the existing memory. Therefore, due to the existence of rectangular transformation in AVS2, the calculation, storage and control processes of AVS2 decoder are more complicated and less efficient than those of other mainstream decoders.
[0106] In one embodiment of the present invention, the AVS2 inverse transformation device 100 further includes a storage module 160, which is connected to the control module 110 and the calculation module 150 respectively, and is used to store the intermediate matrix by column and read the intermediate matrix by row.
[0107] See also Figure 3 and Figure 4 In one embodiment of the present invention, the calculation module 150 includes: at least one calculation unit 151, which is connected to the coefficient selection module 140 and the matrix splicing module 130 respectively, and is used to implement multiplication and addition operations between vectors; the calculation unit 151 is a butterfly calculator.
[0108] See also Figure 5, showing the implementation structure of one of the computing units. Wherein, x = {x0, x1, x2, x3} represents the input vector, E = {a0, a1, a2, a3} represents the transformation coefficient vector, CALx represents the multiplier-adder of 4 points, and each CALx can realize the 4×4 transformation of one point. Since the computing unit adopts a butterfly structure, therefore: to realize the 4×4 transformation of one point, one multiplier-adder Calx is required, and the corresponding transformation result is y_0.125; to realize the 8×8 transformation of one point, two multipliers-adders Calx are required, and the corresponding transformation result is y1_0.25 or y32_0.25; to realize the 16×16 transformation of one point, four multipliers-adders Calx are required, and the corresponding transformation result is y1_0.5 or y32_0.5; to realize the 32×32 transformation of one point, eight multipliers-adders are required, and the corresponding transformation result is y1 or y32. In summary, each of the computing units can simultaneously realize 4×4 transform outputs of up to 8 points, 8×8 transform outputs of up to 8 points, 16×16 transform outputs of up to 4 points, and 32×32 transform outputs of up to 2 points. If the computing module includes 4 computing units, the computing module can simultaneously realize 4×4 transform outputs of up to 32 points, 8×8 transform outputs of up to 32 points, 16×16 transform outputs of up to 16 points, and 32×32 transform outputs of up to 8 points. The transform realized by the computing unit can be a row transform or a column transform.
[0109] See also Figure 3 In one embodiment of the present invention, the calculation module 150 also includes: a column segment division unit 152, which is respectively connected to the matrix splicing module 130 and the calculation unit 151, and is used to divide each column of the residual matrix into N1 column segments of length M2, where N1 is a positive integer; the calculation unit 151 uses the transpose of the second inverse transformation coefficient matrix to perform column transformation on each of the column segments to obtain a column vector corresponding to each of the column segments; a column vector splicing unit 153, which is connected to the calculation unit 151, splices all the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix.
[0110] The residual matrix is a matrix with M2 rows and M1 columns. When M2>M1, the residual square matrix is a matrix with M2 rows and M2 columns. Figure 6 , the second inverse transform coefficient matrix is a 16×16 square matrix, the residual square matrix 620 is formed by concatenating the first residual matrix 621, the second residual matrix 622, the third residual matrix 623 and the fourth residual matrix 624, and the above residual matrices are all 16×4 matrices.
[0111] When performing column transformation, the column segment division unit 152 divides each column of the residual square matrix 620 into one column segment, for example, the first column is divided into a first column segment 6211, and the length of each column segment is 16. The calculation unit 151 uses the transpose 610 of the second inverse transformation coefficient matrix to perform column transformation on each column segment to obtain a column vector corresponding to each column segment. The column transformation can be achieved by multiplying the transpose 610 of the second inverse transformation coefficient matrix by each column segment, for example: the transpose 610 of the second inverse transformation coefficient matrix is multiplied by the first column segment 6211 to obtain a first column vector 6311. Since the row numbers of all column segments are the same, the column vector splicing unit 153 splices all the column vectors according to the column numbers of each column segment to obtain the intermediate matrix 630. The intermediate matrix 630 is stored by column. In the above column transformation process, a 16×16 column transformation is adopted, and each calculation unit can realize a 16×16 column transformation of 4 points at a time. If the calculation module includes four calculation units, the throughput rate of the column transformation is 16 points / clk, where clk represents the time required for the calculation unit to complete one operation.
[0112] When M2<M1, the residual square matrix is a matrix with M1 rows and M1 columns. Figure 7 , the second inverse transform coefficient matrix is a 4×4 square matrix, the residual square matrix 720 is formed by concatenating the first residual matrix 721, the second residual matrix 722, the third residual matrix 723 and the fourth residual matrix 724, and the above residual matrices are all 4×16 matrices.
[0113] When performing column transformation, the column segment division unit 152 divides each column of the residual square matrix 720 into 4 column segments, for example, the first column of the residual square matrix 720 is divided into a first column segment 7211, a second column segment 7221, a third column segment 7231 and a fourth column segment 7241, and the length of each column segment is 4. The calculation unit 151 performs column transformation on each column segment using the second inverse transformation coefficient matrix 710 to obtain a column vector corresponding to each column segment. The column transformation can be realized by multiplying the transpose 710 of the second inverse transformation coefficient matrix by each column segment, for example: the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the first column segment 7211 to obtain a first column vector 7311, the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the second column segment 7221 to obtain a second column vector 7321, the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the third column segment 7231 to obtain a third column vector 7331, and the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the fourth column segment 7241 to obtain a fourth column vector 7341. Preferably, all column segments belonging to the same column are column transformed at the same time, and column segments belonging to different columns are column transformed sequentially. The column vector splicing unit 153 splices the column vectors according to the row number and / or column number of the column vectors to obtain the intermediate matrix 730. The intermediate matrix 730 is stored by column. In this process, 4×4 column transformation is adopted, and the structure of the calculation unit can realize 4×4 column transformation of 4 column segments of each column at the same time, and output 4 points accordingly. If the calculation module includes 4 calculation units, the throughput rate of the above column transformation is 16 points / clk.
[0114] In one embodiment of the present invention, the dimension of the residual square matrix is the same as the dimension of the second inverse transform coefficient matrix, and the calculation unit 151 performs column transformation on the residual square matrix using the transpose of the second inverse transform coefficient matrix to obtain the intermediate square matrix. The column transformation is achieved by multiplying the residual square matrix by the transpose of the second inverse transform coefficient matrix.
[0115] See also Figure 4 In one embodiment of the present invention, the calculation module 150 also includes: a row segment division unit 154, which is respectively connected to the matrix splicing module 130 and the calculation unit 151, and is used to divide each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; the calculation unit 151 uses the first inverse transformation coefficient matrix to perform row transformation on each of the row segments to obtain a row vector corresponding to each of the row segments; a row vector splicing unit 155, which is connected to the calculation unit 151, splices all the row vectors according to the row number and / or column number of the row vector to obtain the residual sample matrix.
[0116] The residual matrix is a matrix with M2 rows and M1 columns. When M2>M1, the residual square matrix is a matrix with M2 rows and M2 columns. Figure 6 , the first inverse transformation coefficient matrix is a 4×4 square matrix, the residual square matrix 620 is formed by concatenating the first residual matrix 621, the second residual matrix 622, the third residual matrix 623 and the fourth residual matrix 624, and the above residual matrices are all 16×4 matrices.
[0117] When performing row transformation, the intermediate matrix 640 is read row by row. The row segment division unit 154 divides each row of the residual square matrix 620 into four row segments, for example, the first row of the intermediate matrix 640 is divided into a first row segment 6411, a second row segment 6412, a third row segment 6413 and a fourth row segment 6414, and the length of each row segment is 4. The calculation unit 151 uses the first inverse transformation coefficient matrix 650 to perform row transformation on each of the row segments to obtain a row vector corresponding to each of the row segments. The row transformation can be achieved by multiplying the row segment by the first inverse transformation coefficient matrix, for example: the first row segment 6411 is multiplied by the first inverse transformation coefficient matrix 650 to obtain a first row vector 6611, the second row segment 6412 is multiplied by the first inverse transformation coefficient matrix 650 to obtain a second row vector 6612, the third row segment 6413 is multiplied by the first inverse transformation coefficient matrix 650 to obtain a third row vector 6613, and the fourth row segment 6414 is multiplied by the first inverse transformation coefficient matrix 650 to obtain a fourth row vector 6614. Preferably, all row segments belonging to the same row are row transformed at the same time, and row segments belonging to different rows are row transformed sequentially. The row vector splicing unit 155 splices the row vectors according to the row number and / or column number of the row vectors to obtain the residual sample matrix 660. In this process, 4×4 row transformation is adopted, and the structure of the calculation unit can realize 4×4 row transformation of 4 row segments of each row at the same time, and output 4 points accordingly. If the calculation module includes 4 calculation units, the throughput rate of the above row transformation can reach 16 points / clk.
[0118] When M2<M1, the residual square matrix is a matrix with M1 rows and M1 columns. Figure 7 , the second inverse transform coefficient matrix is a 16×16 square matrix, the residual square matrix 720 is formed by concatenating the first residual matrix 721, the second residual matrix 722, the third residual matrix 723 and the fourth residual matrix 724, and the above residual matrices are all 4×16 matrices.
[0119] When performing row transformation, the intermediate matrix 740 is read row by row, and the row segment division unit 154 divides each row of the residual square matrix 720 into one row segment, for example, the first row is divided into the first row segment 7411, and the length of each row segment is 16. The calculation unit 151 uses the first inverse transformation coefficient matrix to perform row transformation on each row segment to obtain the row vector corresponding to each row segment. The row transformation can be achieved by multiplying the row segment by the first inverse transformation coefficient matrix, for example: the first row segment 7411 is multiplied by the first inverse transformation coefficient matrix to obtain the first row vector 7611. The row vector splicing unit 155 splices all the row vectors according to the row number of each row vector to obtain the residual sample matrix 760. In the above row transformation process, a 16×16 row transformation is used. If the calculation module includes 4 calculation units, each calculation unit can realize a 16×16 row transformation of 4 points each time, so the throughput of the above row transformation is 16 points / clk.
[0120] In one embodiment of the present invention, the dimension of the residual square matrix is the same as the dimension of the first inverse transformation coefficient matrix, and the calculation unit 151 uses the first inverse transformation coefficient matrix to perform row transformation on the residual square matrix to obtain the residual sample matrix. The row transformation is achieved by multiplying the residual square matrix by the first inverse transformation coefficient matrix.
[0121] In one embodiment of the present invention, the number of rows of the residual matrix is greater than the number of columns, that is, M2>M1. The calculation unit multiplies the residual square matrix by the transpose of the second inverse transformation coefficient matrix to obtain the intermediate matrix; the row segment division unit divides each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; the calculation unit multiplies each row segment by the first inverse transformation coefficient matrix to obtain the corresponding row vector; the row vector splicing unit splices all row vectors according to the row number and / or column number of each row vector to obtain the residual sample matrix.
[0122] In one embodiment of the present invention, the number of rows of the residual matrix is greater than the number of columns, that is, M2>M1. The column segment division unit divides each column of the residual matrix into a column segment of length M2; the calculation unit uses the transpose of the second inverse transformation coefficient matrix to perform column transformation on each of the column segments to obtain a corresponding column vector; the column vector splicing unit splices all the row vectors according to the column number of the column vector to obtain an intermediate matrix. The row segment division unit divides each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; the calculation unit multiplies each of the row segments by the first inverse transformation coefficient matrix to obtain a corresponding row vector; the row vector splicing unit splices all row vectors according to the row number and / or column number of each row vector to obtain a residual sample matrix.
[0123] In one embodiment of the present invention, the number of rows of the residual matrix is less than the number of columns, that is, M2<M1. The column segment division unit divides each column of the residual square matrix into N1 column segments of length M2, where N1 is a positive integer; the calculation unit uses the transpose of the second inverse transformation coefficient matrix to perform column transformation on each of the column segments to obtain the column vector corresponding to each of the column segments; the column vector splicing unit splices all the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix. The calculation unit multiplies the intermediate matrix by the first inverse transformation coefficient matrix to obtain the residual sample matrix.
[0124] In one embodiment of the present invention, the number of rows of the residual matrix is less than the number of columns, that is, M2<M1. The column segment division unit divides each column of the residual matrix into N1 column segments of length M2, where N1 is a positive integer; the calculation unit uses the transpose of the second inverse transformation coefficient matrix to perform column transformation on each of the column segments to obtain the column vector corresponding to each of the column segments; the column vector splicing unit splices all of the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix. The row segment division unit divides each row of the intermediate matrix into 1 row segment of length M1, and the calculation unit uses the first inverse transformation coefficient matrix to perform row transformation on each of the row segments to obtain the row vector corresponding to each of the row segments; the row vector splicing unit splices all row vectors according to the row number of the row vector to obtain the residual sample matrix.
[0125] The present invention also provides an AVS2 inverse transformation method, see Figure 8 , the AVS2 inverse transformation method includes:
[0126] S1, obtain a residual matrix; the residual matrix is an M2×M1 matrix; wherein M1 and M2 are both positive integers; the residual matrix is obtained by inverse quantization of a compressed bit stream; in particular, the residual matrix is a 16×4 matrix (representing a 16-row 4-column matrix), a 4×16 matrix (representing a 4-row 16-column matrix), a 32×8 matrix (representing a 32-row 8-column matrix) or an 8×32 matrix (representing an 8-row 32-column matrix).
[0127] S2, splicing at least 2 of the residual matrices to form a residual square matrix; the splicing refers to the process of simply splicing matrices to obtain a square matrix. Preferably, the residual matrices involved in the splicing are adjacent residual matrices. If M2>M1 of the residual matrix, that is, the number of rows of the residual matrix is greater than the number of columns, it is preferred to splice the residual matrix row by row. For example, if the residual matrix is a 16×4 matrix, and the four residual matrices are A, B, C and D, they are spliced row by row to obtain a 16×16 square matrix [ABCD]. If M2<M1 of the residual matrix, that is, the number of rows of the residual matrix is less than the number of columns, it is preferred to splice the residual matrix column by column. For example, if the residual matrix is an 8×32 matrix, and the four residual matrices are A', B', C' and D', the four adjacent residual matrices can be spliced column by column to obtain a 32×32 square matrix. In particular, for the residual square matrix of M2=M1, there is no need to concatenate them, and the inverse transformation can be directly completed using the existing square inverse transformation method.
[0128] S3, according to the residual matrix, select the corresponding first inverse transformation coefficient matrix and the second inverse transformation coefficient matrix; the second inverse transformation coefficient matrix is an M2×M2 matrix; the first inverse transformation coefficient matrix is an M1×M1 matrix; the AVS2 standard provides a total of 6 inverse transformation coefficient matrices, namely S4, D4, T4, T8, T 16 and T 32 The coefficient selection module 140 selects the second inverse transformation coefficient matrix from the above six inverse transformation coefficient matrices according to the number of rows of the residual matrix, and selects the first inverse transformation coefficient matrix from the above six inverse transformation coefficient matrices according to the number of columns of the residual matrix.
[0129] S4, using the second inverse transformation coefficient matrix to perform column transformation on the residual square matrix to obtain an intermediate matrix;
[0130] S5, using the first inverse transformation coefficient matrix to perform row transformation on the intermediate matrix to obtain a residual sample matrix.
[0131] In one embodiment of the present invention, the AVS2 inverse transformation method further includes: storing the intermediate matrix in a storage module by column; and reading the intermediate matrix from the storage module by row.
[0132] In one embodiment of the present invention, the row transformation and the column transformation are implemented by multiplication and addition operations between vectors; the multiplication and addition operations are implemented by a butterfly operation. The butterfly operation is implemented by a butterfly calculator, see Figure 5For the calculation unit in the butterfly calculator, CALx represents a 4-point multiplier-adder, and the process of implementing the vector multiplication and addition operation through CALx is: input two vectors x={x0,x1,x2,x3} and E={a0,a1,a2,a3}, where x={x0,x1,x2,x3} represents the input vector, and E={a0,a1,a2,a3} represents the transformation coefficient vector; use the multiplier-adder to multiply the elements at corresponding positions in the vector to obtain the corresponding product, and then sum all the products to implement the multiplication and addition operation of the vector x and E. Figure 5 In the example, each CALx can realize a 4×4 transformation of one point. Since the computing unit adopts a butterfly structure, one multiplier-adder Calx is required to realize a 4×4 transformation of one point, and the corresponding transformation result is y_0.125; two multipliers-adders Calx are required to realize an 8×8 transformation of one point, and the corresponding transformation result is y1_0.25 or y32_0.25; four multipliers-adders Calx are required to realize a 16×16 transformation of one point, and the corresponding transformation result is y1_0.5 or y32_0.5; eight multipliers-adders are required to realize a 32×32 transformation of one point, and the corresponding transformation result is y1 or y32. In summary, one computing unit can simultaneously realize 4×4 transformation output of 8 points, 8×8 transformation output of 8 points, 16×16 transformation output of 4 points, and 32×32 transformation output of 2 points. If the calculation module includes 4 calculation units, the calculation module can simultaneously realize 4×4 transformation output of 32 points, 8×8 transformation output of 32 points, 16×16 transformation output of 16 points, and 32×32 transformation output of 8 points. The transformation can be a row transformation or a column transformation.
[0133] In one embodiment of the present invention, a method for implementing column transformation of the residual matrix using the second inverse transformation coefficient matrix includes: if the dimension of the second inverse transformation coefficient matrix is the same as that of the residual matrix, multiplying the residual matrix by the transpose of the second inverse transformation coefficient matrix to obtain the intermediate matrix.
[0134] See also Fig. 9 In one embodiment of the present invention, a method for implementing column transformation of the residual square matrix using the second inverse transformation coefficient matrix includes:
[0135] S41, divide each column of the residual square matrix into N1 column segments of length M2, where N1 is a positive integer.
[0136] The residual matrix is a matrix with M2 rows and M1 columns. When M2>M1, the residual square matrix is a matrix with M2 rows and M2 columns. Figure 6, the second inverse transformation coefficient matrix is a 16×16 square matrix, the residual square matrix 620 is formed by splicing the first residual matrix 621, the second residual matrix 622, the third residual matrix 623 and the fourth residual matrix 624, and the above residual matrices are all 16×4 matrices. When performing column transformation, each column of the residual square matrix 620 is divided into 1 column segment, for example, the first column is divided into the first column segment 6211, and the length of each column segment is 16.
[0137] When M2<M1, the residual square matrix is a matrix with M1 rows and M1 columns. Figure 7 , the second inverse transformation coefficient matrix is a 4×4 square matrix, the residual square matrix 720 is formed by concatenating the first residual matrix 721, the second residual matrix 722, the third residual matrix 723 and the fourth residual matrix 724, and the above residual matrices are all 4×16 matrices. When performing column transformation, each column of the residual square matrix 720 is divided into 4 column segments, for example, the first column is divided into a first column segment 7211, a second column segment 7221, a third column segment 7231 and a fourth column segment 7241, and the length of each column segment is 4.
[0138] S42, performing column transformation on each of the column segments using the transpose of the second inverse transformation coefficient matrix to obtain a column vector corresponding to each of the column segments.
[0139] See also Figure 6 When M2>M1, the transpose 610 of the second inverse transform coefficient matrix is used to perform column transform on each of the column segments to obtain a column vector corresponding to each of the column segments. The column transform can be achieved by multiplying the transpose 610 of the second inverse transform coefficient matrix by each of the column segments. For example: the transpose 610 of the second inverse transform coefficient matrix is multiplied by the first column segment 6211 to obtain the first column vector 6311.
[0140] See also Figure 7 , when M2<M1, the second inverse transformation coefficient matrix 710 is used to perform column transformation on each of the column segments to obtain a column vector corresponding to each of the column segments, and the column transformation can be achieved by multiplying the transpose 710 of the second inverse transformation coefficient matrix by each of the column segments, for example: the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the first column segment 7211 to obtain a first column vector 7311, the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the second column segment 7221 to obtain a second column vector 7321, the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the third column segment 7231 to obtain a third column vector 7331, and the transpose 710 of the second inverse transformation coefficient matrix is multiplied by the fourth column segment 7241 to obtain a fourth column vector 7341. Preferably, all column segments belonging to the same column are column transformed simultaneously, and column segments belonging to different columns are column transformed sequentially.
[0141] S43, concatenating all the column vectors according to the column numbers and / or row numbers of the column vectors to obtain the intermediate matrix.
[0142] See also Figure 6 , when M2>M1, all the column vectors are concatenated according to the column numbers of the column segments to obtain the intermediate matrix 630. The intermediate matrix 630 is stored by column. In the above column transformation process, a 16×16 column transformation is adopted. If the calculation module includes 4 calculation units, each calculation unit can realize a 16×16 column transformation of 4 points each time, so the throughput of the above column transformation is 16 points / clk. Wherein, clk represents the time required for the calculation unit to complete one operation.
[0143] See also Figure 7 , when M2<M1, the column vectors are spliced according to the row number and / or column number of the column vectors to obtain the intermediate matrix 730. The intermediate matrix 730 is stored by column. In this process, a 4×4 column transformation is adopted, and the structure of the calculation unit can realize 4×4 column transformation of 4 column segments of each column at the same time, and the corresponding output is 4 points. If the calculation module includes 4 calculation units, the throughput of the above column transformation can reach 16 points / clk.
[0144] The row number and / or column number of the column vector can be determined according to the horizontal coordinate and the vertical coordinate of the first element in the column vector, respectively. Column vectors with the same row number are aligned horizontally, and column vectors with the same vertical coordinate are aligned vertically.
[0145] In one embodiment of the present invention, a method for implementing row transformation of the intermediate matrix using the first inverse transformation coefficient matrix includes: if the dimension of the first inverse transformation coefficient matrix is the same as the dimension of the intermediate matrix, multiplying the intermediate matrix by the first inverse transformation coefficient matrix to obtain the residual sample matrix.
[0146] See also Fig.10 In one embodiment of the present invention, a method for implementing row transformation of the intermediate matrix using the first inverse transformation coefficient matrix includes:
[0147] S51, dividing each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer.
[0148] The residual matrix is a matrix with M2 rows and M1 columns. When M2>M1, the residual square matrix is a matrix with M2 rows and M2 columns. Figure 6, the second inverse transformation coefficient matrix is a 16×16 square matrix, the residual square matrix 620 is formed by splicing the first residual matrix 621, the second residual matrix 622, the third residual matrix 623 and the fourth residual matrix 624, and the above residual matrices are all 16×4 matrices. When performing column transformation, each column of the residual square matrix 620 is divided into 1 column segment, for example, the first column is divided into the first column segment 6211, and the length of each column segment is 16.
[0149] When M2<M1, the residual square matrix is a matrix with M1 rows and M1 columns. Figure 7 , the second inverse transformation coefficient matrix is a 4×4 square matrix, the residual square matrix 720 is formed by concatenating the first residual matrix 721, the second residual matrix 722, the third residual matrix 723 and the fourth residual matrix 724, and the above residual matrices are all 4×16 matrices. When performing column transformation, each column of the residual square matrix 720 is divided into 4 column segments, for example, the first column is divided into a first column segment 7211, a second column segment 7221, a third column segment 7231 and a fourth column segment 7241, and the length of each column segment is 4.
[0150] S52: Perform row transformation on each of the row segments using the first inverse transformation coefficient matrix to obtain a row vector corresponding to each of the row segments.
[0151] When M2>M1, the transpose 610 of the second inverse transform coefficient matrix is used to perform column transformation on each of the column segments to obtain a column vector corresponding to each of the column segments. The column transformation can be achieved by multiplying the transpose 610 of the second inverse transform coefficient matrix by each of the column segments. For example: the transpose 610 of the second inverse transform coefficient matrix is multiplied by the first column segment 6211 to obtain the first column vector 6311.
[0152] When M2<M1, the second inverse transform coefficient matrix 710 is used to perform column transformation on each of the column segments to obtain a column vector corresponding to each of the column segments. The column transformation can be achieved by multiplying the transpose 710 of the second inverse transform coefficient matrix by each of the column segments. For example, the transpose 710 of the second inverse transform coefficient matrix is multiplied by the first column segment 7211 to obtain a first column vector 7311, the transpose 710 of the second inverse transform coefficient matrix is multiplied by the second column segment 7221 to obtain a second column vector 7321, the transpose 710 of the second inverse transform coefficient matrix is multiplied by the third column segment 7231 to obtain a third column vector 7331, and the transpose 710 of the second inverse transform coefficient matrix is multiplied by the fourth column segment 7241 to obtain a fourth column vector 7341. Preferably, all column segments belonging to the same column are column transformed simultaneously, and column segments belonging to different columns are column transformed sequentially.
[0153] S53, concatenating all the row vectors according to the row numbers and / or column numbers of the row vectors to obtain the residual sample matrix.
[0154] When M2>M1, all the column vectors are concatenated according to the column numbers of the column segments to obtain the intermediate matrix 630. The intermediate matrix 630 is stored by column. In the above column transformation process, 16×16 column transformation is adopted. If the calculation module includes 4 calculation units, each calculation unit can realize 16×16 column transformation of 4 points each time, so the throughput of the above column transformation is 16 points / clk. Wherein, clk represents the time required for the calculation unit to complete one operation.
[0155] When M2<M1, the column vectors are spliced according to the row number and / or column number of the column vectors to obtain the intermediate matrix 730. The intermediate matrix 730 is stored by column. In this process, a 4×4 column transformation is adopted, and the structure of the calculation unit can realize 4×4 column transformation of 4 column segments of each column at the same time, and the corresponding output is 4 points. If the calculation module includes 4 calculation units, the throughput of the above column transformation can reach 16 points / clk.
[0156] The protection scope of the AVS2 inverse transformation method described in the present invention is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present invention are included in the protection scope of the present invention.
[0157] The present invention also provides an AVS2 inverse transformation device, which can implement the AVS2 inverse transformation method described in the present invention. However, the implementation device of the AVS2 inverse transformation method described in the present invention includes but is not limited to the structure of the AVS2 inverse transformation device listed in this embodiment. All structural deformations and replacements of the prior art made according to the principles of the present invention are included in the protection scope of the present invention.
[0158] The AVS2 inverse transform method of the present invention makes the throughput rate before and after transform decoding the same, and can improve the performance and processing speed of each hardware;
[0159] The present invention uses square matrix transformation to realize rectangular inverse transformation, which can well reuse the existing square inverse transformation hardware and has good compatibility with mainstream decoders;
[0160] The AVS2 inverse transformation method of the present invention adopts a butterfly calculator to realize the inverse transformation, and the 4×16 and 16×4 residual matrices are calculated in a 16×16 manner, which can effectively reduce the number of 4×4 blocks and improve the performance of the system.
[0161] The AVS2 inverse transformation device of the present invention only needs to support the storage of square matrices and does not need to additionally support rectangular matrices.
[0162] In one embodiment of the present invention, the number of rows of the residual matrix is greater than the number of columns, that is, M2>M1. An implementation method for obtaining the residual sample matrix includes: multiplying the residual square matrix by the transpose of the second inverse transform coefficient matrix to obtain the intermediate matrix; dividing each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; multiplying each row segment by the first inverse transform coefficient matrix to obtain a corresponding row vector; splicing all row vectors according to the row number and / or column number of each row vector to obtain a residual sample matrix.
[0163] In one embodiment of the present invention, the number of rows of the residual matrix is greater than the number of columns, that is, M2>M1. A method for obtaining the residual sample matrix includes: dividing each column of the residual square matrix into a column segment of length M2; performing column transformation on each of the column segments using the transpose of the second inverse transformation coefficient matrix to obtain a corresponding column vector; splicing all of the row vectors according to the column number of the column vector to obtain an intermediate matrix. Divide each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; multiply each of the row segments by the first inverse transformation coefficient matrix to obtain a corresponding row vector; splice all of the row vectors according to the row number and / or column number of each of the row vectors to obtain a residual sample matrix.
[0164] In one embodiment of the present invention, the number of rows of the residual matrix is less than the number of columns, that is, M2<M1. A method for obtaining the residual sample matrix includes: dividing each column of the residual square matrix into N1 column segments of length M2, where N1 is a positive integer; performing column transformation on each of the column segments using the transpose of the second inverse transformation coefficient matrix to obtain the column vector corresponding to each of the column segments; splicing all the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix. The residual sample matrix is obtained by multiplying the intermediate matrix by the first inverse transformation coefficient matrix.
[0165] In one embodiment of the present invention, the number of rows of the residual matrix is less than the number of columns, that is, M2<M1. An implementation method for obtaining the residual sample matrix includes: dividing each column of the residual square matrix into N1 column segments of length M2, where N1 is a positive integer; performing column transformation on each of the column segments using the transpose of the second inverse transformation coefficient matrix to obtain a column vector corresponding to each of the column segments; splicing all of the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix. Divide each row of the intermediate matrix into a row segment of length M1, perform row transformation on each of the row segments using the first inverse transformation coefficient matrix to obtain a row vector corresponding to each of the row segments; splice all of the row vectors according to the row number of the row vector to obtain the residual sample matrix.
[0166] In summary, the present invention converts the difficult-to-implement AVS2 rectangular transformation into an easily-implemented square matrix transformation, and converts the rectangular transformation that is not easily reused by other mainstream decoders into an easily reused square matrix transformation, thereby improving the overall performance of the AVS2 inverse transformation and saving the resource overhead of the AVS2 inverse transformation system. The present invention effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.
[0167] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. An AVS2 inverse transformation device, characterized in that: The AVS2 inverse transformation device comprises: A control module, used for controlling the AVS2 inverse transformation device to implement the AVS2 inverse transformation; A matrix acquisition module, connected to the control module, for acquiring a plurality of residual matrices; each residual matrix is an M2×M1 matrix; wherein M1 and M2 are both positive integers; A matrix splicing module, connected to the control module and the matrix acquisition module respectively, for splicing at least two of the residual matrices to form a residual square matrix; A coefficient selection module, connected to the control module, for selecting a first inverse transformation coefficient matrix and a second inverse transformation coefficient matrix according to the residual matrix; the second inverse transformation coefficient matrix is an M2×M2 matrix; the first inverse transformation coefficient matrix is an M1×M1 matrix; A calculation module is respectively connected to the control module, the coefficient selection module, and the matrix splicing module, and is used to use the second inverse transformation coefficient matrix to perform column transformation on the residual square matrix to obtain an intermediate matrix, and to use the first inverse transformation coefficient matrix to perform row transformation on the intermediate matrix to obtain a residual sample matrix.
2. The AVS2 inverse transformation device according to claim 1, characterized in that: The AVS2 inverse transformation device also includes: A storage module is connected to the control module and the calculation module respectively, and is used to store the intermediate matrix by column and read the intermediate matrix by row.
3. The AVS2 inverse transformation device according to claim 1, characterized in that: The calculation module comprises: At least one computing unit is connected to the coefficient selection module and the matrix splicing module respectively, and is used to implement multiplication and addition operations between vectors; the computing unit is a primary butterfly calculator.
4. The AVS2 inverse transformation device according to claim 3, characterized in that: The calculation module also includes: a column segment division unit, connected to the matrix concatenation module and the calculation unit respectively, and configured to divide each column of the residual square matrix into N1 column segments of length M2, wherein N1 is a positive integer; the calculation unit performs column transformation on each of the column segments by using the transpose of the second inverse transformation coefficient matrix to obtain a column vector corresponding to each of the column segments; A column vector concatenation unit is connected to the calculation unit and is used to concatenate all the column vectors according to the column number and / or row number of the column vector to obtain the intermediate matrix.
5. The AVS2 inverse transformation device according to claim 3, characterized in that: The calculation module also includes: a row segment division unit, connected to the matrix splicing module and the calculation unit respectively, and used to divide each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; the calculation unit uses the first inverse transformation coefficient matrix to perform row transformation on each row segment to obtain a row vector corresponding to each row segment; A row vector splicing unit is connected to the calculation unit and is used to splice all the row vectors according to the row number and / or column number of the row vector to obtain the residual sample matrix.
6. An AVS2 inverse transformation method, characterized in that: The AVS2 inverse transformation method comprises: Obtain multiple residual matrices; each residual matrix is an M2×M1 matrix; wherein M1 and M2 are both positive integers; Concatenate at least two of the residual matrices to form a square residual matrix; Selecting a corresponding first inverse transformation coefficient matrix and a second inverse transformation coefficient matrix according to the residual matrix; the second inverse transformation coefficient matrix is an M2×M2 matrix; the first inverse transformation coefficient matrix is an M1×M1 matrix; Using the second inverse transformation coefficient matrix, performing column transformation on the residual square matrix to obtain an intermediate matrix; The first inverse transformation coefficient matrix is used to perform row transformation on the intermediate matrix to obtain a residual sample matrix.
7. The AVS2 inverse transformation method according to claim 6, characterized in that: The AVS2 inverse transformation method further includes: Storing the intermediate matrix in a storage module by column; The intermediate matrix is read row by row from the storage module.
8. The AVS2 inverse transformation method according to claim 6, characterized in that: The row transformation and the column transformation are implemented through multiplication and addition operations between vectors; the multiplication and addition operations are implemented through one butterfly operation.
9. The AVS2 inverse transformation method according to claim 6, characterized in that: A method for implementing column transformation of the residual square matrix using the second inverse transformation coefficient matrix includes: If the second inverse transform coefficient matrix and the residual square matrix have the same dimension, the transpose of the second inverse transform coefficient matrix is multiplied by the residual square matrix to obtain the intermediate matrix.
10. The AVS2 inverse transformation method according to claim 6, characterized in that: A method for implementing column transformation of the residual square matrix using the second inverse transformation coefficient matrix includes: Divide each column of the residual square matrix into N1 column segments of length M2, where N1 is a positive integer; Performing column transformation on each of the column segments by using the transpose of the second inverse transformation coefficient matrix to obtain a column vector corresponding to each of the column segments; All the column vectors are concatenated according to the column numbers and / or row numbers of the column vectors to obtain the intermediate matrix.
11. The AVS2 inverse transformation method according to claim 6, characterized in that: A method for implementing row transformation of the intermediate matrix using the first inverse transformation coefficient matrix includes: If the dimension of the first inverse transform coefficient matrix is the same as the dimension of the intermediate matrix, the residual sample matrix is obtained by multiplying the intermediate matrix by the first inverse transform coefficient matrix.
12. The AVS2 inverse transformation method according to claim 6, characterized in that: A method for implementing row transformation of the intermediate matrix using the first inverse transformation coefficient matrix includes: Divide each row of the intermediate matrix into N2 row segments of length M1, where N2 is a positive integer; Performing row transformation on each of the row segments using the first inverse transformation coefficient matrix to obtain a row vector corresponding to each of the row segments; All the row vectors are concatenated according to the row numbers and / or column numbers of the row vectors to obtain the residual sample matrix.
Citation Information
Patent Citations
Optimized video data coding method based on boundary adaptive transform
CN105791867A
Coding device and decoding device
CN107251558A