Video coding processing method, device and equipment and storage medium

By defining the effective rectangular range of the inverse quantization matrix and performing calculations only on the matrix values ​​within the effective rectangular range, the problem of computational redundancy in video encoding and decoding is solved, thereby reducing the amount of computation and adapting the algorithm, and improving encoding and decoding efficiency.

CN115714865BActive Publication Date: 2025-12-16BIGO TECH PTE LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211275687.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-18
Publication Date
2025-12-16
Estimated Expiration
2042-10-18

AI Technical Summary

Technical Problem

Existing technologies suffer from significant computational redundancy and high computational load in video encoding and decoding processes, particularly in the inverse discrete cosine transform, where the algorithm is not effectively adapted, leading to an imbalance between computational load and algorithm implementation.

Method used

By defining the effective rectangular range of the inverse quantization matrix, calculations are performed only on the matrix values ​​within the effective rectangular range, avoiding computational redundancy, adapting to algorithms related to the inverse discrete cosine transform, and reducing the amount of computation.

Benefits of technology

The computational load was reduced and computational efficiency was improved during video encoding and decoding. A balance between computational load and algorithm was achieved, and the calculation process of decoding residuals was simplified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115714865B_ABST
    Figure CN115714865B_ABST
Patent Text Reader

Abstract

Embodiments of the application disclose a video coding processing method, device and equipment and a storage medium. The method comprises: determining an effective rectangular range of a dequantization matrix in a video coding process; performing operation on a set transform matrix based on a matrix value corresponding to the effective rectangular range to obtain a first target matrix, the effective rectangular range being smaller than a matrix range of the dequantization matrix; and performing operation on the first target matrix and the transform matrix to obtain a decoded residual matrix, which is used for video coding. The present scheme facilitates implementation of related algorithms while reducing the amount of calculation in the video coding process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of video processing, and in particular to a video coding processing method and device, equipment and a storage medium. BACKGROUND

[0002] Discrete cosine transform is an important part of the video hybrid coding framework, which transforms the residual matrix to concentrate energy in the top-left corner of the transform block, while the transform coefficients in the bottom-right corner of the transform block are relatively small. After discrete cosine transform, only a few non-zero coefficients in the top-left corner are left after quantization, while most of the coefficients in the bottom-right corner are zero, which achieves the purpose of compressing part of the information. Discrete cosine transform can be understood as Y=D*X*D^, where X is the residual matrix, D is the discrete cosine transform matrix, D^ is the transpose of the discrete cosine transform matrix, and Y is the coefficient matrix after transformation.

[0003] Discrete cosine inverse transform is the opposite process of discrete cosine transform, which is used in video decoding and reconstruction in coding. Taking decoding as an example, the decoded residual is obtained by performing discrete cosine inverse transform on the dequantized coefficient matrix, and the reconstructed pixel is obtained by adding the decoded residual and the prediction value. The final decoded pixel is obtained by performing post-processing on the reconstructed pixel. Discrete cosine inverse transform can be represented as X'=D^*Y'*D, where Y' is the dequantized coefficient matrix and X' is the inverse transformed residual matrix. In related technologies, complete matrix multiplication is used to calculate the inverse transformed residual matrix, resulting in a large amount of calculation redundancy, which leads to a large amount of calculation. At the same time, the current algorithm related to discrete cosine inverse transform is not considered in the calculation process, resulting in an imbalance between the calculation amount and the algorithm implementation. SUMMARY

[0004] Embodiments of the present application provide a video coding processing method, device, equipment and storage medium, which solves the problem of large amount of calculation in related technologies when video coding is performed by using complete matrix multiplication, thereby reducing the amount of calculation and facilitating the implementation of related algorithms.

[0005] In a first aspect, embodiments of the present application provide a video coding processing method, which comprises:

[0006] In the video coding process, the effective rectangular range of the dequantization matrix is determined;

[0007] The first target matrix is obtained by operating the matrix value corresponding to the effective rectangular range and the set transform matrix, and the effective rectangular range is smaller than the matrix range of the dequantization matrix;

[0008] The first target matrix is obtained by performing operation on the matrix value corresponding to the effective rectangular range of the inverse quantization matrix and a set transform matrix, and the effective rectangular range is smaller than the matrix range of the inverse quantization matrix.

[0009] In a second aspect, the embodiments of the present application further provide a video coding processing apparatus, comprising:

[0010] a range determining module, configured to determine an effective rectangular range of an inverse quantization matrix in a video coding process;

[0011] a target matrix calculating module, configured to obtain a first target matrix by performing operation on a matrix value corresponding to the effective rectangular range and a set transform matrix, the effective rectangular range being smaller than a matrix range of the inverse quantization matrix;

[0012] a residual matrix calculating module, configured to obtain a decoding residual matrix by performing operation on the first target matrix and the transform matrix, for video coding.

[0013] In a third aspect, the embodiments of the present application further provide a video coding processing device, comprising:

[0014] one or more processors;

[0015] a storage device, configured to store one or more programs,

[0016] when the one or more programs are executed by the one or more processors, the one or more processors implement the video coding processing method provided by the embodiments of the present application.

[0017] In a fourth aspect, the embodiments of the present application further provide a nonvolatile storage medium storing computer executable instructions, which, when executed by a computer processor, are used to perform the video coding processing method provided by the embodiments of the present application.

[0018] In a fifth aspect, the embodiments of the present application further provide a computer program product, which comprises a computer program stored in a computer readable storage medium, and at least one processor of a device reads and executes the computer program from the computer readable storage medium, so that the device performs the video coding processing method provided by the embodiments of the present application.

[0019] In the video coding process, an effective rectangular range of the inverse quantization matrix is determined, a first target matrix is obtained by performing operation on the matrix value corresponding to the effective rectangular range and the set transform matrix, the effective rectangular range is smaller than the matrix range of the inverse quantization matrix, and then the decoding residual matrix is obtained by performing operation on the obtained first target matrix and the set transform matrix, so as to perform video coding. In this processing mode, when calculating the residual matrix after inverse transform, the operation of the matrix value corresponding to the effective rectangular range is performed by determining the effective rectangular range, and the values outside the effective rectangular range are not calculated, so as to reduce the operation amount and avoid a large amount of redundant calculation. At the same time, the effective rectangular range is determined, which can adapt to the current algorithm related to the inverse discrete cosine transform, so that the calculation amount and the algorithm implementation are balanced. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1 A flowchart of a video coding processing method provided by an embodiment of the present application is shown in FIG. 1.

[0021] Figure 2 A flowchart of a method for determining an effective rectangular range of an inverse quantization matrix provided by an embodiment of the present application is shown in FIG. 2.

[0022] Figure 3 A rectangular range diagram provided by an embodiment of the present application is shown in FIG. 3.

[0023] Figure 4 A flowchart of a method for calculating a first target matrix provided by an embodiment of the present application is shown in FIG. 4.

[0024] Figure 5 A range division diagram of the first target matrix provided by an embodiment of the present application is shown in FIG. 5.

[0025] Figure 6 A flowchart of a method for performing target matrix data storage provided by an embodiment of the present application is shown in FIG. 6.

[0026] Figure 7 A structural block diagram of a video coding processing device provided by an embodiment of the present application is shown in FIG. 7.

[0027] Figure 8 A structural diagram of a video coding processing device provided by an embodiment of the present application is shown in FIG. 8. DETAILED DESCRIPTION

[0028] The embodiments of the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, but not to limit the embodiments of the present application. In addition, it should be noted that, in order to facilitate description, only the parts related to the embodiments of the present application are shown in the drawings, but not all the structures.

[0029] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a particular order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a category, not limited to the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in a "or" relationship.

[0030] The video coding processing method provided in the embodiments of the present application can be applied to a video coding scene. For the operation of inverse discrete cosine transform in the coding process, the operation of all matrix values in the coefficient matrix after dequantization is not performed, the calculation process of the decoded residual is simplified, and the overall video coding efficiency is improved.

[0031] Figure 1 The flowchart of the video coding processing method provided in the embodiments of the present application specifically includes the following steps:

[0032] Step S101, in the video coding process, the effective rectangular range of the dequantization matrix is determined.

[0033] In the video coding process, DCT (Discrete Cosine Transform) is an important part of the current video hybrid coding framework, which transforms the residual matrix to concentrate energy on the top left corner of the transform block. The discrete cosine transform can be understood as Y=D*X*D^, where X is the residual matrix, D is the discrete cosine transform matrix, D^ is the transpose of the discrete cosine transform matrix, and Y is the coefficient matrix after transformation. The residual matrix represents the difference between the coding block and the prediction block. IDCT (Inverse Discrete Cosine Transform) is the reverse process of DCT transformation, and the IDCT transformation can be represented as X'=D^*Y'*D, where Y' is the coefficient matrix after dequantization, represented by the dequantization matrix in the present application, and X' is the residual matrix after inverse transformation. The reason for using Y' instead of Y here is that information loss occurs after dequantization, and the residual matrix X' after inverse transformation is also different from the previous residual matrix X.

[0034] In one embodiment, in the video coding process, when the IDCT transform processing is performed, considering the case that there are a large number of 0 coefficients in the inverse quantization matrix and the non-zero coefficients are regularly present in the upper left corner region of the matrix, the determination of the effective rectangular range of the inverse quantization matrix is performed, and meanwhile, in the process of determining the effective rectangular range, the commonly used algorithms associated with IDCT, such as the SIMD method and the fast algorithm, are adaptively considered.

[0035] Optionally, a manner for determining the effective rectangular range of the inverse quantization matrix is to determine the effective rectangular range according to the non-zero matrix values in the inverse quantization matrix and the bit number of the vector register. Specifically, as shown in the following formula, the effective rectangular range is determined according to the non-zero matrix values in the inverse quantization matrix and the bit number of the vector register. Figure 2 Figure 2 A flowchart of a method for determining the effective rectangular range of the inverse quantization matrix provided by the embodiment of the present application includes the following steps.

[0036] In step S1011, the maximum horizontal coordinate and the maximum vertical coordinate corresponding to the non-zero matrix values in the inverse quantization matrix are determined.

[0037] In one embodiment, the manner for determining the maximum horizontal coordinate and the maximum vertical coordinate corresponding to the non-zero matrix values in the inverse quantization matrix can also be to scan from the right bottom corner to the left top corner to find the first row with non-zero coefficients as the maximum horizontal coordinate and correspondingly find the first column with non-zero coefficients as the maximum vertical coordinate. For example, for an N×N-dimensional inverse quantization matrix Y', the vertical coordinate yMax of the lowest non-zero coefficient is determined, where yMax∈[1, N], and the horizontal coordinate xMax of the rightmost non-zero coefficient is determined, where xMax∈[1, N]. According to the vertical coordinate yMax and the horizontal coordinate xMax, the effective rectangular range is determined. It is assumed that the horizontal coordinate of the effective rectangular range is denoted as xNorm and the vertical coordinate of the effective rectangular range is denoted as yNorm.

[0038] In step S1012, the bit number of the vector register and the maximum horizontal coordinate are substituted into a preset formula to calculate the rectangular horizontal coordinate.

[0039] For example, the preset formula for calculating xNorm is as follows.

[0040] xNorm = K * floor((xMax + K - 1) / K)

[0041] wherein K is a constant related to the bit number M of the vector register supported by the platform, K = M / 16 / 2, and for example, the value of M can be 128. floor() represents a down-rounding function.

[0042] In step S1013, the range composed of the maximum vertical coordinate and the rectangular horizontal coordinate is determined as the effective rectangular range. ​

[0043] In one embodiment, when determining the effective rectangular range, xNorm is calculated using the formula mentioned in step S1012 above, yNorm = yMax, that is, the maximum ordinate is directly determined as the ordinate of the effective rectangular range.

[0044] For example, taking an 8x8 block IDCT transform as an example, in the Y′ matrix a xy This represents non-zero coefficients, and the others are zero coefficients. An example of an 8x8 matrix is ​​shown below:

[0045]

[0046] The ordinate of the lowest non-zero coefficient in the vertical direction is yMax = 6, and the x-coordinate of the rightmost non-zero coefficient in the horizontal direction is xMax = 4. Therefore...

[0047] yNorm = yMax = 6

[0048] xNorm=4*floor((4+4-1) / 4)=4

[0049] For example, such as Figure 3 As shown, Figure 3 This is a schematic diagram of a rectangular range including an effective rectangular range, provided for an embodiment of this application. In this diagram, E represents the determined effective rectangular range, and R1, R2, and B represent regions with a matrix value of zero.

[0050] In another embodiment, after determining the maximum x-coordinate and maximum y-coordinate corresponding to the non-zero matrix values ​​in the inverse quantization matrix, the method further includes: adjusting the coordinate value of the maximum y-coordinate based on a set adjustment coefficient to obtain the rectangular y-coordinate; that is, instead of directly using the maximum y-coordinate as the rectangular y-coordinate, the maximum y-coordinate is adjusted based on a set adjustment coefficient to obtain the rectangular y-coordinate. Optionally, the adjustment process may be:

[0051] yNorm = P*floor((yMax+P-1) / P)

[0052] Here, `floor()` represents the function to obtain the floor function, and `P` is a custom constant in the vertical direction. Users can adjust this constant to achieve a balance between implementation complexity and computational savings. This solves the problem that for an N×N dimensional inverse quantization matrix Y′, considering only the vertical direction and not the horizontal direction, N corresponding IDCT transformation functions are needed, which is relatively cumbersome in real-time computation.

[0053] Step S102: Calculate the first target matrix based on the matrix value corresponding to the effective rectangular range and the set transformation matrix, wherein the effective rectangular range is smaller than the matrix range of the inverse quantization matrix.

[0054] In one embodiment, after determining the effective rectangular range, the matrix values ​​corresponding to the effective rectangular range are calculated with the set transformation matrix to obtain the first target matrix. Matrix values ​​outside the effective rectangular range are not calculated. Specifically, during the IDCT transformation calculation, in the IDCT transformation X′=D^*Y′*D, the D^*Y′ portion is calculated first, exemplarily denoted as Z=D^*Y′, and this matrix Z is denoted as the first target matrix described in this embodiment. Specifically, during the calculation process, elements within the effective matrix range of Y′ are read into the vector register; elements outside the effective matrix range do not need to be read.

[0055] Optional, Figure 4 A flowchart of a method for calculating a first target matrix provided in an embodiment of this application is shown below. Figure 4 As shown, it specifically includes:

[0056] Step S1021: Determine the zeroing region and non-zeroing region of the first target matrix to be calculated based on the effective rectangular range. The non-zeroing region includes the operation sub-region and the skip sub-region.

[0057] Step S1022: Set the matrix value of the zeroing region of the first target matrix to zero, perform calculations based on the matrix value corresponding to the effective rectangular range and the set transformation matrix to obtain the matrix value of the operation sub-region, and skip the calculation of the skipped sub-region.

[0058] Specifically, when performing the matrix multiplication operation Z = D^*Y′, with Figure 3 Taking the division of the effective rectangular range as an example, the zeroing regions R1 and R2 of the first target matrix are determined, as well as the operation sub-region E and skip sub-region B in the non-zeroing region. During the operation, the R1 and R2 regions of the first target matrix Z are directly set to zero, and no operation is required. For the non-zeroing region, when calculating D^*Y′, since region B of Y′ is 0, the multiplication and addition operations involving elements in the skip sub-region B are skipped. Only the multiplication and addition operations in the operation sub-region E are performed, and the operation results are shifted accordingly. The process of operating on the matrix value and the set transformation matrix includes matrix multiplication of the matrix value and the set transformation matrix.

[0059] For example, the transformation matrix for this setting could be:

[0060]

[0061] Step S103: Perform operations based on the first target matrix and the transformation matrix to obtain a decoding residual matrix for use in video encoding and decoding.

[0062] In one embodiment, after the first target matrix is calculated, the decoding residual matrix is obtained based on the first target matrix and the transform matrix. Specifically, the calculation manner includes matrix multiplication between the first target matrix and the transform matrix. For example, after the calculation of Z=D^*Y' in the IDCT transform X'=D^*Y'*D, the IDCT transform X'=Z*D is performed, and then the matrix multiplication between the first target matrix Z and the transform matrix D is performed to finally obtain the IDCT transform X', i.e., the decoding residual matrix. After the decoding residual matrix is obtained, the decoding residual is added to the prediction value in the video encoding process to obtain the reconstructed pixel, and the final decoded pixel is obtained after the reconstructed pixel is processed.

[0063] In another embodiment, the operation between the first target matrix and the transform matrix can also be: the transpose operation is performed on the first target matrix and the transform matrix, the transposed first target matrix and the transform matrix are subjected to matrix multiplication, wherein the operation of the zero value region of the transposed first target matrix is skipped in the operation process; and the operation result is subjected to shift and transpose processing. Specifically, for the IDCT transform X'=Z*D, in order to adapt to the SIMD operation, the formula is transformed into X'=Z*D=(D^*Z^)^=Q^, and when Q=D^*Z^ is calculated, Z^ after the transposition of Z has non-zero values only in the E' and B' regions of the xNorm rows on the upper side. The specific region division is shown in FIG. 2, for example. Figure 5 Figure 5 The range division diagram after the transposition of the first target matrix provided by the embodiment of the application is shown in FIG. 2, wherein Z^ after the transposition of Z has non-zero values only in the E' region and the B' region of the xNorm rows on the upper side. When the matrix multiplication between D^ and Z^ is performed, the operation of the zero value region (R1' region and R2' region) of the transposed first target matrix is skipped, and the operation result Q is subjected to shift and transpose processing to finally obtain the decoding residual matrix X'. This operation manner adapts to the SIMD operation algorithm associated with the IDCT, reduces the calculation amount, and facilitates the implementation of the related algorithm.

[0064] ​From the above scheme, in the video coding process, the effective rectangular range of the inverse quantization matrix is determined, the matrix value corresponding to the effective rectangular range is operated based on the set transform matrix to obtain a first target matrix, wherein the effective rectangular range is smaller than the matrix range of the inverse quantization matrix, and then the first target matrix obtained is operated based on the set transform matrix to obtain a decoding residual matrix, which is used for video coding. This processing method, when calculating the residual matrix after inverse transform, determines the effective rectangular range, and the matrix value corresponding to the effective rectangular range is operated, and the values outside the effective rectangular range are not calculated, thereby reducing the amount of calculation and avoiding a large amount of redundant calculation. At the same time, the method of determining the effective rectangular range can adapt to the current algorithm related to the inverse discrete cosine transform, so that the calculation amount and the algorithm implementation are balanced.

[0065] Figure 6 A flowchart of a method for storing target matrix data provided by an embodiment of the present application is shown in FIG. 2, and specifically includes the following steps. Figure 6

[0066] In step S201, in the video coding process, the maximum horizontal coordinate and the maximum vertical coordinate corresponding to the non-zero matrix value in the inverse quantization matrix are determined, the number of bits of the vector register and the maximum horizontal coordinate are substituted into a preset formula to calculate a rectangular horizontal coordinate, and the range composed of the maximum vertical coordinate and the rectangular horizontal coordinate is determined as an effective rectangular range.

[0067] In step S202, the storage mode of the non-zero matrix value in the first target matrix is determined according to the number of bits of the vector register and the rectangular horizontal coordinate. When the rectangular horizontal coordinate is less than half of the number of bits of the vector register, the high bits and the low bits in the vector register are used to store different matrix values respectively.

[0068] In one embodiment, the data storage of the first target matrix is further optimized. Specifically, the storage mode of the non-zero matrix value in the first target matrix is determined according to the number of bits of the vector register and the rectangular horizontal coordinate. If the rectangular horizontal coordinate is less than half of the number of bits of the vector register, the high bits and the low bits in the vector register are used to store different matrix values respectively.

[0069] Specifically, taking the rectangular horizontal coordinate as xNorm and the number of bits of the vector register as M as an example, if xNorm>M / 2, then Figure 3 ​In the range area of the shown example, the elements of each row of the E region and the B region can be placed in different N vector registers, waiting for the subsequent transpose operation of Z. If xNorm is less than or equal to M / 2, the non-zero coefficients of the E region and the B region can be managed by N / 2 registers, i.e. the upper N / 2 rows of elements are placed in the low M / 2 bits of N / 2 vector registers, and the lower N / 2 rows of elements are placed in the high M / 2 bits of N / 2 vector registers. In this storage mode, less vector registers are used for data storage, and the number of operations is reduced in the subsequent transpose operation, i.e. one vector register reading can complete the operation of two data at the same time.

[0070] For example, in the case of a maximum of 128 bits for one vector register in ARM64, under the previous condition of 128-bit limitation of the destination register, the two source registers of the SIMD multiplication operation each occupy a maximum of 64 bits, which can be understood as that src1 and src2 in "mul dst, src1, src2" can each occupy a maximum of 64 bits, so that there is no risk of exceeding 128 bits for dst. Here, src1 can be considered as a vector register for storing the relevant coefficients of the transformation matrix, and src2 can be considered as a vector register for storing the relevant coefficients of Y'. Because src2 can only occupy a maximum of 64 bits, Z = D^*Y' is further transformed into the following form:

[0071]

[0072] That is, each vector register v x is divided into v x-low and v x-high , which respectively occupy the low 64 bits and the high 64 bits. At this time, 2*8 = 16 times of vector register multiplication operations and 2*7 = 14 times of vector register addition operations are required to calculate one row of elements of the first target matrix Z.

[0073] For example, in the case of the last four column coefficient values of Y' being 0, in the operation process, v 0-high ~ v 7-high are not read, i.e. the multiplication and addition operations involving v 0-high ~ v 7-high are skipped, and the corresponding column of the first target matrix Z is directly set to zero. In addition, the values of the last two rows of Y' are both 0, so v 6-low and v 7-low are not read, i.e. the multiplication and addition operations involving v 6-low and v 7-low are skipped.

[0074] At this time, after the appropriate shift operation is performed on the elements of the first target matrix Z, Z has the following form:

[0075]

[0076] i.e.z xy may be non-zero, and the other 4 columns to the right are zero. At this time, since xNorm≤M / 2, the elements in Z can be managed with 4 vector registers, for example, after rearrangement, v x contains the elements [z 11 , z 12 , z 13 , z 14 , z 51 , z 52 , z 53 , z 54 ]. Based on the rearranged elements, the transpose operation is performed by combining the trn1 and trn2 instructions in ARM64, thereby saving the computation, for example, as follows:

[0077]

[0078] At this time, the elements in the last 4 rows of Z^ after transposition are all zero, so no setting operation is performed on v4-v7, and thus the multiplication and addition operations involving these 4 vector registers are skipped when performing the step of Q=D^*Z^ to obtain Q=D^*Z^, thereby saving the computation, for example, the matrix representation is as follows:

[0079]

[0080] Finally, the corresponding shift and transposition processing of Q is performed to obtain the decoded residual matrix X′.

[0081] In step S203, a first target matrix is obtained by performing operation on the matrix value corresponding to the effective rectangular range and the set transform matrix, and the effective rectangular range is smaller than the matrix range of the inverse quantization matrix.

[0082] In step S204, a decoded residual matrix is obtained by performing operation on the first target matrix and the transform matrix, and is used for video coding and decoding.

[0083] As known from the above, in the data storage process, the management mode of the first target matrix in the vector register is that when the rectangular horizontal coordinate is less than half of the bit number of the vector register, the high bits and the low bits in the vector register are used to store different matrix values, thereby using fewer vector registers to store data, and in the subsequent transposition operation process, the number of operations is reduced, i.e., one reading of the vector register can complete the operation of two data at the same time.

[0084] Figure 7A structural block diagram of a video coding processing device provided by an embodiment of the present application is provided, which is used to execute the video coding processing method provided by the above-mentioned embodiment, and has the function modules and beneficial effects corresponding to the execution method. As shown in the figure, the device specifically includes: a range determining module 101, a target matrix calculating module 102, and a residual matrix calculating module 103, wherein, Figure 7

[0085] The range determining module 101 is configured to determine an effective rectangular range of the inverse quantization matrix in the video coding process.

[0086] The target matrix calculating module 102 is configured to perform operation on the matrix value corresponding to the effective rectangular range and a set transform matrix to obtain a first target matrix, and the effective rectangular range is smaller than the matrix range of the inverse quantization matrix.

[0087] The residual matrix calculating module 103 is configured to perform operation on the first target matrix and the transform matrix to obtain a decoding residual matrix, which is used for video coding.

[0088] From the above-mentioned solution, in the video coding process, the effective rectangular range of the inverse quantization matrix is determined, operation is performed on the matrix value corresponding to the effective rectangular range and a set transform matrix to obtain a first target matrix, wherein the effective rectangular range is smaller than the matrix range of the inverse quantization matrix, and then operation is performed on the obtained first target matrix and the aforementioned set transform matrix to obtain a decoding residual matrix, which is used for video coding. This processing manner, when calculating the residual matrix after inverse transform, performs operation on the matrix value corresponding to the effective rectangular range by determining the effective rectangular range, and the values outside the effective rectangular range are not calculated, thereby reducing the operation amount and avoiding a large amount of redundant calculation. At the same time, the effective rectangular range is determined, which can adapt to the current algorithm related to inverse discrete cosine transform, so that the calculation amount and the algorithm implementation reach a balance.

[0089] In one possible embodiment, the range determining module 101 is configured to:

[0090] determine the effective rectangular range according to the non-zero matrix values in the inverse quantization matrix and the number of bits of the vector register.

[0091] In one possible embodiment, the range determining module 101 is configured to:

[0092] determine the maximum horizontal coordinate and the maximum vertical coordinate corresponding to the non-zero matrix values in the inverse quantization matrix;

[0093] substitute the number of bits of the vector register and the maximum horizontal coordinate into a preset formula to calculate the rectangular horizontal coordinate;

[0094] ​The range composed of the maximum longitudinal coordinate and the rectangular transverse coordinate is determined as an effective rectangular range.

[0095] In a possible embodiment, the range determining module 101 is configured to:

[0096] After determining the maximum transverse coordinate and the maximum longitudinal coordinate corresponding to the non-zero matrix value in the inverse quantization matrix, the coordinate value of the maximum longitudinal coordinate is adjusted based on the set adjustment coefficient to obtain a rectangular longitudinal coordinate.

[0097] The range composed of the rectangular longitudinal coordinate and the rectangular transverse coordinate is determined as an effective rectangular range.

[0098] In a possible embodiment, the target matrix calculating module 102 is configured to:

[0099] Based on the effective rectangular range, a zero setting region and a non-zero setting region of a first target matrix for calculation are determined, and the non-zero setting region includes an operation sub-region and a skip sub-region.

[0100] The matrix value of the zero setting region of the first target matrix is set to zero, the matrix value of the operation sub-region is obtained by performing operation on the matrix value corresponding to the effective rectangular range and a set transformation matrix, and the operation of the skip sub-region is skipped.

[0101] In a possible embodiment, the target matrix calculating module 102 is configured to:

[0102] After the first target matrix is obtained by performing operation on the matrix value corresponding to the effective rectangular range and the set transformation matrix, the storage mode of the non-zero matrix value in the first target matrix is determined according to the number of bits of the vector register and the rectangular transverse coordinate.

[0103] When the rectangular transverse coordinate is less than half of the number of bits of the vector register, the high bits and the low bits in the vector register are used to store different matrix values respectively.

[0104] In a possible embodiment, the residual matrix calculating module 103 is configured to:

[0105] The matrix value is subjected to matrix multiplication operation with a set transformation matrix.

[0106] The operation based on the first target matrix and the transformation matrix includes:

[0107] The first target matrix is subjected to matrix multiplication operation with the transformation matrix.

[0108] In a possible embodiment, the residual matrix calculating module 103 is configured to:

[0109] The first target matrix and the transformation matrix are transposed, and the transposed first target matrix and the transformation matrix are multiplied. During the operation, the operation of the zero value region of the transposed first target matrix is ​​skipped.

[0110] The results of the operation are shifted and transposed.

[0111] Figure 8 This is a schematic diagram of the structure of a video encoding and decoding processing device provided in an embodiment of this application, as shown below. Figure 8 As shown, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device can be one or more. Figure 8 Taking a processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected via a bus or other means. Figure 8 Taking a bus connection as an example, the memory 202, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the video encoding and decoding processing method in this embodiment. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 302, thereby implementing the aforementioned video encoding and decoding processing method. The input device 203 can be used to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display screen or other display device.

[0112] This application also provides a non-volatile storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a video encoding / decoding processing method described in the above embodiments, comprising:

[0113] During video encoding and decoding, the effective rectangular range of the inverse quantization matrix is ​​determined;

[0114] The first target matrix is ​​obtained by performing calculations based on the matrix value corresponding to the effective rectangular range and the set transformation matrix, wherein the effective rectangular range is smaller than the matrix range of the inverse quantization matrix;

[0115] The decoding residual matrix is ​​obtained by performing operations on the first target matrix and the transformation matrix, which is then used for video encoding and decoding.

[0116] It is worth noting that in the above-mentioned embodiments of the video coding processing apparatus, each unit and module included is only divided according to the function logic, but is not limited to the above-mentioned division, as long as the corresponding function can be realized; in addition, the specific name of each functional unit is only for the convenience of mutual differentiation, and is not used to limit the protection scope of the embodiments of the present application.

[0117] In some possible implementation, each aspect of the method provided by the present application can also be implemented in the form of a program product, which includes program codes for causing a computer device to perform the steps of the method according to various exemplary embodiments of the present application described above in the specification when the program product runs on the computer device, for example, the computer device can perform the video coding processing method described in the embodiments of the present application. The program product can be realized by any combination of one or more readable media.

Claims

1. A method of video coding processing, characterized by, The application relates to a method for determining an effective rectangular range of a dequantization matrix in a video coding process. The method comprises the following steps: determining the effective rectangular range of the dequantization matrix according to non-zero matrix values in the dequantization matrix and the number of bits of a vector register; performing operation on the matrix values corresponding to the effective rectangular range and a set transform matrix to obtain a first target matrix, wherein the effective rectangular range is smaller than the matrix range of the dequantization matrix; performing operation on the first target matrix and the transform matrix to obtain a decoded residual matrix, so as to perform video coding.

2. The video coding process method of claim 1, wherein, The method for determining the effective rectangular range according to the non-zero matrix values in the dequantization matrix and the number of bits of the vector register comprises the following steps: determining the maximum horizontal coordinate and the maximum vertical coordinate corresponding to the non-zero matrix values in the dequantization matrix; calculating the rectangular horizontal coordinate by substituting the number of bits of the vector register and the maximum horizontal coordinate into a preset formula; determining the range composed of the maximum vertical coordinate and the rectangular horizontal coordinate as the effective rectangular range.

3. The video coding process of claim 2, wherein, After the maximum horizontal coordinate and the maximum vertical coordinate corresponding to the non-zero matrix values in the dequantization matrix are determined, the method further comprises the following steps: adjusting the coordinate value of the maximum vertical coordinate based on a set adjustment coefficient to obtain a rectangular vertical coordinate; correspondingly, the method for determining the effective rectangular range by substituting the maximum vertical coordinate and the rectangular horizontal coordinate comprises the following steps: determining the range composed of the rectangular vertical coordinate and the rectangular horizontal coordinate as the effective rectangular range.

4. The video coding process of claim 1, wherein, The method for performing operation on the matrix values corresponding to the effective rectangular range and the set transform matrix to obtain the first target matrix comprises the following steps: determining the zero setting area and the non-zero area of the first target matrix for calculation based on the effective rectangular range, wherein the non-zero area comprises a calculation subarea and a skipping subarea; setting the matrix values of the zero setting area of the first target matrix to zero, performing operation on the matrix values corresponding to the effective rectangular range and the set transform matrix to obtain the matrix values of the calculation subarea, and skipping the operation of the skipping subarea.

5. The video coding process of claim 2, wherein, After the operation on the matrix values corresponding to the effective rectangular range and the set transform matrix to obtain the first target matrix is performed, the method further comprises the following steps: determining the storage mode of the non-zero matrix values in the first target matrix according to the number of bits of the vector register and the rectangular horizontal coordinate; when the rectangular horizontal coordinate is smaller than half of the number of bits of the vector register, storing different matrix values in the high bits and the low bits of the vector register respectively.

6. The video coding process of any of claims 1-5, wherein, The method for performing operation on the matrix values and the set transform matrix comprises the following steps: performing matrix multiplication operation on the matrix values and the set transform matrix. The method for performing operation on the first target matrix and the transform matrix comprises the following steps: performing matrix multiplication operation on the first target matrix and the transform matrix.

7. The video coding process of any of claims 1-5, wherein, The method for performing operation on the first target matrix and the transform matrix comprises the following steps: performing transposition operation on the first target matrix and the transform matrix, performing matrix multiplication operation on the transposed first target matrix and the transform matrix, wherein the operation of the zero value area of the transposed first target matrix is skipped in the operation process; performing shift and transposition processing on the operation result.

8. A video codec processing apparatus, characterized by The application further relates to a video coding device. The range determining module is configured to determine an effective rectangular range of the inverse quantization matrix in a video coding process, and is specifically configured to determine the effective rectangular range according to non-zero matrix values in the inverse quantization matrix and a bit number of a vector register. The target matrix calculating module is configured to perform operation on the matrix values corresponding to the effective rectangular range and a set transform matrix to obtain a first target matrix, and the effective rectangular range is smaller than a matrix range of the inverse quantization matrix. The residual matrix calculating module is configured to perform operation on the first target matrix and the transform matrix to obtain a decoded residual matrix, which is used for video coding.

9. A video codec processing device, the device comprising: One or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the video coding processing method in any one of claims 1-7.

10. A non-transitory storage medium storing computer-executable instructions for performing the video coding processing method in any one of claims 1-7 when executed by a computer processor.

11. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the video coding processing method in any one of claims 1-7.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN113592966A