Image encoding and decoding method, encoder, decoder and storage medium
By setting the correspondence between pre-stored index numbers and offsets in multi-functional video encoding, the encoding and decoding process of MIP mode is simplified, solving the problems of increased storage space and time, and improving encoding and decoding efficiency.
Patent Information
- Application Number
- CN202511891055.0
- 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
In multi-functional video coding, matrix-based intra-frame prediction (MIP) technology requires more storage space and increases encoding and decoding time due to the different parameters used for luma blocks of different sizes, thus reducing encoding and decoding efficiency.
By pre-setting the correspondence between the pre-stored index number and the offset, the first offset is determined according to the size of the current block, and the second offset and the prediction value are calculated using this offset, which simplifies the encoding and decoding process of MIP mode.
It reduces the complexity of MIP mode, reduces storage space and overall time, and improves encoding and decoding efficiency.
Smart Images

Figure CN121486575A_ABST
Abstract
Description
[0001] Case Analysis This application is a divisional application of the application filed on September 24, 2019, with application number 201980060144.7, entitled "Image Encoding and Decoding Method, Encoder, Decoder and Storage Medium". Technical Field
[0002] This application relates to the field of video encoding and decoding technology, and in particular to an image encoding and decoding method, encoder, decoder, and storage medium. Background Technology
[0003] In the reference software testbed for Versatile Video Coding (VVC), a novel intra-frame coding technique, Matrix-based Intra Prediction (MIP), was proposed. MIP is a neural network-based intra-frame prediction technique that uses a multi-layer neural network to predict the luminance value of the current block based on adjacent reconstructed luminance blocks. Specifically, similar to traditional intra-frame modes, when using MIP for intra-frame prediction, the input is the data from the previous row and left column of the adjacent luminance blocks, and the output is the first predicted value of the luminance component of the current block. The prediction process consists of three steps: downsampling, matrix-vector multiplication, and interpolation.
[0004] However, when performing brightness prediction using MIP mode, the parameters used for brightness blocks of different sizes may also be different. Therefore, a large amount of storage space is required to store a large number of parameters, and the lookup and retrieval of parameters during the prediction process also increases the overall time, thereby reducing the encoding and decoding efficiency. Summary of the Invention
[0005] This application provides an image encoding / decoding method, encoder, decoder, and storage medium, which can reduce the storage space and overall time required in the encoding / decoding process while ensuring encoding / decoding performance, thereby effectively improving encoding / decoding efficiency.
[0006] The technical solution of this application embodiment is implemented as follows: This application provides an image encoding method applied to an encoder, the method comprising: Determine 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; The second offset is calculated using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; Based on the second offset, determine the first predicted value of the current block; The current block is encoded based on the first predicted value.
[0007] This application provides an image decoding method applied to a decoder, the method comprising: Decode the bitstream to obtain the size and encoding mode of the current block; When the encoding mode of the current block is MIP mode, the first offset is determined according to the size of the current block; The second offset is calculated using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; Based on the second offset, determine the first predicted value of the current block; Based on the first predicted value, the reconstruction value of the current block is determined.
[0008] This application provides an encoder, which includes: a first determining part, a first calculating part, and an encoding part. The first determining part is configured to determine the size of the current block; and when encoding the current block using the MIP mode, to determine a first offset based on the size of the current block; The first calculation part 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 first determining portion is further configured to determine a first predicted value of the current block based on the second offset; The encoding portion is configured to encode the current block based on the first predicted value.
[0009] This application provides a decoder, which includes: a parsing part, a second determining part, and a second calculation part. The parsing section is configured in the decoded bitstream to obtain the size and encoding mode of the current block. The second determining part 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 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 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.
[0010] This application provides an encoder, which includes a first processor, a first memory storing instructions executable by the first processor, a first communication interface, and a first bus for connecting the first processor, the first memory, and the first communication interface. When the instructions are executed by the first processor, the image encoding method as described above is implemented.
[0011] This application provides a decoder, which includes a second processor, a second memory storing instructions executable by the second processor, a second communication interface, and a second bus for connecting the second processor, the second memory, and the second communication interface. When the instructions are executed by the second processor, the image decoding method as described above is implemented.
[0012] This application provides a computer-readable storage medium storing a program applied in an encoder and a decoder. When the program is executed by a processor, it implements the image encoding and decoding method described above.
[0013] This application provides an image encoding / decoding method, an encoder, a decoder, and a storage medium. The encoder determines the size of the current block; when encoding the current block using MIP mode, it determines a first offset based on the size of the current block; it calculates a second offset using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; it determines a first predicted value of the current block based on the second offset; and it encodes the current block based on the first predicted value. The decoder decodes the bitstream to obtain the size of the current block and the encoding mode; when the encoding mode of the current block is MIP mode, it determines the first offset based on the size of the current block; it calculates the second offset using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; it determines the first predicted value of the current block based on the second offset; and it determines the reconstructed value of the current block based on the first predicted value. Therefore, the image encoding and decoding method proposed in this application can directly determine the first offset corresponding to the current block based on the size of the current block when using the MIP mode for encoding and decoding. Then, the first offset can be used to perform encoding and decoding processing on the current block. In other words, in this application, based on the correspondence between the pre-stored index number and the offset, 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 decoding processing, and can reduce the storage space and overall time required in the decoding process while ensuring encoding and decoding performance, thus effectively improving encoding and decoding efficiency. Attached Figure Description
[0014] Figure 1 This is a schematic diagram showing the arrangement of the 67 prediction modes in intra-frame 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 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 should be 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 1This is a schematic diagram showing the arrangement of the 67 prediction modes in intra-frame prediction, as follows: Figure 1 As shown, arrows numbered 2-66 represent 65 intra-frame angular prediction modes. There are also two non-angular modes: the Planar mode (numbered 0) and the DC mode (numbered 1). Therefore, the intra-frame prediction process in VVC includes two non-angular modes and 65 angular modes. Here, these 67 prediction modes are referred to as the traditional intra-frame prediction modes.
[0018] MIP (Monthly In-Frame Prediction) is a neural network-based intra-frame prediction technique that uses a multi-layer neural network to predict the luminance value of the current block based on neighboring reconstructed pixels. Specifically, MIP categorizes luminance coding blocks into three types based on their size. Let the size of the luminance coding block be W×H, where W is the width parameter and H is the height parameter. According to the size of the luminance coding block, it can be divided into three categories: A luminance coding block of size 4×4 is classified as a first-class luminance block, luminance coding blocks of sizes 8×4, 4×8 and 8×8 are classified as second-class luminance blocks, and luminance coding blocks of other sizes are classified as third-class luminance blocks.
[0019] For these three types of intra-luminance coded blocks, the MIP technology adds M MIP modes to the 67 traditional intra-prediction modes. Specifically, 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-frame luminance prediction. Similar to traditional modes, the input to MIP prediction is the data from the row above and column to the left of the current block, and the output is the predicted value of the current block. The prediction process consists of three steps: averaging, matrix-vector multiplication, and interpolation. In other words, by performing these three operations on the reconstructed luminance values of the adjacent pixels in the row above and column to the left of the input, the predicted luminance component value of the current block can be obtained.
[0021] Figure 2 A flowchart illustrating the encoding process for MIP mode, as shown below. Figure 2 As shown, the specific implementation of brightness prediction in MIP mode is as follows: Step 1: Perform an averaging operation on the upper adjacent reference points of the current block to obtain the vector bdry. top There are N values in total; the vector bdry is obtained by averaging the left-adjacent reference points of the current block. left There are N values in total. When the current block is a first-class luminance coded block, N=2; when the current block is a second-class or third-class luminance coded block, N=4. Vector bdry top and vector bdry left Form a new vector bdry red And proceed with subsequent operations; Step 2: Obtain the corresponding matrix A using the mode number k of the MIP mode. k and offset b k The following formula (1) is used to calculate the result as follows: Figure 2 The partial predicted values of the current block, indicated by cross lines: (1) Step 3: Obtain the remaining predicted values Pred in the current block through linear interpolation. red .
[0022] It should be noted that the encoding process for the current block requires writing the specific encoding mode used for intra-frame prediction into the compressed bitstream. This allows the decoder to determine which mode is being used—whether it's a traditional mode or a MIP mode—by parsing the mode information. If it's a traditional mode, the specific traditional mode is specified; if it's a MIP mode, the specific MIP mode is specified.
[0023] In VVC's intra-frame prediction, the rate-distortion cost (RDcost) of 67 conventional modes and M MIP modes is compared for each luma coding block. The optimal mode is selected from the 67 conventional modes and M MIP modes and encoded. To save bit overhead, VVC uses intra-frame mode coding based on the Most Probable Modes List (MPM).
[0024] It is important to note that since the multiple reference line (MPL) technique and the intra sub-patterning (ISP) technique are only used for modes in the MPM list, when both extendrefflag and ispflag are 0, that is, when 0 reference lines are used and no sub-patterning is performed, there is no need to encode mpmflag; instead, the position of the optimal mode in the MPM list is directly encoded.
[0025] Furthermore, regarding the construction of the MPM list and MIPMPM list, in VVC luminance intra-frame prediction, if the optimal mode selected for the current block is the traditional mode, then an MPM list containing 6 most likely traditional modes needs to be constructed; if the optimal mode selected for the current block is the MIP mode, then an MIPMPM list containing 3 most likely MIP modes needs to be constructed.
[0026] Figure 3 This is a schematic diagram showing the arrangement of the upper and left adjacent brightness blocks of the current block, as shown below. Figure 3 As shown, both lists above are based on... Figure 3The optimal mode is derived from the upper adjacent luminance block (A) and the left adjacent luminance block (L) of the current block shown.
[0027] Furthermore, regarding the construction of the MIPMPM list, in VVC intra-frame prediction, if the optimal mode of the current block is MIP mode, then the MIPMPM list needs to be constructed. During the construction of the MIPMPM list, it is first necessary to obtain the MIP mode ABOVE_MIP corresponding to the optimal mode of the upper adjacent luma block and the MIP mode LEFT_MIP corresponding to the optimal mode of the left adjacent luma block.
[0028] Furthermore, after obtaining LEFT_MIP and ABOVE_MIP, a MIPMPM list containing the three most likely MIPMPM modes is constructed as follows: The numbers in MIPMPM are the numbers of the MIP modes, ranging from 0 to (M-1). For the first type of luma block, the numbers are 0-34; for the second type of luma block, the numbers are 0-18; and for the third type of luma block, the numbers are 0-10. If LEFT_MIP is available (not -1), add LEFT_MIP to MIPMPMlist; If ABOVE_MIP is available (not -1), add ABOVE_MIP to MIPMPMlist after passing the redundancy check; If LEFT_MIP is unavailable (-1) and ABOVE_MIP is unavailable (-1), the default list is added after redundancy checks based on the type of the current block until MIPMPMlist is full. The default list of the first type of brightness blocks is: {17, 34, 5}; The default list of the second type of brightness blocks is: {0, 7, 16}; The default list of the third type of brightness blocks is: {1, 4, 6}.
[0029] Furthermore, it should be added that in the intra-chroma prediction process of VVC, there is a Direct Mode (DM) that utilizes inter-component correlation. This mode uses the intra-prediction mode at the center position of the corresponding luma coding block to perform intra-prediction of the current chroma block. Figure 4 To determine the layout diagram of the DM pattern, as follows: Figure 4 As shown, since MIP technology is only applied to luma-coded blocks, when Figure 4 When the intra-prediction mode at the CR position is MIP mode, the MIP mode needs to be mapped to the traditional mode through the "MIP-Traditional Mapping Table" to perform intra-prediction of the current chroma block. 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 components such as a header information decoding and CABAC decoding module 201, an inverse transform and inverse quantization module 202, an intra-frame prediction module 203, a motion compensation module 204, a deblocking and SAO filtering module 205, and a decoded image buffer module 206. After the video image is processed by the transform and quantization module 101, the intra-frame estimation module 102, the intra-frame prediction module 103, the motion compensation module 104, the motion estimation module 105, the deblocking and SAO filtering module 108, and the header information encoding and CABAC encoding module 109 in the video encoding system 100, the bitstream of the video image is output. This bitstream is input into the video decoding system 200, and after being processed by the header information decoding and CABAC decoding module 201, the inverse transform and inverse quantization module 202, the intra-frame prediction module 203, and the motion compensation module 204 in the video decoding system 200, the original video image is finally recovered.
[0037] Based on the height and width parameters, the current block can have 25 sizes. Specifically, the standard specifies that the maximum size of the luminance block is 128×128. However, since the maximum size of the transformation unit is 64×64, a luminance block of 128×128 size must first undergo quadtree partitioning. Therefore, the maximum luminance block size is 64×64. Table 5 shows a schematic diagram of the luminance block sizes. Table 5
[0038] In the prior art, the MIP mode is restricted based on the height and width parameters of the current block. Specifically, if the aspect ratio of the current block is greater than 4, or the height-to-width ratio is greater than 4, then the current block is not encoded using the MIP mode. Table 6 shows the restrictions on the luma block size in the prior art under the MIP mode. Table 6
[0039] In existing technology, in the first type of luma block in MIP mode (corresponding to a 4×4 luma block), two adjacent upper and two adjacent left luma blocks are used to generate a 4×4 prediction block through matrix operations. In the second type of luma block in MIP mode (corresponding to 4×8, 8×4, and 8×8 luma blocks), four adjacent upper and four adjacent left luma blocks are used to generate a 4×4 prediction block through matrix operations. In the third type of luma block in MIP mode (corresponding to luma blocks of other sizes), four adjacent upper and four adjacent left luma blocks are used to generate a 4×8 prediction block (4×16 luma block), an 8×4 prediction block (16×4 luma block), or an 8×8 prediction block (luma blocks of other sizes) through matrix operations. Since the third type of luma block generates non-square prediction blocks, odd-numbered rows of the matrix need to be extracted during calculation.
[0040] Furthermore, in the syntax, MipSizeId represents the application category of MIP, i.e., MipSizeId is the index number of the MIP block size, numModes represents the number of MIP modes, boundarySize represents the number of luminance blocks in the upper reference row or left reference column obtained by downsampling, predW represents the width parameter of the prediction block, predH represents the height parameter of the prediction block, and predC represents the side length of the MIP matrix. Table 7 shows the syntactic relationship corresponding to MIP modes in the prior art. As shown in Table 7, MipSizeId, numModes, boundarySize, predW, predH, and predC in the syntax have the following relationships: Table 7
[0041] Furthermore, in the syntax, the MIP block size index number has a value of 0 for a 4×4 luma block, a value of 1 for 4×8, 8×4, and 8×8 luma blocks, and a value of 2 for other luma block sizes. `numModes` indicates the total number of MIP prediction modes: 35 for 4×4 luma blocks, 19 for 4×8, 8×4, and 8×8 luma blocks, and 11 for other sizes. `boundarySize` indicates that the adjacent luma blocks in the current block's upper row or left column are ultimately downsampled into 2 or 4 adjacent luma blocks.
[0042] In the prior art, when the encoder performs brightness prediction using the MIP mode, it can be done using the following formula (2): (2) Here, mWeight and vBias are the weight and bias matrices trained by deep learning for each MIP mode. Specifically, mWeight is the weight matrix for each MIP mode class, and vBias is the bias matrix for each MIP mode class. sB is the left shift of the bias matrix, oW is the rounded-off value, and sW is the right shift of the overall predicted value. The sW value for different MIP modes needs to be obtained by looking up a table.
[0043] Based on JVET-N1001-v7, when generating the prediction matrix of the MIP, the encoder uses variables... and To determine whether the predicted values for odd-numbered rows need to be extracted, the variable fO represents the value that needs to be subtracted from mWeight. Specifically: (3) (4) (5) If MipSizeId < 2, then (6) (7) otherwise (8) in, This means that extraction needs to be performed on either the width or height parameter.
[0044] Table 8 is a syntax description of sW in the prior art. As shown in Table 8, since the sW value in MIP mode is a mapping relationship, the sW value in all modes can be obtained through Table 8.
[0045] Table 8
[0046] Table 9 provides a syntactic description of fO in the prior art. As shown in Table 9, during the calculation of the MIP mode prediction value, the fO variable represents the value that needs to be subtracted from mWeight, and the fO values of different brightness blocks in different MIP modes need to be obtained by looking up the table. mWeight is the weight matrix of each MIP mode trained through deep learning.
[0047] As can be seen from the syntax description of fO in Table 9, the value of fO is related to both the size of the luma block and the mode number.
[0048] Table 9
[0049] Because the value of fO in Table 9 is related to both the luma block size and the mode number, meaning that the syntax description of fO is different in different MIP modes, when the encoder performs luma prediction through MIP modes, the value of fO may be different for the current coding block with different MipSizeId or different MIP mode number modeId. This will cause inconsistencies in the algorithm, and the process of querying Table 9 increases the time complexity of the algorithm. The storage of Table 9 also requires storage space.
[0050] It is evident that when performing brightness prediction using the MIP mode, existing technologies may employ different parameters for brightness blocks of different sizes. Consequently, a large amount of storage space is required to store a large number of parameters, and the lookup and retrieval of parameters during the prediction process also increases the overall time, thereby reducing encoding and decoding efficiency.
[0051] To address the aforementioned issues, this application proposes an image encoding method. On one hand, the encoder can ensure that the value of the current block's fO during encoding is only related to the size of the current block by setting pre-stored index numbers and offsets, i.e., by setting the correspondence between MipSizeId and fO. This makes the implementation of MIP more concise and unified. On the other hand, the correspondence between MipSizeId and fO can be stored using a one-dimensional array or a data structure with similar functionality, reducing dimensionality and saving storage space occupied by fO itself. Furthermore, when the encoder performs unified modifications and updates to fO, it can also use the updated fO to update the corresponding mWeight, thereby avoiding a decrease in encoding performance.
[0052] Furthermore, the image coding method proposed in this application can affect the intra-frame prediction part in the video coding hybrid framework, that is, it is mainly applied to the intra-frame prediction module 103 in video coding and the intra-frame prediction module 203 in video decoding, and has a simultaneous effect on the encoding end and the decoding end.
[0053] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0054] In one embodiment of this application, Figure 7 This is a schematic diagram illustrating the implementation process of an image encoding method, such as... Figure 7 As shown in the embodiments of this application, the method for image encoding by the encoder may include the following steps: Step 701: Determine the size of the current block.
[0055] In the embodiments of this application, the encoder can first determine the size of the current block, wherein the current block can be the current encoding block to be encoded. That is, the encoder can determine the specific size of the current block before encoding it.
[0056] Furthermore, in the embodiments of this application, the current block can be a luminance block to be encoded.
[0057] It should be noted that, in the embodiments of this application, the size of the current block can include 25 different sizes according to the height parameter H and width parameter W of the current block. Specifically, the standard specifies that the maximum size of the current block is 128×128, but since the maximum size of the transformation unit is 64×64, the current block must be partitioned into a quadtree at a size of 128×128. Therefore, the maximum size of the current block is 64×64.
[0058] Specifically, as shown in Table 5 above, the size (H×W) of the current block can include 25 dimensions: (4×4), (4×8), (4×16), (4×32), (4×64), (8×4), (8×8), (8×16), (8×32), (8×64), (16×4), (16×8), (16×16), (16×32), (16×64), (32×4), (32×8), (32×16), (32×32), (32×64), (64×4), (64×8), (64×16), (64×32), (64×64).
[0059] Step 702: When encoding the current block using MIP mode, determine the first offset based on the size of the current block.
[0060] In the embodiments of this application, when the encoder encodes the current block using the MIP mode, it can first determine the first offset corresponding to the current block based on the size of the current block. Specifically, based on the above formula (2), the first offset corresponding to the current block can be fO, representing the value that needs to be subtracted from the weight matrix mWeight.
[0061] It should be noted that, in the embodiments of this application, the encoder can set different first offsets for encoding processing for current blocks of different sizes. Specifically, the encoder can first determine the MIP block size index number corresponding to the current block based on the size of the current block, and then further determine the first offset corresponding to the current block based on the MIP block size index number.
[0062] Furthermore, in the embodiments of the application, the MIP block size index number of the current block is the MipSizeId determined according to the size of the current block, and the first offset of the current block is the parameter fO that needs to be subtracted from the mWeight of the current block.
[0063] It is understood that, in the embodiments of this application, when the encoder determines the MIP block size index number corresponding to the current block based on the current block size, it may specifically perform the following steps: (1) If the size of the current block is 4×4, then MipSizeId is 0; (2) If the size of the current block is 4×8, 8×4 or 8×8, then MipSizeId is 1; (3) If the size of the current block is otherwise, then MipSizeId is 2.
[0064] Furthermore, in the embodiments of this application, the encoder may pre-set the correspondence between MipSizeId and fO, that is, the encoder sets a pre-stored correspondence between index number and offset. Therefore, after the encoder determines the MIP block size index number corresponding to the current block, it can map and obtain the first offset corresponding to the current block based on the pre-stored correspondence between index number and offset.
[0065] It should be noted that, in the embodiments of this application, based on the correspondence between the pre-stored index number and the offset, for the same MIP block size index number, the corresponding first offset is also the same. That is to say, in the embodiments of this application, when the encoder encodes the current block using the MIP mode, the encoder can directly use the MIP block size index number corresponding to the current block to determine the first offset corresponding to the current block, so that the first offset can be further used for encoding processing.
[0066] In the embodiments of this application, furthermore, before encoding the current block according to the MIP mode, the encoder can first set the correspondence between the pre-stored index number and the offset. That is, the encoder needs to set different fO for different MipSizeIds.
[0067] Furthermore, in the embodiments of this application, when setting the correspondence between pre-stored index numbers and offsets, the encoder can set the fO corresponding to luminance blocks with the same MipSizeId to the same value. That is, in this application, the encoder can uniformly set the fO corresponding to luminance blocks with the same MipSizeId. For example, Table 10 shows the correspondence between pre-stored index numbers and offsets. As shown in Table 10, the encoder can directly set the same fO for the same MipSizeId, so that when encoding the current block, the encoder can directly determine the value of the corresponding first offset based on the MIP block size index number corresponding to the current block; for example, if the size of the current block is 4×4, then the encoder can determine that the MIP block size index number corresponding to the current block is 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 shows the second correspondence between pre-stored index numbers and offsets. As shown in Table 11, the encoder can directly set the same fO for the same MipSizeId, so that when the encoder encodes the current block, it can directly determine the value of the corresponding first offset based on the MIP block size index number corresponding to the current block. For example, if the size of the current block is 4×4, then the encoder can determine that the value of the MIP block size index number corresponding to the current block is 0. The encoder can then determine that the first offset corresponding to the current block is 34 based on the correspondence between MipSizeId and fO shown in Table 11.
[0070] Table 11
[0071] Therefore, compared with Table 9, Tables 10 and 11 in this application do not require the encoder to determine the first offset corresponding to the current block based on the values of the two variables MipSizeId and MIP mode number modeId. Instead, the encoder can obtain the first offset corresponding to the current block based on only the MipSizeId parameter. This reduces the computational complexity and saves the storage overhead of storing a two-dimensional table for fO, as shown in Table 9.
[0072] Furthermore, in the embodiments of this application, when the encoder sets the correspondence between the pre-stored index sequence number and the offset, it can first determine the fO with the largest value among the fOs corresponding to different MIP mode numbers modeId with 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 that 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 mode number modeId is 15. Therefore, the encoder can set the fO corresponding to all mode numbers modeId with MipSizeId 0 to 66, that is, establish a 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 mode number modeId is 3. Therefore, The encoder can set the fO corresponding to all mode numbers (modeId) with MipSizeId = 1 to 45, thus establishing a correspondence between MipSizeId = 1 and fO = 45. Correspondingly, based on the original fO syntax description shown in Table 9, it can be determined that when MipSizeId = 2, the largest fO value is 46 when mode number (modeId) = 1. Therefore, the encoder can set the fO corresponding to all mode numbers (modeId) with MipSizeId = 2 to 46, thus establishing a correspondence between MipSizeId = 2 and fO = 46. This yields Table 10 above.
[0073] Specifically, before the encoder obtains fO using Tables 10 and 11 above, it does not need to determine the MipSizeId and modeId corresponding to the current block at the same time. It only needs to determine the MipSizeId using the size of the current block to obtain the fO corresponding to the current block.
[0074] It is understood that in the embodiments of this application, since the correspondence between MipSizeId and fO shown in Table 10 above is a one-dimensional array, the encoder can use a one-dimensional array or a data structure with similar function to store the correspondence between MipSizeId and fO. Compared with Table 9 above, the dimension of the array is reduced, saving the storage space occupied by the array itself.
[0075] Step 703: Calculate the second offset using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block.
[0076] In the embodiments of this application, after the encoder determines the first offset based on the size of the current block, it can calculate the second offset using the first offset and the reconstructed values of the adjacent 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 a rounded value, which can be calculated using the above formula (3).
[0077] It should be noted that, in the embodiments of this application, after the encoder determines the MIP block size index number corresponding to the current block based on the current block size, and determines the first offset corresponding to the current block based on the correspondence between the pre-stored index number and the offset, it can calculate the second offset corresponding to the current block using the first offset based on the above formula (3). Specifically, when determining the second offset, the encoder also needs to use the reconstructed values of the adjacent pixels corresponding to the current block for calculation.
[0078] Step 704: Determine the first predicted value of the current block based on the second offset.
[0079] In the embodiments of this application, after the encoder calculates the second offset based on the first offset and the reconstructed values of the adjacent pixels corresponding to the current block, it can determine the first predicted value corresponding to the current block based on the second offset.
[0080] It should be noted that, in the embodiments of this application, when the encoder determines the first predicted value of the current block based on the second offset, it can first calculate the second predicted value of the pixel at the preset position in the current block using the second offset; then the second predicted value can be filtered to obtain the first predicted value of all pixels in the current block.
[0081] Furthermore, in the embodiments of this application, the preset position can be a specific position in the current block; specifically, the preset position can be a specific position of some pixels in the current block. That is to say, in this application, the encoder calculates the second predicted value using the second offset, not the predicted value of all pixels in the current block, but the predicted value of some pixels at specific positions in the current block.
[0082] It should be noted that, in the embodiments of this application, after the encoder calculates the second predicted value of some specific position pixels in the current block through the second offset, it can filter the second predicted value to obtain the predicted value of all pixels in the current block, that is, obtain the first predicted value corresponding to the current block.
[0083] It is understood that, in the embodiments of this application, the second offset can be used to control the offset of the bit shift operation during the calculation of the second predicted value.
[0084] Step 705: Encode the current block based on the first predicted value.
[0085] In the embodiments of this application, after the encoder determines the first prediction value of the current block according to the second offset, it can encode the current block based on the first prediction value, thereby obtaining the bitstream corresponding to the current block.
[0086] Furthermore, in the embodiments of this application, when the encoder encodes the current block based on the first predicted value, it can first calculate the prediction difference between the original value of the current block and the first predicted value, and then encode the prediction difference.
[0087] It should be noted that in the embodiments of this application, when the encoder encodes the current block, it does not directly encode the first predicted value of the current block. Instead, it determines the difference between the first predicted value and the original value corresponding to the current block, i.e., the prediction difference, and then encodes the prediction difference, thereby effectively improving the encoding and decoding efficiency.
[0088] This application provides an image encoding method in which the encoder determines the size of the current block; when encoding the current block using the 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 the 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.
[0089] Based on the above embodiments, in another embodiment of this application, since the encoder has a pre-stored correspondence between index numbers and offsets, when encoding the current block, the encoder only needs to determine the MIP block size index number corresponding to the current block based on the size of the current block, and can then use the pre-stored correspondence between index numbers and offsets to determine the corresponding first offset. In other words, in this application, based on the pre-stored correspondence between index numbers and offsets, the encoder can directly determine the value of fO based on MipSizeId, without needing to determine the value of fO based on the values of the two variables MipSizeId and modeId, thereby greatly reducing computational complexity and saving the storage overhead of the two-dimensional table used to store the correspondence between MipSizeId, modeId, and fO.
[0090] In other words, in the prior art, fO in the above formula (2) represents the value that mWeight needs to be subtracted, and the fO value of the current block can only be obtained by looking up the correspondence between MipSizeId, modeId, and fO as shown in Table 9 above. It can be seen that the value of fO is related to the size of the current block and the mode number, which causes inconsistency in the algorithm. At the same time, storing the correspondence between MipSizeId, modeId, and fO as shown in Table 9 above also requires a lot of storage space. In contrast, the present application only needs to store the correspondence between MipSizeId and fO, and for the same MipSizeId, even if the modeId is different, the corresponding fO value is the same, thus saving storage space and reducing the complexity of the operation.
[0091] Specifically, in the embodiments of this application, the syntax of the prediction calculation process of MIP is simplified, and the fO of the same MipSizeId is uniformly modified, that is, the corresponding fO can be determined only based on the size of the current block.
[0092] In the embodiments of this application, when the encoder simplifies the syntax of the prediction calculation process of MIP, it can also directly set the fO corresponding to any luma block with different MipSizeId and different modeId to the same value. That is, fO is a fixed value, the correlation between the size of the luma block and fO is eliminated, fO in all cases is defined as a uniform value, and the table related to fO is no longer stored. This can further reduce the complexity of the MIP algorithm, reduce the storage space of the algorithm, and make the implementation and syntax of MIP technology more concise and unified.
[0093] In the embodiments of this application, further, to avoid loss of coding performance, the encoder needs to modify the value of mWeight accordingly while uniformly modifying fO. Specifically, after setting the correspondence between the pre-stored index 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, it can add the updated fO to each original weight value in the original mWeight corresponding to the current block's mWeight, thereby keeping the coding performance completely unchanged. In other words, the encoder can simultaneously use fO to update mWeight accordingly, thereby reducing storage space and computational complexity while maintaining essentially unchanged coding performance and prediction calculation results.
[0094] It should be noted that, in the embodiments of this application, when the encoder updates mWeight using fO, if there is a weight value in the updated mWeight that is greater than a preset weight threshold, the weight value can be set to be less than or equal to the preset weight threshold. For example, if the encoder sets the preset weight threshold to the upper limit of a 7-bit binary number, 127, and there is a weight value in the updated mWeight that is greater than 127, then the weight value greater than 127 can be modified to be less than or equal to the preset weight threshold by clamping, such as setting it to 127.
[0095] Furthermore, in the embodiments of this application, if a weight value greater than a preset weight threshold appears in the updated mWeight, the method of reducing sW can be used to keep all weight values in the updated mWeight within the range of the preset weight threshold.
[0096] Furthermore, in the embodiments of this application, in order to better maintain coding performance, the pseudocode shown in formula (9) can also be used to calculate. The value of the parameter, that is, replacing formula (6) with formula (9), can be understood as follows: the calculation method of formula (9) can reduce the dynamic range of the data in the MIP matrix: (9) For example, for a luma block with a MipSizeId value of 0, before the unified modification of fO, the initial fO syntax description is shown in Table 12 below. The value of fO is different for different MIP mode numbers modeId.
[0097] Table 12
[0098] Where fO is 21 when modeId is 1, the corresponding mWeight is shown in Table 13 below. Table 13
[0099] Based on Table 12 above, using fO which takes the value 21 when modeId is 1, we can obtain the original mWeight corresponding to modeId being 1. Specifically, we can subtract 21 from each weight value in Table 13 above to obtain the corresponding original mWeight as shown in Table 14 below. Table 14
[0100] In the embodiments of this application, when updating the original mWeight corresponding to mWeight, in order to reduce the dynamic range of the data in the MIP matrix, the encoder replaces formula (6) with formula (9).
[0101] Table 15
[0102] Specifically, it is necessary to invert the first column of all original mWeight values corresponding to the MIP mode numbers (modeId) of all luma blocks with MipSizeId values of 0 and 1. For example, based on the above as shown in Table 14, after inverting the weight values in the first column, the preliminary updated mWeight values are shown in Table 15.
[0103] Since the largest fO value in Table 12 is 34, which has a MIP mode number modeId of 0, the encoder can directly set the fO of all luma blocks with MipSizeId of 0 to 34 when uniformly modifying fO. The syntax description of the updated fO is shown in Table 16 below. Table 16
[0104] Simultaneously, the encoder can continue to update the initial update mWeight of the luma block with MIP mode number modeId = 1 using fO with a value of 34. That is, based on Table 15 above, 34 is added to each weight value in Table 15, thus obtaining the updated mWeight as shown in Table 17. Table 17
[0105] Understandably, during this process, if a weight value greater than the preset weight threshold appears in the updated mWeight, the weight value can be clamped to within the range of the preset weight threshold, or the sW can be reduced to keep all weight values in the updated mWeight within the range of the preset weight threshold.
[0106] As can be understood from the above description, in this application, on the one hand, the encoder can achieve the following: by setting the pre-stored index number and offset, that is, by setting the correspondence between MipSizeId and fO, the value of the current block fO during encoding is only related to the size of the current block, thereby making the implementation of MIP more concise and unified; on the other hand, the correspondence between MipSizeId and fO can be stored using a one-dimensional array or a data structure with similar functions, reducing dimensionality and saving the storage space occupied by fO itself; furthermore, when the encoder makes unified modifications and updates to fO, it can also use the updated fO to update the corresponding mWeight, thereby avoiding the reduction of encoding performance.
[0107] This application provides an image encoding method in which the encoder determines the size of the current block; when encoding the current block using the 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 the 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.
[0108] In another embodiment of this application, Figure 8 This is a schematic diagram illustrating the implementation process of the image decoding method, such as... Figure 8 As shown in the embodiments of this application, the method for the decoder to perform image decoding may include the following steps: Step 801: Decode the bitstream to obtain the size and encoding mode of the current block.
[0109] In the embodiments of this application, the decoder can first determine the size and encoding mode of the current block. The current block can be the current encoded block to be decoded. That is, before decoding the current block, the decoder can first determine the specific size and encoding mode of the current block.
[0110] It should be noted that, in the embodiments of this application, the encoding mode of the current block can be one of 67 traditional intra-frame prediction modes or MIP mode.
[0111] Furthermore, in the embodiments of this application, the current block can be a luminance block to be decoded.
[0112] It should be noted that, in the embodiments of this application, the size of the current block can include 25 different sizes according to the height parameter H and width parameter W of the current block. Specifically, the standard specifies that the maximum size of the current block is 128×128, but since the maximum size of the transformation unit is 64×64, the current block must be partitioned into a quadtree at a size of 128×128. Therefore, the maximum size of the current block is 64×64.
[0113] Step 802: When the encoding mode of the current block is MIP mode, determine the first offset based on the size of the current block.
[0114] In the embodiments of this application, after the decoder determines that the encoding mode of the current block is MIP mode, it can first determine the first offset corresponding to the current block based on the size of the current block. Specifically, based on the above formula (2), the first offset corresponding to the current block can be fO, representing the value that needs to be subtracted from mWeight.
[0115] It should be noted that, in the embodiments of this application, the decoder can set different first offsets for decoding different sizes of the current block. Specifically, the decoder can first determine the MIP block size index number corresponding to the current block based on the size of the current block, and then further determine the first offset corresponding to the current block based on the MIP block size index number.
[0116] Furthermore, in the embodiments of the application, the MIP block size index number of the current block is the MipSizeId determined according to the size of the current block, and the first offset of the current block is the parameter fO that needs to be subtracted from the mWeight of the current block.
[0117] It is understood that, in the embodiments of this application, when the decoder determines the MIP block size index number corresponding to the current block based on the current block size, it may specifically perform the following steps: (1) If the size of the current block is 4×4, then MipSizeId is 0; (2) If the size of the current block is 4×8, 8×4 or 8×8, then MipSizeId is 1; (3) If the size of the current block is otherwise, then MipSizeId is 2.
[0118] Furthermore, in the embodiments of this application, the decoder may pre-set the correspondence between MipSizeId and fO, that is, the decoder sets a pre-stored correspondence between index number and offset. Therefore, after the decoder determines the MIP block size index number corresponding to the current block, it can map and obtain the first offset corresponding to the current block based on the pre-stored correspondence between index number and offset.
[0119] It should be noted that, in the embodiments of this application, based on the correspondence between the pre-stored index number and the offset, for the same MIP block size index number, the corresponding first offset is also the same. That is to say, in the embodiments of this application, when the decoder uses the MIP mode to decode the current block, the decoder can directly use the MIP block size index number corresponding to the current block to determine the first offset corresponding to the current block, so that the first offset can be further used for decoding processing.
[0120] In the embodiments of this application, furthermore, before decoding the current block according to the MIP mode, the decoder can first set the correspondence between the pre-stored index number and the offset. That is, the decoder needs to set different fO for different MipSizeIds.
[0121] Furthermore, in the embodiments of this application, when setting the correspondence between pre-stored index numbers and offsets, the decoder can set the fO corresponding to luminance blocks with the same MipSizeId to the same value. That is, in this application, the decoder can uniformly set the fO corresponding to luminance blocks with the same MipSizeId. For example, in Table 10 above, if the size of the current block is 4×4, the decoder can determine that the MIP block size index number corresponding to the current block is 0, and the decoder can determine the first offset corresponding to the current block as 66 through the correspondence between MipSizeId and fO shown in Table 10; in Table 11 above, if the size of the current block is 4×4, the decoder can determine that the MIP block size index number corresponding to the current block is 0, and the encoder can determine the first offset corresponding to the current block as 34 through the correspondence between MipSizeId and fO shown in Table 11.
[0122] Therefore, compared with Table 9, Tables 10 and 11 in this application show that when the decoder determines the first offset corresponding to the current block, it no longer needs to determine the first offset corresponding to the current block based on the values of the two variables MipSizeId and MIP mode number modeId. Instead, it can obtain the first offset corresponding to the current block based on only the MipSizeId parameter. This reduces the computational complexity and saves the storage overhead of storing a two-dimensional table for storing fO, as exemplified in Table 9.
[0123] Furthermore, in the embodiments of this application, when the decoder sets the correspondence between the pre-stored index sequence number and the offset, it can first determine the fO with the largest value among the fOs corresponding to different MIP mode numbers modeId with 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 that 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 mode number modeId is 15. Therefore, the decoder can set all fOs corresponding to mode numbers modeId with MipSizeId of 0 to 66, that is, establish a correspondence between MipSizeId of 0 and fO of 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 mode number modeId is 3. Therefore, The decoder can set the fO corresponding to all mode numbers (modeId) with MipSizeId = 1 to 45, thus establishing a 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 = 2, the largest fO value is 46 when mode number (modeId) = 1. Therefore, the decoder can set the fO corresponding to all mode numbers (modeId) with MipSizeId = 2 to 46, thus establishing a correspondence between MipSizeId = 2 and fO = 46. This yields Table 10 above.
[0124] Specifically, before the decoder obtains fO using Tables 10 and 11 above, it does not need to determine the MipSizeId and modeId corresponding to the current block at the same time. It only needs to determine the MipSizeId using the size of the current block to obtain the fO corresponding to the current block.
[0125] It is understood that in the embodiments of this application, since the correspondence between MipSizeId and fO shown in Table 10 above is a one-dimensional array, the decoder can use a one-dimensional array or a data structure with similar function to store the correspondence between MipSizeId and fO. Compared with Table 9 above, the dimension of the array is reduced, saving the storage space occupied by the array itself.
[0126] Step 803: Calculate the second offset using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block.
[0127] In the embodiments of this application, after the decoder determines the first offset based on the size of the current block, it can calculate the second offset using the first offset and the reconstructed values of the adjacent 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 that controls the bit shift operation. For example, oW in the above formula (2) is the rounded value, which can be calculated by the above formula (3).
[0128] It should be noted that, in the embodiments of this application, after the decoder determines the MIP block size index number corresponding to the current block based on the current block size, and determines the first offset corresponding to the current block based on the pre-stored index number and offset correspondence, it can calculate the second offset corresponding to the current block using the first offset based on the above formula (3). Specifically, when determining the second offset, the decoder also needs to use the reconstructed values of the adjacent pixels corresponding to the current block for calculation.
[0129] Step 804: Determine the first predicted value of the current block based on the second offset.
[0130] In the embodiments of this 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, it can determine the first predicted value corresponding to the current block based on the second offset.
[0131] It should be noted that, in the embodiments of this application, when the decoder determines the first predicted value of the current block based on the second offset, it can first calculate the second predicted value of the pixel at the preset position in the current block using the second offset; then it can filter the second predicted value to obtain the first predicted value of all pixels in the current block.
[0132] Furthermore, in the embodiments of this application, the preset position can be a specific position in the current block; specifically, the preset position can be a specific position of some pixels in the current block. That is to say, in this application, the decoder calculates the second predicted value using the second offset, not the predicted value of all pixels in the current block, but the predicted value of some pixels at specific positions in the current block.
[0133] It should be noted that, in the embodiments of this application, after the decoder calculates the second predicted value of some specific pixels in the current block using the second offset, it can filter the second predicted value to obtain the predicted value of all pixels in the current block, that is, to obtain the first predicted value corresponding to the current block.
[0134] It is understood that, in the embodiments of this application, the second offset can be used to control the offset of the bit shift operation during the calculation of the second predicted value.
[0135] Step 805: Decode the current block based on the first prediction value.
[0136] In the embodiments of this application, after the decoder determines the first prediction value of the current block based on the second offset, it can perform decoding processing on the current decoded block based on the first prediction value, thereby obtaining the bitstream corresponding to the current block.
[0137] Furthermore, in the embodiments of this application, when the decoder decodes the current block based on the first predicted value, it can first calculate the prediction difference between the original value of the current block and the first predicted value, and then decode the prediction difference.
[0138] It should be noted that, in the embodiments of this application, when the decoder decodes the current block, it does not directly decode the first predicted value of the current block. Instead, it determines the difference between the first predicted value and the original value corresponding to the current block, i.e., the prediction difference, and then decodes the prediction difference, thereby effectively improving the encoding and decoding efficiency.
[0139] Furthermore, in the embodiments of this application, before the decoder determines the reconstructed value of the current block based on the first prediction value, it can first obtain the prediction difference of the current block by decoding the bitstream.
[0140] Accordingly, in the embodiments of this application, after determining the prediction difference of the current block and the first prediction value of the current block, the decoder can directly calculate the sum between the first prediction value and the prediction difference, and set the sum as the reconstructed value of the current block. That is, when the decoder determines the reconstructed value of the current block based on the first prediction value, it can perform an addition operation on the first prediction value and the prediction difference to obtain the reconstructed value of the current block, thereby completing the decoding process of the current block.
[0141] This application provides an image decoding method. A decoder decodes the bitstream to obtain the size and encoding mode of the current block. When the encoding mode of the current block is 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. A reconstructed value of the current block is determined based on the first predicted value. Therefore, the image decoding method proposed in this application, when using MIP mode for decoding, can directly determine the first offset corresponding to the current block based on the size of the current block. Then, the first offset can be used to decode 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 decoding, and while ensuring decoding performance, it reduces the storage space and overall time required during the decoding process, effectively improving decoding efficiency.
[0142] Based on the above embodiments, in another embodiment of this application, Figure 9 Schematic diagram of encoder structure Figure 1 ,like Figure 9 As shown, the encoder 300 proposed in this application embodiment may include a first determining part 301, a first calculating part 302, and an encoding part 303.
[0143] The first determining portion 301 is configured to determine the size of the current block; and when encoding the current block using the MIP mode, to determine a first offset based on the size of the current block; The first calculation unit 302 is configured to calculate a second offset using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; The first determining portion 301 is further configured to determine a first predicted value of the current block based on the second offset; The encoding portion 303 is configured to encode the current block based on the first predicted value.
[0144] Figure 10 Schematic diagram of encoder structure Figure 2 ,like Figure 10 As shown, the encoder 300 proposed in this application embodiment may further include a first processor 304, a first memory 305 storing executable instructions of the first processor 304, a first communication interface 306, and a first bus 307 for connecting the first processor 304, the first memory 305, and the first communication interface 306.
[0145] Further, in an embodiment of this application, the first processor 304 is configured to determine the size of the current block; when encoding the current block using the MIP mode, determine a first offset based on the size of the current block; calculate a second offset using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; determine a first prediction value of the current block based on the second offset; and encode the current block based on the first prediction value.
[0146] Furthermore, in this embodiment, the functional modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0147] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[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 this application, the second processor 404 is used to decode the bitstream to obtain the size and encoding mode of the current block; when the encoding mode of the current block is MIP mode, a first offset is determined according to 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 prediction value of the current block is determined according to the second offset; and a reconstructed value of the current block is determined based on the first prediction value.
[0153] Furthermore, in this embodiment, the functional modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0154] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0155] This application provides a decoder that decodes a bitstream to obtain the size and encoding mode of the current block. When the encoding mode of the current block is 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. A reconstructed value of the current block is determined based on the first predicted value. Therefore, the image decoding method proposed in this application, when using MIP mode for decoding, 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 perform decoding processing on 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 decoding processing, and while ensuring decoding performance, it reduces the storage space and overall time required during the decoding process, effectively improving decoding efficiency.
[0156] This application provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the methods described in the above embodiments.
[0157] Specifically, the program instructions corresponding to an image encoding method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to an image encoding method in the storage media are read or executed by an electronic device, the following steps are implemented: Determine 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; The second offset is calculated using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; Based on the second offset, determine the first predicted value of the current block; The current block is encoded based on the first predicted value.
[0158] Specifically, the program instructions corresponding to an image decoding method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to an image decoding method in the storage media are read or executed by an electronic device, the following steps are implemented: Decode the bitstream to obtain the size and encoding mode of the current block; When the encoding mode of the current block is MIP mode, the first offset is determined according to the size of the current block; The second offset is calculated using the first offset and the reconstructed values of the adjacent pixels corresponding to the current block; Based on the second offset, determine the first predicted value of the current block; Based on the first predicted value, the reconstruction value of the current block is determined.
[0159] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0160] This application is described with reference to schematic and / or block diagrams of implementations of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the schematic and / or block diagrams can be implemented by computer program instructions, and combinations of blocks in the schematic and / or block diagrams can be implemented. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the schematic and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the implementation flow diagram. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0163] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this 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; Interpolate the second predicted value to obtain the first predicted value for 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; Interpolate the second predicted value to obtain the first predicted value for 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 portion is further configured to calculate a second predicted value for 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 interpolate the second predicted value to obtain the first predicted value for 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; interpolate 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.