Methods for predicting color components, encoders, decoders, and storage media readable by computer.

VN10061587BActive Publication Date: 2026-09-16GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202400778
Authority / Receiving Office
VN · VN
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-07-11
Filing Date
2020-05-15
Publication Date
2026-09-16
Estimated Expiration
2040-05-15

AI Technical Summary

Technical Problem

The determination of the shift factor in the matrix multiplication process in H.266/VVC is related to the block type and prediction mode index number, which results in a cumbersome prediction process and increased computational complexity, making it difficult to meet the needs of high-definition and ultra-high-definition video coding.

Method used

Provide an image component prediction method that simplifies the determination of the shift factor by determining the prediction parameters of the current block, including prediction mode parameters and block size parameters, and uses fixed values ​​or preset values ​​in the lookup table to reduce computational complexity and memory usage, reducing the storage of lookup tables.

Benefits of technology

It simplifies the determination process of the shift factor, reduces the computational complexity and lookup table storage requirements, improves the encoding and decoding efficiency, and is suitable for video encoding and decoding systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202400778_0
    Figure VN1202400778_0
Patent Text Reader

Abstract

The invention relates to a method for predicting color components, an encoder, and a decoder. This method comprises: determining the prediction parameters for the current block, wherein the prediction parameters include the prediction method parameter and the size parameter of the current block; if the prediction method parameter indicates that a matrix-based intra-prediction (MIP) method should be used to determine the intra-prediction value of the current block, determining the MIP weight matrix of the current block, the shift coefficient of the current block, and the input sample matrix MIP of the current block; and determining the intra-prediction value of the current block in terms of the MIP weight matrix, the shift coefficient, and the input sample matrix MIP.
Need to check novelty before this filing date? Find Prior Art

Description

Image component prediction method, encoder, decoder, and storage medium

[0001] Cross Reference to Related Applications

[0002] 1) Prior U.S. Provisional Patent Application No. 62 / 872,488 entitled “Matrix-Based Intra Prediction (MIP) Shift Unification According to Block Size and Mode Index” in the names of Junyan Huo, Yanzhuo Ma, and Wei Zhang, filed July 10, 2019;

[0003] 2) Prior U.S. Provisional Patent Application No. 62 / 872,830 entitled “Methods and Apparatuses for Matrix-Based Intra Prediction (MIP) Shift Unification” in the names of Junyan Huo, Yanzhuo Ma, and Wei Zhang, filed July 11, 2019;

[0004] 3) Prior U.S. Provisional Patent Application No. 62 / 873,170 entitled “Methods and Apparatuses for Matrix-Based Intra Prediction (MIP) Shift Unification” in the names of Junyan Huo, Yanzhuo Ma, and Wei Zhang, filed July 11, 2019. TECHNICAL FIELD

[0005] Embodiments of the present application relate to the field of video coding technology, and particularly relate to an image component prediction method, an encoder, a decoder, and a storage medium. BACKGROUND

[0006] With the increasing demand for video display quality, new video application forms such as high definition and ultra-high definition video have emerged. H.265 / High Efficiency Video Coding (HEVC) has been unable to meet the needs of the rapid development of video applications, and the Joint Video Research Group (JVET) has proposed the next generation video coding standard H.266 / Versatile Video Coding (VVC). The corresponding test model is the VVC Test Model (VTM) of the reference software test platform of VVC.

[0007] In H.266 / VVC, the Matrix-based Intra Prediction (MIP) technology has been accepted. This technology increases different numbers of MIP prediction modes in the intra prediction process according to different types of current blocks. However, in the process of MIP prediction, especially the determination of the shift factor in the matrix multiplication process, the current block type and the index number of the MIP prediction mode are related, which makes the prediction process more complicated and increases the computational complexity.

[0008] SUMMARY

[0009] The embodiments of the present application provide an image component prediction method, an encoder, a decoder and a storage medium, which can simplify the determination method of the shift factor, and when the lookup table is used to determine the shift factor, the memory occupied by the lookup table can be reduced while reducing the computational complexity.

[0010] The technical solutions of the embodiments of the present application can be implemented as follows:

[0011] In a first aspect, the embodiments of the present application provide an image component prediction method applied to an encoder, and the method comprises:

[0012] determining a prediction parameter of a current block, wherein the prediction parameter comprises a prediction mode parameter and a size parameter of the current block;

[0013] when the prediction mode parameter indicates that a MIP mode is used to determine an intra prediction value of the current block, determining a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sampling matrix of the current block;

[0014] determining the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sampling matrix.

[0015] In a second aspect, an image component prediction method is provided. The method is applied to a decoder and includes the following steps.

[0016] Parsing a bitstream to obtain prediction parameters of a current block, wherein the prediction parameters include a prediction mode parameter and a size parameter of the current block;

[0017] When the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block, determining a MIP weight matrix of the current block, a shift factor of the current block, and a MIP input sample matrix of the current block;

[0018] Determining the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.

[0019] In a third aspect, an encoder is provided. The encoder includes a first determining unit and a first prediction unit, and wherein

[0020] The first determining unit is configured to determine prediction parameters of a current block, wherein the prediction parameters include a prediction mode parameter and a size parameter of the current block;

[0021] The first determining unit is further configured to, when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block, determine a MIP weight matrix of the current block, a shift factor of the current block, and a MIP input sample matrix of the current block;

[0022] The first prediction unit is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.

[0023] In a fourth aspect, an encoder is provided. The encoder includes a first memory and a first processor, and wherein

[0024] The first memory is configured to store a computer program capable of running on the first processor;

[0025] The first processor is configured to, when running the computer program, execute the method of the first aspect.

[0026] In a fifth aspect, a decoder is provided. The decoder includes a parsing unit, a second determining unit, and a second prediction unit, and wherein

[0027] The parsing unit is configured to parse a bitstream to obtain prediction parameters of a current block, wherein the prediction parameters include a prediction mode parameter and a size parameter of the current block;

[0028] The second determining unit is configured to determine a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sample matrix of the current block when the prediction mode parameter indicates that the MIP mode is used to determine the intra prediction value of the current block.

[0029] The second prediction unit is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sample matrix.

[0030] In a sixth aspect, an embodiment of the present application provides a decoder, which comprises a second memory and a second processor; wherein,

[0031] The second memory is configured to store a computer program capable of running on the second processor.

[0032] The second processor is configured to execute the method in the second aspect when the computer program is running.

[0033] In a seventh aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program, the computer program is executed by a first processor to implement the method in the first aspect, or is executed by a second processor to implement the method in the second aspect.

[0034] The embodiments of the present application provide an image component prediction method, an encoder, a decoder and a storage medium. On the encoder side, a prediction parameter of a current block is determined, the prediction parameter comprises a prediction mode parameter and a size parameter of the current block; when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block, a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sample matrix of the current block are determined; and the intra prediction value of the current block is determined according to the MIP weight matrix, the shift factor and the MIP input sample matrix. On the decoder side, a bitstream is parsed, a prediction parameter of a current block is acquired, the prediction parameter comprises a prediction mode parameter and a size parameter of the current block; when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block, a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sample matrix of the current block are determined; and the intra prediction value of the current block is determined according to the MIP weight matrix, the shift factor and the MIP input sample matrix. In this way, no matter the decoder side or the encoder side, the determination mode of the shift factor can be simplified, and when the shift factor is determined by using a lookup table, the memory occupied by the lookup table for storage can be reduced in the case of reducing the calculation complexity, so that the coding efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0035] FIG. 1 is a flow chart of a MIP prediction process according to the prior art;

[0036] FIG. 2A is a block diagram of a video encoding system according to an embodiment of the present application;

[0037] FIG. 2B is a block diagram of a video decoding system according to an embodiment of the present application;

[0038] FIG. 3 is a flow chart of a method for predicting image components according to an embodiment of the present application;

[0039] FIG. 4 is a structural diagram of generating an intra prediction value according to an embodiment of the present application;

[0040] FIG. 5 is a flow chart of another method for predicting image components according to an embodiment of the present application;

[0041] FIG. 6 is a structural diagram of an encoder according to an embodiment of the present application;

[0042] FIG. 7 is a structural diagram of another encoder according to an embodiment of the present application;

[0043] FIG. 8 is a structural diagram of a specific hardware of an encoder according to an embodiment of the present application;

[0044] FIG. 9 is a structural diagram of a decoder according to an embodiment of the present application;

[0045] FIG. 10 is a structural diagram of another decoder according to an embodiment of the present application;

[0046] FIG. 11 is a structural diagram of a specific hardware of a decoder according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to enable a person skilled in the art to better understand the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings, which are only used for reference and do not limit the embodiments of the present application.

[0048] 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; wherein the three image components are a luminance component, a blue chroma component and a red chroma component respectively, specifically, the luminance component is usually represented by a symbol Y, the blue chroma component is usually represented by a symbol Cb or U, and the red chroma component is usually represented by a symbol Cr or V; thus, the video image can be represented by YCbCr format or YUV format.

[0049] In the embodiments of the present application, the first image component can be a luminance component, the second image component can be a blue chroma component, and the third image component can be a red chroma component, but the embodiments of the present application are not limited thereto.

[0050] The following will describe the related technical solutions in the light of the prediction process of the current MIP technology.

[0051] The input data of MIP prediction mainly includes the position of the current block (xTbCmp, yTbCmp), the MIP mode index value (which can be represented by modeId or modeIdx) when the current block uses MIP prediction, the height of the current block (represented by nTbH), the width of the current block (represented by nTbW), and the transposition processing indication flag (represented by isTransposed) whether transposition is needed, etc.

[0052] The output data of MIP prediction mainly includes the prediction block of the current block, and the prediction value corresponding to the pixel coordinates [x][y] in the prediction block is predSamples[x][y]; wherein x = 0, 1, …, nTbW-1; y = 0, 1, …, nTbH-1.

[0053] Here, as shown in FIG. 1, the MIP prediction process can be divided into four steps: configuring core parameters 11, obtaining reference pixels 12, constructing input samples 13, and generating intra prediction values 14. Specifically, for configuring core parameters 11, according to the size of the intra current block size, the current block can be divided into three categories, and the block size index value mipSizeId or blocksizeIdx is used to record the category of the current block; and the reference sample point number and the matrix multiplication output sample point number of the current block corresponding to different block size index values are different. For obtaining reference pixels 12, when predicting the current block, the upper block and the left block of the current block are both coded blocks, and the reference pixels of the MIP technology are the reconstructed values of the pixels in the upper row and the left column of the current block. The process of obtaining the reference pixels adjacent to the upper side of the current block (denoted as refT) and the reference pixels adjacent to the left side of the current block (denoted as refL) is the process of obtaining reference pixels. For constructing input samples 13, this step is used for the input of matrix multiplication, which can mainly include: obtaining reference samples 131, constructing a reference sample buffer 132, and deriving matrix multiplication input samples 133; wherein the process of obtaining reference samples is a downsampling process, and the construction of the reference sample buffer 132 can further include the filling method of the buffer when no transposition is required 1321 and the filling method of the buffer when transposition is required 1322. For generating intra prediction values 14, this step is used to obtain the MIP prediction value of the current block, which can mainly include: constructing matrix multiplication output sample blocks 141, matrix multiplication output sample embedding 142, matrix multiplication output sample transposition 143, and generating MIP final prediction values 144; wherein constructing matrix multiplication output sample blocks 141 can further include obtaining a weight matrix 1411, obtaining a shift factor and an offset factor 1412, and matrix multiplication operation 1413, and generating MIP final prediction values 144 can further include generating prediction values without upsampling 1441 and generating prediction values requiring upsampling 1442. In this way, after the four steps, the intra prediction value of at least one pixel in the current block can be obtained.

[0054] In the MIP prediction process as shown in FIG. 1, the MIP prediction can be represented by the following formula,

[0055] P = M x R (1)

[0056] Wherein, M is a matrix, R is an input sample vector derived from reference sample pixels, P is a prediction pixel value derived according to formula (1), that is, MIP is an encoding tool that can be used to derive an intra prediction signal containing matrix multiplication, and each specific matrix M corresponds to an MIP mode.

[0057] However, the coefficients of the matrix are initially trained as floating point values. But in the process of computer processing, these coefficients need to be stored and calculated as integer values. A common way to convert floating point values to integer values is to multiply the floating point values by a sufficiently large value to retain the appropriate precision, which is commonly referred to as a shift operation. Specifically, a left shift operation aimed at deriving an integer value can be implemented by the following formula,

[0058] VAL = val x (1 << shift) (2)

[0059] wherein val is a floating point matrix value, shift is the number of shift bits in the shift operation (also referred to as a shift factor for short), VAL is the stored integer value, and "<<" represents a left shift operator.

[0060] In this way, after obtaining the integer matrix, integer matrix multiplication can be performed; and finally, a right shift operation is performed on P to obtain the final MIP prediction value. The calculation formula of the entire process is as follows,

[0061] P = (M x (1 << shift) x R) >> shift (3)

[0062] or,

[0063] P = (M x (1 << shift) x R + (1 << (shift - 1))) >> shift (4)

[0064] wherein (1 << (shift - 1)) represents a rounding operation, and ">>" represents a right shift operator. However, in the latest MIP version, the corresponding shift value in the shift operation of the above formula (3) or formula (4) is different for different block size and different MIP modes. That is, the current shift factor is closely related to the current block type and the index number of the MIP prediction mode, making the prediction process more complicated and increasing the computational complexity.

[0065] The embodiment of the present application provides a kind of image component prediction method, it is applied to encoder or decoder.In the prediction parameter of obtaining the prediction parameter of current block, when the prediction mode parameter in it indicates using MIP mode to determine the intra prediction value of current block, the MIP weight matrix of current block, the shift factor of current block and the MIP input sampling matrix of current block can be determined;Then according to the MIP weight matrix, the shift factor and the MIP input sampling matrix, the intra prediction value of current block is determined.In this way, whether it is decoder side or encoder side, the determination mode of shift factor can be simplified, and when using lookup table to determine shift factor, it can also reduce the memory occupied by lookup table storage under the condition of reducing calculation complexity, to reach the purpose of improving coding efficiency.

[0066] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0067] Referring to FIG. 2A, an example of a block diagram of a video coding system is shown; as shown in FIG. 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 filter unit 108, an encoding unit 109, and a decoded picture buffer unit 110, etc., wherein the filter 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 arithmatic coding (CABAC).For the input raw video signal, a video coding block can be obtained by the division of a coding tree unit (CTU), and then the residual pixel information obtained after the intra- or inter-frame prediction is transformed by the transform and quantization unit 101 on the video coding block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-estimation unit 102 and the intra-prediction unit 103 are used for intra-frame prediction of the video coding block; in particular, the intra-estimation unit 102 and the intra-prediction unit 103 are used 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 used to perform inter-frame prediction encoding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector that can estimate the motion of the video coding block, and then the motion compensation is performed by the motion compensation unit 104 based on the motion vector determined by the motion estimation unit 105; after the intra-prediction mode is determined, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for the reconstruction of the video coding block, reconstructing the residual block in the pixel domain, which removes the blocking artifact by the filter control analysis unit 107 and the filtering unit 108, and then adds the reconstructed residual block to a predictive block in one of the frames of the decoded image buffer unit 110 to generate a reconstructed video coding block; the encoding unit 109 is used to encode various encoding parameters and quantized transform coefficients, and in the CABAC-based encoding algorithm, the context content can be based on the adjacent coding block, which can be used to encode the information indicating the determined intra-prediction mode, and output the bitstream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video coding blocks are continuously generated, which are all stored in the decoded image buffer unit 110.

[0068] Referring to FIG. 2B, an example of a block diagram of a video decoding system is shown; as shown in FIG. 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 picture buffer unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is processed by the encoding system shown in FIG. 2A, a bitstream of the video signal is output; the bitstream is input into the video decoding system 20, and first passes through the decoding unit 201 to obtain decoded transform coefficients; the inverse transform and inverse quantization unit 202 processes the transform coefficients to generate a residual block in the pixel domain; the intra prediction unit 203 can be used to generate prediction data of a current video decoding block based on a determined intra prediction mode and data from a previously decoded block of a current frame or picture; the motion compensation unit 204 determines prediction information for the video decoding block by parsing motion vectors and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blockiness artifacts, which can improve the video quality; the decoded video block is then stored in the decoded picture buffer unit 206, which stores reference pictures for subsequent intra prediction or motion compensation, and also for output of the video signal, i.e., the original video signal is recovered.

[0069] The image component prediction method in the embodiments of the present application is mainly applied to the intra prediction unit 103 part shown in FIG. 2A and the intra prediction unit 203 part shown in FIG. 2B. That is, the image component prediction method in the embodiments of the present application can be applied to a video encoding system, a video decoding system, or both, but the embodiments of the present application are not limited in this regard. It should be noted that when the image component prediction method is applied to the intra prediction unit 103 part, the "current block" specifically refers to a current to-be-encoded block in intra prediction; when the image component prediction method is applied to the intra prediction unit 203 part, the "current block" specifically refers to a current to-be-decoded block in intra prediction.

[0070] Based on the application scenario shown in FIG. 2A, referring to FIG. 3, a flowchart of an image component prediction method is shown. As shown in FIG. 3, the method can include:

[0071] S301: determining a prediction parameter of a current block, wherein the prediction parameter comprises a prediction mode parameter and a size parameter of the current block;

[0072] It should be noted that the method is applied to an encoder. A video image can be divided into a plurality of image blocks, and each current image block to be encoded can be referred to as a coding block (CB). Here, each coding block can include a first image component, a second image component and a third image component; and the current block is a coding block to be encoded for which first image component, second image component or third image component prediction is currently performed in the video image.

[0073] Wherein, assuming that the current block performs first image component prediction, and the first image component is a luminance component, i.e., the image component to be predicted is a luminance component, the current block can also be referred to as a luminance block; or, assuming that the current block performs second image component prediction, and the second image component is a chroma component, i.e., the image component to be predicted is a chroma component, the current block can also be referred to as a chroma block.

[0074] It should also be noted that the prediction parameter indicates the prediction mode adopted by the current block and the parameters related to the prediction mode. Here, for the determination of the prediction parameter, a simple decision strategy can be used, such as determining according to the size of the distortion value; or a complex decision strategy can be used, such as determining according to the result of rate distortion optimization (RDO), and the embodiments of the present application are not limited in any way. Generally, the RDO method can be used to determine the prediction parameter of the current block.

[0075] Specifically, in some embodiments, for S301, the determination of the prediction parameter of the current block can include:

[0076] Pre-encoding processing the current block using a plurality of prediction modes to obtain a rate distortion value corresponding to each prediction mode;

[0077] Selecting a minimum rate distortion value from the obtained plurality of rate distortion values, and determining the prediction parameter in the prediction mode corresponding to the minimum rate distortion value as the prediction parameter of the current block.

[0078] That is, at the encoder side, the current block can be pre-encoded by using multiple prediction modes respectively. Here, the multiple prediction modes usually include inter prediction mode and intra prediction mode, and the intra prediction mode can include traditional intra prediction mode and non-traditional intra prediction mode. Specifically, the traditional intra prediction mode can include direct current (DC) mode, planar (PLANAR) mode and angle mode, etc., the non-traditional intra prediction mode can include matrix-based intra prediction (MIP) mode, cross-component linear model prediction (CCLM) mode, intra block copy (IBC) mode and PLT (Palette) mode, etc., and the inter prediction mode can include traditional inter prediction mode and geometrical partitioning for inter blocks (GEO) mode, etc.

[0079] In this way, after the current block is pre-encoded by using multiple prediction modes respectively, the rate-distortion cost value corresponding to each prediction mode can be obtained; then the minimum rate-distortion cost value is selected from the obtained multiple rate-distortion cost values, and the prediction parameter in the prediction mode corresponding to the minimum rate-distortion cost value is determined as the prediction parameter of the current block. In addition, after the current block is pre-encoded by using multiple prediction modes respectively, the distortion value corresponding to each prediction mode can be obtained; then the minimum distortion value is selected from the obtained multiple distortion values, and the prediction parameter in the prediction mode corresponding to the minimum distortion value is determined as the prediction parameter of the current block. In this way, the current block is finally encoded by using the determined prediction parameter, and in this prediction mode, the prediction residual can be small, which can improve the encoding efficiency.

[0080] S302: When the prediction mode parameter indicates that the matrix-based intra prediction (MIP) mode is used to determine the intra prediction value of the current block, the MIP weight matrix of the current block, the shift factor of the current block and the MIP input sample matrix of the current block are determined.

[0081] It should be noted that for the current block, if the MIP mode is used to determine the intra prediction value of the current block, then the MIP input sample matrix of the current block, the MIP weight matrix of the current block and the shift factor of the current block need to be determined; wherein the shift factor can also be referred to as shift bit number, weight shift value, etc., and can be represented by sW, shift or weight shift.

[0082] It should be understood that for the MIP mode, the MIP core parameters need to be configured first. Here, the MIP mode can divide the current block into three categories according to the width and height of the current block, and the category of the current block is represented by mipSizeId or BlocksizeIdx, that is, the block size index value of the current block. For different block size index values, the number of reference samples (boundySize reference samples are needed on each side), the number of matrix multiplication input samples inSize, and the number of matrix multiplication output samples (arranged into predSize x predSize) are different.

[0083] Optionally, in some embodiments, determining the block size index value of the current block according to the size parameters of the current block can include:

[0084] If the width and height of the current block are both equal to 4, the block size index value of the current block can be set to 0;

[0085] On the contrary, if the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, the block size index value of the current block can be set to 1;

[0086] On the contrary, if the current block is a block of other sizes, the block size index value of the current block can be set to 2.

[0087] Optionally, in some embodiments, determining the block size index value of the current block according to the size parameters of the current block can include:

[0088] If the width and height of the current block are both equal to 4, the block size index value of the current block can be set to 0;

[0089] On the contrary, if one of the width and height of the current block is equal to 4, the block size index value of the current block can be set to 1;

[0090] On the contrary, if the current block is a block of other sizes, the block size index value of the current block can be set to 2.

[0091] In this way, according to the block size index value of the current block, the number of adjacent boundary reference samples (variable boundarySize) and the size of the MIP prediction block (variable predSize, the size of the MIP prediction block is predSize x predSize) can be determined according to the look-up table (LUT) shown in Table 1, and the number of input samples (represented by inSize) for the MIP matrix multiplication operation process can be calculated, and the calculation formula is as follows,

[0092] inSize = (2 x boundarySize) - (mipSizeId == 2)? 1 : 0 (5)

[0093] In the formula (5), the operation rules of the operators are the same as those defined in the ITU-T H.265 standard, for example, "==" is a logical "equal to" operator.

[0094] Table 1

[0095] BlocksizeIdx boundarySize predSize 0 2 4 2 4 8

[0096] Thus, according to Table 1, when the value of BlocksizeIdx is 0, the value of boundarySize can be 2 and the value of predSize can be 4; that is, at this time, the reference pixels are two pixel points selected for each edge, and the matrix multiplication outputs a 4x4 MIP prediction block; or when the value of BlocksizeIdx is 1, the value of boundarySize can be 4 and the value of predSize can be 4; that is, at this time, the reference pixels are four pixel points selected for each edge, and the matrix multiplication outputs a 4x4 MIP prediction block; or when the value of BlocksizeIdx is 2, the value of boundarySize can be 4 and the value of predSize can be 8; that is, at this time, the reference pixels are four pixel points selected for each edge, and the matrix multiplication outputs an 8x8 MIP prediction block.

[0097] In addition, the values of boundarySize, inSize and predSize can also be determined according to the block size index value of the current block according to the LUT shown in Table 2.

[0098] Table 2

[0099] BlocksizeIdx boundarySize inSize predSize 0 2 4 14 8 2 4 4 8

[0100] Thus, according to Table 2, when the value of BlocksizeIdx is 0, the value of boundarySize can be 2, the value of inSize can be 4, and the value of predSize can be 4; that is, at this time, the reference pixels are two pixel points selected for each edge, the number of input sampling points of matrix multiplication is four, and the matrix multiplication output is a 4x4 MIP prediction block; or when the value of BlocksizeIdx is 1, the value of boundarySize can be 4, the value of inSize can be 8, and the value of predSize can be 4; that is, at this time, the reference pixels are four pixel points selected for each edge, the number of input sampling points of matrix multiplication is eight, and the matrix multiplication output is a 4x4 MIP prediction block; or when the value of BlocksizeIdx is 2, the value of boundarySize can be 4, the value of inSize can be 7, and the value of predSize can be 8; that is, at this time, the reference pixels are four pixel points selected for each edge, the number of input sampling points of matrix multiplication is seven, and the matrix multiplication output is an 8x8 MIP prediction block.

[0101] Further, after configuring the MIP core parameters, reference pixels also need to be obtained to construct the MIP input sampling matrix. Specifically, in some embodiments, the determining the MIP input sampling matrix of the current block can include:

[0102] determining a neighboring reference sample set of the current block; wherein the neighboring reference sample set includes at least one reference sample value;

[0103] buffering the neighboring reference sample set to construct an input reference sample set;

[0104] determining the MIP input sampling matrix according to the input reference sample set.

[0105] It should be noted that the matrix multiplication input sampling (denoted as P) is the input for the matrix multiplication process; after multiplication with the corresponding matrix, the matrix multiplication output sampling (denoted as predMip) can be obtained. The matrix multiplication input sampling P is determined by a buffer (denoted as pTemp), the block size index value of the current block (denoted as BlocksizeIdx), and the bit depth value of the image component to be predicted (denoted as BitDepth), and the number of input reference samples in the matrix multiplication input sampling P (denoted as inSize) is only related to the block size index value of the current block. Finally, the xth input sample value (denoted as P[x]) in the input sampling matrix can be obtained.

[0106] Here, the specific construction process of the input sampling matrix P[x] is as follows,

[0107] When BlocksizeIdx = 0 or 1, the sample value at the zeroth position in pTemp needs to be subtracted by (1 « (BitDepth - 1)) as the sample value at the zeroth position in the input sampling matrix, denoted as P[0]; then the sample value at each position in the input sampling matrix other than the zeroth position needs to be obtained by subtracting the value at the zeroth position in pTemp from the sample value at the corresponding position in pTemp, denoted as P[x]; the specific expression is as follows,

[0108]

[0109] When BlocksizeIdx = 2, the sample value at each position in the input sampling matrix other than the zeroth position is obtained by subtracting the sample value at the zeroth position in pTemp from the sample value at the next position of the corresponding position in pTemp; the specific expression is as follows,

[0110] P[x] = pTemp[x + 1] - pTemp[0] for x = 0,..., inSize - 1 (7)

[0111] Thus, still taking the 4x4 current block as an example, four values are stored in the buffer pTemp, but the number of input samples is four, at this time, the four input sample values can be determined according to the formula (3) or formula (4), denoted as p[x], x = 0, 1, 2, 3; thus, the 1x4 MIP input sampling matrix is obtained.

[0112] Further, in the encoder, a weight matrix table is established in advance and stored in the encoder. Thus, according to the block size index value (BlocksizeIdx) and the MIP mode index value (modeIdx) of the current block, the MIP weight matrix required by the current block can be determined by table lookup, denoted as mWeight[x][y]. Wherein, the size of the MIP weight matrix mWeight[x][y] is only related to the block size index value of the current block, as shown in Table 3; in the MIP weight matrix, the number of columns is the number of input samples inSize, and the number of rows is the number of output samples predSizedxpredSized, so that the MIP weight matrix of the current block can be determined.

[0113] Table 3

[0114] mipSizeId number of columns number of rows 041618162764

[0115] Further, in the encoder, a shift table is also pre-established and stored in the encoder. In the latest MIP version, the shift bit number (i.e. shift factor) in the shift operation is different for different block size and different MIP mode index. As shown in Table 4, according to the block size index (BlocksizeIdx) and MIP mode index (modeIdx) of the current block, the shift factor used in the matrix multiplication can be determined by looking up the table.

[0116] Table 4

[0117]

[0118] However, in the encoder, the table 4 needs to be stored in the computer memory in the form of a lookup table; however, storage is costly, and the lookup process is also costly; since the shift factor in the table 4 is related to the block size and MIP mode index of the current block, the memory occupation is increased, and the calculation complexity is also increased.

[0119] In order to reduce the memory occupation and reduce the calculation complexity, the embodiments of the present application simplify the determination method of the shift factor. Specifically, in some embodiments, the shift factor of the current block can include a constant value shift factor and a shift factor determined according to a prediction parameter.

[0120] In a possible implementation, the shift factor can be set to a fixed constant value. For example, for different block size index values and different MIP mode index values, the shift factor can be set to 5; or, for different block size index values and different MIP mode index values, the shift factor can be set to 6; or, for different block size index values and different MIP mode index values, the shift factor can be set to 7. In the embodiments of the present application, preferably, the constant value of the shift factor is equal to 6, but this is not limited.

[0121] In another possible implementation, the shift factor determined according to the prediction parameter can include:

[0122] determining a block size index value of the current block according to a size parameter of the current block;

[0123] determining the shift factor according to the block size index value of the current block.

[0124] It should be noted that the block size index value of the current block can be determined according to the size parameter of the current block. Specifically, the determination of the block size index value of the current block according to the size parameter of the current block can include:

[0125] when the width and the height of the current block are both equal to 4, setting the block size index value of the current block as 0;

[0126] when the width and the height of the current block are both equal to 8, or one of the width and the height of the current block is equal to 4, setting the block size index value of the current block as 1;

[0127] when the width and the height of the current block do not satisfy the foregoing conditions, setting the block size index value of the current block as 2.

[0128] In this way, after the block size index value of the current block is determined, the shift factor can be further determined according to the block size index value of the current block, in combination with the number of MIP input sampling values or the size of the MIP prediction block.

[0129] Optionally, in some embodiments, the determining the shift factor according to the block size index value of the current block can include:

[0130] setting the shift factor as equal to a ratio between the width or the height of the current block and a first preset value corresponding to the block size index value of the current block.

[0131] Here, the first preset value represents the number of MIP input sampling values obtained from the boundary of the current block. In this case, the method can further include:

[0132] when the block size index value of the current block is equal to 0, 1 and 2 respectively, determining that the first preset value corresponding to the block size index value of the current block is equal to 2, 4 and 4 respectively.

[0133] That is, when the first preset value represents the number of MIP input sampling values obtained from the boundary of the current block, if the block size index value of the current block is equal to 0, the corresponding first preset value is equal to 2; if the block size index value of the current block is equal to 1, the corresponding first preset value is equal to 4; and if the block size index value of the current block is equal to 2, the corresponding first preset value is equal to 4, so that the shift factor can be determined according to the ratio between the width or the height of the current block and the corresponding first preset value.

[0134] Optionally, in some embodiments, the determining the shift factor according to the block size index value of the current block can include:

[0135] setting the shift factor as equal to a ratio between the width or the height of the current block and a second preset value corresponding to the block size index value of the current block.

[0136] Here, the second preset value indicates a size of the MIP prediction block of the current block calculated directly using the MIP weight matrix. In this case, the method can further include:

[0137] When the block size index value of the current block is equal to 0, 1 and 2 respectively, the second preset value corresponding to the block size index value of the current block is equal to 4, 4 and 8 respectively.

[0138] That is, when the second preset value indicates the size of the MIP prediction block of the current block calculated directly using the MIP weight matrix, if the block size index value of the current block is equal to 0, the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 1, the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 2, the corresponding second preset value is equal to 8, so that the shift factor can be determined according to the ratio between the width or height of the current block and the corresponding second preset value.

[0139] In yet another possible implementation, the shift table can be minimized, and the shift factor can still be determined using the lookup table. Optionally, for S302, the method can further include:

[0140] According to the size parameter of the current block, determining a block size index value of the current block;

[0141] According to the determined block size index value, querying a shift factor corresponding to the determined block size index value from a first preset lookup table, wherein the first preset lookup table is used to record the corresponding values between the block size index value and the shift factor;

[0142] Determining the queried shift factor as the shift factor corresponding to the current block.

[0143] It should be noted that the shift factor can be queried only according to the block size index value (denoted as blocksizeIdx) of the current block. As shown in the first preset lookup table in Table 5, for each block size index value, a fixed shift factor can be corresponded, that is, each block size or each block size set can have a fixed shift value as shown in Table 5; here, blocksizeIdx is the block size index value corresponding to the current block size or a group of block sizes.

[0144] Table 5

[0145] blocksizeIdx weight shift 0 1 5 1 6 2 6

[0146] In still another possible implementation, the shift table can still be minimized and the shift factor can still be determined using a look-up table. Optionally, in some embodiments, for S302, the method can further include:

[0147] determining a MIP mode type index value of the current block when the prediction mode parameter indicates that the intra prediction value of the current block is determined using the MIP mode;

[0148] querying, according to the determined MIP mode type index value, a shift factor corresponding to the determined MIP mode type index value from a second preset look-up table, wherein the second preset look-up table is used to record corresponding values between MIP mode type index values and shift factors;

[0149] determining the queried shift factor as the shift factor corresponding to the current block.

[0150] It should be noted that the shift factor can be queried only according to the MIP mode type index value (denoted as ModeCategoryIdx) of the current block. As shown in the second preset look-up table in Table 6, for each MIP mode type index value, a fixed shift factor can be corresponded, that is, according to ModeCategoryIdx, a fixed shift value as shown in Table 6 can be performed; here, ModeCategoryIdx is a type index value corresponding to a MIP mode or a group of MIP modes.

[0151] Table 6

[0152] ModeCategoryIdx weight shift 0 1 5 1 2 6 7

[0153] Further, ModeCategoryIdx can be derived according to the MIP mode index value. Specifically, the determination of the MIP mode type index value of the current block can include:

[0154] determining a block size index value corresponding to the current block and a MIP mode index value when the MIP mode is used for prediction;

[0155] determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value.

[0156] That is, after obtaining the block size index value and the MIP mode index value of the current block, the MIP mode type index value can be calculated using a hash method, or the MIP mode type index value can be determined according to a conditional judgment.

[0157] Optionally, the MIP mode type index value is calculated by using a hash method. In some embodiments, the determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value can comprise:

[0158] when the block size index value is equal to 0,

[0159] performing right shift processing on the MIP mode index value by using a first preset displacement value to obtain the MIP mode type index value of the current block;

[0160] or, when the block size index value is equal to 1,

[0161] performing right shift processing on the MIP mode index value by using a first preset displacement value to obtain a right shift processed value;

[0162] performing superposition processing on the right shift processed value and a third preset value to obtain the MIP mode type index value of the current block;

[0163] or, when the block size index value is equal to 2,

[0164] performing right shift processing on the MIP mode index value by using a second preset displacement value to obtain the MIP mode type index value of the current block.

[0165] It should be noted that the first preset displacement value can be 3, the second preset displacement value can be 2, and the third preset value can be 1.

[0166] Exemplarily, when the block size index value (blocksizeIdx) is equal to 0, the MIP mode index value (modeIdx) can be right shifted by 3 to obtain the MIP mode type index value; when the block size index value (blocksizeIdx) is equal to 1, the MIP mode index value (modeIdx) can be right shifted by 3 and then superimposed by 1 to obtain the MIP mode type index value; when the block size index value (blocksizeIdx) is equal to 2, the MIP mode index value (modeIdx) can be right shifted by 2 to obtain the MIP mode type index value. The specific representation is as follows,

[0167] ModeCategoryIdx=ModeIdx>>3.for blocksizeIdx=0

[0168] ModeCategoryIdx=(ModeIdx>>3)+1.for blocksizeIdx=1

[0169] ModeCategoryIdx = ModeIdx » 2. for blocksizeIdx = 2

[0170] Optionally, the MIP mode type index value is determined according to a condition judgment. In some embodiments, the determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value can comprise:

[0171] when the block size index value is equal to 0,

[0172] if the MIP mode index value is less than or equal to a first threshold value, determining the MIP mode index value as a fourth preset value;

[0173] if the MIP mode index value is greater than the first threshold value, determining the MIP mode index value as a fifth preset value;

[0174] or, when the block size index value is equal to 1,

[0175] if the MIP mode index value is less than or equal to a second threshold value, determining the MIP mode index value as a sixth preset value;

[0176] if the MIP mode index value is greater than the second threshold value, determining the MIP mode index value as a seventh preset value;

[0177] or, when the block size index value is equal to 2,

[0178] if the MIP mode index value is less than or equal to a third threshold value, determining the MIP mode index value as an eighth preset value;

[0179] if the MIP mode index value is greater than the third threshold value and less than or equal to a fourth threshold value, determining the MIP mode index value as a ninth preset value;

[0180] if the MIP mode index value is greater than the fourth threshold value, determining the MIP mode index value as a tenth preset value.

[0181] It should be noted that the first threshold value can be 6, the second threshold value can be 8, the third threshold value can be 3, and the fourth threshold value can be 4; the fourth preset value can be 5, the fifth preset value can be 6, the sixth preset value can be 6, the seventh preset value can be 7, the eighth preset value can be 5, the ninth preset value can be 6, and the tenth preset value can be 7.

[0182] Exemplarily, when the block size index value (blocksizeIdx) is equal to 0, if the MIP mode index value (modeIdx) is less than or equal to 6, the MIP mode type index value is set to 5, otherwise the MIP mode type index value is set to 6; when the block size index value (blocksizeIdx) is equal to 1, if the MIP mode index value (modeIdx) is less than or equal to 8, the MIP mode type index value is set to 6, otherwise the MIP mode type index value is set to 7; when the block size index value (blocksizeIdx) is equal to 2, if the MIP mode index value (modeIdx) is less than or equal to 3, the MIP mode type index value is set to 5, otherwise if the MIP mode index value (modeIdx) is less than or equal to 4, the MIP mode type index value is set to 6, otherwise the MIP mode type index value is set to 7. The specific representation is as follows,

[0183] If ModeIdx<=6,ModeCategoryIdx=5,otherwise ModeCategoryIdx=6,for blocksizeIdx=0

[0184] If ModeIdx<=8,ModeCategoryIdx=6,otherwise ModeCategoryIdx=7,for blocksizeIdx=1

[0185] If ModeIdx<=3,ModeCategoryIdx=5,else if ModeIdx<=4,ModeCategoryIdx=6,otherwise ModeCategoryIdx=7,for blocksizeIdx=2

[0186] It should be further explained that the first threshold value can be 6, the second threshold value can be 8, the third threshold value can be 3, and the fourth threshold value can be 4; the fourth preset value can be 0, the fifth preset value can be 1, the sixth preset value can be 1, the seventh preset value can be 2, the eighth preset value can be 0, the ninth preset value can be 1, and the tenth preset value can be 2.

[0187] Exemplarily, when the block size index value (blocksizeIdx) is equal to 0, if the MIP mode index value (modeIdx) is less than or equal to 6, the MIP mode type index value is set to 0, otherwise the MIP mode type index value is set to 1; when the block size index value (blocksizeIdx) is equal to 1, if the MIP mode index value (modeIdx) is less than or equal to 8, the MIP mode type index value is set to 1, otherwise the MIP mode type index value is set to 2; when the block size index value (blocksizeIdx) is equal to 2, if the MIP mode index value (modeIdx) is less than or equal to 3, the MIP mode type index value is set to 0, otherwise if the MIP mode index value (modeIdx) is less than or equal to 4, the MIP mode type index value is set to 1, otherwise the MIP mode type index value is set to 2. The specific representation is as follows,

[0188] If ModeIdx<=6,ModeCategoryIdx=0,otherwise ModeCategoryIdx=1,for blocksizeIdx=0

[0189] If ModeIdx<=8,ModeCategoryIdx=1,otherwise ModeCategoryIdx=2,for blocksizeIdx=1

[0190] If ModeIdx<=3,ModeCategoryIdx=0,else if ModeIdx<=4,ModeCategoryIdx=1,otherwise ModeCategoryIdx=2,for blocksizeIdx=2.

[0191] In the above embodiment, by simplifying the determination manner of the shift factor, especially minimizing the shift table, the storage of the lookup table can be minimized, so that the memory occupied by the shift table in the MIP mode can be reduced without increasing the calculation complexity.

[0192] In this way, in the MIP mode, the MIP input sampling matrix, the MIP weight matrix and the shift factor can be obtained, so as to determine the intra prediction value of the current block subsequently.

[0193] S303: determining the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sampling matrix.

[0194] It should be noted that after obtaining the MIP input sampling matrix, the MIP weight matrix and the shift factor, the MIP prediction block of the current block can be determined first, and then the intra prediction value of the current block is determined. Specifically, in some embodiments, for S303, the intra prediction value of the current block is determined according to the MIP weight matrix, the shift factor and the MIP input sampling matrix, can include:

[0195] The MIP input sampling matrix, the MIP weight matrix and the shift factor are processed by matrix multiplication using a pre-designed calculation model to obtain the MIP prediction block of the current block.

[0196] The MIP prediction block is filtered to obtain the intra prediction value of the current block; wherein the MIP prediction block contains the prediction value of at least part of the pixel positions in the current block.

[0197] That is, after obtaining the MIP input sampling matrix, the MIP weight matrix and the shift factor, the MIP prediction block of the current block can be determined first using a pre-designed calculation model, wherein the MIP prediction block contains the prediction value of at least part of the pixel positions in the current block.

[0198] Specifically, in the MIP mode, the MIP weight matrix (denoted as mWeight), the shift factor (denoted as sW) and the offset factor (denoted as fO) can be determined according to the block size index value (denoted as blocksizeIdx) of the current block and the MIP mode index value (denoted as modeIdx); then the MIP input sampling matrix (denoted as P[x]), mWeight, sW and fO are input into the matrix multiplication process to obtain the MIP prediction block (denoted as predMip[x][y]) output by the matrix multiplication, and the sampling points in predMip[x][y] are arranged in the form of a matrix according to predSize x predSize. Wherein, the pre-designed calculation model is as follows,

[0199]

[0200] wherein, [x][y] represents the position coordinates of a pixel point, x represents the horizontal direction, and y represents the vertical direction; inSize represents the input sampling number, and predSize represents the side length of the MIP prediction block predMip. Here, predSize is only related to the current block type mipSizeId; when mipSizeId=0 or 1, the output MIP prediction block is 4x4, and then predSize is equal to 4; when mipSizeId=2, the output MIP prediction block is 8x8, and then predSize is equal to 8. In this way, according to the above formula (8), the temporary prediction value of at least one pixel in the MIP prediction block predMip can be calculated to obtain the MIP prediction block.

[0201] Further, the prediction sampling values in the MIP prediction block also need to be bit-embedded to obtain the MIP prediction block of the current block; then it is judged whether the MIP prediction block needs to be transposed; if the result of the judgment is yes, the prediction sampling values in the MIP prediction block also need to be transposed, and the transposed MIP prediction block is determined as the MIP prediction block of the current block; if the result of the judgment is no, the prediction sampling values in the MIP prediction block do not need to be transposed, and the MIP prediction block can be directly determined as the MIP prediction block of the current block.

[0202] Further, in some embodiments, the filtering processing of the MIP prediction block to obtain the intra prediction value of the current block can include:

[0203] judging whether the size of the MIP prediction block is the same as the size of the current block;

[0204] when the size of the MIP prediction block is the same as the size of the current block, setting the intra prediction block of the current block to be equal to the MIP prediction block; wherein the MIP prediction block contains the prediction sampling values of all pixel positions in the current block;

[0205] when the size of the MIP prediction block is not the same as the size of the current block, performing filtering processing on the MIP prediction block to obtain a filtered prediction block, and setting the filtered prediction block as the intra prediction block of the current block.

[0206] Here, the filtering processing can include up-sampling filtering processing or low-pass filtering processing.

[0207] It should be understood that, after obtaining the MIP prediction block, since the size of the MIP prediction block only includes two kinds: 4x4 MIP prediction block and 8x8 MIP prediction block; thus, the size of the current block can be the same as the size of the MIP prediction block, or can not be the same; that is, the sampling values corresponding to the MIP prediction block can not be able to fill the current block, so that the generation of the final prediction value can need to perform an upsampling operation on the MIP prediction block, that is, by judging whether the size of the MIP prediction block is the same as the size of the current block, to determine whether to perform the upsampling processing on the MIP prediction block.

[0208] It should be noted that, when the size of the MIP prediction block is the same as the size of the current block, that is, the width and height of the MIP prediction block are the same as the current block, it indicates that the upsampling processing on the MIP prediction block is not needed, at this time, the MIP prediction block can be directly filled into the current block, that is, there is no empty pixel point in the current block after filling, at this time, the intra prediction value of each pixel in the current block can be directly set as the prediction value of each pixel in the MIP prediction block, as follows,

[0209] predSamples[x][y] = predMip[x][y] (9)

[0210] Wherein, [x][y] represents the position coordinates of the pixel point, x represents the horizontal direction, y represents the vertical direction; predSamples[x][y] represents the intra prediction value corresponding to the pixel point with position coordinates [x][y] in the current block, predMip[x][y] represents the prediction value corresponding to the pixel point with position coordinates [x][y] in the MIP prediction block. In this way, according to formula (9), the MIP prediction block predMip[x][y] can be directly taken as the frame prediction block predSamples[x][y] of the current block.

[0211] It should be further noted that when the size of the MIP prediction block is not the same as the size of the current block, i.e. at least one of the width and height of the MIP prediction block is not the same as the current block, the MIP prediction block cannot fill the current block, i.e. there are empty pixel points in the current block after filling, indicating that the MIP prediction block needs to be filtered at this time. That is, if the up-sampling processing is needed in the horizontal direction and the vertical direction, the MIP prediction block can be up-sampled in the horizontal direction first and then up-sampled in the vertical direction to obtain a first up-sampled block, which can be represented by predSamples[x][y]; then the MIP prediction block is up-sampled in the vertical direction and then up-sampled in the horizontal direction to obtain a second up-sampled block, which can be represented by predSamplesTemp[x][y]; finally, the weighted average of predSamples[x][y] and predSamplesTemp[x][y] is calculated to obtain the intra prediction block of the current block.

[0212] Exemplarily, if the side length nTbS (here, S can be replaced by W and H respectively) of the current block is equal to the side length predSize (here, predSize is only related to the blocksizeIdx of the current block) of the MIP prediction block, the MIP prediction block can be directly set as the intra prediction block of the current block at this time; otherwise, the MIP prediction block needs to be filtered to obtain the intra prediction block of the current block. The generation process of the intra prediction block can be referred to Fig. 4, still taking the 4x4 current block as an example, in Fig. 4, since the size of the current block is the same as that of the MIP prediction block, the MIP prediction block does not need to be filtered at this time, and the MIP prediction block can be directly set as the intra prediction block of the current block, so that the intra prediction value of at least one pixel in the current block can be obtained.

[0213] The embodiment provides an image component prediction method, applied to an encoder. A prediction parameter of a current block is determined, wherein the prediction parameter comprises a prediction mode parameter and a size parameter of the current block; when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block, a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sample matrix of the current block are determined; and the intra prediction value of the current block is determined according to the MIP weight matrix, the shift factor and the MIP input sample matrix. In this way, the determination mode of the shift factor can be simplified, and when the shift factor is determined by using a lookup table, the memory occupied by the lookup table can be reduced at the same time under the condition of reducing the calculation complexity, so that the purpose of improving the coding efficiency is achieved.

[0214] Based on the application scenario example shown in FIG. 2B, referring to FIG. 5, a flowchart of another image component prediction method provided by the embodiments of the present application is shown. As shown in FIG. 5, the method can include the following steps.

[0215] S501: parsing a code stream to obtain a prediction parameter of a current block, wherein the prediction parameter includes a prediction mode parameter and a size parameter of the current block;

[0216] It should be noted that the method is applied to a decoder. A video image can be divided into a plurality of image blocks, and each current image block to be decoded can be referred to as a decoding block. Here, each decoding block can include a first image component, a second image component and a third image component; and the current block is a decoding block in a video image which is currently to be predicted by a first image component, a second image component or a third image component.

[0217] It should be further noted that the prediction parameter is used to indicate a prediction mode adopted by the current block and parameters related to the prediction mode. The prediction mode usually includes an inter-prediction mode, a traditional intra-prediction mode and a non-traditional intra-prediction mode, and the non-traditional intra-prediction mode includes an MIP mode, a CCLM mode, an IBC mode and a PLT mode. That is, the encoder selects an optimal prediction mode to precode the current block, and in this process, the prediction mode of the current block can be determined, so that the prediction parameter in the prediction mode is written into the code stream and transmitted to the decoder by the encoder.

[0218] In this way, on the decoder side, the prediction parameter of the current block can be obtained by parsing the code stream, and the prediction mode parameter contained in the prediction parameter obtained by parsing can be used to determine whether the MIP mode is used for the current block.

[0219] S502: when the prediction mode parameter indicates that a matrix-based intra-prediction (MIP) mode is used to determine an intra-prediction value of the current block, determining an MIP weight matrix of the current block, a shift factor of the current block and an MIP input sample matrix of the current block;

[0220] It should be noted that for the current block, if the MIP mode is used to determine the intra-prediction value of the current block, then the MIP input sample matrix of the current block, the MIP weight matrix of the current block and the shift factor of the current block need to be determined; wherein the shift factor can also be referred to as a shift bit number, a weight shift value, and can be represented by sW, shift or weight shift.

[0221] In some embodiments, the shift factor of the current block can include a constant value shift factor and a shift factor determined according to the prediction parameter.

[0222] In a possible implementation, the shift factor can be set as a fixed constant value. In the embodiments of the present application, the constant value of the shift factor is preferably equal to 6, but this is not limited in this way.

[0223] In another possible implementation, the shift factor determined according to the prediction parameter can include:

[0224] determining a block size index value of the current block according to the size parameter of the current block;

[0225] determining the shift factor according to the block size index value of the current block.

[0226] It should be noted that the block size index value (denoted as mipSizeId or blocksizeIdx) of the current block can be determined according to the size parameter of the current block. Specifically, the determination of the block size index value of the current block according to the size parameter of the current block can include:

[0227] when the width and the height of the current block are both equal to 4, setting the block size index value of the current block as 0;

[0228] when the width and the height of the current block are both equal to 8, or one of the width and the height of the current block is equal to 4, setting the block size index value of the current block as 1;

[0229] when the width and the height of the current block do not satisfy the foregoing conditions, setting the block size index value of the current block as 2.

[0230] In this way, after the block size index value of the current block is determined, the shift factor can be further determined according to the block size index value of the current block, in combination with the number of MIP input sampling values or the size of the MIP prediction block.

[0231] Optionally, in some embodiments, the determination of the shift factor according to the block size index value of the current block can include:

[0232] setting the shift factor as equal to the ratio between the width or the height of the current block and a first preset value corresponding to the block size index value of the current block.

[0233] Here, the first preset value represents the number of MIP input sampling values obtained from the boundary of the current block. In this case, the method can further include:

[0234] when the block size index value of the current block is equal to 0, 1 and 2 respectively, determining that the first preset value corresponding to the block size index value of the current block is equal to 2, 4 and 4 respectively.

[0235] That is, when the first preset value represents the number of MIP input sampling values obtained from the boundary of the current block, if the block size index value of the current block is equal to 0, the corresponding first preset value is equal to 2; if the block size index value of the current block is equal to 1, the corresponding first preset value is equal to 4; if the block size index value of the current block is equal to 2, the corresponding first preset value is equal to 4, so that the shift factor can be determined according to the ratio between the width or height of the current block and the corresponding first preset value.

[0236] Optionally, in some embodiments, the determining the shift factor according to the block size index value of the current block can comprise:

[0237] setting the shift factor to be equal to the ratio between the width or height of the current block and a second preset value corresponding to the block size index value of the current block.

[0238] Here, the second preset value represents the size of the MIP prediction block of the current block obtained by directly using the MIP weight matrix for calculation. In this case, the method can further comprise:

[0239] when the block size index value of the current block is equal to 0, 1 and 2 respectively, determining that the second preset value corresponding to the block size index value of the current block is equal to 4, 4 and 8 respectively.

[0240] That is, when the second preset value represents the size of the MIP prediction block of the current block obtained by directly using the MIP weight matrix for calculation, if the block size index value of the current block is equal to 0, the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 1, the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 2, the corresponding second preset value is equal to 8, so that the shift factor can be determined according to the ratio between the width or height of the current block and the corresponding second preset value.

[0241] In yet another possible implementation, the shift table can be minimized, and the shift factor is still determined in the manner of looking up the table. Optionally, in some embodiments, for S502, the method further comprises:

[0242] determining the block size index value of the current block according to the size parameter of the current block;

[0243] inquiring the shift factor corresponding to the determined block size index value from a first preset lookup table according to the determined block size index value, wherein the first preset lookup table is used to record the corresponding values between the block size index value and the shift factor;

[0244] determining the inquired shift factor as the shift factor corresponding to the current block.

[0245] It should be noted that in the decoder, a shift table (such as the first preset lookup table or the second preset lookup table) is also established in advance and stored in the decoder. In this way, when the shift factor is queried only according to the block size index value of the current block, the first preset lookup table shown in Table 5 can be used. In Table 5, for each block size index value, a fixed shift factor can be corresponded, that is, each block size or each block size set can have a fixed shift value as shown in Table 5.

[0246] In another possible implementation, the shift table can still be minimized, and the shift factor can still be determined using the lookup table. Optionally, in some embodiments, for S502, the method can further include:

[0247] when the prediction mode parameter indicates that the MIP mode is used to determine the intra prediction value of the current block, determining a MIP mode type index value of the current block;

[0248] querying, according to the determined MIP mode type index value, a shift factor corresponding to the determined MIP mode type index value from a second preset lookup table, wherein the second preset lookup table is used to record the corresponding values between the MIP mode type index value and the shift factor;

[0249] determining the queried shift factor as the shift factor corresponding to the current block.

[0250] It should be noted that when the shift factor is queried only according to the MIP mode type index value (denoted as ModeCategoryIdx) of the current block, the second preset lookup table shown in Table 6 can be used. In Table 6, for each MIP mode type index value, a fixed shift factor can be corresponded, that is, according to ModeCategoryIdx, a fixed shift value as shown in Table 6 can be performed.

[0251] Further, ModeCategoryIdx can be derived according to the MIP mode index value. Specifically, the determination of the MIP mode type index value of the current block can include:

[0252] determining, according to the prediction parameter, a block size index value corresponding to the current block and a MIP mode index value when the MIP mode is used for prediction;

[0253] determining, according to the block size index value and the MIP mode index value, the MIP mode type index value of the current block.

[0254] That is, after obtaining the block size index value and the MIP mode index value of the current block, the MIP mode type index value can be calculated by using a hash method, or can be determined according to a conditional judgment.

[0255] Optionally, the MIP mode type index value is calculated by using a hash method. In some embodiments, the determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value comprises:

[0256] when the block size index value is equal to 0,

[0257] performing right shift processing on the MIP mode index value by using a first preset displacement value to obtain the MIP mode type index value of the current block;

[0258] or, when the block size index value is equal to 1,

[0259] performing right shift processing on the MIP mode index value by using a first preset displacement value to obtain a right shift processed value;

[0260] performing superposition processing on the right shift processed value and a third preset value to obtain the MIP mode type index value of the current block;

[0261] or, when the block size index value is equal to 2,

[0262] performing right shift processing on the MIP mode index value by using a second preset displacement value to obtain the MIP mode type index value of the current block.

[0263] Exemplarily, the first preset displacement value can be 3, the second preset displacement value can be 2, and the third preset value can be 1; the specific representation is as follows,

[0264] ModeCategoryIdx=ModeIdx>>3.for blocksizeIdx=0

[0265] ModeCategoryIdx=(ModeIdx>>3)+1.for blocksizeIdx=1

[0266] ModeCategoryIdx=ModeIdx>>2.for blocksizeIdx=2

[0267] Optionally, the MIP mode type index value is determined according to a conditional judgment. In some embodiments, the determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value comprises:

[0268] when the block size index value is equal to 0,

[0269] if the MIP mode index value is less than or equal to a first threshold value, determining the MIP mode index value as a fourth preset value;

[0270] if the MIP mode index value is greater than the first threshold value, determining the MIP mode index value as a fifth preset value;

[0271] or, when the block size index value is equal to 1,

[0272] if the MIP mode index value is less than or equal to a second threshold value, determining the MIP mode index value as a sixth preset value;

[0273] if the MIP mode index value is greater than the second threshold value, determining the MIP mode index value as a seventh preset value;

[0274] or, when the block size index value is equal to 2,

[0275] if the MIP mode index value is less than or equal to a third threshold value, determining the MIP mode index value as an eighth preset value;

[0276] if the MIP mode index value is greater than the third threshold value and less than or equal to a fourth threshold value, determining the MIP mode index value as a ninth preset value;

[0277] if the MIP mode index value is greater than the fourth threshold value, determining the MIP mode index value as a tenth preset value.

[0278] Exemplarily, the first threshold value can be 6, the second threshold value can be 8, the third threshold value can be 3, and the fourth threshold value can be 4.

[0279] when the fourth preset value can be 5, the fifth preset value can be 6, the sixth preset value can be 6, the seventh preset value can be 7, the eighth preset value can be 5, the ninth preset value can be 6, and the tenth preset value is 7, the specific representation is as follows,

[0280] If ModeIdx<=6,ModeCategoryIdx=5,otherwise ModeCategoryIdx=6,for blocksizeIdx=0

[0281] If ModeIdx<=8,ModeCategoryIdx=6,otherwise ModeCategoryIdx=7,for blocksizeIdx=1

[0282] If ModeIdx<=3,ModeCategoryIdx=5,else if ModeIdx<=4,ModeCategoryIdx=6,otherwise ModeCategoryIdx=7,for blocksizeIdx=2

[0283] Alternatively, when the fourth preset value can be 0, the fifth preset value can be 1, the sixth preset value can be 1, the seventh preset value can be 2, the eighth preset value can be 0, the ninth preset value can be 1, and the tenth preset value is 2, the specific representation is as follows,

[0284] If ModeIdx<=6,ModeCategoryIdx=0,otherwise ModeCategoryIdx=1,for blocksizeIdx=0

[0285] If ModeIdx<=8,ModeCategoryIdx=1,otherwise ModeCategoryIdx=2,for blocksizeIdx=1

[0286] If ModeIdx<=3,ModeCategoryIdx=0,else if ModeIdx<=4,ModeCategoryIdx=1,otherwise ModeCategoryIdx=2,for blocksizeIdx=2.

[0287] In the above embodiment, by simplifying the determination manner of the shift factor, especially minimizing the shift table, the storage of the lookup table can be minimized, so that the memory occupied by the shift table in the MIP mode can be reduced without increasing the calculation complexity.

[0288] In this way, in the MIP mode, the MIP input sampling matrix and the MIP weight matrix can also be obtained, so as to determine the intra prediction value of the current block subsequently.

[0289] S503: Determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sampling matrix.

[0290] It should be noted that, after obtaining the MIP input sampling matrix, the MIP weight matrix and the shift factor, the MIP prediction block of the current block can be determined first, and then the intra prediction value of the current block is determined. Specifically, for S503, the determining the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sampling matrix can include:

[0291] performing matrix multiplication processing on the MIP input sampling matrix, the MIP weight matrix and the shift factor by using a pre-designed calculation model to obtain the MIP prediction block of the current block;

[0292] performing filtering processing on the MIP prediction block to obtain the intra prediction value of the current block; wherein the MIP prediction block contains the prediction values of at least part of the pixel positions in the current block.

[0293] That is, after obtaining the MIP input sampling matrix, the MIP weight matrix and the shift factor, the MIP prediction block of the current block can be determined first; and then according to the obtained MIP prediction block, the intra prediction value of the current block can be further determined by judging whether the size of the MIP prediction block is the same as the size of the current block. Specifically, according to the judgment result, when the size of the MIP prediction block is the same as the size of the current block, the intra prediction block of the current block is set to be equal to the MIP prediction block; at this time, the MIP prediction block contains the prediction sampling values of all pixel positions in the current block; when the size of the MIP prediction block is not the same as the size of the current block, the MIP prediction block is filtered to obtain a filtered prediction block, and the filtered prediction block is set as the intra prediction block of the current block. Here, the filtering processing can include up-sampling filtering processing or low-pass filtering processing.

[0294] The embodiment provides an image component prediction method applied to a decoder. By parsing a code stream, prediction parameters of a current block are obtained, wherein the prediction parameters include a prediction mode parameter and a size parameter of the current block; when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block, a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sampling matrix of the current block are determined; and the intra prediction value of the current block is determined according to the MIP weight matrix, the shift factor and the MIP input sampling matrix. In this way, the determination mode of the shift factor can be simplified, and when the shift factor is determined by using a lookup table, the memory occupied by the lookup table for storage can be reduced at the same time under the condition of reducing the calculation complexity, so as to improve the decoding efficiency.

[0295] Based on the same inventive concept as the foregoing embodiments, referring to FIG. 6, a schematic diagram of a composition structure of an encoder 60 is shown according to an embodiment of the present application. As shown in FIG. 6, the encoder 60 can include a first determining unit 601 and a first prediction unit 602; wherein,

[0296] The first determining unit 601 is configured to determine a prediction parameter of a current block, wherein the prediction parameter includes a prediction mode parameter and a size parameter of the current block.

[0297] The first determining unit 601 is further configured to, when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block, determine a MIP weight matrix of the current block, a shift factor of the current block, and a MIP input sample matrix of the current block.

[0298] The first prediction unit 602 is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.

[0299] In some embodiments, the shift factor of the current block includes a constant value shift factor and a shift factor determined according to the prediction parameter.

[0300] In some embodiments, the constant value shift factor has a value equal to 6.

[0301] In some embodiments, the first determining unit 601 is further configured to determine a block size index value of the current block according to the size parameter of the current block; and determine the shift factor according to the block size index value of the current block.

[0302] In some embodiments, referring to FIG. 7, the encoder 60 can further include a first setting unit 603 configured to set the block size index value of the current block to 0 when the width and the height of the current block are both equal to 4; set the block size index value of the current block to 1 when the width and the height of the current block are both equal to 8, or one of the width and the height of the current block is equal to 4; and set the block size index value of the current block to 2 when the width and the height of the current block do not satisfy the foregoing conditions.

[0303] In some embodiments, the first setting unit 603 is further configured to set the shift factor to be equal to a ratio between the width or the height of the current block and a first preset value corresponding to the block size index value of the current block.

[0304] In some embodiments, the first preset value represents a number of MIP input sample values obtained from a boundary of the current block.

[0305] In some embodiments, the first determining unit 601 is further configured to determine that the first preset value corresponding to the block size index value of the current block is equal to 2, 4 and 4 respectively when the block size index value of the current block is equal to 0, 1 and 2 respectively.

[0306] In some embodiments, the first setting unit 603 is further configured to set the shift factor to be equal to a ratio between the width or height of the current block and a second preset value corresponding to the block size index value of the current block.

[0307] In some embodiments, the second preset value represents a size of a MIP prediction block of the current block obtained by directly using the MIP weight matrix.

[0308] In some embodiments, the first determining unit 601 is further configured to determine that the second preset value corresponding to the block size index value of the current block is equal to 4, 4 and 8 respectively when the block size index value of the current block is equal to 0, 1 and 2 respectively.

[0309] In some embodiments, referring to FIG. 7, the encoder 60 can further include a first querying unit 604; wherein,

[0310] The first determining unit 601 is further configured to determine the block size index value of the current block according to the size parameter of the current block.

[0311] The first querying unit 604 is configured to query a shift factor corresponding to the determined block size index value from a first preset lookup table according to the determined block size index value, wherein the first preset lookup table is used to record corresponding values between block size index values and shift factors; and determine the queried shift factor as the shift factor corresponding to the current block.

[0312] In some embodiments, the first determining unit 601 is further configured to determine a MIP mode type index value of the current block when the prediction mode parameter indicates that the MIP mode is used to determine the intra prediction value of the current block.

[0313] The first querying unit 604 is further configured to query a shift factor corresponding to the determined MIP mode type index value from a second preset lookup table according to the determined MIP mode type index value, wherein the second preset lookup table is used to record corresponding values between MIP mode type index values and shift factors; and determine the queried shift factor as the shift factor corresponding to the current block.

[0314] In some embodiments, the first determining unit 601 is specifically configured to determine a block size index value corresponding to the current block and a MIP mode index value when the current block is predicted using the MIP mode; and determine a MIP mode type index value of the current block according to the block size index value and the MIP mode index value.

[0315] In some embodiments, referring to FIG. 7, the encoder 60 can further include a first calculating unit 605 configured to, when the block size index value is equal to 0, right shift the MIP mode index value by a first preset displacement value to obtain the MIP mode type index value of the current block; or, when the block size index value is equal to 1, right shift the MIP mode index value by the first preset displacement value to obtain a right-shifted value; superimpose the right-shifted value and a third preset value to obtain the MIP mode type index value of the current block; or, when the block size index value is equal to 2, right shift the MIP mode index value by a second preset displacement value to obtain the MIP mode type index value of the current block.

[0316] In some embodiments, referring to FIG. 7, the encoder 60 can further include a first judging unit 606 configured to, when the block size index value is equal to 0, if the MIP mode index value is less than or equal to a first threshold value, determine the MIP mode index value as a fourth preset value; or, if the MIP mode index value is greater than the first threshold value, determine the MIP mode index value as a fifth preset value; or, when the block size index value is equal to 1, if the MIP mode index value is less than or equal to a second threshold value, determine the MIP mode index value as a sixth preset value; or, if the MIP mode index value is greater than the second threshold value, determine the MIP mode index value as a seventh preset value; or, when the block size index value is equal to 2, if the MIP mode index value is less than or equal to a third threshold value, determine the MIP mode index value as an eighth preset value; or, if the MIP mode index value is greater than the third threshold value and less than or equal to a fourth threshold value, determine the MIP mode index value as a ninth preset value; or, if the MIP mode index value is greater than the fourth threshold value, determine the MIP mode index value as a tenth preset value.

[0317] In some embodiments, referring to FIG. 7, the encoder 60 can further include a pre-encoding unit 607 configured to pre-encode the current block using a plurality of prediction modes to obtain a rate-distortion cost value corresponding to each prediction mode; and select a minimum rate-distortion cost value from the obtained plurality of rate-distortion cost values, and determine a prediction parameter in a prediction mode corresponding to the minimum rate-distortion cost value as a prediction parameter of the current block.

[0318] In some embodiments, the first calculation unit 605 is further configured to perform matrix multiplication on the MIP input sampling matrix, the MIP weight matrix and the shift factor by using a pre-designed calculation model to obtain a MIP prediction block of the current block.

[0319] The first prediction unit 602 is specifically configured to perform filtering processing on the MIP prediction block to obtain an intra prediction value of the current block, wherein the MIP prediction block contains prediction values of at least part of pixel positions in the current block.

[0320] It can be understood that, in the embodiments of the present application, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in a processing unit, or can be physically present individually, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0321] When the integrated unit is realized in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the embodiments. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program codes that can be stored in the medium.

[0322] Therefore, the embodiments of the present application provide a computer storage medium applied to the encoder 60, and the computer storage medium stores a computer program. When the computer program is executed by a first processor, the method described in any one of the foregoing embodiments is implemented.

[0323] Based on the above encoder 60 composition and computer storage medium, referring to FIG. 8, a specific hardware structure example of the encoder 60 provided by the embodiments of the present application can include: a first communication interface 801, a first memory 802 and a first processor 803; each component is coupled together through a first bus system 804. It can be understood that the first bus system 804 is used to realize the connection communication between the components. The first bus system 804 includes not only a data bus, but also a power supply bus, a control bus and a state signal bus. However, in order to clearly illustrate, various buses are marked as the first bus system 804 in FIG. 8. Among them,

[0324] The first communication interface 801 is used for receiving and sending signals in the process of transmitting information with other external network elements;

[0325] The first memory 802 is used for storing computer programs capable of running on the first processor 803;

[0326] The first processor 803 is used for executing the following steps when running the computer programs:

[0327] Determine the prediction parameters of the current block, wherein the prediction parameters include the prediction mode parameters and the size parameters of the current block;

[0328] When the prediction mode parameters indicate that the intra prediction value of the current block is determined using the matrix-based intra prediction (MIP) mode, determine the MIP weight matrix of the current block, the shift factor of the current block and the MIP input sampling matrix of the current block;

[0329] According to the MIP weight matrix, the shift factor and the MIP input sampling matrix, determine the intra prediction value of the current block.

[0330] It is to be appreciated that the first memory 802 in embodiments of the application can be volatile or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of illustration, and not limitation, nonvolatile memory can be read only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which acts as external cache. By way of illustration and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The first memory 802 of the system and method described herein are intended to include, without being limited to, these and any other suitable types of memory.

[0331] The first processor 803 can be an integrated circuit chip having a processing capability for signals. In implementation, each step of the above method can be completed by integrated logic circuits of hardware or instructions in the form of software in the first processor 803. The first processor 803 described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the first memory 802, and the first processor 803 reads the information in the first memory 802 and combines the hardware to complete the steps of the above method.

[0332] It can be understood that the embodiments described in the present application can be realized by 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 processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for executing the functions described in the present application or a combination thereof. For software implementation, the technologies described in the present application can be implemented by modules (such as processes, functions, etc.) for executing the functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0333] Optionally, as another embodiment, the first processor 803 is further configured to execute the method according to any one of the preceding embodiments when running the computer program.

[0334] The embodiment provides an encoder, which can include a first determining unit and a first predicting unit; the first determining unit is configured to determine a prediction parameter of a current block, the prediction parameter including a prediction mode parameter and a size parameter of the current block; and is further configured to determine a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sampling matrix of the current block when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block; and the first predicting unit is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sampling matrix. In this way, the determination manner of the shift factor can be simplified, and when the shift factor is determined by using a lookup table, the memory occupied by the lookup table for storage can be reduced at the same time in the case of reducing the calculation complexity, so that the coding efficiency is improved.

[0335] Based on the same inventive concept as the preceding embodiments, referring to FIG. 9, a constituent structure schematic diagram of a decoder 90 provided by the embodiment of the application is shown. As shown in FIG. 9, the decoder 90 can include a parsing unit 901, a second determining unit 902 and a second predicting unit 903; wherein,

[0336] The parsing unit 901 is configured to parse a code stream to obtain a prediction parameter of a current block, wherein the prediction parameter includes a prediction mode parameter and a size parameter of the current block;

[0337] The second determining unit 902 is configured to determine a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sampling matrix of the current block when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block;

[0338] The second predicting unit 903 is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sampling matrix.

[0339] In some embodiments, the shift factor of the current block includes a constant-value shift factor and a shift factor determined according to the prediction parameter.

[0340] In some embodiments, the constant-value shift factor has a value equal to 6.

[0341] In some embodiments, the second determining unit 902 is further configured to determine a block size index value of the current block according to the size parameter of the current block; and determine the shift factor according to the block size index value of the current block.

[0342] In some embodiments, referring to FIG. 10, the decoder 90 can further include a second setting unit 904 configured to set the block size index value of the current block to 0 when the width and the height of the current block are both equal to 4; set the block size index value of the current block to 1 when the width and the height of the current block are both equal to 8 or one of the width and the height of the current block is equal to 4; and set the block size index value of the current block to 2 when the width and the height of the current block do not satisfy the foregoing conditions.

[0343] In some embodiments, the second setting unit 904 is further configured to set the shift factor to be equal to a ratio between the width or the height of the current block and a first preset value corresponding to the block size index value of the current block.

[0344] In some embodiments, the first preset value represents a number of MIP input sampling values obtained from a boundary of the current block.

[0345] In some embodiments, the second determining unit 902 is further configured to determine that the first preset value corresponding to the block size index value of the current block is equal to 2, 4 and 4 respectively when the block size index value of the current block is equal to 0, 1 and 2 respectively.

[0346] In some embodiments, the second setting unit 904 is further configured to set the shift factor to be equal to a ratio between the width or the height of the current block and a second preset value corresponding to the block size index value of the current block.

[0347] In some embodiments, the second preset value represents a size of a MIP prediction block of the current block calculated directly using the MIP weight matrix.

[0348] In some embodiments, the second determining unit 902 is further configured to determine that the second preset value corresponding to the block size index value of the current block is equal to 4, 4 and 8 respectively when the block size index value of the current block is equal to 0, 1 and 2 respectively.

[0349] In some embodiments, referring to FIG. 10, the decoder 90 can further include a second querying unit 905; wherein,

[0350] The second determining unit 902 is further configured to determine a block size index value of the current block according to the size parameter of the current block.

[0351] The second query unit 905 is configured to query a shift factor corresponding to the determined block size index value from a first preset lookup table according to the determined block size index value, wherein the first preset lookup table is used to record corresponding values between block size index values and shift factors; and determine the queried shift factor as the shift factor corresponding to the current block.

[0352] In some embodiments, the second determination unit 902 is further configured to, when the prediction mode parameter indicates that the MIP mode is used to determine the intra prediction value of the current block, determine a MIP mode type index value of the current block.

[0353] The second query unit 905 is further configured to query a shift factor corresponding to the determined MIP mode type index value from a second preset lookup table according to the determined MIP mode type index value, wherein the second preset lookup table is used to record corresponding values between MIP mode type index values and shift factors; and determine the queried shift factor as the shift factor corresponding to the current block.

[0354] In some embodiments, the second determination unit 902 is specifically configured to determine a block size index value corresponding to the current block and a MIP mode index value when the MIP mode is used for prediction according to the prediction parameter; and determine a MIP mode type index value of the current block according to the block size index value and the MIP mode index value.

[0355] In some embodiments, referring to FIG. 10, the decoder 90 can further include a second calculation unit 906 configured to, when the block size index value is equal to 0, right shift the MIP mode index value by a first preset bit shift value to obtain the MIP mode type index value of the current block; or configured to, when the block size index value is equal to 1, right shift the MIP mode index value by a first preset bit shift value to obtain a right shift processed value; superimpose the right shift processed value and a third preset value to obtain the MIP mode type index value of the current block; or configured to, when the block size index value is equal to 2, right shift the MIP mode index value by a second preset bit shift value to obtain the MIP mode type index value of the current block.

[0356] In some embodiments, referring to FIG. 10, the decoder 90 can further include a second judging unit 907 configured to, when the block size index value is equal to 0, determine the MIP mode index value as a fourth preset value if the MIP mode index value is less than or equal to a first threshold value, determine the MIP mode index value as a fifth preset value if the MIP mode index value is greater than the first threshold value, or, when the block size index value is equal to 1, determine the MIP mode index value as a sixth preset value if the MIP mode index value is less than or equal to a second threshold value, determine the MIP mode index value as a seventh preset value if the MIP mode index value is greater than the second threshold value, or, when the block size index value is equal to 2, determine the MIP mode index value as an eighth preset value if the MIP mode index value is less than or equal to a third threshold value, determine the MIP mode index value as a ninth preset value if the MIP mode index value is greater than the third threshold value and less than or equal to a fourth threshold value, or determine the MIP mode index value as a tenth preset value if the MIP mode index value is greater than the fourth threshold value.

[0357] In some embodiments, the second calculating unit 906 is further configured to perform matrix multiplication processing on the MIP input sample matrix, the MIP weight matrix and the shift factor by using a pre-designed calculation model to obtain a MIP prediction block of the current block.

[0358] The second predicting unit 903 is specifically configured to perform filtering processing on the MIP prediction block to obtain an intra prediction value of the current block, wherein the MIP prediction block contains prediction values of at least part of pixel positions in the current block.

[0359] It can be understood that, in the present embodiment, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can be a module, and can also be non-modular. Moreover, the components in the present embodiment can be integrated in one processing unit, or can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0360] When the integrated unit is realized in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the present embodiment provides a computer storage medium applied to the decoder 90, which stores a computer program. When the computer program is executed by a second processor, the method described in any one of the preceding embodiments is implemented.

[0361] Based on the above composition of the decoder 90 and the computer storage medium, referring to FIG. 11, a specific hardware structure example of the decoder 90 provided by the embodiments of the present application is shown, which can include a second communication interface 1101, a second memory 1102 and a second processor 1103; and various components are coupled together through a second bus system 1104. It can be understood that the second bus system 1104 is used to realize the connection communication between the components. The second bus system 1104 includes not only a data bus, but also a power supply bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the second bus system 1104 in FIG. 11. Among them,

[0362] The second communication interface 1101 is used for receiving and sending signals in the process of transceiving information with other external network elements;

[0363] The second memory 1102 is used for storing computer programs capable of running on the second processor 1103;

[0364] The second processor 1103 is used for executing the following when running the computer programs:

[0365] Parsing a code stream to obtain a prediction parameter of a current block, wherein the prediction parameter includes a prediction mode parameter and a size parameter of the current block;

[0366] When the prediction mode parameter indicates that an intra prediction value of the current block is determined using a matrix-based intra prediction (MIP) mode, determining a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sample matrix of the current block;

[0367] Determining the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sample matrix.

[0368] Optionally, as another embodiment, the second processor 1103 is further configured to execute the method in any one of the preceding embodiments when running the computer programs.

[0369] It can be understood that the hardware functions of the second memory 1102 and the first memory 802 are similar, and the hardware functions of the second processor 1103 and the first processor 803 are similar; and here will not be described in detail.

[0370] The embodiment provides a decoder which can include a parsing unit, a second determining unit and a second prediction unit; the parsing unit is configured to parse a code stream, and acquire a prediction parameter of a current block, the prediction parameter including a prediction mode parameter and a size parameter of the current block; the second determining unit is configured to determine a MIP weight matrix of the current block, a shift factor of the current block and a MIP input sampling matrix of the current block when the prediction mode parameter indicates that a matrix-based intra prediction (MIP) mode is used to determine an intra prediction value of the current block; and the second prediction unit is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor and the MIP input sampling matrix. In this way, the determination mode of the shift factor can be simplified, and when the shift factor is determined by using a lookup table, the memory occupied by the lookup table for storage can be reduced at the same time under the condition of reducing the calculation complexity, so that the coding efficiency is improved.

[0371] It should be noted that in this application, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0372] The above sequence numbers of the embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0373] The methods disclosed in the several method embodiments provided by the application can be combined arbitrarily without conflict to obtain new method embodiments.

[0374] The features disclosed in the several product embodiments provided by the application can be combined arbitrarily without conflict to obtain new product embodiments.

[0375] The features disclosed in the several method or device embodiments provided by the application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.

[0376] The above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the application, which should be covered within the protection scope of the application. Therefore, the protection scope of the application should be subject to the protection scope of the claims. Industrial applicability

[0377] In the embodiments of the present application, the method is applied to an encoder or a decoder. After obtaining the prediction parameters of a current block, when the prediction mode parameter in the prediction parameters indicates that the MIP mode is used to determine the intra prediction value of the current block, the MIP weight matrix of the current block, the shift factor of the current block and the MIP input sampling matrix of the current block can be determined; and then the intra prediction value of the current block is determined according to the MIP weight matrix, the shift factor and the MIP input sampling matrix. In this way, no matter the decoder side or the encoder side, the determination manner of the shift factor can be simplified, and when the shift factor is determined by using the lookup table, the memory occupied by the lookup table for storage can be reduced at the same time under the condition of reducing the calculation complexity, so as to improve the coding efficiency.

Claims

1. An image component prediction method, applied to an encoder, the method comprising: Determine the prediction parameters of the current block, where the prediction parameters include a prediction mode parameter and a size parameter of the current block; When the prediction mode parameter indicates using the matrix-based intra prediction (MIP) mode to determine the intra prediction value of the current block, determine the MIP weight matrix of the current block, the shift factor of the current block, and the MIP input sampling matrix of the current block; Determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sampling matrix.

2. The method according to claim 1, wherein, The shift factor of the current block includes a shift factor with a constant value and a shift factor determined according to the prediction parameters.

3. The method according to claim 2, wherein, The value of the shift factor with a constant value is equal to 6.

4. The method according to claim 2, wherein, The shift factor determined according to the prediction parameters includes: Determine the block size index value of the current block according to the size parameter of the current block; Determine the shift factor according to the block size index value of the current block.

5. The method according to claim 4, wherein, The determining the block size index value of the current block according to the size parameter of the current block includes: When both the width and height of the current block are equal to 4, set the block size index value of the current block to 0; When both the width and height of the current block are equal to 8, or one of the width and height of the current block is equal to 4, set the block size index value of the current block to 1; When the width and height of the current block do not meet the foregoing conditions, set the block size index value of the current block to 2.

6. The method according to claim 4 or 5, wherein, The determining the shift factor according to the block size index value of the current block includes: Set the shift factor to be equal to the ratio between the width or height of the current block and a first preset value corresponding to the block size index value of the current block.

7. The method according to claim 6, wherein, The first preset value represents the number of MIP input sampling values obtained from the boundary of the current block.

8. The method according to claim 7, wherein, The method further includes: When the block size index value of the current block is equal to 0, 1, and 2 respectively, determine that the first preset values corresponding to the block size index value of the current block are equal to 2, 4, and 4 respectively.

9. The method according to claim 4 or 5, wherein, The determining the shift factor according to the block size index value of the current block includes: Set the shift factor to be equal to the ratio between the width or height of the current block and a second preset value corresponding to the block size index value of the current block.

10. The method according to claim 9, wherein, The second preset value represents the size of the MIP prediction block of the current block directly calculated using the MIP weight matrix.

11. The method according to claim 10, wherein, The method further includes: When the block size index value of the current block is equal to 0, 1, and 2 respectively, determine that the second preset values corresponding to the block size index value of the current block are equal to 4, 4, and 8 respectively.

12. The method according to claim 1, wherein, The method further includes: Determine the block size index value of the current block according to the size parameter of the current block; Query, from a first preset lookup table, the shift factor corresponding to the determined block size index value, where the first preset lookup table is used to record the corresponding values between the block size index value and the shift factor; Determine the shift factor queried as the shift factor corresponding to the current block.

13. The method according to claim 1, wherein, The method further includes: When the prediction mode parameter indicates that the intra-prediction value of the current block is determined using the MIP mode, determine the MIP mode type index value of the current block; According to the determined MIP mode type index value, query the shift factor corresponding to the determined MIP mode type index value from a second preset look-up table, where the second preset look-up table is used to record the corresponding values between the MIP mode type index value and the shift factor; Determine the shift factor queried as the shift factor corresponding to the current block.

14. According to the method of claim 13, wherein, The determining the MIP mode type index value of the current block includes: Determine the block size index value corresponding to the current block and the MIP mode index value when predicting using the MIP mode; According to the block size index value and the MIP mode index value, determine the MIP mode type index value of the current block.

15. According to the method of claim 14, wherein, The according to the block size index value and the MIP mode index value, determining the MIP mode type index value of the current block includes: When the block size index value is equal to 0, Perform a right shift process on the MIP mode index value using a first preset displacement value to obtain the MIP mode type index value of the current block; Or, when the block size index value is equal to 1, Perform a right shift process on the MIP mode index value using a first preset displacement value to obtain the value after the right shift process; Perform a superposition process on the value after the right shift process and a third preset value to obtain the MIP mode type index value of the current block; Or, when the block size index value is equal to 2, Perform a right shift process on the MIP mode index value using a second preset displacement value to obtain the MIP mode type index value of the current block.

16. According to the method of claim 14, wherein, The according to the block size index value and the MIP mode index value, determining the MIP mode type index value of the current block includes: When the block size index value is equal to 0, If the MIP mode index value is less than or equal to a first threshold value, determine the MIP mode index value as a fourth preset value; If the MIP mode index value is greater than the first threshold value, determine the MIP mode index value as a fifth preset value; Or, when the block size index value is equal to 1, If the MIP mode index value is less than or equal to a second threshold value, determine the MIP mode index value as a sixth preset value; If the MIP mode index value is greater than the second threshold value, determine the MIP mode index value as a seventh preset value; Or, when the block size index value is equal to 2, If the MIP mode index value is less than or equal to a third threshold value, determine the MIP mode index value as an eighth preset value; If the MIP mode index value is greater than the third threshold value and the MIP mode index value is less than or equal to a fourth threshold value, determine the MIP mode index value as a ninth preset value; If the MIP mode index value is greater than the fourth threshold value, determine the MIP mode index value as a tenth preset value.

17. According to the method of claim 1, wherein, The determining the prediction parameters of the current block includes: Perform pre-coding processing on the current block using multiple prediction modes to obtain the rate-distortion cost value corresponding to each prediction mode; Select the minimum rate-distortion cost value from the obtained multiple rate-distortion cost values, and determine the prediction parameters in the prediction mode corresponding to the minimum rate-distortion cost value as the prediction parameters of the current block.

18. According to the method of claim 1, wherein, The determining the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sampling matrix includes: Performing matrix multiplication processing on the MIP input sampling matrix, the MIP weight matrix, and the shift factor by using a pre-designed calculation model to obtain the MIP prediction block of the current block; Performing filtering processing on the MIP prediction block to obtain the intra prediction value of the current block; wherein, the MIP prediction block includes prediction values at at least some pixel positions in the current block.

19. An image component prediction method, applied to a decoder, the method comprising: Parse the code stream to obtain the prediction parameters of the current block, where the prediction parameters include a prediction mode parameter and the size parameter of the current block; When the prediction mode parameter indicates using the matrix-based intra prediction MIP mode to determine the intra prediction value of the current block, determine the MIP weight matrix of the current block, the shift factor of the current block, and the MIP input sampling matrix of the current block; Determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sampling matrix.

20. The method according to claim 19, wherein The shift factor of the current block includes a shift factor with a constant value and a shift factor determined according to the prediction parameters.

21. The method according to claim 20, wherein The value of the shift factor with a constant value is equal to 6.

22. The method according to claim 20, wherein The shift factor determined according to the prediction parameters includes: Determine the block size index value of the current block according to the size parameter of the current block; Determine the shift factor according to the block size index value of the current block.

23. The method according to claim 22, wherein The determining the block size index value of the current block according to the size parameter of the current block includes: When the width and height of the current block are both equal to 4, set the block size index value of the current block to 0; When the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, set the block size index value of the current block to 1; When the width and height of the current block do not meet the foregoing conditions, set the block size index value of the current block to 2.

24. The method according to claim 22 or 23, wherein The determining the shift factor according to the block size index value of the current block includes: Set the shift factor to be equal to the ratio between the width or height of the current block and a first preset value corresponding to the block size index value of the current block.

25. The method according to claim 24, wherein The first preset value represents the number of MIP input sampling values obtained from the boundary of the current block.

26. The method according to claim 25, wherein The method further includes: When the block size index values of the current block are respectively equal to 0, 1, and 2, determine that the first preset values corresponding to the block size index values of the current block are respectively equal to 2, 4, and 4.

27. The method according to claim 22 or 23, wherein The determining the shift factor according to the block size index value of the current block includes: Set the shift factor to be equal to the ratio between the width or height of the current block and a second preset value corresponding to the block size index value of the current block.

28. The method according to claim 27, wherein The second preset value represents the size of the MIP prediction block of the current block directly calculated by using the MIP weight matrix.

29. The method according to claim 28, wherein The method further includes: When the block size index values of the current block are respectively equal to 0, 1, and 2, determining that the second preset values corresponding to the block size index values of the current block are respectively equal to 4, 4, and 8.

30. The method according to claim 19, wherein The method further includes: Determining the block size index value of the current block according to the size parameter of the current block; Querying, from a first preset lookup table, a shift factor corresponding to the determined block size index value, where the first preset lookup table is used to record the corresponding values between the block size index value and the shift factor; Determining the shift factor queried as the shift factor corresponding to the current block.

31. The method according to claim 19, wherein The method further includes: When the prediction mode parameter indicates using the MIP mode to determine the intra prediction value of the current block, determining the MIP mode type index value of the current block; Querying, from a second preset lookup table, a shift factor corresponding to the determined MIP mode type index value, where the second preset lookup table is used to record the corresponding values between the MIP mode type index value and the shift factor; Determining the shift factor queried as the shift factor corresponding to the current block.

32. The method according to claim 31, wherein The determining the MIP mode type index value of the current block includes: Determining the block size index value corresponding to the current block and the MIP mode index value when using the MIP mode for prediction according to the prediction parameter; Determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value.

33. The method according to claim 32, wherein, The determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value includes: When the block size index value is equal to 0, Performing a right shift operation on the MIP mode index value by using a first preset displacement value to obtain the MIP mode type index value of the current block; Or, when the block size index value is equal to 1, Performing a right shift operation on the MIP mode index value by using a first preset displacement value to obtain a value after the right shift operation; Performing a superposition operation on the value after the right shift operation and a third preset value to obtain the MIP mode type index value of the current block; Or, when the block size index value is equal to 2, Performing a right shift operation on the MIP mode index value by using a second preset displacement value to obtain the MIP mode type index value of the current block.

34. The method according to claim 32, wherein, The determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value includes: When the block size index value is equal to 0, If the MIP mode index value is less than or equal to a first threshold value, determining the MIP mode index value as a fourth preset value; If the MIP mode index value is greater than the first threshold value, determining the MIP mode index value as a fifth preset value; Or, when the block size index value is equal to 1, If the MIP mode index value is less than or equal to a second threshold value, determining the MIP mode index value as a sixth preset value; If the MIP mode index value is greater than the second threshold value, determining the MIP mode index value as a seventh preset value; Alternatively, when the block size index value is equal to 2, if the MIP mode index value is less than or equal to a third threshold value, determine that the MIP mode index value is an eighth preset value; if the MIP mode index value is greater than the third threshold value and the MIP mode index value is less than or equal to a fourth threshold value, determine that the MIP mode index value is a ninth preset value; if the MIP mode index value is greater than the fourth threshold value, determine that the MIP mode index value is a tenth preset value.

35. The method according to claim 19, wherein, The determining the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sampling matrix includes: performing matrix multiplication processing on the MIP input sampling matrix, the MIP weight matrix, and the shift factor by using a pre-designed calculation model to obtain an MIP prediction block of the current block; performing filtering processing on the MIP prediction block to obtain the intra prediction value of the current block; wherein, the MIP prediction block includes prediction values of at least some pixel positions in the current block.

36. An encoder, the encoder comprising a first determination unit and a first prediction unit; wherein, The first determining unit is configured to determine prediction parameters of a current block, where the prediction parameters include a prediction mode parameter and a size parameter of the current block; The first determining unit is further configured to, when the prediction mode parameter indicates using the matrix-based intra prediction MIP mode to determine the intra prediction value of the current block, determine the MIP weight matrix of the current block, the shift factor of the current block, and the MIP input sampling matrix of the current block; The first prediction unit is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sampling matrix.

37. An encoder, the encoder comprising a first memory and a first processor; wherein, The first memory is used to store a computer program that can run on the first processor; The first processor is configured to execute the method according to any one of claims 1 to 18 when running the computer program.

38. A decoder, the decoder comprising a parsing unit, a second determination unit and a second prediction unit; wherein, The parsing unit is configured to parse a bitstream to obtain prediction parameters of a current block, where the prediction parameters include a prediction mode parameter and a size parameter of the current block; The second determining unit is configured to, when the prediction mode parameter indicates using the matrix-based intra prediction MIP mode to determine the intra prediction value of the current block, determine the MIP weight matrix of the current block, the shift factor of the current block, and the MIP input sampling matrix of the current block; The second prediction unit is configured to determine the intra prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sampling matrix.

39. A decoder, the decoder includes a second memory and a second processor; wherein, The second memory is used to store a computer program that can run on the second processor; The second processor is configured to execute the method according to any one of claims 19 to 35 when running the computer program.

40. A computer storage medium, wherein, The computer storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method according to any one of claims 1 to 18, or when executed by the second processor, it implements the method according to any one of claims 19 to 35.