Method and device for determining weight of coding unit prediction block

By acquiring and filtering the weight information of the video encoding unit, the number of weight traversals is reduced, and the problem of complex and time-consuming weight determination process in the prior art is solved, the video encoding efficiency is improved and the processor power consumption is reduced.

CN115002486BActive Publication Date: 2025-06-03BIGO TECH PTE LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210590038.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-06-03
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

When determining the weight of the video encoding unit prediction block, the calculation complexity is high and the time consumed increases, resulting in low overall encoding efficiency.

Method used

By obtaining the weight information of the determined encoding unit, where the weight information includes different weights and corresponding accuracy scores, when determining the weight of the prediction block of the current encoding unit, whether the weight information is available is determined based on the accuracy score, and weight traversal is performed in response to availability to determine the optimal weight result. The number of weights recorded in the weight information is smaller than the number of initial traversal weights.

Benefits of technology

It significantly improves video encoding speed, has a low compression loss rate, and reduces processor computing power consumption while increasing very little memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115002486B_ABST
    Figure CN115002486B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a method and apparatus for determining weights of prediction blocks of coding units. The method includes: obtaining weight information of coding units that has been determined, where the weight information includes different weights and corresponding accuracy scores; when determining the weights of prediction blocks of a current coding unit, determining whether the weight information is available according to the accuracy scores; in response to a judgment result that the weight information is available, traversing the weights recorded in the weight information to determine an optimal weight result, where the number of weights recorded in the weight information is less than the number of weights for initial traversal. This solution significantly improves the video coding speed, has a low compression loss rate, and reduces the processor operation power consumption with a very small increase in memory usage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of video coding, and in particular, to a method and device for determining weights of prediction blocks of coding units. Background Art

[0002] In the video coding hybrid framework, the residual information between images is determined by means of intra-frame prediction and inter-frame prediction, and then the residual information is transformed and quantized to implement the coding of video images. Among them, inter-frame prediction includes uni-directional prediction and bi-directional prediction. Uni-directional prediction means that when predicting the current coding unit, the information of one reference frame is used, that is, the optimal motion vector is obtained by motion estimation in one reference frame, and then the prediction value is obtained by motion compensation; bi-directional prediction means that when predicting the current coding unit, the information of two reference frames is used at the same time, the optimal motion vectors are obtained by motion estimation in the two reference frames respectively, and two prediction blocks are obtained by motion compensation respectively, and then the final prediction result of the coding unit is obtained by weighted average of the two prediction blocks.

[0003] In the related art, considering the difference in similarity between the two prediction blocks corresponding to the current coding unit and itself, different weights are set for differentiation, that is, the two prediction blocks correspond to different weight values respectively, so that the prediction result of the current coding unit is more accurate. For example, in the coding unit-level bi-directional weighted prediction technology introduced in the latest generation of coding standard H.266, different weights are used for weighted average of the two different prediction blocks in the bi-direction to calculate the prediction result of the current coding unit. However, when determining the weights of the prediction blocks, it is necessary to traverse multiple sets of preset different weight values to determine the optimal weights of the prediction blocks, and the motion estimation used in each traversal process is time-consuming, and the computational complexity of the weight determination process is high, which reduces the overall coding efficiency. Summary of the Invention

[0004] The embodiments of the present application provide a method and device for determining weights of prediction blocks of coding units, which solve the problems of increased time consumption and too high computational complexity in the related art when determining the weights of prediction blocks, and significantly improve the overall coding efficiency.

[0005] In a first aspect, the embodiments of the present application provide a method for determining weights of prediction blocks of coding units, and the method includes:

[0006] Obtain the weight information of the determined coding unit, where the weight information includes different weights and corresponding accuracy scores;

[0007] When determining the weights of the prediction blocks of the current coding unit, determine whether the weight information is available according to the accuracy scores;

[0008] In response to the judgment result that the weight information is available, traverse the weights recorded in the weight information to determine the optimal weight result, where the number of weights recorded in the weight information is less than the number of initially traversed weights.

[0009] In a second aspect, an embodiment of the present application further provides a weight determination device for a prediction block of an encoding unit, including:

[0010] A weight acquisition module configured to acquire the weight information of the determined encoding unit, where the weight information includes different weights and corresponding accuracy scores;

[0011] A weight judgment module configured to determine whether the weight information is available according to the accuracy score when determining the weight of the prediction block of the current encoding unit;

[0012] A weight processing module configured to, in response to the judgment result that the weight information is available, traverse the weights recorded in the weight information to determine the optimal weight result, where the number of weights recorded in the weight information is less than the number of initially traversed weights.

[0013] In a third aspect, an embodiment of the present application further provides a weight determination device for a prediction block of an encoding unit, and the device includes:

[0014] One or more processors;

[0015] A storage device for storing 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 weight determination method for the prediction block of the encoding unit described in the embodiments of the present application.

[0017] In a fourth aspect, an embodiment of the present application further provides a storage medium storing computer-executable instructions, and the computer-executable instructions are used to execute the weight determination method for the prediction block of the encoding unit described in the embodiments of the present application when executed by a computer processor.

[0018] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program. The computer program is stored in a computer-readable storage medium, and at least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the weight determination method for the prediction block of the encoding unit described in the embodiments of the present application.

[0019] In the embodiments of the present application, by obtaining the weight information of the determined coding unit, where the weight information includes different weights and corresponding accuracy scores, when determining the weight of the prediction block of the current coding unit, it is determined whether the weight information is available according to the accuracy score, and in response to the judgment result that the weight information is available, the weights recorded in the weight information are traversed to determine the optimal weight result, where the number of weights recorded in the weight information is less than the number of initially traversed weights. This solution significantly improves the video coding speed by reasonably reducing the weights that need to be traversed and calculated, has a low compression loss rate, and reduces the processor operation power consumption with a very small increase in memory usage. Description of the Drawings

[0020] Figure 1 It is a flowchart of a method for determining the weight of a prediction block of a coding unit provided by an embodiment of the present application;

[0021] Figure 2 It is a schematic diagram of dividing a coding unit with a size of 64*64 into coding units with a size of 16*16;

[0022] Figure 3 It is a schematic diagram of dividing a coding unit with a size of 64*64 into coding units with a size of 16*64;

[0023] Figure 4 It is a schematic diagram of an inter-frame bidirectional prediction coding process provided by an embodiment of the present application;

[0024] Figure 5 It is a flowchart of another method for determining the weight of a prediction block of a coding unit provided by an embodiment of the present application;

[0025] Figure 6 It is a flowchart of another method for determining the weight of a prediction block of a coding unit provided by an embodiment of the present application;

[0026] Figure 7 It is a structural block diagram of a device for determining the weight of a prediction block of a coding unit provided by an embodiment of the present application;

[0027] Figure 8 It is a structural schematic diagram of a device for determining the weight of a prediction block of a coding unit provided by an embodiment of the present application. Detailed Embodiments

[0028] The following further elaborates on the embodiments of the present application in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than limiting the embodiments of the present application. Additionally, it should be noted that for the sake of description, only parts related to the embodiments of the present application are shown in the drawings, rather than all the structures.

[0029] The terms "first", "second", etc. in the description 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 the data used in this way can be interchanged under appropriate circumstances so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category and do not limit the number of objects. For example, the first object can be one or more. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.

[0030] Figure 1 The figure is a flowchart of a method for determining the weights of prediction blocks of coding units provided for an embodiment of this application, which can be used in the video coding process. This method can be executed by computing devices such as servers, smart terminals, laptops, tablets, etc., and specifically includes the following steps:

[0031] Step S101: Obtain the weight information of the determined coding units, where the weight information includes different weights and the corresponding accuracy scores.

[0032] Among them, the coding unit is a block unit obtained by dividing an image during the video image coding process. Taking the latest generation of video coding international standard H.266 / VVC as an example, the maximum coding unit size for dividing an image is 128*128, and the size of the smallest coding unit is 4*4. Exemplarily, taking an image size of 2560*1280 as an example, it can be divided into 200 LCUs (Largest Coding Unit), and for each LCU, further hierarchical division of coding units can be performed. For example, one coding unit with a size of 128*128 can be equally divided into 16 coding units with a size of 32*32, and each coding unit with a size of 32*32. Exemplarily, Figure 2 It is a schematic diagram of dividing a coding unit with a size of 64*64 into coding units with a size of 16*16. As can be seen from the figure, one coding unit with a size of 64*64 is equally divided into 16 coding units with a size of 16*16. At this time, the coding unit with a size of 64*64 is equivalent to the upper-level unit of the coding unit with a size of 16*16. The coding unit with a size of 64*64 can be defined as the parent coding unit of the coding unit with a size of 16*16, and the coding unit with a size of 16*16 can be defined as the sub-coding unit of the coding unit with a size of 64*64.

[0033] Of course, the above Figure 2The shown method for dividing the coding unit is only an exemplary one, and other dividing methods can also be adopted. Exemplarily, as Figure 3 shown Figure 3 is a schematic diagram for dividing a coding unit with a size of 64*64 into coding units with a size of 16*64. It can be seen from Figure 3 that one coding unit with a size of 64*64 is divided into four coding units with a size of 16*64.

[0034] In one embodiment, during the coding process of the coding unit, the maximum coding unit is gradually divided downward to obtain the next-level sub-coding unit until the smallest coding unit. During the coding process, the coding of the coding unit is performed in sequence according to the division situation. Taking the maximum coding unit with a size of 128*128 as an example, first, it is coded, and the weight information of the coding unit will be calculated accordingly during the coding process. After its coding is completed, the coding unit with a size of 128*128 is further divided into coding units with a size of 64*64. For each coding unit with a size of 64*64, the coding is performed in sequence to determine the corresponding weight information. Subsequently, for each coding unit with a size of 64*64, it is divided into coding units with a size of 32*32 and the corresponding calculations are performed to generate the weight information of each coding unit, and so on until the calculation of the coding unit with the smallest size is completed.

[0035] In one embodiment, in the process of gradually dividing the coding unit with a size of 128*128 into coding units of equal size according to the above example, when determining the weight information of the coding unit with a size of 16*16, the weight information of the coding units that have been determined is the weight information of the coding units with a size of 32*32, 64*64, and 128*128 that cover the coding unit with a size of 16*16.

[0036] Among them, the weight information of the coding unit is used to represent the weights of different prediction blocks corresponding to the coding unit. During the video image coding process, when coding a certain coding unit in the current frame image, due to the correlation between the front and back frame images, the information of the coding blocks at the corresponding positions of the front and back frame images is referred to for coding the current coding unit to achieve temporal-based image compression. During bidirectional prediction, that is, when predicting based on the front and back frame images of the current frame image respectively, the coding blocks at the positions corresponding to the current coding unit in the front and back frame images are defined as the prediction blocks of the current coding unit. As Figure 4 shown Figure 4A schematic diagram of an encoding process for inter-frame bidirectional prediction provided by an embodiment of the present application. Exemplarily, taking the coding unit 1011 in the second frame image as the current coding unit, the coding unit 1012 at the corresponding position in the first frame image and the coding unit 1013 at the position in the third frame image are two prediction blocks of the coding unit 1011. Among them, the first frame image, the second frame image, and the third frame image are three consecutive frame images. It should be noted that the above Figure 4 The example is a schematic situation of the corresponding relationship between an exemplary coding unit and a prediction block. In the specific encoding process, there may be a certain position offset for the prediction block corresponding to the coding unit, and the first frame image, the second frame image, and the third frame image may be non-consecutive adjacent image frames, and there may be other image frames in between.

[0037] Among them, the weight information of the coding unit includes different weights and corresponding accuracy scores. In one embodiment, taking the weight information of the coding unit as an example to represent the weights of two different prediction blocks of the current coding unit, the weights recorded in the weight information can be the respective weight values corresponding to the two prediction blocks, or the set weight coefficients. Through the weight coefficients, the respective weights corresponding to the two prediction blocks are calculated. When the weight information records the weight coefficients, the specific weight coefficient values can be recorded, or the index values corresponding to the recorded weight coefficient values can be recorded. Exemplarily, the prediction result of the current coding unit based on the two prediction blocks is denoted as P bi-pred , and the unidirectional prediction results of the two prediction blocks are respectively denoted as P 0 and P 1 . Using ω to represent the weight coefficient, the prediction result P bi-pred = ((8 - ω) * P 0 + ω * P 1 + 4) >> 3, where ω takes values from {-2, 3, 4, 5, 10}. That is, different weight coefficients ω are substituted into the above formula, which configures different weight values for the two unidirectional prediction results to finally obtain a more reasonable bidirectional prediction result of the current coding unit. Optionally, taking the weight information storing the index value of the weight coefficient as an example, for the weight coefficient with 5 different values, the index value can be set to 1, 2, 3, 4, and 5, corresponding to ω values of -2, 3, 4, 5, and 10 respectively. It should be noted that the number and specific values of the above weight coefficients are for exemplary illustration, and the specific value sizes can be adjusted adaptively. And the above exemplary situation of using the weight information of the coding unit to represent the different weights of two corresponding prediction blocks, for example, for the weights of 3 or more prediction blocks, other formulas or the method of separately recording can be used to store them in the weight information.

[0038] In one embodiment, the weight information includes different weights and corresponding accuracy scores. Taking the characterization of different weights by weight coefficients as an example, the weight information stores the accuracy scores corresponding to different weight coefficients respectively, and the accuracy scores are obtained by accumulation. Exemplarily, taking the weight coefficient value ω with values of -2, 3, 4, 5, and 10 as an example, for the coding unit with the largest size of 128*128, when determining the weight information, if the optimal weights determined according to different prediction modes are 3 and 4 respectively, then when accumulating scores, the accuracy score corresponding to ω with a value of 3 is incremented by 1, and the accuracy score corresponding to ω with a value of 4 is incremented by 1. At this time, for the cases where ω takes values of -2, 5, and 10, since they are not determined as the optimal weights, the accumulation of accuracy scores is not performed, and their corresponding scores are all 0. Then, when the weight coefficient takes values of {-2, 3, 4, 5, 10}, the scores corresponding to each weight coefficient are 0, 1, 1, 0, and 0 in sequence, that is, the more times the weight recorded in the weight information is used as the optimal weight, the higher the corresponding accuracy score. After the weight information of the coding unit with the size of 128*128 is determined, correspondingly, the weight information of the coding unit of the next-level division is determined. Taking the coding unit with the size of 128*128 divided into coding units with the size of 64*64 as an example, if the optimal weights determined according to different prediction modes for one of the coding units with the size of 64*64 are 3 and 5 respectively, then when accumulating scores, the accuracy score corresponding to ω with a value of 3 is incremented by 1, and the accuracy score corresponding to ω with a value of 5 is incremented by 1. At this time, the accuracy scores corresponding to the weight coefficients {-2, 3, 4, 5, 10} are 0, 2, 1, 1, and 0 in sequence. After the weight information of all the coding units with the size of 64*64 is determined, correspondingly, the weight information of the coding units with the size of 32*32 obtained by dividing each coding unit with the size of 64*64 is determined, and so on until the weight information of the coding unit with the smallest size is determined. Among them, the accuracy scores corresponding to different weights are accumulated in sequence according to the above method and stored correspondingly.

[0039] Step S102, when determining the weight of the prediction block of the current coding unit, determine whether the weight information is available according to the accuracy score.

[0040] In one embodiment, when determining the weight of the prediction block of the current coding unit, according to the obtained weight information, determine whether the weight information is available according to the accuracy score therein. If it is not available, the original logic is used to determine the weight of the prediction block of the current coding unit, that is, the preset initial traversal weights are traversed to determine the optimal weight. If the initial traversal weights are 5 different weight coefficients, then each weight coefficient is traversed for calculation to determine the optimal weight. If the weight information is available, step S103 is executed.

[0041] In one embodiment, the process of determining whether the weight information is available according to the accuracy score can be: determining whether the sum of the accuracy scores of each weight in the weight information is greater than or equal to the preset score value. It is rational. The weight information takes recording 5 different weight coefficients and corresponding accuracy score values ​​as an example. Assuming that in the weight information of the coded unit corresponding to the current coding unit, the accuracy scores corresponding to the 5 weight coefficients are 1, 5, 3, 4 and 2 respectively, then the sum of the accuracy scores is 1+5+3+4+2=15. If the preset score value set at this time is 20, then 15 is less than 20 and does not meet the available condition of the weight information; illustratively, the accuracy scores corresponding to the 5 weight coefficients are 2, 8, 7, 4 and 0 respectively, then the sum of the accuracy scores is 2+8+7+4+0=21. When the preset score value is still 20, the sum of the accuracy scores is greater than the preset score value, then it is determined that the weight information is available. Of course, the above is only an optional process for determining whether the weight information is available. In another embodiment, the accuracy scores may be first screened, and after the accuracy scores greater than a certain threshold are screened out, the screened accuracy scores greater than the certain threshold are summed up to compare with the preset score value. Of course, the accuracy scores given in the above embodiment are calculated by accumulation. In another embodiment, each weight may be initially set as a fixed branch (such as 100 points), and the score may be reduced for the optimal weight that appears, that is, the lower the accuracy score value, the more times the corresponding weight is determined as the optimal weight. Accordingly, when determining whether the weight information is available, the judgment condition is that if the sum of the accuracy scores is less than the preset score value, the weight information is determined to be available, otherwise it is unavailable.

[0042] Step S103: In response to the judgment result that the weight information is available, traverse the weights recorded in the weight information to determine the optimal weight result, wherein the number of weights recorded in the weight information is less than the number of initially traversed weights.

[0043] In one embodiment, only the weights that have been determined to be the optimal weights are recorded in the weight information. Taking the case where the weights are characterized by weight coefficients as an example, the number of weights initially traversed, that is, the number of weight coefficients, is exemplarily 5, and the corresponding values are exemplarily {-2, 3, 4, 5, 10} respectively. When determining the optimal weights for a coding unit with a size of 128×128, under different prediction modes, each weight coefficient is traversed respectively. For example, the obtained optimal weight coefficients are 3 and 4. At this time, the weight content recorded in the weight information is 3 and 4; when determining the optimal weights for a coding unit with a size of 64×64 obtained by dividing the 128×128 coding unit, assuming that the weight information of the determined coding unit corresponding to this 64×64 coding unit (the weight information of the 128×128 coding unit) is unavailable, it adopts the original logic. Under different prediction modes, each weight coefficient is traversed respectively. For example, the obtained optimal weight coefficients are 4 and 5. Then, at this time, the weight content recorded in the weight information corresponding to this 64×64 coding unit is 3, 4, and 5; the generation method of the weight content recorded in the weight information corresponding to another 64×64 coding unit is the same, exemplarily -2, 4, and 5.

[0044] In one embodiment, taking a coding unit with a size of 16×16 as the current coding unit as an example, the weight coefficients recorded in the weight information of the determined coding unit obtained by it are exemplarily 3, 4, and 5, and it is determined that this weight information is available. Assuming that the initially traversed weight coefficients include 5, which are -2, 3, 4, 5, and 10 respectively, at this time, only the weights recorded in the weight information (weight coefficients 3, 4, and 5) are traversed to determine the optimal weight result, and the -2 and 10 in the initially traversed weight coefficients are not traversed and calculated, so as to significantly reduce the data operation amount and reduce the processor power consumption. Of course, in another embodiment, if the number of weights recorded in the weight information is the same as the number of initially traversed weights, that is, during the process of determining the weight information through the previous coding unit, all the initially traversed weights have been determined to be the optimal weights, then during the process of determining the optimal weights of the current coding unit, all the weights are traversed. This method can meet the normal operation of coding, but it cannot save the processor power consumption, and its operation amount remains unchanged compared with the case without the aforementioned weight screening process.

[0045] In one embodiment, determining the weights of the prediction block of the current coding unit includes: determining the weights of the prediction block of the current coding unit in a first prediction mode. When determining the weights of the prediction block in the first prediction mode, the optimal weights are obtained by traversing multiple different weights. Specifically, during the traversal calculation process, if the weight information is determined to be available, the rate-distortion cost of the current coding unit is calculated in turn for each weight according to the weights recorded in the weight information, and the weight with the minimum rate-distortion cost is determined as the optimal weight result.

[0046] Optionally, the calculation process of the rate-distortion cost includes obtaining the motion vector (MV, Motion Vector) of the current coding unit, predicting the predicted motion vector (MVP, Motion Vector Prediction) based on the neighboring encoded coding units, calculating the difference between the two (MVD = MV - MVP) for residual coding, and outputting the corresponding weights after MVD. From this calculation process, it can be seen that for each traversal of the weights, motion estimation is required to obtain the motion vector, which is time-consuming.

[0047] In one embodiment, after determining the first optimal weight in the first prediction mode, the optimal weight result is saved to the weight information for reference when subsequent sub-coding units determine the optimal weight, and at the same time, the accuracy score of the corresponding weight is updated according to the optimal weight result. The specific update process can adopt the method of score accumulation or subtraction. Refer to the description of the foregoing example and will not be elaborated here.

[0048] In another embodiment, determining the weights of the prediction block of the current coding unit further includes: determining the weights of the prediction block of the current coding unit in a second prediction mode to obtain the first optimal weight result, saving the first optimal weight result to the weight information, and updating the accuracy score of the corresponding weight according to the first optimal weight result. When determining the weights of the prediction block of the current coding unit in the second prediction mode, it is derived based on the weights corresponding to the adjacent blocks of the current coding unit to obtain the first optimal weight result. Optionally, the first optimal weight result includes N optimal weights determined by the second prediction mode, where N is a positive integer greater than or equal to 1, such as determining 3 optimal weights in the second prediction mode. Correspondingly, after obtaining the first optimal weight result, the first optimal weight result is saved to the weight information for reference when subsequent sub-coding units determine the optimal weight, and at the same time, the accuracy score of the corresponding weight is updated according to the first optimal weight result. The specific update process can adopt the method of score accumulation or subtraction. Refer to the description of the foregoing example and will not be elaborated here.

[0049] As can be seen from the above solution, when determining the weights of the prediction blocks of the current coding unit, reasonable screening of the weights that need to be traversed is performed according to the recorded weight information, significantly improving the video coding speed, having a low compression loss rate, and reducing the processor operation power consumption with very little increase in memory usage. From the experimental data, it can be seen that the above method can average improve the coding speed by 6%, cause an objective compression efficiency loss of 0.08%, maintain the same picture quality subjectively, and only increase very little memory usage; for online applications, it can save 6% of the server CPU resources and reduce 6% of the client CPU consumption.

[0050] Based on the above solution, after determining the optimal weight result, it further includes: determining the optimal weight result of the next coding unit until the weight decision of the largest coding unit is completed. Among them, the size of the largest coding unit varies according to different coding standards. For example, a coding unit with a size of 128*128 is defined as the largest coding unit, or a coding unit with a size of 256*256 is defined as the largest coding unit. The specific size is not limited in this solution. Among them, the weight decision of the largest coding unit refers to determining the optimal weights for each smallest coding unit (exemplarily, taking 4*4, 2*2, or 8*8 as an example) obtained by successive hierarchical division in the largest coding unit.

[0051] Figure 5 It is a flowchart of another method for determining the weights of the prediction blocks of the coding unit provided by the embodiment of the present application, and provides a method for determining the weights of the prediction blocks of the current coding unit in two prediction modes, such as Figure 5 shown, specifically including:

[0052] Step S201, obtain the weight information of the determined coding unit, where the weight information includes different weights and the corresponding accuracy scores.

[0053] Step S202, determine the weights of the prediction blocks of the current coding unit in the second prediction mode to obtain the first optimal weight result, save the first optimal weight result into the weight information, and at the same time update the accuracy scores of the corresponding weights according to the first optimal weight result.

[0054] In one embodiment, during the process of determining the optimal weight of the current coding unit, there are two prediction modes. For the first prediction mode, the optimal weight result is obtained by traversing and calculating the set initial traversal weight or the weight recorded in the weight information. For the second prediction mode, the first optimal weight result is obtained by deriving based on the weights corresponding to the adjacent blocks of the current coding unit. Optionally, the process of deriving based on the weights corresponding to the adjacent blocks of the current coding unit can be as follows: respectively obtain the optimal weight information determined by the adjacent coding units, that is, the adjacent blocks. If the optimal weight information of the coding unit above the current coding unit and the coding unit on the left has been calculated and derived, then obtain the optimal weight information of the coding unit above the current coding unit and the coding unit on the left, and solve the mean value of the optimal weights recorded therein. After obtaining the solution result, determine the weight closest to it among the candidate weights (i.e., the set initial traversal weights) as one of the optimal weights determined by the current coding unit in the second prediction mode. Of course, the above is only an exemplary way to determine the optimal weight of the current coding unit in the second prediction mode, and multiple other ways can also be set, such as setting two other solution methods to respectively determine the corresponding optimal weight results in the three optimal second prediction modes and combining them to obtain the first optimal weight result.

[0055] In one embodiment, when the second prediction mode is executed before the first prediction mode, after obtaining the first optimal weight result, save it to the weight information, and at the same time update the accuracy score of the corresponding weight according to the first optimal weight result, so as to use the updated weight information to judge whether the weight is available when confirming the optimal weight through the first prediction mode, and subsequently use the weight information to screen the weights to reduce the amount of computation.

[0056] Step S203, when determining the weight of the prediction block of the current coding unit in the first prediction mode, determine whether the weight information is available according to the updated accuracy score.

[0057] Step S204, in response to the judgment result that the weight information is available, traverse the weights recorded in the weight information to determine the optimal weight result, save the optimal weight result to the weight information, and update the accuracy score of the corresponding weight according to the optimal weight result.

[0058] As can be seen from the above, during the process of determining the weight of the coding unit, for the two prediction modes, when determining the weight of the prediction block of the current coding unit in the first prediction mode, using the first optimal weight result of the current coding unit determined by the second prediction mode further improves the accuracy of weight screening, making the final coding effect better, and at the same time can save more processor power consumption.

[0059] In one embodiment, after obtaining the optimal weight result for the current coding unit in two prediction modes, such as obtaining the optimal weight result corresponding to the first prediction mode and the first optimal weight result corresponding to the second prediction mode, when updating the optimal weight result and the first optimal weight result to the weight information, different counting methods are adopted for the statistics of the weight scores. Optionally, when the accuracy score of the weight is statistically accumulated, when the weight in the optimal weight result is accumulated, the accumulated score value is greater than the score value when the weight in the first optimal weight result is accumulated. Exemplarily, when the weight in the optimal weight result is accumulated, the accumulated score value of the corresponding weight is twice the score value when the weight in the first optimal weight result is accumulated. By setting different score accumulation methods, the accuracy proportion of the optimal weight determined by the first prediction mode is improved. For the optimal weight determined by the first prediction mode, since it depends on the data of adjacent blocks, its accuracy is lower than that of the optimal weight determined by weight traversal. Thus, the finally obtained weight information is more accurate.

[0060] Figure 6 FIG. is a flowchart of another method for determining the weight of a prediction block of a coding unit provided by an embodiment of the present application, showing a process of traversing the weights recorded in the weight information, as Figure 6 shown, and specifically includes:

[0061] Step S301, obtain the weight information of the determined coding unit, where the weight information includes different weights and corresponding accuracy scores, and the weight information is stored in an array.

[0062] In one embodiment, the weight information is stored in an array, and the indexes of the elements in the array correspond to the weights. For example, indexes [0], [1], [2], [3], and [4] correspond to weight coefficients -2, 3, 4, 5, and 10 respectively. Exemplarily, for the determined optimal weight result, it is saved in the array structure. For example, if the determined optimal weight result is -2, the value corresponding to index [0], that is, the stored accuracy score, is accumulated. At this time, the exemplary array storage information is index a[0], and its corresponding value is 1; when the determined optimal weight result is 10, at this time, the exemplary array storage information is indexes a[0] and a[4], and their corresponding values are 1 and 1 respectively; when the determined optimal weight results are -2 and 3, at this time, the exemplary array storage information is indexes a[0], a[1], and a[4], and their corresponding values are 2, 1, and 1 respectively, and so on. It should be noted that the above is only an exemplary method for storing weight information in an array. A two-dimensional array can also be used to separately store the weight coefficient values and the corresponding accuracy scores, or separately store the weight values of different reference prediction blocks before and after and the corresponding accuracy scores.

[0063] Step S302: When determining the weights of the prediction blocks of the current coding unit, determine whether the weight information is available according to the accuracy score.

[0064] Step S303: In response to the judgment result that the weight information is available, add the weights recorded in the array to the created weight list, and traverse the weights recorded in the weight list to determine the optimal weight result.

[0065] In one embodiment, when it is determined that the weight information is available, taking the case where only the weights determined to be the optimal weight results are recorded in the array as an example, add the weights recorded in the array to the created weight list. Exemplarily, assume that the array records corresponding to the currently available weight information are weight indices 1, 2, and 3, then add weight indices 1, 2, and 3, or the weight coefficient values 3, 4, and 5 corresponding to weight indices 1, 2, and 3 to the created weight list. When determining the optimal weight of the coding unit, perform weight traversal based on the information recorded in the weight list to determine the optimal weight result.

[0066] As can be seen from the above, by storing and traversing the weight information through the set special data structure, screening the weights that need to be traversed reasonably according to the recorded weight information, significantly improves the video coding speed, has a low compression loss rate, and reduces the processor operation power consumption with a very small increase in memory usage.

[0067] Figure 7 The following is a structural block diagram of a device for determining the weights of the prediction blocks of a coding unit provided by an embodiment of the present application. This device is used to execute the method for determining the weights of the prediction blocks of the coding unit provided by the above embodiment, and has the corresponding functional modules and beneficial effects for executing the method. As Figure 7 shown, the device specifically includes: a weight acquisition module 101, a weight judgment module 102, and a weight processing module 103, where

[0068] The weight acquisition module 101 is configured to acquire the weight information of the determined coding unit, and the weight information includes different weights and corresponding accuracy scores;

[0069] The weight judgment module 102 is configured to determine whether the weight information is available according to the accuracy score when determining the weights of the prediction blocks of the current coding unit;

[0070] The weight processing module 103 is configured to, in response to the judgment result that the weight information is available, traverse the weights recorded in the weight information to determine the optimal weight result, where the number of weights recorded in the weight information is less than the number of initial traversed weights.

[0071] As can be seen from the above solution, by obtaining the weight information of the determined coding unit, where the weight information includes different weights and corresponding accuracy scores, when determining the weight of the prediction block of the current coding unit, it is determined whether the weight information is available according to the accuracy score. In response to the judgment result that the weight information is available, the weights recorded in the weight information are traversed to determine the optimal weight result, where the number of weights recorded in the weight information is less than the number of initially traversed weights. This solution significantly improves the video coding speed by reasonably reducing the weights that need to be traversed and calculated, has a low compression loss rate, and reduces the processor operation power consumption with a very small increase in memory usage.

[0072] In a possible embodiment, the weight processing module 103 is configured to:

[0073] Determine the weight of the prediction block of the current coding unit in the first prediction mode;

[0074] Calculate the rate-distortion cost of the current coding unit under each weight in turn according to the weights recorded in the weight information, and determine the weight with the minimum rate-distortion cost as the optimal weight result.

[0075] In a possible embodiment, the device further includes a weight update module 104, configured to save the optimal weight result to the weight information after determining the optimal weight result;

[0076] Update the accuracy score of the corresponding weight according to the optimal weight result.

[0077] In a possible embodiment, the weight processing module 103 is configured to:

[0078] Determine the weight of the prediction block of the current coding unit in the second prediction mode to obtain a first optimal weight result, where the first optimal weight result includes N optimal weights determined by the second prediction mode, and N is a positive integer greater than or equal to 1;

[0079] Save the first optimal weight result to the weight information, and update the accuracy score of the corresponding weight according to the first optimal weight result.

[0080] In a possible embodiment, the determined coding unit includes the parent coding units at all levels including the current coding unit, and the higher the number of times the weight recorded in the weight information is used as the optimal weight, the higher the corresponding accuracy score.

[0081] In a possible embodiment, the weight judgment module 102 is configured to:

[0082] Determine whether the sum of the accuracy scores of each weight in the weight information is greater than or equal to a preset score value;

[0083] The weight processing module 103 is configured as follows:

[0084] In response to the judgment result that the sum of the accuracy scores is greater than the preset score value.

[0085] In a possible embodiment, the weight information is stored in an array, and the weight processing module 103 is configured as follows:

[0086] Add the weights recorded in the array to the created weight list;

[0087] Traverse the weights recorded in the weight list.

[0088] In a possible embodiment, the weight processing module 103 is further configured as follows:

[0089] After determining the optimal weight result, determine the optimal weight result of the next coding unit until the weight decision of the maximum coding unit is completed.

[0090] Figure 8 The following is a schematic structural diagram of a weight determination device for a coding unit prediction block provided by an embodiment of the present application, as Figure 8 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 one processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected through a bus or other means, Figure 8 taking connection through a bus 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 program instructions / modules corresponding to the weight determination method of the coding unit prediction block in the embodiments of the present application. 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 202, that is, implements the above-mentioned weight determination method of the coding unit prediction block. The input device 203 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the device. The output device 204 can include display devices such as a display screen.

[0091] An embodiment of the present application further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute a weight determination method of a coding unit prediction block described in an above embodiment when executed by a computer processor, where the method includes:

[0092] Obtain the weight information of the determined coding unit, where the weight information includes different weights and corresponding accuracy scores;

[0093] When determining the weight of the prediction block of the current coding unit, determine whether the weight information is available according to the accuracy score;

[0094] In response to the determination result that the weight information is available, traverse the weights recorded in the weight information to determine the optimal weight result, where the number of weights recorded in the weight information is less than the number of initial traversed weights.

[0095] It should be noted that in the embodiments of the weight determination device for the prediction block of the coding unit described above, each unit and module included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiments of the present application.

[0096] In some possible implementation manners, various aspects of the method provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is used to cause the computer device to execute the steps in the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device can execute the weight determination method for the prediction block of the coding unit recorded in the embodiments of the present application. The program product can be implemented by any combination of one or more readable media.

Claims

1. Method for determining weights of prediction blocks of coding units, Characterized in that, Comprising: Obtaining the weight information of the determined coding units, where the weight information includes different weights and corresponding accuracy scores; When determining the weights of the prediction blocks of the current coding unit, determining whether the weight information is available according to the accuracy scores; In response to the judgment result that the weight information is available, traversing the weights recorded in the weight information to determine the optimal weight result, where the number of weights recorded in the weight information is less than the number of initial traversal weights, and the judgment result that the weight information is available includes: the judgment result that the sum of the accuracy scores is greater than or less than a preset score value.

2. The weight determination method according to claim 1, Characterized in that, The determining the weights of the prediction blocks of the current coding unit includes: Determining the weights of the prediction blocks of the current coding unit in the first prediction mode; Correspondingly, the traversing the weights recorded in the weight information to determine the optimal weight result includes: Calculating the rate-distortion cost of the current coding unit under each weight in turn according to the weights recorded in the weight information, and determining the weight with the minimum rate-distortion cost as the optimal weight result.

3. The weight determination method according to claim 2, Characterized in that, After determining the optimal weight result, further comprising: Saving the optimal weight result into the weight information; Updating the accuracy scores of the corresponding weights according to the optimal weight result.

4. The weight determination method according to claim 1, Characterized in that, The method for determining the weights of the prediction blocks of the coding units further comprises: Determining the weights of the prediction blocks of the current coding unit in the second prediction mode to obtain a first optimal weight result, where the first optimal weight result includes N optimal weights determined by the second prediction mode, and N is a positive integer greater than or equal to 1; Saving the first optimal weight result into the weight information, and updating the accuracy scores of the corresponding weights according to the first optimal weight result.

5. The weight determination method according to claim 1, Characterized in that, The determined coding units include the parent coding units at all levels containing the current coding unit, and the more times the weights recorded in the weight information are used as the optimal weights, the higher the corresponding accuracy scores are.

6. The weight determination method according to any one of claims 1-5, Characterized in that, The weight information is stored in an array, and the traversing the weights recorded in the weight information includes: Adding the weights recorded in the array to a created weight list; Traversing the weights recorded in the weight list.

7. The weight determination method according to any one of claims 1-5, Characterized in that, After determining the optimal weight result, further comprising: Determining the optimal weight result of the next coding unit until the weight decision of the largest coding unit is completed.

8. Device for determining weights of prediction blocks of coding units, Characterized in that, Comprising: A weight acquisition module configured to obtain the weight information of the determined coding units, where the weight information includes different weights and corresponding accuracy scores; A weight determination module, configured to determine whether the weight information is available according to the accuracy score when determining the weight of the prediction block of the current coding unit; A weight processing module, configured to traverse the weights recorded in the weight information in response to the judgment result that the weight information is available, so as to determine the optimal weight result, wherein the number of weights recorded in the weight information is less than the number of initial traversal weights, and the judgment result that the weight information is available includes: the judgment result that the sum of the accuracy scores is greater than or less than a preset score value.

9. An apparatus for determining the weight of a prediction block of a coding unit, the apparatus comprising: one or more processors; a storage device for storing one or more programs, which when executed by the one or more processors cause the one or more processors to implement the method for determining the weight of the prediction block of the coding unit according to any one of claims 1-7.

10. A storage medium storing computer-executable instructions, the computer-executable instructions being used to execute the method for determining the weight of the prediction block of the coding unit according to any one of claims 1-7 when executed by a computer processor.

11. A computer program product, comprising a computer program, wherein, the computer program, when executed by a processor, implements the method for determining the weight of the prediction block of the coding unit according to any one of claims 1-7.

Citation Information

Patent Citations

  • Video coding code rate distribution and coding unit code rate distribution method and device

    CN106961604A

  • Weighted prediction method and device used for multiple hypothesis coding

    WO2020114510A1