Division type decision-making method and device for video coding, equipment and storage medium
By obtaining the number of coding units and the optimal partitioning type information of the binary tree partitioning depth in video encoding, and reasonably determining whether to skip other tree partitioning decisions, the problem of high computational complexity in the new generation encoder standard is solved, and the encoding speed and efficiency are improved.
Patent Information
- Application Number
- CN202410848399.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-12
AI Technical Summary
The new generation of encoder standards requires more classification decisions, which increases the computational complexity of video encoders, reduces encoding speed, and affects video encoding efficiency.
After completing the binary tree partitioning decision in the current coding region, by obtaining the number of coding units at different partitioning depths and the optimal partitioning type information, it is determined whether to skip other tree partitioning decisions. By using a preset number threshold and rate-distortion cost comparison, the optimal partitioning direction is reasonably determined, reducing computational complexity.
With minimal loss of encoding quality, it improves video encoding efficiency, increases server-side computing resource utilization, saves server costs, reduces client-side CPU utilization, and enhances user experience.
Smart Images

Figure CN118945381A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video coding technology, and in particular, to a method, apparatus, device and storage medium for determining a partition type of video coding. Background Art
[0002] In the new generation encoder standard, multiple recursive partitioning structures can be supported, including no partitioning, quadtree partitioning, binary tree partitioning and ternary tree partitioning, among which binary tree partitioning includes vertical binary tree and horizontal binary tree, and ternary tree partitioning includes vertical ternary tree and horizontal ternary tree. During the partitioning process, the coding unit can select any partitioning tree, but once the coding unit selects a multi-type tree, subsequent nodes can only select a multi-type tree, and there is a limit on the maximum multi-type tree depth. The new generation encoder standard can decide which layer the current area needs to be divided into and what kind of partitioning to adopt based on the rate-distortion cost based on the video content adaptively within a limited depth range for the same coding area. Among them, a coding tree unit is usually used as the root node, and the decision on the non-division type will be made first, and then the quadtree partitioning or binary tree partitioning will be determined first according to the value of the partition flag. When binary tree division is performed first, horizontal binary tree division is performed first, and then the division result is recursively divided into multiple types of trees according to the maximum allowed division depth; after the division is completed, it will return to the previous layer and continue vertical binary tree division, and recursively perform multiple types of tree division on the division result according to the rules; then return to the previous layer to continue ternary tree division, after completing binary tree division and ternary tree division; then perform quadtree division, and recursively perform multiple types of tree division on the division result according to the rules; finally, the division structure with the smallest rate-distortion cost is used as the final division result of the coding tree unit.
[0003] Although the introduction of the new partitioning structure in the new generation encoder standard has brought better coding benefits, the need to execute more partitioning type decisions will increase the computational complexity of the video encoder, reduce the encoding speed, and affect the video encoding efficiency, which needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and storage medium for video coding partition type decision, which solves the problem that the need to execute more partition type decisions will increase the computational complexity of the video encoder, reduce the encoding speed, and affect the video encoding efficiency. It realizes the optimal coding unit partition information after referring to the binary tree partition decision, and reasonably determines whether the tree partition decision containing other partition directions in the current coding area is skipped. Under the premise of less loss of encoding quality, the decision on the type of partition to be divided with a smaller optimal probability is skipped, thereby reducing the computational complexity of the video encoder, increasing the encoding speed, and thus improving the video encoding efficiency.
[0005] In a first aspect, an embodiment of the present application provides a method for determining a partition type for video coding, the method comprising:
[0006] In the case where a binary tree partition decision is completed for the current coding region, partition type information corresponding to a first partition depth, the number of coding units corresponding to a second partition depth, and a second optimal partition type for each coding unit are obtained, wherein the partition type information includes a first optimal partition type, and the second partition depth is greater than the first partition depth;
[0007] Comparing the number of encoding units with a preset number threshold;
[0008] When the first optimal division type is a binary tree division in a preset division direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each of the coding units is a division type in a preset division direction, the tree division decision including other division directions of the current coding area is skipped.
[0009] In a second aspect, an embodiment of the present application further provides a video coding partition type decision device, including:
[0010] a partition information acquisition module, configured to, when a binary tree partition decision is completed for a current coding region, acquire partition type information corresponding to a first partition depth, the number of coding units corresponding to a second partition depth, and a second optimal partition type for each coding unit, wherein the partition type information includes a first optimal partition type, and the second partition depth is greater than the first partition depth;
[0011] A unit quantity comparison module, configured to compare the number of encoding units with a preset quantity threshold;
[0012] The partition decision skipping module is configured to skip the tree partition decision containing other partition directions of the current coding area when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each of the coding units is a partition type of the preset partition direction.
[0013] In a third aspect, an embodiment of the present application further provides a video coding partition type decision device, the device comprising:
[0014] one or more processors;
[0015] a storage device configured to store one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the video coding partition type decision method described in the embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the video encoding partition type decision method described in the embodiment of the present application.
[0018] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program 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 video encoding partition type decision method described in the embodiment of the present application.
[0019] In an embodiment of the present application, by completing a binary tree partitioning decision in the current coding area, obtaining the partition type information corresponding to the first partition depth, the number of coding units corresponding to the second partition depth, and the second optimal partition type of each coding unit, wherein the partition type information includes the first optimal partition type, and the second partition depth is greater than the first partition depth; then, comparing the number of coding units with a preset number threshold; finally, when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each of the coding units is a partition type of a preset partition direction, skipping the tree partition decision of the current coding area including other partition directions. In the above scheme, by obtaining the division type information corresponding to different division depths, the optimal coding unit division information after the binary tree division decision can be effectively referenced, providing a reliable judgment basis for determining whether to skip other tree-type division decisions; according to the comparison results of the number of coding units and the preset number threshold and the optimal division type statistics of different division depths, the texture information of the current coding area can be reasonably utilized, the optimal division direction can be effectively identified, and it can be determined whether the tree-type division decision containing other division directions in the current coding area is skipped. Under the premise of less loss of coding quality, the decision on the type of division to be divided with a smaller optimal probability can be skipped, thereby reducing the computational complexity of the video encoder, increasing the encoding speed, and thus improving the video encoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a video coding partition type decision method provided in an embodiment of the present application;
[0021] Figure 2It is a schematic diagram of the partitioning decision to be executed after the binary tree partitioning decision is executed for the coding area corresponding to the coding unit of the exemplary size of 32×32;
[0022] Figure 3 A schematic diagram of skipping vertical ternary tree partitioning decision and quadtree partitioning decision in a partitioning type decision method based on video coding provided in an embodiment of the present application;
[0023] Figure 4 A flowchart of a partition type decision method for video coding including skipping a tree partition decision process including other partition directions provided in an embodiment of the present application;
[0024] Figure 5 A flowchart of a partition type decision method for video coding including skipping a tree partition decision process including a horizontal partition direction provided in an embodiment of the present application;
[0025] Figure 6 A flowchart of a partition type decision method for video coding including skipping a tree partition decision process including a vertical partition direction provided in an embodiment of the present application;
[0026] Figure 7 A flowchart of a video encoding method including skipping a tree partition decision process including other partition directions according to a preset skip flag provided in an embodiment of the present application;
[0027] Figure 8 A flowchart of a method for determining a partition type of a video encoding including a tree partition decision process for executing other partition directions of the current encoding region provided in an embodiment of the present application;
[0028] Fig. 9 A structural block diagram of a video coding partition type decision device provided in an embodiment of the present application;
[0029] Fig.10 A schematic diagram of the structure of a video coding partition type decision device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0032] The video coding partition type decision method provided in the embodiment of the present application is used to identify the best partition direction suitable for the current coding area by using the optimal coding unit partition information after the binary tree partition decision, skip the tree partition decision of other partition directions, and accelerate video coding. Specific application scenarios may include: video conferencing, video calls, indoor live broadcasts, and outdoor live broadcasts. The several application scenarios listed above are only exemplary and explanatory. In actual applications, the video coding partition type decision method can also be used in video coding in other scenarios, and the embodiment of the present application does not limit this. The present application aims to provide a video coding partition type decision method, device, equipment and storage medium to solve the problem that the need to execute more partition type decisions will increase the computational complexity of the video encoder, reduce the encoding speed, and affect the video encoding efficiency.
[0033] In the method for deciding the division type of video coding provided in the embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, and can also be servers and other devices, which are not limited in the embodiment of the present application.
[0034] Figure 1 A flowchart of a video coding partition type decision method provided in an embodiment of the present application, wherein the execution subject of each step in the partition decision method can be a video coding partition type decision device, such as Figure 1 As shown, the following steps are included:
[0035] Step S101: When a binary tree partitioning decision is completed in the current coding area, the partitioning type information corresponding to the first partitioning depth, the number of coding units corresponding to the second partitioning depth, and the second optimal partitioning type of each coding unit are obtained, wherein the partitioning type information includes the first optimal partitioning type, and the second partitioning depth is greater than the first partitioning depth.
[0036] Among them, in the video encoding process, with the coding tree unit as the root node, the decision of not dividing the type is first made, and then it is determined whether to prioritize quadtree division or binary tree division according to the value of the division flag. After the coding tree unit completes the binary tree division decision, it will return to its initial state, and then make other tree division decisions, such as vertical ternary tree division decision, horizontal ternary tree division decision and quadtree division decision, etc., and finally the division structure with the minimum rate distortion cost can be used as the final division result of the coding tree unit. The embodiment of the present application is to determine whether other tree division decisions that have not been executed can be skipped after binary tree division is preferentially executed. Among them, the binary tree division process can be to first perform horizontal binary tree division, and then recursively perform multi-type tree division on the division result according to the maximum division allowed depth; after the division is completed, it will return to the previous layer and continue to perform vertical binary tree division, and recursively perform multi-type tree division on the division result according to the maximum division allowed depth. In the binary tree partition process, for different partition depths, the partition type with the smallest rate-distortion cost can be used as the optimal partition type corresponding to the partition depth. The number of coding units obtained by each partition depth may be different according to the degree of divisibility of the coding area, and the optimal partition type corresponding to each coding unit may be the same or different. In one embodiment, the first partition depth can be 1. Then, when the partition depth is 1, the rate-distortion costs calculated for no partition, horizontal binary tree partition, and vertical binary tree partition can be obtained for comparison, and the partition type with the smallest rate-distortion cost can be used as the first optimal partition type. Optionally, the calculation of the rate-distortion cost can comprehensively consider the distortion caused by the current coding mode and the bit rate consumed for encoding using the current coding mode. For example, the relevant formula for calculating the rate-distortion cost is as follows:
[0037] J=D+λ mode ·R
[0038] Where D represents the distortion value in the current coding mode, R represents the bit rate value in the current coding mode, and λ mode is the Lagrangian factor.
[0039] In one embodiment, the optimal partition type flag of the first partition depth can be obtained to determine the first optimal partition type corresponding to the first partition depth. When the first partition depth is 1, the optimal partition type flag can be set with three values corresponding to no partition, horizontal binary tree partition, and vertical binary tree partition. Since the second partition depth is greater than the first partition depth, in one embodiment, the first partition depth can be 1 and the second partition depth can be 2. If the first optimal partition type corresponding to the first partition depth is vertical binary tree partition or horizontal binary tree partition, then the second optimal partition type of the coding unit corresponding to the second partition depth may be horizontal partition or vertical partition. It can be determined specifically according to the comparison result of the rate-distortion cost corresponding to different partition types or the optimal partition type flag corresponding to the coding unit. Of course, the values of the first partition depth and the second partition depth are only exemplary descriptions. The first partition depth and the second partition depth can also refer to the partition type information of other value situations, which is not limited in this application. Figure 2 FIG. 1 is a schematic diagram of the division decision to be performed after the binary tree division decision is performed on the coding area corresponding to the coding unit of the exemplary 32×32 size. Figure 2 As shown, the executed partition type decision of the coding region 101 includes a non-division decision 102, a horizontal binary tree partition decision 103, and a vertical binary tree partition decision 104. Then the coding region 101 needs to return to the original state and continue to perform other tree partition decisions to be executed. The tree partition decisions to be executed may include a horizontal ternary tree partition decision 105, a vertical ternary tree partition decision 106, and a quadtree partition decision 107. Since the texture information content of the same coding region is fixed, after the binary tree partition decision, if the partition decision result is that the division direction of the coding unit in the coding region is single, or most of the coding units correspond to the same division direction, then the probability that the tree partition type to be executed corresponding to other division directions is not suitable for the coding region is high, and the decision process can be skipped to achieve the purpose of accelerating coding. Therefore, the partition information of different partition depths corresponding to the binary tree partition decision can be obtained, which is used to determine and identify the optimal partition direction of the current coding region, and provide reliable reference information for skipping the partition type decision with a low probability.
[0040] Step S102: Compare the number of coding units with a preset number threshold.
[0041] Among them, the preset number threshold can be used to determine whether the number of coding units corresponding to the second division depth reaches the set number that effectively represents the texture information of the current coding area. If the number of coding units is greater than or equal to the preset number threshold, it can be regarded as effectively representing the texture information of the current coding area, and the optimal division direction of the current coding area can be determined by combining the second optimal division type of each coding unit; if the number of coding units is less than the preset number threshold, it can be regarded as being unable to effectively represent the texture information of the current coding area. In addition to considering the second optimal division type of each coding unit, it is also necessary to combine other information for a comprehensive judgment of the optimal division direction, such as the rate-distortion cost comparison information of the division types corresponding to different division directions at the first division depth. The preset number threshold can be adaptively set by the developer according to the possible number of coding units at the second division depth in the actual application scenario, and this application does not limit it here.
[0042] Step S103: When the first optimal division type is a binary tree division in a preset division direction, the number of coding units is greater than or equal to a preset number threshold, and the second optimal division type of each coding unit is a division type in a preset division direction, skip the tree division decision containing other division directions of the current coding area.
[0043] Among them, the preset division direction may include a vertical division direction and a horizontal division direction. By determining the first optimal division type corresponding to the first division depth, the preferred division direction of the current coding area can be preliminarily determined. By determining that the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is the division type of the preset division direction, it can be further determined whether the texture information of the current coding area matches the obtained preferred division direction, thereby determining whether it is necessary to skip the tree-type division decision containing other division directions of the current coding area. In one embodiment, the tree-type division decision to be executed may be a ternary tree division decision and a quadtree division decision. If the first optimal division type is a horizontal binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is a horizontal division, the horizontal division direction can be regarded as the optimal division direction with a higher probability corresponding to the current coding area. Therefore, it is possible to choose to skip the tree-type division decision containing the vertical division direction, including the vertical ternary tree division decision and the quadtree division decision. In one embodiment, Figure 3 A schematic diagram of a video coding-based partition type decision method provided in an embodiment of the present application skipping vertical ternary tree partition decision and quadtree partition decision. Figure 3As shown, the executed partition type decisions of the coding area 201 include no partition decision 202, horizontal binary tree partition decision 203 and vertical binary tree partition decision 204, and then the coding area 201 needs to return to the original state and continue to perform other tree partition decisions to be executed, which may include horizontal ternary tree partition decision 205, vertical ternary tree partition decision 206 and quadtree partition decision 207. If the first optimal partition type corresponding to the first partition depth is the vertical binary tree partition decision 204, the possible values of the number of coding units corresponding to the second partition depth are 2, 3 and 4. In order to effectively combine more delicate texture information, the preset number threshold can be set to 3. Therefore, in combination with the number of coding units being greater than or equal to 3, and the second optimal partition type of each coding unit being vertical partition, the corresponding Figure 3 The first partition result 208 and the second partition result 209 of the second partition depth can regard the vertical partition direction as the optimal partition direction with a higher probability corresponding to the current coding area. Therefore, the horizontal ternary tree partition decision 205 and the quadtree partition decision 207 including the horizontal partition direction can be skipped.
[0044] In the above, by completing the binary tree partition decision in the current coding area, the partition type information corresponding to the first partition depth, the number of coding units corresponding to the second partition depth, and the second optimal partition type of each coding unit are obtained, wherein the partition type information includes the first optimal partition type, and the second partition depth is greater than the first partition depth; then, the number of coding units is compared with a preset number threshold; finally, when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each coding unit is a partition type of a preset partition direction, the tree partition decision containing other partition directions of the current coding area is skipped. In the above scheme, by obtaining the division type information corresponding to different division depths, the optimal coding unit division information after the binary tree division decision can be effectively referenced, providing a reliable basis for determining whether to skip other tree-type division decisions; according to the comparison results of the number of coding units and the preset number threshold and the statistics of the optimal division type at different division depths, the texture information of the current coding area can be reasonably used to effectively identify the optimal division direction and determine whether the tree-type division decision containing other division directions in the current coding area is skipped. Under the premise of less loss of encoding quality, the decision of the type to be divided with a smaller optimal probability is skipped, the computational complexity of the video encoder is reduced, the encoding speed is increased, and the video encoding efficiency is improved. In addition, the computing resource utilization rate of the server side is improved, the server cost is saved, and the CPU utilization rate of the client side is reduced, further improving the user experience.
[0045] Figure 4A flowchart of a method for determining a partition type of a video encoding including skipping a tree partition decision process including other partition directions is provided in an embodiment of the present application. Figure 4 As shown, the following steps are included:
[0046] Step S201: When a binary tree partitioning decision is completed in the current coding area, the partitioning type information corresponding to the first partitioning depth, the number of coding units corresponding to the second partitioning depth, and the second optimal partitioning type of each coding unit are obtained, wherein the partitioning type information includes the first optimal partitioning type, and the second partitioning depth is greater than the first partitioning depth.
[0047] Step S202: Compare the number of coding units with a preset number threshold.
[0048] Step S203: When the first optimal division type is vertical binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is vertical division, skip the horizontal ternary tree division decision and the quadtree division decision of the current coding area.
[0049] Among them, the tree partitioning decisions to be executed in the current coding area include ternary tree partitioning decisions and quadtree partitioning decisions. If the first optimal partitioning type is vertical binary tree partitioning, it can be preliminarily judged that the preferred partitioning direction of the current coding area is the vertical partitioning direction. Further, combined with the judgment result that the number of coding units is greater than or equal to the preset number threshold and the second optimal partitioning type of each coding unit is vertical partitioning, it can be determined that the probability that the texture information of the current coding area is of a vertical type is high. Correspondingly, the probability of executing a tree partitioning decision including a horizontal partitioning direction is small, and the horizontal ternary tree partitioning decision and the quadtree partitioning decision can be skipped.
[0050] In one embodiment, the specific process of skipping the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area may be as follows:
[0051] The first skip flag corresponding to the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area is set to a true value. Before making the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area, if it is detected that the first skip flag is a true value, the horizontal ternary tree partition decision and the quadtree partition decision are skipped.
[0052] Among them, the horizontal ternary tree division decision and the quadtree division decision of the current coding area can be pre-set with a first skip flag. If the first skip flag is a true value, the horizontal ternary tree division decision and the quadtree division decision are skipped. If the first skip flag is a false value, the horizontal ternary tree division decision and the quadtree division decision are not skipped. When the first optimal division type is vertical binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is vertical division, the first skip flag of the current coding area can be selected to be set to a true value. Therefore, before the horizontal ternary tree division decision and the quadtree division decision of the current coding area need to be made, it can be determined whether to skip the horizontal ternary tree division decision and the quadtree division decision by detecting the first skip flag.
[0053] In one embodiment, the horizontal ternary tree partition decision and the quadtree partition decision corresponding to the current coding area may be set with a first execution flag. If the first execution flag is a true value, the horizontal ternary tree partition decision and the quadtree partition decision are executed. If the first execution flag is a false value, the horizontal ternary tree partition decision and the quadtree partition decision are skipped. When the first optimal partition type is vertical binary tree partition, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each coding unit is vertical partition, the first execution flag corresponding to the current coding area can be selected to be set to a false value. Therefore, before the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area need to be made, it can be determined whether to execute the horizontal ternary tree partition decision and the quadtree partition decision by detecting the first execution flag.
[0054] Step S204: When the first optimal division type is horizontal binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is horizontal division, skip the vertical ternary tree division decision and the quadtree division decision of the current coding area.
[0055] Among them, if the first optimal division type is horizontal binary tree division, it can be preliminarily judged that the better division direction of the current coding area is the horizontal division direction, and then combined with the judgment result that the number of coding units is greater than or equal to the preset number threshold and the second optimal division type of each coding unit is horizontal division, it can be determined that the probability that the texture information of the current coding area is of horizontal type is high, and accordingly, the probability of executing a tree-type division decision including a vertical division direction is small, and the vertical ternary tree division decision and the quadtree division decision can be skipped.
[0056] In one embodiment, the specific process of skipping the vertical ternary tree partition decision and the quadtree partition decision of the current coding area may be as follows:
[0057] The second skip flag corresponding to the vertical ternary tree partition decision and the quadtree partition decision of the current coding area is set to a true value. Before making the vertical ternary tree partition decision and the quadtree partition decision of the current coding area, if it is detected that the second skip flag is a true value, the vertical ternary tree partition decision and the quadtree partition decision are skipped.
[0058] Among them, the vertical ternary tree division decision and the quadtree division decision of the current coding area can be pre-set with a second skip flag. If the second skip flag is a true value, the vertical ternary tree division decision and the quadtree division decision are skipped. If the second skip flag is a false value, the vertical ternary tree division decision and the quadtree division decision are not skipped. When the first optimal division type is vertical binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is vertical division, the second skip flag of the current coding area can be selected to be set to a true value. Therefore, before the vertical ternary tree division decision and the quadtree division decision of the current coding area need to be made, the second skip flag can be detected to determine whether to skip the vertical ternary tree division decision and the quadtree division decision.
[0059] In one embodiment, the vertical ternary tree division decision and the quadtree division decision corresponding to the current coding area may be set with a second execution flag. If the second execution flag is a true value, the vertical ternary tree division decision and the quadtree division decision are executed. If the second execution flag is a false value, the vertical ternary tree division decision and the quadtree division decision are skipped. When the first optimal division type is vertical binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is vertical division, the second execution flag corresponding to the current coding area can be selected to be set to a false value. Therefore, before the vertical ternary tree division decision and the quadtree division decision of the current coding area need to be made, it can be determined whether to execute the vertical ternary tree division decision and the quadtree division decision by detecting the second execution flag.
[0060] As described above, by determining the division type information corresponding to the first division depth and the second division depth respectively, the optimal division result of the binary tree division can be combined to identify the optimal division direction with a higher probability corresponding to the current coding area, which is helpful to accurately determine the tree division decision of other division directions that need to be skipped.
[0061] Figure 5 A flowchart of a method for determining a partition type of a video encoding including skipping a tree partition decision process including a horizontal partition direction is provided in an embodiment of the present application. Figure 5 As shown, the following steps are included:
[0062] Step S301: When the binary tree partition decision is completed in the current coding area, the partition type information corresponding to the first partition depth, the number of coding units corresponding to the second partition depth, and the second optimal partition type of each coding unit are obtained, wherein the partition type information includes the first optimal partition type, the first rate-distortion cost corresponding to the vertical binary tree partition, and the second rate-distortion cost corresponding to the horizontal binary tree partition, and the second partition depth is greater than the first partition depth.
[0063] Step S302: compare the number of coding units with a preset number threshold.
[0064] Step S303: When the first optimal division type is vertical binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is vertical division, skip the horizontal ternary tree division decision and the quadtree division decision of the current coding area.
[0065] Step S304: When the first optimal division type is horizontal binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is horizontal division, skip the vertical ternary tree division decision and the quadtree division decision of the current coding area.
[0066] Step S305: When the first optimal division type is vertical binary tree division, the number of coding units is less than a preset number threshold, the first rate-distortion cost is less than a first preset ratio of the second rate-distortion cost, and the second optimal division type of each coding unit is vertical division, skip the horizontal ternary tree division decision and the quadtree division decision of the current coding area.
[0067] Among them, if the first optimal division type is vertical binary tree division, it can be preliminarily determined that the preferred division direction of the current coding area is the vertical division direction. However, since the number of coding units is less than the preset number threshold, the texture information of the current coding area cannot be effectively represented. Therefore, in addition to referring to the second optimal division type of each coding unit, it is also necessary to refer to the comparison results of the rate-distortion costs corresponding to the vertical binary tree division and the horizontal binary tree division. In order to ensure that the vertical division direction is the optimal division direction with a higher probability corresponding to the current coding area, in addition to determining that the second optimal division type of each coding unit is vertical division, it is also necessary to determine the first preset ratio of the first rate-distortion cost to the second rate-distortion cost. The first preset ratio can be 0.4 or 0.5, etc., to increase the possibility that the vertical division direction is the optimal division direction corresponding to the current coding area.
[0068] As mentioned above, for the case where the first optimal division type is vertical binary tree division and the second optimal division type for each coding unit is vertical division, but the number of coding units is less than the preset number threshold, it can be determined that the first rate-distortion cost is less than the first preset ratio of the second rate-distortion cost, so that the vertical binary tree division is more closely matched with the current coding area than the horizontal binary tree division, and the vertical division direction is more likely to be the optimal division direction corresponding to the current coding area, thereby ensuring that the coding quality loss caused by skipping the horizontal ternary tree division decision and the quadtree division decision of the current coding area is small.
[0069] Figure 6 A flowchart of a method for determining a partition type of a video encoding including skipping a tree partition decision process including a vertical partition direction is provided in an embodiment of the present application. Figure 6 As shown, the following steps are included:
[0070] Step S401, when the binary tree partition decision is completed in the current coding area, obtain the partition type information corresponding to the first partition depth, the number of coding units corresponding to the second partition depth, and the second optimal partition type of each coding unit, wherein the partition type information includes the first optimal partition type, the first rate-distortion cost corresponding to the vertical binary tree partition, and the second rate-distortion cost corresponding to the horizontal binary tree partition, and the second partition depth is greater than the first partition depth.
[0071] Step S402: Compare the number of coding units with a preset number threshold.
[0072] Step S403: When the first optimal division type is vertical binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is vertical division, skip the horizontal ternary tree division decision and the quadtree division decision of the current coding area.
[0073] Step S404: When the first optimal division type is horizontal binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is horizontal division, skip the vertical ternary tree division decision and the quadtree division decision of the current coding area.
[0074] Step S405: When the first optimal division type is vertical binary tree division, the number of coding units is less than a preset number threshold, the first rate-distortion cost is less than a first preset ratio of the second rate-distortion cost, and the second optimal division type of each coding unit is vertical division, skip the horizontal ternary tree division decision and the quadtree division decision of the current coding area.
[0075] Step S406: When the first optimal division type is horizontal binary tree division, the number of coding units is less than a preset number threshold, the second rate-distortion cost is less than a second preset ratio of the first rate-distortion cost, and the second optimal division type of each coding unit is horizontal division, skip the vertical ternary tree division decision and the quadtree division decision of the current coding area.
[0076] Among them, if the first optimal division type is horizontal binary tree division, it can be preliminarily determined that the better division direction of the current coding area is the horizontal division direction. However, since the number of coding units is less than the preset number threshold, the texture information of the current coding area cannot be effectively characterized. Therefore, in addition to referring to the second optimal division type of each coding unit, it is also necessary to refer to the comparison results of the rate-distortion costs corresponding to the vertical binary tree division and the horizontal binary tree division. In order to ensure that the horizontal division direction is the optimal division direction with a higher probability corresponding to the current coding area, in addition to determining that the second optimal division type of each coding unit is horizontal division, it is also necessary to determine the second preset ratio of the second rate-distortion cost to the first rate-distortion cost. The second preset ratio can be 0.4 or 0.5, etc., to increase the possibility that the horizontal division direction is the optimal division direction corresponding to the current coding area.
[0077] As mentioned above, for the case where the first optimal division type is horizontal binary tree division and the second optimal division type for each coding unit is horizontal division, but the number of coding units is less than the preset number threshold, it can be determined that the second rate-distortion cost is less than the second preset ratio of the first rate-distortion cost, so that the horizontal binary tree division is more closely matched with the current coding area than the vertical binary tree division, and the horizontal division direction is more likely to be the optimal division direction corresponding to the current coding area, thereby ensuring that the coding quality loss caused by skipping the vertical ternary tree division decision and the quadtree division decision of the current coding area is small.
[0078] Figure 7 A flowchart of a video coding method including a method of performing a tree-type partition decision process of skipping other partition directions according to a preset skip flag is provided in an embodiment of the present application. Figure 7 As shown, the following steps are included:
[0079] Step S501: When a binary tree partitioning decision is completed in the current coding area, the partitioning type information corresponding to the first partitioning depth, the number of coding units corresponding to the second partitioning depth, and the second optimal partitioning type of each coding unit are obtained, wherein the partitioning type information includes the first optimal partitioning type, and the second partitioning depth is greater than the first partitioning depth.
[0080] Step S502: Compare the number of coding units with a preset number threshold.
[0081] Step S503: When the first optimal division type is a binary tree division of a preset division direction, the number of coding units is greater than or equal to a preset number threshold, and the second optimal division type of each coding unit is a division type of a preset division direction, a preset skip flag corresponding to a tree division decision of the current coding area including other division directions is set to a true value; before making a tree division decision of the current coding area including other division directions, if it is detected that the preset skip flag is a true value, the tree division decision including other division directions is skipped.
[0082] Among them, the tree-type partitioning decision including other partitioning directions of the current coding area can be pre-set with a preset skip flag. If the preset skip flag is a true value, the tree-type partitioning decision including other partitioning directions is skipped. If the preset skip flag is a false value, the tree-type partitioning decision including other partitioning directions is not skipped. In the case where the first optimal partitioning type is a binary tree partitioning of a preset partitioning direction, the number of coding units is greater than or equal to a preset number threshold, and the second optimal partitioning type of each coding unit is a partitioning type of a preset partitioning direction, the preset skip flag of the current coding area can be selected to be set to a true value. Therefore, before the tree-type partitioning decision including other partitioning directions of the current coding area needs to be made, it can be determined whether to skip the tree-type partitioning decision including other partitioning directions by detecting the preset skip flag.
[0083] In one embodiment, the tree-type partitioning decision including other partitioning directions corresponding to the current coding region may be set with a preset execution flag. If the preset execution flag is a true value, the tree-type partitioning decision including other partitioning directions is executed. If the preset execution flag is a false value, the tree-type partitioning decision including other partitioning directions is skipped. When the first optimal partitioning type is a binary tree partitioning of a preset partitioning direction, the number of coding units is greater than or equal to a preset number threshold, and the second optimal partitioning type of each coding unit is a partitioning type of a preset partitioning direction, the preset execution flag corresponding to the current coding region may be selected to be set to a false value. Therefore, before the tree-type partitioning decision including other partitioning directions of the current coding region needs to be made, it may be determined whether to execute the tree-type partitioning decision including other partitioning directions by detecting the preset execution flag.
[0084] As described above, by setting a preset skip flag for the tree partitioning decision including other partitioning directions, it is possible to effectively identify whether the tree partitioning decision to be executed needs to be skipped, which is helpful for quickly judging whether the decision needs to be skipped, and is also beneficial for developers' maintenance and debugging.
[0085] Figure 8 A flowchart of a video coding method for determining a partition type including a tree partition decision process for executing other partition directions of a current coding region provided by an embodiment of the present application. Figure 8As shown, the following steps are included:
[0086] Step S601: When a binary tree partitioning decision is completed in the current coding area, the partitioning type information corresponding to the first partitioning depth, the number of coding units corresponding to the second partitioning depth, and the second optimal partitioning type of each coding unit are obtained, wherein the partitioning type information includes the first optimal partitioning type, and the second partitioning depth is greater than the first partitioning depth.
[0087] Step S602: Compare the number of coding units with a preset number threshold.
[0088] Step S603: When the first optimal division type is a binary tree division in a preset division direction, the number of coding units is greater than or equal to a preset number threshold, and the second optimal division type of each coding unit is a division type in a preset division direction, skip the tree division decision containing other division directions of the current coding area.
[0089] Step S604: When the first optimal division type is a binary tree division in a preset division direction and there is a second optimal division type of a coding unit that is a division type in other division directions, a tree division decision including other division directions is executed for the current coding area.
[0090] Among them, if the first optimal division type is a binary tree division of a preset division direction, but there is a second optimal division type of a coding unit that is a division type of other division directions, it can be regarded as that the probability that the preset division direction cannot be determined as the optimal division direction of the current coding area is high, and there is still a certain possibility that the optimal division type exists in the tree division type containing other division directions. Therefore, it is necessary to execute a tree division decision containing other division directions for the current coding area.
[0091] As described above, when there is a second optimal partition type in the coding unit that does not conform to the preset partition direction, it is possible to choose to execute tree-type partition decisions in other partition directions to avoid causing a large coding quality loss and ensure the video coding effect.
[0092] Fig. 9 This is a structural block diagram of a video coding partition type decision device provided in an embodiment of the present application. The device is configured to execute the video coding partition type decision method provided in the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. Fig. 9 As shown, the device specifically includes:
[0093] The partition information acquisition module 301 is configured to acquire, when a binary tree partition decision is completed for a current coding region, partition type information corresponding to a first partition depth, the number of coding units corresponding to a second partition depth, and a second optimal partition type for each coding unit, wherein the partition type information includes the first optimal partition type, and the second partition depth is greater than the first partition depth;
[0094] A unit quantity comparison module 302 is configured to compare the number of coding units with a preset number threshold;
[0095] The partition decision skipping module 303 is configured to skip the tree partition decision containing other partition directions of the current coding area when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to a preset number threshold, and the second optimal partition type of each coding unit is a partition type of a preset partition direction.
[0096] In the above, by completing the binary tree partition decision in the current coding area, the partition type information corresponding to the first partition depth, the number of coding units corresponding to the second partition depth, and the second optimal partition type of each coding unit are obtained, wherein the partition type information includes the first optimal partition type, and the second partition depth is greater than the first partition depth; then, the number of coding units is compared with a preset number threshold; finally, when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each coding unit is a partition type of a preset partition direction, the tree partition decision containing other partition directions of the current coding area is skipped. In the above scheme, by obtaining the division type information corresponding to different division depths, the optimal coding unit division information after the binary tree division decision can be effectively referenced, providing a reliable basis for determining whether to skip other tree-type division decisions; according to the comparison results of the number of coding units and the preset number threshold and the statistics of the optimal division type at different division depths, the texture information of the current coding area can be reasonably used to effectively identify the optimal division direction and determine whether the tree-type division decision containing other division directions in the current coding area is skipped. Under the premise of less loss of encoding quality, the decision of the type to be divided with a smaller optimal probability is skipped, the computational complexity of the video encoder is reduced, the encoding speed is increased, and the video encoding efficiency is improved. In addition, the computing resource utilization rate of the server side is improved, the server cost is saved, and the CPU utilization rate of the client side is reduced, further improving the user experience.
[0097] In a possible embodiment, the partition decision skipping module 303 is configured as follows:
[0098] When the first optimal partition type is vertical binary tree partition, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each coding unit is vertical partition, skip the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area;
[0099] When the first optimal division type is horizontal binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each coding unit is horizontal division, the vertical ternary tree division decision and the quadtree division decision of the current coding area are skipped.
[0100] In a possible embodiment, it further includes a first skip decision module configured to:
[0101] When the first optimal division type is vertical binary tree division, the number of coding units is less than a preset number threshold, the first rate-distortion cost is less than a first preset ratio of the second rate-distortion cost, and the second optimal division type of each coding unit is vertical division, the horizontal ternary tree division decision and the quadtree division decision of the current coding area are skipped.
[0102] In a possible embodiment, a second skip decision module is further included, configured to:
[0103] When the first optimal division type is horizontal binary tree division, the number of coding units is less than a preset number threshold, the second rate-distortion cost is less than a second preset ratio of the first rate-distortion cost, and the second optimal division type of each coding unit is horizontal division, the vertical ternary tree division decision and the quadtree division decision of the current coding area are skipped.
[0104] In a possible embodiment, the partition decision skipping module 303 is further configured to:
[0105] The preset skip flag corresponding to the tree-type partition decision of the current coding area containing other partition directions is set to a true value. Before making the tree-type partition decision of the current coding area containing other partition directions, if it is detected that the preset skip flag is a true value, the tree-type partition decision containing other partition directions is skipped.
[0106] In a possible embodiment, the first skip decision module is further configured to:
[0107] The first skip flag corresponding to the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area is set to a true value. Before making the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area, if it is detected that the first skip flag is a true value, the horizontal ternary tree partition decision and the quadtree partition decision are skipped.
[0108] In a possible embodiment, it further includes a partition decision execution module configured as follows:
[0109] When the first optimal partition type is a binary tree partition in a preset partition direction and there is a second optimal partition type of the coding unit that is a partition type in other partition directions, a tree partition decision including other partition directions is executed for the current coding area.
[0110] Fig.10 A schematic diagram of the structure of a video coding division type decision device provided in an embodiment of the present application, such as Fig.10 As shown, the device includes a processor 401, a memory 402, an input device 403 and an output device 404; the number of processors 401 in the device can be one or more. Fig.10 A processor 401 is taken as an example; the processor 401, memory 402, input device 403 and output device 404 in the device can be connected by a bus or other means. Fig.10 The example of connecting through a bus is taken. The memory 402, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for deciding the division type of video coding in the embodiment of the present application. The processor 401 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 402, that is, implements the above-mentioned method for deciding the division type of video coding. The input device 403 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 404 may include a display device such as a display screen.
[0111] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a video encoding partition type decision method described in the above embodiment, which includes: when a binary tree partition decision is completed in the current coding area, obtaining partition type information corresponding to the first partition depth, the number of coding units corresponding to the second partition depth, and the second optimal partition type of each coding unit, wherein the partition type information includes the first optimal partition type, the second partition depth is greater than the first partition depth, the number of coding units is compared with a preset number threshold, and when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each coding unit is a partition type of a preset partition direction, skipping the tree partition decision containing other partition directions of the current coding area.
[0112] It is worth noting that in the embodiment of the above-mentioned video encoding division type decision device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0113] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is configured to enable the computer device to execute the steps of the method according to various exemplary implementations of the present application described above in this specification. For example, the computer device may execute the video coding partition type decision method recorded in the embodiment of the present application. The program product may be implemented in any combination of one or more readable media.
Claims
1. A video coding partition type decision method, characterized in that: include: In the case where a binary tree partition decision is completed for the current coding region, partition type information corresponding to a first partition depth, the number of coding units corresponding to a second partition depth, and a second optimal partition type for each coding unit are obtained, wherein the partition type information includes a first optimal partition type, and the second partition depth is greater than the first partition depth; Comparing the number of encoding units with a preset number threshold; When the first optimal division type is a binary tree division in a preset division direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each of the coding units is a division type in a preset division direction, the tree division decision including other division directions of the current coding area is skipped.
2. The video coding partition type decision method according to claim 1, characterized in that: The step of skipping a tree partition decision including other partition directions of the current coding region when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each coding unit is a partition type of a preset partition direction, comprises: When the first optimal division type is vertical binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each of the coding units is vertical division, skipping the horizontal ternary tree division decision and the quadtree division decision of the current coding area; When the first optimal division type is horizontal binary tree division, the number of coding units is greater than or equal to the preset number threshold, and the second optimal division type of each of the coding units is horizontal division, the vertical ternary tree division decision and the quadtree division decision of the current coding area are skipped.
3. The video coding partition type decision method according to claim 2, characterized in that: The partition type information also includes a first rate-distortion cost corresponding to the vertical binary tree partition and a second rate-distortion cost corresponding to the horizontal binary tree partition. The method further includes: When the first optimal division type is vertical binary tree division, the number of coding units is less than the preset number threshold, the first rate-distortion cost is less than a first preset ratio of the second rate-distortion cost, and the second optimal division type of each of the coding units is vertical division, the horizontal ternary tree division decision and the quadtree division decision of the current coding area are skipped.
4. The video coding partition type decision method according to claim 3, characterized in that: The method further comprises: When the first optimal division type is horizontal binary tree division, the number of coding units is less than the preset number threshold, the second rate-distortion cost is less than a second preset ratio of the first rate-distortion cost, and the second optimal division type of each coding unit is horizontal division, the vertical ternary tree division decision and the quadtree division decision of the current coding area are skipped.
5. The video coding partition type decision method according to claim 1, characterized in that: The decision to skip the tree partitioning of the current coding region including other partitioning directions includes: The preset skip flag corresponding to the tree-type partition decision including other partition directions of the current coding area is set to a true value. Before making the tree-type partition decision including other partition directions of the current coding area, if it is detected that the preset skip flag is a true value, the tree-type partition decision including other partition directions is skipped.
6. The video coding partition type decision method according to claim 2, characterized in that: The skipping of the horizontal ternary tree partitioning decision and the quadtree partitioning decision of the current coding area comprises: The first skip flag corresponding to the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area is set to a true value. Before making the horizontal ternary tree partition decision and the quadtree partition decision of the current coding area, if it is detected that the first skip flag is a true value, the horizontal ternary tree partition decision and the quadtree partition decision are skipped.
7. The video coding partition type decision method according to any one of claims 1 to 6, characterized in that: The method further comprises: When the first optimal partition type is a binary tree partition in a preset partition direction and there is a second optimal partition type of a coding unit that is a partition type in other partition directions, a tree partition decision including other partition directions is executed for the current coding area.
8. A video coding partition type decision device, characterized in that: include: a partition information acquisition module, configured to, when a binary tree partition decision is completed for a current coding region, acquire partition type information corresponding to a first partition depth, the number of coding units corresponding to a second partition depth, and a second optimal partition type for each coding unit, wherein the partition type information includes a first optimal partition type, and the second partition depth is greater than the first partition depth; A unit quantity comparison module, configured to compare the number of encoding units with a preset quantity threshold; The partition decision skipping module is configured to skip the tree partition decision containing other partition directions of the current coding area when the first optimal partition type is a binary tree partition of a preset partition direction, the number of coding units is greater than or equal to the preset number threshold, and the second optimal partition type of each of the coding units is a partition type of the preset partition direction.
9. A video coding partition type decision device, the device comprising: one or more processors; A storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the video coding partition type decision method described in any one of claims 1-7.
10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the video coding partition type decision method according to any one of claims 1 to 7 when executed by a computer processor.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the partition type decision method for video coding according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Method, apparatus and device for determining partitioning type in video encoding, and storage medium
WO2026001650A1
