Encoding and decoding methods, encoder, decoder, and storage medium

By determining multiple non-adjacent spatial locations around the current block at the decoding and encoding ends to obtain gradient information, the problem of inaccurate prediction in DIMD fusion mode is solved, and the accuracy of intra-frame prediction is improved.

WO2025073089A9PCT designated stage expired Publication Date: 2026-05-15GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2023-10-05
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing DIMD fusion modes are not accurate enough in deriving intra-frame prediction modes, resulting in reduced prediction accuracy.

Method used

Multiple non-adjacent spatial locations around the current block are determined at both the decoding and encoding ends. Gradient information to be fused is obtained from these locations to improve the accuracy of the prediction.

Benefits of technology

By searching for gradient information to be fused within a larger search region, the accuracy of the intra-prediction mode derived from the DIMD fusion mode is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023123103_15052026_PF_FP_ABST
    Figure CN2023123103_15052026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide encoding and decoding methods, an encoder, a decoder, and a storage medium. The decoding method comprises: parsing a bitstream, and determining first flag information, the first flag information being used for indicating that a current block uses a DIMD merge mode; on the basis of the first flag information, determining a plurality of search positions around the current block, the plurality of search positions comprising positions spatially non-adjacent to the current block; on the basis of the plurality of search positions, determining gradient information to be merged; and on the basis of the gradient information to be merged, determining a predicted value of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding and decoding methods, codecs, and storage media Technical Field

[0001] This application relates to the technical field of video encoding and decoding, and more particularly to an encoding and decoding method, an encoder and decoder, and a storage medium. Background Technology

[0002] Decoder-side intra-mode derivation merge (DIMD Merge) is an effective intra-prediction mode. DIMD Merge utilizes gradient information from adjacent coding blocks of the current block to deduce the dominant intra-prediction mode (or prediction direction) and generates prediction values ​​accordingly.

[0003] However, in related technologies, the intra-frame prediction mode derived from the DIMD fusion mode is not accurate enough, which reduces the accuracy of prediction.

[0004] Summary of the Invention

[0005] This application provides an encoding / decoding method, an encoding / decoding method, and a storage medium to improve prediction accuracy. The various aspects of this application are described below.

[0006] In a first aspect, a decoding method is provided, applied to a decoder, comprising: parsing a bitstream to determine first identification information, the first identification information being used to indicate that the current block uses a DIMD fusion mode; determining multiple search positions around the current block based on the first identification information, the multiple search positions including non-adjacent spatial positions of the current block; determining gradient information to be fused based on the multiple search positions; and determining a prediction value of the current block based on the gradient information to be fused.

[0007] Secondly, an encoding method is provided, applied to an encoder, comprising: determining multiple search positions around a current block, the multiple search positions including non-adjacent spatial positions of the current block; determining gradient information to be fused based on the multiple search positions; and determining a predicted value of the current block based on the gradient information to be fused.

[0008] Thirdly, a decoder is provided, comprising: a parsing unit configured to parse a bitstream and determine first identification information, the first identification information being used to indicate that the current block uses a DIMD fusion mode; a first determining unit configured to determine multiple search positions around the current block based on the first identification information, the multiple search positions including non-adjacent spatial positions of the current block; a second determining unit configured to determine gradient information to be fused based on the multiple search positions; and a third determining unit configured to determine a prediction value of the current block based on the gradient information to be fused.

[0009] Fourthly, a decoder is provided, the decoder comprising: a memory for storing a computer program; and a processor for executing the method as described in the first aspect when running the computer program.

[0010] Fifthly, an encoder is provided, comprising: a first determining unit configured to determine a plurality of search positions around a current block, the plurality of search positions including non-adjacent spatial positions of the current block; a second determining unit configured to determine gradient information to be fused based on the plurality of search positions; and a third determining unit configured to determine a predicted value of the current block based on the gradient information to be fused.

[0011] In a sixth aspect, an encoder is provided, the encoder comprising: a memory for storing a computer program; and a processor for executing the method as described in the second aspect when running the computer program.

[0012] A seventh aspect provides a computer-readable storage medium storing a computer program that, when executed, implements the method as described in the first or second aspect.

[0013] Eighthly, a computer program product is provided, comprising a computer program that, when executed, implements the method as described in the first or second aspect.

[0014] A ninth aspect provides a non-volatile computer-readable storage medium for storing a bit stream, the bit stream being generated by an encoding method using an encoder, or the bit stream being decoded by a decoding method using a decoder, wherein the decoding method is the method described in the first aspect and the encoding method is the method described in the second aspect.

[0015] The embodiments of this application search for gradient information to be fused in more search locations or larger search areas, which helps to improve the accuracy of the intra-prediction mode derived from the DIMD fusion mode, thereby improving the accuracy of prediction. Attached Figure Description

[0016] Figure 1 is a schematic diagram of the structure of a video encoder applicable to embodiments of this application.

[0017] Figure 2 is a schematic diagram of the structure of a video decoder applicable to embodiments of this application.

[0018] Figure 3 is a schematic diagram of the prediction process of DIMD-related patterns.

[0019] Figure 4 shows an example of how the predicted values ​​of DIMD-related patterns are determined.

[0020] Figure 5 is an example of how the gradient histogram of the current block is derived in DIMD fusion mode.

[0021] Figure 6 is an example of the search location in DIMD fusion mode.

[0022] Figure 7A shows another example of the search location in DIMD fusion mode.

[0023] Figure 7B is another example of the search location in DIMD fusion mode.

[0024] Figure 8 is a flowchart illustrating the decoding method provided in an embodiment of this application.

[0025] Figure 9 is an example diagram of the search location in the DIMD fusion mode provided in the embodiments of this application.

[0026] Figure 10 is a flowchart illustrating the encoding method provided in an embodiment of this application.

[0027] Figure 11 is a schematic diagram of the structure of a decoder provided in one embodiment of this application.

[0028] Figure 12 is a schematic diagram of the structure of a decoder provided in another embodiment of this application.

[0029] Figure 13 is a schematic diagram of the encoder provided in one embodiment of this application.

[0030] Figure 14 is a schematic diagram of the encoder provided in another embodiment of this application. Detailed Implementation

[0031] Figure 1 is a schematic block diagram of a video encoder involved in an embodiment of this application.

[0032] It should be understood that the video encoder 100 can be used for lossy compression of images or lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression.

[0033] This video encoder 100 can be applied to image data in luminance / chrominance (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, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) per 4 pixels; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).

[0034] For example, the video encoder 100 reads video data and, for each image in the video data, divides the image into several coding tree units (CTUs). In some examples, a CTU may be called a "tree block," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU can be associated with a pixel block of equal size within the image. Each pixel can correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU can be further divided into several coding units (CUs) for encoding. CUs can be rectangular blocks or square blocks. The CU can be further divided into prediction units (PUs) and transform units (TUs), thus separating encoding, prediction, and transformation for more flexible processing. In one example, the CTU is divided into CUs using a quadtree structure, and the CUs are further divided into TUs and PUs using a quadtree structure.

[0035] The video encoder and decoder support various PU sizes. Assuming a specific CU size of 2N×2N, the video encoder and decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and also support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and decoder can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.

[0036] In some embodiments, as shown in FIG1, the video encoder 100 may 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 image buffer 170, and an entropy coding unit 180. It should be noted that the video encoder 100 may include more, fewer, or different functional components.

[0037] Optionally, in this application, the current block can be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block can also be referred to as the predicted image block or the image prediction block, and the reconstructed image block can also be referred to as the reconstruction block or the image reconstruction block.

[0038] In some embodiments, the prediction unit 110 includes an inter-frame prediction unit 111 and an intra-frame prediction unit 112. Because there is a strong correlation between adjacent pixels in an image of a video, intra-frame prediction is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent images in a video, inter-frame prediction is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0039] The inter-frame prediction unit 111 can be used for inter-frame prediction, which can include motion estimation and motion compensation. It can reference image information from different images. Inter-frame prediction uses motion information to find reference blocks in the reference images and generates prediction blocks based on these reference blocks to eliminate temporal redundancy. The motion information includes a list of reference images, the reference image index, and motion vectors. Motion vectors can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering needs to be used in the reference image to create the required fractional-pixel blocks. Here, the integer-pixel or fractional-pixel blocks in the reference image found based on the motion vectors are called reference blocks. Some techniques directly use the reference blocks as prediction blocks, while others process the reference blocks further to generate prediction blocks. Processing the reference blocks further to generate prediction blocks can also be understood as using the reference blocks as prediction blocks and then processing them to generate new prediction blocks.

[0040] Intra-frame prediction unit 112 refers only to information from the same image to predict pixel information within the current code image block, thereby eliminating spatial redundancy.

[0041] Intra-prediction has multiple prediction modes. Taking the H-series international digital video coding standards as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angular prediction mode, while H.265 / HEVC extends this to 33 angular prediction modes and 2 non-angular prediction modes. HEVC uses intra-prediction modes (IPM) including Planar, DC, and 33 angular modes, for a total of 35 prediction modes. VVC uses intra-prediction modes including Planar, DC, and 65 angular modes, for a total of 67 prediction modes.

[0042] It should be noted that with the increase in angle modes, intra-frame prediction will be more accurate and better meet the needs of the development of high-definition and ultra-high-definition digital video.

[0043] 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 the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the PU of the CU.

[0044] Transform / quantization unit 130 can quantize transform coefficients. Transform / quantization unit 130 can quantize transform coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. Video encoder 100 can adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0045] The inverse transform / quantization unit 140 can apply inverse quantization and inverse transform to the quantized transform coefficients to reconstruct the residual block from the quantized transform coefficients.

[0046] The reconstruction unit 150 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by the prediction unit 110 to produce a reconstructed image block associated with the TU. By reconstructing the sampled blocks of each TU of the CU in this way, the video encoder 100 can reconstruct the pixel blocks of the CU.

[0047] The loop filtering unit 160 is used to process the pixels after inverse transformation and inverse quantization to compensate for the distortion information and provide a better reference for subsequent encoded pixels. For example, it can perform deblocking filtering to reduce the block effect of pixel blocks associated with the CU.

[0048] In some embodiments, the loop filtering unit 160 includes a deblocking filtering unit, a sample adaptive compensation (SAO) unit, and an adaptive loop filtering (ALF) unit, wherein the deblocking filtering unit is used to remove block effects, the SAO unit is used to remove ringing effects, and the ALF is used to reduce reconstruction errors.

[0049] The decoded image buffer 170 can store reconstructed pixel blocks. The inter-frame prediction unit 111 can use a reference image containing the reconstructed pixel blocks to perform inter-frame prediction on PUs of other images. In addition, the intra-frame prediction unit 112 can use the reconstructed pixel blocks in the decoded image buffer 170 to perform intra-frame prediction on other PUs in the same image as the CU.

[0050] The entropy coding unit 180 can receive quantized transform coefficients from the transform / quantization unit 130. The entropy coding unit 180 can perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data.

[0051] Figure 2 is a schematic block diagram of a video decoder involved in an embodiment of this application.

[0052] As shown in Figure 2, the video decoder 200 includes: an entropy decoding unit 210, a prediction unit 220, an inverse quantization / transformation unit 230, a reconstruction unit 240, a loop filtering unit 250, and a decoded image buffer 260. It should be noted that the video decoder 200 may contain more, fewer, or different functional components.

[0053] Video decoder 200 can receive a bitstream. Entropy decoding unit 210 can parse the bitstream to extract syntax elements. As part of parsing the bitstream, entropy decoding unit 210 can parse the entropy-encoded syntax elements in the bitstream. Prediction unit 220, dequantization / transform unit 230, reconstruction unit 240, and loop filtering unit 250 can decode video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.

[0054] In some embodiments, the prediction unit 220 includes an intra-frame prediction unit 222 and an inter-frame prediction unit 221.

[0055] Intra-prediction unit 222 can perform intra-prediction to generate prediction blocks for the PU. Intra-prediction unit 222 can use an intra-prediction mode to generate prediction blocks for the PU based on pixel blocks of spatially adjacent PUs. Intra-prediction unit 222 can also determine the intra-prediction mode of the PU based on one or more syntax elements parsed from the bitstream.

[0056] Inter-frame prediction unit 221 can construct a first reference image list (list 0) and a second reference image list (list 1) based on the syntax elements parsed from the bitstream. Furthermore, if the PU uses inter-frame prediction coding, entropy decoding unit 210 can parse the motion information of the PU. Inter-frame prediction unit 221 can determine one or more reference blocks of the PU based on the motion information of the PU. Inter-frame prediction unit 221 can generate prediction blocks for the PU based on one or more reference blocks of the PU.

[0057] The dequantization / transformation unit 230 reversibly quantizes (i.e., dequantizes) the transform coefficients associated with the TU. The dequantization / transformation unit 230 can use the QP value associated with the CU of the TU to determine the degree of quantization.

[0058] After the inverse quantization transform coefficients, the inverse quantization / transformation unit 230 can apply one or more inverse transforms to the inverse quantization transform coefficients to generate a residual block associated with the TU.

[0059] The reconstruction unit 240 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 240 can add the sample of the residual block to the corresponding sample of the prediction block to reconstruct the pixel block of the CU, thereby obtaining the reconstructed image block.

[0060] The loop filter unit 250 can perform deblocking filtering operations to reduce the block effect of pixel blocks associated with the CU.

[0061] The video decoder 200 can store the reconstructed image of the CU in the decoded image buffer 260. The video decoder 200 can use the reconstructed image in the decoded image buffer 260 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0062] The basic process of video encoding and decoding is as follows: At the encoding end, an image is divided into blocks. For the current block, prediction unit 110 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. Residual unit 120 can calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block. This residual block can also be called residual information. This residual block is transformed and quantized by transform / quantization unit 130, which can remove information that is not sensitive to the human eye to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by transform / quantization unit 130 can be called a temporal residual block, and the temporal residual block after transformation and quantization by transform / quantization unit 130 can be called a frequency residual block or a frequency domain residual block. Entropy coding unit 180 receives the quantized change coefficients output by transform / quantization unit 130, and can entropy code the quantized change coefficients to output a bitstream. For example, entropy coding unit 180 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.

[0063] At the decoding end, the entropy decoding unit 210 can parse the bitstream to obtain the prediction information and quantization coefficient matrix of the current block. The prediction unit 220 uses intra-frame prediction or inter-frame prediction to generate the prediction block of the current block based on the prediction information. The dequantization / transform unit 230 uses the quantization coefficient matrix obtained from the bitstream to perform dequantization and inverse transform on the quantization coefficient matrix to obtain the residual block. The reconstruction unit 240 adds the prediction block and the residual block to obtain the reconstructed block. The reconstructed blocks form the reconstructed image. The loop filtering unit 250 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain the decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. This decoded image can also be called the reconstructed image, which can be used as a reference image for inter-frame prediction of subsequent images.

[0064] It should be noted that the block partitioning information determined at the encoding end, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, are carried in the bitstream when necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding end by parsing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.

[0065] The above describes the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. This application is applicable to the basic flow of a video codec under this block-based hybrid coding framework, but is not limited to this framework and flow.

[0066] The encoding / decoding framework provided in the embodiments of this application has been described in detail above. The embodiments of this application mainly relate to a prediction process based on DIMD correlation modes, which can be implemented in the intra-frame prediction unit within the aforementioned encoding / decoding framework. The following section provides a detailed description of the DIMD-based prediction process from the perspective of the decoding end.

[0067] At the decoding end, the basic decoding process for obtaining intra-frame reconstructed blocks includes several steps: obtaining the prediction residual through bitstream parsing, obtaining the prediction value, and determining the reconstructed value. Figure 3 shows an example of the intra-frame prediction process.

[0068] Referring to Figure 3, before determining the reconstructed block for the current block, it is first necessary to obtain the predicted value of the current block. In obtaining the predicted value, the DIMD flag is parsed first. This DIMD flag indicates whether the current block uses a DIMD-related pattern. Based on this DIMD flag, it can be determined whether the current block generated its predicted value using a DIMD-related pattern.

[0069] If the intra-prediction mode of the current block is DIMD-related (e.g., the DIMD flag value is 1), the DIMD merge flag can be further parsed to determine whether the current block generates a prediction value through DIMD merging. If the intra-prediction mode of the current block is DIMD merging (e.g., the DIMD flag value is 1), the gradient information of the current block can be derived from the gradient information of neighboring blocks. If the intra-prediction mode of the current block is DIMD (e.g., the DIMD flag value is 0), the gradient information can be calculated from neighboring samples. After obtaining the gradient information, the prediction mode of the current block can be derived based on the gradient information to generate the prediction value.

[0070] If the current block does not generate a prediction value based on the DIMD-related mode (e.g., the DIMD identifier is 0), other intra-frame prediction modes can be parsed to generate prediction values.

[0071] S1: DIMD mode

[0072] DIMD mode is a method that uses the gradient information of neighboring pixels in the current block to deduce the dominant intra-prediction mode (or prediction direction), and then obtains the prediction value based on the deduced intra-prediction mode.

[0073] S1.1 DIMD Intra-Frame Mode Derivation

[0074] As one possible implementation, the horizontal and vertical gradients of adjacent reconstructed pixels can be calculated using the Sobel operator. The Sobel operator formula is shown below, where G... x Used to calculate the horizontal gradient, G y Used to calculate the vertical gradient.

[0075] and

[0076] The following section details the process of using the Sobel operator to perform gradient analysis on neighboring pixels, thereby deriving the intra-frame prediction mode.

[0077] The input to this process is the reconstructed values ​​p[x][y] of the adjacent pixels, 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.

[0078] The output of this process varies depending on the scenario: in the DIMD intra-prediction value acquisition scenario, the output of this process is histogram information; in other application scenarios, the output of this process can be the traditional intra-prediction mode IntraPredModeD, where the value of IntraPredModeD is between [0, 66].

[0079] Set mapHgV = {{2,1},{1,2}} and mapVgH = {{3,4},{4,3}}.

[0080] Set angTable = {0,2048,4096,6144,8192,12288,16384,20480,24576,28672,32768,36864,40960,47104,53248,59392,65536}.

[0081] Set angOffset = {18, 18, 50, 50}.

[0082] Set HoG

[0067] to an array containing the gradient intensities for each conventional intra-prediction mode. At the start of this process, all values ​​in the histogram of oriented gradient (HoG) array are initialized to 0.

[0083] For each reconstructed pixel p[x][y], where x = 1…nTbW-2, y = 1…nTbH-2, the calculation process is as follows.

[0084] Calculate the horizontal gradient 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];

[0085] Calculate the vertical gradient 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];

[0086] Calculate iAmp[x][y]=abs(gHor[x][y])+abs(gVer[x][y]);

[0087] Calculate signH[x][y] = gHor[x][y] < 0? 1: 0;

[0088] Calculate signV[x][y] = gVer[x][y] < 0? 1: 0;

[0089] Calculate HgV[x][y]=(abs(gHor[x][y])>abs(gVer[x][y])?1:0);

[0090] Calculate region[x][y]=(HgV[x][y]==1?mapHgV[signH[x][y]][signV[x][y]]:mapVgH[signH[x][y]][signV[x][y]]);

[0091] Calculate grad[x][y]=(HgV[x][y]==1?abs(gVer[x][y]) / abs(gHor[x][y]):abs(gVer[x][y]) / abs(gHor[x][y]));

[0092] Calculate grad[x][y] = round(grad[x][y] * (1 << 16));

[0093] Calculate the index angIdx[x][y] = argmin i (abs(angTable[i]-grad[x][y]));

[0094] Calculate the intra-frame prediction mode ipm[x][y] = angOffset[region[x][y]] + angIdx[x][y];

[0095] Set HoG[ipm[x][y]]=HoG[ipm[x][y]]+iAmp[x][y];

[0096] In the DIMD prediction scenario, all or part of the gradient histogram information will be stored for subsequent calculations, as detailed in S1.2 below.

[0097] In other application scenarios, an IntraPredModeD can be further calculated based on information from the gradient histogram. For example, if HoG has no non-zero magnitude, IntraPredModeD is set to PLANA. Otherwise, IntraPredModeD is set to argmax. i (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 scenarios where the predicted value is obtained based on DIMD.

[0098] S1.2DIMD obtains the predicted value

[0099] Before obtaining the predicted value, it is first necessary to determine whether to perform weighted fusion. If the gradient histogram is not unidirectional, weighted fusion can be performed; otherwise, the intra-prediction mode (IPM) that is the only non-zero value in the gradient histogram can be used to obtain the intra-prediction value. In the implementation process, HoG information can be analyzed; if the magnitudes of the two directional modes with the highest magnitudes, maxMode[0] (the corresponding item with the highest magnitude in the gradient histogram) and maxMode[1] (the corresponding item with the second highest magnitude in the gradient histogram), are both greater than 0, weighted fusion can be performed; otherwise, weighted fusion can be omitted.

[0100] Without weighted fusion, the IPM with the highest amplitude can be obtained through the gradient histogram information; then, the predicted value can be directly generated through the prediction pattern represented by that IPM.

[0101] If weighted fusion is performed, the gradient histogram information can be used to obtain N (e.g., N=5) IPMs with the highest amplitudes, denoted as M. n n = 0..4, and the corresponding predicted value is denoted as dimdPred. n n = 0..4. Then, it can be weighted and fused with the Planar mode's predicted value dimdPlanar to obtain the final predicted value, as shown in Figure 4. The Planar mode's weight wPlanar can be fixed at 4 / 64. Then, the remaining 60 / 64 weights can be allocated to the five IPMs with the highest amplitudes, and the weights wDimd of these five IPMs... n The magnitudes of n = 0..4 and their gradient histograms are related.

[0102] The predicted value at (x, y) in the current block can be:

[0103] Among them, dimdPred n (x,y) represents the (x,y) position of the current block, according to pattern M. n The generated prediction value, dimdPlanar(x,y), represents the prediction value generated according to the Planar pattern at position (x,y) of the current block.

[0104] The weights wDimd of the five IPMs n It can be calculated as:

[0105] S1.3 stores gradient histogram information.

[0106] The gradient histogram information of the DIMD mode is stored in units of coded blocks. Gradient histogram information can be stored directly, or only the five IPMs with the highest magnitudes in the gradient histogram and their corresponding magnitudes can be stored.

[0107] S2: DIMD Fusion Mode

[0108] DIMD fusion mode is a sub-mode of DIMD related mode. This mode is a method that uses gradient information from neighboring coded blocks of the current block to derive the dominant intra-prediction mode (or prediction direction) and generate prediction values ​​accordingly. Figure 5 shows an example of the derivation process of the gradient information of the current block.

[0109] S2.1DIMD Fusion Intra-Frame Mode Derivation

[0110] The input for step S2.1 may include the following information:

[0111] - Current block top left corner position (xTL, yTL), current block bottom left corner position (xLB, yLB), current block top right corner position (xRT, yRT);

[0112] - The width of the current block is uiWidth, and the height of the current block is uiHeigth;

[0113] - The nearest neighbor positions of the current block (xNb[idx], yNb[idx]), idx = 1, ..., 13;

[0114] - The corresponding coded block at the nearest position (xNb[idx], yNb[idx]) is denoted as cuNeibor[idx], idx = 1, ..., 13.

[0115] The output of step S2.1 varies depending on the scenario: in the DIMD intra-prediction value acquisition scenario, the output of step S2.1 is histogram information; in other application scenarios, the output of step S2.1 can be the traditional intra-prediction mode IntraPredModeD. The value of IntraPredModeD can be, for example, between [0, 66].

[0116] The following details the process of using DIMD fusion to perform gradient analysis and derive the traditional intra-frame prediction mode.

[0117] Implementation method 1:

[0118] Step a: Search for the 13 adjacent coded blocks corresponding to the current block, denoted as cuNeibor[idx], and add cuNeibor[idx] to the candidate list in the search order. Check whether each cuNeibor[idx] in the candidate list exists, whether it is a duplicate, and whether it is a DIMD or DIMD fusion mode. The adjacent positions of the current block searched in Step a are shown in Table 1, and the search order and position of the adjacent positions are shown in Figure 6. If there are duplicate candidate blocks in the candidate list, only one candidate block is retained.

[0119] Table 1. Candidates in the candidate list

[0120] Step b: Sort the available candidate blocks in the candidate list according to the positional distance between the current block and the available candidate blocks in the candidate list. For example, let (xNeiTL, yNeiTL) be the top-left position of the available candidate block in the candidate list. Then, the distance diss[idx] between the current block and the candidate block can be determined by (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)). Then, the available candidate blocks in the candidate list can be sorted in ascending order according to the value of diss[idx]. When diss[idx] are equal, the available candidate blocks in the candidate list can be sorted according to the search order.

[0121] Step c: Read the gradient histograms of the first 3 sorted candidate blocks, denoted as HoGN[nei], where nei = 0..2. When there are fewer than 3 available candidate blocks, retrieve as many available candidate blocks as possible corresponding to HoGN[nei].

[0122] Step d: Calculate the gradient histogram HoGM by performing an arithmetic mean on the obtained gradient histogram HoGN[nei].

[0123] Step e: Save the gradient histogram (HoGM) in units of encoded blocks.

[0124] Step f: Obtain the intra-prediction mode of the current block based on the gradient histogram (HoGM).

[0125] In the DIMD fusion scenario, all or part of the gradient histogram information will be stored for subsequent calculations. See S2.2 below for a detailed description.

[0126] In other application scenarios, an IntraPredModeD can be further calculated based on information from the gradient histogram. For example, if HoG has no non-zero magnitude, IntraPredModeD is set to PLANA. Otherwise, IntraPredModeD is set to argmax. i(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 scenarios where the predicted value is obtained based on DIMD.

[0127] Implementation method 2:

[0128] Compared to implementation method 1, implementation method 2 has three significant differences:

[0129] ① In implementation method 2, the 13 search positions are no longer fixed, but are adaptively determined based on the block size of the current block and the candidate blocks;

[0130] ②In implementation method 2, the maximum number of available candidate cuNeibor in the candidate list is 5.

[0131] ③ In implementation method 2, for candidate blocks, the gradient histogram information HoG of the candidate blocks is no longer read. Instead, only the five IPMs with the highest magnitudes and their corresponding magnitudes are read. For the gradient histogram corresponding to the current block, the gradient histogram HoGM corresponding to the current block is no longer saved. Instead, only the five IPMs with the highest magnitudes and their corresponding magnitudes are saved.

[0132] The remaining operations of implementation method 2 are consistent with those of implementation method 1.

[0133] The implementation process of implementation method 2 will be described in more detail below.

[0134] Step a: Search for the corresponding cuNeibor[idx] at the 13 adjacent positions of the current block. The neighboring positions searched in Implementation Method 2 are shown in Table 2, and examples of the search order and positions of the neighboring positions are shown in Figures 7A and 7B. Add the corresponding encoded blocks to the candidate list according to the search order of the 13 adjacent positions, and check whether cuNeibor[idx] exists in the list and whether it is a DIMD or DIMD fusion mode. Due to the change in the search method, the duplication check of candidate blocks is no longer performed in Implementation Method 2.

[0135] Table 2. Candidates in the candidate list

[0136] During the search process, the position is updated based on the inspection results of the coded block corresponding to the search position.

[0137] Position 1 and Position 2: Starting from position 1 / position 2, with the height / width of the current block as the ending point and 4 pixels as the step size, find the corresponding encoding block; if the currently searched cuNeibor[1] and cuNeibor[2] exist and are in DIMD mode, then update position 1 / position 2 to the current position.

[0138] Positions 10 and 11: If cuNeighbour

[0010] / cuNeighbour

[0011] does not exist or is not in DIMD mode and cuNeighbours[3] exists, then position 10 / 11 will be updated to the lower left and upper right sides of cuNeighbours[3], i.e., the positions 10' / 11' in Figure 7A or Figure 7B.

[0139] Positions 12 and 13: If cuNeighbour

[0012] / cuNeighbour

[0013] does not exist or is not in DIMD mode and cuNeighbour[1] and cuNeighbour[8] / cuNeighbour[2] and cuNeighbour[9] exist, then update positions 12 and 13 to the left of cuNeighbour[8] and above cuNeighbour[9], i.e., positions 12' / 13' in Figure 7A or Figure 7B.

[0140] Step b: Sort the candidate blocks in the candidate list according to the distance between the candidate blocks in the candidate list and the current block.

[0141] Let (xNeiTL, yNeiTL) be the top-left position of the available candidate block in the candidate list. Then the distance diss[idx] between the current block and the candidate block is (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)). The available candidate blocks in the candidate list can be sorted in ascending order according to the value of diss[idx]. When diss[idx] are equal, the available candidate blocks in the candidate list can be sorted according to the search order.

[0142] Step c: Read the five IPMs with the highest amplitudes and their corresponding amplitudes from the top five available candidate blocks after sorting, denoted as HoGTemp[nei], where nei = 0..4; when there are fewer than five available candidate blocks, take as many available candidate blocks as possible.

[0143] Step d: Calculate the gradient histogram HoGMTemp by averaging the obtained HoGTemp[nei].

[0144] Step e: Save the five IPMs with the highest amplitude and their corresponding amplitudes in HoGMTemp in units of coded blocks.

[0145] Step f: Obtain the intra-prediction mode of the current block based on the gradient histogram HoGMTemp.

[0146] In the DIMD prediction scenario, all or part of the gradient histogram information will be stored for subsequent calculations, as detailed in S2.2 below.

[0147] In other application scenarios, an IntraPredModeD can be further calculated based on information from the gradient histogram. For example, if HoG has no non-zero magnitude, IntraPredModeD is set to PLANA. Otherwise, IntraPredModeD is set to argmax. i (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 scenarios where the predicted value is obtained based on DIMD.

[0148] S2.2DIMD fusion to obtain predicted values

[0149] The process of obtaining the predicted value for DIMD shown in S2.2 is basically the same as that in S1.2. If weighted fusion is not performed, the intra-prediction mode with the highest amplitude can be obtained through HoGM information, and the predicted value can be directly generated based on the intra-prediction mode; otherwise, the five intra-prediction modes with the highest amplitude can be obtained through HoGM information, and their predicted values ​​are weighted and fused with the predicted values ​​of the Planar mode to obtain the final predicted value. The calculation of the weights is consistent with that in S1.2.

[0150] The DIMD fusion mode provided by the related technology searches only 13 predefined or adaptively selected search locations around the current block to determine candidate blocks. Then, the related technology performs availability checks, duplication checks, and checks on whether the candidate blocks at the 13 search locations belong to the DIMD related pattern.

[0151] However, after performing the above checks on the 13 search locations, the number of candidate blocks that meet the conditions is often very small, which makes the IPM (or prediction direction) derived from the gradient information of neighboring blocks inaccurate, thus reducing the accuracy of the prediction.

[0152] To address the above issues, the decoding method provided in the embodiments of this application will be described in detail below.

[0153] Figure 8 is a schematic flowchart of the decoding method provided in an embodiment of this application. The method in Figure 8 can also be called an intra-frame prediction method, or a prediction method based on DIMD fusion mode. The method in Figure 8 can be applied to a decoder, for example, to the intra-frame prediction unit of the decoder.

[0154] Referring to Figure 8, in step S810, the bitstream is parsed to determine the first identification information. The first identification information (such as the DIMD fusion identifier) ​​is used to indicate that the current block uses the DIMD fusion mode.

[0155] The current block can also be called the current coding block, the current decoding block, or the current coding unit. For example, the current block can be a luma block.

[0156] The first identifier information may include, for example, a first value and a second value. The first value can be 1 or true. The first value can be used to indicate that the current block uses the DIMD fusion mode. The second value can be 0 or false. The second value can be used to indicate that the current block does not use the DIMD fusion mode. If the current block does not use the DIMD fusion mode, predictions can be made for the current block based on the DIMD mode.

[0157] In step S820, multiple search locations around the current block are determined based on the first identification information.

[0158] In some implementations, the number of search locations around the current block can be greater than 13. For example, the number of search locations around the current block can be greater than or equal to 16, 18, 21, 26, or 31. The number of search locations provided in this application embodiment is greater than the number of search locations provided by related technologies (related technologies provide 13 search locations). Therefore, this application embodiment is equivalent to searching for candidate blocks in a larger search area or more search locations, thereby helping to improve the accuracy of prediction.

[0159] In some implementations, multiple search locations around the current block (or multiple search locations in the neighboring region of the current block) may include spatially adjacent locations (or adjacent reference points) and / or spatially non-adjacent locations (or non-adjacent reference points). For example, a search can be performed at X1 spatially adjacent locations and X2 spatially non-adjacent locations around the current block. The value of X1 may be less than or equal to 13, for example. The value of X2 may be 3, 5, 8, 13, or 18, for example. Embodiments of this application expand the search area, which helps to obtain more available candidate blocks, thereby contributing to improved prediction accuracy.

[0160] In some implementations, the search locations around the current block include non-adjacent locations in the spatial domain, which are determined based on predefined locations and / or predefined dimensions. Predefined dimensions may, for example, include predefined horizontal dimensions (or horizontal step sizes) and / or predefined vertical dimensions (or vertical step sizes).

[0161] In some implementations, the predefined locations or non-adjacent locations in the spatial domain mentioned above can be determined based on one or more of the following:

[0162] The position of the current block (e.g., the top left corner of the current block);

[0163] The size of the current block (such as the width and / or height of the current block);

[0164] The size of the current block's adjacent blocks (such as the width and / or height of the adjacent blocks);

[0165] Predefined horizontal dimensions;

[0166] Predefined vertical dimension.

[0167] In some implementations, the predefined dimensions mentioned above (such as predefined horizontal and / or predefined vertical dimensions) can be determined based on the dimensions of the current block. For example, the predefined horizontal dimension is determined based on the width of the current block. Similarly, the predefined vertical dimension is determined based on the height of the current block. As a more concrete example, the predefined horizontal dimension is N times the width of the current block, and the predefined vertical dimension is N times the height of the current block, where N is a positive integer greater than or equal to 1.

[0168] In some implementations, the predefined dimensions mentioned above (such as predefined horizontal and / or predefined vertical dimensions) may be independent of the current block's size. For example, the predefined horizontal and / or predefined vertical dimensions can be fixed values, such as one or more of 4, 8, 16, 32, and 64.

[0169] For example, non-adjacent locations in the spatial domain to be searched around the current block can satisfy at least one of the following:

[0170] The absolute value of the horizontal offset between the non-adjacent position in the airspace and the top-left corner of the current block is equal to iDistHor+1 (hereinafter referred to as condition 1);

[0171] The absolute value of the vertical offset between the non-adjacent position in the airspace and the top-left corner of the current block is equal to iDistVer+1 (hereinafter referred to as condition 2);

[0172] Where iDistHor equals the predefined horizontal dimension; iDistVer equals the predefined vertical dimension.

[0173] In some implementations, the iDistHor mentioned above can be a fixed value (such as one or more of 4, 8, 16, 32, and 64), or it can be determined based on the size of the current block (such as the width of the current block). For example, the iDistHor mentioned above can be N times the width of the current block, where N is a positive integer greater than or equal to 1.

[0174] In some implementations, the iDistVer value can be a fixed value (e.g., it can include one or more of 4, 8, 16, 32, and 64), or it can be determined based on the size of the current block (e.g., the height of the current block). For example, iDistVer can be N times the height of the current block, where N is a positive integer greater than or equal to 1.

[0175] iDistHor and iDistVer can represent the search distance. Determining iDistHor and / or iDistVer based on the size of the current block allows the search distance to be adaptively adjusted based on the size of the current block, thus making the searched gradient information more accurate.

[0176] Taking Figure 9 as an example, the non-adjacent spatial locations to be searched around the current block include search positions 14 to 16. As shown in Figure 9, search position 14 satisfies condition 1, search position 15 satisfies condition 2, and search position 16 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 14 to 16 is 1, meaning iDistHor equals the width of the current block, and iDistVer equals the height of the current block. In other words, the non-adjacent spatial locations 14 to 16 can be found by starting with the current block's position and using a step size equal to one step size of the current block, within the search area defined by this step size.

[0177] Taking Figure 9 as an example, the non-adjacent spatial locations of the current block include search positions 17-21. As shown in Figure 9, search position 17 satisfies condition 1, search position 18 satisfies condition 2, search position 19 satisfies condition 2, search position 20 satisfies condition 1, and search position 21 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 17-21 is 2, meaning iDistHor is equal to twice the width of the current block, and iDistVer is equal to twice the height of the current block. In other words, the non-adjacent spatial locations 17-21 can be found by searching within the search area defined by twice the current block's size, starting from the current block's position.

[0178] Taking Figure 9 as an example, the non-adjacent spatial locations of the current block include search positions 22 to 26. As shown in Figure 9, search position 22 satisfies condition 1, search position 23 satisfies condition 2, search position 24 satisfies condition 2, search position 25 satisfies condition 1, and search position 26 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 22 to 26 is 3, meaning iDistHor is equal to three times the width of the current block, and iDistVer is equal to three times the height of the current block. In other words, the non-adjacent spatial locations 22 to 26 can be found by searching within the search area defined by three times the current block's size, starting from the current block's position.

[0179] Taking Figure 9 as an example, the non-adjacent spatial locations of the current block include search positions 27 to 31. As shown in Figure 9, search position 27 satisfies condition 1, search position 28 satisfies condition 2, search position 29 satisfies condition 2, search position 30 satisfies condition 1, and search position 31 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 27 to 31 is 4, meaning iDistHor is equal to four times the width of the current block, and iDistVer is equal to four times the height of the current block. In other words, the non-adjacent spatial locations 27 to 31 can be found by searching within the search area defined by four times the current block's size, starting from the current block's position.

[0180] As mentioned above, iDistHor is equal to N times the width of the current block; iDistVer is equal to N times the height of the current block. Alternatively, iDistHor is equal to N times the width of the left adjacent block of the current block; iDistVer is equal to N times the height of the top adjacent block of the current block.

[0181] In some implementations, the value of N mentioned earlier can be less than or equal to 4. For example, the values ​​of N include 1, 2, 3, and 4. Of course, the value of N can also be greater than 4, for example, N is 5, 6, or 7. Setting the value of N to less than or equal to 4 can minimize the implementation complexity of the search process while obtaining sufficient gradient information.

[0182] In some implementations, the non-adjacent spatial locations around the current block to be searched satisfy the following:

[0183] xNb=xTL+offsetX, and yNb=yTL+offsetY;

[0184] Where offsetX and offsetY satisfy at least one of the following:

[0185] offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1;

[0186] offsetX=uiWidth>>1, and offsetY=-iDistVer-1;

[0187] offsetX=-iDistHor-1, and offsetY=-iDistVer-1;

[0188] offsetX=-iDistHor-1, and offsetY=uiHeigth>>1;

[0189] offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1;

[0190] Where xNb represents the horizontal coordinate of a non-adjacent position in the airspace, yNb represents the vertical coordinate of a non-adjacent position in the airspace, xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block.

[0191] The non-adjacent spatial locations provided in this embodiment are evenly distributed around the current block, thereby enabling the search for as much available gradient information as possible using as few search locations as possible.

[0192] Taking Figure 9 as an example, assuming N = 1, then iDistHor equals the width of the current block, and iDistVer equals the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 15 in Figure 9; if offsetX = uiWidth >> 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) is located directly above the current block and has the same horizontal position as search position 15 (Figure 9 does not assign a number to this search position); if offsetX = If offsetX = -iDistHor-1 and offsetY = -iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 16 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) is located to the left of the current block and has the same vertical position as search position 16 (Figure 9 does not assign a number to this search position); if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 16 in Figure 9. Furthermore, in some implementations, when N=1, offsetX and offsetY satisfy at least one of the following: offsetX = uiWidth + iDistHor-1, and offsetY = -iDistVer-1; offsetX = -iDistHor-1, and offsetY = -iDistVer-1; offsetX = -iDistHor-1, and offsetY = uiHeigth + iDistVer-1. Taking Figure 9 as an example, when N=1, the non-adjacent spatial positions (xNb, yNB) can include the search positions 14-16 in Figure 9.

[0193] Taking Figure 9 as an example, assuming N = 2, then iDistHor is equal to twice the width of the current block, and iDistVer is equal to twice the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 18 in Figure 9; if offsetX = uiWidth >> 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 19 in Figure 9; if offsetX = -iDistHor - 1 and offsetY = -iDi If offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 21 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 20 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 17 in Figure 9.

[0194] Taking Figure 9 as an example, assuming N = 3, then iDistHor is equal to three times the width of the current block, and iDistVer is equal to three times the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 23 in Figure 9; if offsetX = uiWidth >> 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 24 in Figure 9; if offsetX = -iDistHor - 1, and offsetY = -iDi If offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 26 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 25 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 22 in Figure 9.

[0195] Taking Figure 9 as an example, assuming N = 4, then iDistHor is equal to four times the width of the current block, and iDistVer is equal to four times the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 28 in Figure 9; if offsetX = uiWidth >> 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 29 in Figure 9; if offsetX = -iDistHor - 1 and offsetY = -iDi If offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 31 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 30 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 27 in Figure 9.

[0196] In some implementations, the non-adjacent spatial locations around the current block satisfy at least one of the following: located to the upper right of the current block, directly above the current block, to the upper left of the current block, directly to the left of the current block, and to the lower left of the current block. If the horizontal coordinate direction is used as a reference, the non-adjacent spatial locations around the current block satisfy at least one of the following: located at 45° of the current block, located at 90° of the current block, located at 135° of the current block, located at 180° of the current block, and located at 225° of the current block. These directions can be understood as the search directions for the non-adjacent spatial locations around the current block; that is, the search operation can be performed along these directions based on the position of the current block to determine the non-adjacent spatial locations of the current block. The search step size in each search direction can be determined based on N (or iDistHor and iDistVer) mentioned above. The non-adjacent spatial locations provided in this application embodiment are uniformly distributed around the current block, thereby enabling the search to obtain as much available gradient information as possible using as few search locations as possible.

[0197] In some implementations, the number of search positions and / or the size of the search range can be adaptively adjusted. For example, the number of search positions and / or the size of the search range can be determined based on the size of the current block. Adaptively adjusting the number of search positions and / or the size of the search range based on the size of the current block results in more accurate gradient information.

[0198] As an example, the range of values ​​for N (or iDistHor and iDistVer) mentioned above can be determined based on the size of the current block. For instance, if the current block size is a first size, then the range of N is the first range; if the current block size is a second size, then the range of N is the second range. Furthermore, in some implementations, if the first size is smaller than the second size, then the first range is smaller than the second range. That is, if the current block is small, the search range of non-adjacent positions in the spatial domain of the current block is narrowed; if the current block is large, the search range of non-adjacent positions in the spatial domain of the current block is expanded, thus making the prediction process more flexible. For example, if the current block size is the first size, then the range of N is 1 to 3; if the current block size is the second size (larger than the first size), then the range of N is 1 to 4.

[0199] As another example, if the size of the current block is smaller than a preset size (e.g., 16×16), then the adjacent spatial locations of the current block may not include at least one of the following locations:

[0200] The first position corresponds to 1 / 4 of the height of the current block (see search position 10 in Figure 6);

[0201] The second position corresponds to 1 / 4 of the width of the current block (see search position 11 in Figure 6);

[0202] The third position corresponds to 3 / 4 of the height of the current block (see search position 12 in Figure 6);

[0203] The fourth position corresponds to 3 / 4 of the width of the current block (see search position 13 in Figure 6);

[0204] The fifth position corresponds to half the height of the current block (see search position 8 in Figure 6);

[0205] The sixth position corresponds to half the width of the current block (see search position 9 in Figure 6).

[0206] As another example, the two examples above can be combined. For instance, if the size of the current block is smaller than a preset size (e.g., 16×16), the range of N can be limited to a second range (e.g., 1 to 3), thereby reducing the number of non-adjacent positions in the spatial domain to be searched. Furthermore, one or more of the positions mentioned above, from the first to the sixth position, can be removed simultaneously (e.g., removing the first to the fourth position simultaneously), thereby reducing the number of adjacent positions in the spatial domain to be searched.

[0207] In step S830, the gradient information to be fused is determined based on multiple search locations around the current block.

[0208] In some implementations, step S830 may include: determining a candidate block set (such as a candidate list) based on multiple search positions surrounding the current block; and determining the gradient information to be fused based on the candidate block set. Determining the candidate block set based on multiple search positions surrounding the current block may include: adding the candidate blocks corresponding to the multiple search positions to the candidate block set. Determining the gradient information to be fused based on the candidate block set may include: sorting the candidate blocks in the candidate block set and using the gradient information corresponding to one or more of the top-ranked candidate blocks as the gradient information to be fused.

[0209] This application does not specifically limit the form or content of the gradient information. For example, in some implementations, the gradient information can be gradient histogram information (HoG information). Gradient histogram information can also be called or replaced by angular pattern HoG information. In other implementations, the gradient information may include a set of IPMs and their corresponding magnitudes. This set of IPMs may, for example, be the set of IPMs with the highest corresponding magnitudes in the gradient histogram. This set of IPMs may include 3 IPMs, 5 IPMs, or other numbers of IPMs.

[0210] In some implementations, the gradient information to be fused can be the gradient information corresponding to K candidate blocks, where K is a positive integer greater than 3. For example, K can be 5. Alternatively, K can be greater than 5, such as 6, 7, or 8. The K candidate blocks mentioned here can be determined based on multiple search positions surrounding the current block. For example, a set of candidate blocks (such as a candidate list, which can be used to store the encoded blocks corresponding to the search positions) can be determined based on multiple search positions surrounding the current block, and the K candidate blocks can be determined from this set. Methods for determining the K candidate blocks from the set can include, for example, sorting the candidate blocks in the set (e.g., sorting by the distance between the top-left corner of a candidate block and the top-left corner of the current block), and then determining the gradient information corresponding to the top K sorted candidate blocks as the gradient information to be fused. Further, in some implementations, if the number of available candidate blocks in the candidate block set is less than K, the gradient information to be fused can be the gradient information corresponding to all available candidate blocks in the candidate block set. By increasing the number of candidate blocks used to provide gradient information (K=3 in related techniques), the accuracy of the fused gradient information can be improved, thereby improving the accuracy of prediction.

[0211] In some implementations, the gradient information to be fused consists of K gradient histograms, where K is a positive integer greater than 3. For example, K can be 5; or, K can be greater than 5, such as 6, 7, or 8.

[0212] In some implementations, the gradient information to be fused consists of the magnitudes of K groups of IPMs, where K is a positive integer greater than 3. For example, K can be 5; or, K can be greater than 5, such as 6, 7, or 8. Each group of IPMs can include 3, 5, or more IPMs.

[0213] In some implementations, the gradient information to be fused is determined based on a set of candidate blocks. This set of candidate blocks can be determined based on multiple search positions surrounding the current block. The set of candidate blocks may or may not contain duplicate candidate blocks. For example, the set of candidate blocks (such as a candidate list, which can be used to store the encoded blocks corresponding to the search positions) can be determined based on multiple search positions surrounding the current block; then, a duplicate check can be performed on the candidate blocks in the set; if the set contains duplicate candidate blocks, only one candidate block is retained. Introducing a duplicate check can avoid redundant gradient information, thereby improving the accuracy of prediction.

[0214] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block in a candidate block set. This candidate block set can be determined based on multiple search positions surrounding the current block. The candidate block set can include M candidate blocks (M is a positive integer greater than or equal to 1), and the order of the M candidate blocks in the candidate block set is determined based on the distance between the M candidate blocks and the current block. Sort the M candidate blocks according to their distance to the current block, which helps to prioritize searching for gradient information corresponding to search positions that are closer in distance.

[0215] There are several ways to define the distance between the M candidate blocks and the current block. For example, the distance between the top-left corner of the M candidate blocks and the top-left corner of the current block can be used as the distance between the M candidate blocks and the current block. Alternatively, the distance between the center of the M candidate blocks and the center of the current block can be used as the distance between the M candidate blocks and the current block.

[0216] As an example, the M candidate blocks include a first candidate block (which can be any of the M candidate blocks). The distance between the first candidate block and the current block is determined based on the difference between a first distance and a second distance. The first distance represents the horizontal distance between the top-left corner of the first candidate block and the top-left corner of the current block, and the second distance represents the vertical distance between the top-left corner of the first candidate block and the top-left corner of the current block. For example, the distance between the first candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)+abs(abs(xTL-xNeiTL)-abs(yTL-yNeiTL))); where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the first candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the first candidate block, and abs represents the absolute value operation. The distance determined by the above method is close to the Euclidean distance between the two positions, and therefore more accurate. In the specific implementation process, deltaX = abs(xTL - xNeiTL) and deltaY = abs(yTL – yNeiTL) can be calculated first, and then (deltaX + deltaY + abs(deltaX - deltaY)) can be calculated to avoid unnecessary repeated calculations.

[0217] As another example, the M candidate blocks include a second candidate block (which can be any of the M candidate blocks). The distance between the second candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL–yNeiTL)); where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the second candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the second candidate block, and abs represents the absolute value operation. The above distance determination method is compatible with the distance determination methods provided by related technologies.

[0218] In some implementations, if two candidate blocks out of M candidate blocks are equidistant from the current block, the candidate block to the left of the current block can be ranked higher than the candidate block above it. For example, the candidate block to the left of the current block has a higher priority than the candidate block above it. Alternatively, the index of the candidate block to the left of the current block can be less than the index of the candidate block above it.

[0219] In some implementations, if two candidate blocks out of M candidate blocks are equidistant from the current block, the candidate block above the current block can be ranked higher than the candidate block to the left of the current block. For example, the candidate block above the current block has a higher priority than the candidate block to the left of the current block. Alternatively, the index of the candidate block above the current block can be less than the index of the candidate block to the left of the current block.

[0220] In step S840, the predicted value of the current block is determined based on the gradient information to be fused.

[0221] In some implementations, step S840 may include: determining target gradient information based on the gradient information to be fused; and determining the predicted value of the current block based on the target gradient information. The target gradient information may, for example, be the gradient information corresponding to the current block.

[0222] In some implementations, determining the target gradient information based on the gradient information to be fused may include: performing an arithmetic average of the gradient information to be fused to determine the target gradient information.

[0223] In some implementations, determining the predicted value of the current block based on the target gradient information may include: determining one or more IPMs based on the target gradient information; performing intra-frame prediction on the current block based on the one or more IPMs to determine one or more predicted values; and determining the predicted value of the current block based on the one or more predicted values. For details, please refer to S1.2 above.

[0224] In some implementations, the gradient information to be fused can be the gradient information corresponding to at least one candidate block. This candidate block can be determined from a set of candidate blocks, which can be determined based on multiple search positions surrounding the current block. Further, in some implementations, the gradient information corresponding to the at least one candidate block can be normalized according to its size (or block size) to determine the gradient information to be fused. For example, at least one gradient histogram corresponding to each of the at least one candidate block can be determined first. Then, the magnitude (or intensity) corresponding to each IPM in the at least one gradient histogram can be normalized according to the size of the at least one candidate block, and the normalized gradient histogram can be used as the gradient information to be fused. Normalizing the gradient information corresponding to the candidate block according to its size helps improve the accuracy of gradient information fusion.

[0225] In some implementations, the gradient information to be fused can be arithmetically averaged or weighted averaged to determine the target gradient information; the predicted value of the current block can then be determined based on the target gradient information. Taking the gradient information to be fused as including one or more gradient histograms as an example, these one or more gradient histograms can be weighted to obtain the gradient histogram corresponding to the current block (i.e., the target gradient information); then, the predicted value of the current block can be determined based on the gradient histogram corresponding to the current block. Weighted averaging of different gradient information to be fused helps improve the accuracy of gradient information fusion.

[0226] The embodiments of this application do not specifically limit the method for determining the weights of the gradient information to be fused. For example, as mentioned above, the gradient information to be fused can be the gradient information corresponding to at least one candidate block in the candidate set. Therefore, in some implementations, the weights of the gradient information to be fused can be determined based on the at least one candidate block.

[0227] As an example, the weights of the gradient information to be fused can be determined based on the distance between the at least one candidate block and the current block. For instance, higher weights can be assigned to the gradient information corresponding to candidate blocks that are closer to the current block, and lower weights can be assigned to the gradient information corresponding to candidate blocks that are farther from the current block.

[0228] As another example, the weights of the gradient information to be fused can be determined based on the size of the at least one candidate block. For instance, larger blocks in the at least one candidate block can be assigned higher weights, and smaller blocks can be assigned lower weights.

[0229] As another example, the weights of the gradient information to be fused can be determined based on the number of target pixels corresponding to the at least one candidate block. Target pixels are the pixels required to determine gradient information in DIMD mode. The target pixels corresponding to the at least one candidate block can be determined based on the size and / or position of the at least one candidate block. For example, blocks with more corresponding target pixels in the at least one candidate block can be assigned higher weights, and blocks with fewer corresponding target pixels can be assigned lower weights.

[0230] As another example, the initial weights of the gradient information to be fused can be determined first based on the number of target pixels corresponding to the at least one candidate block. Then, the initial weights can be adjusted based on the distance between the at least one candidate block and the current block to determine the target weights of the gradient information corresponding to the at least one candidate block. The basic approach to adjusting the initial weights is to give higher weights to blocks that are closer to the current block than the at least one candidate block.

[0231] As mentioned earlier, multiple search positions are set around the current block. This application embodiment does not specifically limit the search order of these multiple search positions. Some possible implementation methods are given below.

[0232] In some implementations, the multiple search locations can be searched in order of proximity to the current block.

[0233] For example, as mentioned earlier, in some implementations, non-adjacent locations in the airspace surrounding the current block can satisfy at least one of the following:

[0234] The absolute value of the horizontal offset between a non-adjacent location in the airspace and the top-left corner of the current block is equal to iDistHor+1;

[0235] The absolute value of the vertical offset between a non-adjacent location in the airspace and the top-left corner of the current block is equal to iDistVer+1;

[0236] Where iDistHor is equal to N times the width of the current block; iDistVer is equal to N times the height of the current block, and N is a positive integer greater than or equal to 1. For non-adjacent spatial locations that satisfy the above conditions, the smaller the value of N corresponding to the non-adjacent spatial location, the closer the non-adjacent spatial location is to the current block, and therefore the search order of the non-adjacent spatial location can be placed earlier.

[0237] Taking Figure 9 as an example, non-adjacent positions 14-16 in the airspace satisfy the above conditions, and the value of N corresponding to non-adjacent positions 14-16 is 1. Therefore, the search order for non-adjacent positions 14-16 is relatively earlier (after searching the adjacent positions, non-adjacent positions 14-16 can be searched). Non-adjacent positions 17-21 in the airspace satisfy the above conditions, and the value of N corresponding to non-adjacent positions 17-21 is 2. Therefore, the search order for non-adjacent positions 17-21 can be placed after non-adjacent positions 14-16. Non-adjacent positions 22-26 in the airspace satisfy the above conditions, and the value of N corresponding to non-adjacent positions 22-26 is 3. Therefore, the search order for non-adjacent positions 22-26 can be placed after non-adjacent positions 17-21. The non-adjacent positions 27-31 in the spatial domain satisfy the above conditions, and the value of N corresponding to these non-adjacent positions is 4. Therefore, the search order for these non-adjacent positions 27-31 can be placed after that for non-adjacent positions 22-26. If multiple non-adjacent positions have the same N value, the order among these positions can be randomly set or determined according to certain rules. For example, the search order of positions located to the left of the current block has priority, followed by positions located above the current block, and then positions located at the top left corner of the current block. Alternatively, the search order of positions located above the current block has priority, followed by positions located to the left of the current block, and then positions located at the top left corner of the current block.

[0238] In some implementations, the search order among multiple search positions can be determined based on the distance (which can refer to absolute distance, i.e., the absolute value of the distances) between the search positions and the current block. This application does not specifically limit the definition of the distance between the search positions and the current block. For example, it can be determined based on the distance between the search position and the top-left corner of the current block. Alternatively, it can be determined based on the distance between the search position and the center of the current block. Or, it can be determined based on the distance between the search position and the top-right corner of the current block. For example, the search order among multiple search positions can be based on the distance between the search positions and the current block, sorted in ascending order of distance. The closer the search position is to the current block, the more similar the gradient information corresponding to that search position is to the gradient information of the current block. Prioritizing the search of such search positions helps to obtain useful reference information more quickly.

[0239] Furthermore, in some implementations, if two of the multiple search positions are equidistant from the current block, the search order between those two search positions can be randomly determined.

[0240] Alternatively, if two of the multiple search positions are equidistant from the current block, the search position to the left of the current block is searched first, followed by the search position above the current block.

[0241] Alternatively, if two of the multiple search positions are equidistant from the current block, the search position above the current block is searched first, followed by the search position to the left of the current block.

[0242] In some implementations, gradient information (such as gradient histograms) can be stored in units of encoded blocks.

[0243] In some implementations, gradient information (such as gradient histograms) can be stored in fixed-size image blocks (or fixed-size storage units). These fixed-size image blocks can be large, such as 32x32 or 64x64. If gradient information is stored in fixed-size image blocks, during use, the pixel position to be searched can be directly divided by the storage unit to obtain the storage coordinates, and the gradient information corresponding to those coordinates can be found in memory. This method of storing gradient information saves memory overhead and is beneficial for hardware implementation.

[0244] The specific size of the image patch (or storage unit) mentioned above can be determined based on the resolution of the current frame (i.e., adaptively selected according to the resolution of the current frame). For example, if the resolution of the current frame is small, a smaller image patch (or storage unit) can be selected, and if the resolution of the current frame is large, a larger image patch (or storage unit) can be selected.

[0245] As mentioned earlier, in some implementations, duplicate checks can be performed on candidate blocks in the candidate block set. Whether two candidate blocks in the candidate block set are duplicates can be determined based on at least one of the following: whether the two candidate blocks correspond to the same coding block; whether the difference between the gradient information corresponding to the two candidate blocks meets a preset condition.

[0246] For example, if two candidate blocks in the candidate block set correspond to the same coded block, then it can be determined that the two candidate blocks are duplicates. In this case, only one candidate block can be retained.

[0247] For example, if the difference between the gradient information corresponding to two candidate blocks in the candidate block set meets a preset condition, it can be determined that the two candidate blocks are duplicates. In this case, only one candidate block can be retained. The preset condition here can be used to measure the similarity of the gradient information corresponding to two candidate blocks. That is, if the gradient information corresponding to two candidate blocks is similar (or the HoG characteristics are consistent), it can be determined that the two candidate blocks are duplicates. By introducing this duplication judgment condition, redundant gradient information can be removed, thereby making the fusion result of gradient information more accurate.

[0248] There are several ways to determine whether two candidate blocks in a candidate block set are similar. For example, if two candidate blocks correspond to two different gradient histograms, the similarity between the two gradient histograms can be directly used to determine their similarity. Alternatively, in some implementations, two sets of IPMs can be determined based on the magnitudes of the IPMs in the two gradient histograms, and the similarity between these two sets of IPMs can be used for comparison.

[0249] For example, the candidate block set includes a first candidate block and a second candidate block. The first candidate block corresponds to a first gradient histogram, and the second candidate block corresponds to a second gradient histogram. The S IPMs with the highest magnitude in the first gradient histogram form a first set (i.e., the gradients corresponding to these S IPMs in the first gradient histogram have the highest magnitude, where S is a positive integer greater than or equal to 1, for example, S can be equal to 3, 4, or 5), and the S IPMs with the highest magnitude in the second gradient histogram form a second set (i.e., the gradients corresponding to these S IPMs have the highest magnitude in the second gradient histogram). Whether the gradient information corresponding to the two candidate blocks is similar (or whether the two candidate blocks are duplicated) can be determined based on whether the first set and the second set are similar.

[0250] In some implementations, whether two candidate blocks are duplicates can be determined based on the number of identical IPMs contained in the first and second sets mentioned above.

[0251] For example, if the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold, then the two candidate blocks can be determined to be duplicates. Alternatively, if the values ​​of the IPMs in the first set and the second set highly overlap, then the two candidate blocks can be determined to be duplicates.

[0252] For example, if the ratio of the intersection to the union of the first and second sets is greater than or equal to a third threshold (e.g., 0.5), then the two candidate blocks are considered duplicates. Specifically, the similarity between the first and second sets can be determined by calculating the ratio of their intersection to their union according to the Jaccard similarity criterion. The Jaccard similarity index ranges from 0 to 1, where 1 indicates that the two sets are completely identical, and 0 indicates that the two sets have no common elements. If the ratio of the intersection to the union of the first and second sets is greater than 0.5, then the first and second sets are considered similar, and thus the two candidate blocks can be determined to be duplicates.

[0253] In some implementations, whether two candidate blocks are duplicates can be determined based on the difference between a first IPM in a first set and a second IPM in a second set, wherein the first set does not include the second IPM, and the second set does not include the first IPM. In other words, the first IPM and the second IPM are IPMs in the first set and the second set that differ from each other.

[0254] For example, if the difference (or maximum difference) between the first IPM and the second IPM is less than or equal to a second threshold, then two candidate blocks can be identified as duplicates. This second threshold can be, for example, 3, 4, or 5.

[0255] In some implementations, at least one of the following can be determined based on the size of the current block: the number of candidate blocks in the candidate block set; the amount of gradient information to be fused (e.g., the number of gradient histograms to be fused); and the number of IPMs used to determine the predicted value (this number can be used to indicate how many IPMs of predicted values ​​need to be used for weighted blending to determine the predicted value of the current block). In other words, one or more of the following can be adaptively adjusted based on the size of the current block: the number of candidate blocks in the candidate block set, the amount of gradient information to be fused, and the number of IPMs used to determine the predicted value.

[0256] For example, for blocks smaller than or equal to 16x16, the number of candidate blocks in the candidate block set can be reduced. For instance, for blocks smaller than or equal to 16x16, the candidate block set may include only 7 or 9 candidate blocks.

[0257] For example, for blocks larger than 16x16, the number of candidate blocks in the candidate block set can be increased.

[0258] For example, for blocks smaller than or equal to 16x16, the number of gradient histograms to be fused can be reduced. For instance, for blocks smaller than or equal to 16x16, an arithmetic mean of only three gradient histograms can be used to determine the gradient histogram corresponding to the current block.

[0259] For example, for blocks larger than 16x16, the number of gradient histograms to be fused can be increased.

[0260] For example, for blocks smaller than or equal to 16x16, fewer IPMs can be used when performing a weighted fusion of predictions from multiple IPMs to generate the prediction for the current block. For instance, the predictions from only 2 IPMs can be used for weighted fusion to generate the prediction for the current block.

[0261] For example, for blocks larger than 16x16, a larger number of IPMs can be used when performing weighted fusion of predictions from multiple IPMs to generate a prediction for the current block.

[0262] The non-adjacent locations in the spatial domain surrounding the current block, as mentioned earlier, can be determined based on a specific search strategy. For example, the search distance and direction can be determined first, and then, using the current block's location as a reference, a two-dimensional search can be performed around the current block according to the search step size and search direction to determine the non-adjacent locations in the spatial domain surrounding the current block.

[0263] Alternatively, in some implementations, the non-adjacent spatial locations around the current block can be determined based on a pre-established first mapping relationship, which is the mapping relationship between the indices and coordinates of the non-adjacent spatial locations. For example, a one-dimensional list can be used to sequentially store the mapping relationship between the indices and coordinates of the non-adjacent spatial locations that need to be searched for in the current block. In actual use, the non-adjacent spatial locations can be found directly based on this one-dimensional list.

[0264] Alternatively, in some implementations, non-adjacent spatial locations are determined based on pre-established first and second mapping relationships. The first mapping relationship is the mapping between the index of the non-adjacent spatial location and the search distance (e.g., the distance between the non-adjacent spatial location and the top-left corner of the current block), and the second mapping relationship is the mapping between the index of the non-adjacent spatial location and the search direction (e.g., the direction of the non-adjacent spatial location relative to the current block). For example, two one-dimensional lists can be used to store the mapping relationship between the index of the non-adjacent spatial location and the search distance, and the mapping relationship between the index of the non-adjacent spatial location and the search direction, respectively. In practical use, the coordinates of the non-adjacent spatial locations can be derived from the combination of the two one-dimensional lists, and then the non-adjacent spatial locations can be determined based on the coordinates of the non-adjacent spatial locations.

[0265] The decoding method provided by the embodiments of this application has been described in detail above with reference to Figure 8. The encoding method provided by the embodiments of this application will be illustrated in detail below with reference to Figure 10.

[0266] Figure 10 is a schematic flowchart of the encoding method provided in an embodiment of this application. The method in Figure 10 can also be called an intra-frame prediction method, or a prediction method based on DIMD fusion mode. The method in Figure 10 can be applied to an encoder, for example, to the intra-frame prediction unit of the encoder.

[0267] Referring to Figure 10, in step S1010, multiple search locations around the current block are determined.

[0268] The current block can also be called the current coding block or the current coding unit. For example, the current block can be a luma block.

[0269] The intra-prediction mode used in the current block can be the DIMD fusion mode.

[0270] In some implementations, the number of search locations around the current block can be greater than 13. For example, the number of search locations around the current block can be greater than or equal to 16, 18, 21, 26, or 31. The number of search locations provided in this application embodiment is greater than the number of search locations provided by related technologies (related technologies provide 13 search locations). Therefore, this application embodiment is equivalent to searching for candidate blocks in a larger search area or more search locations, thereby helping to improve the accuracy of prediction.

[0271] In some implementations, multiple search locations around the current block (or multiple search locations in the neighboring region of the current block) may include spatially adjacent locations (or adjacent reference points) and / or spatially non-adjacent locations (or non-adjacent reference points). For example, a search can be performed at X1 spatially adjacent locations and X2 spatially non-adjacent locations around the current block. The value of X1 may be less than or equal to 13, for example. The value of X2 may be 3, 5, 8, 13, or 18, for example. Embodiments of this application expand the search area, which helps to obtain more available candidate blocks, thereby contributing to improved prediction accuracy.

[0272] In some implementations, the search locations around the current block include non-adjacent locations in the spatial domain, which are determined based on predefined locations and / or predefined dimensions. Predefined dimensions may, for example, include predefined horizontal dimensions (or horizontal step sizes) and / or predefined vertical dimensions (or vertical step sizes).

[0273] In some implementations, the predefined locations or non-adjacent locations in the spatial domain mentioned above can be determined based on one or more of the following:

[0274] The position of the current block (e.g., the top left corner of the current block);

[0275] The size of the current block (such as the width and / or height of the current block);

[0276] The size of the current block's adjacent blocks (such as the width and / or height of the adjacent blocks);

[0277] Predefined horizontal dimensions;

[0278] Predefined vertical dimension.

[0279] In some implementations, the predefined dimensions mentioned above (such as predefined horizontal and / or predefined vertical dimensions) can be determined based on the dimensions of the current block. For example, the predefined horizontal dimension is determined based on the width of the current block. Similarly, the predefined vertical dimension is determined based on the height of the current block. As a more concrete example, the predefined horizontal dimension is N times the width of the current block, and the predefined vertical dimension is N times the height of the current block, where N is a positive integer greater than or equal to 1.

[0280] In some implementations, the predefined dimensions mentioned above (such as predefined horizontal and / or predefined vertical dimensions) may be independent of the current block's size. For example, the predefined horizontal and / or predefined vertical dimensions can be fixed values, such as one or more of 4, 8, 16, 32, and 64.

[0281] For example, non-adjacent locations in the spatial domain to be searched around the current block can satisfy at least one of the following:

[0282] The absolute value of the horizontal offset between the non-adjacent position in the airspace and the top-left corner of the current block is equal to iDistHor+1 (hereinafter referred to as condition 1);

[0283] The absolute value of the vertical offset between the non-adjacent position in the airspace and the top-left corner of the current block is equal to iDistVer+1 (hereinafter referred to as condition 2);

[0284] Where iDistHor equals the predefined horizontal dimension; iDistVer equals the predefined vertical dimension.

[0285] In some implementations, the iDistHor mentioned above can be a fixed value (such as one or more of 4, 8, 16, 32, and 64), or it can be determined based on the size of the current block (such as the width of the current block). For example, the iDistHor mentioned above can be N times the width of the current block, where N is a positive integer greater than or equal to 1.

[0286] In some implementations, the iDistVer value can be a fixed value (e.g., it can include one or more of 4, 8, 16, 32, and 64), or it can be determined based on the size of the current block (e.g., the height of the current block). For example, iDistVer can be N times the height of the current block, where N is a positive integer greater than or equal to 1.

[0287] iDistHor and iDistVer can represent the search distance. Determining iDistHor and / or iDistVer based on the size of the current block allows the search distance to be adaptively adjusted based on the size of the current block, thus making the searched gradient information more accurate.

[0288] Taking Figure 9 as an example, the non-adjacent spatial locations to be searched around the current block include search positions 14 to 16. As shown in Figure 9, search position 14 satisfies condition 1, search position 15 satisfies condition 2, and search position 16 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 14 to 16 is 1, meaning iDistHor equals the width of the current block, and iDistVer equals the height of the current block. In other words, the non-adjacent spatial locations 14 to 16 can be found by starting with the current block's position and using a step size equal to one step size of the current block, within the search area defined by this step size.

[0289] Taking Figure 9 as an example, the non-adjacent spatial locations of the current block include search positions 17-21. As shown in Figure 9, search position 17 satisfies condition 1, search position 18 satisfies condition 2, search position 19 satisfies condition 2, search position 20 satisfies condition 1, and search position 21 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 17-21 is 2, meaning iDistHor is equal to twice the width of the current block, and iDistVer is equal to twice the height of the current block. In other words, the non-adjacent spatial locations 17-21 can be found by searching within the search area defined by twice the current block's size, starting from the current block's position.

[0290] Taking Figure 9 as an example, the non-adjacent spatial locations of the current block include search positions 22 to 26. As shown in Figure 9, search position 22 satisfies condition 1, search position 23 satisfies condition 2, search position 24 satisfies condition 2, search position 25 satisfies condition 1, and search position 26 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 22 to 26 is 3, meaning iDistHor is equal to three times the width of the current block, and iDistVer is equal to three times the height of the current block. In other words, the non-adjacent spatial locations 22 to 26 can be found by searching within the search area defined by three times the current block's size, starting from the current block's position.

[0291] Taking Figure 9 as an example, the non-adjacent spatial locations of the current block include search positions 27 to 31. As shown in Figure 9, search position 27 satisfies condition 1, search position 28 satisfies condition 2, search position 29 satisfies condition 2, search position 30 satisfies condition 1, and search position 31 satisfies both conditions 1 and 2. Furthermore, the value of N corresponding to search positions 27 to 31 is 4, meaning iDistHor is equal to four times the width of the current block, and iDistVer is equal to four times the height of the current block. In other words, the non-adjacent spatial locations 27 to 31 can be found by searching within the search area defined by four times the current block's size, starting from the current block's position.

[0292] As mentioned above, iDistHor is equal to N times the width of the current block; iDistVer is equal to N times the height of the current block. Alternatively, iDistHor is equal to N times the width of the left adjacent block of the current block; iDistVer is equal to N times the height of the top adjacent block of the current block.

[0293] In some implementations, the value of N mentioned earlier can be less than or equal to 4. For example, the values ​​of N include 1, 2, 3, and 4. Of course, the value of N can also be greater than 4, for example, N is 5, 6, or 7. Setting the value of N to less than or equal to 4 can minimize the implementation complexity of the search process while obtaining sufficient gradient information.

[0294] In some implementations, the non-adjacent spatial locations around the current block to be searched satisfy the following:

[0295] xNb=xTL+offsetX, and yNb=yTL+offsetY;

[0296] Where offsetX and offsetY satisfy at least one of the following:

[0297] offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1;

[0298] offsetX=uiWidth>>1, and offsetY=-iDistVer-1;

[0299] offsetX=-iDistHor-1, and offsetY=-iDistVer-1;

[0300] offsetX=-iDistHor-1, and offsetY=uiHeigth>>1;

[0301] offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1;

[0302] Where xNb represents the horizontal coordinate of a non-adjacent position in the airspace, yNb represents the vertical coordinate of a non-adjacent position in the airspace, xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block.

[0303] The non-adjacent spatial locations provided in this embodiment are evenly distributed around the current block, thereby enabling the search for as much available gradient information as possible using as few search locations as possible.

[0304] Taking Figure 9 as an example, assuming N = 1, then iDistHor equals the width of the current block, and iDistVer equals the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 15 in Figure 9; if offsetX = uiWidth >> 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) is located directly above the current block and has the same horizontal position as search position 15 (Figure 9 does not assign a number to this search position); if offsetX = -iDistHor - 1, and offsetY = -iDi... If offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 16 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) is located to the left of the current block and has the same vertical position as search position 16 (Figure 9 does not assign a number to this search position); if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 16 in Figure 9. Furthermore, in some implementations, when N=1, offsetX and offsetY satisfy at least one of the following: offsetX = uiWidth + iDistHor-1, and offsetY = -iDistVer-1; offsetX = -iDistHor-1, and offsetY = -iDistVer-1; offsetX = -iDistHor-1, and offsetY = uiHeigth + iDistVer-1. Taking Figure 9 as an example, when N=1, the non-adjacent spatial positions (xNb, yNB) can include the search positions 14-16 in Figure 9.

[0305] Taking Figure 9 as an example, assuming N=2, then iDistHor is equal to twice the width of the current block, and iDistVer is equal to twice the height of the current block. Furthermore, if offsetX = uiWidth + iDistHor - 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 18 in Figure 9; if offsetX = uiWidth >> 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 19 in Figure 9; if offsetX = -iDistHor - 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 21 in Figure 9; if offsetX = -iDistHor - 1 and offsetY = uiWidth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 20 in Figure 9; if offsetX = -iDistHor - 1 and offsetY = -iDistHor - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 20 in Figure 9; if offsetX = -iDistHor - 1 and offsetY = -iDistVer ... =uiHeigth+iDistVer-1, then the non-adjacent spatial position (xNb,yNB) refers to the search position 17 in Figure 9.

[0306] Taking Figure 9 as an example, assuming N = 3, then iDistHor is equal to three times the width of the current block, and iDistVer is equal to three times the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 23 in Figure 9; if offsetX = uiWidth >> 1, and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 24 in Figure 9; if offsetX = -iDistHor - 1, and offsetY = -iDi If offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 26 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 25 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 22 in Figure 9.

[0307] Taking Figure 9 as an example, assuming N = 4, then iDistHor is equal to four times the width of the current block, and iDistVer is equal to four times the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 28 in Figure 9; if offsetX = uiWidth >> 1 and offsetY = -iDistVer - 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 29 in Figure 9; if offsetX = -iDistHor - 1 and offsetY = -iDi If offsetX = -iDistHor-1 and offsetY = uiHeigth >> 1, then the non-adjacent spatial position (xNb, yNB) refers to search position 31 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 30 in Figure 9; if offsetX = -iDistHor-1 and offsetY = uiHeigth + iDistVer-1, then the non-adjacent spatial position (xNb, yNB) refers to search position 27 in Figure 9.

[0308] In some implementations, the non-adjacent spatial locations around the current block satisfy at least one of the following: located to the upper right of the current block, directly above the current block, to the upper left of the current block, directly to the left of the current block, and to the lower left of the current block. If the horizontal coordinate direction is used as a reference, the non-adjacent spatial locations around the current block satisfy at least one of the following: located at 45° of the current block, located at 90° of the current block, located at 135° of the current block, located at 180° of the current block, and located at 225° of the current block. These directions can be referred to as the search directions for the non-adjacent spatial locations around the current block. That is, the search operation can be performed along these directions based on the position of the current block to determine the non-adjacent spatial locations of the current block. The search step size in each search direction can be determined based on N (or iDistHor and iDistVer) mentioned above. The non-adjacent spatial locations provided in this application embodiment are uniformly distributed around the current block, thereby enabling the search to obtain as much available gradient information as possible using as few search locations as possible.

[0309] In some implementations, the number of search positions and / or the size of the search range can be adaptively adjusted. For example, the number of search positions and / or the size of the search range can be determined based on the size of the current block. Adaptively adjusting the number of search positions and / or the size of the search range based on the size of the current block results in more accurate gradient information.

[0310] As an example, the range of values ​​for N (or iDistHor and iDistVer) mentioned above can be determined based on the size of the current block. For instance, if the current block size is a first size, then the range of N is the first range; if the current block size is a second size, then the range of N is the second range. Furthermore, in some implementations, if the first size is smaller than the second size, then the first range is smaller than the second range. That is, if the current block is small, the search range of non-adjacent positions in the spatial domain of the current block is narrowed; if the current block is large, the search range of non-adjacent positions in the spatial domain of the current block is expanded, thus making the prediction process more flexible. For example, if the current block size is the first size, then the range of N is 1 to 3; if the current block size is the second size (larger than the first size), then the range of N is 1 to 4.

[0311] As another example, if the size of the current block is smaller than a preset size (e.g., 16×16), then the adjacent spatial locations of the current block may not include at least one of the following locations:

[0312] The first position corresponds to 1 / 4 of the height of the current block (see search position 10 in Figure 6);

[0313] The second position corresponds to 1 / 4 of the width of the current block (see search position 11 in Figure 6);

[0314] The third position corresponds to 3 / 4 of the height of the current block (see search position 12 in Figure 6);

[0315] The fourth position corresponds to 3 / 4 of the width of the current block (see search position 13 in Figure 6);

[0316] The fifth position corresponds to half the height of the current block (see search position 8 in Figure 6);

[0317] The sixth position corresponds to half the width of the current block (see search position 9 in Figure 6).

[0318] As another example, the two examples above can be combined. For instance, if the size of the current block is smaller than a preset size (e.g., 16×16), the range of N can be limited to a second range (e.g., 1 to 3), thereby reducing the number of non-adjacent positions in the spatial domain to be searched. Furthermore, one or more of the positions mentioned above, from the first to the sixth position, can be removed simultaneously (e.g., removing the first to the fourth position simultaneously), thereby reducing the number of adjacent positions in the spatial domain to be searched.

[0319] In step S1020, the gradient information to be fused is determined based on multiple search locations around the current block.

[0320] In some implementations, step S1020 may include: determining a candidate block set (such as a candidate list) based on multiple search positions surrounding the current block; and determining the gradient information to be fused based on the candidate block set. Determining the candidate block set based on multiple search positions surrounding the current block may include: adding the candidate blocks corresponding to the multiple search positions to the candidate block set. Determining the gradient information to be fused based on the candidate block set may include: sorting the candidate blocks in the candidate block set and using the gradient information corresponding to one or more of the top-ranked candidate blocks as the gradient information to be fused.

[0321] This application does not specifically limit the form or content of the gradient information. For example, in some implementations, the gradient information can be gradient histogram information (or HoG information). Gradient histogram information can also be called or replaced by angular pattern HoG information. In other implementations, the gradient information may include a set of IPMs and their corresponding magnitudes. This set of IPMs may, for example, be the set of IPMs with the highest corresponding magnitudes in the gradient histogram. This set of IPMs may include 3 IPMs, 5 IPMs, or other numbers of IPMs.

[0322] In some implementations, the gradient information to be fused can be the gradient information corresponding to K candidate blocks, where K is a positive integer greater than 3. For example, K can be 5. Alternatively, K can be greater than 5, such as 6, 7, or 8. The K candidate blocks mentioned here can be determined based on multiple search positions around the current block. For example, a set of candidate blocks (such as a candidate list, which can be used to store the coding block information corresponding to the search positions) can be determined based on multiple search positions around the current block, and the K candidate blocks can be determined from this set. Methods for determining the K candidate blocks from the set can include, for example, sorting the candidate blocks in the set (e.g., sorting by the distance between the top-left corner of a candidate block and the top-left corner of the current block), and then determining the gradient information corresponding to the top K sorted candidate blocks as the gradient information to be fused. Further, in some implementations, if the number of available candidate blocks in the candidate block set is less than K, the gradient information to be fused can be the gradient information corresponding to all available candidate blocks. By increasing the number of candidate blocks used to provide gradient information (K=3 in related techniques), the accuracy of the fused gradient information can be improved, thereby improving the accuracy of prediction.

[0323] In some implementations, the gradient information to be fused consists of K gradient histograms, where K is a positive integer greater than 3. For example, K can be 5; or, K can be greater than 5, such as 6, 7, or 8.

[0324] In some implementations, the gradient information to be fused consists of the magnitudes of K groups of IPMs, where K is a positive integer greater than 3. For example, K can be 5; or, K can be greater than 5, such as 6, 7, or 8. Each group of IPMs can include 3, 5, or more IPMs.

[0325] In some implementations, the gradient information to be fused is determined based on a set of candidate blocks. This set of candidate blocks can be determined based on multiple search positions surrounding the current block. The set of candidate blocks may or may not contain duplicate candidate blocks. For example, the set of candidate blocks (such as a candidate list, which can be used to store the encoded block information corresponding to the search positions) can be determined based on multiple search positions surrounding the current block; then, a duplicate check can be performed on the candidate blocks in the set; if the set contains duplicate candidate blocks, only one candidate block is retained. Introducing a duplicate check can avoid redundant gradient information, thereby improving the accuracy of prediction.

[0326] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block in a candidate block set. This candidate block set can be determined based on multiple search positions surrounding the current block. The candidate block set can include M candidate blocks (M is a positive integer greater than or equal to 1), and the order of the M candidate blocks in the candidate block set is determined based on the distance between the M candidate blocks and the current block. Sort the M candidate blocks according to their distance to the current block, which helps to prioritize searching for gradient information corresponding to search positions that are closer in distance.

[0327] There are several ways to define the distance between the M candidate blocks and the current block. For example, the distance between the top-left corner of the M candidate blocks and the top-left corner of the current block can be used as the distance between the M candidate blocks and the current block. Alternatively, the distance between the center of the M candidate blocks and the center of the current block can be used as the distance between the M candidate blocks and the current block.

[0328] As an example, the M candidate blocks include a first candidate block (which can be any of the M candidate blocks). The distance between the first candidate block and the current block is determined based on the difference between a first distance and a second distance. The first distance represents the horizontal distance between the top-left corner of the first candidate block and the top-left corner of the current block, and the second distance represents the vertical distance between the top-left corner of the first candidate block and the top-left corner of the current block. For example, the distance between the first candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)+abs(abs(xTL-xNeiTL)-abs(yTL-yNeiTL))); where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the first candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the first candidate block, and abs represents the absolute value operation. The distance determined by the above method is close to the Euclidean distance between the two positions, and therefore more accurate. In the specific implementation process, deltaX = abs(xTL - xNeiTL) and deltaY = abs(yTL – yNeiTL) can be calculated first, and then (deltaX + deltaY + abs(deltaX - deltaY)) can be calculated to avoid unnecessary repeated calculations.

[0329] As another example, the M candidate blocks include a second candidate block (which can be any of the M candidate blocks). The distance between the second candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL–yNeiTL)); where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the second candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the second candidate block, and abs represents the absolute value operation. The above distance determination method is compatible with the distance determination methods provided by related technologies.

[0330] In some implementations, if two candidate blocks out of M candidate blocks are equidistant from the current block, the candidate block to the left of the current block can be ranked higher than the candidate block above it. For example, the candidate block to the left of the current block has a higher priority than the candidate block above it. Alternatively, the index of the candidate block to the left of the current block can be less than the index of the candidate block above it.

[0331] In some implementations, if two candidate blocks out of M candidate blocks are equidistant from the current block, the candidate block above the current block can be ranked higher than the candidate block to the left of the current block. For example, the candidate block above the current block has a higher priority than the candidate block to the left of the current block. Alternatively, the index of the candidate block above the current block can be less than the index of the candidate block to the left of the current block.

[0332] In step S1030, the predicted value of the current block is determined based on the gradient information to be fused.

[0333] In some implementations, step S1030 may include: determining target gradient information based on the gradient information to be fused; and determining the predicted value of the current block based on the target gradient information. The target gradient information may, for example, be the gradient information corresponding to the current block.

[0334] In some implementations, determining the target gradient information based on the gradient information to be fused may include: performing an arithmetic average of the gradient information to be fused to determine the target gradient information.

[0335] In some implementations, determining the predicted value of the current block based on the target gradient information may include: determining one or more IPMs based on the target gradient information; performing intra-frame prediction on the current block based on the one or more IPMs to determine one or more predicted values; and determining the predicted value of the current block based on the one or more predicted values. For details, please refer to S1.2 above.

[0336] In some implementations, the gradient information to be fused can be the gradient information corresponding to at least one candidate block. This candidate block can be determined from a set of candidate blocks, which can be determined based on multiple search positions surrounding the current block. Further, in some implementations, the gradient information corresponding to the at least one candidate block can be normalized according to its size (or block size) to determine the gradient information to be fused. For example, at least one gradient histogram corresponding to each of the at least one candidate block can be determined first. Then, the magnitude (or intensity) corresponding to each IPM in the at least one gradient histogram can be normalized according to the size of the at least one candidate block, and the normalized gradient histogram can be used as the gradient information to be fused. Normalizing the gradient information corresponding to the candidate block according to its size helps improve the accuracy of gradient information fusion.

[0337] In some implementations, the gradient information to be fused can be arithmetically averaged or weighted averaged to determine the target gradient information; the predicted value of the current block can then be determined based on the target gradient information. Taking the gradient information to be fused as including one or more gradient histograms as an example, these one or more gradient histograms can be weighted to obtain the gradient histogram corresponding to the current block (i.e., the target gradient information); then, the predicted value of the current block can be determined based on the gradient histogram corresponding to the current block. Weighted averaging of different gradient information to be fused helps improve the accuracy of gradient information fusion.

[0338] The embodiments of this application do not specifically limit the method for determining the weights of the gradient information to be fused. For example, as mentioned above, the gradient information to be fused can be the gradient information corresponding to at least one candidate block in the candidate set. Therefore, in some implementations, the weights of the gradient information to be fused can be determined based on the at least one candidate block.

[0339] As an example, the weights of the gradient information to be fused can be determined based on the distance between the at least one candidate block and the current block. For instance, higher weights can be assigned to the gradient information corresponding to candidate blocks that are closer to the current block, and lower weights can be assigned to the gradient information corresponding to candidate blocks that are farther from the current block.

[0340] As another example, the weights of the gradient information to be fused can be determined based on the size of the at least one candidate block. For instance, larger blocks in the at least one candidate block can be assigned higher weights, and smaller blocks can be assigned lower weights.

[0341] As another example, the weights of the gradient information to be fused can be determined based on the number of target pixels corresponding to the at least one candidate block. Target pixels are the pixels required to determine gradient information in DIMD mode. The target pixels corresponding to the at least one candidate block can be determined based on the size and / or position of the at least one candidate block. For example, blocks with more corresponding target pixels in the at least one candidate block can be assigned higher weights, and blocks with fewer corresponding target pixels can be assigned lower weights.

[0342] As another example, the initial weights of the gradient information to be fused can be determined first based on the number of target pixels corresponding to the at least one candidate block. Then, the initial weights can be adjusted based on the distance between the at least one candidate block and the current block to determine the target weights of the gradient information corresponding to the at least one candidate block. The basic approach to adjusting the initial weights is to give higher weights to blocks that are closer to the current block than the at least one candidate block.

[0343] As mentioned earlier, multiple search positions are set around the current block. This application embodiment does not specifically limit the search order of these multiple search positions. Some possible implementation methods are given below.

[0344] In some implementations, the multiple search locations can be searched in order of proximity to the current block.

[0345] For example, as mentioned earlier, in some implementations, non-adjacent locations in the airspace surrounding the current block can satisfy at least one of the following:

[0346] The absolute value of the horizontal offset between a non-adjacent location in the airspace and the top-left corner of the current block is equal to iDistHor+1;

[0347] The absolute value of the vertical offset between a non-adjacent location in the airspace and the top-left corner of the current block is equal to iDistVer+1;

[0348] Where iDistHor is equal to N times the width of the current block; iDistVer is equal to N times the height of the current block, and N is a positive integer greater than or equal to 1. For non-adjacent spatial locations that satisfy the above conditions, the smaller the value of N corresponding to the non-adjacent spatial location, the closer the non-adjacent spatial location is to the current block, and therefore the search order of the non-adjacent spatial location can be placed earlier.

[0349] Taking Figure 9 as an example, non-adjacent positions 14-16 in the airspace satisfy the above conditions, and the value of N corresponding to non-adjacent positions 14-16 is 1. Therefore, the search order for non-adjacent positions 14-16 is relatively earlier (after searching the adjacent positions, non-adjacent positions 14-16 can be searched). Non-adjacent positions 17-21 in the airspace satisfy the above conditions, and the value of N corresponding to non-adjacent positions 17-21 is 2. Therefore, the search order for non-adjacent positions 17-21 can be placed after non-adjacent positions 14-16. Non-adjacent positions 22-26 in the airspace satisfy the above conditions, and the value of N corresponding to non-adjacent positions 22-26 is 3. Therefore, the search order for non-adjacent positions 22-26 can be placed after non-adjacent positions 17-21. The non-adjacent positions 27-31 in the spatial domain satisfy the above conditions, and the value of N corresponding to these non-adjacent positions is 4. Therefore, the search order for these non-adjacent positions 27-31 can be placed after that for non-adjacent positions 22-26. If multiple non-adjacent positions have the same N value, the order among these positions can be randomly set or determined according to certain rules. For example, the search order of positions located to the left of the current block has priority, followed by positions located above the current block, and then positions located at the top left corner of the current block. Alternatively, the search order of positions located above the current block has priority, followed by positions located to the left of the current block, and then positions located at the top left corner of the current block.

[0350] In some implementations, the search order among multiple search positions can be determined based on the distance (which can refer to absolute distance, i.e., the absolute value of the distances) between the search positions and the current block. This application does not specifically limit the definition of the distance between the search positions and the current block. For example, it can be determined based on the distance between the search position and the top-left corner of the current block. Alternatively, it can be determined based on the distance between the search position and the center of the current block. Or, it can be determined based on the distance between the search position and the top-right corner of the current block. For example, the search order among multiple search positions can be based on the distance between the search positions and the current block, sorted in ascending order of distance. The closer the search position is to the current block, the more similar the gradient information corresponding to that search position is to the gradient information of the current block. Prioritizing the search of such search positions helps to obtain useful reference information more quickly.

[0351] Furthermore, in some implementations, if two of the multiple search positions are equidistant from the current block, the search order between those two search positions can be randomly determined.

[0352] Alternatively, if two of the multiple search positions are equidistant from the current block, the search position to the left of the current block is searched first, followed by the search position above the current block.

[0353] Alternatively, if two of the multiple search positions are equidistant from the current block, the search position above the current block is searched first, followed by the search position to the left of the current block.

[0354] In some implementations, gradient information (such as gradient histograms) can be stored in units of encoded blocks.

[0355] In some implementations, gradient information (such as gradient histograms) can be stored in fixed-size image blocks (or fixed-size storage units). These fixed-size image blocks can be large, such as 32x32 or 64x64. If gradient information is stored in fixed-size image blocks, during use, the pixel position to be searched can be directly divided by the storage unit to obtain the storage coordinates, and the gradient information corresponding to those coordinates can be found in memory. This method of storing gradient information saves memory overhead and is beneficial for hardware implementation.

[0356] The specific size of the image patch (or storage unit) mentioned above can be determined based on the resolution of the current frame (i.e., adaptively selected according to the resolution of the current frame). For example, if the resolution of the current frame is small, a smaller image patch (or storage unit) can be selected, and if the resolution of the current frame is large, a larger image patch (or storage unit) can be selected.

[0357] As mentioned earlier, in some implementations, duplicate checks can be performed on candidate blocks in the candidate block set. Whether two candidate blocks in the candidate block set are duplicates can be determined based on at least one of the following: whether the two candidate blocks correspond to the same coding block; whether the difference between the gradient information corresponding to the two candidate blocks meets a preset condition.

[0358] For example, if two candidate blocks in the candidate block set correspond to the same coded block, then it can be determined that the two candidate blocks are duplicates. In this case, only one candidate block can be retained.

[0359] For example, if the difference between the gradient information corresponding to two candidate blocks in the candidate block set meets a preset condition, it can be determined that the two candidate blocks are duplicates. In this case, only one candidate block can be retained. The preset condition here can be used to measure the similarity of the gradient information corresponding to two candidate blocks. That is, if the gradient information corresponding to two candidate blocks is similar (or the HoG characteristics are consistent), it can be determined that the two candidate blocks are duplicates. By introducing this duplication judgment condition, redundant gradient information can be removed, thereby making the fusion result of gradient information more accurate.

[0360] There are several ways to determine whether two candidate blocks in a candidate block set are similar. For example, if two candidate blocks correspond to two different gradient histograms, the similarity between the two gradient histograms can be directly used to determine their similarity. Alternatively, in some implementations, two sets of IPMs can be determined based on the magnitudes of the IPMs in the two gradient histograms, and the similarity between these two sets of IPMs can be used for comparison.

[0361] For example, the candidate block set includes a first candidate block and a second candidate block. The first candidate block corresponds to a first gradient histogram, and the second candidate block corresponds to a second gradient histogram. The S IPMs with the highest magnitude in the first gradient histogram form a first set (i.e., the gradients corresponding to these S IPMs in the first gradient histogram have the highest magnitude, where S is a positive integer greater than or equal to 1, for example, S can be equal to 3, 4, or 5), and the S IPMs with the highest magnitude in the second gradient histogram form a second set (i.e., the gradients corresponding to these S IPMs have the highest magnitude in the second gradient histogram). Whether the gradient information corresponding to the two candidate blocks is similar (or whether the two candidate blocks are duplicated) can be determined based on whether the first set and the second set are similar.

[0362] In some implementations, whether two candidate blocks are duplicates can be determined based on the number of identical IPMs contained in the first and second sets mentioned above.

[0363] For example, if the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold, then the two candidate blocks can be determined to be duplicates. Alternatively, if the values ​​of the IPMs in the first set and the second set highly overlap, then the two candidate blocks can be determined to be duplicates.

[0364] For example, if the ratio of the intersection to the union of the first and second sets is greater than or equal to a third threshold (e.g., 0.5), then the two candidate blocks are considered duplicates. Specifically, the similarity between the first and second sets can be determined by calculating the ratio of their intersection to their union according to the Jaccard similarity criterion. The Jaccard similarity index ranges from 0 to 1, where 1 indicates that the two sets are completely identical, and 0 indicates that the two sets have no common elements. If the ratio of the intersection to the union of the first and second sets is greater than 0.5, then the first and second sets are considered similar, and thus the two candidate blocks can be determined to be duplicates.

[0365] In some implementations, whether two candidate blocks are duplicates can be determined based on the difference between a first IPM in a first set and a second IPM in a second set, wherein the first set does not include the second IPM, and the second set does not include the first IPM. In other words, the first IPM and the second IPM are IPMs in the first set and the second set that differ from each other.

[0366] For example, if the difference (or maximum difference) between the first IPM and the second IPM is less than or equal to a second threshold, then two candidate blocks can be identified as duplicates. This second threshold can be, for example, 3, 4, or 5.

[0367] In some implementations, at least one of the following can be determined based on the size of the current block: the number of candidate blocks in the candidate block set; the amount of gradient information to be fused (e.g., the number of gradient histograms to be fused); and the number of IPMs used to determine the predicted value (this number can be used to indicate how many IPMs of predicted values ​​need to be used for weighted blending to determine the predicted value of the current block). In other words, one or more of the following can be adaptively adjusted based on the size of the current block: the number of candidate blocks in the candidate block set, the amount of gradient information to be fused, and the number of IPMs used to determine the predicted value.

[0368] For example, for blocks smaller than or equal to 16x16, the number of candidate blocks in the candidate block set can be reduced. For instance, for blocks smaller than or equal to 16x16, the candidate block set may include only 7 or 9 candidate blocks.

[0369] For example, for blocks larger than 16x16, the number of candidate blocks in the candidate block set can be increased.

[0370] For example, for blocks smaller than or equal to 16x16, the number of gradient histograms to be fused can be reduced. For instance, for blocks smaller than or equal to 16x16, an arithmetic mean of only three gradient histograms can be used to determine the gradient histogram corresponding to the current block.

[0371] For example, for blocks larger than 16x16, the number of gradient histograms to be fused can be increased.

[0372] For example, for blocks smaller than or equal to 16x16, fewer IPMs can be used when performing a weighted fusion of predictions from multiple IPMs to generate the prediction for the current block. For instance, the predictions from only 2 IPMs can be used for weighted fusion to generate the prediction for the current block.

[0373] For example, for blocks larger than 16x16, a larger number of IPMs can be used when performing weighted fusion of predictions from multiple IPMs to generate a prediction for the current block.

[0374] The non-adjacent locations in the spatial domain surrounding the current block, as mentioned earlier, can be determined based on a specific search strategy. For example, the search distance and direction can be determined first, and then, using the current block's location as a reference, a two-dimensional search can be performed around the current block according to the search step size and search direction to determine the non-adjacent locations in the spatial domain surrounding the current block.

[0375] Alternatively, in some implementations, the non-adjacent spatial locations around the current block can be determined based on a pre-established first mapping relationship, which is the mapping relationship between the indices and coordinates of the non-adjacent spatial locations. For example, a one-dimensional list can be used to sequentially store the mapping relationship between the indices and coordinates of the non-adjacent spatial locations that need to be searched for in the current block. In actual use, the non-adjacent spatial locations can be found directly based on this one-dimensional list.

[0376] Alternatively, in some implementations, non-adjacent spatial locations are determined based on pre-established first and second mapping relationships. The first mapping relationship is the mapping between the index of the non-adjacent spatial location and the search distance (e.g., the distance between the non-adjacent spatial location and the top-left corner of the current block), and the second mapping relationship is the mapping between the index of the non-adjacent spatial location and the search direction (e.g., the direction of the non-adjacent spatial location relative to the current block). For example, two one-dimensional lists can be used to store the mapping relationship between the index of the non-adjacent spatial location and the search distance, and the mapping relationship between the index of the non-adjacent spatial location and the search direction, respectively. In practical use, the coordinates of the non-adjacent spatial locations can be derived from the combination of the two one-dimensional lists, and then the non-adjacent spatial locations can be determined based on the coordinates of the non-adjacent spatial locations.

[0377] In some implementations, first identification information (such as a DIMD fusion identifier) ​​can be written into the bitstream. This first identification information indicates that the current block uses the DIMD fusion mode. For example, the first identification information may include a first value and a second value. The first value can be 1 or true. The first value can be used to indicate that the current block uses the DIMD fusion mode. The second value can be 0 or false. The second value can be used to indicate that the current block does not use the DIMD fusion mode. If the current block does not use the DIMD fusion mode, prediction can be made based on the DIMD mode.

[0378] The embodiments of this application are described in more detail below with specific examples. It should be noted that the examples below are merely to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of this application to the specific numerical values ​​or scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or variations based on the given examples, and such modifications or variations also fall within the scope of the embodiments of this application.

[0379] In the process of deriving intra-prediction modes based on DIMD fusion, coded blocks at spatially non-adjacent locations in a larger search area can be added to the candidate list.

[0380] S1: DIMD mode

[0381] The implementation of S1 can be found above, and will not be described again here.

[0382] S2.1DIMD Fusion Intra-Frame Mode Derivation

[0383] The input for step S2.1 may include the following information:

[0384] - Current top left position of the luminance block (xTL, yTL), current bottom left position of the luminance block (xLB, yLB), current top right position of the luminance block (xRT, yRT);

[0385] - The width of the current luminance block is uiWidth, and the height of the current luminance block is uiHeigth;

[0386] - The current nearest positions of the luminance block (xNb[idx], yNb[idx]), idx = 1, ..., 31;

[0387] - The CU corresponding to the nearest position (xNb[idx], yNb[idx]) is denoted as cuNeibor[idx], idx = 1, ..., 31;

[0388] The output of step S2.1 has different content in different scenarios: in the DIMD intra-prediction value acquisition scenario, it is histogram information; in other application scenarios, it can be the traditional intra-prediction mode IntraPredModeD, where the value of IntraPredModeD is between [0,66].

[0389] The following details the process of deriving the traditional intra-frame prediction mode through gradient analysis after DIMD fusion expands the search region.

[0390] Step a: Search for the corresponding cuNeibor[idx] at the neighboring positions of the current block, and add the corresponding encoded blocks to the candidate list according to the search order. When adding cuNeibor[idx] to the candidate list, check if cuNeibor[idx] exists, if it is duplicated, and if it is a DIMD or DIMD fusion mode. The search order of the neighboring positions is shown in Figure 9. If there is a duplicate cuNeibor[idx] in the candidate list, only one candidate block is retained.

[0391] To obtain the cuNeibor[idx] corresponding to the neighboring position, the coded blocks corresponding to the 13 spatially adjacent positions and the 18 spatially non-adjacent positions of the current block are selected as candidates in the candidate list.

[0392] i. For the selection method of cuNeibor[idx] corresponding to adjacent positions in the spatial domain, please refer to relevant technologies;

[0393] ii. For cuNeibor[idx] corresponding to non-adjacent locations in the spatial domain, the search distance can be determined based on the width (uiWidth) and height (uiHeight) of the current block. The search location is the location corresponding to 14-31 in Figure 9, and the search order can be determined based on the criterion of from near to far.

[0394] The specific search process is as follows:

[0395] The search is performed in different directions within the current block. Search directions can include 45°, 90° vertical, 135°, 180° horizontal, and 225°. The search step size is based on the width and height of the current block, and the search range extends to a region four times the step size. Furthermore, searches with a step size of one are not performed in the 180° horizontal and 90° vertical directions.

[0396] Five directions are defined: angle[5] = {0,1,2,3,4}, corresponding to 45°, vertical 90°, 135°, horizontal 180° and 225° respectively; the number of directions to be searched for different search step sizes is defined: numAng[4] = {3,5,5,5}; the specific search directions are determined by iMap[4][5], iMap[4][5] = {{0,2,4},{0,1,2,3,4},{0,1,2,3,4},{0,1,2,3,4},{0,1,2,3,4}}, representing the directions to be searched for each search step size. The search steps are as follows:

[0397] • Step size 1, search directions angle[0], angle[2] and angle[4];

[0398] • Step size 2, search directions angle[0], angle[1], angle[2], angle[3] and angle[4];

[0399] • Step size 3, search directions angle[0], angle[1], angle[2], angle[3] and angle[4];

[0400] • Step size 4, search directions angle[0], angle[1], angle[2], angle[3] and angle[4];

[0401] Then perform the corresponding search operation. The search process can be implemented using the following code:

[0402] The coordinates (xNb, yNb) of different search positions are obtained based on the coordinate offset value of each search position, where xNb = xTL + offsetX and yNb = yTL + offsetY. The coding block information corresponding to the neighboring positions (xNb[idx], yNb[idx]) is stored in the candidate list.

[0403] Step b: Sort the available candidate blocks in the candidate list according to their location distance.

[0404] Let (xNeiTL, yNeiTL) be the top-left position of the available cuNeibor[idx] in the candidate list. Then, the distance between the current block and the candidate block cuNeibor[idx] is diss[idx] = (abs(xTL-xNeiTL)+abs(yTL–yNeiTL)). Sort the blocks according to the values ​​of diss[idx] from smallest to largest. When diss[idx] are equal, sort them according to the search order.

[0405] Step c: Read the gradient histograms of the first 5 sorted cuNeibor[idx], denoted as HoGN[nei], where nei = 0..4. When there are fewer than 5 available candidate cuNeibor, take as many HoGN[nei] as possible corresponding to the available candidate cuNeibor[idx].

[0406] Step d: Calculate the gradient histogram HoGM by performing an arithmetic mean on the obtained gradient histogram HoGN[nei].

[0407] Step e: Save the gradient histogram (HoGM) in units of encoded blocks.

[0408] Step f: Obtain the intra-prediction mode of the current block based on the gradient histogram (HoGM).

[0409] In the DIMD prediction scenario, all or part of the gradient histogram information will be stored for subsequent calculations, as detailed in S2.2 below.

[0410] In other application scenarios, an IntraPredModeD can be further calculated based on information from the gradient histogram. For example, if HoG has no non-zero magnitude, IntraPredModeD is set to PLANA. Otherwise, IntraPredModeD is set to argmax. i (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 scenarios where the predicted value is obtained based on DIMD.

[0411] S2.2DIMD fusion to obtain predicted values

[0412] The implementation of S2.2 can be found in the previous description, and will not be repeated here.

[0413] This example proposes a DIMD fusion technique based on a larger search area, which can effectively utilize the orientation of neighboring coded blocks to guide the current block, improving the accuracy of the predicted values ​​generated based on the derived intra-prediction mode. The method was tested on ECM10.0 with a 48-frame interval under All Intra conditions, achieving a -0.10% BD-rate change in the Y component (i.e., the average bitrate change under the same psnr).

[0414] The method embodiments of this application have been described in detail above with reference to Figures 1 to 10. The apparatus embodiments of this application will be described in detail below with reference to Figures 11 to 14. It should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be referred to the preceding method embodiments.

[0415] Figure 11 is a schematic diagram of the decoder structure provided in an embodiment of this application. The decoder 1100 in Figure 11 includes a parsing unit 1110, a first determining unit 1120, a second determining unit 1130, and a third determining unit 1140. The parsing unit 1110 is configured to parse the bitstream and determine first identification information, which is used to indicate that the current block uses the DIMD fusion mode. The first determining unit 1120 is configured to determine multiple search positions around the current block based on the first identification information, the multiple search positions including non-adjacent positions in the spatial domain of the current block. The second determining unit 1130 is configured to determine gradient information to be fused based on the multiple search positions. The third determining unit 1140 is configured to determine the prediction value of the current block based on the gradient information to be fused.

[0416] In some implementations, the non-adjacent locations in the airspace are determined based on predefined locations.

[0417] In some implementations, the predefined location is determined based on at least one of the following:

[0418] The size of the current block;

[0419] Predefined horizontal dimensions;

[0420] Predefined vertical dimension.

[0421] In some implementations, the predefined horizontal dimensions and / or the predefined vertical dimensions are determined based on the dimensions of the current block.

[0422] In some implementations, the number of the plurality of search locations is greater than 13.

[0423] In some implementations, the number of the plurality of search locations is greater than or equal to 31.

[0424] In some implementations, the non-adjacent locations in the spatial domain satisfy at least one of the following:

[0425] The absolute value of the horizontal offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistHor+1;

[0426] The absolute value of the vertical offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistVer+1;

[0427] Where iDistHor equals the predefined horizontal dimension, and iDistVer equals the predefined vertical dimension.

[0428] In some implementations, the predefined horizontal dimension is equal to N times the width of the current block; and / or, the predefined vertical dimension is equal to N times the height of the current block.

[0429] In some implementations, N is less than or equal to 4.

[0430] In some implementations, the value of N includes 1, 2, 3, and 4.

[0431] In some implementations, the non-adjacent positions in the spatial domain satisfy the following:

[0432] xNb=xTL+offsetX, and yNb=yTL+offsetY;

[0433] Where offsetX and offsetY satisfy at least one of the following:

[0434] offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1;

[0435] offsetX=uiWidth>>1, and offsetY=-iDistVer-1;

[0436] offsetX=-iDistHor-1, and offsetY=-iDistVer-1;

[0437] offsetX=-iDistHor-1, and offsetY=uiHeigth>>1;

[0438] offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1;

[0439] Where xNb represents the horizontal coordinate of the non-adjacent position in the spatial domain, yNb represents the vertical coordinate of the non-adjacent position in the spatial domain, xTL represents the horizontal coordinate of the upper left corner of the current block, yTL represents the vertical coordinate of the upper left corner of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block.

[0440] In some implementations, when N=1, offsetX and offsetY satisfy at least one of the following:

[0441] offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1;

[0442] offsetX=-iDistHor-1, and offsetY=-iDistVer-1;

[0443] offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1.

[0444] In some implementations, the non-adjacent locations in the spatial domain satisfy at least one of the following:

[0445] Located at the upper right of the current block;

[0446] Located directly above the current block;

[0447] Located at the upper left of the current block;

[0448] Located directly to the left of the current block;

[0449] It is located at the lower left of the current block.

[0450] In some implementations, the gradient information to be fused is the gradient information corresponding to K candidate blocks, and the K candidate blocks are determined based on the plurality of search positions, where K is a positive integer greater than 3.

[0451] In some implementations, K takes a value greater than or equal to 5.

[0452] In some implementations, the gradient information to be fused is determined based on a set of candidate blocks determined according to the plurality of search positions, and the set of candidate blocks does not include duplicate candidate blocks.

[0453] In some implementations, the predicted value is determined based on target gradient information, which is determined based on an arithmetic or weighted average of the gradient information to be fused.

[0454] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block, and the weights of the gradient information corresponding to the at least one candidate block are determined based on at least one of the following:

[0455] The distance between the at least one candidate block and the current block;

[0456] The number of target pixels corresponding to the at least one candidate block, wherein the target pixels are the pixels required to determine gradient information in DIMD mode.

[0457] In some implementations, the number of target pixels corresponding to the at least one candidate block is used to determine the initial weight of the gradient information corresponding to the at least one candidate block, and the distance between the at least one candidate block and the current block is used to adjust the initial weight to determine the target weight of the gradient information corresponding to the at least one candidate block.

[0458] In some implementations, the gradient information corresponding to each candidate block in the at least one candidate block includes the magnitude corresponding to the IPM, and the magnitude corresponding to the IPM is the magnitude after normalization based on the size of each candidate block.

[0459] In some implementations, the range of values ​​for N is determined based on the size of the current block.

[0460] In some implementations, if the size of the current block is a first size, then the value range of N is a first value range; if the size of the current block is a second size, then the value range of N is a second value range; wherein, the first size is smaller than the second size, and the first value range is smaller than the second value range.

[0461] In some implementations, the plurality of search locations also includes the spatial adjacent locations of the current block; if the size of the current block is smaller than a preset size, then the spatial adjacent locations do not include at least one of the following locations:

[0462] The first position corresponds to 1 / 4 of the height of the current block;

[0463] The second position corresponds to 1 / 4 of the width of the current block;

[0464] The third position corresponds to 3 / 4 of the height of the current block;

[0465] The fourth position corresponds to 3 / 4 of the width of the current block;

[0466] The fifth position corresponds to the position at 1 / 2 of the height of the current block;

[0467] The sixth position corresponds to the position at 1 / 2 of the width of the current block.

[0468] In some implementations, the search order among the plurality of search locations is determined based on the distance between the plurality of search locations and the current block.

[0469] In some implementations, the distance between the plurality of search positions and the current block is determined based on the distance between the plurality of search positions and the top-left corner of the current block.

[0470] In some implementations, the search order of the plurality of search positions is based on the distance between the plurality of search positions and the current block, and is sorted in ascending order of distance.

[0471] In some implementations, if two of the plurality of search positions are equidistant from the current block, the search position located to the left of the current block is searched first, followed by the search position located above the current block; or, if two of the plurality of search positions are equidistant from the current block, the search position located above the current block is searched first, followed by the search position located to the left of the current block.

[0472] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block in the candidate block set. The candidate block set includes M candidate blocks, and the order of the M candidate blocks in the candidate block set is determined based on the distance between the M candidate blocks and the current block, where M is a positive integer greater than or equal to 1.

[0473] In some implementations, if two candidate blocks out of the M candidate blocks are equidistant from the current block, the candidate block to the left of the current block is ranked higher than the candidate block above the current block; or, if two candidate blocks out of the M candidate blocks are equidistant from the current block, the candidate block above the current block is ranked higher than the candidate block to the left of the current block.

[0474] In some implementations, the M candidate blocks include a first candidate block, and the distance between the first candidate block and the current block is determined based on the difference between a first distance and a second distance. The first distance represents the horizontal distance between the top-left corner of the first candidate block and the top-left corner of the current block, and the second distance represents the vertical distance between the top-left corner of the first candidate block and the top-left corner of the current block.

[0475] In some implementations, the distance between the first candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)+abs(abs(xTL-xNeiTL)-abs(yTL-yNeiTL)));

[0476] Where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the first candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the first candidate block, and abs represents the absolute value operation.

[0477] In some implementations, the gradient information is stored in units of coded blocks, or the gradient information is stored in units of fixed-size image blocks in the current frame.

[0478] In some implementations, the size of the image patch is determined based on the resolution of the current frame.

[0479] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block in the candidate block set, and whether two candidate blocks in the candidate block set are duplicates is determined based on at least one of the following:

[0480] Do the two candidate blocks correspond to the same coded block?

[0481] Whether the difference between the gradient information corresponding to the two candidate blocks meets the preset conditions.

[0482] In some implementations, the two candidate blocks include a first candidate block and a second candidate block. The first candidate block corresponds to a first gradient histogram, and the second candidate block corresponds to a second gradient histogram. The S IPMs with the highest magnitude in the first gradient histogram form a first set, and the S IPMs with the highest magnitude in the second gradient histogram form a second set. The difference between the gradient information corresponding to the two candidate blocks is determined based on the difference between the first set and the second set, where S is a positive integer greater than or equal to 1.

[0483] In some implementations, the difference between the first set and the second set is determined based on at least one of the following:

[0484] The number of identical IPMs contained in the first set and the second set;

[0485] The difference between the first IPM in the first set and the second IPM in the second set, wherein the first set does not include the second IPM and the second set does not include the first IPM.

[0486] In some implementations, the two candidate blocks are considered duplicates if the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold; and / or, the two candidate blocks are considered duplicates if the difference between the first IPM and the second IPM is less than or equal to a second threshold; and / or, the two candidate blocks are considered duplicates if the ratio of the intersection to the union of the first set and the second set is greater than or equal to a third threshold.

[0487] In some implementations, at least one of the following is determined based on the size of the current block:

[0488] The number of candidate blocks in the candidate block set, which is determined based on the plurality of search locations;

[0489] The number of gradient information to be fused;

[0490] The number of IPMs used to determine the predicted values.

[0491] In some implementations, the non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship, which is a mapping relationship between the index of the non-adjacent location and the coordinates of the non-adjacent location; or, the non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship and a second mapping relationship, where the first mapping relationship is a mapping relationship between the index of the non-adjacent location and the search distance, and the second mapping relationship is a mapping relationship between the index of the non-adjacent location and the search direction.

[0492] In some implementations, the search distance is the distance between the non-adjacent position in the spatial domain and the top-left corner of the current block; and / or, the search direction is the direction of the non-adjacent position in the spatial domain relative to the current block.

[0493] In some implementations, the gradient information is: a set of IPMs and their corresponding magnitudes; or, gradient histogram information.

[0494] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0495] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0496] Therefore, this application provides a computer-readable storage medium for use in a decoder 1100. The computer-readable storage medium stores a computer program that, when executed by a processor, implements the decoding method in any of the foregoing embodiments.

[0497] Based on the composition of the decoder 1100 described above and the computer-readable storage medium, refer to Figure 12, which shows a schematic diagram of the specific hardware structure of the decoder 1100 provided in this embodiment of the application. As shown in Figure 12, the decoder 1200 may include: a communication interface 1210, a memory 1220, and a processor 1230; the various components are coupled together through a bus system 1240. It is understood that the bus system 1240 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 1240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 1240 in Figure 12.

[0498] The communication interface 1210 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0499] Memory 1220 is used to store computer programs;

[0500] Processor 1230, when running the computer program, performs the following:

[0501] Parse the bitstream to determine the first identification information, which is used to indicate that the current block uses DIMD fusion mode;

[0502] Based on the first identification information, multiple search locations around the current block are determined, including non-adjacent locations in the airspace of the current block;

[0503] Based on the multiple search locations, determine the gradient information to be fused;

[0504] The predicted value of the current block is determined based on the gradient information to be fused.

[0505] It is understood that the memory 1220 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1220 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0506] The processor 1230 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1230 or by instructions in software form. The processor 1230 may 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, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1220. Processor 1230 reads the information in memory 1220 and completes the steps of the above method in conjunction with its hardware.

[0507] It is understood that the embodiments described in this application can be implemented using 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 performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0508] Alternatively, as another embodiment, the processor 1230 is also configured to execute the decoding method described in the foregoing embodiments when running the computer program.

[0509] Figure 13 is a schematic diagram of an encoder provided in one embodiment of this application. The encoder 1300 shown in Figure 13 includes a first determining unit 1310, a second determining unit 1320, and a third determining unit 1330. The first determining unit 1310 is configured to determine multiple search positions around the current block, including non-adjacent spatial positions of the current block. The second determining unit 1320 is configured to determine gradient information to be fused based on the multiple search positions. The third determining unit 1330 is configured to determine the predicted value of the current block based on the gradient information to be fused.

[0510] In some implementations, the non-adjacent locations in the spatial domain are determined based on the size of the current block.

[0511] In some implementations, the number of the plurality of search locations is greater than 13.

[0512] In some implementations, the number of the plurality of search locations is greater than or equal to 31.

[0513] In some implementations, the non-adjacent locations in the spatial domain satisfy at least one of the following:

[0514] The absolute value of the horizontal offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistHor+1;

[0515] The absolute value of the vertical offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistVer+1;

[0516] Where iDistHor is equal to N times the width of the current block, iDistVer is equal to N times the height of the current block, and N is a positive integer greater than or equal to 1.

[0517] In some implementations, N is less than or equal to 4.

[0518] In some implementations, the value of N includes 1, 2, 3, and 4.

[0519] In some implementations, the non-adjacent positions in the spatial domain satisfy the following:

[0520] xNb=xTL+offsetX, and yNb=yTL+offsetY;

[0521] Where offsetX and offsetY satisfy at least one of the following:

[0522] offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1;

[0523] offsetX=uiWidth>>1, and offsetY=-iDistVer-1;

[0524] offsetX=-iDistHor-1, and offsetY=-iDistVer-1;

[0525] offsetX=-iDistHor-1, and offsetY=uiHeigth>>1;

[0526] offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1;

[0527] Where xNb represents the horizontal coordinate of the non-adjacent position in the spatial domain, yNb represents the vertical coordinate of the non-adjacent position in the spatial domain, xTL represents the horizontal coordinate of the upper left corner of the current block, yTL represents the vertical coordinate of the upper left corner of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block.

[0528] In some implementations, when N=1, offsetX and offsetY satisfy at least one of the following:

[0529] offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1;

[0530] offsetX=-iDistHor-1, and offsetY=-iDistVer-1;

[0531] offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1.

[0532] In some implementations, the non-adjacent locations in the spatial domain satisfy at least one of the following:

[0533] Located at the upper right of the current block;

[0534] Located directly above the current block;

[0535] Located at the upper left of the current block;

[0536] Located directly to the left of the current block;

[0537] It is located at the lower left of the current block.

[0538] In some implementations, the gradient information to be fused is the gradient information corresponding to K candidate blocks, and the K candidate blocks are determined based on the plurality of search positions, where K is a positive integer greater than 3.

[0539] In some implementations, K takes a value greater than or equal to 5.

[0540] In some implementations, the gradient information to be fused is determined based on a set of candidate blocks, and the set of candidate blocks does not include duplicate candidate blocks.

[0541] In some implementations, the predicted value is determined based on target gradient information, which is determined based on an arithmetic or weighted average of the gradient information to be fused.

[0542] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block, and the weights of the gradient information corresponding to the at least one candidate block are determined based on at least one of the following:

[0543] The distance between the at least one candidate block and the current block;

[0544] The number of target pixels corresponding to the at least one candidate block, wherein the target pixels are the pixels required to determine gradient information in the intra-frame mode derivation DIMD mode at the decoding end.

[0545] In some implementations, the number of target pixels corresponding to the at least one candidate block is used to determine the initial weight of the gradient information corresponding to the at least one candidate block, and the distance between the at least one candidate block and the current block is used to adjust the initial weight to determine the target weight of the gradient information corresponding to the at least one candidate block.

[0546] In some implementations, the gradient information corresponding to each candidate block in the at least one candidate block includes the magnitude corresponding to the IPM, and the magnitude corresponding to the IPM is the magnitude after normalization based on the size of each candidate block.

[0547] In some implementations, the range of values ​​for N is determined based on the size of the current block.

[0548] In some implementations, if the size of the current block is a first size, then the value range of N is a first value range; if the size of the current block is a second size, then the value range of N is a second value range; wherein, the first size is smaller than the second size, and the first value range is smaller than the second value range.

[0549] In some implementations, the plurality of search locations also includes the spatial adjacent locations of the current block; if the size of the current block is smaller than a preset size, then the spatial adjacent locations do not include at least one of the following locations:

[0550] The first position corresponds to 1 / 4 of the height of the current block;

[0551] The second position corresponds to 1 / 4 of the width of the current block;

[0552] The third position corresponds to 3 / 4 of the height of the current block;

[0553] The fourth position corresponds to 3 / 4 of the width of the current block;

[0554] The fifth position corresponds to the position at 1 / 2 of the height of the current block;

[0555] The sixth position corresponds to the position at 1 / 2 of the width of the current block.

[0556] In some implementations, the search order among the plurality of search locations is determined based on the distance between the plurality of search locations and the current block.

[0557] In some implementations, the distance between the plurality of search positions and the current block is determined based on the distance between the plurality of search positions and the top-left corner of the current block.

[0558] In some implementations, the search order of the plurality of search positions is based on the distance between the plurality of search positions and the current block, and is sorted in ascending order of distance.

[0559] In some implementations, if two of the plurality of search positions are equidistant from the current block, the search position located to the left of the current block is searched first, followed by the search position located above the current block; or, if two of the plurality of search positions are equidistant from the current block, the search position located above the current block is searched first, followed by the search position located to the left of the current block.

[0560] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block in the candidate block set. The candidate block set includes M candidate blocks, and the order of the M candidate blocks in the candidate block set is determined based on the distance between the M candidate blocks and the current block, where M is a positive integer greater than or equal to 1.

[0561] In some implementations, if two candidate blocks out of the M candidate blocks are equidistant from the current block, the candidate block to the left of the current block is ranked higher than the candidate block above the current block; or, if two candidate blocks out of the M candidate blocks are equidistant from the current block, the candidate block above the current block is ranked higher than the candidate block to the left of the current block.

[0562] In some implementations, the M candidate blocks include a first candidate block, and the distance between the first candidate block and the current block is determined based on the difference between a first distance and a second distance. The first distance represents the horizontal distance between the top-left corner of the first candidate block and the top-left corner of the current block, and the second distance represents the vertical distance between the top-left corner of the first candidate block and the top-left corner of the current block.

[0563] In some implementations, the distance between the first candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)+abs(abs(xTL-xNeiTL)-abs(yTL-yNeiTL)));

[0564] Where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the first candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the first candidate block, and abs represents the absolute value operation.

[0565] In some implementations, the gradient information is stored in units of coded blocks, or the gradient information is stored in units of fixed-size image blocks in the current frame.

[0566] In some implementations, the size of the image patch is determined based on the resolution of the current frame.

[0567] In some implementations, the gradient information to be fused is the gradient information corresponding to at least one candidate block in the candidate block set, and whether two candidate blocks in the candidate block set are duplicates is determined based on at least one of the following:

[0568] Do the two candidate blocks correspond to the same coded block?

[0569] Whether the difference between the gradient information corresponding to the two candidate blocks meets the preset conditions.

[0570] In some implementations, the two candidate blocks include a first candidate block and a second candidate block. The first candidate block corresponds to a first gradient histogram, and the second candidate block corresponds to a second gradient histogram. The S IPMs with the highest magnitude in the first gradient histogram form a first set, and the S IPMs with the highest magnitude in the second gradient histogram form a second set. The difference between the gradient information corresponding to the two candidate blocks is determined based on the difference between the first set and the second set, where S is a positive integer greater than or equal to 1.

[0571] In some implementations, the difference between the first set and the second set is determined based on at least one of the following:

[0572] The number of identical IPMs contained in the first set and the second set;

[0573] The difference between the first IPM in the first set and the second IPM in the second set, wherein the first set does not include the second IPM and the second set does not include the first IPM.

[0574] In some implementations, the two candidate blocks are considered duplicates if the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold; and / or, the two candidate blocks are considered duplicates if the difference between the first IPM and the second IPM is less than or equal to a second threshold; and / or, the two candidate blocks are considered duplicates if the ratio of the intersection to the union of the first set and the second set is greater than or equal to a third threshold.

[0575] In some implementations, at least one of the following is determined based on the size of the current block:

[0576] The number of candidate blocks in the candidate block set, which is determined based on the plurality of search locations;

[0577] The number of gradient information to be fused;

[0578] The number of IPMs used to determine the predicted values.

[0579] In some implementations, the non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship, which is a mapping relationship between the index of the non-adjacent location and the coordinates of the non-adjacent location; or, the non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship and a second mapping relationship, where the first mapping relationship is a mapping relationship between the index of the non-adjacent location and the search distance, and the second mapping relationship is a mapping relationship between the index of the non-adjacent location and the search direction.

[0580] In some implementations, the search distance is the distance between the non-adjacent position in the spatial domain and the top-left corner of the current block; and / or, the search direction is the direction of the non-adjacent position in the spatial domain relative to the current block.

[0581] In some implementations, the gradient information is: a set of IPMs and their corresponding magnitudes; or, gradient histogram information.

[0582] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0583] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0584] Therefore, this application provides a computer-readable storage medium for use in an encoder 1300. The computer-readable storage medium stores a computer program that, when executed by a processor, implements the encoding method described in any of the foregoing embodiments.

[0585] Based on the composition of the encoder 1300 described above and the computer-readable storage medium, refer to Figure 14, which shows a schematic diagram of the specific hardware structure of the encoder 1400 provided in this embodiment of the application. As shown in Figure 14, the encoder 1400 may include: a communication interface 1410, a memory 1420, and a processor 1430; the various components are coupled together through a bus system 1440. It is understood that the bus system 1440 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 1440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 1440 in Figure 14.

[0586] The communication interface 1410 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0587] Memory 1420 is used to store computer programs;

[0588] Processor 1430, when running the computer program, performs the following:

[0589] Determine multiple search locations around the current block, including non-adjacent locations in the airspace of the current block;

[0590] Based on the multiple search locations, determine the gradient information to be fused;

[0591] The predicted value of the current block is determined based on the gradient information to be fused.

[0592] It is understood that the memory 1420 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1420 of the systems and methods described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0593] The processor 1430 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1430 or by instructions in software form. The processor 1430 may 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, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1420. Processor 1430 reads the information in memory 1420 and completes the steps of the above method in conjunction with its hardware.

[0594] It is understood that the embodiments described in this application can be implemented using 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 performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0595] Alternatively, as another embodiment, the processor 1430 is also configured to execute the encoding method in the foregoing embodiments when running the computer program.

[0596] This application also provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium for storing bit streams. The bit streams can be generated by using an encoding method of an encoder, or the bit streams can be decoded by using a decoding method of a decoder. The decoding method can be the decoding method described in any of the preceding embodiments, and the encoding method can be the encoding method described in any of the preceding embodiments.

[0597] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0598] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0599] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0600] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0601] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0602] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A decoding method, applied to a decoder, comprising: Parse the bitstream and determine the first identification information, which is used to indicate that the current block uses the intra-frame mode of the decoding end to derive the DIMD fusion mode. Based on the first identification information, multiple search locations around the current block are determined, including non-adjacent locations in the airspace of the current block; Based on the multiple search locations, determine the gradient information to be fused; The predicted value of the current block is determined based on the gradient information to be fused.

2. The method according to claim 1, wherein, The non-adjacent locations in the airspace are determined based on predefined locations.

3. The method according to claim 2, wherein, The predefined location is determined based on at least one of the following: The size of the current block; Predefined horizontal dimensions; Predefined vertical dimension.

4. The method according to claim 3, wherein, The predefined horizontal and / or predefined vertical dimensions are determined based on the dimensions of the current block.

5. The method according to claim 1, wherein, The number of the multiple search locations is greater than 13.

6. The method according to claim 1, wherein, The number of the multiple search locations is greater than or equal to 31.

7. The method according to claim 1, wherein, The non-adjacent locations in the airspace satisfy at least one of the following: The absolute value of the horizontal offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistHor+1; The absolute value of the vertical offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistVer+1; Where iDistHor equals the predefined horizontal dimension, and iDistVer equals the predefined vertical dimension.

8. The method according to claim 7, wherein: The predefined horizontal dimension is equal to N times the width of the current block; and / or The predefined vertical dimension is equal to N times the height of the current block.

9. The method according to claim 8, wherein, The value of N is less than or equal to 4.

10. The method according to claim 8, wherein, The values ​​of N include 1, 2, 3, and 4.

11. The method according to any one of claims 7 to 10, wherein, The non-adjacent locations in the spatial domain satisfy the following: xNb=xTL+offsetX, and yNb=yTL+offsetY; Where offsetX and offsetY satisfy at least one of the following: offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1; offsetX=uiWidth>>1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=uiHeigth>>1; offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1; Where xNb represents the horizontal coordinate of the non-adjacent position in the spatial domain, yNb represents the vertical coordinate of the non-adjacent position in the spatial domain, xTL represents the horizontal coordinate of the upper left corner of the current block, yTL represents the vertical coordinate of the upper left corner of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block.

12. The method according to claim 11, wherein, When N=1, offsetX and offsetY satisfy at least one of the following: offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1.

13. The method according to any one of claims 1 to 12, wherein, The non-adjacent locations in the airspace satisfy at least one of the following: Located at the upper right of the current block; Located directly above the current block; Located at the upper left of the current block; Located directly to the left of the current block; It is located at the lower left of the current block.

14. The method according to claim 1, wherein, The gradient information to be fused consists of the gradient information corresponding to K candidate blocks. The K candidate blocks are determined based on the multiple search positions, where K is a positive integer greater than 3.

15. The method according to claim 14, wherein, The value of K is greater than or equal to 5.

16. The method according to claim 1, wherein, The gradient information to be fused is determined based on a set of candidate blocks determined according to the plurality of search positions, and the set of candidate blocks does not include duplicate candidate blocks.

17. The method according to claim 1, wherein, The predicted value is determined based on the target gradient information, which is determined based on the arithmetic average or weighted average of the gradient information to be fused.

18. The method according to claim 17, wherein, The gradient information to be fused is the gradient information corresponding to at least one candidate block, and the weights of the gradient information corresponding to the at least one candidate block are determined based on at least one of the following: The distance between the at least one candidate block and the current block; The number of target pixels corresponding to the at least one candidate block, wherein the target pixels are the pixels required to determine gradient information in DIMD mode.

19. The method according to claim 18, wherein, The number of target pixels corresponding to the at least one candidate block is used to determine the initial weight of the gradient information corresponding to the at least one candidate block, and the distance between the at least one candidate block and the current block is used to adjust the initial weight to determine the target weight of the gradient information corresponding to the at least one candidate block.

20. The method according to claim 18 or 19, wherein, The gradient information corresponding to each candidate block in the at least one candidate block includes the amplitude corresponding to the intra-prediction mode (IPM), and the amplitude corresponding to the IPM is the amplitude after normalization based on the size of each candidate block.

21. The method according to claim 8, wherein, The range of values ​​for N is determined based on the size of the current block.

22. The method according to claim 21, wherein: If the size of the current block is the first size, then the value range of N is the first value range; If the size of the current block is the second size, then the value range of N is the second value range; Wherein, the first size is smaller than the second size, and the first value range is smaller than the second value range.

23. The method according to claim 1, wherein: The multiple search locations also include the spatial adjacent locations of the current block; If the size of the current block is smaller than the preset size, then the adjacent positions of the spatial domain do not include at least one of the following positions: The first position corresponds to 1 / 4 of the height of the current block; The second position corresponds to 1 / 4 of the width of the current block; The third position corresponds to 3 / 4 of the height of the current block; The fourth position corresponds to 3 / 4 of the width of the current block; The fifth position corresponds to the position at 1 / 2 of the height of the current block; The sixth position corresponds to the position at 1 / 2 of the width of the current block.

24. The method according to claim 1, wherein, The search order among the multiple search locations is determined based on the distance between the multiple search locations and the current block.

25. The method according to claim 24, wherein, The distance between the plurality of search locations and the current block is determined based on the distance between the plurality of search locations and the top-left corner of the current block.

26. The method according to claim 24 or 25, wherein, The search order of the multiple search locations is based on the distance between the multiple search locations and the current block, and is sorted in ascending order of distance.

27. The method according to claim 26, wherein: If two of the multiple search positions are equidistant from the current block, then the search position to the left of the current block is searched first, followed by the search position above the current block; or, If two of the multiple search positions are at the same distance from the current block, then the search position located above the current block is searched first, and then the search position located to the left of the current block is searched.

28. The method according to claim 1, wherein, The gradient information to be fused is the gradient information corresponding to at least one candidate block in the candidate block set. The candidate block set includes M candidate blocks, and the order of the M candidate blocks in the candidate block set is determined based on the distance between the M candidate blocks and the current block, where M is a positive integer greater than or equal to 1.

29. The method according to claim 28, wherein: If two candidate blocks out of the M candidate blocks are equidistant from the current block, then the candidate block to the left of the current block is ranked higher than the candidate block above the current block. or, If two candidate blocks out of the M candidate blocks are equidistant from the current block, then the candidate block located above the current block is ranked higher than the candidate block located to the left of the current block.

30. The method according to claim 28, wherein, The M candidate blocks include a first candidate block. The distance between the first candidate block and the current block is determined based on the difference between a first distance and a second distance. The first distance represents the horizontal distance between the top left corner of the first candidate block and the top left corner of the current block, and the second distance represents the vertical distance between the top left corner of the first candidate block and the top left corner of the current block.

31. The method according to claim 30, wherein, The distance between the first candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)+abs(abs(xTL-xNeiTL)-abs(yTL-yNeiTL))); Where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the first candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the first candidate block, and abs represents the absolute value operation.

32. The method according to claim 1, wherein, The gradient information is stored in units of coded blocks, or the gradient information is stored in units of fixed-size image blocks in the current frame.

33. The method according to claim 32, wherein, The size of the image patch is determined based on the resolution of the current frame.

34. The method according to claim 16, wherein, Whether two candidate blocks in the candidate block set are duplicates is determined based on at least one of the following: Do the two candidate blocks correspond to the same coded block? Whether the difference between the gradient information corresponding to the two candidate blocks meets the preset conditions.

35. The method according to claim 34, wherein, The two candidate blocks include a first candidate block and a second candidate block. The first candidate block corresponds to a first gradient histogram, and the second candidate block corresponds to a second gradient histogram. The S IPMs with the highest magnitude in the first gradient histogram form a first set, and the S IPMs with the highest magnitude in the second gradient histogram form a second set. The difference between the gradient information corresponding to the two candidate blocks is determined based on the difference between the first set and the second set, where S is a positive integer greater than or equal to 1.

36. The method according to claim 35, wherein, The difference between the first set and the second set is determined based on at least one of the following: The number of identical IPMs contained in the first set and the second set; The difference between the first IPM in the first set and the second IPM in the second set, wherein the first set does not include the second IPM and the second set does not include the first IPM.

37. The method of claim 36, wherein: If the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold, then the two candidate blocks are duplicates; and / or If the difference between the first IPM and the second IPM is less than or equal to the second threshold, then the two candidate blocks are duplicated; and / or If the ratio of the intersection to the union of the first set and the second set is greater than or equal to a third threshold, then the two candidate blocks are duplicates.

38. The method according to claim 1, wherein, At least one of the following is determined based on the size of the current block: The number of candidate blocks in the candidate block set, which is determined based on the plurality of search locations; The number of gradient information to be fused; The number of IPMs used to determine the predicted values.

39. The method according to claim 1, wherein: The non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship, which is the mapping relationship between the index of the non-adjacent location in the airspace and the coordinates of the non-adjacent location in the airspace. or, The non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship and a second mapping relationship. The first mapping relationship is the mapping relationship between the index of the non-adjacent location in the airspace and the search distance, and the second mapping relationship is the mapping relationship between the index of the non-adjacent location in the airspace and the search direction.

40. The method of claim 39, wherein: The search distance is the distance between the non-adjacent positions in the spatial domain and the top-left corner of the current block; and / or The search direction is the direction of the non-adjacent position in the airspace relative to the current block.

41. The method according to claim 1, wherein, The gradient information is: A set of IPMs and their corresponding amplitudes; or, Gradient histogram information.

42. An encoding method, applied to an encoder, comprising: Determine multiple search locations around the current block, including non-adjacent locations in the airspace of the current block; Based on the multiple search locations, determine the gradient information to be fused; The predicted value of the current block is determined based on the gradient information to be fused.

43. The method according to claim 42, wherein, The non-adjacent locations in the airspace are determined based on predefined locations.

44. The method according to claim 43, wherein, The predefined location is determined based on at least one of the following: The size of the current block; Predefined horizontal dimensions; Predefined vertical dimension.

45. The method according to claim 44, wherein, The predefined horizontal and / or predefined vertical dimensions are determined based on the dimensions of the current block.

46. ​​The method according to claim 42, wherein, The number of the multiple search locations is greater than 13.

47. The method according to claim 42, wherein, The number of the multiple search locations is greater than or equal to 31.

48. The method according to claim 42, wherein, The non-adjacent locations in the airspace satisfy at least one of the following: The absolute value of the horizontal offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistHor+1; The absolute value of the vertical offset between the non-adjacent position in the spatial domain and the upper left corner of the current block is equal to iDistVer+1; Where iDistHor equals the predefined horizontal dimension, and iDistVer equals the predefined vertical dimension.

49. The method according to claim 48, wherein: The predefined horizontal dimension is equal to N times the width of the current block; and / or The predefined vertical dimension is equal to N times the height of the current block.

50. The method according to claim 49, wherein, The value of N is less than or equal to 4.

51. The method according to claim 49, wherein, The values ​​of N include 1, 2, 3, and 4.

52. The method according to any one of claims 48 to 51, wherein, The non-adjacent locations in the spatial domain satisfy the following: xNb=xTL+offsetX, and yNb=yTL+offsetY; Where offsetX and offsetY satisfy at least one of the following: offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1; offsetX=uiWidth>>1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=uiHeigth>>1; offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1; Where xNb represents the horizontal coordinate of the non-adjacent position in the spatial domain, yNb represents the vertical coordinate of the non-adjacent position in the spatial domain, xTL represents the horizontal coordinate of the upper left corner of the current block, yTL represents the vertical coordinate of the upper left corner of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block.

53. The method according to claim 52, wherein, When N=1, offsetX and offsetY satisfy at least one of the following: offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=-iDistVer-1; offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1.

54. The method according to any one of claims 42 to 53, wherein, The non-adjacent locations in the airspace satisfy at least one of the following: Located at the upper right of the current block; Located directly above the current block; Located at the upper left of the current block; Located directly to the left of the current block; It is located at the lower left of the current block.

55. The method according to claim 42, wherein, The gradient information to be fused consists of the gradient information corresponding to K candidate blocks. The K candidate blocks are determined based on the multiple search positions, where K is a positive integer greater than 3.

56. The method according to claim 55, wherein, The value of K is greater than or equal to 5.

57. The method according to claim 42, wherein, The gradient information to be fused is determined based on a set of candidate blocks, and the set of candidate blocks does not include duplicate candidate blocks.

58. The method according to claim 42, wherein, The predicted value is determined based on the target gradient information, which is determined based on the arithmetic average or weighted average of the gradient information to be fused.

59. The method according to claim 58, wherein, The gradient information to be fused is the gradient information corresponding to at least one candidate block, and the weights of the gradient information corresponding to the at least one candidate block are determined based on at least one of the following: The distance between the at least one candidate block and the current block; The number of target pixels corresponding to the at least one candidate block, wherein the target pixels are the pixels required to determine gradient information in the intra-frame mode derivation DIMD mode at the decoding end.

60. The method according to claim 59, wherein, The number of target pixels corresponding to the at least one candidate block is used to determine the initial weight of the gradient information corresponding to the at least one candidate block, and the distance between the at least one candidate block and the current block is used to adjust the initial weight to determine the target weight of the gradient information corresponding to the at least one candidate block.

61. The method according to claim 59 or 60, wherein, The gradient information corresponding to each candidate block in the at least one candidate block includes the amplitude corresponding to the intra-prediction mode (IPM), and the amplitude corresponding to the IPM is the amplitude after normalization based on the size of each candidate block.

62. The method according to claim 49, wherein, The range of values ​​for N is determined based on the size of the current block.

63. The method according to claim 62, wherein: If the size of the current block is the first size, then the value range of N is the first value range; If the size of the current block is the second size, then the value range of N is the second value range; Wherein, the first size is smaller than the second size, and the first value range is smaller than the second value range.

64. The method according to claim 42, wherein: The multiple search locations also include the spatial adjacent locations of the current block; If the size of the current block is smaller than the preset size, then the adjacent positions of the spatial domain do not include at least one of the following positions: The first position corresponds to 1 / 4 of the height of the current block; The second position corresponds to 1 / 4 of the width of the current block; The third position corresponds to 3 / 4 of the height of the current block; The fourth position corresponds to 3 / 4 of the width of the current block; The fifth position corresponds to the position at 1 / 2 of the height of the current block; The sixth position corresponds to the position at 1 / 2 of the width of the current block.

65. The method according to claim 42, wherein, The search order among the multiple search locations is determined based on the distance between the multiple search locations and the current block.

66. The method according to claim 65, wherein, The distance between the plurality of search locations and the current block is determined based on the distance between the plurality of search locations and the top-left corner of the current block.

67. The method according to claim 65 or 66, wherein, The search order of the multiple search locations is based on the distance between the multiple search locations and the current block, and is sorted in ascending order of distance.

68. The method of claim 67, wherein: If two of the multiple search positions are equidistant from the current block, then the search position to the left of the current block is searched first, followed by the search position above the current block; or, If two of the multiple search positions are at the same distance from the current block, then the search position located above the current block is searched first, and then the search position located to the left of the current block is searched.

69. The method according to claim 42, wherein, The gradient information to be fused is the gradient information corresponding to at least one candidate block in the candidate block set. The candidate block set includes M candidate blocks, and the order of the M candidate blocks in the candidate block set is determined based on the distance between the M candidate blocks and the current block, where M is a positive integer greater than or equal to 1.

70. The method according to claim 69, wherein: If two candidate blocks out of the M candidate blocks are equidistant from the current block, then the candidate block to the left of the current block is ranked higher than the candidate block above the current block. or, If two candidate blocks out of the M candidate blocks are equidistant from the current block, then the candidate block located above the current block is ranked higher than the candidate block located to the left of the current block.

71. The method according to claim 69, wherein, The M candidate blocks include a first candidate block. The distance between the first candidate block and the current block is determined based on the difference between a first distance and a second distance. The first distance represents the horizontal distance between the top left corner of the first candidate block and the top left corner of the current block, and the second distance represents the vertical distance between the top left corner of the first candidate block and the top left corner of the current block.

72. The method according to claim 71, wherein, The distance between the first candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)+abs(abs(xTL-xNeiTL)-abs(yTL-yNeiTL))); Where xTL represents the horizontal coordinate of the top-left corner of the current block, yTL represents the vertical coordinate of the top-left corner of the current block, xNeiTL represents the horizontal coordinate of the top-left corner of the first candidate block, yNeiTL represents the vertical coordinate of the top-left corner of the first candidate block, and abs represents the absolute value operation.

73. The method according to claim 42, wherein, The gradient information is stored in units of coded blocks, or the gradient information is stored in units of fixed-size image blocks in the current frame.

74. The method according to claim 73, wherein, The size of the image patch is determined based on the resolution of the current frame.

75. The method according to claim 57, wherein, Whether two candidate blocks in the candidate block set are duplicates is determined based on at least one of the following: Do the two candidate blocks correspond to the same coded block? Whether the difference between the gradient information corresponding to the two candidate blocks meets the preset conditions.

76. The method according to claim 75, wherein, The two candidate blocks include a first candidate block and a second candidate block. The first candidate block corresponds to a first gradient histogram, and the second candidate block corresponds to a second gradient histogram. The S IPMs with the highest magnitude in the first gradient histogram form a first set, and the S IPMs with the highest magnitude in the second gradient histogram form a second set. The difference between the gradient information corresponding to the two candidate blocks is determined based on the difference between the first set and the second set, where S is a positive integer greater than or equal to 1.

77. The method according to claim 76, wherein, The difference between the first set and the second set is determined based on at least one of the following: The number of identical IPMs contained in the first set and the second set; The difference between the first IPM in the first set and the second IPM in the second set, wherein the first set does not include the second IPM and the second set does not include the first IPM.

78. The method according to claim 77, wherein: If the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold, then the two candidate blocks are duplicates; and / or If the difference between the first IPM and the second IPM is less than or equal to the second threshold, then the two candidate blocks are duplicated; and / or If the ratio of the intersection to the union of the first set and the second set is greater than or equal to a third threshold, then the two candidate blocks are duplicates.

79. The method according to claim 42, wherein, At least one of the following is determined based on the size of the current block: The number of candidate blocks in the candidate block set, which is determined based on the plurality of search locations; The number of gradient information to be fused; The number of IPMs used to determine the predicted values.

80. The method according to claim 42, wherein: The non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship, which is the mapping relationship between the index of the non-adjacent location in the airspace and the coordinates of the non-adjacent location in the airspace. or, The non-adjacent locations in the airspace are determined based on a pre-established first mapping relationship and a second mapping relationship. The first mapping relationship is the mapping relationship between the index of the non-adjacent location in the airspace and the search distance, and the second mapping relationship is the mapping relationship between the index of the non-adjacent location in the airspace and the search direction.

81. The method according to claim 80, wherein: The search distance is the distance between the non-adjacent positions in the spatial domain and the top-left corner of the current block; and / or The search direction is the direction of the non-adjacent position in the airspace relative to the current block.

82. The method according to claim 42, wherein, The gradient information is: A set of IPMs and their corresponding amplitudes; or, Gradient histogram information.

83. A decoder, comprising: The parsing unit is configured to parse the bitstream and determine the first identification information, which is used to indicate that the current block uses the decoder's intra-frame mode to derive the DIMD fusion mode. The first determining unit is configured to determine multiple search locations around the current block based on the first identification information, wherein the multiple search locations include non-adjacent locations in the airspace of the current block; The second determining unit is configured to determine the gradient information to be fused based on the multiple search positions; The third determining unit is configured to determine the predicted value of the current block based on the gradient information to be fused.

84. A decoder, the decoder comprising: Memory, used to store computer programs; A processor, configured to perform the method as described in any one of claims 1 to 41 when running the computer program.

85. An encoder, comprising: The first determining unit is configured to determine multiple search locations around the current block, the multiple search locations including non-adjacent locations in the spatial domain of the current block; The second determining unit is configured to determine the gradient information to be fused based on the multiple search positions; The third determining unit is configured to determine the predicted value of the current block based on the gradient information to be fused.

86. An encoder, the encoder comprising: Memory, used to store computer programs; A processor, configured to perform the method as described in any one of claims 42 to 82 when running the computer program.

87. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 41, or the method as described in any one of claims 42 to 82.

88. A non-volatile computer-readable storage medium for storing a bitstream, said bitstream being generated by an encoding method using an encoder, or said bitstream being decoded by a decoding method using a decoder, wherein, The decoding method is the method as described in any one of claims 1 to 41, and the encoding method is the method as described in any one of claims 42 to 82.