Intra prediction method, encoding method, decoding method and apparatus
Patent Information
- Application Number
- CN202211462464.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-11-21
AI Technical Summary
本申请的发明人在长期的研发过程中,发现目前帧内预测方法还存在一定的局限性,也在一定程度上影响了帧内预测效果
[0043]本申请帧内预测方法基于候选列表中每个预测模式对应的划分方式,对当前块进行划分,得到当前块对应于每个预测模式的划分结果;然后对当前块对应于每个预测模式的划分结果中每个子块进行预测,以得到当前块对应于每个预测模式的预测块;进而基于当前块的所有预测块,确定出当前块的最佳预测模式。如此,在本实施方式中,在遍历预测模式候选列表中预测模式时利用各个预测模式对应的划分方式对当前块进行划分,如此当前块的划分方式上更加灵活多变,便于更好地适应实际图像内容,从而便于提升压缩效率;并且将预测模式和划分方式相对应,可以在以相应预测模式进行预测时,采用与预测模式相适配的划分方式对当前块进行划分,以便提高预测效果。
Smart Images

Figure CN116074519B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image encoding and decoding technology, and in particular to an intra-frame prediction method, a method for encoding video or images, and a method and apparatus for decoding video or image bitstreams. Background Technology
[0002] Because video image data is relatively large, it usually needs to be encoded and compressed. The compressed data is called a video stream. The video stream is transmitted to the user's end via wired or wireless network for decoding and viewing.
[0003] The entire video encoding process includes prediction, transform, quantization, and entropy coding. Prediction is divided into intra-frame prediction and inter-frame prediction. During their long-term research and development, the inventors of this application discovered that current intra-frame prediction methods have certain limitations, which also affect the effectiveness of intra-frame prediction to some extent. Summary of the Invention
[0004] This application provides an intra-frame prediction method, a method for encoding video or images, a method and apparatus for decoding video or image bitstreams, which can improve prediction performance.
[0005] To achieve the above objectives, this application provides an intra-frame prediction method, which includes:
[0006] Construct a candidate list of intra-prediction modes for the current block;
[0007] Based on the partitioning method corresponding to each prediction mode in the candidate list, the current block is partitioned to obtain the partitioning result of the current block corresponding to each prediction mode;
[0008] For each prediction mode, predict all sub-blocks in the partitioning result to obtain the prediction block corresponding to each prediction mode for the current block;
[0009] Based on the prediction blocks corresponding to all prediction modes for the current block, determine the best prediction mode for the current block.
[0010] In one embodiment, the current block is divided based on the partitioning method corresponding to each prediction mode in the candidate list, to obtain the partitioning result of the current block corresponding to each prediction mode;
[0011] Determine the partitioning direction corresponding to each prediction pattern;
[0012] Divide the current block into at least two sub-blocks along the dividing direction.
[0013] In one embodiment, dividing the current block into at least two sub-blocks along the partitioning direction includes:
[0014] Divide the current block into at least two sub-blocks along the dividing direction according to a preset ratio.
[0015] In one embodiment, prediction is performed on all sub-blocks in the partitioning result of each prediction mode to obtain the prediction block corresponding to each prediction mode for the current block, including:
[0016] Based on the gradient information of the neighboring reconstructed pixels of each sub-block in at least a portion of the sub-blocks in the partitioning results of each prediction mode, the prediction mode of each sub-block is determined.
[0017] Each sub-block is predicted using its own prediction pattern to obtain the prediction block for the current block corresponding to each prediction pattern.
[0018] In one embodiment, determining the prediction mode of each sub-block based on the gradient information of the neighboring reconstructed pixels of each sub-block in at least a portion of the sub-blocks in the partitioning result of each prediction mode includes:
[0019] Calculate the horizontal and vertical gradients of each adjacent reconstructed pixel in each sub-block;
[0020] The gradient angle and magnitude of each adjacent reconstructed pixel are derived based on the horizontal and vertical gradients of each adjacent reconstructed pixel.
[0021] The gradient angle is converted into the corresponding prediction mode to determine the prediction mode corresponding to each adjacent reconstructed pixel;
[0022] The prediction modes corresponding to all adjacent reconstructed pixels of each sub-block are statistically analyzed to determine the prediction mode with the highest amplitude in each sub-block, and the prediction mode with the highest amplitude in each sub-block is taken as the prediction mode of each sub-block.
[0023] In one embodiment, prediction is performed on all sub-blocks in the partitioning result of each prediction mode to obtain the prediction block corresponding to each prediction mode for the current block, including:
[0024] Based on the order of sub-blocks in the partitioning results of each prediction mode, gradually shift by a certain angle on each prediction mode to determine the prediction mode corresponding to each sub-block in the partitioning results of each prediction mode; predict each sub-block using the prediction mode corresponding to each sub-block to obtain the prediction block corresponding to each prediction mode for the current block; or,
[0025] For each prediction mode, each sub-block is predicted based on the neighboring reference pixels of each sub-block in the partitioning result of each prediction mode, so as to obtain the prediction block corresponding to each prediction mode for the current block.
[0026] In one embodiment, constructing a candidate list of intra-prediction modes for the current block includes:
[0027] Construct a candidate list of intra-frame prediction modes based on MPM, TIMD, and / or DIMD tools.
[0028] In one embodiment, an intra-prediction mode candidate list is constructed based on MPM tools, TIMD tools, and / or DIMD tools, including:
[0029] Add at least one intermediate prediction mode of the current block determined by the MPM tool, TIMD tool and / or DIMD tool to the candidate list, and / or add at least one final mode of the current block determined by the MPM tool, TIMD tool and / or DIMD tool to the candidate list to obtain the intra-prediction mode candidate list for the current block.
[0030] To achieve the above objectives, this application also provides a method for encoding video or images, the method comprising:
[0031] The final predicted block of the current block in the image is determined based on the prediction method described above;
[0032] The current block is encoded based on the final predicted block.
[0033] In one embodiment, encoding the current block based on the final predicted block includes:
[0034] Set the value of a preset syntax element in the encoded bitstream, where different values of the preset syntax element represent whether the prediction method is enabled.
[0035] In one embodiment, encoding the current block based on the final predicted block includes:
[0036] The index information of the prediction mode corresponding to the final prediction block in the intra-frame prediction mode candidate list is encoded to obtain the encoded bitstream.
[0037] To achieve the above objectives, this application also provides a method for decoding video or image bitstreams, the method comprising:
[0038] The final predicted block of the current block in the image is determined based on the prediction method described above;
[0039] Decode the current block based on the final predicted block.
[0040] To achieve the above objectives, this application also provides a decoder, which includes a processor; the processor is used to execute instructions to implement the steps of the above method.
[0041] To achieve the above objectives, this application also provides an encoder that includes a processor; the processor is configured to execute instructions to implement the steps of the above method.
[0042] To achieve the above objectives, this application also provides a computer-readable storage medium for storing instruction / program data that can be executed to implement the above methods.
[0043] The intra-frame prediction method of this application divides the current block based on the partitioning method corresponding to each prediction mode in the candidate list, obtaining the partitioning result of the current block corresponding to each prediction mode; then, it predicts each sub-block in the partitioning result of the current block corresponding to each prediction mode to obtain the prediction block of the current block corresponding to each prediction mode; and finally, based on all the prediction blocks of the current block, it determines the best prediction mode for the current block. Thus, in this embodiment, when traversing the prediction mode candidate list, the partitioning method corresponding to each prediction mode is used to divide the current block, making the partitioning method of the current block more flexible and adaptable to the actual image content, thereby improving compression efficiency; and by corresponding the prediction mode and the partitioning method, when predicting with the corresponding prediction mode, the partitioning method adapted to the prediction mode can be used to divide the current block, so as to improve the prediction effect. Attached Figure Description
[0044] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0045] Figure 1 This is a schematic diagram of a partitioning method used in an intra-frame prediction method;
[0046] Figure 2 This is a schematic diagram of another partitioning method used in an intra-frame prediction method;
[0047] Figure 3 This is a flowchart illustrating one embodiment of the intra-frame prediction method of this application;
[0048] Figure 4 This is a schematic diagram of a partitioning method used in the intra-frame prediction method of this application;
[0049] Figure 5 This is a schematic diagram of another partitioning method used in the intra-frame prediction method of this application;
[0050] Figure 6 This is a schematic diagram of another partitioning method used in the intra-frame prediction method of this application;
[0051] Figure 7 This is a schematic diagram of another partitioning method used in the intra-frame prediction method of this application;
[0052] Figure 8This is a schematic diagram of another partitioning method used in the intra-frame prediction method of this application;
[0053] Figure 9 This is a flowchart illustrating one embodiment of the method for encoding video or images according to this application;
[0054] Figure 10 This is a flowchart illustrating one embodiment of the method for decoding video or image streams according to this application;
[0055] Figure 11 This is a schematic diagram of one embodiment of the encoder of this application;
[0056] Figure 12 This is a schematic diagram of the structure of one embodiment of the decoder of this application;
[0057] Figure 13 This is a schematic diagram of one embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application. In addition, unless otherwise specified (e.g., "or additionally" or "or in alternatives"), the term "or" as used herein refers to a non-exclusive "or" (i.e., "and / or"). Furthermore, the various embodiments described herein are not necessarily mutually exclusive, as some embodiments can be combined with one or more other embodiments to form new embodiments.
[0059] An intra-frame prediction method includes two processes: constructing a candidate list of prediction modes and making a prediction mode decision.
[0060] (1) Construction of the candidate list for prediction model
[0061] First, an empty candidate list is constructed. Then, candidate prediction modes are added in three stages: initial coarse selection, secondary coarse selection, and MPM (Most Probable Mode) addition.
[0062] Initial coarse selection stage: Calculate the Hada code cost of the prediction patterns for 0, 1 and even numbered patterns. According to the order of Hada code cost from low to high, only the 3 lowest prediction patterns are retained in the candidate list.
[0063] Secondary coarse selection stage: Calculate the Hada code cost of the adjacent angle prediction modes of the angle prediction mode selected in the initial coarse selection (mode number is greater than 0 and less than 66). According to the order of Hada code cost from low to high, the candidate list only retains the 3 prediction modes with the lowest Hada code cost in the initial coarse selection stage and the secondary coarse selection stage.
[0064] MPM Addition Phase: An MPM list is constructed using adjacent coded blocks, and the predicted modes from the MPM list are added to the candidate list. If a predicted mode in the MPM list is already in the candidate list, it is not added.
[0065] (2) Predictive model decision-making
[0066] By comparing the rate-distortion costs of each prediction mode in the candidate list, the prediction mode with the lowest rate-distortion cost is selected as the final prediction mode.
[0067] In addition, during the prediction mode decision-making process, the current coded block needs to be divided into multiple sub-blocks. The division rules include the division conditions, division direction, and method, as follows:
[0068] 1) Partitioning criteria: Sub-blocks are only divided for coded blocks with sizes between 4x4 and 64x64. Sub-blocks are not divided for other sizes. Specifically, coded blocks of 4x8 and 8x4 are divided into 2 sub-blocks, and coded blocks of other sizes are divided into 4 sub-blocks.
[0069] 2) Division direction and method: such as Figure 1 and Figure 2 The diagram illustrates the division direction and method for sub-blocks of CU blocks of different sizes. The division direction is either vertical or horizontal, and the division method is uniform. Each coding block can only be divided once; vertical and horizontal divisions cannot be performed simultaneously within the same division. Each sub-block has the same size, and each sub-block contains a minimum of 16 pixels (width * height >= 16).
[0070] In particular, each sub-block uses the same prediction pattern.
[0071] It can be seen that the current block division method in the above intra-frame prediction method is relatively simple and has limitations on the size of the application, which is not conducive to improving coding efficiency.
[0072] Based on this, this application proposes a novel intra-frame prediction method. This method divides the current block based on the partitioning method corresponding to each prediction mode in the candidate list, obtaining a partitioning result for the current block corresponding to each prediction mode. Then, it predicts each sub-block in the partitioning result for each prediction mode to obtain a prediction block for the current block corresponding to each prediction mode. Finally, based on all prediction blocks of the current block, it determines the optimal prediction mode for the current block. Thus, in this embodiment, when traversing the prediction mode candidate list, the current block is partitioned using the partitioning method corresponding to each prediction mode. This makes the partitioning method of the current block more flexible and adaptable, better suited to the actual image content, thereby improving compression efficiency. Furthermore, by corresponding the prediction mode with the partitioning method, when predicting with the corresponding prediction mode, a partitioning method adapted to the prediction mode can be used to partition the current block, thereby improving the prediction effect.
[0073] Specifically, such as Figure 3 As shown, the novel intra-frame prediction method proposed in this application specifically includes the following steps. It should be noted that the step numbers are for simplification only and are not intended to limit the execution order of the steps. The execution order of each step in this embodiment can be arbitrarily changed without departing from the technical concept of this application.
[0074] S101: Construct a candidate list of intra-prediction modes for the current block.
[0075] We can first construct a candidate list of intra-prediction modes for the current block, so that we can traverse each prediction mode in the candidate list later, and then determine the best prediction mode for the current block based on the traversal results.
[0076] There are several methods for constructing the intra-prediction mode candidate list for the current block, and no specific restrictions are imposed here.
[0077] In the first feasible approach, an intra-prediction mode candidate list for the current block can be constructed based on tools such as MPM, TIMD, and / or DIMD. This allows for a more flexible and complex approach to constructing the prediction mode candidate list, enriching the diversity of prediction modes. Furthermore, incorporating prior information (e.g., utilizing existing modes from existing intra-tools) during candidate list construction can effectively improve compression efficiency. Specifically, at least one intermediate prediction mode and / or at least one final mode from tools such as MPM, TIMD, and / or DIMD can be added to the candidate list to obtain the intra-prediction mode candidate list for the current block. The order in which the tools are added is not restricted. More preferably, redundant modes between tools can be removed during candidate list construction to avoid multiple identical prediction modes existing in the candidate list.
[0078] Preferably, when adding a subset of intermediate / final prediction modes of the current block determined by a tool (e.g., MPM, DIMD, or TIMD) to the candidate list, these added modes are at least one of the highest-ranking intermediate / final prediction modes of the current block determined by that tool. This allows for the addition of superior prediction modes determined by each tool to the candidate list, thereby improving prediction efficiency and effectiveness. For example, when adding a subset of intermediate prediction modes of the current block determined by the DIMD tool to the candidate list, the gradient magnitude of these added modes is greater than the gradient magnitude of the remaining modes not added to the candidate list.
[0079] In the first specific example, the final mode of the MPM tool for the current block can be added to the candidate list of prediction modes. Assuming the final mode of the MPM tool for the current block is 16, the candidate list constructed in step S101 can be {16}.
[0080] In the second specific example, the final patterns of the MPM, TIMD, and DIMD tools for the current block can be added to the candidate list of prediction patterns. Assuming the final pattern of the MPM tool for the current block is 16, the final patterns of the TIMD tool for the current block are 12 and 14, and the final patterns of the DIMD tool for the current block are 36 and 50, then the candidate list constructed in step S101 can be {16, 12, 14, 36, 50}.
[0081] In the third specific example, the final mode of the MPM for the current block, the first final mode of TIMD, and the final mode of the DIMD tool can be added to the candidate list of prediction modes. Assuming the final mode of the MPM tool for the current block is 16, the final modes of the TIMD tool for the current block are 12 and 14, and the final modes of the DIMD tool for the current block are 36 and 50, then the candidate list constructed in step S101 can be {16, 12, 36, 50}.
[0082] In the fourth specific example, the intermediate prediction patterns of the MPM tool for the current block, the first 6 intermediate prediction patterns of the TIMD tool, and the first 6 intermediate prediction patterns of the DIMD tool can be added to the prediction pattern candidate list. Assuming the intermediate prediction patterns of the MPM tool for the current block are {12, 16, 32, 18, 0, 1}, the first 6 intermediate prediction patterns of the TIMD tool for the current block are {12, 16, 32, 19, 20, 22}, and the first 6 intermediate prediction patterns of the DIMD tool for the current block are {36, 50, 20, 14, 24, 0}, then the candidate list constructed in step S101 can be {12, 16, 32, 18, 0, 1, 19, 20, 22, 36, 50, 14, 24}.
[0083] In the fifth specific example, the top three intermediate prediction patterns of the MPM tool and the top three intermediate prediction patterns of the DIMD tool for the current block can be added to the prediction pattern candidate list. Assuming the top three intermediate prediction patterns of the MPM tool for the current block are {12, 16, 32} and the top three intermediate prediction patterns of the DIMD tool for the current block are {36, 50, 20}, then the candidate list constructed in step S101 can be {12, 16, 32, 36, 50, 20}.
[0084] In the sixth specific example, all intermediate prediction modes of the MPM tool, all final modes of TIMD, and all final modes of DIMD for the current block can be added to the candidate list. Assuming the intermediate prediction modes of the MPM tool for the current block are {12, 16, 32, 18, 0, 1}, the final modes of the TIMD tool for the current block are 12, 14, and the final modes of the DIMD tool for the current block are 36, 50, then the candidate list constructed in step S101 can be {12, 16, 32, 18, 0, 1, 19, 20, 22, 36, 50, 14, 24}.
[0085] Optionally, the MPM tool can construct an MPM list from adjacent coded blocks to determine the intermediate and final prediction modes of the MPM. Optionally, intra-prediction modes from adjacent coded blocks can be added to the MPM list of the current block, where the intermediate prediction modes of the MPM refer to all intra-prediction modes in the MPM list of the current block, and the final prediction mode of the MPM refers to at least one intra-prediction mode selected from all intra-prediction modes in the MPM list by cost or index, etc.
[0086] For example, the cost of each intra-prediction mode in the MPM list can be calculated, and the intra-prediction mode with the lowest cost can be selected from all intra-prediction modes in the MPM list as the final mode of the MPM tool.
[0087] The index order of intra-prediction modes in the MPM list is related to the cost of the intra-prediction modes. Preferably, the index of the intra-prediction mode in the MPM list is positively correlated with the cost of the intra-prediction mode. That is, the lower the cost of an intra-prediction mode, the lower its index in the MPM list. In this way, the intra-prediction mode with the smallest index in the MPM list can be directly used as the final mode of the MPM tool.
[0088] The TIMD tool can generate several prediction modes based on template costs. Optionally, the intermediate prediction modes of the TIMD tool can refer to all prediction modes generated by TIMD. The final mode of the TIMD tool can refer to at least one intra-frame prediction mode selected from all intermediate prediction modes of TIMD according to template costs, etc. For example, when TIMD generates several prediction modes based on template costs, the prediction modes can be named as TIMD modes from low to high template costs, and the TIMD tool can take the first TIMD mode and the second TIMD mode as its final mode. The details of determining the intermediate prediction modes and the final mode of the TIMD tool can be found in the TIMD prediction mode documentation, and will not be elaborated here.
[0089] Furthermore, the DIMD tool can derive several prediction modes based on gradient magnitudes. Optionally, the intermediate prediction modes of the DIMD tool can refer to all prediction modes generated by DIMD. The final mode of the DIMD tool can refer to at least one intra-frame prediction mode selected from all intermediate prediction modes of DIMD based on cost or gradient magnitude, etc. For example, when DIMD generates several prediction modes based on gradient magnitudes, the prediction modes can be named as DIMD modes from highest to lowest gradient magnitude. The DIMD tool can use the first DIMD mode and the second DIMD mode as its final mode. Details regarding the determination of the intermediate and final prediction modes of the DIMD tool can be found in the DIMD prediction mode documentation and will not be elaborated upon here.
[0090] In the second feasible approach, the candidate list of prediction modes for the current block can be determined through steps such as initial coarse selection and secondary coarse selection.
[0091] The initial coarse selection step can be as follows: calculate the cost of the prediction patterns with 0, 1 and even numbers, and keep only the three lowest-cost prediction patterns in the candidate list in order of cost from low to high.
[0092] Secondary coarse selection stage: Calculate the cost of the adjacent angle prediction modes of the angle prediction mode selected in the initial coarse selection (mode number greater than 0 and less than 66). In order of cost from low to high, the candidate list retains only the 3 prediction modes with the lowest cost in the initial coarse selection stage and the secondary coarse selection stage.
[0093] Optionally, the cost of the prediction model in the above-mentioned initial coarse selection and secondary coarse selection process can be the Hadamard cost of the prediction model or the rate distortion cost of the prediction model, without any limitation.
[0094] In the third feasible approach, a candidate list of prediction modes for the current block can be constructed through initial coarse selection, secondary coarse selection, and additions by tools such as MPM, DIMD, and / or TIMD.
[0095] S102: Based on the partitioning method corresponding to each prediction mode in the candidate list, the current block is partitioned to obtain the partitioning result of the current block corresponding to each prediction mode.
[0096] After constructing the candidate list of intra-prediction modes for the current block, all intra-prediction modes in the candidate list can be traversed to determine the prediction blocks corresponding to each intra-prediction mode for the current block. Optionally, during the traversal of each intra-prediction mode in the candidate list, the current block can be first divided based on the partitioning method corresponding to each prediction mode in the candidate list, so that subsequent predictions can be performed on each sub-block in the partitioning result corresponding to each intra-prediction mode for the current block, thereby obtaining the prediction blocks corresponding to each intra-prediction mode for the current block.
[0097] In one feasible approach, there is a correspondence between the prediction mode and the partitioning direction. Thus, in step S102, the partitioning direction corresponding to each prediction mode can be determined first, and then the current block can be partitioned along the partitioning direction corresponding to each prediction mode.
[0098] It is understandable that there may be a situation where at least one prediction mode corresponds to a partitioning method that does not partition. In this case, the at least one prediction mode has no corresponding partitioning direction. Furthermore, in step S102, since the partitioning method corresponding to the at least one prediction mode is not partitioned, when the currently traversed prediction mode is one of the at least one prediction modes, there is no need to partition the current block, and the partitioning result of the current block corresponding to the currently traversed prediction mode contains only one sub-block (i.e., the current block itself).
[0099] For example, the prediction mode biased towards the vertical direction (e.g., intra-frame prediction modes with mode numbers in the range of 2-33) corresponds to the vertical direction; the prediction mode biased towards the horizontal direction (e.g., intra-frame prediction modes with mode numbers in the range of 34-66) corresponds to the horizontal direction; the DC mode corresponds to no division, that is, the DC mode has no corresponding division direction; the Planar mode corresponds to both horizontal and vertical division directions.
[0100] For example, the prediction mode biased towards the vertical direction (e.g., intra-prediction modes with mode numbers in the range of 2-33) corresponds to the horizontal direction; the prediction mode biased towards the horizontal direction (e.g., intra-prediction modes with mode numbers in the range of 34-66) corresponds to the vertical direction; the Planar mode corresponds to no division, that is, the Planar mode has no corresponding division direction; the DC mode corresponds to both horizontal and vertical division directions.
[0101] In this implementation, dividing the current block along the division direction corresponding to each prediction mode can refer to dividing the current block along the division direction to obtain a preset number of sub-blocks. The preset number can be a fixed value, such as 2 or 4. Alternatively, the preset number can be set according to the actual situation such as the size of the current block, and is not limited here. For example, when the size of the current block is 16*8, the preset number can be 2. Or, for example, when the size of the current block is 32*16, the preset number can be 4.
[0102] In this implementation, dividing the current block along the division direction corresponding to each prediction mode can also refer to dividing the current block into at least two sub-blocks along the division direction according to a preset ratio. The preset ratio can be a fixed value, such as 1:1, 1:2, or 1:3. Alternatively, the preset ratio can be set according to the actual situation such as the size of the current block, and is not limited here. For example, when the size of the current block is 16*8, the preset ratio can be 1:1. Or, for example, when the size of the current block is 32*8, the preset ratio can be 1:1:1:1.
[0103] Optionally, the preset ratios for the horizontal and vertical directions can be the same or different, without restriction. For example, if the current prediction pattern being traversed includes both vertical and horizontal directions, assuming the preset ratio for the horizontal direction is 1:1 and the preset ratio for the vertical direction is also 1:1, then the current block can be divided into two blocks horizontally at a 1:1 ratio, and then further divided into four sub-blocks vertically at a 1:1 ratio. As another example, if the current prediction pattern being traversed includes both vertical and horizontal directions, assuming the preset ratio for the horizontal direction is 1:2 and the preset ratio for the vertical direction is also 1:1:1:1, then the current block can be divided into four blocks vertically at a 1:1:1:1 ratio, and then further divided into eight sub-blocks horizontally at a 1:2 ratio.
[0104] In a specific example, the current block is a 16*16 coded block, and the current prediction mode being traversed is Planar. Planar corresponds to a horizontal and a vertical partitioning direction, with the number and ratio of sub-blocks in the horizontal and vertical directions being 2 and 1:1, respectively. By partitioning the current block along the partitioning direction corresponding to the current prediction mode and according to the preset ratio, we can obtain the following... Figure 4 The division results are shown.
[0105] In another specific example, the current block is a 16*16 coded block, and the current prediction mode being traversed is 18 (biased towards the horizontal direction). The partitioning direction corresponding to 18 is horizontal, and the number and ratio of horizontally partitioned sub-blocks are 4 and 1:1:1:1 respectively. By partitioning the current block along the partitioning direction corresponding to the currently traversed prediction mode and according to the preset ratio, we can obtain the following... Figure 5 The division results are shown.
[0106] In another feasible approach, there is a correspondence between the prediction mode and the partitioning ratio. Thus, in step S102, the partitioning ratio corresponding to each prediction mode can be determined first, and then the current block can be partitioned according to the partitioning ratio corresponding to each prediction mode.
[0107] It is understandable that there may be a situation where at least one prediction mode corresponds to a partitioning method that does not partition. In this case, the at least one prediction mode does not have a corresponding partitioning ratio. Furthermore, in step S102, since the partitioning method corresponding to the at least one prediction mode is not partitioned, when the currently traversed prediction mode is one of the at least one prediction modes, there is no need to partition the current block, and the partitioning result of the current block corresponding to the currently traversed prediction mode contains only one sub-block (i.e., the current block itself).
[0108] For example, the partition ratio for prediction modes biased towards the vertical direction (e.g., intra-prediction modes with mode numbers in the range of 2-33) is 1:1; the partition ratio for prediction modes biased towards the horizontal direction (e.g., intra-prediction modes with mode numbers in the range of 34-66) is 1:3; the partitioning method for DC mode is no partitioning, that is, DC mode has no corresponding partition ratio; and the partition ratio for Planar mode is 2:1.
[0109] In other examples, the horizontal division ratio for prediction modes biased towards the vertical direction (e.g., intra-prediction modes with mode numbers in the range of 2-33) is 1:1:1:1, and the vertical division ratio is 1:2; the horizontal division ratio for prediction modes biased towards the horizontal direction (e.g., intra-prediction modes with mode numbers in the range of 34-66) is 1:2:1; the horizontal division ratio for DC mode is 3:1, and the vertical division ratio is 1:2:1; the division method for Planar mode is no division, that is, Planar mode has no corresponding division ratio.
[0110] Furthermore, the partitioning direction of the current block can be determined before partitioning the current block according to the partitioning ratio corresponding to each prediction mode.
[0111] Optionally, the dividing direction of the current block can be fixed, such as horizontal, vertical, or both horizontal and vertical.
[0112] Alternatively, the dividing direction of the current block can be set based on the size of the current block. For example, when the size of the current block is 16*8, the dividing direction can be vertical. As another example, when the size of the current block is 16*16, the dividing direction can be both horizontal and vertical. Yet another example, when the size of the current block is 32*32, the dividing direction is horizontal.
[0113] Alternatively, the dividing direction of the current block can be set based on the comparison between the width and height of the current block. For example, if the width of the current block is greater than its height, the dividing direction can be vertical. Or, if the height of the current block is greater than its width, the dividing direction can be horizontal. Still, if the width and height of the current block are equal, the dividing direction can be both horizontal and vertical.
[0114] After determining the partitioning ratio corresponding to the currently traversed intra-prediction mode and the partitioning direction of the current block, the current block can be partitioned along the partitioning direction and according to the partitioning ratio corresponding to the currently traversed intra-prediction mode.
[0115] In a specific example, the current block is a 16*16 coded block, the preset ratio corresponding to the currently traversed prediction pattern is 1:1:1:1, and the partitioning direction is a fixed vertical direction. By partitioning the current block along the vertical direction according to the preset ratio corresponding to the currently traversed prediction pattern, we can obtain the following... Figure 6 The division results are shown.
[0116] In another specific example, the current block is a 16*16 coded block. The preset ratio for the horizontal direction corresponding to the currently traversed prediction pattern is 1:3, and the preset ratio for the vertical direction corresponding to the currently traversed prediction pattern is 1:1. The partitioning direction is a fixed horizontal direction. By partitioning the current block horizontally according to the preset ratio for the horizontal direction corresponding to the currently traversed prediction pattern, the following can be obtained: Figure 7 The division results are shown.
[0117] In another possible implementation, there is a correspondence between the prediction mode and the partitioning ratio, and there is also a correspondence between the prediction mode and the partitioning direction. Thus, in step S102, the partitioning ratio and partitioning direction corresponding to each prediction mode can be determined first, and then the current block can be partitioned along the partitioning direction corresponding to each prediction mode and according to the partitioning ratio corresponding to each prediction mode to obtain the partitioning result of the current block corresponding to each prediction mode.
[0118] It is understandable that there may be a situation where at least one prediction mode corresponds to a partitioning method that does not partition. In this case, the at least one prediction mode does not have a corresponding partitioning ratio or partitioning direction. Furthermore, in step S102, since the partitioning method corresponding to the at least one prediction mode is not partitioned, when the currently traversed prediction mode is one of the at least one prediction modes, there is no need to partition the current block, and the partitioning result of the current block corresponding to the currently traversed prediction mode contains only one sub-block (i.e., the current block itself).
[0119] In a specific example, the current block is a 16*16 coded block. The partitioning method corresponding to the currently traversed prediction mode is a 1:1 partition along the horizontal direction and a 3:1 partition along the vertical direction. Thus, the current block can be partitioned by performing a 1:1 partition along the horizontal direction and a 3:1 partition along the vertical direction, resulting in the following... Figure 8 The division results are shown.
[0120] S103: Predict all sub-blocks in the partitioning result to obtain the prediction block corresponding to each prediction mode for the current block.
[0121] After obtaining the partitioning result of the current block corresponding to the prediction mode currently being traversed based on step S102, prediction can be performed on all sub-blocks in the partitioning result to obtain the prediction block of the current block corresponding to the prediction mode traversed by the current block. This allows the best prediction mode and the final prediction block of the current block to be determined based on the prediction blocks of the current block corresponding to all prediction modes in the candidate list.
[0122] In one embodiment, the prediction of each sub-block in the partitioning result can be made using the prediction pattern currently being traversed.
[0123] In this process, the prediction mode traversed by the current block is used to predict each sub-block in the partitioning result based on the neighboring reference pixels of each sub-block, so as to obtain the prediction result of each sub-block, thereby obtaining the prediction block of the current block corresponding to the prediction mode traversed by the current block.
[0124] In this embodiment, the same prediction model is used to predict each sub-block. Of course, in other embodiments, different prediction models can be used to predict each sub-block.
[0125] In another embodiment, the prediction patterns can be shifted sequentially by several angles, and the corresponding sub-blocks can be predicted based on the shifted prediction patterns. Specifically, the prediction patterns are gradually shifted by several angles according to the order of the sub-blocks to determine the prediction patterns corresponding to each sub-block in the partitioning result. Then, each sub-block is predicted using the prediction patterns corresponding to each sub-block. In this way, each sub-block can use different prediction patterns, making the sub-blocks have more flexible prediction patterns to improve the prediction effect.
[0126] For example, sub-blocks can be ordered from left to right and from top to bottom, so that in Figure 4 In the partitioning result shown, all sub-blocks can be ordered A→B→C→D. Alternatively, the sub-blocks can be ordered from right to left and from bottom to top. Figure 4 In the partitioning results shown, the order of all sub-blocks can be D→C→B→A.
[0127] The aforementioned "gradually shifting by a certain angle on the currently traversed prediction pattern" can refer to: using the currently traversed prediction pattern as the prediction pattern for the first sub-block in the partitioning result, using the prediction pattern corresponding to the currently traversed prediction pattern after adding a preset angle as the prediction pattern for the second sub-block, using the prediction pattern corresponding to the currently traversed prediction pattern after adding twice the preset angle as the prediction pattern for the third sub-block, ..., using the prediction pattern corresponding to the currently traversed prediction pattern after adding N times the preset angle as the prediction pattern for the Nth sub-block. For example, if the number of the currently traversed prediction pattern is 18, then in Figure 4 In the partitioning results shown, the pattern numbers corresponding to sub-blocks A, B, C, and D can be 18, 19, 20, and 21, respectively.
[0128] Alternatively, the phrase "gradually shifting by a certain angle on the currently traversed prediction pattern" could mean: using the currently traversed prediction pattern as the prediction pattern for the first sub-block in the partitioning result, using the prediction pattern corresponding to the currently traversed prediction pattern after reducing it by a preset angle as the prediction pattern for the second sub-block, using the prediction pattern corresponding to the currently traversed prediction pattern after reducing it by twice the preset angle as the prediction pattern for the third sub-block, ..., using the prediction pattern corresponding to the currently traversed prediction pattern after reducing it by N times the preset angle as the prediction pattern for the Nth sub-block.
[0129] Alternatively, the aforementioned "gradually shifting by a certain angle on the currently traversed prediction pattern" can refer to: using the prediction pattern corresponding to the currently traversed prediction pattern after reducing it by a preset angle as the prediction pattern of the first sub-block in the partitioning result, using the prediction pattern corresponding to the currently traversed prediction pattern after reducing it by two times the preset angle as the prediction pattern of the second sub-block, using the prediction pattern corresponding to the currently traversed prediction pattern after reducing it by three times the preset angle as the prediction pattern of the third sub-block, ..., using the prediction pattern corresponding to the currently traversed prediction pattern after reducing it by N+1 times the preset angle as the prediction pattern of the Nth sub-block.
[0130] The preset angle can be set according to the actual situation such as the size of the current block, and there are no restrictions here. For example, the preset angle can be 2°, 4° or 5°, etc.
[0131] In another embodiment, the prediction mode of each sub-block can be determined based on the gradient information of the neighboring reconstructed pixels of each sub-block in at least some of the sub-blocks in the segmentation result; each sub-block is predicted using the prediction mode of each sub-block to obtain the prediction block corresponding to each prediction mode of the current block. In this way, each sub-block can use different prediction modes, making the sub-block have more flexible prediction modes; and the prediction mode of the sub-block is determined by gradient derivation, so that the prediction mode can be more adapted to the content of the sub-block, thereby improving the prediction effect.
[0132] For example, in Figure 4 In the partitioning results shown, the prediction mode of sub-block A can be determined based on the gradient information of the neighboring reconstructed pixels of sub-block A, the prediction mode of sub-block B can be determined based on the gradient information of the neighboring reconstructed pixels of sub-block B, the prediction mode of sub-block C can be determined based on the gradient information of the neighboring reconstructed pixels of sub-block C, and the prediction mode of sub-block D can be determined based on the gradient information of the neighboring reconstructed pixels of sub-block D.
[0133] In another example, in Figure 4 In the partitioning results shown, the currently traversed prediction mode can be used as the prediction mode of sub-block A; after predicting and reconstructing sub-block A using the currently traversed prediction mode, the prediction mode of sub-block B is determined based on the gradient information of the neighboring reconstructed pixels of sub-block B (including the reconstructed pixels in sub-block A); after predicting and reconstructing sub-block B using the prediction mode of sub-block B, the prediction mode of sub-block C is determined based on the gradient information of the neighboring reconstructed pixels of sub-block C (including the reconstructed pixels in sub-block A, and possibly the reconstructed pixels in sub-block B); the prediction mode of sub-block D is determined based on the gradient information of the neighboring reconstructed pixels of sub-block D (including the reconstructed pixels in sub-block C and the reconstructed pixels in sub-block B, and possibly the reconstructed pixels in sub-block A).
[0134] The process of determining the prediction mode of a sub-block using the gradient information of its neighboring reconstructed pixels can include: calculating the horizontal and vertical gradients of each neighboring reconstructed pixel in the sub-block; deriving the gradient angle and magnitude of each neighboring reconstructed pixel based on their horizontal and vertical gradients; converting the gradient angles into corresponding prediction modes to determine the prediction modes corresponding to each neighboring reconstructed pixel; statistically analyzing the prediction modes corresponding to all neighboring reconstructed pixels to determine the prediction mode with the highest magnitude, and using this prediction mode as the prediction mode for the sub-block. The selection of neighboring reconstructed pixels for a sub-block can refer to the DIMD prediction method and will not be elaborated upon here.
[0135] S104: Based on the prediction blocks corresponding to all prediction modes of the current block, determine the best prediction mode for the current block.
[0136] After traversing all prediction modes in the candidate list based on the above steps, the best prediction mode and the final prediction block for the current block can be determined based on the prediction blocks of all prediction modes corresponding to the current block.
[0137] Optionally, before step S104, the cost of the current block corresponding to the currently traversed prediction mode can be determined based on the prediction blocks of the current block corresponding to the currently traversed prediction mode. Thus, in step S104, the optimal prediction mode for the current block can be determined based on the costs of the current block corresponding to all prediction modes, and the prediction block corresponding to the optimal prediction mode is taken as the final prediction block for the current block. More preferably, the prediction mode with the lowest cost among all prediction modes can be taken as the optimal prediction mode for the current block.
[0138] In this embodiment, the current block is divided based on the partitioning method corresponding to each prediction mode in the candidate list, resulting in a partitioning result for each prediction mode. Then, each sub-block in the partitioning result corresponding to each prediction mode is predicted to obtain a prediction block for each prediction mode. Finally, based on all prediction blocks of the current block, the optimal prediction mode for the current block is determined. Thus, in this embodiment, when traversing the prediction mode candidate list, the partitioning method corresponding to each prediction mode is used to divide the current block. This makes the partitioning method of the current block more flexible and adaptable, better suited to the actual image content, thereby improving compression efficiency. Furthermore, by corresponding the prediction mode with the partitioning method, when predicting with the corresponding prediction mode, a partitioning method adapted to the prediction mode can be used to divide the current block, thereby improving the prediction effect.
[0139] Optionally, the intra-prediction method proposed in this application can be used as a new intra-prediction tool in the intra-prediction process. In this case, the best-performing tool and prediction mode among the intra-prediction method proposed in this application, MPM, DIMD, TIMD, ISP, etc., can be selected by some means, such as comparing rate-distortion costs or comparing Hadamard costs.
[0140] In other embodiments, the intra-prediction method proposed in this application can be used to replace existing intra-prediction tools. For example, the intra-prediction method proposed in this application can be used to replace at least one of existing ISP, MPM, TIMD, and DIMD intra-prediction tools.
[0141] Please see Figure 9 , Figure 9 This is a flowchart illustrating one embodiment of the method for encoding video or images according to this application. This method for encoding video or images can be applied to video encoding. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily imply otherwise. Figure 9 The illustrated process sequence is limited. In this embodiment, the method for encoding video or images includes the following steps:
[0142] S201: Determine the final predicted block of the current block in the image based on any of the above prediction methods.
[0143] S202: Encode the current block based on the final predicted block.
[0144] Optionally, when encoding the current block, a preset syntax element value can be set in the encoded bitstream. Different values of the preset syntax element represent whether the prediction method of this application is enabled, i.e., a switch syntax is set to indicate the usage status of the prediction method of this application. For example, the switch syntax AISP_FLAG can be used to express whether the prediction method of this application is used in the encoding and decoding process. Specifically, ISP_FLAG=0 indicates that the prediction method of this application is disabled, and AISP_FLAG=1 indicates that the prediction method of this application is enabled.
[0145] Of course, if the prediction method of this application is used in a mandatory manner, the value of the preset syntax element may not be set in the encoded bitstream.
[0146] In addition, when multiple schemes or modes are selected in the encoding / decoding process, scheme syntax can be used to express the final selected scheme or mode. For example, scheme syntax is used to express the final tools, partitioning methods, prediction modes, and / or sub-block mode determination methods when multiple tools (such as MPM, DIMD, and / or TIMD), partitioning methods, prediction modes, and / or sub-block mode determination methods are involved in the encoding / decoding process.
[0147] In a specific example, the switch syntax AISP_FLAG is used to indicate whether the intra-prediction method proposed in this application is enabled or disabled. When AISP_FLAG=0, it means that the intra-prediction method proposed in this application is disabled, and when AISP_FLAG=1, it means that the intra-prediction method proposed in this application is enabled.
[0148] When AISP_FLAG=1, AISP_IDX is used to mark the position of the best prediction mode in the intra-prediction method proposed in this application in the intra-prediction mode candidate list. For example, if the candidate list is {16, 12, 14, 18, 20} and the best prediction mode is 16, then AISP_IDX=0.
[0149] In another specific example, for the current coding block, the intra-prediction method proposed in this application serves as a new intra-prediction tool. First, a candidate list of prediction modes is constructed, assuming the candidate list is {12, 16, 32, 18, 0, 1, 14, 36, 50}. Then, each prediction mode in the candidate list is traversed to obtain the rate-distortion cost of each prediction mode. During the traversal, the current block needs to be partitioned and the mode deduced. The partitioning direction is determined based on the prediction mode, and the partitioning method is based on dividing the block into 4 sub-blocks at a uniform ratio. The sub-blocks after partitioning use the same prediction mode. Assuming the rate-distortion cost of each prediction mode in the final candidate list is {600, 560, 700, 480, 800, 760, 780, 640, 730}, the prediction mode with the lowest cost is selected as the optimal prediction mode of the intra-prediction method proposed in this application, which is the fourth prediction mode 18 in the candidate list. At this time, the switch syntax AISP_FLAG=1 indicates that the intra-prediction method proposed in this application is enabled, and AISP_IDX=4 indicates that the optimal prediction mode of the intra-prediction method proposed in this application is the fourth mode in the candidate list.
[0150] Please see Figure 10 , Figure 10 This is a flowchart illustrating one embodiment of the method for decoding video or image streams according to this application. This method for decoding video or image streams can be applied to video decoding. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily imply otherwise. Figure 10 The illustrated process sequence is limited. In this embodiment, the method for decoding video or image streams includes the following steps:
[0151] S301: Determine the final predicted block of the current block in the image based on any of the above prediction methods;
[0152] S302: Decode the current block based on the final predicted block.
[0153] Please see Figure 11 , Figure 11This is a schematic diagram of one embodiment of the encoder of this application. The encoder 10 includes a processor 12, which executes instructions to implement the above-described prediction method and the method for encoding video or images. For detailed implementation processes, please refer to the description of the above embodiments, which will not be repeated here.
[0154] Processor 12 can also be referred to as a CPU (Central Processing Unit). Processor 12 may be an integrated circuit chip with signal processing capabilities. Processor 12 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor, or processor 12 can be any conventional processor.
[0155] The encoder 10 may further include a memory 11 for storing instructions and data required for the processor 12 to run.
[0156] The processor 12 is used to execute instructions to implement the methods provided by any embodiment and any non-conflicting combination of the prediction method and the method for encoding video or images described in this application.
[0157] Please see Figure 12 , Figure 12 This is a schematic diagram of one embodiment of the decoder of this application. The decoder 20 includes a processor 22, which executes instructions to implement the above-described prediction method and the method for decoding video or image bitstreams. For detailed implementation processes, please refer to the description of the above embodiments, which will not be repeated here.
[0158] Processor 22 can also be referred to as CPU (Central Processing Unit). Processor 22 may be an integrated circuit chip with signal processing capabilities. Processor 22 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor can be a microprocessor, or processor 22 can be any conventional processor.
[0159] The decoder 20 may further include a memory 21 for storing instructions and data required for the processor 22 to run.
[0160] The processor 22 is used to execute instructions to implement the methods provided by any embodiment and any non-conflicting combination of the prediction method and the method for decoding video or image bitstreams described in this application.
[0161] Please see Figure 13 , Figure 13 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. The computer-readable storage medium 30 in this embodiment stores instruction / program data 31. When executed, this instruction / program data 31 implements any embodiment of the prediction method, the method for decoding video or image streams, and the method for encoding video or images, as well as any non-conflicting combination thereof. The instruction / program data 31 can be formed into a program file and stored in the storage medium 30 as a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) or processor can execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage medium 30 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0162] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0163] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0164] It should also be noted that 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 process, method, article, or apparatus. Unless otherwise specified, 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.
[0165] The above are merely embodiments of this application and do not limit the scope of this patent application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.
Claims
1. An intra-frame prediction method, characterized in that, The method includes: Construct a candidate list of intra-prediction modes for the current block; Based on the partitioning method corresponding to each prediction mode in the candidate list, the current block is partitioned to obtain the partitioning result of the current block corresponding to each prediction mode, including: Determine the division direction and division ratio corresponding to each prediction model; The current block is divided along the division direction corresponding to each prediction mode, and according to the division ratio corresponding to each prediction mode or a preset ratio, to obtain the division result of the current block corresponding to each prediction mode; or, The current block is divided along the current block's division direction and according to the division ratio corresponding to each prediction mode, to obtain the division result of the current block corresponding to each prediction mode; wherein, the current block's division direction is a fixed division direction, or the current block's division direction is set according to the size of the current block, or the current block's division direction is set according to the comparison result of the width and height of the current block; For each prediction mode, all sub-blocks in the partitioning result are predicted to obtain the prediction block corresponding to each prediction mode for the current block; Based on the prediction blocks of all prediction modes corresponding to the current block, the best prediction mode for the current block is determined.
2. The intra-frame prediction method according to claim 1, characterized in that, The step of predicting all sub-blocks in the partitioning result of each prediction mode to obtain the prediction block corresponding to each prediction mode for the current block includes: Based on the gradient information of the neighboring reconstructed pixels of each sub-block in at least a portion of the partitioning results of each prediction mode, the prediction mode of each sub-block is determined. Each sub-block is predicted using the prediction mode of each sub-block to obtain the prediction block corresponding to each prediction mode for the current block.
3. The intra-frame prediction method according to claim 2, characterized in that, The determination of the prediction mode for each sub-block based on the gradient information of the neighboring reconstructed pixels of each sub-block in at least a portion of the partitioning results of each prediction mode includes: Calculate the horizontal and vertical gradients of each adjacent reconstructed pixel in each sub-block; The gradient angle and magnitude of each adjacent reconstructed pixel are derived based on the horizontal and vertical gradients of each adjacent reconstructed pixel. The gradient angle is converted into the corresponding prediction mode to determine the prediction mode corresponding to each adjacent reconstructed pixel; The prediction modes corresponding to all adjacent reconstructed pixels of each sub-block are statistically analyzed to determine the prediction mode with the highest amplitude of each sub-block, and the prediction mode with the highest amplitude of each sub-block is taken as the prediction mode of each sub-block; wherein, the prediction mode with the highest amplitude is the prediction mode corresponding to the adjacent reconstructed pixel with the highest amplitude among all adjacent reconstructed pixels of the sub-block.
4. The intra-frame prediction method according to claim 1, characterized in that, The step of predicting all sub-blocks in the partitioning result of each prediction mode to obtain the prediction block corresponding to each prediction mode for the current block includes: According to the order of sub-blocks in the partitioning result of each prediction mode, gradually shift by a certain angle on each prediction mode to determine the prediction mode corresponding to each sub-block in the partitioning result of each prediction mode; predict each sub-block using the prediction mode corresponding to each sub-block to obtain the prediction block corresponding to each prediction mode for the current block; or, Each sub-block is predicted using each prediction mode and based on the neighboring reference pixels of each sub-block in the partitioning result of each prediction mode, so as to obtain the prediction block corresponding to each prediction mode for the current block.
5. The intra-frame prediction method according to claim 1, characterized in that, The candidate list for constructing the intra-prediction mode of the current block includes: The intra-frame prediction mode candidate list is constructed based on the MPM tool, TIMD tool, and / or DIMD tool.
6. The intra-frame prediction method according to claim 5, characterized in that, The intra-frame prediction mode candidate list is constructed using MPM tools, TIMD tools, and / or DIMD tools, including: At least one intermediate prediction mode of the current block determined by the MPM tool, TIMD tool and / or DIMD tool is added to the candidate list, and / or at least one final mode of the current block determined by the MPM tool, TIMD tool and / or DIMD tool is added to the candidate list to obtain the intra-prediction mode candidate list of the current block.
7. A method for encoding video or images, characterized in that, The method includes: The prediction method according to any one of claims 1-6 determines the final predicted block of the current block in the image; The current block is encoded based on the final predicted block.
8. The method for encoding video or images according to claim 7, characterized in that, The encoding of the current block based on the final predicted block includes: In the encoded bitstream, a preset syntax element is set to a value, wherein different values of the preset syntax element represent whether the prediction method is enabled.
9. The method for encoding video or images according to claim 7, characterized in that, The encoding of the current block based on the final predicted block includes: The index information of the prediction mode corresponding to the final prediction block in the intra-frame prediction mode candidate list is encoded to obtain the encoded bitstream.
10. A method for decoding video or image bitstreams, characterized in that, The method includes: The prediction method according to any one of claims 1-6 determines the final predicted block of the current block in the image; The current block is decoded based on the final predicted block.
11. An encoder, characterized in that, The encoder includes a processor; the processor is configured to execute instructions to implement the steps of the method as described in any one of claims 1-9.
12. A decoder, characterized in that, The decoder includes a processor; the processor is configured to execute instructions to implement the steps of the method as described in any one of claims 1-6 and 10.
13. A computer-readable storage medium storing instruction / program data thereon, characterized in that, When the instruction / program data is executed, it implements the steps of the method described in any one of claims 1-10.
Citation Information
Patent Citations
Method for processing image on basis of intra prediction mode and apparatus therefor
CN107409207A
Video signal encoding / decoding method and device therefor
CN112514384A