Image codec method, image decode method, and decoder
By unifying right-shift parameters for different block sizes and modes in MIP, the video codec achieves reduced storage and processing time without compromising performance.
Patent Information
- Application Number
- JP2025185375
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-01-19
AI Technical Summary
The existing video codec technologies using Matrix-Based Intra Prediction (MIP) face inefficiencies due to varying parameters for different block sizes and modes, leading to increased storage requirements and processing time.
Unifying the initial right-shift parameters for different block sizes and modes using an offset parameter to standardize the number of right-shift bits, thereby simplifying the MIP algorithm and reducing storage space and processing time.
This approach reduces storage space and overall time required for coding processes while maintaining codec performance, enhancing efficiency by eliminating the need to query and store multiple parameter sets.
Smart Images

Figure 2026009300000001_ABST
Abstract
Description
[Technical Field]
[0001] The present embodiment relates to the technical field of video codec, and in particular to an image codec method, an encoder, a decoder and a storage medium. [Background technology]
[0002] A new intra-coding technique, matrix-based intra prediction (MIP), has been proposed in a reference software test platform for versatile video coding (VVC). MIP is a neural network-based intra prediction technique that uses a multi-layer neural network to predict the luminance value of a current block based on neighboring reconstructed luminance blocks. Specifically, when performing intra prediction using MIP mode, similar to the traditional intra mode, the input of MIP prediction is also the data of the luminance block adjacent to the previous row and left column of the current block, and the output is the predicted luminance component value of the current block. The specific prediction process can be divided into three steps: downsampling, matrix-vector multiplication, and interpolation.
[0003] However, when performing luma prediction via MIP mode, the parameters used for luma blocks of different sizes may also be different, thus occupying a large storage space and storing a large number of parameters, and the search and call of parameters for the prediction process also increases the overall time and reduces the efficiency of the codec. Summary of the Invention [Problem to be solved by the invention]
[0004] The embodiments of the present invention provide an image coding method, an encoder, a decoder and a storage medium, which can reduce the storage space and overall time required for the coding process while ensuring the codec performance, and effectively improve the efficiency of the codec. [Means for solving the problem]
[0005] The technical solution of the present embodiment is realized as follows:
[0006] An embodiment of the present application provides an image coding method applied to an encoder, the method comprising: Before performing the coding process according to the MIP mode, perform correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the right shift bit number of the predicted value; and When performing the coding process according to the MIP mode, performing the coding process according to the offset parameter.
[0007] An embodiment of the present application provides an image decoding method applied to a decoder, the method comprising: Before performing the decoding process according to the MIP mode, perform a correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the right shift bit number of the predicted value; and When the decoding process is performed according to the MIP mode, the decoding process is performed according to the offset parameter.
[0008] An embodiment of the present invention provides an encoder, the encoder comprising: a first correction part and a coding part; the first correction unit is configured to perform correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing coding processing according to an MIP mode, where the offset parameter is used to indicate the number of right-shift bits of a predicted value; The coding section is configured to perform the coding process according to the offset parameter when performing the coding process according to the MIP mode.
[0009] An embodiment of the present invention provides a decoder, the decoder comprising: a second correction part and a decoding part; the second correction unit is configured to perform correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing a decoding process according to an MIP mode, where the offset parameter is used to indicate the number of right-shift bits of the predicted value; The coding part is configured to perform the decoding process according to the offset parameter when performing the decoding process according to the MIP mode.
[0010] An embodiment of the present application provides an encoder comprising a first processor, a first memory for storing executable instructions for the first processor, a first communication interface, and a first bus used to connect the first processor to the first memory and the first communication interface, and wherein the instructions, when executed by the first processor, realize the above-mentioned image coding method.
[0011] An embodiment of the present application provides a decoder comprising a second processor, a second memory for storing executable instructions for the second processor, a second communication interface, and a second bus configured to connect the second processor to the second memory and the second communication interface, and the instructions, when executed by the second processor, realize the above-mentioned image decoding method.
[0012] An embodiment of the present application provides a computer-readable storage medium on which a program is stored, the program being applied to an encoder and a decoder, and realizing the above image coding method when the program is executed by a processor. [Effects of the Invention]
[0013] The present embodiments provide an image codec method, an encoder, a decoder, and a storage medium, in which the encoder performs a correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing a coding process according to an MIP mode, where the offset parameter is used to indicate the number of right-shift bits of a predicted value, and when performing the coding process according to the MIP mode, the encoder performs the coding process according to the offset parameter. The decoder performs a correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter before performing a decoding process according to the MIP mode, and when performing the decoding process according to the offset parameter. As can be seen, the image coding method proposed by the present application uses an offset parameter to perform correction to standardize the number of right-shift bits of the predicted value, so that all luminance blocks of different sizes and different MIP mode numbers have the same sW value. As a result, there is no need to query and call the sW value when performing coding processing. This reduces the complexity of the MIP algorithm and ensures codec performance, while reducing the storage space and overall time required for the coding process and effectively improving codec efficiency. [Brief explanation of the drawings]
[0014] [Figure 1] FIG. 1 is a schematic diagram illustrating the arrangement of 67 types of prediction modes in intra prediction. [Figure 2] 1 is an exemplary flowchart for coding in MIP mode. [Figure 3] FIG. 10 is a schematic diagram of the arrangement of the upper and left neighboring luminance blocks of the current block; [Figure 4] FIG. 1 is a schematic diagram of an arrangement for determining a DM mode. [Figure 5] 1 is an exemplary structural diagram of a video coding system; [Figure 6] 1 is an exemplary structural diagram of a video decoding system; [Figure 7] 1 is an exemplary implementation flowchart 1 of an image coding method proposed by an embodiment of the present application; [Figure 8] 2 is an exemplary implementation flowchart 2 of the image coding method proposed by the present embodiment; [Figure 9] 1 is an exemplary implementation flowchart 1 of an image decoding method proposed by an embodiment of the present application; [Figure 10] 2 is an exemplary implementation flowchart 2 of the image decoding method proposed by the present embodiment; [Figure 11] 1 is an exemplary structural diagram of an encoder configuration proposed by an embodiment of the present invention; [Figure 12] 2 is an exemplary structural diagram of an encoder configuration proposed by an embodiment of the present invention. [Figure 13] 1 is an exemplary structural diagram of a decoder configuration proposed by an embodiment of the present invention; [Figure 14] 2 is an exemplary structural diagram of a decoder configuration proposed by an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0015] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to describe related applications and are not intended to limit the applications. Furthermore, it should be noted that for ease of description, only parts related to the related applications are shown in the drawings.
[0016] In video images, VVC accepts the Affine Linear Weighted Intra Prediction technique proposed in Joint Video Experts Team (JVET)-N0217 and amends its name to Matrix-Based Intra Prediction, or MIP technique, which adds different numbers of matrix-based intra prediction modes to the intra luma prediction process for different sizes of intra luma coding blocks.
[0017] In order to capture the finer edge directions presented in natural video, VVC expands the 33 intra-luminance prediction angle modes defined in the video compression standard (HEVC: High Efficiency Video Coding) to 65. Figure 1 is a schematic diagram of the arrangement of 67 prediction modes in intra prediction. As shown in Figure 1, arrows numbered 2 to 66 represent the 65 intra-angle prediction modes. In addition, there are also two non-angle modes: a gradually flattening Planar mode numbered 0 and a direct current (DC) mode numbered 1. Therefore, the intra prediction process in VVC includes two non-angle modes and 65 angle modes. Here, these 67 prediction modes are referred to as conventional modes of intra prediction.
[0018] MIP is an intra prediction technology based on a neural network, that is, it uses a multi-layer neural network to predict the luminance value of a current block based on neighboring reconstructed pixels. Specifically, the MIP technology divides luminance coding blocks into three types according to the size of the intra luminance coding block, and sets the size of the luminance coding block as W×H, where W is a width parameter and H is a height parameter. According to the size of the luminance coding block, the luminance coding block can be divided into the following three types:
[0019] Luminance coding blocks of size 4x4 are luminance blocks of the first type, luminance coding blocks of sizes 8x4, 4x8 and 8x8 are luminance blocks of the second type, and luminance coding blocks of other sizes are luminance blocks of the third type.
[0020] For these three types of intra-luminance coding blocks, the MIP technique adds M MIP modes to the 67 conventional intra-prediction modes, where M=35 for the first type of luminance block, M=19 for the second type of luminance block, and M=11 for the third type of luminance block.
[0021] Specifically, the MIP technique is only applied to intra-luminance prediction. Similar to the conventional mode, the input of the MIP prediction is also the data of the previous row and left column of the current block, and the output is the predicted value of the current block. The specific prediction process is divided into three steps: averaging, matrix-vector multiplication, and interpolation. That is, the predicted value of the luminance component of the current block can be obtained by performing these three steps on the reconstructed luminance values of the input adjacent pixels in the previous row and left column.
[0022] FIG. 2 is an exemplary flowchart of coding in MIP mode. As shown in FIG. 2, the MIP mode performs luma prediction, which is specifically realized as follows:
[0023] In step 1, we perform the averaging operation on the neighboring reference points above the current block to create a vector bdry with a total of N values. top and perform the average operation on the adjacent reference points on the left side of the current block to obtain a vector bdry with a total of N values. left If the current block is the first type of luminance coding, N=2, and if the current block is the second or third type of luminance coding, N=4. top and vector bdryleft is a new vector bdry red and perform the subsequent operations.
[0024] In step 2, the corresponding matrix A is obtained through the mode number k of the MIP mode. k and offset amount b k , and calculate and obtain the partial predicted value of the current block identified by the crossing line through the following equation (1), as shown in FIG. 2 .
number
[0025] In step 3, the residual prediction value Predred of the current block is obtained through linear interpolation.
[0026] It should be noted that for the implementation process of coding the current block, the specific coding mode used for intra prediction needs to be written into the compressed code stream, so that the decoding side can determine, through analyzing the mode information, whether to use a conventional mode or an MIP mode, and if it is a conventional mode, which specific conventional mode, or if it is an MIP mode, which specific MIP mode.
[0027] In VVC intra prediction, for each luma coding block, a comparison of the RAD distortion cost RDcost between all 67 conventional modes and M MIP modes is performed, and the optimal mode is selected from the 67 conventional modes and M MIP modes for coding. To save bit overhead, VVC uses an intra-mode coding technique based on a Most Probable Modes List (MPM).
[0028] Note that since the multi-reference line technique (extend reference line) and intra sub-block partitioning technique (ISP) are only used for modes in the MPM list, if extendrefflag and ispflag are both 0, i.e., if a reference line that is 0 is used and no sub-block partitioning is performed, then the position of the optimal mode in the MPM list is directly coded without the need to code mpmflag.
[0029] Furthermore, for constructing the MPM list and the MIPMPM list, in VVC luma intra prediction, if the optimal mode selected for the current block is a conventional mode, an MPM list containing the six most likely conventional modes must be constructed, and if the optimal mode selected for the current block is an MIP mode, an MIPMPM list containing the three most likely MIP modes must be constructed.
[0030] FIG. 3 is a schematic diagram of the arrangement of the upper adjacent luminance block and the left adjacent luminance block of the current block. As shown in FIG. 3, the above two lists are both derived according to the optimal modes of the upper adjacent luminance block (A) and the left adjacent luminance block (L) of the current block shown in FIG. 3.
[0031] Furthermore, for constructing the MIPMPM list, if the optimal mode of the current block in VVC intra prediction is a MIP mode, then the MIPMPM list needs to be constructed. In the process of constructing the MIPMPM list, it is first necessary to obtain the MIP mode ABOVE_MIP corresponding to the optimal mode of the upper adjacent luminance block and the MIP mode LEFT_MIP corresponding to the optimal mode of the left adjacent luminance block.
[0032] Further, after obtaining LEFT_MIP and ABOVE_MIP, construct a MIPMPM list including three most probable MIPMPM modes according to the following method: where the number in MIPMPM is the number of the MIP mode, and the number ranges from 0 to (M-1), and for the first type of luminance block, the number is 0-34, for the second type of luminance block, the number is 0-18, and for the third type of luminance block, the number is 0-10; If LEFT_MIP is available (not -1), put LEFT_MIP into the MIPMPMlist, If ABOVE_MIP is available (not -1), put ABOVE_MIP into the MIPMPMlist after redundancy check, If LEFT_MIP is not available (is -1) and ABOVE_MIP is not available (is -1), add the default list according to the type of the current block, after redundancy check, until the MIPMPMlist is filled.
[0033] The default list for the first type of luminance block is {17,34,5}, The default list for the second type of luminance block is {0,7,16}, The default list for the third type of luminance block is {1,4,6}.
[0034] Furthermore, in the chroma intra prediction process of VVC, there is a direct mode (DM) that uses correlation between components, and intra prediction of the current chroma block is performed using the intra prediction mode of the central position of the luma coding block at the same position corresponding to the current block. Figure 4 is a schematic diagram of the arrangement for determining the DM mode. As shown in Figure 4, MIP technology is only used for luma coding blocks. Therefore, if the intra prediction mode of the CR position in Figure 4 is MIP mode, it is necessary to add that the MIP mode is mapped to a conventional mode via an "MIP-conventional mapping table" to perform intra prediction of the current chroma block.
[0035] That is, with the introduction of MIP technology, in the intra prediction process, the construction of the MPMPM list requires mapping of conventional modes to MIP modes, and the construction of the MPM list and the determination of the DM mode requires mapping of MIP modes to conventional modes. [Table 1]
[0036] Furthermore, in the process of constructing the MPM list and obtaining the DM mode, a mapping from MIP modes to conventional modes must be used. Specifically, 35, 19, and 11 MIP modes are mapped to 67 conventional modes through a "MIP-conventional mapping table." For three types of luminance blocks, the three "MIP-conventional mapping tables" are as shown in Table 2, Table 3, and Table 4. [Table 2] [Table 3] [Table 4]
[0037] FIG. 5 is an exemplary structural diagram of a video coding system. As shown in FIG. 5, the video coding system 100 includes a transform and quantization module 101, an intra estimation module 102, an intra prediction module 103, a motion compensation module 104, a motion estimation module 105, an inverse transform and inverse quantization module 106, a filter control analysis module 107, a deblocking filtering and sample adaptive offset (SAO) filtering module 108, a header coding and context-based adaptive binary arithmetic coding (CABAC) module 109, a frame rate control module 110, a frame rate control module 111, a frame rate control module 112, a frame rate control module 113, a frame rate control module 114, a frame rate control module 115, a frame rate control module 116, a frame rate control module 117, a frame rate control module 118, a frame rate control module 119, a frame rate control module 120, a frame rate control module 121, a frame rate control module 122, a frame rate control module 123, a frame rate control module 124, a frame rate control module 125, a frame rate control module 126, a frame rate control module 127, a frame rate control module 128, a frame rate control module 129, a frame rate control module 130, a frame rate control module 131, a frame rate control module 132, a frame rate control module 133, a frame rate control module 134, a frame rate control module 135, a frame rate control module 136, a frame rate control module 137, a frame rate control module 138, a frame rate control module 139, a frame rate control module 139, a frame rate control module 140, a frame rate control module 141, a frame rate control module 142, a frame rate control module 143, a frame rate control module 144 6 is an exemplary structural diagram of a video decoding system. As shown in FIG. 6, the video decoding system 200 includes components such as a header decoding and CABAC decoding module 201, an inverse transform and inverse quantization module 202, an intra prediction module 203, a motion compensation module 204, a deblocking filtering and SAO filtering module 205, and a decoded image cache module 206. The video image is partially processed by the video coding system 100 through a transform and quantization module 101, an intra estimation module 102, an intra prediction module 103, a motion compensation module 104, a motion estimation module 105, a deblocking filtering and SAO filtering module 108, and a header coding and CABAC module 109, which outputs a code stream of the video image, and the code stream is input to a video decoding system 200, which partially processes the video image through a header decoding and CABAC decoding module 201, an inverse transform and inverse quantization module 202, an intra prediction module 203, and a motion compensation module 204, which finally restores the original video image.
[0038] According to the height and width parameters, the current block can have 25 different sizes. Specifically, the standard specifies that the maximum luma block is 128x128, but the maximum size of a transform unit is 64x64, that is, a luma block has a size of 128x128 and must first be subjected to quadtree division, so the maximum luma block size is 64x64. Table 5 is a summary table of luma block sizes, as shown in Table 5. [Table 5]
[0039] In the prior art, the MIP mode is restricted according to the height and width parameters of the current block. Specifically, if the width-to-height ratio of the current block is greater than 4 or the height-to-width ratio is greater than 4, the current block is not coded through the MIP mode. Table 6 shows the luminance block size restrictions in the MIP mode of the prior art, as shown in Table 6. [Table 6]
[0040] In the prior art, for a first-type luminance block in MIP mode (a luminance block corresponding to 4×4), two adjacent luminance blocks above and two adjacent luminance blocks to the left are matrix-operated to generate a 4×4 prediction block; for a second-type luminance block in MIP mode (a luminance block corresponding to 4×8, 8×4, or 8×8), four adjacent luminance blocks above and four adjacent luminance blocks to the left are matrix-operated to generate a 4×4 prediction block; for a third-type luminance block in MIP mode (a luminance block corresponding to other sizes), four adjacent luminance blocks above and four adjacent luminance blocks to the left are matrix-operated to generate a 4×8 prediction block (a 4×16 luminance block), an 8×4 prediction block (a 16×4 luminance block), or an 8×8 prediction block (a luminance block of other sizes). Here, since the third-type luminance block generates a non-square prediction block, it is necessary to extract odd rows from the matrix when calculating.
[0041] Furthermore, in the grammar, MipSizeId indicates the MIP application class, numModes indicates the number of MIP modes, boundarySize indicates the number of luminance blocks in the upper reference row or left reference column obtained by downsampling, predW indicates the width parameter of the prediction block, predH indicates the height parameter of the prediction block, and predC indicates the side length of the MIP matrix. Table 7 shows the grammar relationships corresponding to the MIP modes of the prior art. As shown in Table 7, MipSizeId, numModes, boundarySize, predW, predH, and predC in the grammar have the following relationships: [Table 7]
[0042] Furthermore, in the grammar, MipSizeId takes a value of 0 to indicate a 4x4 luma block, a value of 1 to indicate a 4x8, 8x4, or 8x8 luma block, or a value of 2 to indicate luma blocks of other sizes. numModes indicates the total number of MIP prediction modes, i.e., there are a total of 35 types of 4x4 luma blocks, a total of 19 types of 4x8, 8x4, or 8x8 luma blocks, and a total of 11 types of luma blocks of other sizes. boundarySize indicates that the adjacent luma block in the row above or the adjacent luma block in the left column of the current block will be downsampled to two or four adjacent luma blocks in the end.
[0043] In the prior art, when an encoder performs luma prediction via MIP mode, it can do so via the following equation (2):
number
[0044] Here, mWeight and vBias are the weight matrix and bias matrix obtained by deep learning for each MIP mode. Specifically, mWeight is the weight matrix for each MIP mode, and vBias is the bias matrix for each MIP mode. sB is the left shift amount of the bias matrix, oW is the reserved value for rounding, and sW is the right shift amount of the overall predicted value. The sW value for different MIP modes must be obtained by table lookup.
[0045] Based on JVET-N1001-v7, when generating the MIP prediction matrix, the encoder determines whether it needs to extract the prediction values of odd rows through the variables incW and incH, as follows:
number
[0046] Here, incW=2 or incH=2 indicates that extraction is required using the width or height parameter.
[0047] Table 8 is a grammatical description of sW in the prior art. As shown in Table 8, the value of sW is 9 only when MipSizeId is equal to 1, that is, when the current block size is 4x8, 8x4, or 8x8 and the MIP mode number is 3, 8, 12, or 17, and the value of sW is 8 in all the remaining MIP modes. Here, the value of sW in the MIP mode is a mapping relationship, so the value of sW in all modes can be obtained through Table 8. [Table 8]
[0048] Table 9 shows the mWeight matrix when MipSizeId is 1 and MIP mode numbers are 3 and 12. [Table 9]
[0049] Table 10 is the vBias matrix when MipSizeId is 1 and MIP mode numbers are 3 and 12. [Table 10]
[0050] Table 11 is the mWeight matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. Table 12 is the vBias matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. [Table 11] [Table 12]
[0051] As shown in Table 8, due to the different grammar descriptions of sW in different MIP modes, when the encoder performs luma prediction through the MIP mode, if the MipSizeId of the current block is 1, that is, if the current block is a second-type luma block (a luma block whose size is 4x8, 8x4, or 8x8), and the MIP mode number corresponding to the current coding block is 3, 8, 12, or 17, the value of sW will be different from that of other modes, which will cause inconsistency in the algorithm and increase the time complexity of the algorithm in the process of querying Table 8 above, and will also require storage space for Table 8. That is, when performing luma prediction through the MIP mode, the parameters used for luma blocks of different sizes may also be different, which will require large storage space to store a large number of parameters, and the overall time required for searching and retrieving parameters in the prediction process will also increase, reducing the efficiency of the codec.
[0052] To solve the above problem, this application proposes an image coding method to correct the values of sW in MIP mode numbers 3, 8, 12, and 17 of the second type luminance block, so that the values of sW in all MIP mode numbers are the same, thereby reducing storage space and reducing overall time by omitting the operation of looking up a table.
[0053] Furthermore, the image coding method proposed in this application can affect the intra prediction part in the video coding hybrid framework, i.e., it is mainly applied to the intra prediction module 103 in video coding and the intra prediction module 203 in video decoding, and acts on the coding side and the decoding side simultaneously.
[0054] It should be noted that in the embodiment of the present application, based on the calculation parameters obtained by training the machine learning method, the image coding method proposed in the present application can perform a unified correction of sW according to a fixed offset parameter, and at the same time, correct the corresponding weight matrix and bias matrix. Here, in the present application, the second-type luminance block is not limited to correcting the value of sW in the MIP mode numbers of 3, 8, 12, and 17, and performs a unified correction for different values of sW, which is the calculation parameter obtained by training the machine learning method, after specific parameter changes (including different combinations of parameters such as size, mode, right shift value, etc.).
[0055] Furthermore, in the following embodiments, the values of sW in the MIP mode numbers 3, 8, 12, and 17 of the second type luminance block are taken as examples to exemplify the image coding method proposed in this application.
[0056] Hereinafter, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application.
[0057] In one embodiment of the present application, FIG. 7 is an exemplary implementation flowchart 1 of the image coding method proposed by the embodiment of the present application. As shown in FIG. 7, in the embodiment of the present application, the method in which the encoder performs image coding may include the following steps:
[0058] In step 101, before performing the coding process according to the MIP mode, a correction is performed to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the number of right shift bits of the predicted value.
[0059] In an embodiment of the present application, before performing the coding process according to the MIP mode, the encoder can first set an offset parameter used to indicate the number of offset bits.
[0060] It should be noted that in the embodiment of the present application, based on the above equation (2), the offset parameter is sW in equation (2), that is, the offset parameter is the right shift amount of the overall predicted value, that is, when performing luma prediction on the current block, the offset parameter is used to indicate the number of right shift bits of the overall predicted value of the current block.
[0061] Furthermore, in an embodiment of the present application, the encoder can set the offset parameter to a fixed positive integer before performing the coding process according to the MIP mode, that is, after the encoder sets the offset parameter, the offset parameter to be used for any current block is determined regardless of the size of the current block or the MIP mode number corresponding to the current block.
[0062] It should be noted that in the present embodiment, when the encoder performs the correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, the encoder can set the offset parameter to any positive integer. Specifically, the encoder can preferably set the offset parameter sW to 6, or preferably set the offset parameter sW to 7, or preferably set the offset parameter sW to 8, or preferably set the offset parameter sW to 9.
[0063] For example, Table 13 is the first grammar description of sW in the present application. In an embodiment of the present application, when the encoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, it can set the corresponding sW for a luminance block whose size is 4×8, 8×4, or 8×8 and whose MIP mode number is 3, 8, 12, or 17 to the same value as the sW for other luminance blocks. That is, if the sW for other luminance blocks is 8, the sW for the luminance blocks whose size is 4×8, 8×4, or 8×8 and whose MIP mode number is 3, 8, 12, or 17 will be set to 8, so that different current blocks have the same offset parameter sW. [Table 13]
[0064] For example, Table 14 is the second grammar description of sW in the present application. In an embodiment of the present application, when the encoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, it can set the corresponding sW for a luminance block whose size is 4×8, 8×4, or 8×8 and whose MIP mode number is 3, 8, 12, or 17 to the same value as the sW for other luminance blocks. That is, if the sW for other luminance blocks is 7, the sW for the luminance blocks whose size is 4×8, 8×4, or 8×8 and whose MIP mode number is 3, 8, 12, or 17 will be set to 7, so that different current blocks have the same offset parameter sW. [Table 14]
[0065] For example, Table 15 is the second grammar description of sW in the present application. In an embodiment of the present application, when the encoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, it can set the corresponding sW for a luminance block whose size is 4×8, 8×4, or 8×8 and whose MIP mode number is 3, 8, 12, or 17 to the same value as the sW for other luminance blocks. That is, if the sW for other luminance blocks is 8, the sW for the luminance blocks whose size is 4×8, 8×4, or 8×8 and whose MIP mode number is 3, 8, 12, or 17 will be set to 8, so that different current blocks have the same offset parameter sW. [Table 15]
[0066] As shown in Table 8 above, in the prior art, the offset parameter sW corresponding to different current blocks may be different. Specifically, only when MipSizeId is equal to 1, that is, the current block is a second-type luminance block, the size is 4x8, 8x4, or 8x8, and the MIP mode number is 3, 8, 12, or 17, the value of sW is different from the values of sW for all the remaining MIP mode numbers. Therefore, when coding the current block, the encoder needs to query and call the offset parameter sW according to the size and MIP mode number of the current block, which increases the overall time and reduces the efficiency of the codec, and also increases the storage space because it needs to store a grammar description table for sW. Compared with the prior art, the present application can first set the offset parameter sW before performing the coding process according to the MIP mode, and set the offset parameters sW corresponding to all luminance blocks of different sizes and different MIP mode numbers to the same value. When coding the current block, there is no need to query and call the offset parameter sW according to the size and MIP mode number of the current block, and the encoder also does not need to store a grammar description table for sW, which further reduces the storage space and overall time required for the coding process and effectively improves the efficiency of the codec.
[0067] In this embodiment, when the encoder sets the offset parameter sW, it sets all offset parameters sW corresponding to different sizes and different MIP mode numbers to the same value. However, only when MipSizeId is equal to 1, i.e., when the current block is a second-type luminance block, the size is 4×8, 8×4, 8×8, and the MIP mode number is 3, 8, 12, or 17, the value of sW is different from the values of sW for all the remaining MIP mode numbers. Therefore, it should be noted that when the encoder uniformly corrects sW for the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, it sets the offset parameter sW corresponding to the size of 4×8, 8×4, 8×8, and the MIP mode number is 3, 8, 12, or 17.
[0068] As can be seen from this, in the embodiment of the present application, the process in which the encoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter is as follows: if the initial right shift parameter is different from the offset parameter, the encoder corrects the initial right shift parameter to the offset parameter so that the number of right shift bits of all predicted values corresponding to all sizes and all MIP mode numbers are all the same.
[0069] In step 102, if the coding process is performed according to the MIP mode, the coding process is performed according to the offset parameter.
[0070] In an embodiment of the present application, the encoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, and then when the encoder performs coding according to the MIP mode, the encoder can perform coding based on the set offset parameter.
[0071] It should be noted that in the embodiment of the present application, after setting the offset parameter, when the encoder performs the coding process according to the MIP mode, it can directly perform the coding process for the current block according to the offset parameter, which can reduce the storage space and overall time required for the coding process and effectively improve the efficiency of the codec while ensuring the codec performance.
[0072] In the embodiment of the present application, further, FIG. 8 is an exemplary implementation flowchart 2 of the image coding method proposed by the embodiment of the present application. As shown in FIG. 8, after the encoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, i.e., after step 101, the method of the encoder performing image coding further includes the following steps:
[0073] In step 103, the initial weight matrix and the initial bias matrix are corrected according to a preset calculation rule to obtain a corrected weight matrix and a corrected bias matrix, where the initial weight matrix and the initial bias matrix correspond to the initial right shift parameters that have been corrected to be unified.
[0074] In an embodiment of the present application, the encoder performs a correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, and then corrects the initial weight matrix and the initial bias matrix according to a preset calculation rule, thereby obtaining a corrected weight matrix and a corrected bias matrix.
[0075] It should be noted that in the present implementation, the initial weight matrix and the initial bias matrix correspond to the initial right shift parameters that have undergone the unifying correction.
[0076] It should be noted that in the present embodiment, the preset calculation rule can be used to update the corresponding initial weight matrix and initial bias matrix when the size is 4x8, 8x4, or 8x8 and the MIP mode number is 3, 8, 12, or 17.
[0077] Furthermore, in the embodiment of the present application, after the encoder sets the offset parameters, i.e., after correcting the offset parameters corresponding to the size of 4×8, 8×4, or 8×8 and the MIP mode number of 3, 8, 12, or 17, it can further perform an update process on the corresponding initial weight matrix and initial bias matrix to obtain corrected weight matrix and corrected bias matrix, in order to prevent the codec performance from being degraded.
[0078] It should be noted that in the present embodiment, when the size is 4x8, 8x4, or 8x8 and the MIP mode number is 3, 8, 12, or 17, the encoder can update the corresponding initial weight matrix and initial bias matrix through several different methods when obtaining the corrected weight matrix and corrected bias matrix according to the preset calculation rule. For example, when the size is 4x8, 8x4, or 8x8 and the MIP mode number is 3, 8, 12, or 17, the encoder can update any element value A in the initial weight matrix to A / 2 and any element value B in the initial bias matrix to B / 2 according to the calculation rule of rounding down to obtain the corrected weight matrix and the corrected bias matrix. Here, A and B are both integers. Furthermore, the encoder can also update any element value A in the initial weight matrix to A / 2 and any element value B in the initial bias matrix to B / 2 according to the calculation rule of rounding up to obtain the corrected weight matrix and the corrected bias matrix. Furthermore, the encoder can also update any element value A in the initial weight matrix to A / 2 and any element value B in the initial bias matrix to B / 2 according to the rounding calculation rule to obtain a corrected weight matrix and a corrected bias matrix.
[0079] In step 104, a coding process is performed according to the offset parameters, the corrected weight matrix and the corrected bias matrix.
[0080] In an embodiment of the present application, when the encoder performs the coding process according to the MIP mode, the encoder can perform the coding process based on the set offset parameters, the corrected weight matrix, and the corrected bias matrix.
[0081] It should be noted that in this embodiment, after setting the offset parameters, the encoder may further update the corresponding initial weight matrix and initial bias matrix to obtain a corrected weight matrix and a corrected bias matrix to prevent degradation of codec performance, and when performing coding according to the MIP mode, the encoder may perform coding for the current block according to the offset parameters and the corrected weight matrix and the corrected bias matrix, thereby reducing the storage space and overall time required for the coding process and effectively improving codec efficiency while ensuring codec performance.
[0082] It should be noted that in the present embodiment, after the encoder sets the offset parameters, it can directly perform the coding process for the current block according to the offset parameters and the initial weight matrix and the initial bias matrix, that is, after the encoder completes the offset parameter setting, it can also not update the corresponding initial weight matrix and the initial bias matrix.
[0083] In the prior art, when predicting luminance values for a current block through MIP mode, the number of right-shift bits needs to be non-uniform, that is, the offset parameter sW needs to be different. The image coding method proposed in this application sets the offset parameter to a uniform value, making the implementation of MIP mode simpler and more uniform. Furthermore, because the offset parameter sW in the prior art is different, it is necessary to store an sW table representing the number of right-shift bits. In the calculation process, the sW corresponding to the current block is queried and called to determine the number of bits the predicted value calculated through MIP needs to be right-shifted. In the image coding method proposed in this application, the offset parameter is set to a uniform value, so there is no need to store an sW table representing the number of right-shift bits, which saves storage space and omits the processing process of queried and called sW.
[0084] Furthermore, in this embodiment, after the encoder sets the offset parameters, it also updates the corresponding initial weight matrix and initial bias matrix to ensure no obvious loss in codec performance. Specifically, according to the common VVC test standard, the BD-rates for Y, U, and V are 0.00%, -0.02%, and -0.02%, respectively, where the result of 24-frame interval is expected to be the same as the codec performance of 8-frame interval.
[0085] In the image coding method proposed in this embodiment, before performing coding according to the MIP mode, the encoder performs correction to unify initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the number of right shift bits of the predicted value, and when performing coding according to the MIP mode, the encoder performs coding according to the offset parameter. As can be seen, the image coding method proposed by this embodiment uses the offset parameter to perform correction to unify the number of right shift bits of the predicted value, so that all luminance blocks of different sizes and different MIP mode numbers have the same sW value, and there is no need to query and call the sW value when performing coding, which reduces the complexity of the MIP algorithm and ensures codec performance, while reducing the storage space and overall time required for the coding process and effectively improving codec efficiency.
[0086] Based on the above embodiment, in another embodiment of the present application, when the size is 4x8, 8x4, or 8x8, and the MIP mode number is 3, 8, 12, or 17, a method for an encoder to obtain a corrected weight matrix and a corrected bias matrix according to a preset calculation rule may include the following steps:
[0087] In step 103a, according to the calculation rule of truncation, all element values in the initial weight matrix are corrected to values of the same binary order as other weight matrix element values to obtain a corrected weight matrix.
[0088] In step 103b, according to the calculation rule of truncation, all elements in the initial bias matrix are corrected to the same binary order values as other bias matrix element values to obtain a corrected bias matrix.
[0089] In an embodiment of the present application, if the size is 4x8, 8x4, or 8x8, and the MIP mode number is 3, 8, 12, or 17, the encoder can correct all element values in the initial weight matrix to values of the same binary order as other weight matrix element values according to the calculation rule of truncation, and at the same time, correct all elements in the initial bias matrix to values of the same binary order as other bias matrix element values, thereby obtaining a corrected weight matrix and a corrected bias matrix.
[0090] Based on Table 9 above, Table 16 is the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. As shown in Table 16, the encoder updates each element value A in Table 9 to A / 2 according to the truncation calculation rule to obtain the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. [Table 16]
[0091] Based on Table 10 above, Table 17 is the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. As shown in Table 17, the encoder corrects each element value B in Table 10 to B / 2 according to the truncation calculation rule to obtain the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. [Table 17]
[0092] Based on Table 11 above, Table 18 is the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. As shown in Table 18, the encoder updates each element value A in Table 11 to A / 2 according to the rounding down calculation rule to obtain the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. [Table 18]
[0093] Based on Table 12 above, Table 19 is the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. As shown in Table 22, the encoder corrects each element value B in Table 12 to B / 2 according to the truncation calculation rule to obtain the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. [Table 19]
[0094] In the embodiment of the present application, furthermore, if the size is 4x8, 8x4, or 8x8, and the MIP mode number is 3, 8, 12, or 17, the method by which the encoder obtains the corrected weight matrix and the corrected bias matrix according to the preset calculation rule may include the following steps:
[0095] In step 103c, all element values in the initial weight matrix are corrected to the same binary order as the other weight matrix element values according to the round-up calculation rule to obtain a corrected weight matrix.
[0096] In step 103d, all elements in the initial bias matrix are corrected to the same binary order values as other bias matrix element values according to the round-up calculation rule to obtain a corrected bias matrix.
[0097] In an embodiment of the present application, if the size is 4x8, 8x4, or 8x8, and the MIP mode number is 3, 8, 12, or 17, the encoder can correct all element values in the initial weight matrix to values with the same binary order as other weight matrix element values according to the round-up calculation rule, and at the same time, correct all elements in the initial bias matrix to values with the same binary order as other bias matrix element values, thereby obtaining a corrected weight matrix and a corrected bias matrix.
[0098] Based on Table 9 above, Table 20 is the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. As shown in Table 20, the encoder updates each element value A in Table 9 to A / 2 according to the round-up calculation rule to obtain the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. [Table 20]
[0099] Based on Table 10 above, Table 21 is the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. As shown in Table 21, the encoder corrects each element value B in Table 10 to B / 2 according to the round-up calculation rule to obtain the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. [Table 21]
[0100] Based on Table 11 above, Table 22 is the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. As shown in Table 22, the encoder updates each element value A in Table 11 to A / 2 according to the round-up calculation rule to obtain the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. [Table 22]
[0101] Based on Table 12 above, Table 23 is the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. As shown in Table 23, the encoder corrects each element value B in Table 12 to B / 2 according to the round-up calculation rule to obtain the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. [Table 23]
[0102] In the embodiment of the present application, furthermore, if the size is 4x8, 8x4, or 8x8, and the MIP mode number is 3, 8, 12, or 17, the method by which the encoder obtains the corrected weight matrix and the corrected bias matrix according to the preset calculation rule may include the following steps:
[0103] In step 103e, according to the calculation rule of rounding off, all element values in the initial weight matrix are corrected to values of the same binary order as other weight matrix element values to obtain a corrected weight matrix.
[0104] In step 103f, all elements in the initial bias matrix are corrected to the same binary order values as other bias matrix element values according to the rounding calculation rule to obtain a corrected bias matrix.
[0105] In an embodiment of the present application, if the size is 4x8, 8x4, or 8x8, and the MIP mode number is 3, 8, 12, or 17, the encoder can correct all element values in the initial weight matrix to values of the same binary order as other weight matrix element values according to the rounding calculation rule, and at the same time, correct all elements in the initial bias matrix to values of the same binary order as other bias matrix element values, thereby obtaining a corrected weight matrix and a corrected bias matrix.
[0106] Based on Table 9 above, Table 24 is the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. As shown in Table 24, the encoder updates each element value A in Table 9 to A / 2 according to the rounding calculation rule to obtain the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. [Table 24]
[0107] Based on Table 10 above, Table 25 is the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. As shown in Table 25, the encoder corrects each element value B in Table 10 to B / 2 according to the rounding calculation rule to obtain the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 3 and 12. [Table 25]
[0108] Based on Table 11 above, Table 26 is the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. As shown in Table 26, the encoder updates each element value A in Table 11 to A / 2 according to the rounding calculation rule to obtain the corrected weight matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. [Table 26]
[0109] Based on Table 12 above, Table 27 is the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. As shown in Table 30, the encoder corrects each element value B in Table 12 to B / 2 according to the rounding calculation rule to obtain the corrected bias matrix when MipSizeId is 1 and the MIP mode numbers are 8 and 17. [Table 27]
[0110] In the image coding method proposed in this embodiment, before performing coding according to the MIP mode, the encoder performs correction to unify initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the number of right shift bits of the predicted value, and when performing coding according to the MIP mode, the encoder performs coding according to the offset parameter. As can be seen, the image coding method proposed by this embodiment uses the offset parameter to perform correction to unify the number of right shift bits of the predicted value, so that all luminance blocks of different sizes and different MIP mode numbers have the same sW value, and there is no need to query and call the sW value when performing coding, which reduces the complexity of the MIP algorithm and ensures codec performance, while reducing the storage space and overall time required for the coding process and effectively improving codec efficiency.
[0111] In another embodiment of the present application, Figure 9 is an exemplary implementation flowchart 1 of the image decoding method proposed by the embodiment of the present application. As shown in Figure 9, in the embodiment of the present application, the method by which the decoder performs image decoding may include the following steps:
[0112] In step 201, before performing the decoding process according to the MIP mode, a correction is performed to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the number of right shift bits of the predicted value.
[0113] In the embodiment of the present application, before performing the decoding process according to the MIP mode, the decoder can first set an offset parameter used to indicate the number of offset bits.
[0114] It should be noted that in the embodiment of the present application, based on the above equation (2), the offset parameter is sW in equation (2), that is, the offset parameter is the right shift amount of the overall predicted value, that is, when performing luma prediction on the current block, the offset parameter is used to indicate the number of right shift bits of the overall predicted value of the current block.
[0115] Furthermore, in an embodiment of the present application, the decoder can set the offset parameter to a fixed positive integer before performing the decoding process according to the MIP mode, that is, after the decoder sets the offset parameter, the offset parameter to be used for any current block is determined regardless of the size of the current block and the MIP mode number corresponding to the current block.
[0116] It should be noted that in the present embodiment, when the decoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, the decoder can set the offset parameter to any positive integer. Specifically, the decoder can preferably set the offset parameter sW to 6, or preferably set the offset parameter sW to 7, or preferably set the offset parameter sW to 8, or preferably set the offset parameter sW to 9.
[0117] In the prior art, the offset parameter sW corresponding to different current blocks may be different, specifically, only when MipSizeId is equal to 1, that is, when the current block is a second-type luminance block, the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the value of sW is different from the values of sW for all the remaining MIP mode numbers. Therefore, when decoding the current block, the decoder needs to query and call the offset parameter sW according to the size and MIP mode number of the current block, which increases the overall time and reduces the efficiency of the codec, and also increases the storage space because it needs to store a grammar description table for sW. Compared with the prior art, the present application can first set the offset parameter sW before performing the decoding process according to the MIP mode, and the offset parameters sW corresponding to all luminance blocks of different sizes and different MIP mode numbers are all set to the same value. When decoding the current block, there is no need to query and call the offset parameter sW according to the size and MIP mode number of the current block, and the decoder also does not need to store a grammar description table for sW, which further reduces the storage space and overall time required for the coding process and effectively improves the efficiency of the codec.
[0118] In this embodiment, when the decoder sets the offset parameter sW, it sets all offset parameters sW corresponding to different sizes and different MIP mode numbers to the same value. However, only when MipSizeId is equal to 1, i.e., when the current block is a second-type luminance block, the size is 4×8, 8×4, 8×8, and the MIP mode number is 3, 8, 12, or 17, the value of sW is different from the values of sW for all the remaining MIP mode numbers. Therefore, it should be noted that when the decoder uniformly corrects sW for the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, it sets the offset parameter sW corresponding to the size of 4×8, 8×4, 8×8, and the MIP mode number is 3, 8, 12, or 17.
[0119] As can be seen from this, in the embodiment of the present application, the decoder performs a correction process to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, that is, if the initial right shift parameter is different from the offset parameter, the decoder corrects the initial right shift parameter to the offset parameter so that the number of right shift bits of all predicted values corresponding to all sizes and all MIP mode numbers are all the same.
[0120] In step 202, if the decoding process is performed according to the MIP mode, the decoding process is performed according to the offset parameter.
[0121] In an embodiment of the present application, the decoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, and then when the decoder performs the decoding process according to the MIP mode, it can perform the decoding process based on the set offset parameter.
[0122] It should be noted that in the embodiment of the present application, when the decoder performs the decoding process according to the MIP mode after setting the offset parameter, it can directly perform the decoding process on the current block according to the offset parameter, which can reduce the storage space and overall time required for the coding process while ensuring the codec performance, and effectively improve the codec efficiency.
[0123] In addition, in an embodiment of the present application, FIG. 10 is an exemplary implementation flowchart 2 of the image decoding method proposed by an embodiment of the present application. As shown in FIG. 10, after the decoder performs correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, i.e., after step 201, the method in which the decoder performs image decoding may further include the following steps:
[0124] In step 203, the initial weight matrix and the initial bias matrix are corrected according to a preset calculation rule to obtain a corrected weight matrix and a corrected bias matrix, where the initial weight matrix and the initial bias matrix correspond to the initial right shift parameters that have been corrected to be unified.
[0125] In an embodiment of the present application, the decoder can perform a correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, and then correct the initial weight matrix and the initial bias matrix according to a preset calculation rule, thereby obtaining a corrected weight matrix and a corrected bias matrix.
[0126] It should be noted that in the present implementation, the initial weight matrix and the initial bias matrix correspond to the initial right shift parameters that have undergone the unifying correction.
[0127] It should be noted that in the present embodiment, the preset calculation rule can be used to update the corresponding initial weight matrix and initial bias matrix when the size is 4x8, 8x4, or 8x8 and the MIP mode number is 3, 8, 12, or 17.
[0128] Furthermore, in the embodiment of the present application, after the decoder sets the offset parameters, i.e., after correcting the offset parameters corresponding to the size of 4×8, 8×4, or 8×8 and the MIP mode number of 3, 8, 12, or 17, in order to prevent the degradation of the codec performance, the decoder can further perform an update process on the corresponding initial weight matrix and initial bias matrix, thereby obtaining corrected weight matrix and corrected bias matrix.
[0129] It should be noted that in the present embodiment, when the size is 4x8, 8x4, or 8x8 and the MIP mode number is 3, 8, 12, or 17, the decoder can update the corresponding initial weight matrix and initial bias matrix through multiple different methods when obtaining the corrected weight matrix and corrected bias matrix according to the preset calculation rule. For example, when the size is 4x8, 8x4, or 8x8 and the MIP mode number is 3, 8, 12, or 17, the decoder can update any element value A in the initial weight matrix to A / 2 and any element value B in the initial bias matrix to B / 2 according to the calculation rule of rounding down to obtain the corrected weight matrix and the corrected bias matrix. Here, A and B are both integers. Furthermore, the decoder can also update any element value A in the initial weight matrix to A / 2 and any element value B in the initial bias matrix to B / 2 according to the calculation rule of rounding up to obtain the corrected weight matrix and the corrected bias matrix. Furthermore, the decoder can also update any element value A in the initial weight matrix to A / 2 and any element value B in the initial bias matrix to B / 2 according to the rounding calculation rule to obtain a corrected weight matrix and a corrected bias matrix.
[0130] In step 204, a decoding process is performed according to the offset parameters, the corrected weight matrix and the corrected bias matrix.
[0131] In an embodiment of the present application, when the decoder performs the decoding process according to the MIP mode, the decoding process can be performed based on the set offset parameters, the corrected weight matrix, and the corrected bias matrix.
[0132] It should be noted that in this embodiment, after setting the offset parameters, the decoder can further update the corresponding initial weight matrix and initial bias matrix to obtain a corrected weight matrix and a corrected bias matrix to prevent the degradation of codec performance, and when performing decoding according to the MIP mode, the decoder can perform decoding on the current block according to the offset parameters and the corrected weight matrix and the corrected bias matrix, thereby reducing the storage space and overall time required for the coding process and effectively improving the efficiency of the codec while ensuring the codec performance.
[0133] It should be noted that in the embodiment of the present application, after the decoder sets the offset parameters, it can also directly perform the decoding process for the current block according to the offset parameters and the initial weight matrix and the initial bias matrix, that is, after the decoder completes the setting of the offset parameters, it can also not update the corresponding initial weight matrix and the initial bias matrix.
[0134] In the prior art, when predicting luminance values for a current block through MIP mode, the number of right-shift bits needs to be non-uniform, that is, the offset parameter sW needs to be different. The image decoding method proposed in this application sets the offset parameter to a uniform value, making the implementation of MIP mode simpler and more uniform. Furthermore, because the offset parameter sW in the prior art is different, it is necessary to store an sW table representing the number of right-shift bits. In the calculation process, the sW corresponding to the current block is queried and called to determine the number of bits the predicted value calculated through MIP needs to be right-shifted. In the image decoding method proposed in this application, the offset parameter is set to a uniform value, so there is no need to store an sW table representing the number of right-shift bits, which saves storage space and omits the processing process of queried and called sW.
[0135] In the image decoding method proposed in this embodiment, before performing decoding according to the MIP mode, the decoder performs correction to unify initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the number of right shift bits of the predicted value, and when performing decoding according to the MIP mode, the decoder performs decoding according to the offset parameter. As can be seen, the image coding method proposed by this application uses the offset parameter to perform correction to unify the number of right shift bits of the predicted value, so that all luminance blocks of different sizes and different MIP mode numbers have the same sW value, and there is no need to query and call the sW value when performing coding, which reduces the complexity of the MIP algorithm and ensures codec performance, while reducing the storage space and overall time required for the coding process and effectively improving codec efficiency.
[0136] According to the above embodiment, in another embodiment of the present application, FIG. 11 is an exemplary structural diagram 1 of the configuration of the encoder proposed by the embodiment of the present application. As shown in FIG. 11, the encoder 300 proposed by the embodiment of the present application may include a first correction part 301 and a coding part 302.
[0137] The first correction part 301 is configured to perform correction to unify initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing coding processing according to the MIP mode, where the offset parameter is used to indicate the number of right shift bits of the predicted value.
[0138] The coding part 302 is configured to perform the coding process according to the offset parameter when performing the coding process according to the MIP mode.
[0139] Specifically, the first correction part 301 is configured to correct the initial right shift parameter to the offset parameter if the initial right shift parameter is different from the offset parameter, so that the number of right shift bits of all predicted values corresponding to all sizes and all MIP mode numbers is the same.
[0140] FIG. 12 is an exemplary structural diagram 2 of the configuration of the encoder proposed by the present embodiment. As shown in FIG. 12, the encoder 300 proposed by the present embodiment further includes a first processor 303, a first memory 304 that stores executable instructions for the first processor 303, a first communication interface 305, and a first bus 306 that is used to connect the first processor 303, the first memory 304, and the first communication interface 305.
[0141] Furthermore, in an embodiment of the present application, the first processor 303 is used to perform correction to unify initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing the coding process according to the MIP mode, where the offset parameter is used to indicate the number of right shift bits of the predicted value, and when performing the coding process according to the MIP mode, performs the coding process according to the offset parameter.
[0142] Furthermore, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated units may be realized in the form of hardware or in the form of software functional modules.
[0143] When an integrated unit is realized in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence or a part that contributes to the prior art, or all or a part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) or a processor to execute all or a part of the steps of the method 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.
[0144] An embodiment of the present application provides an encoder, which, before performing coding according to an MIP mode, performs correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the number of right-shift bits of a predicted value, and when performing coding according to the MIP mode, performs coding according to the offset parameter. As can be seen, the image coding method proposed by the present application uses the offset parameter to perform correction to unify the number of right-shift bits of a predicted value, so that all luminance blocks of different sizes and different MIP mode numbers have the same sW value, and there is no need to query and call the sW value when performing coding, thereby reducing the complexity of the MIP algorithm and ensuring codec performance, while reducing the storage space and overall time required for the coding process and effectively improving codec efficiency.
[0145] FIG. 13 is an exemplary structural diagram 1 of the decoder configuration proposed by the present embodiment. As shown in FIG. 13, the decoder 400 proposed by the present embodiment may include a first correction part 401 and a decoding part 402.
[0146] The second correction part 401 is configured to perform correction to unify initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing a decoding process according to an MIP mode, where the offset parameter is used to indicate the number of right shift bits of a predicted value.
[0147] When performing the decoding process according to the MIP mode, the decoding part 402 is configured to perform the decoding process according to the offset parameter.
[0148] Specifically, the second correction part 401 is configured to correct the initial right shift parameter to the offset parameter if the initial right shift parameter is different from the offset parameter, so that the number of right shift bits of all predicted values corresponding to all sizes and all MIP mode numbers is the same.
[0149] FIG. 14 is an exemplary structural diagram 2 of the decoder configuration proposed by the present embodiment. As shown in FIG. 14, the decoder 400 proposed by the present embodiment may further include a second processor 403, a second memory 404 that stores executable instructions for the second processor 403, a second communication interface 405, and a second bus 406 used to connect the second processor 403, the second memory 404, and the first communication interface 405.
[0150] Furthermore, in an embodiment of the present application, the second processor 403 is used to perform correction to unify initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing the decoding process according to the MIP mode, where the offset parameter is used to indicate the number of right shift bits of the predicted value, and is used to perform the decoding process according to the offset parameter when performing the decoding process according to the MIP mode.
[0151] Furthermore, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated units may be realized in the form of hardware or in the form of software functional modules.
[0152] When an integrated unit is realized in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence or a part that contributes to the prior art, or all or a part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) or a processor to execute all or a part of the steps of the method 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.
[0153] An embodiment of the present application provides an encoder, and the decoder performs a correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing decoding according to an MIP mode, and when performing decoding according to an MIP mode, performs decoding according to the offset parameter. As can be seen, the image coding method proposed by the present application uses the offset parameter to perform correction to unify the number of right-shift bits of the predicted value, so that all luminance blocks of different sizes and different MIP mode numbers have the same sW value, and there is no need to query and call the sW value when performing coding, which reduces the complexity of the MIP algorithm and ensures codec performance, while reducing the storage space and overall time required for the coding process and effectively improving codec efficiency.
[0154] The present embodiment provides a computer-readable storage medium and a computer-readable storage medium on which a program is stored, the program implementing the method described in the above embodiment when executed by a processor.
[0155] Specifically, the program instructions corresponding to the image coding method in this embodiment can be stored in a storage medium such as an optical disk, a hard disk, a U disk, etc. When the program instructions corresponding to one image coding method in the storage medium are read or executed by an electronic device, Before performing the coding process according to the MIP mode, perform correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the right shift bit number of the predicted value; and When performing the coding process according to the MIP mode, performing the coding process according to the offset parameter.
[0156] Specifically, the program instructions corresponding to the image decoding method in this embodiment can be stored in a storage medium such as an optical disk, a hard disk, a U disk, etc. When the program instructions corresponding to one image decoding method in the storage medium are read or executed by an electronic device, Before performing the decoding process according to the MIP mode, perform a correction to unify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter, where the offset parameter is used to indicate the right shift bit number of the predicted value; and When the decoding process is performed according to the MIP mode, the decoding process is performed according to the offset parameter.
[0157] Those skilled in the art will appreciate that embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment that combines software and hardware. Furthermore, the present application may take the form of a computer program product embodied in one or more computer-usable storage media (including, but not limited to, disk memory, optical memory, etc.) that contain computer-usable program code.
[0158] The present application will be described with reference to exemplary implementation flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the exemplary implementation flowcharts and / or block diagrams, and combinations of processes and / or blocks in the exemplary implementation flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine that, when executed by the processor of the computer or other programmable data processing device, generates an apparatus for performing the function(s) specified in one or more processes in the exemplary implementation flowcharts and / or one or more blocks in the block diagrams.
[0159] These computer program instructions may be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory can cause an article of manufacture comprising an instruction apparatus that embodies the functions specified in one or more processes of the exemplary implementation flowcharts and / or one or more blocks of the block diagrams.
[0160] These computer program instructions may be loaded into a computer or other programmable data processing apparatus and cause the computer or other programmable apparatus to perform a series of operational steps to generate a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one or more processes of the exemplary implementation flowcharts and / or one or more blocks of the block diagrams.
[0161] The above are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. [Industrial Applicability]
[0162] The present embodiments provide an image codec method, an encoder, a decoder, and a storage medium, in which the encoder performs a correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter before performing a coding process according to an MIP mode, where the offset parameter is used to indicate the number of right-shift bits of a predicted value, and when performing the coding process according to the MIP mode, the encoder performs the coding process according to the offset parameter. The decoder performs a correction to unify initial right-shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter before performing a decoding process according to the MIP mode, and when performing the decoding process according to the offset parameter. As can be seen from this, the image coding method proposed by the present application uses an offset parameter to perform correction to standardize the number of right-shift bits of the predicted value, so that all luminance blocks of different sizes and different MIP mode numbers have the same sW value. This eliminates the need to query and call the sW value when performing coding, thereby reducing the complexity of the MIP algorithm and ensuring codec performance, while reducing the storage space and overall time required for the coding process and effectively improving codec efficiency.
Claims
1. 1. A bitstream storage method comprising: generating a bitstream by determining a mode parameter of a current block, and if the mode parameter indicates that a prediction value of the current block is determined by a matrix-based intra prediction (MIP) mode, predicting the current block by MIP based on an offset parameter, wherein the offset parameter indicates a uniform number of right shift bits to calculate for prediction values in all block sizes and all MIP modes; storing said bitstream storage; Bitstream storage method.
2. the offset parameter is a fixed positive integer; 2. The bitstream storage method of claim 1.
3. the offset parameter is equal to 6; 3. The bitstream storage method of claim 2.
4. predicting the current block by MIP based on the offset parameter, predicting the current block based on the offset parameters and a weight matrix; 2. The bitstream storage method of claim 1.
5. writing mode parameters of the current block to the bitstream.
2. The bitstream storage method of claim 1.
6. 1. A method for reading a bitstream, comprising: Reading the bitstream; determining a mode parameter of a current block; and, if the mode parameter indicates that a prediction value of the current block is to be determined by a matrix-based intra prediction (MIP) mode, predicting the current block by MIP based on an offset parameter, wherein the offset parameter indicates a uniform number of right shift bits to calculate for prediction values for all block sizes and all MIP modes; Bitstream reading method.
7. the offset parameter is a fixed positive integer; 7. The bitstream reading method according to claim 6.
8. the offset parameter is equal to 6; 8. The bitstream reading method according to claim 7.
9. predicting the current block by MIP based on an offset parameter, predicting the current block based on the offset parameters and a weight matrix; 7. The bitstream reading method according to claim 6.
10. further comprising parsing the bitstream to determine mode parameters of the current block.
7. The bitstream reading method according to claim 6.
11. 1. A computer-readable storage medium, comprising: A computer program or instruction and a bitstream are stored, and the computer program or the instruction is transmitted to a processor. determining mode parameters of the current block; If the mode parameter indicates that a prediction value of the current block is determined by a matrix-based intra prediction (MIP) mode, predicting the current block by MIP based on an offset parameter, the offset parameter indicating a uniform number of right shift bits to be calculated for prediction values in all block sizes and all MIP modes; to generate the bitstream; A computer-readable storage medium.
Citation Information
Patent Citations
Image codec method, image decode method, and decoder
JP2026009299A
Image codec method, image decode method, and decoder
JP2026009301A
Image processing device, image processing method, and program
JP7513027B2
Image processing device, and image processing method
WO2020255769A1
Cited By
Image codec method, image decode method, and decoder
JP2026009299A
Image codec method, image decode method, and decoder
JP2026009301A