A method and apparatus for determining an intra prediction mode, and an electronic device

By dividing the intra-prediction mode into sub-block units and calculating the texture complexity, the intra-prediction mode is determined based on the texture direction, which solves the problem of excessively long coarse selection time in the intra-prediction mode and saves encoding time.

CN119052483BActive Publication Date: 2025-11-04MIGU VIDEO TECH CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411074587.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2025-11-04
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

In existing technologies, the time consumed during the coarse selection of intra-prediction modes is too high, resulting in slow encoding speed. This is mainly because a large number of candidate modes need to be traversed for RD overhead prediction calculation.

Method used

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.

Benefits of technology

This effectively reduces the number of candidate prediction modes in the initial selection of intra-frame prediction modes, saving encoding time while maintaining essentially the same encoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052483B_ABST
    Figure CN119052483B_ABST
Patent Text Reader

Abstract

The application provides a method and device for determining an intra prediction mode and electronic equipment, and relates to the technical field of video coding, wherein the method comprises: dividing a minimum coding unit (LCU) in a target coding unit (CU) of a target image into a plurality of sub-block units; determining texture complexity of the target CU in a plurality of directions according to texture complexity of each of the sub-block units in the plurality of directions; and determining an intra prediction mode of the target image according to a direction corresponding to a maximum value of the texture complexity of the target CU in the plurality of directions, in a case where a difference between the maximum value and a minimum value of the texture complexity of the target CU in the plurality of directions satisfies a preset condition. According to the embodiment of the application, several prediction modes most likely to be selected are screened according to the texture direction of the CU to serve as candidate modes, the number of candidate prediction modes in the rough selection of the intra prediction mode is reduced, and the encoding time is saved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of video coding, and particularly relates to a method and device for determining an intra prediction mode and an electronic device. BACKGROUND

[0002] In related technologies, when performing intra prediction mode rough selection, 18 fixed intra prediction modes (mode numbers are 0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, and 32) are usually used as candidate modes to perform intra prediction mode rough selection, RD (Rate-Distortion) overheads of using each mode to perform prediction are estimated, and the intra prediction modes with smaller RD overheads are selected according to the estimated RD overheads from small to large. SUMMARY

[0003] Embodiments of the present application provide a method and device for determining an intra prediction mode and an electronic device to solve the problem of high time consumption and slow encoding speed in the process of intra prediction mode rough selection.

[0004] To solve the above technical problem, the present application is implemented as follows:

[0005] In a first aspect, the embodiments of the present application provide a method for determining an intra prediction mode, and the method comprises the following steps:

[0006] dividing a minimum coding unit (LCU) in a target coding unit (CU) of a target image into a plurality of sub-block units;

[0007] determining texture complexity of the target CU in a plurality of directions according to texture complexity of each of the sub-block units in the plurality of directions;

[0008] determining an intra prediction mode of the target image according to a direction corresponding to a maximum value in the texture complexity of the target CU in the plurality of directions, in a case where a difference between the maximum value and a minimum value satisfies a preset condition.

[0009] Optionally, the step of determining the intra prediction mode of the target image according to the direction corresponding to the maximum value in the case where the difference between the maximum value and the minimum value satisfies the preset condition comprises:

[0010] In a case where a difference between a maximum value and a minimum value of texture complexity of the target CU in the plurality of directions is greater than or equal to a preset multiple of the minimum value, an intra prediction mode of the target image is determined according to a direction corresponding to the maximum value.

[0011] Optionally, the plurality of directions include a horizontal direction, a vertical direction, a 45-degree direction, and a 135-degree direction; and the determining the texture complexity of the target CU in the plurality of directions according to the texture complexity of each of the sub-block units in the plurality of directions includes:

[0012] calculating the texture complexity of each of the sub-block units in a target direction, the target direction being any one of the plurality of directions;

[0013] adding the texture complexity of each of the sub-block units in the target direction in the plurality of sub-block units to obtain the texture complexity of the target CU in the target direction.

[0014] Optionally, the calculating the texture complexity of each of the sub-block units in a target direction includes:

[0015] calculating pixel values of all sub-block units in an LCU corresponding to a target sub-block unit in the target direction, the target sub-block unit being any one of the plurality of sub-block units;

[0016] calculating an average value of the pixel values of the all sub-block units;

[0017] wherein the texture complexity of the target sub-block unit in the target direction is a difference between the pixel value of the target sub-block unit and the average value.

[0018] Optionally, the determining the intra prediction mode of the target image according to the direction corresponding to the maximum value includes:

[0019] adding a preset first prediction mode to a candidate mode list;

[0020] in a case where the direction corresponding to the maximum value is the horizontal direction, adding a second prediction mode to the candidate mode list; or, in a case where the direction corresponding to the maximum value is the vertical direction, adding a third prediction mode to the candidate mode list; or, in a case where the direction corresponding to the maximum value is the 45-degree direction, adding a fourth prediction mode to the candidate mode list; or, in a case where the direction corresponding to the maximum value is the 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.

[0021] According to the candidate mode list after adding the prediction mode, the intra prediction mode of the target image is determined.

[0022] Optionally, the determining the intra prediction mode of the target image according to the candidate mode list after adding the prediction mode comprises:

[0023] According to the estimated size of the overhead, a first candidate prediction mode is determined in the candidate mode list after adding the prediction mode.

[0024] The prediction mode number in the first candidate prediction mode is processed to obtain a second candidate prediction mode.

[0025] The prediction mode in the adjacent direction of the second candidate prediction mode is obtained by using a preset mapping method, and the intra prediction mode of the target image is determined according to the prediction mode in the adjacent direction.

[0026] Optionally, the method further comprises:

[0027] In a case where the difference between the maximum value and the minimum value of the texture complexity of the target CU in the plurality of directions does not satisfy the preset condition, the intra prediction mode of the target image is determined as a preset intra prediction mode.

[0028] In a second aspect, an embodiment of the present application provides a determination apparatus of an intra prediction mode, and the apparatus comprises:

[0029] A division module is configured to divide 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 determination module is configured to determine the texture complexity of the target CU in a plurality of directions according to the texture complexity of each of the sub-block units in the plurality of directions.

[0031] A second determination module is configured to determine the intra prediction mode of the target image according to the direction corresponding to the maximum value of the texture complexity of the target CU in the plurality of directions in a case where the difference between the maximum value and the minimum value of the texture complexity of the target CU in the plurality of directions satisfies a preset condition.

[0032] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a processor, a memory, and a program stored in the memory and executable on the processor, and the program is executed by the processor to implement the steps of the determination method of the intra prediction mode of the first aspect.

[0033] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of the method for determining an intra prediction mode according to the first aspect.

[0034] In a fifth aspect, a computer program product is provided, and the computer program product includes computer instructions. The computer instructions are executed by a processor to implement the steps of the method for determining an intra prediction mode according to the first aspect.

[0035] In the embodiments of the present application, the most likely selected prediction modes are screened according to the texture direction of the CU to be a candidate mode, the number of candidate prediction modes in the rough selection of the intra prediction mode is reduced, and the encoding time is saved. BRIEF DESCRIPTION OF DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0037] Figure 1 is one of the flowcharts of the method for determining an intra prediction mode provided by the embodiments of the present application;

[0038] Figure 2 is the second flowchart of the method for determining an intra prediction mode provided by the embodiments of the present application;

[0039] Figure 3 is a structural schematic diagram of a device for determining an intra prediction mode provided by the embodiments of the present application;

[0040] Figure 4 is a structural schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0041] The technical solutions of the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0042] The embodiment of the present application provides a method and device for determining an intra prediction mode, and an electronic device. The texture information in different directions within a current coding unit (CU) is calculated and analyzed, and the value obtained by calculation is used to assist in determining the intra prediction mode of the current CU, so that the problem of high time consumption and slow encoding speed in the process of rough selection of the intra prediction mode is solved.

[0043] Referring to Figure 1 , Figure 1 A flowchart of a method for determining an intra prediction mode is provided by the embodiment of the present application, as shown in Figure 1 The method comprises the following steps:

[0044] Step 101, dividing the minimum coding unit (LCU) in the target coding unit (CU) of a target image into a plurality of sub-block units.

[0045] The target CU of a target image to be encoded is divided into a plurality of LCU, wherein the target CU is any one of a plurality of coding units in the encoding process, and the LCU is a basic unit that cannot be further divided. The number of sub-block units of the LCU division can be pre-set according to the encoding standard or the characteristics of the image, for example, each LCU is divided into a plurality of 8x8 sub-block units. The image can include a video image or a picture.

[0046] Step 102, determining the texture complexity of the target CU in a plurality of directions according to the texture complexity of each sub-block unit in the plurality of directions.

[0047] In this step, the texture complexity of each sub-block unit in a plurality of directions is obtained, and the plurality of directions can include a horizontal direction, a vertical direction, a diagonal direction, etc.

[0048] The texture complexity of each sub-block unit can 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 a plurality of directions, the texture complexity of the target CU in a plurality of directions is determined. Specifically, the texture complexity of the target CU in a target direction can be obtained by weighted summation or averaging the texture complexity of each sub-block unit in the target direction, or by accumulating the texture complexity of each sub-block unit in the target direction 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 in the unit of LCU, compared with calculating the texture complexity in the unit of CU, the redundant calculation caused by the spatial overlapping area of CU in the block division stage decision can be avoided. In addition, the texture information of the target CU is obtained by combining the texture information of the sub-block units, and the complexity of calculating the texture information of the target CU is reduced.

[0051] Optionally, the plurality of directions include a horizontal direction, a vertical direction, a 45-degree direction and a 135-degree direction; and the determining the texture complexity of the target CU in the plurality of directions according to the texture complexity of each of the sub-block units in the plurality of directions comprises:

[0052] calculating the texture complexity of each of the sub-block units in a target direction, the target direction being any one of the plurality of directions;

[0053] adding the texture complexity of each of the sub-block units in the target direction to obtain the texture complexity of the target CU in the target direction.

[0054] Optionally, the plurality of directions include a horizontal direction, a vertical direction, a 45-degree direction and a 135-degree direction; and the determining the texture complexity of the target CU in the plurality of directions according to the texture complexity of each of the sub-block units in the plurality of directions comprises:

[0055] For example, the texture complexity of the target CU in the target direction is calculated, and the texture complexity of each of the sub-block units in the target direction is added to obtain the texture complexity of the target CU in the target direction.

[0056] In the above manner, the texture complexity of the target CU in the four directions can be obtained. The texture information of the target CU is obtained by combining the texture information of the sub-block units, and the complexity of calculating the texture information of the target CU is reduced.

[0057] Optionally, the calculating the texture complexity of each of the sub-block units in the target direction comprises:

[0058] calculating the pixel values of all the sub-block units in the LCU corresponding to the target sub-block unit in the target direction, the target sub-block unit being any one of the plurality of sub-block units;

[0059] calculating the average value of the pixel values of all the sub-block units;

[0060] Optionally, 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] The texture complexity of the target sub-block unit in the target direction is calculated by taking the target sub-block unit as an example.

[0062] According to the sub-block unit of LCU division, the LCU corresponding to the target sub-block unit can be determined, and the pixel values of all sub-block units in the target direction in the LCU are obtained. 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 represents the pixel brightness component value of the i-th row and j-th column of an 8x8 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, and tex_45 and tex_135 represent the texture complexity in the 45-degree direction and the 135-degree direction, respectively.

[0074] In addition, the pixel value of the above sub-block unit can be determined by obtaining the predicted pixel value, or by calculating the residual of the pixel data.

[0075] In the present embodiment, the pixel value of the current sub-block unit is subtracted from the average value of all sub-block units in the direction to obtain the complexity at the pixel point, which has lower computational complexity than using the common gradient operator to calculate the complexity.

[0076] In a case that a difference between the maximum value and the minimum value of the texture complexity of the target CU in the plurality of directions satisfies a preset condition, determining the intra prediction mode of the target image according to a direction corresponding to the maximum value.

[0077] The texture complexity values of the target CU in the plurality of directions are obtained, and the texture complexity values in the plurality of directions are compared. The preset condition that the difference between the maximum value and the minimum value satisfies can be that the difference is greater than or equal to a preset multiple of the minimum value, or that the difference is greater than or equal to a preset multiple of an average value, the average value being an average of the maximum value and the minimum value.

[0078] When the difference between the maximum value and the minimum value of the texture complexity values satisfies the preset condition, a direction corresponding to the maximum value of the texture complexity of the target CU is obtained as a main direction, and the intra 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, a horizontal prediction mode can be selected.

[0079] Optionally, the method further comprises:

[0080] In a case that a difference between the maximum value and the minimum value of the texture complexity of the target CU in the plurality of directions does not satisfy the preset condition, determining the intra prediction mode of the target image as a preset intra prediction mode.

[0081] When the difference between the maximum value and the minimum value of the texture complexity values does not satisfy the preset condition, a preset intra prediction mode is selected. The preset mode can be determined according to factors such as an encoding standard of the image, complexity of the image, and quality required by the image.

[0082] Optionally, in the case that the difference between the maximum value and the minimum value of the texture complexity of the target CU in the plurality of directions satisfies the preset condition, determining the intra prediction mode of the target image according to the direction corresponding to the maximum value, comprises:

[0083] In a case that the difference between the maximum value and the minimum value of the texture complexity of the target CU in the plurality of directions is greater than or equal to a preset multiple of the minimum value, determining the intra prediction mode of the target image according to the direction corresponding to the maximum value.

[0084] The preset multiple can be a threshold value set through experiments, for example, 0.1 or 0.11.

[0085] In the above manner, the intra prediction mode of the target image is determined, the number of candidate prediction modes in the intra prediction mode rough selection is reduced, and the encoding time is saved.

[0086] Optionally, the step of determining the intra prediction mode of the target image according to the direction corresponding to the maximum value comprises:

[0087] adding a preset first prediction mode to the candidate mode list;

[0088] adding a second prediction mode to the candidate mode list if the direction corresponding to the maximum value is a horizontal direction, or adding a third prediction mode to the candidate mode list if the direction corresponding to the maximum value is a vertical direction, or adding a fourth prediction mode to the candidate mode list if the direction corresponding to the maximum value is a 45-degree direction, or adding a fifth prediction mode to the candidate mode list if the direction corresponding to the maximum value is a 135-degree direction, wherein the second prediction mode, the third prediction mode, the fourth prediction mode and the fifth prediction mode each comprise at least one prediction mode;

[0089] determining the intra prediction mode of the target image according to the candidate mode list after adding the prediction modes.

[0090] In this embodiment, first, a non-angular intra prediction mode, i.e., a first prediction mode 0, 1, 2, is selected as a candidate mode, if the direction corresponding to the maximum value is a horizontal direction, a second prediction mode (prediction mode numbers are 21, 24, 27 respectively) related to the horizontal direction is added to the candidate mode list, if the direction corresponding to the maximum value is a vertical direction, a third prediction mode (prediction mode numbers are 9, 12, 15 respectively) corresponding to the vertical direction is added to the candidate mode list, if the direction corresponding to the maximum value is a 45-degree direction, a fourth prediction mode (prediction mode numbers are 4, 7, 10, 25, 28, 31 respectively) corresponding to the 45-degree direction is added to the candidate mode list, and if the direction corresponding to the maximum value is a 135-degree direction, a fifth prediction mode (prediction mode numbers are 15, 18, 21 respectively) corresponding to the 135-degree direction is added to the candidate mode list.

[0091] Determining the intra prediction mode based on the above prediction modes in the candidate mode list can reduce the number of candidate prediction modes in the rough selection of the intra prediction mode, thereby saving the encoding time.

[0092] Optionally, the step of determining the intra prediction mode of the target image according to the candidate mode list after adding the prediction modes comprises:

[0093] determining a first candidate prediction mode in the candidate mode list after adding the prediction modes according to the estimated size of the overhead;

[0094] processing the prediction mode numbers in the first candidate prediction mode to obtain a second candidate prediction mode;

[0095] obtaining a prediction mode in a neighboring direction of the second candidate prediction mode by using a preset mapping method, and determining the intra prediction mode of the target image according to the prediction mode in the neighboring direction.

[0096] In the embodiment, three rounds of rough selection are adopted to determine the intra prediction mode.

[0097] First round of rough selection: the prediction modes in the candidate mode list after adding the prediction mode are arranged in descending order according to the estimated cost, and a first candidate prediction mode with smaller cost is obtained.

[0098] Second round of rough selection: for the angle prediction modes except the modes numbered 0, 1 and 2 in the first candidate mode, new modes obtained by adding 1 and subtracting 1 to the number of each mode respectively are used as candidate modes for the second round of rough selection of the intra prediction mode, and a plurality of modes with the smallest RD cost estimated in the first two rounds are reserved.

[0099] Third round of rough selection: for the modes obtained after the second round of rough selection, for the angle prediction modes therein, neighboring direction angle prediction modes thereof are obtained by using a preset mapping method, and the third round of rough selection is performed by using the angle prediction modes in the neighboring directions as candidate modes, and a plurality of modes with the smallest RD cost estimated in the first three rounds are reserved.

[0100] The intra prediction mode of the target image is obtained through the above three rounds of rough selection.

[0101] According to the embodiment, a plurality of prediction modes most likely to be selected are screened out as candidate modes according to the texture direction of the CU, the number of candidate prediction modes in the rough selection of the intra prediction mode is reduced, and the encoding time is saved.

[0102] In order to facilitate understanding of the embodiment, the following is illustrated by combining a specific implementation.

[0103] As shown in Figure 2 the following steps are included:

[0104] Step 201: divide the whole image into a plurality of 8x8 sub-block units.

[0105] Divide the whole image into a plurality of LCUs, and then divide each LCU into a plurality of 8x8 sub-block units.

[0106] Step 202: calculate the texture complexity in four directions of each sub-block unit, and save.

[0107] In each sub-block unit, the horizontal, vertical, 45-degree and 135-degree texture complexities of each sub-block unit are calculated according to the above formulas (1) to (8), and are recorded and saved.

[0108] Step 203, locate all sub-block units inside the current CU, and calculate the sum of texture complexity of each direction.

[0109] When intra prediction is performed on a certain CU, all 8x8 sub-block units contained inside the CU are located, and the previously saved horizontal, vertical, 45-degree and 135-degree texture complexities of all sub-block units are read. The texture complexity of each direction is respectively accumulated and summed up as the texture complexity of the current CU in that direction.

[0110] When the current CU performs intra prediction mode decision, according to the texture complexity of the four directions in all 8x8 sub-block units inside the current CU, and the preset method, the number of candidate intra prediction modes in the intra prediction process is pruned, thereby playing a role in saving encoding time.

[0111] Step 204, calculate the maximum complexity maxGrad and the minimum complexity minGrad of the current CU.

[0112] According to the order of the texture complexity of the current CU in the four directions from large to small, the direction corresponding to the maximum complexity value is the main direction.

[0113] Step 205, judge whether maxGrad-minGrad is greater than a*minGrad.

[0114] It is implemented on the encoder software AVS3Enc of AVS3 (Audio Video Source Coding) standard, and AVS3Enc is used as the reference benchmark of the algorithm. The simulation experiment is performed under the AI configuration, the test speed level is set to Speed_Level=4, and the encoding test is performed on the general test sequence by setting the quantization parameter QP i to 27, 32, 38, and 45. After balancing the encoding performance and encoding complexity, a set of parameters is determined: α=0.1. The experiment is performed by using the 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 respectively the BD-BR values calculated for the luminance and two chrominance components in the YUV color space. These values reflect the code rate saving situation in the encoding process of different test sequences, 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, and the encoding performance decreases by 0.38%. The calculation formula of the encoding time saving rate TS is as follows:

[0118]

[0119] where Time prop represents the encoding time in high quality mode, Time base represents the encoding time in base mode.

[0120] Step 206, if yes, use maxGrad to select the most probable modes in the corresponding direction as the candidate modes for the rough selection.

[0121] If the difference between the maximum complexity value and the minimum complexity value is greater than or equal to a times the minimum complexity value (a is a threshold value set according to experiments), then select several intra prediction modes according to the main direction as the candidate modes for the subsequent rough selection of intra prediction modes.

[0122] The specific way of selecting the candidate intra prediction modes is as follows: first, select the non-angular intra prediction modes 0, 1, 2 as the candidate modes. If the main direction is the horizontal direction, then add the intra prediction modes 21, 24, 27 to the candidate mode list; if the main direction is the vertical direction, then add the intra prediction modes 9, 12, 15 to the candidate mode list; if the main direction is the 45 degree direction, then add the intra prediction modes 4, 7, 10, 25, 28, 31 to the candidate mode list; if the main direction is the 135 degree direction, then add the intra prediction modes 15, 18, 21 to the candidate mode list.

[0123] Step 207, if no, use the existing rough selection technology of intra prediction modes.

[0124] Using the candidate modes selected by the above steps, perform the first round of rough selection of intra prediction modes, and sort all the modes according to their estimated RD cost from small to large. For the modes obtained after the first round of rough selection, use the new modes obtained by adding one and subtracting one to the number of each mode respectively as the candidate modes to perform the second round of rough selection of intra prediction modes, and retain at most 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 angular prediction modes among them, obtain the angular prediction modes in the adjacent directions thereof through a preset mapping method, and use the angular prediction modes in the adjacent directions as the candidate modes to perform the third round of rough selection, and retain at most 2 modes with the smallest estimated RD cost in the first three rounds.

[0125] In the related art, a fixed intra prediction mode is adopted, and a first round of rough selection is performed according to the predicted RD overhead; in a second round, the number of the angle prediction mode (a mode whose number is not 0, 1 or 2) in the first round is increased by one and decreased by one to obtain a new mode, the mode is taken as a candidate mode of the second round of rough selection, the RD overhead of all modes is estimated, and at most 6 modes with the minimum estimated RD overhead among all the modes reserved in the first two rounds of rough selection are reserved. In a third step, for the angle prediction mode in the at most 6 modes reserved in the first two rounds, a mapping method is preset to obtain an angle prediction mode adjacent to the angle prediction mode, and the angle prediction mode is taken as a candidate mode in the third round of rough selection, at most 5 modes with the minimum estimated RD overhead among all the modes reserved in the first three rounds of rough selection are reserved as the final candidate modes of the intra prediction.

[0126] In order to further reduce the candidate modes, the embodiments of the present application prune the number of the candidate intra prediction modes in the intra prediction process, thereby saving the encoding time. The texture complexity of each sub-block in the internal LCU is calculated and recorded, and when the CU is intra predicted, the previously saved data is directly taken. For the CU whose spatial position overlaps in the block division decision process, the sub-block unit at the same position does not need to calculate the texture complexity repeatedly. Moreover, only the texture information in the internal CU is needed, and for the CU located at the image edge without the adjacent CU or the CU with weak correlation with the adjacent CU, the intra prediction mode rough selection can also be performed by using the algorithm. In addition, the texture complexity in four directions is calculated, compared with the method of considering only the horizontal and vertical texture complexity, more modes can be skipped when the mode rough selection is performed; compared with the method of establishing the 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, and the high-complexity square operation and inverse trigonometric function operation can be avoided.

[0127] The application is implemented and experimented in an AVS3 Enc encoder, and the experimental results show that, in an all intra (AI) configuration (all frames in the encoding process are predicted and encoded using only information in the current frame, without using information of other frames), an average of 9.2% can be saved, and the encoding loss of the luminance component is 0.38%, and the encoding loss of the chroma component is 0.37% for the U component and 0.24% for the V component. The application is implemented based on the AVS3 standard, and the decision process of the intra prediction mode in the AVS3 is improved, which can effectively reduce the encoding complexity and save the encoding time. The application can be applied to the field of video encoding, including but not limited to video conference, video live broadcast, video content storage and other application scenarios. Compared with the existing fast algorithm for rough selection of the intra prediction mode based on image texture in the VVC (general video coding standard) and other standards, the application can be applied to the AVS3 video coding standard, and is mainly designed for the characteristics of the angle prediction mode distribution in the AVS3 standard, so that it can be applied to the AVS3 standard.

[0128] For a CU with strong texture directionality, the finally selected intra prediction mode has strong correlation with the texture direction, therefore, the application uses the image texture characteristics in the CU to select several most likely selected prediction modes in advance as candidate modes according to the texture direction of the CU, which can effectively save the encoding time.

[0129] Referring to Figure 3 , Figure 3 is a structural schematic diagram of a determination device for an intra prediction mode provided by an embodiment of the application, as Figure 3 shown, the determination device for the intra prediction mode 300 comprises:

[0130] A division module 301 is configured 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 determination module 302 is configured to determine texture complexity of the target CU in a plurality of directions according to texture complexity of each of the sub-block units in the plurality of directions.

[0132] A second determination module 303 is configured to determine an intra prediction mode of the target image according to a direction corresponding to a maximum value of the texture complexity of the target CU in the plurality of directions, in a case where a difference between the maximum value and a minimum value of the texture complexity of the target CU in the plurality of directions satisfies a preset condition.

[0133] Optionally, the second determination module is specifically configured to:

[0134] In a case where a difference between a maximum value and a minimum value of the texture complexity of the target CU in the plurality of directions is greater than or equal to a preset multiple of the minimum value, a frame intra prediction mode of the target image is determined according to a direction corresponding to the maximum value.

[0135] Optionally, the plurality of 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 calculating sub-module, configured to calculate the texture complexity of each of the sub-block units in a target direction, the target direction being any one of the plurality of directions;

[0137] a summing sub-module, configured to sum the texture complexity of each of the sub-block units in the target direction to obtain the texture complexity of the target CU in the target direction.

[0138] Optionally, the calculating sub-module includes:

[0139] a first calculating unit, configured to calculate pixel values of all sub-block units in an LCU corresponding to a target sub-block unit in the target direction, the target sub-block unit being any one of the plurality of sub-block units;

[0140] a second calculating unit, configured to calculate an average value of the pixel values of the all sub-block units;

[0141] wherein the texture complexity of the target sub-block unit in the target direction is a 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 sub-module, configured to add a preset first prediction mode to a candidate mode list;

[0144] a second adding sub-module, configured to add a second prediction mode to the candidate mode list in a case where the direction corresponding to the maximum value is the horizontal direction; or add a third prediction mode to the candidate mode list in a case where the direction corresponding to the maximum value is the vertical direction; or add a fourth prediction mode to the candidate mode list in a case where the direction corresponding to the maximum value is the 45-degree direction; or add a fifth prediction mode to the candidate mode list in a case where the direction corresponding to the maximum value is the 135-degree direction, 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 determining sub-module is configured to determine the intra prediction mode of the target image according to the candidate mode list after adding the prediction mode.

[0146] Optionally, the determining sub-module comprises:

[0147] The first determining unit is configured to determine a first candidate prediction mode from the candidate mode list after adding the prediction mode according to the estimated size of the overhead.

[0148] The processing unit is configured to process the prediction mode number in the first candidate prediction mode to obtain a second candidate prediction mode.

[0149] The second determining unit is configured to obtain the prediction mode in the adjacent direction of the second candidate prediction mode by using a preset mapping method, and determine the intra prediction mode of the target image according to the prediction mode in the adjacent direction.

[0150] Optionally, the apparatus further comprises:

[0151] The third determining module is configured to determine the intra prediction mode of the target image as a preset intra prediction mode in a case where the difference between the maximum value and the minimum value of the texture complexity of the target CU in the plurality of directions does not satisfy the preset condition.

[0152] The determining apparatus of the intra prediction mode can achieve Figure 1 The processes implemented in the corresponding method embodiments and the same technical effects can be achieved, and thus details are not repeated here.

[0153] As Figure 4 shown, the embodiments of the present application further provide an electronic device 400, which comprises a processor 401, a memory 402, and a program stored in the memory 402 and capable of running on the processor 401. The program is executed by the processor 401 to implement the processes of the above-mentioned intra prediction mode determining method embodiments, and the same technical effects can be achieved. To avoid repetition, details are not repeated here.

[0154] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the processes of the above-mentioned intra prediction mode determining method embodiments, and the same technical effects can be achieved. To avoid repetition, details are 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 embodiment of the present application further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the above-mentioned Figure 1 The various processes of the method embodiment are implemented by the computer program product, and the same technical effects can be achieved. To avoid repetition, details are not described herein.

[0156] It should be noted that, in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or further include elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0157] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a number of instructions for making a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the methods described in the various embodiments of the present application.

[0158] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, which are only illustrative and not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the protection scope of the claims.

Claims

1. A method for determining an intra-frame prediction mode, characterized in that, include: The smallest coding unit (LCU) in the target coding unit (CU) of the target image is divided into multiple sub-block units; The texture complexity of the target CU in the multiple directions is determined based on the texture complexity of each sub-block unit in the multiple directions; If the difference between the maximum and minimum values ​​of the texture complexity of the target CU in the multiple directions satisfies a preset condition, the intra-frame 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 the difference between the maximum and minimum values ​​of the texture complexity of the target CU in the multiple directions satisfies a preset condition, determining the intra-frame prediction mode of the target image based on the direction corresponding to the maximum value includes: If the difference between the maximum and minimum values ​​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 horizontal, vertical, 45-degree, and 135-degree directions; determining the texture complexity of the target CU in the multiple directions based on the texture complexity of each sub-block unit in the multiple directions includes: Calculate the texture complexity of each of the sub-block units in the target direction, where the target direction is any one of the plurality of directions; The texture complexity of the target CU in the target direction is obtained by summing the texture complexity of each sub-block unit in the target direction.

4. The method according to claim 3, characterized in that, The calculation of the texture complexity of each sub-block unit in the target direction includes: Calculate the pixel values ​​of all sub-block units in the LCU corresponding to the target sub-block unit in the target direction, wherein the target sub-block unit is any one of the plurality of sub-block units; Calculate the average pixel value of all sub-block units; Wherein, 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, Determining the intra-frame prediction mode of the target image based on the direction corresponding to the maximum value includes: Add the preset first prediction mode to the candidate mode list; If the direction corresponding to the maximum value is horizontal, a second prediction mode is added to the candidate mode list; or, if the direction corresponding to the maximum value is vertical, a third prediction mode is added to the candidate mode list; or, if the direction corresponding to the maximum value is 45 degrees, a fourth prediction mode is added to the candidate mode list; or, if the direction corresponding to the maximum value is 135 degrees, a 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; Based on the candidate mode list after adding prediction modes, the intra-frame prediction mode of the target image is determined.

6. The method according to claim 5, characterized in that, Determining the intra-frame prediction mode of the target image based on the candidate mode list after adding prediction modes includes: Based on the estimated cost, a first candidate prediction mode is determined from the candidate mode list after adding prediction modes; The prediction pattern number in the first candidate prediction pattern is processed to obtain the second candidate prediction pattern; A preset mapping method is used to obtain the prediction modes of the second candidate prediction mode in adjacent directions, and the intra-frame prediction mode of the target image is determined based on the prediction modes in the adjacent directions.

7. The method according to claim 1, characterized in that, The method further includes: If the difference between the maximum and minimum values ​​of the texture complexity of the target CU in the multiple directions does not meet the preset condition, the intra-frame prediction mode of the target image is determined to be the 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 the program, when executed by the processor, implements the steps of the method for determining an intra-prediction mode as claimed in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for determining an intra-frame prediction mode as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the method for determining the intra-prediction mode as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Fast selecting method of prediction mode in video frame and device thereof

    CN105812799A

  • Intra-frame prediction mode selection method and device, equipment and storage medium

    CN111741299A