Encoding method, decoding method, encoder, decoder, and storage medium
By using the gradient information of more reference areas to derive the intra-frame prediction mode at the decoding end, the problem of inaccurate prediction caused by insufficient gradient information in the existing technology is solved, and more accurate intra-frame prediction is achieved.
Patent Information
- Application Number
- PCT/CN2024/087096
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2025-10-16
AI Technical Summary
In the prior art, the intra prediction modes derived by the decoding-end intra mode derivation (DIMD) mode based on the gradient information of adjacent samples of the current block are not rich enough, resulting in inaccurate prediction results.
By utilizing more reference areas or reconstructed samples to determine gradient information, including adjacent samples in the four left columns, four upper rows, five left columns, five upper rows, or a larger range of the current block, richer gradient information is calculated to derive a more accurate intra prediction mode.
Improved the accuracy of intra-frame prediction mode to generate more accurate prediction values.
Smart Images

Figure CN2024087096_16102025_PF_FP_ABST
Abstract
Description
Coding method, coder and storage medium TECHNICAL FIELD
[0001] The present application relates to the technical field of video coding, and in particular to a coding method, a coder and a storage medium. BACKGROUND
[0002] The decoder-side intra mode derivation (DIMD) mode is an effective intra prediction mode. In the related art, the DIMD mode derives a dominant intra prediction mode based on gradient information of neighboring samples of a current block, so as to determine a prediction value of the current block. However, the gradient information obtained by the DIMD mode is not rich enough, resulting in an inaccurate prediction result.
[0003] SUMMARY
[0004] Embodiments of the present application provide a coding method, a coder and a storage medium to improve the accuracy of prediction. Each aspect of the present application is described below.
[0005] In a first aspect, a decoding method is provided, applied to a decoder, including: determining gradient information according to at least one reconstructed sample around a current block; determining a first intra prediction mode according to the gradient information; determining a prediction block of the current block according to the first intra prediction mode; and determining a reconstructed block of the current block according to the prediction block of the current block.
[0006] In a second aspect, an encoding method is provided, applied to an encoder, including: determining gradient information according to at least one reconstructed sample around a current block; determining a first intra prediction mode according to the gradient information; determining a prediction block of the current block according to the first intra prediction mode; and determining a residual block of the current block according to the prediction block of the current block.
[0007] In a third aspect, a decoding method is provided, applied to a decoder, including: parsing a bitstream to determine a reference template of a current block; determining a first mode parameter according to the reference template of the current block; determining a first intra prediction mode of the current block according to the first mode parameter; determining a prediction value of the current block according to the first intra prediction mode; and determining a reconstructed block of the current block according to the prediction value of the current block.
[0008] In a fourth aspect, a decoding method is provided, which is applied to a decoder and includes: determining a candidate intra prediction mode set of a current block according to reconstructed samples of a picture in which the current block is located; determining a first intra prediction mode of the current block according to the candidate intra prediction mode set; determining a prediction value of the current block according to the first intra prediction mode; and determining a reconstructed block of the current block according to the prediction value of the current block.
[0009] In a fifth aspect, an encoding method is provided, which is applied to an encoder and includes: determining a reference template of a current block; determining a candidate intra prediction mode set of the current block according to the reference template; determining a first intra prediction mode of the current block according to the candidate intra prediction mode set; determining a prediction value of the current block according to the first intra prediction mode; and encoding the current block according to the prediction value of the current block.
[0010] In a sixth aspect, a decoder is provided, which includes: a first determining module configured to determine gradient information according to at least one reconstructed sample around a current block; a second determining module configured to determine a first intra prediction mode according to the gradient information; a third determining module configured to determine a prediction block of the current block according to the first intra prediction mode; and a fourth determining module configured to determine a reconstructed block of the current block according to the prediction block of the current block.
[0011] In a seventh aspect, an encoder is provided, which includes: a first determining module configured to determine gradient information according to at least one reconstructed sample around a current block; a second determining module configured to determine a first intra prediction mode according to the gradient information; a third determining module configured to determine a prediction block of the current block according to the first intra prediction mode; and a fourth determining module configured to determine a residual block of the current block according to the prediction block of the current block.
[0012] In an eighth aspect, a decoder is provided, which includes: a parsing module configured to parse a bitstream and determine a reference template of a current block; a first determining module configured to determine a first mode parameter according to the reference template of the current block; a second determining module configured to determine a first intra prediction mode of the current block according to the first mode parameter; a third determining module configured to determine a prediction value of the current block according to the first intra prediction mode; and a fourth determining module configured to determine a reconstructed block of the current block according to the prediction value of the current block.
[0013] In a ninth aspect, a decoder is provided, comprising: a first determining module configured to determine a candidate intra prediction mode set of a current block according to reconstructed samples of a picture in which the current block is located; a second determining module configured to determine a first intra prediction mode of the current block according to the candidate intra prediction mode set; a third determining module configured to determine a prediction value of the current block according to the first intra prediction mode; and a fourth determining module configured to determine a reconstructed block of the current block according to the prediction value of the current block.
[0014] In a tenth aspect, an encoder is provided, comprising: a first determining module configured to determine a reference template of a current block; a second determining module configured to determine a candidate intra prediction mode set of the current block according to the reference template; a third determining module configured to determine a first intra prediction mode of the current block according to the candidate intra prediction mode set of the current block; a fourth determining module configured to determine a prediction value of the current block according to the first intra prediction mode; and an encoding module configured to encode the current block according to the prediction value of the current block.
[0015] In an eleventh aspect, a decoder is provided, wherein the encoder comprises: a memory configured to store a computer program; and a processor configured to execute the computer program to perform the method of the first aspect, the third aspect, or the fourth aspect.
[0016] In a twelfth aspect, an encoder is provided, wherein the encoder comprises: a memory configured to store a computer program; and a processor configured to execute the computer program to perform the method of the second aspect or the fifth aspect.
[0017] In a thirteenth aspect, a computer readable storage medium is provided, wherein the computer readable storage medium stores a computer program, and the computer program is executed to implement the method of any one of the first aspect to the fifth aspect.
[0018] In a fourteenth aspect, a computer program product is provided, comprising a computer program, and the computer program is executed to implement the method of any one of the first aspect to the fifth aspect.
[0019] In a fifteenth aspect, a non-volatile computer readable storage medium storing a bitstream is provided, wherein the bitstream is generated by using an encoding method of an encoder, or the bitstream is decoded by using a decoding method of a decoder, wherein the decoding method is the method of the second aspect or the fifth aspect, and the encoding method is the method of the first aspect, the third aspect, or the fourth aspect.
[0020] The embodiments of the present application determine gradient information by using more reference regions or reconstructed samples, thereby improving the prediction accuracy of the DIMD mode. BRIEF DESCRIPTION OF DRAWINGS
[0021] FIG. 1 is a schematic diagram of a structure of a video encoder to which embodiments of the present application can be applied.
[0022] FIG. 2 is a schematic diagram of a structure of a video decoder to which embodiments of the present application can be applied.
[0023] FIG. 3 is a schematic diagram of a prediction process of a DIMD mode.
[0024] FIG. 4 is an example diagram of a determination manner of a prediction value of a DIMD mode.
[0025] FIG. 5 is an example diagram of a manner of generating a prediction block of a DIMD mode.
[0026] FIG. 6 is a schematic diagram of a flow of a decoding method provided by an embodiment of the present application.
[0027] FIG. 7 is an example diagram of a reference region provided by an embodiment of the present application.
[0028] FIG. 8A is another example diagram of a reference region provided by an embodiment of the present application.
[0029] FIG. 8B is another example diagram of a reference region provided by an embodiment of the present application.
[0030] FIG. 8C is another example diagram of a reference region provided by an embodiment of the present application.
[0031] FIG. 9 is another example diagram of a reference region provided by an embodiment of the present application.
[0032] FIG. 10 is another example diagram of a reference region provided by an embodiment of the present application.
[0033] FIG. 11 is another example diagram of a reference region provided by an embodiment of the present application.
[0034] FIG. 12A is another example diagram of a reference region provided by an embodiment of the present application.
[0035] FIG. 12B is another example diagram of a reference region provided by an embodiment of the present application.
[0036] FIG. 13A is another example diagram of a reference region provided by an embodiment of the present application.
[0037] FIG. 13B is another example diagram of a reference region provided by an embodiment of the present application.
[0038] FIG. 13C is another example diagram of a reference region provided by an embodiment of the present application.
[0039] FIG. 14 is a schematic diagram of a flow of a decoding method provided by another embodiment of the present application.
[0040] FIG. 15 is a flowchart illustrating a decoding method according to another embodiment of the present application.
[0041] FIG. 16 is a flowchart illustrating an encoding method according to an embodiment of the present application.
[0042] FIG. 17 is a flowchart illustrating an encoding method according to another embodiment of the present application.
[0043] FIG. 18 is a flowchart illustrating a decoding method according to another embodiment of the present application.
[0044] FIG. 19 is a flowchart illustrating an implementation of step S2 in FIG. 18.
[0045] FIG. 20 is a schematic diagram illustrating a structure of a decoder according to an embodiment of the present application.
[0046] FIG. 21 is a schematic diagram illustrating a structure of a decoder according to another embodiment of the present application.
[0047] FIG. 22 is a schematic diagram illustrating a structure of an encoder according to an embodiment of the present application.
[0048] FIG. 23 is a schematic diagram illustrating a structure of an encoder according to another embodiment of the present application.
[0049] FIG. 24 is a schematic diagram illustrating a structure of a decoder according to another embodiment of the present application.
[0050] FIG. 25 is a schematic diagram illustrating a structure of a decoder according to another embodiment of the present application.
[0051] FIG. 26 is a schematic diagram illustrating a structure of a decoder according to another embodiment of the present application.
[0052] FIG. 27 is a schematic diagram illustrating a structure of a decoder according to another embodiment of the present application.
[0053] FIG. 28 is a schematic diagram illustrating a structure of an encoder according to an embodiment of the present application.
[0054] FIG. 29 is a schematic diagram illustrating a structure of an encoder according to another embodiment of the present application. DETAILED DESCRIPTION
[0055] FIG. 1 is a schematic block diagram of a video encoder according to an embodiment of the present application.
[0056] It should be understood that the video encoder 100 can be configured to perform lossy compression of images, and can also be configured to perform lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression.
[0057] The video encoder 100 can be configured to operate on image data in YCbCr (YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chrominance, and Cr (V) represents red chrominance, and U and V are used to describe color and saturation for chrominance (Chroma). For example, in terms of color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components for every 4 pixels (YYYYCbCr), 4:2:2 means that there are 4 luminance components and 4 chrominance components for every 4 pixels (YYYYCbCrCbCr), and 4:4:4 means that there are full pixel displays (YYYYCbCrCbCrCbCrCbCr).
[0058] For example, the video encoder 100 reads video data and, for each image in the video data, divides the image into coding tree units (CTUs), which can be referred to in some examples as “treeblocks,” “largest coding units” (LCUs) or “coding tree blocks” (CTBs). Each CTU can be associated with a block of pixels of equal size within the image having the same size. Each pixel can correspond to a luminance (luma) sample and two chrominance (chroma) samples. Thus, each CTU can be associated with a block of luminance samples and two blocks of chrominance samples. A CTU size can be, for example, 128x128, 64x64, 32x32, and so on. A CTU can be further divided into coding units (CUs) for coding, which can be rectangular or square. A CU can be further divided into prediction units (PUs) and transform units (TUs) to separate coding, prediction, and transform for more flexibility in processing. In one example, a CTU is divided into CUs in a quadtree manner, a CU is divided into TUs and PUs in a quadtree manner.
[0059] Video encoders and video decoders can support various PU sizes. Assuming that a size of a particular CU is 2Nx2N, video encoders and video decoders can support PU sizes of 2Nx2N or NxN for intra prediction, and symmetric PUs of 2Nx2N, 2NxN, Nx2N, NxN, or similar for inter prediction. Video encoders and video decoders can also support asymmetric PUs of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter prediction.
[0060] In some embodiments, as shown in FIG. 1, the video encoder 100 can include a prediction unit 110, a residual unit 120, a transform / quantization unit 130, an inverse transform / quantization unit 140, a reconstruction unit 150, a loop filtering unit 160, a decoded picture buffer 170, and an entropy encoding unit 180. It is noted that the video encoder 100 can include more, less, or different functional components.
[0061] Optionally, in this application, the current block can be referred to as a current coding unit (CU) or a current prediction unit (PU), etc. The prediction block can also be referred to as a prediction image block or an image prediction block, and the reconstructed image block can also be referred to as a reconstructed block or an image reconstructed block.
[0062] In some embodiments, the prediction unit 110 includes an inter-prediction unit 111 and an intra-prediction unit 112. Since there is a strong correlation between adjacent pixels in a picture of a video, the method of using intra-prediction in video coding technology eliminates the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent pictures in a video, the method of using inter-prediction in video coding technology eliminates the temporal redundancy between adjacent pictures, thereby improving the coding efficiency.
[0063] The inter prediction unit 111 can be configured to perform inter prediction, which can include motion estimation and motion compensation, can refer to image information of different images, and find a reference block from a reference image using motion information, generate a prediction block from the reference block, and be used to eliminate temporal redundancy. Inter prediction uses motion information to find a reference block from a reference image and generates a prediction block from the reference block. The motion information includes a reference image list where the reference image is located, a reference image index, and a motion vector. The motion vector can be an integer pixel or a fractional pixel. If the motion vector is a fractional pixel, an interpolation filter needs to be used in the reference image to obtain the required fractional pixel block. The integer pixel or fractional pixel block found in the reference image according to the motion vector is called a reference block. Some techniques directly use the reference block as the prediction block, and some techniques generate the prediction block by processing the reference block. Generating the prediction block by processing the reference block can also be understood as using the reference block as the prediction block and then processing the prediction block to generate a new prediction block.
[0064] The intra prediction unit 112 only refers to information of the same image to predict pixel information in the current code image block, and is used to eliminate spatial redundancy.
[0065] There are many intra prediction modes. For example, the H.264 / AVC standard has 8 angle prediction modes and 1 non-angle prediction mode, and the H.265 / HEVC is extended to 33 angle prediction modes and 2 non-angle prediction modes. The intra prediction mode (IPM) used by HEVC has Planar, DC and 33 angle modes, a total of 35 prediction modes. The intra mode used by VVC has Planar, DC and 65 angle modes, a total of 67 prediction modes.
[0066] It should be noted that with the increase of angle modes, the intra prediction will be more accurate and more in line with the needs of the development of high-definition and ultra-high-definition digital video.
[0067] The residual unit 120 can generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, the residual unit 120 can generate a residual block of the CU such that each sample in the residual block has a value equal to a difference between a sample in the pixel block of the CU and a corresponding sample in the prediction block of the PU of the CU.
[0068] Transform / quantization unit 130 can quantize the transform coefficients. Transform / quantization unit 130 can quantize the transform coefficients associated with a TU of a CU based on a quantization parameter (QP) value associated with the CU. Video encoder 100 can adjust the degree of quantization applied to the transform coefficients associated with a CU by adjusting the QP value associated with the CU.
[0069] Inverse transform / quantization unit 140 can apply inverse quantization and inverse transformation to the quantized transform coefficients, respectively, to reconstruct the residual blocks from the quantized transform coefficients.
[0070] Reconstruction unit 150 can add samples of the reconstructed residual blocks to corresponding samples of one or more prediction blocks generated by prediction unit 110 to produce a reconstructed image block associated with a TU. By reconstructing the sample blocks of each TU of a CU in this way, video encoder 100 can reconstruct the pixel blocks of the CU.
[0071] Loop filter unit 160 can be used to process the pixels after inverse transform and inverse quantization, to compensate for distortion information, to provide a better reference for subsequent encoding pixels, for example, a deblocking filter operation can be performed to reduce blocking artifacts associated with the pixel blocks of the CU.
[0072] In some embodiments, loop filter unit 160 includes a deblocking filter unit to remove blocking artifacts, a sample adaptive offset (SAO) unit to remove ringing artifacts, and an adaptive loop filter (ALF) unit to reduce reconstruction error.
[0073] Decoded picture buffer 170 can store the reconstructed pixel blocks. Inter prediction unit 111 can use reference pictures containing reconstructed pixel blocks to perform inter prediction for PUs of other pictures. In addition, intra prediction unit 112 can use reconstructed pixel blocks in decoded picture buffer 170 to perform intra prediction for other PUs in the same picture as the CU.
[0074] Entropy encoding unit 180 can receive quantized transform coefficients from transform / quantization unit 130. Entropy encoding unit 180 can perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy encoded data.
[0075] FIG. 2 is a schematic block diagram of a video decoder that the embodiments of the present application relate to.
[0076] As shown in FIG. 2, video decoder 200 includes an entropy decoding unit 210, a prediction unit 220, an inverse quantization / transform unit 230, a reconstruction unit 240, a loop filter unit 250, and a decoded picture buffer 260. It is noted that video decoder 200 can include more, less, or different functional components.
[0077] Video decoder 200 can receive a bitstream. Entropy decoding unit 210 can parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, entropy decoding unit 210 can entropy-decode syntax elements in the bitstream. Prediction unit 220, inverse quantization / transform unit 230, reconstruction unit 240, and loop filter unit 250 can decode video data according to the syntax elements extracted from the bitstream, i.e., generate decoded video data.
[0078] In some embodiments, prediction unit 220 includes an intra-prediction unit 222 and an inter-prediction unit 221.
[0079] Intra-prediction unit 222 can perform intra-prediction to generate a prediction block for a PU. Intra-prediction unit 222 can use an intra-prediction mode to generate the prediction block for the PU based on blocks of pixels of spatially neighboring PUs. Intra-prediction unit 222 can also determine the intra-prediction mode for the PU according to one or more syntax elements parsed from the bitstream.
[0080] Inter-prediction unit 221 can construct a first reference picture list (List 0) and a second reference picture list (List 1) according to syntax elements parsed from the bitstream. In addition, if the PU is coded using inter-prediction, entropy decoding unit 210 can parse motion information for the PU. Inter-prediction unit 221 can determine one or more reference blocks for the PU according to the motion information for the PU. Inter-prediction unit 221 can generate the prediction block for the PU according to the one or more reference blocks for the PU.
[0081] Inverse quantization / transform unit 230 can inverse quantize (i.e., de-quantize) transform coefficients associated with a TU. Inverse quantization / transform unit 230 can use a QP value associated with a CU of the TU to determine a degree of quantization.
[0082] After inverse quantizing the transform coefficients, inverse quantization / transform unit 230 can apply one or more inverse transforms to the inverse quantized transform coefficients in order to produce a residual block associated with the TU.
[0083] Reconstruction unit 240 uses the residual block associated with a TU of a CU and the prediction block for the PU of the CU to reconstruct a pixel block for the CU. For example, reconstruction unit 240 can add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block for the CU, resulting in a reconstructed image block.
[0084] Loop filter unit 250 can perform a deblocking filter operation to reduce blocking artifacts in the pixel block associated with the CU.
[0085] Video decoder 200 can store the reconstructed image for a CU in decoded picture buffer 260. Video decoder 200 can use the reconstructed image in decoded picture buffer 260 as reference pictures for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
[0086] The basic process of video coding is as follows: at the encoding end, an image is divided into blocks, and for a current block, the prediction unit 110 uses intra prediction or inter prediction to generate a prediction block of the current block. The residual unit 120 can calculate a residual block based on the prediction block and the original block of the current block, i.e., the difference between the prediction block and the original block of the current block, which can also be referred to as residual information. The residual block can be processed by the transform / quantization unit 130 to remove information that is not sensitive to the human eye, such as visual redundancy, through processes such as transformation and quantization. Optionally, the residual block before transformation and quantization by the transform / quantization unit 130 can be referred to as a time domain residual block, and the time domain residual block after transformation and quantization by the transform / quantization unit 130 can be referred to as a frequency residual block or a frequency domain residual block. The entropy encoding unit 180 receives the quantized transform coefficients output by the transform / quantization unit 130 and entropy encodes the quantized transform coefficients to output a bitstream. For example, the entropy encoding unit 180 can eliminate character redundancy based on a target context model and probability information of a binary code stream.
[0087] At the decoding end, the entropy decoding unit 210 can parse the bitstream to obtain the prediction information, the quantized coefficient matrix, etc. of the current block, and the prediction unit 220 uses intra prediction or inter prediction based on the prediction information to generate a prediction block of the current block. The inverse quantization / transformation unit 230 uses the quantized coefficient matrix obtained from the bitstream to perform inverse quantization and inverse transformation on the quantized coefficient matrix to obtain a residual block. The reconstruction unit 240 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed block constitutes a reconstructed image, and the loop filtering unit 250 performs loop filtering on the reconstructed image based on the image or based on the block to obtain a decoded image. The encoding end also needs to perform similar operations to obtain a decoded image. The decoded image can also be referred to as a reconstructed image, and the reconstructed image can be used as a reference image for subsequent image inter prediction.
[0088] It should be noted that the block division information determined by the encoding end, as well as the mode information or parameter information of prediction, transformation, quantization, entropy encoding, loop filtering, etc. are carried in the bitstream when necessary. The decoding end determines the same block division information, prediction, transformation, quantization, entropy encoding, loop filtering, etc. mode information or parameter information by analyzing the bitstream and based on the existing information, so as to ensure that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.
[0089] The above is the basic process of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process can be optimized. The present application is applicable to the basic process of a video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
[0090] The coding framework provided by the embodiments of the present application is described in detail above. The embodiments of the present application mainly relate to a prediction process based on a DIMD related mode, which can be implemented in the intra prediction unit in the coding framework mentioned above. The prediction process based on DIMD is described in detail below from the perspective of the decoding end.
[0091] At the decoding end, the basic decoding process of the intra-reconstructed block includes the following links: obtaining the prediction residual through code stream analysis, obtaining the prediction value, and determining the reconstructed value. FIG. 3 shows an example of the intra prediction process.
[0092] Referring to FIG. 3, in the process of analyzing the syntax elements, first, the DIMD flag is analyzed to determine whether the prediction value of the current block is generated by the DIMD mode. If the prediction value is not generated by the DIMD mode (the DIMD flag is 0), other syntax elements related to the intra prediction mode are analyzed; otherwise, the prediction value is generated by the DIMD mode. The related syntax semantics table is shown in Table 1.
[0093] Table 1. Syntax semantics related to the DIMD mode at the CU layer
[0094] In Table 1, intra_dimd_flag is used to identify whether the prediction value is generated by the DIMD mode. intra_dimd_flag is 1, indicating that the intra prediction mode of the luma sample is the DIMD mode, and intra_dimd_flag is 0, indicating that the intra prediction mode of the luma sample is not the DIMD mode.
[0095] S1.1: Obtain reference samples
[0096] One way of obtaining reference samples is to obtain the reconstructed samples p[x][y] of the three adjacent rows and three adjacent columns of the current block, where x=0..nTbW-1, y=0..nTbH-1. nTbW represents the width of the current block, and nTbH represents the height of the current block. Alternatively, only the three adjacent columns of reconstructed samples on the left or the three adjacent rows of reconstructed samples on the top can be obtained.
[0097] S1.2 DIMD intra mode derivation
[0098] As a possible implementation, the horizontal gradient and the vertical gradient of the adjacent reconstructed samples can be calculated by the Sobel operator. The Sobel operator formula is as follows, where G x is used to calculate the horizontal gradient, and G y is used to calculate the vertical gradient.
[0099] and
[0100] The process of deriving the intra prediction mode using Sobel operator to analyze the gradient of neighboring samples is described in detail as follows.
[0101] The input of the process is the reconstructed values of neighboring samples p[x][y] with x = 0..nTbW-1, y = 0..nTbH-1, nTbW represents the width of the current block, and nTbH represents the height of the current block.
[0102] The output of the process has different contents in different scenarios: in the DIMD intra prediction value obtaining scenario, the output of the process is the histogram information; in other application scenarios, the output of the process can be the traditional intra prediction mode IntraPredModeD, wherein the value of IntraPredModeD is between [0, 66].
[0103] mapHgV is set to be {{2, 1}, {1, 2}} and mapVgH is set to be {{3, 4}, {4, 3}}.
[0104] angTable is set to be {0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536}.
[0105] angOffset is set to be {18, 18, 50, 50}.
[0106] HoG
[0067] is set to be an array containing the gradient strength of each traditional intra prediction mode. At the beginning of the process, all values in the histogram of oriented gradient (HoG) array are initialized to 0.
[0107] For each reconstructed sample p[x][y] with x = 1…nTbW-2, y = 1…nTbH-2, the process is calculated as follows.
[0108] The horizontal gradient gHor[x][y] is calculated as follows: gHor[x][y] = p[x-1][y-1] + 2p[x-1][y] + p[x-1][y+1] - p[x+1][y-1] - 2p[x+1][y] - p[x+1][y+1];
[0109] The vertical gradient gVer[x][y] is calculated as follows: gVer[x][y] = p[x-1][y-1] + 2p[x][y-1] + p[x+1][y-1] - p[x-1][y+1] - 2p[x][y+1] - p[x+1][y+1];
[0110] Compute iAmp[x][y] = abs(gHor[x][y]) + abs(gVer[x][y]);
[0111] Compute signH[x][y] = gHor[x][y] < 0? 1 : 0;
[0112] Compute signV[x][y] = gVer[x][y] < 0? 1 : 0;
[0113] Compute HgV[x][y] = (abs(gHor[x][y]) > abs(gVer[x][y])? 1 : 0);
[0114] Compute region[x][y] = (HgV[x][y] == 1? mapHgV[signH[x][y]][signV[x][y]] : mapVgH[signH[x][y]][signV[x][y]]);
[0115] Compute grad[x][y] = (HgV[x][y] == 1? abs(gVer[x][y]) / abs(gHor[x][y]) : abs(gVer[x][y]) / abs(gHor[x][y]));
[0116] Compute grad[x][y] = round(grad[x][y] * (1 << 16));
[0117] Compute index angIdx[x][y] = argmin i (abs(angTable[i] - grad[x][y]));
[0118] Compute intra prediction mode ipm[x][y] = angOffset[region[x][y]] + angIdx[x][y];
[0119] Set HoG[ipm[x][y]] = HoG[ipm[x][y]] + iAmp[x][y];
[0120] In DIMD prediction scenario, all or part of the information of gradient histogram will be stored for subsequent operation. For details, refer to S1.2 in the following.
[0121] In other application scenarios, a directional mode IntraPredModeD can be further calculated according to the information in the gradient histogram. For example, if HoG has no non-zero amplitude, set IntraPredModeD as PLANAR. Otherwise, set IntraPredModeD as argmaxi (HoG[i]), where i = 0,..., N, argmax i (L[i]) returns the index between 0 and N that maximizes L. If there are multiple indices that maximize L, the index with the smaller value can be returned. Finally, predModeIntra is mapped to IntraPredModeD. It should be understood that this part is not necessary in the scenario where the prediction value is obtained based on DIMD.
[0122] S1.3 DIMD obtains the prediction value
[0123] Before obtaining the prediction value, it is first determined whether to perform weighted fusion. If the gradient histogram is not unidirectional, weighted fusion can be performed; otherwise, the intra prediction value can be obtained using the only non-zero intra prediction mode (IPM) in the gradient histogram. In the implementation process, the HoG information can be analyzed; if the amplitudes of the two most directional modes maxMode[0] (the corresponding item with the highest amplitude in the gradient histogram) and maxMode[1] (the corresponding item with the second highest amplitude in the gradient histogram) are both greater than 0, weighted fusion can be performed; otherwise, weighted fusion can not be performed.
[0124] If weighted fusion is not performed, the IPM with the highest amplitude can be obtained through the gradient histogram information; then, the prediction value can be directly generated through the prediction mode represented by the IPM.
[0125] If weighted fusion is performed, the N (for example, N = 5) IPMs with the highest amplitudes can be obtained through the gradient histogram information, denoted as M n ,n = 0..4, and the prediction values corresponding thereto are denoted as dimdPred n ,n = 0..4. Then, the prediction values can be weighted fused with the prediction value dimdPlanar of the Planar mode to obtain the final prediction value, as shown in FIG. 5. The weight wPlanar of the Planar mode can be fixed as 4 / 64. Then, the remaining 60 / 64 weights can be allocated to the five IPMs with the highest amplitudes, and the weights wDimd n ,n = 0..4 of the five IPMs and the amplitudes of their gradient histograms are related.
[0126] The prediction value at (x, y) in the current block can be:
[0127] where dimdPred n (x, y) represents the (x, y) position of the current block, and dimdPred ndimdPlanar(x, y) represents the prediction value generated according to the Planar mode at the (x, y) position of the current block.
[0128] The weight wDimd of the five IPMs n The weight wDimd of the five IPMs
[0129] According to the foregoing description, it can be known that the traditional DIMD mode only uses a region of three rows and three columns adjacent to the current block to calculate gradient information, obtains a gradient histogram, and derives the intra prediction mode and the prediction value of the current block by using the gradient histogram.
[0130] However, the gradient information obtained by using only the region of three rows and three columns is not rich enough and cannot express the diversity of the direction of the current block, so that the direction of the current block derived by the gradient information is not accurate, and further, the prediction value generated according to the intra prediction mode derived by the DIMD is not accurate.
[0131] In view of the foregoing problem, the decoding method provided by the embodiments of the present application is described in detail below.
[0132] FIG. 6 is a flowchart of a decoding method provided by an embodiment of the present application. The method of FIG. 6 can also be referred to as an intra prediction method or a prediction method based on the DIMD mode. The method of FIG. 6 can be applied to a decoder, for example, can be applied to an intra prediction unit of a decoder.
[0133] Referring to FIG. 6, in step S610, gradient information is determined according to at least one reconstructed sample around a current block. The current block can also be referred to as a current coding block, a current decoding block or a current coding unit. The current block can be, for example, a luma block. The manner of determining the gradient information based on the at least one sample can refer to the foregoing description. For example, the horizontal gradient and the vertical gradient of the at least one sample can be determined based on the Sobel operator, and then the gradient information is determined based on the horizontal gradient and the vertical gradient. The gradient information can be a gradient histogram; or the gradient information can include the amplitude values of the gradients corresponding to the partial intra prediction modes.
[0134] In step S620, a first intra prediction mode is determined according to the gradient information. In some implementations, the gradient information contains the amplitude values of one or more intra prediction modes, and the first intra prediction mode can be determined according to the amplitude values of the one or more intra prediction modes. For example, if the gradient information contains only one intra prediction mode with a non-zero amplitude value, the first intra prediction mode can be determined as the intra prediction mode. For another example, if the gradient information contains multiple intra prediction modes with non-zero amplitude values, the multiple intra prediction modes can be weighted and summed according to the amplitude values of the multiple intra prediction modes to determine the first intra prediction mode.
[0135] At step S630-S640, a prediction block of the current block is determined according to the first intra prediction mode; and a reconstructed block of the current block is determined according to the prediction block of the current block. For example, the code stream can be parsed to determine a residual block of the current block; and then, the reconstructed block of the current block is determined according to the prediction block of the current block and the residual block of the current block.
[0136] In some implementations, the at least one sample mentioned in step S610 includes a first sample. The first sample is located outside a first region formed by three left column neighboring samples of the current block and three upper row neighboring samples of the current block. The first region mentioned herein can be understood as the reference region used by the related art when using the DIMD mode. The first sample located outside the first region is equivalent to using reconstructed samples in a larger range to determine gradient information. The generated prediction value can be more accurate based on the gradient information guiding the current block to generate the prediction value.
[0137] As an example, the first region can include four left column neighboring samples of the current block and / or four upper row neighboring samples of the current block.
[0138] As another example, the first region can include five left column neighboring samples of the current block and / or five upper row neighboring samples of the current block.
[0139] As another example, the first region can include six left column neighboring samples of the current block and / or six upper row neighboring samples of the current block.
[0140] As another example, the first region can also be composed of reconstructed samples in a non-adjacent region of the current block.
[0141] In some implementations, the at least one sample mentioned in step S610 includes a sample in a first reference region (the reference region can also be referred to as a reference template, in various embodiments of the present application, the reference region and the reference template can both be understood as an image region containing one or more reconstructed samples, therefore, in various embodiments of the present application, the two can be used interchangeably). The first reference region is one of a plurality of reference regions, and the plurality of reference regions are all reconstructed regions. For example, FIG. 7 shows three reference regions of the current block, and the first reference region can be any one of the three reference regions. As a more specific example, the first reference region can be an adjacent reference region of the current block, or a non-adjacent reference region of the current block.
[0142] It should be noted that the shape of the reference region is not limited in the embodiments of the present application, and can be an L-shaped region or a rectangular region. The reference region can be only a left region, only a top-left region, only an upper region, only a bottom-left region, or only a top-right region of the current block, etc. Alternatively, the reference region can also be a combination of multiple different regions, for example, the reference region can be a combination of one left region and one upper region of the current block.
[0143] In some implementations, the first reference region is determined based on a first parameter in the bitstream. The first parameter is used to determine or indicate the first reference region from the multiple reference regions. For example, the first parameter can be a first index (Idx), i.e., a reference region index. Still taking FIG. 7 as an example, the index values corresponding to the three reference regions are 0, 1, and 2, respectively.
[0144] In some implementations, the multiple values of the first parameter have a first mapping relationship (which can be a one-to-one mapping relationship) with the multiple reference regions. The first mapping relationship is determined based on at least one of the following:
[0145] a predefined mapping relationship;
[0146] a second parameter in the bitstream;
[0147] a size of the current block;
[0148] a shape of the reference region corresponding to the current block.
[0149] For example, a mapping relationship between the multiple values of the first parameter and the multiple reference regions can be predefined. Then, the first parameter can be carried in the bitstream, so that the decoding end can determine the first reference region based on the value of the first parameter and the predefined mapping relationship.
[0150] For another example, multiple mapping relationships (or multiple groups of mapping relationships) between the multiple values of the first parameter and the multiple reference regions can be predefined. Then, a parameter (such as a high-level syntax element) can be carried in the bitstream to determine which mapping relationship in the multiple mapping relationships is used. The parameter can be an index or a serial number of the multiple mapping relationships, for example.
[0151] For another example, the specific information of the first mapping relationship can be directly indicated by a parameter in the bitstream, such as the positions of the multiple reference regions.
[0152] For example, if there are multiple mapping relationships between the first parameter and the multiple reference regions, the specific mapping relationship used can also be determined by other conditions. For example, the mapping relationship used by the current block can be determined based on the size of the current block and the mode selected by the current block (or the mode selected by the CU layer). The mapping relationship determined based on the size of the current block can be described below. The mode selected by the CU layer can refer to the shape of the reference region corresponding to the current block (rectangular or L-shaped, and the rectangular shape can include a rectangular shape on the left side of the current block, a rectangular shape on the top side of the current block, etc.).
[0153] It should be understood that the multiple values of the first parameter can be directly mapped to the multiple reference regions, or can be mapped to the multiple reference regions through an intermediate parameter. The intermediate parameter can be any type of parameter that can be used to determine the positions of the multiple reference regions. As an example, the intermediate parameter can be a reference region step. The reference region step can be defined as the horizontal and / or vertical offset (in samples) between the reference region and the current block. Alternatively, the step of the reference region can be the number of rows / columns of the reference region starting from the lower / right position and separated from the current block by a number of samples. In the example shown in FIG. 7, the step of the reference region is a multiple of 4.
[0154] For example, the mapping relationship between the reference region index and the reference region step can be represented in an array form as DIMD_REF_LINE_IDX[N] = {M 0, M1,…,M N-1}. Wherein N is the total number of reference regions, M0-M N-1 is the number of rows / columns of the reference region starting from the lower / right position and separated from the current block by a number of samples. The value of N can be an integer value between 2 and 10 (including 2 and 10), and the values of M0-M N-1 can be integer values between 0 and 64 (including 0 and 64). The relationship between M0-M N-1 may be an arithmetic sequence (such as 2, 3, 4, 8 integer multiples), or a geometric sequence relationship (such as powers of 2).
[0155] In addition to the above, the multiple values of the first parameter and the multiple reference regions can also use other mapping methods. For example, the shapes of the reference regions corresponding to different values of the first parameter can not be exactly the same, for example, some reference regions can be L-shaped, and some reference regions can be rectangular, and the order of the L-shaped and rectangular reference regions can be arranged from near to far relative to the position of the current block, or can be arranged from far to near relative to the position of the current block.
[0156] For example, each reference region can be used in the order of HoG[Idx][sdx] in FIG. 8A to FIG. 8C, and DIMD_REF_LINE_IDX[N] = {0, …, Idx*NoL+sdx, …}. NoL represents the number of reference regions in each reference region index step. Idx represents the reference region index, and sdx represents the sub-region index of each reference region. The order of sdx can be modified arbitrarily. The number of reference regions in different reference region index steps can be the same, for example, the number of reference regions in each reference region index step in FIG. 8A is 3. The number of reference regions in different reference region index steps can also be different, for example, in FIG. 8B and FIG. 8C, the number of reference regions in the reference region index step can be 3, 5, or 7.
[0157] As a more specific example, the mapping relationship of an L-shaped reference region index and a reference region step is: DIMD_REF_LINE_IDX[6] = {0, 4, 8, 12, 16, 20}, that is, when the index value is 0, it corresponds to the row / column that is immediately adjacent to the current block, that is, the row / column number of the reference region is 0; when the index value is 1, it corresponds to the row / column that is 4 samples apart from the current block, and the row / column number of the reference region is 4 at this time. By analogy. The reference region step is the horizontal and vertical offset between the reference region and the current block.
[0158] The embodiments of the present application propose a scheme of using more DIMD reference regions, which can effectively use the reference samples in a larger region to calculate different gradient information, and improve the accuracy and diversity of generating prediction values according to the derived intra prediction mode. The method is tested on ECM12.0 under the condition of 48 frames interval in All Intra, and can obtain a -0.08% BD-rate change (i.e. average code rate change under the same psnr) on the Y component.
[0159] As mentioned above, the first parameter has multiple values and multiple reference regions can have multiple mapping relationships. The first mapping relationship used by the current block can be determined based on the size of the current block. The following gives several possible implementation modes of determining the first mapping relationship based on the size of the current block.
[0160] In some implementation modes, if the size of the current block is a first size, the interval between adjacent regions in the plurality of reference regions in the first mapping relationship is a first interval; if the size of the current block is a second size, the interval between adjacent regions in the plurality of reference regions in the first mapping relationship is a second interval; wherein the first interval is different from the second interval. Optionally, the first size is smaller than the second size, and the first interval is smaller than the second interval.
[0161] As an example, assume the first parameter is a reference region index, and the first parameter establishes a mapping relationship with the reference region through a reference region step size. The mapping relationship between the reference region index and the reference region step size can be adaptively selected according to the size of the current block, and a larger step size is selected for a large block and a smaller step size is selected for a small block for region mapping. For example, the mapping relationship between the reference region index and the reference region step size is as follows:
[0162] The width or height of the current block is greater than or equal to 32: DIMD_REF_LINE IDX[6] = {0, 4, 8, 12, 16, 20};
[0163] Otherwise, the width or height of the current block is greater than or equal to 16: DIMD_REF_LINE IDX[6] = {0, 3, 6, 9, 12, 15};
[0164] Otherwise, DIMD_REF_LINE IDX[6] = {0, 2, 4, 6, 8, 10}.
[0165] In some implementations, if the size of the current block is a first size, the number of reference regions contained in the plurality of reference regions is a first number in the first mapping relationship; if the size of the current block is a second size, the number of reference regions contained in the plurality of reference regions is a second number in the first mapping relationship; and the first number is different from the second number. Optionally, the first size is smaller than the second size, and the first number is smaller than the second number.
[0166] As an example, the range of the reference region (or the length of the reference region index list) can be adaptively selected according to the size of the current block, and a smaller reference region range is used for a small block and a larger region range is used for a large block. One setting method is as follows:
[0167] The width or height of the current block is less than or equal to 8: DIMD_REF_LINE IDX[4] = {0, 4, 8, 12}, that is, only 3 reference regions corresponding to the reference range are additionally expanded;
[0168] Otherwise, the width or height of the current block is less than or equal to 16: DIMD_REF_LINE IDX[5] = {0, 4, 8, 12, 16}, that is, only 4 reference regions corresponding to the reference range are additionally expanded;
[0169] Otherwise, the width or height of the current block is less than or equal to 16: DIMD_REF_LINE IDX[5] = {0, 4, 8, 12, 16}, that is, only 4 reference regions corresponding to the reference range are additionally expanded;
[0170] The above scheme can be used in combination with the scheme mentioned above, i.e., "larger step size for large block and smaller step size for small block". For example, if the size of the current block is larger than a threshold, more reference regions can be set, and larger step size can be used between adjacent reference regions.
[0171] As mentioned above, the at least one sample (used to determine gradient information) in step S610 includes samples in the first reference region. It can be understood that the at least one sample can include only samples in the first reference region, or can include samples in multiple reference regions.
[0172] In some implementations, the at least one sample further includes samples in the reference region between the first reference region and the current block in the multiple reference regions. For example, the at least one sample further includes samples in all reference regions between the first reference region and the current block in the multiple reference regions. Taking FIG. 7 as an example, if the index value of the first reference region is 2, the at least one sample can include not only samples in the reference region with index value 2, but also samples in the reference region with index value 1 and samples in the reference region with index value 0 (because the reference region with index value 1 and the reference region with index value 0 are both between the current block and the reference region with index value 2). Further, the gradient information determined based on the at least one sample can include the accumulation (such as NHoG) of gradient information (such as gradient histogram) of the first reference region and the reference region between the first reference region and the current block.
[0173] In some implementations, the at least one sample in step S610 includes samples in the multiple target regions. The multiple target regions satisfy one of the following conditions:
[0174] The multiple target regions are the multiple reference regions mentioned above;
[0175] The multiple target regions are part or all of the sub-regions in the first reference region mentioned above;
[0176] The multiple target regions include part of the sub-regions in the first reference region and part of the sub-regions in the second reference region (belonging to the multiple reference regions mentioned above) (that is, the multiple target regions can be a combination of sub-regions in different reference regions);
[0177] The multiple target regions include the first reference region and part of the sub-regions in the second reference region (that is, the multiple target regions can be a combination of a reference region and sub-regions in other reference regions).
[0178] Further, in some implementations, the first intra prediction mode can be determined based on magnitudes corresponding to the plurality of intra prediction modes. The magnitudes corresponding to the plurality of intra prediction modes are determined based on gradient information of samples in the plurality of target regions, respectively. For example, the first intra prediction mode can be determined based on the magnitudes corresponding to the plurality of intra prediction modes and weights corresponding to the plurality of intra prediction modes, which are determined based on at least one of the magnitudes corresponding to the plurality of intra prediction modes (e.g., the greater the magnitude, the greater the weight) and distances between the plurality of target regions and the current block (e.g., the closer the distance, the greater the weight).
[0179] As a specific example, among different reference region indexes, the highest magnitude in the gradient histogram corresponding to each reference region index is selected as an intra prediction mode (IPM). The IPMs corresponding to the six or five reference region indexes and their corresponding magnitudes are blended. In the blending process, the weight of each IPM can be directly derived from the magnitude corresponding to the IPM, or can be derived based on the distance and the magnitude.
[0180] As can be seen from the above description, embodiments of the present application support flexible combination of gradient information between reference regions, and also support flexible combination of gradient information of sub-regions in one or more reference regions. For example, gradient information calculated from part of the sub-regions in a reference region can be used for mode derivation, or gradient information calculated from sub-regions between different reference regions can be used for mode derivation.
[0181] As mentioned above, the at least one sample (used to determine gradient information) in step S610 includes a sample in the first reference region. The at least one sample can include all samples in the first reference region, or can include part of the samples in the first reference region (to simplify implementation). For example, the at least one sample can include only samples in the first reference region located at a certain position or positions of the current block. An implementation of an L-shaped reference region is shown in FIG. 9, with a reference region size of 3 rows by 3 columns. Taking the first reference region with an index value of 1 as an example, gradient information is calculated only using the region where the non-blank grid is located (i.e., the 3-block region identified by Idx = 1), thereby reducing the number of calculations at the decoding end and reducing the complexity of the decoding end.
[0182] In some implementations, the first reference region can be divided into a plurality of sub-regions. The at least one sample mentioned in step S610 includes samples in some or all of the sub-regions in the first reference region. For example, for the first reference region index, the gradient histogram HoG can be divided into at most 5 gradient histograms HoGS[i], i=0,…4 by the sample source of the gradient histogram HoG. One division manner is shown in FIG. 10. According to the left region, the left-biased upper region, the upper-left region, the upper-biased left region, and the upper region, at most 5 partial gradient histograms HoGS[i] are calculated respectively. One IPM with the highest amplitude in each gradient histogram HoGS[i] is selected, and a prediction value is generated after fusion.
[0183] As mentioned above, a reference region can be divided into a plurality of sub-regions. The number of sub-regions in different reference regions can be the same or different. The size of the sub-region located in the first orientation (such as left, upper-left, or upper) of the current block in different reference regions can be the same or different.
[0184] Taking the first reference region (which can be, for example, the reference region closest to the current block in FIGS. 8A-8C) and the second reference region (which can be, for example, the reference region farther from the current block in FIGS. 8A-8C) as examples, the number of sub-regions in the first reference region and the second reference region can be the same (as in FIG. 8A); or the number of sub-regions in the first reference region and the second reference region can be different (as in FIG. 8B or FIG. 8C); or the size of the sub-region located in the first orientation of the current block in the first reference region and the second reference region can be the same (as in the left orientation of the current block in FIG. 8A); or the size of the sub-region located in the first orientation of the current block in the first reference region and the second reference region can be different (as in the left-biased upper orientation in FIG. 8B or FIG. 8C).
[0185] In the related art, the number of reference areas corresponding to the DIMD mode is 1, and the embodiments of the present application introduce multiple reference areas. One possible implementation is to extend the DIMD mode in the related art so that it supports multiple reference areas. Another possible implementation is to provide the DIMD mode with multiple reference areas in the embodiments of the present application as a new DIMD mode. For example, the DIMD mode provided in the related art can be referred to as a first DIMD mode (the number of corresponding reference areas is 1), and the DIMD mode provided in the embodiments of the present application can be referred to as a second DIMD mode (the number of corresponding reference areas is greater than 1, which can be referred to as a multiple reference-area DIMD (MR_DIMD)). Then, the decoding end can parse a third parameter from the code stream, which is used to determine or indicate the DIMD mode used by the current block. The third parameter can be referred to as mr_dimd_Flg, for example, which is used to indicate whether MR_DIMD is used. If mr_dimd_Flag is 1, the value of the first parameter (such as the first index) mentioned above can be transmitted; otherwise, the first parameter (such as the first index) is not transmitted.
[0186] In some implementations, the gradient information determined in step S610 can be stored. For example, the correspondence between the first parameter (such as the first index) and the gradient information can be stored, so as to diversely utilize the gradient information in the prediction process. Taking an example in which the gradient information includes multiple gradient histograms, the multiple gradient histograms are stored, and the information between the multiple gradient histograms can be conveniently utilized in the prediction process. Exemplarily, at the decoding end, the gradient histogram HoG information corresponding to the reference area index parsed from the code stream can be stored in units of coding units (CUs), and the HoG can be directly stored, or only the five IPMs with the highest amplitudes in the HoG and the corresponding amplitudes can be stored.
[0187] In some implementations, in order to improve the utilization rate of the gradient information of the neighboring samples of the current block, the reference area step can be set to a small interval. For example, multiple reference areas can be set to be adjacent or overlapping. Exemplarily, the mapping relationship between the reference area index and the reference area step can be: DIMD_REF_LINE IDX[6] = {0, 2, 4, 6, 8, 10}. One mapping relationship between the L-shaped reference area index and the reference area is shown in FIG. 11, in which the size of the reference area is three rows and three columns, and the reference area step is an integer multiple of 2.
[0188] As mentioned above, the reference region shape of the multiple reference regions (or the first reference region) can have multiple alternative shapes. Which shape is used can be determined based on a fourth parameter (an index of the reference region shape) in the bitstream. That is, the fourth parameter can be used to indicate the shape of the reference region. Alternatively, in some implementations, the shape of the reference region used for the current block can be determined based on the distribution of gradient information in the multiple shapes of the reference region. For example, if the gradient information (e.g., gradient histogram) of only the left region or only the top region of the current block is the main source of the gradient information (e.g., gradient histogram) of the L-shaped region, the prediction value can be generated using only the gradient information of the only left or only top region. As an example, the gradient information of the L-shaped region, only left region and only top region can be calculated respectively, and if the gradient information corresponding to three or five main IPMs of the L-shaped region is mainly from the L-shaped region, the prediction value can be generated using only the gradient information of the only left region. FIG. 12A and FIG. 12B show two cases where the shape of the reference region is rectangular, where the reference region in FIG. 12A is the only left region of the current block, and the reference region in FIG. 12B is the only top region of the current block.
[0189] As mentioned above, the reference region can be divided into multiple sub-regions. Examples of the division of the sub-regions in the reference region of multiple shapes are given below in connection with FIG. 13A to FIG. 13C (FIG. 13 is an example where the reference region index step is an integer multiple of 4, and the reference region index step can also be other values such as 3 or 5), where FIG. 13A shows the division of the sub-regions in the only left region of the current block, FIG. 13B shows the division of the sub-regions in the only top region of the current block, and FIG. 13C shows the division of the sub-regions in the L-shaped region of the current block. In the process of coding and decoding, the gradient information of the sub-regions can be flexibly used. For example, the gradient information of all sub-regions can be used, or the gradient information of part of the sub-regions can be used, or the information between different sub-regions can be used separately, or the information between different sub-regions can be used in combination.
[0190] In some implementations, the width of the first reference region mentioned above is greater than or equal to 3. For example, the width of the first reference region can be 4, 5, 6 or other values.
[0191] In some embodiments, the first reference region is determined based on a difference (or cost) between one or more prediction values of the template region of the current block and the reconstructed values of the template region. The one or more prediction values of the template region can be determined based on gradient information of samples in one or more reference regions. For example, one or more intra prediction modes of the template region can be determined based on gradient information of samples in one or more reference regions, and then one or more prediction values of the template region are determined based on the one or more intra prediction modes of the template region. Exemplarily, the reference region corresponding to the prediction values with the minimum difference or the optimal cost can be determined as the first reference region.
[0192] It should be noted that the shape and size of the template region are not limited in the embodiments of the present application. The shape of the template region can be L-shaped or rectangular. The size of the template region can be 3 rows and 3 columns, or 2 rows and 2 columns, 4 rows and 4 columns, or 6 rows and 6 columns.
[0193] It should be further noted that the difference or cost between the prediction values and the reconstructed values of the template region can be SAD, or SATD, or a smaller value of SAD or SATD.
[0194] In some embodiments, the method of FIG. 6 can further include parsing the bitstream to determine a fifth parameter. The fifth parameter is used to indicate whether the current block uses the DIMD mode. The fifth parameter can be identification information, such as intra_dimd_flag, to identify whether the DIMD related mode is used to generate the prediction values. Exemplarily, intra_dimd_flag is 1 to indicate that the intra prediction mode of the current block is the DIMD related mode, and intra_dimd_flag is 0 to indicate that the intra prediction mode of the current block is not the DIMD related mode.
[0195] FIG. 14 is a flowchart of a decoding method according to another embodiment of the present application. The method of FIG. 14 can also be referred to as an intra prediction method, or a prediction method based on the DIMD mode. The method of FIG. 14 can be applied to a decoder, for example, to an intra prediction unit of a decoder.
[0196] Referring to FIG. 14, in step S1410, a reference template of a current block is parsed from a bitstream. The reference template mentioned herein is the same concept as the reference region mentioned above, and the two can be used interchangeably. The reference template can include one or more reconstructed samples (or reconstructed pixels) in an image in which the current block is located. The reconstructed samples in the reference template can be the top three rows and left three columns of samples of the current block, or can include more rows / columns of samples, or fewer rows / columns of samples. The shape of the reference template can be L-shaped or rectangular.
[0197] The reference template of the current block can be determined from one or more reference templates. For example, the bitstream can be parsed to determine a first index, the first index being used to determine the reference template of the current block (the first index being used to indicate the reference template of the current block, or the first index being used to indicate the position of the reference template). For example, the first index can indicate that the current block uses three rows and three columns of samples neighboring the current block as the reference template; for another example, the first index can indicate that the current block uses three rows and three columns of samples having a first interval from the current block as the reference template; for another example, the first index can indicate that the current block uses three rows and three columns of samples having a second interval (larger than the first interval) from the current block as the reference template.
[0198] Alternatively, the reference template of the current block can be determined based on a difference between one or more predicted values of a template region of the current block and reconstructed values of the template region. The one or more predicted values of the template region can be determined based on gradient information of samples in the one or more reference templates. For example, one or more intra prediction modes of the template region can be determined based on the gradient information of the samples in the one or more reference templates, and then the one or more predicted values of the template region can be determined based on the one or more intra prediction modes of the template region. Illustratively, the reference template corresponding to the predicted value with the minimum difference or the optimal cost can be determined as the first reference template.
[0199] It should be noted that the embodiments of the present application do not limit the shape and size of the template region. The shape of the template region can be L-shaped or rectangular. The size of the template region can be 3 rows and 3 columns, or 2 rows and 2 columns, 4 rows and 4 columns, or 6 rows and 6 columns.
[0200] At step S1420, a first mode parameter is determined according to the reference template of the current block. The first mode parameter is used to indicate the texture feature (or texture direction) of the samples in the reference template. The texture feature can represent the change of the samples in a local range, including the directionality and severity of the change. Alternatively, the first mode parameter is the gradient of one or more reconstructed samples in the reference template. The gradient mentioned herein can be determined based on the horizontal gradient and the vertical gradient of the reconstructed samples in the reference template, and the horizontal gradient and the vertical gradient are determined based on the Sobel operator.
[0201] At step S1430, a first intra prediction mode of the current block is determined according to the first mode parameter. Taking the gradient as the first mode parameter as an example, the IPM corresponding to the maximum gradient amplitude can be determined as the first intra prediction mode, or a plurality of IPMs corresponding to the gradient with a relatively large amplitude can be fused to determine the first intra prediction mode.
[0202] At step S1440-S1450, a prediction value of the current block is determined according to the first intra prediction mode; and a reconstructed block of the current block is determined according to the prediction value of the current block. For example, a residual value of the current block can be parsed from the bitstream; and then, the prediction value of the current block and the residual value of the current block can be summed to determine the reconstructed block of the current block.
[0203] FIG. 15 is a flowchart illustrating a decoding method according to another embodiment of the present disclosure. The method of FIG. 15 can also be referred to as an intra prediction method, or a prediction method based on DIMD mode. The method of FIG. 15 can be applied to a decoder, for example, to an intra prediction unit of a decoder.
[0204] At step S1510, a candidate intra prediction mode set of the current block is determined according to reconstructed samples of the image in which the current block is located (e.g., neighboring reconstructed samples of the current block). It should be understood that the candidate intra prediction mode set can include one or more candidate intra prediction modes. The candidate intra prediction mode set can be determined based on one or more reference templates of the current block (i.e., the gradient information of the samples in the reference templates is analyzed based on DIMD to determine the intra prediction mode). The reconstructed samples included in the one or more reference templates can be determined based on one or more of the following: pre-defined information, the size of the current block, the mode selected at the CU level (e.g., shape information of the reference region corresponding to the current block). For example, for a current block with a larger size, one or more reference templates can be selected, and the interval between neighboring reference templates can be set to be larger. For example, for a current block with a smaller size, one or more reference templates can be selected, and the interval between neighboring reference templates can be set to be smaller. For example, for a current block with a larger size, more reference templates can be selected. For example, for a current block with a smaller size, fewer reference templates can be selected.
[0205] At step S1520, a first intra prediction mode of the current block is determined according to the candidate intra prediction mode set. The first intra prediction mode can be determined from the candidate intra prediction mode set based on a first index in the bitstream. That is, the first index can be used to indicate which intra prediction mode in the candidate intra prediction mode set is used for the current block. Alternatively, the first intra prediction mode can be determined based on the difference between one or more prediction values of a template region of the current block and the reconstructed values of the template region. The one or more prediction values of the template region are determined based on one or more candidate intra prediction modes in the candidate intra prediction mode set. For example, the one or more prediction values can be obtained by predicting the template region based on the one or more candidate intra prediction modes. Illustratively, the candidate prediction mode corresponding to the prediction value with the smallest difference or the optimal cost can be determined as the first intra prediction mode.
[0206] It should be noted that the embodiments of the present application do not limit the shape and size of the template region. The template region can be L-shaped or rectangular. The template region can have a size of 3x3, 2x2, 4x4 or 6x6.
[0207] In step S1530-S1540, a prediction value of the current block is determined according to the first intra prediction mode; and a reconstructed block of the current block is determined according to the prediction value of the current block. For example, the residual value of the current block can be determined by parsing the bitstream; and then, the reconstructed block of the current block can be determined according to the residual value and the prediction value of the current block.
[0208] The foregoing describes the decoding method provided by the embodiments of the present application in detail with reference to FIG. 1 to FIG. 15. The following describes the encoding method provided by the embodiments of the present application in detail with reference to FIG. 16 to FIG. 17.
[0209] FIG. 16 is a flowchart of an encoding method provided by the embodiments of the present application. The method of FIG. 16 can also be referred to as an intra prediction method, or a prediction method based on DIMD mode. The method of FIG. 16 can be applied to an encoder, for example, an intra prediction unit of the encoder.
[0210] Referring to FIG. 16, in step S1610, gradient information is determined according to at least one reconstructed sample around the current block. The current block can also be referred to as a current coding block, or a current coding unit. The current block can be a luma block, for example. The gradient information can be determined based on the at least one sample in the manner described above. For example, the horizontal gradient and the vertical gradient of the at least one sample can be determined based on the Sobel operator, and then the gradient information can be determined based on the horizontal gradient and the vertical gradient. The gradient information can be a gradient histogram; or the gradient information can be one or more amplitude values of the gradients corresponding to one or more intra prediction modes.
[0211] In step S1620, a first intra prediction mode is determined according to the gradient information. In some implementations, the gradient information contains one or more amplitude values of the gradients corresponding to one or more intra prediction modes, and the first intra prediction mode can be determined according to the one or more amplitude values. For example, if the gradient information contains only one intra prediction mode with a non-zero amplitude value, the first intra prediction mode can be determined as the intra prediction mode. For another example, if the gradient information contains multiple intra prediction modes with non-zero amplitude values, the first intra prediction mode can be determined by weighted sum of the multiple intra prediction modes according to the amplitude values of the multiple intra prediction modes.
[0212] At step S1630-S1640, a prediction block of the current block is determined according to the first intra prediction mode; and a residual block of the current block is determined according to the prediction block of the current block. For example, the residual block can be determined according to the original block of the current block and the prediction block. After the residual block is determined, the residual block can be entropy encoded, so as to write the residual information into the bitstream.
[0213] In some embodiments, the at least one sample mentioned in step S1610 includes a first sample. The first sample is located outside a first region formed by three left column neighboring samples of the current block and three upper row neighboring samples of the current block. The first region mentioned herein can be understood as the reference region used by the related art when using the DIMD mode. The first sample is located outside the first region, which is equivalent to using reconstructed samples in a larger range to determine gradient information. Based on the gradient information, the prediction value of the current block is generated, which can make the generated prediction value more accurate.
[0214] As an example, the first region can include four left column neighboring samples of the current block and / or four upper row neighboring samples of the current block.
[0215] As another example, the first region can include five left column neighboring samples of the current block and / or five upper row neighboring samples of the current block.
[0216] As another example, the first region can include six left column neighboring samples of the current block and / or six upper row neighboring samples of the current block.
[0217] As another example, the first region can also be composed of reconstructed samples in a non-adjacent region of the current block.
[0218] In some embodiments, the at least one sample mentioned in step S1610 includes a sample in a first reference region (the reference region can also be referred to as a reference template, in various embodiments of the present application, the reference region and the reference template can both be understood as a region containing one or more reconstructed samples, therefore, in various embodiments of the present application, the two can be used interchangeably). The first reference region is one of a plurality of reference regions, and the plurality of reference regions are all reconstructed regions. For example, FIG. 7 shows three reference regions of the current block, and the first reference region can be any one of the three reference regions. As a more specific example, the first reference region can be an adjacent reference region of the current block, or a non-adjacent reference region of the current block.
[0219] It should be noted that the shape of the reference region is not specifically limited in the embodiments of the present application, and can be an L-shaped region or a rectangular region. The reference region can be a left region only, a left-up region only, an upper region only, a left-down region only, a right-up region only, etc. of the current block. Alternatively, the reference region can also be a combination of a plurality of different regions, for example, a combination of a left region and an upper region.
[0220] In some embodiments, after determining the first reference region, the first parameter can be written into the bitstream. The first parameter is used to determine or indicate the first reference region from the plurality of reference regions. For example, the first parameter can be a first index (Idx), i.e., an index of the reference region. Still taking FIG. 7 as an example, the index values corresponding to the three reference regions are 0, 1, and 2, respectively.
[0221] In some embodiments, the plurality of values of the first parameter have a first mapping relationship (which can be a one-to-one mapping relationship) with the plurality of reference regions. The first mapping relationship is determined based on at least one of the following:
[0222] a pre-defined mapping relationship;
[0223] a size of the current block;
[0224] a shape of the reference region corresponding to the current block.
[0225] For example, a mapping relationship between the plurality of values of the first parameter and the plurality of reference regions can be pre-defined. Then, the first parameter can be carried in the bitstream, so that the decoding end can determine the first reference region based on the value of the first parameter and the pre-defined mapping relationship.
[0226] For another example, a plurality of mapping relationships (or a plurality of groups of mapping relationships) between the plurality of values of the first parameter and the plurality of reference regions can be pre-defined. Then, a parameter (such as a high-level syntax element) can be carried in the bitstream to determine which mapping relationship in the plurality of mapping relationships is used. The parameter can be, for example, an index or a serial number of the plurality of mapping relationships.
[0227] For another example, the specific information of the first mapping relationship can be directly indicated by a parameter in the bitstream, such as the positions of the plurality of reference regions.
[0228] For another example, if there are a plurality of mapping relationships between the plurality of values of the first parameter and the plurality of reference regions, the specific mapping relationship to be used can also be determined by other conditions. As an example, the size of the current block and the mode selected by the current block (or the mode selected by the CU layer) can be used to determine which mapping relationship is used by the current block. The way of determining the mapping relationship based on the size of the current block can be referred to the description below. The mode selected by the CU layer can be, for example, the shape of the reference region corresponding to the current block (rectangular or L-shaped, and the rectangular can include a rectangular on the left side of the current block, a rectangular on the top side of the current block, etc.).
[0229] It should be understood that the multiple values of the first parameter can be directly mapped to the multiple reference regions, or can be mapped to the multiple reference regions through an intermediate parameter. The intermediate parameter can be any type of parameter that can be used to determine the position of the multiple reference regions. As an example, the intermediate parameter can be a reference region step size. The reference region step size can be defined, for example, as the horizontal and / or vertical offset (which can be in units of samples) between the reference region and the current block. In other words, the step size of the reference region can be the number of rows / columns of samples between the lower / right starting position of the rows / columns of the reference region and the current block. In the example shown in FIG. 7, the step size of the reference region is a multiple of 4.
[0230] For example, the mapping relationship between the reference region index and the reference region step size can be represented in an array form as DIMD_REF_LINE_IDX[N] = {M 0, M1, M2, M3, M4, M5, M6, M7, M8, M9, M10 N-1}. Wherein, N is the total number of reference regions, M0~M N-1 are the number of rows / columns of samples between the lower / right starting position of the rows / columns of the reference region and the current block. The value of N can be an integer value between 2 and 10 (inclusive), and the values of M0~M N-1 can be integer values between 0 and 64 (inclusive). The relationship between M0~M N-1 may be an arithmetic sequence (such as 2, 3, 4, 8 integer multiples), or a geometric sequence relationship (such as powers of 2).
[0231] In addition to the above manner, the multiple values of the first parameter and the multiple reference regions can also use other mapping methods. For example, the shapes of the reference regions corresponding to different values of the first parameter can not be exactly the same, for example, some reference regions can be L-shaped, and some reference regions can be rectangular, the order of the L-shaped and rectangular reference regions relative to the position of the current block can be arranged from near to far, or can be arranged from far to near.
[0232] For another example, each reference region can be used in the order of HoG[Idx][sdx] in FIGS. 8A-8C, then DIMD_REF_LINE_IDX[N] = {0, …, Idx*NoL+sdx, …}. Here NoL represents the number of reference regions per reference region index step. Idx represents the reference region index, and sdx represents the sub-region index of each reference region, and the order of sdx can be modified arbitrarily. The number of reference regions per reference region index step can be the same, for example, the number of reference regions per reference region index step in FIG. 8A is 3; the number of reference regions per reference region index step can also be different, for example, in FIGS. 8B and 8C, the number of reference regions per reference region index step can be 3, 5, or 7.
[0233] As a more specific example, a mapping relationship between an L-shaped reference region index and a reference region step length is: DIMD_REF_LINE IDX[6] = {0, 4, 8, 12, 16, 20}, that is, when the index value is 0, it corresponds to the row / column adjacent to the current block, that is, the row / column number of the reference region is 0; when the index value is 1, it corresponds to the row / column separated by 4 rows of samples from the current block, and the row / column number of the reference region is 4 at this time; and so on. The reference region step length is the horizontal and vertical offset between the reference region and the current block.
[0234] Embodiments of the present application propose a scheme of using more DIMD reference regions, which can effectively use the reference samples in a larger region to calculate different gradient information, and improve the accuracy and diversity of generating prediction values according to the derived intra prediction mode. The method is tested on ECM12.0 under the condition of 48 frames interval in All Intra, and can obtain a -0.08% BD-rate change (i.e. average code rate change under the same psnr) on the Y component.
[0235] As mentioned above, the plurality of values of the first parameter and the plurality of reference regions can have a plurality of mapping relationships, and the first mapping relationship used by the current block can be determined based on the size of the current block. The following gives several possible implementation manners of determining the first mapping relationship based on the size of the current block.
[0236] In some implementation manners, if the size of the current block is a first size, then in the first mapping relationship, the interval between adjacent regions in the plurality of reference regions is a first interval; if the size of the current block is a second size, then in the first mapping relationship, the interval between adjacent regions in the plurality of reference regions is a second interval; wherein the first interval is different from the second interval. Optionally, the first size is smaller than the second size, and the first interval is smaller than the second interval.
[0237] As an example, it is assumed that the first parameter is a reference region index, and the first parameter establishes a mapping relationship with the reference region through a reference region step length. The mapping relationship between the reference region index and the reference region step length can be adaptively selected according to the size of the current block, and a larger step length is selected for a large block and a smaller step length is selected for a small block for region mapping. For example, the mapping relationship between the reference region index and the reference region selection step length is:
[0238] The width or height of the current block is greater than or equal to 32: DIMD_REF_LINE IDX[6] = {0, 4, 8, 12, 16, 20};
[0239] Otherwise, the width or height of the current block is greater than or equal to 16: DIMD_REF_LINE IDX[6] = {0, 3, 6, 9, 12, 15};
[0240] Otherwise, DIMD_REF_LINE IDX[6] = {0, 2, 4, 6, 8, 10}.
[0241] In some implementations, if the size of the current block is a first size, the number of reference regions contained in the plurality of reference regions is a first number in the first mapping relationship; if the size of the current block is a second size, the number of reference regions contained in the plurality of reference regions is a second number in the first mapping relationship; and the first number is different from the second number. Optionally, the first size is smaller than the second size, and the first number is smaller than the second number.
[0242] As an example, the range of the reference region (or the length of the reference region index list) can be adaptively selected according to the size of the current block, a smaller reference region range is used for a small block, and a larger region range is used for a large block. One setting mode is as follows:
[0243] The width or height of the current block is less than or equal to 8: DIMD_REF_LINE IDX[4] = {0, 4, 8, 12}, that is, only 3 reference region corresponding reference ranges are additionally extended;
[0244] Otherwise, the width or height of the current block is less than or equal to 16: DIMD_REF_LINE IDX[5] = {0, 4, 8, 12, 16}, that is, only 4 reference region corresponding reference ranges are additionally extended;
[0245] Otherwise, consistent with the main scheme, DIMD_REF_LINE IDX[6] = {0, 4, 8, 12, 16, 20}, that is, only 5 reference region corresponding reference ranges are additionally extended.
[0246] The above scheme can be used in combination with the scheme mentioned in the foregoing that "a larger step length is selected for a large block, and a smaller step length is selected for a small block". For example, if the size of the current block is greater than a certain threshold, more reference regions can be set, and a larger step length is used between the reference regions.
[0247] As mentioned in the foregoing, the at least one sample (used for determining the gradient information) in step S1610 includes a sample in the first reference region. It can be understood that the at least one sample can only include a sample in the first reference region, or can also include samples in multiple reference regions.
[0248] In some embodiments, the at least one sample further includes samples in a reference region between the first reference region and the current block among the plurality of reference regions. For example, the at least one sample further includes samples in all reference regions between the first reference region and the current block among the plurality of reference regions. For example, referring to FIG. 7, if the index value of the first reference region is 2, the at least one sample can include not only samples in the reference region with index value 2, but also samples in the reference region with index value 1 and samples in the reference region with index value 0 (because the reference region with index value 1 and the reference region with index value 0 are both between the current block and the reference region with index value 2). Further, the gradient information determined based on the at least one sample can include the accumulation (such as NHoG) of gradient information (such as gradient histogram) of the first reference region and the reference regions between the first reference region and the current block. The gradient information after the accumulation can be used as a candidate gradient information for selection by the encoding end.
[0249] In some embodiments, the at least one sample referred to in step S1610 includes samples in a plurality of target regions. The plurality of target regions satisfy one of the following:
[0250] The plurality of target regions are the plurality of reference regions mentioned above;
[0251] The plurality of target regions are part or all of the sub-regions in the first reference region mentioned above;
[0252] The plurality of target regions include part of the sub-regions in the first reference region and part of the sub-regions in the second reference region (also belonging to the plurality of reference regions mentioned above) (that is, the plurality of target regions can be a combination of sub-regions in different reference regions);
[0253] The plurality of target regions include the first reference region and part of the sub-regions in the second reference region (that is, the plurality of target regions can be a combination of a reference region and sub-regions in other reference regions).
[0254] Further, in some embodiments, the first intra prediction mode can be determined based on magnitudes corresponding to a plurality of intra prediction modes. The magnitudes corresponding to the plurality of intra prediction modes are determined based on gradient information of samples in the plurality of target regions. For example, the first intra prediction mode can be determined based on the magnitudes corresponding to the plurality of intra prediction modes and weights corresponding to the plurality of intra prediction modes, and the weights corresponding to the plurality of intra prediction modes are determined based on at least one of the following: the magnitudes corresponding to the plurality of intra prediction modes (for example, the greater the magnitude, the greater the weight); and intervals between the plurality of target regions and the current block (for example, the closer the distance, the greater the weight).
[0255] As a specific example, among different reference region indexes, one IPM with the highest amplitude in the gradient histogram corresponding to each reference region index is selected, and blending is performed using the IPMs corresponding to the six or five reference region indexes and the amplitudes corresponding to the IPMs. During the blending, the weight of each IPM can be directly derived from the amplitude corresponding to the IPM, or the weight information can be derived according to the distance and the amplitude.
[0256] As can be seen from the above description, the embodiments of the present application support flexible combination of gradient information between reference regions, and also support flexible combination of gradient information of sub-regions in one or more reference regions. For example, gradient information calculated by some sub-regions in one reference region can be used for mode derivation, or gradient information calculated by sub-regions in different reference regions can be used for derivation.
[0257] It is mentioned above that the at least one sample (used for determining gradient information) in step S1610 includes a sample in the first reference region. The at least one sample can include all samples in the first reference region, or can include some samples in the first reference region (so as to simplify implementation). For example, the at least one sample can include only samples in the first reference region located at a certain position or positions of the current block. An implementation manner of an L-shaped reference region is shown in FIG. 9, and the reference region size is 3 rows by 3 columns. Taking the first reference region with an index value of 1 as an example, gradient information is calculated only using the region where the non-blank grid is located (i.e., the 3-block region identified by Idx=1), so as to reduce the number of calculations at the decoding end and reduce the complexity of the decoding end.
[0258] In some implementation manners, the first reference region can be divided into a plurality of sub-regions, and the at least one sample includes a sample in some or all of the sub-regions in the first reference region. For example, for the first reference region index, the gradient histogram HoG can be divided into at most five gradient histograms HoGS[i], i=0,…4 by the sample source of the gradient histogram HoG. An implementation manner is shown in FIG. 10. According to the left region, the left-biased-up region, the left-up region, the up-biased-left region, and the up region, at most five partial gradient histograms HoGS[i] are calculated. One IPM with the highest amplitude in each gradient histogram HoGS[i] is selected, and a prediction value is generated after blending.
[0259] It is mentioned above that one reference region can be divided into a plurality of sub-regions. The number of sub-regions in different reference regions can be the same or different. The size of the sub-region located at a first position (such as left, left-up, or up) of the current block in different reference regions can be the same or different.
[0260] Taking the first reference region (which can be the reference region closest to the current block in FIGS. 8A-8C) and the second reference region (which can be the reference region farther from the current block in FIGS. 8A-8C) as an example, the number of sub-regions in the first reference region and the second reference region can be the same (as in FIG. 8A); or, the number of sub-regions in the first reference region and the second reference region can be different (as in FIG. 8B or FIG. 8C); or, the size of the sub-region in the first reference region and the second reference region at the first orientation of the current block can be the same (as in the left orientation of the current block in FIG. 8A); or, the size of the sub-region in the first reference region and the second reference region at the first orientation of the current block can be different (as in the left and upper orientation in FIG. 8B or FIG. 8C).
[0261] In the related art, the number of reference regions corresponding to the DIMD mode is 1, and the embodiments of the present application introduce multiple reference regions. One possible implementation is to extend the DIMD mode in the related art so that it supports multiple reference regions. Another possible implementation is to provide the DIMD mode with multiple reference regions in the embodiments of the present application as a new DIMD mode. For example, the DIMD mode provided in the related art can be referred to as a first DIMD mode (the number of corresponding reference regions is 1), and the DIMD mode provided in the embodiments of the present application can be referred to as a second DIMD mode (the number of corresponding reference regions is greater than 1, which can be referred to as a multiple reference-area DIMD mode (MR_DIMD)). Then, the encoding end determines which DIMD mode to use according to the rate-distortion cost of the two DIMD modes. Next, the encoding end can write a third parameter into the code stream, which is used to determine or indicate the DIMD mode used by the current block. The third parameter can be referred to as mr_dimd_Flg, for example, which is used to indicate whether to use MR_DIMD. If mr_dimd_Flag is 1, the value of the first parameter (such as the first index) mentioned above can be transmitted; otherwise, the first parameter (such as the first index) is not transmitted.
[0262] In some embodiments, the gradient information determined in step S1610 can be stored. For example, the correspondence between the first parameter (e.g., the first index) and the gradient information can be stored, so as to diversely utilize the gradient information in the prediction process. Taking an example in which the gradient information includes a plurality of gradient histograms, the plurality of gradient histograms can be stored, and the information among the plurality of gradient histograms can be conveniently utilized in the prediction process. Exemplarily, at the encoding end, the gradient information (e.g., the gradient histogram information) corresponding to the available reference region index can be stored in units of the coding block, and one gradient histogram is stored for each reference region, and a maximum of N gradient histograms can be stored, where N can be an integer from 1 to 15. The HoG can be directly stored, or only the five IPMs with the highest amplitudes in the HoG and the corresponding amplitudes can be stored.
[0263] In some embodiments, in order to improve the utilization rate of the gradient information of the neighboring samples of the current block, the reference region step can be set to a smaller interval. For example, a plurality of reference regions can be set to be adjacent or overlapping. Exemplarily, the mapping relationship between the reference region index and the reference region step can be: DIMD_REF_LINE IDX[6] = {0, 2, 4, 6, 8, 10}. A mapping relationship between an L-shaped reference region index and a reference region is shown in FIG. 11, in which the size of the reference region is three rows and three columns, and the reference region step is an integer multiple of 2.
[0264] It is mentioned above that the reference region shape of the plurality of reference regions (or the first reference region) can have a plurality of optional shapes. The shape actually used can be determined by the rate-distortion cost at the encoding end. Then, the encoding end can write the fourth parameter (the index of the reference region shape) into the bitstream, and the fourth parameter can be used to indicate the shape of the reference region. Alternatively, in some embodiments, the reference region shape used by the current block can be determined based on the distribution of the gradient information in the reference regions with a plurality of shapes. For example, if the gradient information (e.g., the gradient histogram) of only the left region or only the top region of the current block is the main source of the gradient information (e.g., the gradient histogram) of the L-shaped region, the gradient information of only the left region or only the top region can be used to generate the prediction value. As an example, the gradient information of the L-shaped region, only the left region, and only the top region can be calculated respectively, and if the gradient information corresponding to the three or five main IPMs of the L-shaped region mainly comes from the L-shaped region, the gradient information of only the left region can be used to generate the prediction value. FIGS. 12A and 12B show the reference region shape as a rectangular shape, in which the reference region in FIG. 12A is only the left region of the current block, and the reference region in FIG. 12B is only the top region of the current block.
[0265] It is mentioned above that the reference region can be divided into a plurality of sub-regions. Examples of the division of the sub-regions in the reference region of various shapes are given below in connection with FIGS. 13A-13C (FIG. 13 is illustrated by taking an example of a reference region index step length of an integer multiple of 4, which can also be other values such as 3 or 5), in which FIG. 13A shows the division of the sub-regions in the left region only of the current block, FIG. 13B shows the division of the sub-regions in the top region only of the current block, and FIG. 13C shows the division of the sub-regions in the L-shaped region of the current block. In the process of encoding, the gradient information of the sub-regions can be flexibly used. For example, the gradient information of all the sub-regions can be used, or the gradient information of part of the sub-regions can be used, or the information between different sub-regions can be used separately, or the information between different sub-regions can be used in combination.
[0266] In some implementations, the width of the first reference region mentioned above is greater than or equal to 3. For example, the width of the first reference region can be 4, 5, 6, or other values.
[0267] In some implementations, the first reference region is determined based on the difference (or cost) between one or more prediction values of a template region of the current block and the reconstructed values of the template region. The one or more prediction values of the template region can be determined based on the gradient information of the samples in one or more reference regions. For example, one or more intra-prediction modes of the template region can be determined based on the gradient information of the samples in one or more reference regions, and then one or more prediction values of the template region are determined based on the one or more intra-prediction modes of the template region. Exemplarily, the reference region corresponding to the prediction values with the smallest difference or the optimal cost can be determined as the first reference region.
[0268] It should be noted that the shape and size of the template region are not limited by the embodiments of the present application. The shape of the template region can be L-shaped or rectangular. The size of the template region can be 3 rows and 3 columns, or 2 rows and 2 columns, or 4 rows and 4 columns, or 6 rows and 6 columns.
[0269] It should also be noted that the difference or cost between the prediction values and the reconstructed values of the template region can be SAD, or SATD, or a smaller value of SAD or SATD.
[0270] In some implementations, the encoding complexity at the encoding end can be reduced in certain ways. For example, at the encoding end, a rough selection process can be used to select some reference regions from a plurality of reference regions, and then the rate-distortion cost is calculated based on the selected reference regions to select the first reference region. Illustratively, the encoding end can maintain a rough selection list (the index of the reference region can be stored in the rough selection list, or the index of the DIMD mode can be stored in the rough selection list, and different DIMD modes correspond to different reference regions). In the process of encoding the current block, a Hadamard process can be used to select the two reference regions with the smallest cost in the reference region corresponding to the current block by using the SAD / SATD cost. Then, the cost of the two reference regions is compared with the cost of other modes in the rough selection list, and if the cost is smaller than the maximum cost in the rough selection list, the rough selection list is updated; otherwise, the two reference regions are added to the rough selection list. Then, the fine selection (such as calculating the RDO cost) can be performed based on the reference regions in the rough selection list, so as to reduce the encoding time complexity.
[0271] In some implementations, the rough selection list generated when the LFNST transform kernel is 0 can be loaded when the low-frequency non-separable transform (LFNST) transform kernel 1 / 2 / 3 is traversed. In this way, the number of mode rough selection performed at the encoding end can be reduced, and thus the encoding complexity at the encoding end can be reduced. This scheme can be used in combination with the previous scheme.
[0272] In some implementations, the rough selection list loaded when the transform mode is traversed can be pruned, so as to reduce the complexity of the mode fine selection process, and thus reduce the encoding complexity. One implementation of pruning is that the modes in the loaded rough selection list are analyzed, and if the cost corresponding to the MR_DIMD mode is greater than N times the minimum cost in the rough selection list, the mode is deleted from the rough selection list, and thus the number of modes that need to be calculated in the subsequent mode fine selection is reduced. The value of N can be any value between 1.0-2.0, for example, 1.5 or 1.3. This scheme can be used in combination with the two schemes described above.
[0273] In some implementations, the prediction values generated by the first DIMD (the DIMD mode provided by the related art) and the second DIMD mode (the DIMD mode provided by the embodiments of the present application, which can be referred to as the MR_DIMD mode) can be stored when the mode rough selection is performed. Then, the prediction values can be directly loaded in the subsequent mode fine selection, so as to reduce the number of times of calculating the prediction values, and thus reduce the encoding complexity at the encoding end. This scheme can be used in combination with one or more of the schemes related to the rough selection and fine selection processes described above.
[0274] In some embodiments, the method of FIG. 16 can further include writing a fifth parameter into the bitstream. The fifth parameter is used to indicate whether the current block uses the DIMD mode. The fifth parameter can be a flag, such as intra_dimd_flag, to indicate whether the DIMD related mode is used to generate the prediction value. For example, intra_dimd_flag being equal to 1 indicates that the intra prediction mode of the current block is the DIMD related mode, and intra_dimd_flag being equal to 0 indicates that the intra prediction mode of the current block is not the DIMD related mode.
[0275] FIG. 17 is a flowchart illustrating an encoding method according to another embodiment of the present disclosure. The method of FIG. 17 can also be referred to as an intra prediction method, or a prediction method based on the DIMD mode. The method of FIG. 17 can be applied to an encoder, such as an intra prediction unit of an encoder.
[0276] Referring to FIG. 17, in step S1710, a reference template of the current block is determined. The reference template mentioned herein is the same concept as the reference region mentioned above, and the two can be used interchangeably. The reference template can include one or more reconstructed samples (or reconstructed pixels) in the image in which the current block is located. The reconstructed samples in the reference template can be the samples in the left three columns and the top three rows of the current block, or more rows / columns of samples, or fewer rows / columns of samples. The shape of the reference template can be L-shaped, or rectangular.
[0277] In step S1720, a candidate intra prediction mode set of the current block is determined based on the reference template. For example, based on the DIMD mode, a candidate intra prediction mode is determined for one reference template. Then, the candidate intra prediction mode is added to the candidate intra prediction mode set.
[0278] In step S1730, a first intra prediction mode of the current block is determined based on the candidate intra prediction mode set of the current block. For example, the first intra prediction mode is determined based on the rate-distortion cost of the candidate intra prediction modes in the candidate intra prediction mode set. Alternatively, the first intra prediction mode can also be determined based on the difference between one or more prediction values of the template region of the current block and the reconstructed values of the template region. The one or more prediction values of the template region are determined based on one or more candidate intra prediction modes in the candidate intra prediction mode set. For example, the template region can be predicted based on the one or more candidate intra prediction modes to obtain the one or more prediction values. For example, the candidate prediction mode corresponding to the prediction value with the smallest difference or the optimal cost can be determined as the first intra prediction mode.
[0279] It should be noted that the embodiments of the present application do not limit the shape and size of the template region. The shape of the template region can be L-shaped, or rectangular. The size of the template region can be 3 rows and 3 columns, or 2 rows and 2 columns, 4 rows and 4 columns, or 6 rows and 6 columns.
[0280] In step S1740-S1750, the prediction value of the current block is determined according to the first intra prediction mode; and the current block is encoded according to the prediction value of the current block. For example, the residual value of the current block can be determined according to the original value and the prediction value of the current block; and then the residual value of the current block is encoded.
[0281] In some implementations, the method of FIG. 17 can further include writing the first index into the bitstream. The first index satisfies one of the following:
[0282] The first index is used to indicate the first intra prediction mode from the candidate intra prediction mode set;
[0283] The first index is the serial number of the first intra prediction mode in the candidate intra prediction mode set;
[0284] The first index is used to indicate the reference template used by the current block from one or more reference templates;
[0285] The first index is used to indicate the position of the reference template used by the current block.
[0286] It should be noted that the decoding method mentioned in each embodiment of the present application can also be referred to as a video decoding method or an image decoding method. The encoding method mentioned in each embodiment of the present application can also be referred to as a video encoding method or an image encoding method.
[0287] It should also be noted that the sample mentioned in each embodiment of the present application can also be referred to as a pixel.
[0288] The embodiments of the present application will be described in more detail below with specific examples. It should be noted that the following examples are only to help those skilled in the art to understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific values or specific scenarios exemplified. Those skilled in the art can obviously make various equivalent modifications or changes according to the examples given, and such modifications or changes also fall within the scope of the embodiments of the present application.
[0289] In the process of deriving the intra prediction mode by DIMD, this example proposes a method of extending the reference region of DIMD by using reference samples in a larger region to calculate different gradient information.
[0290] Specifically, a plurality of reference regions are selected at a fixed step length on the left and upper sides of the current block, gradient information is calculated using some or all sample points in the reference region as candidate gradient information of the current block, the reference region shape can be an L-shaped region or only a left region or only an upper region, and the region size is not limited and can be three rows and three columns, or four rows and four columns, or six rows and six columns. The candidate gradient information with the minimum cost is selected after decision at the encoding end, and the corresponding reference region index is transmitted. The reference region index is used to obtain the reference region at the decoding end, and the corresponding gradient information is derived in the same way, and the gradient information is used for prediction.
[0291] The following is an example of a modified example of the process of obtaining an intra-frame reconstructed block at the decoding end. In this example, an MR_DIMD mode is proposed, which determines whether the current block uses the DIMD mode or the MR_DIMD mode to generate a prediction value according to the DIMD reference index. The specific modifications are as follows:
[0292] At the decoding end, the basic decoding process of obtaining an intra-frame reconstructed block includes the following steps: parsing syntax elements from a bitstream and obtaining a prediction residual, obtaining a prediction value, and determining a reconstructed value. An embodiment of the decoding end is shown in FIG. 18.
[0293] In the process of parsing syntax elements, DIMD Flag (indicating whether it is a DIMD related mode) is first parsed to determine whether the current block generates a prediction value by the DIMD related mode. If the prediction value is generated by the DIMD related mode (DIMD Flag is 1), DIMD Idx is parsed; otherwise, other syntax elements related to intra-frame prediction modes are parsed. The related syntax semantics table is shown in Table 2.
[0294] When the prediction value is generated by the DIMD related mode (DIMD Flag is 1), according to the parsed DIMD Idx, if DIMD Idx is 0, the prediction information is generated by the original DIMD mode, and if DIMD Idx is greater than 0, the prediction information is derived by the MR_DIMD mode.
[0295] Table 2. Syntax semantics related to CU layer DIMD related mode
[0296] intra_dimd_flag: indicates whether the prediction value is generated by the DIMD related mode. intra_dimd_flag is 1, indicating that the intra-frame prediction mode of the luminance sample is the DIMD related mode, and intra_dimd_flag is 0, indicating that the intra-frame prediction mode of the luminance sample is not the DIMD related mode.
[0297] intra_dimd_idx: indicates the DIMD related mode reference region index.
[0298] The implementation process of the proposed method is described in detail below. The implementation of S1 can refer to the description above. S2 is the MR_DIMD mode, and the specific process is shown in FIG. 19.
[0299] S2.1 Obtain reference samples
[0300] The input of step S2.1 is the available reference region index Idx of the current luma block, and the output is the reference samples.
[0301] a. Obtain the available reference region index
[0302] At the encoding end, it is checked whether the reference region corresponding to the reference region index Idx has been reconstructed or whether it is out of the picture boundary. If the check is available, the next step is performed; otherwise, the operation on the subsequent reference region index (the index greater than Idx) is skipped.
[0303] At the decoding end, the reference region index Idx is directly obtained through the code stream analysis.
[0304] b. Obtain the reference region, which can be an L-shaped region or a rectangular region, such as only the left region, only the upper-left region, only the upper region, only the lower-left region, only the upper-right region, etc. The reference region can also be a combination of multiple different regions, such as a combination of one left region and one upper region.
[0305] The mapping relationship between the reference region index Idx and the reference region step can be represented in the form of an array as DIMD_REF_LINE_IDX[N] = {M0, M1, …, M N-1}, where N is the total number of reference regions, M0~M N-1 are the row / column numbers of the lower / right starting positions of the reference regions from the current block. The value of N is generally an integer value between 2 and 10 (including 2 and 10), and the values of M0~M N-1 are generally integer values between 0 and 64 (including 0 and 64). The relationship between M0~M N-1 may be an arithmetic sequence (such as 2, 3, 4, 8 integer multiples), or a geometric sequence relationship (such as powers of 2).
[0306] The mapping relationship can be:
[0307] predefined;
[0308] or transmitted by high-level syntax;
[0309] or has multiple groups of definitions and uses the serial number transmitted by the high-level syntax to determine which group to use;
[0310] Or determined by other conditions, such as the size of the CU, the mode of the CU layer selection (information such as the reference region is L-shaped or rectangular, etc.), etc. to determine which mapping relationship is used.
[0311] For example, a mapping relationship between an L-shaped reference region index Idx and a reference region step is: DIMD_REF_LINE_IDX[6] = {0, 4, 8, 12, 16, 20}, that is, when the index value is 0, it corresponds to the immediately adjacent row / column, that is, the row / column number of the reference region is 0; when the index value is 1, it corresponds to the row / column that is 4 rows apart, and the row / column number of the reference region is 4 at this time. And so on. The reference region step is the horizontal and vertical offset between the reference region and the current block. A mapping relationship between an L-shaped reference region index Idx and a reference region is shown in FIG. 7, in which the size of the reference region is three rows and three columns.
[0312] c. Obtain part or all of the reconstructed samples in the reference region.
[0313] S2.2 MR_DIMD intra mode derivation
[0314] The input of step S2.2 is the available reference region index Idx of the current luminance block, and the reference sample corresponding to the reference region index Idx. The output has different contents in different scenarios: in the MR_DIMD intra prediction value acquisition scenario, it is histogram information; in other application scenarios, it can be a traditional intra prediction mode IntraPredModeDM, wherein IntraPredModeDM is between [0, 66]. According to the reference sample corresponding to the reference region index, the MR_DIMD intra mode is derived, and the derivation method is consistent with S1.2 in the foregoing.
[0315] S2.3 MR_DIMD prediction value acquisition
[0316] Using the histogram information derived by different reference region indexes, the prediction value of the current block is obtained, and the acquisition method is consistent with S1.3 in the foregoing.
[0317] The present scheme proposes a technical scheme using more DIMD reference regions, which can effectively use the reference samples in a larger region to calculate different gradient information, and improves the accuracy and diversity of generating prediction values according to the derived intra prediction mode. The method is tested on ECM12.0 with a 48-frame interval under the All Intra condition, and can obtain a -0.08% BD-rate change (i.e. average code rate change under the same psnr) on the Y component.
[0318] The method embodiments of the present application are described in detail above in combination with FIG. 1 to FIG. 19, and the device embodiments of the present application are described in detail below in combination with FIG. 20 to FIG. 30. It should be understood that the description of the method embodiments corresponds to the description of the device embodiments, and therefore, the parts not described in detail can be referred to the method embodiments.
[0319] FIG. 20 is a structural schematic diagram of a decoder according to an embodiment of the present application. The decoder 2000 in FIG. 20 includes a first determining module 2010, a second determining module 2020, a third determining module 2030, and a fourth determining module 2040. The first determining module 2010 is configured to determine gradient information according to at least one reconstructed sample around a current block. The second determining module 2020 is configured to determine a first intra prediction mode according to the gradient information. The third determining module 2030 is configured to determine a prediction block of the current block according to the first intra prediction mode. The fourth determining module 2040 is configured to determine a reconstructed block of the current block according to the prediction block of the current block.
[0320] In some embodiments, the at least one sample includes a first sample, and the first sample is located outside a first region, and the first region is an L-shaped region formed by left three columns of neighboring samples of the current block and upper three rows of neighboring samples of the current block.
[0321] In some embodiments, the at least one sample includes a sample in a first reference region, and the first reference region is one of a plurality of reference regions, and each of the plurality of reference regions is a reconstructed region.
[0322] In some embodiments, the first reference region is determined based on a first parameter in a bitstream, and the first parameter is used to indicate the first reference region from the plurality of reference regions.
[0323] In some embodiments, a plurality of values of the first parameter have a first mapping relationship with the plurality of reference regions, and the first mapping relationship is determined based on at least one of the following:
[0324] a predefined mapping relationship;
[0325] a second parameter in the bitstream;
[0326] a size of the current block;
[0327] a shape of a reference region corresponding to the current block.
[0328] In some embodiments, the first mapping relationship belongs to one of a plurality of predefined mapping relationships, and the first mapping relationship is determined from the plurality of mapping relationships based on at least one of the following:
[0329] a size of the current block;
[0330] a shape of a reference region corresponding to the current block.
[0331] In some embodiments, if a size of the current block is a first size, in the first mapping relationship, a spacing between adjacent regions in the plurality of reference regions is a first spacing; if the size of the current block is a second size, in the first mapping relationship, the spacing between adjacent regions in the plurality of reference regions is a second spacing; wherein the first spacing is different from the second spacing.
[0332] In some embodiments, the first size is smaller than the second size, and the first spacing is smaller than the second spacing.
[0333] In some embodiments, if the size of the current block is a first size, in the first mapping relationship, a number of reference regions contained in the plurality of reference regions is a first number; if the size of the current block is a second size, in the first mapping relationship, the number of reference regions contained in the plurality of reference regions is a second number; wherein the first number is different from the second number.
[0334] In some embodiments, the first size is smaller than the second size, and the first number is smaller than the second number.
[0335] In some embodiments, the at least one sample further comprises a sample in a reference region in the plurality of reference regions between the first reference region and the current block.
[0336] In some embodiments, the at least one sample comprises a sample in part or all of a sub-region in the first reference region.
[0337] In some embodiments, the at least one sample comprises a sample in a plurality of target regions, the plurality of target regions satisfying one of the following:
[0338] the plurality of target regions are the plurality of reference regions;
[0339] the plurality of target regions are part or all of a sub-region in the first reference region;
[0340] the plurality of target regions comprise part of a sub-region in the first reference region and part of a sub-region in a second reference region, the second reference region belonging to the plurality of reference regions;
[0341] the plurality of target regions comprise the first reference region and part of a sub-region in the second reference region.
[0342] In some embodiments, the first intra prediction mode is determined based on magnitudes corresponding to the plurality of intra prediction modes, the magnitudes corresponding to the plurality of intra prediction modes are determined based on gradient information of samples in the plurality of target regions, respectively.
[0343] In some embodiments, the first intra prediction mode is determined based on the magnitudes corresponding to the plurality of intra prediction modes and weights corresponding to the plurality of intra prediction modes, the weights corresponding to the plurality of intra prediction modes are determined based on at least one of:
[0344] the magnitudes corresponding to the plurality of intra prediction modes;
[0345] a distance between the plurality of target regions and the current block.
[0346] In some embodiments, a number of sub-regions in the first reference region and a number of sub-regions in the second reference region are same, the second reference region belongs to the plurality of reference regions; or, the number of sub-regions in the first reference region and the number of sub-regions in the second reference region are different; or, sizes of sub-regions in the first reference region and the second reference region located at a first orientation of the current block are same; or, the sizes of sub-regions in the first reference region and the second reference region located at the first orientation of the current block are different.
[0347] In some embodiments, the at least one sample includes partial samples in the first reference region.
[0348] In some embodiments, the decoder further includes a first parsing module configured to parse a bitstream to determine a third parameter, the third parameter being used to determine a decoding-side intra mode derivation (DIMD) mode used by the current block, the DIMD mode used by the current block including a first DIMD mode and a second DIMD mode, a number of reference regions corresponding to the first DIMD mode being 1, and a number of reference regions corresponding to the second DIMD mode being greater than 1.
[0349] In some embodiments, the decoder further includes a storage module configured to store the gradient information.
[0350] In some embodiments, the plurality of reference regions are adjacent or overlapping.
[0351] In some embodiments, a shape of the first reference region is determined based on at least one of:
[0352] a fourth parameter in the bitstream;
[0353] a distribution of gradient information in the plurality of shapes of reference regions.
[0354] In some embodiments, the width of the first reference region is greater than or equal to 3.
[0355] In some embodiments, the first reference region is determined based on a difference between one or more prediction values of a template region of the current block and reconstructed values of the template region, the one or more prediction values of the template region being determined based on gradient information of samples in one or more reference regions.
[0356] In some embodiments, the decoder further includes a second parsing module configured to parse the bitstream to determine a fifth parameter, the fifth parameter being used to indicate whether the current block uses the DIMD mode.
[0357] It can be understood that, in the embodiments of the present application, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in one processing unit, or can be physically present individually, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.
[0358] When the integrated unit is realized in the form of a software function 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 solutions of the embodiments can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the methods described in the embodiments. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program codes that can be stored in the medium.
[0359] Therefore, the embodiments of the present application provide a computer readable storage medium applied to the decoder 2000, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the decoding method in any of the foregoing embodiments.
[0360] Based on the above components of the decoder 2000 and the computer readable storage medium, referring to FIG. 21, a specific hardware structure diagram of the decoder 2000 is shown. As shown in FIG. 21, the decoder 2100 can include a communication interface 2110, a memory 2120 and a processor 2130; and the various components are coupled together through a bus system 2140. It can be understood that the bus system 2140 is used to realize the connection communication between the components. The bus system 2140 includes not only a data bus, but also a power supply bus, a control bus and a status signal bus. However, in order to clearly illustrate, various buses are marked as the bus system 2140 in FIG. 21. Among them,
[0361] The communication interface 2110 is configured to receive and send signals in the process of transmitting information with other external network elements;
[0362] The memory 2120 is configured to store a computer program;
[0363] The processor 2130 is configured to execute the following when running the computer program:
[0364] Determine gradient information according to at least one reconstructed sample around the current block;
[0365] Determine a first intra prediction mode according to the gradient information;
[0366] Determine a prediction block of the current block according to the first intra prediction mode;
[0367] Determine a reconstructed block of the current block according to the prediction block of the current block.
[0368] It is to be understood that the memory 2120 in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 2120 of the system and method described in the present application is intended to include, without being limited to, these and any other suitable types of memory.
[0369] The processor 2130 can be an integrated circuit chip powerfully processing signals. In implementation process, each step of the above method can be completed by the integrated logic circuit or the instruction in the form of software in the processor 2130. The processor 2130 described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logic block in the embodiments of the present application can be realized or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor to execute, or be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register, or other mature storage medium in the art. The storage medium is located in the storage 2120, and the processor 2130 reads the information in the storage 2120 and combines the hardware to complete the steps of the above method.
[0370] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for executing the functions described in the present application, or a combination thereof. For software implementation, the technologies described in the present application can be implemented by modules (such as processes, functions, etc.) for executing the functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0371] Optionally, as another embodiment, the processor 2130 is further configured to execute the decoding method described in the foregoing embodiments when running the computer program.
[0372] FIG. 22 is a schematic diagram of an encoder according to an embodiment of the present application. As shown in FIG. 22, the encoder 2200 includes a first determining module 2210, a second determining module 2220, a third determining module 2230, and a fourth determining module 2240. The first determining module 2210 is configured to determine gradient information according to at least one reconstructed sample around a current block. The second determining module 2220 is configured to determine a first intra prediction mode according to the gradient information. The third determining module 2230 is configured to determine a prediction block of the current block according to the first intra prediction mode. The fourth determining module 2240 is configured to determine a residual block of the current block according to the prediction block of the current block.
[0373] In some embodiments, the at least one sample includes a first sample, and the first sample is located outside a first region, and the first region is an L-shaped region formed by left three columns of neighboring samples of the current block and upper three rows of neighboring samples of the current block.
[0374] In some embodiments, the at least one sample includes a sample in a first reference region, and the first reference region is one of a plurality of reference regions, and each of the plurality of reference regions is a reconstructed region.
[0375] In some embodiments, the encoder further includes a first encoding module configured to write a first parameter into a bitstream, and the first parameter is used to indicate the first reference region from the plurality of reference regions.
[0376] In some embodiments, a plurality of values of the first parameter have a first mapping relationship with the plurality of reference regions, and the first mapping relationship is determined based on at least one of the following:
[0377] a predefined mapping relationship;
[0378] a size of the current block;
[0379] a shape of a reference region corresponding to the current block.
[0380] In some embodiments, the first mapping relationship is one of a plurality of predefined mapping relationships, and the first mapping relationship is determined from the plurality of mapping relationships based on at least one of the following:
[0381] a size of the current block;
[0382] a shape of a reference region corresponding to the current block.
[0383] In some embodiments, if the size of the current block is a first size, in the first mapping relationship, a spacing between adjacent regions in the plurality of reference regions is a first spacing.
[0384] If a size of the current block is a second size, in the first mapping relationship, intervals between adjacent regions in the plurality of reference regions are a second interval.
[0385] Wherein the first interval is different from the second interval.
[0386] In some implementations, the first size is smaller than the second size, and the first interval is smaller than the second interval.
[0387] In some implementations, if the size of the current block is a first size, in the first mapping relationship, a number of reference regions contained in the plurality of reference regions is a first number.
[0388] If the size of the current block is a second size, in the first mapping relationship, a number of reference regions contained in the plurality of reference regions is a second number.
[0389] Wherein the first number is different from the second number.
[0390] In some implementations, the first size is smaller than the second size, and the first number is smaller than the second number.
[0391] In some implementations, the at least one sample further includes a sample in a reference region in the plurality of reference regions between the first reference region and the current block.
[0392] In some implementations, the at least one sample includes a sample in part or all of the sub-regions in the first reference region.
[0393] In some implementations, the at least one sample includes a sample in a plurality of target regions, the plurality of target regions satisfying one of the following:
[0394] The plurality of target regions are the plurality of reference regions.
[0395] The plurality of target regions are part or all of the sub-regions in the first reference region.
[0396] The plurality of target regions include part of the sub-regions in the first reference region and part of the sub-regions in a second reference region, the second reference region belonging to the plurality of reference regions.
[0397] The plurality of target regions include the first reference region and part of the sub-regions in the second reference region.
[0398] In some embodiments, the first intra prediction mode is determined based on magnitudes corresponding to the plurality of intra prediction modes, the magnitudes corresponding to the plurality of intra prediction modes are determined based on gradient information of samples in the plurality of target regions, respectively.
[0399] In some embodiments, the first intra prediction mode is determined based on the magnitudes corresponding to the plurality of intra prediction modes and weights corresponding to the plurality of intra prediction modes, the weights corresponding to the plurality of intra prediction modes are determined based on at least one of:
[0400] the magnitudes corresponding to the plurality of intra prediction modes;
[0401] a distance between the plurality of target regions and the current block.
[0402] In some embodiments, a number of sub-regions in the first reference region and a number of sub-regions in the second reference region are same, the second reference region belongs to the plurality of reference regions; or,
[0403] the number of sub-regions in the first reference region and the number of sub-regions in the second reference region are different; or,
[0404] sizes of sub-regions in the first reference region and sub-regions in the second reference region located at a first orientation of the current block are same; or,
[0405] sizes of sub-regions in the first reference region and sub-regions in the second reference region located at the first orientation of the current block are different.
[0406] In some embodiments, the at least one sample includes partial samples in the first reference region.
[0407] In some embodiments, the encoder further includes a second encoding module configured to write a third parameter into a bitstream, the third parameter being used to determine a decoding-side intra mode derivation (DIMD) mode used by the current block, the DIMD mode used by the current block including a first DIMD mode and a second DIMD mode, a number of reference regions corresponding to the first DIMD mode being 1, and a number of reference regions corresponding to the second DIMD mode being greater than 1.
[0408] In some embodiments, the encoder further includes a storage module configured to store the gradient information.
[0409] In some embodiments, the plurality of reference regions are adjacent or overlapped.
[0410] In some embodiments, a shape of the first reference region is determined based on at least one of:
[0411] a cost between the prediction value determined based on the plurality of shapes of the reference region and the original value;
[0412] a distribution of gradient information in the plurality of shapes of the reference region.
[0413] In some implementations, the first reference region has a width greater than or equal to 3.
[0414] In some implementations, the first reference region is determined based on a difference between one or more prediction values of a template region of the current block and reconstructed values of the template region, the one or more prediction values of the template region being determined based on gradient information of samples in one or more reference regions.
[0415] In some implementations, the encoder further includes a third encoding module configured to write a fifth parameter into a bitstream, the fifth parameter being used to indicate whether the current block uses the DIMD mode.
[0416] It can be understood that, in the embodiments of the present application, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in one processing unit, or can be physically present individually, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.
[0417] When the integrated unit is realized in the form of a software function 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 solutions of the embodiments can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the embodiments. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0418] Therefore, the embodiments of the present application provide a computer readable storage medium applied to the encoder 2200, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the encoding method in any one of the foregoing embodiments.
[0419] Based on the above components of the encoder 2200 and the computer readable storage medium, referring to FIG. 23, a specific hardware structure diagram of the encoder 2200 is shown. As shown in FIG. 23, the encoder 2300 can include a communication interface 2310, a memory 2320 and a processor 2330; each component is coupled together through a bus system 2340. It can be understood that the bus system 2340 is used to realize the connection communication between the components. The bus system 2340 includes not only a data bus, but also a power supply bus, a control bus and a status signal bus. However, in order to clearly illustrate, various buses are marked as the bus system 2340 in FIG. 23. Among them,
[0420] The communication interface 2310 is configured to receive and send signals in the process of transceiving information with other external network elements;
[0421] The memory 2320 is configured to store a computer program;
[0422] The processor 2330 is configured to execute the following steps when running the computer program:
[0423] Determine gradient information according to at least one reconstructed sample around the current block;
[0424] Determine a first intra prediction mode according to the gradient information;
[0425] Determine a prediction block of the current block according to the first intra prediction mode;
[0426] Determine a residual block of the current block according to the prediction block of the current block.
[0427] It is to be appreciated that the memory 2320 in the embodiments of this application can be volatile, nonvolatile, or a combination of both. By way of example, the nonvolatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which acts as external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double-Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), SynchBurst DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The memory 2320 of the subject systems and methods is intended to include, without being limited to, these and any other suitable types of memory.
[0428] The processor 2330 can be an integrated circuit chip powerfully processing signals. In the implementation process, the steps of the foregoing method can be completed by the integrated logic electric circuit in the processor 2330 or the instruction of the software form. The processor 2330 can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic device, discrete hardware component. The methods, steps and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor to execute, or a combination of hardware and software modules in the code processor to execute. The software module can be located in the random access memory, the flash memory, the read only memory, the programmable read only memory or the electrically erasable programmable memory, the register or other mature storage medium in the art. The storage medium is located in the storage 2320, and the processor 2330 reads the information in the storage 2320 and combines the hardware to complete the steps of the foregoing method.
[0429] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for executing the functions described in the present application or a combination thereof. For software implementation, the technology described in the present application can be implemented by modules (such as processes, functions, etc.) for executing the functions described in the present application. The software code can be stored in the memory and executed by the processor. The memory can be implemented in the processor or outside the processor.
[0430] Optionally, as another embodiment, the processor 2330 is further configured to execute the encoding method in the foregoing embodiments when running the computer program.
[0431] FIG. 24 is a schematic diagram of a structure of a decoder according to an embodiment of the present application. The decoder 2400 in FIG. 24 includes a parsing module 2410, a first determining module 2420, a second determining module 2430, a third determining module 2440, and a fourth determining module 2450. The parsing module 2410 is configured to parse a bitstream to determine a reference template of a current block. The first determining module 2420 is configured to determine a first mode parameter according to the reference template of the current block. The second determining module 2430 is configured to determine a first intra prediction mode of the current block according to the first mode parameter. The third determining module 2440 is configured to determine a prediction value of the current block according to the first intra prediction mode. The fourth determining module 2450 is configured to determine a reconstructed block of the current block according to the prediction value of the current block.
[0432] In some embodiments, the first parsing module is configured to parse the bitstream to determine a first index, the first index being used to determine the reference template of the current block.
[0433] In some embodiments, the first index is used to indicate the reference template of the current block, or the first index is used to indicate a position of the reference template.
[0434] In some embodiments, the reference template of the current block is determined based on a difference between one or more prediction values of a template region of the current block and reconstructed values of the template region, the one or more prediction values of the template region being determined based on gradient information of samples in one or more reference templates.
[0435] In some embodiments, the first mode parameter is used to indicate a texture feature of a sample in the reference template.
[0436] In some embodiments, the first mode parameter is a gradient of one or more reconstructed samples in the reference template.
[0437] In some embodiments, the gradient is determined based on a horizontal gradient and a vertical gradient of a reconstructed sample in the reference template, the horizontal gradient and the vertical gradient being determined based on a Sobel operator.
[0438] It can be understood that, in the embodiments of the present application, "unit" can be part of a circuit, part of a processor, part of a program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in one processing unit, or can be physically present as individual units, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.
[0439] The integrated unit, if implemented in the form of a software function 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 essentially or the part of the prior art that contributes to the technical solutions 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 and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in the embodiments. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0440] Therefore, the embodiments of the present application provide a computer readable storage medium applied to the decoder 2400, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the decoding method in any of the foregoing embodiments.
[0441] Based on the composition of the decoder 2400 and the computer readable storage medium, referring to FIG. 25, a specific hardware structure schematic diagram of the decoder 2400 is shown. As shown in FIG. 25, the decoder 2500 can include a communication interface 2510, a memory 2520, and a processor 2530. The various components are coupled together through a bus system 2540. It can be understood that the bus system 2540 is used to realize the connection and communication between the components. The bus system 2540 includes a data bus, a power bus, a control bus, and a status signal bus. However, for the purpose of clarity, all kinds of buses are marked as the bus system 2540 in FIG. 25. Among them,
[0442] The communication interface 2510 is used for receiving and sending signals in the process of transceiving information with other external network elements;
[0443] The memory 2520 is used for storing a computer program;
[0444] The processor 2530 is used for executing the following steps when running the computer program:
[0445] Parsing a code stream to determine a reference template of a current block;
[0446] Determining a first mode parameter according to the reference template of the current block;
[0447] Determining a first intra prediction mode of the current block according to the first mode parameter;
[0448] determining a prediction value of the current block according to the first intra prediction mode;
[0449] determining a reconstructed block of the current block according to the prediction value of the current block.
[0450] It can be understood that the memory 2520 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. The volatile memory can be a random access memory (Random Access Memory, RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 2520 of the system and method described in the present application is intended to include, but not limited to, these and any other suitable types of memory.
[0451] The processor 2530 can be an integrated circuit chip powerfully processing signals. In implementation process, each step of the above method can be completed by the integrated logic circuit or the instruction in the form of software in the processor 2530. The processor 2530 described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logic block in the embodiments of the present application can be realized or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor to execute, or be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register, or other mature storage medium in the art. The storage medium is located in the memory 2520, and the processor 2530 reads the information in the memory 2520 and combines the hardware to complete the steps of the above method.
[0452] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for executing the functions described in the present application or a combination thereof. For software implementation, the technologies described in the present application can be realized by modules (such as processes, functions, etc.) for executing the functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0453] Optionally, as another embodiment, the processor 2530 is further configured to execute the decoding method described in the foregoing embodiments when running the computer program.
[0454] FIG. 26 is a schematic diagram of a structure of a decoder according to an embodiment of the present application. The decoder 2600 of FIG. 26 includes a first determining module 2610, a second determining module 2620, a third determining module 2630, and a fourth determining module 2640. The first determining module 2610 is configured to determine a candidate intra prediction mode set of a current block according to reconstructed samples of a picture in which the current block is located. The second determining module 2620 is configured to determine a first intra prediction mode of the current block according to the candidate intra prediction mode set. The third determining module 2630 is configured to determine a prediction value of the current block according to the first intra prediction mode. The fourth determining module 2640 is configured to determine a reconstructed block of the current block according to the prediction value of the current block.
[0455] In some embodiments, the candidate intra prediction mode set includes one or more candidate intra prediction modes.
[0456] In some embodiments, the candidate intra prediction mode set is determined based on one or more reference templates of the current block.
[0457] In some embodiments, the reconstructed samples included in the one or more reference templates are determined based on one or more of the following:
[0458] predefined information;
[0459] a size of the current block;
[0460] shape information of a reference region corresponding to the current block.
[0461] In some embodiments, for one reference template, one candidate intra prediction mode is determined based on a decoded intra mode derivation (DIMD) mode.
[0462] In some embodiments, the first intra prediction mode is determined from the candidate intra prediction mode set based on a first index in a bitstream.
[0463] In some embodiments, the first intra prediction mode is determined based on a difference between one or more prediction values of a template region of the current block and reconstructed values of the template region, the one or more prediction values of the template region being determined based on one or more candidate intra prediction modes in the candidate intra prediction mode set.
[0464] It can be understood that, in the embodiments of the present application, the "unit" can be part of a circuit, part of a processor, part of a program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in a processing unit, or can be physically present as individual units, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.
[0465] The integrated unit, if realized in the form of a software function module and not sold or used as an independent product, can be stored in a computer-readable storage medium, based on this understanding, the technical solutions of the embodiments essentially or the parts that contribute 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, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the method described in 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 media that can store program codes.
[0466] Therefore, the embodiments of the present application provide a computer-readable storage medium applied to the decoder 2600, the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to realize the decoding method in any of the foregoing embodiments.
[0467] Based on the components of the decoder 2600 and the computer-readable storage medium, referring to FIG. 27, a specific hardware structure diagram of the decoder 2600 is shown. As shown in FIG. 27, the decoder 2700 can include a communication interface 2710, a memory 2720, and a processor 2730; the various components are coupled together through a bus system 2740. It can be understood that the bus system 2740 is used to realize the connection communication between the components. The bus system 2740 includes not only a data bus, but also a power bus, a control bus, and a status signal bus. However, for the purpose of clear illustration, various buses are marked as the bus system 2740 in FIG. 27. Among them,
[0468] The communication interface 2710 is used for receiving and sending signals in the process of transceiving information with other external network elements;
[0469] The memory 2720 is used for storing a computer program;
[0470] The processor 2730, configured to, when the computer program is run:
[0471] determine a candidate intra prediction mode set of the current block according to reconstructed samples of an image where the current block is located;
[0472] determine a first intra prediction mode of the current block according to the candidate intra prediction mode set;
[0473] determine a prediction value of the current block according to the first intra prediction mode;
[0474] determine a reconstructed block of the current block according to the prediction value of the current block.
[0475] It can be understood that the memory 2720 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM) or a flash memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache. By way of example, but not by way of limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM) and Direct Rambus RAM (DRRAM). The memory 2720 of the system and method described in the present application is intended to include, but not limited to, these and any other suitable types of memory.
[0476] The processor 2730 can be an integrated circuit chip on which signal processing capabilities are implemented. In implementation, the steps of the above method can be completed by integrated logic circuits or instructions in the form of software in the processor 2730. The processor 2730 described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor to execute, or be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register, or other mature storage medium in the art. The storage medium is located in the memory 2720, and the processor 2730 reads the information in the memory 2720 and combines the hardware to complete the steps of the above method.
[0477] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for executing the functions described in the present application, or a combination thereof. For software implementation, the technologies described in the present application can be implemented by modules (such as processes, functions, etc.) for executing the functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0478] Alternatively, as another embodiment, the processor 2730 is further configured to execute the decoding method described in the foregoing embodiments when running the computer program.
[0479] FIG. 28 is a schematic diagram of an encoder according to an embodiment of the present application. As shown in FIG. 28, the encoder 2800 includes a first determining module 2810, a second determining module 2820, a third determining module 2830, a fourth determining module 2840, and an encoding module 2850. The first determining module 2810 is configured to determine a reference template of a current block. The second determining module 2820 is configured to determine a candidate intra prediction mode set of the current block according to the reference template. The third determining module 2830 is configured to determine a first intra prediction mode of the current block according to the candidate intra prediction mode set of the current block. The fourth determining module 2840 is configured to determine a prediction value of the current block according to the first intra prediction mode. The encoding module 2850 is configured to encode the current block according to the prediction value of the current block.
[0480] In some embodiments, the second determining module 2820 is configured to determine one candidate intra prediction mode based on a decoded-in-loop mode derivation (DIMD) mode for one reference template.
[0481] In some embodiments, the first intra prediction mode is determined based on rate-distortion cost of candidate intra prediction modes in the candidate intra prediction mode set.
[0482] In some embodiments, the first intra prediction mode is determined based on difference between one or more prediction values of a template region of the current block and reconstructed values of the template region, the one or more prediction values of the template region being determined based on one or more candidate intra prediction modes in the candidate intra prediction mode set.
[0483] In some embodiments, the encoding module is further configured to write a first index into a bitstream, the first index satisfying one of the following:
[0484] The first index is used to indicate the first intra prediction mode from the candidate intra prediction mode set;
[0485] The first index is a serial number of the first intra prediction mode in the candidate intra prediction mode set;
[0486] The first index is used to indicate a reference template used by the current block from one or more reference templates;
[0487] The first index is used to indicate a position of the reference template used by the current block.
[0488] It can be understood that, in the embodiments of the present application, the "unit" can be part of a circuit, part of a processor, part of a program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in a processing unit, or can be physically present as individual units, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.
[0489] The integrated unit, if realized in the form of a software function 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 essentially or the parts that contribute 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, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the method described in 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 media that can store program codes.
[0490] Therefore, the embodiments of the present application provide a computer readable storage medium applied to the encoder 2800, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the encoding method in any one of the foregoing embodiments.
[0491] Based on the components of the foregoing encoder 2800 and the computer readable storage medium, referring to FIG. 29, a specific hardware structure schematic diagram of the encoder 2800 is shown. As shown in FIG. 29, the encoder 2900 can include a communication interface 2910, a memory 2920 and a processor 2930; the various components are coupled together through a bus system 2940. It can be understood that the bus system 2940 is used to realize the connection communication between the components. The bus system 2940 includes a data bus, a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, various buses are marked as the bus system 2940 in FIG. 29. Among them,
[0492] The communication interface 2910 is used for receiving and sending signals in the process of transceiving information with other external network elements;
[0493] The memory 2920 is used for storing a computer program;
[0494] a processor 2930 configured to, working with the computer program:
[0495] determine a reference template for a current block;
[0496] determine a candidate intra prediction mode set for the current block according to the reference template;
[0497] determine a first intra prediction mode for the current block according to the candidate intra prediction mode set for the current block;
[0498] determine a prediction value for the current block according to the first intra prediction mode;
[0499] encode the current block according to the prediction value for the current block.
[0500] It can be understood that the memory 2920 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), or a flash memory. The volatile memory can be a random access memory (Random Access Memory, RAM) used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 2920 of the system and method described in the present application is intended to include but not limited to these and any other suitable types of memory.
[0501] The processor 2930 can be an integrated circuit chip including a processing unit that is configured to process signals. In implementation, the steps of the above-described method can be completed by the integrated logic circuit of the processor 2930 or by an instruction in a form of software. The processor 2930 described above can be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed by the processor 2930. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code executed by the processor, or a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), electrically programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, or other mature storage media in the art. The storage medium is located in the memory 2920, and the processor 2930 reads information in the memory 2920 and combines the hardware to complete the steps of the above-described method.
[0502] It can be understood that the embodiments described in the present application can be implemented in hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field-Programmable Gate Arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for executing the functions described in the present application or a combination thereof. For software implementation, the technologies described in the present application can be implemented by modules (such as processes, functions, etc.) for performing the functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0503] Optionally, as another embodiment, the processor 2930 is further configured to execute the encoding method in the foregoing embodiments when running the computer program.
[0504] The embodiment of the present application further provides a computer readable storage medium, which is a nonvolatile computer readable storage medium for storing a bitstream, the bitstream can be generated by using an encoding method of an encoder, or the bitstream is decoded by using a decoding method of a decoder, wherein the decoding method can be the decoding method in any one of the foregoing embodiments, and the encoding method can be the encoding method in any one of the foregoing embodiments.
[0505] It should be noted that, in the present application, the terms "comprising", "containing" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0506] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0507] The methods disclosed in the several method embodiments provided by the present application can be combined arbitrarily without conflict, to obtain new method embodiments.
[0508] The features disclosed in the several product embodiments provided by the present application can be combined arbitrarily without conflict, to obtain new product embodiments.
[0509] The features disclosed in the several method or device embodiments provided by the present application can be combined arbitrarily without conflict, to obtain new method or device embodiments.
[0510] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A decoding method, applied to a decoder, comprising: determining gradient information based on at least one reconstructed sample surrounding the current block; determining a first intra-frame prediction mode according to the gradient information; determining a prediction block for the current block according to the first intra prediction mode; A reconstructed block of the current block is determined according to the prediction block of the current block.
2. The method according to claim 1, wherein The at least one sample includes a first sample, and the first sample is located outside a first area, where the first area is an L-shaped area formed by three left columns of adjacent samples of the current block and three upper rows of adjacent samples of the current block.
3. The method according to claim 1, wherein The at least one sample includes a sample in a first reference region, where the first reference region is one of a plurality of reference regions, and all of the plurality of reference regions are reconstructed regions.
4. The method according to claim 3, wherein: The first reference region is determined based on a first parameter in a code stream, where the first parameter is used to indicate the first reference region from among the multiple reference regions.
5. The method according to claim 4, wherein The multiple values of the first parameter have a first mapping relationship with the multiple reference areas, and the first mapping relationship is determined based on at least one of the following: Predefined mapping relationships; The second parameter in the code stream; The size of the current block; The shape of the reference area corresponding to the current block.
6. The method according to claim 5, wherein: The first mapping relationship belongs to one of a plurality of predefined mapping relationships, and the first mapping relationship is determined from the plurality of mapping relationships based on at least one of the following: The size of the current block; The shape of the reference area corresponding to the current block.
7. The method according to claim 6, wherein: If the size of the current block is a first size, then in the first mapping relationship, an interval between adjacent regions in the plurality of reference regions is a first interval; If the size of the current block is the second size, then in the first mapping relationship, the interval between adjacent regions in the multiple reference regions is the second interval; The first interval is different from the second interval.
8. The method according to claim 7, wherein: The first size is smaller than the second size, and the first interval is smaller than the second interval.
9. The method according to claim 6, wherein: If the size of the current block is a first size, then in the first mapping relationship, the number of reference areas included in the multiple reference areas is a first number; If the size of the current block is the second size, then in the first mapping relationship, the number of reference areas included in the multiple reference areas is the second number; The first quantity is different from the second quantity.
10. The method according to claim 9, wherein: The first size is smaller than the second size, and the first quantity is smaller than the second quantity.
11. The method according to claim 3, wherein: The at least one sample further includes a sample in a reference region located between the first reference region and the current block among the plurality of reference regions.
12. The method according to claim 3, wherein The at least one sample includes samples in part or all of the sub-regions in the first reference region.
13. The method according to claim 3, wherein: The at least one sample includes samples in a plurality of target areas, and the plurality of target areas satisfy one of the following conditions: The multiple target areas are the multiple reference areas; The multiple target areas are part or all of the sub-areas in the first reference area; The multiple target areas include some sub-areas in the first reference area and some sub-areas in the second reference area, and the second reference area belongs to the multiple reference areas; The multiple target areas include the first reference area and some sub-areas in the second reference area.
14. The method according to claim 13, wherein The first intra prediction mode is determined based on amplitudes corresponding to a plurality of intra prediction modes, and the amplitudes corresponding to the plurality of intra prediction modes are respectively determined based on gradient information of samples in the plurality of target areas.
15. The method according to claim 14, wherein The first intra prediction mode is determined based on amplitudes corresponding to the multiple intra prediction modes and weights corresponding to the multiple intra prediction modes, and the weights corresponding to the multiple intra prediction modes are determined based on at least one of the following: Amplitudes corresponding to the multiple intra prediction modes; The intervals between the multiple target areas and the current block.
16. The method of claim 3, wherein: The first reference region and the second reference region have the same number of sub-regions, and the second reference region belongs to the plurality of reference regions; or, The number of sub-regions in the first reference region and the second reference region is different; or, The sub-regions in the first reference region and the second reference region located at the first position of the current block have the same size; or, The sizes of the sub-regions located at the first position of the current block in the first reference region and the second reference region are different.
17. The method according to claim 3, wherein: The at least one sample includes a portion of samples in the first reference region.
18. The method according to claim 3, wherein The method further comprises: Parse the code stream and determine a third parameter, where the third parameter is used to determine a decoding-end intra-frame mode derivation DIMD mode used by the current block, where the DIMD mode used by the current block includes a first DIMD mode and a second DIMD mode, where the number of reference areas corresponding to the first DIMD mode is 1, and the number of reference areas corresponding to the second DIMD mode is greater than 1.
19. The method according to claim 3, wherein The method further comprises: The gradient information is stored.
20. The method according to claim 3, wherein The multiple reference areas are adjacent or overlapping.
21. The method according to claim 3, wherein The shape of the first reference area is determined based on at least one of the following: The fourth parameter in the code stream; The distribution of gradient information in the reference regions of the various shapes.
22. The method according to claim 3, wherein The width of the first reference area is greater than or equal to 3.
23. The method according to claim 3, wherein The first reference region is determined based on a difference between one or more predicted values of a template region of the current block and a reconstructed value of the template region, wherein the one or more predicted values of the template region are determined based on gradient information of samples in one or more reference regions.
24. The method according to claim 1, wherein The method further comprises: Parse the code stream to determine a fifth parameter, where the fifth parameter is used to indicate whether the current block uses the DIMD mode.
25. A coding method, applied to an encoder, comprising: determining gradient information based on at least one reconstructed sample surrounding the current block; determining a first intra-frame prediction mode according to the gradient information; determining a prediction block for the current block according to the first intra prediction mode; A residual block of the current block is determined according to the prediction block of the current block.
26. The method according to claim 25, wherein The at least one sample includes a first sample, and the first sample is located outside a first area, where the first area is an L-shaped area formed by three left columns of adjacent samples of the current block and three upper rows of adjacent samples of the current block.
27. The method according to claim 25, wherein The at least one sample includes a sample in a first reference region, where the first reference region is one of a plurality of reference regions, and all of the plurality of reference regions are reconstructed regions.
28. The method according to claim 27, wherein The method further comprises: A first parameter is written into a bitstream, where the first parameter is used to indicate the first reference area from among the multiple reference areas.
29. The method according to claim 28, wherein The multiple values of the first parameter have a first mapping relationship with the multiple reference areas, and the first mapping relationship is determined based on at least one of the following: Predefined mapping relationships; The size of the current block; The shape of the reference area corresponding to the current block.
30. The method according to claim 29, wherein The first mapping relationship belongs to one of a plurality of predefined mapping relationships, and the first mapping relationship is determined from the plurality of mapping relationships based on at least one of the following: The size of the current block; The shape of the reference area corresponding to the current block.
31. The method of claim 30, wherein: If the size of the current block is a first size, then in the first mapping relationship, an interval between adjacent regions in the plurality of reference regions is a first interval; If the size of the current block is the second size, then in the first mapping relationship, the interval between adjacent regions in the multiple reference regions is the second interval; The first interval is different from the second interval.
32. The method according to claim 31, wherein The first size is smaller than the second size, and the first interval is smaller than the second interval.
33. The method of claim 30, wherein: If the size of the current block is a first size, then in the first mapping relationship, the number of reference areas included in the multiple reference areas is a first number; If the size of the current block is the second size, then in the first mapping relationship, the number of reference areas included in the multiple reference areas is the second number; The first quantity is different from the second quantity.
34. The method according to claim 33, wherein The first size is smaller than the second size, and the first quantity is smaller than the second quantity.
35. The method of claim 27, wherein: The at least one sample further includes a sample in a reference region located between the first reference region and the current block among the plurality of reference regions.
36. The method of claim 27, wherein: The at least one sample includes samples in part or all of the sub-regions in the first reference region.
37. The method of claim 27, wherein: The at least one sample includes samples in a plurality of target areas, and the plurality of target areas satisfy one of the following conditions: The multiple target areas are the multiple reference areas; The multiple target areas are part or all of the sub-areas in the first reference area; The multiple target areas include some sub-areas in the first reference area and some sub-areas in the second reference area, and the second reference area belongs to the multiple reference areas; The multiple target areas include the first reference area and some sub-areas in the second reference area.
38. The method of claim 37, wherein: The first intra prediction mode is determined based on amplitudes corresponding to a plurality of intra prediction modes, and the amplitudes corresponding to the plurality of intra prediction modes are respectively determined based on gradient information of samples in the plurality of target areas.
39. The method according to claim 38, wherein The first intra prediction mode is determined based on amplitudes corresponding to the multiple intra prediction modes and weights corresponding to the multiple intra prediction modes, and the weights corresponding to the multiple intra prediction modes are determined based on at least one of the following: Amplitudes corresponding to the multiple intra prediction modes; The intervals between the multiple target areas and the current block.
40. The method of claim 27, wherein: The first reference region and the second reference region have the same number of sub-regions, and the second reference region belongs to the plurality of reference regions; or, The number of sub-regions in the first reference region and the second reference region is different; or, The sub-regions in the first reference region and the second reference region located at the first position of the current block have the same size; or, The sizes of the sub-regions located at the first position of the current block in the first reference region and the second reference region are different.
41. The method of claim 27, wherein: The at least one sample includes a portion of samples in the first reference region.
42. The method of claim 27, wherein: The method further comprises: A third parameter is written into the bitstream, where the third parameter is used to determine a decoding-end intra-frame mode derivation DIMD mode used by the current block, where the DIMD mode used by the current block includes a first DIMD mode and a second DIMD mode, where the number of reference areas corresponding to the first DIMD mode is 1, and the number of reference areas corresponding to the second DIMD mode is greater than 1.
43. The method of claim 27, wherein: The method further comprises: The gradient information is stored.
44. The method of claim 27, wherein The multiple reference areas are adjacent or overlapping.
45. The method of claim 27, wherein The shape of the first reference area is determined based on at least one of the following: The cost between the predicted value and the original value determined based on reference regions of various shapes; The distribution of gradient information in the reference regions of the various shapes.
46. The method of claim 27, wherein: The width of the first reference area is greater than or equal to 3.
47. The method of claim 27, wherein: The first reference region is determined based on a difference between one or more predicted values of a template region of the current block and a reconstructed value of the template region, wherein the one or more predicted values of the template region are determined based on gradient information of samples in one or more reference regions.
48. The method of claim 25, wherein The method further comprises: A fifth parameter is written into the bitstream, where the fifth parameter is used to indicate whether the current block uses the DIMD mode.
49. A decoding method, applied to a decoder, comprising: Parse the code stream and determine the reference template of the current block; determining first mode parameters according to a reference template of the current block; determining a first intra prediction mode of the current block according to the first mode parameters; determining a prediction value of the current block according to the first intra prediction mode; A reconstructed block of the current block is determined according to the prediction value of the current block.
50. The method of claim 49, wherein The parsing of the code stream to determine the reference template of the current block includes: Parse a code stream to determine a first index, where the first index is used to determine a reference template of the current block.
51. The method of claim 50, wherein: The first index is used to indicate a reference template of the current block, or the first index is used to indicate a position of the reference template.
52. The method of claim 49, wherein The reference template of the current block is determined based on a difference between one or more predicted values of a template area of the current block and a reconstructed value of the template area, wherein the one or more predicted values of the template area are determined based on gradient information of samples in one or more reference templates.
53. The method of claim 49, wherein The first mode parameter is used to indicate a texture feature of a sample in the reference template.
54. The method of claim 49, wherein The first pattern parameter is a gradient of one or more reconstructed samples in the reference template.
55. The method of claim 54, wherein The gradient is determined based on a horizontal gradient and a vertical gradient of a reconstructed sample in the reference template, and the horizontal gradient and the vertical gradient are determined based on a Sobel operator.
56. A decoding method, applied to a decoder, comprising: Determining a candidate intra-frame prediction mode set for the current block according to reconstructed samples of the image where the current block is located; Determining a first intra prediction mode for the current block according to the candidate intra prediction mode set; determining a prediction value of the current block according to the first intra prediction mode; A reconstructed block of the current block is determined according to the prediction value of the current block.
57. The method of claim 56, wherein The candidate intra prediction mode set includes one or more candidate intra prediction modes.
58. The method of claim 56, wherein The candidate intra prediction mode set is determined based on one or more reference templates of the current block.
59. The method of claim 58, wherein The reconstructed samples included in the one or more reference templates are determined based on one or more of the following: Predefined information; The size of the current block; Shape information of the reference area corresponding to the current block.
60. The method of claim 58, wherein For a reference template, a candidate intra prediction mode is determined based on the DIMD mode derived from the intra mode at the decoding end.
61. The method of claim 59, wherein: The first intra prediction mode is determined from the candidate intra prediction mode set based on a first index in a code stream.
62. The method of claim 56, wherein: The first intra-frame prediction mode is determined based on a difference between one or more prediction values of a template area of the current block and a reconstructed value of the template area, and the one or more prediction values of the template area are determined based on one or more candidate intra-frame prediction modes in the candidate intra-frame prediction mode set.
63. A coding method, applied to an encoder, comprising: Determine the reference template of the current block; determining a set of candidate intra prediction modes for the current block according to the reference template; Determining a first intra prediction mode of the current block according to a candidate intra prediction mode set of the current block; determining a prediction value of the current block according to the first intra prediction mode; The current block is encoded according to the prediction value of the current block.
64. The method of claim 63, wherein The determining, according to the reference template, a candidate intra prediction mode set for the current block includes: For a reference template, a candidate intra prediction mode is determined based on the DIMD mode derived from the intra mode at the decoding end.
65. The method of claim 63, wherein The first intra prediction mode is determined based on rate-distortion costs of candidate intra prediction modes in the candidate intra prediction mode set.
66. The method of claim 63, wherein The first intra-frame prediction mode is determined based on a difference between one or more prediction values of a template area of the current block and a reconstructed value of the template area, and the one or more prediction values of the template area are determined based on one or more candidate intra-frame prediction modes in the candidate intra-frame prediction mode set.
67. The method of claim 63, wherein The method further comprises: A first index is written into a bitstream, where the first index satisfies one of the following conditions: The first index is used to indicate the first intra prediction mode from the candidate intra prediction mode set; The first index is a sequence number of the first intra prediction mode in the candidate intra prediction mode set; The first index is used to indicate a reference template used by the current block from one or more reference templates; The first index is used to indicate the position of the reference template used by the current block.
68. A decoder comprising: A first determining module is configured to determine gradient information according to at least one reconstructed sample around the current block; a second determining module, configured to determine a first intra prediction mode according to the gradient information; a third determining module, configured to determine a prediction block of the current block according to the first intra prediction mode; The fourth determining module is configured to determine a reconstructed block of the current block according to the predicted block of the current block.
69. An encoder comprising: A first determining module is configured to determine gradient information according to at least one reconstructed sample around the current block; a second determining module, configured to determine a first intra prediction mode according to the gradient information; a third determining module, configured to determine a prediction block of the current block according to the first intra prediction mode; The fourth determining module is configured to determine the residual block of the current block according to the prediction block of the current block.
70. A decoder comprising: A parsing module configured to parse the code stream and determine a reference template for a current block; A first determining module configured to determine a first mode parameter according to a reference template of the current block; a second determining module, configured to determine a first intra prediction mode of the current block according to the first mode parameter; a third determining module, configured to determine a prediction value of the current block according to the first intra prediction mode; The fourth determining module is configured to determine a reconstructed block of the current block according to the predicted value of the current block.
71. A decoder comprising: A first determination module is configured to determine a candidate intra-frame prediction mode set for the current block according to reconstructed samples of the image where the current block is located; a second determining module configured to determine a first intra prediction mode of the current block according to the candidate intra prediction mode set; a third determining module, configured to determine a prediction value of the current block according to the first intra prediction mode; The fourth determining module is configured to determine a reconstructed block of the current block according to the predicted value of the current block.
72. An encoder comprising: A first determining module configured to determine a reference template for a current block; a second determining module configured to determine a candidate intra prediction mode set for the current block according to the reference template; a third determining module, configured to determine a first intra prediction mode of the current block according to the candidate intra prediction mode set of the current block; a fourth determining module, configured to determine a prediction value of the current block according to the first intra prediction mode; The encoding module is configured to encode the current block according to the prediction value of the current block.
73. A decoder, comprising: Memory for storing computer programs; A processor for performing the method according to any one of claims 1 to 24 or 49 to 62 when running the computer program.
74. An encoder, comprising: Memory for storing computer programs; A processor for executing a method as described in any one of claims 25 to 48 or 63 to 67 when running the computer program.
75. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, which implements the method according to any one of claims 1 to 67 when executed.
76. A non-volatile computer-readable storage medium storing a bit stream, wherein the bit stream is generated by an encoding method using an encoder, or the bit stream is decoded by a decoding method using a decoder, wherein the decoding method is the method according to any one of claims 1 to 24 or 49 to 62, and the encoding method is the method according to any one of claims 25 to 48 or 63 to 67.
Citation Information
Patent Citations
Energy saving system and method for Cargo Hold within ventilation system
KR1020240045630A
Intra prediction fusion with reduced complexity in video coding
US20240098257A1
Method and apparatus of improvement for decoder-derived intra prediction in video coding system
WO2023198112A1
Decoding method, encoding method, decoder, and encoder
WO2024007116A1
Intra prediction mode-based image encoding / decoding method and apparatus using multi reference line (MRL), and recording medium for storing bitstream
WO2024063532A1