Intra prediction method, encoder, decoder, and storage medium
The intra prediction method addresses the challenge of high hardware costs and complexity in video coding by combining two intra angle prediction modes with weighting matrices, enhancing accuracy and efficiency.
Patent Information
- Application Number
- JP2023549679
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2025-07-30
- Estimated Expiration
- 2041-02-22
AI Technical Summary
Existing video coding technologies face challenges in hardware implementation due to the need for two sets of intra prediction circuits for different modes, leading to increased cost and complexity, while conventional intra prediction methods struggle to handle complex textures efficiently.
An intra prediction method that identifies two different intra angle prediction modes for a current block, constructs a most probable mode list, and uses a weighting matrix to combine these modes, reducing hardware costs and complexity while improving encoding/decoding efficiency.
This approach enhances prediction accuracy, reduces hardware implementation costs, and improves compression performance by combining two intra angle prediction modes with weighting matrices, resulting in a more complex prediction block.
Smart Images

Figure 0007715817000010 
Figure 0007715817000011 
Figure 0007715817000012
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of image processing technology, and more particularly, to an intra prediction method, an encoder, a decoder, and a storage medium.
Background Art
[0002] In order to capture finer edge directions that appear in natural videos, in versatile video coding (VVC), the 33 intra-luminance prediction angle modes defined in high efficiency video coding (HEVC), which is a video compression standard, are extended to 65, and furthermore, there are two non-angle modes: the Planar mode with number 0 and the direct current (DC) mode with number 1.
[0003] In order to improve the accuracy of intra prediction, currently, a method of performing intra prediction using two different intra prediction modes has been proposed. However, in hardware implementation, it is difficult to reuse circuits of different intra prediction modes. Therefore, two sets of intra prediction circuits are required, and adding new prediction circuits leads to an increase in the cost of hardware implementation, an increase in complexity, and a decrease in encoding / decoding performance.
Summary of the Invention
[0004] In embodiments of the present application, an intra prediction method, an encoder, a decoder, and a storage medium are provided. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
[0005] The technical solution of the embodiments of the present application can be realized as follows.
[0006] In a first aspect, in an embodiment of the present application, an intra prediction method is provided. The method is applied to a decoder and includes the following. By decoding a bitstream, an intra prediction mode parameter of a current block is identified. When the intra prediction mode parameter instructs to identify an intra prediction value of the current block using an intra weighted combined prediction (IWCP) mode, a first mode index and a second mode index of the current block are identified. A most probable mode (MPM) list of the current block is constructed. Based on the first mode index, the second mode index, and the MPM list, a first intra prediction mode and a second intra prediction mode of the current block are identified. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. A weighting matrix of the current block is identified, and based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, a prediction value of the current block is identified.
[0007] In a second aspect, in an embodiment of the present application, an intra prediction method is provided. The method is applied to an encoder and includes the following. When identifying an intra prediction value of a current block using an intra weighted combined prediction (IWCP) mode, a first intra prediction mode and a second intra prediction mode of the current block are identified. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. A most probable mode (MPM) list of the current block is constructed. Based on the first intra prediction mode, the second intra prediction mode, and the MPM list, a first mode index and a second mode index of the current block are identified. The first mode index and the second mode index are written into a bitstream.
[0008] In a third aspect, in an embodiment of the present application, an encoder is provided. The encoder includes a first specifying unit, a first constructing unit, and an encoding unit. The first specifying unit is configured to specify a first intra prediction mode and a second intra prediction mode of a current block when specifying an intra prediction value of the current block using an intra weighted combination prediction (IWCP) mode, and the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. The first constructing unit is configured to construct a most probable mode (MPM) list of the current block. The first specifying unit is further configured to specify 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.
[0009] In a fourth aspect, in an embodiment of the present application, a decoder is provided. The decoder includes a decoding unit, a second specifying unit, and a second constructing unit. The decoding unit is configured to decode a bitstream. The second specifying unit is configured to specify an intra prediction mode parameter of a current block, and when the intra prediction mode parameter instructs to specify an intra prediction value of the current block using an intra weighted combination prediction (IWCP) mode, the second specifying unit is configured to specify a first mode index and a second mode index of the current block. The second constructing unit is configured to construct a most probable mode (MPM) list of the current block. The second specifying unit is further configured to specify 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, and the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. The second specifying unit is further configured to specify a weighting matrix of the current block, and based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, to specify a predicted value of the current block.
[0010] In a fifth aspect, in an embodiment of the present application, an encoder is provided. The encoder includes a first processor and a first memory storing instructions executable by the first processor. When the instructions are executed, the first processor executes the intra prediction method.
[0011] In a sixth aspect, in an embodiment of the present application, a decoder is provided. The decoder includes a second processor and a second memory storing instructions executable by the second processor. When the instructions are executed, the second processor executes the intra prediction method.
[0012] In a seventh aspect, in an embodiment of the present application, a computer storage medium is provided. A computer program is stored in the computer storage medium. When the computer program is executed by a first processor, the intra prediction method described in the Two above aspect is executed, or when the computer program is executed by a second processor, the intra prediction method described in the One above aspect is executed.
[0013] In an embodiment of the present application, an intra prediction method, an encoder, a decoder, and a storage medium are provided. The decoder decodes a bitstream to identify an intra prediction mode parameter of a current block. When the intra prediction mode parameter instructs to identify an intra prediction value of the current block using the IWCP mode, a first mode index and a second mode index of the current block are identified. An MPM list of the current block is constructed. Based on the first mode index, the second mode index, and the MPM list, a first intra prediction mode and a second intra prediction mode of the current block are identified. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. A weighting matrix of the current block is identified, and based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, a prediction value of the current block is identified. When the encoder identifies an intra prediction value of the current block using the IWCP mode, a first intra prediction mode and a second intra prediction mode of the current block are identified. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. An MPM list of the current block is constructed. Based on the first intra prediction mode, the second intra prediction mode, and the MPM list, a first mode index and a second mode index of the current block are identified. The first mode index and the second mode index are written into the bitstream. That is, in the embodiment of the present application, the encoder / decoder can identify two different prediction blocks of the current block in two different intra angle prediction modes, and then finally obtain a more complex prediction block by combining the two different prediction blocks with various weighting matrices. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
Brief Description of Drawings
[0014]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Embodiments for Carrying Out the Invention
[0015] Hereinafter, the technical solutions of the embodiments of the present application will be clearly and comprehensively described 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. Also, for ease of explanation, the drawings only show the parts related to the present application.
[0016] Currently, a block-based hybrid coding framework is used in general video coding and decoding standards. Each image (frame) in a video picture is divided into largest coding units (LCUs) that are squares of the same size (e.g., 128×128, 64×64, etc.), and each largest coding unit can also be divided into rectangular coding units (CUs) based on rules, and the coding units can also 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 Filter. The prediction module can include intraPrediction and interPrediction, and interPrediction can include motion estimation and motion compensation. Since there is a strong correlation between adjacent samples in a video picture, in video coding and decoding technology, the intra-prediction method is used to eliminate the spatial redundancy between adjacent samples. Since there is a strong similarity between adjacent images in a video, in video coding and decoding technology, the inter-prediction method can be used to eliminate the temporal redundancy between adjacent images and improve the coding and decoding efficiency.
[0017] The basic process of video encoding and decoding is as follows. On the encoding side, one image is divided into blocks, and a predicted block of the current block is generated by performing intra prediction or inter prediction on 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 quantized coefficient matrix. The quantized coefficient matrix is entropy encoded and output to a bitstream. On the decoding side, a predicted block of the current block is generated by performing intra prediction or inter prediction on the current block. On the other hand, the bitstream is decoded to obtain a quantized coefficient matrix. The quantized coefficient matrix is inverse quantized and inverse transformed to obtain a residual block. The predicted block and the residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image. The reconstructed image is loop-filtered based on the image or blocks to obtain a decoded image. On the encoding side as well, in order to obtain a decoded image, processing similar to that on the decoding side is required. The decoded image can be a reference image for inter prediction of subsequent images. The block division information specified on the encoding side, and mode information or parameter information such as prediction, transformation, quantization, entropy encoding, loop filtering, etc. are output to the bitstream as necessary. The decoding side analyzes and analyzes the existing information to identify the same block division information, mode information or parameter information such as prediction, transformation, quantization, entropy encoding, loop filtering, etc. as on the encoding side. Thereby, it is ensured that the decoded image obtained on the encoding side is the same as the decoded image obtained on the decoding side. The decoded image obtained on 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 transformation units, and the divisions of the prediction units and the transformation units may be different. The above is the basic process of video encoding and decoding in a block-based hybrid encoding framework. With the development of technology, some modules or steps in the framework or process may be optimized.Embodiments of the present application are applicable to the basic flow of video encoding and decoding in a hybrid encoding framework based on the block, but are not limited to the framework or the flow.
[0018] The current block may be a current coding unit (CU), or a current prediction unit (PU), etc.
[0019] In inter prediction, the current block is predicted using information of a decoded or reconstructed image or a reference image. In inter prediction, motion information is used to find a reference block from a reference image, and a prediction block is generated based on the reference block. The motion information includes a reference image list including a reference image, a reference image index, and a motion vector. The motion vector can be an integer-sample motion vector or a fractional-sample motion vector. When the motion vector is a fractional-sample motion vector, it is necessary to use an interpolation filter for the reference image to generate a required fractional-sample block. An integer-sample block or a fractional-sample block in the reference image found based on the motion vector is called a reference block. There is a technique of using the reference block as the prediction block as it is, and there is also a technique of processing based on the reference block to generate a prediction block. Processing based on the reference block to generate a prediction block can also be understood as using the reference block as the prediction block and then processing based on the prediction block to generate a new prediction block.
[0020] In the video encoding / decoding standard of multi-purpose video coding (VVC) currently under development, there is an inter prediction mode called geometric partitioning mode (GPM). In the video encoding / decoding standard of audio video coding standard (AVS) currently under development, there is an inter prediction mode called angular weighted prediction (AWP). Although these two modes have different names and specific implementation forms, they have something in common in principle.
[0021] In conventional uni-directional prediction, only one reference block having the same size as the current block is used. In conventional bi-directional prediction, two reference blocks having the same size as the current block are used, and the value of each sample in the prediction block is the average value of the samples at the corresponding positions in the two reference blocks. That is, the contribution rate of all samples in each reference block to the prediction block is 50%. In bi-directional 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, bi-directional optical flow (BIO), etc., cause some changes in the reference samples or prediction samples. Also, GPM or AWP also uses two reference blocks having the same size as the current block. However, at some sample positions, the sample value at the corresponding position of the first reference block is used 100%, at some other sample positions, the sample value at the corresponding position of the second reference block is 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 certain ratio. How the weights of the sample values are specifically assigned is determined by the mode of GPM or AWP.
[0022] Exemplarily, FIG. 1 is a first schematic diagram showing weight assignment. As shown in FIG. 1, a schematic diagram of weight assignment for multiple split modes of GPM in a 64×64 current block according to an embodiment of the present application is shown. There are 64 split modes in GPM. FIG. 2 is a second schematic diagram showing weight assignment. As shown in FIG. 2, a schematic diagram of weight assignment for multiple split modes of AWP in a 64×64 current block according to an embodiment of the present application is shown. There are 56 split modes in AWP. In either FIG. 1 or FIG. 2, for various split modes, the black area indicates that the weight value at the corresponding position of the first reference block is 0%, the white area indicates that the weight value at the corresponding position of the first reference block is 100%, and the gray area indicates that the weight value at the corresponding position of the first reference block is any weight value greater than 0% and less than 100% due to the difference in color shade. The weight value at the corresponding position of the second reference block is the value obtained by subtracting the weight value at the corresponding position of the first reference block from 100%.
[0023] The method for deriving weights in GPM is different from the method for deriving weights in AWP. In GPM, the angle and offset are specified based on various modes, and then the weighting matrix for various modes is calculated. In AWP, first, a one-dimensional weight line is generated, and then the entire matrix is tiled with the one-dimensional weight line using a method similar to intra-angle prediction.
[0024] In the prior encoding / decoding techniques, regardless of the division of CUs, PUs, and transform units (TUs), only the rectangular division method exists. In GPM and AWP, the non-rectangular division effect of prediction is realized when not divided. In GPM and AWP, a mask of the weights of two reference blocks, i.e., a weight map, is used. From this mask, the weights of the two reference blocks for generating the prediction block are specified. A blending area is obtained by weighting the corresponding positions of the two reference blocks, and the transition can be made smoother. In GPM and AWP, since the current block is not divided into two CUs or PUs by a dividing line, conversion, quantization, inverse conversion, inverse quantization, etc. of the residual after prediction are performed on the entire current block.
[0025] The motion information currently used for a block can be stored. Based on the adjacent position relationship, the motion information of a previous encoded / decoded block (e.g., an adjacent block) can be used for subsequent encoded / decoded blocks of the current image. Since it utilizes spatial correlation, such motion information of the encoded / decoded image 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 previous encoded / decoded image can be used for subsequent encoded / decoded images. Since it utilizes temporal correlation, such motion information of the encoded / decoded image is called temporal motion information. In the method of storing the motion information used for each block of the current image, a matrix with a fixed size such as a 4×4 matrix is used as the minimum unit, and one set of motion information is stored independently for each minimum unit. Thus, each time a block is encoded / decoded, those minimum units corresponding to the position of that block can store the motion information of that block. Thus, when utilizing spatial motion information or temporal motion information, based on the position, the motion information corresponding to that position can be directly found. For example, when conventional unidirectional prediction is used for a 16×16 block, all of the 4×4 minimum units corresponding to that block store the motion information of this unidirectional prediction. When GPM or AWP is used for a block, all of the minimum units corresponding to that block identify the motion information 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. As one method, if all of the 4×4 samples corresponding to one minimum unit are derived from the first motion information, this minimum unit stores the first motion information. If all of the 4×4 samples corresponding to one minimum unit are derived from the second motion information, this minimum unit stores the second motion information.When a 4×4 sample corresponding to one minimum unit is derived from both the first motion information and the second motion information, in AWP, one of the two is selected and stored. In GPM, when the two motion information indicates different reference picture lists, the two motion information is combined and stored as bidirectional motion information. Otherwise, only the second motion information is stored.
[0026] Note that GPM or AWP belongs to a type of inter prediction technology. It is necessary to transmit a flag indicating whether GPM or AWP is used in the bit stream. The flag can indicate whether GPM or AWP is currently used for the current block. When GPM or AWP is used, the coder needs to transmit the specific mode used (that is, any one of the 64 split modes of GPM or any one of the 56 split modes of AWP) and the index values of the two unidirectional motion information in the bit stream. That is, for the current block, the decoder can obtain the information on whether GPM or AWP is used by decoding the bit stream. When it is determined that GPM or AWP is used, the decoder can analyze the prediction mode parameters of GPM or AWP and the two motion information index values. For example, when the current block is divided into two partitions, the first index value corresponding to the first partition and the second index value corresponding to the second partition can be analyzed.
[0027] Specifically, in the GPM mode, when GPM is used, the prediction mode parameters in GPM (for example, the specific split mode of GPM) are transmitted in the bit stream. Usually, GPM includes 64 split modes. In the AWP mode, when AWP is used, the prediction mode parameters in AWP (for example, the specific split mode of AWP) are transmitted in the bit stream. Usually, AWP includes 56 split modes.
[0028] In the inter-prediction mode, for example, in GPM and AWP, two unidirectional motion information is required to search for two reference blocks. In the current implementation, the encoder side uses the relevant information of the encoded / decoded part before the current block to construct one unidirectional motion information candidate list, selects the unidirectional motion information from the unidirectional motion information candidate list, and writes the indexes of these two unidirectional motion information in the unidirectional motion information candidate list into the bitstream. The decoder side adopts the same method as the encoder side, that is, uses the relevant information of the decoded part before the current block to construct one unidirectional motion information candidate list. This unidirectional motion information candidate list is the same as the candidate list constructed on the encoder side. In this way, the indexes of the two unidirectional motion information are analyzed from the bitstream, and then the two unidirectional motion information (that is, the two unidirectional motion information that needs to be used for the current block) are searched from the unidirectional motion information candidate list.
[0029] In other words, the unidirectional motion information described in the present application can include motion vector information (i.e., the values of (x, y)) 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 indexes in two reference image lists are 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 is invalid, for example, -1. The reference image list for which the reference image index is valid 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 one corresponding motion vector, 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 necessary reference image from the reference image information in the unidirectional motion information, and based on the position of the current block and the motion vector (i.e., the values of (x, y)), find the reference block from the reference image, and further specify the inter-prediction value of the current block.
[0030] In the intra prediction method, the current block is predicted by using the reconstructed samples that have been encoded / decoded around the current block as reference samples. FIG. 3 is a schematic diagram showing intra prediction. As shown in FIG. 3, the size of the current block is 4×4, and the samples in the leftmost column and the topmost row of the current block are the reference samples of the current block. In intra prediction, these reference samples are used to predict the current block. All of these reference samples may be available, that is, they may all have been encoded / decoded. Optionally, some of these reference samples may be unavailable. For example, the current block is at the far left of the entire image, and the reference sample to the left of the current block is unavailable. Or, when encoding / decoding the current block, the bottom-left sample of the current block has not yet been encoded / decoded, so the bottom-left reference sample is also unavailable. When the reference samples are unavailable, filling may or may not be performed using the available reference samples or some value or method.
[0031] Furthermore, when performing intra prediction, in the multiple reference line (MRL) intra prediction method, more reference samples can be used to improve the encoding efficiency. For example, four reference lines / columns are used as the reference samples of the current block.
[0032] There are multiple types of prediction modes for intra prediction. In H.264, when performing intra prediction on a 4×4 block, 9 modes can be included. In mode 0, the samples above the current block are copied vertically along to the current block as the predicted value. In mode 1, the reference samples to the left of the current block are copied horizontally along to the current block as the 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 samples are copied to the corresponding positions of the current block along a certain angle. Since some positions of the current block cannot strictly correspond to the reference samples, it is necessary to use the weighted average value of the reference samples or the interpolated fractional samples of the reference samples.
[0033] There are also other modes such as the Planar mode. With the development of technology and the expansion of blocks, the number of angle prediction modes is also increasing. For example, the intra prediction modes used in HEVC include the Planar mode, the DC mode, and 33 angle modes, a total of 35 prediction modes. The intra modes used in VVC include the Planar mode, the DC mode, and 65 angle modes, a total of 67 prediction modes. The intra modes used in AVS3 include the DC mode, the Plane mode, the Bilinear mode, and 63 angle modes, a total of 66 prediction modes.
[0034] There are also techniques for improving prediction, such as improving fractional sample interpolation of reference samples, filtering prediction samples, etc. For example, in the multiple intra prediction filter (MIPF) in AVS3, different filters are used to generate prediction values for blocks with different sizes. For samples at different positions within the same block, one type of filter is used to generate prediction values for samples close to the reference samples, and another filter is used to generate prediction values for samples far from the reference samples. In techniques for filtering prediction samples, such as the intra prediction filter (IPF) in AVS3, the prediction values can be filtered using reference samples.
[0035] In intra prediction, the intra mode coding technique using the most probable mode (MPM) list can be used to improve the encoding and decoding efficiency. An intra prediction mode (e.g., an adjacent mode) derived based on the intra prediction mode of the encoded and decoded surrounding blocks and the intra prediction mode of the encoded and decoded surrounding blocks, and general or highly probable intra prediction modes (e.g., DC, Planar, Bilinear modes, etc.) are used to construct one MPM list. Since the texture has spatial continuity, referring to the intra prediction mode of the encoded and decoded surrounding blocks utilizes spatial correlation. The MPM can be used for predicting 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, during binarization, fewer codewords are used for the MPM, so overhead can be saved and the encoding and decoding efficiency can be improved.
[0036] Current intra prediction has modes such as DC mode, Planar mode, and Bilinear mode, but all of these can only handle the prediction of simple textures. Even if the number of angular modes increases, the prediction based on such modes can only be executed along a straight line of one angle. Thus, the conventional intra prediction mode can only handle the prediction of simple textures. For complex textures, during prediction, it is necessary to divide them into smaller blocks or encode more residuals, which may cause significant distortion.
[0037] Regarding the above problems, currently, an intra prediction method has been proposed. In this method, the encoder and decoder identify two different prediction blocks of the current block in two different intra prediction modes, and then finally obtain a more complex prediction block by combining the prediction blocks with various weighting matrices, thereby improving the prediction accuracy. However, the computational logics of non-angular prediction modes such as DC mode, Planar mode, PLANE mode, and Bilinear mode are different from those of the angular prediction mode. Each non-angular prediction mode has its own logic, and in hardware implementation, it is difficult to reuse the circuit of the non-angular prediction mode as the circuit of the angular prediction mode. When performing prediction using two intra prediction modes, the prediction by the two intra prediction modes is performed serially in hardware. Furthermore, when combined based on the weighting matrix, the existing intra prediction circuit can be used for the prediction by the two intra prediction modes. However, it is necessary to store the predicted values previously predicted. Thus, the time for intra-weighted combination prediction is significantly longer than the time for the original prediction using only one intra prediction mode. When the prediction by the two intra prediction modes is performed in parallel in hardware, the generation speed of the predicted values for intra-weighted combination prediction is clearly faster than that of the serial implementation. In contrast, in terms of cost, two sets of intra prediction circuits are required, that is, it is necessary to add one set of intra prediction circuits. The intra prediction circuit mentioned here is for performing prediction by the above intra non-angular prediction mode and intra angular prediction mode, that is, a new set of intra prediction circuits is added.
[0038] Thus, in the conventional method of performing intra prediction using two different intra prediction modes, the prediction effect can be improved to a certain extent. However, it is necessary to newly add a prediction circuit, which leads to an increase in the cost of hardware implementation. Therefore, the newly added intra prediction circuit can be simplified as much as possible to reduce the complexity caused by intra weight combination prediction. To solve the above problems, in the embodiments of the present application, the encoder / decoder can identify two different prediction blocks of the current block in two different intra angle prediction modes, and then, by combining the two different prediction blocks with various weighting matrices, a more complex prediction block can be finally obtained. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
[0039] Referring to FIG. 4, FIG. 4 is a block diagram showing 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 / quantization unit 101, an intra prediction unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform / inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, a decoded image buffer unit 110, and the like. The filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering. The encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC). For the input original video signal, one video encoding block can be obtained by dividing a coding tree unit (CTU). Next, for the residual sample information obtained by performing intra prediction or inter prediction, the transform / quantization unit 101 performs a transform on the video encoding block, for example, including transforming 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 prediction unit 102 and the intra prediction unit 103 are used to perform intra prediction on the video encoding block. Specifically, the intra prediction unit 102 and the intra prediction unit 103 are used to identify the intra prediction mode for encoding the video encoding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter prediction encoding of the received video encoding block for one or more blocks in one or more reference images to provide temporal prediction information.The motion estimation executed by the motion estimation unit 105 is a process of generating a motion vector, and the motion of the video encoding block can be estimated by the motion vector. Next, the motion compensation unit 104 executes motion compensation based on the motion vector specified by the motion estimation unit 105. After the intra prediction mode is specified, the intra prediction unit 103 is further used to provide the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 transmits the motion vector data specified by calculation to the encoding unit 109. Further, the inverse transform and inverse quantization unit 106 reconstructs the video encoding block and is used to reconstruct the residual block within the pixel region. The reconstructed residual block is filtered by the filter control analysis unit 107 and the filtering unit 108 to remove blocking effect artifacts. Next, the reconstructed residual block is added to one of the prediction blocks in the image of the decoded image buffer unit 110 to generate a reconstructed video code block. The encoding unit 109 is used to encode various encoding parameters and the quantized transform coefficients. In the CABAC-based encoding algorithm, the context content can be used to encode information indicating the specified intra prediction mode based on adjacent encoding blocks and output the bitstream of the video signal. The decoded image buffer unit 110 is used to store the reconstructed video encoding block for prediction reference. As the video image encoding is executed, new reconstructed video encoding blocks are continuously generated, and all of these reconstructed video encoding blocks are stored in the decoded image 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, a decoded image buffer unit 206, and the like. The decoding unit 201 can realize header information decoding and CABAC decoding. The filtering unit 205 can realize deblocking filtering and SAO filtering. After the input video signal is encoded as shown in FIG. 4, the bitstream of the video signal is output. The bitstream is input to the video decoding system 20, and first, the decoding unit 201 obtains the decoded transform coefficients. For the transform coefficients, the inverse transform and inverse quantization unit 202 processes them to generate a residual block in the pixel domain. The intra prediction unit 203 can be used to generate prediction data for the current video decoding block based on the specified intra prediction mode and data from the blocks decoded before the current frame or image. The motion compensation unit 204 analyzes the motion vector and other related syntax elements to identify prediction information for the video decoding block, and uses the prediction information to generate a prediction block for the video decoding block being decoded. By adding the residual block from the inverse transform and inverse quantization unit 202 and the corresponding prediction block generated by the intra prediction unit 203 or the motion compensation unit 204, a decoded video block is formed. The decoded video signal is processed by the filtering unit 205 to remove block effect artifacts, thereby improving the video quality. Next, the decoded video block is stored in the decoded image buffer unit 206. The decoded image buffer unit 206 stores a reference image for subsequent intra prediction or motion compensation, and is simultaneously used to output a video signal to obtain the restored original video signal.
[0041] The intra prediction method in the embodiments of the present application is mainly applied to the intra prediction unit 103 shown in FIG. 4 and the intra prediction unit 203 shown in FIG. 5. That is, the intra prediction method in the embodiments of the present application may be applied to a video encoding system, may be applied to a video decoding system, and further may be applied to both the video encoding system and the video decoding system at the same time, but is not particularly limited in the embodiments of the present application. When the intra prediction method is applied to the intra prediction unit [0000161], "the current block" specifically refers to the current encoding block in intra prediction. When the intra prediction method is applied to the intra prediction unit [0000162], "the current block" specifically refers to the current decoding block in intra prediction.
[0042] Hereinafter, with reference to the drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely.
[0043] In one embodiment of the present application, an intra prediction method applied to a decoder is provided. FIG. 6 is the first flowchart showing the realization of the intra prediction method. As shown in FIG. 6 The intra prediction method by the decoder may include the following steps.
[0044] Step 101: By decoding the bitstream, identify the intra prediction mode parameter of the current block.
[0045] In the embodiments of the present application, the decoder can identify the intra prediction mode parameter of the current block by decoding the bitstream.
[0046] In the embodiments of the present application, the intra prediction mode parameter can indicate whether the intra weighted combination prediction (IWCP) mode can be used for the current block, that is, whether two different intra angle prediction modes can be used to identify the predicted value of the current block.
[0047] In addition, in the embodiments 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 bit stream, and the value of the variable can be used to identify the intra prediction mode parameter.
[0048] In addition, in the embodiments of the present application, the IWCP mode is a kind of intra prediction method. Specifically, in the IWCP mode, two different intra angle prediction modes are identified for the current block, and based on each of these two different intra angle prediction modes, two prediction blocks are respectively identified. Next, a weighting matrix is identified, and by combining these two prediction blocks based on the weighting matrix, a new prediction block can be finally obtained, that is, the prediction block of the current block can be obtained.
[0049] FIG. 7 is a schematic diagram showing the IWCP mode. As shown in FIG. 7, when performing intra prediction on the current block, the first prediction block of the current block can be identified by using the intra angle prediction mode 1 (the first intra prediction mode), and at the same time, the second prediction block of the current block can be identified by using the intra angle prediction mode 2 (the second intra prediction mode). Then, a new prediction block can be finally obtained by combining the first prediction block and the second prediction block using the weighting matrix.
[0050] In the embodiments of the present application, a video image can be divided into a plurality of image blocks. A current block is an image block waiting for current encoding and can be referred to as a Coding Block (CB). Here, each coding block can 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 luminance component, that is, assuming that the color component waiting for prediction is a luminance component, the coding block waiting for prediction may be referred to as a luminance block. If a second intra prediction is performed and the second color component is a chroma component, that is, assuming that the color component waiting for prediction is a chroma component, the coding block waiting for prediction may be referred to as a chroma block.
[0051] Furthermore, in the embodiments of the present application, when applying the IWCP mode, the size of the current block may be restricted.
[0052] In the intra prediction method according to the embodiments of the present application, since it is necessary to generate two prediction blocks by using two different intra angle prediction modes respectively and obtain a new prediction block by performing weighting based on a weighting matrix, in order to reduce the complexity and take into account the balance between both the compression performance and the complexity, in the embodiments of the present application, it is possible to restrict the IWCP mode from being used for prediction blocks having a specific size. Therefore, in the present application, a decoder can first identify the size parameter of the current block and, based on the size parameter, identify whether the IWCP mode is used for the current block.
[0053] In addition, in the embodiments of the present application, the size parameter of the current block can include the height and width of the current block. Therefore, the decoder can limit the use of the IWCP mode based on the height and width of the current block, that is, it can limit the size of the predicted block for which the IWCP mode can be used.
[0054] Exemplarily, in the present application, when both the width and the height are greater than or equal to the first lower limit value and both the width and the height are less than or equal to the first upper limit value, it can be determined that the IWCP mode is used for the current block. Thus, as one possible limitation, the IWCP mode is used only when the width and height of the predicted block are smaller than (or less than or equal to) the first upper limit value and the width and height of the predicted block are greater than (or greater than or equal to) the first lower limit value. Note that the first lower limit value may be 8, and the value of the first upper limit value may be 16 or 32, etc.
[0055] Exemplarily, in the present application, there can be a frame-level flag for determining whether the IWCP mode is used for the current frame waiting for decoding. For example, the IWCP mode can be configured to be used for intra-frames (e.g., I-frames) and not used for inter-frames (e.g., B-frames, P-frames). Or, the IWCP mode can be configured not to be used for intra-frames and to be used for inter-frames. Or, the IWCP mode can be configured to be used for some inter-frames and not used for some inter-frames. Since intra prediction can be used for inter-frames, there is also a possibility that the IWCP mode is used for inter-frames.
[0056] Exemplarily, in the present application, there can be a flag at a level below the frame level and above the CU level (e.g., tile, slice, patch, LCU, etc.) for determining whether the IWCP mode is used for this area.
[0057] Step 102: When the intra prediction mode parameter instructs that the current block uses the IWCP mode to determine the intra prediction value of the current block, determine the first mode index and the second mode index of the current block.
[0058] In the embodiments of the present application, after the decoder determines the intra prediction mode parameter of the current block, when the intra prediction mode parameter instructs that the current block uses the IWCP mode to determine the intra prediction value of the current block, the decoder can further determine the first mode index and the second mode index of the current block.
[0059] Note that in the embodiments of the present application, the first mode index can be used to indicate the first intra prediction mode used for the current block, and the second mode index can be used to indicate the second intra prediction mode 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 angle 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 angle prediction modes with mode numbers from 4 to 31. Therefore, both the value of the first mode index and the value of the second mode index are in the range of 0 to 27.
[0061] Exemplarily, in the embodiments of the present application, the first mode index can be represented by the parameter iwcp_pred_mode0_index, and the second mode index can be represented by the parameter iwcp_pred_mode1_index.
[0062] Step 103: Construct the MPM list of the current block.
[0063] In an embodiment of the present application, the decoder can further construct the MPM list of the current block. All prediction modes in the MPM list are intra-angle prediction modes.
[0064] Also, in an embodiment of the present application, when constructing the MPM list of the current block, the decoder needs to first identify the weight matrix derivation mode of the current block, and then use the weight matrix derivation mode to identify the MPM list of the current block.
[0065] Note that in the present application, the weight matrix derivation mode is used to identify the weight matrix used for the current block. Specifically, the weight matrix derivation mode may be a mode for deriving the weight matrix. For a prediction block with a predetermined Height and width, one weight matrix can be derived for each of various weight matrix derivation modes. For prediction blocks having the same size, the weight matrices derived from different weight matrix derivation modes are different.
[0066] Exemplarily, in the present application, there are 56 weight matrix derivation modes for AWP in AVS3 and 64 weight matrix derivation modes for GPM in VVC.
[0067] Optionally, in the present application, when constructing the MPM list of the current block, the decoder can directly construct the MPM list based on the prediction modes and weight matrix derivation modes of the adjacent blocks of the current block.
[0068] Optionally, in the present application, when constructing the MPM list of the current block, the decoder can construct the MPM list based on the prediction mode of the adjacent block of the current block, the preset angle prediction mode set, and the weighting matrix derivation mode. The preset angle prediction mode set can be a subset of all intra angle prediction modes. Taking AVS3 as an example, the preset angle prediction mode set can include only 28 intra angle prediction modes with mode numbers from 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 angle prediction mode set may be a combination of all intra angle prediction modes. When the ranges of the first intra prediction mode and the second intra prediction mode need to be restricted, the preset angle prediction mode set can be only a combination of some intra angle prediction modes. In this case, the preset angle prediction mode set can be used to restrict the ranges of the first intra prediction mode and the second intra prediction mode. Thereby, the overhead can be effectively reduced and the compression performance can be improved.
[0070] Optionally, in the present application, the decoder of the pre- When constructing the MPM list, based on the prediction mode of the adjacent block, the preset angle prediction mode set, and the weighting matrix derivation mode, the decoder can use the prediction mode of the adjacent block to identify the first candidate mode, use the weighting matrix derivation mode to identify the second candidate mode, and further construct the MPM list of the current block based on the first candidate mode, the second candidate mode, and the preset angle prediction mode set.
[0071] Specifically, in the present application, when the decoder uses the prediction mode of the adjacent block to identify the first candidate mode, if the adjacent block is a normal intra prediction block and the prediction mode of the adjacent block is an intra prediction mode, the decoder identifies the prediction mode of the adjacent block as the first candidate mode.
[0072] In the present application, a normal intra prediction block is a prediction block that uses a prediction mode such as a DC mode, a Planar mode, a Bilinear mode, or an angular prediction mode, and it can be understood that it is not a prediction block that uses a prediction mode such as an intra block copy (IBC) or an intra string copy prediction.
[0073] FIG. 8 is a schematic diagram showing adjacent blocks. As shown in FIG. 8, the current block is E, (x0, y0) are the coordinates of the sample at the upper left corner of block E in the image, (x1, y0) are the coordinates of the sample at the upper right corner of block E in the image, and (x0, y1) are the coordinates of the sample at the lower left corner of block E in the image. The adjacent block A of the current block E is the block where the sample (x0 - 1, y0) is located, the adjacent block B of the current block E is the block where the sample (x0, y0 - 1) is located, the adjacent block C of the current block E is the block where the sample (x1 + 1, y0 - 1) is located, the adjacent block D of the current block E is the block where the sample (x0 - 1, y0 - 1) is located, the adjacent block F of block E is the block where the sample (x0 - 1, y1) is located, and the adjacent block G of block E is the block where the sample (x1, y0 - 1) is located. The spatial positional relationship between the current block E and its adjacent blocks A, B, C, and D is as shown in FIG. 8.
[0074] In the present application, the decoder can use adjacent blocks that are further to the right and adjacent blocks that are further below the current block.
[0075] Specifically, in the present application, when the decoder uses a weight matrix derivation mode to identify a second candidate mode, first, a boundary line angle index is identified based on the weight matrix derivation mode, and then the boundary line angle index can be used to identify the second candidate mode.
[0076] In addition, in the embodiment of the present application, it can be specified that the second candidate mode includes L different intra-angle prediction modes, whereby the construction of the MPM list with a length of L can be ensured.
[0077] Furthermore, in the embodiment of the present application, when the weighting matrix includes two types of weight values, the positions where the weight values change form a straight line. Or, when the weighting matrix includes multiple types of weight values, the positions where the weight values are the same in the transition region form a straight line, and this straight line may be referred to as a boundary line. The angle in the right horizontal direction may be set to 0 degrees, and the angle may increase counterclockwise. In this case, the boundary line can have various angles such as a horizontal 0 degrees, a vertical 90 degrees, a 45 degrees, a 135 degrees inclination angle, etc. When a certain weight matrix is used for one prediction block, for example, there are textures with two different angles on both sides of the boundary line, or there is a textured side on one side of the boundary line and a flat texture on the other side of the boundary line. The corresponding textures are likely to exhibit different characteristics on both sides of the boundary line. Since the boundary line itself also has an angle, assuming that the boundary line is obtained by intra-angle prediction at one point and that the boundary line is 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 the present application, if it is assumed that the 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, the horizontal boundary line matches the horizontal intra-prediction mode (e.g., mode 24 in AVS3). The vertical boundary line matches the vertical intra-prediction mode (e.g., mode 12 in AVS3). The 45-degree boundary line may match the 45-degree intra-prediction mode from the lower left to the lower right (e.g., mode 30 in AVS3), or may match the 225-degree intra-prediction mode from the upper right to the lower left (e.g., mode 6 in AVS3). When there is only one weight value in one weight matrix, it can match modes with no obvious angle, such as the DC mode, Planar mode, Bilinear mode, etc. Thus, since the weight matrix derivation mode can match several intra-prediction modes, the weight matrix derivation mode can be utilized to assist in the decoding of the intra-prediction mode.
[0079] Note that in the present application, the weight matrix derivation mode may also be the index of the weight matrix. For example, it can be considered that the 56 modes of AWP are 56 weight matrix derivation modes.
[0080] Exemplarily, in the present application, in order to further represent the mapping relationship between the weighting matrix derivation mode and the intra angle prediction mode, one mapping relationship table may be constructed. Specifically, the boundary lines of multiple modes of AWP and GPM all have the same angle. For example, the AWP of AVS3 has the same angle for every eight modes. The 56 AWP modes have a total of eight boundary line angles. The boundary line angle index can be obtained by performing a modulo operation with 8 (%8) 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, the boundary line angle indices 0 and 1 can respectively correspond to two intra angle prediction modes (one is the prediction mode from the upper right to the lower left, and one is the prediction mode from the upper left to the lower right). Specifically, for other boundary line angle indices, other approximately corresponding intra angle prediction modes may be found, or all boundary line angle indices may correspond to only one type of intra angle prediction mode.
[0081]
Table 1
[0082] For one type of weighting matrix, not only is it highly likely that the intra angle prediction mode corresponding to its boundary line is used, but it is also highly likely that several intra angle prediction modes related to the boundary line are used. For example, corresponding intra angle prediction modes include angles close to the boundary line or angles perpendicular to the boundary line. The decoder can construct the MPM list of the IWCP mode by utilizing the correlation between the weighting matrix and the intra angle prediction mode. For example, when constructing the MPM list of the IWCP mode, if the list length of the MPM list is 4, candidate modes corresponding to the boundary line angle indices 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 line angle index is equal to the length of the MPM list, it can be ensured that the MPM list can be filled even when all the intra prediction modes of adjacent 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 line angle index can be set to 4.
[0085] Furthermore, in the present application, when constructing the MPM list, the decoder filters the first candidate mode based on the preset angle prediction mode set, obtains the filtered candidate modes based on the first candidate mode, the second candidate mode, and the preset angle prediction mode set, and constructs the MPM list based on the filtered candidate modes and the second candidate mode.
[0086] Specifically, in the present application, when the decoder filters the first candidate mode based on the preset angle prediction mode set and obtains the filtered candidate modes, if the first candidate mode belongs to the preset angle prediction mode set, the decoder specifies 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 angle prediction mode set, the decoder specifies an alternative mode of the first candidate mode from the preset angle prediction mode set and specifies the alternative mode as the filtered candidate mode.
[0087] Furthermore, in the present application, if the first candidate mode is not an intra angle prediction mode, the decoder can directly delete the first candidate mode.
[0088] In the present application, since the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes and does not include the intra non-angle prediction mode, it is necessary to adjust the selection of the MPM of the current block for the IWCP mode, that is, the method of constructing the MPM list. Specifically, when constructing the MPM list, the decoder needs to refer to the intra prediction modes of the adjacent blocks around the current block. Examples of the adjacent blocks around include the left adjacent block, the upper adjacent block, the upper left adjacent block, the upper right adjacent block, and the lower left adjacent block. Due to spatial correlation, if a certain prediction mode is used for an adjacent block around, the same or a similar prediction mode is likely to be used for the current block.
[0089] Optionally, both the first intra prediction mode and the second intra prediction mode of the IWCP mode can only be intra angle prediction modes. Therefore, the intra prediction mode used for a certain adjacent block for reference is an intra non-angle prediction mode. That is, when the first candidate mode is not an intra angle prediction mode, the decoder does not use the intra non-angle prediction mode used for the reference block when constructing the MPM list of the current block, that is, does not add the intra non-angle prediction mode to the MPM list of the current block.
[0090] Optionally, the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes. Therefore, if the intra prediction mode used for a certain adjacent block for reference is an intra angle prediction mode not included in the preset angle prediction mode set, that is, when the first candidate mode is an intra angle prediction mode and does not belong to the preset angle prediction mode set, when the decoder constructs the MPM list of the current block, the intra angle prediction mode not included in the preset angle prediction mode set is converted into an intra angle prediction mode with a similar angle within the preset angle prediction mode set, and then added to the MPM list. Taking AVS3 as an example, according to the preset angle prediction mode set, the first intra prediction mode and the second intra prediction mode are limited to intra angle prediction modes with mode numbers from 4 to 31. Also, when the intra angle prediction mode with mode number 43 is used for the adjacent block of the current block, the decoder can add the intra angle prediction with mode number 12, which is similar to the intra angle prediction with mode number 43, to the MPM list of the current block in the IWCP mode.
[0091] Also, in the embodiments of the present application, when constructing the MPM list based on the filtered candidate mode and the second candidate mode, if the filtered candidate mode meets the preset additional conditions, the decoder adds the filtered candidate mode to the MPM list. If the MPM list does not meet the preset list length L and the second candidate mode meets the preset additional conditions, the decoder adds the second candidate mode to the MPM list. L is an integer greater than or equal to 1.
[0092] Exemplarily, in the present application, the value of L can be 4, that is, the preset list length of the MPM list is 4, or the MPM list contains 4 MPMs.
[0093] In the embodiments of the present application, the decoder can rearrange the L modes in the MPM list in ascending order of the mode number.
[0094] In the embodiments of the present application, when the filtered candidate mode is different from all the prediction modes in the MPM list, the decoder can determine that the filtered candidate mode satisfies a preset additional condition. Accordingly, when the second candidate mode is different from all the prediction modes in the MPM list, the decoder can determine that the second candidate mode satisfies a preset additional condition.
[0095] In the embodiments of the present application, when the decoder adds the filtered candidate mode corresponding to the adjacent block to the MPM list, it can identify the order parameter corresponding to the adjacent block, and based on the order parameter, add the filtered intra candidate mode corresponding to the adjacent block to the MPM list in sequence. The decoder can identify the corresponding order parameter according to the spatial distance between the adjacent block and the current block. For example, the closer the spatial distance between the adjacent block and the current block, the stronger the correlation between the adjacent block and the current block, the earlier the additional process is performed, and the smaller the order parameter. The farther the spatial distance between the adjacent block and the current block, the weaker the correlation between the two, the later the additional process is performed, and the larger the order parameter.
[0096] Furthermore, in the embodiments of the present application, after the decoder adds the filtered candidate mode and / or the second candidate mode to the MPM list, it can further rearrange the L prediction modes in the MPM list in ascending order of the mode number.
[0097] Exemplarily, in the present application, the MPM list of the current block in the IWCP mode is IwcpMpm[4], that is, the list length of the MPM list is 4, the index of the weighted matrix derivation mode is IwcpIndex, the weighted matrix derivation mode reuses 56 derivation modes of AWP, and assuming that the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong includes the intra angle prediction modes with mode numbers from 4 to 31, the decoder can sequentially execute the following steps when constructing the MPM list of the current block.
[0098] Step S1: Provide an array cand_mode
[10] and initialize all values of cand_mode to invalid values. Execute the following operations on cand_mode. (a) If the adjacent block F "exists" and is a normal intra prediction block, cand_mode[0] is equal to the intra prediction mode of F. (b) If the adjacent block G "exists" and is a normal intra prediction block, cand_mode[1] is equal to the intra prediction mode of G. (c) If the adjacent block C "exists" and is a normal intra prediction block, cand_mode[2] is equal to the intra prediction mode of C. (d) If the adjacent block A "exists" and is a normal intra prediction block, cand_mode[3] is equal to the intra prediction mode of A. (e) If the adjacent block B "exists" and is a normal intra prediction block, cand_mode[4] is equal to the intra prediction mode of B. (f) If the adjacent block D "exists" and is a normal intra prediction 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 the 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] The fact that an adjacent block X (where X is A, B, C, D, F, or G) "exists" means that the block should be within the image and should belong to the same slice as block E. Otherwise, the adjacent block "does not exist". If a block "does not exist" or has not yet been decoded, the block is "unusable". Otherwise, the block is "usable". If the block where the sample of the image is located "does not exist" or the sample has not yet been decoded, the sample is "unusable". Otherwise, the sample is "usable".
[0100] In the present application, the execution procedures from (a) to (f) above are the specific process of the first candidate mode, and the execution procedures from (g) to (j) above are the specific process of the second candidate mode. The decoder can specify the second candidate mode with reference to Table 2 above.
[0101] Step S2: For i from 0 to 5, execute the following operations. (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, when the first candidate mode is an intra non-angle prediction mode, the decoder can directly delete the first candidate mode, that is, it is not necessary to use the first candidate mode. (b) Otherwise, if cand_mode[i] is equal to 3, make cand_mode[i] equal to 4. (c) Otherwise, if cand_mode[i] is equal to 32, make cand_mode[i] equal to 31. (d) Otherwise, if cand_mode[i] is greater than 33, execute the following operation. If cand_mode[i] is less than 44, set cand_mode[i] equal to cand_mode[i] - 30. Otherwise, if cand_mode[i] is less than 58, set cand_mode[i] equal to cand_mode[i] - 33. Otherwise, set cand_mode[i] equal to cand_mode[i] - 34. That is, when the first candidate mode is the 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 the alternative mode of 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, when the first candidate mode belongs to the preset angle prediction mode set, the decoder can directly use the first candidate mode, that is, the first candidate mode is the filtered candidate mode.
[0102] In the present application, step S2 is the filtering process of the first candidate mode, and the finally determined filtered candidate mode corresponding to the first candidate mode is obtained.
[0103] Step S3: Set mpm_num to 0, and for i from 0 to 9, perform the following operations. (a) If cand_mode[i] is not an invalid value, perform the following operations. Compare cand_mode[i] with IwcpMpm[j], where j is from 0 to mpm_num - 1. If cand_mode[i] is not equal to any of 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, end step 3.
[0104] That is, on the premise that the number of prediction modes in the MPM list is less than 4, 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. After adding all the filtered candidate modes that meet the preset addition conditions to the MPM list, if the number of prediction modes in the MPM list is still less than 4, the decoder can continue to add the second candidate mode that meets the preset addition conditions to the MPM list until the list length of the MPM list becomes 4.
[0105] Step S4: Sort the four values of IwcpMpm[4] in ascending order.
[0106] Finally, the decoder can sort the four intra-angle prediction modes in the MPM list in ascending order of the mode numbers.
[0107] In this application, the execution order of step 102 and step 103 is not limited, that is, the order of the specific process of the first mode index and the second mode index and the construction process of the MPM list is not limited.
[0108] Step 104: Based on the first mode index, the second mode index, and the MPM list, determine the first intra prediction mode and the 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 from each other.
[0109] In the embodiment of this application, after the decoder determines 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 determine 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 addition, in the embodiments of the present application, the first intra prediction mode and the second intra prediction mode can be different intra angle prediction modes from each other. Specifically, in the embodiments of the present application, the first intra prediction mode and the second intra prediction mode can be different intra angle prediction modes in a preset angle prediction mode set.
[0111] That is, in the present application, both the first intra prediction mode and the second intra prediction mode are intra angle prediction modes only. That is, neither the first intra prediction mode nor the second intra prediction mode is another basic intra prediction mode other than the intra angle prediction mode (for example, an intra non-angle prediction mode including a DC mode, a Planar mode, a PLANE mode, a Bilinear mode, a PCM mode, etc.). The basic intra prediction modes include, but are not limited to, an angle prediction mode and a non-angle prediction mode. For example, 67 intra prediction modes used in VVC and 66 intra prediction modes used in AVS3 can be mentioned.
[0112] In addition, in the present application, by restricting the first intra prediction mode and the second intra prediction mode to the intra angle prediction mode, on the one hand, when implementing the IWCP mode in parallel, only one set of circuits that support intra angle weighted prediction needs to be added to the hardware, so the hardware implementation complexity of the IWCP mode can be reduced. On the other hand, although the intra weighted combination prediction mode itself is applied to a block with relatively complex content, the intra non-angle prediction mode is usually used to handle a scene with relatively uniform texture changes, and the overhead can be reduced by using fewer modes. Therefore, whether to use the intra non-angle prediction mode for the IWCP mode has little effect on the compression performance.
[0113] Also, in this application, the more available intra prediction modes there are, the higher the accuracy of the predicted value that can be generated. Accordingly, however, the overhead for transmitting the flags of the selected modes in the bitstream increases. Therefore, in order to obtain better compression performance, a reasonable set of available intra prediction modes can be selected to achieve a better balance between the prediction effect and the overhead. Specifically, the decoder can use a preset angle prediction mode set to limit the available intra angle prediction modes of the first intra prediction mode and the second intra prediction mode. The preset angle prediction mode set is a subset of all the intra angle prediction modes. Taking AVS3 as an example, there are 62 angle modes in AVS3, that is, intra angle prediction modes with mode numbers from 3 to 32 and from 34 to 65.
[0114] Exemplarily, in this application, the first intra prediction mode and the second intra prediction mode may use only the intra angle prediction modes with mode numbers from 3 to 32, or may use only 28 intra angle prediction modes with mode numbers from 4 to 31.
[0115] Exemplarily, in this application, taking VVC as an example, the first intra prediction mode and the second intra prediction mode may use only the intra angle prediction modes with even mode numbers, or may use only the intra angle prediction modes with odd mode numbers.
[0116] Exemplarily, in the present 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 limit the first intra prediction mode and the second intra prediction mode by using the same preset angular prediction mode set. That is, if the first intra prediction mode can only use 28 intra angular prediction modes with mode numbers from 4 to 31, and the second intra prediction mode can also only use 28 intra angular prediction modes with mode numbers from 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 / decoding methods. That is, when the decoder limits the first intra prediction mode and the second intra prediction mode by using different preset angular prediction mode sets, different MPM lists or significantly different encoding / decoding methods need to be used for the first intra prediction mode and the second intra prediction mode.
[0117] Also, in an embodiment of the present application, the decoder can identify a first mapping relationship table between the index value and the binary string. 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.
[0118] Exemplarily, in the present application, the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
[0119] Note that in the present application, the first mapping relationship table between the index value and the binary string can be used to identify the values of the first mode index and the second mode index.
[0120] Optionally, in this application, in AVS3, 28 intra - angle prediction modes with mode numbers from 4 to 31 are used. That is, when a total of 28 modes are included in the preset angle prediction mode set, the modes can be encoded in the form of 4 + 8 + 16. That is, they can be encoded with the 4 modes with the shortest codewords, the 8 modes with shorter codewords, and the 16 modes with longer codewords. The 4 modes with the shortest codewords use 3 - bit codewords, that is, the first length is used. The 8 modes with shorter codewords use 5 - bit codewords, that is, the second length is used. The 16 modes with longer codewords use 6 - bit codewords, that is, the third length is used.
[0121] Note that in this application, the predicted angles of the 28 intra - angle prediction modes with mode numbers from 4 to 31 basically cover the entire common angle range. At the same time, the intra - angle prediction modes with mode numbers from 4 to 31 are simpler than the intra - angle prediction modes with mode numbers from 34 to 65. Encoding these 28 modes in the form of 4 + 8 + 16 does not waste codewords. Therefore, it is preferable for the decoder to define the preset angle prediction mode set based on the 28 intra - angle prediction modes with mode numbers from 4 to 31.
[0122] Also, in the embodiments of this application, when the list length of the MPM list of the current block is 4, the binary string with the first length can be used for the 4 MPMs in the MPM list. That is, the 4 modes with the shortest codewords can be used for the 4 MPMs in the MPM list. Accordingly, the binary string with the second length and the binary string with the third length can be used for other prediction modes not included in the MPM list in the preset angle prediction mode set.
[0123] Optionally, in this application, for the other 24 intra-angle prediction modes other than the 4 MPMs in the MPM list in the preset angle prediction mode set, the decoder can evenly distribute the modes with short codewords and the modes with long codewords. Specifically, the decoder can evenly distribute 8 modes with short codewords (binary strings with the second length) among the remaining 24 intra-angle prediction modes. For example, for every 2 modes with long codewords (binary strings with the third length), 1 mode with a short codeword (binary string with the second length) is used. In a more specific execution process, among the remaining 24 intra-angle prediction modes, for the serial numbers from 0 to 23, it is realized by performing a modulo operation with 3 (%3). For example, a mode with a serial number modulo 3 remainder of 2 uses a 5-bit codeword, that is, a binary string with the second length. A mode with a serial number modulo 3 remainder of 0 or 1 uses a 6-bit codeword, that is, a binary string with the third length.
[0124] Exemplarily, in this application, when 28 intra-angle prediction modes with mode numbers from 4 to 31 are used, that is, when the preset angle prediction mode set includes 28 modes, the first mapping relationship table between the index value and the binary string is as shown in Table 3. 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 it is an MPM. For example, "1" indicates it is an MPM, and "0" indicates it is not an MPM. If the first intra prediction mode is an MPM, assuming there are 4 MPMs in the MPM list, 2 bits can be used to indicate which MPM in the MPM list is used. For example, "00, 01, 10, 11" represent the first MPM, the second MPM, the third MPM, and the fourth MPM in the MPM list respectively.
[0127] Furthermore, in this application, a binary string with a bit flag of 0 is decoded using a context model, and a binary string with a bit flag not equal to 0 is decoded without using a context model. The value of the bit flag can represent how many bits have been decoded, and the bit flag can be represented by binIdx.
[0128] Note that in this application, on the decoding side, when performing inverse binary conversion based on Table 3, a binary string with binIdx equal to 0 is 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] Also, 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, first, the value i (i is an integer greater than or equal to 0) of the first mode index can be determined based on the first mapping relationship table between the index value and the binary string. When i is greater than or equal to 0 and less than L, the angular prediction mode in the MPM list is determined as the first intra prediction mode. When i is greater than or equal to L, the preset angular prediction mode set and the MPM list are used to determine the first intra prediction mode. , with index i The angular prediction mode is determined as the first intra prediction mode. When i is greater than or equal to L, the preset angular prediction mode set and the MPM list are used to determine the first intra prediction mode.
[0130] Specifically, in the present application, when the decoder uses the preset angle prediction mode set and the MPM list to identify the first intra prediction mode, if i is greater than or equal to the mode number of the first mode in the MPM list, the decoder adds i and 1. If (i + 1) is greater than or equal to the mode number of the second mode in the MPM list, the decoder adds (i + 1) and 1. If (i + 2) is greater than or equal to the mode number of the third mode in the MPM list, the decoder adds (i + 2) and 1. If (i + 3) is greater than or equal to the mode number of the fourth mode in the MPM list, the decoder adds (i + 3) and 1. 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 angle prediction mode set.
[0131] Accordingly, in the present application, when the decoder uses the preset angle prediction mode set and the MPM list to identify the first intra prediction mode, if i is less than the mode number of the first mode in the MPM list, the decoder identifies i as the mode number of the first intra prediction mode and identifies the first intra prediction mode from the preset angle prediction mode set. Or, if (i + 1) is less than the mode number of the second mode in the MPM list, the decoder identifies (i + 1) as the mode number of the first intra prediction mode and identifies the first intra prediction mode from the preset angle prediction mode set. Or, if (i + 2) is less than the mode number of the third mode in the MPM list, the decoder identifies (i + 2) as the mode number of the first intra prediction mode and identifies the first intra prediction mode from the preset angle prediction mode set. Or, 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 angle prediction mode set.
[0132] Exemplarily, in the present application, the mode numbers of the four MPMs in the MPM list are 4, 8, 12, and 16 respectively, and when the value i of the first mode index specified based on the first mapping relationship table between the index values and the binary strings shown in Table 3 above is 5, in the preset angle prediction mode set including 28 intra-angle prediction modes with mode numbers from 4 to 31, i and the mode numbers of the four MPMs in the MPM list are compared in order. Specifically, since 5 is greater than the mode number of the first mode in the MPM list, the decoder can add i and 1, that is, i + 1 = 6. Next, the decoder compares 6 with the mode number of the second mode in the MPM list. Since 6 is smaller than 8, the decoder specifies the value 6 of (i + 1) as the mode number of the first intra-prediction mode, and can specify the intra-prediction mode with the mode number 6 in the preset angle prediction mode set as the first intra-prediction mode.
[0133] Exemplarily, in the present application, the mode numbers of the four MPMs in the MPM list are 4, 8, 12, and 16 respectively, and when the value i of the first mode index specified based on the first mapping relationship table between the index values and the binary strings shown in Table 3 above is 10, in the preset angle prediction mode set including 28 intra angle prediction modes with mode numbers from 4 to 31, i and the mode numbers of the four MPMs in the MPM list are compared in order. Specifically, since 10 is greater than the mode number of the first mode in the MPM list, the decoder can add i and 1, that is, i + 1 = 11. Next, the decoder compares 11 with the mode number of the second mode in the MPM list. Since 11 is greater than 8, the decoder can add (i + 1) and 1, that is, (i + 1) + 1 = 12. Next, the decoder compares 12 with the mode number of the third mode in the MPM list. Since 12 is equal to 12, the decoder can add (i + 2) and 1, that is, (i + 2) + 1 = 13. Next, the decoder compares 13 with the mode number of the fourth mode in the MPM list. Since 13 is less than 16, the decoder specifies the value 13 of (i + 3) as the mode number of the first intra prediction mode, and can specify the intra prediction mode with the mode number 13 in the preset angle prediction mode set as the first intra prediction mode.
[0134] Also, in the present application, when the decoder specifies 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, first, the value j (j is an integer greater than or equal to 0) of the second mode index can be specified based on the first mapping relationship table. When j is greater than or equal to 0 and less than L, the ([ j +1)th angle prediction mode in the MPM list is specified as the Two intra prediction mode. When j is greater than or equal to L, the preset angle prediction mode set and the MPM list are used to specify the Two intra prediction mode.
[0135] Specifically, in the present application, when the decoder uses the preset angle prediction mode set and the MPM list to identify the second intra prediction mode, if j is greater than or equal to the mode number of the first mode in the MPM list, the decoder adds j and 1. If (j + 1) is greater than or equal to the mode number of the second mode in the MPM list, the decoder adds (j + 1) and 1. If (j + 2) is greater than or equal to the mode number of the third mode in the MPM list, the decoder adds (j + 2) and 1. If (j + 3) is greater than or equal to the mode number of the fourth mode in the MPM list, the decoder adds (j + 3) and 1. The decoder specifies (j + 4) as the mode number of the second intra prediction mode and identifies the second intra prediction mode from the preset angle prediction mode set.
[0136] Accordingly, in the present application, when the decoder uses the preset angle prediction mode set and the MPM list to identify the second intra prediction mode, if j is less than the mode number of the first mode in the MPM list, the decoder specifies j as the mode number of the second intra prediction mode and identifies the second intra prediction mode from the preset angle prediction mode set. If (j + 1) is less than the mode number of the second mode in the MPM list, the decoder specifies (j + 1) as the mode number of the second intra prediction mode and identifies the second intra prediction mode from the preset angle prediction mode set. Or, if (j + 2) is less than the mode number of the third mode in the MPM list, the decoder specifies (j + 2) as the mode number of the second intra prediction mode and identifies the second intra prediction mode from the preset angle prediction mode set. Or, if (j + 3) is less than the mode number of the fourth mode in the MPM list, the decoder specifies (j + 3) as the mode number of the second intra prediction mode and identifies the second intra prediction mode from the preset angle prediction mode set.
[0137] Exemplarily, in the present application, when the IWCP mode is currently used for a block, the length of the MPM list of the current block is 4, that is, L = 4, and when the preset angle prediction mode set includes 28 intra angle prediction modes with mode numbers from 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 bit stream. Further, based on the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index, the first intra prediction mode can be derived as IwcpPredMode0, and the second intra prediction mode can be derived as IwcpPredMode1.
[0138] When the decoder uses the first mode index iwcp_pred_mode0_index to identify the first intra prediction mode IwcpPredMode0, specifically, the following operations can be performed.
[0139] 1. Based on Table 3, by inverse binary conversion of the binary string, the value of iwcp_pred_mode0_index is identified as i.
[0140] Specifically, after identifying the iwcp_pred_mode0_index in the form of a binary string by decoding, based on Table 3, the binary string can be identified by inverse binary conversion, 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 the 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] When i is 4 or more, 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 the present application, when the first intra prediction mode IwcpPredMode0 does not belong to the MPM list and is one of the other 24 intra angle prediction modes other than MPM in the preset angle prediction mode set, the decoder compares the value i of the first mode index iwcp_pred_mode0_index with the mode numbers of each angle 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 angle prediction mode set according to the mode number.
[0144] When the decoder identifies the second intra prediction mode IwcpPredMode1 by using the second mode index iwcp_pred_mode1_index, specifically, the following operations can be performed.
[0145] 1. Based on Table 3, by inverse binarizing the binary string, the value of iwcp_pred_mode1_index is identified as j.
[0146] Specifically, after identifying iwcp_pred_mode1_index in the form of a binary string by decoding, based on Table 3, the binary string can be identified by inverse binarization, 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] When 2.j is greater than or equal to 0 and less than 4, IwcpPredMode1 is equal to IwcpMpm[i].
[0148] When 3.j is greater than or equal to 4, 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] Also, in the embodiment of the present application, in the IWCP mode, it is necessary to specify the prediction value of the current block by using the first intra prediction mode and the second intra prediction mode. 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, the first intra prediction mode can be referred to when encoding / decoding the second intra prediction mode. Specifically, when specifying the second intra prediction mode, the first intra prediction mode can be excluded.
[0150] In this application, for the 28 intra angle prediction modes, in the above 4+8+16 encoding / decoding method, the probability that 4 MPMs in the MPM list appear is high (the probability that the first intra prediction mode is one of the 4 MPMs in the MPM list is about 50%, and the probability that the second intra prediction mode is one of the 4 MPMs in the MPM list is about 50%). When both the first intra prediction mode and the second intra prediction mode are MPMs in the MPM list, when specifying the second intra prediction mode, only one can be selected from the other 3 MPMs in the MPM list other than the first intra prediction mode. Thus, originally, one was selected from 4, and 4 three-bit codewords were required, but now one is selected from 3, and one two-bit codeword and 2 three-bit codewords are required. Accordingly, when neither the first intra prediction mode nor the second intra prediction mode is an MPM in the MPM list, for the second intra prediction mode, one can be removed from the 24 intra angle prediction modes of 8+16, but such an impact is relatively small.
[0151] As can be seen from the above, when both the first intra prediction mode and the second intra prediction mode are MPMs in the MPM list, when specifying the second intra prediction mode, the first intra prediction mode can be deleted first, thereby reducing the overhead.
[0152] Furthermore, in the embodiments of the present application, when the first intra prediction mode is one of the MPMs 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, after specifying the (i + 1)-th angular prediction mode in the MPM list as the first intra prediction mode, when specifying the second intra prediction mode, the decoder can specify the value j of the second mode index based on the second mapping relationship table between the index value and the binary string. If j is greater than or equal to i, add j and 1. After adding 1, if j is greater than or equal to 0 and less than L, specify 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, use the preset angular prediction mode set and the MPM list to specify the second intra prediction mode.
[0153] Also, in the embodiments of the present application, the decoder can specify the second mapping relationship table between the index value and the binary string. The second mapping relationship table includes a binary string having a first length, a binary string having a second length, a binary string having a third length, and a binary string having a fourth length, respectively.
[0154] Exemplarily, in the present 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] Note that in the present application, the second mapping relationship table between the index value and the binary string is only used to specify the value of the second mode index.
[0156] Optionally, in the present application, the second mapping relationship table between the index value and the binary string is as shown in Table 4, 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 angle prediction mode set includes 28 intra-angle prediction modes with mode numbers from 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 bit stream. Further, based on the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index, the first intra-prediction mode can be derived as IwcpPredMode0 and the second intra-prediction mode can be derived as IwcpPredMode1.
[0159] In this application, on the decoding side, when inverse binarizing based on Table 4, the binary string with binIdx equal to 0 can be decoded using the context model, and the binary string with binIdx not equal to 0 can be decoded using the equiprobability model or the bypass mode.
[0160] When the decoder uses the first mode index iwcp_pred_mode0_index to identify the first intra-prediction mode IwcpPredMode0, specifically, the following operations can be performed. 1. Based on Table 3, by inverse binarizing the binary string, the value of iwcp_pred_mode0_index is identified as i. 2. If i is greater than or equal to 0 and less than 4, IwcpPredMode0 is equal to IwcpMpm[i]. When 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] When the decoder uses the second mode index iwcp_pred_mode1_index to identify the second intra prediction mode IwcpPredMode1, specifically, the following operations can be performed. 1. When i is 0 or greater and less than 4, perform the following operations. (a) Based on Table 4, by inverse binarizing the binary string, identify the value of iwcp_pred_mode1_index as j. (b) If iwcp_pred_mode1_index is greater than or equal to iwcp_pred_mode0_index, that is, if j is greater than or equal to i, then iwcp_pred_mode1_index becomes equal to iwcp_pred_mode1_index + 1, that is, add j and 1, that is, j = j + 1, and then execute step 3. 2. When i is 4 or greater, based on Table 3, by inverse binarizing the binary string, identify the value of iwcp_pred_mode1_index as j, and then execute step 3. 3. When j is 0 or greater and less than 4, IwcpPredMode1 is equal to IwcpMpm[i]. When j of 4 is 4 or more, IwcpPredMode1 becomes 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, when the identification of the second intra prediction mode needs to be performed 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, when both the first intra prediction mode and the second intra prediction mode are MPMs in the MPM list, there are only three available MPMs for the second intra prediction mode. Furthermore, the MPM can be represented by one or two bits. For example, "00, 01, 10" represent the remaining first MPM, second MPM, and third MPM, respectively. In this way, since one possibility is excluded, the overhead can be reduced by changing the encoding / decoding method or changing the binarization or inverse binarization method.
[0163] In the embodiment of the present application, when the preset angle prediction mode set includes 28 intra angle prediction modes with mode numbers from 4 to 31 and the length of the MPM list is 4, when specifying the first mapping relationship table between the index value and the binary string using the binary string with the first length, the binary string with the second length, and the binary string with the third length, first, the binary string with the first length, that is, the shortest codeword can be used for the four MPMs in the MPM list. Next, the binary string with the second length is used for eight intra angle prediction modes selected from the remaining 24 intra angle prediction modes, and the binary string with the third length is used for the selected 16 intra angle prediction modes.
[0164] Specifically, in the present application, for the remaining 24 intra-angle prediction modes, according to the ascending order of the mode numbers, a short codeword, i.e., a binary string having the second length, is used for the prediction modes corresponding to the previous 8 mode numbers. Next, a long codeword, i.e., a binary string having the third length, can be used for the prediction modes corresponding to the subsequent 16 mode numbers.
[0165] Exemplarily, in the present application, the first mapping relationship table between the index values and the binary strings shown in Table 3 above can be replaced with Table 5 below. Table 5 for representing the first mapping relationship table between the index values and the binary strings can also be used to identify the values of the first mode index and the second mode index.
[0166]
Table 5
[0167] Accordingly, the second mapping relationship table between the index values and the binary strings shown in Table 4 above can be replaced with Table 6 below. Table 6 for representing the second mapping relationship table between the index values and the binary strings can also be used to identify the value of the second mode index.
[0168]
Table 6
[0169] Note that in the present application, 28 intra-angle prediction modes with mode numbers from 4 to 31 are used, that is, when 28 modes are included in the preset angle prediction mode set, in the form of 4 + 8 + 16, that is, 4 modes with 3-bit codewords, 8 modes with 5-bit codewords, and 16 modes with 6-bit codewords can be used for encoding.
[0170] Optionally, in this application, when a total of 20 modes are included in the preset angle prediction mode set, these modes can be represented by 4 three-bit codewords and 16 five-bit codewords.
[0171] Optionally, in this application, when a total of 36 modes are included in the preset angle prediction mode set, these modes can be represented by 4 three-bit codewords and 32 six-bit codewords. For example, in AVS3, 36 intra angle prediction modes with mode numbers 4 to 31, 42 to 45, and 56 to 59 are used.
[0172] Note that in this application, when all modes in the preset angle prediction mode set are represented by a set of binary character strings as shown in Table 3 or Table 4, the "codeword" can be understood as a binary character string. The length of the codeword can be understood as the length of the binary character string. Another expression method is the sum of the flag and the binary character string. For example, one binary MPM_flag is used to indicate whether the current mode is the MPM mode. That is, when MPM_flag is 1, it indicates that the current mode is the MPM mode, and when MPM_flag is 0, it indicates that the current mode is not the MPM mode. When the current mode is the MPM mode, MPM has a total of 4 possibilities, and a 2-bit binary character string is used to indicate which MPM the current mode is. In this case, the codeword can be understood as the sum of the flag and the binary character string, and the length of the codeword can be understood as the total length of the flag and the binary character string.
[0173] Step 105: Identify the weighting matrix of the current block, and based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, identify the predicted value of the current block.
[0174] In an embodiment of the present application, after identifying the first intra prediction mode and the second intra prediction mode used for the current block, further, based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, the decoder needs to identify the weighting matrix of the current block so as to identify the predicted value of the current block.
[0175] Specifically, in the present 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 the decoder identifies the predicted value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, first, it identifies the first predicted value of the current block based on the first intra prediction mode, and identifies the second predicted value of the current block based on the second intra prediction mode. Next, by performing a weighting operation on the first predicted value and the second predicted value using the weighting matrix, the predicted value of the current block can be obtained.
[0177] Note that in the present application, both the first intra prediction mode and the second intra prediction mode can be intra angle prediction modes. That is, in the embodiment of the present application, two different intra angle prediction modes are used. Then, using the first intra prediction mode and the second intra prediction mode, a first predicted block and a second predicted block are respectively generated, and further, based on the first predicted block, the second predicted block, and the weighting matrix, the predicted block of the current block is identified.
[0178] Also, in the embodiment of the present application, it is not the case that the weight values of all points in each weighting matrix in all possible weighting matrices are the same. In other words, at least one possible weighting matrix includes at least two different weight values.
[0179] In the embodiments of the present application, the decoder can identify the weight matrix in a manner similar to GPM or AWP. Specifically, when GPM or AWP is used in the same video encoding / decoding standard or encoder / decoder, the weight matrix can be identified by this method, so that some of the same logic can be reused. For example, when AWP is used for inter prediction in AVS3, the AWP method can be utilized in AVS3 to identify the weight matrix. It is of course also possible to use a method different from GPM or AWP in the same video encoding / decoding standard or encoder / decoder, such as using a different number of modes, or an algorithm with a different transition region, or different parameters. Since inter prediction utilizes temporal correlation, the reconstructed image in the reference image is used as the reference block. Since intra prediction utilizes spatial correlation, the reconstructed samples around the current block are used as the 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 certain weight matrix causes the sample position of the predicted block to be far from the reference sample, such a weight matrix may not be able to generate a more appropriate predicted value than the prior art, so such a weight matrix cannot be utilized. Instead, such a weight matrix can be used for inter prediction.
[0180] In the embodiments of the present application, an intra prediction method is provided. The encoder / decoder can identify two different predicted blocks of the current block in two different intra angle prediction modes, and then finally obtain a more complex predicted block by combining the two different predicted blocks with various weight matrices. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
[0181] Based on the above embodiments, in yet another embodiment of the present application, the following prediction sample matrix is the above-mentioned prediction block, that is, it can be understood that "block" is "sample matrix", and the arrays mentioned in the specification mean matrices. Taking the case where IWCP is used for predicting the luminance component as an example, the present invention is not limited to the luminance component, and can also be used for the chroma component and any component in any other format. As an example, when the intra prediction method proposed in the present application is applied to AVS3, the specific process in which the decoder uses the IWCP mode to determine the predicted value of the current block can be described as follows.
[0182] In addition, in one specific decoding example, 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 that of the weighting matrix of AWP.
[0183] For example, a flag at the sequence level is used to determine whether the IWCP mode is used for the current sequence waiting for decoding. For example, the definition of the sequence header is shown in Table 7.
[0184]
Table 7
[0185] The usage flag iwcp_enable_flag of the IWCP mode is a binary variable. The value of iwcp_enable_flag being "1" indicates that the IWCP mode is available, and the value of iwcp_enable_flag being "0" indicates that the IWCP mode is not available. The value of IwcpEnableFlag is equal to iwcp_enable_flag. When iwcp_enable_flag does not exist in the bitstream, the value of IwcpEnableFlag is 0.
[0186] Optionally, a frame-level flag can be used to identify whether the IWCP mode is used for the current frame waiting for decoding. For example, the IWCP mode can be configured to be used for intra-frames (e.g., I-frames) and not used for inter-frames (e.g., B-frames, P-frames). Or, the IWCP mode can be configured not to be used for intra-frames and to be used for inter-frames. Or, the IWCP mode can be configured to be used for some inter-frames and not used for some inter-frames.
[0187] Optionally, flags at levels below frame level and above 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] Exemplarily, when decoding the current CU, if the current CU meets the usage conditions of IWCP, 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 usage conditions of IWCP are that the current CU is an intra-coded CU (hereinafter, IntraCuFlag is 1), IWCP can be used for the current sequence (hereinafter, IwcpEnableFlag is 1), and the size of the current block meets the limit (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 one 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] Exemplarily, in the encoding of the YUV4:2:0 format, an 8×8 luminance block corresponds to a 4×4 chrominance block at the same position. As one possible method, the IWCP mode can be used for the 8×8 luminance block, but it is prohibited from being used for the 4×4 chrominance block. This is because in a 4×4 block, the improvement in the prediction effect by the IWCP mode is not significant, and also because the cost of hardware implementation increases.
[0190] Exemplarily, when IWCP is currently used for the current CU (Coding Unit), other modes such as the 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 regarding these modes. This is because even if IWCP is combined with these modes, the prediction effect cannot be significantly improved. Conversely, if it is the default not to use DT, IPF, and IIP when IWCP is used for the current CU, there is no need to transmit flags (e.g., dt_split_flag, intra_pf_flag, iip_flag) indicating whether to use these modes in the bitstream, which can save codewords and is beneficial for compression efficiency.
[0191] One example is shown in Table 8.
[0192] [Table 8]
[0193] The IWCP flag iwcp_flag is a binary variable. The value of iwcp_flag being "1" indicates that the IWCP mode should be used, and the value of iwcp_flag being "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 does not exist in the bitstream, the value of IwcpFlag is 0.
[0194] The DT mode split flag dt_split_flag is a binary variable. The value of dt_split_flag being "1" indicates that DT mode splitting should be performed, and the value of dt_split_flag being "0" 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 range is 0 to 4. If dt_split_flag does not exist 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. The value of intra_pf_flag being "1" indicates that IPF should be used for the current coding unit, and the value of intra_pf_flag being "0" indicates that 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 does not exist in the bitstream, the value of IntraPfFlag is 0. After the initial prediction value is generated, IPF can be used to generate a new prediction value by filtering the initial prediction value using reference samples.
[0196] The IIP flag iip_flag is a binary variable. A value of "1" for iip_flag indicates that IIP should be used for the current coding unit, and a value of "0" for iip_flag indicates that 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 does not exist in the bitstream, the value of IipFlag is 0. IIP can be used to generate a prediction value by using a filter different from that when IIP is not used. As an example, for a certain angular prediction, in IIP, an 8-tap filter is used to generate a prediction value. When IIP is not used, a 4-tap filter is used to generate a prediction value.
[0197] Exemplarily, when IWCP is used for the current CU, as shown in Table 9 below, it is necessary to decode the bitstream and identify the weight matrix derivation mode iwcp_idx, the first mode index iwcp_pred_mode0_index of the two intra prediction modes, and the second mode index iwcp_pred_model_index. The weight matrix derivation mode reuses the weight matrix derivation mode of AWP.
[0198] [Table 9]
[0199] The index iwcp_idx of the IWCP mode is used to identify the weight 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 specify the second intra prediction mode IwcpPredMode1 of the luminance block in the IWCP mode.
[0202] Furthermore, after specifying the first intra prediction mode and the second intra prediction mode, based on the method of step 105 in the above embodiment, the first intra luminance prediction sample matrix predMatrixY0 can be specified based on IwcpPredMode0, and the second intra luminance prediction sample matrix predMatrixY1 can be specified based on IwcpPredMode1. After specifying the luminance weighting matrix IwcpWeightMatrixY based on IwcpIndex, by using the luminance weighting matrix IwcpWeightMatrixY to perform a weighting operation on the first intra luminance prediction sample matrix predMatrixY0 and the second intra luminance prediction sample matrix predMatrixY1, the luminance prediction sample matrix predMatrixIwcpY is finally specified.
[0203] Specifically, when specifying the IWCP luminance prediction sample matrix predMatrixIwcpY based on two intra luminance 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 of the intra weighting combination prediction mode is ((predMatrixY0[x][y] * IwcpWeightMatrixY[x][y] + predMatrixY1[x][y] * (8 - IwcpWeightMatrixY[x][y]) + 4) >> 3). (x, y) is the coordinate position within the current block.
[0205] Furthermore, after identifying the prediction block of IWCP, i.e., the prediction sample matrix predMatrixIwcpY in IWCP mode, subsequent processing can further include decoding of quantization coefficients, identification of the residual block by inverse transformation and inverse quantization, obtaining the reconstructed block by combining the residual block and the prediction block, subsequent in-loop filtering, and the like.
[0206] In an embodiment of the present application, an intra prediction method is provided. The encoder / decoder can identify two different prediction blocks of the current block in two different intra angle prediction modes. Next, by combining two different prediction blocks with various weighting matrices, a more complex prediction block can be finally obtained. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
[0207] In one embodiment of the present application, an intra prediction method applied to an encoder is provided. FIG. 9 is a second flowchart showing the realization of the intra prediction method. As shown in FIG. 9 The method for intra prediction by the encoder can include the following steps.
[0208] Step 201: When identifying the intra prediction value of the current block using the IWCP mode, identify the first intra prediction mode and the 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 from each other.
[0209] In an embodiment of the present application, when identifying the intra prediction value of the current block using the IWCP mode, the encoder can first identify the first intra prediction mode and the 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 from each other.
[0210] In addition, in the embodiments of the present application, the IWCP mode is a kind of intra prediction method. Specifically, in the IWCP mode, two different intra angle prediction modes are specified for the current block, and based on each of these two different intra angle prediction modes, two prediction blocks are respectively specified. Next, one weighting matrix is specified, and by combining these two prediction blocks based on the weighting matrix, a new prediction block can be finally obtained, that is, the prediction block of the current block can be obtained.
[0211] Furthermore, in the embodiments of the present application, when applying the IWCP mode, the size of the current block may be restricted.
[0212] In the intra prediction method according to the embodiments of the present application, since it is necessary to respectively generate two prediction blocks by using two different intra angle prediction modes and obtain a new prediction block by performing weighting based on the weighting matrix, in the embodiments of the present application, the IWCP mode can be restricted so as not to be used for prediction blocks having a specific size, taking into account the reduction of complexity and the balance between compression performance and complexity. Therefore, in the present application, the encoder can first specify the size parameter of the current block, and based on the size parameter, determine whether the IWCP mode is used for the current block.
[0213] In addition, in the embodiments of the present application, the size parameter of the current block can include the height and width of the current block. Therefore, the encoder can restrict the use of the IWCP mode based on the height and width of the current block, that is, restrict the size of the prediction block for which the IWCP mode can be used.
[0214] Exemplarily, in the present application, when both the width and the height are equal to or greater than the first lower limit value and both the width and the height are equal to or less than the first upper limit value, it can be specified that the IWCP mode is used for the current block. Thus, as one possible limitation, the IWCP mode is used only when the width and height of the prediction block are smaller than (or equal to) the first upper limit value and the width and height of the prediction block are greater than (or equal to) the first lower limit value. Note that the first lower limit value may be 8, and the value of the first upper limit value may be 16 or 32, etc.
[0215] Exemplarily, in the encoding of the YUV4:2:0 format, an 8×8 luminance block corresponds to a 4×4 chrominance block at the same position. As one possible method, the IWCP mode can be used for the 8×8 luminance block, but is prohibited from being used for the 4×4 chrominance block. This is because in a 4×4 block, the improvement in the prediction effect by the IWCP mode is not significant, and also because the cost of hardware implementation increases.
[0216] Exemplarily, in the present application, there can be a frame-level flag for specifying whether the IWCP mode is used for the current frame waiting for decoding. For example, the IWCP mode can be configured to be used for an intra-frame (e.g., I-frame) and not used for an inter-frame (e.g., B-frame, P-frame). Or, the IWCP mode can be configured not to be used for an intra-frame and to be used for an inter-frame. Or, the IWCP mode can be configured to be used for some inter-frames and not used for some inter-frames. Since intra prediction may be used for an inter-frame, there is also a possibility that the IWCP mode is used for an inter-frame.
[0217] Exemplarily, in the present application, there can be a flag at a level below the frame level and above the CU level (e.g., tile, slice, patch, LCU, etc.) for specifying whether the IWCP mode is used for this region.
[0218] In addition, in the embodiments of the present application, the coder can identify a combination of an intra prediction mode and a weight matrix derivation mode that has the minimum rate distortion. The combination includes a first intra prediction mode, a second intra prediction mode, and a weight matrix derivation mode.
[0219] Furthermore, in the embodiments of the present application, the first intra prediction mode and the second intra prediction mode can be different intra angle prediction modes from each other. Specifically, in the embodiments of the present application, the first intra prediction mode and the second intra prediction mode can be different intra angle prediction modes in a preset angle prediction mode set.
[0220] That is, in the present application, both the first intra prediction mode and the second intra prediction mode can only be intra angle prediction modes. That is, neither the first intra prediction mode nor the second intra prediction mode is any other basic intra prediction mode other than the intra angle prediction mode (for example, an intra non-angle prediction mode including a DC mode, a Planar mode, a PLANE mode, a Bilinear mode, a PCM mode, etc.). The basic intra prediction modes include, but are not limited to, an angle prediction mode and a non-angle prediction mode. For example, 67 intra prediction modes used in VVC and 66 intra prediction modes used in AVS3 can be mentioned.
[0221] In this application, by restricting the first intra prediction mode and the second intra prediction mode to the intra angle prediction mode, on the one hand, when implementing the IWCP mode in parallel, only one set of circuits for supporting intra angle weighting prediction needs to be added to the hardware, so the hardware implementation complexity of the IWCP mode can be reduced. On the other hand, although the intra weighting combination 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 the overhead can be reduced by using fewer modes. Therefore, whether to use the intra non-angle prediction mode in the IWCP mode has little impact on the compression performance.
[0222] Also, in this application, the more available intra prediction modes there are, the higher the accuracy of the predicted values that can be generated. Correspondingly, however, the overhead for transmitting the flags of the selected modes in the bitstream increases. Therefore, in order to obtain better compression performance, a reasonable set of available intra prediction modes can be selected to achieve a better balance between the prediction effect and the overhead. Specifically, the encoder can use the preset angle prediction mode set to limit the available intra angle prediction modes of the first intra prediction mode and the second intra prediction mode. The preset angle prediction mode set is a subset of all the intra angle prediction modes. Taking AVS3 as an example, there are 62 angle modes in AVS3, that is, the intra angle prediction modes with mode numbers from 3 to 32 and 34 to 65.
[0223] Exemplarily, in this application, the first intra prediction mode and the second intra prediction mode may use only the intra angle prediction modes with mode numbers from 3 to 32, or may use only 28 intra angle prediction modes with mode numbers from 4 to 31.
[0224] Exemplarily, in the present application, taking VVC as an example, for the first intra prediction mode and the second intra prediction mode, only the intra angle prediction modes with even mode numbers may be used, or only the intra angle prediction modes with odd mode numbers may be used.
[0225] Exemplarily, in the present application, the set of angle prediction modes used for the first intra prediction mode is different from the set of angle prediction modes used for the second intra prediction mode. Optionally, the decoder can use the same preset angle prediction mode set to limit the first intra prediction mode and the second intra prediction mode. That is, if the first intra prediction mode can only use 28 intra angle prediction modes with mode numbers from 4 to 31, and the second intra prediction mode can also only use 28 intra angle prediction modes with mode numbers from 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 / decoding methods. That is, when the decoder uses different preset angle prediction mode sets to limit the first intra prediction mode and the second intra prediction mode, different MPM lists or significantly different encoding / decoding methods need to be used for the first intra prediction mode and the second intra prediction mode.
[0226] Step 202: Construct the MPM list of the current block.
[0227] In an embodiment of the present application, the encoder can further construct the MPM list of the current block. All the prediction modes in the MPM list are intra angle prediction modes.
[0228] Also, in an embodiment of the present application, when constructing the MPM list of the current block, the encoder needs to first identify the weight matrix derivation mode of the current block, and then use the weight matrix derivation mode to identify the MPM list of the current block.
[0229] In this application, the weighting matrix derivation mode is used to identify the weighting matrix used for the current block. Specifically, the weighting matrix derivation mode may be a mode for deriving the 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, the weighting matrices derived from different weighting matrix derivation modes are different.
[0230] Exemplarily, in this application, there are 56 weighting matrix derivation modes in AWP of AVS3 and 64 weighting matrix derivation modes in GPM of VVC.
[0231] Optionally, in this application, when constructing the MPM list of the current block, the coder can directly construct the MPM list based on the prediction mode and the weighting matrix derivation mode of the adjacent block of the current block.
[0232] Optionally, in this application, when constructing the MPM list of the current block, the coder can construct the MPM list based on the prediction mode of the adjacent block of the current block, the preset angle prediction mode set, and the weighting matrix derivation mode. The preset angle prediction mode set can be a subset of all intra angle prediction modes. Taking AVS3 as an example, the preset angle prediction mode set can include only 28 intra angle prediction modes with mode numbers from 4 to 31.
[0233] In this application, when the ranges of the first intra prediction mode and the second intra prediction mode are not restricted, the preset angle prediction mode set may be all combinations of all intra angle prediction modes. When the ranges of the first intra prediction mode and the second intra prediction mode need to be restricted, the preset angle prediction mode set can be only some combinations of intra angle prediction modes. In this case, the preset angle prediction mode set can be used to restrict the ranges of the first intra prediction mode and the second intra prediction mode. Thereby, the overhead can be effectively reduced and the compression performance can be improved.
[0234] Optionally, in this application, the coder of the pre- [[ID=⑥]]When constructing the MPM list based on the prediction mode, the preset angle prediction mode set, and the weight matrix derivation mode, the prediction mode of the adjacent block is used to identify the first candidate mode, the weight matrix derivation mode is used to identify the second candidate mode, and further, based on the first candidate mode, the second candidate mode, and the preset angle prediction mode set, the MPM list of the current block can be constructed.
[0235] Specifically, in this application, when the coder uses the prediction mode of the adjacent block to identify the first candidate mode, if the adjacent block is a normal intra prediction block and the prediction mode of the adjacent block is an intra prediction mode, the prediction mode of the adjacent block is identified as the first candidate mode.
[0236] In this application, it can be understood that a normal intra prediction block is a prediction block that uses prediction modes such as the DC mode, the Planar mode, the Bilinear mode, and the angle prediction mode, and is not a prediction block that uses prediction modes such as the IBC mode and the intra string copy prediction.
[0237] Specifically, in the present application, when the coder identifies the second candidate mode using the weight matrix derivation mode, first, it identifies the boundary line angle index based on the weight matrix derivation mode, and then it can identify the second candidate mode using the boundary line angle index.
[0238] Note that in the embodiment of the present application, it can be specified that the second candidate mode includes L different intra-angle prediction modes, thereby ensuring the construction of an MPM list with a length of L.
[0239] Furthermore, in the embodiment of the present application, when the weight matrix includes two types of weight values, the positions where the weight values change form a straight line. Or, when the weight matrix includes multiple types of weight values, the positions where the weight values are the same in the transition region form a straight line, and this straight line may be referred to as the boundary line. The angle in the right horizontal direction may be set to 0 degrees, and the angle may increase counterclockwise. In this case, the boundary line can have various angles such as a horizontal 0 degrees, a vertical 90 degrees, a 45 degrees, a 135 degrees inclination angle, etc. When a certain weight matrix is used for one prediction block, for example, there are two different-angle textures on both sides of the boundary line, or there is an angled texture on one side of the boundary line and a flat texture on the other side of the boundary line. The corresponding textures are likely to exhibit different characteristics on both sides of the boundary line. Since the boundary line itself also has an angle, assuming that the boundary line is obtained by intra-angle prediction at one point and that the boundary line is 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, if it is assumed that the 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, the horizontal boundary line matches the horizontal intra-prediction mode (e.g., mode 24 in AVS3). The vertical boundary line matches the vertical intra-prediction mode (e.g., mode 12 in AVS3). The 45-degree boundary line may match the 45-degree intra-prediction mode from bottom left to top right (e.g., mode 30 in AVS3), or may match the 225-degree intra-prediction mode from top right to bottom left (e.g., mode 6 in AVS3). When there is only one weight value in one weight matrix, it can match modes with no obvious angle, such as the DC mode, Planar mode, Bilinear mode, etc. In this way, since the weight matrix derivation mode can match several intra-prediction modes, the weight matrix derivation mode can be used to assist in decoding the intra-prediction mode.
[0241] Note that in this application, the weight matrix derivation mode may also be the index of the weight matrix. For example, it can be considered that the 56 modes of AWP are 56 weight matrix derivation modes.
[0242] Exemplarily, in the present application, in order to further represent the mapping relationship between the weight matrix derivation mode and the intra-angle prediction mode, one mapping relationship table may be constructed. Specifically, the boundary lines of multiple modes of AWP and GPM all have the same angle. For example, the AWP of AVS3 has the same angle for every eight modes. The 56 AWP modes have a total of eight boundary line angles. The boundary line angle index can be obtained by performing a modulo operation with 8 (%8) on the mode number of the weight matrix derivation mode. For example, Table 1 above is a mapping relationship table. Taking the angle mode in AVS3 as an example, boundary line angle indices 0 and 1 can respectively correspond to two intra-angle prediction modes (one is the prediction mode from top right to bottom left, and the other is the prediction mode from top left to bottom right). Specifically, for other boundary line angle indices, other approximately corresponding intra-angle prediction modes may be found, or all boundary line angle indices may correspond to only one type of intra-angle prediction mode.
[0243] For one type of weight matrix, it is highly likely that the intra-angle prediction mode corresponding to its boundary line is used, and it is also highly likely that several intra-angle prediction modes related to the boundary line are used. For example, corresponding intra-angle prediction modes include angles close to the boundary line or angles perpendicular to the boundary line. The encoder can construct the MPM list of the IWCP mode by utilizing the correlation between the weight matrix and the intra-angle prediction mode. For example, when constructing the MPM list of the IWCP mode, if the list length of the MPM list is 4, the candidate modes corresponding to the boundary line angle indices in Table 2 above can be added to the MPM list.
[0244] According to Table 2 above, since the number of candidate modes corresponding to each boundary line angle index is equal to the length of the MPM list, it can be ensured that the MPM list can be filled even when all the intra prediction modes of adjacent 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 line angle index can be set to 4.
[0245] Furthermore, in the present application, when constructing the MPM list, the coder filters the first candidate mode based on the preset angle prediction mode set, obtains the filtered candidate modes, and constructs the MPM list based on the filtered candidate modes and the second candidate mode, based on the first candidate mode, the second candidate mode, and the preset angle prediction mode set.
[0246] Specifically, in the present application, when the coder filters the first candidate mode based on the preset angle prediction mode set to obtain the filtered candidate modes, if the first candidate mode belongs to the preset angle prediction mode set, the coder specifies 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 angle prediction mode set, the coder specifies an alternative mode of the first candidate mode from the preset angle prediction mode set and specifies the alternative mode as the filtered candidate mode.
[0247] Furthermore, in the present application, if the first candidate mode is not an intra angle prediction mode, the coder can directly delete the first candidate mode.
[0248] In the present application, since the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes and does not include the intra non-angle prediction mode, it is necessary to adjust the selection of the MPM of the current block for the IWCP mode, that is, the method of constructing the MPM list. Specifically, when constructing the MPM list, the coder needs to refer to the intra prediction modes of the adjacent blocks around the current block. Examples of the adjacent blocks around include the left adjacent block, the upper adjacent block, the upper left adjacent block, the upper right adjacent block, and the lower left adjacent block. Due to the spatial correlation, when a certain prediction mode is used for an adjacent block around, the same or similar prediction mode is likely to be used for the current block.
[0249] Optionally, both the first intra prediction mode and the second intra prediction mode of the IWCP mode are intra angle prediction modes only. Therefore, the intra prediction mode used for a certain adjacent block for reference is an intra non-angle prediction mode. That is, when the first candidate mode is not an intra angle prediction mode, the coder does not use the intra non-angle prediction mode used for the reference block when constructing the MPM list of the current block, that is, does not add the intra non-angle prediction mode to the MPM list of the current block.
[0250] Optionally, the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes. Therefore, if the intra prediction mode used for a certain adjacent block for reference is an intra angle prediction mode not included in the preset angle prediction mode set, that is, when the first candidate mode is an intra angle prediction mode and does not belong to the preset angle prediction mode set, when the coder constructs the MPM list of the current block, the intra angle prediction mode not included in the preset angle prediction mode set is converted into an intra angle prediction mode with a similar angle within the preset angle prediction mode set, and then added to the MPM list. Taking AVS3 as an example, according to the preset angle prediction mode set, the first intra prediction mode and the second intra prediction mode are limited to intra angle prediction modes with mode numbers from 4 to 31. Also, when the intra angle prediction mode with mode number 43 is used for the adjacent block of the current block, the coder can add the intra angle prediction with mode number 12, which is similar to the intra angle prediction with mode number 43, to the MPM list of the current block in the IWCP mode.
[0251] Also, in the embodiments of the present application, when the coder constructs the MPM list based on the filtered candidate mode and the second candidate mode, if the filtered candidate mode meets the preset additional conditions, the filtered candidate mode is added to the MPM list. If the MPM list does not meet the preset list length L and the second candidate mode meets the preset additional conditions, the second candidate mode is added to the MPM list. L is an integer greater than or equal to 1.
[0252] Exemplarily, in the present application, the value of L can be 4, that is, the preset list length of the MPM list is 4, or the MPM list contains 4 MPMs.
[0253] In addition, in the embodiment of the present application, the coder can rearrange the L modes in the MPM list according to the ascending order of the mode numbers.
[0254] In addition, in the embodiment of the present application, when the filtered candidate mode is different from all the prediction modes in the MPM list, the coder can determine that the filtered candidate mode satisfies a preset additional condition. Accordingly, when the second candidate mode is different from all the prediction modes in the MPM list, the coder can determine that the second candidate mode satisfies a predetermined additional condition.
[0255] In addition, in the embodiment of the present application, when the coder adds the filtered candidate mode corresponding to the adjacent block to the MPM list, it can identify the order parameter corresponding to the adjacent block, and based on the order parameter, add the filtered intra-candidate mode corresponding to the adjacent block to the MPM list in sequence. The coder can identify the corresponding order parameter according to the spatial distance between the adjacent block and the current block. For example, the closer the spatial distance between the adjacent block and the current block, the stronger the correlation between the adjacent block and the current block, the earlier the addition process is performed, and the smaller the order parameter. The farther the spatial distance between the adjacent block and the current block, the weaker the correlation between the two, the later the addition process is performed, and the larger the order parameter.
[0256] Furthermore, in the embodiment of the present application, after the coder adds the filtered candidate mode and / or the second candidate mode to the MPM list, it can further rearrange the L prediction modes in the MPM list according to the ascending order of the mode numbers.
[0257] Exemplarily, in the present application, the MPM list of the current block in the IWCP mode is IwcpMpm[4]. That is, the list length of the MPM list is 4, the index of the weighted matrix derivation mode is IwcpIndex, the weighted matrix derivation mode reuses 56 derivation modes of AWP, and assuming that the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong includes the intra angle prediction modes with mode numbers from 4 to 31, when constructing the MPM list of the current block, the coder can sequentially execute the following steps.
[0258] Step S1: Provide an array cand_mode
[10] and initialize all values of cand_mode to invalid values. Execute the following operations on cand_mode. (a) If the adjacent block F "exists" and is a normal intra prediction block, cand_mode[0] is equal to the intra prediction mode of F. (b) If the adjacent block G "exists" and is a normal intra prediction block, cand_mode[1] is equal to the intra prediction mode of G. (c) If the adjacent block C "exists" and is a normal intra prediction block, cand_mode[2] is equal to the intra prediction mode of C. (d) If the adjacent block A "exists" and is a normal intra prediction block, cand_mode[3] is equal to the intra prediction mode of A. (e) If the adjacent block B "exists" and is a normal intra prediction block, cand_mode[4] is equal to the intra prediction mode of B. (f) If the adjacent block D "exists" and is a normal intra prediction block, cand_mode[5] is equal to the intra prediction mode of D. (g) cand_mode[6] is equal to 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] For an adjacent block X (where X is A, B, C, D, F, or G) to "exist" means that the block should be within the image and should belong to the same slice as block E. Otherwise, the adjacent block "does not exist". If a block "does not exist" or has not yet been decoded, the block is "unusable". Otherwise, the block is "usable". If the block where the sample of the image is located "does not exist" or the sample has not yet been decoded, the sample is "unusable". Otherwise, the sample is "usable".
[0260] In this application, the execution procedures from (a) to (f) above are the specific process of the first candidate mode, and the execution procedures from (g) to (j) above are the specific process of the second candidate mode. The encoder can specify the second candidate mode with reference to Table 2 above.
[0261] Step S2: For i from 0 to 5, perform the following operations. (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, when the first candidate mode is an intra non-angle prediction mode, the encoder can directly delete the first candidate mode, that is, it is not necessary to use the first candidate mode. (b) Otherwise, if cand_mode[i] is equal to 3, make cand_mode[i] equal to 4. (c) Otherwise, if cand_mode[i] is equal to 32, make cand_mode[i] equal to 31. (d) Otherwise, if cand_mode[i] is greater than 33, perform the following operation. If cand_mode[i] is less than 44, set cand_mode[i] equal to cand_mode[i] - 30. Otherwise, if cand_mode[i] is less than 58, set cand_mode[i] equal to cand_mode[i] - 33. Otherwise, set cand_mode[i] equal to cand_mode[i] - 34. That is, when the first candidate mode is the 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 the alternative mode of 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, when the first candidate mode belongs to the preset angle prediction mode set, the encoder can directly use the first candidate mode, that is, the first candidate mode is the filtered candidate mode.
[0262] In the present application, the above step S2 is the filtering process of the first candidate mode, and the finally determined filtered candidate mode corresponding to the first candidate mode is obtained.
[0263] Step S3: Set mpm_num to 0, and for i from 0 to 9, perform the following operations. (a) If cand_mode[i] is not an invalid value, perform the following operations. Compare cand_mode[i] with IwcpMpm[j], where j ranges from 0 to mpm_num - 1. If cand_mode[i] is not equal to any of 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, end step 3. That is, on the premise that the number of prediction modes in the MPM list is less than 4, if the filtered candidate mode is not the same as any of the prediction modes in the MPM list, the coder can add the filtered candidate mode to the MPM list. After adding all the filtered candidate modes that meet the preset addition conditions to the MPM list, if the number of prediction modes in the MPM list is still less than 4, the coder can continue to add the second candidate mode that meets the preset addition conditions to the MPM list until the list length of the MPM list becomes 4.
[0264] Step S4: Sort the four values of IwcpMpm[4] in ascending order.
[0265] Finally, the coder can sort the four intra angle prediction modes in the MPM list in ascending order of the mode numbers.
[0266] In this application, the execution order of step 202 and step 203 is not restricted, that is, the order of the specific process of the first mode index and the second mode index and the construction process of the MPM list is not restricted.
[0267] Step 203: 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.
[0268] In the embodiment of this application, after the coder 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 coder 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 the embodiments of the present application, the first mode index is used to indicate the first intra prediction mode used for the current block, and the second mode index can be used to indicate the second intra prediction mode 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 angle prediction modes of the first intra prediction mode and the second intra prediction mode. For example, each of the first intra prediction mode and the second intra prediction mode may be one of 28 intra angle prediction modes with mode numbers from 4 to 31. Therefore, both the value of the first mode index and the value of the second mode index are in the range of 0 to 27.
[0271] Exemplarily, in the embodiments of the present application, the first mode index can be represented by the parameter iwcp_pred_mode0_index, and the second mode index can be represented by the parameter iwcp_pred_mode1_index.
[0272] Also, in the embodiments of the present application, the encoder can identify a first mapping relationship table between the index value and the binary string. 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.
[0273] Exemplarily, in the present application, the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
[0274] Note that in the present application, the first mapping relationship table between the index value and the binary string can be used to identify the values of the first mode index and the second mode index.
[0275] Optionally, in this application, in AVS3, 28 intra-angle prediction modes with mode numbers from 4 to 31 are used. That is, when a total of 28 modes are included in the preset angle prediction mode set, the modes can be encoded in the form of 4 + 8 + 16. That is, the 4 modes with the shortest codewords, the 8 modes with shorter codewords, and the 16 modes with longer codewords can be encoded. The 4 modes with the shortest codewords use 3-bit codewords, that is, the first length is used. The 8 modes with shorter codewords use 5-bit codewords, that is, the second length is used. The 16 modes with longer codewords use 6-bit codewords, that is, the third length is used.
[0276] Note that in this application, the predicted angles of the 28 intra-angle prediction modes with mode numbers from 4 to 31 basically cover the entire common angle range. At the same time, the intra-angle prediction modes with mode numbers from 4 to 31 are simpler than the intra-angle prediction modes with mode numbers from 34 to 65. Since encoding these 28 modes in the form of 4 + 8 + 16 does not waste codewords, it is preferable for the encoder to define the preset angle prediction mode set based on the 28 intra-angle prediction modes with mode numbers from 4 to 31.
[0277] Also, in the embodiments of this application, when the list length of the MPM list of the current block is 4, the binary string with the first length can be used for the 4 MPMs in the MPM list. That is, the 4 modes with the shortest codewords can be used for the 4 MPMs in the MPM list. Accordingly, the binary string with the second length and the binary string with the third length can be used for the other prediction modes not included in the MPM list in the preset angle prediction mode set.
[0278] Optionally, in the present application, for the 24 intra-angle prediction modes other than the 4 MPMs in the MPM list in the preset angle prediction mode set, the coder can evenly distribute the modes with short codewords and the modes with long codewords. Specifically, the coder can evenly distribute 8 modes with short codewords (binary strings having the second length) among the remaining 24 intra-angle prediction modes. For example, for every 2 modes with long codewords (binary strings having the third length), 1 mode with a short codeword (binary string having the second length) is used. In a more specific execution process, among the remaining 24 intra-angle prediction modes, for the serial numbers from 0 to 23, it is realized by performing a modulo operation with 3 (%3). For example, a mode with a serial number modulo 3 having a remainder of 2 uses a 5-bit codeword, that is, a binary string having the second length. A mode with a serial number modulo 3 having a remainder of 0 or 1 uses a 6-bit codeword, that is, a binary string having the third length.
[0279] Exemplarily, in the present application, when 28 intra-angle prediction modes with mode numbers from 4 to 31 are used, that is, when the preset angle prediction mode set includes 28 modes, the first mapping relationship table between the index value and the binary string is as shown in Table 3 above, the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
[0280] The first bit can represent whether it is an MPM. For example, "1" represents an MPM, and "0" represents not an MPM. If the first intra-prediction mode is an MPM, assuming that the MPM list contains 4 MPMs, 2 bits can be used to indicate which MPM in the MPM list is used. For example, "00, 01, 10, 11" represent the first MPM, the second MPM, the third MPM, and the fourth MPM in the MPM list, respectively.
[0281] Furthermore, in the present application, a binary string with a bit flag of 0 is encoded using a context model, and a binary string with a bit flag other than 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 addition, in the present application, on the encoding side, when binarizing based on Table 3, a binary string with binIdx equal to 0 is encoded using a context model, and a binary string with binIdx not equal to 0 can be encoded using an equiprobability model or a bypass mode.
[0283] Furthermore, in 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 first intra prediction mode is the same as the mode number of the m-th mode in the MPM list, the value m is assigned to the value i of the first mode index. If the mode number of the first intra prediction mode is different from the mode numbers of any modes in the MPM list, the value i of the first mode index is determined using the MPM list, and the first mode index is determined based on the first mapping relationship table and i. m is an integer greater than or equal to 0 and less than L.
[0284] That is, in the present application, when the mode number of the first intra prediction mode is the same as the mode number of one of the MPMs 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, when the first intra prediction mode is the same as the second mode in the MPM list, set i = 2.
[0285] Specifically, in the present application, when the coder determines the value i of the first mode index using the MPM list, if the mode number of the first intra prediction mode is greater than or equal to the mode number of the fourth mode in the MPM list, the coder 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 less than the mode number of the fourth mode in the MPM list and greater than or equal to the mode number of the third mode in the MPM list, the coder 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 less 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 coder assigns the difference between the mode number of the first intra prediction mode and 2 to i; if the mode number of the first intra prediction mode is less 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 coder assigns the difference between the mode number of the first intra prediction mode and 1 to i; if the mode number of the first intra prediction mode is less than the mode number of the first mode in the MPM list, the coder assigns the mode number of the first intra prediction mode to i.
[0286] Exemplarily, in the present application, if the mode numbers of the 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 coder 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] Exemplarily, in this application, if the mode numbers of the 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 smaller than the mode number of the fourth MPM, the value i of the first mode index is 15 - 3 = 12.
[0288] In addition, in this application, after the encoder determines the value i of the first mode index corresponding to the first intra prediction mode, the encoder can determine the first mode index based on the first mapping relationship table and i. Specifically, the encoder can 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 Two encoder assigns the value m to the value j of the second mode index. 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 uses the MPM list to Two determine the value j of the second mode index, and determines the second mode index based on the first mapping relationship table and j. 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 of the MPMs in the MPM list, the Two 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, set j = 3.
[0291] Specifically, in the present application, when the coder uses the MPM list to identify the value j of the mode index, if the mode number of the second intra prediction mode is greater than or equal to the mode number of the fourth mode in the MPM list, the difference between the mode number of the second intra prediction mode and 4 is assigned to j. If the mode number of the second intra prediction mode is less than the mode number of the fourth mode in the MPM list and greater than or equal to the mode number of the third mode in the MPM list, the difference between the mode number of the second intra prediction mode and 3 is assigned to j. If the mode number of the second intra prediction mode is less 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 second intra prediction mode and 2 is assigned to j. If the mode number of the second intra prediction mode is less 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 second intra prediction mode and 1 is assigned to j. If the mode number of the second intra prediction mode is less 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. Two Specifically, in the present application, when the coder uses the MPM list to identify the value j of the mode index, if the mode number of the second intra prediction mode is greater than or equal to the mode number of the fourth mode in the MPM list, the difference between the mode number of the second intra prediction mode and 4 is assigned to j. If the mode number of the second intra prediction mode is less than the mode number of the fourth mode in the MPM list and greater than or equal to the mode number of the third mode in the MPM list, the difference between the mode number of the second intra prediction mode and 3 is assigned to j. If the mode number of the second intra prediction mode is less 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 second intra prediction mode and 2 is assigned to j. If the mode number of the second intra prediction mode is less 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 second intra prediction mode and 1 is assigned to j. If the mode number of the second intra prediction mode is less 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] Exemplarily, in the present application, if the mode numbers of the 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 coder 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, Two the value j of the mode index is 17 - 4 = 13.
[0293] Exemplarily, in the present application, if the mode numbers of the 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 coder 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,Two The value j of the mode index becomes 5 which is 6 - 1.
[0294] In the present application, after the coder identifies the value j of the second mode index corresponding to the second intra prediction mode, the second mode index can be identified based on the first mapping relation table and j. Specifically, the coder can identify the second mode index by binarizing j according to the first mapping relation table shown in Table 3 above.
[0295] Exemplarily, in the present application, when the IWCP mode is used for the current block, the length of the MPM list of the current block is 4, that is, L = 4, the four modes in the MPM list are sorted in ascending order of mode numbers, and the preset angle prediction mode set includes 28 intra angle prediction modes with mode numbers from 4 to 31, the coder first identifies the first intra prediction mode as IwcpPredMode0 and the second intra prediction mode as IwcpPredMode1, and then can 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 the coder identifies the first intra prediction mode IwcpPredMode0 used for the IWCP mode of the current block, when identifying the first mode index iwcp_pred_mode0_index, specifically, the following operations can be performed.
[0297] 1. When IwcpPredMode0 is equal to IwcpMpm[m] and m is 0 or more 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]? 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 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.
[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] Also, in the embodiments of the present application, in the IWCP mode, it is necessary to specify the predicted value of the current block by using the first intra prediction mode and the second intra prediction mode. 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 specifying the second intra prediction mode, the first intra prediction mode can be excluded.
[0309] In the present application, for the 28 intra angle prediction modes, in the above encoding / decoding method of 4 + 8 + 16, the probability that the 4 MPMs in the MPM list appear is high (the probability that the first intra prediction mode is one of the 4 MPMs in the MPM list is about 50%, and the probability that the second intra prediction mode is one of the 4 MPMs in the MPM list is about 50%). When both the first intra prediction mode and the second intra prediction mode are MPMs in the MPM list, when specifying the second intra prediction mode, only one can be selected from the other 3 MPMs in the MPM list other than the first intra prediction mode. Thus, originally, one was selected from 4, and 4 three-bit codewords were required, but now one is selected from 3, and one two-bit codeword and 2 three-bit codewords are required. Accordingly, when neither the first intra prediction mode nor the second intra prediction mode is an MPM in the MPM list, for the second intra prediction mode, one can be removed from the 24 intra angle prediction modes of 8 + 16, but such an impact is relatively small.
[0310] As can be seen from the above, when both the first intra prediction mode and the second intra prediction mode are MPMs in the MPM list, when specifying the second intra prediction mode, the first intra prediction mode can be deleted first, thereby reducing the overhead.
[0311] Optionally, in an embodiment of the present application, when determining 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: Two A value m is assigned to the value j of the 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 MPM list is used to select the first intra-prediction mode. Two A value j of the mode index is identified, and a second mode index is identified 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] In the present application, the second mapping relationship table between the index value and the binary string is used only for specifying the value of the second mode index.
[0316] Optionally, in the present application, the second mapping relationship table between the index value and the binary string 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 the present application, on the encoding side, when binarizing based on Table 4, the binary string with binIdx being 0 can be encoded using the context model, and the binary string with binIdx not being 0 can be encoded using the equiprobability model or the bypass mode.
[0318] Exemplarily, in the present application, when 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, and the four modes in the MPM list are sorted in ascending order of the mode number. When the preset angle prediction mode set includes 28 intra-angle prediction modes with mode numbers from 4 to 31, the encoder first specifies the first intra-prediction mode as IwcpPredMode0 and the second intra-prediction mode as IwcpPredMode1, and then can specify the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode_ e1_index based on the first intra-prediction mode IwcpPredMode0 and the second intra-prediction mode IwcpPredMode1.
[0319] After specifying the first intra-prediction mode IwcpPredMode0 used for the IWCP mode of the current block, when specifying the first mode index iwcp_pred_mode0_index, the encoder can specifically perform the following operations.
[0320] 1. When 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, based on Table 3, when binarizing the value i of iwcp_pred_mode0_index, 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 becomes 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, when the identification of the second intra prediction mode needs to be performed based on the first intra prediction mode, iwcp_pred_mode1_index depends on iwcp_pred_mode0_index. Specifically, taking Table 4 as an example, when both the first intra prediction mode and the second intra prediction mode are MPMs in the MPM list, there are only three available MPMs for the second intra prediction mode, and further, the MPM can be represented by one or two bits. For example, "00, 01, 10" represent the remaining first MPM, second MPM, and third MPM respectively. In this way, since one possibility is excluded, the overhead can be reduced by changing the encoding / decoding method or changing the binarization or inverse binarization method.
[0332] In the embodiments of the present application, when the preset angle prediction mode set includes 28 intra angle prediction modes with mode numbers from 4 to 31 and the length of the MPM list is 4, when specifying the first mapping relationship table between the index value and the binary string using the binary string with the first length, the binary string with the second length, and the binary string with the third length, first, the binary string with the first length, that is, the shortest codeword, can be used for the four MPMs in the MPM list. Next, the binary string with the second length is used for eight intra angle prediction modes selected from the remaining 24 intra angle prediction modes, and the binary string with the third length is used for the selected 16 intra angle prediction modes.
[0333] Specifically, in the present application, for the remaining 24 intra angle prediction modes, in ascending order of the mode number, the short codeword, that is, the binary string with the second length, is used for the prediction modes corresponding to the previous eight mode numbers, and then, the long codeword, that is, the binary string with the third length, can be used for the prediction modes corresponding to the subsequent 16 mode numbers.
[0334] Exemplarily, in this application, it is possible to replace the first mapping relationship table between the index values shown in Table 3 above and the binary strings with Table 5 above. Table 5 for representing the first mapping relationship table between index values and binary strings can also be used to identify the values of the first mode index and the second mode index.
[0335] Accordingly, it is possible to replace the second mapping relationship table between the index values shown in Table 4 above and the binary strings with Table 6 above. Table 6 for representing the second mapping relationship table between index values and binary strings can also be used to identify the value of the second mode index.
[0336] Note that in this application, when 28 intra-angle prediction modes with mode numbers from 4 to 31 are used, that is, when the preset angle prediction mode set contains 28 modes, in the form of 4 + 8 + 16, that is, 4 modes with 3-bit codewords, 8 modes with 5-bit codewords, and 16 modes with 6-bit codewords can be used for encoding.
[0337] Optionally, in this application, when the preset angle prediction mode set contains a total of 20 modes, these modes can be represented by 4 three-bit codewords and 16 five-bit codewords.
[0338] Optionally, in this application, when the preset angle prediction mode set contains a total of 36 modes, these modes can be represented by 4 three-bit codewords and 32 six-bit codewords. For example, in AVS3, 36 intra-angle prediction modes with mode numbers 4 to 31, 42 to 45, and 56 to 59 are used.
[0339] In addition, in this application, when all the modes in the preset angle prediction mode set are represented by a set of binary strings as shown in Table 3 or Table 4, the "code word" can be understood as a binary string. The length of the code word can be understood as the length of the binary string. Another expression method is the sum of the flag and the binary string. For example, one binary MPM_flag is used to indicate whether the current mode is the MPM mode. That is, when MPM_flag is 1, it indicates that the current mode is the MPM mode, and when MPM_flag is 0, it indicates that the current mode is not the MPM mode. When the current mode is the MPM mode, MPM has a total of four possibilities, and a 2-bit binary string is used to indicate which MPM the current mode is. In this case, the code word can be understood as the sum of the flag and the binary string, and the length of the code word can be understood as the total length of the flag and the binary string.
[0340] Step 204: Write the first mode index and the second mode index into the bit stream.
[0341] In an embodiment of this application, after the encoder determines the first mode index used to indicate the first intra prediction mode and the second mode index used to indicate the second intra prediction mode, based on the first mode index and the second mode index determined by the decoder by decoding the bit stream, the encoder can write the first mode index and the second mode index into the bit stream and transmit them to the decoding side so as to determine the prediction value of the current block.
[0342] Furthermore, in an embodiment of this application, after determining the first intra prediction mode and the second intra prediction mode used for the current block, the encoder needs to determine the weighting matrix of the current block so as to determine the prediction value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix.
[0343] In addition, in the embodiment of the present application, when the coder determines the predicted value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, first, the first predicted value of the current block is determined based on the first intra prediction mode, and the second predicted value of the current block is determined based on the second intra prediction mode. Next, the predicted value of the current block can be finally obtained by performing a weighting operation on the first predicted value and the second predicted value using the weighting matrix.
[0344] Furthermore, in the embodiment of the present application, after the coder determines the predicted value of the current block, the difference between the true value and the predicted value of the current block can be calculated and obtained so that the prediction difference of the current block, that is, the residual, can be determined.
[0345] That is, in the present application, the coder can calculate the difference between the true value and the intra prediction value of the current block to obtain the residual, and the residual is transformed, quantized, entropy coded, written into the bit stream, and transmitted to the decoding side.
[0346] Specifically, in the present application, the coder can determine the weighting matrix of the current block based on the weighting matrix derivation mode of the current block.
[0347] In the present application, both the first intra prediction mode and the second intra prediction mode can be intra angle prediction modes. That is, in the embodiment of the present application, two different intra angle prediction modes are used. Then, the first prediction block and the second prediction block are generated using the first intra prediction mode and the second intra prediction mode, respectively. Furthermore, 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 the embodiments of the present application, it is not the case that the weight values of all points in each weight matrix in all possible weight matrices are the same. In other words, at least one possible weight matrix includes at least two different weight values.
[0349] In addition, in the embodiments of the present application, the encoder can identify the weight matrix in a manner similar to GPM or AWP. Specifically, when GPM or AWP is used in the same video encoding / decoding standard or encoder / decoder, the weight matrix can be identified by this method, and thus some of the same logic can be reused. For example, when AWP is used for inter prediction in AVS3, the method of AWP can be used in AVS3 to identify the weight matrix. Of course, it is also possible to use methods different from GPM or AWP in the same video encoding / decoding standard or encoder / decoder, such as using a different number of modes, or an algorithm with a different transition region, or different parameters. Since inter prediction utilizes temporal correlation, the reconstructed image in the reference image is used as the reference block. Since intra prediction utilizes spatial correlation, the reconstructed samples around the current block are used as the reference samples. In the spatial domain, the closer the distance, the stronger the correlation, and the farther the distance, the weaker the correlation. Therefore, when a certain weight matrix causes the sample position of the predicted block to be far from the reference sample, such a weight matrix may not be able to generate a more appropriate predicted value than the prior art, so such a weight matrix cannot be used. Instead, such a weight matrix can be used for inter prediction.
[0350] In an embodiment of the present application, an intra prediction method is provided. An encoder / decoder can identify two different prediction blocks of a current block in two different intra angle prediction modes, and then, by combining the two different prediction blocks with various weighting matrices, a more complex prediction block can be finally obtained. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
[0351] Based on the above embodiment, in a further embodiment of the present application, after identifying that the IWCP mode is used for the current block, the encoder further identifies the intra prediction mode parameter of the current block and can write the intra prediction mode parameter into the bitstream. The intra prediction mode parameter is used to determine whether the IWCP mode is used for the current block.
[0352] Note that 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, that is, whether two different intra angle prediction modes can be used to identify the predicted value of the current block.
[0353] Note that in an embodiment of the present application, the intra prediction mode parameter may be understood as a flag indicating whether the IWCP mode is being used. Specifically, the encoder can identify a variable as the intra prediction mode parameter by analyzing the bitstream, and the value of the variable can be used to identify the intra prediction mode parameter.
[0354] Exemplarily, in the present application, when the IWCP mode is used for the current block, the encoder can set the value of the intra prediction mode parameter to indicate that the IWCP mode is used for the current block. Specifically, the encoder can set the value of the variable to 1.
[0355] Exemplarily, in the present application, if the IWCP mode is not currently used for a block, the encoder can set the value of the intra prediction mode parameter to indicate that the IWCP mode is not currently used for the block. Specifically, the encoder can set the value of the variable to 0.
[0356] Furthermore, in an embodiment of the present application, after the encoder completes the setting of the intra prediction mode parameter, the encoder can write the intra prediction mode parameter into the bitstream and transmit the bitstream to the decoder so that the decoder can obtain the intra prediction mode parameter after decoding the bitstream.
[0357] That is, in an embodiment of the present application, on the encoder side, predictive coding is performed on the current block, during which the intra prediction mode parameter of the current block is identified, the corresponding intra prediction mode parameter is written into the bitstream, and the bitstream is transmitted from the encoder to the decoder.
[0358] Note that in an embodiment of the present application, before performing intra prediction on the current block, the encoder first identifies the prediction mode parameter, and then can identify which coding mode the coding mode used for the current block is by using the prediction mode parameter.
[0359] Furthermore, in an embodiment of the present application, when identifying the prediction mode parameter of the current block, the encoder first performs encoding prediction on the current block using a plurality of different prediction modes respectively, and then can calculate the rate-distortion cost corresponding to each of the plurality of prediction modes. Finally, the encoder can select the minimum rate-distortion cost from the calculated plurality of rate-distortion costs and identify the prediction mode corresponding to the minimum rate-distortion cost as the prediction mode parameter of the current block.
[0360] That is, for the current block, on the encoder side, a plurality of prediction modes can be respectively used to encode the color components waiting for prediction.
[0361] Furthermore, in the embodiments of the present application, after the encoder encodes the current block using a plurality of prediction modes respectively, it can obtain the rate-distortion cost corresponding to each prediction mode. Next, the encoder can select the minimum rate-distortion cost from the obtained plurality of rate-distortion costs, and specify the prediction mode corresponding to the minimum rate-distortion cost as the prediction mode parameter of the current block. In this way, the specified prediction mode can be used to encode the current block, and in this prediction mode, the prediction residual can be reduced, and the encoding / decoding efficiency can be improved.
[0362] Furthermore, in the embodiments of the present application, on the encoding side, when the encoder attempts to obtain a certain 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, it attempts to obtain the costs of all or some possible situations, and selects the minimum cost as the cost of encoding using the IWCP mode.
[0363] Note that in the embodiments of the present application, all the above possible situations include combinations of three variables. The three variables are such 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] Note that in the present 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. By doing so, the number of possible situations decreases accordingly, and the complexity on the encoding side also decreases correspondingly.
[0365] Exemplarily, in the present application, assuming that there are 66 intra prediction modes available in the IWCP mode and 66 first intra prediction modes, since the second intra prediction mode is different from the first intra prediction mode, there are 65 second intra prediction modes. Assuming that there are 56 weight matrix derivation modes (taking AWP as an example), in the present application, it is possible to use any two different intra prediction modes and any one weight matrix derivation mode, and there are a total of 66×65×56 possibilities. If the available intra angle prediction modes are restricted, that is, if the mode range within the preset angle prediction mode set is restricted, for example, if the preset angle prediction mode set is restricted to include only 28 intra angle prediction modes with mode numbers from 4 to 31, the first intra prediction mode has 28 possibilities. Since the second intra prediction mode is different from the first intra prediction mode, the second intra prediction mode has 27 possibilities. Assuming that there are 56 weight matrix derivation modes (taking AWP as an example), in the present application, since any two different intra prediction modes and any one weight matrix derivation mode can be used, there are a total of 28×27×56 possibilities.
[0366] Furthermore, in an embodiment of the present application, the encoder performs rate distortion optimization (RDO) for all possible situations of the IWCP mode and identifies one combination with the minimum cost. 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 RDO, a first selection is made for all possible situations of the IWCP mode. For example, by making the first selection using the cost of approximations such as the sum of absolute difference (SAD) and the sum of absolute transformed difference (SATD), a set number of candidate combinations of the first intra prediction mode, the second intra prediction mode, and the weight matrix derivation mode can be identified. Next, a fine selection is performed by RDO to identify the combination of the first intra prediction mode, the second intra prediction mode, and the weight matrix derivation mode with the minimum cost. Several fast algorithms are used for the first selection, which can reduce the number of attempts. For example, if one intra angle prediction mode causes a high cost, multiple intra prediction modes adjacent to the intra angle prediction mode are not attempted.
[0368] Note that in the present application, in the above first selection and fine selection, the cost can include the overhead cost of encoding the first intra prediction mode, the second intra prediction mode, and the weight matrix derivation mode in a bit stream. Also, during the first selection, it is possible to use the estimated cost of the overhead in the bit streams of the first intra prediction mode, the second intra prediction mode, and the weight matrix derivation mode. For example, the number of bits of the first intra prediction mode or the second intra prediction mode is estimated according to whether the first intra prediction mode or the second intra prediction mode is MPM, or the number of bits of the first or second intra prediction mode is estimated according to the rearrangement of the intra prediction modes. In RDO, the cost can be obtained by more accurate trial coding. In that process, the method for constructing the MPM list or the method for rearranging the intra prediction modes in the present application is required.
[0369] In this application, during the above first selection and refinement, a first prediction block is identified based on the first intra prediction mode, a second prediction block is identified based on the second intra prediction mode, and a weighting matrix is derived based on the weighting matrix derivation mode. A prediction block of this application is identified based on the first prediction block, the second prediction block, and the weighting matrix. During the first selection using SAD and SATD, SAD and SATD are identified using the current block and the prediction block.
[0370] Furthermore, in an embodiment of this application, the encoder can first analyze the texture of the current block, for example, by using gradients. The analyzed data is useful for the first selection. For example, if the texture in a certain direction in the texture of the current block is strong, during the above first selection, the intra prediction mode in a direction approximated to that direction is selected more often for trial. If the texture in a certain direction in the texture of the current block is weak, during the above first selection, the intra prediction mode in a direction approximated to that direction is selected less often or not at all for trial.
[0371] Note that in this application, the encoding cost 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 conversion, quantization, entropy encoding, etc. of the prediction residual, the cost of the distortion of the reconstructed block, and the like.
[0372] After identifying the encoding cost using the IWCP mode, if the encoding cost using the IWCP mode is lower than the cost of other prediction modes (other prediction modes can include other intra prediction modes or inter prediction modes, etc.), the encoder selects the IWCP mode as the prediction mode of the current block. Otherwise, the encoder selects other prediction modes.
[0373] Furthermore, in the embodiments of the present application, the coder attempts different block partitions and determines the encoding cost. When the IWCP mode is selected for a specific prediction block, the flags required for the IWCP mode, as well as the 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 the syntax. At the same time, the prediction block can be predicted and encoded using the IWCP mode.
[0374] In the embodiments of the present application, an intra prediction method is provided. The coder / decoder can identify two different prediction blocks of the current block in two different intra angle prediction modes, and then finally obtain a more complex prediction block by combining the two different prediction blocks with various weight matrices. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
[0375] Based on the above embodiments, in yet another further embodiment of the present application, FIG. 10 is a first schematic diagram showing the structure of an encoder according to an embodiment of the present application. As shown in FIG. 10, an encoder 300 according to an embodiment of the present application includes a first specifying unit 301, a first constructing unit 302, and an encoding unit 303. The first specifying unit 301 is configured to specify a first intra prediction mode and a second intra prediction mode of a current block when specifying an intra prediction value of the current block using an intra weight combination prediction (IWCP) mode, and the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. The first constructing unit 302 is configured to construct a most probable mode (MPM) list of the current block. The first specifying unit 301 is further configured to specify 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 into a bit stream.
[0376] FIG. 11 is a second schematic diagram showing 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. Instructions executable by the first processor 304 are stored in the first memory 305, and the first bus 307 is used to connect the first processor 304, the first memory 305, and the first communication interface 306.
[0377] Furthermore, in the embodiments of the present application, when the first processor 304 uses the IWCP mode to identify the intra prediction value of the current block, the first intra prediction mode and the second intra prediction mode of the current block are identified, the MPM list of the current block is constructed, and 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 of the current block are identified, and the first mode index and the second mode index are configured to be written into the bitstream. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other.
[0378] FIG. 12 is a first schematic diagram showing the structure of a decoder according to an embodiment of the present application. As shown in FIG. 12, the decoder 400 according to the embodiment of the present application includes a decoding unit 401, a second specifying unit 402, and a second constructing unit 403. The decoding unit 401 is configured to decode a bitstream. The second specifying unit 402 is configured to specify the intra prediction mode parameter of the current block. When the intra prediction mode parameter instructs to identify the intra prediction value of the current block using the IWCP mode, the second specifying unit 402 is configured to specify the first mode index and the second mode index of the current block. The second constructing unit 403 is configured to construct the MPM list of the current block. The second specifying unit 402 is further configured to specify 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 first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. The second specifying unit 402 is further configured to specify the weighting matrix of the current block, and based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, to specify the prediction value of the current block.
[0379] FIG. 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. Instructions executable by the second processor 404 are stored in the second memory 405. The second bus 407 is used to connect the second processor 404, the second memory 405, and the second communication interface 406.
[0380] Furthermore, in the embodiment of the present application, when the second processor 404 decodes a bitstream to identify the intra prediction mode parameter of the current block, and the intra prediction mode parameter instructs to identify the intra prediction value of the current block using the IWCP mode, the second processor 404 identifies the first mode index and the second mode index of the current block, constructs the MPM list of the current block, 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, identifies the weighting matrix of the current block, and is configured to identify the prediction value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes.
[0381] Also, each functional module according to this embodiment may be integrated into one processing unit, each unit may physically exist alone, or two or more units may be integrated into one unit. The integrated unit can be implemented in the form of a hardware or software functional module.
[0382] When the integrated unit is implemented as a software functional module and sold or used as an independent product, it may be stored in a computer-readable recording medium. According to this understanding, for the technical solution of the present application, the essential part, or the part that can contribute to the prior art, or all or part of the technical solution, can be expressed as a software product. This computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) 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 codes such as a universal serial bus (USB) flash drive, 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 identifies the intra prediction mode parameter of the current block by decoding the bitstream. When the intra prediction mode parameter instructs to identify the intra prediction value of the current block using the IWCP mode, the decoder identifies the first mode index and the second mode index of the current block. The decoder constructs the MPM list of the current block. Based on the first mode index, the second mode index, and the MPM list, the decoder identifies the first intra prediction mode and the 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 from each other. The decoder identifies the weighting matrix of the current block and identifies the prediction value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix. When the encoder identifies the intra prediction value of the current block using the IWCP mode, the encoder identifies the first intra prediction mode and the 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 from each other. The encoder constructs the MPM list of the current block. Based on the first intra prediction mode, the second intra prediction mode, and the MPM list, the encoder identifies the first mode index and the second mode index of the current block. The encoder writes the first mode index and the second mode index into the bitstream. That is, in the embodiment of the present application, the encoder / decoder can identify two different prediction blocks of the current block in two different intra angle prediction modes, and then finally obtain a more complex prediction block by combining the two different prediction blocks with various weighting matrices. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
[0384] In an embodiment of the present application, a computer-readable storage medium is provided. A program is stored in the computer-readable storage medium, and when the program is executed by a processor, the method described in the above embodiment is executed.
[0385] Specifically, program instructions corresponding to one intra prediction method in this embodiment can be stored in a storage medium such as an optical disc, a hard disk, or a USB flash drive. When the program instructions corresponding to one intra prediction method in the storage medium are read or executed by an electronic device, the following operations are performed. By decoding the bitstream, the intra prediction mode parameter of the current block is identified. When the intra prediction mode parameter instructs to identify the intra prediction value of the current block using the IWCP mode, the first mode index and the second mode index of the current block are identified. The MPM list of the current block is constructed. 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 of the current block are identified. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. The weighting matrix of the current block is identified, and based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, the predicted value of the current block is identified.
[0386] The following operations are further performed. When the intra prediction value of the current block is identified using the IWCP mode, the first intra prediction mode and the second intra prediction mode of the current block are identified. The first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. The MPM list of the current block is constructed. 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 of the current block are identified. The first mode index and the second mode index are written into the bitstream.
[0387] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can have hardware embodiments, software embodiments, or embodiments combining software and hardware. Further, 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 memories, etc.) containing program code that can be utilized by a computer.
[0388] The present application will be described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the 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 can be realized by computer program instructions. Those computer program instructions are provided to the processor of a general-purpose computer, a dedicated computer, an embedded processor, or other programmable data processing device, thereby generating a machine. Thus, the instructions executed by the processor of the computer or other programmable data processing device result in an apparatus for realizing the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram.
[0389] Those computer program instructions can be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to execute in a specific manner. Thereby, the instructions stored in the computer-readable storage medium result in a manufactured product including an instruction device. The instruction device realizes the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram.
[0390] Those computer program instructions can be loaded into a computer or other programmable data processing apparatus and cause a series of operational steps to be executed in the computer or other programmable apparatus to generate a process implemented by the computer. Thus, the instructions executed in the computer or other programmable apparatus provide the steps for realizing the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram.
[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 identifies the intra prediction mode parameter of the current block by decoding the bitstream. When the intra prediction mode parameter instructs to identify the intra prediction value of the current block using the IWCP mode, the decoder identifies the first mode index and the second mode index of the current block. The decoder constructs the MPM list of the current block. Based on the first mode index, the second mode index, and the MPM list, the decoder identifies the first intra prediction mode and the 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 from each other. The decoder identifies the weighting matrix of the current block, and based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, the decoder identifies the prediction value of the current block. When the encoder identifies the intra prediction value of the current block using the IWCP mode, the encoder identifies the first intra prediction mode and the 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 from each other. The encoder constructs the MPM list of the current block. Based on the first intra prediction mode, the second intra prediction mode, and the MPM list, the encoder identifies the first mode index and the second mode index of the current block. The encoder writes the first mode index and the second mode index into the bitstream. That is, in the embodiment of the present application, the encoder / decoder can identify two different prediction blocks of the current block in two different intra angle prediction modes, and then finally obtain a more complex prediction block by combining the two different prediction blocks with various weighting matrices. Thereby, while improving the accuracy of intra prediction, the cost of hardware implementation can be reduced, the complexity can be reduced, a simple and efficient encoding / decoding method can be realized, and the compression performance can be improved.
Claims
1. An intra prediction method applied to a decoder, comprising: identifying an intra prediction mode parameter of a current block by decoding a bitstream; when the intra prediction mode parameter instructs to identify an intra prediction value of the current block using an intra weighted combination prediction (IWCP) mode, identifying a first mode index and a second mode index of the current block; constructing a most probable mode (MPM) list of the current block; identifying 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, wherein the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes; identifying a weighting matrix of the current block, and identifying a prediction value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix. An intra prediction method, characterized by the above.
2. The intra prediction method further includes identifying a weighting matrix derivation mode of the current block, wherein constructing the MPM list of the current block includes constructing the MPM list based on a prediction mode of an adjacent block of the current block and the weighting matrix derivation mode. The intra prediction method according to Claim 1, characterized by the above.
3. The intra prediction method further includes identifying a weighting matrix derivation mode of the current block, wherein constructing the MPM list of the current block includes constructing the MPM list based on a prediction mode of an adjacent block of the current block, a preset angle prediction mode set, and the weighting matrix derivation mode, wherein constructing the MPM list based on the prediction mode of the adjacent block of the current block, the preset angle prediction mode set, and the weighting matrix derivation mode includes identifying a first candidate mode using the prediction mode of the adjacent block; 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 1, characterized in that.
4. Identifying the first candidate mode using the prediction mode of the adjacent block means that, When the adjacent block is a normal intra prediction block and the prediction mode of the adjacent block is an intra prediction mode, identifying the prediction mode of the adjacent block as the first candidate mode, or Identifying the second candidate mode using the weighted matrix derivation mode means that, Identifying a boundary line angle index based on the weighted matrix derivation mode, and Identifying the second candidate mode using the boundary line angle index. The intra prediction method according to claim 3, characterized in that.
5. Constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes means that, Obtaining a filtered candidate mode by filtering the first candidate mode based on the set of preset angle prediction modes, and Constructing the MPM list based on the filtered candidate mode and the second candidate mode. Obtaining the filtered candidate mode by filtering the first candidate mode based on the set of preset angle prediction modes means that, When the first candidate mode belongs to the set of preset angle prediction modes, identifying the first candidate mode as the filtered candidate mode, and When the first candidate mode is an intra angle prediction mode and does not belong to the set of preset angle prediction modes, identifying an alternative mode of the first candidate mode from the set of preset angle prediction modes and identifying the alternative mode as the filtered candidate mode, and When 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 3, characterized in that.
6. Constructing the MPM list based on the first candidate mode, the second candidate mode, and the set of preset angle prediction modes means that, Obtaining a filtered candidate mode by filtering the first candidate mode based on the preset angle prediction mode set; When the filtered candidate mode satisfies a preset additional condition, adding the filtered candidate mode to the MPM list; When the MPM list does not satisfy a preset list length L and the second candidate mode satisfies the preset additional condition, adding the second candidate mode to the MPM list, where L is an integer greater than or equal to 1; The intra prediction method according to claim 3, characterized in that.
7. The intra prediction method further includes identifying a first mapping relationship table between an index value and a binary string; 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; The binary string having the first length is used for the 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 not included in the MPM list in the preset angle prediction mode set; The intra prediction method according to claim 6, characterized in that.
8. Identifying 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: Identifying the value i of the first mode index based on the first mapping relationship table; When i is greater than or equal to 0 and less than L, identifying the angle prediction mode with index i in the MPM list as the first intra prediction mode; When i is greater than or equal to L, identifying the first intra prediction mode by using the preset angle prediction mode set and the MPM list; The intra prediction method according to claim 7, characterized in that.
9. The intra prediction method further includes identifying a weighting matrix derivation mode of the current block; Identifying the weighting matrix of the current block includes: Identifying the weighting matrix of the current block based on the weighting matrix derivation mode; Based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix, specifying the predicted value of the current block includes: specifying a first predicted value of the current block based on the first intra prediction mode and specifying a second predicted value of the current block based on the second intra prediction mode; obtaining the predicted value of the current block by performing a weighting operation on the first predicted value and the second predicted value using the weighting matrix. The intra prediction method according to claim 1 is characterized by the above. The intra prediction method according to claim 1, characterized in that.
10. The intra prediction method further includes: all prediction modes in the MPM list are intra angle prediction modes. The intra prediction method according to claim 1 is characterized by the above. The intra prediction method according to claim 1, characterized in that.
11. An intra prediction method applied to an encoder, when specifying the intra predicted value of a current block using an intra weighted combination prediction (IWCP) mode, specifying 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 from each other; constructing a most probable mode (MPM) list of the current block; specifying 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 bit stream. The intra prediction method is characterized by the above. The intra prediction method according to claim 11, characterized in that. The intra prediction method according to claim 12, characterized in that the intra prediction method further includes specifying a weighting matrix derivation mode of the current block, and constructing the MPM list of the current block includes constructing the MPM list based on the prediction mode of an adjacent block of the current block and the weighting matrix derivation mode.
13. The intra prediction method further includes specifying a weighting matrix derivation mode of the current block, and constructing the MPM list of the current block includes: The intra prediction method further includes specifying a weighting matrix derivation mode of the current block. Constructing the MPM list of the current block includes constructing the MPM list based on the prediction mode of an adjacent block of the current block and the weighting matrix derivation mode. The intra prediction method according to claim 11 is characterized by the above. Constructing the MPM list of the current block includes: Constructing the MPM list based on the prediction mode of an adjacent block of the current block and the weighting matrix derivation mode. The intra prediction method according to claim 11 is characterized by the above. The intra prediction method according to claim 11, characterized in that.
13. The intra prediction method further includes specifying a weighting matrix derivation mode of the current block. Constructing the MPM list of the current block includes: Constructing the MPM list based on the prediction mode of an adjacent block of the current block and the weighting matrix derivation mode. The intra prediction method according to claim 11 is characterized by the above. Constructing the MPM list based on the prediction mode of the adjacent block of the current block, the preset angle prediction mode set, and the weighting matrix derivation mode, Constructing the MPM list based on the prediction mode of the adjacent block of the current block, the preset angle prediction mode set, and the weighting matrix derivation mode includes: Identifying a first candidate mode using the prediction mode of the adjacent block; 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 preset angle prediction mode set. The intra prediction method according to claim 11, characterized in that.
14. An encoder comprising a first identifying unit, a first constructing unit, and an encoding unit, When the first identifying unit identifies the intra prediction value of the current block using the intra-weighted combination prediction (IWCP) mode, the first identifying unit is configured to identify the first intra prediction mode and the second intra prediction mode of the current block, and the first intra prediction mode and the second intra prediction mode are different intra angle prediction modes from each other. The first constructing unit is configured to construct a most probable mode (MPM) list of the current block. The first identifying 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 bit stream. An encoder, characterized in that.
15. A decoder comprising a decoding unit, a second identifying unit, and a second constructing unit, The decoding unit is configured to decode a bit stream. The second identifying unit is configured to identify the intra prediction mode parameter of the current block. When the intra prediction mode parameter instructs to identify the intra prediction value of the current block using the intra-weighted combination prediction (IWCP) mode, the second identifying unit is configured to identify the first mode index and the second mode index of the current block. The second construction unit is configured to construct a most probable mode (MPM) list of the current block, The second specifying unit is further configured to specify 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 from each other, and the second specifying unit is further configured to specify a weighting matrix of the current block, and to specify a predicted value of the current block based on the first intra prediction mode, the second intra prediction mode, and the weighting matrix. A decoder characterized by the above.
Citation Information
Patent Citations
Intranet prediction method and intranet prediction system
JP2013524670A
Entropy decoding apparatus, entropy coding apparatus, image decoding device, and image coding device
JP2019216294A