Intra-frame prediction methods and terminals
By obtaining texture information from a reference sample set to determine the second-angle prediction mode and modifying the prediction samples, the accuracy problem in the PDPC method is solved, and the accuracy of intra-frame prediction is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2021-09-30
- Publication Date
- 2026-07-17
Smart Images

Figure CN115883834B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of video codec standards, specifically relating to an intra-frame prediction method and terminal. Background Technology
[0002] In the Versatile Video Coding (VVC) standard, the Position Dependent Intra Prediction Combination (PDPC) method is typically used to modify the prediction samples corresponding to the prediction blocks, thereby improving the accuracy of intra prediction.
[0003] In related technologies, PDPC determines a prediction sample and a first reference sample based on the angle prediction pattern corresponding to the prediction block. Then, based on the prediction sample, it adds or subtracts 180 degrees from the first prediction angle corresponding to the first reference sample to obtain the second prediction angle corresponding to the second reference sample. The prediction sample is then corrected based on the first and second reference samples to obtain the corrected prediction sample. However, the accuracy of the modified prediction sample obtained by this PDPC method is relatively low. Summary of the Invention
[0004] This application provides an intra-frame prediction method and terminal that can solve the problem of low accuracy of modified prediction samples obtained by the existing PDPC method.
[0005] Firstly, an intra-frame prediction method is provided, which includes:
[0006] Based on the angle prediction mode corresponding to the prediction block, the prediction sample corresponding to the prediction block is determined;
[0007] The prediction samples are modified using the location-dependent intra-prediction combination PDPC to generate modified prediction samples.
[0008] The modification of the prediction sample using location-related intra-frame prediction combinations includes:
[0009] The texture information of the reference sample set corresponding to the first angle prediction mode is obtained. The first angle prediction mode is the angle prediction mode corresponding to the prediction block. The reference sample set includes at least one reference sample.
[0010] The second angle prediction mode is determined based on the texture information;
[0011] The prediction sample is modified based on the target reference sample corresponding to the second angle prediction mode.
[0012] Secondly, a decoder is provided, the device comprising:
[0013] The first determining module is used to determine the prediction sample corresponding to the prediction block based on the angle prediction mode corresponding to the prediction block.
[0014] The processing module is used to modify the prediction sample using location-dependent intra-prediction combination (PDPC) to generate the modified prediction sample.
[0015] The processing module includes:
[0016] The acquisition module is used to acquire the texture information of the reference sample set corresponding to the first angle prediction mode, wherein the first angle prediction mode is the angle prediction mode corresponding to the prediction block, and the reference sample set includes at least one reference sample.
[0017] The second determining module is used to determine the second angle prediction mode based on the texture information;
[0018] The modification module is used to modify the prediction sample based on the target reference sample corresponding to the second angle prediction mode.
[0019] Thirdly, a terminal is provided, the terminal including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0020] Fourthly, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0021] Fifthly, a chip is provided, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the method described in the first aspect.
[0022] In a sixth aspect, a computer program / program product is provided, the computer program / program product being stored in a non-volatile storage medium, the program / program product being executed by at least one processor to implement the steps of the method as described in the first aspect.
[0023] In this embodiment, texture information of the reference sample set corresponding to the first angle prediction mode is obtained, and a second angle prediction mode is determined based on the texture information. The prediction angle corresponding to the second angle prediction mode is then determined as the second prediction angle; instead of adding or subtracting 180 degrees from the first prediction angle corresponding to the first angle prediction mode to obtain the second prediction angle. Furthermore, the prediction sample is modified according to the target reference sample corresponding to the second angle prediction mode, thereby using the second angle prediction mode determined based on texture information to modify the prediction sample, which improves the accuracy of the modified prediction sample. Attached Figure Description
[0024] Figure 1 This application provides a schematic diagram illustrating the mapping relationship between angle modes and offset values in its embodiments.
[0025] Figure 2 This is a schematic diagram of the predicted angle provided in an embodiment of this application;
[0026] Figure 3 This is a diagram illustrating application scenarios for existing PDPC methods;
[0027] Figure 4 This is a flowchart of the intra-frame prediction method provided in the embodiments of this application;
[0028] Figure 5 This is a diagram illustrating application scenarios for existing DIMD methods;
[0029] Figure 6 This is an application scenario diagram of the PDPC method provided in the embodiments of this application;
[0030] Figure 7 This is a structural diagram of the decoder provided in the embodiments of this application;
[0031] Figure 8 This is a structural diagram of the communication device provided in the embodiments of this application;
[0032] Figure 9 This is a schematic diagram of the hardware structure of the terminal provided in the embodiments of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0034] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0035] The decoder corresponding to the intra-frame prediction method in this application embodiment can be a terminal, which can also be called a terminal device or user equipment (UE). The terminal can be a mobile phone, tablet computer, laptop computer, personal digital assistant (PDA), handheld computer, netbook, ultra-mobile personal computer (UMPC), mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device or vehicle-mounted device (VUE), pedestrian terminal (PUE), etc. Wearable devices include smartwatches, bracelets, headphones, glasses, etc. It should be noted that the specific type of terminal is not limited in this application embodiment.
[0036] For ease of understanding, the following describes some aspects of the embodiments of this application:
[0037] Currently, intra-frame prediction modes are commonly used to process various types of textures in images. These intra-frame prediction modes include angle prediction mode, DC prediction mode, and Planar prediction mode. The index range for angle prediction mode is -14 to 80, the index for DC prediction mode is 1, and the index for Planar prediction mode is 0.
[0038] The aforementioned angle prediction modes are equivalent to offsetting the prediction block in the horizontal or vertical direction. For details on the mapping relationship between different angle modes and offset values, please refer to [link to documentation]. Figure 1 .in, Figure 1In this context, predModeIntra is the index corresponding to the angle prediction mode, and intraPredAngle is the offset value.
[0039] For easier understanding, please refer to Figure 2 , Figure 2 The offset position corresponding to each angle prediction mode is shown.
[0040] Furthermore, the reverse angle value can be obtained based on the offset value, as shown in the following formula:
[0041]
[0042] Where invAngle is the inverted angle value and intraPredAngle is the offset value.
[0043] It should be understood that PDPC is supported when the index corresponding to the angle prediction mode is greater than 50 or less than 18. PDPC is an intra-frame prediction method that can further modify the predicted samples after intra-frame prediction.
[0044] The following section details the existing PDPC methods:
[0045] Please see Figure 3 ,like Figure 3 As shown, based on the prediction angle corresponding to the prediction block, the coordinates of the prediction sample corresponding to the prediction block are pred(x',y.), and the coordinates of reference sample 1 are R(x',-1), meaning that reference sample 1 is located above the current prediction block. Reference sample 1 is determined based on the prediction angle corresponding to the current prediction block, using the prediction sample as a basis.
[0046] Then, we can rotate the angle between the predicted sample and reference sample 1 by 180 degrees to obtain reference sample 2, as shown below. Figure 3 As shown, the coordinates of reference sample 2 are R(-1, y'), meaning reference sample 2 is located to the left of the prediction block. Reference sample 1 and reference sample 2 both include at least one reference sample.
[0047] The following section details how the scaling factor is calculated in existing PDPC methods:
[0048] 1. When the index corresponding to the angular prediction mode of the prediction block is greater than 50, the scaling factor can be calculated using the following pseudocode:
[0049] nScale=Min(2,Log2(nTbH)-Floor(Log2(3*invAngle-2))+8)
[0050] Where nScale is the scaling factor, nTbH is the height of the prediction block, and invAngle is the inverse angle value corresponding to the prediction block.
[0051] 2. When the index corresponding to the angular prediction mode of the prediction block is less than 18, and the corresponding index is not equal to 0 or 1, the scaling factor can be calculated using the following pseudocode:
[0052] nScale=Min(2,Log2(nTbW)-Floor(Log2(3*invAngle-2))+8)
[0053] Where nScale is the scaling factor, nTbW is the width of the prediction block, and invAngle is the inverse angle value corresponding to the prediction block.
[0054] 3. Otherwise, if the index corresponding to the angular prediction mode of the prediction block is equal to 18, 50, 0, or 1, the scaling factor can be calculated using the following pseudocode:
[0055] nScale=(Log2(nTbW)+Log2(nTbH)-2)>>2
[0056] Where nScale is the scaling factor, nTbW is the width of the prediction block, and nTbH is the height of the prediction block.
[0057] The following section details how variables are calculated in existing PDPC methods:
[0058] It should be understood that the above variables include refL[x][y], refT[x][y], wT[y], and wL[x], where refL[x][y] represents the reference sample located to the left of the prediction block. Figure 3 In the scenario shown, this variable represents reference sample 2; refT[x][y] represents the reference sample located above the prediction block. Figure 3 In the scenario shown, the variable represents reference sample 1; wT[y] represents the weight value of the reference sample to the left of the prediction block; and wL[x] represents the weight value of the reference sample above the prediction block.
[0059] First, determine the reference sample arrays mainRef[x] and sideRef[y]:
[0060] mainRef[x] = p[x][-1]
[0061] sideRef[y] = p[-1][y]
[0062] Where, mainRef[x] represents the coordinates of the predicted sample mapped onto the reference sample above the prediction block, and in the illustrated scenario, it is associated with reference sample 1; sideRef[y] represents the coordinates of the predicted sample mapped onto the reference sample to the left of the prediction block, and in the illustrated scenario, it is associated with reference sample 1; Figure 3 In the scenario shown, it is associated with reference sample 2; that is, p[x] above is the x-coordinate of the predicted sample and p[y] above is the y-coordinate of the predicted sample.
[0063] 1. When the index corresponding to the angular prediction mode of the prediction block is equal to 0 or 1, that is, when the intra-frame prediction mode corresponding to the prediction block is DC mode or Planar mode, the variable can be calculated using the following pseudocode:
[0064] refL[x][y]=p[-1][y]
[0065] refT[x][y]=p[x][-1]
[0066] wT[y]=32>>((y<1)>>nScale)
[0067] wL[x]=32>>((x<1)>>nScale)
[0068] Where p[-1][y] is the coordinate of the predicted sample mapped onto the reference sample to the left of the prediction block, p[x][-1] is the coordinate of the predicted sample mapped onto the reference sample above the prediction block, and nScale is the scaling factor.
[0069] 2. When the index corresponding to the angular prediction mode of the prediction block is equal to 18 or 50, the variable can be calculated using the following pseudocode:
[0070] refL[x][y]=p[-1][y]-p[-1][-1]+predSamples[x][y]
[0071] refT[x][y]=p[x][-1]-p[-1][-1]+predSamples[x][y]
[0072] wT[y]=(predModeIntra==INTRA_ANGULAR18)? 32>((y<1)>>nScale): 0
[0073] wL[x]=(predModeIntra==INTRA_ANGULAR50)? 32>((x<1)>>nScale):0
[0074] Where predSamples[x][y] are the coordinates of the predicted samples, predModeIntra is the angle prediction mode of the prediction block, INTRA_ANGULAR18 indicates that the index corresponding to the angle prediction mode of the prediction block is 18, nScale is the scaling factor, and INTRA_ANGULAR50 indicates that the index corresponding to the angle prediction mode of the prediction block is 50.
[0075] 3. When the index corresponding to the angular prediction mode of the prediction block is less than 18 and the scaling factor is greater than or equal to 0, the variable can be calculated using the following pseudocode:
[0076] dXInt[y]=((y+1)*invAngle+256)>>9
[0077] dX[x][y]=x+dXInt[y]
[0078] Wherein, variable dXInt[y] represents the offset value of the X coordinate of the reference sample above the prediction block relative to the X coordinate of the prediction sample set, variable dX[x][y] is used to determine the position of the reference sample above the prediction block, and invAngle is the inverse angle value corresponding to the prediction block.
[0079] refL[x][y]=0
[0080] refT[x][y]=(y<(3< <nScale))?mainRef[dX[x][y]]:0
[0081] wT[y]=32>>((y<1)>>nScale)
[0082] wL[x]=0
[0083] 4. When the index corresponding to the angular prediction mode of the prediction block is greater than 50 and the scaling factor is greater than or equal to 0, the variable can be calculated using the following pseudocode:
[0084] dYInt[x]=((x+1)*invAngle+256)>>9
[0085] dY[x][y] = y + dYInt[x]
[0086] Wherein, variable dYInt[x] represents the offset value of the Y coordinate of the reference sample to the left of the prediction block relative to the Y coordinate of the prediction sample, variable dY[x][y] is used to determine the position of the reference sample to the left of the prediction block, and invAngle is the inverse angle value corresponding to the prediction block.
[0087] refL[x][y]=(x<(3< <nScale))?sideRef[dY[x][y]]:0
[0088] refT[x][y]=0
[0089] wT[y]=0
[0090] wL[x]=32>>((x<1)>>nScale)
[0091] 5. If the index corresponding to the angular prediction mode of the prediction block is greater than 18 and less than 50, set refL[x][y], refT[x][y], wT[y] and wL[x] to 0.
[0092] The following section details how existing PDPC methods modify predicted samples using variables to obtain modified predicted samples:
[0093] predSamples[x'][y']=Clip1(refL[x][y]*wL[x]+refT[x][y]*wT[y]+((64-wL[x]-wT[y])*predSamples[x][y]+32)>>6)
[0094] Where predSamples[x'][y'] are the modified predicted samples, and predSamples[x][y] are the unmodified predicted samples.
[0095] In existing PDPC methods, such as Figure 3 As shown, after determining reference sample 1 based on the first prediction angle corresponding to the angle prediction mode of the prediction block, the angle between the prediction sample and reference sample 1 is rotated by 180 degrees to obtain reference sample 2. However, the above process of determining reference sample 2 does not fully consider the texture information corresponding to each reference sample in the reference sample. The second prediction angle corresponding to reference sample 2 and the first prediction angle corresponding to reference sample 1 may not have a linear relationship. This leads to the inaccuracy of the modified prediction sample obtained by the PDPC method, which reduces the accuracy of intra-frame prediction.
[0096] Please see Figure 4 , Figure 4 This is a flowchart of the intra-frame prediction method provided in this application. The intra-frame prediction method provided in this embodiment includes the following steps:
[0097] S101, Based on the angle prediction mode corresponding to the prediction block, determine the prediction sample corresponding to the prediction block.
[0098] As described above, based on the angle prediction pattern corresponding to the prediction block, a first reference sample and a second reference sample can be determined. The first reference sample can be understood as... Figure 3 The reference sample 1 in the scenario shown, and the second reference sample can be understood as... Figure 3 Reference sample 2 is shown in the scenario. Then, a predicted sample is obtained based on reference sample 1 and reference sample 2, where the predicted sample can be understood as... Figure 3 Predicted samples in the scene shown.
[0099] S102, Modify the prediction sample using the location-dependent intra-prediction combination PDPC to generate the modified prediction sample.
[0100] In this step, if the index corresponding to the angle prediction mode of the above angle prediction mode is less than 18 or greater than 50, PDPC can be used to modify the prediction sample and generate a modified prediction sample to improve the accuracy of the modified prediction sample.
[0101] The modification of the prediction sample using location-related intra-frame prediction combinations includes:
[0102] S1021, Obtain the texture information of the reference sample set corresponding to the first angle prediction mode.
[0103] In this step, the first angle prediction mode is the angle prediction mode corresponding to the prediction block. The reference sample set is determined based on the first prediction angle corresponding to the first angle prediction mode, and the reference sample set includes at least one reference sample. The texture information can be understood as a gradient histogram generated using the decoder-side intra-modederivation (DIMD) mode exported from the decoder, or an angle prediction mode corresponding to an adjacent decoded block of the prediction block. For specific technical solutions on how to obtain texture information, please refer to subsequent embodiments.
[0104] S1022, Determine the second angle prediction mode based on the texture information.
[0105] In this step, after obtaining the texture information, one optional implementation is to derive the second angle prediction mode by comparing the amplitude magnitude in the gradient histogram; another optional implementation is to derive the second angle prediction mode from the angle prediction mode corresponding to the decoded block.
[0106] S1023, Modify the prediction sample according to the target reference sample corresponding to the second angle prediction mode.
[0107] It should be understood that when the index corresponding to the angular prediction mode of the prediction block is greater than 50, the first reference sample corresponding to the prediction block is located above the prediction block, and the second reference sample corresponding to the prediction block is located to the left of the prediction block; when the index corresponding to the angular prediction mode of the prediction block is less than 18, the first reference sample corresponding to the prediction block is located above the prediction block, and the second reference sample corresponding to the prediction block is located to the left of the prediction block. The aforementioned second reference sample can be understood as the target reference sample.
[0108] In this step, after obtaining the second angle prediction mode, the prediction sample can be modified using the target reference sample corresponding to the second angle prediction mode. For specific implementation details, please refer to the following embodiments.
[0109] In this embodiment, texture information of the reference sample set corresponding to the first angle prediction mode is obtained, and a second angle prediction mode is determined based on the texture information. The prediction angle corresponding to the second angle prediction mode is then determined as the second prediction angle; instead of adding or subtracting 180 degrees from the first prediction angle corresponding to the first angle prediction mode to obtain the second prediction angle. Furthermore, the prediction sample is modified according to the target reference sample corresponding to the second angle prediction mode, thereby using the second angle prediction mode determined based on texture information to modify the prediction sample, which improves the accuracy of the modified prediction sample.
[0110] Optionally, obtaining the texture information of the reference sample set corresponding to the first angle prediction mode includes:
[0111] If the index corresponding to the first angle prediction mode is less than the first preset index, texture analysis is performed on at least some pixels in the reconstructed image located above and adjacent to the prediction block to obtain the texture information.
[0112] When the index corresponding to the first angle prediction mode is greater than the second preset index, at least some pixels in the reconstructed image located to the left of the prediction block and adjacent to the prediction block are subjected to texture analysis processing to obtain the texture information.
[0113] One way to obtain texture information is to perform texture analysis on the reconstructed images adjacent to the predicted block:
[0114] In this embodiment, optionally, the first preset index is 18 and the second preset index is 50. If the index corresponding to the first angle prediction mode is less than the first preset index, and the reference sample set is determined to be above the prediction block, then texture analysis processing is performed on at least one row of pixels in the reconstructed image above and adjacent to the prediction block to obtain texture information.
[0115] If the index corresponding to the first angle prediction mode is greater than the second preset index, and the reference sample set is determined to be located to the left of the current prediction block, then at least one column of pixels in the reconstructed image to the left of the current prediction block and adjacent to the current prediction block is subjected to texture analysis processing to obtain texture information.
[0116] It should be understood that DIMD can be used to perform texture analysis on a reference sample set to obtain texture information, and further, a second-angle prediction pattern can be derived from the texture information.
[0117] Among them, DIMD mode is a technique for implicitly deriving intra-prediction mode. When the index corresponding to the first angle prediction mode is less than the first preset index, Sobel filter is applied to at least one row of pixels above the prediction block to perform gradient histogram calculation, the direction of the gradient is converted into the angle prediction mode, and the intensity of the gradient is accumulated as the amplitude of the angle prediction mode to generate a gradient histogram. The gradient histogram is determined as the texture information of the reference sample set.
[0118] If the index corresponding to the first angle prediction mode is greater than the second preset index, a Sobel filter is applied to at least one column of pixels in the reconstructed image to the left of the prediction block and adjacent to the current prediction block to perform gradient histogram calculation, thereby generating a gradient histogram, which is then determined as the texture information of the reference sample set.
[0119] For easier understanding, please refer to Figure 5 .like Figure 5 As shown, DIMD can use a window to perform texture analysis on a reference sample set. When the size of the predicted block is 4x4, it can use a window as shown in the example below. Figure 5 The two windows shown perform texture analysis on at least a portion of the pixels above and below the prediction block. When the size of the prediction block is not 4x4, a method such as... Figure 5 The sliding window shown performs texture analysis on at least some pixels above the prediction block and at least some pixels below the prediction block.
[0120] Optionally, obtaining the texture information of the reference sample set corresponding to the first angle prediction mode includes:
[0121] When the index corresponding to the first angle prediction mode is less than the first preset index, the texture information is obtained based on the intra-frame prediction mode corresponding to the decoded block located above and adjacent to the prediction block.
[0122] When the index corresponding to the first angle prediction mode is greater than the second preset index, the texture information is obtained based on the intra-frame prediction mode corresponding to the decoded block located to the left of the prediction block and adjacent to the prediction block.
[0123] One way to obtain texture information is to determine the texture information based on the angle prediction mode corresponding to the adjacent decoded blocks of the prediction block:
[0124] In this embodiment, optionally, the first preset index is 18 and the second preset index is 50. When the index corresponding to the first angle prediction mode is less than the first preset index, it is determined that the reference sample set is located above the prediction block. The intra-frame prediction mode corresponding to the decoded block above the prediction block and adjacent to the prediction block can be obtained, and the gradient histogram represented by the intra-frame prediction mode is determined as texture information.
[0125] If the index corresponding to the first angle prediction mode is greater than the second preset index, it is determined that the reference sample set is located to the left of the prediction block. The intra-prediction mode corresponding to the decoded block to the left of the prediction block and adjacent to the prediction block can be obtained. The gradient histogram represented by the above intra-prediction mode is determined as texture information.
[0126] Optionally, modifying the predicted sample according to the target reference sample corresponding to the second angle prediction mode includes:
[0127] Based on the first prediction angle corresponding to the first angle prediction mode and the second prediction angle corresponding to the second angle prediction mode, determine the scaling factor and the target converse angle value;
[0128] The predicted sample is modified using the target reference sample, the scaling factor, and the target contra-angle value.
[0129] The first prediction angle mentioned above is the prediction angle corresponding to the first angle prediction mode, and the second prediction angle mentioned above is the prediction angle corresponding to the second angle prediction mode. After obtaining the first prediction angle and the second prediction angle, the scaling factor and the target inversion angle value can be calculated using the first prediction angle and the second prediction angle. For specific technical solutions, please refer to the following embodiments.
[0130] In this embodiment, after determining the scaling factor and the target inflection angle value, the target reference sample, the scaling factor, and the target inflection angle value can be used to modify the prediction sample to obtain the modified prediction sample, thereby improving the accuracy of intra-frame prediction.
[0131] Optionally, determining the scaling factor and the target contra-angle value based on the first prediction angle corresponding to the first angle prediction mode and the second prediction angle corresponding to the second angle prediction mode includes:
[0132] The scaling factor is determined using the first contra-angle value corresponding to the first predicted angle;
[0133] The target contraangle value is determined based on the first predicted angle and the second predicted angle.
[0134] In this embodiment, an optional implementation method is to calculate the scaling factor using the first contra-angle value corresponding to the first predicted angle; and then determine the target contra-angle value based on the first predicted angle and the second predicted angle. For details on how to determine the target contra-angle value, please refer to subsequent embodiments.
[0135] As mentioned above, the parameter invAngle is required in the pseudocode for calculating the scaling factor. In this embodiment, the parameter invAngle can be set to the first inverse angle value corresponding to the first prediction angle, that is, the inverse angle value corresponding to the prediction block.
[0136] Optionally, determining the scaling factor and the target contra-angle value based on the first prediction angle corresponding to the first angle prediction mode and the second prediction angle corresponding to the second angle prediction mode includes:
[0137] The target contraangle value is determined based on the first predicted angle and the second predicted angle;
[0138] The scaling factor is determined using the target contra-angle value.
[0139] In this embodiment, an optional implementation method is to determine the target contraangle value based on the first prediction angle and the second prediction angle; then, using the target contraangle value, a scaling factor is calculated, that is, the target contraangle value is substituted into the pseudocode for calculating the scaling factor to obtain the scaling factor. For details on how to determine the target contraangle value, please refer to subsequent embodiments.
[0140] As mentioned above, the parameter invAngle is required in the pseudocode for calculating the scaling factor. In this embodiment, the parameter invAngle can be set to the target contra-angle value calculated based on the first prediction angle and the second prediction angle.
[0141] The following details the technical solution for calculating the target contour angle value:
[0142] Optionally, determining the target contraangle value based on the first predicted angle and the second predicted angle includes:
[0143] If the first angle prediction mode and the second angle prediction mode do not meet the preset conditions, the result of the division of the first preset value and the first offset value is rounded to obtain the target contra-angle value.
[0144] When the first angle prediction mode and the second angle prediction mode meet the preset conditions, the target contra-angle value is obtained according to the second offset value and the second preset value.
[0145] In this embodiment, preset conditions are set in advance. For a detailed explanation of the preset conditions, please refer to the following embodiments.
[0146] If neither the first angle prediction mode nor the second angle prediction mode meets the preset conditions, the target contraangle value can be obtained using the above contraangle value calculation formula. The contraangle value calculation formula is as follows:
[0147]
[0148] Wherein, invAngle is the target contraangle value; 512*32 is the first preset value, i.e., the first preset value is 16384; and predModeAng is the first offset value, which can be obtained by querying... Figure 1 The first offset value corresponding to the first prediction angle is obtained in this way, that is, the offset value corresponding to the first angle prediction mode.
[0149] If the first and second prediction angles meet the preset conditions, it can be done through querying. Figure 1 The second offset value corresponding to the second predicted angle is obtained in this way, that is, the offset value corresponding to the second angle prediction mode. Further, based on the second offset value and the second preset value, the target contra-angle value is obtained; for specific technical solutions, please refer to subsequent embodiments.
[0150] Optionally, obtaining the target contraangle value based on the second offset value and the second preset value includes:
[0151] The target contra-angle value is obtained by shifting the second offset value and the second preset value to the left.
[0152] An optional implementation involves, after obtaining the second offset value and the second preset value, performing a left shift operation on the second offset value and the second preset value to obtain the target contraangle value. Specifically, the target contraangle value can be calculated using the following pseudocode:
[0153] invAngle=predModeAng1< <k
[0154] Wherein, invAngle is the target contraangle value, predModeAng1 is the second offset value, and k is the second preset value. The second preset value is related to the accuracy of the second angle prediction mode. For example, if the accuracy of the second angle prediction mode is 32, then k equals 4.
[0155] Optionally, obtaining the target contraangle value based on the second offset value and the second preset value includes:
[0156] The second offset value and the second preset value are shifted to the left to obtain the second inverse angle value;
[0157] The result of dividing the first preset value and the first offset value is rounded to obtain the third reverse angle value;
[0158] The second and third concave angle values are weighted and summed to determine the target concave angle value.
[0159] Another optional implementation involves left-shifting the second offset value and the second preset value to obtain the second inversion angle value. It should be understood that the pseudocode for calculating the second inversion angle value in this embodiment is the same as the pseudocode for calculating the target inversion angle value in the above embodiments, and can be expressed as:
[0160] invAngle1 = predModeAng1< <k
[0161] Wherein, invAngle1 is the second inverse angle value, predModeAng1 is the second offset value, and k is the second preset value.
[0162] exist Figure 1 The first offset value corresponding to the first predicted angle is obtained by querying the query. The result of dividing the first preset value and the first offset value is rounded to obtain the third inversion angle value. Specifically, it can be expressed as:
[0163]
[0164] Among them, invAngle0 is the third inverse angle value, predModeAng is the first offset value, and 512*32 is the first preset value, that is, the first preset value is 16384.
[0165] After obtaining the second and third concave angle values, the product of the second concave angle value and a preset first weight value is used as the first value, and the product of the third concave angle value and a preset second weight value is used as the second value. The sum of the first and second values is used as the target concave angle value. Optionally, the average of the second and third concave angle values is determined as the target concave angle value.
[0166] For easier understanding, please refer to Figure 6 ,like Figure 6 As shown, based on the predicted sample, the first reference sample R1 can be determined using the first prediction angle corresponding to the prediction block. Figure 6 As shown in the figure, the reference sample R2 pointed to by the dashed line is the position of the second reference sample determined in the existing PDPC method. It can be seen that in the existing PDPC method, the predicted sample, the first reference sample, and the second reference sample are located on the same straight line.
[0167] In this embodiment, after obtaining the target contraangle value, the position of the second reference sample can be corrected based on this target contraangle value, such as... Figure 6 As shown, the corrected second reference sample is reference sample R3, indicated by the solid line in the figure. Then, based on the first reference sample and the corrected second reference sample, the predicted sample is further corrected.
[0168] Optionally, the preset conditions include any one of the following:
[0169] The index corresponding to the first angle prediction mode is less than the first preset index, the index corresponding to the first angle prediction mode is different from the third preset index, the index corresponding to the second angle prediction mode is greater than the second preset index, and the target scaling factor is greater than or equal to the third preset value.
[0170] The index corresponding to the first angle prediction mode is greater than the second preset index, the index corresponding to the second angle prediction mode is less than the first preset index, the index corresponding to the second angle prediction mode is different from the third preset index, and the target scaling factor is greater than or equal to the third preset value.
[0171] Optionally, the first preset index is 18, the second preset index is 50, and the third preset index is 0 and 1.
[0172] After obtaining the index corresponding to the first angle prediction mode and the index corresponding to the second angle prediction mode, if any of the following conditions are met, it can be determined that the first angle prediction mode and the second angle prediction mode meet the preset conditions.
[0173] One scenario is that the index corresponding to the first angle prediction mode is less than 18, and the index corresponding to the first angle prediction mode is not equal to 0 or 1; the index corresponding to the second angle prediction mode is greater than 50; and the target scaling factor is greater than or equal to a third preset value, optionally, the aforementioned third preset value is 0.
[0174] Specifically, when the scaling factor is calculated first and then the target contraangle value is calculated, the aforementioned target scaling factor is the scaling factor calculated using the first contraangle value, i.e., the contraangle value corresponding to the first angle prediction mode. When the target contraangle value is calculated first and then the scaling factor is calculated, the aforementioned target scaling factor is the scaling factor calculated using the target contraangle value.
[0175] Another scenario is: the index corresponding to the first angle prediction mode is greater than 50; the index corresponding to the second angle prediction mode is less than 18, and the index corresponding to the second angle prediction mode is not equal to 0 or 1; and the target scaling factor is greater than or equal to the third preset value.
[0176] Optionally, the preset conditions include any one of the following:
[0177] The index corresponding to the first angle prediction mode is less than the first preset index, the index corresponding to the first angle prediction mode is different from the third preset index, and the target scaling factor is greater than or equal to the third preset value.
[0178] The index corresponding to the first angle prediction mode is greater than the second prediction index, and the target scaling factor is greater than or equal to the third preset value.
[0179] If any of the following conditions are met, it can be determined that the first angle prediction mode and the second angle prediction mode meet the preset conditions.
[0180] As mentioned above, the first preset index is 18, the second preset index is 50, and the third preset index is 0 and 1.
[0181] One scenario is that the index corresponding to the first prediction angle prediction mode is less than 18, the index corresponding to the first prediction angle prediction mode is not 0 or 1, and the target scaling factor is greater than or equal to 0.
[0182] Another scenario is that the index corresponding to the first prediction angle prediction mode is greater than 50, and the target scaling factor is greater than or equal to 0.
[0183] Optionally, modifying the predicted sample using the target reference sample, the scaling factor, and the target contraangle value includes:
[0184] The target variable is obtained using the target reference sample, the scaling factor, and the target inflection angle value;
[0185] The target variable is used to modify the predicted sample.
[0186] In this embodiment, the coordinates, scaling factor, and target inflection angle of the target reference sample can be substituted into the relevant pseudocode for calculating the target variables refL[x][y], refT[x][y], wT[y], and wL[x] to obtain the target variables.
[0187] Furthermore, by substituting the target variable and the coordinates of the predicted sample into the aforementioned pseudocode for modifying the predicted sample, the modified predicted sample is obtained.
[0188] Optionally, modifying the predicted sample using the target variable includes:
[0189] The target reference sample is subjected to linear interpolation filtering to adjust the target variable;
[0190] The predicted sample is modified using the adjusted target variable.
[0191] In this embodiment, 2-tap linear interpolation filtering can also be introduced to perform linear interpolation filtering on the target reference sample in order to adjust the value of the target variable.
[0192] First, determine the reference sample arrays mainRef[x] and sideRef[y]:
[0193] mainRef[x] = p[x][-1]
[0194] sideRef[y] = p[-1][y]
[0195] Wherein, mainRef[x] is the coordinate of the predicted sample mapped onto the reference sample above the prediction block, and sideRef[y] is the coordinate of the predicted sample mapped onto the reference sample to the left of the prediction block.
[0196] Specifically, when the index corresponding to the first-angle prediction mode is less than 18 and the scaling factor is greater than or equal to 0, the target variable can be calculated using the following pseudocode:
[0197] dXPos[y]=((y+1)*invAngle+4)>>3
[0198] dXFrac[y]=dXPos[y]&63
[0199] dXInt[y]=dXPos[y]>>6
[0200] dX[x][y]=x+dXInt[y]
[0201] Wherein, variable dXPos[y] is the position of the reference sample above the prediction block in the reconstructed image above, expressed with 1 / 64 positional precision; variable dXFrac[y] is the fractional part of the position of the reference sample above the prediction block in the reconstructed image above, expressed with 1 / 64 positional precision; invAngle is the inverse angle value corresponding to the prediction block; dXInt[y] represents the offset value of the X coordinate of the reference sample above the prediction block relative to the X coordinate of the prediction sample; and variable dX[x][y] is used to determine the position of the reference sample above the prediction block.
[0202] refL[x][y]=0
[0203] refT[x][y]=(y<(3<<nScale))?((64-dXFrac[y])*mainRef[dX[x][y]]+dXFrac[y]*mainRef[dX[x][y]+1]+32)> >6): 0
[0204] wT[y]=32>>((y<1)>>nScale)
[0205] wL[x]=0
[0206] Where nScale is the scaling factor.
[0207] Specifically, when the index corresponding to the first-angle prediction mode is greater than 50 and the scaling factor is greater than or equal to 0, the target variable can be calculated using the following pseudocode:
[0208] dYPos[x]=((x+1)*invAngle+4)>>3
[0209] dYFrac[x] = dYPos[x] & 63
[0210] dYInt[x] = dYPos[x] >> 6
[0211] dY[x][y] = y + dYInt[x]
[0212] Wherein, variable dYPos[x] is the position of the reference sample to the left of the prediction block in the reconstructed image on the left, expressed with 1 / 64 positional precision; variable dYFrac[x] is the fractional part of the position of the reference sample to the left of the prediction block in the reconstructed image on the left, expressed with 1 / 64 positional precision; variable dYInt[x] represents the offset of the Y coordinate of the reference sample to the left of the prediction block relative to the Y coordinate of the prediction sample; variable dY[x][y] is used to determine the position of the reference sample to the left of the prediction block, and invAngle is the inverse angle value corresponding to the prediction block.
[0213] refL[x][y]=(x<(3<<nScale))?((64-dYFrac[x])*sideRef[dY[x][y]]+dYFrac[x]*sideRef[dY[x][y]+1]+32)> >6): 0
[0214] refT[x][y]=0
[0215] wT[y]=0
[0216] wL[x]=32>>((x<1)>>nScale)
[0217] Where nScale is the scaling factor.
[0218] After obtaining the adjusted target variable, the adjusted target variable and the coordinates of the predicted sample are input into the relevant pseudocode to modify the predicted sample, thus obtaining the modified predicted sample.
[0219] like Figure 7 As shown, the decoder 200 includes:
[0220] The first determining module 201 is used to determine the prediction sample corresponding to the prediction block based on the angle prediction mode corresponding to the prediction block.
[0221] Processing module 202 is used to modify the prediction sample using position-dependent intra-prediction combination (PDPC) to generate a modified prediction sample.
[0222] The processing module 202 includes:
[0223] The acquisition module 2021 is used to acquire the texture information of the reference sample set corresponding to the first angle prediction mode;
[0224] The second determining module 2022 is used to determine the second angle prediction mode based on the texture information;
[0225] Modification module 2023 is used to modify the prediction sample according to the target reference sample corresponding to the second angle prediction mode.
[0226] Optionally, the acquisition module 2021 is specifically used for:
[0227] If the index corresponding to the first angle prediction mode is less than the first preset index, texture analysis is performed on at least some pixels in the reconstructed image located above and adjacent to the prediction block to obtain the texture information.
[0228] When the index corresponding to the first angle prediction mode is greater than the second preset index, at least some pixels in the reconstructed image located to the left of the prediction block and adjacent to the prediction block are subjected to texture analysis processing to obtain the texture information.
[0229] Optionally, the acquisition module 2021 is further specifically used for:
[0230] When the index corresponding to the first angle prediction mode is less than the first preset index, the texture information is obtained based on the intra-frame prediction mode corresponding to the decoded block located above and adjacent to the prediction block.
[0231] When the index corresponding to the first angle prediction mode is greater than the second preset index, the texture information is obtained based on the intra-frame prediction mode corresponding to the decoded block located to the left of the prediction block and adjacent to the prediction block.
[0232] Optionally, the modification module 2023 is specifically used for:
[0233] Based on the first prediction angle corresponding to the first angle prediction mode and the second prediction angle corresponding to the second angle prediction mode, determine the scaling factor and the target converse angle value;
[0234] The predicted sample is modified using the target reference sample, the scaling factor, and the target contra-angle value.
[0235] Optionally, the modification module 2023 is further specifically used for:
[0236] The scaling factor is determined using the first contra-angle value corresponding to the first angle prediction mode;
[0237] The target contra-angle value is determined based on the first angle prediction mode and the second angle prediction mode.
[0238] Optionally, the modification module 2023 is further specifically used for:
[0239] The target contraangle value is determined based on the first angle prediction mode and the second angle prediction mode;
[0240] The scaling factor is determined using the target contra-angle value.
[0241] Optionally, the modification module 2023 is further specifically used for:
[0242] If the first angle prediction mode and the second angle prediction mode do not meet the preset conditions, the result of the division of the first preset value and the first offset value is rounded to obtain the target contra-angle value.
[0243] When the first angle prediction mode and the second angle prediction mode meet the preset conditions, the target contra-angle value is obtained according to the second offset value and the second preset value.
[0244] Optionally, the modification module 2023 is further specifically used for:
[0245] The target contra-angle value is obtained by shifting the second offset value and the second preset value to the left.
[0246] Optionally, the modification module 2023 is further specifically used for:
[0247] The second offset value and the second preset value are shifted to the left to obtain the second inverse angle value;
[0248] The result of dividing the first preset value and the first offset value is rounded to obtain the third reverse angle value;
[0249] The second and third concave angle values are weighted and summed to determine the target concave angle value.
[0250] Optionally, the modification module 2023 is further specifically used for:
[0251] The target variable is obtained using the target reference sample, the scaling factor, and the target inflection angle value;
[0252] The target variable is used to modify the predicted sample.
[0253] Optionally, the modification module 2023 is further specifically used for:
[0254] The target reference sample is subjected to linear interpolation filtering to adjust the target variable;
[0255] The predicted sample is modified using the adjusted target variable.
[0256] The decoder provided in this application embodiment can achieve... Figure 4 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0257] It should be noted that the intra-frame prediction method provided in this application embodiment can be executed by a decoder, or by a control module in the decoder for executing the intra-frame prediction method. This application embodiment uses the decoder executing the intra-frame prediction method as an example to illustrate the decoder provided in this application embodiment.
[0258] In this embodiment, texture information of the reference sample set corresponding to the first angle prediction mode is obtained, and a second angle prediction mode is determined based on the texture information. The prediction angle corresponding to the second angle prediction mode is then determined as the second prediction angle; instead of adding or subtracting 180 degrees from the first prediction angle corresponding to the first angle prediction mode to obtain the second prediction angle. Furthermore, the prediction sample is modified according to the target reference sample corresponding to the second angle prediction mode, thereby using the second angle prediction mode determined based on texture information to modify the prediction sample, which improves the accuracy of the modified prediction sample.
[0259] The decoder in this application embodiment can be a device, a device or electronic device with an operating system, or a component, integrated circuit, or chip in a terminal. The device or electronic device can be a mobile terminal or a non-mobile terminal. For example, a mobile terminal can include, but is not limited to, the types of terminals 11 listed above, while a non-mobile terminal can be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not impose specific limitations.
[0260] The decoder provided in this application embodiment can achieve... Figure 4The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0261] Optionally, such as Figure 8 As shown, this application embodiment also provides a communication device 300, including a processor 301, a memory 302, and a program or instructions stored in the memory 302 and executable on the processor 301. For example, when the communication device 300 is a terminal, the program or instructions executed by the processor 301 implement the various processes of the above-described intra-frame prediction method embodiment and achieve the same technical effect.
[0262] This terminal embodiment corresponds to the aforementioned terminal-side method embodiment. All implementation processes and methods of the aforementioned method embodiments can be applied to this terminal embodiment and achieve the same technical effect. Specifically, Figure 9 A schematic diagram of the hardware structure of a terminal to implement an embodiment of this application.
[0263] The terminal 1000 includes, but is not limited to, the following components: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
[0264] Those skilled in the art will understand that the terminal 1000 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 9 The terminal structure shown does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0265] It should be understood that, in this embodiment, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The GPU 10041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1006 may include a display panel 10061, which may be configured as a liquid crystal display, organic light-emitting diode, or the like. The user input unit 1007 includes a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0266] In this embodiment, the radio frequency unit 1001 receives downlink data from the network-side device and processes it for the processor 1010; additionally, it sends uplink data to the network-side device. Typically, the radio frequency unit 1001 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc.
[0267] The memory 1009 can be used to store software programs or instructions and various data. The memory 1009 may primarily include a program or instruction storage area and a data storage area. The program or instruction storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1009 may include high-speed random access memory and non-volatile memory, wherein the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. For example, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0268] Processor 1010 may include one or more processing units; optionally, processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications or instructions, and the modem processor mainly handles wireless communication, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1010.
[0269] The processor 1010 is the processor in the terminal described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0270] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described intra-frame prediction method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0271] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0272] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0273] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0274] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for intra-frame prediction, characterized in that, include: Based on the angle prediction mode corresponding to the prediction block, the prediction sample corresponding to the prediction block is determined; The prediction samples are modified using the location-dependent intra-prediction combination PDPC to generate modified prediction samples. The modification of the prediction sample using location-related intra-frame prediction combinations includes: The texture information of the reference sample set corresponding to the first angle prediction mode is obtained. The first angle prediction mode is the angle prediction mode corresponding to the prediction block. The reference sample set includes at least one reference sample. The texture information includes the gradient histogram generated by exporting the intra-prediction mode DIMD at the decoding end, or the angle prediction mode corresponding to the decoded block adjacent to the prediction block. The second angle prediction mode is determined based on the texture information; The prediction sample is modified based on the target reference sample corresponding to the second angle prediction mode.
2. The method according to claim 1, characterized in that, The process of obtaining the texture information of the reference sample set corresponding to the first angle prediction mode includes: If the index corresponding to the first angle prediction mode is less than the first preset index, perform texture analysis on the first reference sample set located above the prediction block to obtain the texture information. When the index corresponding to the first angle prediction mode is greater than the second preset index, texture analysis processing is performed on the second reference sample set located to the left of the prediction block to obtain the texture information. Wherein, the first reference sample set consists of at least a portion of the pixels in the reconstructed image adjacent to the prediction block, and the second reference sample set consists of at least a portion of the pixels in the reconstructed image adjacent to the prediction block.
3. The method according to claim 1, characterized in that, The process of obtaining the texture information of the reference sample set corresponding to the first angle prediction mode includes: When the index corresponding to the first angle prediction mode is less than the first preset index, the texture information is obtained based on the intra-frame prediction mode corresponding to the decoded block located above and adjacent to the prediction block. When the index corresponding to the first angle prediction mode is greater than the second preset index, the texture information is obtained based on the intra-frame prediction mode corresponding to the decoded block located to the left of the prediction block and adjacent to the prediction block.
4. The method according to any one of claims 1-3, characterized in that, The step of modifying the prediction sample according to the target reference sample corresponding to the second angle prediction mode includes: Based on the first prediction angle corresponding to the first angle prediction mode and the second prediction angle corresponding to the second angle prediction mode, determine the scaling factor and the target converse angle value; The predicted sample is modified using the target reference sample, the scaling factor, and the target contra-angle value.
5. The method according to claim 4, characterized in that, The step of determining the scaling factor and the target contra-angle value based on the first prediction angle corresponding to the first angle prediction mode and the second prediction angle corresponding to the second angle prediction mode includes: The scaling factor is determined using the first contra-angle value corresponding to the first predicted angle; The target contraangle value is determined based on the first predicted angle and the second predicted angle.
6. The method according to claim 4, characterized in that, The step of determining the scaling factor and the target contra-angle value based on the first prediction angle corresponding to the first angle prediction mode and the second prediction angle corresponding to the second angle prediction mode includes: The target contraangle value is determined based on the first predicted angle and the second predicted angle; The scaling factor is determined using the target contra-angle value.
7. The method according to claim 5 or 6, characterized in that, Determining the target contraangle value based on the first predicted angle and the second predicted angle includes: If the first angle prediction mode and the second angle prediction mode do not meet the preset conditions, the result of dividing the first preset value and the first offset value is rounded to obtain the target contra-angle value; the first offset value corresponds to the first angle prediction mode. When the first angle prediction mode and the second angle prediction mode meet the preset conditions, the target reverse angle value is obtained according to the second offset value and the second preset value; the second offset value corresponds to the second angle prediction mode.
8. The method according to claim 7, characterized in that, The step of obtaining the target contraangle value based on the second offset value and the second preset value includes: The target contra-angle value is obtained by shifting the second offset value and the second preset value to the left.
9. The method according to claim 7, characterized in that, The step of obtaining the target contraangle value based on the second offset value and the second preset value includes: The second offset value and the second preset value are shifted to the left to obtain the second inverse angle value; The result of dividing the first preset value and the first offset value is rounded to obtain the third reverse angle value; The second and third concave angle values are weighted and summed to determine the target concave angle value.
10. The method according to claim 7, characterized in that, The preset conditions include any one of the following: The index corresponding to the first angle prediction mode is less than the first preset index, the index corresponding to the first angle prediction mode is different from the third preset index, the index corresponding to the second angle prediction mode is greater than the second preset index, and the target scaling factor is greater than or equal to the third preset value; the third preset index is less than the first preset index, and the target scaling factor is a scaling factor calculated using the first contra-angle value, or a scaling factor calculated using the target contra-angle value. The index corresponding to the first angle prediction mode is greater than the second preset index, the index corresponding to the second angle prediction mode is less than the first preset index, the index corresponding to the second angle prediction mode is different from the third preset index, and the target scaling factor is greater than or equal to the third preset value.
11. The method according to claim 7, characterized in that, The preset conditions include any one of the following: The index corresponding to the first angle prediction mode is less than the first preset index, the index corresponding to the first angle prediction mode is different from the third preset index, and the target scaling factor is greater than or equal to the third preset value. The index corresponding to the first angle prediction mode is greater than the second preset index, and the target scaling factor is greater than or equal to the third preset value.
12. The method according to claim 4, characterized in that, Modifying the predicted sample using the target reference sample, the scaling factor, and the target inflection angle value includes: The target variable is obtained using the target reference sample, the scaling factor, and the target inflection angle value; The target variable is used to modify the predicted sample.
13. The method according to claim 12, characterized in that, The step of using the target variable to modify the predicted sample includes: The target reference sample is subjected to linear interpolation filtering to adjust the target variable; The predicted sample is modified using the adjusted target variable.
14. A decoder, characterized in that, include: The first determining module is used to determine the prediction sample corresponding to the prediction block based on the angle prediction mode corresponding to the prediction block. The processing module is used to modify the prediction sample using location-dependent intra-prediction combination (PDPC) to generate the modified prediction sample. The processing module includes: The acquisition module is used to acquire the texture information of the reference sample set corresponding to the first angle prediction mode. The first angle prediction mode is the angle prediction mode represented by the angle prediction mode corresponding to the prediction block. The reference sample set includes at least one reference sample. The texture information includes the gradient histogram generated by exporting the intra-prediction mode DIMD from the decoder, or the angle prediction mode corresponding to the decoded block adjacent to the prediction block. The second determining module is used to determine the second angle prediction mode based on the texture information; The modification module is used to modify the prediction sample based on the target reference sample corresponding to the second angle prediction mode.
15. A terminal, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the intra-frame prediction method as described in any one of claims 1-13.
16. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the intra-frame prediction method as described in any one of claims 1-13.