Image encoding and decoding method, encoder, decoder and storage medium

By utilizing the correspondence between pre-stored index numbers and offsets in multi-functional video coding, the encoding and decoding process of MIP mode is simplified, solving the problems of large storage space and time consumption, and improving encoding and decoding efficiency.

CN121486576APending Publication Date: 2026-02-06GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511891066.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2019-09-24
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

In multi-functional video coding, matrix-based intra-frame prediction (MIP) technology uses different parameters for luma blocks of different sizes, resulting in large storage space consumption and increased lookup and retrieval time, which reduces encoding and decoding efficiency.

Method used

By pre-stored the correspondence between index numbers and offsets, the first offset of the current block is determined, and the second offset is calculated using this offset, directly determining the predicted value of the current block and simplifying the encoding and decoding process.

Benefits of technology

This reduces the complexity of the MIP algorithm, decreases storage space and overall time, and improves encoding and decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121486576A_ABST
    Figure CN121486576A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image encoding and decoding method, an encoder, a decoder and a storage medium. The encoder determines the size of a current block; when the current block is coded by using the MIP mode, determining a first offset according to the size of the current block; calculating a second offset by using the first offset and a reconstruction value of an adjacent pixel corresponding to the current block; determining a first predicted value of the current block according to the second offset; and encoding the current block based on the first prediction value. The decoder decodes the code stream to obtain the size and the coding mode of the current block; when the coding mode of the current block is an MIP mode, determining a first offset according to the size of the current block; calculating a second offset by using the first offset and a reconstruction value of an adjacent pixel corresponding to the current block; determining a first predicted value of the current block according to the second offset; a reconstruction value of the current block is determined based on the first prediction value.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Divisional explanation This application is a divisional application of the application with the application number 201980060144.7 and the application name "Image coding method, encoder, decoder and storage medium", the application date of which is September 24, 2019. TECHNICAL FIELD

[0002] Embodiments of the present application relate to the field of video coding technology, in particular to an image coding method, an encoder, a decoder and a storage medium. BACKGROUND

[0003] In the reference software test platform of Versatile Video Coding (VVC), a new intra coding technology, Matrix-based Intra Prediction (MIP), is proposed. MIP is a neural network-based intra prediction technology, that is, a multi-layer neural network is used to predict the luminance value of the current block based on the adjacent reconstructed luminance blocks. Specifically, the same as the traditional intra mode, when intra prediction is performed using the MIP mode, the input of the MIP prediction is also the data of the adjacent luminance blocks of the previous row and the left column of the current block, and the output is the first predicted value of the luminance component of the current block. The specific prediction process includes three steps: downsampling, matrix-vector multiplication and interpolation.

[0004] However, when predicting the luminance by using the MIP mode, the parameters used by the luminance blocks of different sizes may also be different, so a large storage space is needed to store a large number of parameters, and the searching and calling of the parameters in the prediction process also increases the overall time, thereby reducing the coding efficiency. SUMMARY

[0005] Embodiments of the present application provide an image coding method, an encoder, a decoder and a storage medium, which can reduce the storage space and the overall time required in the coding process on the basis of ensuring the coding performance, and effectively improve the coding efficiency.

[0006] The technical scheme of the embodiments of the present application is as follows: The embodiments of the present application provide an image coding method applied to an encoder, the method comprising: determining the size of a current block; when encoding the current block by using the MIP mode, determining a first offset according to the size of the current block; calculating a second offset by using the first offset and the reconstructed value of the adjacent pixel corresponding to the current block; determine a first prediction value of the current block according to the second offset; encode the current block based on the first prediction value.

[0007] Embodiments of the present application provide a method for decoding an image, applied to a decoder, and the method comprises: decode a code stream to obtain a size and an encoding mode of a current block; when the encoding mode of the current block is a MIP mode, determine a first offset according to the size of the current block; calculate a second offset by using the first offset and a reconstructed value of a neighboring pixel corresponding to the current block; determine a first prediction value of the current block according to the second offset; determine a reconstructed value of the current block based on the first prediction value.

[0008] Embodiments of the present application provide an encoder, which comprises a first determining part, a first calculating part and an encoding part, the first determining part is configured to determine a size of a current block, and when encoding the current block by using a MIP mode, determine a first offset according to the size of the current block; the first calculating part is configured to calculate a second offset by using the first offset and a reconstructed value of a neighboring pixel corresponding to the current block; the first determining part is further configured to determine a first prediction value of the current block according to the second offset; the encoding part is configured to encode the current block based on the first prediction value.

[0009] Embodiments of the present application provide a decoder, which comprises an analyzing part, a second determining part and a second calculating part, the analyzing part is configured to decode a code stream to obtain a size and an encoding mode of a current block; the second determining part is configured to, when the encoding mode of the current block is a MIP mode, determine a first offset according to the size of the current block; the second calculating part is configured to calculate a second offset by using the first offset and a reconstructed value of a neighboring pixel corresponding to the current block; the second determining part is further configured to determine a first prediction value of the current block according to the second offset, and determine a reconstructed value of the current block based on the first prediction value.

[0010] The embodiment of the present application provides an encoder, which comprises a first processor, a first memory storing executable instructions of the first processor, a first communication interface, and a first bus for connecting the first processor, the first memory and the first communication interface, and when the instructions are executed by the first processor, the image encoding method is realized.

[0011] The embodiment of the present application provides a decoder, which comprises a second processor, a second memory storing executable instructions of the second processor, a second communication interface, and a second bus for connecting the second processor, the second memory and the second communication interface, and when the instructions are executed by the second processor, the image decoding method is realized.

[0012] The embodiment of the present application provides a computer readable storage medium, which stores a program, and is applied to an encoder and a decoder, and when the program is executed by a processor, the image encoding and decoding method is realized.

[0013] The embodiment of the present application provides an image encoding and decoding method, an encoder, a decoder and a storage medium. The encoder determines the size of a current block; when encoding the current block by using a MIP mode, a first offset is determined according to the size of the current block; a second offset is calculated by using the first offset and the reconstructed value of a neighboring pixel corresponding to the current block; a first prediction value of the current block is determined according to the second offset; and the current block is encoded based on the first prediction value. The decoder decodes a code stream to obtain the size of the current block and an encoding mode; when the encoding mode of the current block is the MIP mode, a first offset is determined according to the size of the current block; a second offset is calculated by using the first offset and the reconstructed value of a neighboring pixel corresponding to the current block; a first prediction value of the current block is determined according to the second offset; and the reconstructed value of the current block is determined based on the first prediction value. It can be seen that, when the image encoding and decoding method is used for encoding and decoding by using the MIP mode, the first offset corresponding to the current block can be directly determined according to the size of the current block, and then the current block can be encoded and decoded by using the first offset. That is, in the present application, based on the corresponding relationship between the pre-stored index sequence number and the offset, the first offset corresponding to the MIP block size index sequence number can be directly obtained after the MIP block size index sequence number corresponding to the size of the current block is determined, so that when the encoding and decoding processing is performed, the complexity of the MIP algorithm is reduced, the storage space and the overall time required in the encoding and decoding process are reduced on the basis of ensuring the encoding and decoding performance, and the encoding and decoding efficiency is effectively improved. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 Arrangement diagram of 67 prediction modes in intra prediction; Figure 2 A flowchart illustrating the encoding process for MIP mode; Figure 3 This is a schematic diagram showing the arrangement of the upper and left adjacent brightness blocks of the current block; Figure 4 To determine the layout diagram of the DM pattern; Figure 5 This is a schematic diagram of the structure of a video encoding system; Figure 6 This is a schematic diagram of the structure of a video decoding system; Figure 7 This is a schematic diagram illustrating the implementation process of the image encoding method. Figure 8 This is a schematic diagram illustrating the implementation process of the image decoding method. Figure 9 Schematic diagram of encoder structure Figure 1 ; Figure 10 Schematic diagram of encoder structure Figure 2 ; Figure 11 Schematic diagram of the decoder's structure Figure 1 ; Figure 12 Schematic diagram of the decoder's structure Figure 2 . Detailed Implementation

[0015] 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.

[0016] 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.

[0017] To capture finer edge directions in natural videos, VVC expands the 33 intra-frame luminance prediction angle modes defined in the High Efficiency Video Coding (HEVC) standard to 65. Figure 1An arrangement diagram of 67 prediction modes in intra prediction is shown as Figure 1 indicates 65 intra angular prediction modes, and two non-angular modes, i.e., a gradual planar (Planar) mode numbered 0 and a direct current (DC) mode numbered 1; therefore, the intra prediction process in VVC includes two non-angular modes and 65 angular modes, which are referred to as traditional modes of intra prediction.

[0018] MIP is a neural network-based intra prediction technology, i.e., a multi-layer neural network is used to predict the luminance value of a current block based on adjacent reconstructed pixels. Specifically, the MIP technology divides the luminance coding block into three categories according to the size of the intra luminance coding block, assuming that the size of the luminance coding block is WxH, 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 three categories: The luminance coding block with a size of 4x4 is the first type of luminance block, the luminance coding block with a size of 8x4, 4x8 and 8x8 is the second type of luminance block, and the luminance coding block with other sizes is the third type of luminance block.

[0019] For the three types of intra luminance coding blocks, the MIP technology adds M MIP modes to the 67 traditional 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.

[0020] Specifically, MIP technology is only applied to intra luminance prediction. Like traditional modes, the input of MIP prediction is also the last row and the left column data of the current block, and the output is the prediction value of the current block. The specific prediction process consists of three steps: averaging, matrix-vector multiplication and interpolation. That is, by performing these three operations on the reconstructed luminance values of the input adjacent pixels in the last row and the left column, the luminance component prediction value of the current block can be obtained.

[0021] Figure 2 An encoding flowchart for MIP modes is shown as Figure 2 The specific implementation of MIP mode for luminance prediction is as follows: First step: average the adjacent reference points on the top side of the current block to obtain a vector bdry top with N values; average the adjacent reference points on the left side of the current block to obtain a vector bdry left with N values. When the current block is the first type of luminance coding, N=2; when the current block is the second or third type of luminance coding block, N=4. The vector bdry top and the vector bdry left form a new vector bdry red and subsequent operations are performed; Second step: Obtain the corresponding matrix A through the mode number k of the MIP mode k and offset b k , the partial prediction value of the current block marked with cross lines in the following formula (1) is calculated as Figure 2 (1) Third step: Obtain the remaining prediction value Pred in the current block by linear interpolation red .

[0022] It should be noted that the implementation process of encoding the current block needs to write which encoding mode of the intra prediction is used into the compressed code stream, so that the decoding end can determine which mode is used by analyzing the mode information, whether it is a traditional mode or a MIP mode; if it is a traditional mode, which traditional mode is it; if it is a MIP mode, which MIP mode is it.

[0023] In the intra prediction of VVC, the rate distortion cost RDcost of 67 traditional modes and M MIP modes is compared for each luminance coding block, and the optimal mode is selected from the 67 traditional modes and M MIP modes and is coded. In order to save bit overhead, the intra mode coding technology based on the most probable mode list (MPM) is used in VVC.

[0024] It should be noted that since the multi-reference line technology (extend reference line) and the intra sub-block partition technology (Intra Sub-Patitionar, ISP) are only used for the modes in the MPM list, when extendrefflag and ispflag are both 0, i.e. 0 reference line is used and sub-block partition is not performed, mpmflag does not need to be coded, and the position of the optimal mode in the MPM list is directly coded.

[0025] Further, for the construction of the MPM list and the MIP MPM list, in the VVC luminance intra prediction, if the optimal mode selected for the current block is a traditional mode, a MPM list containing 6 most probable traditional modes needs to be constructed; if the optimal mode selected for the current block is a MIP mode, a MIP MPM list containing 3 most probable MIP modes needs to be constructed.

[0026] Figure 3 The arrangement diagram of the upper and left adjacent luminance blocks of the current block is shown in FIG. 1, and the above two lists are constructed according to the above two blocks. Figure 3 Figure 3 ​​The optimal modes of the top neighboring luma block (A) and the left neighboring luma block (L) of the current block are derived.

[0027] Further, for the construction of the MIP MPM list, in the VVC intra prediction, if the optimal mode of the current block is a MIP mode, the MIP MPM list needs to be constructed. In the process of constructing the MIP MPM list, firstly, the MIP mode corresponding to the optimal mode of the top neighboring luma block, denoted as ABOVE MIP, and the MIP mode corresponding to the optimal mode of the left neighboring luma block, denoted as LEFT MIP, need to be obtained.

[0028] Further, after obtaining LEFT MIP and ABOVE MIP, the MIP MPM list containing 3 most probable MIP MPM modes is constructed according to the following method, where the number in MIP MPM is the number of MIP mode, the number range is 0 to (M-1), for the first type of luma block, the number is 0-34; for the second type of luma block, the number is 0-18; for the third type of luma block, the number is 0-10: If LEFT MIP is available (not -1), LEFT MIP is put into MIP MPM list; If ABOVE MIP is available (not -1), ABOVE MIP is put into MIP MPM list after redundancy check; If LEFT MIP is not available (-1), ABOVE MIP is not available (-1), according to the type of the current block, the default list is added to MIP MPM list after redundancy check until MIP MPM list is full: The default list of the first type of luma block is: {17, 34, 5}; The default list of the second type of luma block is: {0, 7, 16}; The default list of the third type of luma block is: {1, 4, 6}.

[0029] Further, it needs to be supplemented that in the VVC chroma intra prediction process, there is a direct mode (DM) that uses the intra prediction mode of the center position of the same position luma coding block corresponding to the current block to perform intra prediction of the current chroma block, Figure 4 To determine the arrangement diagram of DM mode, as shown in Figure 4 As MIP technology is only applied to luma coding blocks, when the intra prediction mode of the CR position in Figure 4 is a MIP mode, the MIP mode needs to be mapped to a traditional mode through the "MIP-traditional mapping table" to perform intra prediction of the current chroma block, and Table 1 is the MIP-traditional mapping table.

[0030] Table 1

[0031] 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.

[0032] 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.

[0033] Table 2

[0034] Table 3

[0035] Table 4

[0036] Figure 5 This is a schematic diagram of the structure of a video encoding system, such as... Figure 5 As shown, the video coding system 100 includes components such as 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. Figure 6 This is a schematic diagram of the structure of a video decoding system, such as... Figure 6As shown, the video decoding system 200 includes a header information 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 and SAO filtering module 205, and a decoded image buffer module 206. A video image is processed by the transform and quantization module 101, the intra estimation module 102, the intra 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 encoding module 109 in the video encoding system 100, and a bitstream of the video image is output. The bitstream is input into the video decoding system 200, and is processed by the header information decoding and CABAC decoding module 201, the inverse transform and inverse quantization module 202, the intra prediction module 203, and the motion compensation module 204 in the video decoding system 200, and finally the original video image is recovered.

[0037] According to the height parameter and the width parameter, the current block can have 25 sizes. Specifically, the standard specifies that the maximum size of a luma block is 128x128, but since the maximum size of a transform unit is 64x64, that is, a luma block of size 128x128 must be divided by a quadtree first, so the maximum size of a luma block is 64x64. Table 5 is a size table of a luma block, as shown in Table 5, Table 5

[0038] In the prior art, the MIP mode is limited according to the height parameter and the width parameter of the current block. Specifically, if the aspect ratio of the current block is greater than 4, or the aspect ratio is greater than 4, the current block is not encoded by the MIP mode. Table 6 is the size limitation of a luma block in the MIP mode in the prior art, as shown in Table 6, Table 6

[0039] In the first type of luma block in the MIP mode (corresponding to a luma block of 4x4), two upper neighboring luma blocks and two left neighboring luma blocks are generated by matrix operation to generate a 4x4 prediction block. In the second type of luma block in the MIP mode (corresponding to a luma block of 4x8, 8x4, or 8x8), four upper neighboring luma blocks and four left neighboring luma blocks are generated by matrix operation to generate a 4x4 prediction block. In the third type of luma block in the MIP mode (corresponding to other sizes of luma blocks), four upper neighboring luma blocks and four left neighboring luma blocks are generated by matrix operation to generate a 4x8 prediction block (for a luma block of 4x16), an 8x4 prediction block (for a luma block of 16x4), or an 8x8 prediction block (for other sizes of luma blocks). Since the third type of luma block generates a non-square prediction block, odd rows of the matrix need to be extracted when calculating.

[0040] Further, in the syntax, the application category of MIP can be represented by MipSizeId, i.e. MipSizeId is the MIP block size index number, numModes represents the number of MIP modes, boundarySize represents the number of luminance blocks of the upper reference row or the 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 is the syntax relationship corresponding to the MIP mode in the prior art. As shown in Table 7, MipSizeId, numModes, boundarySize, predW, predH and predC in the syntax have the following relationships: Table 7

[0041] Further, in the syntax, the MIP block size index number takes the value of 0 to represent a 4x4 luminance block, takes the value of 1 to represent a 4x8, 8x4 or 8x8 luminance block, and takes the value of 2 to represent a luminance block of other sizes. numModes represents the total number of MIP prediction modes, i.e. there are 35 kinds of MIP prediction modes for a 4x4 luminance block, 19 kinds of MIP prediction modes for a 4x8, 8x4 or 8x8 luminance block, and 11 kinds of MIP prediction modes for a luminance block of other sizes. boundarySize represents that the adjacent luminance blocks of the current block in the upper row or the left column are finally downsampled into 2 or 4 adjacent luminance blocks.

[0042] In the prior art, when the encoder performs luminance prediction by using the MIP mode, the following formula (2) can be used: (2) wherein mWeight and vBias are the weight matrix and the bias matrix of each MIP mode trained by deep learning, specifically, mWeight is the weight matrix of each MIP mode, and vBias is the bias matrix of each MIP mode. sB is the left shift amount of the bias matrix, oW is the rounding reserve value, sW is the right shift amount of the overall prediction value, and sW values under different MIP modes need to be obtained by table lookup.

[0043] Based on JVET-N1001-v7, when generating the prediction matrix of MIP, the encoder judges whether the prediction value of the odd row needs to be extracted by using the variables and The fO variable represents the value that mWeight needs to subtract, specifically: (3) (4) (5) If MipSizeId < 2, then (6) (7) Else (8) wherein, represents the need to be extracted in the width parameter or height parameter.

[0044] Table 8 is the syntax description of sW in the prior art, as shown in Table 8, since the sW value in the MIP mode is the mapping relationship, the sW value in all modes can be obtained through Table 8.

[0045] Table 8

[0046] Table 9 is the syntax description of fO in the prior art, as shown in Table 9, in the calculation process of the MIP mode prediction value, the fO variable represents the value that the mWeight needs to subtract, and the fO value of different MIP modes needs to be obtained by looking up table for different brightness blocks. mWeight is the weight matrix of each MIP mode trained by deep learning.

[0047] As can be seen from the syntax description of fO in Table 9, the value of fO is related to the size of the brightness block and the mode number.

[0048] Table 9

[0049] It is because that the value of fO in Table 9 is related to the size of the brightness block and the mode number, that is, the syntax description of fO is different in different MIP modes. When the encoder performs brightness prediction by MIP mode, the value of fO may not be the same for the current coding block with different MipSizeId or different MIP mode number modeId, which causes the algorithm to be not unified, and the process of querying the above Table 9 increases the time complexity of the algorithm, and the storage of Table 9 also needs to occupy storage space.

[0050] As can be seen, when the prior art performs brightness prediction by MIP mode, the parameters used by the brightness blocks of different sizes may also be different, therefore, a large storage space is needed to store a large number of parameters, and the searching and calling of the parameters in the prediction process also increases the overall time, thereby reducing the coding efficiency.

[0051] To solve the above problems, the present application provides an image coding method. On the one hand, the encoder can realize that the value of the current block fO is only related to the size of the current block by setting the pre-stored index number and the offset, that is, by setting the corresponding relationship between MipSizeId and fO, so that the implementation of MIP can be more concise and unified. On the other hand, the corresponding relationship between MipSizeId and fO can be stored by using a one-dimensional array or a data structure with similar functions, which reduces the dimension and saves the storage space occupied by fO itself. On the other hand, when the encoder updates the unified fO, it can also update the corresponding mWeight using the updated fO, so as to avoid the reduction of coding performance.

[0052] Further, the image coding method provided by the present application can affect the intra prediction part in the video coding hybrid framework, that is, mainly applied to the intra prediction module 103 in the video coding and the intra prediction module 203 in the video decoding, which simultaneously acts on the encoding end and the decoding end.

[0053] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application.

[0054] In an embodiment of the present application, Figure 7 For the implementation flowchart of the image coding method, as Figure 7 shown, in the embodiment of the present application, the method for image coding by the encoder can include the following steps: Step 701, determine the size of the current block.

[0055] In the embodiment of the present application, the encoder can first determine the size of the current block, wherein the current block can be a current coding block to be coded, that is, the encoder can first determine the specific size of the current block before coding the current block.

[0056] Further, in the embodiment of the present application, the current block can be a luminance block to be coded.

[0057] It should be noted that in the embodiment of the present application, according to the height parameter H and the width parameter W of the current block, the size of the current block can include 25 sizes. Specifically, the standard stipulates that the current block is at most 128x128, but since the maximum size of the transform unit is 64x64, that is, the current block must be divided by quadtree when the size is 128x128. Therefore, the maximum size of the current block is 64x64.

[0058] Specifically, as shown in Table 5 above, the size (HxW) of the current block can include 25 sizes of (4x4), (4x8), (4x16), (4x32), (4x64), (8x4), (8x8), (8x16), (8x32), (8x64), (16x4), (16x8), (16x16), (16x32), (16x64), (32x4), (32x8), (32x16), (32x32), (32x64), (64x4), (64x8), (64x16), (64x32), (64x64).

[0059] In step 702, when encoding the current block by using the MIP mode, a first offset is determined according to the size of the current block.

[0060] In the embodiment of the present application, when encoding the current block by using the MIP mode, the encoder can first determine the first offset corresponding to the current block according to the size of the current block. According to the above formula (2), the first offset corresponding to the current block can be fO representing the value that the weight matrix mWeight needs to subtract.

[0061] It should be noted that in the embodiment of the present application, the encoder can set different first offsets for encoding processing for different sizes of the current block. Specifically, the encoder can first determine the MIP block size index sequence number corresponding to the current block according to the size of the current block, and then further determine the first offset corresponding to the current block according to the MIP block size index sequence number.

[0062] Further, in the embodiment of the present application, the MIP block size index sequence number of the current block is MipSizeId determined according to the size of the current block, and the first offset of the current block is fO of the parameter that the mWeight of the current block needs to subtract.

[0063] It can be understood that in the embodiment of the present application, when the encoder determines the MIP block size index sequence number corresponding to the current block according to the size of the current block, it can be specifically based on the following steps: (1) If the size of the current block is 4x4, MipSizeId takes the value of 0; (2) If the size of the current block is 4x8, 8x4 or 8x8, MipSizeId takes the value of 1; (3) If the size of the current block is other cases, MipSizeId takes the value of 2.

[0064] Further, in the embodiments of the present application, the encoder can be pre-configured with the correspondence between MipSizeId and fO, i.e., the encoder is configured with the pre-stored correspondence between index sequence number and offset, thus, after determining the MIP block size index sequence number corresponding to the current block, the encoder can map the first offset corresponding to the current block based on the pre-stored correspondence between index sequence number and offset.

[0065] It should be noted that, in the embodiments of the present application, based on the pre-stored correspondence between index sequence number and offset, for the same MIP block size index sequence number, the corresponding first offset is also the same, that is, in the embodiments of the present application, when the encoder encodes the current block using the MIP mode, the encoder can directly determine the first offset corresponding to the current block using the MIP block size index sequence number corresponding to the current block, so as to further perform encoding processing using the first offset.

[0066] In the embodiments of the present application, further, before encoding the current block according to the MIP mode, the encoder can first set the correspondence between the pre-stored index sequence number and offset. That is, the encoder needs to first set different fO for different MipSizeId.

[0067] Further, in the embodiments of the present application, when setting the correspondence between the pre-stored index sequence number and offset, for the same MipSizeId of the luminance block, the encoder can set the fO corresponding to these luminance blocks to the same value. That is, in the present application, the encoder can uniformly set the fO corresponding to the luminance blocks with the same MipSizeId. For example, Table 10 is a correspondence between pre-stored index sequence number and offset 1, as shown in Table 10, the encoder can directly set the same fO for the same MipSizeId, so that when the encoder encodes the current block, the encoder can directly determine the value of the first offset corresponding to the current block according to the MIP block size index sequence number corresponding to the current block; for example, if the size of the current block is 4x4, the encoder can determine that the MIP block size index sequence number corresponding to the current block takes the value of 0, and the encoder can determine that the first offset corresponding to the current block is 66 through the correspondence between MipSizeId and fO shown in Table 10.

[0068] Table 10

[0069] Table 11 is a corresponding relationship between a pre-stored index sequence and an offset. As shown in Table 11, the same fO can be directly set for the same MipSizeId, so that when encoding the current block, the encoder can directly determine the value of the corresponding first offset according to the MIP block size index sequence corresponding to the current block. For example, if the size of the current block is 4x4, the encoder can determine that the MIP block size index sequence corresponding to the current block takes the value of 0, and the encoder can determine that the first offset corresponding to the current block is 34 through the corresponding relationship between MipSizeId and fO shown in Table 11.

[0070] Table 11

[0071] It can be seen that, compared with Table 9, the encoder does not need to determine the first offset corresponding to the current block according to the values of MipSizeId and MIP mode number modeId in the above-mentioned Table 10 and Table 11, but only needs to obtain the first offset corresponding to the current block according to MipSizeId, thereby reducing the complexity of the operation and saving the storage overhead for storing the two-dimensional table of fO as shown in Table 9.

[0072] Further, in the embodiments of the present application, when setting the correspondence between the pre-stored index number and the offset, the encoder can first determine the fO with the largest value corresponding to different MIP mode numbers modeId of the same MipSizeId based on the original syntax description of fO, and then determine the fO with the largest value as the first offset corresponding to the MipSizeId. For example, based on the original syntax description of fO as shown in Table 9, it can be determined that when MipSizeId is 0, the fO with the largest value is 66 when modeId is 15, and therefore the encoder can set the fO corresponding to all modeId of MipSizeId 0 to 66, i.e., establish the correspondence between MipSizeId 0 and fO 66; correspondingly, based on the original syntax description of fO as shown in Table 9, it can be determined that when MipSizeId is 1, the fO with the largest value is 45 when modeId is 3, and therefore the encoder can set the fO corresponding to all modeId of MipSizeId 1 to 45, i.e., establish the correspondence between MipSizeId 1 and fO 45; correspondingly, based on the original syntax description of fO as shown in Table 9, it can be determined that when MipSizeId is 2, the fO with the largest value is 46 when modeId is 1, and therefore the encoder can set the fO corresponding to all modeId of MipSizeId 2 to 46, i.e., establish the correspondence between MipSizeId 2 and fO 46. That is, the above Table 10 is obtained.

[0073] Specifically, before the encoder obtains the fO by using the above Table 10 and Table 11, it is not necessary to determine the MipSizeId and modeId corresponding to the current block at the same time, but only needs to determine the MipSizeId by using the size of the current block, and then the fO corresponding to the current block can be obtained.

[0074] It can be understood that, in the embodiments of the present application, since the correspondence between MipSizeId and fO shown in the above Table 10 is a one-dimensional array, the encoder can store the correspondence between MipSizeId and fO by using a one-dimensional array or a data structure with similar functions, which reduces the dimension of the array and saves the storage space occupied by the array itself compared with the above Table 9.

[0075] In step 703, the second offset is calculated by using the first offset and the reconstructed value of the neighboring pixel corresponding to the current block.

[0076] In the embodiments of the present application, after the encoder determines the first offset according to the size of the current block, the encoder can calculate the second offset by using the first offset and the reconstructed values of the neighboring pixels corresponding to the current block. The second offset can be oW in the above formula (2). Specifically, the second offset can be the offset for controlling the bit shift operation, for example, oW in the above formula (2) is the reserved value of rounding, which can be calculated by the above formula (3).

[0077] It should be noted that in the embodiments of the present application, after the encoder determines the MIP block size index corresponding to the current block according to the size of the current block, and determines the first offset corresponding to the current block based on the correspondence between the pre-stored index sequence and the offset, the encoder can calculate the second offset corresponding to the current block by using the first offset based on the above formula (3). Specifically, when determining the second offset, the encoder also needs to calculate by using the reconstructed values of the neighboring pixels corresponding to the current block.

[0078] In step 704, the first prediction value of the current block is determined according to the second offset.

[0079] In the embodiments of the present application, after the encoder calculates the second offset based on the first offset and the reconstructed values of the neighboring pixels corresponding to the current block, the encoder can determine the first prediction value corresponding to the current block according to the second offset.

[0080] It should be noted that in the embodiments of the present application, when the encoder determines the first prediction value of the current block according to the second offset, the encoder can first calculate the second prediction value of the pixel at the preset position in the current block by using the second offset; and then the second prediction value can be filtered to obtain the first prediction value of all the pixels in the current block.

[0081] Further, in the embodiments of the present application, the preset position can be a specific position in the current block. Specifically, the preset position can be a specific position of part of the pixels in the current block. That is, in the present application, the encoder calculates the second prediction value by using the second offset, which is not the prediction value of all the pixels in the current block, but the prediction value of part of the specific position pixels in the current block.

[0082] It should be noted that in the embodiments of the present application, after the encoder calculates the second prediction value of part of the specific position pixels in the current block by using the second offset, the second prediction value can be filtered to obtain the prediction value of all the pixels in the current block, that is, to obtain the first prediction value corresponding to the current block.

[0083] It can be understood that in the embodiments of the present application, the second offset can be used to control the offset of the bit shift operation in the process of calculating the second prediction value.

[0084] Step 705, encoding the current block based on the first prediction value.

[0085] In the embodiments of the present application, after the encoder determines the first prediction value of the current block according to the second offset, the encoder can encode the current block based on the first prediction value, so as to obtain the code stream corresponding to the current block.

[0086] Further, in the embodiments of the present application, when the encoder encodes the current block based on the first prediction value, the encoder can first calculate the prediction difference between the original value of the current block and the first prediction value, and then encode the prediction difference value.

[0087] It should be noted that, in the embodiments of the present application, when the encoder encodes the current block, the encoder does not directly encode the first prediction value of the current block, but determines the difference between the first prediction value and the original value corresponding to the current block, that is, the prediction difference, and then encodes the prediction difference, so as to effectively improve the coding efficiency.

[0088] The embodiments of the present application provide an image encoding method. An encoder determines the size of a current block; when encoding the current block by using a MIP mode, determines a first offset according to the size of the current block; calculates a second offset by using the first offset and the reconstructed value of a neighboring pixel corresponding to the current block; determines a first prediction value of the current block according to the second offset; and encodes the current block based on the first prediction value. As can be seen, the image encoding method provided in the present application can directly determine the first offset corresponding to the current block according to the size of the current block when encoding by using the MIP mode, and then can encode the current block by using the first offset. That is, in the present application, based on the corresponding relationship between the pre-stored index sequence number and the offset, the first offset corresponding to the MIP block size index sequence number can be directly obtained after the MIP block size index sequence number corresponding to the size of the current block is determined, so that the complexity of the MIP algorithm is reduced when encoding, the storage space and the overall time required in the encoding process are reduced on the basis of ensuring the encoding performance, and the encoding efficiency is effectively improved.

[0089] Based on the above embodiments, in another embodiment of the present application, since the encoder is provided with the pre-stored correspondence between the index sequence number and the offset, when encoding the current block, the encoder only needs to determine the MIP block size index sequence number corresponding to the current block according to the size of the current block, and then determine the corresponding first offset by using the pre-stored correspondence between the index sequence number and the offset, that is, in the present application, based on the pre-stored correspondence between the index sequence number and the offset, the encoder can directly determine the value of fO according to MipSizeId, without determining the value of fO according to the values of MipSizeId and modeId, thereby greatly reducing the computational complexity and saving the storage overhead of the two-dimensional table for storing the correspondence among MipSizeId, modeId and fO.

[0090] That is, in the prior art, fO in the above formula (2) represents a value that needs to be subtracted from mWeight, and the value of fO of the current block can be obtained only by querying the correspondence among MipSizeId, modeId and fO shown in Table 9 above, so it can be seen that the value of fO is related to the size and mode number of the current block, which causes the algorithm to be not unified, and the storage of the correspondence among MipSizeId, modeId and fO in Table 9 above also needs to occupy a large storage space. In contrast, in the present application, only the correspondence between MipSizeId and fO needs to be stored, and for the same MipSizeId, the value of fO is the same even if the modeId is different, thereby saving the storage space and reducing the computational complexity.

[0091] Specifically, in the embodiment of the present application, the syntax of the prediction calculation process of MIP is simplified, and fO for the same MipSizeId is uniformly modified, that is, only the size of the current block can be used to determine the corresponding fO.

[0092] In the embodiment of the present application, further, when the syntax of the prediction calculation process of MIP is simplified, the encoder can also directly set fO corresponding to any luma block with different MipSizeId and different modeId to be the same value, that is, fO is a fixed value, the correlation between the size of the luma block and fO is cancelled, fO in all cases is defined as a unified value, and the table related to fO is no longer stored, thereby further reducing the complexity of the MIP algorithm, reducing the storage space of the algorithm, and making the implementation and syntax of the MIP technology more simple and unified.

[0093] In the embodiments of the present application, further, in order to avoid the loss of coding performance, the encoder needs to make corresponding modification to the value of mWeight while modifying fO uniformly. Specifically, after setting the corresponding relationship between the pre-stored index sequence number and the offset, the encoder can add the increased part of fO in the corresponding mode to each weight value in the weight matrix mWeight corresponding to the current block, that is, the encoder can add the updated fO to each original weight value in the original mWeight corresponding to the current block of mWeight, so that the coding performance can be completely unchanged, that is, the encoder can simultaneously update mWeight by using fO, so that the storage space and the operation complexity can be reduced while the coding performance and the prediction calculation result remain unchanged.

[0094] It should be noted that in the embodiments of the present application, when the encoder updates mWeight by using fO, if there is a weight value greater than the preset weight threshold in the updated mWeight, the weight value can be set to be less than or equal to the preset weight threshold. For example, the encoder sets the preset weight threshold to be the upper limit value 127 of 7-bit binary number, and if there is a weight value greater than 127 in the updated mWeight, the weight value greater than 127 can be modified to be less than or equal to the preset weight threshold by using the clamping method, such as setting it to be 127.

[0095] Further, in the embodiments of the present application, if there is a weight value greater than the preset weight threshold in the updated mWeight, the method of reducing sW can also be used to keep all the weight values in the updated mWeight within the range of the preset weight threshold.

[0096] Further, in the embodiments of the present application, in order to better maintain the coding performance, the pseudo code shown in formula (9) can also be used to calculate The value of the parameter, that is, replace formula (6) with formula (9). It can be understood that the calculation method of formula (9) can reduce the dynamic range of the data in the MIP matrix: (9) Exemplarily, for the luma block with the value of MipSizeId being 0, before the fO is modified uniformly, the syntax description of the initial fO is shown in Table 12, and the value of fO is different for different MIP mode numbers modeId.

[0097] Table 12

[0098] wherein, the fO with modeId value of 1 is 21, and the corresponding mWeight is shown in Table 13 as follows, Table 13

[0099] Based on the above Table 12, the fO with value of 21 when modeId is 1 can be used to obtain the original mWeight corresponding to modeId value of 1, specifically, each weight value in the above Table 13 can be subtracted by 21, thereby the corresponding original mWeight can be obtained as shown in Table 14 as follows, Table 14

[0100] In the embodiments of the present application, when updating the original mWeight corresponding to mWeight, in order to reduce the dynamic range of data in the MIP matrix, the encoder replaces formula (6) with formula (9).

[0101] Table 15

[0102] Specifically, it is necessary to take the first column of all original mWeight corresponding to the MIP mode number modeId of the luminance block with MipSizeId value of 0 and 1 to be opposite. For example, based on the above Table 14, after taking the weight value in the first column to be opposite, the preliminary updated mWeight obtained is shown in Table 15 as follows.

[0103] Since the fO value in the above Table 12 is the largest 34 of the MIP mode number modeId of 0, the encoder can directly set the fO corresponding to all luminance blocks with MipSizeId of 0 to 34 when uniformly modifying fO, that is, the syntax description of the updated fO is shown in Table 16 as follows, Table 16

[0104] At the same time, the encoder can continue to update the preliminary updated mWeight of the luminance block with MIP mode number modeId of 1 using the fO with value of 34, that is, based on the above Table 15, each weight value in Table 15 is added by 34, thereby the updated mWeight can be obtained as shown in Table 17 as follows, Table 17

[0105] It can be understood that, in this process, if a weight value greater than the preset weight threshold appears in the updated mWeight, the weight value can be clamped within the range of the preset weight threshold, or the sW can be reduced, so that all weight values in the updated mWeight are kept within the range of the preset weight threshold.

[0106] It can be understood from the above description that, in the present application, on the one hand, the encoder can realize that the value of the current block fO is only related to the size of the current block when encoding by setting the correspondence between the pre-stored index sequence number and the offset, i.e., by setting the correspondence between MipSizeId and fO, so that the implementation of MIP is more concise and unified; on the other hand, the correspondence between MipSizeId and fO can be stored by using a one-dimensional array or a data structure with similar functions, which reduces the dimension and saves the storage space occupied by fO itself; on the other hand, when the encoder updates the fO uniformly, the corresponding mWeight can also be updated using the updated fO, so that the reduction of the encoding performance can be avoided.

[0107] The embodiment of the present application provides an image encoding method. An encoder determines the size of a current block; when encoding the current block by using a MIP mode, a first offset is determined according to the size of the current block; a second offset is calculated by using the first offset and the reconstructed value of a neighboring pixel corresponding to the current block; a first prediction value of the current block is determined according to the second offset; and the current block is encoded based on the first prediction value. As can be seen, the image encoding method proposed in the present application can directly determine the first offset corresponding to the current block according to the size of the current block when encoding by using the MIP mode, and then the current block can be encoded by using the first offset. That is, in the present application, based on the correspondence between the pre-stored index sequence number and the offset, the first offset corresponding to the MIP block size index sequence number can be directly obtained after the MIP block size index sequence number corresponding to the size of the current block is determined, so that the complexity of the MIP algorithm is reduced when encoding, the storage space and the overall time required in the encoding process are reduced on the basis of ensuring the encoding performance, and the encoding efficiency is effectively improved.

[0108] In another embodiment of the present application, Figure 8 For the implementation flowchart of the image decoding method, as Figure 8 shown, in the embodiment of the present application, the method for image decoding by the decoder can include the following steps: Step 801, decode the code stream to obtain the size of the current block and the encoding mode.

[0109] In the embodiments of the present application, the decoder can first determine the size and the coding mode of the current block, wherein the current block can be a current coding block to be decoded, that is, the decoder can first determine the specific size and the coding mode of the current block before decoding the current block.

[0110] It should be noted that in the embodiments of the present application, the coding mode of the current block can be 67 traditional intra prediction modes or MIP modes.

[0111] Further, in the embodiments of the present application, the current block can be a luma block to be decoded.

[0112] It should be noted that in the embodiments of the present application, according to the height parameter H and the width parameter W of the current block, the size of the current block can include 25 sizes, specifically, the standard stipulates that the maximum size of the current block is 128x128, but since the maximum size of the transform unit is 64x64, that is, the current block must be divided by quad-tree when the size of the current block is 128x128, therefore, the maximum size of the current block is 64x64.

[0113] Step 802, when the coding mode of the current block is the MIP mode, determining a first offset according to the size of the current block.

[0114] In the embodiments of the present application, after the decoder determines that the coding mode of the current block is the MIP mode, the decoder can first determine the first offset corresponding to the current block according to the size of the current block. Based on the above formula (2), the first offset corresponding to the current block can be fO of the value that mWeight needs to subtract.

[0115] It should be noted that in the embodiments of the present application, for different sizes of the current block, the decoder can set different first offsets for decoding processing. Specifically, the decoder can first determine the MIP block size index sequence number corresponding to the current block according to the size of the current block, and then can further determine the first offset corresponding to the current block according to the MIP block size index sequence number.

[0116] Further, in the embodiments of the present application, the MIP block size index sequence number of the current block is MipSizeId determined according to the size of the current block, and the first offset of the current block is fO of the parameter that mWeight needs to subtract.

[0117] It can be understood that in the embodiments of the present application, when the decoder determines the MIP block size index sequence number corresponding to the current block according to the size of the current block, the decoder can specifically perform the following steps: (1) If the size of the current block is 4x4, MipSizeId takes 0; (2) If the size of the current block is 4x8, 8x4 or 8x8, MipSizeId is set to 1; (3) If the size of the current block is other cases, MipSizeId is set to 2.

[0118] Further, in the embodiments of the present application, the decoder can be pre- provided with the correspondence between MipSizeId and fO, that is, the decoder is provided with the pre-stored correspondence between the index sequence number and the offset, therefore, after determining the MIP block size index sequence number corresponding to the current block, the decoder can map the first offset corresponding to the current block based on the pre-stored correspondence between the index sequence number and the offset.

[0119] It should be noted that, in the embodiments of the present application, based on the pre-stored correspondence between the index sequence number and the offset, for the same MIP block size index sequence number, the corresponding first offset is also the same, that is, in the embodiments of the present application, when the decoder decodes the current block by using the MIP mode, the decoder can directly determine the first offset corresponding to the current block by using the MIP block size index sequence number corresponding to the current block, so as to further perform decoding processing by using the first offset.

[0120] In the embodiments of the present application, further, before decoding the current block according to the MIP mode, the decoder can first set the pre-stored correspondence between the index sequence number and the offset. That is, the decoder needs to first set different fO for different MipSizeId.

[0121] Further, in the embodiments of the present application, when setting the pre-stored correspondence between the index sequence number and the offset, for the luma blocks with the same MipSizeId, the decoder can set the fO corresponding to these luma blocks to the same value. That is, in the present application, the decoder can uniformly set the fO corresponding to the luma blocks with the same MipSizeId. For example, in the above table 10, if the size of the current block is 4x4, the decoder can determine that the MIP block size index sequence number corresponding to the current block is 0, and the decoder can determine the first offset corresponding to the current block as 66 by using the correspondence between MipSizeId and fO shown in table 10; in the above table 11, if the size of the current block is 4x4, the decoder can determine that the MIP block size index sequence number corresponding to the current block is 0, and the decoder can determine the first offset corresponding to the current block as 34 by using the correspondence between MipSizeId and fO shown in table 11.

[0122] Therefore, compared with the above table 9, the above table 10 and table 11 in the present application, when determining the first offset corresponding to the current block, the decoder does not need to determine the first offset corresponding to the current block according to the values of MipSizeId and MIP mode number modeId two variables, but can obtain the first offset corresponding to the current block according to only one parameter MipSizeId, so as to reduce the complexity of operation, and save the storage overhead for storing the two-dimensional table of fO as in the above table 9.

[0123] Further, in the embodiment of the present application, when setting the corresponding relationship between the pre-stored index sequence number and the offset, the decoder can first determine the fO with the largest value corresponding to different MIP mode numbers modeId of the same MipSizeId based on the original syntax description of fO, and then determine the fO with the largest value as the first offset corresponding to the one MipSizeId. For example, based on the original syntax description of fO as shown in table 9, it can be determined that when MipSizeId is 0, the fO with the largest value is 66 when modeId is 15, therefore, the decoder can set the fO corresponding to all modeId of MipSizeId as 0 to 66, that is, establish the corresponding relationship between MipSizeId as 0 and fO as 66; correspondingly, based on the original syntax description of fO as shown in table 9, it can be determined that when MipSizeId is 1, the fO with the largest value is 45 when modeId is 3, therefore, the decoder can set the fO corresponding to all modeId of MipSizeId as 1 to 45, that is, establish the corresponding relationship between MipSizeId as 1 and fO as 45; correspondingly, based on the original syntax description of fO as shown in table 9, it can be determined that when MipSizeId is 2, the fO with the largest value is 46 when modeId is 1, therefore, the decoder can set the fO corresponding to all modeId of MipSizeId as 2 to 46, that is, establish the corresponding relationship between MipSizeId as 2 and fO as 46. That is, the above table 10 is obtained.

[0124] Specifically, before the decoder obtains fO by using the above table 10 and table 11, the decoder does not need to determine the MipSizeId and modeId corresponding to the current block at the same time, but only needs to determine MipSizeId by using the size of the current block, so as to obtain the fO corresponding to the current block.

[0125] It can be understood that, in the embodiments of the present application, since the correspondence between MipSizeId and fO shown in Table 10 is a one-dimensional array, the decoder can store the correspondence between MipSizeId and fO by using a one-dimensional array or a data structure with similar functions, compared with Table 9, the dimension of the array is reduced, and the storage space occupied by the array itself is saved.

[0126] In step 803, the second offset is calculated by using the first offset and the reconstructed values of the neighboring pixels corresponding to the current block.

[0127] In the embodiments of the present application, after the decoder determines the first offset according to the size of the current block, the second offset can be calculated by using the first offset and the reconstructed values of the neighboring pixels corresponding to the current block. Specifically, the second offset can be the offset for controlling the bit shift operation, for example, oW in formula (2) is the reserved value of rounding, which can be calculated by formula (3).

[0128] It should be noted that, in the embodiments of the present application, after the decoder determines the MIP block size index corresponding to the current block according to the size of the current block, and determines the first offset corresponding to the current block based on the correspondence between the pre-stored index sequence and the offset, the second offset corresponding to the current block can be calculated by using the first offset based on formula (3). Specifically, the decoder also needs to use the reconstructed values of the neighboring pixels corresponding to the current block to calculate the second offset when determining the second offset.

[0129] In step 804, the first prediction value of the current block is determined according to the second offset.

[0130] In the embodiments of the present application, after the decoder calculates the second offset based on the first offset and the reconstructed values of the neighboring pixels corresponding to the current block, the first prediction value of the current block corresponding to the second offset can be determined.

[0131] It should be noted that, in the embodiments of the present application, when the decoder determines the first prediction value of the current block according to the second offset, the second prediction value of the pixel at the preset position in the current block can be calculated by using the second offset first; then the second prediction value can be filtered, so that the first prediction value of all the pixels in the current block can be obtained.

[0132] Further, in the embodiments of the present application, the preset position can be a specific position of the pixels in the current block, and specifically, the preset position can be a specific position of the partial pixels in the current block. That is, in the present application, the decoder calculates the second prediction value through the second offset, and the prediction value is not for all the pixels in the current block, but for the partial specific position pixels in the current block.

[0133] It should be noted that in the embodiments of the present application, after the decoder obtains the second prediction value of the partial specific position pixels in the current block through the second offset, the second prediction value can be filtered, so as to obtain the prediction value of all the pixels in the current block, that is, to obtain the first prediction value corresponding to the current block.

[0134] It can be understood that in the embodiments of the present application, the second offset can be used to control the offset of the bit shift operation in the process of calculating the second prediction value.

[0135] Step 805, decoding the current block based on the first prediction value.

[0136] In the embodiments of the present application, after the decoder determines the first prediction value of the current block according to the second offset, the decoder can decode the current block based on the first prediction value, so as to obtain the code stream corresponding to the current block.

[0137] Further, in the embodiments of the present application, when the decoder decodes the current block based on the first prediction value, the decoder can first calculate the prediction difference between the original value of the current block and the first prediction value, and then decode the prediction difference.

[0138] It should be noted that in the embodiments of the present application, when the decoder decodes the current block, the decoder does not directly decode the first prediction value of the current block, but determines the difference between the first prediction value and the original value corresponding to the current block, that is, the prediction difference, and then decodes the prediction difference, so as to effectively improve the coding efficiency.

[0139] Further, in the embodiments of the present application, before the decoder determines the reconstruction value of the current block based on the first prediction value, the decoder can first obtain the prediction difference of the current block by decoding the code stream.

[0140] Correspondingly, in the embodiments of the present application, after the decoder determines the prediction difference of the current block and determines the first prediction value of the current block, the decoder can directly calculate the sum value between the first prediction value and the prediction difference, and set the sum value as the reconstruction value of the current block. That is, when the decoder determines the reconstruction value of the current block based on the first prediction value, the decoder can perform addition operation on the first prediction value and the prediction difference, so as to obtain the reconstruction value of the current block, to complete the decoding process of the current block.

[0141] The embodiment of the present application provides a kind of image decoding method, decoder decodes code stream, obtains the size and coding mode of current block;When the coding mode of current block is MIP mode, according to the size of current block, first offset is determined;Second offset is calculated using the first offset and the reconstruction value of the adjacent pixel corresponding to current block;According to second offset, the first prediction value of current block is determined;The reconstruction value of current block is determined based on first prediction value.It can be seen from this, the image decoding method proposed in the present application, when decoding using MIP mode, first offset corresponding to current block can be directly determined according to the size of current block, then first offset can be used to decode and process current block, that is, in the present application, based on the corresponding relationship between pre-stored index sequence number and offset, after determining the MIP block size index sequence number corresponding to the size of current block, the first offset corresponding to the MIP block size index sequence number is directly obtained, so that when decoding, the complexity of MIP algorithm is reduced, the storage space and overall time required in decoding process can be reduced on the basis of guaranteeing decoding performance, and decoding efficiency is effectively improved.

[0142] Based on the above embodiment, in another embodiment of the present application, Figure 9 The schematic structure of encoder Figure 1 As shown in the figure, the encoder 300 proposed in the embodiment of the present application can include a first determining part 301, a first calculating part 302 and an encoding part 303. Figure 9 The first determining part 301 is configured to determine the size of current block, and when encoding the current block using MIP mode, determine first offset according to the size of the current block;

[0143] The first calculating part 302 is configured to calculate second offset using the first offset and the reconstruction value of the adjacent pixel corresponding to the current block. The first determining part 301 is further configured to determine the first prediction value of the current block according to the second offset. The encoding part 303 is configured to encode the current block based on the first prediction value.

[0144] Figure 10 The schematic structure of encoder Figure 2 As shown in the figure, the encoder 300 proposed in the embodiment of the present application can include a first determining part 301, a first calculating part 302 and an encoding part 303. Figure 10 The first determining part 301 is configured to determine the size of current block, and when encoding the current block using MIP mode, determine first offset according to the size of the current block;

[0145] ​Further, in the embodiments of the present application, the first processor 304 is configured to determine a size of a current block, determine a first offset according to the size of the current block when encoding the current block by using the MIP mode, calculate a second offset by using the first offset and a reconstructed value of a neighboring pixel corresponding to the current block, determine a first prediction value of the current block according to the second offset, and encode the current block based on the first prediction value.

[0146] In addition, each functional module in the embodiments can be integrated in one processing unit, or each unit can exist alone physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional module.

[0147] The integrated unit, if implemented in the form of a software functional module and not sold or used as an independent product, can be stored in a computer readable storage medium, based on such understanding, the technical solutions of the embodiments can essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, the computer software product is stored in a storage medium, includes a plurality of instructions to make a computer device (may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the embodiments method. And the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various program codes that can be stored in the medium.

[0148] This application provides an encoder that determines the size of the current block; when encoding the current block using MIP mode, a first offset is determined based on the size of the current block; a second offset is calculated using the first offset and the reconstructed values ​​of the adjacent pixels corresponding to the current block; a first predicted value of the current block is determined based on the second offset; and the current block is encoded based on the first predicted value. Therefore, the image encoding method proposed in this application, when encoding using MIP mode, can directly determine the first offset corresponding to the current block based on the size of the current block, and then use the first offset to encode the current block. In other words, based on the pre-stored correspondence between index numbers and offsets, after determining the MIP block size index number corresponding to the size of the current block, the first offset corresponding to the MIP block size index number can be directly obtained. This reduces the complexity of the MIP algorithm during encoding, and while ensuring encoding performance, it reduces the storage space and overall time required during the encoding process, effectively improving encoding efficiency.

[0149] Based on the above embodiments, in another embodiment of this application... Figure 11 Schematic diagram of the decoder's structure Figure 1 ,like Figure 11 As shown, the decoder 400 proposed in this application embodiment may include a parsing part 401, a second determining part 402, and a second calculation part 403.

[0150] The parsing section 401 is configured in the decoded bitstream to obtain the size and encoding mode of the current block. The second determining part 402 is configured to determine a first offset based on the size of the current block when the encoding mode of the current block is MIP mode; The second calculation part 403 is configured to calculate the second offset using the first offset and the reconstructed values ​​of the adjacent pixels corresponding to the current block; The second determining portion 402 is further configured to determine a first predicted value of the current block based on the second offset; and to determine a reconstructed value of the current block based on the first predicted value.

[0151] Figure 12 Schematic diagram of the decoder's structure Figure 2 ,like Figure 12 As shown, the decoder 400 proposed in this application embodiment may further include a second processor 404, a second memory 405 storing executable instructions of the second processor 404, a second communication interface 406, and a second bus 407 for connecting the second processor 404, the second memory 405, and the second communication interface 406.

[0152] Further, in the embodiments of the present application, the second processor 404 is configured to decode the code stream, obtain a size and an encoding mode of a current block, determine a first offset according to the size of the current block when the encoding mode of the current block is a MIP mode, calculate a second offset by using the first offset and a reconstructed value of a neighboring pixel corresponding to the current block, determine a first prediction value of the current block according to the second offset, and determine a reconstructed value of the current block based on the first prediction value.

[0153] In addition, each functional module in the embodiments can be integrated in one processing unit, or each unit can exist alone physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional module.

[0154] The integrated unit, if implemented in the form of a software functional module and not sold or used as an independent product, can be stored in a computer readable storage medium, based on such understanding, the technical solutions of the embodiments can essentially or partially 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 can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the embodiments. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various other media that can store program codes.

[0155] The embodiment of the present application provides a decoder which decodes a code stream, obtains the size and the coding mode of a current block; when the coding mode of the current block is a MIP mode, a first offset is determined according to the size of the current block; a second offset is calculated by using the first offset and the reconstructed value of a neighboring pixel corresponding to the current block; a first prediction value of the current block is determined according to the second offset; and the reconstructed value of the current block is determined based on the first prediction value. As can be seen, the image decoding method provided in the present application can directly determine the first offset corresponding to the current block according to the size of the current block when decoding by using the MIP mode, and then the current block can be decoded by using the first offset, that is, in the present application, based on the corresponding relationship between the pre-stored index sequence number and the offset, the first offset corresponding to the MIP block size index sequence number can be directly obtained after the MIP block size index sequence number corresponding to the size of the current block is determined, so that the complexity of the MIP algorithm is reduced when decoding, the storage space and the overall time required in the decoding process are reduced on the basis of ensuring the decoding performance, and the decoding efficiency is effectively improved.

[0156] The embodiment of the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the method described in the above embodiment.

[0157] Specifically, the program instructions corresponding to the image encoding method in the embodiment can be stored on a storage medium such as an optical disc, a hard disk, a U disk, etc., and when the program instructions corresponding to the image encoding method in the storage medium are read or executed by an electronic device, the following steps are implemented: determining the size of a current block; when encoding the current block by using the MIP mode, a first offset is determined according to the size of the current block; a second offset is calculated by using the first offset and the reconstructed value of a neighboring pixel corresponding to the current block; a first prediction value of the current block is determined according to the second offset; the current block is encoded based on the first prediction value.

[0158] Specifically, the program instructions corresponding to the image decoding method in the embodiment can be stored on a storage medium such as an optical disc, a hard disk, a U disk, etc., and when the program instructions corresponding to the image decoding method in the storage medium are read or executed by an electronic device, the following steps are implemented: decoding a code stream to obtain the size and the coding mode of a current block; when the coding mode of the current block is a MIP mode, a first offset is determined according to the size of the current block; calculating a second offset based on the first offset and a reconstructed value of a neighboring pixel corresponding to the current block; determining a first prediction value of the current block according to the second offset; determining a reconstructed value of the current block based on the first prediction value.

[0159] Those skilled in the art understand that embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present 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, etc.) containing computer-usable program code.

[0160] The present application is described with reference to the flowchart illustrations and / or block diagrams of the methods, apparatus (systems) and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart illustrations and / or block diagrams, and combinations of flows and / or blocks in the flowchart illustrations 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, special purpose computer, an 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 means for implementing the functions specified in the flowchart illustrations and / or block diagrams of the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0161] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions means which implement the function specified in the flowchart illustrations and / or block diagrams of the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0162] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams of the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0163] The above description is only the preferred embodiment of the present application, and is not intended to limit the protection scope of the present application.

Claims

1. An image encoding method applied to an encoder, the method comprising: Determine the size of the current block; When encoding the current block using the matrix-based intra-prediction MIP mode, a second offset is calculated based on the size of the current block, using a first offset and the reconstructed values ​​of the adjacent pixels corresponding to the current block; wherein, the first offset is a fixed value; the adjacent pixels include the row above and the column to the left of the current block; Using the second offset, a second predicted value for a pixel at a preset position in the current block is calculated; wherein, the preset position is a specific position in the current block; The second predicted value is filtered to obtain the first predicted value of all pixels in the current block; Calculate the prediction difference between the original value of the current block and the first predicted value; The prediction difference is encoded.

2. The method according to claim 1, wherein, The second offset is used to control the offset of the bit shift operation result during the calculation of the second predicted value.

3. An image decoding method, applied to a decoder, the method comprising: Decode the bitstream to obtain the size, encoding mode, and prediction difference of the current block; When the encoding mode of the current block is matrix-based intra-prediction (MIP) mode, a second offset is calculated based on the size of the current block using a first offset and the reconstructed values ​​of the adjacent pixels corresponding to the current block; wherein, the first offset is a fixed value; the adjacent pixels include the row above and the column to the left of the current block; Using the second offset, a second predicted value for a pixel at a preset position in the current block is calculated; wherein, the preset position is a specific position in the current block; The second predicted value is filtered to obtain the first predicted value of all pixels in the current block; Calculate the sum between the first predicted value and the prediction difference, and set the sum as the reconstruction value of the current block.

4. The method according to claim 3, wherein, The second offset is used to control the offset of the bit shift operation result during the calculation of the second predicted value.

5. An encoder, the encoder comprising: The first determining part, the first calculating part, and the encoding part. The first determining part is configured to determine the size of the current block; The first calculation part is configured to, when encoding the current block using a matrix-based intra-prediction MIP mode, calculate a second offset based on the size of the current block, using a first offset and the reconstructed values ​​of the adjacent pixels corresponding to the current block; wherein, the first offset is a fixed value; the adjacent pixels include the row above and the column to the left of the current block; The first determining part is further configured to calculate a second predicted value of a pixel at a preset position in the current block using the second offset; wherein the preset position is a specific position in the current block; and to filter the second predicted value to obtain the first predicted value of all pixels in the current block; The encoding portion is configured to calculate the prediction difference between the original value of the current block and the first predicted value; and to encode the prediction difference.

6. The encoder according to claim 5, wherein, The second offset is used to control the offset of the bit shift operation result during the calculation of the second predicted value.

7. A decoder, the decoder comprising: The analytical part, the second determining part, and the second calculation part. The parsing section is configured in the decoded bitstream to obtain the size, encoding mode, and prediction difference of the current block. The second calculation part, configured when the encoding mode of the current block is matrix-based intra-prediction (MIP) mode, calculates a second offset based on the size of the current block, using a first offset and the reconstructed values ​​of the adjacent pixels corresponding to the current block; wherein, the first offset is a fixed value; the adjacent pixels include the row above and the column to the left of the current block; The second determining part is configured to: calculate a second predicted value of a pixel at a preset position in the current block using the second offset; wherein the preset position is a specific position in the current block; and filter the second predicted value to obtain a first predicted value of all pixels in the current block; calculate the sum between the first predicted value and the prediction difference; and set the sum as the reconstructed value of the current block.

8. The decoder according to claim 7, wherein, The second offset is used to control the offset of the bit shift operation result during the calculation of the second predicted value.

9. 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 encoder implements the method as described in claim 1 or 2.

10. 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 claim 3 or 4.

11. A computer-readable storage medium storing a computer program / instructions and a code stream thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in claim 1 or 2 to generate the bitstream.

12. A method for transmitting a code stream, characterized in that, Generate a bitstream by performing the method of claim 1 or 2; and transmit the bitstream.

13. A method for receiving a code stream, characterized in that, Receive the bitstream and perform the method of claim 3 or 4 to decode the bitstream to generate a video or image.