Video encoding method and apparatus

CN116471407BActive Publication Date: 2026-09-04SHANGHAI BILIBILI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310580663.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-22
Publication Date
2026-09-04
Estimated Expiration
2043-05-22

AI Technical Summary

Technical Problem

其中,在块划分阶段,对块的不同划分方式,可能会影响后续的率失真等

Benefits of technology

[0044]不同于分别计算每个子块的率失真,本实施例的方式是:先计算第一个子块的率失真;基于第一个子块的率失真去预估其他剩余子块的预测率失真;继而,根据其他剩余子块的预测率失真之和与第一预设率失真阈值比较,决定是否弃用第一划分策略。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116471407B_ABST
    Figure CN116471407B_ABST
Patent Text Reader

Abstract

The application provides a video coding method, which comprises the following steps: obtaining the rate-distortion of a first sub-block in N sub-blocks, wherein the N sub-blocks are obtained according to a first partition strategy, N is a natural number greater than 1; obtaining the predicted rate-distortion of N-1 remaining sub-blocks according to the rate-distortion of the first sub-block; wherein the N-1 remaining sub-blocks comprise the remaining sub-blocks in the N sub-blocks except the first sub-block; and performing a first determination operation, wherein the first determination operation comprises: determining to discard the first partition strategy when the sum of the predicted rate-distortions of the N-1 remaining sub-blocks is greater than a first preset rate-distortion threshold. The application also provides a video coding device, a computer device and a computer readable storage medium. The technical scheme provided by the application can effectively save the computing resources consumed in calculating the rate-distortion of each sub-block and accelerate the coding speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of computer and video technologies, more and more video coding standards have been proposed, such as HEVC (High Efficiency Video Coding) and AV1 (Alliance for OpenMediaVideo).

[0003] Video encoding generally includes operations such as block partitioning, prediction, data transformation, quantization, entropy coding, and filtering. Among these, the different partitioning methods used in the block partitioning stage can affect subsequent rate-distortion and other parameters. The inventors have learned that selecting or excluding partitioning methods is generally very computationally intensive, and therefore a significant factor affecting encoding speed.

[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the Invention

[0005] The purpose of this application is to provide a video encoding method, apparatus, computer device, and computer-readable storage medium to solve the above-mentioned problems.

[0006] One aspect of this application provides a video encoding method, the method comprising:

[0007] Obtain the rate distortion of the first sub-block among N sub-blocks, wherein the N sub-blocks are obtained according to a first partitioning strategy, and N is a natural number greater than 1;

[0008] Based on the rate distortion of the first sub-block, the prediction rate distortion of each of the remaining N-1 sub-blocks is obtained; wherein, the remaining N-1 sub-blocks include the remaining sub-blocks other than the first sub-block among the N sub-blocks; and

[0009] Perform a first determination operation, wherein the first determination operation includes: if the sum of the prediction rate distortion of the remaining N-1 sub-blocks is greater than a first preset rate distortion threshold, determine to discard the first partitioning strategy.

[0010] Preferably, based on the rate-distortion of the first sub-block, the prediction rate-distortion of each of the remaining N-1 sub-blocks is obtained, including:

[0011] Determine the approximation rate distortion corresponding to the first sub-block; wherein, the approximation rate distortion of the first sub-block is the sum of the approximation rate distortions of multiple pre-analysis blocks within the range of the first sub-block, and the pre-analysis blocks are obtained in the pre-analysis operation;

[0012] Determine the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, wherein the approximation rate distortion of each of the N-1 remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding remaining sub-block range;

[0013] The prediction rate distortion of each of the N-1 remaining sub-blocks is determined based on the approximation rate distortion corresponding to the first sub-block, the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, and the rate distortion of the first sub-block.

[0014] Preferably, the first partitioning strategy is one of multiple partitioning strategies, each corresponding to a total rate distortion; the first preset rate distortion threshold is obtained through the following operation:

[0015] Based on multiple total rate distortions corresponding to multiple other partitioning strategies, the minimum total rate distortion among the multiple total rate distortions is obtained; wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy among the multiple partitioning strategies;

[0016] The rate-distortion of the flag bits of the N sub-blocks is obtained; wherein the flag bits are used to indicate the division of the N sub-blocks;

[0017] The first preset rate distortion threshold is obtained based on the minimum total rate distortion, the rate distortion of the flag bits of the N sub-blocks, and the rate distortion of the first sub-block.

[0018] Preferably, the method further includes:

[0019] If the sum of the prediction rate distortions of the remaining N-1 sub-blocks is not greater than the first preset rate distortion threshold, a second determination operation is performed for the first partitioning strategy; wherein, the second determination operation includes:

[0020] Rate distortion of the second sub-block;

[0021] Based on the rate distortion of the first sub-block and the rate distortion of the second sub-block, the prediction rate distortion of each of the remaining N-2 sub-blocks is obtained; wherein, the remaining N-2 sub-blocks include the sub-blocks remaining from the N sub-blocks excluding the first and second sub-blocks; and

[0022] If the sum of the prediction rate distortion of the remaining N-2 sub-blocks is greater than the second preset rate distortion threshold, the first partitioning strategy is discarded.

[0023] Preferably, the method further includes:

[0024] If the sum of the prediction rate distortion of the remaining N-2 sub-blocks is not greater than the second preset rate distortion threshold, a third determination operation is performed for the first partitioning strategy.

[0025] Specifically: during the execution of the third determination operation and each subsequent determination operation, the rate distortion of one of the remaining sub-blocks in the previous determination operation is obtained, and the determination operation for the first partitioning strategy is repeatedly executed according to different predicted rate distortions until the first partitioning strategy is discarded or the last determination operation is executed.

[0026] Preferably, in the second determination operation or each subsequent determination operation, the prediction rate distortion of the respective remaining sub-blocks is obtained through the following operation:

[0027] Determine the approximation rate distortion corresponding to each of the first M sub-blocks; wherein, the approximation rate distortion of each sub-block in the first M sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, 2≤M≤N-1, where M is a natural number;

[0028] Determine the approximation rate distortion for each of the NM remaining sub-blocks; wherein the approximation rate distortion of each of the NM remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, and the NM remaining sub-blocks include the remaining sub-blocks excluding the first M sub-blocks from the N sub-blocks; and

[0029] The prediction rate distortion of the NM remaining sub-blocks is determined based on the approximation rate distortion of the first M sub-blocks, the approximation rate distortion of the NM remaining sub-blocks, and the rate distortion of the first M sub-blocks.

[0030] Preferably, the first partitioning strategy is one of multiple partitioning strategies, each partitioning strategy corresponding to a total rate distortion; in the second determination operation or each subsequent determination operation, the preset rate distortion threshold in the corresponding determination operation is obtained through the following operations:

[0031] Based on multiple total rate distortions corresponding to multiple other partitioning strategies, the minimum total rate distortion among the multiple total rate distortions is obtained; wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy among the multiple partitioning strategies;

[0032] The rate-distortion of the flag bits of the N sub-blocks is obtained; wherein the flag bits are used to indicate the division of the N sub-blocks;

[0033] The corresponding preset rate distortion threshold is obtained based on the minimum total rate distortion, the rate distortion of the flag bits of the N sub-blocks, and the rate distortion of the first M sub-blocks; where 2≤M≤N-1, and M is a natural number.

[0034] Another aspect of this application provides a video encoding apparatus, the apparatus comprising:

[0035] The first acquisition module is used to acquire the rate distortion of the first sub-block among N sub-blocks, wherein the N sub-blocks are obtained according to the first partitioning strategy, and N is a natural number greater than 1;

[0036] The second acquisition module is used to acquire the prediction rate distortion of each of the remaining N-1 sub-blocks based on the rate distortion of the first sub-block; wherein, the remaining N-1 sub-blocks include the remaining sub-blocks other than the first sub-block among the N sub-blocks; and

[0037] An execution module is used to perform a first determination operation, wherein the first determination operation includes: determining to discard the first partitioning strategy when the sum of the prediction rate distortion of the remaining N-1 sub-blocks is greater than a first preset rate distortion threshold.

[0038] Another aspect of this application provides a computer device, including:

[0039] At least one processor; and

[0040] A memory communicatively connected to the at least one processor; wherein:

[0041] The memory stores computer instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described above.

[0042] Another aspect of this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method described above.

[0043] The technical solution provided in this application has the following advantages:

[0044] Unlike calculating the rate distortion of each sub-block separately, this embodiment calculates the rate distortion of the first sub-block first; then estimates the predicted rate distortion of the remaining sub-blocks based on the rate distortion of the first sub-block; and finally, determines whether to abandon the first partitioning strategy by comparing the sum of the predicted rate distortions of the remaining sub-blocks with a first preset rate distortion threshold.

[0045] Therefore, in this embodiment, it is often not necessary to calculate the rate distortion of each sub-block. Instead, the rate distortion of the first sub-block is calculated, and the predicted rate distortion of the remaining sub-blocks is obtained based on the rate distortion of the first sub-block. This can effectively save the computing resources consumed by calculating the rate distortion of each sub-block, thereby speeding up the encoding process. Attached Figure Description

[0046] Figure 1 The illustration shows multiple CTUs on a single screen;

[0047] Figure 2 The block partitioning for the CTU is illustrated schematically;

[0048] Figure 3 This diagram schematically illustrates the operating environment of the video encoding method according to Embodiment 1 of this application;

[0049] Figure 4 A flowchart illustrating a video encoding method according to Embodiment 1 of this application is shown schematically;

[0050] Figure 5 The flowchart of the sub-steps of step S402 is shown schematically;

[0051] Figure 6 The calculation process for the preset rate distortion threshold is illustrated schematically;

[0052] Figure 7 The flowchart illustrating the additional steps of the video encoding method according to Embodiment 1 of this application is shown in the illustration.

[0053] Figure 8 This schematically illustrates a flowchart for determining whether to deprecate an exemplary partitioning strategy;

[0054] Figure 9 A block diagram of a video encoding apparatus according to Embodiment 2 of this application is shown schematically;

[0055] Figure 10 A schematic diagram of the hardware architecture of a computer device according to Embodiment 3 of this application is shown. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0057] It should be noted that the descriptions involving "first," "second," etc., in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0058] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order of the steps, but are only used to facilitate the description of this application and to distinguish each step, and therefore should not be construed as a limitation of this application.

[0059] Explanation of terms used in this application:

[0060] HEVC (High Efficiency Video Coding) is an international video coding standard jointly developed by ITU-T and ISO.

[0061] AV1 (Alliance for OpenMedia Video1) is a royalty-free video coding standard developed by the Alliance for Open Media. Depending on the use case, AV1 can achieve higher compression efficiency than VP9 and H.264 / AVC (Advanced Video Coding).

[0062] CTU (Coding Tree Unit) is a unit used for coding tree operations.

[0063] CU (Coding Unit)

[0064] RD (Rate Distortion) refers to rate distortion.

[0065] QP (Quantization Parameter) is a parameter used for quantization.

[0066] To facilitate understanding of the technical solutions provided in the embodiments of this application by those skilled in the art, the relevant technologies are described below:

[0067] The encoding process generally includes the following steps: partitioning, prediction, transformation, quantization, entropy coding, filtering, etc.

[0068] During the segmentation phase, considering the characteristics of high-definition / ultra-high-definition video, standards such as H.265 / HEVC and AV1 introduced a CTU or similar structure, the size of which is specified by the encoder. For example... Figure 1 As shown, an image can be divided into several non-overlapping CTUs. Within a CTU, a cyclic hierarchical structure based on a quadtree can be used. A CTU may contain one sub-block (CU) or may be divided into multiple sub-blocks. A sub-block can be further subdivided into multiple smaller sub-blocks according to a quadtree structure.

[0069] like Figure 2 As shown, when encoding a CTU, you can encode it as a whole, or you can choose to divide it into several sub-blocks and encode them separately. For sub-blocks, you can choose to encode the sub-block as a whole, or you can choose to subdivide the sub-block and encode them separately.

[0070] There are several ways to divide sub-blocks, such as dividing them into four equal parts (SPLIT) or two equal parts (HORZ, VERT).

[0071] Different ways of dividing sub-blocks will affect the encoding performance in the subsequent encoding process.

[0072] Quantization refers to the process of mapping continuous values ​​(or a large number of possible discrete values) of a signal to a finite number of discrete values; it is a many-to-one mapping. In video coding, after the residual signal undergoes transforms such as discrete cosine transforms, the transform coefficients typically have a large range. Therefore, quantizing the transform coefficients can effectively reduce the signal value space, thereby obtaining a suitable bit rate. However, due to the many-to-one mapping nature, the quantization process inevitably introduces data loss. Quantization is a significant source of video distortion in video coding.

[0073] In video coding, both distortion and bitrate are factors affecting coding performance. Distortion reflects video quality, while bitrate reflects compression efficiency. Reducing distortion generally increases bitrate, and vice versa. Therefore, to balance distortion and bitrate, video coding introduces the concept of rate-distortion cost. Rate-distortion cost comprehensively considers the effects of distortion (D) and bitrate (R). During encoding, a lower rate-distortion cost is better. For ease of explanation, this paper will simply refer to rate-distortion cost as rate-distortion.

[0074] Returning to the earlier point, different ways of dividing sub-blocks will affect rate distortion, i.e., produce different costs. Therefore, how to divide sub-blocks to minimize rate distortion becomes an important direction for optimization during encoding.

[0075] The inventors have learned that a rate-distortion-based decision method can be used when selecting the encoding method for the CU. For ease of explanation, let's take the example of examining whether the CU should be encoded into four equal-sized sub-blocks. Let the rate-distortion of the flag indicating the division into four sub-blocks be RD. split The rate distortion of the four sub-blocks are RD sub0 RD sub1 RD sub2 RD sub3 The total rate distortion corresponding to the division into the four sub-blocks is as follows:

[0076] RD 4sub =RD split +RD sub0 +RD sub1 +RD sub2 +RD sub3

[0077] Suppose that among the total distortions of other CU partitioning methods, the minimum value is RD. temp_min If RD 4sub <RD temp_min If so, the CU is divided into 4 sub-blocks and then encoded. Otherwise, it is selected to be related to RD. temp_min The corresponding partitioning method encoding.

[0078] As can be seen, the above method requires calculating the rate-distortion of all sub-blocks before comparing the total rate-distortion and determining the partitioning method. However, calculating the rate-distortion of sub-blocks is very computationally intensive, especially when there are many partitioning methods.

[0079] In view of this, the embodiments of this application aim to provide a video encoding scheme that can terminate sub-block evaluation in advance, reduce the number of rate distortion calculations, that is, reduce the number of sub-blocks that need to be calculated for rate distortion, and speed up video encoding.

[0080] The following provides an exemplary application environment for this application, which, for example, can be used as follows: Figure 3 Computer devices 2 and 6 (or shown) Figure 10 The computer device shown is 10000.

[0081] Computer device 10000 can be configured to access server content (such as video) and services.

[0082] Computer device 10000 may include electronic devices with built-in or external display panels, such as mobile devices, tablets, laptops, workstations, virtual reality devices, gaming devices, digital streaming media devices, vehicle user terminals, smart TVs, set-top boxes, etc., and may also include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc.

[0083] Computer device 10000 can be associated with one or more users. A single user can also use one or more of computer devices 10000 to access the server. Computer device 10000 can travel to various locations and use different networks to access the server. Computer device 10000 can include multiple client programs, such as video codecs, for providing encoding and decoding services. The video codec can encode and compress video or images to facilitate their transmission or storage.

[0084] The following will provide several embodiments in the above exemplary application environment to illustrate the video encoding scheme.

[0085] Example 1

[0086] Figure 4 A flowchart illustrating a video encoding method according to Embodiment 1 of this application is shown schematically.

[0087] like Figure 4 As shown, the video encoding method may include steps S400 to S404, wherein:

[0088] Step S400: Obtain the rate distortion of the first sub-block among N sub-blocks, wherein the N sub-blocks are obtained according to the first partitioning strategy, and N is a natural number greater than 1.

[0089] Step S402: Based on the rate distortion of the first sub-block, obtain the prediction rate distortion of each of the N-1 remaining sub-blocks; wherein, the N-1 remaining sub-blocks include the remaining sub-blocks other than the first sub-block among the N sub-blocks.

[0090] Step S404: Perform the first determination operation, wherein the first determination operation includes: if the sum of the prediction rate distortion of the remaining N-1 sub-blocks is greater than a first preset rate distortion threshold, determine to discard the first partitioning strategy.

[0091] This embodiment can be used to decide whether to abandon one or more partitioning strategies, and to avoid using inappropriate partitioning strategies to divide blocks, thereby minimizing the impact on coding performance caused by inappropriate partitioning strategies.

[0092] Taking the first partitioning strategy as an example, the process for deciding whether to abandon the first partitioning strategy can be as follows:

[0093] First, a block is divided according to the first partitioning strategy to obtain multiple sub-blocks.

[0094] Second, unlike calculating the rate distortion of each sub-block separately, this embodiment calculates the rate distortion of the first sub-block first; then, based on the rate distortion of the first sub-block, it estimates the predicted rate distortion of the remaining sub-blocks; and then, based on the sum of the predicted rate distortions of the remaining sub-blocks and the first preset rate distortion threshold, it decides whether to abandon the first partitioning strategy.

[0095] If the sum of the prediction rate distortion of the remaining sub-blocks is greater than the first preset rate distortion threshold, it indicates that using the first partitioning strategy will result in a large rate distortion during the encoding process, which in turn leads to low encoding efficiency.

[0096] As described above, in this embodiment, it may not be necessary to calculate the rate distortion of each sub-block. Instead, the rate distortion of the first sub-block is calculated, and the predicted rate distortion of the remaining sub-blocks is obtained based on the rate distortion of the first sub-block. Therefore, the computational resources consumed in calculating the rate distortion of each sub-block can be effectively saved, especially when there are many partitioning methods.

[0097] It should be noted that this embodiment can be used in various encoding formats, such as HEVC and AV1. The partitioning object can be a coding block (coding unit), a superblock, etc. Theoretically, the partitioning object can be a block at any level. In this embodiment, the partitioning object can be a block under a CTU, or a block corresponding to the CTU itself, etc.

[0098] It should be noted that in step S404, the prediction rate distortion and the first preset rate distortion threshold can be obtained in various ways.

[0099] The inventors have learned that among various encoding methods, the dual encoding method of pre-analysis plus master encoding, which has high encoding efficiency, has become one of the more ideal encoding methods for video. Pre-analysis involves dividing the image into blocks (e.g., dividing them into 8x8 blocks) and then calculating the approximation rate-distortion (RD) cost of each pre-analyzed block to evaluate the importance of each part of the image, thereby guiding the setting of the QP of each part during subsequent encoding.

[0100] In view of this, in an alternative embodiment, prediction rate distortion can be obtained by means of approximation rate distortion in pre-analysis.

[0101] Regarding the aforementioned prediction rate distortion:

[0102] like Figure 5As shown, step S402, "obtaining the prediction rate distortion of each of the N-1 remaining sub-blocks based on the rate distortion of the first sub-block," may include: Step S500, determining the approximation rate distortion corresponding to the first sub-block; wherein, the approximation rate distortion of the first sub-block is the sum of the approximation rate distortions of multiple pre-analysis blocks within the range of the first sub-block, and the pre-analysis blocks are obtained in the pre-analysis operation. Step S502, determining the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, wherein the approximation rate distortion of each of the N-1 remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the range of the corresponding remaining sub-block. Step S504, determining the prediction rate distortion of each of the N-1 remaining sub-blocks based on the approximation rate distortion corresponding to the first sub-block, the approximation rate distortions corresponding to each of the N-1 remaining sub-blocks, and the rate distortion of the first sub-block.

[0103] Regarding the first preset rate-distortion threshold:

[0104] The first partitioning strategy is one of multiple partitioning strategies, each corresponding to a different total rate distortion. In optional embodiments, such as... Figure 6 As shown, the first preset rate-distortion threshold can be obtained through the following steps: Step S600, based on multiple total rate-distortions corresponding to multiple other partitioning strategies, obtain the minimum total rate-distortion among the multiple total rate-distortions. Wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy. Step S602, obtain the rate-distortion of the flag bits of the N sub-blocks; wherein, the flag bits are used to indicate the partitioning of the N sub-blocks. Step S604, based on the minimum total rate-distortion, the rate-distortion of the flag bits of the N sub-blocks, and the rate-distortion of the first sub-block, obtain the first preset rate-distortion threshold.

[0105] For ease of understanding, let's take the first partitioning strategy of dividing into 4 sub-blocks as an example, and examine sub-blocks 0, 1, 2, and 3 in sequence.

[0106] Within sub-block i, the sum of the approximation rate distortion of all pre-analyzed blocks is rdsum. i (0≤i≤3).

[0107] The minimum total rate distortion corresponding to multiple other partitioning strategies is RD. temp_min .

[0108] The rate distortion of the flag bits indicating that the block is divided into 4 sub-blocks is RD. split .

[0109] c0 is a constant greater than 1.

[0110] Rate-distortion RD obtained from the first sub-block (sub-block 0) sub0 In the following circumstances:

[0111] First: Based on the rate distortion of the first sub-block (sub-block 0), obtain the prediction rate distortion of the second, third, and fourth sub-blocks (sub-blocks 1, 2, and 3).

[0112]

[0113]

[0114]

[0115] Second: Calculate the first preset rate-distortion threshold: (RD) temp_min -RD split -RD sub0 )·c0.

[0116] Third: Perform the first determination operation. For example, the following formula can be used to determine whether to discard the first partitioning strategy.

[0117]

[0118] If the above inequality holds, it is determined that using the first partitioning strategy would incur a higher cost during the encoding process, and therefore it is discarded.

[0119] In the above embodiments, based on the rate distortion of some sub-blocks (such as the first sub-block) and with the help of data obtained in the pre-analysis stage (approximate rate distortion), the predicted rate distortion of the remaining sub-blocks can be calculated. The calculated predicted rate distortion is used to determine whether the first partitioning strategy can be discarded, thereby comparing rate distortion with less computation.

[0120] In the above embodiments, the cost of rate distortion can be measured more accurately based on the calculation of the first preset rate distortion threshold.

[0121] Understandably, in many cases, steps S400-S404 are sufficient to determine whether to abandon the first partitioning strategy. However, in some cases, further judgment is required to determine whether to abandon the first partitioning strategy.

[0122] In an optional embodiment, if it cannot be determined whether to abandon the first partitioning strategy after steps S400-S404, for example, if the sum of the prediction rate distortion of the remaining N-1 sub-blocks is not greater than the first preset rate distortion threshold, then a second determination operation for the first partitioning strategy is performed. Figure 7As shown, the second determination operation may include: step S700, obtaining the rate distortion of the second sub-block; step S702, obtaining the prediction rate distortion of each of the N-2 remaining sub-blocks based on the rate distortion of the first sub-block and the rate distortion of the second sub-block; wherein, the N-2 remaining sub-blocks include the remaining sub-blocks among the N sub-blocks excluding the first sub-block and the second sub-block; and step S704, determining to discard the first partitioning strategy if the sum of the prediction rate distortions of the N-2 remaining sub-blocks is greater than a second preset rate distortion threshold.

[0123] To make it easier to understand, let's continue with the first partitioning strategy of dividing into 4 sub-blocks as an example, and examine sub-blocks 0, 1, 2, and 3 in sequence.

[0124] Once the rate-distortion of the first sub-block (sub-block 0) is calculated, and combined with the prediction rate-distortions of the second, third, and fourth sub-blocks (sub-blocks 1, 2, and 3), a decision is made as to whether to abandon the first partitioning strategy. If the decision is made to abandon it, other partitioning strategies are then examined. If it is impossible to decide whether to abandon the first partitioning strategy, the rate-distortion of the second sub-block (sub-block 1) is then obtained.

[0125] Based on the rate-distortion of the first and second sub-blocks (sub-blocks 0 and 1), and combined with the prediction rate-distortion of the third and fourth sub-blocks (sub-blocks 2 and 3), a decision is made as to whether to abandon the first partitioning strategy. If the first partitioning strategy is abandoned, the rate-distortion of the third and fourth sub-blocks (sub-blocks 2 and 3) does not need to be calculated again, and other partitioning strategies are further examined.

[0126] In the above embodiments, it can be further confirmed whether to abandon the first partitioning strategy, thereby speeding up the encoding process.

[0127] Understandably, steps S400-S404 and S700-S704 are often sufficient to determine whether to abandon the first partitioning strategy. However, in some cases, further judgment is required to determine whether to abandon the first partitioning strategy.

[0128] In an optional embodiment, the method further includes confirming whether to abandon the first partitioning strategy, as follows:

[0129] If the sum of the prediction rate distortion of the remaining N-2 sub-blocks is not greater than the second preset rate distortion threshold, a third determination operation is performed for the first partitioning strategy.

[0130] Specifically: during the execution of the third determination operation and each subsequent determination operation, the rate distortion of one of the remaining sub-blocks in the previous determination operation is obtained, and the determination operation for the first partitioning strategy is repeatedly executed according to different predicted rate distortions until the first partitioning strategy is discarded or the last determination operation is executed.

[0131] To make it easier to understand, let's continue with the first partitioning strategy of dividing into 4 sub-blocks as an example, and examine sub-blocks 0, 1, 2, and 3 in sequence.

[0132] As mentioned earlier, after calculating the rate-distortion of the first sub-block (sub-block 0), and combining it with the prediction rate-distortion of the second, third, and fourth sub-blocks (sub-blocks 1, 2, and 3), a decision is made on whether to abandon the first partitioning strategy. If the decision is made to abandon it, other partitioning strategies are then examined. If it is impossible to decide whether to abandon the first partitioning strategy, the rate-distortion of the second sub-block (sub-block 1) is then obtained.

[0133] Next, based on the rate-distortion of the first and second sub-blocks (sub-blocks 0 and 1), and combined with the prediction rate-distortion of the third and fourth sub-blocks (sub-blocks 2 and 3), a decision is made as to whether to abandon the first partitioning strategy. If the first partitioning strategy is abandoned, the rate-distortion of the third and fourth sub-blocks (sub-blocks 2 and 3) does not need to be calculated again, and other partitioning strategies are examined. If it is impossible to decide whether to abandon the first partitioning strategy, the rate-distortion of the third sub-block (sub-block 2) is then obtained.

[0134] Next, based on the rate-distortion of the first, second, and third sub-blocks (sub-blocks 0, 1, and 2), and combined with the prediction rate-distortion of the fourth sub-block (sub-block 3), a decision is made as to whether to abandon the first partitioning strategy. If the first partitioning strategy is abandoned, the rate-distortion of the fourth sub-block (sub-block 3) does not need to be calculated again, and other partitioning strategies are examined. If it is impossible to decide whether to abandon the first partitioning strategy, the rate-distortion of the fourth sub-block (sub-block 3) is obtained.

[0135] At this point, since the rate distortion of all four sub-blocks has been calculated, it can be determined whether to abandon the first partitioning strategy in the following way.

[0136] The rate distortion of the four sub-blocks are RD sub0 RD sub1 RD sub2 RD sub3 The total rate distortion of the four sub-blocks is then:

[0137] RD 4sub =RD split +RD sub0 +RD sub1 +RD sub2 +RD sub3

[0138] Among the various total distortions for other partitioning methods, the minimum value is RD. temp_min If RD 4sub <RD temp_min If so, the first partitioning strategy is used for encoding. Otherwise, the RD partitioning strategy is selected. temp_minThe corresponding partitioning strategy encoding.

[0139] In the first partitioning strategy of dividing the above example into 4 sub-blocks:

[0140] The first outcome: It is known whether to discard the first partitioning strategy during the initial determination;

[0141] The second possible outcome is that the decision on whether to discard the first partitioning strategy may only be determined during the second round of determination.

[0142] The third possible outcome: It may only be during the third determination that we know whether to discard the first partitioning strategy;

[0143] The fourth outcome: It may not be known whether to use the first partitioning strategy until the fourth determination.

[0144] If the first result is obtained, the rate distortion of the first sub-block is calculated, but the rate distortion of the second, third, and fourth sub-blocks does not need to be calculated.

[0145] If the result is the second one, then calculate the rate distortion of the first and second sub-blocks, but do not need to calculate the rate distortion of the third and fourth sub-blocks;

[0146] If the result is the third one, then calculate the rate distortion of the first, second and third sub-blocks, but do not need to calculate the rate distortion of the fourth sub-block;

[0147] If the result is the fourth one, then calculate the rate distortion of the four sub-blocks.

[0148] From a probabilistic and practical perspective, in many cases, it is not necessary to calculate the rate-distortion of all sub-blocks to determine whether to abandon the first partitioning strategy. In other words, the scheme described in this embodiment reduces the number of sub-blocks for which rate-distortion needs to be calculated, speeds up video encoding, and reduces the computational resources required to calculate the rate-distortion of sub-blocks, especially when there are many partitioning methods.

[0149] In an optional embodiment, in the second determination operation or each subsequent determination operation, the prediction rate distortion of the respective remaining sub-blocks is obtained through the following operations: determining the approximation rate distortion corresponding to the first M sub-blocks; wherein, the approximation rate distortion of each sub-block in the first M sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, 2≤M≤N-1, and M is a natural number; determining the approximation rate distortion corresponding to the remaining NM sub-blocks; wherein, the approximation rate distortion of each sub-block in the remaining NM sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, and the remaining NM sub-blocks include the remaining sub-blocks other than the first M sub-blocks in the N sub-blocks; and determining the prediction rate distortion of the remaining NM sub-blocks based on the approximation rate distortion corresponding to the first M sub-blocks, the approximation rate distortion corresponding to the remaining NM sub-blocks, and the rate distortion corresponding to the first M sub-blocks. In the above embodiments, based on the rate distortion of some sub-blocks and with the help of the approximate rate distortion obtained in the pre-analysis stage, the predicted rate distortion of the remaining sub-blocks in the corresponding cycle stage can be calculated. The calculated predicted rate distortion is used to determine whether the first partitioning strategy can be discarded, thereby comparing rate distortion with less computation.

[0150] In an optional embodiment, the first partitioning strategy is one of multiple partitioning strategies, each corresponding to a total rate distortion (RTD). In the second determination operation or each subsequent determination operation, a preset RTD threshold is obtained through the following operations: obtaining the minimum RTD among multiple RTDs corresponding to multiple other partitioning strategies; wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy; obtaining the RTD of the flag bits of the N sub-blocks; wherein, the flag bits are used to indicate the partitioning of the N sub-blocks; obtaining the corresponding preset RTD threshold based on the minimum RTD, the RTD of the flag bits of the N sub-blocks, and the RTD of the first M sub-blocks; wherein, 2≤M≤N-1, and M is a natural number. In the above embodiments, the RTD cost can be measured more accurately based on the calculation of each preset RTD threshold.

[0151] To facilitate understanding, we will continue with the first partitioning strategy, dividing the space into 4 sub-blocks (sub-blocks 0, 1, 2, and 3), as an example. Figure 8 The example application flow is shown.

[0152] It should be noted that:

[0153] Within sub-block i, the sum of the approximation rate distortion of all pre-analyzed blocks is rdsum. i (0≤i≤3).

[0154] The minimum total rate distortion corresponding to multiple other partitioning strategies is RD. temp_min .

[0155] The rate distortion of the flag bits indicating that the block is divided into 4 sub-blocks is RD. split .

[0156] c0, c1, and c2 are all constants greater than 1.

[0157] S800, calculate the rate distortion RD of sub-block 0. sub0 .

[0158] S802, based on the rate distortion of sub-block 0, obtain the prediction rate distortion of sub-blocks 1, 2, and 3.

[0159]

[0160]

[0161]

[0162] S804, if If the first partitioning strategy is not selected, the rate distortion of the remaining sub-blocks 1, 2, and 3 will not be calculated. Otherwise, proceed to step S806.

[0163] S806, calculate the rate distortion RD of sub-block 1. sub1 .

[0164] S808 obtains the prediction rate distortion of sub-blocks 2 and 3 based on the rate distortion of sub-blocks 0 and 1.

[0165]

[0166]

[0167] S810, if If the first partitioning strategy is not selected, the rate distortion of the remaining sub-blocks 2 and 3 will not be calculated. Otherwise, proceed to step S812.

[0168] S812, calculate the rate distortion RD of sub-block 2. sub2 .

[0169] S814, based on the rate distortion of sub-blocks 0, 1, and 2, obtain the prediction rate distortion of sub-block 3.

[0170]

[0171] S816, if If the first partitioning strategy is not selected, the rate-distortion of the remaining sub-block 3 will not be calculated. Otherwise, proceed to step S818. In S818, calculate the rate-distortion of sub-block 3.

[0172] S820 determines whether to use the first partitioning strategy based on the rate distortion of sub-blocks 0, 1, 2, and 3.

[0173] In step S820, the rate distortion of the four sub-blocks are RD sub0 RD sub1 RD sub2 RD sub3 The total rate distortion of the four sub-blocks is then:

[0174] RD 4sub =RD split +RD sub0 +RD sub1 +RD sub2 +RD sub3

[0175] Among the various total distortions for other partitioning methods, the minimum value is RD. temp_min If RD 4sub <RD temp_min If so, the first partitioning strategy is used for encoding. Otherwise, the RD partitioning strategy is selected. temp_min The corresponding partitioning strategy encoding.

[0176] It should be noted that, based on the above exemplary applications, it is possible to promptly identify which partitioning strategies are being abandoned, thereby accelerating the coding process.

[0177] Example 2

[0178] Figure 9 A block diagram of a video encoding apparatus according to Embodiment 2 of this application is schematically shown. This video encoding apparatus can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of this application. The program module referred to in this embodiment is a series of computer instruction segments capable of performing a specific function. The following description will specifically introduce the functions of each program module in this embodiment. The video encoding apparatus 900 may include a first acquisition module 910, a second acquisition module 920, and an execution module 930, wherein:

[0179] The first acquisition module 910 is used to acquire the rate distortion of the first sub-block among N sub-blocks, wherein the N sub-blocks are obtained according to the first partitioning strategy, and N is a natural number greater than 1;

[0180] The second acquisition module 920 is configured to acquire the prediction rate distortion of each of the remaining N-1 sub-blocks based on the rate distortion of the first sub-block; wherein the remaining N-1 sub-blocks include the remaining sub-blocks other than the first sub-block among the N sub-blocks; and

[0181] The execution module 930 is used to perform a first determination operation, wherein the first determination operation includes: determining to discard the first partitioning strategy when the sum of the prediction rate distortion of the remaining N-1 sub-blocks is greater than a first preset rate distortion threshold.

[0182] In an optional embodiment, the second acquisition module 920 is further configured to:

[0183] Determine the approximation rate distortion corresponding to the first sub-block; wherein, the approximation rate distortion of the first sub-block is the sum of the approximation rate distortions of multiple pre-analysis blocks within the range of the first sub-block, and the pre-analysis blocks are obtained in the pre-analysis operation;

[0184] Determine the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, wherein the approximation rate distortion of each of the N-1 remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding remaining sub-block range;

[0185] The prediction rate distortion of each of the N-1 remaining sub-blocks is determined based on the approximation rate distortion corresponding to the first sub-block, the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, and the rate distortion of the first sub-block.

[0186] In an optional embodiment, the first partitioning strategy is one of a plurality of partitioning strategies, each partitioning strategy corresponding to a total rate distortion;

[0187] The device may further include a threshold acquisition module, the threshold acquisition module being used for:

[0188] Based on multiple total rate distortions corresponding to multiple other partitioning strategies, the minimum total rate distortion among the multiple total rate distortions is obtained; wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy among the multiple partitioning strategies;

[0189] The rate-distortion of the flag bits of the N sub-blocks is obtained; wherein the flag bits are used to indicate the division of the N sub-blocks;

[0190] The first preset rate distortion threshold is obtained based on the minimum total rate distortion, the rate distortion of the flag bits of the N sub-blocks, and the rate distortion of the first sub-block.

[0191] In an optional embodiment, the execution module 930 is further configured to:

[0192] If the sum of the prediction rate distortions of the remaining N-1 sub-blocks is not greater than the first preset rate distortion threshold, a second determination operation is performed for the first partitioning strategy; wherein, the second determination operation includes:

[0193] Rate distortion of the second sub-block;

[0194] Based on the rate distortion of the first sub-block and the rate distortion of the second sub-block, the prediction rate distortion of each of the remaining N-2 sub-blocks is obtained; wherein, the remaining N-2 sub-blocks include the sub-blocks remaining from the N sub-blocks excluding the first and second sub-blocks; and

[0195] If the sum of the prediction rate distortion of the remaining N-2 sub-blocks is greater than the second preset rate distortion threshold, the first partitioning strategy is discarded.

[0196] In an optional embodiment, the execution module 930 is further configured to:

[0197] If the sum of the prediction rate distortion of the remaining N-2 sub-blocks is not greater than the second preset rate distortion threshold, a third determination operation is performed for the first partitioning strategy.

[0198] Specifically: during the execution of the third determination operation and each subsequent determination operation, the rate distortion of one of the remaining sub-blocks in the previous determination operation is obtained, and the determination operation for the first partitioning strategy is repeatedly executed according to different predicted rate distortions until the first partitioning strategy is discarded or the last determination operation is executed.

[0199] In an optional embodiment, in the second determination operation or each subsequent determination operation, the second acquisition module is further configured to:

[0200] Determine the approximation rate distortion corresponding to each of the first M sub-blocks; wherein, the approximation rate distortion of each sub-block in the first M sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, 2≤M≤N-1, where M is a natural number;

[0201] Determine the approximation rate distortion for each of the NM remaining sub-blocks; wherein the approximation rate distortion of each of the NM remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, and the NM remaining sub-blocks include the remaining sub-blocks excluding the first M sub-blocks from the N sub-blocks; and

[0202] The prediction rate distortion of the NM remaining sub-blocks is determined based on the approximation rate distortion of the first M sub-blocks, the approximation rate distortion of the NM remaining sub-blocks, and the rate distortion of the first M sub-blocks.

[0203] In an optional embodiment, the first partitioning strategy is one of multiple partitioning strategies, each partitioning strategy corresponding to a total rate distortion; the device may further include a threshold acquisition module, which is used to acquire a preset rate distortion threshold in the corresponding determination operation in the second determination operation or in each subsequent determination operation:

[0204] Based on multiple total rate distortions corresponding to multiple other partitioning strategies, the minimum total rate distortion among the multiple total rate distortions is obtained; wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy among the multiple partitioning strategies;

[0205] The rate-distortion of the flag bits of the N sub-blocks is obtained; wherein the flag bits are used to indicate the division of the N sub-blocks;

[0206] The corresponding preset rate distortion threshold is obtained based on the minimum total rate distortion, the rate distortion of the flag bits of the N sub-blocks, and the rate distortion of the first M sub-blocks; where 2≤M≤N-1, and M is a natural number.

[0207] Example 3

[0208] Figure 10 This illustration schematically shows a hardware architecture diagram of a computer device 10000 suitable for implementing a video encoding method according to Embodiment 3 of this application. The computer device 10000 can be part of a server 2 or an electronic device 6. In this embodiment, the computer device 10000 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. For example, it can be a smartphone, tablet computer, laptop, personal computer, virtual device, set-top box, television, projector, vehicle terminal, headphones, etc. In other embodiments, the computer device 10000 can also be a rack server, blade server, tower server, or cabinet server (including independent servers or server clusters composed of multiple servers), etc. Figure 10 As shown, the computer device 10000 includes, but is not limited to, a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other via a system bus. Wherein:

[0209] The memory 10010 includes at least one type of computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of the computer device 10000, such as the hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 10000. Of course, the memory 10010 may also include both the internal storage module and the external storage device of the computer device 10000. In this embodiment, the memory 10010 is typically used to store the operating system and various application software installed on the computer device 10000, such as program code for video encoding methods. In addition, the memory 10010 can also be used to temporarily store various types of data that have been output or will be output.

[0210] In some embodiments, processor 10020 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. Processor 10020 is typically used to control the overall operation of computer device 10000, such as performing control and processing related to data interaction or communication with computer device 10000. In this embodiment, processor 10020 is used to run program code stored in memory 10010 or process data.

[0211] Network interface 10030 may include a wireless network interface or a wired network interface, which is typically used to establish a communication link between computer device 10000 and other computer devices. For example, network interface 10030 is used to connect computer device 10000 to an external terminal via a network, establishing a data transmission channel and communication link between computer device 10000 and the external terminal. The network may be an intranet, the Internet, Global System for Mobile Communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, or other wireless or wired networks.

[0212] It should be pointed out that, Figure 10 Only computer devices with components 10010-10030 are shown; however, it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.

[0213] In this embodiment, the video encoding method stored in memory 10010 can be further divided into one or more program modules and executed by one or more processors (processor 10020 in this embodiment) to complete the embodiment of this application.

[0214] Example 4

[0215] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the video encoding method in the embodiments.

[0216] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device. Of course, the computer-readable storage medium can also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is typically used to store the operating system and various application software installed on the computer device, such as the program code of the video encoding method in this embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or will be output.

[0217] Obviously, those skilled in the art should understand that the modules or steps of the embodiments of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of this application are not limited to any particular combination of hardware and software.

[0218] It should be noted that the above are merely preferred embodiments of this application and do not limit the scope of patent protection of this application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A video encoding method, characterized in that, The method includes: Obtain the rate distortion of the first sub-block among N sub-blocks, wherein the N sub-blocks are obtained according to a first partitioning strategy, and N is a natural number greater than 1; Based on the rate-distortion of the first sub-block, the prediction rate-distortion of each of the remaining N-1 sub-blocks is obtained; wherein, the remaining N-1 sub-blocks include the remaining sub-blocks excluding the first sub-block among the N sub-blocks; and Perform the first determination operation, wherein the first determination operation includes: if the sum of the prediction rate distortion of the remaining N-1 sub-blocks is greater than a first preset rate distortion threshold, determine to discard the first partitioning strategy; Specifically, based on the rate distortion of the first sub-block, the prediction rate distortion of each of the remaining N-1 sub-blocks is obtained, including: Determine the approximation rate distortion corresponding to the first sub-block; wherein, the approximation rate distortion of the first sub-block is the sum of the approximation rate distortions of multiple pre-analysis blocks within the range of the first sub-block, and the pre-analysis blocks are obtained in the pre-analysis operation; Determine the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, wherein the approximation rate distortion of each of the N-1 remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding remaining sub-block range; The prediction rate distortion of each of the N-1 remaining sub-blocks is determined based on the approximation rate distortion corresponding to the first sub-block, the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, and the rate distortion of the first sub-block.

2. The method according to claim 1, characterized in that, The first partitioning strategy is one of multiple partitioning strategies, each corresponding to a total rate distortion; the first preset rate distortion threshold is obtained through the following operation: Based on multiple total rate distortions corresponding to multiple other partitioning strategies, the minimum total rate distortion among the multiple total rate distortions is obtained; wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy among the multiple partitioning strategies; The rate-distortion of the flag bits of the N sub-blocks is obtained; wherein the flag bits are used to indicate the division of the N sub-blocks; The first preset rate distortion threshold is obtained based on the minimum total rate distortion, the rate distortion of the flag bits of the N sub-blocks, and the rate distortion of the first sub-block.

3. The method according to claim 1, characterized in that, The method further includes: If the sum of the prediction rate distortions of the remaining N-1 sub-blocks is not greater than the first preset rate distortion threshold, a second determination operation is performed for the first partitioning strategy; wherein, the second determination operation includes: Rate distortion of the second sub-block; Based on the rate distortion of the first sub-block and the rate distortion of the second sub-block, the prediction rate distortion of each of the remaining N-2 sub-blocks is obtained; wherein, the remaining N-2 sub-blocks include the sub-blocks remaining from the N sub-blocks excluding the first and second sub-blocks; and If the sum of the prediction rate distortion of the remaining N-2 sub-blocks is greater than the second preset rate distortion threshold, the first partitioning strategy is discarded.

4. The method according to claim 3, characterized in that, The method further includes: If the sum of the prediction rate distortion of the remaining N-2 sub-blocks is not greater than the second preset rate distortion threshold, a third determination operation is performed for the first partitioning strategy. Specifically: during the execution of the third determination operation and each subsequent determination operation, the rate distortion of one of the remaining sub-blocks in the previous determination operation is obtained, and the determination operation for the first partitioning strategy is repeatedly executed according to different predicted rate distortions until the first partitioning strategy is discarded or the last determination operation is executed.

5. The method according to claim 4, characterized in that, In the second determination operation or each subsequent determination operation, the prediction rate distortion of the respective remaining sub-blocks is obtained through the following operation: Determine the approximation rate distortion corresponding to each of the first M sub-blocks; wherein, the approximation rate distortion of each sub-block in the first M sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, 2≤M≤N-1, where M is a natural number; Determine the approximation rate distortion for each of the NM remaining sub-blocks; wherein the approximation rate distortion of each of the NM remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding sub-block range, and the NM remaining sub-blocks include the remaining sub-blocks excluding the first M sub-blocks from the N sub-blocks; and The prediction rate distortion of the NM remaining sub-blocks is determined based on the approximation rate distortion of the first M sub-blocks, the approximation rate distortion of the NM remaining sub-blocks, and the rate distortion of the first M sub-blocks.

6. The method according to claim 4, characterized in that, The first partitioning strategy is one of multiple partitioning strategies, each corresponding to a total rate distortion; in the second determination operation or each subsequent determination operation, the preset rate distortion threshold in the corresponding determination operation is obtained through the following operations: Based on multiple total rate distortions corresponding to multiple other partitioning strategies, the minimum total rate distortion among the multiple total rate distortions is obtained; wherein, the multiple other partitioning strategies are strategies other than the first partitioning strategy among the multiple partitioning strategies; The rate-distortion of the flag bits of the N sub-blocks is obtained; wherein the flag bits are used to indicate the division of the N sub-blocks; The corresponding preset rate distortion threshold is obtained based on the minimum total rate distortion, the rate distortion of the flag bits of the N sub-blocks, and the rate distortion of the first M sub-blocks; where 2≤M≤N-1, and M is a natural number.

7. A video encoding device, characterized in that, The device includes: The first acquisition module is used to acquire the rate distortion of the first sub-block among N sub-blocks, wherein the N sub-blocks are obtained according to the first partitioning strategy, and N is a natural number greater than 1; The second acquisition module is used to acquire the prediction rate distortion of each of the remaining N-1 sub-blocks based on the rate distortion of the first sub-block; wherein, the remaining N-1 sub-blocks include the remaining sub-blocks other than the first sub-block among the N sub-blocks; and An execution module is used to perform a first determination operation, wherein the first determination operation includes: determining to discard the first partitioning strategy when the sum of the prediction rate distortion of the remaining N-1 sub-blocks is greater than a first preset rate distortion threshold; Specifically, based on the rate distortion of the first sub-block, the prediction rate distortion of each of the remaining N-1 sub-blocks is obtained, including: Determine the approximation rate distortion corresponding to the first sub-block; wherein, the approximation rate distortion of the first sub-block is the sum of the approximation rate distortions of multiple pre-analysis blocks within the range of the first sub-block, and the pre-analysis blocks are obtained in the pre-analysis operation; Determine the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, wherein the approximation rate distortion of each of the N-1 remaining sub-blocks is the sum of the approximation rate distortions of multiple pre-analysis blocks within the corresponding remaining sub-block range; The prediction rate distortion of each of the N-1 remaining sub-blocks is determined based on the approximation rate distortion corresponding to the first sub-block, the approximation rate distortion corresponding to each of the N-1 remaining sub-blocks, and the rate distortion of the first sub-block.

8. A computer device, characterized in that, include: At least one processor; and A memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 6.

10. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method, apparatus and system for encoding and decoding the prediction units of a coding unit

    AU2012232972A1

  • Rapid HEVC CU deep partition coding method

    CN104796693A