Intra prediction method, encoder, decoder, and storage medium
The intra prediction method addresses the challenge of complex textures in video coding by using two intra angular modes with weighting matrices, improving accuracy and reducing hardware complexity and cost.
Patent Information
- Application Number
- JP2025120280
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-10-07
- Estimated Expiration
- 2041-02-22
AI Technical Summary
Existing video coding technologies face challenges in accurately predicting complex textures due to the need for additional hardware circuits when using multiple intra prediction modes, leading to increased cost and complexity in hardware implementation.
An intra prediction method that uses two different intra angular prediction modes for a current block, combined with weighting matrices, to improve prediction accuracy while reducing hardware complexity and cost.
This approach enhances intra prediction accuracy, simplifies encoding and decoding processes, and improves compression performance by combining two different prediction blocks with weighting matrices.
Smart Images

Figure 2025148546000001_ABST
Abstract
Description
[Technical Field]
[0001] TECHNICAL FIELD Embodiments of the present application relate to the field of image processing technology, and in particular to an intra prediction method, an encoder, a decoder, and a storage medium. [Background technology]
[0002] In order to capture finer edge directions that appear in natural video, versatile video coding (VVC) expands the 33 intra-luminance prediction angle modes defined in the video compression standard high efficiency video coding (HEVC) to 65, and also provides two non-angle modes: a planar mode numbered 0 and a direct current (DC) mode numbered 1.
[0003] To improve the accuracy of intra prediction, a method has been proposed that uses two different intra prediction modes. However, in hardware implementation, it is difficult to reuse circuits for different intra prediction modes, so two sets of intra prediction circuits are required. Adding new prediction circuits increases the cost and complexity of the hardware implementation, and reduces encoding and decoding performance. Summary of the Invention
[0004] In the embodiments of the present application, an intra prediction method, an encoder, a decoder, and a storage medium are provided, which improve the accuracy of intra prediction, reduce the cost and complexity of hardware implementation, realize a simple and efficient encoding and decoding method, and improve compression performance.
[0005] The technical solutions of the embodiments of the present application can be realized as follows.
[0006] In a first aspect, an embodiment of the present application provides an intra prediction method. The method is applicable to a decoder and includes the following steps: Identifying intra prediction mode parameters for a current block by decoding a bitstream; If the intra prediction mode parameters indicate that an intra predicted value of the current block is to be determined using an intra weighted combined prediction (IWCP) mode, identifying a first mode index and a second mode index for the current block; Constructing a Most Probable Mode (MPM) list for the current block; Identifying a first intra prediction mode and a second intra prediction mode for the current block based on the first mode index, the second mode index, and the MPM list; The first intra prediction mode and the second intra prediction mode are different intra angular prediction modes; Identifying a weighting matrix for the current block, and identifying a predicted value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix.
[0007] In a second aspect, an embodiment of the present application provides an intra prediction method. The method is applied to an encoder and includes the following steps: when determining an intra predicted value of a current block using an intra weighted combined prediction (IWCP) mode, determining a first intra prediction mode and a second intra prediction mode of the current block; the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes; constructing a most probable mode (MPM) list for the current block; determining a first mode index and a second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list; and writing the first mode index and the second mode index into a bitstream.
[0008] In a third aspect, an embodiment of the present application provides an encoder. The encoder includes a first identification unit, a first construction unit, and a coding unit. The first identification unit is configured to identify a first intra prediction mode and a second intra prediction mode of the current block when an intra prediction value of the current block is identified using an intra weighted combined prediction (IWCP) mode, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes. The first construction unit is configured to construct a most probable mode (MPM) list for the current block. The first identification unit is further configured to identify a first mode index and a second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list. The coding unit is configured to write the first mode index and the second mode index to a bitstream.
[0009] In a fourth aspect, an embodiment of the present application provides a decoder. The decoder includes a decoding unit, a second identification unit, and a second construction unit. The decoding unit is configured to decode a bitstream. The second identification unit is configured to identify an intra-prediction mode parameter of a current block. If the intra-prediction mode parameter indicates that an intra-prediction value of the current block is to be determined using an intra-weighted combined prediction (IWCP) mode, the second identification unit is configured to identify a first mode index and a second mode index of the current block. The second construction unit is configured to construct a most probable mode (MPM) list for the current block. The second identification unit is further configured to identify a first intra-prediction mode and a second intra-prediction mode of the current block based on the first mode index, the second mode index, and the MPM list, where the first intra-prediction mode and the second intra-prediction mode are different intra-angle prediction modes. The second identification unit is further configured to identify a weighting matrix of the current block and to determine a prediction value of the current block based on the first intra-prediction mode, the second intra-prediction mode, and the weighting matrix.
[0010] In a fifth aspect, an embodiment of the present application provides an encoder, the encoder comprising a first processor and a first memory storing instructions executable by the first processor, the instructions, when executed, causing the first processor to perform the intra prediction method.
[0011] In a sixth aspect, an embodiment of the present application provides a decoder, the decoder comprising a second processor and a second memory storing instructions executable by the second processor, the instructions, when executed, causing the second processor to perform the intra prediction method.
[0012] In a seventh aspect, an embodiment of the present application provides a computer storage medium having a computer program stored thereon, the computer program being configured to execute the intra prediction method according to the second aspect when executed by a first processor, or to execute the intra prediction method according to the first aspect when executed by a second processor.
[0013] In an embodiment of the present application, an intra prediction method, an encoder, a decoder, and a storage medium are provided. The decoder determines an intra prediction mode parameter of a current block by decoding a bitstream. If the intra prediction mode parameter indicates that an intra prediction value of the current block is to be determined using the IWCP mode, it determines a first mode index and a second mode index of the current block. It constructs an MPM list for the current block. It determines a first intra prediction mode and a second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list. The first intra prediction mode and the second intra prediction mode are different intra angular prediction modes. It determines a weighting matrix for the current block, and determines a prediction value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix. If the intra prediction value of the current block is to be determined using the IWCP mode, the encoder determines a first intra prediction mode and a second intra prediction mode of the current block. The first intra prediction mode and the second intra prediction mode are different intra angular prediction modes. It constructs an MPM list for the current block. A first mode index and a second mode index of the current block are determined based on the first intra prediction mode, the second intra prediction mode, and the MPM list. The first mode index and the second mode index are written into the bitstream. That is, in an embodiment of the present application, the encoder / decoder can determine two different prediction blocks of the current block using two different intra angle prediction modes, and then combine the two different prediction blocks with various weighting matrices to finally obtain a more complex prediction block. This improves the accuracy of intra prediction, while reducing hardware implementation costs and complexity, achieving a simple and efficient encoding / decoding method, and improving compression performance. [Brief explanation of the drawings]
[0014] [Figure 1] FIG. 1 is a first schematic diagram showing weight assignment. [Figure 2] FIG. 2 is a second schematic diagram illustrating weight assignment. [Figure 3] FIG. 3 is a schematic diagram illustrating intra prediction. [Figure 4] FIG. 4 is a block diagram showing the configuration of a video encoding system. [Figure 5] FIG. 5 is a block diagram showing the configuration of a video decoding system. [Figure 6] FIG. 6 is a first flowchart illustrating the implementation of the intra prediction method. [Figure 7] FIG. 7 is a schematic diagram showing the IWCP mode. [Figure 8] FIG. 8 is a schematic diagram showing adjacent blocks. [Figure 9] FIG. 9 is a second flowchart illustrating the implementation of the intra prediction method. [Figure 10] FIG. 10 is a first schematic diagram illustrating the structure of an encoder according to an embodiment of the present application. [Figure 11] FIG. 11 is a second schematic diagram illustrating the structure of an encoder according to an embodiment of the present application. [Figure 12] FIG. 12 is a first schematic diagram illustrating the structure of a decoder according to an embodiment of the present application. [Figure 13] FIG. 13 is a second schematic diagram illustrating the structure of a decoder according to an embodiment of the present application. DETAILED DESCRIPTION OF THE INVENTION
[0015] The technical solutions of the embodiments of the present application will be clearly and comprehensively described below with reference to the drawings of the embodiments of the present application. The specific embodiments described in the specification are only used to explain the present application and do not limit the present application. In addition, for ease of description, the drawings only show parts relevant to the present application.
[0016] Currently, a block-based hybrid coding framework is used in common video encoding and decoding standards. Each image (frame) in a video image is divided into largest coding units (LCUs) of the same size (e.g., 128x128, 64x64, etc.). Each LCU can be divided into rectangular coding units (CUs) based on a rule, and the coding units can be divided into smaller prediction units (PUs). Specifically, the hybrid coding framework can include modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. The prediction module can include intraprediction and interprediction, and interprediction can include motion estimation and motion compensation. Due to the strong correlation between adjacent samples in a video picture, video encoding and decoding technology uses intraprediction to eliminate spatial redundancy between adjacent samples. Due to the strong similarity between adjacent pictures in a video, in video coding and decoding technology, inter-prediction methods can be used to eliminate the temporal redundancy between adjacent pictures and improve the coding and decoding efficiency.
[0017] The basic flow of video encoding and decoding is as follows: On the encoding side, an image is divided into blocks, and a predicted block of the current block is generated by intra- or inter-prediction of the current block. The predicted block is subtracted from the original block of the current block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix, and the quantization coefficient matrix is entropy coded and output to a bitstream. On the decoding side, a predicted block of the current block is generated by intra- or inter-prediction of the current block. The bitstream is decoded to obtain a quantization coefficient matrix, and the quantization coefficient matrix is inversely quantized and inversely transformed to obtain a residual block. The predicted block and residual block are added to obtain a reconstructed block. The reconstructed block forms a reconstructed image. The reconstructed image is then in-loop filtered based on the image or block to obtain a decoded image. The encoding side also requires a similar process to that on the decoding side to obtain a decoded image. The decoded image can be used as a reference image for inter-prediction of a subsequent image. The block partition information identified by the encoding side, as well as mode or parameter information such as prediction, transform, quantization, entropy coding, and in-loop filtering, are output to the bitstream as needed. The decoding side analyzes the existing information to identify the same block partition information, mode or parameter information such as prediction, transform, quantization, entropy coding, and in-loop filtering as the encoding side. This ensures that the decoded image obtained by the encoding side is the same as the decoded image obtained by the decoding side. The decoded image obtained by the encoding side is usually also called a reconstructed image. During prediction, the current block may be divided into prediction units, and during transformation, the current block may be divided into transform units. The division between prediction units and transform units may be different. The above is the basic flow of video encoding and decoding in a block-based hybrid coding framework. As technology develops, some modules and steps in this framework or flow may be optimized.The embodiments of the present application apply to the basic flow of video encoding and decoding in this block-based hybrid coding framework, but are not limited to this framework or flow.
[0018] The current block may be a current coding unit (CU), a current prediction unit (PU), or the like.
[0019] In inter prediction, a current block is predicted using information from a decoded or reconstructed image or a reference image. In inter prediction, a reference block is found from a reference image using motion information, and a prediction block is generated based on the reference block. The motion information includes a reference image list containing reference images, a reference image index, and a motion vector. The motion vector can be an integer-sample motion vector or a fractional-sample motion vector. If the motion vector is a fractional-sample motion vector, an interpolation filter must be applied to the reference image to generate the required fractional sample block. The integer-sample block or fractional-sample block in the reference image found based on the motion vector is called a reference block. Some techniques use the reference block as a prediction block, while other techniques generate a prediction block by processing based on the reference block. Generating a prediction block by processing based on the reference block can also be understood as using the reference block as a prediction block and then processing based on the prediction block to generate a new prediction block.
[0020] The video coding and decoding standard currently under development, called Versatile Video Coding (VVC), has an inter-prediction mode called geometric partitioning mode (GPM). The video coding and decoding standard currently under development, called Audio Video Coding standard (AVS), has an inter-prediction mode called angular weighted prediction (AWP). Although these two modes have different names and implementations, they share some principles.
[0021] While conventional unidirectional prediction uses only one reference block with the same size as the current block, conventional bidirectional prediction uses two reference blocks with the same size as the current block, and the value of each sample in the prediction block is the average of the values of samples at corresponding positions in the two reference blocks. That is, all samples in each reference block contribute 50% to the prediction block. In bidirectional weighted prediction, the contribution rates of the two reference blocks may be different. For example, all samples in the first reference block contribute 75% and all samples in the second reference block contribute 25%. However, all samples in the same reference block have the same contribution rate. Some other optimization methods, such as decoder side motion vector refinement (DMVR) technology and bidirectional optical flow (BIO), may cause some changes to the reference samples or prediction samples. In GPM or AWP, two reference blocks having the same size as the current block are also used, but at some sample positions, the sample values at the corresponding positions of the first reference block are used 100%, at other sample positions, the sample values at the corresponding positions of the second reference block are used 100%, and in the transition region (intersection region), the sample values at the corresponding positions of these two reference blocks are used at a fixed rate. How the weights of the sample values are specifically assigned is determined by the GPM or AWP mode.
[0022] For example, FIG. 1 is a first schematic diagram illustrating weight allocation. As shown in FIG. 1, a schematic diagram of weight allocation for multiple division modes of a GPM in a 64x64 current block according to an embodiment of the present application is shown, where the GPM has 64 division modes. FIG. 2 is a second schematic diagram illustrating weight allocation. As shown in FIG. 2, a schematic diagram of weight allocation for multiple division modes of an AWP in a 64x64 current block according to an embodiment of the present application is shown, where the AWP has 56 division modes. In both FIG. 1 and FIG. 2, for various division modes, a black area indicates that the weight value of the corresponding position of the first reference block is 0%, a white area indicates that the weight value of the corresponding position of the first reference block is 100%, and a gray area indicates that the weight value of the corresponding position of the first reference block is any weight value greater than 0% and less than 100% with different color shades. The weight value of the corresponding position of the second reference block is 100% minus the weight value of the corresponding position of the first reference block.
[0023] The method of deriving weights in GPM and AWP is different. GPM identifies angles and offsets based on various modes, and then calculates weighting matrices for various modes. AWP first generates one-dimensional weight lines, and then tile the entire matrix with the one-dimensional weight lines using a method similar to intra-angle prediction.
[0024] Previous encoding and decoding technologies only use rectangular partitioning, regardless of whether they are CUs, PUs, or transform units (TUs). In GPM and AWP, non-rectangular partitioning of prediction is achieved without partitioning. GPM and AWP use a weight map, or mask, of the weights of two reference blocks. This mask determines the weights of the two reference blocks used to generate the predicted block. A blending area is obtained by weighting the corresponding positions of the two reference blocks, resulting in a smoother transition. In GPM and AWP, the current block is not divided into two CUs or PUs by a partition line, so the entire current block is subjected to the transform, quantization, inverse transform, and inverse quantization of the predicted residual.
[0025] The motion information used for the current block can be stored. Based on the adjacent positional relationship, the motion information of a previously coded or decoded block (e.g., a neighboring block) can be used for a subsequent coded or decoded block of the current image. Because it uses spatial correlation, the motion information of such coded or decoded images is called spatial motion information. The motion information used for each block of the current image can be stored. Based on the reference relationship, the motion information of a previously coded or decoded image can be used for a subsequent coded or decoded image. Because it uses temporal correlation, the motion information of such coded or decoded images is called temporal motion information. In a method for storing motion information used for each block of the current image, a fixed-size matrix, such as a 4x4 matrix, is used as the smallest unit, and one set of motion information is stored independently in each smallest unit. In this way, each time a block is coded or decoded, the smallest units corresponding to the block's position can store the motion information for that block. In this way, when spatial motion information or temporal motion information is used, the motion information corresponding to that position can be directly found based on the position. For example, when conventional unidirectional prediction is used for one 16x16 block, all 4x4 minimum units corresponding to the block store the motion information of this unidirectional prediction. When GPM or AWP is used for one block, all minimum units corresponding to the block identify the motion information to be stored in each minimum unit based on the GPM or AWP mode, the first motion information, the second motion information, and the position of each minimum unit. In one method, when all 4x4 samples corresponding to one minimum unit are derived from the first motion information, this minimum unit stores the first motion information. When all 4x4 samples corresponding to one minimum unit are derived from the second motion information, this minimum unit stores the second motion information.If a 4x4 sample corresponding to one minimum unit comes from both the first motion information and the second motion information, AWP selects and stores one of them, while GPM combines and stores the two motion information as bidirectional motion information if they point to different reference image lists; otherwise, it stores only the second motion information.
[0026] Note that GPM or AWP is a type of inter-prediction technique. A flag indicating whether GPM or AWP is used needs to be transmitted in the bitstream. The flag can indicate whether GPM or AWP is used for the current block. If GPM or AWP is used, the encoder needs to transmit the specific mode to be used (i.e., one of the 64 partition modes of GPM or one of the 56 partition modes of AWP) and two unidirectional motion information index values in the bitstream. That is, for the current block, the decoder can obtain information on whether GPM or AWP is used by decoding the bitstream. If it is determined that GPM or AWP is used, the decoder can analyze the prediction mode parameter of GPM or AWP and two motion information index values. For example, if the current block is divided into two partitions, the decoder can analyze a first index value corresponding to the first partition and a second index value corresponding to the second partition.
[0027] Specifically, in the GPM mode, when the GPM is used, prediction mode parameters in the GPM (e.g., specific partition modes of the GPM) are transmitted in the bitstream. Typically, the GPM includes 64 partition modes. In the AWP mode, when the AWP is used, prediction mode parameters in the AWP (e.g., specific partition modes of the AWP) are transmitted in the bitstream. Typically, the AWP includes 56 partition modes.
[0028] In inter-prediction modes, for example, GPM and AWP, two unidirectional motion information are required to search for two reference blocks. In the current implementation, the encoder side uses related information of previously coded / decoded parts of the current block to construct a unidirectional motion information candidate list, selects unidirectional motion information from the unidirectional motion information candidate list, and writes the indices of the two unidirectional motion information in the unidirectional motion information candidate list into the bitstream. The decoder side uses the same method as the encoder side, i.e., uses related information of previously decoded parts of the current block to construct a unidirectional motion information candidate list. This unidirectional motion information candidate list is the same as the candidate list constructed by the encoder side. In this way, the decoder analyzes the indexes of the two unidirectional motion information from the bitstream and then searches for the two unidirectional motion information (i.e., the two unidirectional motion information needed for the current block) from the unidirectional motion information candidate list.
[0029] In other words, the unidirectional motion information described in this application can include motion vector information (i.e., the (x, y) value) and corresponding reference image information (i.e., the reference image list and the reference image index in the reference image list). In one method, the reference image index in two reference image lists is recorded. The reference image index corresponding to one of the two reference image lists is valid, for example, 0, 1, 2, etc., and the reference image index corresponding to the other reference image list is invalid, for example, -1. The reference image list with a valid reference image index is the reference image list used for the motion information of the current block. Based on the reference image index, the corresponding reference image can be found from the reference image list. Each reference image list has a corresponding motion vector, and the motion vector corresponding to the valid reference image list is valid, and the motion vector corresponding to the invalid reference image list is invalid. The decoder can find the required reference image from the reference image information in the unidirectional motion information, and can find the reference block from the reference image based on the position and motion vector (i.e., the (x, y) value) of the current block, and can further determine the inter-prediction value of the current block.
[0030] Intra prediction predicts a current block using reconstructed samples that have been coded and decoded around the current block as reference samples. FIG. 3 is a schematic diagram illustrating intra prediction. As shown in FIG. 3, the size of the current block is 4x4, and the samples in the left column and the top row of the current block are reference samples for the current block. In intra prediction, these reference samples are used to predict the current block. All of these reference samples may be available, i.e., they may all have been coded and decoded. Alternatively, some of these reference samples may be unavailable. For example, if the current block is located at the leftmost position of the entire image, the reference sample to the left of the current block may be unavailable. Or, when coding and decoding the current block, the reference sample to the bottom left of the current block has not yet been coded and decoded, so the reference sample to the bottom left is also unavailable. If a reference sample is unavailable, available reference samples may be used, or some value or method may be used to perform fill-in, or no fill-in may be performed.
[0031] Furthermore, when performing intra prediction, a multiple reference line (MRL) intra prediction method can improve coding efficiency by using more reference samples, for example, four reference lines / columns as reference samples for the current block.
[0032] There are multiple prediction modes for intra prediction, and H.264 can include nine modes when performing intra prediction on a 4x4 block. In mode 0, the sample above the current block is copied vertically onto the current block as a predicted value. In mode 1, the reference sample to the left of the current block is copied horizontally onto the current block as a predicted value. In mode 2 (DC), the average value of multiple adjacent samples is used as the predicted value for all samples. In modes 3 to 8, the reference sample is copied to the corresponding position of the current block along a certain angle. Because some positions in the current block cannot exactly correspond to the reference sample, it is necessary to use a weighted average of the reference sample or an interpolated fractional sample of the reference sample.
[0033] There are also other modes such as planar. As technology advances and blocks become larger, the number of angle prediction modes is also increasing. For example, the intra prediction modes used in HEVC include planar mode, DC mode, and 33 angle modes, for a total of 35 prediction modes. The intra modes used in VVC include planar mode, DC mode, and 65 angle modes, for a total of 67 prediction modes. The intra modes used in AVS3 include DC mode, planar mode, bilinear mode, and 63 angle modes, for a total of 66 prediction modes.
[0034] There are also techniques for improving prediction, such as improving fractional sample interpolation of reference samples and filtering predicted samples. For example, the multiple intra prediction filter (MIPF) in AVS3 generates predictions using different filters for blocks of different sizes. For samples at different positions within the same block, one filter is used to generate predictions for samples close to the reference sample, and another filter is used to generate predictions for samples far from the reference sample. Techniques for filtering predicted samples, such as the intra prediction filter (IPF) in AVS3, can filter predictions using a reference sample.
[0035] In intra prediction, encoding and decoding efficiency can be improved by using intra mode encoding technology that uses a most probable mode (MPM) list. An MPM list is constructed using the intra prediction modes of previously coded and decoded surrounding blocks, intra prediction modes (e.g., adjacent modes) derived based on the previously coded and decoded surrounding blocks, and commonly used or highly likely intra prediction modes (e.g., DC, planar, bilinear modes, etc.). Because textures have spatial continuity, referencing the intra prediction modes of previously coded and decoded surrounding blocks utilizes spatial correlation. The MPM can be used to predict the intra prediction mode. That is, the probability that the MPM is used for the current block is considered to be higher than the probability that the MPM is not used for the current block. Therefore, fewer codewords are used for the MPM during binarization, thereby saving overhead and improving encoding and decoding efficiency.
[0036] Current intra prediction modes include DC mode, planar mode, and bilinear mode, but all of these can only predict simple textures. Even though there are many angle modes, predictions based on these modes can only be performed along a straight line at a single angle. As such, conventional intra prediction modes can only predict simple textures. For complex textures, prediction requires dividing the image into smaller blocks or coding more residuals, which can result in significant distortion.
[0037] To address the above issues, an intra-prediction method has been proposed. In this method, the encoder and decoder identify two different prediction blocks for the current block using two different intra-prediction modes, and then combine the prediction blocks using various weighting matrices to ultimately obtain a more complex prediction block, thereby improving prediction accuracy. However, non-angular prediction modes, such as DC mode, planar mode, PLANE mode, and bilinear mode, have different calculation logic from angular prediction modes. Each non-angular prediction mode has its own logic, making it difficult to reuse the circuit for the non-angular prediction mode as the circuit for the angular prediction mode in hardware implementation. When performing prediction using two intra-prediction modes, if the predictions using the two intra-prediction modes are performed serially in hardware and then combined based on a weighting matrix, an existing intra-prediction circuit can be used for prediction using the two intra-prediction modes. However, previously predicted values must be stored, and thus the time required for intra-weighted combined prediction is significantly longer than the time required for original prediction using only one intra-prediction mode. When predictions using two intra prediction modes are performed in parallel in hardware, the speed at which prediction values are generated using intra weighted combination prediction is significantly faster than when performed serially. However, in terms of cost, two sets of intra prediction circuits are required, i.e., one set of intra prediction circuits must be added. The intra prediction circuit here performs predictions using the intra non-angular prediction mode and the intra angular prediction mode, i.e., one set of intra prediction circuits must be newly added.
[0038] While the conventional method of performing intra prediction using two different intra prediction modes can improve prediction effectiveness to a certain extent, it requires the addition of a new prediction circuit, which increases hardware implementation costs. Therefore, the newly added intra prediction circuit can be simplified as much as possible to reduce the complexity of intra weighted combination prediction. To solve the above problem, in an embodiment of the present application, an encoder / decoder can identify two different prediction blocks for a current block using two different intra angle prediction modes, and then combine the two different prediction blocks with various weighting matrices to ultimately obtain a more complex prediction block. This improves intra prediction accuracy, reduces hardware implementation costs, reduces complexity, realizes a simple and efficient encoding / decoding method, and improves compression performance.
[0039] Referring to FIG. 4, FIG. 4 is a block diagram illustrating the configuration of a video encoding system according to an embodiment of the present application. As shown in FIG. 4, the video encoding system 10 includes a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image buffer unit 110. The filtering unit 108 can implement deblocking filtering and Sample Adaptive Offset (SAO) filtering. The encoding unit 109 can implement header information coding and context-based adaptive binary arithmetic coding (CABAC). For an input original video signal, one video coding block can be obtained by dividing a coding tree unit (CTU). Next, the transform and quantization unit 101 performs a transform on the video coding block using residual sample information obtained by performing intra prediction or inter prediction, for example, converting the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate. The intra estimation unit 102 and the intra prediction unit 103 are used to perform intra prediction on the video coding block. Specifically, the intra estimation unit 102 and the intra prediction unit 103 are used to determine an intra prediction mode for encoding the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter prediction encoding of the received video coding block relative to one or more blocks in one or more reference images to provide temporal prediction information.Motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector, which can estimate the motion of the video coding block. Then, the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105. After the intra prediction mode is determined, the intra prediction unit 103 is further used to provide the selected intra prediction data to the coding unit 109, and the motion estimation unit 105 sends the calculated motion vector data to the coding unit 109. Furthermore, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block and reconstruct a residual block in the pixel domain. The reconstructed residual block is filtered by the filter control analysis unit 107 and the filtering unit 108 to remove blocking effect artifacts, and then the reconstructed residual block is added to a prediction block in the image of the decoded image buffer unit 110 to generate a reconstructed video coding block. The coding unit 109 is used to encode various coding parameters and quantized transform coefficients. In a CABAC-based encoding algorithm, the context content can be used to encode information indicating a specified intra-prediction mode based on neighboring coding blocks and output a bitstream of the video signal. The decoded picture buffer unit 110 is used to store reconstructed video coding blocks for prediction reference. As video image encoding is performed, new reconstructed video coding blocks are continuously generated, and all of these reconstructed video coding blocks are stored in the decoded picture buffer unit 110.
[0040] Referring to FIG. 5, FIG. 5 is a block diagram showing the configuration of a video decoding system according to an embodiment of the present application. As shown in FIG. 5, the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206. The decoding unit 201 can perform header information decoding and CABAC decoding. The filtering unit 205 can perform deblocking filtering and SAO filtering. After an input video signal is encoded as shown in FIG. 4, a bitstream of the video signal is output. The bitstream is input to the video decoding system 20. The decoding unit 201 first obtains decoded transform coefficients. The decoded transform coefficients are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain. The intra prediction unit 203 may be used to generate prediction data for a current video decoding block based on the identified intra prediction mode and data from a previously decoded block of the current frame or image. The motion compensation unit 204 identifies prediction information for the video decoding block by analyzing the motion vectors and other related syntax elements and uses the prediction information to generate a prediction block for the video decoding block being decoded. A decoded video block is formed by adding the residual block from the inverse transform and inverse quantization unit 202 to the corresponding prediction block generated by the intra prediction unit 203 or the motion compensation unit 204. The decoded video signal is then filtered by the filtering unit 205 to remove block effect artifacts, thereby improving video quality. The decoded video block is then stored in the decoded image buffer unit 206, which stores reference images for subsequent intra prediction or motion compensation and simultaneously outputs a video signal to obtain a reconstructed original video signal.
[0041] The intra prediction method in the embodiment of the present application is mainly applied to the intra prediction unit 103 shown in Figure 4 and the intra prediction unit 203 shown in Figure 5. That is, the intra prediction method in the embodiment of the present application may be applied to a video encoding system, a video decoding system, or even simultaneously applied to a video encoding system and a video decoding system, but is not particularly limited in the embodiment of the present application. Note that, when the intra prediction method is applied to the intra prediction unit 103, the "current block" specifically refers to the currently encoded block in intra prediction. When the intra prediction method is applied to the intra prediction unit 203, the "current block" specifically refers to the currently decoded block in intra prediction.
[0042] Hereinafter, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application.
[0043] In one embodiment of the present application, an intra prediction method applied to a decoder is provided. Figure 6 is a first flowchart showing the implementation of the intra prediction method. As shown in Figure 6, the intra prediction method by the decoder can include the following steps:
[0044] Step 101: Identify the intra prediction mode parameters of the current block by decoding the bitstream.
[0045] In an embodiment of the present application, the decoder can identify the intra-prediction mode parameters of the current block by decoding the bitstream.
[0046] In addition, in an embodiment of the present application, the intra prediction mode parameter may indicate whether an intra weighted combined prediction (IWCP) mode can be used for the current block, i.e., whether two different intra angle prediction modes can be used to determine the predicted value of the current block.
[0047] In the embodiment of the present application, the intra-prediction mode parameter may be understood as a flag indicating whether the IWCP mode is used. Specifically, the decoder can identify a variable as the intra-prediction mode parameter by decoding the bitstream, and can identify the intra-prediction mode parameter based on the value of the variable.
[0048] It should be noted that in the embodiment of the present application, the IWCP mode is a type of intra prediction method. Specifically, in the IWCP mode, two different intra angular prediction modes are determined for the current block, and two prediction blocks are determined respectively according to the two different intra angular prediction modes. Then, a weighting matrix is determined, and the two prediction blocks are combined according to the weighting matrix to finally obtain a new prediction block, that is, a prediction block of the current block is obtained.
[0049] 7 is a schematic diagram illustrating an IWCP mode. As shown in FIG. 7, when performing intra prediction on a current block, an intra angle prediction mode 1 (first intra prediction mode) is used to identify a first predicted block of the current block, and an intra angle prediction mode 2 (second intra prediction mode) is used to identify a second predicted block of the current block. Then, a new predicted block can be finally obtained by combining the first predicted block and the second predicted block using a weighting matrix.
[0050] In an embodiment of the present application, a video image may be divided into multiple image blocks, and a current block is an image block currently waiting to be coded and may be referred to as a coding block (CB). Here, each coding block may include a first color component, a second color component, and a third color component. Specifically, in the present application, if a first intra prediction is performed and the first color component is a luma component, i.e., the color component to be predicted is a luma component, the coding block to be predicted may be referred to as a luma block. If a second intra prediction is performed and the second color component is a chroma component, i.e., the color component to be predicted is a chroma component, the coding block to be predicted may be referred to as a chroma block.
[0051] Furthermore, in the embodiment of the present application, when applying the IWCP mode, the size of the current block may be limited.
[0052] In the intra prediction method according to the embodiment of the present application, two different intra angular prediction modes are used to generate two prediction blocks, and a new prediction block is obtained by weighting the two prediction blocks based on a weighting matrix. Therefore, in order to reduce complexity and to strike a balance between compression performance and complexity, the embodiment of the present application can restrict the IWCP mode from being used for prediction blocks having a certain size. Therefore, in the present application, the decoder can first determine the size parameter of the current block and determine whether the IWCP mode is used for the current block based on the size parameter.
[0053] It should be noted that in the embodiment of the present application, the size parameters of the current block may include the height and width of the current block, so that the decoder can restrict the use of the IWCP mode based on the height and width of the current block, i.e., restrict the size of the predicted block for which the IWCP mode can be used.
[0054] For example, in this application, it can be determined that the IWCP mode is used for the current block when both the width and height are equal to or greater than a first lower limit and both the width and height are equal to or less than a first upper limit. Thus, one possible restriction is that the IWCP mode is used only when the width and height of the prediction block are smaller than (or equal to or less than) the first upper limit and larger than (or equal to or greater than) the first lower limit. Note that the first lower limit may be 8, and the value of the first upper limit may be 16 or 32, etc.
[0055] For example, in the present application, there may be a frame-level flag for specifying whether the IWCP mode is used for the current frame waiting to be decoded. For example, the IWCP mode may be configured to be used for intraframes (e.g., I frames) but not for interframes (e.g., B frames, P frames). Alternatively, the IWCP mode may be configured to be not used for intraframes but to be used for interframes. Alternatively, the IWCP mode may be configured to be used for some interframes but not for some interframes. Since intraprediction may be used for interframes, the IWCP mode may also be used for interframes.
[0056] Illustratively, in this application, there may be a flag below the frame level and above the CU level (eg, tile, slice, patch, LCU, etc.) to specify whether the IWCP mode is used for this region.
[0057] Step 102: If the intra prediction mode parameter indicates that the current block uses the IWCP mode to determine the intra predicted value of the current block, a first mode index and a second mode index of the current block are determined.
[0058] In an embodiment of the present application, after the decoder identifies the intra prediction mode parameter of the current block, if the intra prediction mode parameter indicates that the current block uses the IWCP mode to identify the intra prediction value of the current block, the decoder can further identify a first mode index and a second mode index of the current block.
[0059] In addition, in an embodiment of the present application, the first mode index can be used to indicate the first intra prediction mode to be used for the current block, and the second mode index can be used to indicate the second intra prediction mode to be used for the current block.
[0060] Specifically, the value of the first mode index and the value of the second mode index are associated with the number of possible intra angular prediction modes of the first intra prediction mode and the second intra prediction mode. For example, the first intra prediction mode and the second intra prediction mode may each be one of 28 intra angular prediction modes with mode numbers ranging from 4 to 31. Therefore, the value of the first mode index and the value of the second mode index are both in the range of 0 to 27.
[0061] Exemplarily, in an embodiment of the present application, the parameter iwcp_pred_mode0_index may represent the first mode index, and the parameter iwcp_pred_mode1_index may represent the second mode index.
[0062] Step 103: Build an MPM list for the current block.
[0063] In an embodiment of the present application, the decoder can further construct an MPM list for the current block, where all prediction modes in the MPM list are intra-angle prediction modes.
[0064] In addition, in an embodiment of the present application, when constructing an MPM list for a current block, the decoder must first identify the weighting matrix derivation mode for the current block, and then use the weighting matrix derivation mode to identify the MPM list for the current block.
[0065] In this application, the weighting matrix derivation mode is used to specify a weighting matrix to be used for a current block. Specifically, the weighting matrix derivation mode may be a mode for deriving a weighting matrix. For a prediction block having a predetermined height and width, one weighting matrix can be derived for each of various weighting matrix derivation modes. For prediction blocks having the same size, different weighting matrices are derived from different weighting matrix derivation modes.
[0066] Illustratively, in this application, there are 56 weighting matrix derivation modes in AWP in AVS3, and there are 64 weighting matrix derivation modes in GPM in VVC.
[0067] Alternatively, in this application, when constructing the MPM list of the current block, the decoder can construct the MPM list directly based on the prediction modes and weighting matrix derivation modes of the neighboring blocks of the current block.
[0068] Alternatively, in this application, when constructing an MPM list for a current block, the decoder may construct the MPM list based on prediction modes of neighboring blocks of the current block, a preset angular prediction mode set, and a weighting matrix derivation mode. The preset angular prediction mode set may be a subset of all intra angular prediction modes. Taking AVS3 as an example, the preset angular prediction mode set may include only 28 intra angular prediction modes with mode numbers 4 to 31.
[0069] In the present application, when the ranges of the first intra prediction mode and the second intra prediction mode are not restricted, the preset angular prediction mode set may be a combination of all intra angular prediction modes. When the ranges of the first intra prediction mode and the second intra prediction mode need to be restricted, the preset angular prediction mode set may be a combination of only some intra angular prediction modes. In this case, the preset angular prediction mode set may be used to restrict the ranges of the first intra prediction mode and the second intra prediction mode. This can effectively reduce overhead and improve compression performance.
[0070] Optionally, in this application, when constructing an MPM list based on the prediction modes of neighboring blocks of the current block, a preset angle prediction mode set, and a weighting matrix derivation mode, the decoder can identify a first candidate mode using the prediction modes of the neighboring blocks and identify a second candidate mode using the weighting matrix derivation mode, and further construct an MPM list for the current block based on the first candidate mode, the second candidate mode, and the preset angle prediction mode set.
[0071] Specifically, in this application, when the decoder identifies the first candidate mode using the prediction mode of a neighboring block, if the neighboring block is a normal intra-prediction block and the prediction mode of the neighboring block is an intra-prediction mode, the decoder identifies the prediction mode of the neighboring block as the first candidate mode.
[0072] In this application, a typical intra-prediction block can be understood to be a prediction block using a prediction mode such as DC mode, planar mode, bilinear mode, or angle prediction mode, and not a prediction block using a prediction mode such as intra block copy (IBC) or intra string copy prediction.
[0073] 8 is a schematic diagram showing neighboring blocks. As shown in FIG. 8, a current block is E, (x0, y0) is the coordinate of the upper left corner sample of block E in the image, (x1, y0) is the coordinate of the upper right corner sample of block E in the image, and (x0, y1) is the coordinate of the lower left corner sample of block E in the image. Neighboring block A of current block E is the block where sample (x0-1, y0) is located, neighboring block B of current block E is the block where sample (x0, y0-1) is located, neighboring block C of current block E is the block where sample (x1+1, y0-1) is located, neighboring block D of current block E is the block where sample (x0-1, y0-1) is located, neighboring block F of block E is the block where sample (x0-1, y1) is located, and neighboring block G of block E is the block where sample (x1, y0-1) is located. The spatial relationship between the current block E and its neighboring blocks A, B, C, and D is as shown in FIG.
[0074] In this application, the decoder can utilize neighboring blocks further to the right of the current block and neighboring blocks further below.
[0075] Specifically, in the present application, when the decoder uses a weighting matrix derivation mode to identify a second candidate mode, the decoder can first identify a boundary line angle index based on the weighting matrix derivation mode, and then use the boundary line angle index to identify the second candidate mode.
[0076] It should be noted that in an embodiment of the present application, the second candidate mode may be specified to include L different intra-angle prediction modes, thereby ensuring the construction of an MPM list with length L.
[0077] Furthermore, in an embodiment of the present application, when a weighting matrix includes two types of weighting values, positions where the weighting values change form a straight line. Alternatively, when a weighting matrix includes multiple types of weighting values, positions in the transition region where the weighting values are the same may form a straight line, which may be referred to as a boundary line. The right horizontal angle may be 0 degrees, and the angle may increase counterclockwise. In this case, the boundary line may have various angles, such as 0 degrees horizontally and 90 degrees, 45 degrees, or 135 degrees vertically. When a certain weighting matrix is used for one prediction block, the corresponding textures are likely to exhibit different characteristics on both sides of the boundary line, for example, textures with two different angles on both sides of the boundary line, or an angled texture on one side of the boundary line and a flat texture on the other side of the boundary line. Because the boundary line itself has an angle, assuming that the boundary line is obtained by intra-angle prediction at one point, and the boundary line may be close to some textures of the current block, there is a correlation between this straight line and the two intra-prediction modes of the current block.
[0078] Specifically, in this application, assuming that a boundary line is obtained by intra-angle prediction at one point, at least one intra-angle prediction mode can be found, and this intra-angle prediction mode is used to approximately create the boundary line. For example, a horizontal boundary line matches a horizontal intra-prediction mode (e.g., mode 24 in AVS3). A vertical boundary line matches a vertical intra-prediction mode (e.g., mode 12 in AVS3). A 45-degree boundary line may match a 45-degree intra-prediction mode from bottom left to bottom right (e.g., mode 30 in AVS3), or a 225-degree intra-prediction mode from top right to bottom left (e.g., mode 6 in AVS3). If a weighting matrix has only one weight value, it can match modes that clearly have no angle, such as DC mode, planar mode, and bilinear mode. In this way, since the weighting matrix derivation mode can match several intra-prediction modes, the weighting matrix derivation mode can be used to assist in decoding the intra-prediction mode.
[0079] It should be noted that in this application, the weighting matrix derivation mode may be an index of the weighting matrix, for example, the 56 modes of the AWP can be considered as 56 weighting matrix derivation modes.
[0080] For example, in this application, a mapping relationship table may be constructed to further represent the mapping relationship between the weighting matrix derivation mode and the intra angle prediction mode. Specifically, the boundaries of the multiple modes of AWP and GPM all have the same angle. For example, in the AVS3 AWP, the boundaries of every eighth mode have the same angle. The 56 AWP modes have a total of eight boundary angle angles. The boundary angle index may be obtained by performing a modulo 8 (%8) operation on the mode number of the weighting matrix derivation mode. For example, Table 1 is a mapping relationship table. Taking the angle mode in AVS3 as an example, boundary angle indexes 0 and 1 may correspond to two intra angle prediction modes (one prediction mode from the top right to the bottom left, and one prediction mode from the top left to the bottom right). Specifically, for other boundary angle indexes, other approximately corresponding intra angle prediction modes may be found, or all boundary angle indexes may correspond to only one intra angle prediction mode.
[0081] [Table 1]
[0082] For a given weighting matrix, an intra angle prediction mode corresponding to the boundary line is likely to be used, and several intra angle prediction modes related to the boundary line are also likely to be used. For example, corresponding intra angle prediction modes for angles close to the boundary line or perpendicular to the boundary line may be used. The decoder can construct an MPM list for the IWCP mode using the correlation between the weighting matrix and the intra angle prediction mode. For example, when constructing an MPM list for the IWCP mode, if the list length of the MPM list is 4, candidate modes corresponding to boundary line angle indexes in Table 2 below can be added to the MPM list.
[0083] [Table 2]
[0084] According to Table 2 above, since the number of candidate modes corresponding to each boundary angle index is equal to the length of the MPM list, it is possible to ensure that the MPM list can be filled even when all of the intra-prediction modes of neighboring blocks for reference are unavailable. For example, if the length of the MPM list is 4, the number of candidate modes corresponding to each boundary angle index can be 4.
[0085] Furthermore, in this application, when constructing an MPM list based on a first candidate mode, a second candidate mode, and a preset angle prediction mode set, the decoder obtains a filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set, and constructs an MPM list based on the filtered candidate mode and the second candidate mode.
[0086] Specifically, in the present application, when a decoder obtains a filtered candidate mode by filtering a first candidate mode based on a preset angular prediction mode set, if the first candidate mode belongs to the preset angular prediction mode set, the decoder identifies the first candidate mode as the filtered candidate mode; if the first candidate mode is an intra-angle prediction mode and does not belong to the preset angular prediction mode set, the decoder identifies an alternative mode of the first candidate mode from the preset angular prediction mode set and identifies the alternative mode as the filtered candidate mode.
[0087] Furthermore, in this application, if the first candidate mode is not an intra-angle prediction mode, the decoder can directly delete the first candidate mode.
[0088] In this application, the preset angular prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angular prediction modes and does not include intra non-angular prediction modes. Therefore, for the IWCP mode, the MPM selection for the current block, i.e., the method for constructing the MPM list, must also be adjusted. Specifically, when constructing the MPM list, the decoder must refer to the intra prediction modes of neighboring blocks surrounding the current block. Examples of neighboring blocks include the left neighboring block, the above neighboring block, the upper left neighboring block, the upper right neighboring block, and the lower left neighboring block. Due to spatial correlation, if a certain prediction mode is used for the neighboring blocks, it is highly likely that the same or similar prediction mode will be used for the current block.
[0089] Alternatively, the first intra prediction mode and the second intra prediction mode in the IWCP mode can only be intra angular prediction modes. Therefore, if the intra prediction mode used for a neighboring block for reference is an intra non-angular prediction mode, i.e., if the first candidate mode is not an intra angular prediction mode, the decoder does not use the intra non-angular prediction mode used for the reference block when constructing the MPM list for the current block, i.e., does not add the intra non-angular prediction mode to the MPM list for the current block.
[0090] Optionally, the preset angular prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angular prediction modes. Therefore, if the intra prediction mode used for a neighboring block for reference is an intra angular prediction mode not included in the preset angular prediction mode set, i.e., if the first candidate mode is an intra angular prediction mode and does not belong to the preset angular prediction mode set, when constructing the MPM list for the current block, the decoder converts the intra angular prediction mode not included in the preset angular prediction mode set to an intra angular prediction mode with a similar angle in the preset angular prediction mode set, and then adds the converted intra angular prediction mode to the MPM list. Taking AVS3 as an example, according to the preset angular prediction mode set, the first intra prediction mode and the second intra prediction mode are limited to intra angular prediction modes with mode numbers 4 to 31. Furthermore, if an intra angular prediction mode with mode number 43 is used for a neighboring block of the current block, the decoder can add intra angular prediction with mode number 12, which is similar to the intra angular prediction with mode number 43, to the MPM list of the current block in IWCP mode.
[0091] In addition, in an embodiment of the present application, when constructing an MPM list based on the filtered candidate modes and the second candidate modes, the decoder adds the filtered candidate mode to the MPM list if the filtered candidate mode satisfies a predetermined additional condition, and adds the second candidate mode to the MPM list if the MPM list does not meet the predetermined list length L and the second candidate mode satisfies the predetermined additional condition, where L is an integer greater than or equal to 1.
[0092] Illustratively, in the present application, the value of L may be 4, that is, the preset list length of the MPM list is 4, or the MPM list includes 4 MPMs.
[0093] It should be noted that in the embodiment of the present application, the decoder can sort the L modes in the MPM list according to the ascending order of the mode numbers.
[0094] It should be noted that in an embodiment of the present application, if the filtered candidate mode is different from all prediction modes in the MPM list, the decoder can determine that the filtered candidate mode satisfies a predetermined additional condition. Correspondingly, if the second candidate mode is different from all prediction modes in the MPM list, the decoder can determine that the second candidate mode satisfies a predetermined additional condition.
[0095] In an embodiment of the present application, when adding filtered candidate modes corresponding to neighboring blocks to the MPM list, the decoder may identify an order parameter corresponding to the neighboring block and add the filtered intra candidate modes corresponding to the neighboring blocks to the MPM list in order based on the order parameter. The decoder may identify the corresponding order parameter according to the spatial distance between the neighboring block and the current block. For example, the closer the spatial distance between the neighboring block and the current block, the stronger the correlation between the neighboring block and the current block, and the earlier the additional processing is performed, and the smaller the order parameter. The farther the spatial distance between the neighboring block and the current block, the weaker the correlation between them, and the later the additional processing is performed, and the larger the order parameter.
[0096] Furthermore, in an embodiment of the present application, after adding the filtered candidate mode and / or the second candidate mode to the MPM list, the decoder can further sort the L prediction modes in the MPM list according to ascending order of mode number.
[0097] For example, in this application, assuming that the MPM list of the current block in IWCP mode is IwcpMpm[4], i.e., the list length of the MPM list is 4, the index of the weighting matrix derivation mode is IwcpIndex, the weighting matrix derivation mode reuses the 56 derivation modes of AWP, and the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong includes intra angle prediction modes with mode numbers 4 to 31, the decoder can sequentially perform the following steps when constructing the MPM list of the current block.
[0098] Step S1: An array cand_mode
[10] is provided, and all values of cand_mode are initialized to invalid values. The following operations are performed on cand_mode. (a) If the neighboring block F is "present" and is a normal intra-predicted block, cand_mode[0] is equal to the intra-prediction mode of F. (b) If neighboring block G is "present" and is a regular intra-predicted block, cand_mode[1] is equal to the intra-prediction mode of G. (c) If neighboring block C is "present" and is a regular intra-predicted block, cand_mode[2] is equal to the intra-prediction mode of C. (d) If neighboring block A is "present" and is a normal intra-predicted block, cand_mode[3] is equal to the intra-prediction mode of A. (e) If neighboring block B is "present" and is a regular intra-predicted block, cand_mode[4] is equal to the intra-prediction mode of B. (f) If neighboring block D is “present” and is a regular intra-predicted block, cand_mode[5] is equal to the intra-prediction mode of D. (g) cand_mode[6] is equal to the candidate mode 0 corresponding to IwcpIndex%8. (h) cand_mode[7] is equal to candidate mode 1 corresponding to IwcpIndex%8. (i) cand_mode[8] is equal to candidate mode 2 corresponding to IwcpIndex%8. (j) cand_mode[9] is equal to candidate mode 3 corresponding to IwcpIndex%8.
[0099] A neighboring block X (where X is A, B, C, D, F, or G) "exists" means that the block should be in the image and should belong to the same slice as block E. Otherwise, the neighboring block "does not exist." If a block "does not exist" or has not yet been decoded, the block is "unavailable." Otherwise, the block is "available." If a sample of an image is located in a block that "does not exist" or has not yet been decoded, the sample is "unavailable." Otherwise, the sample is "available."
[0100] In this application, the above steps (a) to (f) are the process of identifying the first candidate mode, and the above steps (g) to (j) are the process of identifying the second candidate mode. The decoder can identify the second candidate mode by referring to Table 2 above.
[0101] Step S2: For i from 0 to 5, the following operations are performed. (a) If cand_mode[i] is less than 3 or cand_mode[i] is equal to 33, set cand_mode[i] to an invalid value. That is, if the first candidate mode is an intra non-angle prediction mode, the decoder may directly delete the first candidate mode, that is, not use the first candidate mode. (b) Otherwise, if cand_mode[i] is equal to 3, then set cand_mode[i] to 4. (c) Otherwise, if cand_mode[i] is equal to 32, then set cand_mode[i] equal to 31. (d) Otherwise, if cand_mode[i] is greater than 33, perform the following operations: If cand_mode[i] is less than 44, then set cand_mode[i] equal to cand_mode[i]-30. Otherwise, if cand_mode[i] is less than 58, then set cand_mode[i] equal to cand_mode[i]-33. Otherwise, set cand_mode[i] equal to cand_mode[i]-34. That is, if the first candidate mode is an intra-angle prediction mode and does not belong to the preset angle prediction mode set, the decoder selects a similar intra-angle prediction mode from the preset angle prediction mode set as an alternative mode to the first candidate mode, and sets the alternative mode as the filtered candidate mode. (e) Otherwise, do not correct the value of cand_mode[i]. That is, if the first candidate mode belongs to the preset angular prediction mode set, the decoder can directly use the first candidate mode, that is, the first candidate mode is a filtered candidate mode.
[0102] In this application, the above step S2 is a filtering process of the first candidate mode, and the filtered candidate mode corresponding to the first candidate mode is finally identified.
[0103] Step S3: Set mpm_num to 0, and perform the following operations for i from 0 to 9. (a) If cand_mode[i] is not an invalid value, perform the following operations: Compare cand_mode[i] with IwcpMpm[j], where j is between 0 and mpm_num-1. If cand_mode[i] is not equal to IwcpMpm[j], perform the following operations. 1. Set IwcpMpm[mpm_num] equal to cand_mode[i]. 2. Set mpm_num equal to mpm_num+1. 3. If mpm_num is equal to 4, then exit step 3.
[0104] That is, provided that there are less than four prediction modes in the MPM list, if the filtered candidate mode is not the same as any of the prediction modes in the MPM list, the decoder can add the filtered candidate mode to the MPM list. If there are still less than four prediction modes in the MPM list after all filtered candidate modes that meet the preset addition conditions have been added to the MPM list, the decoder can continue to add second candidate modes that meet the preset addition conditions to the MPM list until the list length of the MPM list becomes four.
[0105] Step S4: The four values of IwcpMpm[4] are sorted in ascending order.
[0106] Finally, the decoder can sort the four intra angle prediction modes in the MPM list in ascending order of mode number.
[0107] This application does not limit the execution order of the above steps 102 and 103, that is, does not limit the order of the process of identifying the first mode index and the second mode index and the process of building the MPM list.
[0108] Step 104: Identify a first intra prediction mode and a second intra prediction mode of the current block according to the first mode index, the second mode index, and the MPM list, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes.
[0109] In an embodiment of the present application, after the decoder identifies the first mode index and the second mode index of the current block and constructs the MPM list of the current block, the decoder can further identify the first intra-prediction mode and the second intra-prediction mode of the current block based on the first mode index, the second mode index and the MPM list.
[0110] In some embodiments, the first intra prediction mode and the second intra prediction mode may be different intra angular prediction modes. Specifically, in some embodiments, the first intra prediction mode and the second intra prediction mode may be different intra angular prediction modes in a set of preset angular prediction modes.
[0111] That is, in this application, both the first intra prediction mode and the second intra prediction mode must be intra angular prediction modes. That is, neither the first intra prediction mode nor the second intra prediction mode is a basic intra prediction mode other than the intra angular prediction mode (e.g., an intra non-angular prediction mode including a DC mode, a Planar mode, a PLANE mode, a Bilinear mode, a PCM mode, etc.). Basic intra prediction modes include, but are not limited to, angular prediction modes and non-angular prediction modes. For example, there are 67 intra prediction modes used in VVC and 66 intra prediction modes used in AVS3.
[0112] In addition, in this application, by limiting the first intra prediction mode and the second intra prediction mode to intra angle prediction modes, on the one hand, when implementing the IWCP mode in parallel, only one set of circuits supporting intra angle weighted prediction needs to be added to the hardware, thereby reducing the complexity of the hardware implementation of the IWCP mode; on the other hand, although the intra weighted combined prediction mode itself is applied to blocks with relatively complex content, the intra non-angle prediction mode is usually used to handle scenes with relatively uniform texture changes, and overhead can be reduced by using fewer modes, so whether or not to use the intra non-angle prediction mode for the IWCP mode has little impact on compression performance.
[0113] In addition, in this application, the more available intra prediction modes are, the more accurate the prediction value can be generated, but the overhead for transmitting the selected mode flags in the bitstream increases accordingly. Therefore, to obtain better compression performance, a reasonable set of available intra prediction modes can be selected to better balance both prediction effectiveness and overhead. Specifically, the decoder can limit the available intra angular prediction modes of the first intra prediction mode and the second intra prediction mode using a preset angular prediction mode set, which is a subset of all intra angular prediction modes. Taking AVS3 as an example, AVS3 has 62 angular modes, i.e., intra angular prediction modes with mode numbers 3 to 32 and 34 to 65.
[0114] For example, in the present application, the first intra prediction mode and the second intra prediction mode may use only intra angle prediction modes with mode numbers 3 to 32, or may use only 28 intra angle prediction modes with mode numbers 4 to 31.
[0115] Illustratively, in this application, taking VVC as an example, the first intra prediction mode and the second intra prediction mode may use only intra angle prediction modes with even mode numbers, or may use only intra angle prediction modes with odd mode numbers.
[0116] For example, in this application, the set of angular prediction modes used for the first intra prediction mode is different from the set of angular prediction modes used for the second intra prediction mode. Optionally, the decoder can restrict the first intra prediction mode and the second intra prediction mode using the same preset angular prediction mode set. That is, if the first intra prediction mode can use only 28 intra angular prediction modes with mode numbers 4 to 31 and the second intra prediction mode can also use only 28 intra angular prediction modes with mode numbers 4 to 31, the first intra prediction mode and the second intra prediction mode can use the same MPM list and the same or similar encoding and decoding methods. That is, if the decoder restricts the first intra prediction mode and the second intra prediction mode using different preset angular prediction mode sets, different MPM lists or significantly different encoding and decoding methods must be used for the first intra prediction mode and the second intra prediction mode.
[0117] In addition, in an embodiment of the present application, the decoder can identify a first mapping relationship table between index values and binary strings, where the first mapping relationship table includes binary strings having a first length, binary strings having a second length, and binary strings having a third length, respectively.
[0118] Illustratively, in this application, the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
[0119] It should be noted that in the present application, a first mapping relationship table between index values and binary strings can be used to identify the values of the first mode index and the second mode index.
[0120] Alternatively, in the present application, when 28 intra angular prediction modes with mode numbers 4 to 31 are used in AVS3, i.e., when a total of 28 modes are included in the preset angular prediction mode set, the modes may be coded in a format of 4+8+16, i.e., four modes with the shortest codewords, eight modes with short codewords, and 16 modes with long codewords. The four modes with the shortest codewords use 3-bit codewords, i.e., a first length. The eight modes with short codewords use 5-bit codewords, i.e., a second length. The 16 modes with long codewords use 6-bit codewords, i.e., a third length.
[0121] In this application, the prediction angles of the 28 intra angular prediction modes with mode numbers 4 to 31 basically cover the entire commonly used angle range. At the same time, the intra angular prediction modes with mode numbers 4 to 31 are simpler than the intra angular prediction modes with mode numbers 34 to 65, and the 28 modes are coded in the format of 4+8+16, which does not waste codewords. Therefore, it is preferable that the decoder defines a preset angular prediction mode set based on the 28 intra angular prediction modes with mode numbers 4 to 31.
[0122] Also, in an embodiment of the present application, if the list length of the MPM list of the current block is 4, the binary string having the first length can be used for four MPMs in the MPM list, i.e., the four modes with the shortest codewords can be used for the four MPMs in the MPM list. Accordingly, the binary string having the second length and the binary string having the third length can be used for other prediction modes in the preset angle prediction mode set that are not included in the MPM list.
[0123] Optionally, in this application, for the remaining 24 intra angular prediction modes in the preset angular prediction mode set other than the four MPMs in the MPM list, the decoder may uniformly distribute modes with short codewords and modes with long codewords. Specifically, the decoder may uniformly distribute eight modes with short codewords (binary strings having a second length) among the remaining 24 intra angular prediction modes. For example, one mode with short codewords (binary strings having a second length) is used for every two modes with long codewords (binary strings having a third length). In a more specific implementation process, the remaining 24 intra angular prediction modes are realized by performing a modulo-3 (%) operation on serial numbers 0 to 23. For example, a mode whose modulo-3 serial number remainder is 2 uses a 5-bit codeword, i.e., a binary string having a second length. A mode whose modulo-3 serial number remainder is 0 or 1 uses a 6-bit codeword, i.e., a binary string having a third length.
[0124] For example, in the present application, 28 intra angle prediction modes with mode numbers 4 to 31 are used, that is, the preset angle prediction mode set includes 28 modes. In this case, the first mapping relationship table between the index value and the binary string is as shown in Table 3, where the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
[0125] [Table 3]
[0126] The first bit can indicate whether or not the mode is an MPM, for example, "1" indicates an MPM and "0" indicates no MPM. If the first intra prediction mode is an MPM, assuming that the MPM list includes four MPMs, two bits can be used to indicate which MPM in the MPM list is used. For example, "00, 01, 10, 11" represent the first MPM, second MPM, third MPM, and fourth MPM in the MPM list, respectively.
[0127] Furthermore, in this application, a binary string whose bit flag is 0 is decoded using a context model, and a binary string whose bit flag is not 0 is decoded without using a context model. The value of the bit flag can indicate how many bits are decoded, and the bit flag can be represented by binIdx.
[0128] In this application, when performing debinarization based on Table 3 on the decoding side, a binary string with binIdx of 0 can be decoded using a context model, and a binary string with binIdx not equal to 0 can be decoded using an equal probability model or a bypass mode.
[0129] Furthermore, in this application, when the decoder identifies the first intra prediction mode and the second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list, the decoder may first identify the value i (i is an integer greater than or equal to 0) of the first mode index based on a first mapping relationship table between index values and binary strings. If i is greater than or equal to 0 and less than L, the decoder identifies the angular prediction mode with index i in the MPM list as the first intra prediction mode. If i is greater than or equal to L, the decoder identifies the first intra prediction mode using a preset angular prediction mode set and the MPM list.
[0130] Specifically, in this application, when a decoder identifies a first intra prediction mode using a preset angular prediction mode set and an MPM list, if i is greater than or equal to the mode number of the first mode in the MPM list, the decoder adds 1 to i. If (i+1) is greater than or equal to the mode number of the second mode in the MPM list, the decoder adds 1 to (i+1). If (i+2) is greater than or equal to the mode number of the third mode in the MPM list, the decoder adds 1 to (i+2). If (i+3) is greater than or equal to the mode number of the fourth mode in the MPM list, the decoder adds 1 to (i+3). The decoder identifies (i+4) as the mode number of the first intra prediction mode and identifies the first intra prediction mode from the preset angular prediction mode set.
[0131] Accordingly, in this application, when a decoder identifies a first intra prediction mode using a preset angular prediction mode set and an MPM list, if i is smaller than the mode number of the first mode in the MPM list, the decoder identifies the first intra prediction mode as the mode number of the first intra prediction mode from the preset angular prediction mode set; if (i+1) is smaller than the mode number of the second mode in the MPM list, the decoder identifies the first intra prediction mode as the mode number of the first intra prediction mode from the preset angular prediction mode set; or if (i+2) is smaller than the mode number of the third mode in the MPM list, the decoder identifies the first intra prediction mode as the mode number of the first intra prediction mode from the preset angular prediction mode set. Alternatively, if (i+3) is less than the mode number of the fourth mode in the MPM list, the decoder identifies (i+3) as the mode number of the first intra-prediction mode and identifies the first intra-prediction mode from the preset angular prediction mode set.
[0132] For example, in the present application, if the mode numbers of four MPMs in an MPM list are 4, 8, 12, and 16, respectively, and the value i of a first mode index identified based on the first mapping relationship table between index values and binary strings shown in Table 3 above is 5, the decoder sequentially compares i with the mode numbers of the four MPMs in the MPM list in a preset angular prediction mode set including 28 intra angular prediction modes with mode numbers 4 to 31. Specifically, because 5 is greater than the mode number of the first mode in the MPM list, the decoder can add 1 to i, i.e., i+1=6. Next, the decoder compares 6 with the mode number of the second mode in the MPM list. Because 6 is less than 8, the decoder can identify the value of (i+1), 6, as the mode number of the first intra prediction mode and identify the intra prediction mode with mode number 6 in the preset angular prediction mode set as the first intra prediction mode.
[0133] For example, in the present application, if the mode numbers of four MPMs in the MPM list are 4, 8, 12, and 16, respectively, and the value i of the first mode index identified based on the first mapping relationship table between index values and binary strings shown in Table 3 above is 10, then in a preset angular prediction mode set including 28 intra angular prediction modes with mode numbers 4 to 31, the decoder sequentially compares i with the mode numbers of the four MPMs in the MPM list. Specifically, because 10 is greater than the mode number of the first mode in the MPM list, the decoder can add 1 to i, i.e., i+1=11. Next, the decoder compares 11 with the mode number of the second mode in the MPM list. Because 11 is greater than 8, the decoder can add (i+1) and 1, i.e., (i+1)+1=12. Next, the decoder compares 12 with the mode number of the third mode in the MPM list. Because 12 equals 12, the decoder can add (i+2) and 1, i.e., (i+2)+1=13. The decoder then compares 13 with the mode number of the fourth mode in the MPM list. Because 13 is less than 16, the decoder can identify the value of (i+3), 13, as the mode number of the first intra-prediction mode and identify the intra-prediction mode in the preset angular prediction mode set with mode number 13 as the first intra-prediction mode.
[0134] Furthermore, in this application, when the decoder determines the first intra prediction mode and the second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list, the decoder may first determine the value j (j is an integer greater than or equal to 0) of the second mode index based on the first mapping relationship table. If j is greater than or equal to 0 and less than L, the decoder determines the (j+1)th angular prediction mode in the MPM list as the second intra prediction mode. If j is greater than or equal to L, the decoder determines the second intra prediction mode using the preset angular prediction mode set and the MPM list.
[0135] Specifically, in this application, when the decoder identifies the second intra prediction mode using the preset angular prediction mode set and the MPM list, if j is greater than or equal to the mode number of the first mode in the MPM list, the decoder adds 1 to j. If (j+1) is greater than or equal to the mode number of the second mode in the MPM list, the decoder adds 1 to (j+1). If (j+2) is greater than or equal to the mode number of the third mode in the MPM list, the decoder adds 1 to (j+2). If (j+3) is greater than or equal to the mode number of the fourth mode in the MPM list, the decoder adds 1 to (j+3). The decoder identifies (j+4) as the mode number of the second intra prediction mode and identifies the second intra prediction mode from the preset angular prediction mode set.
[0136] Accordingly, in this application, when a decoder identifies a second intra prediction mode using the preset angular prediction mode set and the MPM list, if j is less than the mode number of the first mode in the MPM list, the decoder identifies the second intra prediction mode as the mode number of the second intra prediction mode from the preset angular prediction mode set. If (j+1) is less than the mode number of the second mode in the MPM list, the decoder identifies the second intra prediction mode as the mode number of the second intra prediction mode from the preset angular prediction mode set. Alternatively, if (j+2) is less than the mode number of the third mode in the MPM list, the decoder identifies the second intra prediction mode as the mode number of the second intra prediction mode from the preset angular prediction mode set. Alternatively, if (j+3) is less than the mode number of the fourth mode in the MPM list, the decoder identifies the mode number of the second intra prediction mode from the preset angular prediction mode set as the mode number of the second intra prediction mode.
[0137] For example, in the present application, if the IWCP mode is used for a current block, the length of the MPM list of the current block is 4, i.e., L=4, and the preset angular prediction mode set includes 28 intra angular prediction modes with mode numbers 4 to 31, the decoder may identify a first mode index iwcp_pred_mode0_index and a second mode index iwcp_pred_mode1_index by decoding the bitstream. Furthermore, based on the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index, the decoder may derive the first intra prediction mode as IwcpPredMode0 and the second intra prediction mode as IwcpPredMode1.
[0138] Specifically, the decoder may perform the following operations when identifying the first intra-prediction mode IwcpPredMode0 using the first mode index iwcp_pred_mode0_index.
[0139] 1. Based on Table 3, determine the value of iwcp_pred_mode0_index to i by de-binarizing the binary string.
[0140] Specifically, after identifying the iwcp_pred_mode0_index in binary string format through decoding, the binary string can be identified through inverse binarization based on Table 3, that is, find the binary string that matches the iwcp_pred_mode0_index from the right column of Table 3, and then identify the value i of iwcp_pred_mode0_index from the left column of the same row.
[0141] 2. When i is greater than or equal to 0 and less than 4, IwcpPredMode0 is equal to IwcpMpm[i].
[0142] 3. If i is 4 or greater, IwcpPredMode0 is equal to (iwcp_pred_mode0_index+(iwcp_pred_mode0_index>=IwcpMpm[0])+((iwcp_pred_mode0_index+1)>=IwcpMpm[1])+((iwcp_pred_mode0_index+2)>=IwcpMpm[2])+((iwcp_pred_mode0_index+3)>=IwcpMpm[3])).
[0143] That is, in this application, if the first intra prediction mode IwcpPredMode0 does not belong to the MPM list and is one of the other 24 intra angular prediction modes in the preset angular prediction mode set other than the MPM in the MPM list, the decoder compares the value i of the first mode index iwcp_pred_mode0_index with the mode number of each angular prediction mode in the MPM list, and determines whether to add 1 according to the comparison result. Finally, the decoder calculates the mode number of the first intra prediction mode, and identifies the first intra prediction mode from the preset angular prediction mode set according to the mode number.
[0144] Specifically, the decoder may perform the following operations when identifying the second intra-prediction mode IwcpPredMode1 using the second mode index iwcp_pred_mode1_index.
[0145] 1. Based on Table 3, determine the value of iwcp_pred_mode1_index to j by de-binarizing the binary string.
[0146] Specifically, after identifying iwcp_pred_mode1_index in binary string format through decoding, the binary string can be identified through inverse binarization based on Table 3, that is, find the binary string that matches iwcp_pred_mode1_index from the right column of Table 3, and then identify the value j of iwcp_pred_mode1_index from the left column of the same row.
[0147] 2. If j is greater than or equal to 0 and less than 4, IwcpPredMode1 is equal to IwcpMpm[i].
[0148] 3. If j is 4 or greater, IwcpPredMode1 is equal to (iwcp_pred_mode1_index+(iwcp_pred_mode1_index>=IwcpMpm[0])+((iwcp_pred_mode1_index+1)>=IwcpMpm[1])+((iwcp_pred_mode1_index+2)>=IwcpMpm[2])+((iwcp_pred_mode1_index+3)>=IwcpMpm[3])).
[0149] In addition, in an embodiment of the present application, in the IWCP mode, a predicted value of the current block needs to be determined using a first intra prediction mode and a second intra prediction mode. The first intra prediction mode and the second intra prediction mode may share one preset angular prediction mode set and may also share the same MPM list. Because the first intra prediction mode and the second intra prediction mode in the IWCP mode are not the same, the first intra prediction mode can be referenced when encoding or decoding the second intra prediction mode. Specifically, the first intra prediction mode can be excluded when determining the second intra prediction mode.
[0150] In the present application, for 28 intra-angle prediction modes, in the above 4+8+16 encoding / decoding scheme, there is a high probability that four MPMs in the MPM list will appear (the probability that the first intra-prediction mode is one of the four MPMs in the MPM list is approximately 50%, and the probability that the second intra-prediction mode is one of the four MPMs in the MPM list is approximately 50%). If the first intra-prediction mode and the second intra-prediction mode are both MPMs in the MPM list, when identifying the second intra-prediction mode, only one of the other three MPMs in the MPM list other than the first intra-prediction mode can be selected. In this way, while originally selecting one from four and requiring four 3-bit codewords, selecting one from three requires one 2-bit codeword and two 3-bit codewords. Accordingly, if neither the first intra prediction mode nor the second intra prediction mode is an MPM in the MPM list, one of the 24 intra angle prediction modes (8+16) may be removed for the second intra prediction mode, although the impact of this is relatively small.
[0151] As can be seen from the above, if the first intra prediction mode and the second intra prediction mode are both MPMs in the MPM list, when identifying the second intra prediction mode, the first intra prediction mode can be deleted first, thereby reducing overhead.
[0152] Furthermore, in an embodiment of the present application, when the first intra prediction mode is an MPM in the MPM list, that is, when the value i of the first mode index is greater than or equal to 0 and less than L, the decoder identifies the (i+1)th angular prediction mode in the MPM list as the first intra prediction mode. After that, when identifying the second intra prediction mode, the decoder may identify the value j of the second mode index based on a second mapping relationship table between index values and binary strings. If j is greater than or equal to i, j is added by 1. If, after adding 1, j is greater than or equal to 0 and less than L, the decoder identifies the (j+1)th angular prediction mode in the MPM list as the second intra prediction mode. If j is greater than or equal to L, the decoder identifies the second intra prediction mode using the preset angular prediction mode set and the MPM list.
[0153] In addition, in an embodiment of the present application, the decoder can identify a second mapping relationship table between index values and binary strings, where the second mapping relationship table includes binary strings having a first length, binary strings having a second length, binary strings having a third length, and binary strings having a fourth length, respectively.
[0154] Illustratively, in this application, the first length is 3 bits, the second length is 5 bits, the third length is 6 bits, and the fourth length is 2 bits.
[0155] It should be noted that in this application, the second mapping relationship table between index values and binary strings is only used to identify the value of the second mode index.
[0156] Optionally, in this application, the second mapping relationship table between index values and binary strings is as shown in Table 4, where the first length is 3 bits, the second length is 5 bits, the third length is 6 bits, and the fourth length is 2 bits.
[0157] [Table 4]
[0158] The length of the MPM list is 4, and the preset angular prediction mode set includes 28 intra angular prediction modes with mode numbers 4 to 31. The decoder can identify the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index by decoding the bitstream. Furthermore, the decoder can derive the first intra prediction mode as IwcpPredMode0 and the second intra prediction mode as IwcpPredMode1 based on the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index.
[0159] In this application, when performing debinarization based on Table 4 on the decoding side, a binary string with binIdx of 0 can be decoded using a context model, and a binary string with binIdx other than 0 can be decoded using an equal probability model or a bypass mode.
[0160] Specifically, the decoder may perform the following operations when identifying the first intra-prediction mode IwcpPredMode0 using the first mode index iwcp_pred_mode0_index. 1. Based on Table 3, determine the value of iwcp_pred_mode0_index to i by de-binarizing the binary string. 2. When i is greater than or equal to 0 and less than 4, IwcpPredMode0 is equal to IwcpMpm[i]. 3. If i is 4 or greater, IwcpPredMode0 is equal to (iwcp_pred_mode0_index+(iwcp_pred_mode0_index>=IwcpMpm[0])+((iwcp_pred_mode0_index+1)>=IwcpMpm[1])+((iwcp_pred_mode0_index+2)>=IwcpMpm[2])+((iwcp_pred_mode0_index+3)>=IwcpMpm[3])).
[0161] Specifically, the decoder may perform the following operations when identifying the second intra-prediction mode IwcpPredMode1 using the second mode index iwcp_pred_mode1_index. 1. If i is greater than or equal to 0 and less than 4, perform the following operations: (a) Based on Table 4, the value of iwcp_pred_mode1_index is determined to be j by de-binarizing the binary string. (b) If iwcp_pred_mode1_index is greater than or equal to iwcp_pred_mode0_index, i.e., j is greater than or equal to i, then iwcp_pred_mode1_index is equal to iwcp_pred_mode1_index+1, i.e., j is added to 1, i.e., j=j+1, and then perform step 3. 2. If i is 4 or greater, determine the value of iwcp_pred_mode1_index as j by de-binarizing the binary string based on Table 3, and then perform step 3. 3. If j is greater than or equal to 0 and less than 4, IwcpPredMode1 is equal to IwcpMpm[i]. 4. If j is 4 or greater, IwcpPredMode1 is equal to (iwcp_pred_mode1_index+(iwcp_pred_mode1_index>=IwcpMpm[0])+((iwcp_pred_mode1_index+1)>=IwcpMpm[1])+((iwcp_pred_mode1_index+2)>=IwcpMpm[2])+((iwcp_pred_mode1_index+3)>=IwcpMpm[3])).
[0162] As can be seen from the above, if the second intra prediction mode needs to be identified based on the first intra prediction mode, the value j of iwcp_pred_mode1_index depends on the value i of iwcp_pred_mode0_index. Specifically, taking Table 4 as an example, if the first intra prediction mode and the second intra prediction mode are both MPMs in the MPM list, there are only three available MPMs for the second intra prediction mode, and the MPMs can be represented by one or two bits. For example, "00," "01," and "10" represent the remaining first, second, and third MPMs, respectively. By eliminating one possibility in this way, overhead can be reduced by changing the encoding / decoding method or the binarization or de-binarization method.
[0163] In an embodiment of the present application, the preset angular prediction mode set includes 28 intra angular prediction modes with mode numbers 4 to 31, and the length of the MPM list is 4. When a first mapping relationship table between index values and binary strings is identified using binary strings having a first length, binary strings having a second length, and binary strings having a third length, the binary strings having the first length, i.e., the shortest codewords, may be first used for four MPMs in the MPM list. Next, the binary strings having the second length are used for eight intra angular prediction modes selected from the remaining 24 intra angular prediction modes, and the binary strings having the third length are used for the selected 16 intra angular prediction modes.
[0164] Specifically, in this application, for the remaining 24 intra-angle prediction modes, in ascending order of mode numbers, short codewords, i.e., binary strings having a second length, can be used for prediction modes corresponding to the first 8 mode numbers, and then long codewords, i.e., binary strings having a third length, can be used for prediction modes corresponding to the subsequent 16 mode numbers.
[0165] For example, in the present application, the first mapping relationship table between index values and binary strings shown in Table 3 above can be replaced with the following Table 5. Table 5, which represents the first mapping relationship table between index values and binary strings, can also be used to specify the values of the first mode index and the second mode index.
[0166] [Table 5]
[0167] Accordingly, the second mapping relationship table between index values and binary strings shown in Table 4 above can be replaced with the following Table 6. Table 6 for representing the second mapping relationship table between index values and binary strings can also be used to specify the value of the second mode index.
[0168] [Table 6]
[0169] In the present application, 28 intra angular prediction modes with mode numbers 4 to 31 are used. In other words, when the preset angular prediction mode set includes 28 modes, encoding can be performed in the form of 4+8+16, i.e., using 4 modes with 3-bit codewords, 8 modes with 5-bit codewords, and 16 modes with 6-bit codewords.
[0170] Alternatively, in this application, if the preset angular prediction mode set includes a total of 20 modes, these modes can be represented by four 3-bit codewords and sixteen 5-bit codewords.
[0171] Alternatively, in this application, if the preset angular prediction mode set includes a total of 36 modes, these modes can be represented by four 3-bit codewords or 32 6-bit codewords. For example, AVS3 uses 36 intra angular prediction modes with mode numbers 4 to 31, 42 to 45, and 56 to 59.
[0172] In this application, when all modes in a preset angle prediction mode set are represented by a set of binary strings as shown in Table 3 or Table 4, a "codeword" can be understood as a binary string. The length of the codeword can be understood as the length of the binary string. Another way of expressing it is the sum of a flag and a binary string. For example, a binary MPM_flag is used to indicate whether the current mode is an MPM mode. That is, when MPM_flag is 1, it indicates that the current mode is an MPM mode, and when MPM_flag is 0, it indicates that the current mode is not an MPM mode. When the current mode is an MPM mode, MPM has a total of four possibilities, and a 2-bit binary string indicates which MPM the current mode is. In this case, a codeword can be understood as the sum of a flag and a binary string, and the length of the codeword can be understood as the sum of the length of the flag and the binary string.
[0173] Step 105: Identify a weighting matrix of the current block, and determine a predicted value of the current block based on the first intra-prediction mode, the second intra-prediction mode, and the weighting matrix.
[0174] In an embodiment of the present application, after identifying the first intra prediction mode and the second intra prediction mode to be used for the current block, the decoder further needs to identify a weighting matrix for the current block so as to identify a predicted value for the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix.
[0175] Specifically, in this application, the decoder can identify the weighting matrix of the current block based on the weighting matrix derivation mode of the current block.
[0176] Furthermore, in the present application, when determining a predicted value of a current block based on a first intra-prediction mode, a second intra-prediction mode, and a weighting matrix, the decoder can first determine a first predicted value of the current block based on the first intra-prediction mode, determine a second predicted value of the current block based on the second intra-prediction mode, and then perform a weighting operation on the first predicted value and the second predicted value using the weighting matrix to obtain the predicted value of the current block.
[0177] It should be noted that in this application, both the first intra prediction mode and the second intra prediction mode can be intra angular prediction modes, that is, in this embodiment, two different intra angular prediction modes are used, and the first intra prediction mode and the second intra prediction mode are used to generate the first prediction block and the second prediction block, respectively, and the prediction block of the current block is determined based on the first prediction block, the second prediction block, and the weighting matrix.
[0178] Also, in embodiments of the present application, the weight values of all points in each weight matrix in all possible weight matrices are not the same, in other words, at least one possible weight matrix includes at least two different weight values.
[0179] In an embodiment of the present application, the decoder may determine the weighting matrix using a method similar to GPM or AWP. Specifically, when GPM or AWP is used in the same video encoding / decoding standard or encoder / decoder, the weighting matrix may be determined using the method, thereby allowing some of the same logic to be reused. For example, when AWP is used for inter prediction in AVS3, the weighting matrix may be determined using the AWP method in AVS3. Of course, a method different from GPM or AWP in the same video encoding / decoding standard or encoder / decoder is also possible, such as using a different number of modes, a different algorithm for the transition region, or different parameters. Since inter prediction utilizes temporal correlation, a reconstructed image in the reference image is used as the reference block. Since intra prediction utilizes spatial correlation, reconstructed samples surrounding the current block are used as reference samples. In the spatial domain, the closer the distance, the stronger the correlation, and the farther the distance, the weaker the correlation. Therefore, if a weighting matrix causes the sample positions of a prediction block to move away from the reference samples, such a weighting matrix may not be used because it may not produce a better prediction value than existing techniques, and instead, the weighting matrix may be used for inter prediction.
[0180] In an embodiment of the present application, an intra prediction method is provided. The encoder / decoder can identify two different prediction blocks for a current block using two different intra angle prediction modes, and then combine the two different prediction blocks with various weighting matrices to finally obtain a more complex prediction block. This improves the accuracy of intra prediction, reduces the cost and complexity of hardware implementation, realizes a simple and efficient encoding / decoding method, and improves compression performance.
[0181] Based on the above embodiment, in another embodiment of the present application, the following predicted sample matrix is the above-mentioned predicted block, i.e., "block" can be understood as "sample matrix", and the arrays mentioned in the specification mean matrices. Although IWCP is used to predict the luma component as an example, the present invention is not limited to the luma component and can be used for the chroma component and any other component in any format. For example, when the intra prediction method proposed in the present application is applied to AVS3, a specific process in which a decoder determines a predicted value of a current block using IWCP mode can be described as follows:
[0182] In addition, in one specific decoding embodiment, since the AWP technology is used in AVS3, the weighting matrix of the intra weighted combined prediction (IWCP) mode reuses the weighting matrix of AWP, that is, the derivation method of the weighting matrix of IWCP is the same as the derivation method of the weighting matrix of AWP.
[0183] For example, one sequence-level flag is used to specify whether IWCP mode is used for the current sequence waiting to be decoded. For example, the definition of the sequence header is shown in Table 7.
[0184] [Table 7]
[0185] The IWCP mode usage flag iwcp_enable_flag is a binary variable. A value of "1" for iwcp_enable_flag indicates that the IWCP mode is available, and a value of "0" for iwcp_enable_flag indicates that the IWCP mode is not available. The value of iwcpEnableFlag is equal to iwcp_enable_flag. If iwcp_enable_flag does not exist in the bitstream, the value of IwcpEnableFlag is 0.
[0186] Alternatively, a frame-level flag can be used to specify whether the IWCP mode is used for the current frame waiting to be decoded. For example, the IWCP mode can be configured to be used for intraframes (e.g., I frames) but not for interframes (e.g., B frames, P frames). Alternatively, the IWCP mode can be configured to be used for interframes but not for intraframes. Alternatively, the IWCP mode can be configured to be used for some interframes but not for some interframes.
[0187] Alternatively, flags below the frame level and above the CU level (e.g., tile, slice, patch, LCU, etc.) can be used to indicate whether the IWCP mode is used for the region corresponding to the flag.
[0188] For example, when decoding a current CU, if the current CU meets the IWCP usage conditions, the decoder decodes the IWCP usage flag of the current CU. Otherwise, there is no need to decode the IWCP usage flag of the current CU. The IWCP usage conditions are that the current CU is an intra-coded CU (hereinafter, IntraCuFlag is 1), IWCP can be used in the current sequence (hereinafter, IwcpEnableFlag is 1), and the size of the current block meets the restrictions (hereinafter, width >= IwcpMinSize && height >= IwcpMinSize && width <= IwcpMaxSize && height <= IwcpMaxSize). In one possible case, IwcpMinSize is equal to 8 and IwcpMaxSize is equal to 32. In another possible case, IwcpMinSize is equal to 8 and IwcpMaxSize is equal to 16. width is the width of the current CU, and height is the height of the current CU.
[0189] For example, in YUV4:2:0 format coding, an 8x8 luma block corresponds to a 4x4 chroma block at the same position. One possible method is to allow the IWCP mode to be used for the 8x8 luma block but prohibit its use for the 4x4 chroma block. This is because the prediction effect improvement of the IWCP mode is not significant for 4x4 blocks and the hardware implementation cost increases.
[0190] For example, when IWCP is used for the current CU, other modes such as Derived Tree (DT) mode, Intra Prediction Filter (IPF), and Improved Intra Prediction (IIP) are not used for the current CU. That is, when IWCP is used for the current CU, there is no need to process information about these modes. This is because combining IWCP with these modes does not significantly improve the prediction effect. Conversely, when IWCP is used for the current CU, if DT, IPF, and IIP are not used by default, there is no need to transmit flags (e.g., dt_split_flag, intra_pf_flag, iip_flag) indicating whether these modes are used or not in the bitstream, which can save codewords and is advantageous for compression efficiency.
[0191] An example is shown in Table 8.
[0192] [Table 8]
[0193] The IWCP flag iwcp_flag is a binary variable, where a value of "1" indicates that the IWCP mode should be used, and a value of "0" indicates that the IWCP mode should not be used. The value of iwcpFlag is equal to the value of iwcp_flag. If iwcp_flag is not present in the bitstream, the value of IwcpFlag is 0.
[0194] The DT mode split flag dt_split_flag is a binary variable. A value of '1' for dt_split_flag indicates that DT mode splitting should be performed, and a value of '0' for dt_split_flag indicates that DT mode splitting should not be performed. The value of DtSplitFlag is equal to the value of dt_split_flag, and its value ranges from 0 to 4. If dt_split_flag is not present in the bitstream, the value of DtSplitFlag is 0. DT mode splitting indicates that the current CU can be split into rectangular prediction units.
[0195] The IPF flag intra_pf_flag is a binary variable. A value of "1" for intra_pf_flag indicates that the IPF should be used for the current coding unit, and a value of "0" for intra_pf_flag indicates that the IPF should not be used for the current coding unit. The value of IntraPfFlag is equal to the value of intra_pf_flag. If intra_pf_flag is not present in the bitstream, the value of IntraPfFlag is 0. After an initial prediction is generated, the IPF can be used to generate a new prediction by filtering the initial prediction using reference samples.
[0196] The IIP flag iip_flag is a binary variable. A value of "1" for iip_flag indicates that an IIP should be used for the current coding unit, and a value of "0" for iip_flag indicates that an IIP should not be used for the current coding unit. The value of IipFlag is equal to the value of iip_flag. If iip_flag is not present in the bitstream, the value of IipFlag is 0. An IIP can be used to generate a prediction using a filter that is different from the filter used when an IIP is not used. As an example, for a certain angular prediction, an IIP uses an 8-tap filter to generate a prediction. When an IIP is not used, a 4-tap filter is used to generate a prediction.
[0197] For example, if IWCP is currently used in a CU, the bitstream needs to be decoded to identify the weighting matrix derivation mode iwcp_idx and the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_model_index of the two intra prediction modes, as shown in Table 9. The weighting matrix derivation mode reuses the weighting matrix derivation mode of AWP.
[0198] [Table 9]
[0199] The IWCP mode index iwcp_idx is used to identify the weighting matrix of the IWCP mode. The value of IwcpIndex is equal to the value of iwcp_idx. If iwcp_idx does not exist in the bitstream, the value of IwcpIndex is equal to 0.
[0200] The first mode index iwcp_pred_mode0_index in the IWCP mode is used to identify the first intra prediction mode IwcpPredMode0 of the luminance block in the IWCP mode.
[0201] The second mode index iwcp_pred_mode1_index in the IWCP mode is used to identify the second intra prediction mode IwcpPredMode1 of the luminance block in the IWCP mode.
[0202] Furthermore, after the first intra prediction mode and the second intra prediction mode are determined, the first intra luma prediction sample matrix predMatrixY0 can be determined based on IwcpPredMode0, and the second intra luma prediction sample matrix predMatrixY1 can be determined based on IwcpPredMode1, based on the method of step 105 in the above embodiment. After the luma weighting matrix IwcpWeightMatrixY is determined based on IwcpIndex, the luma weighting matrix IwcpWeightMatrixY is used to perform a weighting operation on the first intra luma prediction sample matrix predMatrixY0 and the second intra luma prediction sample matrix predMatrixY1, thereby finally determining the luma prediction sample matrix predMatrixIwcpY.
[0203] Specifically, when determining the IWCP luma prediction sample matrix predMatrixIwcpY based on the two intra luma prediction sample matrices (predMatrixY0, predMatrixY1) and the weighting matrix IwcpWeightMatrixY, the specific method is as follows:
[0204] The value of the element predMatrixIwcpY[x][y] in the prediction sample matrix predMatrixIwcpY for the intra weighted combination prediction mode is ((predMatrixY0[x][y]*IwcpWeightMatrixY[x][y]+predMatrixY1[x][y]*(8-IwcpWeightMatrixY[x][y])+4) >> 3), where (x, y) is the coordinate position within the current block.
[0205] Furthermore, after identifying the IWCP prediction block, i.e., the IWCP mode prediction sample matrix predMatrixIwcpY, subsequent processing may further include decoding the quantized coefficients, identifying a residual block by inverse transform and inverse quantization, combining the residual block and the prediction block to obtain a reconstructed block, subsequent in-loop filtering, etc.
[0206] In an embodiment of the present application, an intra prediction method is provided. An encoder / decoder can identify two different prediction blocks for a current block using two different intra angle prediction modes. Then, by combining the two different prediction blocks with various weighting matrices, a more complex prediction block can be finally obtained. This improves the accuracy of intra prediction, reduces hardware implementation costs and complexity, realizes a simple and efficient encoding / decoding method, and improves compression performance.
[0207] In one embodiment of the present application, an intra prediction method applied to an encoder is provided. Figure 9 is a second flowchart showing the implementation of the intra prediction method. As shown in Figure 9, the method for intra prediction by the encoder can include the following steps:
[0208] Step 201: When determining an intra prediction value of a current block using an IWCP mode, a first intra prediction mode and a second intra prediction mode of the current block are determined, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes.
[0209] In an embodiment of the present application, when determining an intra prediction value of a current block using the IWCP mode, the encoder may first determine a first intra prediction mode and a second intra prediction mode of the current block, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes.
[0210] It should be noted that in the embodiment of the present application, the IWCP mode is a type of intra prediction method. Specifically, in the IWCP mode, two different intra angular prediction modes are determined for the current block, and two prediction blocks are determined respectively according to the two different intra angular prediction modes. Then, a weighting matrix is determined, and the two prediction blocks are combined according to the weighting matrix to finally obtain a new prediction block, that is, a prediction block of the current block is obtained.
[0211] Furthermore, in the embodiment of the present application, when applying the IWCP mode, the size of the current block may be limited.
[0212] In the intra prediction method according to the embodiment of the present application, two different intra angular prediction modes are used to generate two prediction blocks, and a new prediction block is obtained by weighting the two prediction blocks based on a weighting matrix. Therefore, in order to reduce complexity and to strike a balance between compression performance and complexity, the embodiment of the present application can restrict the IWCP mode from being used for prediction blocks having a certain size. Therefore, in the present application, the encoder can first determine the size parameter of the current block and determine whether the IWCP mode is used for the current block based on the size parameter.
[0213] In addition, in the embodiment of the present application, the size parameters of the current block may include the height and width of the current block, so that the encoder can restrict the use of the IWCP mode based on the height and width of the current block, i.e., restrict the size of the prediction block for which the IWCP mode can be used.
[0214] For example, in this application, it can be determined that the IWCP mode is used for the current block when both the width and height are equal to or greater than a first lower limit and both the width and height are equal to or less than a first upper limit. Thus, one possible restriction is that the IWCP mode is used only when the width and height of the prediction block are smaller than (or equal to or less than) the first upper limit and larger than (or equal to or greater than) the first lower limit. Note that the first lower limit may be 8, and the value of the first upper limit may be 16 or 32, etc.
[0215] For example, in YUV4:2:0 format coding, an 8x8 luma block corresponds to a 4x4 chroma block at the same position. One possible method is to allow the IWCP mode to be used for the 8x8 luma block but prohibit its use for the 4x4 chroma block. This is because the prediction effect improvement of the IWCP mode is not significant for 4x4 blocks and the hardware implementation cost increases.
[0216] For example, in the present application, there may be a frame-level flag for specifying whether the IWCP mode is used for the current frame waiting to be decoded. For example, the IWCP mode may be configured to be used for intraframes (e.g., I frames) but not for interframes (e.g., B frames, P frames). Alternatively, the IWCP mode may be configured to be not used for intraframes but to be used for interframes. Alternatively, the IWCP mode may be configured to be used for some interframes but not for some interframes. Since intraprediction may be used for interframes, the IWCP mode may also be used for interframes.
[0217] Illustratively, in this application, there may be a flag below the frame level and above the CU level (eg, tile, slice, patch, LCU, etc.) to specify whether the IWCP mode is used for this region.
[0218] It should be noted that in an embodiment of the present application, the encoder can identify a combination of intra-prediction mode and weight matrix derivation mode that has the minimum rate distortion, where the combination includes a first intra-prediction mode, a second intra-prediction mode, and a weight matrix derivation mode.
[0219] Furthermore, in an embodiment of the present application, the first intra prediction mode and the second intra prediction mode may be different intra angular prediction modes. Specifically, in an embodiment of the present application, the first intra prediction mode and the second intra prediction mode may be different intra angular prediction modes in a preset angular prediction mode set.
[0220] That is, in this application, both the first intra prediction mode and the second intra prediction mode must be intra angular prediction modes. That is, neither the first intra prediction mode nor the second intra prediction mode is a basic intra prediction mode other than the intra angular prediction mode (e.g., an intra non-angular prediction mode including a DC mode, a Planar mode, a PLANE mode, a Bilinear mode, a PCM mode, etc.). Basic intra prediction modes include, but are not limited to, angular prediction modes and non-angular prediction modes. For example, there are 67 intra prediction modes used in VVC and 66 intra prediction modes used in AVS3.
[0221] In addition, in this application, by limiting the first intra prediction mode and the second intra prediction mode to intra angle prediction modes, on the one hand, when implementing the IWCP mode in parallel, only one set of circuits supporting intra angle weighted prediction needs to be added to the hardware, thereby reducing the complexity of the hardware implementation of the IWCP mode; on the other hand, although the intra weighted combined prediction mode itself is applied to blocks with relatively complex content, the intra non-angle prediction mode is usually used to handle scenes with relatively uniform texture changes, and overhead can be reduced by using fewer modes, so whether or not to use the intra non-angle prediction mode for the IWCP mode has little impact on compression performance.
[0222] In addition, in this application, the more available intra prediction modes there are, the more accurate the prediction value can be generated, but the overhead for transmitting the selected mode flags in the bitstream increases accordingly. Therefore, to obtain better compression performance, a reasonable set of available intra prediction modes can be selected to better balance both prediction effectiveness and overhead. Specifically, the encoder can limit the available intra angular prediction modes of the first intra prediction mode and the second intra prediction mode using a preset angular prediction mode set, which is a subset of all intra angular prediction modes. Taking AVS3 as an example, AVS3 has 62 angular modes, i.e., intra angular prediction modes with mode numbers 3 to 32 and 34 to 65.
[0223] For example, in the present application, the first intra prediction mode and the second intra prediction mode may use only intra angle prediction modes with mode numbers 3 to 32, or may use only 28 intra angle prediction modes with mode numbers 4 to 31.
[0224] Illustratively, in this application, taking VVC as an example, the first intra prediction mode and the second intra prediction mode may use only intra angle prediction modes with even mode numbers, or may use only intra angle prediction modes with odd mode numbers.
[0225] For example, in this application, the set of angular prediction modes used for the first intra prediction mode is different from the set of angular prediction modes used for the second intra prediction mode. Optionally, the decoder can restrict the first intra prediction mode and the second intra prediction mode using the same preset angular prediction mode set. That is, if the first intra prediction mode can use only 28 intra angular prediction modes with mode numbers 4 to 31 and the second intra prediction mode can also use only 28 intra angular prediction modes with mode numbers 4 to 31, the first intra prediction mode and the second intra prediction mode can use the same MPM list and the same or similar encoding and decoding methods. That is, if the decoder restricts the first intra prediction mode and the second intra prediction mode using different preset angular prediction mode sets, different MPM lists or significantly different encoding and decoding methods must be used for the first intra prediction mode and the second intra prediction mode.
[0226] Step 202: Build an MPM list for the current block.
[0227] In an embodiment of the present application, the encoder can further construct an MPM list for the current block, where all prediction modes in the MPM list are intra-angle prediction modes.
[0228] In addition, in an embodiment of the present application, when constructing an MPM list for a current block, the encoder must first identify the weighting matrix derivation mode for the current block, and then use the weighting matrix derivation mode to identify the MPM list for the current block.
[0229] In this application, the weighting matrix derivation mode is used to specify a weighting matrix to be used for a current block. Specifically, the weighting matrix derivation mode may be a mode for deriving a weighting matrix. For a prediction block having a predetermined height and width, one weighting matrix can be derived for each of various weighting matrix derivation modes. For prediction blocks having the same size, different weighting matrices are derived from different weighting matrix derivation modes.
[0230] Illustratively, in this application, there are 56 weighting matrix derivation modes in AWP in AVS3, and there are 64 weighting matrix derivation modes in GPM in VVC.
[0231] Alternatively, in this application, when constructing the MPM list of the current block, the encoder can construct the MPM list directly based on the prediction modes and weighting matrix derivation modes of the neighboring blocks of the current block.
[0232] Alternatively, in this application, when constructing an MPM list for a current block, the encoder may construct the MPM list based on prediction modes of neighboring blocks of the current block, a preset angular prediction mode set, and a weighting matrix derivation mode. The preset angular prediction mode set may be a subset of all intra angular prediction modes. Taking AVS3 as an example, the preset angular prediction mode set may include only 28 intra angular prediction modes with mode numbers 4 to 31.
[0233] In the present application, when the ranges of the first intra prediction mode and the second intra prediction mode are not restricted, the preset angular prediction mode set may be a combination of all intra angular prediction modes. When the ranges of the first intra prediction mode and the second intra prediction mode need to be restricted, the preset angular prediction mode set may be a combination of only some intra angular prediction modes. In this case, the preset angular prediction mode set may be used to restrict the ranges of the first intra prediction mode and the second intra prediction mode. This can effectively reduce overhead and improve compression performance.
[0234] Optionally, in this application, when constructing an MPM list based on the prediction modes of neighboring blocks of the current block, a preset angle prediction mode set, and a weighting matrix derivation mode, the encoder can identify a first candidate mode using the prediction modes of the neighboring blocks and identify a second candidate mode using the weighting matrix derivation mode, and further construct an MPM list for the current block based on the first candidate mode, the second candidate mode, and the preset angle prediction mode set.
[0235] Specifically, in this application, when the encoder identifies the first candidate mode using the prediction mode of a neighboring block, if the neighboring block is a normal intra-prediction block and the prediction mode of the neighboring block is an intra-prediction mode, the encoder identifies the prediction mode of the neighboring block as the first candidate mode.
[0236] In this application, a typical intra-prediction block can be understood to be a prediction block using a prediction mode such as DC mode, planar mode, bilinear mode, or angle prediction mode, but not a prediction block using a prediction mode such as IBC mode or intra string copy prediction.
[0237] Specifically, in the present application, when the encoder uses a weighting matrix derivation mode to identify a second candidate mode, the encoder can first identify a boundary line angle index based on the weighting matrix derivation mode, and then use the boundary line angle index to identify the second candidate mode.
[0238] It should be noted that in an embodiment of the present application, the second candidate mode may be specified to include L different intra-angle prediction modes, thereby ensuring the construction of an MPM list with length L.
[0239] Furthermore, in an embodiment of the present application, when a weighting matrix includes two types of weighting values, positions where the weighting values change form a straight line. Alternatively, when a weighting matrix includes multiple types of weighting values, positions in the transition region where the weighting values are the same may form a straight line, which may be referred to as a boundary line. The right horizontal angle may be 0 degrees, and the angle may increase counterclockwise. In this case, the boundary line may have various angles, such as 0 degrees horizontally and 90 degrees, 45 degrees, or 135 degrees vertically. When a certain weighting matrix is used for one prediction block, the corresponding textures are likely to exhibit different characteristics on both sides of the boundary line, for example, textures with two different angles on both sides of the boundary line, or an angled texture on one side of the boundary line and a flat texture on the other side of the boundary line. Because the boundary line itself has an angle, assuming that the boundary line is obtained by intra-angle prediction at one point, and the boundary line may be close to some textures of the current block, there is a correlation between this straight line and the two intra-prediction modes of the current block.
[0240] Specifically, in this application, assuming that a boundary line is obtained by intra-angle prediction at one point, at least one intra-angle prediction mode can be found, and this intra-angle prediction mode is used to approximately create the boundary line. For example, a horizontal boundary line matches a horizontal intra-prediction mode (e.g., mode 24 in AVS3). A vertical boundary line matches a vertical intra-prediction mode (e.g., mode 12 in AVS3). A 45-degree boundary line may match a 45-degree intra-prediction mode from bottom left to bottom right (e.g., mode 30 in AVS3), or a 225-degree intra-prediction mode from top right to bottom left (e.g., mode 6 in AVS3). If a weighting matrix has only one weight value, it can match modes that clearly have no angle, such as DC mode, planar mode, and bilinear mode. In this way, since the weighting matrix derivation mode can match several intra-prediction modes, the weighting matrix derivation mode can be used to assist in decoding the intra-prediction mode.
[0241] It should be noted that in this application, the weighting matrix derivation mode may be an index of the weighting matrix, for example, the 56 modes of the AWP can be considered as 56 weighting matrix derivation modes.
[0242] For example, in this application, a mapping relationship table may be constructed to further represent the mapping relationship between the weighting matrix derivation mode and the intra angle prediction mode. Specifically, the boundaries of the multiple modes of AWP and GPM all have the same angle. For example, in the AVS3 AWP, the boundaries of every eighth mode have the same angle. The 56 AWP modes have a total of eight boundary angle angles. The boundary angle index may be obtained by performing a modulo 8 (%8) operation on the mode number of the weighting matrix derivation mode. For example, Table 1 above is a mapping relationship table. Taking the angle mode in AVS3 as an example, boundary angle indexes 0 and 1 may correspond to two intra angle prediction modes (one prediction mode from the top right to the bottom left, and one prediction mode from the top left to the bottom right). Specifically, for other boundary angle indexes, other approximately corresponding intra angle prediction modes may be found, or all boundary angle indexes may correspond to only one intra angle prediction mode.
[0243] For a given weighting matrix, an intra angle prediction mode corresponding to the boundary line is likely to be used, and several intra angle prediction modes related to the boundary line are also likely to be used. For example, corresponding intra angle prediction modes, such as angles close to the boundary line or angles perpendicular to the boundary line, may be used. The encoder may construct an MPM list for the IWCP mode by utilizing the correlation between the weighting matrix and the intra angle prediction mode. For example, when constructing the MPM list for the IWCP mode, if the list length of the MPM list is 4, candidate modes corresponding to the boundary line angle indexes in Table 2 above may be added to the MPM list.
[0244] According to Table 2 above, since the number of candidate modes corresponding to each boundary angle index is equal to the length of the MPM list, it is possible to ensure that the MPM list can be filled even when all of the intra-prediction modes of neighboring blocks for reference are unavailable. For example, if the length of the MPM list is 4, the number of candidate modes corresponding to each boundary angle index can be 4.
[0245] Furthermore, in this application, when constructing an MPM list based on a first candidate mode, a second candidate mode, and a preset angular prediction mode set, the encoder obtains a filtered candidate mode by filtering the first candidate mode based on the preset angular prediction mode set, and constructs an MPM list based on the filtered candidate mode and the second candidate mode.
[0246] Specifically, in the present application, when an encoder obtains a filtered candidate mode by filtering a first candidate mode based on a preset angular prediction mode set, if the first candidate mode belongs to the preset angular prediction mode set, the encoder identifies the first candidate mode as the filtered candidate mode; if the first candidate mode is an intra angular prediction mode and does not belong to the preset angular prediction mode set, the encoder identifies an alternative mode of the first candidate mode from the preset angular prediction mode set and identifies the alternative mode as the filtered candidate mode.
[0247] Furthermore, in this application, if the first candidate mode is not an intra-angle prediction mode, the encoder can directly delete the first candidate mode.
[0248] In this application, the preset angular prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angular prediction modes and does not include intra non-angular prediction modes. Therefore, for the IWCP mode, the MPM selection for the current block, i.e., the method for constructing the MPM list, also needs to be adjusted. Specifically, when constructing the MPM list, the encoder needs to refer to the intra prediction modes of neighboring blocks surrounding the current block. Examples of neighboring blocks include the left neighboring block, the above neighboring block, the upper left neighboring block, the upper right neighboring block, and the lower left neighboring block. Due to spatial correlation, if a certain prediction mode is used for the neighboring blocks, it is highly likely that the same or a similar prediction mode will be used for the current block.
[0249] Alternatively, the first intra prediction mode and the second intra prediction mode in the IWCP mode can only be intra angular prediction modes. Therefore, if the intra prediction mode used for a neighboring block for reference is an intra non-angular prediction mode, i.e., if the first candidate mode is not an intra angular prediction mode, the encoder does not use the intra non-angular prediction mode used for the reference block when constructing the MPM list for the current block, i.e., does not add the intra non-angular prediction mode to the MPM list for the current block.
[0250] Optionally, the preset angular prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angular prediction modes. Therefore, if the intra prediction mode used for a neighboring block for reference is an intra angular prediction mode not included in the preset angular prediction mode set, i.e., if the first candidate mode is an intra angular prediction mode and does not belong to the preset angular prediction mode set, when constructing the MPM list for the current block, the encoder converts the intra angular prediction mode not included in the preset angular prediction mode set to an intra angular prediction mode with a similar angle in the preset angular prediction mode set, and then adds the converted intra angular prediction mode to the MPM list. Taking AVS3 as an example, according to the preset angular prediction mode set, the first intra prediction mode and the second intra prediction mode are limited to intra angular prediction modes with mode numbers 4 to 31. Furthermore, if an intra angular prediction mode with mode number 43 is used for a neighboring block of the current block, the encoder can add intra angular prediction with mode number 12, which is similar to the intra angular prediction with mode number 43, to the MPM list of the current block in IWCP mode.
[0251] Furthermore, in an embodiment of the present application, when constructing an MPM list based on the filtered candidate modes and the second candidate modes, the encoder adds the filtered candidate mode to the MPM list if the filtered candidate mode satisfies a predetermined additional condition, and adds the second candidate mode to the MPM list if the MPM list does not meet the predetermined list length L and the second candidate mode satisfies the predetermined additional condition, where L is an integer greater than or equal to 1.
[0252] Illustratively, in the present application, the value of L may be 4, that is, the preset list length of the MPM list is 4, or the MPM list includes 4 MPMs.
[0253] It should be noted that in the embodiment of the present application, the encoder can sort the L modes in the MPM list according to the ascending order of the mode numbers.
[0254] It should be noted that in an embodiment of the present application, if the filtered candidate mode is different from all prediction modes in the MPM list, the encoder can determine that the filtered candidate mode satisfies a predetermined additional condition. Correspondingly, if the second candidate mode is different from all prediction modes in the MPM list, the encoder can determine that the second candidate mode satisfies a predetermined additional condition.
[0255] In an embodiment of the present application, when adding filtered candidate modes corresponding to neighboring blocks to the MPM list, the encoder may identify an order parameter corresponding to the neighboring block and add the filtered intra candidate modes corresponding to the neighboring blocks to the MPM list in order based on the order parameter. The encoder may identify the corresponding order parameter according to the spatial distance between the neighboring block and the current block. For example, the closer the spatial distance between the neighboring block and the current block, the stronger the correlation between the neighboring block and the current block, and the earlier the additional processing is performed, resulting in a smaller order parameter. The farther the spatial distance between the neighboring block and the current block, the weaker the correlation between them, resulting in a later additional processing, resulting in a larger order parameter.
[0256] Furthermore, in an embodiment of the present application, after adding the filtered candidate mode and / or the second candidate mode to the MPM list, the encoder can further sort the L prediction modes in the MPM list according to ascending order of mode number.
[0257] For example, in this application, assuming that the MPM list of the current block in IWCP mode is IwcpMpm[4], i.e., the list length of the MPM list is 4, the index of the weighting matrix derivation mode is IwcpIndex, the weighting matrix derivation mode reuses the 56 derivation modes of AWP, and the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong includes intra angle prediction modes with mode numbers 4 to 31, the encoder can sequentially perform the following steps when constructing the MPM list of the current block.
[0258] Step S1: An array cand_mode
[10] is provided, and all values of cand_mode are initialized to invalid values. The following operations are performed on cand_mode. (a) If the neighboring block F is "present" and is a normal intra-predicted block, cand_mode[0] is equal to the intra-prediction mode of F. (b) If neighboring block G is "present" and is a regular intra-predicted block, cand_mode[1] is equal to the intra-prediction mode of G. (c) If neighboring block C is "present" and is a regular intra-predicted block, cand_mode[2] is equal to the intra-prediction mode of C. (d) If neighboring block A is "present" and is a normal intra-predicted block, cand_mode[3] is equal to the intra-prediction mode of A. (e) If neighboring block B is "present" and is a regular intra-predicted block, cand_mode[4] is equal to the intra-prediction mode of B. (f) If neighboring block D is “present” and is a regular intra-predicted block, cand_mode[5] is equal to the intra-prediction mode of D. (g) cand_mode[6] is equal to the candidate mode 0 corresponding to IwcpIndex%8. (h) cand_mode[7] is equal to candidate mode 1 corresponding to IwcpIndex%8. (i) cand_mode[8] is equal to candidate mode 2 corresponding to IwcpIndex%8. (j) cand_mode[9] is equal to candidate mode 3 corresponding to IwcpIndex%8.
[0259] A neighboring block X (where X is A, B, C, D, F, or G) "exists" means that the block should be in the image and should belong to the same slice as block E. Otherwise, the neighboring block "does not exist." If a block "does not exist" or has not yet been decoded, the block is "unavailable." Otherwise, the block is "available." If a sample of an image is located in a block that "does not exist" or has not yet been decoded, the sample is "unavailable." Otherwise, the sample is "available."
[0260] In this application, the above steps (a) to (f) are the process of identifying the first candidate mode, and the above steps (g) to (j) are the process of identifying the second candidate mode. The encoder can identify the second candidate mode by referring to Table 2 above.
[0261] Step S2: For i from 0 to 5, the following operations are performed. (a) If cand_mode[i] is less than 3 or cand_mode[i] is equal to 33, set cand_mode[i] to an invalid value. That is, if the first candidate mode is an intra non-angle prediction mode, the encoder may directly delete the first candidate mode, that is, not use the first candidate mode. (b) Otherwise, if cand_mode[i] is equal to 3, then set cand_mode[i] to 4. (c) Otherwise, if cand_mode[i] is equal to 32, then set cand_mode[i] equal to 31. (d) Otherwise, if cand_mode[i] is greater than 33, perform the following operations: If cand_mode[i] is less than 44, then set cand_mode[i] equal to cand_mode[i]-30. Otherwise, if cand_mode[i] is less than 58, then set cand_mode[i] equal to cand_mode[i]-33. Otherwise, set cand_mode[i] equal to cand_mode[i]-34. That is, if the first candidate mode is an intra-angle prediction mode and does not belong to the preset angle prediction mode set, the encoder selects a similar intra-angle prediction mode from the preset angle prediction mode set as an alternative mode to the first candidate mode, and sets the alternative mode as the filtered candidate mode. (e) Otherwise, do not correct the value of cand_mode[i]. That is, if the first candidate mode belongs to the preset angular prediction mode set, the encoder can directly use the first candidate mode, that is, the first candidate mode is a filtered candidate mode.
[0262] In this application, the above step S2 is a filtering process of the first candidate mode, and the filtered candidate mode corresponding to the first candidate mode is finally identified.
[0263] Step S3: Set mpm_num to 0, and perform the following operations for i from 0 to 9. (a) If cand_mode[i] is not an invalid value, perform the following operations: Compare cand_mode[i] with IwcpMpm[j], where j is between 0 and mpm_num-1. If cand_mode[i] is not equal to IwcpMpm[j], perform the following operations. 1. Set IwcpMpm[mpm_num] equal to cand_mode[i]. 2. Set mpm_num equal to mpm_num+1. 3. If mpm_num is equal to 4, then exit step 3. That is, provided that there are less than four prediction modes in the MPM list, if the filtered candidate mode is not the same as any of the prediction modes in the MPM list, the encoder may add the filtered candidate mode to the MPM list. If there are still less than four prediction modes in the MPM list after all filtered candidate modes that meet the preset addition conditions have been added to the MPM list, the encoder may continue to add second candidate modes that meet the preset addition conditions to the MPM list until the list length of the MPM list becomes four.
[0264] Step S4: The four values of IwcpMpm[4] are sorted in ascending order.
[0265] Finally, the encoder can sort the four intra-angle prediction modes in the MPM list in ascending order of mode number.
[0266] This application does not limit the execution order of the above steps 202 and 203, that is, does not limit the order of the process of identifying the first mode index and the second mode index and the process of building the MPM list.
[0267] Step 203: Identify a first mode index and a second mode index of the current block according to the first intra prediction mode, the second intra prediction mode, and the MPM list.
[0268] In an embodiment of the present application, after the encoder identifies the first intra prediction mode and the second intra prediction mode of the current block and constructs the MPM list of the current block, the encoder can further identify the first mode index and the second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list.
[0269] In addition, in an embodiment of the present application, the first mode index can be used to indicate the first intra prediction mode to be used for the current block, and the second mode index can be used to indicate the second intra prediction mode to be used for the current block.
[0270] Specifically, the value of the first mode index and the value of the second mode index are associated with the number of possible intra angular prediction modes of the first intra prediction mode and the second intra prediction mode. For example, the first intra prediction mode and the second intra prediction mode may each be one of 28 intra angular prediction modes with mode numbers ranging from 4 to 31. Therefore, the value of the first mode index and the value of the second mode index are both in the range of 0 to 27.
[0271] Exemplarily, in an embodiment of the present application, the parameter iwcp_pred_mode0_index may represent the first mode index, and the parameter iwcp_pred_mode1_index may represent the second mode index.
[0272] In addition, in an embodiment of the present application, the encoder can identify a first mapping relationship table between index values and binary strings, where the first mapping relationship table includes binary strings having a first length, binary strings having a second length, and binary strings having a third length, respectively.
[0273] Illustratively, in this application, the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
[0274] It should be noted that in the present application, a first mapping relationship table between index values and binary strings can be used to identify the values of the first mode index and the second mode index.
[0275] Alternatively, in the present application, when 28 intra angular prediction modes with mode numbers 4 to 31 are used in AVS3, i.e., when a total of 28 modes are included in the preset angular prediction mode set, the modes may be coded in a format of 4+8+16, i.e., four modes with the shortest codewords, eight modes with short codewords, and 16 modes with long codewords. The four modes with the shortest codewords use 3-bit codewords, i.e., a first length. The eight modes with short codewords use 5-bit codewords, i.e., a second length. The 16 modes with long codewords use 6-bit codewords, i.e., a third length.
[0276] In this application, the prediction angles of the 28 intra angular prediction modes with mode numbers 4 to 31 basically cover the entire commonly used angle range. At the same time, the intra angular prediction modes with mode numbers 4 to 31 are simpler than the intra angular prediction modes with mode numbers 34 to 65, and encoding these 28 modes in the format of 4+8+16 does not waste codewords. Therefore, it is preferable that the encoder defines a preset angular prediction mode set based on the 28 intra angular prediction modes with mode numbers 4 to 31.
[0277] Also, in an embodiment of the present application, if the list length of the MPM list of the current block is 4, the binary string having the first length can be used for four MPMs in the MPM list, i.e., the four modes with the shortest codewords can be used for the four MPMs in the MPM list. Accordingly, the binary string having the second length and the binary string having the third length can be used for other prediction modes in the preset angle prediction mode set that are not included in the MPM list.
[0278] Alternatively, in this application, for the remaining 24 intra angular prediction modes in the preset angular prediction mode set other than the four MPMs in the MPM list, the encoder may uniformly distribute modes with short codewords and modes with long codewords. Specifically, the encoder may uniformly distribute eight modes with short codewords (binary strings having a second length) among the remaining 24 intra angular prediction modes. For example, one mode with short codewords (binary strings having a second length) is used for every two modes with long codewords (binary strings having a third length). In a more specific implementation process, the remaining 24 intra angular prediction modes are implemented by performing a modulo-3 (%) operation on serial numbers 0 to 23. For example, a mode whose modulo-3 serial number remainder is 2 uses a 5-bit codeword, i.e., a binary string having a second length. A mode whose modulo-3 serial number remainder is 0 or 1 uses a 6-bit codeword, i.e., a binary string having a third length.
[0279] For example, in the present application, 28 intra angle prediction modes with mode numbers 4 to 31 are used, i.e., the preset angle prediction mode set includes 28 modes. In this case, the first mapping relationship table between the index value and the binary string is as shown in Table 3 above, where the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
[0280] The first bit can indicate whether or not the mode is an MPM, for example, "1" indicates an MPM and "0" indicates no MPM. If the first intra prediction mode is an MPM, assuming that the MPM list includes four MPMs, two bits can be used to indicate which MPM in the MPM list is used. For example, "00, 01, 10, 11" represent the first MPM, second MPM, third MPM, and fourth MPM in the MPM list, respectively.
[0281] Furthermore, in this application, a binary string whose bit flag is 0 is encoded using a context model, and a binary string whose bit flag is not 0 is encoded without using a context model. The value of the bit flag can represent how many bits are encoded, and the bit flag can be represented by binIdx.
[0282] In this application, when binarizing based on Table 3 on the encoding side, a binary string with binIdx of 0 can be encoded using a context model, and a binary string with binIdx other than 0 can be encoded using an equal probability model or a bypass mode.
[0283] Furthermore, in this application, when the encoder determines the first mode index and the second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list, if the mode number of the first intra prediction mode is the same as the mode number of the m-th mode in the MPM list, the encoder assigns value m to value i of the first mode index, and if the mode number of the first intra prediction mode is different from the mode numbers of any modes in the MPM list, the encoder determines value i of the first mode index using the MPM list, and determines the first mode index based on the first mapping relationship table and i, where m is an integer greater than or equal to 0 and less than L.
[0284] That is, in this application, if the mode number of the first intra prediction mode is the same as the mode number of one MPM in the MPM list, the value i of the first mode index can be directly set to the order m of this MPM. For example, if the first intra prediction mode is the same as the second mode in the MPM list, i is set to 2.
[0285] Specifically, in this application, when the encoder uses the MPM list to identify the value i of the first mode index, if the mode number of the first intra prediction mode is equal to or greater than the mode number of the fourth mode in the MPM list, the encoder assigns the difference between the mode number of the first intra prediction mode and 4 to i; if the mode number of the first intra prediction mode is smaller than the mode number of the fourth mode in the MPM list and equal to or greater than the mode number of the third mode in the MPM list, the encoder assigns the difference between the mode number of the first intra prediction mode and 3 to i; If the mode number of the first intra prediction mode is smaller than the mode number of the third mode in the MPM list and greater than or equal to the mode number of the second mode in the MPM list, the difference between the mode number of the first intra prediction mode and 2 is assigned to i; if the mode number of the first intra prediction mode is smaller than the mode number of the second mode in the MPM list and greater than or equal to the mode number of the first mode in the MPM list, the difference between the mode number of the first intra prediction mode and 1 is assigned to i; and if the mode number of the first intra prediction mode is smaller than the mode number of the first mode in the MPM list, the mode number of the first intra prediction mode is assigned to i.
[0286] For example, in this application, if the mode numbers of four MPMs in the MPM list are 4, 8, 12, and 16, respectively, and the mode number of the first intra-prediction mode is 9, the encoder compares the mode number of the first intra-prediction mode with the mode numbers of the four MPMs respectively. Specifically, since 9 is greater than the mode number of the second MPM and less than the mode number of the third MPM, the value i of the first mode index is 9-2=7.
[0287] For example, in this application, if the mode numbers of four MPMs in the MPM list are 4, 8, 12, and 16, respectively, and the mode number of the first intra-prediction mode is 15, the encoder compares the mode number of the first intra-prediction mode with the mode numbers of the four MPMs, respectively. Specifically, since 15 is greater than the mode number of the third MPM and less than the mode number of the fourth MPM, the value i of the first mode index is 15-3=12.
[0288] Note that in the present application, the encoder may determine a value i of the first mode index corresponding to the first intra-prediction mode, and then determine the first mode index based on the first mapping relationship table and i. Specifically, the encoder may determine the first mode index by binarizing i according to the first mapping relationship table shown in Table 3 above.
[0289] Furthermore, in this application, when the encoder determines the first mode index and the second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list, if the mode number of the second intra prediction mode is the same as the mode number of the m-th mode in the MPM list, the encoder assigns value m to value j of the second mode index, and if the mode number of the second intra prediction mode is different from the mode numbers of any modes in the MPM list, the encoder determines value j of the second mode index using the MPM list, and determines the second mode index based on the first mapping relationship table and j, where m is an integer greater than or equal to 0 and less than L.
[0290] That is, in this application, if the mode number of the second intra prediction mode is the same as the mode number of one MPM in the MPM list, the value j of the second mode index can be directly set to the order m of this MPM. For example, if the second intra prediction mode is the same as the third mode in the MPM list, j is set to 3.
[0291] Specifically, in this application, when the encoder uses the MPM list to identify the value j of the second mode index, if the mode number of the second intra prediction mode is equal to or greater than the mode number of the fourth mode in the MPM list, the encoder assigns the difference between the mode number of the second intra prediction mode and 4 to j; if the mode number of the second intra prediction mode is smaller than the mode number of the fourth mode in the MPM list and equal to or greater than the mode number of the third mode in the MPM list, the encoder assigns the difference between the mode number of the second intra prediction mode and 3 to j; If the mode number of the second intra prediction mode is smaller than the mode number of the third mode in the MPM list and equal to or greater than the mode number of the second mode in the MPM list, the difference between the mode number of the second intra prediction mode and 2 is assigned to j; if the mode number of the second intra prediction mode is smaller than the mode number of the second mode in the MPM list and equal to or greater than the mode number of the first mode in the MPM list, the difference between the mode number of the second intra prediction mode and 1 is assigned to j; and if the mode number of the second intra prediction mode is smaller than the mode number of the first mode in the MPM list, the mode number of the second intra prediction mode is assigned to j.
[0292] For example, in this application, if the mode numbers of four MPMs in the MPM list are 4, 8, 12, and 16, respectively, and the mode number of the second intra-prediction mode is 17, the encoder compares the mode number of the second intra-prediction mode with the mode numbers of the four MPMs, respectively. Specifically, since 17 is greater than the mode number of the fourth MPM, the value j of the second mode index is 17-4=13.
[0293] For example, in this application, if the mode numbers of four MPMs in the MPM list are 4, 8, 12, and 16, respectively, and the mode number of the second intra-prediction mode is 6, the encoder compares the mode number of the second intra-prediction mode with the mode numbers of the four MPMs respectively. Specifically, since 6 is greater than the mode number of the first MPM and less than the mode number of the second MPM, the value j of the second mode index is 6-1=5.
[0294] In addition, in the present application, the encoder may determine the value j of the second mode index corresponding to the second intra-prediction mode, and then determine the second mode index based on the first mapping relationship table and j. Specifically, the encoder may determine the second mode index by binarizing j according to the first mapping relationship table shown in Table 3 above.
[0295] For example, in the present application, if the IWCP mode is used for the current block, the length of the MPM list of the current block is 4, i.e., L=4, the four modes in the MPM list are sorted in ascending order of mode numbers, and the preset angular prediction mode set includes 28 intra angular prediction modes with mode numbers from 4 to 31, the encoder may first identify the first intra prediction mode as IwcpPredMode0 and the second intra prediction mode as IwcpPredMode1, and then identify the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index based on the first intra prediction mode IwcpPredMode0 and the second intra prediction mode IwcpPredMode1. The values of iwcp_pred_mode0_index and iwcp_pred_model_index are in the range of 0 to 27.
[0296] After identifying the first intra prediction mode IwcpPredMode0 to be used for the IWCP mode of the current block, the encoder may specifically perform the following operations when identifying the first mode index iwcp_pred_mode0_index.
[0297] 1. If IwcpPredMode0 is equal to IwcpMpm[m] and m is greater than or equal to 0 and less than 4, the value i of iwcp_pred_mode0_index is equal to m.
[0298] That is, when the first intra prediction mode is the same as the m-th MPM in the MPM list, the value m can be directly assigned to i, that is, i = m.
[0299] 2. When IwcpPredMode0 is not equal to IwcpMpm[m], the value i of iwcp_pred_mode0_index is equal to IwcpPredMode0 < IwcpMpm[0]? IwcpPredMode0 : IwcpPredMode0 < IwcpMpm[1]? IwcpPredMode0 - 1 : IwcpPredMode0 < IwcpMpm[2]? IwcpPredMode0 - 2 : IwcpPredMode0 < IwcpMpm[3]? IwcpPredMode's value i is equal to IwcpPredMode0 < IwcpMpm[0]? IwcpPredMode0 : IwcpPredMode0 < IwcpMpm[1]? IwcpPredMode0 - 1 : IwcpPredMode0 < IwcpMpm[2]? IwcpPredMode0 - 2 : IwcpPredMode0 < IwcpMpm[3]? IwcpPredMode0 - 3 : IwcpPredMode0 - 4.
[0300] 3. Based on Table 3, by binarizing the value i of iwcp_pred_mode0_index, the iwcp_pred_mode0_index in binary string format is determined.
[0301] Specifically, when binarizing the value i of iwcp_pred_mode0_index based on Table is determined, and then the binary string iwcp_pred_mode0_index can be determined from the right column of the same row.
[0302] Accordingly, after determining the second intra prediction mode IwcpPredMode1 used for the IWCP mode of the current block, when determining the second mode index iwcp_pred_mode1_index, specifically, the following operations can be performed.
[0303] 1. When IwcpPredMode1 is equal to IwcpMpm[m] and m is greater than or equal to 0 and less than 4, the value j of iwcp_pred_mode1_index is equal to m.
[0304] That is, when the second intra prediction mode is the same as the m-th MPM in the MPM list, the value m can be directly assigned to j, that is, j = m.
[0305] 2. When IwcpPredMode1 is not equal to IwcpMpm[m], the value j of iwcp_pred_mode1_index is equal to IwcpPredMode1 < IwcpMpm[0]? IwcpPredMode1 : IwcpPredMode1 < IwcpMpm[1]? IwcpPredMode1 - 1 : IwcpPredMode1 < IwcpMpm[2]? IwcpPredMode1 - 2 : IwcpPredMode1 < IwcpMpm[3]? IwcpPredMode1 - 3 : IwcpPredMode1 - 4.
[0306] 3. Based on Table 3, by binarizing the value j of iwcp_pred_mode1_index, the iwcp_pred_mode1_index in binary string format is determined.
[0307] Specifically, when binarizing the value j of iwcp_pred_mode1_index based on Table 3, the index value the same as j is determined from the left column of Table 3, and then the binary string iwcp_pred_mode1_index is determined from the right column of the same row.
[0308] In addition, in the embodiments of the present application, in the IWCP mode, it is necessary to use the first intra prediction mode and the second intra prediction mode to determine the prediction value of the current block. The first intra prediction mode and the second intra prediction mode can share one preset angle prediction mode set and can also share the same MPM list. Since the first intra prediction mode and the second intra prediction mode in the IWCP mode are not the same, when encoding / decoding the second intra prediction mode, the first intra prediction mode can be referred to. Specifically, when determining the second intra prediction mode, the first intra prediction mode can be excluded.
[0309] In the present application, for 28 intra-angle prediction modes, in the above 4+8+16 encoding / decoding scheme, there is a high probability that four MPMs in the MPM list will appear (the probability that the first intra-prediction mode is one of the four MPMs in the MPM list is approximately 50%, and the probability that the second intra-prediction mode is one of the four MPMs in the MPM list is approximately 50%). If the first intra-prediction mode and the second intra-prediction mode are both MPMs in the MPM list, when identifying the second intra-prediction mode, only one of the other three MPMs in the MPM list other than the first intra-prediction mode can be selected. In this way, while originally selecting one from four and requiring four 3-bit codewords, selecting one from three requires one 2-bit codeword and two 3-bit codewords. Accordingly, if neither the first intra prediction mode nor the second intra prediction mode is an MPM in the MPM list, one of the 24 intra angle prediction modes (8+16) may be removed for the second intra prediction mode, although the impact of this is relatively small.
[0310] As can be seen from the above, if the first intra prediction mode and the second intra prediction mode are both MPMs in the MPM list, when identifying the second intra prediction mode, the first intra prediction mode can be deleted first, thereby reducing overhead.
[0311] Optionally, in an embodiment of the present application, when the encoder determines the first mode index and the second mode index of the current block based on the first intra-prediction mode, the second intra-prediction mode, and the MPM list, if the mode number of the second intra-prediction mode is the same as the mode number of the mth mode in the MPM list, the encoder assigns value m to the value j of the second mode index, and if the mode number of the second intra-prediction mode is different from the mode number of any mode in the MPM list, the encoder uses the MPM list to determine the value j of the second mode index, and determines the second mode index based on the first mapping relationship table, the second mapping relationship table between index values and binary strings, and j.
[0312] Specifically, in this application, when the encoder determines the second mode index based on the first mapping relationship table, the second mapping relationship table between index values and binary strings, and j, if i is smaller than L and smaller than j, it subtracts 1 from j and then binarizes j according to the second mapping relationship table to determine the second mode index; if j is equal to or greater than L, it binarizes j according to the first mapping relationship table to determine the second mode index.
[0313] In addition, in an embodiment of the present application, the encoder can identify a second mapping relationship table between index values and binary strings, where the second mapping relationship table includes binary strings having a first length, binary strings having a second length, binary strings having a third length, and binary strings having a fourth length, respectively.
[0314] Illustratively, in this application, the first length is 3 bits, the second length is 5 bits, the third length is 6 bits, and the fourth length is 2 bits.
[0315] It should be noted that in this application, the second mapping relationship table between index values and binary strings is only used to identify the value of the second mode index.
[0316] Optionally, in this application, the second mapping relationship table between index values and binary strings is as shown in Table 4, where the first length is 3 bits, the second length is 5 bits, the third length is 6 bits, and the fourth length is 2 bits.
[0317] In this application, when binarizing based on Table 4 on the encoding side, a binary string with binIdx of 0 can be encoded using a context model, and a binary string with binIdx other than 0 can be encoded using an equal probability model or a bypass mode.
[0318] For example, in the present application, if the IWCP mode is used for the current block, the length of the MPM list of the current block is 4, i.e., L=4, the four modes in the MPM list are sorted in ascending order of mode numbers, and the preset angular prediction mode set includes 28 intra angular prediction modes with mode numbers from 4 to 31, the encoder can first identify the first intra prediction mode as IwcpPredMode0 and the second intra prediction mode as IwcpPredMode1, and then identify the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index based on the first intra prediction mode IwcpPredMode0 and the second intra prediction mode IwcpPredMode1.
[0319] After identifying the first intra prediction mode IwcpPredMode0 to be used for the IWCP mode of the current block, the encoder may specifically perform the following operations when identifying the first mode index iwcp_pred_mode0_index.
[0320] 1. If IwcpPredMode0 is equal to IwcpMpm[m] and m is greater than or equal to 0 and less than 4, the value i of iwcp_pred_mode0_index is equal to m.
[0321] That is, when the first intra prediction mode is the same as the m-th MPM in the MPM list, the value m can be directly assigned to i, that is, i = m.
[0322] 2. When IwcpPredMode0 is not equal to IwcpMpm[m], the value i of iwcp_pred_mode0_index is equal to IwcpPredMode0 < IwcpMpm[0]? IwcpPredMode0 : IwcpPredMode0 < IwcpMpm[1]? IwcpPredMode0 - 1 : IwcpPredMode0 < IwcpMpm[2]? IwcpPredMode0 - 2 : IwcpPredMode0 < IwcpMpm[3]? IwcpPredMode0 - 3 : IwcpPredMode0 - 4.
[0323] 3. Based on Table 3, by binarizing the value i of iwcp_pred_mode0_index, the iwcp_pred_mode0_index in binary string format is determined.
[0324] Specifically, when binarizing the value i of iwcp_pred_mode0_index based on Table 3, the index value the same as i is determined from the left column of Table 3, and then the binary string iwcp_pred_mode0_index can be determined from the right column of the same row.
[0325] Accordingly, when determining the second intra prediction mode based on the first intra prediction mode, after the encoder determines the second intra prediction mode IwcpPredMode1 used for the IWCP mode of the current block, when determining the second mode index iwcp_pred_mode1_index, specifically, the following operations can be performed.
[0326] 1. When IwcpPredMode1 is equal to IwcpMpm[m] and m is greater than or equal to 0 and less than 4, the value j of iwcp_pred_mode1_index is equal to m.
[0327] That is, when the second intra prediction mode is the same as the m-th MPM in the MPM list, the value m can be directly assigned to j, that is, j = m.
[0328] 2. When IwcpPredMode1 is not equal to IwcpMpm[m], the value j of iwcp_pred_mode1_index is equal to IwcpPredMode1 < IwcpMpm[0]? IwcpPredMode1 : IwcpPredMode1 < IwcpMpm[1]? IwcpPredMode1 - 1 : IwcpPredMode1 < IwcpMpm[2]? IwcpPredMode1 - 2 : IwcpPredMode1 < IwcpMpm[3]? IwcpPredMode1 - 3 : IwcpPredMode1 - 4.
[0329] 3. When the value of iwcp_pred_mode0_index is less than 4, a. When iwcp_pred_mode1_index is greater than or equal to iwcp_pred_mode0_index, iwcp_pred_mode1_index is equal to iwcp_pred_mode1_index - 1, b. Based on Table 4, by binarizing the value j of iwcp_pred_mode1_index, the iwcp_pred_mode1_index in binary string format is determined.
[0330] 4. When iwcp_pred_mode0_index is greater than or equal to 4, based on Table 3, by binarizing the value j of iwcp_pred_mode1_index, the iwcp_pred_mode1_index in binary string format is determined.
[0331] As can be seen from the above, if the second intra prediction mode needs to be identified based on the first intra prediction mode, iwcp_pred_mode1_index depends on iwcp_pred_mode0_index. Specifically, taking Table 4 as an example, if the first intra prediction mode and the second intra prediction mode are both MPMs in the MPM list, there are only three available MPMs for the second intra prediction mode, and each MPM can be represented by one or two bits. For example, "00, 01, 10" represent the remaining first, second, and third MPMs, respectively. By eliminating one possibility in this way, overhead can be reduced by changing the encoding / decoding method or the binarization or de-binarization method.
[0332] In an embodiment of the present application, the preset angular prediction mode set includes 28 intra angular prediction modes with mode numbers 4 to 31, and the length of the MPM list is 4. When a first mapping relationship table between index values and binary strings is identified using binary strings having a first length, binary strings having a second length, and binary strings having a third length, the binary strings having the first length, i.e., the shortest codewords, may be first used for four MPMs in the MPM list. Next, the binary strings having the second length are used for eight intra angular prediction modes selected from the remaining 24 intra angular prediction modes, and the binary strings having the third length are used for the selected 16 intra angular prediction modes.
[0333] Specifically, in this application, for the remaining 24 intra-angle prediction modes, in ascending order of mode numbers, short codewords, i.e., binary strings having a second length, can be used for prediction modes corresponding to the first 8 mode numbers, and then long codewords, i.e., binary strings having a third length, can be used for prediction modes corresponding to the subsequent 16 mode numbers.
[0334] For example, in the present application, the first mapping relationship table between index values and binary strings shown in Table 3 above can be replaced with Table 5 above. Table 5 for representing the first mapping relationship table between index values and binary strings can also be used to specify the values of the first mode index and the second mode index.
[0335] Accordingly, the second mapping relationship table between index values and binary strings shown in Table 4 above can be replaced with Table 6 above. Table 6 for representing the second mapping relationship table between index values and binary strings can also be used to specify the value of the second mode index.
[0336] In the present application, 28 intra angular prediction modes with mode numbers 4 to 31 are used. In other words, when the preset angular prediction mode set includes 28 modes, encoding can be performed in the form of 4+8+16, i.e., using 4 modes with 3-bit codewords, 8 modes with 5-bit codewords, and 16 modes with 6-bit codewords.
[0337] Alternatively, in this application, if the preset angular prediction mode set includes a total of 20 modes, these modes can be represented by four 3-bit codewords and sixteen 5-bit codewords.
[0338] Alternatively, in this application, if the preset angular prediction mode set includes a total of 36 modes, these modes can be represented by four 3-bit codewords or 32 6-bit codewords. For example, AVS3 uses 36 intra angular prediction modes with mode numbers 4 to 31, 42 to 45, and 56 to 59.
[0339] In this application, when all modes in a preset angle prediction mode set are represented by a set of binary strings as shown in Table 3 or Table 4, a "codeword" can be understood as a binary string. The length of the codeword can be understood as the length of the binary string. Another way of expressing it is the sum of a flag and a binary string. For example, a binary MPM_flag is used to indicate whether the current mode is an MPM mode. That is, when MPM_flag is 1, it indicates that the current mode is an MPM mode, and when MPM_flag is 0, it indicates that the current mode is not an MPM mode. When the current mode is an MPM mode, MPM has a total of four possibilities, and a 2-bit binary string indicates which MPM the current mode is. In this case, a codeword can be understood as the sum of a flag and a binary string, and the length of the codeword can be understood as the sum of the length of the flag and the binary string.
[0340] Step 204: Write the first mode index and the second mode index into the bitstream.
[0341] In an embodiment of the present application, the encoder identifies a first mode index used to indicate a first intra-prediction mode and a second mode index used to indicate a second intra-prediction mode, and then the encoder can write the first mode index and the second mode index into the bitstream and transmit them to the decoding side so that the decoder can determine a predicted value of the current block based on the identified first mode index and second mode index by decoding the bitstream.
[0342] Furthermore, in an embodiment of the present application, after identifying the first intra prediction mode and the second intra prediction mode to be used for the current block, the encoder further needs to identify a weighting matrix for the current block, so as to identify a predicted value for the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix.
[0343] In addition, in an embodiment of the present application, when determining a predicted value of a current block based on a first intra prediction mode, a second intra prediction mode, and a weighting matrix, the encoder first determines a first predicted value of the current block based on the first intra prediction mode, determines a second predicted value of the current block based on the second intra prediction mode, and then performs a weighting operation on the first predicted value and the second predicted value using the weighting matrix, thereby finally obtaining a predicted value of the current block.
[0344] Furthermore, in an embodiment of the present application, after determining the predicted value of the current block, the encoder can calculate and obtain the difference between the true value and the predicted value of the current block so as to determine the prediction difference, i.e., the residual, of the current block.
[0345] That is, in this application, the encoder can calculate the difference between the true value of the current block and the intra-predicted value to obtain a residual, which is then transformed, quantized, entropy coded, written into a bitstream, and transmitted to the decoding side.
[0346] Specifically, in this application, the encoder can identify the weighting matrix of the current block based on the weighting matrix derivation mode of the current block.
[0347] It should be noted that in this application, both the first intra prediction mode and the second intra prediction mode can be intra angular prediction modes, that is, in this embodiment, two different intra angular prediction modes are used, and the first intra prediction mode and the second intra prediction mode are used to generate the first prediction block and the second prediction block, respectively, and the prediction block of the current block is determined based on the first prediction block, the second prediction block, and the weighting matrix.
[0348] Also, in embodiments of the present application, the weight values of all points in each weight matrix in all possible weight matrices are not the same, in other words, at least one possible weight matrix includes at least two different weight values.
[0349] In an embodiment of the present application, the encoder may determine the weighting matrix using a method similar to GPM or AWP. Specifically, when GPM or AWP is used in the same video encoding / decoding standard or encoder / decoder, the weighting matrix may be determined using the method, thereby allowing some of the same logic to be reused. For example, when AWP is used for inter prediction in AVS3, the weighting matrix may be determined using the AWP method in AVS3. Of course, a method different from GPM or AWP in the same video encoding / decoding standard or encoder / decoder is also possible, such as using a different number of modes, a different algorithm for the transition region, or different parameters. Since inter prediction utilizes temporal correlation, a reconstructed image in the reference image is used as the reference block. Since intra prediction utilizes spatial correlation, reconstructed samples surrounding the current block are used as reference samples. In the spatial domain, the closer the distance, the stronger the correlation, and the farther the distance, the weaker the correlation. Therefore, if a weighting matrix causes the sample positions of a prediction block to move away from the reference samples, such a weighting matrix may not be used because it may not produce a better prediction value than existing techniques, and instead, the weighting matrix may be used for inter prediction.
[0350] In an embodiment of the present application, an intra prediction method is provided. The encoder / decoder can identify two different prediction blocks for a current block using two different intra angle prediction modes, and then combine the two different prediction blocks with various weighting matrices to finally obtain a more complex prediction block. This improves the accuracy of intra prediction, reduces the cost and complexity of hardware implementation, realizes a simple and efficient encoding / decoding method, and improves compression performance.
[0351] Based on the above embodiment, in a further embodiment of the present application, after the encoder determines that the IWCP mode is used for the current block, it can further determine an intra-prediction mode parameter for the current block and write the intra-prediction mode parameter to the bitstream, and the intra-prediction mode parameter is used to determine whether the IWCP mode is used for the current block.
[0352] In addition, in an embodiment of the present application, the intra prediction mode parameter can indicate whether the IWCP mode can be used for the current block, i.e., whether two different intra angle prediction modes can be used to determine the prediction value of the current block.
[0353] In the embodiment of the present application, the intra-prediction mode parameter may be understood as a flag indicating whether the IWCP mode is used. Specifically, the encoder can analyze the bitstream to identify a variable as the intra-prediction mode parameter, and can identify the intra-prediction mode parameter based on the value of the variable.
[0354] For example, in this application, if the IWCP mode is used for the current block, the encoder may set the value of the intra prediction mode parameter to indicate that the IWCP mode is used for the current block. Specifically, the encoder may set the value of the variable to 1.
[0355] For example, in the present application, if the IWCP mode is not used for the current block, the encoder may set the value of the intra-prediction mode parameter to indicate that the IWCP mode is not used for the current block. Specifically, the encoder may set the value of the variable to 0.
[0356] Furthermore, in an embodiment of the present application, after the encoder completes setting the intra-prediction mode parameters, the encoder can write the intra-prediction mode parameters into a bitstream and transmit the bitstream to the decoder, so that the decoder can obtain the intra-prediction mode parameters after decoding the bitstream.
[0357] That is, in an embodiment of the present application, the encoder side performs predictive coding on the current block, during which it determines the intra-prediction mode parameters of the current block, writes the corresponding intra-prediction mode parameters into a bitstream, and transmits the bitstream from the encoder to the decoder.
[0358] In addition, in an embodiment of the present application, before performing intra prediction on the current block, the encoder can first identify a prediction mode parameter, and then use the prediction mode parameter to identify which encoding mode is to be used for the current block.
[0359] Furthermore, in an embodiment of the present application, when determining a prediction mode parameter for a current block, the encoder may first perform coding prediction for the current block using a plurality of different prediction modes, and then calculate a rate-distortion cost corresponding to each of the plurality of prediction modes. Finally, the encoder may select the smallest rate-distortion cost from the calculated plurality of rate-distortion costs, and determine the prediction mode corresponding to the smallest rate-distortion cost as the prediction mode parameter for the current block.
[0360] That is, for the current block, the encoder can use multiple prediction modes to encode the color components waiting to be predicted.
[0361] Furthermore, in an embodiment of the present application, an encoder may encode a current block using a plurality of prediction modes, and then obtain a rate-distortion cost corresponding to each prediction mode. Next, the encoder may select a minimum rate-distortion cost from the obtained plurality of rate-distortion costs and specify a prediction mode corresponding to the minimum rate-distortion cost as a prediction mode parameter for the current block. In this manner, the specified prediction mode may be used to encode the current block, and this prediction mode may reduce a prediction residual and improve encoding and decoding efficiency.
[0362] Furthermore, in an embodiment of the present application, on the encoding side, when the encoder attempts to obtain a prediction block by intra prediction, the encoder also attempts to obtain the cost of encoding using the IWCP mode. When the encoder attempts to obtain the cost of encoding using the IWCP mode, the encoder attempts to obtain the costs of all or some of the possible situations and selects the minimum cost as the cost of encoding using the IWCP mode.
[0363] It should be noted that in the embodiment of the present application, all the above possible situations include a combination of three variables, which are that the first intra prediction mode of the current block is all possible prediction modes, the second intra prediction mode of the current block is all possible prediction modes, and the weight matrix derivation mode is all possible modes.
[0364] It should be noted that in this application, the first intra prediction mode and the second intra prediction mode are completely different intra angle prediction modes, and the encoder may limit the intra angle prediction modes available for the IWCP mode, or may limit the number of weight matrix derivation modes available for the IWCP mode, thereby correspondingly reducing the number of possible situations and the complexity on the encoding side.
[0365] For example, in the present application, assuming that there are 66 total intra prediction modes available for the IWCP mode and 66 first intra prediction modes, there are 65 second intra prediction modes because the second intra prediction mode is different from the first intra prediction mode. Assuming that there are 56 weighting matrix derivation modes (e.g., AWP), the present application can use any two different intra prediction modes and any weighting matrix derivation mode, resulting in a total of 66 × 65 × 56 possibilities. If the available intra angular prediction modes are limited, i.e., the mode range within the preset angular prediction mode set is limited, for example, if the preset angular prediction mode set is limited to include only 28 intra angular prediction modes with mode numbers 4 to 31, there are 28 possibilities for the first intra prediction mode, and since the second intra prediction mode is different from the first intra prediction mode, there are 27 possibilities for the second intra prediction mode. Assuming there are 56 weighting matrix derivation modes (AWP as an example), the present application can utilize any two different intra prediction modes and any weighting matrix derivation mode, resulting in a total of 28 x 27 x 56 possibilities.
[0366] Furthermore, in an embodiment of the present application, the encoder performs rate distortion optimization (RDO) for all possible situations of IWCP modes to identify one combination with the lowest cost, where each combination includes a first intra-prediction mode, a second intra-prediction mode, and a weight matrix derivation mode.
[0367] Optionally, to reduce the time consumption of the RDO, a set number of candidate combinations of the first intra prediction mode, the second intra prediction mode, and the weighting matrix derivation mode can be identified by first selecting from all possible IWCP modes and using an approximation cost, such as sum of absolute difference (SAD) or sum of absolute transformed difference (SATD). Then, the RDO performs refinement to identify the combination of the first intra prediction mode, the second intra prediction mode, and the weighting matrix derivation mode with the lowest cost. Some fast algorithms can be used for the initial selection to reduce the number of attempts. For example, if one intra angular prediction mode causes a high cost, multiple intra prediction modes adjacent to the intra angular prediction mode are not attempted.
[0368] In the present application, in the initial selection and refinement, the cost may include the overhead cost of encoding the first intra prediction mode, the second intra prediction mode, and the weight matrix derivation mode in the bitstream. Also, during the initial selection, estimated overhead costs in the bitstream for the first intra prediction mode, the second intra prediction mode, and the weight matrix derivation mode may be used. For example, the number of bits for the first intra prediction mode or the second intra prediction mode may be estimated depending on whether the first intra prediction mode or the second intra prediction mode is an MPM, or the number of bits for the first or second intra prediction mode may be estimated depending on the sorting of the intra prediction modes. In RDO, the cost can be obtained through more accurate trial coding. In this process, the MPM list construction method or intra prediction mode sorting method of the present application is required.
[0369] In addition, in the present application, during the initial selection and refinement, a first prediction block is identified based on a first intra prediction mode, a second prediction block is identified based on a second intra prediction mode, and a weighting matrix is derived based on a weighting matrix derivation mode. The prediction block of the present application is identified based on the first prediction block, the second prediction block, and the weighting matrix. During the initial selection using SAD and SATD, the current block and the prediction block are used to identify SAD and SATD.
[0370] Furthermore, in an embodiment of the present application, the encoder may first analyze the texture of the current block, for example, using gradient analysis. The analyzed data is useful for the initial selection. For example, if the texture of the current block is strong in a certain direction, intra prediction modes in a direction similar to that direction are selected more frequently for trial during the initial selection. If the texture of the current block is weak in a certain direction, intra prediction modes in a direction similar to that direction are selected less frequently or not selected for trial during the initial selection.
[0371] In this application, the cost of encoding using the IWCP mode includes the cost of the codewords occupied in the bitstream by the first intra-prediction mode, the second intra-prediction mode, and the weighting matrix derivation mode, the cost of various flags and quantization coefficients transmitted in the bitstream for transforming, quantizing, entropy coding, etc. of the prediction residual, the cost of distortion of the reconstructed block, etc.
[0372] After determining the cost of encoding using the IWCP mode, if the cost of encoding using the IWCP mode is lower than the cost of other prediction modes (other prediction modes may include other intra prediction modes or inter prediction modes, etc.), the encoder selects the IWCP mode as the prediction mode for the current block. Otherwise, the encoder selects other prediction modes.
[0373] Furthermore, in an embodiment of the present application, the encoder attempts different block divisions and identifies the encoding cost. When the IWCP mode is selected for a certain prediction block, the flags required for the IWCP mode, as well as information on the first intra-prediction mode, the second intra-prediction mode, and the weight matrix derivation mode are written into the bitstream according to a syntax, and the prediction block can be predicted and coded using the IWCP mode at the same time.
[0374] In an embodiment of the present application, an intra prediction method is provided. The encoder / decoder can identify two different prediction blocks for a current block using two different intra angle prediction modes, and then combine the two different prediction blocks with various weighting matrices to finally obtain a more complex prediction block. This improves the accuracy of intra prediction, reduces the cost and complexity of hardware implementation, realizes a simple and efficient encoding / decoding method, and improves compression performance.
[0375] Based on the above embodiment, in yet another embodiment of the present application, FIG. 10 is a first schematic diagram illustrating the structure of an encoder according to an embodiment of the present application. As shown in FIG. 10, the encoder 300 according to an embodiment of the present application includes a first identification unit 301, a first construction unit 302, and an encoding unit 303. The first identification unit 301 is configured to identify a first intra prediction mode and a second intra prediction mode of the current block when an intra prediction value of the current block is identified using an intra weighted combined prediction (IWCP) mode, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes. The first construction unit 302 is configured to construct a most probable mode (MPM) list for the current block. The first identification unit 301 is further configured to identify a first mode index and a second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list. The encoding unit 303 is configured to write the first mode index and the second mode index to a bitstream.
[0376] 11 is a second schematic diagram illustrating the structure of an encoder according to an embodiment of the present application. As shown in FIG. 11, an encoder 300 according to an embodiment of the present application includes a first processor 304, a first memory 305, a first communication interface 306, and a first bus 307, where the first memory 305 stores instructions executable by the first processor 304, and the first bus 307 is used to connect the first processor 304, the first memory 305, and the first communication interface 306.
[0377] Further, in an embodiment of the present application, when the first processor 304 identifies an intra prediction value of the current block using the IWCP mode, it is configured to identify a first intra prediction mode and a second intra prediction mode of the current block, construct an MPM list for the current block, identify a first mode index and a second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list, and write the first mode index and the second mode index to the bitstream, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes.
[0378] 12 is a first schematic diagram illustrating the structure of a decoder according to an embodiment of the present application. As shown in FIG. 12, a decoder 400 according to an embodiment of the present application includes a decoding unit 401, a second identification unit 402, and a second construction unit 403. The decoding unit 401 is configured to decode a bitstream. The second identification unit 402 is configured to identify intra-prediction mode parameters of a current block, and, when the intra-prediction mode parameters indicate that the intra-prediction value of the current block is to be determined using the IWCP mode, the second identification unit 402 is configured to identify a first mode index and a second mode index of the current block. The second construction unit 403 is configured to construct an MPM list for the current block. The second identification unit 402 is further configured to identify a first intra prediction mode and a second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes, and the second identification unit 402 is further configured to identify a weighting matrix of the current block, and to identify a predicted value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix.
[0379] 13 is a second schematic diagram showing the structure of a decoder according to an embodiment of the present application. As shown in FIG. 13, a decoder 400 according to an embodiment of the present application includes a second processor 404, a second memory 405, a second communication interface 406, and a second bus 407, where the second memory 405 stores instructions executable by the second processor 404, and the second bus 407 is used to connect the second processor 404, the second memory 405, and the second communication interface 406.
[0380] Further, in an embodiment of the present application, the second processor 404 is configured to determine an intra-prediction mode parameter of the current block by decoding the bitstream, and when the intra-prediction mode parameter indicates that the intra-prediction value of the current block is to be determined using an IWCP mode, determine a first mode index and a second mode index of the current block, construct an MPM list for the current block, determine a first intra-prediction mode and a second intra-prediction mode of the current block based on the first mode index, the second mode index, and the MPM list, determine a weighting matrix of the current block, and determine a prediction value of the current block based on the first intra-prediction mode, the second intra-prediction mode, and the weighting matrix, wherein the first intra-prediction mode and the second intra-prediction mode are different intra-angle prediction modes.
[0381] Furthermore, each functional module according to the present embodiment may be integrated into one processing unit, each unit may exist physically independently, or two or more units may be integrated into one unit. The integrated units may be realized in the form of hardware or software functional modules.
[0382] The integrated unit may be implemented as a software functional module and stored in a computer-readable recording medium when sold or used as an independent product. According to this understanding, an essential part of the technical solution of the present application, a part that contributes to the prior art, or all or part of the technical solution may be expressed as a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (such as a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The storage medium includes various types of media capable of storing program code, such as a universal serial bus (USB) flash disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0383] In an embodiment of the present application, an encoder and a decoder are provided. The decoder determines an intra prediction mode parameter of a current block by decoding a bitstream. If the intra prediction mode parameter indicates that an intra predictor of the current block is to be determined using the IWCP mode, the decoder determines a first mode index and a second mode index of the current block. The decoder constructs an MPM list for the current block. The decoder determines a first intra prediction mode and a second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list. The first intra prediction mode and the second intra prediction mode are different intra angular prediction modes. The encoder determines a weighting matrix for the current block, and determines a predictor of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix. If the encoder determines an intra predictor of the current block using the IWCP mode, the decoder determines a first intra prediction mode and a second intra prediction mode of the current block. The first intra prediction mode and the second intra prediction mode are different intra angular prediction modes. The decoder constructs an MPM list for the current block. A first mode index and a second mode index of the current block are determined based on the first intra prediction mode, the second intra prediction mode, and the MPM list. The first mode index and the second mode index are written into the bitstream. That is, in an embodiment of the present application, the encoder / decoder can determine two different prediction blocks of the current block using two different intra angle prediction modes, and then combine the two different prediction blocks with various weighting matrices to finally obtain a more complex prediction block. This improves the accuracy of intra prediction, while reducing hardware implementation costs and complexity, achieving a simple and efficient encoding / decoding method, and improving compression performance.
[0384] In an embodiment of the present application, a computer-readable storage medium is provided, which stores a program, which, when executed by a processor, performs the method described in the above embodiment.
[0385] Specifically, program instructions corresponding to an intra prediction method in this embodiment may be stored in a storage medium such as an optical disc, a hard disk, or a USB flash disk. When the program instructions corresponding to an intra prediction method stored in the storage medium are read or executed by an electronic device, the following operations are performed: Identify intra prediction mode parameters of a current block by decoding a bitstream; If the intra prediction mode parameters indicate that an intra predicted value of the current block is determined using the IWCP mode, identify a first mode index and a second mode index of the current block; Construct an MPM list for the current block; Identify a first intra prediction mode and a second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list; The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes; Identify a weighting matrix for the current block, and identify a predicted value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix.
[0386] The following operations are further performed: When determining the intra-predicted value of the current block using the IWCP mode, determine a first intra-prediction mode and a second intra-prediction mode of the current block. The first intra-prediction mode and the second intra-prediction mode are different intra-angle prediction modes. Construct an MPM list for the current block. Determine a first mode index and a second mode index of the current block based on the first intra-prediction mode, the second intra-prediction mode, and the MPM list. Write the first mode index and the second mode index into the bitstream.
[0387] It should be understood by those skilled in the art that the embodiments of the present application can be provided as a method, a system, or a computer program product. Thus, the present application can have a hardware embodiment, a software embodiment, or an embodiment combining software and hardware. Also, the present application can be implemented in the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage devices, optical memory, etc.) containing computer-usable program code.
[0388] The present application is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. Each process and / or block in the flowcharts and / or block diagrams, and combinations of processes and / or blocks in the flowcharts and / or block diagrams, may be implemented by computer program instructions. These computer program instructions, when provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device, produce a machine. The instructions, executed by the processor of the computer or other programmable data processing device, then produce a device that can be used to implement the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.
[0389] These computer program instructions can be stored on a computer-readable storage medium that can direct a computer or other programmable data processing apparatus to perform in a specific manner, whereby the instructions stored on the computer-readable storage medium result in an article of manufacture that includes an instruction apparatus that implements the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.
[0390] These computer program instructions can be loaded into a computer or other programmable data processing apparatus and cause the computer or other programmable apparatus to perform a series of operational steps to produce a computer-implemented process, where the instructions, executed on the computer or other programmable apparatus, provide the steps used to implement the functions specified in one or more processes of the flowcharts and / or one or more blocks of the block diagrams.
[0391] The above are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application.
[0392] In an embodiment of the present application, an intra prediction method, an encoder, a decoder, and a storage medium are provided. The decoder determines an intra prediction mode parameter of a current block by decoding a bitstream. If the intra prediction mode parameter indicates that an intra prediction value of the current block is to be determined using the IWCP mode, it determines a first mode index and a second mode index of the current block. It constructs an MPM list for the current block. It determines a first intra prediction mode and a second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list. The first intra prediction mode and the second intra prediction mode are different intra angular prediction modes. It determines a weighting matrix for the current block, and determines a prediction value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix. If the intra prediction value of the current block is to be determined using the IWCP mode, the encoder determines a first intra prediction mode and a second intra prediction mode of the current block. The first intra prediction mode and the second intra prediction mode are different intra angular prediction modes. It constructs an MPM list for the current block. A first mode index and a second mode index of the current block are determined based on the first intra prediction mode, the second intra prediction mode, and the MPM list. The first mode index and the second mode index are written into the bitstream. That is, in an embodiment of the present application, the encoder / decoder can determine two different prediction blocks of the current block using two different intra angle prediction modes, and then combine the two different prediction blocks with various weighting matrices to finally obtain a more complex prediction block. This improves the accuracy of intra prediction, while reducing hardware implementation costs and complexity, achieving a simple and efficient encoding / decoding method, and improving compression performance.
Claims
1. 1. An intra prediction method applied in a decoder, comprising: Decoding the bitstream to determine intra-prediction mode parameters of the current block; If it is determined that the intra predicted value of the current block is determined using an intra weighted combined prediction mode based on the intra prediction mode parameter, determining a first mode index, a second mode index, and a weighting matrix derivation mode of the current block; constructing a most probable mode (MPM) list for the current block; determining a first intra prediction mode and a second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes; determining a weighting matrix for the current block based on the weighting matrix derivation mode; determining first predicted values of samples in the current block based on the first intra-prediction mode and determining second predicted values of samples in the current block based on the second intra-prediction mode; determining predicted values of samples in the current block based on a weighting matrix for the current block, first predicted values of samples in the current block, and second predicted values of samples in the current block.
1. An intra prediction method comprising:
2. Constructing the MPM list for the current block includes: constructing the MPM list based on prediction modes of neighboring blocks of the current block and the weighting matrix derivation mode; The intra prediction method according to claim 1 .
3. Constructing the MPM list for the current block includes: constructing the MPM list based on prediction modes of neighboring blocks of the current block, a preset angular prediction mode set, and the weighting matrix derivation mode; The intra prediction method according to claim 1 .
4. Constructing the MPM list based on prediction modes of neighboring blocks of the current block, the preset angular prediction mode set, and the weighting matrix derivation mode includes: identifying a first candidate mode using prediction modes of the neighboring blocks; identifying a second candidate mode using the weighting matrix derivation mode; constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes. The intra prediction method according to claim 3 .
5. Identifying the first candidate mode using a prediction mode of the neighboring block includes: If the neighboring block is a normal intra-predicted block and the prediction mode of the neighboring block is an intra-prediction mode, identifying the prediction mode of the neighboring block as the first candidate mode; or Identifying the second candidate mode using the weighting matrix derivation mode includes: determining a boundary angle index based on the weighting matrix derivation mode; and identifying the second candidate mode using the boundary angle index. The intra prediction method according to claim 4 .
6. Constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes includes: obtaining a filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set; constructing the MPM list based on the filtered candidate modes and the second candidate mode; obtaining the filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set, If the first candidate mode belongs to the preset angle prediction mode set, identifying the first candidate mode as the filtered candidate mode; if the first candidate mode is an intra angular prediction mode and does not belong to the preset angular prediction mode set, identifying an alternative mode of the first candidate mode from the preset angular prediction mode set, and identifying the alternative mode as the filtered candidate mode; If the first candidate mode is not an intra-angle prediction mode, the first candidate mode is not added to the MPM list. The intra prediction method according to claim 4 .
7. Constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes includes: obtaining a filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set; adding the filtered candidate modes to the MPM list if the filtered candidate modes satisfy a predetermined addition condition; If the MPM list does not satisfy a predetermined list length L and the second candidate mode satisfies the predetermined addition condition, adding the second candidate mode to the MPM list, where L is an integer equal to or greater than 1. The intra prediction method according to claim 4 .
8. The method further includes identifying a first mapping relationship table between index values and binary strings; the first mapping relationship table includes a binary string having a first length, a binary string having a second length, and a binary string having a third length, respectively; the binary string having the first length is used for a prediction mode in the MPM list; the binary string having the second length and the binary string having the third length are used for other prediction modes in the preset angular prediction mode set that are not included in the MPM list; The intra prediction method according to claim 7 .
9. Determining the first intra prediction mode and the second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list includes: determining the value i of the first mode index based on the first mapping relationship table; If i is greater than or equal to 0 and less than L, identifying an angular prediction mode in the MPM list having an index of i as the first intra prediction mode; and if i is greater than or equal to L, identifying the first intra prediction mode using the set of preset angular prediction modes and the MPM list. The intra prediction method according to claim 8 .
10. The method comprises: determining a size parameter of the current block; determining whether the intra weighted combined prediction mode is used for the current block based on a size parameter of the current block; The intra prediction method according to claim 1 .
11. 1. An intra prediction method applied in an encoder, comprising: When determining an intra prediction value of a current block using an intra weighted combined prediction mode, determining a weighting matrix derivation mode of the current block, constructing a most probable mode (MPM) list of the current block, and determining a first intra prediction mode and a second intra prediction mode of the current block, wherein the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes; determining a weighting matrix for the current block based on the weighting matrix derivation mode; determining first predicted values of samples in the current block based on the first intra-prediction mode and determining second predicted values of samples in the current block based on the second intra-prediction mode; determining predicted values of samples in the current block based on a weighting matrix for the current block, first predicted values of samples in the current block, and second predicted values of samples in the current block; Identifying a first mode index and a second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list; writing the first mode index and the second mode index into a bitstream.
1. An intra prediction method comprising:
12. Constructing the MPM list for the current block includes: constructing the MPM list based on prediction modes of neighboring blocks of the current block and the weighting matrix derivation mode; The intra prediction method according to claim 11 .
13. Constructing the MPM list for the current block includes: constructing the MPM list based on prediction modes of neighboring blocks of the current block, a preset angular prediction mode set, and the weighting matrix derivation mode; The intra prediction method according to claim 11 .
14. Constructing the MPM list based on prediction modes of neighboring blocks of the current block, the preset angular prediction mode set, and the weighting matrix derivation mode includes: identifying a first candidate mode using prediction modes of the neighboring blocks; identifying a second candidate mode using the weighting matrix derivation mode; constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes. The intra prediction method according to claim 13 .
15. Identifying the first candidate mode using a prediction mode of the neighboring block includes: If the neighboring block is a normal intra-predicted block and the prediction mode of the neighboring block is an intra-prediction mode, identifying the prediction mode of the neighboring block as the first candidate mode; or Identifying the second candidate mode using the weighting matrix derivation mode includes: determining a boundary angle index based on the weighting matrix derivation mode; and identifying the second candidate mode using the boundary angle index. The method of intra prediction according to claim 14 .
16. Constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes includes: obtaining a filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set; constructing the MPM list based on the filtered candidate modes and the second candidate mode; obtaining the filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set, If the first candidate mode belongs to the preset angle prediction mode set, identifying the first candidate mode as the filtered candidate mode; if the first candidate mode is an intra angular prediction mode and does not belong to the preset angular prediction mode set, identifying an alternative mode of the first candidate mode from the preset angular prediction mode set, and identifying the alternative mode as the filtered candidate mode; If the first candidate mode is not an intra-angle prediction mode, the first candidate mode is not added to the MPM list. The method of intra prediction according to claim 14 .
17. Constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes includes: obtaining a filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set; adding the filtered candidate modes to the MPM list if the filtered candidate modes satisfy a predetermined addition condition; If the MPM list does not satisfy a predetermined list length L and the second candidate mode satisfies the predetermined addition condition, adding the second candidate mode to the MPM list, where L is an integer equal to or greater than 1. The method of intra prediction according to claim 14 .
18. The method further includes identifying a first mapping relationship table between index values and binary strings; the first mapping relationship table includes a binary string having a first length, a binary string having a second length, and a binary string having a third length, respectively; the binary string having the first length is used for a prediction mode in the MPM list; the binary string having the second length and the binary string having the third length are used for other prediction modes in the preset angular prediction mode set that are not included in the MPM list; The method of intra prediction according to claim 17 .
19. Determining the first intra prediction mode and the second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list includes: determining the value i of the first mode index based on the first mapping relationship table; If i is greater than or equal to 0 and less than L, identifying an angular prediction mode in the MPM list having an index of i as the first intra prediction mode; and if i is greater than or equal to L, identifying the first intra prediction mode using the set of preset angular prediction modes and the MPM list. The method of intra prediction according to claim 18 .
20. The method comprises: determining a size parameter of the current block; determining whether the intra weighted combined prediction mode is used for the current block based on a size parameter of the current block; The intra prediction method according to claim 11 .
21. an encoder comprising: a first identifying unit; and an encoding unit; When identifying an intra prediction value of a current block using an intra weighted combined prediction mode, the first identification unit is configured to identify a weighting matrix derivation mode of the current block, construct a most probable mode (MPM) list of the current block, and identify a first intra prediction mode and a second intra prediction mode of the current block, wherein the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes; the first identification unit is further configured to identify a weighting matrix of the current block based on the weighting matrix derivation mode, identify first predicted values of samples in the current block based on the first intra prediction mode, identify second predicted values of samples in the current block based on the second intra prediction mode, and identify predicted values of samples in the current block based on the weighting matrix of the current block, the first predicted values of samples in the current block, and the second predicted values of samples in the current block; The first identification unit is further configured to identify a first mode index and a second mode index of the current block based on the first intra prediction mode, the second intra prediction mode, and the MPM list; the encoding unit is configured to write the first mode index and the second mode index into a bitstream.
1. An encoder characterized by:
22. a decoder comprising: a decoding unit; a second identifying unit; and a second constructing unit; the decoding unit is configured to decode a bitstream; the second identification unit is configured to identify an intra prediction mode parameter of a current block; and when the second identification unit determines that an intra prediction value of the current block is to be identified using an intra weighted combined prediction mode based on the intra prediction mode parameter, the second identification unit is configured to identify a first mode index, a second mode index, and a weighting matrix derivation mode of the current block; The second constructor is configured to construct a most probable mode (MPM) list for the current block; the second identification unit is further configured to identify a first intra prediction mode and a second intra prediction mode of the current block based on the first mode index, the second mode index, and the MPM list, where the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes; and the second identification unit is further configured to identify a weighting matrix of the current block based on the weighting matrix derivation mode, identify first predicted values of samples in the current block based on the first intra prediction mode, identify second predicted values of samples in the current block based on the second intra prediction mode, and identify predicted values of samples in the current block based on the weighting matrix of the current block, the first predicted values of samples in the current block, and the second predicted values of samples in the current block.
10. A decoder comprising:
23. 1. A computer-readable storage medium, comprising: The computer-readable storage medium stores a computer program / instructions and a bitstream, and when the computer program / instructions are executed by a processor, the method of any one of claims 11 to 20 is performed to generate the bitstream. A computer-readable storage medium comprising:
24. 1. A computer-readable storage medium, comprising: The computer readable storage medium stores a computer program / instructions and a bitstream, which, when executed by a processor, performs the method of any one of claims 1 to 10 to decode the bitstream and generate a video or image. A computer-readable storage medium comprising:
Citation Information
Patent Citations
Motion and apparatus for motion field storage in video coding
US20200404267A1
Image signal encoding / decoding method and apparatus therefor
US20210227212A1
Video encoding device, and video decoding device
WO2011083599A1
Methods and systems for intra prediction
WO2011126157A1
Image signal encoding / decoding method and apparatus therefor
WO2020096389A1