Video encoding method and video decoding method, encoder, decoder, and storage medium
By determining a first predicted value and transformation parameter based on intra-prediction mode parameters, the method enhances coding efficiency and image quality in video encoding and decoding, addressing the inflexibility of existing standards for non-traditional modes like MIP.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2022-04-13
- Publication Date
- 2026-06-02
AI Technical Summary
The existing video coding standards, such as H.266/VVC, lack flexibility in selecting transformation kernels for non-traditional intra-prediction modes, leading to reduced coding efficiency and video image quality.
A method and system that determine a first predicted value and transformation parameter based on intra-prediction mode parameters, allowing flexible selection of transformation kernels for non-traditional modes like MIP, enhancing coding efficiency and image quality.
Improves decoding efficiency and video image quality by enabling flexible selection of transformation kernels for non-traditional intra-prediction modes, particularly MIP, in video encoding and decoding processes.
Smart Images

Figure 0007869332000007 
Figure 0007869332000008 
Figure 0007869332000009
Abstract
Description
[Technical Field]
[0001] The embodiments of this application relate to the field of image processing technology, and more particularly to video encoding methods and video decoding methods, encoders, decoders, and storage media. [Background technology]
[0002] With increasing demands for video display quality, new forms of video applications, such as high-resolution and ultra-high-resolution video, are emerging. The Joint Video Exploration Team (JVET) of the International Organization for Standardization (ISO / IEC) and the ITU-T developed the video coding standard H.266 / Versatile Video Coding (VVC). H.266 / VVC includes conversion techniques related to the coding mode of the coding block. However, these conversion techniques are not adapted to non-angle prediction coding modes, resulting in reduced coding efficiency. [Overview of the Initiative]
[0003] The embodiments of this application provide a video encoding method and a video decoding method, an encoder, a decoder, and a storage medium that can improve encoding and decoding efficiency by improving applicability to non-traditional intra-predictive modes and by making the selection of the conversion kernel more flexible. [Means for solving the problem]
[0004] The technical solution of the embodiment of this application can be realized as follows.
[0005] In a first embodiment, the embodiment of the present application provides a video decoding method applicable to a decoder, the method being Decode the bitstream and determine the intra-predictive mode parameters of the first type in the current block, Based on the first type of intra prediction mode parameter, the first predicted value of the current block is determined, The first transformation parameter of the current block is determined based on the first predicted value of the current block or the first type of intra-prediction mode parameter, Based on the first transformation parameter, a second transformation parameter for transforming the current block is determined, Based on the second transformation parameter, a transformation process is performed on the transformation coefficient of the current block to determine the residual value of the current block. This includes determining the reconstruction value of the current block based on the residual difference value and the first predicted value.
[0006] In a second embodiment, an embodiment of the present application provides a video encoding method applicable to an encoder, the method being: Determining the parameters of the first type of intra-predictive mode, Based on the first type of intra-prediction mode parameter, a first predicted value of the current block is determined, and the residual difference between the original value of the current block and the first predicted value is calculated. The first transformation parameter of the current block is determined based on the first predicted value of the current block or the first type of intra-prediction mode parameter, Based on the first transformation parameter, a second transformation parameter for transforming the current block is determined, This includes performing a transformation process on the residual difference value based on the second transformation parameter to obtain the transformation coefficient of the current block.
[0007] In a third embodiment, the embodiment of the present application provides a decoder, the decoder is, A decoding unit configured to decode a bitstream and determine the first type of intra-predictive mode parameters of the current block, A first prediction unit is configured to determine a first predicted value for the current block based on the first type of intra prediction mode parameter, A first determination unit is configured to determine a first transformation parameter for the current block based on a first predicted value of the current block or the first type of intra-prediction mode parameter, and to determine a second transformation parameter for transforming the current block based on the first transformation parameter. A first conversion unit is configured to perform a conversion process on the conversion coefficient of the current block based on the second conversion parameter and to determine the residual difference value of the current block. The system includes a reconstruction unit configured to determine the reconstruction value of the current block based on the residual difference value and the first predicted value.
[0008] In a fourth embodiment, the embodiment of the present application provides an encoder, said encoder, A second determination unit configured to determine the first type of intra-predictive mode parameters, A second prediction unit is configured to determine a first predicted value for the current block based on the first type of intra prediction mode parameter, The second determination unit is further configured to calculate the residual difference between the original value of the current block and the first predicted value, determine the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter, and determine the second transformation parameter for transforming the current block based on the first transformation parameter.
[0009] The system includes a second conversion unit configured to perform a conversion process on the residual difference value based on the second conversion parameter to obtain a conversion coefficient for the current block.
[0010] In a fifth embodiment, the embodiment of the present application provides a decoder comprising a first memory and a first processor, The first memory stores computer programs executed by the first processor, The first processor executes the method according to the first embodiment by executing the computer program.
[0011] In a sixth embodiment, the present invention provides an encoder comprising a second memory and a second processor. The second memory stores computer programs executed by the second processor. The second processor executes the computer program to perform the method according to the second embodiment.
[0012] In a seventh embodiment, the embodiment of the present application provides a computer-readable storage medium that stores a computer program which, when executed by a first processor, causes the first processor to perform the method described in the second embodiment, or when executed by a second processor, causes the second processor to perform the method described in the first embodiment.
[0013] Embodiments of this application provide a video encoding method and a video decoding method, an encoder, a decoder, and a storage medium, which determine a first predicted value of the current block based on a first type of intra-prediction mode parameter, determine a first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter, determine a second transformation parameter for transforming the current block based on the first transformation parameter, perform a transformation process on the transformation coefficients of the current block based on the second transformation parameter, determine the residual value of the current block, and determine the reconstructed value of the current block based on the residual value and the first predicted value. In this way, when performing LFNST transformation on a current block employing a first type of intra-prediction mode (e.g., MIP), the introduction of the first predicted value of the current block or the first type of intra-prediction mode parameter makes the selection of the transformation kernel or transformation matrix (corresponding to the second transformation parameter) in the transformation technique more flexible, thereby improving applicability to non-traditional intra-prediction modes (first type of intra-prediction mode), improving decoding efficiency, and simultaneously improving video image quality. [Brief explanation of the drawing]
[0014] [Figure 1] It is a schematic diagram of the application position of the LFNST technology by related technical solutions. [Figure 2A] It is a block diagram of the configuration of a video encoding system according to an embodiment of the present application. [Figure 2B] It is a block diagram of the configuration of a video decoding system according to an embodiment of the present application. [Figure 3] It is an exemplary flowchart of a video decoding method according to an embodiment of the present application. [Figure 4] It is a block diagram of the MIP prediction process according to an embodiment of the present application. [Figure 5] It is a schematic diagram of the structure of the calculation process of matrix multiplication of the LFNST technology according to an embodiment of the present application. [Figure 6A] It is a block diagram of the structure of the LFNST transform by related technical solutions. [Figure 6B] It is a block diagram of another structure of the LFNST transform by related technical solutions. [Figure 6C] It is a block diagram of yet another structure of the LFNST transform by related technical solutions. [Figure 6D] It is a block diagram of yet another structure of the LFNST transform by related technical solutions. [Figure 7] It is a block diagram of the specific process of the LFNST according to an embodiment of the present application. [Figure 8] It is an exemplary flowchart of another video encoding method according to an embodiment of the present application. [Figure 9] It is an exemplary structural diagram of the configuration of a decoder according to an embodiment of the present application. [Figure 10] It is a schematic diagram of the specific hardware structure of a decoder according to an embodiment of the present application. [Figure 11] It is an exemplary structural diagram of the configuration of an encoder according to an embodiment of the present application. [Figure 12] It is a schematic diagram of the specific hardware structure of an encoder according to an embodiment of the present application.
Mode for Carrying Out the Invention
[0015] To better understand the features and technical content of the embodiments of this application, the embodiments of this application will be described in detail below with reference to the drawings. The accompanying drawings are for reference purposes only and are not intended to limit the embodiments of this application.
[0016] In a video image, a coding block (CB) is generally represented by a first image component, a second image component, and a third image component, where these three image components are one luminance component, one blue chroma component, and one red chroma component, respectively. Exemplarily, the luminance component is usually represented by the code Y, the blue chroma component by the code Cb or U, and the red chroma component by the code Cr or V. Thus, a video image may be represented in YCbCr format or YUV format. Otherwise, the video image may be in RGB format, YcgCo format, or the like, and the embodiments of this application are not particularly limited.
[0017] In the embodiments of this application, the first image component may be a luminance component, the second image component may be a blue component, and the third image component may be a red component; however, the embodiments of this application are not particularly limited.
[0018] The embodiments of this application may be suitable for scenarios involving low-frequency unseparated secondary conversion (LFNST) or extended low-frequency unseparated secondary conversion, or for other conversion techniques that need to be related to the encoding mode of the encoded block, and the embodiments of this application are not limited thereto.
[0019] The following describes related solutions for LFNST technology.
[0020] Referring to Figure 1, a schematic diagram of the application locations of LFNST technology by related technologies is shown. As shown in Figure 1, in intra-prediction mode, on the encoder side, LFNST technology is applied between the positive linear conversion unit 11 and the quantization unit 12, and between the inverse quantization unit 13 and the inverse linear conversion unit 14.
[0021] On the encoder side, first, the data is subjected to an initial transformation (which may be called a "Core Transform", "linear transformation", or "main transformation") by the positive linear transformation unit 11, for example, the predicted residual (which can be represented as a residual), to obtain the transformation coefficient matrix after the initial transformation (i.e., the second transformation coefficient). Then, an LFNST transformation (which may be called a "Secondary Transform" or "quadratic transformation") is performed on the coefficients in the transformation coefficient matrix to obtain the LFNST transformation coefficient matrix (i.e., the first transformation coefficient). Finally, the LFNST transformation coefficient matrix is subjected to quantization by the quantization unit 12, and the final quantized coefficients are written to the video bitstream.
[0022] On the decoder side, the quantization coefficients of the LFNST transformation coefficient matrix can be obtained by analyzing the bitstream. The inverse quantization unit 13 performs an inverse quantization process (which may also be called "Scaling") on these quantization coefficients to obtain the restored values of the LFNST transformation coefficient matrix (i.e., the first transformation coefficients). An inverse LFNST transformation is then performed on these restored values to obtain the second transformation coefficients. Subsequently, the inverse linear transformation unit 14 performs an inverse transformation on the second transformation coefficients corresponding to the encoder side's "Core Transform," finally obtaining the restored residual values. It should be noted that, in the standard, only the "inverse transformation" operation on the decoder side is defined, so in the standard, the "inverse LFNST transformation" is also called "LFNST transformation." Here, in order to distinguish it from the transformation on the encoder side, the "LFNST transformation" on the encoder side may be called the "forward LFNST transformation," and the "LFNST transformation" on the decoder side may be called the "inverse LFNST transformation."
[0023] In other words, the encoder performs a positive linear transformation on the predicted residual of the current transformation block to obtain linear transformation coefficients, i.e., second transformation coefficients. Then, a quadratic transformation is performed by multiplying some of the linear transformation coefficients by the transformation matrix using matrix multiplication to obtain quadratic transformation coefficients (i.e., first transformation coefficients) that are smaller in quantity and more concentrated. Furthermore, quantization is performed on these to obtain quantization coefficients. The decoder analyzes the quantization coefficients, then performs inverse quantization on them. A reverse quadratic transformation is performed on the first transformation coefficients after inverse quantization using matrix multiplication. Finally, a reverse linear transformation is performed on the first transformation coefficients after the reverse quadratic transformation to restore the predicted residual.
[0024] In technologies related to LFNST, the LFNST transformation process may include steps such as configuring core parameters, mapping intra-prediction modes, selecting a transformation matrix, calculating matrix multiplication, and constructing an inverse linear transformation coefficient matrix. After these steps, the LFNST transformation is completed. However, in the step of selecting the transformation matrix (i.e., the transformation kernel), it is first necessary to select a transformation set. Since the transformation matrix is related to the directional characteristics of the prediction modes, the transformation set is currently selected based on the intra-prediction mode. Here, in the traditional intra-prediction mode, the value of the intra-prediction mode indicator (which can be represented by predModeIntra), i.e., the value of the first transformation parameter, can be determined based on the number of the traditional intra-prediction mode, and the index number of the transformation set can be determined based on the value of predModeIntra. However, in non-traditional intra-prediction modes, particularly matrix-based intra-prediction (MIP) modes, the value of predModeIntra is directly set to the corresponding intra-prediction mode index number (i.e., 0) to indicate the PLANAR mode. This means that in MIP mode, only transformation sets with an index number of 0 can be selected for the current block. This lack of variability when performing LFNST transformations on the current block in MIP mode not only prevents the application of LFNST techniques to MIP mode but also reduces coding efficiency.
[0025] Embodiments of this application provide a video decoding method applicable to a decoder. Based on a first type of intra-prediction mode parameter, a first predicted value of the current block is determined; based on the first predicted value of the current block or the first type of intra-prediction mode parameter, a first transformation parameter of the current block is determined; based on the first transformation parameter, a second transformation parameter for transforming the current block is determined; based on the second transformation parameter, a transformation process is performed on the transformation coefficients of the current block to determine the residual value of the current block; and based on the residual value and the first predicted value, the reconstructed value of the current block is determined. In this way, for a current block employing a first type of intra-prediction mode (e.g., MIP), when performing an LFNST transformation, the introduction of the first predicted value of the current block or the first type of intra-prediction mode parameter makes the selection of the transformation kernel or transformation matrix (corresponding to the second transformation parameter) more flexible in the transformation technique, thereby improving applicability to non-traditional intra-prediction modes (first type of intra-prediction mode), improving decoding efficiency, and simultaneously improving video image quality.
[0026] Embodiments of this application provide a video coding method applicable to an encoder. A first type of intra-prediction mode parameter is determined, a first predicted value of the current block is determined based on the first type of intra-prediction mode parameter, a residual difference value is calculated between the original value of the current block and the first predicted value, a first transformation parameter of the current block is determined based on the first predicted value of the current block or the first type of intra-prediction mode parameter, a second transformation parameter for transforming the current block is determined based on the first transformation parameter, and a transformation process is performed on the residual difference value based on the second transformation parameter to obtain a transformation coefficient of the current block. In this way, when performing an LFNST transformation on a current block employing a first type of intra-prediction mode (e.g., MIP), the introduction of the first predicted value of the current block or the first type of intra-prediction mode parameter makes the selection of the transformation kernel or transformation matrix (corresponding to the second transformation parameter) in the transformation technique more flexible, thereby improving applicability to non-traditional intra-prediction modes (first type of intra-prediction mode), improving coding efficiency, and simultaneously improving video image quality.
[0027] The system frameworks used in each embodiment of this application will be described in detail below with reference to the drawings.
[0028] Figure 2A shows an example of a block diagram of the configuration of a video coding system according to an embodiment of this application. As shown in Figure 2A, the video coding system 10 includes a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image buffer unit 110. Here, the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC). A single video coding block can be obtained from the input original video signal by dividing it into a coding tree unit (CTU). Then, the video coding block is transformed by a transformation and quantization unit 101 using residual pixel information obtained by intra-prediction or inter-prediction. This involves transforming the residual information from the pixel region to the transformation region and quantizing the resulting transformation coefficients, thereby further reducing the bitrate.The intra-estimation unit 102 and the intra-prediction unit 103 are configured to perform intra-prediction on the video coding block, specifically, the intra-estimation unit 102 and the intra-prediction unit 103 are configured to determine the intra-prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are configured to perform inter-prediction coding of the received video coding block for one or more blocks in one or more reference frames to provide time prediction information; the motion estimation performed by the motion estimation unit 105 is a process that generates motion vectors, which can estimate the motion of the video coding block; and the motion compensation unit 104 performs motion compensation based on the motion vectors determined by the motion estimation unit 105; and after the intra-prediction mode is determined, the intra-prediction unit 103 is further configured to provide selected intra-prediction data to the encoding unit 109, and the motion estimation unit 105 also transmits the computationally determined motion vector data to the encoding unit 109. Furthermore, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coded block, the residual block is reconstructed in the pixel region, the reconstructed residual block is deblocked of blocking artifacts by the filter control analysis unit 107 and the filtering unit 108, and the reconstructed residual block is added to one prediction block in the frame of the decoding image buffer unit 110 to generate a reconstructed video coded block. The coding unit 109 is configured to encode various coding parameters and quantized transformation coefficients, and in a CABAC-based coding algorithm, contextual content can be based on adjacent coded blocks, encode information indicating a determined intra-prediction mode, and can be used to output a bitstream of the video signal, and the decoding image buffer unit 110 is configured to store the reconstructed video coded block used for prediction reference.As the encoding of the video image progresses, newly reconstructed video encoding blocks are continuously generated, and all of these reconstructed video encoding blocks are stored in the decoded image buffer unit 110.
[0029] Figure 2B shows an example of a block diagram of the configuration of a video decoding system according to an embodiment of this application. As shown in Figure 2B, the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc. The decoding unit 201 can perform decoding of header information and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the encoding process shown in Figure 2A is performed on the input video signal, the bitstream of the video signal is output and input to the video decoding system 20. First, the decoding unit 201 processes the decoded transformation coefficients, and these transformation coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel region. The intra-prediction unit 203 is configured to generate prediction data for the current video decoding block based on the determined intra-prediction mode and data from previous decoding blocks from the current frame or image. The motion compensation unit 204 is configured to determine prediction information for the video decoding block by analyzing motion vectors and other relevant syntactic elements, and to generate prediction blocks for the video decoding block being decoded using this prediction information. The decoded video block is formed by adding the residual blocks from the inverse transform and inverse quantization unit 202 and the corresponding prediction blocks generated by the intra-prediction unit 203 or motion compensation unit 204. The decoded video signal can be filtered by the filtering unit 205 to remove blocking artifacts and improve video quality. The decoded video block is stored in the decoding image buffer unit 206, which stores a reference image for subsequent intra-prediction or motion compensation and outputs the video signal to obtain the restored original video signal.
[0030] The video encoding method in the embodiments of this application can be applied to the transform and quantization unit 101 shown in Figure 2A, which includes the forward linear transform unit 11 and quantization unit 12 shown in Figure 1, in which case the video encoding method is applied to the process after transforming but before quantization. Furthermore, the video decoding method in the embodiments of this application can be applied to the inverse transform and inverse quantization unit 202 shown in Figure 2B, which may include the inverse quantization unit 13 and inverse linear transform unit 14 shown in Figure 1, in which case the video decoding method is applied to the process after inverse quantization but before inverse transforming. In other words, the video encoding method in the embodiments of this application is applied to a video encoding system, and the video decoding method in the embodiments of this application is applied to a video decoding system. Furthermore, it may be applied simultaneously to both the video encoding system and the video decoding system, but the embodiments of this application are not limited. Furthermore, when the video encoding method is applied to a video encoding system, the "current block" (i.e., the transformed block) may be the current encoded block in intra-prediction, and when the video decoding method is applied to a video decoding system, the "current block" (i.e., the transformed block) may refer to the current decoded block in intra-prediction.
[0031] Referring to Figure 3, based on the example application scenario in Figure 2B above, an exemplary flowchart of a video decoding method according to an embodiment of the present application is shown and applied to a decoder. As shown in Figure 3, the method may include the following steps:
[0032] In step S101, the bitstream is decoded and the intra-prediction mode parameters of the first type for the current block are determined.
[0033] In the embodiments of this application, the decoder decodes the bitstream in the decoding process to obtain the prediction mode parameters of the current block, the prediction mode parameters representing the encoding mode of the current block and parameters associated with that mode. Here, the prediction mode typically includes traditional intra-prediction modes and non-traditional intra-prediction modes, where traditional intra-prediction modes may include DC mode, planar mode, and angular prediction mode, and non-traditional intra-prediction modes (first type of intra-prediction mode) may include MIP mode, CCLM mode, IBC mode, and PLT mode.
[0034] In the embodiments of this application, the second type of intra-prediction mode represents a traditional intra-prediction mode, and the first type of intra-prediction mode represents a non-traditional intra-prediction mode. Here, the first type of intra-prediction mode may be understood as a non-angle prediction mode.
[0035] When the decoder decodes, if the decoded prediction mode parameter represents a first type intra-prediction mode, it determines the first type intra-prediction mode parameter for the current block in the bitstream.
[0036] In the embodiment of this application, when the encoder encodes the current block, the encoder performs prediction and encoding on the current block, and in this process can determine the prediction mode of the current block, write the corresponding prediction mode parameters to a bitstream, and transmit them to the decoder by the encoder.
[0037] Furthermore, the encoder can determine the predicted mode parameters of the current block using a rate distortion optimization (RDO) method.
[0038] In the embodiments of this application, the decoding of the current block is also a decoding process for different color components. The luminance component or chroma component of the current block is indicated by an image component indicator (which can be represented by cIdx).
[0039] For example, when predicting the luminance component of the current block, cIdx is equal to 0, and when predicting the chroma component of the current block, cIdx is equal to 1. Also, (xTbY, yTbY) are the coordinates of the sample point at the upper left corner of the current block, IntraPredModeY[xTbY][yTbY] is the intra-prediction mode for the luminance component, and IntraPredModeC[xTbY][yTbY] is the intra-prediction mode for the chroma component.
[0040] After knowing the prediction mode, the decoder can determine the first type of intra-prediction mode parameters for the current block. The first type of intra-prediction mode parameters are the parameters corresponding to the first type of intra-prediction mode.
[0041] For example, if the first type of intra-prediction mode is the MIP mode, then the parameters corresponding to the first type of intra-prediction mode are the MIP parameters.
[0042] The first type of intra-predictive mode parameters may include parameters such as the first type of intra-predictive mode index (which can be represented by modeId), the current block size, and the current block type (which can be represented by mipSizeId), and the values of these parameters can be obtained by decoding the bitstream. Here, the MIP parameters may include parameters such as the MIP transpose instruction parameter (which can be represented by isTransposed), the MIP mode index number (which can be represented by modeId), the current block size, and the current block type (which can be represented by mipSizeId).
[0043] In one embodiment, determining the type of current block based on the size of the current block is possible. Currently, if both the width and height of a block are equal to 4, the value of mipSizeId can be set to 0. Otherwise, if either the width or height of the block is currently equal to 4, or if both the width and height of the block are currently equal to 8, the value of mipSizeId can be set to 1. Otherwise, this may include the fact that if the current block is a block of a different size, the value of mipSizeId can be set to 2.
[0044] In another embodiment, determining the type of current block based on the size of the current block is possible. Currently, if both the width and height of a block are equal to 4, the value of mipSizeId can be set to 0. Currently, if one of the block's width or height is equal to 4, the value of mipSizeId can be set to 1. Otherwise, this may include the fact that if the current block is a block of a different size, the value of mipSizeId can be set to 2.
[0045] In this way, the process of determining intra-predicted values using MIP allows for the determination of MIP parameters, which in turn allows for the determination of the LFNST transformation kernel (which can be represented as kernel) to be used for the current block, based on the determined MIP parameters.
[0046] The following explanation will use MIP parameters as an example.
[0047] In some embodiments, the value of isTransposed can be determined by decoding the bitstream. If the value of isTransposed is equal to 1, the input vector of sample points used in MIP mode must be transposed. If the value of isTransposed is equal to 0, the input vector of sample points used in MIP mode does not need to be transposed. In other words, the MIP transpose instruction parameter can be used to indicate whether or not to perform a transpose on the input vector of sample points used in MIP mode.
[0048] In some embodiments, the bitstream can be decoded to determine an MIP mode index number (which can be represented by modeId), where the MIP mode index number can be used to indicate the MIP mode used for the current block, and the MIP mode can be used to indicate a derivation scheme for a calculation that uses MIP to determine the intra-predicted value of the current block. In other words, since there are multiple types of MIP modes, these multiple types of MIP modes can be distinguished by the MIP mode index number, that is, different MIP modes have different MIP mode index numbers, and in this way, a specific MIP mode can be determined based on a derivation scheme for a calculation that uses MIP to determine the intra-predicted value of the current block, thereby obtaining the corresponding MIP mode index number, and in embodiments of this application, the value of the MIP mode index number may be 0, 1, 2, 3, 4, or 5.
[0049] In some embodiments, decoding the bitstream can further determine parameter information such as the size, aspect ratio, and type of the current block (which can be represented by mipSizeId). After determining the MIP parameters in this way, the subsequent steps involve selecting a translation kernel (which can be represented by kernel, e.g., an LFNST translation kernel) or scan sequence parameters to be used for the current block based on the determined MIP parameters, or determining a first predicted value for the current block based on the determined MIP parameters, and then selecting a translation kernel or scan sequence parameters based on the first predicted value.
[0050] In step S102, the first predicted value of the current block is determined based on the first type of intra-prediction mode parameter.
[0051] In the embodiment of this application, the decoder can determine a first predicted value for the current block by performing an intra-prediction based on a first type of intra-prediction mode parameter.
[0052] We will explain this using the example that the first type of intra-predictive mode parameter is the MIP parameter.
[0053] In the embodiment of this application, in MIP mode, the input data for MIP prediction includes the current block position (xTbCmp, yTbCmp), the MIP prediction mode applied to the current block (which can be represented by modeId), the current block height (which can be represented by nTbH), the current block width (which can be represented by nTbW), and a transposition instruction flag (which can be represented by isTransposed) indicating whether transposition is required. The output data for MIP prediction includes the predicted block of the current block, and the intra-predicted value corresponding to the pixel coordinates [x][y] in the predicted block is predSamples[x][y], where x=0,1,...,nTbW-1 and y=0,1,...,nTbH-1.
[0054] In some embodiments of this application, as shown in Figure 4, the MIP prediction process can be divided into four steps: core parameter configuration 41, reference pixel acquisition 42, input sample construction 43, and predicted value generation 44. Here, regarding core parameter configuration 41, the current block can be divided into three types based on the size of the current block in the frame, and the type of the current block is recorded in mipSizeId. For different types of current blocks, the number of reference sample points and the number of output sample points from matrix multiplication are different. Regarding reference pixel acquisition 42, when predicting the current block, the top and left blocks of the current block are all encoded blocks, and the reference pixels of the MIP technique are the reconstructed values of the pixels in the previous row and the left column of the current block. The reference pixel acquisition process is the process of acquiring the reference pixels adjacent to the top side of the current block (represented by refT) and the reference pixels adjacent to the left side (represented by refL). Regarding the construction of input samples 43, this step is used for input to matrix multiplication and mainly includes obtaining reference samples 431, constructing a reference sample buffer 432, and deriving input samples for matrix multiplication 433, where the reference sample acquisition process may be a downsampling process, and the construction of the reference sample buffer 432 may include a buffer filling method 4321 when transposition is not required and a buffer filling method 4322 when transposition is required. Regarding the generation of predicted values 44, this step is for obtaining the MIP predicted value of the current block and mainly includes constructing a matrix multiplication output sample block 441, clipping the matrix multiplication output sample 442, transposing the matrix multiplication output sample 443, and generating the final predicted value of the MIP 444, where constructing the matrix multiplication output sample block 441 may further include obtaining the weight matrix 4411, obtaining the shift factor and offset factor 4412, and performing matrix multiplication operations 4413, and generating the final predicted value of the MIP 444 may include generating predicted values that do not require upsampling 4441 and generating predicted values that do require upsampling 4442. In this way, the intra predicted value of the current block can be obtained through these four steps.
[0055] In this way, after determining the intra-predicted value of the current block, a difference calculation is performed on the actual pixel value and the intra-predicted value of the current block. By using the calculated difference value as the predicted difference value, a conversion process can be performed on subsequent predicted difference values.
[0056] Furthermore, the MIP prediction process requires determining the MIP parameters.
[0057] In some embodiments, the MIP parameters may include a MIP transpose instruction parameter (which can be denoted as isTransposed), where the value of the MIP transpose instruction parameter is used to indicate whether or not to perform a transpose operation on the input vector of sample points used in the MIP mode.
[0058] In MIP mode, an adjacent reference sample set can be obtained based on the reference sample value corresponding to the left adjacent reference pixel of the current block and the reference sample value corresponding to the upper adjacent reference pixel. After obtaining the adjacent reference sample set in this way, one input reference sample set, i.e., the input vector of sample points used in MIP mode, can be constructed. However, the construction method for the input reference sample set differs between the encoder and decoder sides, and mainly depends on the value of the MIP transpose instruction parameter. During encoding, the MIP transpose instruction parameter is determined by the encoder's calculation, and during decoding, the MIP transpose instruction parameter is decoded from the bitstream by the decoder.
[0059] Furthermore, when the MIP transpose instruction parameter is decoded by the decoder and the value of the MIP transpose instruction parameter is 0, the buffer can store the reference sample value corresponding to the upper side in the adjacent reference sample set before the reference sample value corresponding to the left side. In this case, there is no need to perform transposition, that is, there is no need to perform transposition on the input vector of the sample points used in MIP mode, and the buffer can be directly determined as the input reference sample set. When the value of the MIP transpose instruction parameter is 1, the buffer can store the reference sample value corresponding to the upper side in the adjacent reference sample set after the reference sample value corresponding to the left side. In this case, transposition must be performed on the buffer, that is, transposition must be performed on the input vector of the sample points used in MIP mode, and then the transposed buffer is determined as the input reference sample set. In this way, after obtaining the input reference sample set, it can be used in the process of determining the intra-predicted value corresponding to the current block in MIP mode.
[0060] In step S103, the first transformation parameter of the current block is determined based on the first predicted value or the first type of intra-prediction mode parameter of the current block.
[0061] In embodiments of this application, the decoder can determine a first transformation parameter of the current block based on a first predicted value of the current block. The decoder can further determine a first transformation parameter of the current block based on a first type of intra-predicted mode parameter of the current block, and embodiments of this application are not limited thereto.
[0062] In some embodiments of this application, the decoder determining a first transformation parameter of the current block based on a first predicted value of the current block may include the following steps:
[0063] In step S1, the first index of the second type of intra prediction mode for the current block is determined based on the first predicted value of the current block.
[0064] In step S2, the first transformation parameter of the current block is determined based on the first index of the second type of intra prediction mode of the current block.
[0065] In the embodiment of this application, the decoder can determine a first index of a second type of intra-prediction mode using a first predicted value of the current block, where the second type of intra-prediction mode includes at least one of a planar mode, a DC mode, and an angular intra-prediction mode. The decoder can then determine a first transformation parameter of the current block based on the first index of the second type of intra-prediction mode of the current block.
[0066] In the embodiments of this application, the first transformation parameter is the basis for determining the second transformation parameter, namely the transformation kernel index parameter (referring to the transformation coefficient matrix index) and the scan order parameter of the transformation parameter.
[0067] In other words, the decoder can map non-traditional intra-prediction modes to traditional intra-prediction modes, thereby using the first index of the traditional intra-prediction mode to determine the first transformation parameter of the current block. This allows the decoder to select a second transformation parameter that performs parameter transformation in the non-traditional intra-prediction mode of the current block using a flexible method corresponding to the traditional intra-prediction mode. This improves the applicability of non-traditional intra-prediction modes (first type intra-prediction modes), enhances coding efficiency, and simultaneously improves video image quality.
[0068] In the embodiments of this application, the first predicted value may be the final predicted value obtained by performing intraprediction using the first type of intraprediction mode, or it may be an intermediate predicted value in the process of performing intraprediction using the first type of intraprediction mode.
[0069] For example, in MIP mode, the first predicted value may be the final predicted value after upsampling in MIP prediction, or it may be an intermediate predicted value before upsampling in MIP prediction, and the embodiments of this application are not limited thereto.
[0070] In some embodiments of this application, the decoder can set the first transformation parameter of the current block to be equal to the first index of the second type of intra-prediction mode of the current block.
[0071] In some embodiments of this application, the implementation of S1 includes the following steps:
[0072] In step S201, based on the first predicted value, the index set for the second type of intra-prediction mode of the first predicted value is determined.
[0073] In step S202, the first index of the second type intra-prediction mode for the current block is determined based on the index set of the second type intra-prediction mode for the first predicted value, where the index set of the second type intra-prediction mode stores cumulative weight values corresponding to some or all of the tolerance values of the index of the second type intra-prediction mode.
[0074] In the embodiment of this application, the decoder can map a first predicted value to a second type of intra-prediction mode, thereby obtaining an index set of the second type of intra-prediction mode, and from the index set of the second type of intra-prediction mode, determine the first index of the second type of intra-prediction mode to be used in the current block.
[0075] Furthermore, the index set for the second type of intra-prediction mode can store cumulative weight values corresponding to some or all of the tolerance values of one or more second type of intra-prediction mode indices. If multiple values are stored, the first index of the second type of intra-prediction mode in the current block may be one selected from among the cumulative weight values corresponding to multiple second type of intra-prediction mode indices.
[0076] In some embodiments of this application, the decoder determines the horizontal and vertical gradient values of the sample points corresponding to some or all of the first predicted values, and determines the index set of a second type of intra-prediction mode for the first predicted values based on the horizontal and vertical gradient values of the sample points.
[0077] Exemplary, MIP predictions are used, and by calculating gradient information of the MIP mode predictions using different analysis methods, the MIP predictions are mapped to traditional intra-prediction modes. For example, traditional intra-prediction modes are derived based on gradient information, and the transformation set and scan order used during LFNST are selected based on the derived intra-prediction modes.
[0078] Furthermore, the decoder can determine a second index of the second type of intra-prediction mode corresponding to each sample point, and after determining all sample points corresponding to some or all of the first predicted values, it becomes possible to obtain a set of indexes for the second type of intra-prediction mode.
[0079] In some embodiments of this application, the process for determining the second index of the second type of intra-prediction mode for each sample point is similar. For a single sample point, the decoder determines the set of indexes of the second type of intra-prediction mode for the first predicted value based on the horizontal and vertical gradient values of the sample point, which includes (1) and (2) as follows:
[0080] (1) The decoder determines the gradient angle value of the sample point based on the horizontal and vertical gradient values of the sample point, determines the second index of the second type intra-prediction mode corresponding to the gradient angle value based on the gradient angle value of the sample point, and updates the cumulative weight value corresponding to the determined second index of the second type intra-prediction mode in the index set of the second type intra-prediction mode.
[0081] In the embodiment of this application, the decoder determines the gradient angle value of the sample point based on the horizontal gradient value and vertical gradient value of the sample point, and a preset functional relationship.
[0082] One way to implement this is to use a predefined functional relationship, which is the arctangent function, where the arctangent function is the ratio of the horizontal gradient value to the vertical gradient value of the sample point.
[0083] As an example, the predefined functional relationships are shown in equation (1).
[0084]
number
[0085] In some embodiments of this application, the decoder determines the gradient angle value of the sample point by processing the ratio of the horizontal gradient value to the vertical gradient value of the sample point based on the arctangent function.
[0086] Another implementation method involves a pre-defined functional relationship, which is a second mapping table between the gradient angle value of a sample point and the horizontal and vertical gradient values of the sample point.
[0087] In some embodiments of this application, the decoder inputs the horizontal gradient value and vertical gradient value of the sample point, or the ratio of the horizontal gradient value and vertical gradient value of the sample point, into a second mapping table and outputs the gradient angle value of the sample point.
[0088] Furthermore, since the second mapping table is known, the gradient angle value of the mapping can be determined from the second mapping table and the horizontal and vertical gradient values of the sample points. The second mapping table is the correspondence between the horizontal and vertical gradient values of the sample points and the gradient angle value, or it may be the correspondence between the ratio of the horizontal gradient value to the vertical gradient and the gradient angle value, and the embodiments of this application are not limited to this.
[0089] In the embodiment of this application, the decoder can determine the gradient angle value and then determine the second index of the second type of intra-prediction mode for the sample point based on the gradient angle value of the sample point.
[0090] In some embodiments of this application, the decoder determines a second index of a second type of intra-prediction mode corresponding to a gradient angle value based on the gradient angle value of a sample point, which includes determining a second type of intra-prediction mode index value corresponding to the angular intra-prediction direction with the smallest angle between the angular intra-prediction direction shown in some or all of the tolerance values of the index of the second type of intra-prediction mode and the direction shown in the gradient angle value, and setting the second index of the second type of intra-prediction mode of the gradient angle value to the second type of intra-prediction mode index value.
[0091] The decoder can store cumulative weight values corresponding to some or all of the tolerance values for the second type of intra-prediction mode index using a single array. Each data set in the array is a cumulative weight value for the tolerance value corresponding to the second type of intra-prediction mode.
[0092] The decoder first finds the angular intra-prediction direction closest to the direction indicated by the gradient angle value, then determines a second type of intra-prediction mode corresponding to that angular intra-prediction direction, and the index value of this second type of intra-prediction mode is used as the second index of the second type of intra-prediction mode for the gradient angle value.
[0093] In some embodiments of this application, the decoder determining a second index of a second type of intra-prediction mode corresponding to a gradient angle value based on the gradient angle value of a sample point includes determining a second index of a second type of intra-prediction mode corresponding to a gradient angle value based on a third mapping table between a preset gradient angle value and a second type of intra-prediction mode index, where the third mapping table represents the correspondence between gradient angle values of different values or different ranges of values and a second type of intra-prediction mode index.
[0094] In some embodiments of this application, after the decoder determines a second index of a second type intra-prediction mode corresponding to each sample point, the decoder can update the cumulative weight value corresponding to the determined second index of the second type intra-prediction mode in the index set of the second type intra-prediction mode. That is, each time the decoder determines a second index for a sample point, it can add a set number to the cumulative weight value corresponding to the determined second index of the second type intra-prediction mode in the index set of the second type intra-prediction mode. In this way, after processing all sample points, a set of indexes of the second type intra-prediction mode for the first predicted value can be obtained.
[0095] In some embodiments of this application, the set value is equal to 1, or the set value is equal to the sum (G) of the absolute values of the horizontal gradient and the absolute values of the vertical gradient. The embodiments of this application are not limited to these.
[0096] For example, G is as shown in equation (2).
[0097] G=|G x |+|G y (2) (2) The decoder determines the gradient direction, first gradient intensity, and mode partition corresponding to the sample point based on the horizontal and vertical gradient values of the sample point, determines the second index of the second type intra-prediction mode based on the gradient direction, first gradient intensity, and mode partition corresponding to the sample point, and updates the cumulative weight value corresponding to the determined second index of the second type intra-prediction mode in the index set of the second type intra-prediction mode.
[0098] In some embodiments of this application, the decoder determines a first gradient intensity of a sample point based on the horizontal gradient value (gHor[x][y]) and vertical gradient value ((gVer[x][y]) of the sample point, performs partition processing of a second type of intra-prediction mode on the sample point based on the horizontal gradient value and vertical gradient value of the sample point, determines the horizontal region index (signH[x][y]), vertical region index (signV[x][y]), and gradient intensity index (HgV[x][y]) of the sample point, determines the mode partition (region[x][y]) of the sample point based on the horizontal region index, vertical region index, and gradient intensity index of the sample point, and determines the gradient direction (HgV[x][y]==1?) corresponding to the sample point based on the gradient intensity index of the sample point.
[0099] In some embodiments of this application, the decoder determines a second index of a second type of intra-prediction mode based on the gradient direction, first gradient intensity, and mode partition corresponding to the sample point. The decoder includes: determining the gradient offset ratio (grad[x][y]) of a sample point based on the gradient direction corresponding to the sample point; mapping the gradient offset ratio of the sample point to a preset mode offset range to obtain the offset amount (angIdx[x][y]) of the intra-prediction mode index of the sample point; determining the target second type intra-prediction mode corresponding to the mode partition of the sample point based on a fourth mapping table of preset mode partitions and mode indices; and determining the second index of the second type intra-prediction mode of the sample point by combining the target second type intra-prediction mode and the offset amount of the intra-prediction mode index.
[0100] In some embodiments of this application, after the decoder determines a second index of a second type intra-prediction mode corresponding to each sample point, the decoder can update the cumulative weight value corresponding to the determined second index of the second type intra-prediction mode in the index set of the second type intra-prediction mode. That is, each time the decoder determines a second index for a sample point, it can add a set number to the cumulative weight value corresponding to the determined second index of the second type intra-prediction mode in the index set of the second type intra-prediction mode. In this way, after processing all sample points, a set of indexes of the second type intra-prediction mode for the first predicted value can be obtained.
[0101] In the embodiments of this application, updating the cumulative weight value corresponding to the second index of the determined second type intra-prediction mode in the index set of second type intra-prediction modes by the decoder includes adding a set number to the cumulative weight value corresponding to the second index of the determined second type intra-prediction mode in the index set of second type intra-prediction modes.
[0102] Here, the set value is equal to 1, or equal to the sum of the absolute values of the horizontal gradient and the absolute values of the vertical gradient, and the embodiments of this application are not limited to this.
[0103] For example, taking the MIP mode as an example, we analyze the predicted value of the MIP mode (i.e., the first predicted value), derive the traditional intra prediction mode based on the predicted value of the MIP mode, map predModeIntra as the traditional intra prediction mode to obtain the first index, and thus obtain the first transformation parameter equal to the first index.
[0104] In the embodiment of this application, the decoder can analyze the gradient of the MIP prediction value, extract the direction with the largest gradient value, and associate that direction with a traditional intra-prediction mode. The mapping process is divided into two steps: acquiring the prediction pixels of the MIP mode and deriving the traditional intra-prediction mode using the gradient. The mapping process includes acquiring the prediction pixels of the MIP mode (i.e., sample points of the first prediction value) and deriving the traditional intra-prediction mode using the gradient.
[0105] The decoder determines the index set of the second type of intra-prediction mode for the first prediction based on the first prediction as follows:
[0106] In the embodiments of this application, the decoder can obtain predicted values of the MIP mode based on the position and size of the MIP transformation block (current block). When transformation and quantization are performed on the residual values of the current transformation block, the prediction of the current transformation block is completed, and in this case, the predicted values can be obtained directly based on the position and size of the MIP transformation block. One feasible method is to obtain the final predicted values after matrix multiplication and upsampling of the MIP, and another feasible method is to obtain the predicted values before upsampling of the MIP.
[0107] In the embodiment of this application, the decoder uses gradients to derive traditional intra-prediction modes in the following process: Taking the analysis of the final predicted pixels of the MIP mode as an example, for the final predicted pixels of the MIP mode, the vertical gradient (vertical gradient value) and horizontal gradient (horizontal gradient value) of all or some of the predicted pixels are calculated, and the direction with the largest gradient (gradient angle value) is mapped to the traditional intra-prediction mode.
[0108] In the embodiments of this application, the MIP prediction mode is mapped to a traditional intra-prediction mode by analyzing the predicted values of the MIP before upsampling, and the transformation set and scan order used when performing LFNST are selected based on the mapped traditional intra-prediction mode.
[0109] Exemplary, one feasible approach is to use the Sobel operator to calculate the horizontal and vertical slopes of the final predicted MIP. Equation (3) for the Sobel operator is shown below, where G x This is used to calculate the horizontal slope, G y This is used to calculate the vertical slope.
[0110]
number
[0111] First, let's introduce the settings and concepts of the following parameters.
[0112] The sample points for the predicted values in MIP mode are p[x][y], where x=0…nTbW-1 and y=0…nTbH-1, where nTbW represents the current width of the MIP transformation block and nTbH represents the current height of the MIP transformation block.
[0113] The decoder obtains the traditional intra-predictive mode IntraPredModeD (i.e., the second type of intra-predictive mode), where IntraPredModeD is in the range [0, 66].
[0114] Several rules need to be set, as follows:
[0115] Set mapHgV={{2,1},{1,2}} and mapVgH={{3,4},{4,3}}, that is, divide the horizontal and vertical directions into four partitions each.
[0116] Set angTable={0,2048,4096,6144,8192,12288,16384,20480,24576,28672,32768,36864,40960,47104,53248,59392,65536} and set 16 modes corresponding to different angle offset amounts. Here, the index corresponding to each value in angTable is
[0117] That is the case.
[0118] Set angOffset={18,18,50,50}.
[0119] Set up so that the [0,66] corresponding to HoG
[67] is an array containing the gradient strengths of the intra-prediction modes for each tradition. At the start of this process, all HOG array values are initialized to 0.
[0120] For each predicted pixel p[x][y], with x=1…nTbW-2 and y=1…nTbH-2, the calculation process is as follows.
[0121] Calculate the horizontal gradient gHor[x][y]=p[x-1][y-1]+2.p[x-1][y]+p[x-1][y+1]-p[x+1][y-1]-2.p[x+1][y]-p[x+1][y+1].
[0122] Calculate the vertical gradient gVer[x][y]=p[x-1][y-1]+2.p[x][y-1]+p[x+1][y-1]-p[x-1][y+1]-2.p[x][y+1]-p[x+1][y+1].
[0123] The gradient strength iAmp[x][y] = abs(gHor[x][y]) + abs(gVer[x][y]) is calculated.
[0124] Calculate the horizontal region index signH[x][y] = gHor[x][y] < 0 ? 1 : 0.
[0125] Calculate the vertical region index signV[x][y] = gVer[x][y] < 0 ? 1 : 0.
[0126] Calculate the gradient strength index HgV[x][y]=(abs(gHor[x][y])>abs(gVer[x][y])?1:0).
[0127] The mode partition region[x][y]=(HgV[x][y]==1?mapHgV[signH[x][y]][signV[x][y]]:mapVgH[signH[x][y]][signV[x][y]]) is determined by calculation, that is, the mode partition of a sample point is determined based on the horizontal region index, vertical region index, and gradient intensity index of the sample point.
[0128] The gradient offset ratio grad[x][y]=(HgV[x][y]==1?abs(gVer[x][y]) / abs(gHor[x][y]):abs((gHor[x][y] / gVer[x][y]))) is calculated, that is, the gradient offset ratio of the sample point is determined based on the gradient direction corresponding to the sample point.
[0129] Calculate grad[x][y]=round(grad[x][y]*(1<<16)) and calculate the offset amount of the intra prediction mode index angIdx[x][y]=argmin iThe formula (abs(angTable[i]-grad[x][y])) is calculated, that is, the gradient offset ratio of the sample points is mapped to a predetermined mode offset range to obtain the offset amount of the intra-predicted mode index of the sample points.
[0130] The index ipm[x][y] = angOffset[region[x][y]] (which can take values of 18 or 50) + angIdx[x][y] for the second type intra-prediction mode is calculated. In other words, based on the fourth mapping table of pre-configured mode partitions and mode indices, the target second type intra-prediction mode (angOffset[region[x][y]]) corresponding to the mode partition of the sample point is determined, and the second index (ipm[x][y]) for the second type intra-prediction mode of the sample point is determined by combining the target second type intra-prediction mode and the offset amount of the intra-prediction mode index.
[0131] Set HOG[ipm[x][y]] = HOG[ipm[x][y]] (cumulative weight value) + iAmp[x][y] (set value).
[0132] In this way, a second type of intra-prediction mode corresponding to each sample point, and a second index HOG[ipm[x][y]] of the second type of intra-prediction mode are obtained.
[0133] In some embodiments of this application, for step S202, the decoder determines the first index of the second type of intra-prediction mode for the current block based on the index set of the second type of intra-prediction mode for the first predicted value. The decoder includes setting the first index of the second type of intra prediction mode of the current block to the second index of the second type of prediction mode corresponding to the largest cumulative weight value within the index set of the second type of intra prediction mode of the first prediction value. Or, the decoder includes setting the first index of the second type of intra prediction mode of the current block to the second index of the second type of prediction mode corresponding to the smallest cumulative weight value within the index set of the second type of intra prediction mode of the first prediction value, and the embodiments of the present application are not limited thereto.
[0134] Note that after the decoder obtains the index set of the second type of intra prediction mode of the first prediction value by some or all of the sample points of the first prediction value, the decoder determines the second index of the second type of prediction mode corresponding to the largest cumulative weight value within the index set of the second type of intra prediction mode of the first prediction value as the first index of the second type of intra prediction mode of the current block.
[0135] Exemplarily, set the traditional intra prediction mode of IntraPredModeD to argmax i (HoG[i]).
[0136] Here, argmax i (L[i]), i = 0, …, N returns the index between 0 and N that maximizes L (if there are multiple maximum values, returns the smaller index).
[0137] argmin i (L[i]), i = 0, …, N returns the index between 0 and N that minimizes L (if there are multiple minimum values, returns the smaller index).
[0138] Finally, map predModeIntra to IntraPredModeD.
[0139] If all HOGs are at zero magnitude, the value of predModeIntra will be updated to the index number indicating PLANAR mode.
[0140] In some embodiments of this application, the decoder can further determine a second type of intra-prediction value for the current block based on a candidate second type of intra-prediction mode, the candidate second type of intra-prediction mode includes one or more of planar mode, DC mode, and angular intra-prediction modes. Based on the first intra-prediction value and the second type of intra-prediction value, a first index of the second type of intra-prediction mode for the current block is determined.
[0141] For example, the decoder calculates the difference between the predicted value in MIP mode and the predicted value in traditional intra-prediction mode, selects the traditional intra-prediction mode whose predicted value is closest to the predicted value in MIP mode, and then selects the transformation set and scan order to be used when performing LFNST based on the selected intra-prediction mode.
[0142] In some embodiments of this application, the decoder determines a first prediction error between a first intra-predicted value and a second type of intra-predicted value, and determines an index value corresponding to a candidate second type of intra-predicted mode when the first prediction error satisfies a first predetermined condition as the first index of the second type of intra-predicted mode in the current block.
[0143] The decoder's determination of the first prediction error between the first type of intra-predicted value and the second type of intra-predicted value includes the following two methods:
[0144] As a first method, the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value is determined based on the first error rule.
[0145] Here, the first error rule is one of the sum of absolute differences (SAD), the sum of squared errors (SSD), the mean absolute error (MAD), and the mean squared error (MSE), and the first predetermined condition is that the first prediction error reaches its minimum value.
[0146] As a second method, the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value is determined based on the second error rule.
[0147] Here, the second error rule is one of the signal-to-noise ratio (SNR) and the peak signal-to-noise ratio (PSNR), and the first predetermined condition is that the first prediction error reaches its maximum value.
[0148] In some embodiments of this application, the decoder determining a first transformation parameter of the current block based on a first type of intra-predictive mode parameter of the current block may include determining a first index of a second type of intra-predictive mode of the current block based on the first type of intra-predictive mode parameter, and determining a first transformation parameter of the current block based on the first index of the second type of intra-predictive mode.
[0149] In embodiments of this application, the method by which the decoder determines the first index of the second type of intra-prediction mode of the current block based on the first type of intra-prediction mode parameters includes the following two methods:
[0150] Regarding Method 1 The decoder determines the first index of the second type intra-prediction mode for the current block based on a first predetermined mapping relationship between the first type intra-prediction mode parameters and the second type intra-prediction mode index.
[0151] Here, the first type intra-prediction mode parameter includes the first type intra-prediction mode index, the first predetermined mapping relationship represents the correspondence between the first type intra-prediction mode index and the second type intra-prediction mode index, and the decoder determines the first index of the second type intra-prediction mode from the first predetermined mapping relationship based on the first type intra-prediction mode index.
[0152] Regarding Method 2 The decoder determines the first index of the second type intra-prediction mode for the current block based on the weighted matrix of the first type intra-prediction mode, which is indicated by the first type intra-prediction mode parameter.
[0153] In some embodiments of this application, the decoder determines the gradient parameter of the weighting matrix of a first type of intra-prediction mode and determines the first index of the second type of intra-prediction mode for the current block based on the gradient parameter of the weighting matrix of the first type of intra-prediction mode.
[0154] Exemplary, by analyzing the weighted matrix of MIP, we map the MIP prediction mode to the traditional intra-prediction mode and select the transformation set and scan order to be used when performing LFNST based on the mapped traditional intra-prediction mode.
[0155] In some embodiments of this application, in step S2, the decoder determines the first transformation parameter of the current block based on the first index of the second type of intra-prediction mode. This includes performing a wide-angle mapping on the first index of the second type of intra-prediction mode to determine the wide-angle prediction mode index, and determining the first transformation parameter based on the wide-angle prediction mode index.
[0156] The decoder, for transformation blocks using the first type of intra-prediction mode, analyzes the first predicted value of the first type of intra-prediction mode to map the first type of intra-prediction mode to the traditional intra-prediction mode (the second type of intra-prediction mode). It then performs a wide-angle mapping on the mapped traditional prediction mode and selects a transformation set (transformation matrix) and scan order based on the wide-angle mapped traditional prediction mode (i.e., the determined first transformation parameter).
[0157] For example, for a transformation block that uses the MIP prediction mode, the MIP mode is mapped to a traditional intra-prediction mode by analyzing the predicted values of the MIP mode, a wide-angle mapping is performed on the mapped traditional prediction mode, and a transformation set (transformation matrix) and scan order are selected based on the wide-angle mapped traditional prediction mode.
[0158] In the embodiments described in this application, the use of MIP mode and LFNST technology is explained as an example, and this application is also suitable for scenarios using extended LFNST technology.
[0159] Not all current blocks can perform LFNST. LFNST can only be performed on a current block if it satisfies the following conditions simultaneously: (a) both the width and height of the current block are 4 or greater; (b) both the width and height of the current block are less than or equal to the maximum size of the transform block; (c) the prediction mode of the current block or the coding block in which the current block is located is intra-prediction mode; (d) the linear transformation of the current block is a two-dimensional positive linear transformation (DCT2) in both the horizontal and vertical directions; and (e) the intra-prediction mode of the current block or the coding block in which the current block is located is non-MIP mode, or the prediction mode of the transform block is MIP mode and both the width and height of the transform block are 16 or greater. In other words, the current block in the embodiment of this application must satisfy all five of the above conditions simultaneously.
[0160] Furthermore, if it is determined that the current block can perform LFNST, it is also necessary to determine which LFNST translation kernel (which can be represented as kernel) will be used for the current block. Here, there are a total of four candidate translation kernel sets for LFNST, and these four candidate translation kernel sets may include set0, set1, set2, and set3. Here, the selected candidate translation kernel set can be implicitly derived based on the coding parameters of the current block or the coding block in which the current block resides. For example, in the current H.266 / VVC, it can be determined which of the four candidate translation kernel sets to use based on the intra-prediction mode of the current block.
[0161] In the embodiment of this application, after obtaining the current block's intra prediction mode, the initial value of the intra prediction mode (which can be represented by predModeIntra) can be determined, and the calculation formula is as follows:
[0162] predModeIntra=(cIdx==0)?IntraPredModeY[xTbY][yTbY] :IntraPredModeC[xTbY][yTbY] (4) Here, the image component indicator (which can be represented by cIdx) is used to indicate the luminance or chroma component of the current block, where cIdx is equal to 0 when predicting the luminance component of the current block, and cIdx is equal to 1 when predicting the chroma component of the current block. Also, (xTbY, yTbY) are the coordinates of the sample point at the upper left corner of the current block, IntraPredModeY[xTbY][yTbY] is the intra-prediction mode for the luminance component, and IntraPredModeC[xTbY][yTbY] is the intra-prediction mode for the chroma component.
[0163] The LFNST index number can be used to indicate whether or not to use LFNST for the current block, and to specify the index number of the LFNST conversion kernel in the LFNST conversion kernel candidate set. Specifically, after the LFNST index number is parsed, if its value is equal to 0, it means that LFNST will not be used for the current block. If its value is greater than 0, it means that LFNST will be used for the current block, and the index number of the conversion kernel is equal to the value of the LFNST index number, or the value obtained by subtracting 1 from the value of the LFNST index number.
[0164] Furthermore, it should be explained that on the decoder side, the input data for LFNST may include the luminance position of the current transformation block (xTbY, yTbY), the width of the current block nTbW, the height of the current block nTbH, whether the current block is a luminance component or a chroma component cIdx, and the inversely quantized (scaling) coefficients d[x][y] (x=0,1,…,nTbW-1, y=0,1,…,nTbH-1) of the current transformation block, and the output data for LFNST may include the linear transformation coefficients d'[x][y] (x=0,1,…,nLfnstSize-1, y=0,1,…,nLfnstSize-1) generated by performing LFNST on the quadratic transformation coefficients.
[0165] In H.266 / VVC, intra-prediction modes can be further divided into traditional intra-prediction modes and non-traditional intra-prediction modes. For non-traditional intra-prediction modes, the value of predModeIntra indicates the following information.
[0166] If the current prediction mode for a block is CCLM mode, the value of predModeIntra may be INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM (81, 82, and 83 respectively for VVC).
[0167] If the current prediction mode for a block is MIP mode, the value of predModeIntra may be the MIP mode index number being used.
[0168] If the current block prediction mode is the traditional intra prediction mode, the value of predModeIntra may be in the range of [0, 66].
[0169] Furthermore, if the current block prediction mode is CCLM mode or MIP mode, the value of predModeIntra can be set using the following method.
[0170] (1) If the current block prediction mode is CCLM mode, If the mode of the central luminance block at the luminance position corresponding to the current block (e.g., chroma block) is MIP mode, i.e., intra_mip_flag[xTbY+nTbW / 2][yTbY+nTbH / 2] is 1, then the value of predMode Intra is set to the index number indicating PLANAR mode (i.e., 0).
[0171] Otherwise, if the mode of the central luminance block at the luminance position corresponding to the current block (e.g., chroma block) is IBC (Intra Block Copy) mode or Palette mode, set the value of predModeIntra to the index number indicating DC mode (i.e., 1).
[0172] Otherwise, the value of predModeIntra is set to IntraPredModeY[xTbY+nTbW / 2][yTbY+nTbH / 2], which is the mode index number of the central luminance block at the luminance position corresponding to the current block (e.g., a chroma block).
[0173] (2) If the current block prediction mode is MIP mode, If intra_mip_flag[xTbY][yTbY] is 1 and cIdx is 0, it indicates that the current prediction mode of the transformation block is MIP mode. In this case, the predicted value of MIP mode is analyzed, the traditional intra prediction mode is derived based on the predicted value of MIP mode, and predModeIntra is mapped to that traditional intra prediction mode.
[0174] Regarding the traditional intra-prediction mode, we can now perform wide-angle mapping based on the current block size and extend the traditional intra-prediction mode [0,66] to [-14,80], and the mapping process is as follows:
[0175] First, calculate the proportionality factor (which can be expressed as whRatio) between width and height, as shown below.
[0176] whRatio=Abs(Log2(nTbW / nTbH)) (5) For non-square current blocks (where nTbW and nTbH are different), the following modifications can be made to predModeIntra: if nTbW is greater than nTbH, predModeIntra is 2 or greater, and predModeIntra is less than ((whRatio>1?(8+2×whRatio):8) then predModeIntra=(predModeIntra+65); conversely, if nTbW is less than nTbH, predModeIntra is 66 or less, and predModeIntra is greater than ((whRatio>1?(60-2×whRatio):60) then predModeIntra=(predModeIntra-67).
[0177] It can be understood that when performing an LFNST transformation on a current block employing a first type intra-prediction mode (e.g., MIP), the introduction of the first predicted value or first type intra-prediction mode parameter for the current block makes the selection of the transformation kernel or transformation matrix (corresponding to the second transformation parameter) more flexible in the transformation technique. This not only improves the applicability to non-traditional intra-prediction modes (first type intra-prediction modes) but also improves decoding efficiency while simultaneously improving video image quality.
[0178] In step S104, a second transformation parameter for transforming the current block is determined based on the first transformation parameter.
[0179] In the embodiment of this application, the decoder can determine a second transformation parameter corresponding to a first transformation parameter based on a first mapping table between a preset first transformation parameter and a second transformation parameter.
[0180] Here, the second transformation parameter includes at least one of the following: a transformation kernel index parameter (pointing to the transformation coefficient matrix index) and a scan order parameter of the transformation parameter, where the transformation kernel index parameter indicates the transformation kernel used in the process of decoding the transformation parameter of the current block, and the scan order parameter indicates the scan order of the transformation parameter, which includes horizontal and vertical order.
[0181] The transformation kernel index parameter refers to the transformation coefficient matrix index and may be obtained directly from the bitstream, or, after the transformation set (i.e., the transformation kernel candidate set) is determined on the decoding side, the index number of the transformation kernel in the transformation kernel candidate set may be obtained from the bitstream.
[0182] In the embodiments described in this application, the use of MIP mode and LFNST technology is explained as an example, and this application is also suitable for scenarios using extended LFNST technology.
[0183] In the current H.266 / VVC, the value of the LFNST index number (which can be represented by SetIdx) can be determined based on the value of predModeIntra and Table 1 (the first mapping table), and the specific values are shown in Table 1. Here, the value of the LFNST index number is set to indicate that LFNST is used in the current block and to point to the index number of the LFNST translation kernel in the LFNST translation kernel candidate set. Generally, an LFNST translation set contains four translation kernel candidate sets (set0, set1, set2, set3), corresponding to SetIdx values of 0, 1, 2, and 3, respectively.
[0184] [Table 1]
[0185] In the embodiments of this application, a set of candidate LFNST transformation kernels can be determined based on MIP parameters or first predicted values. Then, LFNST index numbers can be obtained from the bitstream, and based on the LFNST index numbers, the LFNST transformation kernel to be used for the current block can be determined from the set of candidate LFNST transformation kernels. Here, the LFNST transformation matrix is a set of fixed-coefficient matrices obtained through training, and the set of candidate LFNST transformation kernels includes two sets of transformation matrices (which may also be called LFNST transformation kernels). After determining the set of candidate LFNST transformation kernels, it is necessary to select one set of LFNST transformation kernels from the set of candidate LFNST transformation kernels, that is, it is necessary to determine the transformation matrix to be used when performing LFNST on the current block.
[0186] In the extended LFNST, the number of candidate LFNST transformation kernel sets is much larger, and each candidate LFNST transformation kernel set contains three transformation matrices, which will not be explained in detail here.
[0187] Here, if we select the LFNST transformation kernel from the first set of candidate LFNST transformation kernels (i.e., the transformation matrix from the first set), we set lfnst_idx to 1, and if we select the LFNST transformation kernel from the second set of candidate LFNST transformation kernels (i.e., the transformation matrix from the second set), we set lfnst_idx to 2.
[0188] After determining the MIP mode index, the MIP mode index number can be converted to the LFNST intra prediction mode index number, i.e., the value of the first index of the second type of intra prediction mode (which can be represented by predModeIntra). Then, based on the value of predModeIntra, one LFNST conversion kernel candidate set is selected from multiple LFNST conversion kernel candidate sets to determine the conversion kernel candidate set. From the selected LFNST conversion kernel candidate set, the conversion kernel indicated by the LFNST index number is selected and set as the LFNST conversion kernel used for the current block.
[0189] Here, regarding the value of the LFNST index number, if the value of the LFNST index number is equal to 0, LFNST is not used; if the value of the LFNST index number is greater than 0, LFNST is used, and the index number of the translation kernel is equal to the value of the LFNST index number, or the value obtained by subtracting 1 from the value of the LFNST index number.
[0190] In step S105, a transformation process is performed on the transformation coefficient of the current block based on the second transformation parameter, and the residual value of the current block is determined.
[0191] In step S106, the reconstruction value of the current block is determined based on the residual difference value and the first predicted value.
[0192] In the embodiments of this application, the transformation coefficients include quantization coefficients.
[0193] In the embodiment of this application, the decoder performs inverse quantization on the quantization coefficients to obtain a first transformation coefficient, transforms the first transformation coefficient to obtain a first transformation coefficient vector, adopts the transformation matrix shown in the transformation kernel index parameter to transform the first transformation coefficient vector to obtain a second transformation coefficient vector, adopts the scan order parameter of the transformation parameter to transform the second transformation coefficient vector to obtain a second transformation coefficient, The second transformation coefficient is subjected to an inverse transformation to obtain the residual value of the current block. After obtaining the residual value and the first predicted value, the decoder can determine the reconstructed value of the current block based on the residual value and the first predicted value.
[0194] For example, after determining the LFNST transformation kernel, we can obtain the transformation matrix selected for the current block, in which case we can perform the transformation on the predicted difference values.
[0195] Here, the transformation matrix for each set may further include two elementary transformation matrices T of sizes such as 16x16 and 16x48. For the transformation matrix selected by the four sizes of TU, specifically, for a 4x4 size TU, an 8x16 transformation matrix is used, which is derived from the previous 8x16 elementary transformation matrix of the 16x16 elementary transformation matrix; for a 4xN or Nx4 (N>4) size TU, a 16x16 elementary transformation matrix is used; for an 8x8 size TU, an 8x48 transformation matrix is used, which is derived from the previous 8x48 elementary transformation matrix of the 16x48 elementary transformation matrix; and for a TU larger than 8x8, a 16x48 elementary transformation matrix is used. It should be noted that in the current H.266 / VVC, the LFNST transformation matrix (T) on the decoder side is used. TOnly the one that can be represented by ) is stored, and the transformation matrix used on the encoder side is the transposed matrix (which can be represented by T) of the transformation matrix of LFNST.
[0196] Furthermore, it should be noted that LFNST applies non-separable transformation by means of direct matrix multiplication. In order to reduce the computational complexity and memory capacity as much as possible, a simplified non-separable transformation technique is used in LFNST transformation. Here, the main idea of the simplified non-separable transformation technique is to map an N-dimensional vector to an R-dimensional vector in a different space. Here, N / R (R < N) is the scaling factor. In this case, the transformation matrix corresponding to the simplified non-separable transformation technique is an R×N matrix as shown below.
[0197] [Number] Here, the transformation matrices used for the forward LFNST transformation and the reverse LFNST transformation have a transposed relationship with each other. Referring to FIG. 5, a schematic diagram of the structure of the matrix multiplication calculation process of the LFNST technology according to the embodiment of the present application is shown. As shown in FIG. 5, (a) shows the calculation process of the forward LFNST transformation. After the primary transformation coefficient passes through the transformation matrix T, the secondary transformation coefficient can be obtained. (b) shows the calculation process of the reverse LFNST transformation. After the reverse secondary transformation coefficient passes through the transposed transformation matrix T T the reverse primary transformation coefficient can be obtained.
[0198] Furthermore, with the LFNST technique, we can now decide whether to use a 4x4 inseparable transformation or an 8x8 inseparable transformation based on the current block size, where we can call the "4x4 inseparable transformation" "4x4 LFNST" and the "8x8 inseparable transformation" "8x8 LFNST". Assuming the current block width is nTbW and height is nTbH, we can determine that if min(nTbW,nTbH)<=4, we use a 4x4 LFNST for the current block, and otherwise we use an 8x8 LFNST for the current block. It should be noted that the return value of min(A,B) is the smaller of A and B.
[0199] In one embodiment, for a 4x4 LFNST, the encoder side takes 16 coefficients as input, passes them through the positive LFNST, and outputs 16 or 8 coefficients, while the decoder side takes 16 or 8 coefficients as input and outputs 16 coefficients; in other words, the number of inputs and outputs for the encoder and decoder are inversely related.
[0200] We assume that the size of the transform unit (TU) can be expressed as nTbW × nTbH, where the transform unit is the predicted residual unit obtained based on the predicted difference value. In other words, the TU may be equal to 4 × 4, or equal to 4 × N or N × 4 (N > 4). The above case will be explained in detail below.
[0201] When TU is equal to 4×4, the forward LFNST process corresponding to a 4×4 transformation block is as shown in Figure 6A. Here, in Figure 6A, the white blocks are predicted difference values, the gray blocks are linear transformation coefficients, and the black blocks are quadratic transformation coefficients. In the example shown at the position "0", the encoder sets the transformation coefficient to 0. For a 4×4 transformation block, the size of the transformation matrix used during forward LFNST is 8×16, and all 4×4 linear transformation coefficients in the current transformation block become inputs, while 4×2 quadratic transformation coefficients are output.
[0202] When TU is equal to 4×N or N×4 (N>4), the forward LFNST process corresponding to a 4×N or N×4 transformation block is as shown in Figure 6B. Here, in Figure 6B, the white blocks are predicted difference values, the gray blocks are linear transformation coefficients, and the black blocks are quadratic transformation coefficients. Here, for a 4×N or N×4 transformation block, the size of the transformation matrix used in the forward LFNST is 16×16, taking the linear transformation coefficient in the first 4×4 subblock in the current transformation block (specifically, the topmost subblock for a 4×N transformation block and the leftmost subblock for an N×4 transformation block) as input and outputting 4×4 quadratic transformation coefficients. Here, in the example shown at position "0", the encoder still sets the transformation coefficient to 0.
[0203] In another embodiment, for an 8x8 LFNST, the encoder side takes 48 coefficients as input and outputs 16 or 8 coefficients through the positive LFNST, while the decoder side takes 16 or 8 coefficients as input and outputs 48 coefficients; in other words, the number of inputs and outputs for the encoder and decoder are inversely related.
[0204] When TU is equal to 8×8, the forward LFNST process corresponding to an 8×8 transformation block is as shown in Figure 6C. Here, in Figure 6C, the white blocks are predicted difference values, the gray blocks are linear transformation coefficients, and the black blocks are quadratic transformation coefficients. For an 8×8 transformation block, the size of the transformation matrix used in the forward LFNST is 8×48, taking the linear transformation coefficients of the first three 4×4 subblocks in the current transformation block (i.e., the three subblocks located in the upper left corner) as input and outputting 4×2 quadratic transformation coefficients. Here, in the example shown at the position "0", the encoder still sets the transformation coefficient to 0.
[0205] If TU is greater than 8×8, the forward LFNST process corresponding to a transformation block larger than 8×8 is as shown in Figure 6D. Here, in Figure 6D, the white blocks are predicted difference values, the gray blocks are linear transformation coefficients, and the black blocks are quadratic transformation coefficients. For transformation blocks larger than 8×8, the size of the transformation matrix used in the forward LFNST is 48×16, taking the linear transformation coefficients of the first three 4×4 subblocks in the current transformation block (i.e., the three subblocks located in the upper left corner) as input and outputting 4×4 quadratic transformation coefficients. Here, in the example shown at the position "0", the encoder still sets the transformation coefficient to 0.
[0206] In this way, even when the TU corresponding to the predicted difference value is 4x4 size, or 4xN or Nx4 (N>4) size, or 8x8 size, or even larger than 8x8 size, the conversion process for the predicted difference value can be implemented according to Figure 6A, Figure 6B, Figure 6C, or Figure 6D.
[0207] After selecting a candidate set of LFNST transformation kernels, the bitstream is analyzed to obtain the LFNST index number (lfnst_idx). Based on the value of lfnst_idx, the transformation matrix (transformation kernel) indicated by lfnst_idx can be selected from the candidate set of LFNST transformation kernels. For example, if lfnst_idx is 1, the first set of transformation matrices can be used as the LFNST transformation kernel in the decoding process, and if lfnst_idx is 2, the second set of transformation matrices can be used as the LFNST transformation kernel in the decoding process.
[0208] Furthermore, each set of transformation matrices (transformation kernels) contains two sizes of elementary transformation matrices, with the sizes used by the decoder being 16x16 and 48x16. The selection is based on nLfnstOutSzie; if nLfnstOutSzie is 16, the 16x16 elementary transformation matrix is selected, or if nLfnstOutSzie is 48, the 48x16 elementary transformation matrix is selected. Alternatively, if nonZeroSize is 8, only the first 8 rows of the transformation matrix are used for matrix multiplication calculations.
[0209] Furthermore, the quadratic transformation coefficient vector u[i] is taken as input and multiplied by the transformation matrix to obtain the linear transformation coefficient vector v[j], where i=0,1,…,nonZeroSize-1 and j=0,1,…,nLfnstOutSzie-1. If the transformation matrix obtained in the above steps is lowFreqTransMatrix, the specific calculation process for v[j] is as follows.
[0210]
number
[0211] CoeffMin = -(1 15) (8) CoeffMax = (1 15) - 1 (9) In this way, the conversion process for the conversion coefficients can be realized through the matrix calculation described above. Here, in the case of 4×4 LFNST, the decoder takes 16 or 8 coefficients as input and outputs 16 coefficients, and in the case of 8×8 LFNST, the decoder takes 16 or 8 coefficients as input and outputs 48 coefficients to realize the LFNST conversion process for the conversion coefficients.
[0212] As shown in Figure 7, the specific process of LFNST can be divided into five steps: configuration of core parameters 81, mapping of intra-prediction modes 82, selection of transformation matrices 83, calculation of matrix multiplication 84, and construction of the linear transformation coefficient matrix 85. Here, regarding the mapping of intra-prediction modes 82, this step is used to determine the value of predModeIntra and may mainly include mapping of non-traditional intra-prediction modes 821 and wide-angle mapping 822. Regarding the selection of transformation matrices 83, this step is used to select transformation sets and transformation matrices and may mainly include selection of transformation sets 831, selection of transformation matrix groups 832, and selection of transformation matrix sizes 833.
[0213] Regarding the configuration of the core parameters 81, it is first necessary to configure the length of the input quadratic transformation coefficient vector for LFNST calculation (which can be expressed as nonZeroSize) and the length of the output linear transformation coefficient vector (which can be expressed as nLfnstOutSzie). Here, the values of nonZeroSize and nLfnstOutSzie are shown in Table 2.
[0214] [Table 2]
[0215] The parameter configuration, including nonZeroSize and nLfnstOutSzie, is calculated using the following formula.
[0216] nLfnstOutSzie=(nTbW>=8&&nTbH>=8)?48:16 (10) nonZeroSize= (nTbW==4&&nTbH==4)||(nTbW==8&&nTbH==8)?8:16 (11) In addition, it is necessary to configure the parameter nLfnstSize, which indicates that in the current block, the linear transformation coefficients exist only within the range of nLfnstSize × nLfnstSize, and the value of nLfnstSize is as follows.
[0217] Log2LfnstSize=(nTbW>=8&&nTbH>=8)?3:2 (12) nLfnstSize=1< <Log2LfnstSize (13) In this case, by analyzing the bitstream, it is possible to obtain the intra-prediction mode of the luminance or chroma component of the current block or the encoded block in which the current block is located, and in this case, the value of predModeIntra can be determined, and the calculation formula is as described above.
[0218] Furthermore, a vector of quadratic transformation coefficients u[i], i=0,1,...,nonZeroSize-1 is obtained. If it is decided to use LFNST for the current transformation block, then the inversely quantized coefficients d[x][y] are the quadratic transformation coefficients. By obtaining the first nonZeroSize values according to the diagonal scan order, the vector of quadratic transformation coefficients u[i], i=0,1,...,nonZeroSize-1 is obtained, and in the following equation, xC and yC represent the horizontal and vertical coordinates of the top-left corner point in the current block where the coefficient of x is located, according to the diagonal order, and xC and yC are as shown below.
[0219] xC=DiagScanOrder[2][2][x][0] (14) yC=DiagScanOrder[2][2][x][1] (15) u[i]=d[xC][yC] (16) In the embodiments of this application, the applicability of LFNST technology to current blocks using MIP mode can be improved, and the selection of the transformation set (or transformation kernel) can be made more flexible. The characteristics of the MIP prediction values are analyzed, a mapping between MIP and traditional intra prediction modes is established, and in the LFNST process for transformation blocks using MIP, the transformation set (transformation matrix) and scan order are selected based on the mapped traditional prediction modes. This method was tested on ECM4.0 under All Intra conditions at 48-frame intervals, and BD-rate changes of -0.08%, 0.05%, and -0.10% for Y, Cb, and Cr, respectively (i.e., average bitrate change at equivalent psnr), improving decoding efficiency.
[0220] Referring to Figure 8, based on the example application scenario in Figure 2A above, an exemplary flowchart of a video encoding method according to an embodiment of the present application is shown. As shown in Figure 8, the method may include the following steps:
[0221] In step S301, the parameters for the first type of intra-predictive mode are determined.
[0222] A video image can be divided into multiple image blocks, and each image block currently awaiting encoding is also called a coding block (CB). Here, each coding block may contain a first image component, a second image component, and a third image component, and the current block is the coding block in which the prediction of the first, second, or third image component of the video image is currently being performed.
[0223] Here, if we predict the first image component for the current block and assume that the first image component is the luminance component, that is, if we assume that the image component awaiting prediction is the luminance component, then the current block is also called the luminance block. Alternatively, if we predict the second image component for the current block and assume that the second image component is the chroma component, that is, if we assume that the image component awaiting prediction is the chroma component, then the current block is also called the chroma block.
[0224] Furthermore, the measured mode parameters indicate the coding mode of the current block and the parameters associated with that mode. Typically, the predicted mode parameters of the current block can be determined using a method called Rate Distortion Optimization (RDO).
[0225] Specifically, in some embodiments, determining the prediction mode parameters of the current block is Currently, the image components awaiting prediction for the block are determined, Based on the parameters of the current block, prediction and coding are performed on the pending image component using multiple prediction modes, and the rate distortion cost result corresponding to each of the multiple prediction modes is calculated. This may include selecting the minimum rate distortion cost result from a plurality of calculated rate distortion cost results, and determining the prediction mode corresponding to the minimum rate distortion cost result as the prediction mode parameter for the current block.
[0226] In other words, the encoder can encode each awaiting prediction for the current block using various prediction modes. Here, multiple prediction modes typically include traditional intra-prediction modes and non-traditional intra-prediction modes. Traditional intra-prediction modes may further include Direct Current (DC) mode, Planar mode, and Angular mode, while non-traditional intra-prediction modes may further include MIP mode, Cross-component Linear Model Prediction (CCLM) mode, Intra Block Copy (IBC) mode, and PLT (Palette) mode.
[0227] In this way, after encoding the current block using various prediction modes, rate distortion cost results corresponding to each prediction mode can be obtained. Then, the minimum rate distortion cost result is selected from the obtained multiple rate distortion cost results, and the prediction mode corresponding to this minimum rate distortion cost result is determined as the prediction mode parameter. In this way, the current block can finally be encoded using the determined prediction mode, and the prediction residual can be reduced, thereby improving the encoding efficiency.
[0228] In step S302, a first predicted value for the current block is determined based on the first type of intra-prediction mode parameter, and the residual difference value between the original value of the current block and the first predicted value is calculated.
[0229] In step S303, the first transformation parameter of the current block is determined based on the first predicted value or the first type of intra-prediction mode parameter of the current block.
[0230] In step S304, a second transformation parameter for transforming the current block is determined based on the first transformation parameter.
[0231] In step S305, a transformation process is performed on the residual value based on the second transformation parameter to obtain the transformation coefficient for the current block.
[0232] In embodiments of this application, the decoder can determine a first transformation parameter of the current block based on a first predicted value of the current block. The decoder can further determine a first transformation parameter of the current block based on a first type of intra-predicted mode parameter of the current block, and embodiments of this application are not limited thereto.
[0233] In some embodiments of this application, the decoder determining a first transformation parameter of the current block based on a first predicted value of the current block may include the following steps:
[0234] In step S1, the first index of the second type of intra prediction mode for the current block is determined based on the first predicted value of the current block.
[0235] In step S2, the first transformation parameter of the current block is determined based on the first index of the second type of intra prediction mode of the current block.
[0236] In the embodiment of this application, the decoder can determine a first index of a second type of intra-prediction mode using a first predicted value of the current block, where the second type of intra-prediction mode includes at least one of a planar mode, a DC mode, and an angular intra-prediction mode. The decoder can then determine a first transformation parameter of the current block based on the first index of the second type of intra-prediction mode of the current block.
[0237] In the embodiments of this application, the first transformation parameter is the basis for determining the second transformation parameter, namely the transformation kernel index parameter (referring to the transformation coefficient matrix index) and the scan order parameter of the transformation parameter.
[0238] In other words, the decoder can map non-traditional intra-prediction modes to traditional intra-prediction modes, thereby using the first index of the traditional intra-prediction mode to determine the first transformation parameter of the current block. This allows the current block to select a second transformation parameter that performs parameter transformation in a non-traditional intra-prediction mode using a flexible method corresponding to the traditional intra-prediction mode, thereby improving the applicability of non-traditional intra-prediction modes (first type intra-prediction modes), improving coding efficiency, and simultaneously improving video image quality.
[0239] In the embodiments of this application, the first predicted value may be the final predicted value obtained by performing intraprediction using the first type of intraprediction mode, or it may be an intermediate predicted value in the process of performing intraprediction using the first type of intraprediction mode.
[0240] For example, for an MIP mode, the first predicted value may be the upsampled final predicted value in the MIP prediction, or it may be the intermediate predicted value before upsampling in the MIP prediction, and the embodiments of this application are not limited to these.
[0241] In some embodiments of this application, the decoder can set the first transformation parameter of the current block to be equal to the first index of the second type of intra-prediction mode of the current block.
[0242] In some embodiments of this application, the realization of S1 includes the following steps: In step S201, an index set of a second type of intra-prediction mode of the first predictive value is determined based on the first predictive value.
[0243] In step S202, the first index of the second type intra-prediction mode for the current block is determined based on the index set of the second type intra-prediction mode for the first predicted value, where the index set of the second type intra-prediction mode stores cumulative weight values corresponding to some or all of the tolerance values of the index of the second type intra-prediction mode.
[0244] In some embodiments of this application, for some or all of the first predicted values, the horizontal and vertical gradient values of the sample points corresponding to some or all of the predicted values are determined, and based on the horizontal and vertical gradient values of the sample points, an index set of a second type of intra-prediction mode for the first predicted values is determined.
[0245] The encoder determines an index set of a second type of intra-prediction mode for the first predicted value based on the horizontal and vertical gradient values of the sample point, which includes (1) and (2).
[0246] (1) Based on the horizontal and vertical gradient values of the sample point, the gradient angle value of the sample point is determined; based on the gradient angle value of the sample point, the second index of the second type intra prediction mode corresponding to the gradient angle value is determined; and the cumulative weight value corresponding to the determined second index of the second type intra prediction mode in the index set of the second type intra prediction mode is updated.
[0247] In some embodiments of this application, determining the gradient angle value of a sample point based on the horizontal and vertical gradient values of the sample point includes determining the gradient angle value of the sample point based on the horizontal and vertical gradient values of the sample point and a predetermined functional relationship. The predetermined functional relationship is an arctangent function, where the arctangent function is the ratio of the horizontal gradient value to the vertical gradient value of the sample point.
[0248] In some embodiments of this application, determining the gradient angle value of a sample point based on the horizontal gradient value and vertical gradient value of the sample point and a predetermined functional relationship includes determining the gradient angle value of the sample point by processing the ratio of the horizontal gradient value and vertical gradient value of the sample point based on an arctangent function.
[0249] Here, the pre-defined functional relationship is a second mapping table between the gradient angle value of the sample point and the horizontal and vertical gradient values of the sample point.
[0250] In some embodiments of this application, determining the gradient angle value of a sample point based on the horizontal gradient value and vertical gradient value of the sample point and a preset functional relationship includes inputting the ratio of the horizontal gradient value and vertical gradient value of the sample point, or the ratio of the horizontal gradient value and vertical gradient value of the sample point, into a second mapping table and outputting the gradient angle value of the sample point.
[0251] In some embodiments of this application, determining a second index of a second type of intra-prediction mode corresponding to a gradient angle value based on the gradient angle value of a sample point includes determining a second type of intra-prediction mode index value corresponding to the angular intra-prediction direction in which the angle between the angular intra-prediction direction shown in some or all of the tolerance values of the index of the second type of intra-prediction mode is smallest, and setting the second index of the second type of intra-prediction mode of the gradient angle value to the second type of intra-prediction mode index value.
[0252] Alternatively, the method includes determining a second index of the second type of intra-prediction mode corresponding to a gradient angle value, based on a third mapping table between a preset gradient angle value and a second type of intra-prediction mode index.
[0253] The third mapping table shows the correspondence between gradient angle values that are different values or within different value ranges and the second type of intra-prediction mode index.
[0254] (2) The encoder determines the gradient direction, first gradient intensity, and mode partition corresponding to the sample point based on the horizontal gradient value and vertical gradient value of the sample point, determines the second index of the second type intra-prediction mode based on the gradient direction, first gradient intensity, and mode partition corresponding to the sample point, and updates the cumulative weight value corresponding to the determined second index of the second type intra-prediction mode in the index set of the second type intra-prediction mode.
[0255] In some embodiments of the present application, determining the gradient direction, the first gradient strength, and the mode partition corresponding to a sample point based on the horizontal gradient value and the vertical gradient value of the sample point includes determining the first gradient strength of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, performing partition processing on the second type of intra prediction mode for the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, determining the horizontal region index, the vertical region index, and the gradient strength index of the sample point, determining the mode partition of the sample point based on the horizontal region index, the vertical region index, and the gradient strength index of the sample point, and determining the gradient direction corresponding to the sample point based on the gradient strength index of the sample point.
[0256] In some embodiments of the present application, determining the second index of the second type of intra prediction mode based on the gradient direction, the first gradient strength, and the mode partition corresponding to a sample point includes determining the gradient offset ratio of the sample point based on the gradient direction corresponding to the sample point, mapping the gradient offset ratio of the sample point within a preset mode offset range to obtain the offset amount of the intra prediction mode index of the sample point, determining the target second type of intra prediction mode corresponding to the mode partition of the sample point based on a fourth mapping table of the preset mode partition and the mode index, and combining the target second type of intra prediction mode and the offset amount of the intra prediction mode index to determine the second index of the second type of intra prediction mode of the sample point.
[0257] In some embodiments of the present application, updating the cumulative weight value corresponding to the second index of the determined second type of intra prediction mode within the index set of the second type of intra prediction mode includes adding a set value to the cumulative weight value corresponding to the second index of the determined second type of intra prediction mode within the index set of the second type of intra prediction mode.
[0258] Here, the set value is equal to 1, or the set value is equal to the sum of the absolute value of the horizontal gradient value and the absolute value of the vertical gradient value.
[0259] In some embodiments of the present application, determining the first index of the second type of intra prediction mode of the current block based on the index set of the second type of intra prediction mode of the first prediction value includes setting the first index of the second type of intra prediction mode of the current block to the second index of the second type of prediction mode corresponding to the largest cumulative weight value within the index set of the second type of intra prediction mode of the first prediction value.
[0260] In some embodiments of the present application, determining the first index of the second type of intra prediction mode of the current block based on the first prediction value of the current block includes determining the second type of intra prediction value of the current block based on the candidate second type of intra prediction mode, and determining the first index of the second type of intra prediction mode of the current block based on the first intra prediction value and the second type of intra prediction value.
[0261] Here, the candidate second type of intra prediction mode includes one or more of a planar mode, a DC mode, and an angular intra prediction mode.
[0262] In some embodiments of this application, a first prediction error is determined between a first intra-predicted value and a second type intra-predicted value, and when the first prediction error satisfies a first predetermined condition, an index value corresponding to a candidate second type intra-predicted mode is determined as the first index of the second type intra-predicted mode in the current block.
[0263] The methods for determining the first predicted difference value include the following two:
[0264] As a first method, the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value is determined based on the first error rule.
[0265] Here, the first error rule is one of the sum of absolute differences (SAD), the sum of squared errors (SSD), the mean absolute error (MAD), and the mean squared error (MSE), and the first predetermined condition is that the first prediction error reaches its minimum value.
[0266] As a second method, the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value is determined based on the second error rule.
[0267] Here, the second error rule is one of the signal-to-noise ratio (SNR) and the peak signal-to-noise ratio (PSNR), and the first predetermined condition is that the first prediction error reaches its maximum value.
[0268] In some embodiments of this application, the decoder determining a first transformation parameter of the current block based on a first type of intra-predictive mode parameter of the current block may include determining a first index of a second type of intra-predictive mode of the current block based on the first type of intra-predictive mode parameter, and determining a first transformation parameter of the current block based on the first index of the second type of intra-predictive mode.
[0269] In some embodiments of this application, determining the first index of the second type of intra-prediction mode of the current block based on the first type of intra-prediction mode parameters includes the following two methods: Method 1 The encoder determines the first index of the second type intra-prediction mode for the current block based on a first predetermined mapping relationship between the first type intra-prediction mode parameter and the second type intra-prediction mode index.
[0270] The first type of intra-prediction mode parameter includes the first type of intra-prediction mode index, and the first predetermined mapping relationship represents the correspondence between the first type of intra-prediction mode index and the second type of intra-prediction mode index. In some embodiments of this application, the encoder determining a first index of a second type intra-predictive mode in the current block based on a first predetermined mapping relationship between a first type intra-predictive mode parameter and a second type intra-predictive mode index includes determining a first index of a second type intra-predictive mode from the first predetermined mapping relationship based on the first type intra-predictive mode index.
[0271] Method 2 The encoder determines the first index of the second type intra-prediction mode for the current block based on the weighted matrix of the first type intra-prediction mode, which is indicated by the first type intra-prediction mode parameter.
[0272] In some embodiments of this application, the encoder determining a first index of a second type intra-prediction mode in the current block based on a weighted matrix of a first type intra-prediction mode indicated by a first type intra-prediction mode parameter includes determining a gradient parameter of the weighted matrix of the first type intra-prediction mode and determining a first index of a second type intra-prediction mode in the current block based on the gradient parameter of the weighted matrix of the first type intra-prediction mode.
[0273] For step S2, the encoder determining the first transformation parameter of the current block based on the first index of the second type of intra-prediction mode includes performing a wide-angle mapping to the first index of the second type of intra-prediction mode to determine the wide-angle prediction mode index, and determining the first transformation parameter based on the wide-angle prediction mode index.
[0274] In some embodiments of this application, the encoder determines a second transformation parameter for transforming the current block based on a first transformation parameter, which includes determining a second transformation parameter corresponding to a first transformation parameter based on a first mapping table between a preset first transformation parameter and a second transformation parameter.
[0275] Here, the second transformation parameter includes at least one of the following: a transformation kernel index parameter (pointing to the transformation coefficient matrix index) and a scan order parameter of the transformation parameter, where the transformation kernel index parameter indicates the transformation kernel used in the process of decoding the transformation parameter of the current block, and the scan order parameter indicates the scan order of the transformation parameter, which includes horizontal and vertical order.
[0276] In some embodiments of the present application, obtaining the transform coefficient of the current block by performing a transform process on the residual difference value based on the second transform parameter includes: transforming the residual difference value to obtain a second transform coefficient; adopting the scan order parameter of the transform parameter to transform the second transform coefficient to obtain a second transform coefficient vector; adopting the transform matrix indicated by the transform kernel index parameter to transform the second transform coefficient vector to obtain a first transform coefficient vector; transforming the first transform coefficient vector to obtain a first transform coefficient; quantizing the first transform coefficient to obtain the quantization coefficient of the current block, where the quantization coefficient is the transform coefficient of the current block.
[0277] Note that the description and explanation regarding the encoder determining the first index of the second type of intra prediction mode are consistent with those of the decoder and will not be repeated here. The difference is that the prediction mode parameter indicates the encoding mode of the current block and the parameters related to the mode. Usually, the encoder can determine the prediction mode parameter of the current block by using the rate distortion optimization (RDO) method.
[0278] The encoder determines the LFNST transform kernel used for the current block, sets the LFNST index number, and writes it into the video bitstream.
[0279] Furthermore, since the LFNST conversion kernel candidate set includes two or more conversion kernels pre-configured for use in MIP, in this case, the conversion kernel to be used for the current block can be selected using a rate distortion optimization method. Specifically, for each conversion kernel, the rate distortion cost (RDCost) can be calculated using the rate distortion optimization method, and then the conversion kernel with the smallest rate distortion cost can be selected as the conversion kernel to be used for the current block. In other words, the encoder can select a set of LFNST conversion kernels using RDCost, write the index number corresponding to the LFNST conversion kernel (which can be represented by lfnst_idx) to the video bitstream, and transmit it to the decoder.
[0280] It can be understood that when performing an LFNST transformation on a current block employing a first type intra-prediction mode (e.g., MIP), the introduction of the first predicted value or first type intra-prediction mode parameter for the current block makes the selection of the transformation kernel or transformation matrix (corresponding to the second transformation parameter) more flexible in the transformation technique. This not only improves the applicability to non-traditional intra-prediction modes (first type intra-prediction modes) but also improves encoding efficiency while simultaneously improving video image quality.
[0281] Based on the same inventive concept as the above embodiment, Figure 9 shows an exemplary structural diagram of the decoder configuration according to the embodiment of this application. As shown in Figure 9, the decoder 1 is A decoding unit 10 is configured to decode a bitstream and determine the first type of intra-predictive mode parameters of the current block. A first prediction unit 11 is configured to determine a first predicted value for the current block based on the first type of intra prediction mode parameter, A first determination unit 12 is configured to determine a first transformation parameter for the current block based on a first predicted value of the current block or the first type of intra prediction mode parameter, and to determine a second transformation parameter for transforming the current block based on the first transformation parameter. A first conversion unit 13 is configured to perform a conversion process on the conversion coefficient of the current block based on the second conversion parameter and to determine the residual difference value of the current block. The system may include a reconstruction unit 14 configured to determine the reconstruction value of the current block based on the residual difference value and the first predicted value.
[0282] In some embodiments of this application, determining the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter is: Based on the first predicted value of the current block, the first index of the second type of intra prediction mode of the current block is determined, This includes determining a first transformation parameter of the current block based on a first index of the second type of intra prediction mode of the current block.
[0283] In some embodiments of this application, determining the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter is: Based on the first type of intra-prediction mode parameters, the first index of the second type of intra-prediction mode for the current block is determined, This includes determining a first transformation parameter of the current block based on a first index of the second type of intra prediction mode.
[0284] In some embodiments of this application, the second type of intra-prediction mode includes at least one of a planar mode, a DC mode, and an angular intra-prediction mode.
[0285] In some embodiments of this application, the first determination unit 12 is further configured to set the first transformation parameter of the current block to be equal to the first index of the second type of intra-prediction mode of the current block.
[0286] In some embodiments of this application, the first conversion unit 13 is further configured to determine the second conversion parameter corresponding to the first conversion parameter based on a first mapping table between a preset first conversion parameter and a second conversion parameter.
[0287] In some embodiments of this application, the second transformation parameter includes at least one of a transformation kernel index parameter and a scan order parameter of the transformation parameter, wherein the transformation kernel index parameter indicates a transformation kernel used in the process of decoding the transformation parameter of the current block, and the scan order parameter indicates the scan order of the transformation parameter, wherein the scan order includes a horizontal order and a vertical order.
[0288] In some embodiments of this application, the first determination unit 12 further determines, based on the first predicted value, an index set of a second type of intra-prediction mode for the first predicted value. The system is configured to determine the first index of the second type of intra-prediction mode for the current block based on the index set of the second type of intra-prediction mode for the first predicted value, wherein the index set of the second type of intra-prediction mode stores cumulative weight values corresponding to some or all of the tolerance values of the index of the second type of intra-prediction mode.
[0289] In some embodiments of this application, the first determination unit 12 further determines the horizontal gradient value and the vertical gradient value of the sample points corresponding to some or all of the first predicted values, Based on the horizontal and vertical gradient values of the sample points, the system is configured to determine the index set of the second type of intra-prediction mode for the first predicted value.
[0290] In some embodiments of this application, the first determination unit 12 further determines the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, Based on the gradient angle value of the sample point, a second index of a second type of intra-prediction mode corresponding to the gradient angle value is determined. It is configured to update the cumulative weight values corresponding to the second index of the determined second type of intra-prediction mode in the index set of the second type of intra-prediction mode.
[0291] In some embodiments of this application, the first determination unit 12 is further configured to determine the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point and a preset functional relationship.
[0292] In some embodiments of this application, the predetermined functional relationship is an arctangent function, and the arctangent function is the ratio of the horizontal gradient value to the vertical gradient value of the sample point. In some embodiments of this application, the first determination unit 12 is further configured to determine the gradient angle value of the sample point by processing the ratio of the horizontal gradient value and the vertical gradient value of the sample point based on the inverse tangent function.
[0293] In some embodiments of this application, the preset functional relationship is a second mapping table between the gradient angle value of the sample point and the horizontal gradient value and vertical gradient value of the sample point. In some embodiments of this application, the first determination unit 12 is further configured to input the horizontal gradient value and the vertical gradient value of the sample point, or the ratio of the horizontal gradient value and the vertical gradient value of the sample point, into the second mapping table and output the gradient angle value of the sample point.
[0294] In some embodiments of this application, the first determination unit 12 further determines a second type intra-prediction mode index value corresponding to the angular intra-prediction direction in which the angle between the angular intra-prediction direction shown in some or all of the tolerance values of the second type intra-prediction mode index and the direction shown in the gradient angle value is smallest. The second index of the second type intra prediction mode of the gradient angle value is configured to be set to the second type intra prediction mode index value.
[0295] In some embodiments of this application, the first determination unit 12 is further configured to determine a second index of the second type of intra-prediction mode corresponding to the gradient angle value, based on a third mapping table between a preset gradient angle value and a second type of intra-prediction mode index.
[0296] In some embodiments of this application, the third mapping table represents the correspondence between gradient angle values of different values or different ranges of values and a second type of intra-prediction mode index.
[0297] In some embodiments of this application, the first determination unit 12 is further configured to add a set number to the cumulative weight value corresponding to the second index of the determined second type intra-prediction mode in the index set of the second type intra-prediction mode.
[0298] In some embodiments of this application, the set value is equal to 1.
[0299] In some embodiments of this application, the set value is equal to the sum of the absolute value of the horizontal gradient value and the absolute value of the vertical gradient value.
[0300] In some embodiments of the present application, the first determination unit 12 is further configured to set the first index of the second type of intra-prediction mode of the current block to the second index of the second type of prediction mode corresponding to the largest cumulative weight value in the set of indexes of the second type of intra-prediction mode of the first predicted value.
[0301] In some embodiments of this application, the first determination unit 12 further determines the second type intra-predicted value of the current block based on the candidate second type intra-predicted mode. Based on the first intra-prediction value and the second type of intra-prediction value, the system is configured to determine the first index of the second type of intra-prediction mode for the current block.
[0302] In some embodiments of this application, the candidate second type intra-prediction mode includes one or more of the planar mode, DC mode, and angular intra-prediction mode.
[0303] In some embodiments of this application, the first determination unit 12 further determines the first prediction error of the first intra-predicted value and the second type of intra-predicted value, The system is configured to determine, as the first index of the second type of intra-prediction mode for the current block, the index value corresponding to the candidate second type of intra-prediction mode that satisfies the first predetermined condition.
[0304] In some embodiments of this application, the first determination unit 12 is further configured to determine the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value based on a first error rule. Here, the first error rule is one of the sum of absolute differences, the sum of squared errors, the mean absolute error, and the mean squared error, and the first predetermined condition is that the first prediction error reaches its minimum value.
[0305] In some embodiments of this application, the first determination unit 12 is further configured to determine the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value based on a second error rule. Here, the second error rule is one of the signal-to-noise ratio and the peak signal-to-noise ratio, and the first predetermined condition is that the first prediction error reaches its maximum value.
[0306] In some embodiments of this application, the first determination unit 12 further determines the gradient direction, first gradient intensity, and mode partition corresponding to the sample point based on the horizontal gradient value and the vertical gradient value of the sample point. Based on the gradient direction corresponding to the sample point, the first gradient intensity, and the mode partition, a second index of the second type of intra-prediction mode is determined. It is configured to update the cumulative weight values corresponding to the second index of the determined second type of intra-prediction mode in the index set of the second type of intra-prediction mode.
[0307] In some embodiments of this application, the first determination unit 12 further determines the first gradient strength of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, Based on the horizontal and vertical gradient values of the sample point, a partitioning process of a second type of intra-prediction mode is performed on the sample point to determine the horizontal region index, vertical region index, and gradient intensity index of the sample point. Based on the horizontal region index, vertical region index, and gradient intensity index of the sample point, the mode partition of the sample point is determined. The system is configured to determine the gradient direction corresponding to the sample point based on the gradient intensity index of the sample point.
[0308] In some embodiments of this application, the first determination unit 12 further determines the gradient offset ratio of the sample point based on the gradient direction corresponding to the sample point, The gradient offset ratio of the sample point is mapped to a preset mode offset range to obtain the offset amount of the intra-predicted mode index of the sample point. Based on a fourth mapping table of pre-configured mode partitions and mode indices, the target second type intra-prediction mode corresponding to the mode partition of the sample point is determined. The system is configured to determine the second index of the second type of intra-prediction mode for the sample point by combining the offset amount of the second type of intra-prediction mode for the target and the intra-prediction mode index.
[0309] In some embodiments of this application, the first determination unit 12 is further configured to determine a first index of the second type intra-prediction mode for the current block based on a first predetermined mapping relationship between a first type intra-prediction mode parameter and a second type intra-prediction mode index.
[0310] In some embodiments of this application, the first type intra-predictive mode parameter includes a first type intra-predictive mode index, and the first predetermined mapping relationship represents a correspondence between a first type intra-predictive mode index and a second type intra-predictive mode index. The first determination unit 12 is further configured to determine a first index of the second type of intra prediction mode from the first predetermined mapping relationship based on the first type of intra prediction mode index.
[0311] In some embodiments of this application, the first determination unit 12 is further configured to determine a first index of the second type intra-prediction mode for the current block based on a weighted matrix of the first type intra-prediction mode indicated by the first type intra-prediction mode parameter.
[0312] In some embodiments of this application, the first determination unit 12 further determines the gradient parameters of the weighting matrix of the first type of intra-prediction mode, The system is configured to determine the first index of the second type of intra-prediction mode for the current block based on the gradient parameter of the weighted matrix of the first type of intra-prediction mode.
[0313] In some embodiments of this application, the first determination unit 12 further performs wide-angle mapping on the first index of the second type of intra-prediction mode and determines the wide-angle prediction mode index. The system is configured to determine the first transformation parameter based on the wide-angle prediction mode index.
[0314] In some embodiments of this application, the conversion coefficient includes a quantization coefficient, and the first conversion unit 13 further performs inverse quantization on the quantization coefficient to obtain a first conversion coefficient. The first transformation coefficient is transformed to obtain the first transformation coefficient vector. The transformation matrix shown in the transformation kernel index parameter is used to transform the first transformation coefficient vector to obtain the second transformation coefficient vector. The scan order parameter of the conversion parameter is adopted, and the second conversion coefficient vector is transformed to obtain the second conversion coefficient. The system is configured to perform an inverse transformation on the second transformation coefficient to obtain the residual difference value of the current block.
[0315] Referring to Figure 10, based on the same inventive concept as the above embodiment, an exemplary structural diagram of the decoder configuration according to the embodiment of this application is shown. As shown in Figure 10, the decoder may include a first memory 1002 and the first processor 1003. The first memory 1002 stores a computer program that is executed by the first processor. The first processor 1003 executes the decoder method by executing the computer program.
[0316] In the embodiments of this application, the decoder further comprises a first communication interface 1001, which is configured to send and receive signals in the process of sending and receiving information with another external network element. Each component is coupled via a bus system 1004. Understandably, the first bus system 1004 is used to enable connection communication between these components. In addition to the data bus, the first bus system 1004 further includes a power bus, a control bus, and a status signal bus. However, for clarity in the explanation, in Figure 10, the various buses are labeled as the first bus system 1004.
[0317] It should be understood that the first memory 1002 in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Here, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM) used as an external cache. While illustrative but not limiting, various forms of RAM can be used, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The first memory 1002 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0318] However, the processor 1003 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be performed by instructions in the form of hardware integrated logic circuits or software in the first processor 1003. The first processor 1003 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, or transistor logic devices, discrete hardware components, etc. Each method, step and logic block diagram disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of this application may be performed directly by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software module can be placed in a conventional storage medium such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, or registers. The storage medium is placed in the first memory 1002, and the first processor 1003 reads the information in the first memory 1002 and combines it with its hardware to complete the steps of the method.
[0319] It can be understood that these embodiments described in this application can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processing (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, or other electronic units configured to perform the functions described in this application, or forms thereof. In the case of software implementation, the technology described in this application can be implemented through modules (processes, functions, etc.) that perform the functions described in this application. The software code can be stored in memory and executed by the processor. The memory can be implemented within or outside the processor.
[0320] Exemplary, in another embodiment, the first processor 1003 further performs the method of any one of the above embodiments by executing the computer program.
[0321] Based on the same inventive concept as the above embodiment, Figure 11 shows an exemplary structural diagram of the encoder configuration according to the embodiment of this application. As shown in Figure 11, the encoder 2 is A second determination unit 20 is configured to determine the first type of intra-predictive mode parameters, A second prediction unit 21 is configured to determine a first predicted value for the current block based on the first type of intra prediction mode parameter, The system may include a second conversion unit 22 configured to perform a conversion process on the residual difference value based on the second conversion parameter to obtain the conversion coefficient of the current block. The second determination unit 20 is further configured to calculate the residual difference between the original value of the current block and the first predicted value, determine the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter, and determine the second transformation parameter for transforming the current block based on the first transformation parameter.
[0322] In some embodiments of this application, the second determination unit 20 further determines a first index of a second type of intra prediction mode for the current block based on the first predicted value of the current block, The system is configured to determine the first transformation parameter of the current block based on the first index of the second type of intra prediction mode of the current block.
[0323] In some embodiments of this application, determining the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter is: Based on the first type of intra-prediction mode parameters, the first index of the second type of intra-prediction mode for the current block is determined, This includes determining a first transformation parameter of the current block based on a first index of the second type of intra prediction mode.
[0324] In some embodiments of this application, the second type of intra-prediction mode includes at least one of a planar mode, a DC mode, and an angular intra-prediction mode.
[0325] In some embodiments of this application, the second determination unit 20 is further configured to set the first transformation parameter of the current block to be equal to the first index of the second type of intra-prediction mode of the current block.
[0326] In some embodiments of this application, the second conversion unit 22 is further configured to determine the second conversion parameter corresponding to the first conversion parameter based on a first mapping table between a preset first conversion parameter and a second conversion parameter.
[0327] In some embodiments of this application, the second transformation parameter includes at least one of a transformation kernel index parameter and a scan order parameter of the transformation parameter, wherein the transformation kernel index parameter indicates a transformation kernel used in the process of decoding the transformation parameter of the current block, and the scan order parameter indicates the scan order of the transformation parameter, wherein the scan order includes a horizontal order and a vertical order.
[0328] In some embodiments of this application, the second determination unit 20 further determines, based on the first predicted value, an index set of a second type of intra-prediction mode for the first predicted value. The system is configured to determine the first index of the second type of intra-prediction mode for the current block based on the index set of the second type of intra-prediction mode for the first predicted value, wherein the index set of the second type of intra-prediction mode stores cumulative weight values corresponding to some or all of the tolerance values of the index of the second type of intra-prediction mode.
[0329] In some embodiments of this application, the second determination unit 20 further determines the horizontal gradient value and the vertical gradient value of the sample points corresponding to some or all of the first predicted values, Based on the horizontal and vertical gradient values of the sample points, the system is configured to determine the index set of the second type of intra-prediction mode for the first predicted value.
[0330] In some embodiments of this application, the second determination unit 20 further determines the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, Based on the gradient angle value of the sample point, a second index of a second type of intra-prediction mode corresponding to the gradient angle value is determined. It is configured to update the cumulative weight values corresponding to the second index of the determined second type of intra-prediction mode in the index set of the second type of intra-prediction mode.
[0331] In some embodiments of this application, the second determination unit 20 is further configured to determine the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point and a preset functional relationship.
[0332] In some embodiments of this application, the predetermined functional relationship is an arctangent function, and the arctangent function is the ratio of the horizontal gradient value to the vertical gradient value of the sample point. In some embodiments of this application, the second determination unit 20 is further configured to determine the gradient angle value of the sample point by processing the ratio of the horizontal gradient value and the vertical gradient value of the sample point based on the arctangent function.
[0333] In some embodiments of this application, the preset functional relationship is a second mapping table between the gradient angle value of the sample point and the horizontal gradient value and vertical gradient value of the sample point. In some embodiments of this application, the second determination unit 20 is further configured to input the horizontal gradient value and the vertical gradient value of the sample point, or the ratio of the horizontal gradient value and the vertical gradient value of the sample point, into the second mapping table and output the gradient angle value of the sample point.
[0334] In some embodiments of this application, the second determination unit 20 further determines a second type intra-prediction mode index value corresponding to the angular intra-prediction direction in which the angle between the angular intra-prediction direction and the direction indicated by the gradient angle value is smallest, from the angular intra-prediction direction indicated by some or all of the tolerance values of the second type intra-prediction mode index, The second index of the second type intra prediction mode of the gradient angle value is configured to be set to the second type intra prediction mode index value.
[0335] In some embodiments of this application, the second determination unit 20 is further configured to determine a second index of the second type of intra-prediction mode corresponding to the gradient angle value, based on a third mapping table between a preset gradient angle value and a second type of intra-prediction mode index.
[0336] In some embodiments of this application, the third mapping table represents the correspondence between gradient angle values of different values or different ranges of values and a second type of intra-prediction mode index.
[0337] In some embodiments of this application, the second determination unit 20 is further configured to add a set number to the cumulative weight value corresponding to the second index of the determined second type intra-prediction mode in the index set of the second type intra-prediction mode.
[0338] In some embodiments of this application, the set value is equal to 1.
[0339] In some embodiments of this application, the set value is equal to the sum of the absolute value of the horizontal gradient value and the absolute value of the vertical gradient value.
[0340] In some embodiments of the present application, the second determination unit 20 is further configured to set the first index of the second type of intra-prediction mode of the current block to the second index of the second type of prediction mode corresponding to the largest cumulative weight value in the index set of the second type of intra-prediction mode of the first predicted value.
[0341] In some embodiments of this application, the second determination unit 20 further determines the second type intra-predicted value of the current block based on the candidate second type intra-predicted mode. Based on the first intra-prediction value and the second type of intra-prediction value, the system is configured to determine the first index of the second type of intra-prediction mode for the current block.
[0342] In some embodiments of this application, the candidate second type intra-prediction mode includes one or more of the planar mode, DC mode, and angular intra-prediction mode.
[0343] In some embodiments of this application, the second determination unit 20 further determines the first prediction error between the first intra-predicted value and the second type of intra-predicted value, The system is configured to determine, as the first index of the second type of intra-prediction mode for the current block, the index value corresponding to the candidate second type of intra-prediction mode that satisfies the first predetermined condition.
[0344] In some embodiments of this application, the second determination unit 20 is further configured to determine the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value based on the first error rule. Here, the first error rule is one of the sum of absolute differences, the sum of squared errors, the mean absolute error, and the mean squared error, and the first predetermined condition is that the first prediction error reaches its minimum value.
[0345] In some embodiments of this application, the second determination unit 20 is further configured to determine the first predicted difference value between the first intra-predicted value and the second type of intra-predicted value based on a second error rule. Here, the second error rule is one of the signal-to-noise ratio and the peak signal-to-noise ratio, and the first predetermined condition is that the first prediction error reaches its maximum value.
[0346] In some embodiments of this application, the second determination unit 20 further determines the gradient direction, first gradient intensity, and mode partition corresponding to the sample point based on the horizontal gradient value and the vertical gradient value of the sample point. Based on the gradient direction corresponding to the sample point, the first gradient intensity, and the mode partition, a second index of the second type of intra-prediction mode is determined. It is configured to update the cumulative weight values corresponding to the second index of the determined second type of intra-prediction mode in the index set of the second type of intra-prediction mode.
[0347] In some embodiments of this application, the second determination unit 20 further determines the first gradient strength of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, Based on the horizontal and vertical gradient values of the sample point, a partitioning process of a second type of intra-prediction mode is performed on the sample point to determine the horizontal region index, vertical region index, and gradient intensity index of the sample point. Based on the horizontal region index, vertical region index, and gradient intensity index of the sample point, the mode partition of the sample point is determined. The system is configured to determine the gradient direction corresponding to the sample point based on the gradient intensity index of the sample point.
[0348] In some embodiments of this application, the second determination unit 20 further determines the gradient offset ratio of the sample point based on the gradient direction corresponding to the sample point, The gradient offset ratio of the sample point is mapped to a preset mode offset range to obtain the offset amount of the intra-predicted mode index of the sample point. Based on a fourth mapping table of pre-configured mode partitions and mode indices, the target second type intra-prediction mode corresponding to the mode partition of the sample point is determined. The system is configured to determine the second index of the second type of intra-prediction mode for the sample point by combining the offset amount of the second type of intra-prediction mode for the target and the intra-prediction mode index.
[0349] In some embodiments of this application, the second determination unit 20 is further configured to determine a first index of the second type intra-prediction mode for the current block based on a first predetermined mapping relationship between a first type intra-prediction mode parameter and a second type intra-prediction mode index.
[0350] In some embodiments of this application, the first type intra-predictive mode parameter includes a first type intra-predictive mode index, and the first predetermined mapping relationship represents a correspondence between a first type intra-predictive mode index and a second type intra-predictive mode index. The second determination unit 20 is further configured to determine a first index of the second type intra prediction mode from the first predetermined mapping relationship based on the first type intra prediction mode index.
[0351] In some embodiments of this application, the second determination unit 20 is further configured to determine a first index of the second type intra-prediction mode for the current block based on a weighted matrix of the first type intra-prediction mode indicated by the first type intra-prediction mode parameter.
[0352] In some embodiments of this application, the second determination unit 20 further determines the gradient parameters of the weighting matrix of the first type of intra-prediction mode, The system is configured to determine the first index of the second type of intra-prediction mode for the current block based on the gradient parameter of the weighted matrix of the first type of intra-prediction mode.
[0353] In some embodiments of this application, the second determination unit 20 further performs wide-angle mapping on the first index of the second type of intra-prediction mode and determines the wide-angle prediction mode index. The system is configured to determine the first transformation parameter based on the wide-angle prediction mode index.
[0354] In some embodiments of this application, the second conversion unit 22 further converts the residual difference value to obtain a second conversion coefficient. The scan order parameter of the conversion parameter is adopted, and the second conversion coefficient is converted to obtain the second conversion coefficient vector. By adopting the transformation matrix shown in the transformation kernel index parameter, the second transformation coefficient vector is transformed to obtain the first transformation coefficient vector. The first transformation coefficient vector is transformed to obtain the first transformation coefficient. The system is configured to perform quantization on the first transformation coefficient to obtain the quantization coefficient of the current block, and the quantization coefficient is the transformation coefficient of the current block.
[0355] Referring to Figure 12, based on the same inventive concept as the embodiments described above, an exemplary structural diagram of the encoder configuration according to the embodiment of this application is shown. As shown in Figure 12, the encoder may comprise a second communication interface 1201, a second memory 1202, and a second processor 1203, each component being coupled by a second bus system 1204. Understandably, the second bus system 1204 is configured to enable connection communication between these components. In addition to the data bus, the second bus system 1204 further includes a power bus, a control bus, and a status signal bus. However, for clarity of explanation, in Figure 12, the various buses are labeled as the second bus system 1204. Here, The second communication interface 1201 is configured to send and receive signals in the process of sending and receiving information with another external network element. The second memory 1202 stores computer programs executed by the second processor, The second processor 1201 executes the method performed by the encoder by executing the computer program.
[0356] It is understood that the hardware functions of the second memory 1202 and the first memory 1002 are similar, and the hardware functions of the second processor 1203 and the first processor 1003 are similar, and therefore will not be explained in detail again here.
[0357] An embodiment of this application provides a computer-readable storage medium storing a computer program, which, when executed by a first processor, causes the first processor to execute a video encoding method applicable to a decoder, or when executed by a second processor, causes the second processor to execute a method applicable to an encoder.
[0358] The above describes only specific embodiments of this application, and the scope of protection of this application is not limited thereto. Any modifications or substitutions that a person skilled in the art could easily conceive within the technical scope disclosed in this application should be included within the scope of protection of this application. Accordingly, the scope of protection of this application shall be subject to the scope of protection of the claims. [Industrial applicability]
[0359] In the embodiments of this application, a first predicted value of the current block is determined based on a first type intra-prediction mode parameter; a first transformation parameter of the current block is determined based on the first predicted value of the current block or a first type intra-prediction mode parameter; a second transformation parameter for transforming the current block is determined based on the first transformation parameter; a transformation process is performed on the transformation coefficients of the current block based on the second transformation parameter to determine the residual value of the current block; and a reconstructed value of the current block is determined based on the residual value and the first predicted value. In this way, when performing an LFNST transformation on a current block employing a first type intra-prediction mode (e.g., MIP), the introduction of a first predicted value of the current block or a first type intra-prediction mode parameter makes the selection of the transformation kernel or transformation matrix (corresponding to the second transformation parameter) in the transformation technique more flexible, thereby improving applicability to non-traditional intra-prediction modes (first type intra-prediction modes), improving decoding efficiency, and simultaneously improving video image quality.
Claims
1. A video decoding method applied to a decoder, Decode the bitstream and determine the intra-predictive mode parameters of the first type in the current block, Based on the first type of intra prediction mode parameter, the first predicted value of the current block is determined, The first transformation parameter of the current block is determined based on the first predicted value of the current block or the first type of intra prediction mode parameter, Based on the first transformation parameter, a second transformation parameter for transforming the current block is determined, Based on the second conversion parameter, a conversion process is performed on the conversion coefficient of the current block to determine the residual value of the current block. This includes determining the reconstruction value of the current block based on the residual difference value and the first predicted value, Determining the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter is: Based on the first predicted value of the current block, the first index of the second type of intra prediction mode of the current block is determined, The process includes determining a first transformation parameter of the current block based on a first index of the second type of intra prediction mode of the current block, How to decrypt a video.
2. Determining the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter is: Based on the first type of intra prediction mode parameters, the first index of the second type of intra prediction mode for the current block is determined, This includes determining a first transformation parameter of the current block based on a first index of the second type of intra prediction mode, The second type of intra-prediction mode includes at least one of the planar mode, DC mode, and angular intra-prediction mode. The video decoding method according to claim 1.
3. The aforementioned video decoding method is The method further includes setting the first transformation parameter of the current block to be equal to the first index of the second type of intra-prediction mode of the current block, Determining a second transformation parameter for transforming the current block based on the first transformation parameter is: This includes determining the second transformation parameter corresponding to the first transformation parameter based on a first mapping table between a pre-set first transformation parameter and a second transformation parameter, The second transformation parameter includes at least one of a transformation kernel index parameter and a transformation parameter scan order parameter, wherein the transformation kernel index parameter indicates the transformation kernel used in the process of decoding the transformation parameter of the current block, and the scan order parameter indicates the scan order of the transformation parameter, wherein the scan order includes a horizontal order and a vertical order. The video decoding method according to claim 1.
4. Determining the first index of the second type of intra prediction mode for the current block based on the first predicted value of the current block is: Based on the first predicted value, determine the index set of the second type of intra prediction mode for the first predicted value, Determining a first index of the second type intra-prediction mode for the current block based on the index set of the second type intra-prediction mode for the first predicted value, wherein the index set of the second type intra-prediction mode stores cumulative weight values corresponding to some or all of the tolerance values of the index of the second type intra-prediction mode, The video decoding method according to claim 1.
5. Based on the first predicted value of the current block, determining the index set of the second type of intra-prediction mode for the first predicted value is: For some or all of the first predicted values, the horizontal gradient value and vertical gradient value of the sample points corresponding to some or all of the predicted values are determined. This includes determining the index set of the second type of intra-prediction mode for the first predicted value based on the horizontal gradient value and the vertical gradient value of the sample point, Determining the index set of the second type of intra-prediction mode for the first predicted value based on the horizontal gradient value and the vertical gradient value of the sample point is: Based on the horizontal gradient value and the vertical gradient value of the sample point, the gradient angle value of the sample point is determined. Based on the gradient angle value of the sample point, a second index of a second type of intra-prediction mode corresponding to the gradient angle value is determined, This includes updating the cumulative weight values corresponding to the second index of the determined second type of intra-prediction mode in the index set of the second type of intra-prediction mode, Determining the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point is: This includes determining the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, and a preset functional relationship. The video decoding method according to claim 4.
6. The aforementioned pre-defined functional relationship is an arctangent function, and the arctangent function is the ratio of the horizontal gradient value to the vertical gradient value of the sample point. Determining the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, and a preset functional relationship, is: The process includes determining the gradient angle value of the sample point by processing the ratio of the horizontal gradient value and the vertical gradient value of the sample point based on the aforementioned inverse tangent function. Or, The aforementioned pre-defined function relationship is a second mapping table between the gradient angle value of the sample point and the horizontal gradient value and vertical gradient value of the sample point. Determining the gradient angle value of the sample point based on the horizontal gradient value and the vertical gradient value of the sample point, and a preset functional relationship, is: This includes inputting the horizontal gradient value and vertical gradient value of the sample point, or the ratio of the horizontal gradient value and vertical gradient value of the sample point, into the second mapping table and outputting the gradient angle value of the sample point. The video decoding method according to claim 5.
7. A video encoding method applied to an encoder, To determine the parameters of the first type of intra-predictive mode, Based on the first type of intra-prediction mode parameter, a first predicted value for the current block is determined, and the residual difference between the original value of the current block and the first predicted value is calculated. The first transformation parameter of the current block is determined based on the first predicted value of the current block or the first type of intra prediction mode parameter, Based on the first transformation parameter, a second transformation parameter for transforming the current block is determined, This includes performing a transformation process on the residual difference value based on the second transformation parameter to obtain the transformation coefficient of the current block, Determining the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter is: Based on the first predicted value of the current block, the first index of the second type of intra prediction mode of the current block is determined, The process includes determining a first transformation parameter of the current block based on a first index of the second type of intra prediction mode of the current block, Video encoding method.
8. Determining the first transformation parameter of the current block based on the first predicted value of the current block or the first type of intra-prediction mode parameter is: Based on the first type of intra prediction mode parameters, the first index of the second type of intra prediction mode for the current block is determined, This includes determining a first transformation parameter of the current block based on a first index of the second type of intra prediction mode, The video encoding method according to claim 7.
9. The second type of intra-prediction mode includes at least one of the planar mode, DC mode, and angular intra-prediction mode, and / or The aforementioned video encoding method is The further includes setting the first transformation parameter of the current block to be equal to the first index of the second type of intra-prediction mode of the current block, The video encoding method according to claim 7.
10. Determining a second transformation parameter for transforming the current block based on the first transformation parameter is: This includes determining the second transformation parameter corresponding to the first transformation parameter based on a first mapping table between a pre-set first transformation parameter and a second transformation parameter, and / or, The second transformation parameter includes at least one of a transformation kernel index parameter and a transformation parameter scan order parameter, wherein the transformation kernel index parameter indicates the transformation kernel used in the process of decoding the transformation parameter of the current block, and the scan order parameter indicates the scan order of the transformation parameter, wherein the scan order includes a horizontal order and a vertical order. The video encoding method according to claim 7.
11. A decoder comprising memory and a processor, The memory stores computer programs executed by the processor, The decoder is a processor that executes the video decoding method according to any one of claims 1 to 6 by executing the computer program.
12. An encoder comprising memory and a processor, The memory stores computer programs executed by the processor, The processor is an encoder that performs the video encoding method according to any one of claims 7 to 10 by executing the computer program.
13. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to execute the video decoding method described in any one of claims 1 to 6, or, when executed by a processor, causes the processor to execute the video encoding method described in any one of claims 7 to 10.