Video encoding processing method, apparatus, device and storage medium

CN115767097BActive Publication Date: 2026-09-11BIGO TECH PTE LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211275675.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-18
Publication Date
2026-09-11
Estimated Expiration
2042-10-18

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种视频编码处理方法、装置、设备及存储介质,解决了相关技术中,视频编码处理时,运算量大的问题,针对相对平坦的编码块,可以有效减少运算量,提高了整体的视频编码处理效率

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115767097B_ABST
    Figure CN115767097B_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 whether a to-be-coded block is a flat block in a video coding process; obtaining a first coding matrix corresponding to the to-be-coded block and a second coding matrix corresponding to each of at least two prediction blocks associated with the to-be-coded block in the case that the to-be-coded block is a flat block; calculating a first eigenvalue of the first coding matrix and a second eigenvalue of each of the second coding matrices respectively; and determining an absolute residual cost of each of the prediction blocks based on a difference between the first eigenvalue and each of the second eigenvalues, so as to be used for video coding. The scheme can effectively reduce the operation amount in the video coding process and improve the overall video coding processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video processing technology, and in particular to a video encoding processing method, apparatus, device, and storage medium. Background Technology

[0002] Video coding achieves video compression by reducing spatial, temporal, visual, and coding redundancy in the original video. The process of reducing spatial and temporal redundancy can be understood as finding the most similar matching region to the current block to be encoded within spatially adjacent regions or temporally adjacent frames. This decision-making process roughly includes: first, assuming the block to be encoded is an intra-frame coded block, and determining the optimal intra-frame coded mode from among many options; second, assuming the block to be encoded is an inter-frame coded block, and finding the best match within a certain range of a reference frame, i.e., determining the optimal motion vector from among many motion vectors; finally, considering the rate-distortion costs of intra-frame and inter-frame modes, selecting the one with the lower cost as the final decision result.

[0003] In related technologies, to reduce computational load, rate-distortion costs are not calculated for each candidate prediction block during video coding decisions. The decision-making process is typically divided into two steps: coarse selection and fine selection. In the coarse selection step, the difference between the current block to be encoded and the prediction block is calculated, such as calculating the absolute residual cost in the transform domain. However, the calculation of the absolute residual cost involves numerous matrix multiplication operations involving addition and subtraction of matrix values, resulting in a still relatively high overall computational load for video coding. Summary of the Invention

[0004] This application provides a video encoding processing method, apparatus, device, and storage medium, which solves the problem of high computational load in video encoding processing in related technologies. For relatively flat encoding blocks, it can effectively reduce the computational load and improve the overall video encoding processing efficiency.

[0005] In a first aspect, embodiments of this application provide a video encoding processing method, the method comprising:

[0006] During video encoding, it is determined whether the block to be encoded is a flat block;

[0007] In the case that the block to be encoded is a flat block, obtain the first encoding matrix corresponding to the block to be encoded, and the second encoding matrix corresponding to each of the at least two prediction blocks associated with the block to be encoded;

[0008] Calculate the first eigenvalue of the first encoding matrix and the second eigenvalue of each of the second encoding matrices;

[0009] The absolute residual cost of each prediction block is determined based on the difference between the first feature value and each of the second feature values ​​for use in video coding.

[0010] Secondly, embodiments of this application also provide a video encoding processing apparatus, including:

[0011] The flatness determination module is configured to determine whether the block to be encoded is a flat block during the video encoding process.

[0012] The matrix acquisition module is configured to, when the block to be encoded is a flat block, acquire a first encoding matrix corresponding to the block to be encoded, and a second encoding matrix corresponding to each of at least two prediction blocks associated with the block to be encoded.

[0013] The eigenvalue calculation module is configured to calculate the first eigenvalue of the first encoding matrix and the second eigenvalue of each of the second encoding matrices.

[0014] The residual calculation module is configured to determine the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values, for use in video coding.

[0015] Thirdly, embodiments of this application also provide a video encoding processing apparatus, the apparatus comprising:

[0016] One or more processors;

[0017] Storage device for storing one or more programs.

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the video encoding processing method described in the embodiments of this application.

[0019] Fourthly, embodiments of this application also provide a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the video encoding processing method described in embodiments of this application.

[0020] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads from the computer-readable storage medium and executes the computer program, causing the device to perform the video encoding processing method described in embodiments of this application.

[0021] In this embodiment of the application, during video encoding, it is first determined whether the block to be encoded is a flat block. If it is a flat block, the first encoding matrix corresponding to the block to be encoded and the second encoding matrix corresponding to each of the at least two prediction blocks associated with the block to be encoded are obtained. After calculating the first eigenvalue of the first encoding matrix and the second eigenvalue of each second encoding matrix, the absolute residual cost of each prediction block is determined based on the difference between the first eigenvalue and each second eigenvalue for use in video encoding. This method of calculating the absolute residual cost only requires the difference of eigenvalues ​​and does not require complex calculations, which can save a lot of computation for video encoding of flat blocks, while ensuring the compression efficiency of video encoding. Attached Figure Description

[0022] Figure 1 A flowchart illustrating a video encoding processing method provided in this application embodiment;

[0023] Figure 2 A flowchart illustrating a method for determining whether a block to be encoded is a flat block, provided in an embodiment of this application;

[0024] Figure 3 A flowchart illustrating a method for determining the flatness of a block to be encoded, provided as an embodiment of this application;

[0025] Figure 4 A flowchart illustrating a method for determining an coded reference block, provided in an embodiment of this application;

[0026] Figure 5 A structural block diagram of a video encoding processing apparatus provided in an embodiment of this application;

[0027] Figure 6 This is a schematic diagram of the structure of a video encoding processing device provided in an embodiment of this application. Detailed Implementation

[0028] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.

[0029] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0030] The video encoding processing method provided in this application can be applied to video encoding scenarios. During video encoding, a suitable prediction block needs to be found for the block to be encoded, so that video encoding of the current block can be performed based on the prediction block. The higher the correlation between the prediction block and the block to be encoded, the less temporal and spatial redundancy occurs during encoding, and the higher the encoding compression ratio. When selecting the prediction block for the block to be encoded, using the video encoding processing method provided in this application can effectively reduce the computational complexity during decision-making and significantly reduce the amount of data processing.

[0031] Figure 1 A flowchart of a video encoding processing method provided in this application embodiment specifically includes the following steps:

[0032] Step S101: During the video encoding process, determine whether the block to be encoded is a flat block.

[0033] During video encoding, it is necessary to determine the prediction block with the lowest encoding cost among multiple prediction blocks corresponding to the current block to be encoded, so as to perform video encoding for the current block. In one embodiment, it is determined whether the block to be encoded is a flat block. The characteristic of a flat block is that each value in the matrix of the current block to be encoded is the same or similar. If each matrix value in the residual matrix is ​​the same, it is determined to be the flattest.

[0034] Optional, such as Figure 2 As shown, Figure 2 A flowchart of a method for determining whether a block to be encoded is a flat block is provided in an embodiment of this application. It illustrates a specific method for determining a flat block, including:

[0035] Step S1011: Calculate the average pixel value of the block to be encoded based on the number of pixels in the block to be encoded and the pixel value of each pixel.

[0036] For example, the number of pixels in the block to be encoded is denoted as S, and the pixel value of each pixel is denoted as a. ijLet A be the average pixel value of the block to be encoded. The calculation method for A is as follows:

[0037]

[0038] Step S1012: Calculate the flatness estimation parameters based on the average pixel value and the pixel value of each pixel.

[0039] For example, the flatness estimation parameter is denoted as V. After obtaining the pixel average value A, the flatness estimation parameter V is calculated based on the pixel average value A and the pixel value of each pixel. An exemplary calculation method is as follows:

[0040] V=∑a ij *a ij -A*(∑a ij )

[0041] Step S1013: Substitute the flatness estimation parameter into the preset flatness calculation formula to obtain the flatness value of the block to be encoded, and compare the flatness value with the preset flatness threshold to determine whether the block to be encoded is a flat block.

[0042] For example, after calculating the flatness estimation parameter V, it is substituted into a preset flatness calculation formula to obtain the flatness value of the block to be encoded. For example, the flatness value of the block to be encoded is denoted as F. V The preset flatness calculation formula is as follows:

[0043] F V =V / S / A 2

[0044] Therefore, after calculating the flatness value of the block to be encoded, it can be determined whether the block to be encoded is a flat block based on the flatness value.

[0045] In another embodiment, if the flatness estimation parameter V has been calculated in the preprocessing stage of the encoder, the flatness estimation parameter calculated in the preprocessing stage can be directly obtained and substituted into the flatness calculation to obtain the flatness value of the block to be encoded.

[0046] In one embodiment, when determining whether a block is flat based on its flatness value, the flatness value is compared with a preset flatness threshold to determine whether the block is flat. Optionally, a block may be considered flat if its flatness value is less than the set flatness threshold, and otherwise considered non-flat. Optionally, the original video encoding process can be performed for non-flat blocks.

[0047] In one embodiment, the determination of whether the block to be encoded is a flat block is further refined. The flatness of the flat block is further subdivided, meaning that the flatness value of the block to be encoded can be used to determine whether it is a first-flat block, a second-flat block, or a non-flat block. Specifically, Figure 3 A flowchart of a method for determining the flatness of a block to be encoded, provided in an embodiment of this application, specifically includes:

[0048] Step S1014: Compare the flatness value of the block to be encoded with the first flatness threshold. If the flatness value is less than the first flatness threshold, determine the block to be encoded as the first flat block.

[0049] Step S1015: If the flatness value is not less than the first flatness threshold, compare the flatness value with the second flatness threshold. If the flatness value is less than the second flatness threshold, determine the block to be encoded as the second flatness block.

[0050] The first flatness threshold mentioned above is lower than the second flatness threshold. The specific values ​​of the first and second flatness thresholds can be set according to actual conditions. That is, the flatness represented by the first flat block is higher than that of the second flat block. Subsequent processing can be applied differently depending on whether the block to be encoded is the first or the second flat block, in order to optimize the video coding method.

[0051] For example, the following three 8x8 luminance blocks are given as examples to evaluate whether they are flat blocks, and if so, whether they are the first or the second flat block. The following are three different 8x8 blocks, denoted as E. A E B E C ,in,

[0052]

[0053]

[0054]

[0055] Using the calculation methods provided in the examples above, V can be calculated respectively. A =0, V B =64, V C =21824, Let TF be the first flatness threshold in the example above. V1 Its value is 0.0001; the second flatness threshold is denoted as TF. V2Taking a value of 0.001 as an example, a comparison shows that... Then E A The block was determined to be the first flat block; and Then E B The block was determined to be the second flat block. Then determine E C It is a non-flat block.

[0056] Step S102: If the block to be encoded is a flat block, obtain the first encoding matrix corresponding to the block to be encoded, and the second encoding matrix corresponding to each of the at least two prediction blocks associated with the block to be encoded.

[0057] For video coding, the block to be coded and the prediction block can be represented using coding matrices. In one embodiment, if the block to be coded is determined to be a flat block, the matrix corresponding to the block to be coded is obtained, denoted here as the first coding matrix, and the matrix corresponding to the prediction block associated with the block to be coded is obtained, denoted here as the second coding matrix. The prediction blocks associated with the block to be coded include multiple blocks, and the prediction block with the lowest final rate-distortion cost is selected as the coding reference block for video coding of the block to be coded.

[0058] Step S103: Calculate the first eigenvalue of the first encoding matrix and the second eigenvalue of each of the second encoding matrices.

[0059] In one embodiment, after obtaining the first coding matrix corresponding to the block to be coded and the second coding matrices of multiple prediction blocks, the feature value of each coding matrix is ​​calculated, and the difference of the feature values ​​is used as an indicator to evaluate the difference between the block to be coded and the prediction blocks in the video coding process.

[0060] Optionally, one way to calculate the eigenvalues ​​of the coding matrix is ​​to accumulate each matrix value in the coding matrix, and then perform a shift operation to obtain the corresponding eigenvalue. This eigenvalue can be the value representing the top-left corner of the coding matrix after the Hadamard transform.

[0061] For example, consider a 4x4 matrix X′, assuming X′ is as follows:

[0062]

[0063] The matrix Y after the Hadamard transformation is Y = H * X′ * H, where the Hadamard transformation matrix H is exemplified as follows:

[0064]

[0065] The following can be calculated using the formula Y = H * X′ * H:

[0066]

[0067] Here, the eigenvalue of the encoding matrix X′ represents the value of the top-left corner of the matrix after the Hadamard transform, which is 20 in this case. This eigenvalue reflects, to some extent, the trend of SATD (Sum of Absolute Transformed Difference).

[0068] Accordingly, the specific calculation process of this eigenvalue can be replaced by summing each matrix value in the original encoding matrix and then shifting it accordingly. Optionally, the shifting operation can be performed as follows: obtaining the set Hadamard transform matrix, determining the shift parameters based on the Hadamard transform matrix, and performing the shift operation based on the shift parameters to obtain the corresponding first and second eigenvalues. Taking the above example, the Hadamard transform matrix is ​​denoted as:

[0069]

[0070] The square of the reciprocal of the coefficients of the Hadamard transformation matrix is ​​used as the shift parameter (4 in this example) to shift the accumulated value, that is, the accumulated value is divided by 4 to obtain the corresponding eigenvalue.

[0071] For example, consider calculating the eigenvalues ​​of the following matrix:

[0072]

[0073] The sum of each matrix value in matrix X″ is 79. After shifting by the shift parameter of 4 as described above, the corresponding eigenvalue is calculated to be 19.75. Specifically, the above eigenvalue calculation method is used for the coding matrix corresponding to the block to be coded and each prediction block to obtain the first eigenvalue and multiple second eigenvalues.

[0074] Step S104: Determine the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values, for use in video coding.

[0075] In one embodiment, during the calculation of the difference between the block to be encoded and the predicted block, taking the first coding matrix corresponding to the block to be encoded as E and the second coding matrix corresponding to the predicted block as P as an example, the matrix after Hadamard transform is Y = H*X*H, where the residual matrix X = EP. Then, by transforming the formula, we can get Y = H*X*H = H*(EP)*H = H*E*HH*P*H. Here, H*E*H is represented by the first eigenvalue corresponding to the block to be encoded, and H*P*H is represented by the second eigenvalue corresponding to the predicted block. That is, the difference between the block to be encoded and the predicted block is represented by the difference between the first eigenvalue and the second eigenvalue. Further, based on the difference between the first eigenvalue and each second eigenvalue, the absolute residual cost of each predicted block is calculated. The subsequent video coding decision is made based on the absolute residual cost to finally complete the video coding of the block to be encoded.

[0076] In one embodiment, during video encoding, when the most matching predicted block to be encoded is determined, the RDO (Rate Distortion Optimization) of each predicted block is calculated. The RDO for a candidate predicted block is calculated as follows:

[0077] C RDO =D + λ * bits

[0078] This process requires calculating the distortion D and the actual number of bits consumed. Calculating the distortion D necessitates completing the entire reconstruction process and calculating the SSD (Sum of Squired Difference) between the reconstructed block and the current block to be encoded. Obtaining the bits requires entropy coding, making this computationally intensive. To reduce computational complexity, the decision-making process is divided into coarse and fine selection. In the fine selection process, the aforementioned RDO calculation is performed on a smaller number of candidate prediction blocks. In the coarse selection process, a simpler method is used to calculate the distortion D, considering only the difference between the block to be encoded and the prediction block. The parameter representing this difference can be SATD or SAD (Sum of Absolute Difference). The bits are calculated using estimation, and correspondingly, λ differs from the value used in the actual RDO cost calculation.

[0079] The calculation method for SATD cost is as follows:

[0080] C SATD =SATD+λ′*bits′=∑abs(H*x*H)+λ′*bits′

[0081] The specific values ​​of bits′ and λ′ can be determined using empirical values. In the calculation of H*X*H, for example, an 8x8 dimensional Hadamard transformation matrix H is as follows:

[0082]

[0083] Therefore, calculating H*X*H requires certain addition and subtraction operations on the elements of X, followed by a shift operation. However, when the block to be encoded is a flat block, the decision-making process for each candidate prediction block—first obtaining X, then performing the Hadamard transform, and finally executing subsequent processes—fails to fully utilize the features of the flat block. In this case, the calculation of SATD can be replaced by the difference between the first feature value of the block to be encoded and the second feature value of the prediction block, and then substituted into the aforementioned C. SATD The formula is used to calculate the absolute residual cost C. SATD In the calculation of eigenvalues, only accumulation and shift operations are used, which can save a lot of computation.

[0084] As described above, during video encoding, it is first determined whether the block to be encoded is a flat block. If it is a flat block, the first encoding matrix corresponding to the block to be encoded and the second encoding matrices corresponding to at least two prediction blocks associated with the block to be encoded are obtained. After calculating the first eigenvalue of the first encoding matrix and the second eigenvalue of each second encoding matrix, the absolute residual cost of each prediction block is determined based on the difference between the first eigenvalue and each second eigenvalue for use in video encoding. This method of calculating the absolute residual cost only requires the difference of eigenvalues ​​and does not require complex calculations, which can save a lot of computation for video encoding of flat blocks while ensuring the compression efficiency of video encoding.

[0085] Based on the above technical solution, after determining the absolute residual cost of each predicted block based on the difference between the first feature value and each second feature value, the method for determining the final encoded reference block is further included, such as... Figure 4 As shown, Figure 4 A flowchart of a method for determining an coded reference block provided in this application embodiment specifically includes:

[0086] Step S201: During the video encoding process, determine whether the block to be encoded is a flat block.

[0087] Step S202: If the block to be encoded is a flat block, obtain the first encoding matrix corresponding to the block to be encoded, and the second encoding matrix corresponding to each of the at least two prediction blocks associated with the block to be encoded.

[0088] Step S203: Calculate the first eigenvalue of the first encoding matrix and the second eigenvalue of each of the second encoding matrices.

[0089] Step S204: Determine the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values, for use in video coding.

[0090] Step S205: Based on the absolute residual cost, select a first preset number of prediction blocks, calculate the rate-distortion cost of the first preset number of prediction blocks and the block to be encoded, determine the encoding reference block in the first preset number of prediction blocks according to the rate-distortion cost, and perform video encoding of the block to be encoded based on the encoding reference block.

[0091] For example, after calculating the absolute residual cost between each candidate prediction block and the block to be encoded, the prediction blocks with the lowest cost are sorted and selected from a first preset number of prediction blocks. For example, 5 prediction blocks are selected from 35 candidate prediction blocks. The rate-distortion cost of the 5 prediction blocks and the block to be encoded is calculated. Based on the calculation results, the prediction block with the lowest cost is selected as the coding reference block, and the video coding of the block to be encoded is performed based on the coding reference block.

[0092] As can be seen from the above, in the video coding process, for flat coding blocks, the difference between the eigenvalues ​​of the coding matrices of the block to be coded and the predicted block is used as the absolute residual cost to perform coarse screening of the predicted blocks. For the selected predicted blocks, a more refined rate-distortion cost is then calculated, which can significantly reduce the amount of computation while ensuring the video coding compression efficiency.

[0093] In one embodiment, the absolute residual cost is further optimized based on the different flatness levels of the block to be encoded. Using the aforementioned description of the first and second flat blocks, the absolute residual cost calculation process for the second flat block, which has a slightly lower flatness, can be as follows: When the block to be encoded is the second flat block, a second preset number of prediction blocks are selected based on the difference between the first feature value and each second feature value. The absolute residual cost between each prediction block and the block to be encoded is then calculated. For example, taking a prediction block containing 35 candidates as an example, the absolute residual cost is calculated using the feature value difference method, then sorted, and a second preset number (e.g., 10) of prediction blocks with the lowest cost are selected. For these 10 prediction blocks, the inherent SATD calculation method, i.e., using the Hadamard transform matrix, is used to calculate the absolute residual cost. Subsequently, the first preset number (e.g., 5) of prediction blocks with the lowest cost are sorted and a fine-grained RDO cost calculation is performed to obtain the encoding reference block. This further optimizes the prediction block selection process, ensuring a more accurate matching process for candidate prediction blocks and thus guaranteeing the video compression rate.

[0094] In another embodiment, to avoid saving a second preset number of prediction blocks, when performing a second preset number of filtering calculations on the block to be encoded and the prediction blocks, after calculating the difference between the feature values ​​of the block to be encoded and the prediction blocks, the Hadamard transform method of STAD is calculated simultaneously. Based on the absolute residual cost obtained from the calculation of the Hadamard transform method, a second preset number of prediction blocks are obtained by filtering, and the subsequent RDO cost is calculated.

[0095] Figure 5 This is a structural block diagram of a video encoding processing apparatus provided in an embodiment of this application. The apparatus is used to execute the video encoding processing method provided in the above embodiments, and has corresponding functional modules and beneficial effects for executing the method. Figure 5 As shown, the device specifically includes: a flatness determination module 101, a matrix acquisition module 102, an eigenvalue calculation module 103, and a residual calculation module 104, wherein,

[0096] Flatness determination module 101 is configured to determine whether the block to be encoded is a flat block during the video encoding process;

[0097] The matrix acquisition module 102 is configured to acquire, when the block to be encoded is a flat block, a first encoding matrix corresponding to the block to be encoded, and a second encoding matrix corresponding to each of at least two prediction blocks associated with the block to be encoded.

[0098] The feature value calculation module 103 is configured to calculate the first feature value of the first encoding matrix and the second feature value of each of the second encoding matrices respectively;

[0099] The residual calculation module 104 is configured to determine the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values, for use in video coding.

[0100] As can be seen from the above scheme, during video encoding, it is first determined whether the block to be encoded is a flat block. If it is a flat block, the first encoding matrix corresponding to the block to be encoded and the second encoding matrix corresponding to each of the at least two prediction blocks associated with the block to be encoded are obtained. After calculating the first eigenvalue of the first encoding matrix and the second eigenvalue of each second encoding matrix, the absolute residual cost of each prediction block is determined based on the difference between the first eigenvalue and each second eigenvalue for use in video encoding. This method of calculating the absolute residual cost only requires the difference of eigenvalues ​​and does not require complex multiplication operations, which can save a lot of computation for video encoding of flat blocks, while ensuring the compression efficiency of video encoding.

[0101] In one possible embodiment, the flatness determination module 101 is configured as follows:

[0102] The average pixel value of the block to be encoded is calculated based on the number of pixels in the block and the pixel value of each pixel.

[0103] The flatness estimation parameter is calculated based on the average pixel value and the pixel value of each pixel.

[0104] The flatness estimation parameters are substituted into the preset flatness calculation formula to obtain the flatness value of the block to be encoded. The flatness value is then compared with the preset flatness threshold to determine whether the block to be encoded is a flat block.

[0105] In one possible embodiment, the flatness determination module 101 is configured as follows:

[0106] The flatness value is compared with a first flatness threshold. If the flatness value is less than the first flatness threshold, the block to be encoded is determined to be a first flat block.

[0107] If the flatness value is not less than the first flatness threshold, the flatness value is compared with the second flatness threshold. If the flatness value is less than the second flatness threshold, the block to be encoded is determined to be a second flat block, and the first flatness threshold is less than the second flatness threshold.

[0108] In one possible embodiment, the feature value calculation module 103 is configured as follows:

[0109] After accumulating the matrix values ​​in the first encoding matrix and each of the second encoding matrices, a shift operation is performed to obtain the corresponding first eigenvalue and second eigenvalue.

[0110] In one possible embodiment, the feature value calculation module 103 is configured as follows:

[0111] Obtain the set Hadamard transform matrix, and determine the shift parameters based on the Hadamard transform matrix;

[0112] The first and second feature values ​​are obtained by performing a shift operation based on the shift parameters.

[0113] In one possible embodiment, the residual calculation module 104 is configured as follows:

[0114] The absolute residual cost of each prediction block is calculated by replacing the absolute residual value in the absolute residual cost with the difference between the first feature value and each of the second feature values.

[0115] In one possible embodiment, the device further includes an encoding module configured to:

[0116] After determining the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values, a first preset number of prediction blocks are selected based on the absolute residual cost;

[0117] Calculate the rate-distortion cost of the first preset number of prediction blocks and the block to be encoded, and determine the encoding reference block in the first preset number of prediction blocks based on the rate-distortion cost;

[0118] The video encoding of the block to be encoded is performed based on the encoding reference block.

[0119] Figure 6 This is a schematic diagram of the structure of a video encoding processing device provided in an embodiment of this application, as shown below. Figure 6 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 6 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 6 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 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 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.

[0120] 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 processing method described in the above embodiments, comprising:

[0121] During video encoding, it is determined whether the block to be encoded is a flat block;

[0122] In the case that the block to be encoded is a flat block, obtain the first encoding matrix corresponding to the block to be encoded, and the second encoding matrix corresponding to each of the at least two prediction blocks associated with the block to be encoded;

[0123] Calculate the first eigenvalue of the first encoding matrix and the second eigenvalue of each of the second encoding matrices;

[0124] The absolute residual cost of each prediction block is determined based on the difference between the first feature value and each of the second feature values ​​for use in video coding.

[0125] It is worth noting that in the above-described embodiments of the video encoding processing apparatus, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this application.

[0126] In some possible implementations, various aspects of the methods provided in this application can also be implemented as a program product comprising program code that, when run on a computer device, causes the computer device to perform the steps of the methods according to the various exemplary embodiments of this application described above. For example, the computer device can perform the video encoding processing method described in the embodiments of this application. The program product can be implemented using any combination of one or more readable media.

Claims

1. A method of video encoding processing, characterized by, include: During video encoding, it is determined whether the block to be encoded is a flat block; In the case that the block to be encoded is a flat block, obtain the first encoding matrix corresponding to the block to be encoded, and the second encoding matrix corresponding to each of the at least two prediction blocks associated with the block to be encoded; The first eigenvalue of the first encoding matrix and the second eigenvalue of each of the second encoding matrices are calculated respectively, including: summing the matrix values ​​in the first encoding matrix and then performing a shift operation to obtain the corresponding first eigenvalue; summing the matrix values ​​in each of the second encoding matrices and then performing a shift operation to obtain the corresponding second eigenvalue. The absolute residual cost of each prediction block is determined based on the difference between the first feature value and each of the second feature values ​​for use in video coding.

2. The video encoding processing method according to claim 1, characterized in that, Determining whether the block to be encoded is a flat block includes: The average pixel value of the block to be encoded is calculated based on the number of pixels in the block and the pixel value of each pixel. The flatness estimation parameter is calculated based on the average pixel value and the pixel value of each pixel. The flatness estimation parameters are substituted into the preset flatness calculation formula to obtain the flatness value of the block to be encoded. The flatness value is then compared with the preset flatness threshold to determine whether the block to be encoded is a flat block.

3. The video encoding processing method according to claim 2, characterized in that, The step of comparing the flatness value with a preset flatness threshold to determine whether the block to be encoded is a flat block includes: The flatness value is compared with a first flatness threshold. If the flatness value is less than the first flatness threshold, the block to be encoded is determined to be a first flat block. If the flatness value is not less than the first flatness threshold, the flatness value is compared with the second flatness threshold. If the flatness value is less than the second flatness threshold, the block to be encoded is determined to be a second flat block, and the first flatness threshold is less than the second flatness threshold.

4. The video encoding processing method according to claim 1, characterized in that, The step of performing shift operations to obtain the corresponding first and second feature values ​​includes: Obtain the set Hadamard transform matrix, and determine the shift parameters based on the Hadamard transform matrix; The first and second feature values ​​are obtained by performing a shift operation based on the shift parameters.

5. The video encoding processing method according to any one of claims 1-4, characterized in that, The step of determining the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values ​​includes: The absolute residual cost of each prediction block is calculated by replacing the absolute residual value in the absolute residual cost with the difference between the first feature value and each of the second feature values.

6. The video encoding processing method according to any one of claims 1-4, characterized in that, After determining the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values, the process includes: A first preset number of prediction blocks are selected based on the absolute residual cost; Calculate the rate-distortion cost of the first preset number of prediction blocks and the block to be encoded, and determine the encoding reference block in the first preset number of prediction blocks based on the rate-distortion cost; The video encoding of the block to be encoded is performed based on the encoding reference block.

7. The video encoding processing method according to claim 3, characterized in that, The step of determining the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values ​​includes: In the case that the block to be encoded is a second flat block, a second preset number of prediction blocks are selected based on the difference between the first feature value and each of the second feature values; Calculate the absolute residual cost between each prediction block and the block to be encoded in the second preset number of prediction blocks.

8. A video encoding processing apparatus, characterized in that, include: The flatness determination module is configured to determine whether the block to be encoded is a flat block during the video encoding process. The matrix acquisition module is configured to, when the block to be encoded is a flat block, acquire a first encoding matrix corresponding to the block to be encoded, and a second encoding matrix corresponding to each of at least two prediction blocks associated with the block to be encoded. The eigenvalue calculation module is configured to accumulate the matrix values ​​in the first encoding matrix and then perform a shift operation to obtain the corresponding first eigenvalue. After accumulating the matrix values ​​in each of the second encoding matrices, a shift operation is performed to obtain the corresponding second feature value; The residual calculation module is configured to determine the absolute residual cost of each prediction block based on the difference between the first feature value and each of the second feature values, for use in video encoding.

9. A video encoding processing apparatus, the apparatus comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the video encoding processing method according to any one of claims 1-7.

10. A non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the video encoding processing method according to any one of claims 1-7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the video encoding processing method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for calculating absolute transformation difference sum in video coding

    CN111836050A

  • Video system

    US20080181311A1