Coding mode prediction method, apparatus, device, medium and product

By acquiring and judging chroma distortion information in video encoding and calculating additional costs to select the target encoding mode, the problem of image color blockage caused by poor chroma component encoding in existing technologies is solved, and better encoding effect is achieved.

CN119316593BActive Publication Date: 2026-03-20BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing video coding technologies, coding mode prediction methods based on rate-distortion cost are prone to poor chroma component coding, resulting in image color block problems.

Method used

By acquiring the chroma distortion information of candidate coding modes, it is determined whether the preset conditions are met. If they are met, an additional cost is calculated and the target cost is determined based on the additional cost, thereby selecting the target coding mode and avoiding chroma component distortion.

Benefits of technology

At the same coding bit rate, it reduces significant distortion of chroma components, improves image color blocking, and enhances coding mode prediction performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316593B_ABST
    Figure CN119316593B_ABST
Patent Text Reader

Abstract

The present disclosure provides an encoding mode prediction method, device, equipment, medium and product, relates to the technical field of artificial intelligence, in particular to the technical fields of cloud storage, cloud computing, video encoding and the like. The encoding mode prediction method comprises: for various candidate encoding modes in a plurality of candidate encoding modes, obtaining chrominance distortion information of a current block corresponding to the various candidate encoding modes; if the chrominance distortion information meets a preset condition, determining an additional cost of the various candidate encoding modes, and determining a target cost of the various candidate encoding modes based on the additional cost; and determining a target encoding mode in the plurality of candidate encoding modes based on the target cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to the technical field of cloud storage, cloud computing, video coding and the like, and more particularly to a coding mode prediction method and device, equipment, medium and product. BACKGROUND

[0002] The coding mode prediction of video coding refers to predicting the coding mode of a current block to encode the video at as low a code rate as possible while maintaining a certain video quality level.

[0003] In the related art, the coding mode prediction is usually based on rate distortion cost (RdCost). SUMMARY

[0004] The present disclosure provides a coding mode prediction method and device, equipment, medium and product.

[0005] According to an aspect of the present disclosure, a coding mode prediction method is provided, including: obtaining, for each candidate coding mode in a plurality of candidate coding modes, chrominance distortion information of a current block corresponding to the candidate coding mode; determining, if the chrominance distortion information meets a preset condition, an additional cost of the candidate coding mode, and determining a target cost of the candidate coding mode based on the additional cost; and determining, based on the target cost, a target coding mode from the plurality of candidate coding modes.

[0006] According to another aspect of the present disclosure, a coding mode prediction device is provided, including: an obtaining module configured to obtain, for each candidate coding mode in a plurality of candidate coding modes, chrominance distortion information of a current block corresponding to the candidate coding mode; a determining module configured to determine, if the chrominance distortion information meets a preset condition, an additional cost of the candidate coding mode, and determine a target cost of the candidate coding mode based on the additional cost; and a prediction module configured to determine, based on the target cost, a target coding mode from the plurality of candidate coding modes.

[0007] According to another aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of the aspects described above.

[0008] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method according to any one of the aspects above.

[0009] According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of the aspects above.

[0010] According to the embodiments of the present disclosure, the encoding effect can be improved, and the color block problem of the image can be improved.

[0011] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0012] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them:

[0013] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0014] Figure 2 is a schematic diagram of an application scenario for implementing the embodiments of the present disclosure;

[0015] Figure 3 is a schematic diagram of a target cost calculation process according to an embodiment of the present disclosure;

[0016] Figure 4 is a schematic diagram according to a second embodiment of the present disclosure;

[0017] Figure 5 is a schematic diagram according to a third embodiment of the present disclosure;

[0018] Figure 6 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0019] Figure 7 is a schematic diagram of an electronic device for implementing the encoding mode prediction method of the embodiments of the present disclosure. DETAILED DESCRIPTION

[0020] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, in order to be clear and concise, the description below omits the description of well-known functions and structures.

[0021] YUV is a video data format, mainly used in television systems, including analog television and digital television. In YUV, Y refers to luminance (Luminance or Luma), and U and V refer to chrominance (Chrominance or Chroma). Common YUV formats mainly include the following:

[0022] YUV444: The sampling rate of Y, U, and V components is 1, that is, each pixel has independent Y, U, and V values. This is the highest quality YUV format, but the data volume is also the largest.

[0023] YUV422: U and V are sampled once for every two pixels. Compared with YUV444, the chroma resolution is reduced by half.

[0024] YUV420: U and V are sampled once for every four pixels. Compared with YUV444, the chroma resolution is reduced by three quarters. This is the most commonly used YUV format because it greatly reduces the data volume while maintaining good video quality.

[0025] YUV411: U and V are sampled once for every four pixels, but the horizontal resolution of chroma is lower than that of YUV420.

[0026] YUV410: U and V are sampled once for every nine pixels, and the horizontal and vertical resolutions of chroma are both low.

[0027] YUV400: Only Y component, no U and V components, that is, black and white video.

[0028] When predicting the encoding mode, the sum_RdCost of the three components Y, U, and V is usually used as a measure to select the mode with smaller sum_RdCost as the optimal encoding mode. Wherein, sum_RdCost=Y_RdCost+U_RdCost+V_RdCost.

[0029] The above cost is usually the rate-distortion cost (Rate-Distortion Cost), which is used to measure the pros and cons of different encoding modes in video encoding, and it considers both the bit rate and the distortion degree after encoding. It can be expressed in the formula as follows:

[0030] Rd_Cost=D+λR

[0031] Wherein, Rd_Cost is the rate-distortion cost;

[0032] D is the distortion degree;

[0033] R is the encoding bit rate;

[0034] λ is a preset weight adjustment parameter.

[0035] At present, most of the video encoding is to encode the video in YUV420 data format.

[0036] In the sum_RdCost calculation of each encoding mode, since the data proportion of the Y component is higher, and the data proportion of the U and V components is low, even if the U and V components have obvious abnormalities, the sum_RdCost is smaller, resulting in that the optimal encoding mode selected is a mode with poor chroma component encoding, and the image color block problem occurs.

[0037] In order to improve the image color block problem, the present disclosure provides the following embodiments.

[0038] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure. The present embodiment provides an encoding mode prediction method, as shown in Figure 1 The method comprises the following steps.

[0039] 101. For each candidate encoding mode in a plurality of candidate encoding modes, obtain chroma distortion information of a current block corresponding to the candidate encoding mode.

[0040] 102. If the chroma distortion information meets a preset condition, determine an additional cost of the candidate encoding mode, and determine a target cost of the candidate encoding mode based on the additional cost.

[0041] 103. Determine a target encoding mode in the plurality of candidate encoding modes based on the target cost.

[0042] In the video encoding scenario, the current block refers to a pixel block currently encoded in the video.

[0043] The chroma distortion information refers to distortion-related information on the chroma component.

[0044] Assuming that the video format is YUV format, the chroma component includes the U component and the Y component.

[0045] The distortion-related information can include distortion degree and / or distortion variance.

[0046] The distortion degree is used to represent the distortion degree.

[0047] Common distortion measurement methods include mean squared error (MSE), peak signal-to-noise ratio (PSNR), and the like. The mean squared error is the average of the square of the difference between each pixel of the original pixel block and the reconstructed pixel block; the PSNR is obtained based on the mean squared error, for example, by dividing the maximum pixel value by the mean squared error and then taking the logarithm. In formula:

[0048]

[0049] wherein MSE is the mean squared error;

[0050] x i is the pixel value of the i-th pixel in the original pixel block;

[0051] y i is the pixel value of the i-th pixel in the reconstructed pixel block;

[0052] n is the total number of pixels.

[0053]

[0054] wherein PSNR is the peak signal-to-noise ratio;

[0055] MSE is the mean squared error;

[0056] MAX I is the maximum pixel value, for example, for an 8-bit grayscale image, MAX I = 255.

[0057] Taking the YUV format as an example, the distortion degree in the chrominance distortion information is the chrominance distortion degree, including the U component distortion degree and the V component distortion degree, represented by dist_U and dist_V respectively. Taking the distortion degree as MSE as an example, the MSE of the U component is taken as dist_U, and the MSE of the V component is taken as dist_V.

[0058] The distortion variance refers to the variance between the distortion degrees of the sub-blocks of the current block.

[0059] Suppose the sub-block size is 4*4, then the current block can be divided into multiple 4*4 sub-blocks, the distortion degree of each sub-block is calculated, for example, the mean squared error of each sub-block, and then the variance between the sub-blocks is calculated according to the distortion degree of each sub-block, for example, first calculate the mean value of the distortion degree according to the distortion degree of each sub-block, and then calculate the square sum mean value of the distortion degree of each sub-block and the mean value of the distortion degree, as the variance.

[0060] The variance is expressed in formula as:

[0061]

[0062] wherein var represents a variance;

[0063] m is the total number of sub-blocks;

[0064] d i is the distortion degree of the i-th sub-block;

[0065] d avg is the mean of the sub-block distortion degrees.

[0066] Taking the YUV format as an example, the distortion variance in the chroma distortion information is specifically a chroma distortion variance, including a U component distortion variance and a V component distortion variance, represented by var_dist_U and var_dist_V respectively. Taking var_dist_U as an example, var_dist_U is a variance calculated according to the distortion degrees of the 4*4 sub-blocks corresponding to the U component.

[0067] After obtaining the chroma distortion information of the current block, such as the chroma distortion degrees (dist_U and dist_V) and / or the chroma distortion variances (var_dist_U and var_dist_V) described above, it is determined whether the obtained chroma distortion information meets a preset condition. When the preset condition is met, an additional cost is calculated, and then a target cost is calculated according to the additional cost.

[0068] Specifically, the preset condition can include: a target chroma distortion degree is greater than a preset multiple of a luminance distortion degree; and / or a target chroma distortion variance is greater than a preset variance threshold.

[0069] wherein the target chroma distortion degree is the maximum value in the chroma distortion degrees, and is represented as:

[0070] max(dist_U, dist_V);

[0071] The target chroma distortion variance is the maximum value in the chroma distortion variances, and is represented as:

[0072] max(var_dist_U, var_dist_V).

[0073] The luminance distortion degree is a distortion degree calculated according to the luminance component, and in the YUV format, it is a distortion degree calculated according to the Y component, such as the MSE of the Y component, represented by dist_Y.

[0074] Based on this, if max(dist_U, dist_V) > dist_Y * k1, and / or,

[0075] If max(var_dist_U, var_dist_V) > k2, the additional cost is calculated.

[0076] wherein k1 is a preset multiple, and k2 is a preset variance threshold.

[0077] After the additional cost is obtained, the target cost is calculated based on the additional cost.

[0078] The target cost is a final calculated parameter, which can be a rate-distortion cost.

[0079] The additional cost refers to an additional introduced parameter other than a general cost function. For example, the target cost is a rate-distortion cost, and the general cost is calculated according to a distortion D and an encoding bit rate R. In the embodiment, an additional introduced parameter, referred to as an additional cost, is used to represent R extra .

[0080] The calculation formula can be:

[0081] sum_Rd_Cost=D+λ(R+R extra ).

[0082] The sum_Rd_Cost is the target cost.

[0083] The R extra is the additional cost.

[0084] The D, R, and λ are parameters involved in the general cost function, which are the distortion, the encoding bit rate, and the weight adjustment parameter, respectively, as described above.

[0085] After the target cost of each candidate encoding mode is determined, the target encoding mode is determined based on the target cost, for example, the candidate encoding mode with the minimum target cost is taken as the target encoding mode.

[0086] In the embodiment, when the chrominance distortion information meets the preset condition, the additional cost of each candidate encoding mode is determined, the target cost is determined based on the additional cost, and the target encoding mode is determined based on the target cost. In this way, the additional cost can be introduced when the target cost is calculated, the encoding mode prediction effect is improved, and thus the chrominance component obvious distortion is reduced on the basis of the same encoding bit rate, thereby obviously improving the image color block problem.

[0087] In order to better understand the present disclosure, the application scenarios related to the present disclosure are described as follows:

[0088] Figure 2 is a schematic diagram of an application scenario for implementing the embodiment of the present disclosure.

[0089] In the embodiment, the encoding mode prediction in video encoding is taken as an example.

[0090] In the video encoding scenario, for a current block in a current frame, the target encoding mode can be determined in multiple candidate encoding modes through the encoding mode prediction process, and then the current block is encoded by using the target encoding mode.

[0091] Generally speaking, the more complex the encoding pattern, the more encoding bits are required, and the lower the distortion. When predicting encoding patterns, it is necessary to balance the number of encoding bits and the distortion. Therefore, the rate-distortion cost (Rd_Cost) can be used to measure the merits of different encoding patterns, which comprehensively considers the bit rate and distortion level after encoding.

[0092] For YUV format data, the target cost is usually the sum of the costs of each component, denoted as sum_Rd_Cost.

[0093] After obtaining the target cost of each candidate coding mode, the candidate coding mode with the minimum target cost can be taken as the target coding mode.

[0094] Specifically, such as Figure 2 As shown, assuming there are N candidate encoding patterns, denoted as the first encoding pattern, the second encoding pattern, ... the Nth encoding pattern, the target cost (e.g., sum_Rd_Cost) of each candidate encoding pattern can be calculated, denoted as sum_Rd_cost1 to sum_Rd_costN respectively. The candidate encoding pattern corresponding to the minimum cost is taken as the target encoding pattern.

[0095] For each candidate encoding pattern, the target cost, without introducing additional costs, can be expressed as:

[0096] sum_Rd_Cost=D+λR

[0097] =D Y +D U +D V +λ(R Y +R U +R V )

[0098] Where sum_Rd_Cost is the target cost; D Y D U D V These are the distortions in the Y, U, and V components, respectively; R Y ,R U ,R V These are the encoding bit rates for the Y, U, and V components, respectively; λ is a preset weight adjustment parameter.

[0099] Because the Y component has a high proportion in sum_Rd_Cost, the chroma distortion may be high for a certain candidate encoding mode (e.g., D). U and D VThe chroma distortion may be relatively large, but the total cost (sum_Rd_Cost) may be relatively small. Therefore, when determining the target encoding mode based on sum_Rd_Cost, the candidate encoding mode with large chroma distortion may be used as the target encoding mode, which will lead to color block problems.

[0100] Therefore, if the chroma distortion of the current block is large, in this embodiment of the disclosure, an additional cost will be introduced, a target cost will be calculated based on the additional cost, and then the candidate encoding mode with the minimum target cost can be used as the target encoding mode.

[0101] Based on this, for each candidate encoding pattern, the target cost, when introducing additional costs, can be expressed as:

[0102] sum_Rd_Cost=D+λ(R+R extra )

[0103] =D Y +D U +D V +λ(R Y +R U +R V +R extra )

[0104] Where sum_Rd_Cost is the target cost; D Y D U D V These are the distortions in the Y, U, and V components, respectively; R Y ,R U ,R V These are the coding bit rates for the Y, U, and V components, respectively; λ is a preset weight adjustment parameter; R extra It's an additional cost.

[0105] Figure 3 This is a schematic diagram illustrating the calculation process of the target cost according to an embodiment of this disclosure.

[0106] like Figure 3 As shown, for each candidate encoding mode, we can first determine whether the chroma distortion information of the current block meets the preset conditions. If it does, we calculate the additional cost and then calculate the target cost based on the additional cost. If it does not meet the conditions, we calculate the target cost based on the usual method.

[0107] Specifically, when introducing additional costs, the calculation formula can be:

[0108] sum_Rd_Cost=D+λ(R+R extra )

[0109] =D Y +D U +DV + λ (R Y + R U + R V + R extra )

[0110] The calculation formula can be:

[0111] sum_Rd_Cost = D + λR

[0112] = D Y + D U + D V + λ (R Y + R U + R V )

[0113] In the above formula, sum_Rd_Cost is the target cost; D Y , D U , and D V are distortion degrees on Y, U, and V components respectively; R Y , R U , and R V are encoding bit rates on Y, U, and V components respectively; λ is a preset weight adjustment parameter; and R extra is the additional cost.

[0114] In combination with the above application scenarios, the present disclosure further provides the following embodiments.

[0115] Figure 4 According to a second embodiment of the present disclosure, a schematic diagram is provided, and the embodiment provides an encoding mode prediction method, which comprises:

[0116] 401. For each candidate encoding mode in multiple candidate encoding modes, obtain chrominance distortion information of a current block corresponding to the candidate encoding mode.

[0117] 402. Determine whether the chrominance distortion information meets a preset condition. If yes, perform 403; otherwise, perform 404.

[0118] Specifically, if the chrominance distortion information includes a target chrominance distortion degree, and the target chrominance distortion degree is greater than a preset multiple of a luminance distortion degree of the current block, it is determined that the chrominance distortion information meets the preset condition; and / or,

[0119] If the chrominance distortion information includes a target chrominance distortion variance, and the target chrominance distortion is greater than a preset variance threshold, it is determined that the chrominance distortion information meets the preset condition.

[0120] If the current block includes multiple chroma components, the target chroma distortion degree is the maximum value of the multiple chroma distortion degrees, and similarly, the target chroma distortion variance is the maximum value of the multiple chroma distortion variances.

[0121] For example, in the YUV format, the target chroma distortion degree is the maximum value of the U component distortion degree and the V component distortion degree, and the target chroma distortion variance is the maximum value of the U component distortion variance and the V component distortion variance.

[0122] The formula is:

[0123] Based on this, if max(dist_U, dist_V) > dist_Y * k1, the preset condition is met; and / or,

[0124] If max(var_dist_U, var_dist_V) > k2, the preset condition is met.

[0125] Wherein, k1 is a preset multiple, and k2 is a preset variance threshold;

[0126] dist_U and dist_V are the U component distortion degree and the V component distortion degree, respectively;

[0127] dist_Y is the Y component (luminance component) distortion degree;

[0128] var_dist_U and var_dist_V are the U component distortion variance and the V component distortion variance, respectively;

[0129] max() is a maximum value operation.

[0130] In this embodiment, whether the preset condition is met is determined based on the chroma distortion degree and / or the chroma distortion variance, which can accurately and comprehensively predict the current block with obvious chroma distortion, and then the target encoding mode capable of reducing the chroma distortion can be selected for the current block with obvious chroma distortion, thereby improving the image block problem.

[0131] 403, determine the additional cost of the various candidate encoding modes, and determine the target cost of the various candidate encoding modes based on the additional cost.

[0132] Wherein, the additional cost can be determined based on the current optimal mode chroma distortion degree and the current chroma distortion degree corresponding to the current block.

[0133] For example, in the YUV format, the current optimal mode chroma distortion degree is represented by dist_U_best and dist_V_best, and the current chroma distortion degree is represented by dist_U and dist_V, and the additional cost R extra The calculation formula of the additional cost R

[0134]

[0135] wherein R extra is an extra cost;

[0136] qp is a preset quantization parameter; used to control the code rate and the encoding distortion, the greater the qp, the greater the distortion, the lower the code rate;

[0137] dist diff is a distortion error;

[0138] dist_U, dist_V is the current chroma distortion degree;

[0139] dist_U_best, dist_V_best is the current optimal mode chroma distortion degree.

[0140] wherein the current chroma distortion degree is the chroma distortion degree corresponding to the current encoding mode, and the current optimal mode chroma distortion degree is the chroma distortion degree corresponding to the current optimal encoding mode, and the current optimal encoding mode is the optimal encoding mode among all candidate encoding modes that have been processed.

[0141] Specifically, each candidate encoding mode can be traversed in turn, and the target cost of each candidate encoding mode can be calculated. The candidate encoding mode currently traversed is the current encoding mode. Assuming that the current encoding mode is the second encoding mode, the current chroma distortion degree is the chroma distortion degree corresponding to the second encoding mode. Assuming that the first encoding mode has been traversed before, the current optimal mode chroma distortion degree is the chroma distortion degree corresponding to the optimal encoding mode among the first encoding mode and the second encoding mode. For example, the target cost corresponding to the first encoding mode is sum1, the target cost corresponding to the second encoding mode is sum2, and sum2<sum1, then the current optimal mode is the second encoding mode, and the current optimal mode chroma distortion degree is the chroma distortion degree corresponding to the second encoding mode. For another example, after traversing the second encoding mode, the third encoding mode is currently traversed, the current optimal mode is the optimal encoding mode among the first encoding mode, the second encoding mode and the third encoding mode, and the current optimal mode chroma distortion degree is the chroma distortion degree corresponding to the current optimal mode.

[0142] In this embodiment, the extra cost is determined based on the current optimal mode chroma distortion degree and the current chroma distortion degree, which can accurately and efficiently obtain the extra cost and improve the processing accuracy and efficiency.

[0143] After the extra cost is calculated, the target cost is calculated based on the extra cost. Specifically, the original distortion degree and the original encoding bit rate corresponding to the various candidate encoding modes can be obtained; the target encoding bit rate is obtained based on the extra cost and the original encoding bit rate; and the target cost is determined based on the original distortion degree and the target encoding bit rate.

[0144] The calculation formula can be:

[0145] sum_Rd_Cost=D+λ(R+R extra );

[0146] Wherein, sum_Rd_Cost is the target cost;

[0147] D and R are the original distortion degree and the original encoding bit rate respectively;

[0148] R extra is the additional cost;

[0149] R+R extra is the target encoding bit rate;

[0150] λ is a preset weight adjustment parameter.

[0151] In this embodiment, the target encoding bit rate is obtained based on the additional cost and the original encoding bit rate, and the target cost is determined based on the original distortion degree and the target encoding bit rate, so that the additional cost is introduced into the encoding bit rate part, the accuracy of the target cost is improved, and the encoding block with abnormal chroma is avoided, and the accuracy of the target encoding mode is improved.

[0152] 404、Based on the original distortion degree and the original encoding bit rate corresponding to the various candidate encoding modes, the target cost is determined.

[0153] The calculation formula can be:

[0154] sum_Rd_Cost=D+λR;

[0155] Wherein, sum_Rd_Cost is the target cost;

[0156] D and R are the original distortion degree and the original encoding bit rate respectively;

[0157] λ is a preset weight adjustment parameter.

[0158] In this embodiment, when the chroma distortion information does not satisfy the preset condition, the target cost is determined based on the original distortion degree and the original encoding bit rate, which can simplify the operation and improve the processing efficiency.

[0159] 405、Based on the target cost, the target encoding mode is determined from the multiple candidate encoding modes.

[0160] Specifically, the candidate encoding mode with the minimum target cost can be taken as the target encoding mode.

[0161] In this way, the target encoding mode can be obtained simply and efficiently.

[0162] Figure 5is a schematic diagram according to a third embodiment of the present disclosure, and the embodiment provides an encoding mode prediction method, which comprises the following steps of:

[0163] 501. Obtain a current block in a video.

[0164] The current block is a currently encoded image block in the video. Specifically, for each frame image in the video, the image can be divided into a plurality of image blocks, each image block is taken as the current block, and then the current block can be encoded.

[0165] 502. Obtain target chroma distortion and target chroma distortion variance of the current block corresponding to each candidate encoding mode in a plurality of candidate encoding modes.

[0166] The plurality of candidate encoding modes are preset, and the target chroma distortion and the target chroma distortion variance of the current block are calculated for each encoding mode.

[0167] The target distortion can be represented by max (dist_U, dist_V), and the target chroma distortion variance can be represented by max (var_dist_U, var_dist_V). For specific calculation processes, refer to the related descriptions of the above embodiments.

[0168] 503. Determine whether any of the following conditions is met:

[0169] max (dist_U, dist_V) > dist_Y * k1;

[0170] max (var_dist_U, var_dist_V) > k2;

[0171] dist_Y is the luminance distortion, the calculation process can be referred to the related descriptions of the above embodiments, k1 is a preset multiple, and k2 is a preset variance threshold.

[0172] If yes, perform 504, otherwise perform 505.

[0173] 504. Determine the additional cost of the candidate encoding modes, and determine the target cost of the candidate encoding modes based on the additional cost. Then perform 506.

[0174] For example, the calculation formula of the target cost at this time is:

[0175] sum_Rd_Cost = D + λ (R + R extra );

[0176] sum_Rd_Cost is the target cost.

[0177] D, R are original distortion degree and original encoding bit rate respectively;

[0178] R extra is an extra cost;

[0179] R+R extra is a target encoding bit rate;

[0180] λ is a preset weight adjustment parameter.

[0181] The specific calculation process of the extra cost R extra can be referred to the related description of the above embodiment.

[0182] 505, determine the extra cost of the various candidate encoding modes, and determine the target cost of the various candidate encoding modes based on the extra cost.

[0183] For example, the calculation formula of the target cost at this time is:

[0184] sum_Rd_Cost=D+λR;

[0185] Wherein, sum_Rd_Cost is the target cost;

[0186] D, R are original distortion degree and original encoding bit rate respectively;

[0187] λ is a preset weight adjustment parameter.

[0188] 506, the candidate encoding mode corresponding to the smallest target cost is taken as the target encoding mode of the current block.

[0189] 507, encode the current block by using the target encoding mode.

[0190] For example, assuming that the candidate encoding modes include: a first encoding mode, a second encoding mode and a third encoding mode, and the target cost corresponding to the first encoding mode is the smallest after calculation, then the first encoding mode is used to encode the current block.

[0191] After that, 501 and the subsequent steps can be repeatedly executed until all blocks are encoded.

[0192] Figure 6 is a schematic diagram according to the fourth embodiment of the disclosure, and the embodiment provides an encoding mode prediction device, which comprises an acquisition module 601, a determination module 602 and a prediction module 603.

[0193] The acquisition module 601 is configured to acquire, for each candidate coding mode in the plurality of candidate coding modes, chrominance distortion information of a current block corresponding to the candidate coding mode; the determination module 602 is configured to determine an additional cost of the candidate coding mode if the chrominance distortion information satisfies a preset condition, and determine a target cost of the candidate coding mode based on the additional cost; and the prediction module 603 is configured to determine a target coding mode from the plurality of candidate coding modes based on the target cost.

[0194] In this embodiment, when the chrominance distortion information satisfies the preset condition, the additional cost of each candidate coding mode is determined, the target cost is determined based on the additional cost, and the target coding mode is determined based on the target cost. In this way, the additional cost can be introduced when the target cost is calculated, the coding mode prediction effect is improved, and thus the chrominance distortion is reduced and the image blocking problem is improved on the basis of the same coding bit rate.

[0195] In some embodiments, the determination module 602 is further configured to:

[0196] If the chrominance distortion information includes a target chrominance distortion degree, and the target chrominance distortion degree is greater than a preset multiple of a luminance distortion degree of the current block, it is determined that the chrominance distortion information satisfies the preset condition; and / or,

[0197] If the chrominance distortion information includes a target chrominance distortion variance, and the target chrominance distortion is greater than a preset variance threshold, it is determined that the chrominance distortion information satisfies the preset condition.

[0198] In this embodiment, whether the preset condition is satisfied is determined based on the chrominance distortion degree and / or the chrominance distortion variance, which can accurately and comprehensively predict the current block with obvious chrominance distortion, and thus the target coding mode that can reduce the chrominance distortion can be selected for the current block with obvious chrominance distortion, and the image blocking problem is improved.

[0199] In some embodiments, the determination module 602 is further configured to:

[0200] The additional cost is determined based on a current optimal mode chrominance distortion degree and a current chrominance distortion degree corresponding to the current block.

[0201] In this embodiment, the additional cost is determined based on the current optimal mode chrominance distortion degree and the current chrominance distortion degree, which can accurately and efficiently obtain the additional cost and improve the processing accuracy and efficiency.

[0202] In some embodiments, the determination module 602 is further configured to:

[0203] The original distortion degree and the original coding bit rate corresponding to the candidate coding mode are acquired.

[0204] The target coding bit rate is obtained based on the additional cost and the original coding bit rate.

[0205] The target cost is determined based on the original distortion degree and the target coding bit rate.

[0206] In the embodiment, the target coding bit rate is obtained based on the additional cost and the original coding bit rate, and the target cost is determined based on the original distortion degree and the target coding bit rate, so that the additional cost is introduced into the coding bit rate part, the accuracy of the target cost is improved, and the accuracy of the target coding mode is improved.

[0207] In some embodiments, the determining module 602 is further configured to:

[0208] If the chroma distortion information does not satisfy the preset condition, the target cost is determined based on the original distortion degree and the original coding bit rate corresponding to the various candidate coding modes.

[0209] In the embodiment, when the chroma distortion information does not satisfy the preset condition, the target cost is determined based on the original distortion degree and the original coding bit rate, so that the operation can be simplified, and the processing efficiency is improved.

[0210] It can be understood that the same or similar contents in different embodiments in the embodiments of the present disclosure can be mutually referred to.

[0211] It can be understood that "first", "second", and the like in the embodiments of the present disclosure are only used for distinction, and do not represent importance level, time sequence, and the like.

[0212] It can be understood that the order of steps in the flow is not limited in terms of time sequence unless otherwise specified.

[0213] In the technical solutions of the present disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solutions comply with relevant laws and regulations, and do not violate public order and good customs.

[0214] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.

[0215] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device 700 is intended to represent various forms of digital computers, such as laptops, desktops, tablets, servers, blades, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present disclosure described and / or claimed in this document.

[0216] As shown in Figure 7 The electronic device 700 includes a computing unit 701 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 702 or a computer program loaded into a random access memory (RAM) 703 from a storage unit 708. Various programs and data required for the operation of the electronic device 700 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0217] Various components in the electronic device 700 are connected to the I / O interface 705, including an input unit 706, such as a keyboard, a mouse, and the like; an output unit 707, such as various types of displays, speakers, and the like; a storage unit 708, such as a magnetic disk, an optical disk, and the like; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0218] The computing unit 701 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs various methods and processes described above, such as the encoding mode prediction method. For example, in some embodiments, the encoding mode prediction method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded onto the RAM 703 and executed by the computing unit 701, one or more steps of the encoding mode prediction method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the encoding mode prediction method by any other suitable means, such as by means of firmware.

[0219] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0220] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable task processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, implements the functions / operations specified in the flowcharts and / or block diagrams. The program code can execute entirely on a machine, partly on a machine, as a stand-alone software package, partly on a machine and partly on a remote machine or entirely on a remote machine or server.

[0221] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0222] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0223] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0224] The computer system can include clients and servers. This relationship can be. The servers are generally remote from the users and can be accessed via the Internet using a communication network. The relationship can be a client-server relationship over a communications network, and as such, the servers can be accessed by the clients using computer programs. The servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are mainframe products in the cloud computing service system, and solve the defects of large management difficulty and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or simply "VPS").

[0225] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present disclosure can be achieved, and the present disclosure is not limited herein.

[0226] The above detailed description does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A coding pattern prediction method, comprising: For each candidate coding mode among multiple candidate coding modes, obtain the chroma distortion information of the current block corresponding to each candidate coding mode; If the chroma distortion information meets a preset condition, determine the additional cost of each candidate coding mode, and determine the target cost of each candidate coding mode based on the additional cost, including: obtaining the original distortion and original coding bit rate corresponding to each candidate coding mode; obtaining the target coding bit rate based on the additional cost and the original coding bit rate; and determining the target cost based on the original distortion and the target coding bit rate. Based on the target cost, a target coding mode is determined from the plurality of candidate coding modes; The current block is the currently encoded image block in the video; The additional cost is a parameter other than distortion and coding bit rate, and is determined based on the current optimal mode chroma distortion and the current chroma distortion corresponding to the current block.

2. The method according to claim 1, further comprising: If the chromaticity distortion information includes a target chromaticity distortion degree, and the target chromaticity distortion degree is greater than a preset multiple of the luminance distortion degree of the current block, then the chromaticity distortion information is determined to meet a preset condition. And / or, If the chromaticity distortion information includes the target chromaticity distortion variance, and the target chromaticity distortion is greater than a preset variance threshold, then the chromaticity distortion information is determined to meet the preset condition.

3. The method according to claim 1, further comprising: If the chroma distortion information does not meet the preset conditions, the target cost is determined based on the original distortion and original coding bit rate corresponding to the various candidate coding modes.

4. A coding pattern prediction device, comprising: The acquisition module is used to acquire the chroma distortion information of the current block corresponding to each candidate encoding mode among multiple candidate encoding modes. A determining module is configured to, if the chroma distortion information meets preset conditions, determine the additional cost of various candidate coding modes, and determine the target cost of various candidate coding modes based on the additional cost, including: obtaining the original distortion and original coding bit rate corresponding to various candidate coding modes; obtaining the target coding bit rate based on the additional cost and the original coding bit rate; and determining the target cost based on the original distortion and the target coding bit rate. The prediction module is used to determine the target coding mode among the multiple candidate coding modes based on the target cost; The current block is the currently encoded image block in the video; The additional cost is a parameter other than distortion and coding bit rate, and is determined based on the current optimal mode chroma distortion and the current chroma distortion corresponding to the current block.

5. The apparatus according to claim 4, wherein, The determining module is also used for: If the chromaticity distortion information includes a target chromaticity distortion degree, and the target chromaticity distortion degree is greater than a preset multiple of the luminance distortion degree of the current block, then the chromaticity distortion information is determined to meet a preset condition. And / or, If the chromaticity distortion information includes the target chromaticity distortion variance, and the target chromaticity distortion is greater than a preset variance threshold, then the chromaticity distortion information is determined to meet the preset condition.

6. The apparatus according to claim 4, wherein, The determining module is also used for: If the chroma distortion information does not meet the preset conditions, the target cost is determined based on the original distortion and original coding bit rate corresponding to the various candidate coding modes.

7. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3.

8. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-3.

9. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Method and apparatus for performing rate distortion analysis for palette mode

    CN114208172A

  • Method and device for selecting chroma coding mode and computer equipment

    CN115278225A