Method and device for determining intra-frame prediction mode and electronic equipment
By dividing the intra-prediction mode into sub-block units and calculating the texture complexity, and determining the intra-prediction mode based on the direction of the maximum texture complexity, the problem of excessively long coarse selection time in the intra-prediction mode is solved, thus improving the encoding speed.
Patent Information
- Application Number
- CN202411074587.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-06
AI Technical Summary
In existing technologies, the time consumed during the coarse selection process of intra-frame prediction mode is too high, resulting in slow encoding speed.
By dividing the coding unit (CU) of the target image into multiple sub-block units, calculating the texture complexity of each sub-block unit in multiple directions, and determining the intra-frame prediction mode based on the direction corresponding to the maximum value when the texture complexity difference meets the preset condition, the number of candidate modes is reduced.
It effectively reduces the number of candidate prediction modes in the coarse selection of intra-frame prediction modes, saves encoding time, and improves encoding speed.
Smart Images

Figure CN119052483A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video coding and decoding technology, and in particular to a method, device and electronic device for determining an intra-frame prediction mode. Background Art
[0002] In the related art, when performing a rough selection of an intra-frame prediction mode, a fixed 18 intra-frame prediction modes (with mode numbers 0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32) are usually used as candidate modes for rough selection of intra-frame prediction modes, and the RD (rate-distortion) cost of using each mode for prediction is estimated, and the estimated RD costs are arranged from small to large, so as to select the intra-frame prediction mode with the smaller RD cost. However, in the above process, since a large number of candidate modes need to be traversed and tried, a large number of RD costs of these candidate modes need to be estimated and calculated, resulting in excessive time consumption in the process of rough selection of intra-frame prediction modes and slow encoding speed. Summary of the invention
[0003] The embodiments of the present application provide a method, device and electronic device for determining an intra-frame prediction mode to solve the problem that the time consumed in the rough selection process of the intra-frame prediction mode is too high and the encoding speed is slow.
[0004] To solve the above technical problems, this application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for determining an intra-frame prediction mode, the method comprising:
[0006] Divide a minimum coding unit LCU in a target coding unit CU of a target image into a plurality of sub-block units;
[0007] Determining the texture complexity of the target CU in the multiple directions according to the texture complexity of each of the sub-block units in the multiple directions;
[0008] When a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions satisfies a preset condition, the intra prediction mode of the target image is determined according to the direction corresponding to the maximum value.
[0009] Optionally, when a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions satisfies a preset condition, determining the intra prediction mode of the target image according to the direction corresponding to the maximum value includes:
[0010] When the difference between the maximum value and the minimum value of the texture complexity of the target CU in the multiple directions is greater than or equal to a preset multiple of the minimum value, the intra-frame prediction mode of the target image is determined according to the direction corresponding to the maximum value.
[0011] Optionally, the multiple directions include a horizontal direction, a vertical direction, a 45-degree direction, and a 135-degree direction; and determining, according to the texture complexity of each of the sub-block units in the multiple directions, the texture complexity of the target CU in the multiple directions includes:
[0012] Calculating the texture complexity of each of the sub-block units in a target direction, where the target direction is any one of the multiple directions;
[0013] The texture complexity of each sub-block unit in the multiple sub-block units in the target direction is added to obtain the texture complexity of the target CU in the target direction.
[0014] Optionally, calculating the texture complexity of each sub-block unit in the target direction includes:
[0015] Calculating pixel values of all sub-block units in the target direction in the LCU corresponding to the target sub-block unit, where the target sub-block unit is any one of the multiple sub-block units;
[0016] Calculating the average value of the pixel values of all the sub-block units;
[0017] The texture complexity of the target sub-block unit in the target direction is the difference between the pixel value of the target sub-block unit and the average value.
[0018] Optionally, determining the intra-frame prediction mode of the target image according to the direction corresponding to the maximum value includes:
[0019] Adding the preset first prediction mode to the candidate mode list;
[0020] When the direction corresponding to the maximum value is a horizontal direction, the second prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a vertical direction, the third prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a 45-degree direction, the fourth prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a 135-degree direction, the fifth prediction mode is added to the candidate mode list, wherein the second prediction mode, the third prediction mode, the fourth prediction mode and the fifth prediction mode each include at least one prediction mode;
[0021] The intra-frame prediction mode of the target image is determined according to the candidate mode list after the prediction mode is added.
[0022] Optionally, determining the intra prediction mode of the target image according to the candidate mode list after the prediction mode is added includes:
[0023] Determining a first candidate prediction mode in the candidate mode list after adding the prediction mode according to the estimated overhead size;
[0024] Processing the prediction mode number in the first candidate prediction mode to obtain a second candidate prediction mode;
[0025] A preset mapping method is adopted to obtain the prediction mode of the second candidate prediction mode in an adjacent direction, and the intra-frame prediction mode of the target image is determined according to the prediction mode in the adjacent direction.
[0026] Optionally, the method further comprises:
[0027] When a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions does not satisfy the preset condition, the intra-frame prediction mode of the target image is determined to be a preset intra-frame prediction mode.
[0028] In a second aspect, an embodiment of the present application provides a device for determining an intra-frame prediction mode, the device comprising:
[0029] A division module, used for dividing a minimum coding unit LCU in a target coding unit CU of a target image into a plurality of sub-block units;
[0030] A first determining module, configured to determine the texture complexity of the target CU in the multiple directions according to the texture complexity of each of the sub-block units in the multiple directions;
[0031] The second determination module is used to determine the intra-frame prediction mode of the target image according to the direction corresponding to the maximum value when the difference between the maximum value and the minimum value in the texture complexity of the target CU in the multiple directions meets a preset condition.
[0032] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the method for determining the intra-frame prediction mode described in the first aspect are implemented.
[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for determining the intra-frame prediction mode described in the first aspect are implemented.
[0034] According to a fifth aspect, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps of the method for determining the intra-frame prediction mode as described in the first aspect.
[0035] In the embodiment of the present application, several most likely selected prediction modes are screened out as candidate modes according to the CU texture direction, thereby reducing the number of candidate prediction modes roughly selected in the intra-frame prediction mode and saving encoding time. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 This is one of the flowcharts of a method for determining an intra-frame prediction mode provided in an embodiment of the present application;
[0038] Figure 2 This is a second flowchart of a method for determining an intra-frame prediction mode provided in an embodiment of the present application;
[0039] Figure 3 It is a structural schematic diagram of a device for determining an intra-frame prediction mode provided in an embodiment of the present application;
[0040] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] The embodiments of the present application provide a method, device and electronic device for determining an intra-frame prediction mode, which calculates and analyzes the texture information in different directions inside a current coding unit (Coding Unit, CU), and assists in deciding the intra-frame prediction mode of the current CU based on the calculated value, so as to solve the problem of excessive time consumption and slow encoding speed in the process of rough selection of the intra-frame prediction mode.
[0043] See also Figure 1 , Figure 1 is a flowchart of a method for determining an intra-frame prediction mode provided by an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0044] Step 101: Divide a minimum coding unit LCU in a target coding unit CU of a target image into a plurality of sub-block units.
[0045] The target CU of the target image to be encoded is divided into several least coding units (Least Coding Unit, LCU), where the target CU is any one of the multiple coding units in the encoding process, and the least coding unit is a basic unit that cannot be divided any further. The number of sub-block units divided by the LCU can be pre-set according to the encoding standard or the characteristics of the image, for example, each LCU is divided into multiple 8×8 sub-block units. The above-mentioned image may include a video image or a picture.
[0046] Step 102: Determine the texture complexity of the target CU in the multiple directions according to the texture complexity of each of the sub-block units in the multiple directions.
[0047] In this step, the texture complexity of each sub-block unit in multiple directions is obtained, and the multiple directions may include horizontal direction, vertical direction, diagonal direction, etc.
[0048] The texture complexity of each sub-block unit may be determined by selecting a representative direction for texture analysis, or by using a texture analysis algorithm to determine the texture complexity of the sub-block unit, or by assigning a texture complexity index to each sub-block unit in each direction to determine the texture complexity of the sub-block unit.
[0049] Based on the texture complexity of each sub-block unit in multiple directions, the texture complexity of the target CU in multiple directions is determined. Specifically, the texture complexity of the target CU in the target direction can be obtained by weighted summing or averaging the texture complexity of each sub-block unit in the target direction, or the texture complexity of each sub-block unit in the target direction can be accumulated to obtain the texture complexity of the target CU in the target direction.
[0050] In the above process, the texture complexity can be calculated and saved at the LCU level. Compared with calculating the texture complexity at the CU level, it avoids the redundant calculation caused by the spatial overlap of CUs that may occur during the block division stage decision. In addition, the texture information of the target CU is obtained by combining the texture information of the sub-block units, which reduces the complexity of calculating the texture information of the target CU.
[0051] Optionally, the multiple directions include a horizontal direction, a vertical direction, a 45-degree direction, and a 135-degree direction; and determining, according to the texture complexity of each of the sub-block units in the multiple directions, the texture complexity of the target CU in the multiple directions includes:
[0052] Calculating the texture complexity of each of the sub-block units in a target direction, where the target direction is any one of the multiple directions;
[0053] The texture complexity of each sub-block unit in the multiple sub-block units in the target direction is added to obtain the texture complexity of the target CU in the target direction.
[0054] Each sub-block unit includes a horizontal direction, a vertical direction, a 45-degree direction, and a 135-degree direction, and the texture complexity of each sub-block unit in the above four directions is calculated respectively.
[0055] Taking the calculation of the texture complexity of the target CU in the target direction as an example, the texture complexity of each sub-block unit in the target direction of the multiple sub-block units is added together to obtain the texture complexity of the target CU in the target direction.
[0056] By the above method, the texture complexity of the target CU in the above four directions can be obtained. The texture information of the target CU is obtained by combining the texture information of the sub-block units, which reduces the complexity of calculating the texture information of the target CU.
[0057] Optionally, calculating the texture complexity of each sub-block unit in the target direction includes:
[0058] Calculating pixel values of all sub-block units in the target direction in the LCU corresponding to the target sub-block unit, where the target sub-block unit is any one of the multiple sub-block units;
[0059] Calculating the average value of the pixel values of all the sub-block units;
[0060] The texture complexity of the target sub-block unit in the target direction is the difference between the pixel value of the target sub-block unit and the average value.
[0061] Taking the target sub-block unit as an example, the texture complexity of the target sub-block unit in the target direction is calculated.
[0062] According to the sub-block units divided by the LCU, the LCU corresponding to the target sub-block unit can be determined, and the pixel values of all sub-block units in the LCU in the target direction can be obtained. And according to the pixel values of all sub-block units in the target direction, the average value of the pixel values of all sub-block units in the target direction can be determined.
[0063] The texture complexity of the target sub-block unit is obtained by subtracting the average value from the pixel value of the target sub-block unit.
[0064] The texture complexity of each sub-block unit can be calculated by the following formula:
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071] tex_45=var45_L+var45_R (7)
[0072] tex_135=var135_L+var135_R (8)
[0073] In the above formula, pixel i,j It represents the pixel brightness component value of the i-th row and j-th column of an 8×8 sub-block unit in the current LCU. tex_h represents the horizontal texture complexity calculated in the sub-block unit. tex_v represents the vertical texture complexity. tex_45 and tex_135 represent the texture complexity in the 45-degree direction and 135-degree direction respectively.
[0074] In addition, the pixel value of the above sub-block unit can be determined by obtaining a predicted pixel value, or by calculating a residual from pixel data.
[0075] In this implementation, the pixel value of the current sub-block unit minus the average pixel value of all sub-block units in the same direction is used as the complexity at the pixel point, which has lower computational complexity than using a common gradient operator to calculate the complexity.
[0076] Step 103: When a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions satisfies a preset condition, determine the intra-frame prediction mode of the target image according to the direction corresponding to the maximum value.
[0077] The texture complexity values of the target CU in each direction are obtained, and the texture complexity values in each direction are compared. The difference between the maximum value and the minimum value satisfies the preset condition that the difference is greater than or equal to a preset multiple of the minimum value, or the difference is greater than a preset multiple of an average value, and the average value is the average of the maximum value and the minimum value.
[0078] When the difference between the maximum and minimum values of the texture complexity value meets the preset condition, the direction corresponding to the maximum value of the texture complexity of the target CU is obtained as the main direction, and the intra-frame prediction mode of the target image is determined based on the main direction. For example, when the maximum texture complexity is in the horizontal direction, the horizontal prediction mode can be selected.
[0079] Optionally, the method further comprises:
[0080] When a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions does not satisfy the preset condition, the intra-frame prediction mode of the target image is determined to be a preset intra-frame prediction mode.
[0081] When the difference between the maximum and minimum values of the texture complexity value does not meet the above preset conditions, a preset intra-frame prediction mode is selected. The preset mode can be determined based on factors such as the encoding standard of the image, the complexity of the image, and the required quality of the image.
[0082] Optionally, when a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions satisfies a preset condition, determining the intra prediction mode of the target image according to the direction corresponding to the maximum value includes:
[0083] When the difference between the maximum value and the minimum value of the texture complexity of the target CU in the multiple directions is greater than or equal to a preset multiple of the minimum value, the intra-frame prediction mode of the target image is determined according to the direction corresponding to the maximum value.
[0084] The preset multiple may be a threshold value set through experiments, for example, 0.1 or 0.11.
[0085] By determining the intra-frame prediction mode of the target image in the above manner, the number of candidate prediction modes in the rough selection of the intra-frame prediction mode is reduced, and the encoding time is saved.
[0086] Optionally, determining the intra-frame prediction mode of the target image according to the direction corresponding to the maximum value includes:
[0087] Adding the preset first prediction mode to the candidate mode list;
[0088] When the direction corresponding to the maximum value is a horizontal direction, the second prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a vertical direction, the third prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a 45-degree direction, the fourth prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a 135-degree direction, the fifth prediction mode is added to the candidate mode list, wherein the second prediction mode, the third prediction mode, the fourth prediction mode and the fifth prediction mode each include at least one prediction mode;
[0089] The intra-frame prediction mode of the target image is determined according to the candidate mode list after the prediction mode is added.
[0090] In this embodiment, the non-angular intra-frame prediction mode, that is, the first prediction mode 0, 1, 2 is first selected as the candidate mode. If the direction corresponding to the maximum value is the horizontal direction, the second prediction mode related to the horizontal direction (the prediction mode numbers are 21, 24, and 27 respectively) is added to the candidate mode list; if the direction corresponding to the maximum value is the vertical direction, the third prediction mode corresponding to the vertical direction (the prediction mode numbers are 9, 12, and 15 respectively) is added to the candidate mode list; if the direction corresponding to the maximum value is the 45-degree direction, the fourth prediction mode corresponding to the 45-degree direction (the prediction mode numbers are 4, 7, 10, 25, 28, and 31 respectively) is added to the candidate mode list; if the direction corresponding to the maximum value is the 135-degree direction, the fifth prediction mode corresponding to the 135-degree direction (the prediction mode numbers are 15, 18, and 21 respectively) is added to the candidate mode list.
[0091] Determining the intra-frame prediction mode based on the above prediction mode in the candidate mode list can reduce the number of candidate prediction modes in the rough selection of the intra-frame prediction mode, thereby saving encoding time.
[0092] Optionally, determining the intra prediction mode of the target image according to the candidate mode list after the prediction mode is added includes:
[0093] Determining a first candidate prediction mode in the candidate mode list after adding the prediction mode according to the estimated overhead size;
[0094] Processing the prediction mode number in the first candidate prediction mode to obtain a second candidate prediction mode;
[0095] A preset mapping method is adopted to obtain the prediction mode of the second candidate prediction mode in an adjacent direction, and the intra-frame prediction mode of the target image is determined according to the prediction mode in the adjacent direction.
[0096] In this implementation, three rounds of rough selection are adopted to determine the intra-frame prediction mode.
[0097] First round of rough selection: the prediction modes in the candidate mode list after the prediction mode is added are arranged from large to small according to the estimated cost size, and the first candidate prediction mode with the smallest cost is obtained.
[0098] Second round of rough selection: For the angle prediction modes in the first candidate mode except the modes numbered 0, 1, and 2, the new modes obtained by adding one and subtracting one to each mode number are used as candidate modes for the second round of intra-frame prediction mode rough selection, and several modes with the smallest RD cost estimated in the first two rounds are retained.
[0099] The third round of rough selection: For the modes obtained after the second round of rough selection, for the angle prediction modes therein, the angle prediction modes in the adjacent directions are obtained through a preset mapping method, and the angle prediction modes in the adjacent directions are used as candidate modes for the third round of rough selection, and several modes with the smallest estimated RD overhead in the first three rounds are retained.
[0100] The intra-frame prediction mode of the target image is obtained through the above three rounds of rough selection.
[0101] In the embodiment of the present application, several prediction modes that are most likely to be selected are screened out as candidate modes according to the CU texture direction, thereby reducing the number of candidate prediction modes roughly selected in the intra-frame prediction mode and saving encoding time.
[0102] In order to facilitate the understanding of the embodiments of the present application, the following examples are provided in conjunction with specific implementation methods.
[0103] like Figure 2 As shown, the following steps are included:
[0104] Step 201: Divide the entire image into a number of 8×8 sub-block units.
[0105] The entire image is divided into several LCUs, and each LCU is further divided into several 8×8 sub-block units.
[0106] Step 202: Calculate the texture complexity of each sub-block unit in four directions and save it.
[0107] In each sub-block unit, the texture complexity of each sub-block unit at the horizontal, vertical, 45 degree and 135 degree angles is calculated according to the above formulas (1) to (8), and the records are saved.
[0108] Step 203: locate all sub-block units in the current CU, and calculate the sum of the texture complexity in each direction.
[0109] When intra-prediction is performed on a CU, all 8×8 sub-block units contained in it are located, and the horizontal, vertical, 45-degree, and 135-degree texture complexities of all sub-block units previously saved are read. The texture complexity in each direction is accumulated and summed as the texture complexity of the current CU in that direction.
[0110] When the current CU makes an intra-frame prediction mode decision, the candidate intra-frame prediction modes in the intra-frame prediction process are pruned in quantity according to the texture complexity of the four directions of all 8×8 sub-block units in the current CU and a preset method, thereby saving encoding time.
[0111] Step 204: Calculate the maximum complexity maxGrad and the minimum complexity minGrad of the current CU.
[0112] The textures of the current CU in four directions are sorted in descending order according to their texture complexity, and the direction corresponding to the maximum complexity value is the main direction.
[0113] Step 205: Determine whether maxGrad-minGrad is greater than a*minGrad.
[0114] The algorithm is implemented on the AVS3 (audio and video source coding) standard encoder software AVS3Enc, and AVS3Enc is used as the reference benchmark of the algorithm. This algorithm is simulated under AI configuration, and the test speed level is set to Speed_Level = 4. The quantization parameter QP is used for the general test sequence. i For the coding test of 27, 32, 38, 45, a set of parameters was determined after balancing the coding performance and coding complexity: α = 0.1. Experiments were carried out using this set of parameters, and the experimental results are shown in Table 1.
[0115] Table 1
[0116]
[0117] Among them, BDBR-Y, BDBR-U, and BDBR-V are the BD-BR values calculated for the brightness and two chrominance components in the YUV color space, respectively. These values reflect the bit rate savings of different test sequences during the encoding process and reflect the encoding performance. The results show that the encoding time saving rate of the algorithm is about 9.2%, which effectively reduces the encoding complexity, while the encoding performance drops to 0.38%. The calculation formula for the encoding time saving rate TS is as follows:
[0118]
[0119] Among them, Time prop Indicates the encoding time in high quality mode, Time base Indicates encoding time in benchmark mode.
[0120] Step 206: If yes, use the most likely prediction modes in the direction corresponding to maxGrad as coarsely selected candidate modes.
[0121] If the difference between the maximum complexity value and the minimum complexity value is greater than or equal to α times the minimum complexity value (α is a threshold set according to experiments), several intra-frame prediction modes are selected as candidate modes according to the main direction, and subsequent intra-frame prediction mode rough selection is performed.
[0122] The specific method of selecting candidate intra prediction modes is as follows: first select non-angle intra prediction modes 0, 1, and 2 as candidate modes. If the main direction is horizontal, add intra prediction modes 21, 24, and 27 to the candidate mode list; if the main direction is vertical, add intra prediction modes 9, 12, and 15 to the candidate mode list; if the main direction is 45 degrees, add intra prediction modes 4, 7, 10, 25, 28, and 31 to the candidate mode list; if the main direction is 135 degrees, add intra prediction modes 15, 18, and 21 to the candidate mode list.
[0123] Step 207: If not, use the existing intra-frame prediction mode coarse selection technology.
[0124] Use the candidate modes selected by the above steps to perform the first round of intra-frame prediction mode rough selection, and sort all modes from small to large according to their estimated RD cost. For the modes obtained after the first round of rough selection, use the angle prediction modes (except the modes numbered 0, 1, and 2) as candidate modes, and use the new modes obtained by adding one and subtracting one to each mode number as candidate modes to perform the second round of intra-frame prediction mode rough selection, and retain up to 4 modes with the smallest estimated RD cost in the first two rounds. For the modes obtained after the second round of rough selection, for the angle prediction modes, obtain the angle prediction modes in the adjacent directions through a preset mapping method, and use the angle prediction modes in the adjacent directions as candidate modes for the third round of rough selection, and retain up to 2 modes with the smallest estimated RD cost in the first three rounds.
[0125] In the related art, a fixed intra-frame prediction mode is used, and the first round of rough selection is performed based on the predicted RD cost; in the second round, the numbers of the angle prediction modes (modes numbered not 0, 1, 2) in the first round are added and subtracted by one to obtain new modes, and these modes are used as candidate modes for the second round of rough selection, and the RD costs of all modes are estimated, and at most 6 modes with the smallest estimated RD costs among all modes in the first two rounds of rough selection are retained. In the third step, for the angle prediction modes among the at most 6 modes retained in the first two rounds, the angle prediction modes of the angles adjacent to them are obtained through a preset mapping method, and used as candidate modes in the third round of rough selection, and at most 5 modes with the smallest estimated RD costs among all modes in the first three rounds of rough selection are retained as the final candidate modes for intra-frame prediction.
[0126] In order to further reduce the candidate modes, the embodiment of the present application performs quantitative pruning of candidate intra-frame prediction modes in the intra-frame prediction process, thereby saving encoding time. The texture complexity of each internal sub-block is calculated and recorded and saved in units of LCU. When the CU performs intra-frame prediction, it is only necessary to directly access the previously saved data. When there are CUs with overlapping spatial positions in the block division decision process, the sub-block units at the same position do not need to repeatedly calculate the texture complexity. And only the texture information inside the current CU needs to be used. For CUs located at the edge of the image without adjacent CUs or with weak correlation with the content of adjacent CUs, this algorithm can also be used for rough selection of intra-frame prediction modes. In addition, by calculating the texture complexity in four directions, more modes can be skipped when performing rough mode selection compared to the method of only considering horizontal and vertical texture complexity; and compared to the method of establishing a gradient distribution histogram, the present application only needs to calculate the gradient of each pixel in the given four directions, without calculating the gradient angle of each pixel point, which can avoid the use of square operations and inverse trigonometric functions with high computational complexity.
[0127] This application is implemented and experimented in the AVS3Enc encoder. Under the All Intra (AI) configuration (all frames in the encoding process only use the information in the current frame for predictive encoding, and do not use the information of other frames), the experimental results show that an average of 9.2% can be saved, while the coding loss of the luminance component is 0.38%, and the loss of the chrominance component is 0.37% for the U component and 0.24% for the V component. This application is implemented based on the AVS3 standard, and the decision-making process of the intra-frame prediction mode in AVS3 is improved, which can effectively reduce the encoding complexity and save encoding time. This application can be applied to the field of video coding technology, including but not limited to application scenarios such as video conferencing, live video, and video content storage. Compared with the existing VVC (universal video coding standard) and other standards based on image texture in the intra-frame prediction mode rough selection fast algorithm, this application can be applied to the AVS3 video coding and decoding standard, mainly designed for the characteristics of the angle prediction mode distribution in the AVS3 standard, so it can be implemented in the AVS3 standard.
[0128] For CUs with strong texture directionality, the intra-frame prediction mode finally selected has a strong correlation with the texture direction. Therefore, the present application utilizes the image texture features inside the CU to screen out several prediction modes that are most likely to be selected as candidate modes in advance according to the CU texture direction, which can effectively save encoding time.
[0129] See also Figure 3 , Figure 3 is a structural diagram of a device for determining an intra-frame prediction mode provided by an embodiment of the present application, such as Figure 3 As shown, the intra-frame prediction mode determination device 300 includes:
[0130] A division module 301 is used to divide a minimum coding unit LCU in a target coding unit CU of a target image into a plurality of sub-block units;
[0131] A first determining module 302, configured to determine the texture complexity of the target CU in the multiple directions according to the texture complexity of each of the sub-block units in the multiple directions;
[0132] The second determination module 303 is used to determine the intra-frame prediction mode of the target image according to the direction corresponding to the maximum value when the difference between the maximum value and the minimum value of the texture complexity of the target CU in the multiple directions meets a preset condition.
[0133] Optionally, the second determining module is specifically configured to:
[0134] When the difference between the maximum value and the minimum value of the texture complexity of the target CU in the multiple directions is greater than or equal to a preset multiple of the minimum value, the intra-frame prediction mode of the target image is determined according to the direction corresponding to the maximum value.
[0135] Optionally, the multiple directions include a horizontal direction, a vertical direction, a 45-degree direction, and a 135-degree direction; and the first determining module includes:
[0136] A calculation submodule, used for calculating the texture complexity of each sub-block unit in a target direction, where the target direction is any one of the multiple directions;
[0137] The adding submodule is used to add the texture complexity of each sub-block unit in the multiple sub-block units in the target direction to obtain the texture complexity of the target CU in the target direction.
[0138] Optionally, the calculation submodule includes:
[0139] A first calculation unit, configured to calculate pixel values of all sub-block units in the target direction in the LCU corresponding to the target sub-block unit, wherein the target sub-block unit is any sub-block unit among the multiple sub-block units;
[0140] A second calculation unit, used to calculate the average value of the pixel values of all the sub-block units;
[0141] The texture complexity of the target sub-block unit in the target direction is the difference between the pixel value of the target sub-block unit and the average value.
[0142] Optionally, the second determining module includes:
[0143] A first adding submodule, used for adding a preset first prediction mode to the candidate mode list;
[0144] A second adding submodule is used for adding a second prediction mode to the candidate mode list when the direction corresponding to the maximum value is a horizontal direction; or, when the direction corresponding to the maximum value is a vertical direction, adding a third prediction mode to the candidate mode list; or, when the direction corresponding to the maximum value is a 45-degree direction, adding a fourth prediction mode to the candidate mode list; or, when the direction corresponding to the maximum value is a 135-degree direction, adding a fifth prediction mode to the candidate mode list, wherein the second prediction mode, the third prediction mode, the fourth prediction mode and the fifth prediction mode each include at least one prediction mode;
[0145] The determination submodule is used to determine the intra-frame prediction mode of the target image according to the candidate mode list after the prediction mode is added.
[0146] Optionally, the determining submodule includes:
[0147] A first determining unit, configured to determine, according to the estimated overhead size, a first candidate prediction mode in the candidate mode list after the prediction mode is added;
[0148] a processing unit, configured to process the prediction mode number in the first candidate prediction mode to obtain a second candidate prediction mode;
[0149] The second determination unit is used to obtain the prediction mode of the second candidate prediction mode in an adjacent direction by adopting a preset mapping method, and determine the intra-frame prediction mode of the target image according to the prediction mode in the adjacent direction.
[0150] Optionally, the device further comprises:
[0151] The third determination module is used to determine that the intra-frame prediction mode of the target image is a preset intra-frame prediction mode when the difference between the maximum value and the minimum value in the texture complexity of the target CU in the multiple directions does not meet the preset condition.
[0152] The intra-frame prediction mode determination device can realize Figure 1 The various processes implemented in the corresponding method embodiments can achieve the same technical effects and will not be described again here to avoid repetition.
[0153] like Figure 4 As shown, an embodiment of the present application further provides an electronic device 400, comprising: a processor 401, a memory 402, and a program stored in the memory 402 and executable on the processor 401. When the program is executed by the processor 401, each process of the embodiment of the method for determining the intra-frame prediction mode described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0154] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned method for determining the intra-frame prediction mode is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0155] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0156] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0157] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0158] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for determining an intra-frame prediction mode, characterized in that: include: Divide a minimum coding unit LCU in a target coding unit CU of a target image into a plurality of sub-block units; Determining the texture complexity of the target CU in the multiple directions according to the texture complexity of each of the sub-block units in the multiple directions; When a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions satisfies a preset condition, the intra prediction mode of the target image is determined according to the direction corresponding to the maximum value.
2. The method according to claim 1, characterized in that: When a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions satisfies a preset condition, determining the intra prediction mode of the target image according to the direction corresponding to the maximum value includes: When the difference between the maximum value and the minimum value of the texture complexity of the target CU in the multiple directions is greater than or equal to a preset multiple of the minimum value, the intra-frame prediction mode of the target image is determined according to the direction corresponding to the maximum value.
3. The method according to claim 1, characterized in that: The multiple directions include a horizontal direction, a vertical direction, a 45-degree direction, and a 135-degree direction; and determining the texture complexity of the target CU in the multiple directions according to the texture complexity of each of the sub-block units in the multiple directions includes: Calculating the texture complexity of each of the sub-block units in a target direction, where the target direction is any one of the multiple directions; The texture complexity of each sub-block unit in the multiple sub-block units in the target direction is added to obtain the texture complexity of the target CU in the target direction.
4. The method according to claim 3, characterized in that The calculating the texture complexity of each sub-block unit in the target direction comprises: Calculating pixel values of all sub-block units in the target direction in the LCU corresponding to the target sub-block unit, where the target sub-block unit is any one of the multiple sub-block units; Calculating the average value of the pixel values of all the sub-block units; The texture complexity of the target sub-block unit in the target direction is the difference between the pixel value of the target sub-block unit and the average value.
5. The method according to claim 1, characterized in that The step of determining the intra-frame prediction mode of the target image according to the direction corresponding to the maximum value includes: Adding the preset first prediction mode to the candidate mode list; When the direction corresponding to the maximum value is a horizontal direction, the second prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a vertical direction, the third prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a 45-degree direction, the fourth prediction mode is added to the candidate mode list; or, when the direction corresponding to the maximum value is a 135-degree direction, the fifth prediction mode is added to the candidate mode list, wherein the second prediction mode, the third prediction mode, the fourth prediction mode and the fifth prediction mode each include at least one prediction mode; The intra-frame prediction mode of the target image is determined according to the candidate mode list after the prediction mode is added.
6. The method according to claim 5, characterized in that The step of determining the intra-frame prediction mode of the target image according to the candidate mode list after the prediction mode is added includes: Determining a first candidate prediction mode in the candidate mode list after adding the prediction mode according to the estimated overhead size; Processing the prediction mode number in the first candidate prediction mode to obtain a second candidate prediction mode; A preset mapping method is adopted to obtain the prediction mode of the second candidate prediction mode in an adjacent direction, and the intra-frame prediction mode of the target image is determined according to the prediction mode in the adjacent direction.
7. The method according to claim 1, characterized in that The method further comprises: When a difference between a maximum value and a minimum value of the texture complexity of the target CU in the multiple directions does not satisfy the preset condition, the intra-frame prediction mode of the target image is determined to be a preset intra-frame prediction mode.
8. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the method for determining an intra-frame prediction mode as claimed in any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for determining the intra-frame prediction mode according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method for determining the intra-frame prediction mode according to any one of claims 1 to 7.
Citation Information
Patent Citations
Optimization method for intra-frame prediction MPM (Most Probable Mode) mechanism
CN104639939A
Quick HEVC (High Efficiency Video Coding) inter-frame prediction mode selection method
CN104639940A
Fast selecting method of prediction mode in video frame and device thereof
CN105812799A
CU division and PC prediction mode selection method and system in HEVC frame
CN108184115A
Intra-frame prediction mode selection method and device, equipment and storage medium
CN111741299A
