Method, apparatus and device for mode skip in video coding and storage medium

By calculating the intra-frame and inter-frame mode weights of video coding blocks, the video coding process is optimized, solving the problem of high coding complexity, improving coding speed and resource utilization, and reducing costs and CPU usage.

CN116546200BActive Publication Date: 2026-04-28BIGO TECH PTE LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BIGO TECH PTE LTD
Filing Date
2023-04-06
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing video coding technologies, the coding complexity and coding time of the encoder are too high during inter-frame prediction and intra-frame prediction coding, resulting in encoder performance degradation and resource waste.

Method used

By obtaining the intra-frame mode parameters and inter-frame mode parameters of the block to be encoded and its sub-units in the coding tree unit, the intra-frame mode weights and inter-frame mode weights are calculated, and the mode decision skipping is performed based on these weights to optimize the coding process.

Benefits of technology

Without compromising encoding performance, it improved encoding speed, saved server costs and client CPU resources, and enhanced user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116546200B_ABST
    Figure CN116546200B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a mode skipping method, device and equipment in video coding and a storage medium, the method comprises the following steps: obtaining a to-be-encoded block of a coding tree unit and a sub-unit set corresponding to the coding tree unit; determining a sub-unit contained in the to-be-encoded block, calculating an intra-frame mode weight and an inter-frame mode weight of the to-be-encoded block according to an intra-frame mode parameter and an inter-frame mode parameter corresponding to the sub-unit contained in the to-be-encoded block; and skipping the decision mode of the to-be-encoded block based on the intra-frame mode weight and the inter-frame mode weight. The scheme improves the coding speed of the encoder under the premise that the objective performance of the encoder is hardly reduced and the subjective picture quality is consistent, thereby improving the use rate of the computing resources of the server side and saving the server cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] During video encoding, the divided blocks to be encoded require intra-frame and inter-frame mode prediction to ultimately determine the optimal encoding method. Intra-frame prediction utilizes the spatial correlation of the video, using the already encoded pixel values ​​in the current frame to predict the current pixel, thereby removing spatial redundancy and effectively reducing spatial correlation. Inter-frame prediction combines information from multiple frames for prediction, effectively reducing temporal correlation and significantly improving video compression efficiency.

[0003] In related technologies, after the encoder preprocesses the input video, intra-frame and inter-frame predictive coding are performed on each divided block to be encoded. Inter-frame predictive coding is mainly used to remove temporal correlations between images, while intra-frame predictive coding is mainly used to remove spatial correlations within images. When the current block to be encoded enters the encoding and compression stage, an inter-frame mode decision is made first, followed by an intra-frame mode decision. After deciding on the intra-frame and inter-frame predictive coding modes, the encoder selects the mode with the lowest rate-distortion cost as the final prediction mode and uses this mode to encode the current block. Since the encoder involves cost calculation, transformation, quantization, and other processes during inter-frame and intra-frame predictive coding, it significantly increases the encoder's coding complexity and coding time, necessitating reasonable optimization of the mode decision-making process. Summary of the Invention

[0004] This application provides a mode skipping method, apparatus, device, and storage medium in video encoding, which solves the problems of high encoding complexity and long encoding time of encoders when performing inter-frame prediction and intra-frame prediction encoding of blocks to be encoded in related technologies. It can reasonably skip intra-frame decision modes or inter-frame decision modes, improve the encoding speed of the encoder with almost no reduction in the objective performance of the encoder and maintain the consistency of subjective image quality, thereby improving the utilization of computing resources on the server side, saving server costs, and reducing the CPU utilization of the client side, further improving the user experience.

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

[0006] Obtain the block to be encoded of the coding tree unit and the set of sub-units corresponding to the coding tree unit. The set of sub-units includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit.

[0007] The sub-units contained in the block to be encoded are determined, and the intra-frame mode weights and inter-frame mode weights of the block to be encoded are calculated based on the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units contained in the block to be encoded.

[0008] The decision mode of the block to be encoded is skipped based on the intra-frame mode weight and the inter-frame mode weight.

[0009] Secondly, embodiments of this application also provide a mode skipping device in video encoding, comprising:

[0010] The acquisition module is configured to acquire the block to be encoded of the coding tree unit and the sub-unit set corresponding to the coding tree unit. The sub-unit set includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit.

[0011] The sub-unit determination module is configured to determine the sub-units contained in the block to be encoded;

[0012] The weight calculation module is configured to calculate the intra-frame mode weight and inter-frame mode weight of the block to be encoded based on the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units contained in the block to be encoded.

[0013] The mode decision module is configured to skip the decision mode of the block to be encoded based on the intra-frame mode weight and the inter-frame mode weight.

[0014] Thirdly, embodiments of this application also provide a mode skipping device in video encoding, the device comprising:

[0015] One or more processors;

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

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

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

[0019] Fifthly, embodiments of this application also provide a computer program product comprising a computer program stored in a computer-readable storage medium, wherein at least one processor of the device reads from the computer-readable storage medium and executes the computer program, causing the device to perform the mode skipping method in video encoding described in embodiments of this application.

[0020] In this embodiment, the code obtains the block to be encoded from the coding tree unit and the corresponding set of sub-units. The sub-unit set includes multiple sub-units and their corresponding intra-frame mode parameters and inter-frame mode parameters. Then, the sub-units contained in the block to be encoded are determined. Based on the intra-frame mode parameters and inter-frame mode parameters of the sub-units, the intra-frame mode weights and inter-frame mode weights of the block to be encoded are calculated. Finally, the decision mode for the block to be encoded is skipped based on these intra-frame mode weights and inter-frame mode weights. Therefore, in the mode decision process for the block to be encoded, considering the high similarity of information within the same coding tree unit, the corresponding intra-frame mode weights and inter-frame mode weights are obtained based on the intra-frame mode parameters and inter-frame mode parameters of its contained sub-units, guiding the final decision mode to be skipped. This reduces the encoding complexity of the video encoder, improves video encoding speed with minimal loss of encoding quality, further improves the utilization of server-side computing resources, saves server costs, and reduces client-side CPU utilization, thus improving user experience. Attached Figure Description

[0021] Figure 1 A flowchart illustrating a mode skipping method in video encoding provided in this application embodiment;

[0022] Figure 2 A schematic diagram illustrating the division of a coding tree unit into multiple sub-units, provided in an embodiment of this application;

[0023] Figure 3 Provided for the embodiments of this application Figure 2 The diagram shows a coding tree unit divided into multiple blocks to be encoded.

[0024] Figure 4 A flowchart illustrating a method for skipping the decision mode of a coded block based on intra-frame mode weights and inter-frame mode weights, provided in an embodiment of this application;

[0025] Figure 5 A flowchart illustrating another mode skipping method in video encoding provided in this application embodiment;

[0026] Figure 6 A structural block diagram of a mode skipping device in video encoding provided in an embodiment of this application;

[0027] Figure 7 This is a schematic diagram of a mode skipping device in video encoding provided in an embodiment of this application. Detailed Implementation

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

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

[0030] The mode skipping method in video encoding provided in this application embodiment can be applied to the process of video encoding by computing devices, such as scenarios where a server encodes acquired video data for transmission, or scenarios where a client encodes original video files.

[0031] Figure 1 A flowchart of a mode skipping method in video encoding provided in this application embodiment is shown below. Figure 1 As shown, the specific steps include the following:

[0032] Step S101: Obtain the block to be encoded of the coding tree unit and the sub-unit set corresponding to the coding tree unit. The sub-unit set includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit.

[0033] In one embodiment, during video encoding, a frame is divided into multiple coding blocks. Each coding block, as a block to be encoded, undergoes individual intra-frame mode decision and inter-frame mode decision to ultimately determine the encoding mode to be used. The coding tree unit can be the largest block unit supported by general video coding standards, such as a 128*128 block. The size of the block to be encoded is no larger than the size of the coding tree unit. For example, a 128*128 coding tree unit can be divided into four 64*64 blocks or sixteen 32*32 blocks.

[0034] In one embodiment, each coding tree unit corresponds to a set of subunits, which includes multiple subunits and intra-frame mode parameters and inter-frame mode parameters corresponding to each subunit. The subunits are stored, for example, in array form. The size of each subunit is less than or equal to the size of the block to be encoded. For example, for a 128*128 coding tree unit, the size of each subunit could be 4*4. That is, a 128*128 coding tree unit can be divided into 1024 subunits, each with its own intra-frame mode parameters and inter-frame mode parameters. These parameters serve as the basis for subsequent mode skipping decisions for the block to be encoded. Optionally, a larger intra-frame mode parameter indicates that the block containing that subunit will use the intra-frame coding mode more frequently during mode decision-making; similarly, a larger inter-frame mode parameter indicates that the block containing that subunit will use the inter-frame coding mode more frequently during mode decision-making.

[0035] Step S102: Determine the sub-units contained in the block to be encoded, and calculate the intra-mode weights and inter-mode weights of the block to be encoded based on the intra-mode parameters and inter-mode parameters corresponding to the sub-units contained in the block to be encoded.

[0036] In one embodiment, before making a pattern decision for the current block to be encoded, the sub-units contained in the block to be encoded are first determined. For example, Figure 2 This application provides a schematic diagram illustrating the division of a coding tree unit into multiple sub-units, as shown in the embodiments. Figure 2 As shown, a coding tree unit with a size of 128*128 is divided into 256 sub-units with a size of 8*8. Figure 3 Provided for the embodiments of this application Figure 2 The diagram illustrates the division of a coding tree unit into multiple blocks to be encoded. This 128*128 coding tree unit is divided into 16 blocks of size 32*32. During the encoding process, each block is encoded sequentially. For example, taking the first block as an example, its sub-units are determined, such as... Figure 3 As shown, with Figure 2 and Figure 3 Regarding the partitioning method, the 32*32 block to be encoded comprises 16 sub-units of size 8*8. It should be noted that the above partitioning method and the sizes of the coding tree unit, the block to be encoded, and the sub-units are for illustrative purposes only and are not intended to limit the size.

[0037] In one embodiment, after determining the sub-units contained in the block to be encoded, the intra-frame mode weight and inter-frame mode weight of the block to be encoded are calculated based on the intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit. Optionally, this calculation method can be to accumulate the intra-frame mode parameters corresponding to each sub-unit in the block to be encoded to obtain the intra-frame mode weight, and then accumulate the inter-frame mode parameters corresponding to each sub-unit in the block to be encoded to obtain the inter-frame mode weight. Optionally, another calculation method can be to randomly select a preset number of sub-units when the block to be encoded contains multiple sub-units, accumulate the intra-frame mode parameters corresponding to the selected sub-units to obtain the intra-frame mode weight, and then accumulate the inter-frame mode parameters corresponding to the selected sub-units to obtain the inter-frame mode weight. Optionally, another calculation method can be to select sub-units at a set position when the block to be encoded contains multiple sub-units, accumulate the intra-frame mode parameters corresponding to the selected sub-units to obtain the intra-frame mode weight, and then accumulate the inter-frame mode parameters corresponding to the selected sub-units to obtain the inter-frame mode weight. The set position can be at the center or edge of the block to be encoded.

[0038] In the above description, the intra-frame mode weight and inter-frame mode weight, calculated as described above, represent the degree of preference for the final intra-frame coding mode and inter-frame coding mode of the block to be coded. For example, a higher intra-frame mode weight indicates a greater probability that the block to be coded will ultimately choose the intra-frame coding mode; correspondingly, a higher inter-frame mode weight indicates a greater probability that the block to be coded will ultimately choose the inter-frame coding mode. Accordingly, if it is determined that the probability of the block to be coded ultimately choosing the intra-frame coding mode is greater, then the inter-frame mode decision can be skipped; similarly, if it is determined that the probability of the block to be coded ultimately choosing the inter-frame coding mode is greater, then the intra-frame mode decision can be skipped. This allows decision modes with lower usage probabilities to be skipped in advance, without corresponding predictive coding, thereby improving coding speed without reducing coding performance. Of course, the above weight calculation process is obtained by accumulating parameter values; a higher weight value indicates a greater probability of using the corresponding coding method. Conversely, a subtraction method can also be used, calculating the weight value based on the parameter values; correspondingly, a smaller weight value indicates a greater probability of using the corresponding coding method.

[0039] Step S103: Skip the decision mode of the block to be encoded based on the intra-frame mode weight and the inter-frame mode weight.

[0040] In one embodiment, after obtaining the intra-frame mode weight and inter-frame mode weight corresponding to the block to be coded, calculation and / or comparison are performed based on the intra-frame mode weight and inter-frame mode weight to skip the decision mode of the block to be coded.

[0041] Optionally, if the difference between the intra-frame mode weight and the inter-frame mode weight is greater than a preset difference, the inter-frame mode decision can be skipped; if the difference between the inter-frame mode weight and the intra-frame mode weight is greater than the preset difference, the intra-frame mode decision can be skipped.

[0042] In one embodiment, another specific method for skipping the decision mode of the coded block based on intra-frame mode weights and inter-frame mode weights is provided, such as... Figure 4 As shown, Figure 4 A flowchart illustrating a method for skipping the decision mode of a coded block based on intra-frame mode weights and inter-frame mode weights, provided in this application embodiment, includes:

[0043] Step S1031: Obtain the set intra-frame skip threshold, intra-frame skip lower limit, inter-frame skip threshold, and inter-frame skip lower limit.

[0044] The intra-frame skip threshold, intra-frame skip lower limit, inter-frame skip threshold, and inter-frame skip lower limit are preset and can be set to different values ​​according to the strength of the skip constraint for different video scenarios or modes. For example, taking the case where the inter-frame mode weight and intra-frame mode weight are obtained by accumulation as described above, the values ​​of the intra-frame skip threshold and inter-frame skip threshold can be 18, 20, or 26, and the values ​​of the intra-frame skip lower limit and inter-frame skip lower limit can be positive integers from 0 to 4.

[0045] Step S1032: Based on the intra-frame mode weight, the inter-frame mode weight, the inter-frame skip threshold, and the inter-frame skip lower limit, determine whether to skip the inter-frame decision mode of the block to be encoded.

[0046] Optionally, in determining whether to skip an inter-frame decision mode, the ratio of the size of the block to be encoded to the size of the sub-unit is introduced. In this case, if the intra-frame mode weight is greater than or equal to the product of the inter-frame skip threshold and the calculated ratio, and the inter-frame mode weight is less than or equal to the inter-frame skip lower limit, the inter-frame decision mode of the block to be encoded is skipped. If the above relationship does not hold, the inter-frame decision mode is not skipped.

[0047] Step S1033: Based on the inter-frame mode weight, the intra-frame mode weight, the intra-frame skip threshold, and the intra-frame skip lower limit, determine whether to skip the intra-frame decision mode of the block to be encoded.

[0048] Optionally, in determining whether to skip an intra-frame decision mode, the ratio of the size of the block to be encoded to the size of the sub-unit is introduced. When the inter-frame mode weight is greater than or equal to the product of the intra-frame skip threshold and the ratio, and the intra-frame mode weight is less than or equal to the intra-frame skip lower limit, the intra-frame decision mode of the block to be encoded is skipped. If the above relationship does not hold, the intra-frame decision mode is not skipped.

[0049] Optionally, in steps S1032 and S1033 above, the skipping process for intra-frame decision mode and inter-frame decision mode can be performed respectively. This can be done by first executing step S1032 to determine whether to skip the inter-frame decision mode. If the inter-frame decision mode is skipped, the intra-frame decision mode is determined as the optimal mode in the subsequent decision results. If step S1032 determines that the inter-frame decision mode should not be skipped, then step S1033 is further executed to determine whether to skip the intra-frame decision mode. If skipped, the inter-frame decision mode is determined as the optimal mode in the subsequent decision results. If not skipped, the intra-frame and inter-frame decision modes are predicted separately, and the optimal coding mode is determined based on the rate-distortion cost. It should be noted that the above explanation uses the example of first executing step S1032 to determine the inter-frame decision mode. Alternatively, step S1033 can be executed first to determine whether to skip the intra-frame decision mode, and if it is determined that it should not be skipped, then the determination of whether to skip the inter-frame decision mode is performed. In other words, the order of the determinations is not limited. In determining whether to skip a decision mode, instead of comparing it with a threshold alone, the system simultaneously introduces the ratio of the size of the block to be encoded to the size of the subunit. This allows for a reasonable decision on whether to skip based on different methods of dividing the block to be encoded and the subunit. Furthermore, the system introduces intra-frame skip lower limits and inter-frame skip lower limits to further constrain the leniency of the decision to skip, and allows for reasonable adjustments to the skip mode based on different video content and encoding standards.

[0050] As described above, by obtaining the block to be encoded from the coding tree unit and the corresponding set of subunits (each subunit includes multiple subunits and their corresponding intra-frame and inter-frame mode parameters), the subunits contained in the block to be encoded are determined. Based on the intra-frame and inter-frame mode parameters of the subunits, the intra-frame and inter-frame mode weights of the block to be encoded are calculated. Then, the decision mode for the block to be encoded is skipped based on these weights. Therefore, in the mode decision process for the block to be encoded, considering the high similarity of information within the same coding tree unit, the intra-frame and inter-frame mode weights are obtained based on the intra-frame and inter-frame mode parameters of the subunits, guiding the final decision mode to be skipped. This reduces the encoding complexity of the video encoder, improves video encoding speed with minimal loss of encoding quality, further increases the utilization of server-side computing resources, saves server costs, reduces client-side CPU utilization, and improves user experience.

[0051] Figure 5 A flowchart of another mode skipping method in video encoding provided in this application embodiment, which includes updating the data recorded by the sub-unit, such as... Figure 5 As shown, it includes:

[0052] Step S201: Obtain the block to be encoded of the coding tree unit and the sub-unit set corresponding to the coding tree unit. The sub-unit set includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit.

[0053] Step S202: Determine the sub-units contained in the block to be encoded, and calculate the intra-mode weights and inter-mode weights of the block to be encoded based on the intra-mode parameters and inter-mode parameters corresponding to the sub-units contained in the block to be encoded.

[0054] Step S203: Skip the decision mode of the block to be encoded based on the intra-frame mode weight and the inter-frame mode weight.

[0055] Step S204: Update the intra-frame mode parameters and inter-frame mode parameters of the sub-units contained in the block to be encoded according to the determined decision mode of the block to be encoded.

[0056] In one embodiment, after determining whether to skip a decision mode through the judgment process of steps S201 to S203, the intra-frame mode parameters and inter-frame mode parameters of the sub-units contained in the block to be encoded are updated according to the corresponding results. Specifically, if the intra-frame decision mode is skipped, the optimal mode for the current block to be encoded is determined to be the inter-frame mode; if the inter-frame decision mode is skipped, the optimal mode for the current block to be encoded is determined to be the intra-frame mode; if neither is skipped, predictive coding of inter-frame and intra-frame modes is performed, and the optimal mode is determined to be either the inter-frame mode or the intra-frame mode based on the rate-loss cost.

[0057] The process of updating the intra-frame mode parameters and inter-frame mode parameters of the sub-units contained in the block to be encoded, after determining the decision mode (i.e., the optimal decision mode), can optionally involve: increasing the parameter values ​​of the intra-frame mode parameters of the sub-units contained in the block when the decision mode is intra-frame; and increasing the parameter values ​​of the inter-frame mode parameters of the sub-units contained in the block when the decision mode is inter-frame. Of course, the above example uses parameter value accumulation to represent the decision mode, but it can also be represented by subtraction, multiplication, or division by a set value, as long as it can be mathematically differentiated for different decision modes. It should be noted that the above process of determining the decision mode of the block to be encoded is based on the judgment results provided in the embodiments of this application. During the parameter update of the sub-units, it can also combine other decision results for intra-frame and inter-frame modes to perform the update. For example, if the judgment process in this scheme determines that neither the intra-frame mode nor the inter-frame mode is skipped, and if other algorithms or processing logic determine that the intra-frame mode is skipped, then when determining the optimal mode of the block to be encoded, it can be determined to be the inter-frame mode, and the inter-frame mode parameters of the sub-unit can be updated accordingly.

[0058] As described above, by obtaining the block to be encoded from the coding tree unit and the corresponding set of subunits (each subunit includes multiple subunits and their corresponding intra-frame and inter-frame mode parameters), the subunits contained in the block to be encoded are determined. Based on the intra-frame and inter-frame mode parameters of the subunits, the intra-frame and inter-frame mode weights of the block to be encoded are calculated. Then, the decision mode for the block to be encoded is skipped based on these weights. Therefore, in the mode decision process for the block to be encoded, considering the high similarity of information within the same coding tree unit, the intra-frame and inter-frame mode weights are obtained based on the intra-frame and inter-frame mode parameters of the subunits, guiding the final decision mode to be skipped. This reduces the encoding complexity of the video encoder, improves video encoding speed with minimal loss of encoding quality, further increases the utilization of server-side computing resources, saves server costs, reduces client-side CPU utilization, and improves user experience.

[0059] In one embodiment, the method further includes the steps of sub-unit partitioning and initializing the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units. Optionally, before obtaining the block to be encoded and the set of sub-units corresponding to the coding tree unit, the coding tree unit may be partitioned into multiple blocks to be encoded and multiple sub-units, wherein the size of the block to be encoded is greater than or equal to the size of the sub-unit, and the intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit may be initialized. During initialization, the values ​​of the intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit may be set to 0, and the values ​​may be changed subsequently based on updates to the intra-frame mode parameters and inter-frame mode parameters. The sub-units are fine-grained, relatively small units. The blocks to be encoded can be divided into different shapes such as squares and rectangles, depending on general or custom video coding partitioning standards, as long as they can be combined to form a complete coding tree unit. In one exemplary approach, a 128*128 coded tree unit can be divided into four 64*64 blocks to be encoded. When determining whether to skip a decision mode for each block, the intra-frame mode parameters and inter-frame mode parameters of the corresponding sub-unit are obtained to calculate the corresponding intra-frame mode weights and inter-frame mode weights. If the initial value is 0, the decision mode for the current block is not skipped using any of the aforementioned exemplary evaluation methods. For this block in this round, the rate-distortion cost is calculated using both decision modes. The decision mode with the lower rate-distortion cost is determined as the optimal decision mode for the block, which will then be used subsequently. Encoding is performed in this mode. At this time, the parameter values ​​of the sub-units contained in the 64*64 block to be encoded are updated. If the optimal decision mode is the intra-frame mode, the intra-frame mode parameters of these sub-units are adjusted accordingly. Similarly, when the subsequent coding tree unit is divided into 16 32*32 blocks to be encoded, the intra-frame mode parameters and inter-frame mode parameters of the sub-units contained in each block to be encoded already have non-zero values. Then, the judgment method of skipping is used based on any example of this application. This process is repeated. When it is determined that the judgment result of skipping the mode is met, the corresponding skip is performed, and the parameters of the corresponding sub-units of the finally selected decision mode are updated.

[0060] In one embodiment, when skipping the decision mode of the block to be coded based on intra-frame mode weights and inter-frame mode weights, optionally, if it is determined that the inter-frame mode should be skipped, a preset mode value is set to a first preset value; if it is determined that the intra-frame mode should be skipped, a preset mode value is set to a second preset value. Optionally, the first preset value can be 0, the second preset value can be 1, and the initial value of the preset mode value can be -1. That is, during subsequent logical judgments and encoding execution, if the mode value is -1, no decision mode is skipped; if the mode value is 0, the inter-frame mode decision is skipped; and if the mode value is 1, the intra-frame mode decision is skipped.

[0061] Figure 6 A structural block diagram of a mode skipping device in video encoding provided in this application embodiment is shown below. Figure 6 As shown, this device is used to execute the mode skipping method in video encoding provided in the above embodiments, and has the corresponding functional modules and beneficial effects for executing the method. For example... Figure 6 As shown, the device specifically includes: an acquisition module 101, a sub-unit determination module 102, a weight calculation module 103, and a pattern decision module 104, wherein,

[0062] The acquisition module 101 is configured to acquire the block to be encoded of the coding tree unit and the sub-unit set corresponding to the coding tree unit. The sub-unit set includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit.

[0063] Subunit determination module 102 is configured to determine the subunits contained in the block to be encoded;

[0064] The weight calculation module 103 is configured to calculate the intra-frame mode weight and inter-frame mode weight of the block to be encoded based on the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units contained in the block to be encoded.

[0065] The mode decision module 104 is configured to skip the decision mode of the block to be encoded based on the intra-frame mode weight and the inter-frame mode weight.

[0066] As described above, by obtaining the block to be encoded from the coding tree unit and the corresponding set of subunits (each subunit includes multiple subunits and their corresponding intra-frame and inter-frame mode parameters), the subunits contained in the block to be encoded are determined. Based on the intra-frame and inter-frame mode parameters of the subunits, the intra-frame and inter-frame mode weights of the block to be encoded are calculated. Then, the decision mode for the block to be encoded is skipped based on these weights. Therefore, in the mode decision process for the block to be encoded, considering the high similarity of information within the same coding tree unit, the intra-frame and inter-frame mode weights are obtained based on the intra-frame and inter-frame mode parameters of the subunits, guiding the final decision mode to be skipped. This reduces the encoding complexity of the video encoder, improves video encoding speed with minimal loss of encoding quality, further increases the utilization of server-side computing resources, saves server costs, reduces client-side CPU utilization, and improves user experience.

[0067] In one possible embodiment, the weight calculation module 103 is configured as follows:

[0068] The intra-frame mode parameters corresponding to each sub-unit contained in the block to be encoded are summed to obtain the intra-frame mode weight, and the inter-frame mode parameters corresponding to each sub-unit contained in the block to be encoded are summed to obtain the inter-frame mode weight.

[0069] In one possible embodiment, the pattern decision module 104 is configured as follows:

[0070] Get the set intra-frame skip threshold, intra-frame skip lower limit, inter-frame skip threshold, and inter-frame skip lower limit;

[0071] Based on the intra-frame mode weight, the inter-frame mode weight, the inter-frame skip threshold, and the inter-frame skip lower limit, determine whether to skip the inter-frame decision mode of the block to be encoded;

[0072] Based on the inter-frame mode weights, the intra-frame mode weights, the intra-frame skip threshold, and the intra-frame skip lower limit, it is determined whether to skip the intra-frame decision mode of the block to be encoded.

[0073] In one possible embodiment, the pattern decision module 104 is configured as follows:

[0074] Calculate the ratio of the size of the block to be encoded to the size of the sub-unit;

[0075] If the intra-frame mode weight is greater than or equal to the product of the inter-frame skip threshold and the ratio, and the inter-frame mode weight is less than or equal to the inter-frame skip lower limit, the inter-frame decision mode of the block to be encoded is skipped.

[0076] In one possible embodiment, the pattern decision module 104 is configured as follows:

[0077] Calculate the ratio of the size of the block to be encoded to the size of the sub-unit;

[0078] If the inter-frame mode weight is greater than or equal to the product of the intra-frame skip threshold and the ratio, and the intra-frame mode weight is less than or equal to the intra-frame skip lower limit, the intra-frame decision mode of the block to be encoded is skipped.

[0079] In one possible embodiment, the device further includes a data update module configured to:

[0080] After skipping the decision mode of the block to be encoded based on the intra-frame mode weight and the inter-frame mode weight, the intra-frame mode parameters and inter-frame mode parameters of the sub-units contained in the block to be encoded are updated according to the determined decision mode of the block to be encoded.

[0081] In one possible embodiment, the data update module is configured as follows:

[0082] When the decision mode of the block to be encoded includes an intra-frame decision mode, the parameter values ​​of the intra-frame mode parameters of the sub-units contained in the block to be encoded are increased.

[0083] When the decision mode of the block to be encoded includes an inter-frame decision mode, the parameter values ​​of the inter-frame mode parameters of the sub-units contained in the block to be encoded are increased.

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

[0085] Before obtaining the block to be encoded of the coding tree unit and the set of subunits corresponding to the coding tree unit, the coding tree unit is divided into multiple blocks to be encoded and multiple subunits, wherein the size of the block to be encoded is greater than or equal to the size of the subunit;

[0086] The intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit are initialized.

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

[0088] This application embodiment also provides a non-volatile storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a mode skipping method in video encoding described in the above embodiments, wherein the instructions include:

[0089] Obtain the block to be encoded of the coding tree unit and the set of sub-units corresponding to the coding tree unit. The set of sub-units includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit.

[0090] The sub-units contained in the block to be encoded are determined, and the intra-frame mode weights and inter-frame mode weights of the block to be encoded are calculated based on the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units contained in the block to be encoded.

[0091] The decision mode of the block to be encoded is skipped based on the intra-frame mode weight and the inter-frame mode weight.

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

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

Claims

1. A mode skipping method in video encoding, characterized in that, include: Obtain the block to be encoded of the coding tree unit and the set of sub-units corresponding to the coding tree unit. The set of sub-units includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit. The parameter values ​​of the intra-frame mode parameters and the inter-frame mode parameters are accumulated values ​​of the stored records. The accumulated value represents the number of times the corresponding mode is selected and used when the block to be encoded containing the sub-unit makes a mode decision. The sub-units contained in the block to be encoded are determined, and the intra-frame mode weights and inter-frame mode weights of the block to be encoded are calculated based on the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units contained in the block to be encoded. The decision mode of the block to be encoded is skipped based on the intra-frame mode weight and the inter-frame mode weight. According to the determined decision mode of the block to be encoded, the parameter values ​​corresponding to the intra-frame mode parameters or inter-frame mode parameters of the sub-units contained in the block to be encoded are increased.

2. The mode skipping method in video encoding according to claim 1, characterized in that, The step of calculating the intra-frame mode weights and inter-frame mode weights of the block to be encoded based on the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units contained in the block to be encoded includes: The intra-frame mode parameters corresponding to each sub-unit contained in the block to be encoded are summed to obtain the intra-frame mode weight, and the inter-frame mode parameters corresponding to each sub-unit contained in the block to be encoded are summed to obtain the inter-frame mode weight.

3. The mode skipping method in video encoding according to claim 1, characterized in that, The step of skipping the decision mode of the block to be encoded based on the intra-frame mode weight and the inter-frame mode weight includes: Get the set intra-frame skip threshold, intra-frame skip lower limit, inter-frame skip threshold, and inter-frame skip lower limit; Based on the intra-frame mode weight, the inter-frame mode weight, the inter-frame skip threshold, and the inter-frame skip lower limit, determine whether to skip the inter-frame decision mode of the block to be encoded; Based on the inter-frame mode weights, the intra-frame mode weights, the intra-frame skip threshold, and the intra-frame skip lower limit, it is determined whether to skip the intra-frame decision mode of the block to be encoded.

4. The mode skipping method in video encoding according to claim 3, characterized in that, The step of determining whether to skip the inter-frame decision mode of the block to be coded based on the intra-frame mode weight, the inter-frame mode weight, the inter-frame skip threshold, and the inter-frame skip lower limit includes: Calculate the ratio of the size of the block to be encoded to the size of the sub-unit; If the intra-frame mode weight is greater than or equal to the product of the inter-frame skip threshold and the ratio, and the inter-frame mode weight is less than or equal to the inter-frame skip lower limit, the inter-frame decision mode of the block to be encoded is skipped.

5. The mode skipping method in video encoding according to claim 3, characterized in that, The step of determining whether to skip the intra-frame decision mode of the block to be coded based on the inter-frame mode weights, the intra-frame mode weights, the intra-frame skip threshold, and the intra-frame skip lower limit includes: Calculate the ratio of the size of the block to be encoded to the size of the sub-unit; If the inter-frame mode weight is greater than or equal to the product of the intra-frame skip threshold and the ratio, and the intra-frame mode weight is less than or equal to the intra-frame skip lower limit, the intra-frame decision mode of the block to be encoded is skipped.

6. The mode skipping method in video encoding according to claim 1, characterized in that, The step of updating the intra-frame mode parameters and inter-frame mode parameters of the sub-units contained in the block to be encoded according to the determined decision mode of the block to be encoded includes: When the decision mode of the block to be encoded includes an intra-frame decision mode, the parameter values ​​of the intra-frame mode parameters of the sub-units contained in the block to be encoded are increased. When the decision mode of the block to be encoded includes an inter-frame decision mode, the parameter values ​​of the inter-frame mode parameters of the sub-units contained in the block to be encoded are increased.

7. The mode skipping method in video encoding according to any one of claims 1-5, characterized in that, Before obtaining the block to be encoded of the coding tree unit and the set of subunits corresponding to the coding tree unit, the method further includes: The coding tree unit is divided into multiple blocks to be encoded and multiple sub-units, wherein the size of the blocks to be encoded is greater than or equal to the size of the sub-units; The intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit are initialized.

8. A mode skipping device in video encoding, characterized in that, include: The acquisition module is configured to acquire the block to be encoded of the coding tree unit and the sub-unit set corresponding to the coding tree unit. The sub-unit set includes multiple sub-units and intra-frame mode parameters and inter-frame mode parameters corresponding to each sub-unit. The parameter values ​​of the intra-frame mode parameters and the inter-frame mode parameters are accumulated values ​​of the stored records. The accumulated value represents the number of times the corresponding mode is selected and used when the block to be encoded containing the sub-unit makes a mode decision. The sub-unit determination module is configured to determine the sub-units contained in the block to be encoded; The weight calculation module is configured to calculate the intra-frame mode weight and inter-frame mode weight of the block to be encoded based on the intra-frame mode parameters and inter-frame mode parameters corresponding to the sub-units contained in the block to be encoded. The mode decision module is configured to skip the decision mode of the block to be encoded based on the intra-frame mode weight and the inter-frame mode weight; The data update module is configured to increase the parameter values ​​corresponding to the intra-frame mode parameters or inter-frame mode parameters of the sub-units contained in the block to be encoded according to the determined decision mode of the block to be encoded.

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

10. A non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform a mode skipping method in video coding as described in any one of claims 1-7.

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

Citation Information

Patent Citations

  • Coding mode determination method and device, electronic equipment and storage medium

    CN113542737A