Image component prediction method, encoder, decoder, and storage medium
Patent Information
- Application Number
- JP2024210945
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-07-11
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
【0015】 本願実施例は、画像成分予測方法、符号化器、復号化器、並びに記憶媒体を提供し、符号化器側では、現在のブロックの予測パラメータを決定し、前記予測パラメータは、予測モードパラメータおよび前記現在のブロックのサイズパラメータを含み、前記予測モードパラメータが、行列に基づくフレーム内予測(MIP)モードを使用して現在のブロックのフレーム内予測値を決定するように指示する場合、前記現在のブロックのMIP重み行列、前記現在のブロックのシフト因子、および前記現在のブロックのMIP入力サンプル行列を決定し、前記MIP重み行列、前記シフト因子、および前記MIP入力サンプル行列に従って、前記現在のブロックのフレーム内予測値を決定する。復号化器側では、ビットストリームを解析して、現在のブロックの予測パラメータを取得し、前記予測パラメータは、予測モードパラメータおよび前記現在のブロックのサイズパラメータを含み、前記予測モードパラメータが、行列に基づくフレーム内予測(MIP)モードを使用して現在のブロックのフレーム内予測値を決定するように指示する場合、前記現在のブロックのMIP重み行列、前記現在のブロックのシフト因子、および前記現在のブロックのMIP入力サンプル行列を決定し、前記MIP重み行列、前記シフト因子、および前記MIP入力サンプル行列に従って、前記現在のブロックのフレーム内予測値を決定する。このようにして、復号化器側または符号化器側のいずれにおいても、シフト因子の決定方式を簡略化することができ、さらに、ルックアップテーブルを使用してシフト因子を決定する場合、計算の複雑さを軽減しながら、ルックアップテーブルの記憶によって占有されるメモリを低減できることにより、符号化·復号化の効率を向上させるという目的を達成することができる。
Smart Images

Figure 2025029119000001_ABST
Abstract
Description
[Technical field]
[0001] REFERENCE TO RELATED APPLICATIONS 1) which claims priority to a U.S. provisional patent application, serial number 62 / 872,488, filed on July 10, 2019 in the names of Junyan Huo, Yanzhuo Ma, and Wei Zhang, and entitled “Matrix-Based Intra Prediction (MIP) Shift Unification According to Block Size and Mode Index”; 2) which claims priority to a U.S. provisional patent application, filed on July 11, 2019 in the names of Junyan Huo, Yanzhuo Ma, and Wei Zhang, serial number 62 / 872,830, entitled “Methods and Apparatuses for Matrix-Based Intra Prediction (MIP) Shift Unification”; and 3) This application claims priority to a U.S. provisional patent application, serial number 62 / 873,170, filed on July 11, 2019 in the names of Junyan Huo, Yanzhuo Ma, and Wei Zhang, entitled “Methods and Apparatuses for Matrix-Based Intra Prediction (MIP) Shift Unification.”
[0002] The present application relates to the technical field of video encoding and decoding, and in particular to an image component prediction method, an encoder, a decoder, and a storage medium. [Background technology]
[0003] 2. Description of the Related Art With increasing demands from people for video display quality, new video applications such as high definition and ultra-high definition video have emerged.
[0004] H.265 / High Efficiency Video Coding (HEVC) can no longer meet the needs of rapid development of video applications. Joint Video Exploration Team (JVET) has proposed the next generation video coding standard H.266 / Versatile Video Coding (VVC), and the corresponding VVC reference software test platform (VTM: VVC Test Model).
[0005] Currently, H.266 / VVC adopts matrix-based intra prediction (MIP) technology, in which different numbers of MIP prediction modes are added to the intra prediction process according to different types of current blocks in a frame. However, in the process of MIP prediction, especially in the matrix multiplication process, the shift factor determination is also correlated with the type of current block and the index number of MIP prediction mode, which makes the prediction process relatively complicated and the calculation complicated. Summary of the Invention [Problem to be solved by the invention]
[0006] The present embodiments provide an image component prediction method, an encoder, a decoder, and a storage medium that can simplify the method of determining a shift factor, and when a shift factor is determined using a lookup table, can reduce the memory occupied by storing the lookup table while reducing the calculation complexity. [Means for solving the problem]
[0007] The technical solutions of the embodiments of the present application can be realized as follows.
[0008] According to a first aspect, an embodiment of the present application provides a method for predicting an image component for application in an encoder, the method comprising: determining prediction parameters for a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block; If the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, 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; determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0009] According to a second aspect, an embodiment of the present invention provides an image component prediction method for application to a decoder, the method comprising: Parsing a bitstream to obtain prediction parameters for a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block; If the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, 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; determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0010] According to a third aspect, an embodiment of the present application provides an encoder comprising a first decision unit and a first prediction unit, The first determination unit is configured to determine prediction parameters of a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block; The first determination unit is further configured to, when the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, determine an MIP weight matrix of the current block, a shift factor of the current block, and a MIP input sample matrix of the current block; The first prediction unit is configured to determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0011] According to a fourth aspect, an embodiment of the present application provides an encoder comprising a first memory and a first processor, the first memory is configured to store a computer program executable by the first processor; The first processor is configured, when executing the computer program, to perform the method according to the first aspect.
[0012] According to a fifth aspect, an embodiment of the present invention provides a decoder, comprising: a parsing unit, a second determining unit, and a second predicting unit; The parsing unit is configured to parse a bitstream to obtain prediction parameters of a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block; The second determination unit is configured to determine, when the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, 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; The second prediction unit is configured to determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0013] According to a sixth aspect, an embodiment of the present invention provides a decoder comprising: a second memory; and a second processor; the second memory is configured to store a computer program executable by the second processor; The second processor is configured to, when executing the computer program, perform the method according to the second aspect.
[0014] According to a seventh aspect, an embodiment of the present application provides a computer storage medium having a computer program stored thereon, the computer program, when executed by a first processor, realizing a method according to the first aspect, or the computer program, when executed by a second processor, realizing a method according to the second aspect. Effect of the Invention
[0015] The present embodiment provides an image component prediction method, an encoder, a decoder, and a storage medium, in which an encoder side determines prediction parameters of a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block, and when the prediction mode parameter indicates to determine an intra-frame prediction value of the current block using a matrix-based intra-frame prediction (MIP) mode, determines 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, and determines the intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix. At the decoder side, the bitstream is analyzed to obtain prediction parameters of the current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block, and if the prediction mode parameter indicates to use a matrix-based intra-frame prediction (MIP) mode to determine the intra-frame 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, and the intra-frame 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 method of determining the shift factor can be simplified at either the decoder side or the encoder side, and further, when the shift factor is determined using a lookup table, the memory occupied by the storage of the lookup table can be reduced while the calculation complexity is reduced, thereby achieving the purpose of improving the efficiency of encoding and decoding. [Brief description of the drawings]
[0016] [Figure 1] 1 is a flowchart of a MIP prediction process according to a related technical solution. [Figure 2A] 1 is a block diagram showing the configuration of a video encoding system according to an embodiment of the present invention; [Figure 2B] 1 is a block diagram showing the configuration of a video decoding system according to an embodiment of the present invention; [Diagram 3] 1 is a schematic flowchart of an image component prediction method according to an embodiment of the present application. [Figure 4] FIG. 2 is a schematic diagram of a structure for generating intra-frame prediction values according to an embodiment of the present invention; [Diagram 5] 1 is a schematic flowchart of another image component prediction method according to an embodiment of the present disclosure. [Figure 6] FIG. 2 is a schematic diagram of the architecture of an encoder according to an embodiment of the present invention; [Figure 7] FIG. 4 is a schematic diagram of another encoder architecture according to an embodiment of the present invention; [Figure 8] FIG. 2 is a schematic diagram of a specific hardware structure of an encoder according to an embodiment of the present application; [Figure 9] FIG. 2 is a schematic diagram of a configuration of a decoder according to an embodiment of the present invention; [Figure 10] FIG. 2 is a schematic diagram of a configuration of a decoder according to an embodiment of the present invention; [Figure 11] FIG. 2 is a schematic diagram of a specific hardware structure of a decoder according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] In order to more fully understand the features and technical contents of the present embodiment, the implementation of the present embodiment will be described in detail below with reference to the drawings, and the attached drawings are for reference purposes only and are not intended to limit the present embodiment.
[0018] In a video image, a first image component, a second image component, and a third image component are usually used to represent a coding block (CB), where the three image components are a luminance component, a blue chrominance component, and a red chrominance component, respectively, and specifically, the luminance component is usually represented by the code Y, the blue chrominance component is usually represented by the code Cb or U, and the red chrominance component is usually represented by the code Cr or V. Thus, the video image can be represented in a YCbCr format or a YUV format.
[0019] In the present embodiment, the first image component may be a luminance component, the second image component may be a blue chrominance component, and the third image component may be a red chrominance component, but the present embodiment is not particularly limited thereto.
[0020] The following describes technical solutions related to the prediction process of current MIP technology.
[0021] The input data for MIP prediction mainly includes the position of the current block (xTbCmp, yTbCmp), the MIP mode index value when the current block uses MIP prediction (which can be represented by modeId or modeIdx), the height of the current block (which can be represented by nTbH), the width of the current block (which can be represented by nTbW), and a transposition processing indicator indicating whether transposition is required (which can be represented by isTransposed), etc.
[0022] The output data of MIP prediction mainly includes a prediction block of the current block, and the prediction value corresponding to the pixel coordinate [x][y] in the prediction block is predSamples[x][y], where x=0,1,...,nTbW-1, y=0,1,...,nTbH-1.
[0023] Here, as shown in FIG. 1, the MIP prediction process includes four steps: step 11 of configuring core parameters, step 12 of obtaining reference pixels, step 13 of constructing input samples, and step 14 of generating intraframe predicted values. Specifically, for step 11 of configuring core parameters, based on the size of the current block in the frame, the current block can be divided into three types, and mipSizeId or blocksizeIdx is used as the block size index value to record the type of the current block. The current blocks corresponding to different block size index values have different numbers of reference sampling points and different numbers of matrix multiplication output sampling points. For step 12 of obtaining reference pixels, when predicting the current block, the top block and the left block of the current block are both coded blocks. The reference pixels of the MIP technique are the reconstructed values of the pixels in the top row and the pixels in the left column of the current block, and the process of the reference pixels adjacent to the top edge of the current block (represented by refT) and the reference pixels adjacent to the left edge (represented by refL) is the process of obtaining reference pixels. For the step 13 of constructing input samples, this step is used for the input of matrix multiplication, and mainly includes: step 131 of obtaining reference samples, step 132 of constructing reference sample buffer, and step 133 of deriving matrix multiplication input samples. Here, the process of obtaining reference samples is a downsampling process, and step 132 of constructing reference sample buffer may further include: buffer filling manner 1321 when transposition is not required, and buffer filling manner 1322 when transposition is required. For the step of generating intraframe prediction value, this step is used for obtaining MIP prediction value of current block, and mainly includes: step 141 of constructing matrix multiplication output sample block, step 142 of embedding matrix multiplication output sample, step 143 of transposing matrix multiplication output sample, and step 144 of generating MIP final prediction value.Here, constructing a matrix multiplication output sample block step 141 may include obtaining a weight matrix step 1411, obtaining a shift factor and an offset factor step 1412, and performing matrix multiplication step 1413, and generating a MIP final prediction value step 144 may include generating a prediction value that does not require upsampling step 1441 and generating a prediction value that requires upsampling step 1442. In this way, after the four steps, an intra-frame prediction value of at least one pixel in the current block can be obtained.
[0024] In the MIP prediction process shown in FIG. 1, the MIP prediction can be expressed as follows:
number
[0025] where M is a matrix, R is an input sample vector derived from the reference sample pixel, and P is a predicted pixel value derived according to formula (1). That is, MIP is a coding tool that can be used to derive an intraframe prediction signal that involves matrix multiplication, and each specific matrix M corresponds to one MIP mode.
[0026] However, although the coefficients of the matrix are initially trained as floating-point values, in the computation process, these coefficients need to be stored and calculated as integer values. A common method for converting floating-point values to integer values is usually to multiply the floating-point values by a value of sufficient magnitude, thereby maintaining a suitable degree of precision. Such a method is usually called a shift operation. Specifically, a left shift operation is intended to derive an integer value, and can be realized by the following formula:
number
[0027] where val is the float matrix value, shift is the number of shift bits in the shift operation (which can also be abbreviated as the shift factor), VAL is the stored integer value, and "<<" represents the left shift operator.
[0028] In this way, we obtain the integer matrix, and then perform integer matrix multiplication. Finally, we perform a right shift operation on P to obtain the final MIP prediction value. The calculation formula for the whole process is as follows:
number
[0029] or
number
[0030] Here, (1<<(shift-1)) represents a rounding operation, and [>>] represents a right shift operator. However, in the latest MIP version, for different block sizes and different MIP modes, the corresponding shift values in the shift operation of Equation (3) or Equation (4) are different. That is, the current shift factor is closely correlated with the index number of the current block type and MIP prediction mode, which makes the prediction process relatively complex and the calculation complicated.
[0031] The present embodiment provides an image component prediction method applied to an encoder or decoder. After obtaining prediction parameters of a current block, if a prediction mode parameter in the prediction parameters indicates to use a MIP mode to determine an intraframe predicted 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 can be determined. Then, the intraframe predicted 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 method of determining the shift factor can be simplified on either the decoder side or the encoder side, and further, when a lookup table is used to determine the shift factor, the memory occupied by the storage of the lookup table can be reduced while reducing the complexity of calculation, thereby achieving the purpose of improving the efficiency of encoding and decoding.
[0032] Hereinafter, each embodiment of the present application will be described in detail with reference to the accompanying drawings.
[0033] 2A shows an example of a block diagram of a video encoding system according to an embodiment of the present application, and as shown in FIG. 2A, the video encoding system 10 includes a transform and quantization unit 101, an intraframe estimation unit 102, an intraframe prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image cache unit 110, etc., where the filtering unit 108 can realize deblocking filtering and Sample Adaptive Offset (SAO) filtering, and the encoding unit 109 can realize header information coding and Context-based Adaptive Binary Arithmetic Coding (CABAC). For an input original video signal, one video coding block can be obtained by dividing a coding tree unit (CTU), and then the residual pixel information obtained after performing intraframe or interframe prediction is transformed by a transform and quantization unit 101 (including transforming the residual information from pixel domain to transform domain and quantizing the obtained transform coefficients to further reduce the bit rate). The intraframe estimation unit 102 and the intraframe prediction unit 103 are configured to perform intraframe prediction on the video coding block, specifically, the intraframe estimation unit 102 and the intraframe prediction unit 103 are configured to determine an intraframe prediction mode used to encode the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are configured to perform interframe prediction encoding on the received video coding block with respect 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, according to which the motion of the video coding block can be estimated, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105. After determining the intraframe prediction mode, the intraframe prediction unit 103 is further configured to provide the selected intraframe prediction data to the coding unit 109, and the motion estimation unit 105 also sends the motion vector data determined by calculation to the coding unit 109. Furthermore, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block, i.e., reconstruct a residual block in the pixel domain, and the block artifacts of the reconstructed residual block are removed by the filter control analysis unit 107 and the filtering unit 108, and then add the reconstructed residual block to one prediction block in a frame of the decoded image cache unit 110 to generate a reconstructed video coding block. The coding unit 109 is configured to code various coding parameters and quantized transform coefficients, and in a CABAC-based coding algorithm, the context content can be based on neighboring coding blocks, and can be used to code information of the determined intra-frame prediction mode and output a bitstream of the video signal. The decoded picture cache unit 110 is configured to store the reconstructed video coding blocks as prediction references. As the video pictures are coded, new reconstructed video coding blocks are continuously generated, and these reconstructed video coding blocks are stored in the decoded picture cache unit 110.
[0034] FIG. 2B shows an example of a block diagram of a video decoding system according to an embodiment of the present application. As shown in FIG. 2B, the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intraframe prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image cache unit 206. Here, the decoding unit 201 can realize header information decoding CABAC decoding, and the filtering unit 205 can realize deblocking filtering and SAO filtering. After performing the encoding process shown in FIG. 2A on the input video signal, the system outputs a bitstream of the video signal. The bitstream is input to the video decoding system 20 and is first processed by the decoding unit 201 to obtain decoded transform coefficients. The transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain. The intra prediction unit 203 may be configured to generate prediction data of a current video decoded block based on the determined intra prediction mode and data of a previous decoded block from the current frame or image. The motion compensation unit 204 analyzes the motion vector and other related syntax elements to determine prediction information of the video decoded block, and uses the prediction information to generate a prediction block of the currently decoded video decoded block. The residual block from the inverse transform and inverse quantization unit 202 is summed with the corresponding prediction block generated by the intra prediction unit 203 or the motion compensation unit 204 to generate a decoded video block. Block artifacts of the decoded video signal are removed by the filtering unit 205, thereby improving the video quality. The decoded video block is then stored in the decoded image cache unit 206, which is configured to store a reference image used for subsequent intra prediction or motion compensation, and output a video signal, i.e., obtain a restored original video signal.
[0035] The image component prediction method in the present embodiment is mainly applied to the intraframe prediction unit 103 shown in Fig. 2A and the intraframe prediction unit 203 shown in Fig. 2B. That is, the image component prediction method in the present embodiment can be applied to not only a video encoding system but also a video decoding system, and can be simultaneously applied to a video encoding system and a video decoding system, but the present embodiment is not limited thereto. In addition, when the image component prediction method is applied to the intraframe prediction unit 103, the "current block" specifically refers to a block currently being coded in intraframe prediction, and when the image component prediction method is applied to the intraframe prediction unit 203, the "current block" specifically refers to a block currently being decoded in intraframe prediction.
[0036] Based on the example application scenario shown in Fig. 2A, Fig. 3 shows a schematic flowchart of an image component prediction method according to an embodiment of the present application. As shown in Fig. 3, the method may include the following steps:
[0037] In step S301, prediction parameters of a current block are determined, where the prediction parameters include a prediction mode parameter and a size parameter of the current block.
[0038] It should be noted that the method is applied to an encoder. A video image can be divided into multiple image blocks, and each image block currently being coded can be called a coding block (CB), where each coding block can include a first image component, a second image component, and a third image component, and the current block is the coding block on which the first image component, the second image component, or the third image component prediction is currently performed in the video image.
[0039] Here, if the current block performs a first image component prediction and the first image component is a luma component, i.e., the predicted image component is a luma component, the current block can also be called a luma block, or if the current block performs a second image component prediction and the second image component is a chroma component, i.e., the predicted image component is a chroma component, the current block can also be called a chroma block.
[0040] 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 determining the prediction parameter, a simple determination strategy can be adopted, such as determining the prediction parameter according to the magnitude of the distortion value, or a complex determination strategy can be adopted, such as determining the prediction parameter according to the result of Rate Distortion Optimization (RDO), and the present embodiment is not limited thereto. In general, the RDO method can be adopted to determine the prediction parameter of the current block.
[0041] Specifically, in some embodiments, in step S301, determining prediction parameters for the current block includes: precoding the current block using a plurality of prediction modes to obtain a rate-distortion cost value corresponding to each prediction mode; The method may include: selecting a minimum rate-distortion cost value from the obtained plurality of rate-distortion cost values; and determining prediction parameters under a prediction mode corresponding to the minimum rate-distortion cost value as prediction parameters of the current block.
[0042] That is, at the encoder side, for a current block, multiple prediction modes can be used to precode the current block. Here, the multiple prediction modes typically include an inter prediction mode and an intra prediction mode, and the intra prediction mode may include a conventional intra prediction mode and a non-conventional intra prediction mode. Specifically, the conventional intra prediction mode may include a direct current (DC) mode, a planar (PLANAR) mode, and an angle mode, etc., the non-conventional intra prediction mode may include a matrix-based intra prediction (MIP) mode, a cross-component linear model prediction (CCLM) mode, an intra block copy (IBC) mode, and a palette (PLT) mode, etc., and the inter prediction mode may include a conventional inter prediction mode and an inter geometrical partitioning for inter blocks (GEO) mode, etc.
[0043] In this way, after precoding the current block using multiple prediction modes respectively, a rate-distortion cost value corresponding to each prediction mode can be obtained, and then from the obtained multiple rate-distortion cost values, a minimum rate-distortion cost value is selected, and the prediction parameters under the prediction mode corresponding to the minimum rate-distortion cost value are determined as the prediction parameters of the current block.Furthermore, after precoding the current block using multiple prediction modes, a distortion value corresponding to each prediction mode is obtained, and then from the obtained multiple distortion values, a minimum distortion value is selected, and the prediction parameters under the prediction mode corresponding to the minimum distortion value are determined as the prediction parameters of the current block.In this way, finally, the current block is encoded using the determined prediction parameters, and in the prediction mode, the prediction residual can be reduced, and the encoding efficiency can be improved.
[0044] In step S302, if the prediction mode parameter indicates to determine an intra-frame prediction value of the current block using a matrix-based intra-frame prediction (MIP) mode, 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 are determined.
[0045] For a current block, when using the MIP mode for the current block to determine the intra-frame prediction value of the current block, it is necessary to determine 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, where the shift factor can also be called the number of shift bits, weight shift value, etc., and can be represented by sW, shift, or weight shift.
[0046] It should be understood that for MIP mode, MIP core parameters must be configured first. Here, MIP mode can divide the current block into three types based on the width and height of the current block, and mipSizeId or BlocksizeIdx can represent the type of the current block, that is, the block size index value of the current block. Different block size index values result in different numbers of reference samples (each side needs boundySize number of reference sample points), different numbers of matrix multiplication input samples (inSize), and different numbers of matrix multiplication output samples (placed at predSize×predSize).
[0047] Illustratively, in some embodiments, determining a block size index value for the current block according to a size parameter of the current block includes: that the block size index value of the current block can be set to 0 if the width and height of the current block are both equal to 4; or, that if the width and height of the current block are both equal to 8, or if either the width or height of the current block is equal to 4, the block size index value of the current block can be set to 1; Alternatively, if the current block is a block of another size, the block size index value of the current block may be set to 2.
[0048] Illustratively, in some embodiments, determining a block size index value for the current block according to a size parameter of the current block includes: that the block size index value of the current block can be set to 0 if the width and height of the current block are both equal to 4; or, if either the width or height of the current block is equal to 4, the block size index value of the current block can be set to 1; Alternatively, if the current block is a block of another size, the block size index value of the current block may be set to 2.
[0049] In this way, according to the block size index value of the current block, the number of adjacent boundary reference samples (variable is boundarySize) and the size of the MIP prediction block (variable is predSize, and the size of the MIP prediction block is predSize×predSize) can be determined according to the look-up table (LUT) shown in Table 1, and the number of input samples (represented by inSize) used in the MIP matrix multiplication calculation process can be calculated. The calculation formula is as follows:
number
[0050] Here, the rules for the calculation of operators in formula (5) are the same as those defined in the ITU-TH.265 standard, for example, "==" is the "equal to" logical operator. [Table 1]
[0051] Thus, according to Table 1, if the value of BlocksizeIdx is 0, the value of boundarySize may be 2 and the value of predSize may be 4, i.e., in this case, the reference pixel includes two pixel points selected from each side, and the matrix multiplication output is a 4×4 MIP prediction block. Or, if the value of BlocksizeIdx is 1, the value of boundarySize may be 4 and the value of predSize may be 4, i.e., in this case, the reference pixel includes four pixel points selected from each side, and the matrix multiplication output is a 4×4 MIP prediction block. Or, if the value of BlocksizeIdx is 2, the value of boundarySize may be 4 and the value of predSize may be 8, i.e., in this case, the reference pixel includes four pixel points selected from each side, and the matrix multiplication output is an 8×8 MIP prediction block.
[0052] Also, according to the block size index value of the current block, the values of boundarySize, inSize, and predSize can be determined simultaneously according to the LUT shown in Table 2. [Table 2]
[0053] Thus, according to Table 2, if the BlocksizeIdx value is 0, the boundarySize value may be 2, the inSize value may be 4, and the predSize value may be 4, i.e., in this case, the reference pixel includes two pixel points selected from each side, the number of matrix multiplication input sample points is 4, and the matrix multiplication output is a 4×4 MIP prediction block. Or, if the BlocksizeIdx value is 1, the boundarySize value may be 4, the inSize value may be 8, and the predSize value may be 4, i.e., in this case, the reference pixel includes four pixel points selected from each side, the number of matrix multiplication input sample points is 8, and the matrix multiplication output is a 4×4 MIP prediction block. Or, if the value of BlocksizeIdx is 2, the value of boundarySize may be 4, the value of inSize may be 7, and the value of predSize may be 8, that is, in this case, the reference pixels include four pixel points selected from each side, the number of matrix multiplication input sample points is 7, and the matrix multiplication output is an 8x8 MIP prediction block.
[0054] In addition, after the MIP core parameters are configured, reference pixels need to be further obtained to construct a MIP input sample matrix. Specifically, in some embodiments, determining the MIP input sample matrix of the current block includes: determining a neighboring reference sample set of a current block, where the neighboring reference sample set includes at least one reference sample value; buffering the adjacent reference sample set to construct an input reference sample value set; determining a MIP input sample matrix according to the set of input reference sample values.
[0055] The matrix multiplication input sample (represented by P) is the input of the matrix multiplication process, and after multiplication with the corresponding matrix, a matrix multiplication output sample (represented by predMip) can be obtained. Here, the matrix multiplication input sample P is determined by a buffer (represented by pTemp), a block size index value of the current block (represented by BlocksizeIdx), and a bit depth value (represented by BitDepth) corresponding to the image component to be predicted. The number of input reference samples (inSize) contained in the matrix multiplication input sample P is only correlated to the block size index value of the current block, and finally, the x-th input sample value (represented by P[x]) of the input sample matrix can be obtained.
[0056] Here, the specific construction process of the input sample matrix P[x] is as follows:
[0057] If BlocksizeIdx=0 or 1, to obtain the sample value at the 0th position of the input sample matrix (denoted by P[0]), it is necessary to subtract (1<<(BitDepth-1)) from the sample value at the 0th position of pTemp. Then, the sample values corresponding to each other position of the input sample matrix (denoted by P[x]) are obtained by subtracting the value at the 0th position of pTemp from the sample value at the corresponding position in pTemp. Specifically, it is as follows:
number
[0058] When BlocksizeIdx=2, the sample value corresponding to each other position of the input sample matrix is obtained by subtracting the sample value corresponding to the 0th position of pTemp from the sample value of the next position of the corresponding position of pTemp, specifically,
number
[0059] Still taking the 4×4 current block as an example, the buffer pTemp stores four values, but the number of input samples is four. In this case, four input sample values (denoted as p[x], where x=0, 1, 2, 3) can be determined according to equation (3) or equation (4), thereby obtaining a 1×4 MIP input sample matrix.
[0060] Furthermore, in the encoder, a weight matrix table is created in advance, and the weight matrix table is stored in the encoder. In this way, according to the block size index value (BlocksizeIdx) and the MIP mode index value (modeIdx) of the current block, the MIP weight matrix (represented by mWeight[x][y]) that needs to be used for the current block can be determined in a table lookup manner. Here, the size of the MIP weight matrix mWeight[x][y] is only related to the block size index value of the current block, and as shown in Table 3, in the MIP weight matrix, the number of columns is the number inSize of matrix multiplication input samples, and the number of rows is the number predSized×predSized of matrix multiplication output samples, so that the MIP weight matrix of the current block can be determined. [Table 3]
[0061] In addition, in the encoder, a shift table is also pre-created, and the shift table is also stored in the encoder. Currently, in the latest MIP version, for different block sizes and different MIP mode index numbers, the number of shift bits (i.e., shift factor) in the shift operation is different. As shown in Table 4, according to the block size index value (BlocksizeIdx) and MIP mode index value (modeIdx, which can also be abbreviated as modeId) of the current block, the shift factor that needs to be used for matrix multiplication can be determined by a table lookup method. [Table 4]
[0062] However, at the encoder side, Table 4 needs to be stored in computer memory in the form of a look-up table, which is costly in terms of storage and look-up process.The shift factors in Table 4 are correlated with the block size and MIP mode index value of the current block, which increases the memory occupied and the computational complexity.
[0063] In order to reduce memory occupancy and reduce calculation complexity, the present embodiment simplifies the method of determining the shift factor. Specifically, in some embodiments, the shift factor of the current block may include a constant shift factor and a shift factor determined according to a prediction parameter.
[0064] In one possible embodiment, 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 present embodiment, the value of the constant shift factor is preferably equal to 6, but the present application is not limited thereto.
[0065] In another possible embodiment, determining a shift factor according to the prediction parameters comprises: determining a block size index value of the current block according to a size parameter of the current block; determining the shift factor according to a block size index value of the current block.
[0066] 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, determining the block size index value of the current block according to the size parameter of the current block includes: if the width and height of the current block are both equal to 4, setting a block size index value of the current block to 0; if the width and height of the current block are both equal to 8, or if either the width or height of the current block is equal to 4, setting a block size index value of the current block to 1; If the width and height of the current block do not satisfy the above condition, setting the block size index value of the current block to 2.
[0067] In this way, after determining the block size index value of the current block, the shift factor can be determined according to the block size index value of the current block in combination with the number of MIP input sample values or the size of the MIP prediction block.
[0068] Illustratively, in some embodiments, determining the shift factor according to a block size index value of the current block includes: The method may include setting the shift factor to be equal to a ratio of a width or height of the current block to a first preset value corresponding to a block size index value of the current block.
[0069] Here, the first preset value represents the number of MIP input sample values obtained from the boundary of the current block. In this case, the image component prediction method includes: The method may further include determining that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the first preset values corresponding to the block size index values of the current block are equal to 2, 4, and 4, respectively.
[0070] That is, if the first preset value represents the number of MIP input sample values obtained from the boundary of the current block, when the block size index value of the current block is equal to 0, the corresponding first preset value is equal to 2, when the block size index value of the current block is equal to 1, the corresponding first preset value is equal to 4, and when the block size index value of the current block is equal to 2, the corresponding first preset value is equal to 4. Thereby, 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.
[0071] Illustratively, in some embodiments, determining the shift factor according to a block size index value of the current block includes: The method may include setting the shift factor to be equal to a ratio of a width or height of the current block to a second preset value corresponding to a block size index value of the current block.
[0072] Here, the second preset value represents the size of the MIP predicted block of the current block obtained by directly calculating the MIP weight matrix. In this case, the image component prediction method includes: The method may further include determining that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the second preset values corresponding to the block size index values of the current block are equal to 4, 4, and 8, respectively.
[0073] That is, if the second preset value represents the size of the MIP predicted block of the current block obtained by directly using the MIP weight matrix for calculation, when the block size index value of the current block is equal to 0, the corresponding second preset value is equal to 4, when the block size index value of the current block is equal to 1, the corresponding second preset value is equal to 4, and when the block size index value of the current block is equal to 2, the corresponding second preset value is equal to 8. Thereby, 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.
[0074] In yet another possible embodiment, the shift table can be minimized and still use the table lookup method to determine the shift factor. Illustratively, in some embodiments, for step S302, the image component prediction method includes: determining a block size index value of the current block according to a size parameter of the current block; 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, the first preset lookup table being used to record a corresponding value between the block size index value and the shift factor; and determining the queried shift factor as a shift factor corresponding to the current block.
[0075] It should be noted that the shift factor can be queried only according to the block size index value (represented by blocksizeIdx) of the current block. In the first preset lookup table shown in Table 5, each block size index value can correspond to a fixed shift factor. That is, each block size or each set of block sizes can have a fixed shift value shown in Table 5, where blocksizeIdx is the block size index value corresponding to the current block size or set of block sizes. [Table 5]
[0076] In yet another possible embodiment, the shift table can still be minimized and the shift factor can still be determined using a table lookup scheme. Illustratively, in some embodiments, for step S302, the image component prediction method includes: determining a MIP mode type index value for the current block if the prediction mode parameter indicates that a MIP mode is to be used to determine an intra-frame prediction value for the current block; According to the determined MIP mode type index value, querying a shift factor corresponding to the determined MIP mode type index value from a second preset lookup table, the second preset lookup table being used to record a corresponding value between the MIP mode type index value and the shift factor; determining the queried shift factor as a shift factor corresponding to the current block.
[0077] It should be noted that the shift factor can be queried only according to the MIP mode type index value (represented by ModeCategoryIdx) of the current block. In the second preset lookup table shown in Table 6, each MIP mode type index value can correspond to a fixed shift factor. That is, the fixed shift value shown in Table 6 can be performed according to ModeCategoryIdx, where ModeCategoryIdx is a type index value corresponding to a MIP mode or a set of MIP modes. [Table 6]
[0078] Furthermore, the ModeCategoryIdx can be derived according to the MIP mode index value. Specifically, determining the MIP mode type index value of the current block includes: determining a block size index value corresponding to the current block and a MIP mode index value when MIP mode prediction is used; and determining a MIP mode type index value of the current block according to the block size index value and the MIP mode index value.
[0079] 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 a hash method or determined based on a conditional decision.
[0080] Exemplarily, the MIP mode type index value may be calculated by a hash method. In some embodiments, determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value may include: If the block size index value is equal to 0, performing a right shift operation on the MIP mode index value using a first preset shift value to obtain a MIP mode type index value of a current block; or if said block size index value is equal to one, performing a right shift operation on the MIP mode index value using a first preset shift value to obtain a right shifted value; and overlapping the right-shifted value with a third preset value to obtain a MIP mode type index value of the current block. or, if said block size index value is equal to 2, The method may include performing a right shift operation on the MIP mode index value using a second preset shift value to obtain a MIP mode type index value of the current block.
[0081] Note that the first preset shift value may be 3, the second preset shift value may be 2, and the third preset value may be at 1.
[0082] Exemplarily, when the block size index value (blocksizeIdx) is equal to 0, the MIP mode index value (modeIdx) is shifted 3 to the right 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) is shifted 3 to the right and then overlapped with 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) is shifted 2 to the right to obtain the MIP mode type index value. Specifically, as follows.
[0083] ModeCategoryIdx=ModeIdx>>3. for blocksizeIdx=0 ModeCategoryIdx=(ModeIdx>>3)+1. for blocksizeIdx=1 ModeCategoryIdx=ModeIdx>>2. for blocksizeIdx=2 Exemplarily, a MIP mode type index value may be determined according to a condition determination. In some embodiments, determining a MIP mode type index value of the current block according to the block size index value and the MIP mode index value may include: If the block size index value is equal to 0, If the MIP mode index value is less than or equal to a first threshold, determining that the MIP mode index value is a fourth preset value; and determining, if the MIP mode index value is greater than a first threshold, that the MIP mode index value is a fifth preset value; or if said block size index value is equal to one, If the MIP mode index value is less than or equal to a second threshold, determining that the MIP mode index value is a sixth preset value; and determining that the MIP mode index value is a seventh preset value if the MIP mode index value is greater than a second threshold value; or, if said block size index value is equal to 2, If the MIP mode index value is less than or equal to a third threshold, determining that the MIP mode index value is an eighth preset value; If the MIP mode index value is greater than a third threshold and less than or equal to a fourth threshold, determining that the MIP mode index value is a ninth preset value; If the MIP mode index value is greater than a fourth threshold, determining that the MIP mode index value is a tenth preset value.
[0084] It should be noted that the first threshold may be 6, the second threshold may be 8, the third threshold may be 3, the fourth threshold may be 4, the fourth preset value may be 5, the fifth preset value may be 6, the sixth preset value may be 6, the seventh preset value may be 7, the eighth preset value may be 5, the ninth preset value may be 6, and the tenth preset value is 7.
[0085] Exemplarily, if the block size index value (blocksizeIdx) is equal to 0 and 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. If the block size index value (blocksizeIdx) is equal to 1 and 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. If the block size index value (blocksizeIdx) is equal to 2 and the MIP mode index value (modeIdx) is less than or equal to 3, the MIP mode type index value is set to 5, or 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. Specifically, as follows.
[0086] If ModeIdx<=6, ModeCategoryIdx=5, otherwise ModeCategoryIdx=6, for blocksizeIdx=0 If ModeIdx<=8, ModeCategoryIdx=6, otherwise ModeCategoryIdx=7, for blocksizeIdx=1 If ModeIdx<=3, ModeCategoryIdx=5, else if ModeIdx<=4, ModeCategoryIdx=6, otherwise ModeCategoryIdx=7, for blocksizeIdx=2 Please note that the first threshold may be 6, the second threshold may be 8, the third threshold may be 3, the fourth threshold may be 4, the fourth preset value may be 0, the fifth preset value may be 1, the sixth preset value may be 1, the seventh preset value may be 2, the eighth preset value may be 0, the ninth preset value may be 1, and the tenth preset value may be 2.
[0087] Exemplarily, if the block size index value (blocksizeIdx) is equal to 0 and 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. If the block size index value (blocksizeIdx) is equal to 1 and 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. If the block size index value (blocksizeIdx) is equal to 2 and the MIP mode index value (modeIdx) is less than or equal to 3, the MIP mode type index value is set to 0, or 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. Specifically, as follows.
[0088] If ModeIdx<=6, ModeCategoryIdx=0, otherwise ModeCategoryIdx=1, for blocksizeIdx=0 If ModeIdx<=8, ModeCategoryIdx=1, otherwise ModeCategoryIdx=2, for blocksizeIdx=1 If ModeIdx<=3, ModeCategoryIdx=0, else if ModeIdx<=4, ModeCategoryIdx=1, otherwise ModeCategoryIdx=2, for blocksizeIdx=2. In the above embodiment, by simplifying the method of determining the shift factor, in particular by minimizing the shift table, it is possible to minimize the memory occupied by storing the lookup table, thereby reducing the memory occupied by storing the shift table in MIP mode without increasing the computational complexity.
[0089] In this way, in the MIP mode, the MIP input sample matrix, the MIP weight matrix and the shift factor can be obtained to subsequently determine the intra-frame prediction value of the current block.
[0090] In step S303, determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0091] After obtaining the MIP input sample 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-frame prediction value of the current block can be determined. Specifically, in some embodiments, for step S303, determining the intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix can be: performing a matrix multiplication operation on the MIP input sample matrix, the MIP weight matrix, and the shift factor using a preset computation model to obtain a MIP predicted block of the current block; and performing a filtering process on the MIP prediction block to obtain an intra-frame prediction value of the current block, where the MIP prediction block includes prediction values for at least some pixel positions within the current block.
[0092] That is, after obtaining the MIP input sample matrix, the MIP weight matrix, and the shift factor, a MIP prediction block of the current block can be first determined using a preset computation model, where the MIP prediction block includes predicted values of at least some pixel positions in the current block.
[0093] Specifically, in the MIP mode, the MIP weight matrix (represented by mWeight), the shift factor (represented by sW), and the offset factor (represented by fO) can be determined according to the block size index value (represented by blocksizeIdx) and the MIP mode index value (represented by modeIdx) of the current block. Then, the MIP input sample matrix (represented by P[x]), mWeight, sW, and fO are input into a matrix multiplication process to obtain the MIP predicted block (represented by predMip[x][y]) output by the matrix multiplication, and the sample points in predMip[x][y] are arranged in a matrix according to predSize×predSize. Here, the preset calculation model is as follows:
number
[0094] Here, [x][y] represents the position coordinates of a pixel point, x represents the horizontal direction, y represents the vertical direction, inSize represents the number of input samples, and predSize represents the side length of the MIP prediction block predMip. Here, predSize is only related to the type mipSizeId of the current block, and when mipSizeId=0 or 1, the output MIP prediction block is 4×4, in this case, predSize is equal to 4, and when mipSizeId=2, the output MIP prediction block is 8×8, in this case, predSize is equal to 8. In this way, according to formula (8), a temporary prediction value of at least one pixel in the MIP prediction block predMip can be calculated to obtain a MIP prediction block.
[0095] In addition, it is also necessary to perform an embedding process on the predicted sample values in the MIP predicted block to obtain the MIP predicted block of the current block. Then, it is determined whether to perform a transposition process on the MIP predicted block. If the determination result is "yes", it is necessary to perform a transposition process on the predicted sample values in the MIP predicted block, and the transposed MIP predicted block is determined as the MIP predicted block of the current block. If the determination result is "no", it is possible to directly determine the MIP predicted block as the MIP predicted block of the current block without performing a transposition process on the predicted sample values in the MIP predicted block.
[0096] Moreover, in some embodiments, performing a filtering operation on the MIP predicted block to obtain an intra-frame predicted value of the current block comprises: Determining whether a size of the MIP prediction block is the same as a size of the current block; If the size of the MIP prediction block is the same as the size of the current block, setting an intra-frame prediction block of the current block to be equal to the MIP prediction block, where the MIP prediction block includes predicted sample values of all pixel positions of the current block; If the size of the MIP prediction block is different from the size of the current block, performing a filtering process on the MIP prediction block to obtain a filtered prediction block, and setting the filtered prediction block as an intra-frame prediction block of the current block.
[0097] Here, the filtering process may include an upsampling filtering process or a low-pass filtering process.
[0098] After obtaining the MIP prediction block, since the MIP prediction block only includes two types of blocks, namely, 4×4 MIP prediction block and 8×8 MIP prediction block, the size of the current block may be the same as the size of the MIP prediction block or may be different from the size of the MIP prediction block, that is, the sample value corresponding to the MIP prediction block may not be able to meet the current block, so that an upsampling operation needs to be performed on the MIP prediction block to generate the final prediction value, that is, whether to perform the upsampling process on the MIP prediction block is determined by determining whether the size of the MIP prediction block is the same as the size of the current block.
[0099] Please note that if the size of the MIP prediction block is the same as the size of the current block, that is, both the width and height of the MIP prediction block are the same as the current block, it indicates that there is no need to perform upsampling processing on the MIP prediction block, and in this case, the MIP prediction block can be directly filled into the current block, that is, there is no empty pixel point in the filled current block, and in this case, the intraframe prediction value of each pixel of the current block can be directly set as the prediction value of each pixel of the MIP prediction block, as shown below.
number
[0100] Here, [x][y] represents the position coordinate of a pixel point, x represents the horizontal direction, y represents the vertical direction, predSamples[x][y] represents the intra-frame predicted value corresponding to the pixel point of the position coordinate [x][y] of the current block, and predMip[x][y] represents the predicted value corresponding to the pixel point of the position coordinate [x][y] of the MIP predicted block. In this way, according to Equation (9), the MIP predicted block predMip[x][y] can be directly used as the intra-frame predicted block predSamples[x][y] of the current block.
[0101] It should be noted that if the size of the MIP predicted block is different from the size of the current block, i.e., at least one of the width and height of the MIP predicted block is different from the current block, the MIP predicted block cannot fill the current block. That is, it indicates that there are empty pixel points in the filled current block, and in this case, a filtering process needs to be performed on the MIP predicted block. That is, if the upsampling process needs to be performed in both the horizontal and vertical directions, first, horizontal upsampling can be performed on the MIP predicted block, and then vertical upsampling can be performed to obtain the first upsampling block (which can be represented by predSamples[x][y]). Then, vertical upsampling can be performed on the MIP predicted block, and then horizontal upsampling can be performed to obtain the second upsampling block (which can be represented by predSamplesTemp[x][y]). Finally, a weighted average calculation can be performed on predSamples[x][y] and predSamplesTemp[x][y] to finally obtain the intra-frame predicted block of the current block.
[0102] Exemplarily, if the edge length nTbS (where S can be replaced with W and H respectively) of the current block is equal to the edge length predSize of predMip (where predSize is only correlated with the blocksizeIdx of the current block), the MIP prediction block can be directly set as the intra-frame prediction block of the current block; otherwise, a filtering process needs to be performed on the MIP prediction block to obtain the intra-frame prediction block of the current block. Here, the generation process of the intra-frame prediction block can refer to FIG. 4. Still taking the current block of 4×4 as an example, in FIG. 4, the size of the current block and the MIP prediction block are the same, so in this case, the MIP prediction block can be directly set as the intra-frame prediction block of the current block without performing a filtering process on the MIP prediction block, thereby obtaining the intra-frame prediction value of at least one pixel in the current block.
[0103] This embodiment provides an image component prediction method applied to an encoder. Determine prediction parameters of a current block, where the prediction parameters include a prediction mode parameter and a size parameter of the current block, and when the prediction mode parameter indicates to use a matrix-based intra-frame prediction (MIP) mode to determine the intra-frame 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 sample matrix of the current block, and determine the intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix. In this way, the determination method of the shift factor can be simplified, and further, when the shift factor is determined using a lookup table, the memory occupied by the storage of the lookup table can be reduced while the calculation complexity is reduced, thereby achieving the purpose of improving the efficiency of encoding.
[0104] Based on the example application scenario shown in Fig. 2B, Fig. 5 shows a schematic flowchart of another image component prediction method according to an embodiment of the present application. As shown in Fig. 5, the method may include the following steps:
[0105] In step S501, a bitstream is parsed 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.
[0106] It should be noted that the method is applied to a decoder. A video image can be divided into a number of image blocks, and each currently decoded image block can be called a decoded block, where each decoded block can include a first image component, a second image component, and a third image component, and the current block is the decoded block on which the first image component, the second image component, or the third image component prediction is currently performed in the video image.
[0107] Also, it should be noted that the prediction parameters are used to indicate the prediction mode adopted by the current block and the parameters related to the prediction mode. Here, the prediction modes usually include inter-frame prediction mode, conventional intra-frame prediction mode, and non-conventional intra-frame prediction mode, etc., and the non-conventional intra-frame prediction mode includes MIP mode, CCLM mode, IBC mode, and PLT mode, etc. 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 parameters under the prediction mode can be written into the bitstream and transmitted by the encoder to the decoder.
[0108] In this way, at the decoder side, the prediction parameters of the current block can be obtained by analyzing the bitstream, and the prediction mode parameter included in the prediction parameters obtained by the analysis can determine whether the current block uses MIP mode or not.
[0109] In step S502, if the prediction mode parameter indicates to determine an intra-frame prediction value of the current block using a matrix-based intra-frame prediction (MIP) mode, 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 are determined.
[0110] For a current block, when using the MIP mode for the current block to determine the intra-frame prediction value of the current block, it is necessary to determine 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, where the shift factor can also be called the number of shift bits, weight shift value, etc., and can be represented by sW, shift, or weight shift.
[0111] In some embodiments, the shift factors of the current block may include a constant shift factor and a shift factor determined according to the prediction parameters.
[0112] In one possible embodiment, the shift factor can be set to a fixed constant value. In the present embodiment, the value of the constant shift factor is preferably equal to 6, although the present application is not limited thereto.
[0113] In another possible embodiment, determining a shift factor according to the prediction parameters comprises: determining a block size index value of the current block according to a size parameter of the current block; determining the shift factor according to a block size index value of the current block.
[0114] It should be noted that a block size index value (represented by mipSizeId or blocksizeIdx) of the current block can be determined according to the size parameter of the current block. Specifically, determining a block size index value of the current block according to the size parameter of the current block includes: if the width and height of the current block are both equal to 4, setting a block size index value of the current block to 0; if the width and height of the current block are both equal to 8, or if either the width or height of the current block is equal to 4, setting a block size index value of the current block to 1; If the width and height of the current block do not satisfy the above condition, setting the block size index value of the current block to 2.
[0115] In this way, after determining the block size index value of the current block, the shift factor can be determined according to the block size index value of the current block in combination with the number of MIP input sample values or the size of the MIP prediction block.
[0116] Illustratively, in some embodiments, determining the shift factor according to a block size index value of the current block includes: The method may include setting the shift factor to be equal to a ratio of a width or height of the current block to a first preset value corresponding to a block size index value of the current block.
[0117] Here, the first preset value represents the number of MIP input sample values obtained from the boundary of the current block. In this case, the image component prediction method includes: The method may further include determining that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the first preset values corresponding to the block size index values of the current block are equal to 2, 4, and 4, respectively.
[0118] That is, if the first preset value represents the number of MIP input sample values obtained from the boundary of the current block, when the block size index value of the current block is equal to 0, the corresponding first preset value is equal to 2, when the block size index value of the current block is equal to 1, the corresponding first preset value is equal to 4, and when the block size index value of the current block is equal to 2, the corresponding first preset value is equal to 4. Thereby, 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.
[0119] Illustratively, in some embodiments, determining the shift factor according to a block size index value of the current block includes: The method may include setting the shift factor to be equal to a ratio of a width or height of the current block to a second preset value corresponding to a block size index value of the current block.
[0120] Here, the second preset value represents the size of the MIP predicted block of the current block obtained by directly calculating the MIP weight matrix. In this case, the image component prediction method includes: The method may further include determining that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the second preset values corresponding to the block size index values of the current block are equal to 4, 4, and 8, respectively.
[0121] That is, if the second preset value represents the size of the MIP predicted block of the current block obtained by directly using the MIP weight matrix for calculation, when the block size index value of the current block is equal to 0, the corresponding second preset value is equal to 4, when the block size index value of the current block is equal to 1, the corresponding second preset value is equal to 4, and when the block size index value of the current block is equal to 2, the corresponding second preset value is equal to 8. Thereby, 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.
[0122] In yet another possible embodiment, the shift table can be minimized and still use the table lookup method to determine the shift factor. Illustratively, in some embodiments, for step S502, the image component prediction method includes: determining a block size index value of the current block according to a size parameter of the current block; 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, the first preset lookup table being used to record a corresponding value between the block size index value and the shift factor; and determining the queried shift factor as a shift factor corresponding to the current block.
[0123] It should be noted that in the decoder, a shift table (such as a first preset lookup table or a second preset lookup table) is similarly pre-created and the shift table is also stored in the decoder. Therefore, when querying a shift factor according to only the block size index value of the current block, the first preset lookup table shown in Table 5 can be used. In Table 5, each block size index value can correspond to a fixed shift factor. That is, each block size or each block size set can have a fixed shift value shown in Table 5.
[0124] In yet another possible embodiment, the shift table can still be minimized and the shift factor can still be determined using a table lookup scheme. Illustratively, in some embodiments, for step S502, the image component prediction method includes: determining a MIP mode type index value for the current block if the prediction mode parameter indicates that a MIP mode is to be used to determine an intra-frame prediction value for the current block; According to the determined MIP mode type index value, querying a shift factor corresponding to the determined MIP mode type index value from a second preset lookup table, the second preset lookup table being used to record a corresponding value between the MIP mode type index value and the shift factor; and determining the queried shift factor as a shift factor corresponding to the current block.
[0125] It should be noted that when querying the shift factor according only to the MIP mode type index value (represented by ModeCategoryIdx) of the current block, the second preset lookup table shown in Table 6 can be used. In Table 6, each MIP mode type index value corresponds to a fixed shift factor, that is, the fixed shift value shown in Table 6 can be implemented according to ModeCategoryIdx.
[0126] Furthermore, the ModeCategoryIdx can be derived according to the MIP mode index value. Specifically, determining the MIP mode type index value of the current block includes: determining a block size index value corresponding to the current block according to the prediction parameters, and a MIP mode index value when using MIP mode prediction; and determining a MIP mode type index value of the current block according to the block size index value and the MIP mode index value.
[0127] 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 a hash method or determined based on a conditional decision.
[0128] Exemplarily, the MIP mode type index value may be calculated by a hash method. In some embodiments, determining the MIP mode type index value of the current block according to the block size index value and the MIP mode index value may include: If the block size index value is equal to 0, performing a right shift operation on the MIP mode index value using a first preset shift value to obtain a MIP mode type index value of a current block; or if said block size index value is equal to one, performing a right shift operation on the MIP mode index value using a first preset shift value to obtain a right shifted value; and overlapping the right-shifted value with a third preset value to obtain a MIP mode type index value of the current block. or, if said block size index value is equal to 2, The method may include performing a right shift operation on the MIP mode index value using a second preset shift value to obtain a MIP mode type index value of the current block.
[0129] Exemplarily, the first preset shift value may be 3, the second preset shift value may be 2, and the third preset value may be 1. Specifically, as follows.
[0130] ModeCategoryIdx=ModeIdx>>3. for blocksizeIdx=0 ModeCategoryIdx=(ModeIdx>>3)+1. for blocksizeIdx=1 ModeCategoryIdx=ModeIdx>>2.for blocksizeIdx=2 Exemplarily, a MIP mode type index value may be determined according to a condition determination. In some embodiments, determining a MIP mode type index value of the current block according to the block size index value and the MIP mode index value may include: If the block size index value is equal to 0, If the MIP mode index value is less than or equal to a first threshold, determining that the MIP mode index value is a fourth preset value; and determining, if the MIP mode index value is greater than a first threshold, that the MIP mode index value is a fifth preset value; or if said block size index value is equal to one, If the MIP mode index value is less than or equal to a second threshold, determining that the MIP mode index value is a sixth preset value; and determining that the MIP mode index value is a seventh preset value if the MIP mode index value is greater than a second threshold value; or, if said block size index value is equal to 2, If the MIP mode index value is less than or equal to a third threshold, determining that the MIP mode index value is an eighth preset value; If the MIP mode index value is greater than a third threshold and less than or equal to a fourth threshold, determining that the MIP mode index value is a ninth preset value; If the MIP mode index value is greater than a fourth threshold, determining that the MIP mode index value is a tenth preset value.
[0131] Illustratively, the first threshold may be six, the second threshold may be eight, the third threshold may be three, and the fourth threshold may be four.
[0132] If the fourth preset value may be 5, the fifth preset value may be 6, the sixth preset value may be 6, the seventh preset value may be 7, the eighth preset value may be 5, the ninth preset value may be 6, and the tenth preset value may be 7, then the specific expression is as follows:
[0133] If ModeIdx<=6, ModeCategoryIdx=5, otherwise ModeCategoryIdx=6, for blocksizeIdx=0 If ModeIdx<=8, ModeCategoryIdx=6, otherwise ModeCategoryIdx=7, for blocksizeIdx=1 If ModeIdx<=3, ModeCategoryIdx=5, else if ModeIdx<=4, ModeCategoryIdx=6, otherwise ModeCategoryIdx=7, for blocksizeIdx=2 Or, the fourth preset value may be 0, the fifth preset value may be 1, the sixth preset value may be 1, the seventh preset value may be 2, the eighth preset value may be 0, the ninth preset value may be 1, and the tenth preset value may be 2, and the specific expression is as follows:
[0134] If ModeIdx<=6, ModeCategoryIdx=0, otherwise ModeCategoryIdx=1, for blocksizeIdx=0 If ModeIdx<=8, ModeCategoryIdx=1, otherwise ModeCategoryIdx=2, for blocksizeIdx=1 If ModeIdx<=3, ModeCategoryIdx=0, else if ModeIdx<=4, ModeCategoryIdx=1, otherwise ModeCategoryIdx=2, for blocksizeIdx=2 In the above embodiment, by simplifying the method of determining the shift factor, in particular by minimizing the shift table, it is possible to minimize the memory occupied by storing the lookup table, thereby reducing the memory occupied by storing the shift table in MIP mode without increasing the computational complexity.
[0135] In this way, in MIP mode, the MIP input sample matrix and the MIP weight matrix can also be obtained to subsequently determine the intra-frame prediction value of the current block.
[0136] In step S503, determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0137] After obtaining the MIP input sample 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-frame prediction value of the current block can be determined. Specifically, in some embodiments, for step S503, determining the intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix can be: performing a matrix multiplication operation on the MIP input sample matrix, the MIP weight matrix, and the shift factor using a preset computation model to obtain a MIP predicted block of the current block; and performing a filtering process on the MIP prediction block to obtain an intra-frame prediction value of the current block, where the MIP prediction block includes prediction values for at least some pixel positions within the current block.
[0138] That is, after obtaining the MIP input sample matrix, the MIP weight matrix, and the shift factor, first determine the MIP prediction block of the current block, and then, according to the obtained MIP prediction block, determine whether the size of the MIP prediction block is the same as the size of the current block, thereby further determining the intra-frame prediction value of the current block. Specifically, according to the determination result, if the size of the MIP prediction block is the same as the size of the current block, the intra-frame prediction block of the current block can be set to be equal to the MIP prediction block, in which case the MIP prediction block includes the prediction sample values of all pixel positions of the current block; if the size of the MIP prediction block is different from the size of the current block, a filtering process can be performed on the MIP prediction block to obtain a filtered prediction block, and the filtered prediction block can be set as the intra-frame prediction block of the current block. Here, the filtering process can include an upsampling filtering process or a low-pass filtering process.
[0139] This embodiment provides an image component prediction method applied to a decoder. Analyze 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, and when the prediction mode parameter indicates to use a matrix-based intra-frame prediction (MIP) mode to determine an intra-frame 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, and determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix. In this way, the method of determining the shift factor can be simplified, and further, when using a lookup table to determine the shift factor, the memory occupied by the storage of the lookup table can be reduced while reducing the computation complexity, thereby achieving the purpose of improving the efficiency of decoding.
[0140] Based on the same inventive concept as the above embodiment, Fig. 6 is a schematic diagram of the configuration of an encoder 60 according to an embodiment of the present application. As shown in Fig. 6, the encoder 60 can include a first decision unit 601 and a first prediction unit 602, where: The first determining unit 601 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 determination unit 601 is further configured to determine, when the prediction mode parameter indicates to determine an intra-frame prediction value of the current block using a matrix-based intra-frame prediction (MIP) mode, an MIP weighting matrix of the current block, a shift factor of the current block, and an MIP input sample matrix of the current block; and the first prediction unit 602 is configured to determine the intra-frame prediction value of the current block according to the MIP weighting matrix, the shift factor, and the MIP input sample matrix.
[0141] In some embodiments, the shift factors of the current block include a constant shift factor and a shift factor determined according to the prediction parameters.
[0142] In some embodiments, the constant value shift factor has a value of six.
[0143] In some embodiments, the first determining unit 601 is further configured to determine a block size index value of the current block according to a size parameter of the current block, and to determine the shift factor according to the block size index value of the current block.
[0144] In some embodiments, referring to FIG. 7 , the encoder 60 may further include a first setting unit 603, configured to set a block size index value of the current block to 0 if the width and height of the current block are both equal to 4, set a block size index value of the current block to 1 if the width and height of the current block are both equal to 8 or either the width and height of the current block is equal to 4, and set a block size index value of the current block to 2 if the width and height of the current block do not satisfy the above conditions.
[0145] In some embodiments, the first setting unit 603 is further configured to set the shift factor to be equal to a ratio between a width or height of the current block and a first preset value corresponding to a block size index value of the current block.
[0146] In some embodiments, the first preset value represents a number of MIP input sample values taken from a boundary of the current block.
[0147] In some embodiments, the first determination unit 601 is further configured to determine that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the first preset values corresponding to the block size index values of the current block are equal to 2, 4, and 4, respectively.
[0148] In some embodiments, the first setting unit 603 is further configured to set the shift factor to be equal to a ratio between a width or height of the current block and a second preset value corresponding to a block size index value of the current block.
[0149] In some embodiments, the second preset value represents a size of a MIP prediction block of the current block obtained by directly using and calculating the MIP weighting matrix.
[0150] In some embodiments, the first determination unit 601 is further configured to determine that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the second preset values corresponding to the block size index values of the current block are equal to 4, 4, and 8, respectively.
[0151] In some embodiments, referring to FIG. 7, the encoder 60 may further comprise a first inquiry unit 604, where: The first determining unit 601 is further configured to determine a block size index value of the current block according to a size parameter of the current block; The first query 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, and determine the queried shift factor as a shift factor corresponding to the current block, where the first preset lookup table is used to record corresponding values between block size index values and shift factors.
[0152] In some embodiments, the first determining unit 601 is further configured to, if the prediction mode parameter indicates to determine an intra-frame prediction value of the current block using a MIP mode, determine a MIP mode type index value of the current block; The first query 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, and determine the queried shift factor as a shift factor corresponding to the current block, where the second preset lookup table is used to record corresponding values between MIP mode type index values and shift factors.
[0153] In some embodiments, the first determination unit 601 is specifically configured to determine a block size index value corresponding to the current block and a MIP mode index value when MIP mode prediction is used, 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.
[0154] In some embodiments, referring to FIG. 7 , the encoder 60 may further comprise a first calculation unit 605, configured to: perform a right shift operation on the MIP mode index value using a first preset shift value to obtain a MIP mode type index value of the current block when the block size index value is equal to 0; or to perform a right shift operation on the MIP mode index value using a first preset shift value to obtain a right shifted value and overlap the right shifted value with a third preset value to obtain a MIP mode type index value of the current block when the block size index value is equal to 1; or to perform a right shift operation on the MIP mode index value using a second preset shift value to obtain a MIP mode type index value of the current block when the block size index value is equal to 2.
[0155] In some embodiments, referring to FIG. 7 , the encoder 60 may further include a first judgment unit 606, which is configured to: determine that the MIP mode index value is a fourth preset value when the block size index value is equal to 0 and the MIP mode index value is less than or equal to a first threshold value; determine that the MIP mode index value is a fifth preset value when the MIP mode index value is greater than the first threshold value; or determine that the MIP mode index value is a sixth preset value when the block size index value is equal to 1 and the MIP mode index value is less than or equal to a second threshold value. and, if the MIP mode index value is greater than a second threshold, determine the MIP mode index value to be a seventh preset value; or, if the block size index value is equal to 2, determine the MIP mode index value to be an eighth preset value if the MIP mode index value is less than or equal to a third threshold, determine the MIP mode index value to be a ninth preset value if the MIP mode index value is greater than the third threshold and less than or equal to a fourth threshold, and determine the MIP mode index value to be a tenth preset value if the MIP mode index value is greater than the fourth threshold.
[0156] In some embodiments, referring to FIG. 7 , the encoder 60 may further include a pre-encoding unit 607 configured to pre-code the current block using a plurality of prediction modes to obtain rate-distortion cost values corresponding to each prediction mode, select a minimum rate-distortion cost value from the obtained plurality of rate-distortion cost values, and determine prediction parameters under the prediction mode corresponding to the minimum rate-distortion cost value as prediction parameters of the current block.
[0157] In some embodiments, the first calculation unit 605 is further configured to perform a matrix multiplication operation on the MIP input sample matrix, the MIP weight matrix, and the shift factor using a preset calculation model to obtain a MIP predicted block of the current block; The first prediction unit 602 is specifically configured to perform a filtering process on the MIP prediction block to obtain an intra-frame prediction value of the current block, where the MIP prediction block includes prediction values of at least some pixel positions in the current block.
[0158] It is understood that the "unit" in the present embodiment may be a part of a circuit, a part of a processor, a part of a program, or software, and may be a module or a non-module. Furthermore, each component in the present embodiment may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit described above may be realized in the form of hardware or in the form of a software functional module.
[0159] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in one computer-readable storage medium. Based on this understanding, the essential part of the technical solution of this embodiment, i.e., the part that contributes to the prior art, or all or part of the solution of the technology can be embodied in the form of a software product, and the computer software product is stored in one storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0160] Thus, an embodiment of the present application provides a computer storage medium adapted to an encoder 60, the computer storage medium storing a computer program which, when executed by a first processor, realises a method according to any one of the previously described embodiments.
[0161] Based on the configuration of the encoder 60 and the computer storage medium, FIG. 16 shows an example of a specific hardware structure of the encoder 60 according to an embodiment of the present application, in which the encoder 60 may include a first communication interface 801, a first memory 802, and a first processor 803, and each component is coupled via a first bus system 804. It can be understood that the first bus system 804 is used to realize the connection communication between these components. In addition to the data bus, the first bus system 804 may include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in FIG. 8, all the various buses are represented as the first bus system 804. Here, The first communication interface 801 is configured to receive and transmit signals in the process of transmitting and receiving information to and from other external elements; The first memory 802 is configured to store a computer program executable by the first processor 803; When the first processor 803 executes the computer program, determining prediction parameters for a current block, where the prediction parameters include a prediction mode parameter and a size parameter of the current block; If the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, 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; determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0162] It can be understood that the first memory 802 in the present embodiment may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Here, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM) used as an external cache. Various forms of RAM may be used, such as, by way of example and not limitation, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The first memory 802 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0163] However, the first processor 803 may be an integrated circuit chip with signal processing functions. In the implementation process, each step of the method can be realized by a form of hardware integrated logic circuit or software in the first processor 803. The first processor 803 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc., and can realize or execute each method, step, and logic block diagram disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly performed by a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software modules may be arranged in conventional storage media such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. The storage medium is disposed in the first memory 802, and the first processor 803 reads the information in the first memory 802 and completes the steps of the aforementioned method in combination with its hardware.
[0164] It can be understood that the embodiments described in the present application can be realized in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware realization, the processing unit is realized in one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processing (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field-Programmable Gate Arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described in the present application, or a combination thereof. For software implementation, the technical solutions described in the present application can be realized by executing the modules of functions (e.g., processes, functions, etc.) 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 external to the processor.
[0165] Illustratively, as another embodiment, the first processor 803 is further configured to perform the method according to any one of the above-mentioned embodiments when executing the computer program.
[0166] This embodiment provides an encoder, which may include a first determination unit and a first prediction unit, where the first determination unit is configured to determine prediction parameters of a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block, and the first determination unit is further 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 to use a matrix-based intra prediction (MIP) mode to determine an intra prediction value of the current block, and 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. In this way, the manner of determining the shift factor can be simplified, and further, when the shift factor is determined using a lookup table, the memory occupied by the storage of the lookup table can be reduced while reducing the calculation complexity, thereby achieving the purpose of improving the efficiency of encoding and decoding.
[0167] Based on the same inventive concept as the above-mentioned embodiment, Fig. 9 is a schematic diagram of the configuration of a decoder 90 according to the embodiment of the present application. As shown in Fig. 9, the decoder 90 can include an analysis unit 901, a second determination unit 902, and a second prediction unit 903, where: The parsing unit 901 is configured to parse the 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; a second determining unit 902 configured to determine, when the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, 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; The second prediction unit 903 is configured to determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0168] In some embodiments, the shift factors of the current block include a constant shift factor and a shift factor determined according to the prediction parameters.
[0169] In some embodiments, the constant value shift factor has a value of six.
[0170] In some embodiments, the second determining unit 902 is further configured to determine a block size index value of the current block according to a size parameter of the current block, and to determine the shift factor according to the block size index value of the current block.
[0171] In some embodiments, referring to FIG. 10 , the decoder 90 may further include a second setting unit 904, which is configured to set the block size index value of the current block to 0 if the width and height of the current block are both equal to 4, set the block size index value of the current block to 1 if the width and height of the current block are both equal to 8 or any one of the width and height of the current block is equal to 4, and set the block size index value of the current block to 2 if the width and height of the current block do not satisfy the above conditions.
[0172] In some embodiments, the second setting unit 904 is further configured to set the shift factor to be equal to a ratio between a width or height of the current block and a first preset value corresponding to a block size index value of the current block.
[0173] In some embodiments, the first preset value represents a number of MIP input sample values taken from a boundary of the current block.
[0174] In some embodiments, the second determination unit 902 is further configured to determine that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the first preset values corresponding to the block size index values of the current block are equal to 2, 4, and 4, respectively.
[0175] In some embodiments, the second setting unit 904 is further configured to set the shift factor to be equal to a ratio between a width or height of the current block and a second preset value corresponding to a block size index value of the current block.
[0176] In some embodiments, the second preset value represents a size of a MIP prediction block of the current block obtained by directly using and calculating the MIP weighting matrix.
[0177] In some embodiments, the second determination unit 902 is further configured to determine that when the block size index values of the current block are equal to 0, 1, and 2, respectively, the second preset values corresponding to the block size index values of the current block are equal to 4, 4, and 8, respectively.
[0178] In some embodiments, referring to FIG. 10, the decoder 90 may further comprise a second query unit 905, where: The second determining unit 902 is further configured to determine a block size index value of the current block according to a size parameter of the current block; 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, and determine the queried shift factor as a shift factor corresponding to the current block, where the first preset lookup table is used to record corresponding values between block size index values and shift factors.
[0179] In some embodiments, the second determination unit 902 is further configured to, if the prediction mode parameter indicates to determine an intra-frame prediction value of the current block using a MIP mode, determine a MIP mode type index value of the current block; 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, and determine the queried shift factor as a shift factor corresponding to the current block, where the second preset lookup table is used to record corresponding values between MIP mode type index values and shift factors.
[0180] 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 MIP mode prediction is used according to the prediction parameters, 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.
[0181] In some embodiments, referring to FIG. 10 , the decoder 90 may further comprise a second calculation unit 906, configured to: perform a right shift operation on the MIP mode index value using a first preset shift value to obtain a MIP mode type index value of the current block when the block size index value is equal to 0; or to perform a right shift operation on the MIP mode index value using a first preset shift value to obtain a right shifted value and overlap the right shifted value with a third preset value to obtain a MIP mode type index value of the current block when the block size index value is equal to 1; or to perform a right shift operation on the MIP mode index value using a second preset shift value to obtain a MIP mode type index value of the current block when the block size index value is equal to 2.
[0182] In some embodiments, referring to FIG. 10 , the decoder 90 may further include a second judgment unit 907, which is configured to: determine that the MIP mode index value is a fourth preset value when the block size index value is equal to 0 and the MIP mode index value is smaller than or equal to a first threshold value; determine that the MIP mode index value is a fifth preset value when the MIP mode index value is larger than the first threshold value; or determine that the MIP mode index value is a sixth preset value when the block size index value is equal to 1 and the MIP mode index value is smaller than or equal to a second threshold value; and, if the MIP mode index value is greater than a second threshold, determine the MIP mode index value to be a seventh preset value; or, if the block size index value is equal to 2, determine the MIP mode index value to be an eighth preset value if the MIP mode index value is less than or equal to a third threshold, determine the MIP mode index value to be a ninth preset value if the MIP mode index value is greater than the third threshold and less than or equal to a fourth threshold, and determine the MIP mode index value to be a tenth preset value if the MIP mode index value is greater than the fourth threshold.
[0183] In some embodiments, the second calculation unit 906 is further configured to perform a matrix multiplication operation on the MIP input sample matrix, the MIP weighting matrix, and the shift factor using a preset calculation model to obtain a MIP predicted block of the current block; The second prediction unit 903 is specifically configured to perform a filtering operation on the MIP prediction block to obtain an intra-frame prediction value of the current block, where the MIP prediction block includes prediction values of at least some pixel positions in the current block.
[0184] It is understood that the "unit" in the present embodiment may be a part of a circuit, a part of a processor, a part of a program, or software, and may be a module or a non-module. Furthermore, each component in the present embodiment may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit may be realized in the form of hardware or in the form of a software functional module.
[0185] When the integrated unit is realized in the form of a software functional module and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer storage medium applied to the decoder 90, in which a computer program is stored, and when the computer program is executed by the second processor, the method according to any one of the above-mentioned embodiments is realized.
[0186] Based on the configuration of the decoder 90 and the computer storage medium, FIG. 11 shows an example of a specific hardware structure of the decoder 90 according to the embodiment of the present application, in which the decoder 90 may include a second communication interface 1101, a second memory 1102, and a second processor 1103, and each component is coupled via a second bus system 1104. It can be understood that the second bus system 1104 is used to realize the connection communication between these components. In addition to the data bus, the second bus system 1104 further includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, all the various buses are represented as the second bus system 1104 in FIG. 11. Here, The second communication interface 1101 is configured to send and receive signals in the process of transmitting and receiving information to and from other external network elements.
[0187] The second memory 1102 is configured to store a computer program executable by the second processor 1103 .
[0188] When executing the computer program, the second processor 1103 Parsing a bitstream to obtain prediction parameters for a current block, where the prediction parameters include a prediction mode parameter and a size parameter of the current block; If the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, 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; determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix.
[0189] Illustratively, as another embodiment, the second processor 1103 is further configured to perform the method according to any one of the previous embodiments when executing the computer program.
[0190] It can be understood that the second memory 1102 has the same hardware functions as the first memory 802, and the second processor 1103 has the same hardware functions as the first processor 803, and they will not be described again here.
[0191] This embodiment provides a decoder, which may include an analysis unit, a second determination unit, and a second prediction unit, where the analysis unit is configured to analyze a bitstream to obtain prediction parameters of a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block, the second determination 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 to use a matrix-based intra prediction (MIP) mode 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 sample matrix. In this way, the method of determining the shift factor can be simplified, and when the shift factor is determined using a lookup table, the memory occupied by the storage of the lookup table can be reduced while reducing the calculation complexity, thereby achieving the purpose of improving the efficiency of encoding and decoding.
[0192] It is noted that, in this application, the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a set of elements includes not only those elements, but also other elements not expressly listed or inherent elements of such process, method, article, or apparatus. Unless otherwise limited, an element defined with the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0193] The numbers of the above-mentioned embodiments of the present invention do not indicate superiority or inferiority of the embodiments, but are used for convenience of explanation.
[0194] The methods disclosed in the several method embodiments provided in this application can be combined in any manner without conflict to obtain new method embodiments.
[0195] The features disclosed in the several product embodiments provided in this application may be combined in any non-conflicting manner to obtain new product embodiments.
[0196] The features disclosed in any method or apparatus embodiment provided in this application may be combined in any non-conflicting manner to obtain new method or apparatus embodiments.
[0197] The above content is merely a specific embodiment of the present application, and the protection scope of the present application is not limited thereto. Any modifications or replacements that a person skilled in the art can easily think of within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims. [Industrial Applicability]
[0198] The present embodiment is applied to an encoder or a decoder. After obtaining the prediction parameters of the current block, if the prediction mode parameter in the prediction parameters indicates to use the MIP mode 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 can be determined. Then, 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 method of determining the shift factor can be simplified on either the decoder side or the encoder side, and further, when the shift factor is determined using a lookup table, the memory occupied by the storage of the lookup table can be reduced while reducing the calculation complexity, thereby achieving the purpose of improving the efficiency of encoding and decoding.
Claims
1. 1. A method for predicting an image component, for application to an encoder, comprising: determining prediction parameters for a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block; if the prediction mode parameter indicates to determine an intra prediction value of a current block using a matrix-based intra prediction (MIP) mode, 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; determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix; The MIP weight matrix of the current block is determined according to at least a block size index value of the current block, the block size index value of the current block being determined according to a size parameter of the current block; the shift factor of the current block includes a constant shift factor, the value of the constant shift factor being 6; Determining a block size index value of the current block according to a size parameter of the current block includes: if the width and height of the current block are both equal to 4, setting a block size index value of the current block to 0; setting a block size index value of the current block to 1 if the width and height of the current block are both equal to 8, or if either the width or height of the current block is equal to 4; if the width and height of the current block do not satisfy the above condition, setting the block size index value of the current block to 2. Image component prediction methods.
2. determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix, performing a matrix multiplication process on the MIP input sample matrix, the MIP weight matrix, and the shift factor using a preset computation model to obtain a MIP predicted block of the current block; and performing a filtering process on the MIP prediction block to obtain an intra-frame prediction value of the current block, the MIP prediction block including prediction values of at least some pixel positions within the current block. The method of claim 1 .
3. 1. A method for predicting an image component, applied to a decoder, comprising: Parsing a bitstream to obtain prediction parameters for a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block; if the prediction mode parameter indicates to determine an intra prediction value of a current block using a matrix-based intra prediction (MIP) mode, 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; determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix; The MIP weight matrix of the current block is determined according to at least a block size index value of the current block, and the block size index value of the current block is determined according to a size parameter of the current block; the shift factor of the current block includes a constant shift factor, the value of the constant shift factor being 6; Determining a block size index value of the current block according to a size parameter of the current block includes: if the width and height of the current block are both equal to 4, setting a block size index value of the current block to 0; setting a block size index value of the current block to 1 if the width and height of the current block are both equal to 8, or if either the width or height of the current block is equal to 4; if the width and height of the current block do not satisfy the above condition, setting the block size index value of the current block to 2. Image component prediction methods.
4. determining an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix, performing a matrix multiplication process on the MIP input sample matrix, the MIP weight matrix, and the shift factor using a preset computation model to obtain a MIP predicted block of the current block; and performing a filtering process on the MIP prediction block to obtain an intra-frame prediction value of the current block, the MIP prediction block including prediction values of at least some pixel positions within the current block. The method of claim 3 .
5. An encoder comprising a first decision unit and a first prediction unit, The first determination unit is configured to determine prediction parameters of a current block, the prediction parameters including 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 to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, determine 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; The first prediction unit is configured to determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix; The MIP weight matrix of the current block is determined according to at least a block size index value of the current block, and the block size index value of the current block is determined according to a size parameter of the current block; the shift factor of the current block includes a constant shift factor, the value of the constant shift factor being 6; Determining a block size index value of the current block according to a size parameter of the current block includes: if the width and height of the current block are both equal to 4, setting a block size index value of the current block to 0; setting a block size index value of the current block to 1 if the width and height of the current block are both equal to 8, or if either the width or height of the current block is equal to 4; if the width and height of the current block do not satisfy the above condition, setting the block size index value of the current block to 2. encoder.
6. An encoder comprising: a first memory; and a first processor, the first memory is configured to store a computer program executable by the first processor; An encoder, wherein the first processor is configured to execute the image component prediction method according to claim 1 or 2 when executing the computer program.
7. A decoder comprising a parsing unit, a second determining unit, and a second predicting unit, The parsing unit is configured to parse a bitstream to obtain prediction parameters of a current block, the prediction parameters including a prediction mode parameter and a size parameter of the current block; The second determination unit is configured to determine, when the prediction mode parameter indicates to determine an intra prediction value of the current block using a matrix-based intra prediction (MIP) mode, 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; the second prediction unit is configured to determine an intra-frame prediction value of the current block according to the MIP weight matrix, the shift factor, and the MIP input sample matrix; The MIP weight matrix of the current block is determined according to at least a block size index value of the current block, and the block size index value of the current block is determined according to a size parameter of the current block; the shift factor of the current block includes a constant shift factor, the value of the constant shift factor being 6; Determining a block size index value of the current block according to a size parameter of the current block includes: if the width and height of the current block are both equal to 4, setting a block size index value of the current block to 0; setting a block size index value of the current block to 1 if the width and height of the current block are both equal to 8, or if either the width or height of the current block is equal to 4; if the width and height of the current block do not satisfy the above condition, setting the block size index value of the current block to 2. Decoder.
8. A decoder comprising: a second memory; and a second processor, the second memory is configured to store a computer program executable by the second processor; A decoder, wherein the second processor is configured to execute the image component prediction method according to claim 3 or 4 when executing the computer program.
9. 10. A computer storage medium having a computer program stored thereon, the computer program executing the image component prediction method according to claim 1 or 2 when executed by a first processor, or executing the image component prediction method according to claim 3 or 4 when executed by a second processor.