Image coding method, encoder, decoder, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2019-06-25
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]然而,在通过MIP模式进行亮度预测时,尺寸不同的亮度块所采用的参数也有可能不同,因此,需要占用较大的存储空间对大量参数进行存储,且预测过程中对参数的查找和调用也增加了整体时间,从而降低了编解码效率
[0022]本申请实施例提供了一种图像编解码方法、编码器、解码器以及存储介质,编码器在按照MIP模式进行编码处理之前,按照偏移参数对不同尺寸和不同MIP模式编号所对应的初始右移参数进行统一化修改;其中,偏移参数用于对预测值的右移位数进行指示;以及,在按照MIP模式进行编码处理时,根据偏移参数进行编码处理。解码器在按照MIP模式进行解码处理之前,按照偏移参数对不同尺寸和不同MIP模式编号所对应的初始右移参数进行统一化修改;以及,在按照MIP模式进行解码处理时,根据偏移参数进行解码处理。由此可见,本申请提出的图像编解码方法,通过利用偏移参数对预测值的右移位数进行统一化修改,使不同尺寸、不同MIP模式编号的全部亮度块具有相同的sW值,从而在进行编解码处理时,不需要对sW值进行查询和调用,可以降低MIP算法的复杂度,能够在保证编解码性能的基础上,减小编解码过程中所需要的存储空间和整体时间,有效地提高编解码效率。
Smart Images

Figure CN120034648B_ABST
Abstract
Description
[0001] This application is a divisional application of Chinese patent application No. 201980048358.2, entitled "Image Encoding and Decoding Method, Encoder, Decoder and Storage Medium", which entered the Chinese national phase of PCT international patent application PCT / CN2019 / 092689, filed on June 25, 2019. Technical Field
[0002] This application relates to the field of video encoding and decoding technology, and in particular to an image encoding and decoding method, encoder, decoder, and storage medium. Background Technology
[0003] In the reference software testbed for Versatile Video Coding (VVC), a novel intra-frame coding technique, Matrix-based Intra Prediction (MIP), was proposed. MIP is a neural network-based intra-frame prediction technique that uses a multi-layer neural network to predict the luminance value of the current block based on adjacent reconstructed luminance blocks. Specifically, similar to traditional intra-frame modes, when using MIP for intra-frame prediction, the input is the data from the previous row and left column of the adjacent luminance blocks, and the output is the predicted luminance component value of the current block. The prediction process consists of three steps: downsampling, matrix-vector multiplication, and interpolation.
[0004] However, when performing brightness prediction using MIP mode, the parameters used for brightness blocks of different sizes may also be different. Therefore, a large amount of storage space is required to store a large number of parameters, and the lookup and retrieval of parameters during the prediction process also increases the overall time, thereby reducing the encoding and decoding efficiency. Summary of the Invention
[0005] This application provides an image encoding / decoding method, encoder, decoder, and storage medium, which can reduce the storage space and overall time required in the encoding / decoding process while ensuring encoding / decoding performance, thereby effectively improving encoding / decoding efficiency.
[0006] The technical solution of this application embodiment is implemented as follows:
[0007] This application provides an image encoding method applied to an encoder, the method comprising:
[0008] Before encoding according to the MIP pattern, the initial right shift parameters corresponding to different sizes and different MIP pattern numbers are uniformly modified according to the offset parameter; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value; and,
[0009] When performing encoding processing according to the MIP mode, the encoding processing is performed based on the offset parameter.
[0010] This application provides an image decoding method applied to a decoder, the method comprising:
[0011] Before decoding according to the MIP mode, the initial right shift parameters corresponding to different sizes and different MIP mode numbers are uniformly modified according to the offset parameter; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value; and,
[0012] When performing decoding according to the MIP mode, the decoding process is performed based on the offset parameter.
[0013] This application provides an encoder, which includes a first modification portion and an encoding portion.
[0014] The first modification is configured to uniformly modify the initial right shift parameters corresponding to different sizes and different MIP pattern numbers according to the offset parameter before encoding processing according to the MIP mode; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value;
[0015] The encoding portion is configured to perform encoding processing based on the offset parameter when encoding processing is performed according to the MIP mode.
[0016] This application provides a decoder, which includes a second modification part and a decoding part.
[0017] The second modification is configured to uniformly modify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter before decoding according to the MIP mode; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value;
[0018] The encoding portion is configured to perform decoding processing based on the offset parameter when performing decoding processing according to the MIP mode.
[0019] This application provides an encoder, which includes a first processor, a first memory storing instructions executable by the first processor, a first communication interface, and a first bus for connecting the first processor, the first memory, and the first communication interface. When the instructions are executed by the first processor, the image encoding method as described above is implemented.
[0020] This application provides a decoder, which includes a second processor, a second memory storing instructions executable by the second processor, a second communication interface, and a second bus for connecting the second processor, the second memory, and the first communication interface. When the instructions are executed by the second processor, the image decoding method as described above is implemented.
[0021] This application provides a computer-readable storage medium storing a program applied in an encoder and a decoder. When the program is executed by a processor, it implements the image encoding and decoding method described above.
[0022] This application provides an image encoding / decoding method, an encoder, a decoder, and a storage medium. Before encoding according to the MIP mode, the encoder uniformly modifies the initial right-shift parameters corresponding to different sizes and MIP mode numbers according to an offset parameter. The offset parameter indicates the number of right-shift bits for the predicted value. During encoding according to the MIP mode, encoding is performed based on the offset parameter. Before decoding according to the MIP mode, the decoder uniformly modifies the initial right-shift parameters corresponding to different sizes and MIP mode numbers according to the offset parameter. During decoding according to the MIP mode, decoding is performed based on the offset parameter. Therefore, the image encoding / decoding method proposed in this application, by uniformly modifying the number of right-shift bits for the predicted value using the offset parameter, ensures that all brightness blocks of different sizes and MIP mode numbers have the same sW value. This eliminates the need to query and retrieve the sW value during encoding / decoding, reducing the complexity of the MIP algorithm. While maintaining encoding / decoding performance, it reduces the storage space and overall time required during decoding, effectively improving encoding / decoding efficiency. Attached Figure Description
[0023] Figure 1 This is a schematic diagram showing the arrangement of the 67 prediction modes in intra-frame prediction.
[0024] Figure 2 A flowchart illustrating the encoding process for MIP mode;
[0025] Figure 3 This is a schematic diagram showing the arrangement of the upper and left adjacent brightness blocks of the current block;
[0026] Figure 4 To determine the layout diagram of the DM pattern;
[0027] Figure 5 This is a schematic diagram of the structure of a video encoding system;
[0028] Figure 6This is a schematic diagram of the video decoding system.
[0029] Figure 7 This is a schematic diagram of the implementation process of an image encoding method proposed in an embodiment of this application. Figure 1 ;
[0030] Figure 8 This is a schematic diagram of the implementation process of an image encoding method proposed in an embodiment of this application. Figure 2 ;
[0031] Figure 9 This is a schematic diagram of the implementation process of an image decoding method proposed in an embodiment of this application. Figure 1 ;
[0032] Figure 10 This is a schematic diagram of the implementation process of an image decoding method proposed in an embodiment of this application. Figure 2 ;
[0033] Figure 11 This is a schematic diagram of the encoder structure proposed in the embodiments of this application. Figure 1 ;
[0034] Figure 12 This is a schematic diagram of the encoder structure proposed in the embodiments of this application. Figure 2 ;
[0035] Figure 13 A schematic diagram of the decoder structure proposed in the embodiments of this application. Figure 1 ;
[0036] Figure 14 A schematic diagram of the decoder structure proposed in the embodiments of this application. Figure 2 . Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely for explaining the relevant application and not for limiting the application. Furthermore, it should be noted that, for ease of description, only the parts relevant to the application are shown in the accompanying drawings.
[0038] In video images, VVC adopted the Affine Linear Weighted IntraPrediction technique proposed by the Joint Video Experts Team (JVET)-N0217 and renamed it Matrix-based IntraPrediction, or MIP. This technique adds different numbers of matrix-based intraprediction modes to the intraluminance prediction process depending on the size of the intraluminance coding block.
[0039] To capture finer edge directions in natural video, VVC expands the 33 intra-frame luminance prediction angle modes defined in the High Efficiency Video Coding (HEVC) standard to 65. Figure 1 This is a schematic diagram showing the arrangement of the 67 prediction modes in intra-frame prediction, as follows: Figure 1 As shown, arrows numbered 2-66 represent 65 intra-frame angular prediction modes. There are also two non-angular modes: the Planar mode (numbered 0) and the DC mode (numbered 1). Therefore, the intra-frame prediction process in VVC includes two non-angular modes and 65 angular modes. Here, these 67 prediction modes are referred to as the traditional intra-frame prediction modes.
[0040] MIP (Monthly In-Frame Prediction) is a neural network-based intra-frame prediction technique that uses a multi-layer neural network to predict the luminance value of the current block based on neighboring reconstructed pixels. Specifically, MIP categorizes luminance coding blocks into three types based on their size. Let the size of the luminance coding block be W×H, where W is the width parameter and H is the height parameter. According to the size of the luminance coding block, it can be divided into three categories:
[0041] A luminance coding block of size 4×4 is classified as a first-class luminance block, luminance coding blocks of sizes 8×4, 4×8 and 8×8 are classified as second-class luminance blocks, and luminance coding blocks of other sizes are classified as third-class luminance blocks.
[0042] For these three types of intra-luminance coded blocks, the MIP technology adds M MIP modes to the 67 traditional intra-prediction modes. Specifically, for the first type of luminance block, M=35; for the second type of luminance block, M=19; and for the third type of luminance block, M=11.
[0043] Specifically, MIP technology is only applied to intra-frame luminance prediction. Similar to traditional modes, the input to MIP prediction is the data from the row above and column to the left of the current block, and the output is the predicted value of the current block. The prediction process consists of three steps: averaging, matrix-vector multiplication, and interpolation. In other words, by performing these three operations on the reconstructed luminance values of the adjacent pixels in the row above and column to the left of the input, the predicted luminance component value of the current block can be obtained.
[0044] Figure 2 A flowchart illustrating the encoding process for MIP mode, as shown below. Figure 2 As shown, the specific implementation of brightness prediction in MIP mode is as follows:
[0045] Step 1: Perform an averaging operation on the upper adjacent reference points of the current block to obtain the vector bdry. topThere are N values in total; the vector bdry is obtained by averaging the left-side adjacent reference points of the current block. left There are N values in total. When the current block uses the first type of luminance coding, N = 2; when the current block uses the second or third type of luminance coding, N = 4. Vector bdry top and vector bdry left Form a new vector bdry red And proceed with subsequent operations;
[0046] Step 2: Obtain the corresponding matrix A using the mode number k of the MIP mode. k and offset b k The following formula (1) is used to calculate the result as follows: Figure 2 The partial predicted values of the current block, indicated by cross lines:
[0047] Pred red =A k ·bdry red +b k (1)
[0048] Step 3: Obtain the remaining predicted values Predred in the current block through linear interpolation.
[0049] It should be noted that the encoding process for the current block requires writing the specific encoding mode used for intra-frame prediction into the compressed bitstream. This allows the decoder to determine which mode is being used—whether it's a traditional mode or a MIP mode—by parsing the mode information. If it's a traditional mode, the specific traditional mode is specified; if it's a MIP mode, the specific MIP mode is specified.
[0050] In VVC's intra-frame prediction, the rate-distortion cost (RDcost) of 67 conventional modes and M MIP modes is compared for each luma coding block. The optimal mode is selected from the 67 conventional modes and M MIP modes and encoded. To save bit overhead, VVC uses intra-frame mode coding based on the Most Probable Modes List (MPM).
[0051] It is important to note that since the multiple reference line (MPL) technique and the intra sub-patterning (ISP) technique are only used for modes in the MPM list, when both extendrefflag and ispflag are 0, that is, when 0 reference lines are used and no sub-patterning is performed, there is no need to encode mpmflag; instead, the position of the optimal mode in the MPM list is directly encoded.
[0052] Furthermore, regarding the construction of the MPM list and MIPMPM list, in VVC luminance intra-frame prediction, if the optimal mode selected for the current block is the traditional mode, then an MPM list containing 6 most likely traditional modes needs to be constructed; if the optimal mode selected for the current block is the MIP mode, then an MIPMPM list containing 3 most likely MIP modes needs to be constructed.
[0053] Figure 3 This is a schematic diagram showing the arrangement of the upper and left adjacent brightness blocks of the current block, as shown below. Figure 3 As shown, both lists above are based on... Figure 3 The optimal mode is derived from the upper adjacent luminance block (A) and the left adjacent luminance block (L) of the current block shown.
[0054] Furthermore, regarding the construction of the MIPMPM list, in VVC intra-frame prediction, if the optimal mode of the current block is MIP mode, then the MIPMPM list needs to be constructed. During the construction of the MIPMPM list, it is first necessary to obtain the MIP mode ABOVE_MIP corresponding to the optimal mode of the upper adjacent luma block and the MIP mode LEFT_MIP corresponding to the optimal mode of the left adjacent luma block.
[0055] Furthermore, after obtaining LEFT_MIP and ABOVE_MIP, a MIPMPM list containing the three most likely MIPMPM modes is constructed as follows: The numbers in MIPMPM are the numbers of the MIP modes, ranging from 0 to (M-1). For the first type of luma block, the numbers are 0-34; for the second type of luma block, the numbers are 0-18; and for the third type of luma block, the numbers are 0-10.
[0056] If LEFT_MIP is available (not -1), add LEFT_MIP to MIPMPMlist;
[0057] If ABOVE_MIP is available (not -1), add ABOVE_MIP to MIPMPMlist after passing the redundancy check;
[0058] If LEFT_MIP is unavailable (-1) and ABOVE_MIP is unavailable (-1), the default list is added to the list after redundancy checks based on the type of the current block until MIPMPMlist is full.
[0059] The default list of the first type of brightness blocks is: {17, 34, 5};
[0060] The default list of the second type of brightness blocks is: {0, 7, 16};
[0061] The default list of the third type of brightness blocks is: {1, 4, 6}.
[0062] Furthermore, it should be added that in the intra-chroma prediction process of VVC, there is a Direct Mode (DM) that utilizes inter-component correlation. This mode uses the intra-prediction mode based on the center position of the corresponding luma coding block to perform intra-prediction of the current chroma block. Figure 4 To determine the layout diagram of the DM pattern, as follows: Figure 4 As shown, since MIP technology is only applied to luma-coded blocks, when Figure 4 When the intra-prediction mode at the CR position is MIP mode, the MIP mode needs to be mapped to traditional mode through the "MIP-Traditional Mapping Table" to perform intra-prediction of the current chroma block.
[0063] In other words, due to the introduction of MIP technology, during the intra-frame prediction process, in constructing the MIPMPM list, it is necessary to map the traditional mode to the MIP mode, and in constructing the MPM list and determining the DM mode, it is necessary to map the MIP mode to the traditional mode.
[0064] Table 1
[0065]
[0066] In addition, the MPM list construction process and DM mode acquisition process require the use of MIP mode to traditional mode mapping. Specifically, the "MIP-Traditional Mapping Table" maps 35 / 19 / 11 MIP modes to 67 traditional modes. For the three types of luma blocks, the three "MIP-Traditional Mapping Tables" are shown in Tables 2, 3 and 4.
[0067] Table 2
[0068]
[0069]
[0070] Table 3
[0071] Traditional model 0 1 0 1 0 22 18 18 1 0 1 0 1 0 44 0 50 1 0
[0072] Table 4
[0073] Traditional model 1 1 1 1 18 0 1 0 1 50 0
[0074] Figure 5 This is a schematic diagram of the structure of a video encoding system, such as... Figure 5As shown, the video coding system 100 includes a transform and quantization module 101, an intra-frame estimation module 102, an intra-frame prediction module 103, a motion compensation module 104, a motion estimation module 105, an inverse transform and inverse quantization module 106, a filter control and analysis module 107, a deblocking filtering and sample adaptive offset (SAO) filtering module 108, a header information encoding and context-based adaptive binary arithmetic coding (CABAC) encoding module 109, and a decoding image buffer module 110, etc. Figure 6 This is a schematic diagram of the structure of a video decoding system, such as... Figure 6 As shown, the video decoding system 200 includes components such as a header information decoding and CABAC decoding module 201, an inverse transform and inverse quantization module 202, an intra-frame prediction module 203, a motion compensation module 204, a deblocking and SAO filtering module 205, and a decoded image buffer module 206. After the video image is processed by the transform and quantization module 101, the intra-frame estimation module 102, the intra-frame prediction module 103, the motion compensation module 104, the motion estimation module 105, the deblocking and SAO filtering module 108, and the header information encoding and CABAC module 109 in the video encoding system 100, the bitstream of the video image is output. This bitstream is input into the video decoding system 200, and after being processed by the header information decoding and CABAC decoding module 201, the inverse transform and inverse quantization module 202, the intra-frame prediction module 203, and the motion compensation module 204 in the video decoding system 200, the original video image is finally recovered.
[0075] Based on the height and width parameters, the current block can have 25 sizes. Specifically, the standard specifies that the maximum size of the luminance block is 128×128. However, since the maximum size of the transformation unit is 64×64, a luminance block of 128×128 size must first undergo quadtree partitioning. Therefore, the maximum luminance block size is 64×64. Table 5 shows a schematic diagram of the luminance block sizes.
[0076] Table 5
[0077]
[0078]
[0079] In the prior art, the MIP mode is restricted based on the height and width parameters of the current block. Specifically, if the aspect ratio of the current block is greater than 4, or the height-to-width ratio is greater than 4, then the current block is not encoded using the MIP mode. Table 6 shows the restrictions on the luma block size in the prior art under the MIP mode.
[0080] Table 6
[0081] In existing technology, in the first type of luma block in MIP mode (corresponding to a 4×4 luma block), two upper adjacent and two left adjacent luma blocks are used to generate a 4×4 prediction block through matrix operations. In the second type of luma block in MIP mode (corresponding to 4×8, 8×4, and 8×8 luma blocks), four upper adjacent and four left adjacent luma blocks are used to generate a 4×4 prediction block through matrix operations. In the third type of luma block in MIP mode (corresponding to luma blocks of other sizes), four upper adjacent and four left adjacent luma blocks are used to generate a 4×8 prediction block (4×16 luma block), an 8×4 prediction block (16×4 luma block), or an 8×8 prediction block (luma blocks of other sizes) through matrix operations. Since the third type of luma block generates non-square prediction blocks, odd-numbered rows of the matrix need to be extracted during calculation.
[0082] Furthermore, in the syntax, MipSizeId represents the application category of MIP, numModes represents the number of MIP modes, boundarySize represents the number of luminance blocks in the upper reference row or left reference column obtained by downsampling, predW represents the width parameter of the prediction block, predH represents the height parameter of the prediction block, and predC represents the side length of the MIP matrix. Table 7 shows the syntax relationship corresponding to MIP modes in the prior art. As shown in Table 7, MipSizeId, numModes, boundarySize, predW, predH, and predC in the syntax have the following relationships:
[0083] Table 7
[0084] 0 35 2 4 4 4 1 19 4 4 4 4 2 11 4 Min(nTbW,8) Min(nTbH,8) 8
[0085] Furthermore, in the syntax, MipSizeId takes a value of 0 to represent a 4×4 luma block, a value of 1 to represent 4×8, 8×4, or 8×8 luma blocks, and a value of 2 to represent luma blocks of other sizes. numModes indicates the total number of MIP prediction modes: 35 for 4×4 luma blocks, 19 for 4×8, 8×4, or 8×8 luma blocks, and 11 for other sizes. boundarySize indicates whether the adjacent luma blocks in the current block's upper row or left column are ultimately downsampled into 2 or 4 adjacent luma blocks.
[0086] In the prior art, when the encoder performs brightness prediction using the MIP mode, it can be done using the following formula (2):
[0087]
[0088] Here, mWeight and vBias are the weight and bias matrices trained by deep learning for each MIP mode. Specifically, mWeight is the weight matrix for each MIP mode class, and vBias is the bias matrix for each MIP mode class. sB is the left shift of the bias matrix, oW is the rounded-off value, and sW is the right shift of the overall predicted value. The sW value for different MIP modes needs to be obtained by looking up a table.
[0089] Based on JVET-N1001-v7, when generating the prediction matrix of the MIP, the encoder uses variables incW and incH to determine whether to extract the prediction values of odd-numbered rows. Specifically:
[0090] oW = 1 << (sW-1)
[0091] sB = BitDepth Y -1
[0092] mipW=isTransposed? predH:predW
[0093] mipH=isTransposed? predW:predH
[0094] incW = (predC > mipW)? 2:1
[0095] incH = (predC > mipH)? 2:1
[0096] Here, incW=2 or incH=2 means that extraction needs to be performed on the width or height parameter.
[0097] Table 8 provides a syntax description of the sW (Simplified Written) mode in the prior art. As shown in Table 8, the sW value is 9 if and only if MipSizeId equals 1 (i.e., the current block size is 4×8, 8×4, or 8×8) and the MIP mode number is 3, 8, 12, or 17. The sW value is 8 for all other MIP modes. Since the sW values in the MIP modes are mapped, the sW values for all modes can be obtained from Table 8.
[0098] Table 8
[0099]
[0100] Table 9 shows the mWeight matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0101] Table 9
[0102] 448 94 -45 6 23 -15 2 -3 -1 476 77 -34 -5 -2 1 -3 1 -16 466 61 5 -4 1 -3 -38 2 -3 0 260 358 -77 8 122 -39 1 -1 463 -25 -11 -2 405 54 -41 5 121 -33 2 -6 107 402 16 -12 3 -4 1 -6 5 -1 -1 0 -62 267 375 -73 -25 3 -4 -1 108 466 -28 -11 58 -25 -3 -1 418 96 -35 -3 301 18 -15 5 229 -21 -4 -7 -1 -3 -2 -2 24 -95 291 297 3 1 -5 -2 -30 103 464 -29 -16 0 -6 0 41 429 70 -13 27 -5 -2 1 303 193 -13 -1
[0103] Table 10 shows the vBias matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0104] Table 10
[0105] 1 2 3 1 1 3 3 3 2 4 4 4 3 5 5 5
[0106] Table 11 shows the mWeight matrix when MipSizeId is 1 and MIP mode numbers are 8 and 17. Table 12 shows the vBias matrix when MipSizeId is 1 and MIP mode numbers are 8 and 17.
[0107] Table 11
[0108] -26 -22 14 13 88 306 114 35 -16 18 -16 5 31 327 135 39 -11 11 30 -19 3 325 142 41 12 -4 1 1 -14 273 227 26 3 10 -3 -5 6 231 249 34 1 8 5 -9 10 214 262 37 -1 11 4 -7 15 208 259 40 5 0 4 -4 6 92 340 78 4 6 1 -5 6 113 329 75 2 13 2 -8 6 123 319 75 1 13 6 -10 9 136 303 74 6 1 4 -5 8 38 217 252 4 10 1 -7 9 58 313 141 3 12 4 -8 11 70 327 114 2 14 4 -7 14 82 314 110
[0109] Table 12
[0110] -7 -10 -11 -11 -10 -14 -17 -18 -11 -15 -19 -21 -10 -17 -21 -22
[0111] Due to the different syntax descriptions of sW under different MIP modes as shown in Table 8, when the encoder performs luminance prediction using MIP modes, if the MipSizeId of the current block is 1, meaning the current block is a second-type luminance block (a luminance block of size 4×8, 8×4, or 8×8), and the MIP mode number corresponding to the current encoded block is 3, 8, 12, or 17, the value of sW will differ from other modes. This causes inconsistencies in the algorithm, and the process of looking up Table 8 increases the time complexity of the algorithm. Furthermore, storing Table 8 also requires storage space. In other words, when performing luminance prediction using MIP modes, the parameters used for luminance blocks of different sizes may also differ. Therefore, a large amount of storage space is needed to store a large number of parameters, and the lookup and retrieval of parameters during the prediction process also increases the overall time, thereby reducing encoding and decoding efficiency.
[0112] To address the aforementioned issues, this application proposes an image encoding method that modifies the sW value of the second type of luminance block in MIP mode numbers 3, 8, 12, and 17, ensuring that the sW value is identical across all MIP mode numbers. This reduces storage space and lowers overall time by omitting table lookup operations.
[0113] Furthermore, the image coding method proposed in this application can affect the intra-frame prediction part in the video coding hybrid framework, that is, it is mainly applied to the intra-frame prediction module 103 in video coding and the intra-frame prediction module 203 in video decoding, and has a simultaneous effect on the encoding end and the decoding end.
[0114] It should be noted that, in the embodiments of this application, based on the computational parameters trained by the machine learning method, the image encoding and decoding method proposed in this application can uniformly modify the sW according to a fixed offset parameter, while simultaneously modifying the corresponding weight matrix and bias matrix. Specifically, this application is not limited to modifying the value of sW when the second type of brightness block is numbered in MIP mode 3, 8, 12, and 17, but rather uniformly modifies the different values of the computational parameters sW trained by the machine learning method after changes in specific parameters (including different combinations of parameters such as size, mode, and right shift value).
[0115] Furthermore, in the following embodiments, the image encoding and decoding method proposed in this application is illustrated using the value of sW when the second type of luminance block is numbered in MIP mode 3, 8, 12, 17 as an example.
[0116] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0117] In one embodiment of this application, Figure 7 This is a schematic diagram of the implementation process of an image encoding method proposed in an embodiment of this application. Figure 1 ,like Figure 7 As shown in the embodiments of this application, the method of image encoding by the encoder may include the following steps.
[0118] Step 101: Before encoding according to the MIP mode, the initial right shift parameters corresponding to different sizes and different MIP mode numbers are uniformly modified according to the offset parameter; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value.
[0119] In embodiments of this application, the encoder may first set the offset parameter used to indicate the offset bit length before encoding processing according to MIP mode.
[0120] It should be noted that, in the embodiments of this application, based on the above formula (2), the offset parameter is sW in formula (2), that is, the offset parameter is the right shift of the overall prediction value. In other words, when performing brightness prediction on the current block, the offset parameter is used to indicate the number of right shifts of the overall prediction value of the current block.
[0121] Furthermore, in the embodiments of this application, the encoder can set the offset parameter to a fixed positive integer before performing encoding processing according to the MIP mode. That is, after the encoder sets the offset parameter, the offset parameter used is determined for any current block, regardless of the size of the current block or the MIP mode number corresponding to the current block.
[0122] It should be noted that, in the embodiments of this application, when the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, the offset parameter can be set 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 even more preferably set the offset parameter sW to 9.
[0123] For example, Table 13 is a syntax description of sW in this application. In the embodiments of this application, when the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, for a luma block with a size of 4×8, 8×4 or 8×8 and a MIP mode number of 3, 8, 12 or 17, its corresponding sW can be set to the same value as the sW corresponding to other luma blocks. That is, when the sW corresponding to other luma blocks is 8, the sW corresponding to the luma block with a size of 4×8, 8×4 or 8×8 and a MIP mode number of 3, 8, 12 or 17 is set to 8, so that different current blocks can have the same offset parameter sW.
[0124] Table 13
[0125]
[0126] For example, Table 14 is the second syntax description of sW in this application. In the embodiments of this application, when the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameters, for a luma block with a size of 4×8, 8×4 or 8×8 and a MIP mode number of 3, 8, 12 or 17, its corresponding sW can be set to the same value as the sW corresponding to other luma blocks. That is, when the sW corresponding to other luma blocks is 7, the sW corresponding to the luma block with a size of 4×8, 8×4 or 8×8 and a MIP mode number of 3, 8, 12 or 17 is set to 7, so that different current blocks can have the same offset parameter sW.
[0127] Table 14
[0128]
[0129] For example, Table 15 is the second syntax description of sW in this application. In the embodiments of this application, when the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, for a luma block with a size of 4×8, 8×4 or 8×8 and a MIP mode number of 3, 8, 12 or 17, its corresponding sW can be set to the same value as the sW corresponding to other luma blocks. That is, when the sW corresponding to other luma blocks is 8, the sW corresponding to the luma block with a size of 4×8, 8×4 or 8×8 and a MIP mode number of 3, 8, 12 or 17 is set to 8, so that different current blocks can have the same offset parameter sW.
[0130] Table 15
[0131]
[0132] As shown in Table 8 above, in the prior art, the offset parameter sW may be different for different current blocks. Specifically, the value of sW is different from the values of sW under all other MIP mode numbers if and only if MipSizeId equals 1, that is, the current block is a second type luma block with a size of 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17. Therefore, when the encoder encodes the current block, it needs to query and call the offset parameter sW according to the size of the current block and the MIP mode number, which increases the overall time and reduces the encoding and decoding efficiency. At the same time, the storage space is also increased because the syntax description table of sW needs to be stored. Compared with the prior art, this application can set the offset parameter sW before encoding according to the MIP mode. The offset parameter sW corresponding to all luma blocks of different sizes and MIP mode numbers is set to the same value. Therefore, when encoding the current block, it is no longer necessary to query and call the offset parameter sW according to the size and MIP mode number of the current block. The encoder also does not need to store the syntax description table of sW, thereby reducing the storage space and overall time required in the decoding process and effectively improving the encoding and decoding efficiency.
[0133] It should be noted that, in the embodiments of this application, although the encoder sets the offset parameter sW to the same value for all offset parameters sW corresponding to different sizes and different MIP mode numbers, the value of sW is different from the value of sW for all other MIP mode numbers when MipSizeId is equal to 1, that is, the current block is a second type of luminance block with a size of 4×8, 8×4, 8×8 and MIP mode number 3, 8, 12, 17. Therefore, when the encoder uniformly modifies the initial right shift parameter sW 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 MIP mode number 3, 8, 12, 17.
[0134] Therefore, in the embodiments of this application, the process of uniformly modifying the initial right shift parameter corresponding to different sizes and different MIP mode numbers according to the offset parameter is that when the initial right shift parameter and the offset parameter are different, the initial right shift parameter is modified to the offset parameter so that the right shift number of all predicted values corresponding to all sizes and all MIP mode numbers is the same.
[0135] Step 102: When performing encoding processing according to MIP mode, the encoding processing is performed according to the offset parameter.
[0136] In the embodiments of this application, after the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameters, when the encoder performs encoding processing according to the MIP mode, it can perform encoding processing based on the set offset parameters.
[0137] It should be noted that, in the embodiments of this application, after the encoder sets the offset parameter, it can directly encode the current block according to the offset parameter when performing encoding processing in MIP mode. This reduces the storage space and overall time required during the encoding and decoding process while ensuring encoding and decoding performance, effectively improving encoding and decoding efficiency.
[0138] In the embodiments of this application, further, Figure 8 This is a schematic diagram of the implementation process of an image encoding method proposed in an embodiment of this application. Figure 2 ,like Figure 8 As shown, after the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameters, that is, after step 101, the encoder's image encoding method may further include the following steps:
[0139] Step 103: Modify the initial weight matrix and initial bias matrix according to the preset calculation rules to obtain the modified weight matrix and modified bias matrix; wherein the initial weight matrix and initial bias matrix correspond to the unified modified initial right shift parameters.
[0140] In the embodiments of this application, after the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameters, it can obtain the modified weight matrix and modified bias matrix according to the preset calculation rules for the initial weight matrix and initial bias matrix.
[0141] It should be noted that, in the implementation of this application, the initial weight matrix and the initial bias matrix correspond to the initial right shift parameters that have been uniformly modified.
[0142] It should be noted that, in the embodiments of this application, the preset calculation rules can be used to update the corresponding initial weight matrix and initial bias matrix when the size is 4×8, 8×4 or 8×8 and the MIP mode number is 3, 8, 12 or 17.
[0143] Furthermore, in the embodiments of this application, after the encoder sets the offset parameters, that is, changes 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 encoding and decoding performance from being reduced, the corresponding initial weight matrix and initial bias matrix can be further updated to obtain the modified weight matrix and modified bias matrix.
[0144] It should be noted that, in the embodiments of this application, when the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the encoder can update the corresponding initial weight matrix and initial bias matrix using various different methods when obtaining the modified weight matrix and modified bias matrix according to the preset calculation rules. For example, when the size is 4×8, 8×4, or 8×8, 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 floor function, thereby obtaining the modified weight matrix and modified 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 floor function, thereby obtaining the modified weight matrix and modified bias matrix. Furthermore, 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 rounding calculation rules, thereby obtaining the modified weight matrix and the modified bias matrix.
[0145] Step 104: Perform encoding processing based on the offset parameters, the modified weight matrix, and the modified bias matrix.
[0146] In the embodiments of this application, when the encoder performs encoding processing according to the MIP mode, the encoding processing can be performed based on the set offset parameters, the modified weight matrix, and the modified bias matrix.
[0147] It should be noted that, in the embodiments of this application, after setting the offset parameters, the encoder updates the corresponding initial weight matrix and initial bias matrix to prevent a decrease in encoding and decoding performance, obtaining modified weight matrices and modified bias matrices. Then, during encoding processing in MIP mode, the current block can be encoded based on the offset parameters, modified weight matrices, and modified bias matrices. This reduces the storage space and overall time required for decoding while maintaining encoding and decoding performance, effectively improving encoding and decoding efficiency.
[0148] It should be noted that, in the embodiments of this application, after setting the offset parameters, the encoder can also directly encode the current block based on the offset parameters, the initial weight matrix, and the initial bias matrix. That is, after setting the offset parameters, the encoder may not need to update the corresponding initial weight matrix and initial bias matrix.
[0149] In existing technologies, when predicting the brightness of the current block using the MIP mode, the number of bits to be shifted to the right is inconsistent, i.e., the offset parameter sW is different. However, the image encoding method proposed in this application sets the offset parameter uniformly, making the implementation of the MIP mode simpler and more consistent. Furthermore, because the offset parameter sW is different in existing technologies, it is necessary to store an sW table representing the number of bits to be shifted to the right. During the calculation process, the sW corresponding to the current block is queried and called to determine the number of bits to be shifted to the right for the predicted value calculated by MIP. However, the image encoding method proposed in this application, because the offset parameter is set uniformly, no longer needs to store an sW table representing the number of bits to be shifted to the right, thereby saving storage space and eliminating the processing flow of querying and calling sW.
[0150] Furthermore, in the embodiments of this application, after setting the offset parameters, the encoder can also update the corresponding initial weight matrix and initial bias matrix, so that there is no significant loss in encoding and decoding performance. Specifically, according to the VVC test standard, the BD-rate on Y, U, and V are 0.00%, -0.02%, and -0.02%, respectively. Among them, the results at a 24-frame interval are expected to show similar encoding and decoding performance at an 8-frame interval.
[0151] This application proposes an image encoding method in which, before encoding according to the MIP mode, the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter. The offset parameter indicates the number of right shifts of the predicted value. During encoding according to the MIP mode, encoding is performed based on the offset parameter. Therefore, the image encoding / decoding method proposed in this application, by uniformly modifying the right shift of the predicted value using the offset parameter, ensures that all luma blocks of different sizes and different MIP mode numbers have the same sW value. This eliminates the need to query and retrieve the sW value during encoding / decoding, reducing the complexity of the MIP algorithm. While maintaining encoding / decoding performance, it reduces the storage space and overall time required during decoding, effectively improving encoding / decoding efficiency.
[0152] Based on the above embodiments, in another embodiment of this application, when the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the method for the encoder to obtain the modified weight matrix and the modified bias matrix according to the preset calculation rules may include the following steps:
[0153] Step 103a: According to the calculation rule of rounding down, modify all element values in the initial weight matrix to values of the same binary order of magnitude as the element values of other weight matrices to obtain the modified weight matrix.
[0154] Step 103b: Following the floor rule, modify all elements in the initial bias matrix to values of the same binary order as the elements of other bias matrices to obtain the modified bias matrix.
[0155] In the embodiments of this application, when the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the encoder can modify all element values in the initial weight matrix to values of the same binary order as the element values of other weight matrices according to the rounding down calculation rule, and at the same time modify all elements in the initial bias matrix to values of the same binary order as the element values of other bias matrices, thereby obtaining the modified weight matrix and the modified bias matrix.
[0156] Based on Table 9 above, Table 16 shows the modified weight matrix when MipSizeId is 1 and MIP mode number is 3 and 12. As shown in Table 16, the encoder updates each element value A in Table 9 to A / 2 according to the rounding down calculation rule, thereby obtaining the modified weight matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0157] Table 16
[0158] 224 47 -23 3 11 -8 1 -2 -1 238 38 -17 -3 -1 0 -2 0 -8 233 30 2 -2 0 -2 -19 1 -2 0 130 179 -39 4 61 -20 0 -1 231 -13 -6 -1 202 27 -21 2 60 -17 1 -3 53 201 8 -6 1 -2 0 -3 2 -1 -1 0 -31 133 187 -37 -13 1 -2 -1 54 233 -14 -6 29 -13 -2 -1 209 48 -18 -2 150 9 -8 2 114 -11 -2 -4 -1 -2 -1 -1 12 -48 145 148 1 0 -3 -1 -15 51 232 -15 -8 0 -3 0 20 214 35 -7 13 -3 -1 0 151 96 -7 -1
[0159] Based on Table 10 above, Table 17 shows the modified bias matrix when MipSizeId is 1 and MIP mode number is 3 and 12. As shown in Table 17, the encoder updates the value B of each element in Table 10 to B / 2 according to the rounding down calculation rule, thereby obtaining the modified bias matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0160] Table 17
[0161] 0 1 1 0 0 1 1 1 1 2 2 2 1 2 2 2
[0162] Based on Table 11 above, Table 18 shows the modified weight matrix when MipSizeId is 1 and MIP mode number is 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, thereby obtaining the modified weight matrix when MipSizeId is 1 and MIP mode number is 8 and 17.
[0163] Table 18
[0164] -13 -11 7 6 44 153 57 17 -8 9 -8 2 15 163 67 19 -6 5 15 -10 1 162 71 20 6 -2 0 0 -7 136 113 13 1 5 -2 -3 3 115 124 17 0 4 2 -5 5 107 131 18 -1 5 2 -4 7 104 129 20 2 0 2 -2 3 46 170 39 2 3 0 -3 3 56 164 37 1 6 1 -4 3 61 159 37 0 6 3 -5 4 68 151 37 3 0 2 -3 4 19 108 126 2 5 0 -4 4 29 156 70 1 6 2 -4 5 35 163 57 1 7 2 -4 7 41 157 55
[0165] Based on Table 12 above, Table 19 shows the modified bias matrix when MipSizeId is 1 and MIP mode number is 8 and 17, as shown in Table 22. The encoder updates the value B of each element in Table 12 to B / 2 according to the rounding down calculation rule, thereby obtaining the modified bias matrix when MipSizeId is 1 and MIP mode number is 8 and 17.
[0166] Table 19
[0167] -4 -5 -6 -6 -5 -7 -9 -9 -6 -8 -10 -11 -5 -9 -11 -11
[0168] In the embodiments of this application, further, when the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the method for the encoder to obtain the modified weight matrix and the modified bias matrix according to the preset calculation rules may include the following steps:
[0169] Step 103c: Following the rounding-up calculation rule, modify all element values in the initial weight matrix to values of the same binary order of magnitude as the element values in other weight matrices to obtain the modified weight matrix.
[0170] Step 103d: Following the rounding-up calculation rule, modify all elements in the initial bias matrix to values of the same binary order as the elements of other bias matrices to obtain the modified bias matrix.
[0171] In the embodiments of this application, when the size is 4×8, 8×4 or 8×8 and the MIP mode number is 3, 8, 12 or 17, the encoder can modify all the element values in the initial weight matrix to values of the same binary order as the element values of other weight matrices according to the rounding up calculation rule, and at the same time modify all the elements in the initial bias matrix to values of the same binary order as the element values of other bias matrices, thereby obtaining the modified weight matrix and the modified bias matrix.
[0172] Based on Table 9 above, Table 20 shows the modified weight matrix when MipSizeId is 1 and MIP mode number is 3 and 12. As shown in Table 20, the encoder updates each element value A in Table 9 to A / 2 according to the rounding up calculation rule, thereby obtaining the modified weight matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0173] Table 20
[0174] 224 47 -22 3 12 -7 1 -1 0 238 39 -17 -2 -1 1 -1 1 -8 233 31 3 -2 1 -1 -19 1 -1 0 130 179 -38 4 61 -19 1 0 232 -12 -5 -1 203 27 -20 3 61 -16 1 -3 54 201 8 -6 2 -2 1 -3 3 0 0 0 -31 134 188 -36 -12 2 -2 0 54 233 -14 -5 29 -12 -1 0 209 48 -17 -1 151 9 -7 3 115 -10 -2 -3 0 -1 -1 -1 12 -47 146 149 2 1 -2 -1 -15 52 232 -14 -8 0 -3 0 21 215 35 -6 14 -2 -1 1 152 97 -6 0
[0175] Based on Table 10 above, Table 21 shows the modified bias matrix when MipSizeId is 1 and MIP mode number is 3 and 12. As shown in Table 21, the encoder updates the value B of each element in Table 10 to B / 2 according to the rounding up calculation rule, thereby obtaining the modified bias matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0176] Table 21
[0177] 1 1 2 1 1 2 2 2 1 2 2 2 2 3 3 3
[0178] Based on Table 11 above, Table 22 shows the modified weight matrix when MipSizeId is 1 and MIP mode number is 8 and 17. As shown in Table 22, the encoder updates each element value A in Table 11 to A / 2 according to the rounding up calculation rule, thereby obtaining the modified weight matrix when MipSizeId is 1 and MIP mode number is 8 and 17.
[0179] Table 22
[0180] -13 -11 7 7 44 153 57 18 -8 9 -8 3 16 164 68 20 -5 6 15 -9 2 163 71 21 6 -2 1 1 -7 137 114 13 2 5 -1 -2 3 116 125 17 1 4 3 -4 5 107 131 19 0 6 2 -3 8 104 130 20 3 0 2 -2 3 46 170 39 2 3 1 -2 3 57 165 38 1 7 1 -4 3 62 160 38 1 7 3 -5 5 68 152 37 3 1 2 -2 4 19 109 126 2 5 1 -3 5 29 157 71 2 6 2 -4 6 35 164 57 1 7 2 -3 7 41 157 55
[0181] Based on Table 12 above, Table 23 shows the modified bias matrix when MipSizeId is 1 and MIP mode number is 8 and 17. As shown in Table 23, the encoder updates the value B of each element in Table 12 to B / 2 according to the rounding up calculation rule, thereby obtaining the modified bias matrix when MipSizeId is 1 and MIP mode number is 8 and 17.
[0182] Table 23
[0183] -3 -5 -5 -5 -5 -7 -8 -9 -5 -7 -9 -10 -5 -8 -10 -11
[0184] In the embodiments of this application, further, when the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the method for the encoder to obtain the modified weight matrix and the modified bias matrix according to the preset calculation rules may include the following steps:
[0185] Step 103e: According to the rounding calculation rules, modify all element values in the initial weight matrix to values of the same binary order of magnitude as the element values of other weight matrices to obtain the modified weight matrix.
[0186] Step 103f: According to the rounding calculation rules, modify all elements in the initial bias matrix to values of the same binary order as the element values of other bias matrices to obtain the modified bias matrix.
[0187] In the embodiments of this application, when the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the encoder can modify all element values in the initial weight matrix to values of the same binary order as the element values of other weight matrices according to the rounding calculation rules, and at the same time modify all elements in the initial bias matrix to values of the same binary order as the element values of other bias matrices, thereby obtaining the modified weight matrix and the modified bias matrix.
[0188] Based on Table 9 above, Table 24 shows the modified weight matrix when MipSizeId is 1 and MIP mode number is 3 and 12. As shown in Table 24, the encoder updates the value A of each element in Table 9 to A / 2 according to the rounding calculation rules, thereby obtaining the modified weight matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0189] Table 24
[0190] 224 47 -23 3 12 -8 1 -2 -1 238 39 -17 -3 -1 1 -2 1 -8 233 31 3 -2 1 -2 -19 1 -2 0 130 179 -39 4 61 -20 1 -1 232 -13 -6 -1 203 27 -21 3 61 -17 1 -3 54 201 8 -6 2 -2 1 -3 3 -1 -1 0 -31 134 188 -37 -13 2 -2 -1 54 233 -14 -6 29 -13 -2 -1 209 48 -18 -2 151 9 -8 3 115 -11 -2 -4 -1 -2 -1 -1 12 -48 146 149 2 1 -3 -1 -15 52 232 -15 -8 0 -3 0 21 215 35 -7 14 -3 -1 1 152 97 -7 -1
[0191] Based on Table 10 above, Table 25 shows the modified bias matrix when MipSizeId is 1 and MIP mode number is 3 and 12. As shown in Table 25, the encoder updates the value B of each element in Table 10 to B / 2 according to the rounding calculation rules, thereby obtaining the modified bias matrix when MipSizeId is 1 and MIP mode number is 3 and 12.
[0192] Table 25
[0193] 1 1 2 1 1 2 2 2 1 2 2 2 2 3 3 3
[0194] Based on Table 11 above, Table 26 shows the modified weight matrix when MipSizeId is 1 and MIP mode number is 8 and 17. As shown in Table 26, the encoder updates the value A of each element in Table 11 to A / 2 according to the rounding calculation rules, thereby obtaining the modified weight matrix when MipSizeId is 1 and MIP mode number is 8 and 17.
[0195] Table 26
[0196] -13 -11 7 7 44 153 57 18 -8 9 -8 3 16 164 68 20 -6 6 15 -10 2 163 71 21 6 -2 1 1 -7 137 114 13 2 5 -2 -3 3 116 125 17 1 4 3 -5 5 107 131 19 -1 6 2 -4 8 104 130 20 3 0 2 -2 3 46 170 39 2 3 1 -3 3 57 165 38 1 7 1 -4 3 62 160 38 1 7 3 -5 5 68 152 37 3 1 2 -3 4 19 109 126 2 5 1 -4 5 29 157 71 2 6 2 -4 6 35 164 57 1 7 2 -4 7 41 157 55
[0197] Based on Table 12 above, Table 27 shows the modified bias matrix when MipSizeId is 1 and MIP mode number is 8 and 17, as shown in Table 30. The encoder updates the value B of each element in Table 12 to B / 2 according to the rounding calculation rules, thereby obtaining the modified bias matrix when MipSizeId is 1 and MIP mode number is 8 and 17.
[0198] Table 27
[0199] -4 -5 -6 -6 -5 -7 -9 -9 -6 -8 -10 -11 -5 -9 -11 -11
[0200] This application proposes an image encoding method in which, before encoding according to the MIP mode, the encoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter. The offset parameter indicates the number of right shifts of the predicted value. During encoding according to the MIP mode, encoding is performed based on the offset parameter. Therefore, the image encoding / decoding method proposed in this application, by uniformly modifying the right shift of the predicted value using the offset parameter, ensures that all luma blocks of different sizes and different MIP mode numbers have the same sW value. This eliminates the need to query and retrieve the sW value during encoding / decoding, reducing the complexity of the MIP algorithm. While maintaining encoding / decoding performance, it reduces the storage space and overall time required during decoding, effectively improving encoding / decoding efficiency.
[0201] In another embodiment of this application, Figure 9 This is a schematic diagram of the implementation process of an image decoding method proposed in an embodiment of this application. Figure 1 ,like Figure 9 As shown in the embodiments of this application, the method of the decoder for image decoding may include the following steps.
[0202] Step 201: Before decoding according to the MIP mode, the initial right shift parameters corresponding to different sizes and different MIP mode numbers are uniformly modified according to the offset parameter; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value.
[0203] In embodiments of this application, the decoder may first set the offset parameter used to indicate the offset bit length before performing decoding processing according to MIP mode.
[0204] It should be noted that, in the embodiments of this application, based on the above formula (2), the offset parameter is sW in formula (2), that is, the offset parameter is the right shift of the overall prediction value. In other words, when performing brightness prediction on the current block, the offset parameter is used to indicate the number of right shifts of the overall prediction value of the current block.
[0205] Furthermore, in the embodiments of this application, the decoder can set the offset parameter to a fixed positive integer before performing decoding processing according to the MIP mode. That is, after the decoder sets the offset parameter, the offset parameter used is determined for any current block, regardless of the size of the current block or the MIP mode number corresponding to the current block.
[0206] It should be noted that, in the embodiments of this application, when the decoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter, the offset parameter can be set 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 even preferably set the offset parameter sW to 9.
[0207] In existing technologies, the offset parameter sW may differ for different current blocks. Specifically, the value of sW differs from that of all other MIP mode numbers if and only if MipSizeId equals 1 (i.e., the current block is a second-type luma block with dimensions of 4×8, 8×4, or 8×8) and MIP mode number 3, 8, 12, or 17. Therefore, when decoding the current block, the decoder needs to query and call the offset parameter sW based on the current block's size and MIP mode number, increasing overall time and reducing encoding / decoding efficiency. Furthermore, storing the syntax description table of sW also increases storage space. Compared with the prior art, this application can set the offset parameter sW before decoding according to the MIP mode. The offset parameter sW corresponding to all luma blocks of different sizes and MIP mode numbers is set to the same value. Therefore, when decoding the current block, it is no longer necessary to query and call the offset parameter sW according to the size and MIP mode number of the current block. The decoder also does not need to store the syntax description table of sW, thereby reducing the storage space and overall time required in the decoding process and effectively improving the encoding and decoding efficiency.
[0208] It should be noted that, in the embodiments of this application, although the decoder sets the offset parameter sW to the same value for all offset parameters sW corresponding to different sizes and different MIP mode numbers, the value of sW is different from the value of sW for all other MIP mode numbers when MipSizeId is equal to 1, that is, the current block is a second type of luma block with a size of 4×8, 8×4, 8×8 and MIP mode number 3, 8, 12, 17. Therefore, when the decoder uniformly modifies the initial right shift parameter sW corresponding to different sizes and different MIP mode numbers according to the offset parameter, it sets the offset parameter sW corresponding to sizes of 4×8, 8×4, 8×8 and MIP mode numbers of 3, 8, 12, 17.
[0209] Therefore, in the embodiments of this application, the process of the decoder uniformly modifying the initial right shift parameter corresponding to different sizes and different MIP mode numbers according to the offset parameter is that when the initial right shift parameter and the offset parameter are different, the initial right shift parameter is modified to the offset parameter so that the right shift number of all predicted values corresponding to all sizes and all MIP mode numbers is the same.
[0210] Step 202: When performing decoding processing according to MIP mode, perform decoding processing based on the offset parameter.
[0211] In the embodiments of this application, after the decoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameters, when the decoder performs decoding processing according to the MIP mode, it can perform decoding processing based on the set offset parameters.
[0212] It should be noted that, in the embodiments of this application, after the decoder sets the offset parameter, it can directly decode the current block according to the offset parameter when performing decoding processing in MIP mode. This reduces the storage space and overall time required during the decoding process while ensuring encoding and decoding performance, effectively improving encoding and decoding efficiency.
[0213] In the embodiments of this application, further, Figure 10 This is a schematic diagram of the implementation process of an image decoding method proposed in an embodiment of this application. Figure 2 ,like Figure 10 As shown, after the decoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameters, that is, after step 201, the method of image decoding by the decoder may also include the following steps:
[0214] Step 203: Modify the initial weight matrix and initial bias matrix according to the preset calculation rules to obtain the modified weight matrix and modified bias matrix; wherein the initial weight matrix and initial bias matrix correspond to the unified modified initial right shift parameters.
[0215] In the embodiments of this application, after the decoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameters, it can obtain the modified weight matrix and modified bias matrix according to the preset calculation rules for the initial weight matrix and initial bias matrix.
[0216] It should be noted that, in the implementation of this application, the initial weight matrix and the initial bias matrix correspond to the initial right shift parameters that have been uniformly modified.
[0217] It should be noted that, in the embodiments of this application, the preset calculation rules can be used to update the corresponding initial weight matrix and initial bias matrix when the size is 4×8, 8×4 or 8×8 and the MIP mode number is 3, 8, 12 or 17.
[0218] Furthermore, in the embodiments of this application, after the decoder sets the offset parameters, that is, changes 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 encoding and decoding performance from being reduced, the corresponding initial weight matrix and initial bias matrix can be further updated to obtain the modified weight matrix and modified bias matrix.
[0219] It should be noted that, in the embodiments of this application, when the size is 4×8, 8×4, or 8×8, and the MIP mode number is 3, 8, 12, or 17, the decoder can update the corresponding initial weight matrix and initial bias matrix using various different methods when obtaining the modified weight matrix and modified bias matrix according to the preset calculation rules. For example, when the size is 4×8, 8×4, or 8×8, 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 floor function, thereby obtaining the modified weight matrix and modified 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 floor function, thereby obtaining the modified weight matrix and modified bias matrix. Furthermore, 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 rounding calculation rules, thereby obtaining the modified weight matrix and the modified bias matrix.
[0220] Step 204: Decode the matrix based on the offset parameters, the modified weight matrix, and the modified bias matrix.
[0221] In the embodiments of this application, when the decoder performs decoding processing according to the MIP mode, the decoding processing can be performed based on the set offset parameters, the modified weight matrix, and the modified bias matrix.
[0222] It should be noted that, in the embodiments of this application, after setting the offset parameters, the decoder updates the corresponding initial weight matrix and initial bias matrix to prevent a decrease in encoding and decoding performance, obtaining modified weight matrices and modified bias matrices. Then, during decoding processing in MIP mode, the current block can be decoded based on the offset parameters, modified weight matrices, and modified bias matrices. This reduces the storage space and overall time required during decoding while maintaining encoding and decoding performance, effectively improving encoding and decoding efficiency.
[0223] It should be noted that, in the embodiments of this application, after setting the offset parameters, the decoder can also directly perform decoding processing on the current block based on the offset parameters, the initial weight matrix, and the initial bias matrix. That is, after completing the setting of the offset parameters, the decoder may not update the corresponding initial weight matrix and initial bias matrix.
[0224] In existing technologies, when predicting the brightness of the current block using the MIP mode, the number of bits to be shifted to the right is inconsistent, i.e., the offset parameter sW is different. However, the image decoding method proposed in this application sets the offset parameter uniformly, making the implementation of the MIP mode simpler and more consistent. Furthermore, because the offset parameter sW is different in existing technologies, it is necessary to store an sW table representing the number of bits to be shifted to the right. During the calculation process, the sW corresponding to the current block is queried and called to determine the number of bits to be shifted to the right for the predicted value calculated by MIP. However, the image decoding method proposed in this application, because the offset parameter is set uniformly, no longer needs to store an sW table representing the number of bits to be shifted to the right, thereby saving storage space and eliminating the processing flow of querying and calling sW.
[0225] This application proposes an image decoding method in which, before decoding according to the MIP mode, the decoder uniformly modifies the initial right-shift parameters corresponding to different sizes and MIP mode numbers according to an offset parameter. The offset parameter indicates the number of right-shift bits for the predicted value. During decoding according to the MIP mode, decoding is performed based on the offset parameter. Therefore, the image encoding / decoding method proposed in this application, by uniformly modifying the right-shift bits of the predicted value using the offset parameter, ensures that all luma blocks of different sizes and MIP mode numbers have the same sW value. This eliminates the need to query and retrieve the sW value during encoding / decoding, reducing the complexity of the MIP algorithm. While maintaining encoding / decoding performance, it reduces the storage space and overall time required during decoding, effectively improving encoding / decoding efficiency.
[0226] Based on the above embodiments, in another embodiment of this application, Figure 11This is a schematic diagram of the encoder structure proposed in the embodiments of this application. Figure 1 ,like Figure 11 As shown, the encoder 300 proposed in this application embodiment may include a first modification portion 301 and an encoding portion 302.
[0227] The first modification portion 301 is configured to uniformly modify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter before encoding processing according to the MIP mode; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value.
[0228] The encoding section 302 is configured to perform encoding processing based on the offset parameter when performing encoding processing according to the MIP mode.
[0229] The first modification 301 is specifically configured to modify the initial right shift parameter to the offset parameter when the initial right shift parameter and the offset parameter are not the same, so that the right shift bits of all predicted values corresponding to all sizes and all MIP mode numbers are the same.
[0230] Figure 12 This is a schematic diagram of the encoder structure proposed in the embodiments of this application. Figure 2 ,like Figure 12 As shown, the encoder 300 proposed in this application embodiment may further include a first processor 303, a first memory 304 storing executable instructions of the first processor 303, a first communication interface 305, and a first bus 306 for connecting the first processor 303, the first memory 304, and the first communication interface 305.
[0231] Furthermore, in the embodiments of this application, the first processor 303 is configured to uniformly modify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter before encoding processing according to the MIP mode; wherein the offset parameter is used to indicate the number of right shifts of the predicted value; and, when encoding processing according to the MIP mode, encoding processing is performed according to the offset parameter.
[0232] Furthermore, in this embodiment, the functional modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0233] If the integrated unit is implemented as 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 the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0234] This application provides an encoder that, before encoding according to the MIP mode, uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to an offset parameter. The offset parameter indicates the number of right shifts of the predicted value. During encoding according to the MIP mode, encoding is performed based on the offset parameter. Therefore, the image encoding / decoding method proposed in this application, by uniformly modifying the number of right shifts of the predicted value using the offset parameter, ensures that all luma blocks of different sizes and different MIP mode numbers have the same sW value. This eliminates the need to query and retrieve the sW value during encoding / decoding, reducing the complexity of the MIP algorithm. It effectively improves encoding / decoding efficiency by reducing the storage space and overall time required during decoding while maintaining encoding / decoding performance.
[0235] Figure 13 A schematic diagram of the decoder structure proposed in the embodiments of this application. Figure 1 ,like Figure 13 As shown, the decoder 400 proposed in this application embodiment may include a second modification part 401 and a decoding part 402.
[0236] The second modification 401 is configured to uniformly modify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter before performing decoding processing according to the MIP mode; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value.
[0237] The decoding section 402 is configured to perform decoding processing based on the offset parameter when performing decoding processing according to the MIP mode.
[0238] The second modification 401 is specifically configured to modify the initial right shift parameter to the offset parameter when the initial right shift parameter and the offset parameter are not the same, so that the right shift bits of all predicted values corresponding to all sizes and all MIP mode numbers are the same.
[0239] Figure 14 A schematic diagram of the decoder structure proposed in the embodiments of this application. Figure 2 ,like Figure 14 As shown, the decoder 400 proposed in this application embodiment may further include a second processor 403, a second memory 404 storing executable instructions of the second processor 403, a second communication interface 405, and a second bus 406 for connecting the second processor 403, the second memory 404, and the second communication interface 405.
[0240] Furthermore, in the embodiments of this application, the second processor 403 is configured to uniformly modify the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter before performing decoding processing according to the MIP mode; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value; and, when performing decoding processing according to the MIP mode, performing decoding processing according to the offset parameter.
[0241] Furthermore, in this embodiment, the functional modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0242] If the integrated unit is implemented as 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 the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0243] This application provides an encoder. Before decoding according to the MIP mode, the decoder uniformly modifies the initial right shift parameters corresponding to different sizes and different MIP mode numbers according to the offset parameter; and during decoding according to the MIP mode, the decoding process is performed based on the offset parameter. Therefore, the image encoding and decoding method proposed in this application, by uniformly modifying the right shift bits of the predicted value using the offset parameter, ensures that all luma blocks of different sizes and different MIP mode numbers have the same sW value. Thus, during encoding and decoding, it is not necessary to query and call the sW value, which reduces the complexity of the MIP algorithm. While ensuring encoding and decoding performance, it reduces the storage space and overall time required during the decoding process, effectively improving encoding and decoding efficiency.
[0244] This application provides a computer-readable storage medium and a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the methods described in the above embodiments.
[0245] Specifically, the program instructions corresponding to an image encoding method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to an image encoding method in the storage media are read or executed by an electronic device, the following steps are included:
[0246] Before encoding according to the MIP pattern, the initial right shift parameters corresponding to different sizes and different MIP pattern numbers are uniformly modified according to the offset parameter; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value; and,
[0247] When performing encoding processing according to the MIP mode, the encoding processing is performed based on the offset parameter.
[0248] Specifically, the program instructions corresponding to an image decoding method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to an image decoding method in the storage media are read or executed by an electronic device, the following steps are included:
[0249] Before decoding according to the MIP mode, the initial right shift parameters corresponding to different sizes and different MIP mode numbers are uniformly modified according to the offset parameter; wherein, the offset parameter is used to indicate the number of right shifts of the predicted value; and,
[0250] When performing decoding according to the MIP mode, the decoding process is performed based on the offset parameter.
[0251] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0252] This application is described with reference to schematic and / or block diagrams of implementations of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the schematic and / or block diagrams can be implemented by computer program instructions, and combinations of blocks in the schematic and / or block diagrams can be implemented. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the schematic and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0253] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the implementation flow diagram. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0254] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0255] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
[0256] Industrial applicability
[0257] This application provides an image encoding / decoding method, an encoder, a decoder, and a storage medium. Before encoding according to the MIP mode, the encoder uniformly modifies the initial right-shift parameters corresponding to different sizes and MIP mode numbers according to an offset parameter. The offset parameter indicates the number of right-shift bits for the predicted value. During encoding according to the MIP mode, encoding is performed based on the offset parameter. Before decoding according to the MIP mode, the decoder uniformly modifies the initial right-shift parameters corresponding to different sizes and MIP mode numbers according to the offset parameter. During decoding according to the MIP mode, decoding is performed based on the offset parameter. Therefore, the image encoding / decoding method proposed in this application, by uniformly modifying the number of right-shift bits for the predicted value using the offset parameter, ensures that all brightness blocks of different sizes and MIP mode numbers have the same sW value. This eliminates the need to query and retrieve the sW value during encoding / decoding, reducing the complexity of the MIP algorithm. While maintaining encoding / decoding performance, it reduces the storage space and overall time required during decoding, effectively improving encoding / decoding efficiency.
Claims
1. An image encoding method applied to an encoder, the method comprising: Determine the mode parameters for the current block; as well as, When the mode parameter indicates that the predicted value of the current block is determined according to the matrix-based intra-frame prediction (MIP) mode, the current block is predicted according to the MIP mode based on the offset parameter, wherein the offset parameter is the same for all block sizes and all MIP modes; wherein the offset parameter indicates the number of right shifts used to calculate the predicted value; wherein the block size is represented by MipSizeId, and the MIP mode is represented by the MIP mode number modeId.
2. The method according to claim 1, wherein, The offset parameter is a fixed positive integer.
3. The method according to claim 2, wherein, The offset parameter is 6.
4. The method according to claim 1, wherein, The step of predicting the current block according to the offset parameter in the MIP mode includes: The current block is predicted based on the offset parameter and the weight matrix.
5. The method according to claim 1, wherein, The method further includes: Write the mode parameters of the current block into the bitstream.
6. An image decoding method, applied to a decoder, the method comprising: Determine the mode parameters for the current block; as well as, When the mode parameter indicates that the predicted value of the current block is determined according to the matrix-based intra-frame prediction (MIP) mode, the current block is predicted according to the MIP mode based on the offset parameter, wherein the offset parameter is the same for all block sizes and all MIP modes; wherein the offset parameter indicates the number of right shifts used to calculate the predicted value; wherein the block size is represented by MipSizeId, and the MIP mode is represented by the MIP mode number modeId.
7. The method according to claim 6, wherein, The offset parameter is a fixed positive integer.
8. The method according to claim 6, wherein, The offset parameter is 6.
9. The method according to claim 6, wherein, The step of predicting the current block according to the offset parameter in the MIP mode includes: The current block is predicted based on the offset parameter and the weight matrix.
10. The method according to claim 6, wherein, The method further includes: Parse the bitstream to determine the mode parameters of the current block.
11. An encoder, the encoder comprising a first processor, a first memory storing instructions executable by the first processor, a first communication interface, and a first bus for connecting the first processor, the first memory, and the first communication interface, wherein when the instructions are executed by the first processor, the method of any one of claims 1-5 is implemented.
12. A decoder, the decoder comprising a second processor, a second memory storing instructions executable by the second processor, a second communication interface, and a second bus for connecting the second processor, the second memory, and the second communication interface, wherein when the instructions are executed by the second processor, the decoder implements the method as described in any one of claims 6-10.
13. A computer-readable storage medium having a program stored thereon, applied in an encoder, wherein when the program is executed by a processor, it implements the method as described in any one of claims 1-5 and outputs a bitstream.
14. A computer-readable storage medium having a program stored thereon, applied in a decoder, wherein the program, when executed by a processor, implements the method as described in any one of claims 6-10.
15. An encoding system, characterized in that, The encoding system executes the image encoding method according to any one of claims 1 to 5 and outputs a bitstream.
Citation Information
Patent Citations
Image encoding and decoding method, encoder, decoder and storage medium
CN120034647A