Video coding mode decision-making method and device, equipment, storage medium and product
By recording and utilizing inter prediction mode scores in the fraction buffer area, accurately skipping the second inter prediction mode decision of some encoding units, the problem of time-consuming decision-making of video encoding mode in the prior art is solved, and more efficient video encoding is achieved.
Patent Information
- Application Number
- CN202510667484.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-15
AI Technical Summary
The existing video encoding mode decision process consumes a lot of time, increasing the encoding complexity and encoding time of the encoder, resulting in a decrease in video encoding efficiency.
By determining a plurality of target score units corresponding to the encoding range of the current encoding unit among the multiple score units in the fraction buffer area, recording the first inter prediction mode score and the second inter prediction mode score, and determining whether the second inter prediction skip condition is met based on these scores, the second inter prediction mode decision process of the partial encoding unit is skipped.
It reduces the time of video encoding mode decision-making and the encoding complexity of the encoder, improves video encoding efficiency, and ensures video encoding quality.
Smart Images

Figure CN120499374A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video coding technology, and in particular to video coding mode decision methods, devices, equipment, storage media and products. Background Art
[0002] With the development of internet and computer technologies, the requirements for video coding are becoming increasingly stringent. Versatile Video Coding (VVC) adopts a hybrid coding framework that combines various coding methods such as prediction, transform, quantization, filtering, and entropy coding on the coding blocks.
[0003] The input video is first divided into coding blocks, and then coding mode decisions are made for each coding unit. Coding mode decisions are divided into intra-frame prediction mode and inter-frame prediction mode. Intra-frame prediction technology uses the spatial correlation of the video to predict the current pixel using the encoded pixel values in the current frame, thereby removing spatial redundancy and effectively reducing spatial correlation in the video. Inter-frame prediction technology combines information from multiple frames to make predictions, effectively reducing temporal correlation in the video and significantly improving video compression efficiency. Inter-frame modes include motion vector prediction mode (Merge mode) and advanced motion vector prediction mode (AMVP mode).
[0004] Motion vector prediction mode only requires encoding the reference block index value, while advanced motion vector prediction mode requires further motion vector search and encoding of the motion vector difference (MVD). Because the encoder involves cost calculation, transformation, and quantization when performing inter-frame prediction coding, video coding mode decision-making consumes a considerable amount of time, significantly increasing the encoder's coding complexity and encoding time, resulting in reduced video coding efficiency. Summary of the Invention
[0005] The embodiments of the present application provide a video coding mode decision method, apparatus, device, storage medium and product to solve the technical problem in the related art that video coding mode decision consumes a lot of time, significantly increases the coding complexity and coding time of the encoder, and leads to a decrease in video coding efficiency. The method can reduce the time consumed by video coding mode decision, reduce the coding complexity and coding time of the encoder, and effectively improve the video coding efficiency.
[0006] In a first aspect, an embodiment of the present application provides a video coding mode decision method, comprising: determining, from a plurality of score units in a score buffer, a plurality of target score units corresponding to a coding range of a current coding unit; and determining first inter-frame prediction mode scores and second inter-frame prediction mode scores recorded by the plurality of target score units. The first inter-frame prediction mode scores and second inter-frame prediction mode scores recorded by the score units are updated based on an optimal mode decision result of a coding unit at a corresponding position. determining, according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the plurality of target score units, whether the current coding unit satisfies a second inter-frame prediction skip condition; A coding mode decision is performed on the current coding unit according to the second inter-frame prediction skip condition judgment result to obtain an optimal mode decision result of the current coding unit.
[0007] In a second aspect, an embodiment of the present application provides a video coding mode decision device, comprising a score determination module, a skip judgment module, and a mode decision module, wherein: The score determination module is configured to determine, from the multiple score units in the score buffer area, multiple target score units corresponding to the coding range of the current coding unit, and determine the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, wherein the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the score units are updated according to the optimal mode decision result of the coding unit at the corresponding position; The skip determination module is configured to determine whether the current coding unit meets the second inter-frame prediction skip condition according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the plurality of target score units; The mode decision module is configured to perform coding mode decision on the current coding unit according to the second inter-frame prediction skip condition judgment result, and obtain the optimal mode decision result of the current coding unit.
[0008] In a third aspect, an embodiment of the present application provides a video coding mode decision device, comprising: a memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the video coding mode decision method as described in the first aspect.
[0009] In a fourth aspect, an embodiment of the present application provides a non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to execute the video encoding mode decision method as described in the first aspect.
[0010] In the fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device performs the video coding mode decision method described in the first aspect.
[0011] The embodiment of the present application determines multiple target score units corresponding to the coding range of the current coding unit from multiple score units in the score buffer area, determines the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, determines whether the current coding unit meets the second inter-frame prediction skip condition according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, and makes a coding mode decision for the current coding unit according to the second inter-frame prediction skip condition judgment result to obtain the optimal mode decision result for the current coding unit. By accurately skipping the second inter-frame prediction mode decision process of some coding units according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by each score unit, the time consumed by video coding mode decision is reduced, the coding complexity and coding time of the encoder are reduced, and the video coding efficiency is effectively improved while ensuring the video coding quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 This is a flowchart of a video coding mode decision method provided by an embodiment of the present application; Figure 2 is a flowchart of another video coding mode decision method provided by an embodiment of the present application; Figure 3 This is a structural diagram of a video coding mode decision device provided in an embodiment of the present application; Figure 4 This is a structural diagram of a video coding mode decision device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] To further clarify the objectives, technical solutions, and advantages of this application, specific embodiments of the present application are described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are intended only to illustrate this application and are not intended to limit it. It should also be noted that, for ease of description, the drawings only illustrate portions relevant to this application, not all of them. Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts depict the various operations (or steps) as sequential processes, many of the operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The processes described above may terminate upon completion, but may also include additional steps not shown in the accompanying drawings. These processes may correspond to methods, functions, procedures, subroutines, subprograms, and the like.
[0014] The video coding mode decision method provided in this application can be applied to video coding scenarios based on general video coding. It aims to accurately skip the second inter-frame prediction mode decision process of some coding units based on the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by each score unit, thereby improving video coding efficiency.
[0015] In existing video coding schemes, the video input to the encoder is first divided into coding tree units (CTUs) of equal size. The maximum supported CTU size in VVC (Vertical Video Coding) is 128*128, and the minimum is 32*32. Each CTU is then divided into different CUs of varying sizes. Intra- and inter-frame prediction coding is performed on each CTU. When the current CTU enters the compression phase, the inter-mode decision is made first, followed by the intra-mode decision. Intra-frame prediction exploits the similarity of neighboring pixel values, using the values of previously coded pixels in the current frame to predict the current pixel. The pixel difference is then encoded, removing spatial correlation within the image. Inter-frame prediction uses the previously coded image as a reference image to obtain motion information for each block of the current image in the reference image. Motion compensation is used to obtain a predicted value for the current block. The residual between the predicted value and the true value is then encoded to remove temporal correlation between frames. After deciding between intra-frame and inter-frame prediction coding, the encoder selects the mode with the lowest rate-distortion cost as the optimal prediction mode based on the rate-distortion (RD) cost and uses this prediction mode to encode the current coding unit. Both motion vector prediction mode and advanced motion vector prediction mode are inter-frame prediction modes. The difference between them is that motion vector prediction mode only encodes the index value of the reference block, while advanced motion vector prediction mode further searches for motion vectors and encodes the motion vector difference. Because inter-frame prediction coding involves cost calculation, transformation, and quantization, the encoder's coding complexity and encoding time are significantly increased, resulting in a decrease in video coding efficiency. Based on this, a video coding mode decision method according to an embodiment of the present application is provided to address the technical problem that existing video coding mode decisions require a large amount of time, significantly increasing the encoder's coding complexity and encoding time, and resulting in a decrease in video coding efficiency.
[0016] Figure 1 A flowchart of a video coding mode decision method provided in an embodiment of the present application is given. The video coding mode decision method provided in an embodiment of the present application can be executed by a video coding mode decision device, which can be implemented by hardware and / or software and integrated into a video coding mode decision device.
[0017] The following description is made by taking the video coding mode decision device executing the video coding mode decision method as an example. Figure 1 , the video coding mode decision method includes: S110: Determine multiple target score units corresponding to the coding range of the current coding unit from multiple score units in the score buffer, and determine the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units.
[0018] The score buffer provided in the present application is configured with a plurality of score units, each score unit being configured to record, at a corresponding position of the score unit, a first inter-frame prediction mode score corresponding to the first inter-frame prediction mode and a second inter-frame prediction mode score corresponding to the second inter-frame prediction mode. The first inter-frame prediction mode provided in the present application may be a motion vector prediction mode, and the second inter-frame prediction mode may be an advanced motion vector prediction mode.
[0019] The first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the score unit are updated according to the optimal mode decision result of the coding unit at the corresponding position, and the more times the optimal mode decision result at the corresponding position of the score unit is the first inter-frame prediction mode, the higher the corresponding first inter-frame prediction mode score. Similarly, the more times the optimal mode decision result at the corresponding position of the score unit is the second inter-frame prediction mode, the higher the corresponding second inter-frame prediction mode score. The optimal mode decision result can be one of the first inter-frame prediction mode, the second inter-frame prediction mode, and the intra-frame prediction mode.
[0020] For example, when performing coding mode decision on a video frame to be coded, the video frame to be coded may be divided into multiple coding tree units. For each coding tree unit, the coding tree unit is first divided into multiple coding units of the same size, and a coding mode decision is performed on each coding unit to determine the optimal mode decision result for each coding unit. After completing the coding mode decision for a coding unit, the coding unit is further divided into smaller sub-coding units, and a coding mode decision is performed on each sub-coding unit to determine the optimal mode decision result for each sub-coding unit. This process is repeated until a preset minimum coding unit size is reached. In one embodiment, the size of the fractional unit is less than or equal to the preset minimum coding unit size.
[0021] When making a coding mode decision for a current coding unit, a coding range of the current coding unit is determined, and multiple fractional units corresponding to the coding range of the current coding unit are determined from multiple fractional units in a fraction buffer, and these fractional units are determined as target fractional units. After the target fractional units are determined, the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded in the multiple target fractional units are determined.
[0022] S120: Determine whether the current coding unit meets the second inter-frame prediction skip condition according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded in the multiple target score units.
[0023] Exemplarily, whether the current coding unit satisfies the second inter-frame prediction skip condition is determined based on the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded in the plurality of target score units determined above. When the second inter-frame prediction skip condition is satisfied, it is considered unlikely that the second inter-frame prediction mode will be used as the optimal mode decision result for the current coding unit, and the second inter-frame prediction process may be skipped, thereby reducing the processing difficulty and computational complexity of the video coding mode decision and improving the efficiency of the video coding mode decision.
[0024] S130: Perform coding mode decision on the current coding unit according to the second inter-frame prediction skip condition judgment result to obtain an optimal mode decision result for the current coding unit.
[0025] Exemplarily, a coding mode decision is performed on the current coding unit based on the second inter-frame prediction skip condition determination result determined above to obtain an optimal mode decision result for the current coding unit. When the second inter-frame prediction skip condition is met, the second inter-frame prediction mode decision process for the current coding unit is skipped.
[0026] It should be explained that adjacent pixels in the same image have a strong correlation, that is, because they are located adjacent to each other, the probability of mutation is small. Therefore, the optimal mode decision result of the coding unit that has been encoded in the same coding tree unit is used to predict the coding mode of the current coding unit to be encoded. That is, during the encoding process of the current coding tree unit, after the mode decision is made for each coding unit, if the optimal mode of this coding unit is the inter-frame prediction mode, the corresponding first inter-frame prediction mode score and second inter-frame prediction mode score are stored in a dispersed manner in the score buffer area where the coding area of the current coding unit is located.
[0027] For the current coding unit, the position corresponding to the current coding unit in the score buffer area is determined, the inter-frame prediction mode scores that have been decided and stored in the above position are collected, and it is determined whether to skip the second inter-frame prediction mode decision process to be performed by the current coding unit based on the above collected inter-frame prediction mode scores. This can accurately skip some prediction mode decision processes with lower probabilities for the current coding unit, greatly reducing the complexity of the coding mode decision and improving the video encoding speed while ensuring the accuracy of the coding mode decision.
[0028] In the above, by determining multiple target score units corresponding to the coding range of the current coding unit from multiple score units in the score buffer area, determining the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, determining whether the current coding unit meets the second inter-frame prediction skip condition according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, and making a coding mode decision for the current coding unit according to the second inter-frame prediction skip condition judgment result, obtaining the optimal mode decision result of the current coding unit, and accurately skipping the second inter-frame prediction mode decision process of some coding units according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by each score unit, reducing the time consumed by the video coding mode decision, reducing the coding complexity and coding time of the encoder, and effectively improving the video coding efficiency while ensuring the video coding quality.
[0029] Based on the above embodiments, Figure 2 A flowchart of another video coding mode decision method provided by an embodiment of the present application is given, which is a specific implementation of the above-mentioned video coding mode decision method. Figure 2 , the video coding mode decision method includes: S210: Determine multiple target score units corresponding to the coding range of the current coding unit from the multiple score units in the score buffer, and determine the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units.
[0030] In one possible embodiment, the video coding mode decision method provided by the present application further includes, before determining multiple target fractional units corresponding to the coding range of the current coding unit from the multiple fractional units in the fractional buffer: S201: Create a fractional buffer according to the size of the current coding tree unit, and configure multiple fractional units in the fractional buffer.
[0031] S202: Initialize the first inter prediction mode score and the second inter prediction mode score recorded by the score unit.
[0032] For example, when encoding a video frame, the video frame is divided into multiple coding tree units (CTUs), and coding unit division and coding mode decision processing are performed on each CTU separately. For the current CTU, a fractional buffer is created based on the size of the current CTU, and the fractional buffer is the same size as the current CTU. After the fractional buffer is created, multiple fractional units can be configured in the fractional buffer based on a preset fractional unit size. The preset fractional unit size can be 1*1, 2*2, 4*4, etc.
[0033] After creating a score cache and configuring multiple score units, initialize the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by each score unit, and set the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by each score unit to a preset score value (for example, the preset score value can be set to 0) or a null value.
[0034] For example, when a video frame is divided into multiple 128*128 coding tree units, a 128*128 fractional buffer is created accordingly, and multiple 4*4 fractional units are configured in the fractional buffer. The fractional buffer contains (128*128) / (4*4) = 1024 fractional units of the same size, and the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded in each fractional unit are set to 0.
[0035] The present application creates a fractional buffer according to the size of the current coding tree unit and configures multiple fractional units, and initializes the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the fractional unit. The subsequent coding mode decisions of the coding units in the current coding tree unit can be based on the fractional buffer to determine whether to skip the second inter-frame prediction mode decision process that the current coding unit will perform. While ensuring the accuracy of the coding mode decision, the complexity of the coding mode decision is greatly reduced and the video encoding speed is improved.
[0036] S220: Determine a first score sum of the first inter prediction mode scores and a second score sum of the second inter prediction mode scores recorded by the plurality of target score units.
[0037] S230: Determine whether the current coding unit satisfies a second inter-frame prediction skip condition according to the first fractional sum and the second fractional sum.
[0038] Exemplarily, after determining the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units corresponding to the current coding unit, the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units are respectively accumulated to obtain a first score sum of the first inter-frame prediction mode scores and a second score sum of the second inter-frame prediction mode scores. Optionally, the first score sum and the second score sum can be determined by the following formula:
[0039] in, is the first fraction sum, is the second fractional sum, is the first inter prediction mode score, is the second inter prediction mode score, is the coding unit, The inter-frame prediction mode scores of the fractional units within the coding range corresponding to the coding unit are accumulated.
[0040] In one embodiment, whether the current coding unit satisfies the second inter-frame prediction skip condition is determined based on the above-determined sum of the first scores and the sum of the second scores, and a second inter-frame prediction skip condition judgment result is obtained. For example, whether the current coding unit satisfies the second inter-frame prediction skip condition may be determined when the sum of the first scores is greater than the sum of the second scores, or the sum of the first scores is greater than the sum of the second scores of a preset multiple. The preset multiple is greater than 1, for example, the preset multiple can be set to 1.2, 1.8, 2, 4, etc. The present application accurately determines whether the current coding unit satisfies the second inter-frame prediction skip condition based on the first score sum of the first inter-frame prediction mode score and the second score sum of the second inter-frame prediction mode score, accurately determines the timing of skipping the second inter-frame prediction mode decision process of the current coding unit, and improves the video encoding speed.
[0041] In one possible embodiment, the video coding mode decision method provided in the present application determines whether the current coding unit meets the second inter-frame prediction skip condition based on the first score sum and the second score sum, which can be: when the first score sum is greater than or equal to the product of the preset first inter-frame prediction score threshold and the unit ratio, and the second score sum is less than or equal to the product of the preset score ratio and the first score sum, it is determined that the current coding unit meets the second inter-frame prediction skip condition.
[0042] Exemplarily, it is determined whether the first score sum is greater than or equal to the product of a preset first inter-frame prediction score threshold and a unit ratio, and it is determined whether the second score sum is less than or equal to the product of a preset score ratio and the first score sum. The unit ratio is the size ratio of the current coding unit to the target score unit, the preset first inter-frame prediction score threshold is a threshold used to determine whether to skip the second inter-frame prediction mode, and can be set to, for example, 2, 4, 6, etc. The preset score ratio can be understood as the minimum ratio by which the second score sum needs to be less than the first score sum, and the preset score ratio can be in the range of [0, 1).
[0043] When the first score sum is greater than or equal to the product of the preset first inter-frame prediction score threshold and the unit ratio, and the second score sum is less than or equal to the product of the preset score ratio and the first score sum, it can be determined that the current coding unit meets the second inter-frame prediction skip condition. This means that after sufficient coding mode decisions for coding units of different sizes within the current coding tree unit, the first score sum of the coding region corresponding to the current coding unit has reached a certain threshold, and the second score sum within the current coding unit is relatively small (the proportion of the coding region corresponding to the current coding unit executing the second inter-frame prediction mode is relatively small), and the second inter-frame prediction mode decision process for the current coding unit can be skipped. When the first score sum is less than the product of the preset first inter-frame prediction score threshold and the unit ratio, and / or the second score sum is greater than the product of the preset score ratio and the first score sum, it can be determined that the current coding unit does not meet the second inter-frame prediction skip condition. Optionally, the second inter-frame prediction skip condition can be determined using the following formula:
[0044] in, is the first fraction sum, To preset the first inter-frame prediction score threshold, is the second fractional sum, For the preset fraction ratio, is the unit ratio, is the size of the current coding unit, The present application improves video encoding speed by accurately determining whether the second inter-frame prediction skip condition is met based on the sum of the first scores, the sum of the second scores, the preset first inter-frame prediction score threshold, the sizes of the current coding unit and the target score unit, and the preset score ratio, and accurately determining the timing of skipping the second inter-frame prediction mode decision process for the current coding unit.
[0045] S240: Perform coding mode decision on the current coding unit according to the second inter-frame prediction skip condition judgment result to obtain an optimal mode decision result for the current coding unit.
[0046] In one possible embodiment, the video coding mode decision method provided in the present application makes a coding mode decision on the current coding unit based on the judgment result of the second inter-frame prediction skip condition, including: when the second inter-frame prediction skip condition is met, making a coding mode decision on the current coding unit based on the first inter-frame prediction mode and the intra-frame prediction mode; when the second inter-frame prediction skip condition is not met, making a coding mode decision on the current coding unit based on the first inter-frame prediction mode, the second inter-frame prediction mode and the intra-frame prediction mode.
[0047] Exemplarily, when the current coding unit meets the second inter-frame prediction skip condition, a coding mode decision is made for the current coding unit based on the first inter-frame prediction mode and the intra-frame prediction mode, and correspondingly, the optimal mode decision result is one of the first inter-frame prediction mode and the intra-frame prediction mode. When the current coding unit does not meet the second inter-frame prediction skip condition, a coding mode decision is made for the current coding unit based on the first inter-frame prediction mode, the second inter-frame prediction mode and the intra-frame prediction mode, and correspondingly, the optimal mode decision result is one of the first inter-frame prediction mode, the second inter-frame prediction mode and the intra-frame prediction mode. The present application determines whether to skip the second inter-frame prediction mode decision process of the current coding unit through the second inter-frame prediction skip condition judgment result, thereby effectively improving the video encoding speed.
[0048] S250: Update the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded in the target score unit according to the optimal mode decision result of the current coding unit.
[0049] In one possible embodiment, the video coding mode decision method provided in the present application, after performing a coding mode decision for the current coding unit based on the second inter-frame prediction skip condition determination result and obtaining the optimal mode decision result for the current coding unit, may further update the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded in the target score unit based on the optimal mode decision result for the current coding unit. Based on this, when the current coding unit is subsequently further divided into sub-coding units, the sub-coding units will determine the second inter-frame prediction skip condition based on the updated first inter-frame prediction mode score and the second inter-frame prediction mode score.
[0050] This application updates the inter-frame prediction mode score recorded in the target score unit according to the optimal mode decision result of the current coding unit, and dynamically updates the score unit according to the coding mode decision process, ensuring that the position and timing of skipping the second inter-frame prediction mode decision process can be accurately determined subsequently, while ensuring the video coding quality and effectively improving the video coding efficiency.
[0051] In one embodiment, the video coding mode decision method provided in the present application updates the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the target score unit according to the optimal mode decision result of the current coding unit, which can be: when the optimal mode decision result of the current coding unit is the first inter-frame prediction mode, increase the first inter-frame prediction mode score recorded by the target score unit; when the optimal mode decision result of the current coding unit is the second inter-frame prediction mode, increase the second inter-frame prediction mode score recorded by the target score unit.
[0052] Exemplarily, when the optimal mode decision result for the current coding unit is the first inter-frame prediction mode, the first inter-frame prediction mode score recorded by the target score unit is increased, while the second inter-frame prediction mode score recorded by the target score unit remains unchanged. For example, the preset update amplitude is added to the current first inter-frame prediction mode score to obtain an updated first inter-frame prediction mode score.
[0053] When the optimal mode decision result for the current coding unit is the second inter-frame prediction mode, the second inter-frame prediction mode score recorded in the target score unit is increased, while the first inter-frame prediction mode score recorded in the target score unit remains unchanged. For example, a preset update amplitude is added to the current second inter-frame prediction mode score to obtain an updated second inter-frame prediction mode score.
[0054] When the optimal mode decision result of the current coding unit is the intra-frame prediction mode, the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the target score unit are maintained unchanged. This application dynamically updates the score buffer by increasing the first inter-frame prediction mode score or the second inter-frame prediction mode score according to the optimal mode decision result, ensuring that the location and timing of skipping the second inter-frame prediction mode decision process can be accurately determined subsequently, effectively improving video coding efficiency while ensuring video coding quality.
[0055] In the above, by determining multiple target score units corresponding to the coding range of the current coding unit from multiple score units in the score buffer, determining the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, determining whether the current coding unit meets the second inter-frame prediction skip condition based on the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, and performing a coding mode decision for the current coding unit based on the second inter-frame prediction skip condition determination result, an optimal mode decision result is obtained for the current coding unit. By accurately skipping the second inter-frame prediction mode decision process for some coding units based on the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by each score unit, the time consumed in video coding mode decision is reduced, the encoding complexity and encoding time of the encoder are reduced, and video coding efficiency is effectively improved while ensuring video coding quality. Furthermore, by updating the inter-frame prediction mode scores recorded by the target score units based on the optimal mode decision result of the current coding unit, the score units are dynamically updated according to the coding mode decision process, ensuring that the location and timing of skipping the second inter-frame prediction mode decision process can be accurately determined subsequently, and video coding efficiency is effectively improved while ensuring video coding quality.
[0056] Figure 3 This is a structural diagram of a video coding mode decision device provided by an embodiment of the present application. Figure 3The video encoding mode decision device includes a score determination module 31, a skip judgment module 32 and a mode decision module 33.
[0057] Among them, the score determination module 31 is configured to determine multiple target score units corresponding to the coding range of the current coding unit from the multiple score units in the score buffer area, and determine the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the multiple target score units, wherein the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the score unit are updated according to the optimal mode decision result of the coding unit at the corresponding position; the skip judgment module 32 is configured to determine whether the current coding unit meets the second inter-frame prediction skip condition based on the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the multiple target score units; the mode decision module 33 is configured to make a coding mode decision for the current coding unit according to the second inter-frame prediction skip condition judgment result, and obtain the optimal mode decision result of the current coding unit.
[0058] In the above, by determining multiple target score units corresponding to the coding range of the current coding unit from multiple score units in the score buffer area, determining the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, determining whether the current coding unit meets the second inter-frame prediction skip condition according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, and making a coding mode decision for the current coding unit according to the second inter-frame prediction skip condition judgment result, obtaining the optimal mode decision result of the current coding unit, and accurately skipping the second inter-frame prediction mode decision process of some coding units according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by each score unit, reducing the time consumed by the video coding mode decision, reducing the coding complexity and coding time of the encoder, and effectively improving the video coding efficiency while ensuring the video coding quality.
[0059] In a possible embodiment, the mode decision module 33 performs coding mode decision on the current coding unit according to the second inter-frame prediction skip condition judgment result, and is configured as follows: When the second inter-frame prediction skip condition is met, performing a coding mode decision on the current coding unit based on the first inter-frame prediction mode and the intra-frame prediction mode; When the second inter prediction skip condition is not satisfied, a coding mode decision is performed on the current coding unit based on the first inter prediction mode, the second inter prediction mode, and the intra prediction mode.
[0060] In a possible embodiment, the video coding mode decision device further includes a score updating module, and the score updating module is configured to: The first inter-frame prediction mode score and the second inter-frame prediction mode score recorded in the target score unit are updated according to the optimal mode decision result of the current coding unit.
[0061] In a possible embodiment, the score updating module updates the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the target score unit according to the optimal mode decision result of the current coding unit, and is configured as follows: When the optimal mode decision result of the current coding unit is the first inter-frame prediction mode, increasing the first inter-frame prediction mode score recorded in the target score unit; When the optimal mode decision result of the current coding unit is the second inter-frame prediction mode, the second inter-frame prediction mode score recorded in the target score unit is increased.
[0062] In one possible embodiment, the skip determination module 32 determines whether the current coding unit satisfies the second inter-frame prediction skip condition based on the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, and is configured as follows: Determine a first score sum of the first inter-frame prediction mode scores and a second score sum of the second inter-frame prediction mode scores recorded by the plurality of target score units; Determining whether the current coding unit satisfies a second inter-frame prediction skip condition according to the first fractional sum and the second fractional sum.
[0063] In a possible embodiment, the skip determination module 32 determines whether the current coding unit meets the second inter-frame prediction skip condition according to the first score sum and the second score sum, and is configured as follows: When the first score sum is greater than or equal to the product of a preset first inter-frame prediction score threshold and a unit ratio, and the second score sum is less than or equal to the product of a preset score ratio and the first score sum, it is determined that the current coding unit meets the second inter-frame prediction skip condition, where the unit ratio is the size ratio of the current coding unit to the target score unit.
[0064] In a possible embodiment, the video coding mode decision device further includes a buffer configuration module, and the buffer configuration module is configured as follows: Creating a fractional buffer according to the size of the current coding tree unit and configuring a plurality of fractional units in the fractional buffer; The first inter prediction mode score and the second inter prediction mode score recorded by the score unit are initialized.
[0065] It is worth noting that in the embodiment of the above-mentioned video encoding mode decision device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0066] An embodiment of the present application also provides a video coding mode decision device, which can integrate the video coding mode decision apparatus provided in an embodiment of the present application. Figure 4 This is a schematic diagram of the structure of a video coding mode decision device provided by an embodiment of the present application. Figure 4 The video coding mode decision device includes an input device 43, an output device 44, a memory 42, and one or more processors 41. The memory 42 is used to store one or more programs. When the one or more programs are executed by the one or more processors 41, the one or more processors 41 implement the video coding mode decision method provided in the above embodiments. The video coding mode decision device, equipment, and computer provided above can be used to implement the video coding mode decision method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
[0067] An embodiment of the present application also provides a non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to execute the video coding mode decision method provided in the above embodiment. Of course, the non-volatile storage medium storing computer-executable instructions provided in an embodiment of the present application, whose computer-executable instructions are not limited to the video coding mode decision method provided above, can also execute the relevant operations in the video coding mode decision method provided in any embodiment of the present application. The video coding mode decision device, equipment and storage medium provided in the above embodiment can execute the video coding mode decision method provided in any embodiment of the present application. For technical details not described in detail in the above embodiment, please refer to the video coding mode decision method provided in any embodiment of the present application.
[0068] Based on the above embodiments, the embodiments of the present application also provide a computer program product. The essence of the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes a number of instructions for enabling a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the video coding mode decision method provided in each embodiment of the present application.
Claims
1. A video coding mode decision method, characterized in that: include: Determining, from a plurality of score units in a score buffer, a plurality of target score units corresponding to a coding range of a current coding unit, and determining first inter-frame prediction mode scores and second inter-frame prediction mode scores recorded by the plurality of target score units, wherein the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the score units are updated according to an optimal mode decision result of a coding unit at a corresponding position; determining, according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the plurality of target score units, whether the current coding unit satisfies a second inter-frame prediction skip condition; A coding mode decision is performed on the current coding unit according to the second inter-frame prediction skip condition judgment result to obtain an optimal mode decision result of the current coding unit.
2. The video coding mode decision method according to claim 1, wherein: The performing coding mode decision on the current coding unit according to the second inter-frame prediction skip condition judgment result includes: When a second inter-frame prediction skip condition is met, performing a coding mode decision on the current coding unit based on the first inter-frame prediction mode and the intra-frame prediction mode; When the second inter-frame prediction skip condition is not met, a coding mode decision is performed on the current coding unit based on the first inter-frame prediction mode, the second inter-frame prediction mode, and the intra-frame prediction mode.
3. The video coding mode decision method according to claim 1, wherein: After performing coding mode decision on the current coding unit according to the second inter-frame prediction skip condition judgment result to obtain the optimal mode decision result of the current coding unit, the method further includes: The first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the target score unit are updated according to the optimal mode decision result of the current coding unit.
4. The video coding mode decision method according to claim 3, wherein: The updating of the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the target score unit according to the optimal mode decision result of the current coding unit includes: When the optimal mode decision result of the current coding unit is the first inter-frame prediction mode, increasing the first inter-frame prediction mode score recorded by the target score unit; When the optimal mode decision result of the current coding unit is the second inter-frame prediction mode, the second inter-frame prediction mode score recorded in the target score unit is increased.
5. The video coding mode decision method according to claim 1, wherein: The determining, according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the plurality of target score units, whether the current coding unit satisfies the second inter-frame prediction skip condition includes: Determine a first score sum of the first inter-frame prediction mode scores and a second score sum of the second inter-frame prediction mode scores recorded by the plurality of target score units; Determining whether the current coding unit satisfies a second inter-frame prediction skip condition according to the first fractional sum and the second fractional sum.
6. The video coding mode decision method according to claim 5, characterized in that: The determining, according to the first fraction sum and the second fraction sum, whether the current coding unit satisfies a second inter-frame prediction skip condition includes: When the first score sum is greater than or equal to the product of a preset first inter-frame prediction score threshold and a unit ratio, and the second score sum is less than or equal to the product of a preset score ratio and the first score sum, it is determined that the current coding unit meets the second inter-frame prediction skip condition, wherein the unit ratio is the size ratio of the current coding unit to the target score unit.
7. The video coding mode decision method according to any one of claims 1 to 6, characterized in that: Before determining a plurality of target fractional units corresponding to the coding range of the current coding unit from the plurality of fractional units in the fractional buffer, the method further includes: Creating a fractional buffer according to the size of the current coding tree unit, and configuring a plurality of fractional units in the fractional buffer; Initialize the first inter-frame prediction mode score and the second inter-frame prediction mode score recorded by the score unit.
8. A video coding mode decision device, characterized in that: It includes a score determination module, a skip judgment module and a mode decision module, wherein: The score determination module is configured to determine, from the multiple score units in the score buffer area, multiple target score units corresponding to the coding range of the current coding unit, and determine the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the multiple target score units, wherein the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the score units are updated according to the optimal mode decision result of the coding unit at the corresponding position; The skip determination module is configured to determine whether the current coding unit meets the second inter-frame prediction skip condition according to the first inter-frame prediction mode scores and the second inter-frame prediction mode scores recorded by the plurality of target score units; The mode decision module is configured to perform coding mode decision on the current coding unit according to the second inter-frame prediction skip condition judgment result, and obtain the optimal mode decision result of the current coding unit.
9. A video coding mode decision device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the video coding mode decision method according to any one of claims 1 to 7.
10. A non-volatile storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the video coding mode decision method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the video coding mode decision method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Video coder, method and device and inter-frame mode selection method and device thereof
CN104602017A
Depth correlation-based inter-frame fast encoding method for coding screen content
CN105704494A
Video coding control method and device, equipment and storage medium
CN114584768A
Mode skipping method and device in video coding, equipment and storage medium
CN116546200A
Video coding control method, apparatus, device, and storage medium
WO2023155751A1