Encoding and decoding methods, encoder, decoder, and storage medium
By expanding the search position or search area in video codec to obtain more gradient information, the problem of insufficient prediction accuracy of DIMD fusion mode is solved, and higher intra prediction accuracy is achieved.
Patent Information
- Application Number
- PCT/CN2023/123103
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-10-05
- Publication Date
- 2025-04-10
AI Technical Summary
In the prior art, the intra prediction mode derived by the DIMD fusion mode is not accurate enough, which reduces the accuracy of the prediction.
Improve the accuracy of the intra prediction mode derived from the DIMD fusion mode by searching for gradient information to be fused in more search locations or larger search areas. The specific method includes determining a plurality of non-adjacent search positions around the current block and determining the gradient information to be fused based on these search positions.
The accuracy of the intra prediction mode is improved, thereby improving the overall prediction effect of video encoding and decoding.
Smart Images

Figure CN2023123103_10042025_PF_FP_ABST
Abstract
Description
Coding and decoding method, codec and storage medium Technical Field The present application relates to the technical field of video coding and decoding, and in particular to a coding and decoding method, a codec and a storage medium. Background Art The decoder-side intra mode derivation merge (DIMD Merge) mode is an effective intra prediction mode. The DIMD Merge mode uses the gradient information of the adjacent coding blocks of the current block to derive the dominant intra prediction mode (or prediction direction) and generate the prediction value accordingly. However, in the related art, the intra-frame prediction mode derived from the DIMD fusion mode is not accurate enough, which reduces the accuracy of the prediction. Summary of the invention The embodiments of the present application provide a coding method, a codec and a storage medium to improve the accuracy of prediction. The following introduces various aspects of the present application. In a first aspect, a decoding method is provided, which is applied to a decoder, comprising: parsing a bit stream to determine first identification information, wherein the first identification information is used to indicate that a current block uses a DIMD fusion mode; determining multiple search positions around the current block according to the first identification information, wherein the multiple search positions include spatial non-adjacent positions of the current block; determining gradient information to be fused according to the multiple search positions; and determining a prediction value of the current block according to the gradient information to be fused. In a second aspect, a coding method is provided, which is applied to an encoder, comprising: determining multiple search positions around a current block, the multiple search positions including spatially non-adjacent 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. According to a third aspect, a decoder is provided, comprising: a parsing unit, configured to parse a bitstream and determine first identification information, wherein the first identification information is used to indicate that a current block uses a DIMD fusion mode; a first determination unit, configured to determine multiple search positions around the current block according to the first identification information, wherein the multiple search positions include spatial non-adjacent positions of the current block; a second determination unit, configured to determine gradient information to be fused according to the multiple search positions; and a third determination unit, configured to determine a prediction value of the current block according to the gradient information to be fused. According to a fourth aspect, a decoder is provided, comprising: a memory for storing a computer program; and a processor for executing the method described in the first aspect when running the computer program. In a fifth aspect, an encoder is provided, comprising: a first determination unit, configured to determine multiple search positions around a current block, the multiple search positions including spatially non-adjacent positions of the current block; a second determination unit, configured to determine gradient information to be fused based on the multiple search positions; and a third determination unit, configured to determine a prediction value of the current block based on the gradient information to be fused. In a sixth aspect, an encoder is provided, comprising: a memory for storing a computer program; and a processor for executing the method described in the second aspect when running the computer program. In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method described in the first aspect or the second aspect is implemented. According to an eighth aspect, a computer program product is provided, comprising a computer program, wherein when the computer program is executed, the method according to the first aspect or the second aspect is implemented. In a ninth aspect, a non-volatile computer-readable storage medium for storing a bit stream is provided, wherein the bit stream is generated by an encoding method using an encoder, or the bit stream is decoded by a decoding method using a decoder, wherein the decoding method is the method described in the first aspect, and the encoding method is the method described in the second aspect. The embodiment of the present application searches for the gradient information to be fused in more search positions or a larger search area, which helps to improve the accuracy of the intra-frame prediction mode derived from the DIMD fusion mode, thereby improving the accuracy of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic diagram of the structure of a video encoder to which an embodiment of the present application can be applied. FIG. 2 is a schematic diagram of the structure of a video decoder to which an embodiment of the present application can be applied. FIG3 is a schematic diagram of the prediction process of the DIMD correlation mode. FIG. 4 is a diagram showing an example of a method for determining a prediction value of a DIMD correlation mode. FIG. 5 is an example diagram of a method for deriving a gradient histogram of a current block in DIMD fusion mode. FIG. 6 is an example diagram of search positions in DIMD fusion mode. FIG. 7A is another example diagram of search positions in DIMD fusion mode. FIG. 7B is another example diagram of the search position in the DIMD fusion mode. FIG8 is a flowchart of a decoding method provided in an embodiment of the present application. FIG. 9 is an example diagram of a search position in a DIMD fusion mode provided in an embodiment of the present application. FIG10 is a flow chart of the encoding method provided in an embodiment of the present application. FIG. 11 is a schematic diagram of the structure of a decoder provided in one embodiment of the present application. FIG12 is a schematic diagram of the structure of a decoder provided in another embodiment of the present application. FIG. 13 is a schematic diagram of the structure of an encoder provided in one embodiment of the present application. FIG14 is a schematic diagram of the structure of an encoder provided in another embodiment of the present application. DETAILED DESCRIPTION FIG. 1 is a schematic block diagram of a video encoder according to an embodiment of the present application. It should be understood that the video encoder 100 can be used to perform lossy compression on an image, or can be used to perform lossless compression on an image. The lossless compression can be visually lossless compression or mathematically lossless compression. The video encoder 100 can be applied to image data in a luminance and chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) for describing color and saturation. For example, in color format, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 chrominance components (YYYYCbCrCbCr), and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr). For example, the video encoder 100 reads video data, and for each image in the video data, divides an image into a number of coding tree units (CTUs). In some examples, CTUs may be referred to as "tree blocks", "largest coding units" (LCU) or "coding tree blocks" (CTB). Each CTU may be associated with a pixel block of equal size within the image. Each pixel may correspond to a luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU may be associated with a 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 may be further divided into a number of coding units (CUs) for encoding, and a CU may be a rectangular block or a square block. CU can be further divided into prediction unit (PU) and transform unit (TU), so that coding, prediction and transform are separated and more flexible in processing. In one example, CTU is divided into CU in quadtree mode, and CU is divided into TU and PU in quadtree mode. The video encoder and video decoder may support various PU sizes. Assuming that the size of a particular CU is 2N×2N, the video encoder and video decoder may support PU sizes of 2N×2N or N×N for intra-frame prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N or similar sizes for inter-frame prediction. The video encoder and video decoder may also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction. 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 filter 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. Optionally, in the present application, the current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), etc. A prediction block may also be referred to as a predicted image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstruction block. In some embodiments, the prediction unit 110 includes an inter-frame prediction unit 111 and an intra-frame prediction unit 112. Since there is a strong correlation between adjacent pixels in an image of a video, an intra-frame prediction method is used in video coding and decoding technology to eliminate spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent images in a video, an inter-frame prediction method is used in video coding and decoding technology to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency. The inter-frame prediction unit 111 can be used for inter-frame prediction. Inter-frame prediction can include motion estimation and motion compensation. It can refer to the image information of different images. Inter-frame prediction uses motion information to find a reference block from a reference image, and generates a prediction block based on the reference block to eliminate temporal redundancy. Inter-frame prediction uses motion information to find a reference block from a reference image, and generates a prediction block based on the reference block. The motion information includes a reference image list where the reference image is located, a reference image index, and a motion vector. The motion vector can be an integer pixel or a sub-pixel. If the motion vector is a sub-pixel, it is necessary to use an interpolation filter in the reference image to make the required sub-pixel block. Here, the integer pixel or sub-pixel block in the reference image found according to the motion vector is called a reference block. Some technologies will directly use the reference block as a prediction block, and some technologies will generate a prediction block based on the reference block. Reprocessing the reference block to generate a prediction block can also be understood as using the reference block as a prediction block and then processing the prediction block to generate a new prediction block. The intra-frame prediction unit 112 only refers to information of the same image to predict pixel information within the current code image block to eliminate spatial redundancy. There are multiple prediction modes for intra-frame prediction. Taking the H series of international digital video coding standards as an example, the H.264 / AVC standard has 8 angle prediction modes and 1 non-angle prediction mode, and H.265 / HEVC is extended to 33 angle prediction modes and 2 non-angle prediction modes. The intra prediction modes (IPM) used by HEVC include Planar, DC, and 33 angle modes, for a total of 35 prediction modes. The intra prediction modes used by VVC include Planar, DC, and 65 angle modes, for a total of 67 prediction modes. It should be noted that with the increase of angle modes, intra-frame prediction will be more accurate and more in line with the needs of the development of high-definition and ultra-high-definition digital videos. Residual unit 120 may generate a residual block of a CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, residual unit 120 may generate a residual block of a CU so that each sample in the residual block has a value equal to the difference between the following two: a sample in the pixel blocks of the CU and a corresponding sample in the prediction blocks of the PUs of the CU. The transform / quantization unit 130 may quantize the transform coefficients. The transform / quantization unit 130 may quantize the transform coefficients associated with the TUs of the CU based on a quantization parameter (QP) value associated with the CU. The video encoder 100 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU. The inverse transform / quantization unit 140 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct a residual block from the quantized transform coefficients. The reconstruction unit 150 may add the samples of the reconstructed residual block to the corresponding samples of one or more prediction blocks generated by the prediction unit 110 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of the CU in this manner, the video encoder 100 may reconstruct the pixel blocks of the CU. The loop filter unit 160 is used to process the inverse transformed and inverse quantized pixels to compensate for distortion information and provide a better reference for subsequent coded pixels. For example, a deblocking filter operation may be performed to reduce the blocking effect of pixel blocks associated with the CU. In some embodiments, the loop filter unit 160 includes a deblocking filter unit, a sample adaptive offset (SAO) unit, and an adaptive loop filter (ALF) unit, wherein the deblocking filter unit is used to remove the block effect, the SAO unit is used to remove the ringing effect, and the ALF is used to reduce the reconstruction error. The decoded image buffer 170 may store the reconstructed pixel blocks. The inter prediction unit 111 may use the reference image containing the reconstructed pixel blocks to perform inter prediction on PUs of other images. In addition, the intra prediction unit 112 may use the reconstructed pixel blocks in the decoded image buffer 170 to perform intra prediction on other PUs in the same image as the CU. The entropy encoding unit 180 may receive the quantized transform coefficients from the transform / quantization unit 130. The entropy encoding unit 180 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy-encoded data. FIG. 2 is a schematic block diagram of a video decoder according to an embodiment of the present application. 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 filter unit 250, and a decoded image buffer 260. It should be noted that the video decoder 200 may include more, fewer, or different functional components. The video decoder 200 may receive a bitstream. The entropy decoding unit 210 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 210 may parse the syntax elements in the bitstream that have been entropy encoded. The prediction unit 220, the inverse quantization / transformation unit 230, the reconstruction unit 240, and the loop filter unit 250 may decode the video data according to the syntax elements extracted from the bitstream, i.e., generate decoded video data. In some embodiments, the prediction unit 220 includes an intra prediction unit 222 and an inter prediction unit 221 . The intra prediction unit 222 may perform intra prediction to generate a prediction block for the PU. The intra prediction unit 222 may use an intra prediction mode to generate a prediction block for the PU based on pixel blocks of spatially neighboring PUs. The intra prediction unit 222 may also determine the intra prediction mode of the PU according to one or more syntax elements parsed from the code stream. The inter prediction unit 221 may construct a first reference image list (list 0) and a second reference image list (list 1) according to the syntax elements parsed from the code stream. In addition, if the PU is encoded using inter prediction, the entropy decoding unit 210 may parse the motion information of the PU. The inter prediction unit 221 may determine one or more reference blocks of the PU according to the motion information of the PU. The inter prediction unit 221 may generate a prediction block of the PU according to one or more reference blocks of the PU. The inverse quantization / transform unit 230 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 230 may determine the degree of quantization using a QP value associated with the CU of the TU. After inverse quantizing the transform coefficients, inverse quantization / transform unit 230 may apply one or more inverse transforms to the inverse quantized transform coefficients in order to generate a residual block associated with the TU. 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 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block. The loop filtering unit 250 may perform a deblocking filtering operation to reduce blocking effects of pixel blocks associated with a CU. The video decoder 200 may store the reconstructed image of the CU in the decoded image buffer 260. The video decoder 200 may 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. 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, the prediction unit 110 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block. The residual unit 120 can calculate the residual block based on the original block of the prediction block and the current block, that is, the difference between the original block of the prediction block and the current block. The residual block can also be called residual information. The residual block can remove information that is not sensitive to the human eye through the transformation and quantization process of the transformation / quantization unit 130 to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transformation / quantization unit 130 can be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation / quantization unit 130 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 180 receives the quantized change coefficient output by the transformation and quantization unit 130, and can entropy encode the quantized change coefficient and output a bit stream. For example, the entropy coding unit 180 can eliminate character redundancy based on the target context model and the probability information of the binary bit stream. At the decoding end, the entropy decoding unit 210 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction unit 220 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block based on the prediction information. The inverse quantization / transformation unit 230 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 240 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering unit 250 performs loop filtering on the reconstructed image based on the image or on the block to obtain a decoded image. The encoding end also requires similar operations as the decoding end to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be used as a reference image for inter-frame prediction for subsequent images. It should be noted that the block division information determined by the encoder, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder by analyzing the existing information, thereby ensuring that the decoded image obtained by the encoder is the same as the decoded image obtained by the decoder. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process. The foregoing describes in detail the codec framework provided by the embodiments of the present application. The embodiments of the present application mainly relate to a prediction process based on a DIMD-related mode, which can be implemented in an intra-frame prediction unit in the codec framework mentioned above. The following describes in detail the prediction process based on DIMD from the perspective of the decoding end. At the decoding end, the basic decoding process of obtaining the intra-frame reconstructed block includes: obtaining the prediction residual through bitstream analysis, obtaining the prediction value, and determining the reconstruction value. Figure 3 shows an example of the intra-frame prediction process. Referring to FIG. 3 , before determining the reconstructed block of the current block, it is first necessary to obtain the predicted value of the current block. In the process of obtaining the predicted value, the DIMD flag is first parsed. The DIMD flag can indicate whether the current block uses the DIMD related mode. According to the DIMD flag, it can be determined whether the current block generates the predicted value through the DIMD related mode. If the intra-frame prediction mode of the current block is a DIMD related mode (for example, the value of the DIMD flag is 1), the DIMD Merge flag can be further parsed to determine whether the current block generates a prediction value through the DIMD fusion mode. If the intra-frame prediction mode of the current block is a DIMD fusion mode (for example, the value of the DIMD fusion flag is 1), the gradient information of the current block can be derived from the gradient information of the adjacent blocks. If the intra-frame prediction mode of the current block is a DIMD mode (for example, the value of the DIMD fusion flag is 0), the gradient information can be calculated through adjacent sample points. After obtaining the gradient information, the prediction mode of the current block can be derived based on the gradient information to generate a prediction value. If the current block does not generate a prediction value based on the DIMD-related mode (for example, the value of the DIMD flag is 0), other intra-frame prediction modes can be continuously parsed to generate a prediction value. S1: DIMD mode The DIMD mode is a method of using gradient information of adjacent pixels of a current block to derive a dominant intra-frame prediction mode (or prediction direction), and then obtaining a prediction value according to the derived intra-frame prediction mode. S1.1DIMD intra-mode derivation As a possible implementation method, the horizontal gradient and vertical gradient of adjacent reconstructed pixels can be calculated by the Sobel operator. The Sobel operator formula is as follows, where G x Used to calculate the horizontal gradient, G y Used to calculate vertical gradient. and The following describes in detail the process of using the Sobel operator to perform gradient analysis on adjacent pixels to derive the intra prediction mode. The input of this process is the reconstructed value p[x][y] of the adjacent pixel, 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. The output of this process has different contents in different scenarios: in the DIMD intra-frame 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-frame prediction mode IntraPredModeD, where the value of IntraPredModeD is between [0,66]. Set mapHgV = {{2,1},{1,2}} and mapVgH = {{3,4},{4,3}}. Set angTable = {0,2048,4096,6144,8192,12288,16384,20480,24576,28672,32768,36864,40960,47104,53248,59392,65536}. Set angOffset = {18, 18, 50, 50}. Setting up HoG
[0067] is an array containing the gradient strengths for each traditional intra prediction mode. At the beginning of this process, all values in the histogram of oriented gradient (HoG) array are initialized to 0. For each reconstructed pixel p[x][y], where x=1…nTbW-2, y=1…nTbH-2, the calculation process is as follows. 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]; 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]; Calculate iAmp[x][y]=abs(gHor[x][y])+abs(gVer[x][y]); Calculate signH[x][y]=gHor[x][y]<0?1:0; Calculate signV[x][y]=gVer[x][y]<0?1:0; Calculate HgV[x][y]=(abs(gHor[x][y])>abs(gVer[x][y])?1:0); Calculate region[x][y]=(HgV[x][y]==1?mapHgV[signH[x][y]][signV[x][y]]:mapVgH[signH[x][y]][signV[x][y]]); Calculate grad[x][y]=(HgV[x][y]==1?abs(gVer[x][y]) / abs(gHor[x][y]):abs(gVer[x][y]) / abs(gHor[x][y])); Calculate grad[x][y] = round(grad[x][y]*(1<<16)); Calculate the index angIdx[x][y] = argmin i (abs(angTable[i]-grad[x][y])); Calculate the intra prediction mode ipm[x][y]=angOffset[region[x][y]]+angIdx[x][y]; Set HoG[ipm[x][y]]=HoG[ipm[x][y]]+iAmp[x][y]; In the DIMD prediction scenario, all or part of the information of the gradient histogram will be stored for subsequent calculations. For detailed description, see S1.2 below. In other application scenarios, a directional mode IntraPredModeD can be obtained based on the information in the gradient histogram. For example, if HoG has no non-zero amplitude, set IntraPredModeD to PLANAR. Otherwise, set IntraPredModeD 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 the scenario of obtaining the predicted value based on DIMD. S1.2DIMD obtains the predicted value Before obtaining the prediction value, first determine whether to perform weighted fusion. If the gradient histogram is not a single direction, weighted fusion can be performed; otherwise, the intra prediction value can be obtained using the only non-zero intra prediction mode (IPM) in the gradient histogram. In the implementation process, the HoG information can be analyzed; if the amplitudes of the two directional modes with the highest amplitudes, maxMode[0] (the corresponding item with the highest amplitude in the gradient histogram) and maxMode[1] (the corresponding item with the second highest amplitude in the gradient histogram), are both greater than 0, weighted fusion can be performed; otherwise, weighted fusion may not be performed. If weighted fusion is not performed, an IPM with the highest amplitude can be obtained through the gradient histogram information; then, a prediction value can be directly generated through the prediction mode represented by the IPM. If weighted fusion is performed, the N (for example, N=5) IPMs with the highest amplitudes can be obtained through the gradient histogram information, which are recorded as M n , n = 0..4, and the corresponding predicted value is recorded as dimdPred n , n=0..4. Then, it can be weighted and fused with the predicted value dimdPlanar of the Planar mode to obtain the final predicted value. The specific process is shown in Figure 4. The weight wPlanar of the Planar mode can be fixed to 4 / 64. Then, the remaining 60 / 64 weights can be allocated to the five IPMs with the highest amplitudes. The weights wDimd of the five IPMs are n ,n=0..4 and are related to the magnitude of their gradient histograms. The predicted value at (x, y) in the current block can be: Among them, dimdPred n (x, y) represents the (x, y) position of the current block, according to mode M n The generated prediction value, dimdPlanar(x,y) represents the prediction value generated according to the Planar mode at the (x,y) position of the current block. The weights of the five IPMs wDimd n It can be calculated as: S1.3 Storing gradient histogram information The gradient histogram information of DIMD mode is stored in units of coding blocks. The gradient histogram information can be stored directly, or only The five IPMs with the highest amplitudes in the gradient histogram and their corresponding amplitudes. S2: DIMD fusion mode The DIMD fusion mode is a sub-mode of the DIMD correlation mode. This mode is a method of using the gradient information of the adjacent coding blocks of the current block to derive the dominant intra-frame prediction mode (or prediction direction) and generate a prediction value accordingly. FIG5 shows an example of the derivation process of the gradient information of the current block. S2.1DIMD fusion intra-mode derivation The input to step S2.1 may include the following information: -The upper left corner position of the current block (xTL, yTL), the lower left corner position of the current block (xLB, yLB), and the upper right corner position of the current block (xRT, yRT); -The width uiWidth of the current block, the height uiHeigth of the current block; - Current block neighboring position (xNb[idx], yNb[idx]), idx = 1, ..., 13; -The corresponding coding block at the adjacent position (xNb[idx], yNb[idx]) is denoted as cuNeibor[idx], idx=1,…,13. The output of step S2.1 has different contents in different scenarios: in the DIMD intra-frame 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-frame prediction mode IntraPredModeD. The value of IntraPredModeD can be, for example, between [0,66]. The following is a detailed description of the process of deriving the traditional intra-frame prediction mode through gradient analysis by DIMD fusion. Implementation 1: Step a: Search for the corresponding adjacent coding blocks at the 13 adjacent positions of 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 repeated, and whether it is 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. Table 1. Candidates in the candidate list Step b: Sort the available candidate blocks in the candidate list according to the position distance between the current block and the available candidate blocks in the candidate list. For example, let the upper left position of the available candidate block in the candidate list be (xNeiTL, yNeiTL), then the distance dists[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 from small to large according to the value of dists[idx]; when dists[idx] are equal, the available candidate blocks in the candidate list can be sorted in search order. Step c: Read the gradient histograms of the first three candidate blocks after sorting, denoted as HoGN[nei], where nei = 0..2. When the number of available candidate blocks is less than 3, take the HoGN[nei] corresponding to as many available candidate blocks as possible. Step d: Perform arithmetic averaging on the obtained gradient histogram HoGN[nei] to calculate the gradient histogram HoGM. Step e: Save the gradient histogram HoGM in units of coding blocks. Step f: Obtain the intra prediction mode of the current block according to the gradient histogram HoGM. In the DIMD fusion scenario, all or part of the information of the gradient histogram will be stored for subsequent calculations. For detailed description, see S2.2 below. In other application scenarios, a directional mode IntraPredModeD can be obtained based on the information in the gradient histogram. For example, if HoG has no non-zero amplitude, set IntraPredModeD to PLANAR. Otherwise, set IntraPredModeD 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 In the scenario of obtaining predicted values based on DIMD, this part is not necessary. Implementation 2: Compared with implementation 1, there are three obvious differences in implementation 2: ① In implementation method 2, the 13 search positions are no longer fixed positions, but are adaptively determined based on the block sizes of the current block and the candidate blocks; ② In implementation method 2, the number of available candidate cuNeibor in the candidate list is at most 5. ③ In implementation method 2, for the candidate block, the gradient histogram information HoG of the candidate block is no longer read, but only the 5 IPMs with the highest amplitudes of the candidate block and their corresponding amplitudes are read; for the gradient histogram corresponding to the current block, the gradient histogram HoGM corresponding to the current block is no longer saved, but only the 5 IPMs with the highest amplitudes in the gradient histogram and their corresponding amplitudes are saved. The rest of the operations of implementation method 2 are consistent with those of implementation method 1. The implementation process of implementation method 2 is described in more detail below. Step a: Search for the corresponding cuNeibor[idx] at the 13 adjacent positions of the current block. The adjacent positions searched in Implementation 2 are shown in Table 2, and the search order and position examples of the adjacent positions are shown in Figures 7A and 7B. Add the corresponding coding block 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 DIMD or DIMD fusion mode. Due to the change in the search method, the duplication check of the candidate block is no longer performed in Implementation 2. Table 2. Candidates in the candidate list During the search process, the position is updated according to the inspection result of the coding block corresponding to the search position. Position 1 and Position 2: Use position 1 / position 2 as the starting point, the height / width of the current block as the end point, and 4 pixels as the step size to search for the coding block at the corresponding position; if the currently searched cuNeibor[1] and cuNeibor[2] exist and are in DIMD mode, update position 1 / position 2 to the current position. Position 10 and position 11: If cuNeighbour
[0010] / cuNeighbour
[0011] does not exist or is not in DIMD mode and cuNeighbours[3] exists, then position 10 / 11 is updated to the lower left and upper right of cuNeighbours[3], i.e., position 10' / 11' in FIG. 7A or 7B. Position 12 and position 13: If cuNeighbour
[0012] / cuNeighbour
[0013] does not exist or is not in DIMD mode and cuNeighbour[1], cuNeighbour[8] / cuNeighbour[2] and cuNeighbour[9] exist, then position 12 / 13 is updated to the left side of cuNeighbour[8] / the upper side of cuNeighbour[9], i.e., position 12' / 13' in FIG. 7A or 7B. 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. Let the upper left position of the available candidate block in the candidate list be (xNeiTL, yNeiTL), then the distance dists[idx] between the current block and the candidate block is (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)), and the available candidate blocks in the candidate list can be sorted from small to large according to the value of dists[idx]; when dists[idx] are equal, the available candidate blocks in the candidate list can be sorted in search order. Step c: read the 5 IPMs with the highest amplitudes and their corresponding amplitudes of the first 5 sorted available candidate blocks, recorded as HoGTemp[nei], where nei = 0..4; when the number of available candidate blocks is less than 5, take as many available candidate blocks as possible. Step d: Perform arithmetic averaging on the obtained HoGTemp[nei] and calculate the gradient histogram HoGMTemp. Step e: Save the five IPMs with the highest amplitudes in HoGMTemp and their corresponding amplitudes in units of coding blocks. Step f: Obtain the intra prediction mode of the current block according to the gradient histogram HoGMTemp. In the DIMD prediction scenario, all or part of the information of the gradient histogram will be stored for subsequent calculations. For detailed description, see S2.2 below. In other application scenarios, a directional mode IntraPredModeD can be obtained based on the information in the gradient histogram. For example, if HoG has no non-zero amplitude, set IntraPredModeD to PLANAR. Otherwise, set IntraPredModeD 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 the scenario of obtaining the predicted value based on DIMD. S2.2DIMD fusion to obtain predicted values The process of obtaining the prediction value by DIMD shown in S2.2 is basically the same as that in S1.2. If weighted fusion is not performed, the intra-frame prediction mode with the highest amplitude can be obtained through the HoGM information, and the prediction value can be directly generated based on the intra-frame prediction mode; otherwise, the five intra-frame prediction modes with the highest amplitude can be obtained through the HoGM information, and the prediction values of the Planar mode can be weighted and fused to obtain the final prediction value, and the calculation of the weight is consistent with S1.2. The DIMD fusion mode provided by the related art only searches 13 predefined or adaptively selected search positions around the current block to determine the candidate blocks. Then, the related art will check the availability, repeatability and whether it is a DIMD related mode for the candidate blocks at the 13 search positions. However, after performing the above check on the 13 search positions, the number of candidate blocks that meet the conditions is often small, resulting in inaccurate IPM (or prediction direction) derived from the gradient information of adjacent blocks, thereby reducing the accuracy of the prediction. In response to the above problems, the decoding method provided in the embodiments of the present application is described in detail below with examples. FIG8 is a flowchart of a decoding method provided by an embodiment of the present application. The method of FIG8 may also be referred to as an intra-frame prediction method, or a prediction method based on a DIMD fusion mode. The method of FIG8 may be applied to a decoder, for example, to an intra-frame prediction unit of a decoder. 8, in step S810, the code stream is parsed to determine first identification information. The first identification information (such as DIMD merge identification) is used to indicate that the current block uses the DIMD merge mode. The current block may also be referred to as a current coding block, a current decoding block or a current coding unit. The current block may be, for example, a luminance block. The first identification information may include, for example, a first value and a second value. The first value may be 1 or true. The first value may be used to indicate that the current block uses the DIMD fusion mode. The second value may be 0 or false. The second value may 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, the current block may be predicted based on the DIMD mode. In step S820, multiple search positions around the current block are determined according to the first identification information. In some implementations, the number of multiple search positions around the current block may be greater than 13. For example, the number of search positions around the current block may be greater than or equal to 16, 18, 21, 26, or 31. The number of search positions provided by the embodiment of the present application is greater than the number of search positions provided by the related art (the related art provides 13 search positions). Therefore, the embodiment of the present application is equivalent to searching for candidate blocks in a larger search area or more search positions, thereby helping to improve the accuracy of prediction. In some implementations, the multiple search positions around the current block (or the multiple search positions in the neighboring area of the current block) may include spatially adjacent positions (or adjacent reference points) and / or spatially non-adjacent positions (or non-adjacent reference points). For example, the search may be performed at X1 spatially adjacent positions and X2 spatially non-adjacent positions around the current block. The value of X1 may be, for example, less than or equal to 13. The value of X2 may be, for example, 3, 5, 8, 13, or 18. The embodiment of the present application expands the search area, which helps to obtain more available candidate blocks, thereby helping to improve the accuracy of the prediction. In some implementations, the search position around the current block includes a spatial non-adjacent position, which is determined based on a predefined position and / or a predefined size. The predefined size may, for example, include a predefined horizontal size (or horizontal step size) and / or a predefined vertical size (or vertical step size). In some implementations, the predefined positions or spatially non-adjacent positions mentioned above may be determined based on one or more of the following: The position of the current block (such as the upper left corner of the current block); The size of the current block (such as the width and / or height of the current block); The size of the neighboring blocks of the current block (such as the width and / or height of the neighboring blocks); Predefined horizontal dimensions; Predefined vertical dimensions. In some implementations, the predefined size mentioned above (such as a predefined horizontal size and / or a predefined vertical size) may be determined based on the size of the current block. For example, the predefined horizontal size is determined based on the width of the current block. For another example, the predefined vertical size is determined based on the height of the current block. As a more specific example, the predefined horizontal size is N times the width of the current block, and the predefined vertical size is N times the height of the current block, where N is a positive integer greater than or equal to 1. In some implementations, the predefined size mentioned above (such as a predefined horizontal size and / or a predefined vertical size) may be independent of the size of the current block. For example, the predefined horizontal size and / or the predefined vertical size may be fixed values, such as one or more of 4, 8, 16, 32, and 64. For example, the non-adjacent positions in the spatial domain to be searched around the current block may 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 position of the current block is equal to iDistHor+1 (hereinafter referred to as condition 1); The absolute value of the vertical offset between the non-adjacent position in the spatial domain and the upper left corner position of the current block is equal to iDistVer+1 (hereinafter referred to as condition 2); Among them, iDistHor is equal to the predefined horizontal size; iDistVer is equal to the predefined vertical size. In some implementations, the iDistHor may be a fixed value (e.g., one or more of 4, 8, 16, 32, and 64), or may be determined based on the size of the current block (e.g., the width of the current block). For example, the iDistHor may be N times the width of the current block, where N is a positive integer greater than or equal to 1. In some implementations, the iDistVer may be a fixed value (e.g., one or more of 4, 8, 16, 32, and 64), or may be determined based on the size of the current block (e.g., the height of the current block). For example, the iDistVer may be N times the height of the current block, where N is a positive integer greater than or equal to 1. iDistHor and iDistVer may represent the search distance. Determining iDistHor and / or iDistVer based on the size of the current block may enable the search distance to be adaptively adjusted based on the size of the current block, so that the searched gradient information is more accurate. Taking FIG9 as an example, the non-adjacent spatial positions to be searched around the current block include search positions 14 to 16. As can be seen from FIG9, search position 14 satisfies condition 1, search position 15 satisfies condition 2, and search position 16 satisfies both condition 1 and condition 2. In addition, the value of N corresponding to search positions 14 to 16 is 1, that is, iDistHor is equal to the width of the current block, and iDistVer is equal to the height of the current block. In other words, the position of the current block can be used as the starting position, and the step length of one times the current block can be used as the search step length, and the non-adjacent spatial positions 14 to 16 can be searched near the search area defined by the step length of one times. Still taking Figure 9 as an example, the spatial non-adjacent positions of the current block include search positions 17 to 21. As can be seen from 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 condition 1 and condition 2. In addition, the value of N corresponding to search positions 17 to 21 is 2, that is, 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 position of the current block can be used as the starting position, and the double step length of the current block can be used as the search step length, and the spatial non-adjacent positions 17 to 21 can be searched near the search area defined by the double step length. Still taking Figure 9 as an example, the spatial non-adjacent positions of the current block include search positions 22 to 26. As can be seen from Figure 9, search position 22 meets condition 1, search position 23 meets condition 2, search position 24 meets condition 2, search position 25 meets condition 1, and search position 26 meets both condition 1 and condition 2. In addition, the value of N corresponding to search positions 22 to 26 is 3, that is, 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 position of the current block can be used as the starting position, and the three times step length of the current block can be used as the search step length. The spatial non-adjacent positions 22 to 26 can be searched near the search area defined by the three times step length. Still taking Figure 9 as an example, the spatial non-adjacent positions of the current block include search positions 27 to 31. As can be seen from 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 condition 1 and condition 2. In addition, the value of N corresponding to search positions 27 to 31 is 4, that is, 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 position of the current block can be used as the starting position, and the four times step length of the current block can be used as the search step length, and the spatial non-adjacent positions 27 to 31 can be searched near the search area defined by the four times step length. 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 upper adjacent block of the current block. In some implementations, the value of N mentioned above may be less than or equal to 4. For example, the value of N includes 1, 2, 3, and 4. Of course, the value of N may also be greater than 4, for example, N is 5, 6, or 7. Setting the value of N to be less than or equal to 4 can minimize the implementation complexity of the search process while obtaining sufficient gradient information. In some implementations, the non-adjacent spatial locations to be searched around the current block satisfy: xNb=xTL+offsetX, and yNb=yTL+offsetY; Wherein, 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; Among them, 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 position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block. The above-mentioned spatial non-adjacent positions provided in the embodiment of the present application are evenly distributed around the current block, so that as much available gradient information as possible can be searched using as few search positions as possible. Taking Figure 9 as an example, assuming that N = 1, iDistHor is equal to the width of the current block, and iDistVer is equal to the height of the current block. Further, if offsetX = uiWidth + iDistHor - 1, and offsetY = -iDistVer - 1, the spatial non-adjacent position (xNb, yNB) refers to the search position 15 in Figure 9; if offsetX = uiWidth >> 1, and offsetY = -iDistVer - 1, the spatial non-adjacent position (xNb, yNB) is located directly above the current block and has the same horizontal position as the search position 15 (Figure 9 does not number the search position); if offsetX = -iDistHor-1, and offsetY=-iDistVer-1, then the spatial non-adjacent position (xNb, yNB) refers to the search position 16 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, then the spatial non-adjacent position (xNb, yNB) is located to the left of the current block and has the same vertical position as the search position 16 (the search position is not numbered in Figure 9); if offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1, then the spatial non-adjacent position (xNb, yNB) refers to the search position 16 in Figure 9. Further, 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. Still taking FIG. 9 as an example, when N=1, the spatial non-adjacent position (xNb, yNB) may include the search positions 14 to 16 in FIG. 9. Taking Figure 9 as an example, assuming N = 2, 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 spatial non-adjacent position (xNb, yNB) refers to the search position 18 in Figure 9; if offsetX = uiWidth>>1, and offsetY = -iDistVer-1, then the spatial non-adjacent position (xNb, yNB) refers to the search position 19 in Figure 9; if offsetX = -iDistHor-1, and offsetY = -iDistVer-1, then the spatial non-adjacent position (xNb, yNB) refers to the search position 19 in Figure 9; stVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 21 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, the spatial non-adjacent position (xNb, yNB) refers to the search position 20 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 17 in Figure 9. Taking Figure 9 as an example, assuming N = 3, 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, the spatial non-adjacent position (xNb, yNB) refers to the search position 23 in Figure 9; if offsetX = uiWidth>>1, and offsetY = -iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 24 in Figure 9; if offsetX = -iDistHor-1, and offsetY = -iDistVer-1, stVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 26 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, the spatial non-adjacent position (xNb, yNB) refers to the search position 25 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 22 in Figure 9. Taking Figure 9 as an example, assuming N = 4, 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, the spatial non-adjacent position (xNb, yNB) refers to the search position 28 in Figure 9; if offsetX = uiWidth>>1, and offsetY = -iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 29 in Figure 9; if offsetX = -iDistHor-1, and offsetY = -iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 29 in Figure 9; stVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 31 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, the spatial non-adjacent position (xNb, yNB) refers to the search position 30 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 27 in Figure 9. In some implementations, the spatial non-adjacent positions around the current block 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, and located at the lower left of the current block. If the direction of the horizontal coordinate is used as a reference, the spatial non-adjacent positions around the current block satisfy at least one of the following: located at the 45° direction of the current block, located at the 90° direction of the current block, located at the 135° direction of the current block, located at the 180° direction of the current block, and located at the 225° direction of the current block. The above directions can be understood as the search directions of the spatial non-adjacent positions around the current block, that is, the search operation can be performed along the above directions based on the position of the current block to determine the spatial non-adjacent positions of the current block. The search step size in each search direction can be determined based on the N (or iDistHor and iDistVer) mentioned above. The above-mentioned spatial non-adjacent positions provided in the embodiment of the present application are evenly distributed around the current block, so that as much available gradient information as possible can be searched using as few search positions as possible. In some implementations, the number of search positions and / or the size of the search range may be adaptively adjusted. For example, the number of search positions and / or the size of the search range may be determined based on the size of the current block. By adaptively adjusting the number of search positions and / or the size of the search range according to the size of the current block, the gradient information searched is more accurate. As an example, the value range of N (or iDistHor and iDistVer) mentioned above can be determined according to the size of the current block. For example, if the size of the current block is the first size, the value range of N is the first value range; if the size of the current block is the second size, the value range of N is the second value range. Further, in some implementations, if the first size is smaller than the second size, the first value range is smaller than the second value range. That is, if the current block is a small block, the search range of the spatial non-adjacent positions of the current block is reduced; if the current block is a large block, the search range of the spatial non-adjacent positions of the current block is expanded, so that the prediction process is more flexible. For example, if the size of the current block is the first size, the value range of N is 1 to 3; if the size of the current block is the second size (larger than the first size), the value range of N is 1 to 4. As another example, if the size of the current block is smaller than a preset size (such as 16×16), the spatial neighboring position of the current block may not include at least one of the following positions: The first position corresponds to the position 1 / 4 of the height of the current block (see search position 10 in FIG. 6 ); The second position corresponds to the position of 1 / 4 of the width of the current block (see the search position 11 in FIG. 6 ); The third position corresponds to the 3 / 4 position of the height of the current block (see the search position 12 in FIG. 6 ); The fourth position corresponds to the 3 / 4 position of the width of the current block (see search position 13 in FIG. 6 ); The fifth position corresponds to the position 1 / 2 of the height of the current block (see search position 8 in FIG. 6 ); The sixth position corresponds to the 1 / 2 position of the width of the current block (see search position 9 in FIG. 6 ). As another example, the above two examples can be combined together. For example, if the size of the current block is smaller than the preset size (such as 16×16), the value range of N can be limited to the second value range (such as 1 to 3), thereby reducing the number of non-adjacent positions in the spatial domain to be searched. Furthermore, one or more positions from the first position to the sixth position mentioned above can be removed at the same time (such as removing the first position to the fourth position at the same time), thereby reducing the number of adjacent positions in the spatial domain to be searched. In step S830, gradient information to be fused is determined according to a plurality of search positions around the current block. In some implementations, step S830 may include: determining a candidate block set (such as a candidate list) based on multiple search positions around the current block; and determining gradient information to be fused based on the candidate block set. Determining the candidate block set based on multiple search positions around the current block may include: adding 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 candidate blocks with the highest sorting as the gradient information to be fused. The embodiments of the present application do not specifically limit the form or content of the gradient information. For example, in some implementations, the gradient information may be gradient histogram information (HoG information). The gradient histogram information may also be referred to as or replaced by angle mode HoG information. In other implementations, the gradient information may include a group of IPMs and their corresponding amplitudes. The group of IPMs may, for example, be a group of IPMs with the highest corresponding amplitudes in the gradient histogram. The group of IPMs may include 3 IPMs, or 5 IPMs, or other numbers of IPMs. In some implementations, the gradient information to be fused may be the gradient information corresponding to K candidate blocks, where K is a positive integer greater than 3. For example, the value of K may be 5. For another example, the value of K may be greater than 5, such as K may be 6, 7 or 8. The K candidate blocks mentioned here may be determined based on multiple search positions around the current block. For example, a candidate block set (such as a candidate list, which may be used to store the coding blocks corresponding to the search positions) may be determined based on multiple search positions around the current block, and the K candidate blocks may be determined from the candidate block set. The method of determining the K candidate blocks from the candidate block set may include, for example, sorting the candidate blocks in the candidate block set (such as sorting according to the distance between the upper left corner position of the candidate block and the upper left corner position of the current block), and then determining the gradient information corresponding to the first K candidate blocks after sorting 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 may be the gradient information corresponding to all available candidate blocks in the candidate block set. By increasing the number of candidate blocks for providing gradient information (in the related art, K=3), the accuracy of the fused gradient information can be improved, thereby improving the accuracy of the prediction. In some implementations, the gradient information to be fused is K gradient histograms, where K is a positive integer greater than 3. For example, the value of K may be 5; or, the value of K may be greater than 5, such as K may be 6, 7 or 8. In some implementations, the gradient information to be fused is the amplitude corresponding to K groups of IPMs, where K is a positive integer greater than 3. For example, the value of K may be 5; or, the value of K may be greater than 5, such as K may be 6, 7 or 8. Each group of IPMs may include 3, 5 or more IPMs. In some implementations, the gradient information to be fused is determined based on a candidate block set. The candidate block set can be determined based on multiple search positions around the current block. The candidate block set may or may not contain repeated candidate blocks. For example, a candidate block set (such as a candidate list, which can be used to store the coding blocks corresponding to the search positions) can be determined based on multiple search positions around the current block; then, the candidate blocks in the candidate block set can be checked for repeatability; if the candidate block set contains repeated candidate blocks, only one candidate block is retained. The introduction of repeatability check can avoid redundant gradient information, thereby improving the accuracy of prediction. 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 may be determined based on multiple search positions around the current block. The candidate block set may 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. Sorting the M candidate blocks according to the distance between the candidate blocks and the current block helps to preferentially search for the gradient information corresponding to the search position with a closer distance. There are many ways to define the distance between the M candidate blocks and the current block. For example, the distance between the upper left corners of the M candidate blocks and the upper left corner of the current block can be used as the distance between the M candidate blocks and the current block. For another example, the distance between the center positions of the M candidate blocks and the center position of the current block can be used as the distance between the M candidate blocks and the current block. As an example, the M candidate blocks include a first candidate block (which can be any candidate block among the M candidate blocks). The distance between the first candidate block and the current block is determined based on the difference between the first distance and the second distance. The first distance represents the horizontal distance between the upper left corner position of the first candidate block and the upper left corner position of the current block, and the second distance represents the vertical distance between the upper left corner position of the first candidate block and the upper left corner position 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))); wherein, xTL represents the horizontal coordinate of the upper left corner position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, xNeiTL represents the horizontal coordinate of the upper left corner position of the first candidate block, yNeiTL represents the vertical coordinate of the upper left corner position of the first candidate block, and abs represents the absolute value operation. The distance determined by the above distance determination method is the same as the distance between the two positions. In the specific implementation process, we can first calculate deltaX = abs(xTL-xNeiTL), deltaY = abs(yTL-yNeiTL), and then calculate (deltaX+deltaY+abs(deltaX-deltaY)), so as to avoid unnecessary repeated operations. As another example, the M candidate blocks include a second candidate block (which can be any candidate block among the M candidate blocks). The distance between the second candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)); wherein 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, xNeiTL represents the horizontal coordinate of the upper left corner of the second candidate block, yNeiTL represents the vertical coordinate of the upper left corner of the second candidate block, and abs represents an absolute value operation. The above distance determination method is compatible with the distance determination method provided by the related art. In some implementations, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located on the left side of the current block among the two candidate blocks may be higher than the ranking of the candidate block located on the upper side of the current block among the two candidate blocks. For example, the priority of the candidate block located on the left side of the current block among the two candidate blocks is higher than the priority of the candidate block located on the upper side of the current block among the two candidate blocks. Alternatively, the value of the index of the candidate block located on the left side of the current block among the two candidate blocks is smaller than the value of the index of the candidate block located on the upper side of the current block among the two candidate blocks. In some implementations, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located above the current block among the two candidate blocks may be higher than the ranking of the candidate block located to the left of the current block among the two candidate blocks. For example, the priority of the candidate block located above the current block among the two candidate blocks is higher than the priority of the candidate block located to the left of the current block among the two candidate blocks. Alternatively, the value of the index of the candidate block located above the current block among the two candidate blocks is smaller than the value of the index of the candidate block located to the left of the current block among the two candidate blocks. In step S840, a prediction value of the current block is determined according to the gradient information to be fused. In some implementations, step S840 may include: determining target gradient information according to the gradient information to be fused; and determining a prediction value of the current block according to the target gradient information. The target gradient information may be, for example, gradient information corresponding to the current block. In some implementations, determining the target gradient information according to the gradient information to be fused may include: performing arithmetic averaging on the gradient information to be fused to determine the target gradient information. In some implementations, determining the prediction value of the current block according to the target gradient information may include: determining one or more IPMs according to the target gradient information; performing intra-frame prediction on the current block according to the one or more IPMs to determine one or more prediction values; and determining the prediction value of the current block according to the one or more prediction values. For detailed description, please refer to S1.2 in the above text. In some implementations, the gradient information to be fused may be the gradient information corresponding to at least one candidate block. The at least one candidate block may be determined from a candidate block set, and the candidate block set may be determined based on a plurality of search positions around the current block. Further, in some implementations, the gradient information corresponding to the at least one candidate block may be normalized according to the size (or block size) of the at least one candidate block to determine the gradient information to be fused. For example, at least one gradient histogram corresponding to the at least one candidate block may be determined first, and then, according to the size of the at least one candidate block, the amplitude (or intensity) corresponding to each IPM in the at least one gradient histogram may be normalized, and the normalized gradient histogram may be used as the gradient information to be fused. Normalizing the gradient information corresponding to the candidate block according to the size of the candidate block helps to improve the accuracy of gradient information fusion. In some implementations, the gradient information to be fused may be arithmetic averaged or weighted averaged to determine the target gradient information; and the prediction value of the current block may be determined based on the target gradient information. For example, if the gradient information to be fused includes one or more gradient histograms, the one or more gradient histograms may be weighted to obtain the gradient histogram corresponding to the current block (i.e., the target gradient information); then, the prediction value of the current block may be determined based on the gradient histogram corresponding to the current block. Weighted averaging of different gradient information to be fused helps to improve the accuracy of gradient information fusion. The embodiment of the present application does not specifically limit the method for determining the weight of the gradient information to be fused. For example, as mentioned above, the gradient information to be fused may be the gradient information corresponding to at least one candidate block in the candidate set. Therefore, in some implementations, the weight of the gradient information to be fused may be determined based on the at least one candidate block. As an example, the weight of the gradient information to be fused may be determined according to the distance between the at least one candidate block and the current block. For example, a higher weight may be set for the gradient information corresponding to the candidate block that is closer to the current block among the at least one candidate block, and a lower weight may be set for the gradient information corresponding to the candidate block that is farther from the current block among the at least one candidate block. As another example, the weight of the gradient information to be fused may be determined according to the size of the at least one candidate block. For example, a higher weight may be assigned to a larger block in the at least one candidate block, and a lower weight may be assigned to a smaller block. As another example, the weight of the gradient information to be fused may be determined according to the number of target pixels corresponding to the at least one candidate block. The target pixel is a pixel required for determining the gradient information in the DIMD mode. The target pixel corresponding to the at least one candidate block may be determined based on the size and / or position of the at least one candidate block. For example, a higher weight may be assigned to a block with more corresponding target pixels in the at least one candidate block, and a lower weight may be assigned to a block with fewer corresponding target pixels. As another example, the initial weight of the gradient information to be fused may be determined based on the number of target pixels corresponding to the at least one candidate block, and then the initial weight may be adjusted based on the distance between the at least one candidate block and the current block to determine the target weight of the gradient information corresponding to the at least one candidate block. The basic way to adjust the initial weight may be to make the distance between the at least one candidate block and the current block Blocks that are closer have higher weights. As mentioned above, multiple search positions are set around the current block, and the embodiment of the present application does not specifically limit the search order of the multiple search positions. Some possible implementations are given below. In some implementations, the multiple search positions may be searched in a search order from near to far relative to the current block. For example, as mentioned above, in some implementations, the spatial non-adjacent positions around the current block may 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 position 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 position of the current block is equal to iDistVer+1; Among them, 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 the spatial non-adjacent position that meets the above conditions, if the value of N corresponding to the spatial non-adjacent position is smaller, it means that the spatial non-adjacent position is closer to the current block, so the search order of the spatial non-adjacent block can be earlier. Taking Figure 9 as an example, the spatial non-adjacent positions 14 to 16 meet the above conditions, and the value of N corresponding to the spatial non-adjacent positions 14 to 16 is 1, so the search order of the spatial non-adjacent positions 14 to 16 is relatively early (after searching the spatial adjacent positions, the spatial non-adjacent positions 14 to 16 can be searched). The spatial non-adjacent positions 17 to 21 meet the above conditions, and the value of N corresponding to the spatial non-adjacent positions 17 to 21 is 2, so the search order of the spatial non-adjacent positions 17 to 21 can be arranged after the spatial non-adjacent positions 14 to 16. The spatial non-adjacent positions 22 to 26 meet the above conditions, and the value of N corresponding to the spatial non-adjacent positions 22 to 26 is 3, so the search order of the spatial non-adjacent positions 22 to 26 can be arranged after the spatial non-adjacent positions 17 to 21. Spatial non-adjacent positions 27 to 31 satisfy the above conditions, and the value of N corresponding to spatial non-adjacent positions 27 to 31 is 4, therefore, the search order of spatial non-adjacent positions 27 to 31 can be arranged after spatial non-adjacent positions 22 to 26. If the N values corresponding to multiple spatial non-adjacent positions are the same, the order between the multiple spatial non-adjacent positions can be set randomly or determined according to certain rules. For example, the search order of the search position located on the left side of the current block takes precedence, the search order of the search position located on the upper side of the current block takes precedence, and the search order of the search position located at the upper left corner of the current block takes precedence. For another example, the search order of the search position located on the upper side of the current block takes precedence, the search order of the search position located on the left side of the current block takes precedence, and the search order of the search position located at the upper left corner of the current block takes precedence. In some implementations, the search order between multiple search positions can be determined based on the distance between the multiple search positions and the current block (which can refer to the absolute distance, that is, the absolute value between the distances). The embodiment of the present application does not specifically limit the definition of the distance between the search position and the current block. For example, it can be determined based on the distance between the search position and the upper left corner position of the current block. As another example, it can be determined based on the distance between the search position and the center position of the current block. As another example, it can be determined based on the distance between the search position and the upper right corner position of the current block. For example, the search order between multiple search positions can be based on the distance between the multiple search positions and the current block, and sorted in order from small to large distances. The closer the distance between the search position and the current block, the more similar the gradient information corresponding to the search position is to the gradient information of the current block. Prioritizing the search of such search positions helps to obtain useful reference information faster. Further, in some implementations, if the distances between two search positions among the multiple search positions and the current block are the same, the search order between the two search positions may be randomly determined. Alternatively, if two of the multiple search positions are at the same distance from the current block, the search position located on the left side of the current block is searched first, and then the search position located on the upper side of the current block is searched. Alternatively, if two of the multiple search positions are at the same distance from the current block, the search position located above the current block among the two search positions is searched first, and then the search position located on the left side of the current block is searched. In some implementations, gradient information (such as gradient histogram) may be stored in units of coding blocks. In some implementations, gradient information (such as a gradient histogram) can be stored in units of fixed-size image blocks (or fixed-size storage units). The fixed-size image blocks can be larger-size image blocks such as 32*32 or 64*64. If the gradient information is stored in units of 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 the storage coordinates can be searched in the memory based on the storage coordinates. This storage method of gradient information can save memory overhead and is conducive to hardware implementation. The specific size of the image block (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 block (or storage unit) can be selected, and if the resolution of the current frame is large, a larger image block (or storage unit) can be selected. As mentioned above, in some implementations, the candidate blocks in the candidate block set may be checked for duplication. Whether two candidate blocks in the candidate block set are repeated may be determined based on at least one of the following: whether the two candidate blocks correspond to the same coding block; and whether the difference between the gradient information corresponding to the two candidate blocks meets a preset condition. For example, if two candidate blocks in the candidate block set correspond to the same coding block, it can be determined that the two candidate blocks are repeated. In this case, only one candidate block can be retained. For another example, if the difference between the gradient information corresponding to two candidate blocks in the candidate block set meets the preset condition, it can be determined that the two candidate blocks are repeated. 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 the two candidate blocks. In other words, if the gradient information corresponding to the two candidate blocks is similar (or the HoG characteristics are consistent), it can be determined that The two candidate blocks are repeated. By introducing this repeatability judgment condition, it is helpful to remove redundant gradient information, so that the fusion result of gradient information is more accurate. There are multiple ways to determine whether two candidate blocks in a candidate block set are similar. Taking two candidate blocks corresponding to two gradient histograms as an example, whether the two candidate blocks are similar can be directly determined based on the similarity of the two gradient histograms. Alternatively, in some implementations, two groups of IPMs can be determined based on the amplitudes corresponding to the IPMs in the two gradient histograms, and the determination can be made based on the similarity between the two groups of IPMs. Exemplarily, the two candidate blocks in the candidate block set 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 amplitude in the first gradient histogram form a first set (i.e., the amplitude of the gradient corresponding to the S IPMs in the first gradient histogram is the highest, 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 amplitude in the second gradient histogram form a second set (i.e., the amplitude of the gradient corresponding to the S IPMs in the second gradient histogram is the highest). Whether the gradient information corresponding to the two candidate blocks is similar (or whether the two candidate blocks are repeated) can be determined based on whether the first set and the second set are similar. In some implementations, whether two candidate blocks are repeated may be determined based on the number of identical IPMs included in the first set and the second set. For example, if the number of identical IPMs contained in the first set and the second set is greater than or equal to the first threshold, it can be determined that the two candidate blocks are repeated. In other words, if the values of the IPMs in the first set and the second set are highly overlapped, it can be determined that the two candidate blocks are repeated. For another example, 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 value (such as 0.5), the two candidate blocks are repeated. Specifically, the similarity between the first set and the second set can be determined by calculating the ratio of the intersection to the union of the first set and the second set according to the Jaccard similarity criterion. The value of the Jaccard similarity index is between 0 and 1, where 1 indicates that the two sets are completely consistent and 0 indicates that the two sets have no common elements. If the ratio of the intersection to the union of the first set and the second set is greater than 0.5, the first set and the second set are considered to be similar, and the two candidate blocks can be determined to be repeated. In some implementations, whether two candidate blocks are repeated can be determined based on the difference between a first IPM in the first set and a 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. In other words, the first IPM and the second IPM are IPMs that are different between the first set and the second set. For example, if the difference (or the maximum difference) between the first IPM and the second IPM is less than or equal to a second threshold, then it can be determined that the two candidate blocks are repeated. The second threshold can be 3, 4 or 5, for example. In some implementations, at least one of the following may be determined based on the size of the current block: the number of candidate blocks in the candidate block set; the number of gradient information to be fused (such as the number of gradient histograms to be fused); the number of IPMs used to determine the prediction value (the number may be used to indicate how many IPMs are needed to perform weighted blending to determine the prediction value of the current block). That is, one or more of the number of candidate blocks in the candidate block set, the number of gradient information to be fused, and the number of IPMs used to determine the prediction value may be adaptively adjusted according to the size of the current block. For example, for a block smaller than or equal to 16x16, the number of candidate blocks in the candidate block set may be reduced. Exemplarily, for a block smaller than or equal to 16x16, the candidate block set may include only 7 or 9 candidate blocks. For another example, for a block larger than 16x16, the number of candidate blocks in the candidate block set may be increased. For another example, for a block smaller than or equal to 16x16, the number of gradient histograms to be fused may be reduced. For example, for a block smaller than or equal to 16x16, only three gradient histograms may be used for arithmetic averaging to determine the gradient histogram corresponding to the current block. For another example, for blocks larger than 16x16, the number of gradient histograms to be fused can be increased. For another example, for a block smaller than or equal to 16x16, when performing weighted fusion of prediction values of multiple IPMs to generate a prediction value of the current block, a smaller number of IPMs may be used. For example, only prediction values of 2 IPMs may be weighted fused to generate a prediction value of the current block. For another example, for a block larger than 16x16, a greater number of IPMs may be used when performing weighted fusion of prediction values of multiple IPMs to generate a prediction value of the current block. The aforementioned non-adjacent positions in the spatial domain around the current block can be determined based on a certain search strategy. For example, the search distance and search direction can be determined first, and then a two-dimensional search is performed around the current block based on the search step size and search direction with the position of the current block as a reference to determine the non-adjacent positions in the spatial domain around the current block. Alternatively, in some implementations, the spatial non-adjacent positions around the current block may be determined based on a pre-established first mapping relationship, where the first mapping relationship is a mapping relationship between an index and a coordinate of the spatial non-adjacent position. For example, a one-dimensional list may be used to sequentially store the mapping relationship between the index and the coordinate of the spatial non-adjacent position to be searched for the current block, and in actual use, the spatial non-adjacent position may be directly searched based on the one-dimensional list. Alternatively, in some implementations, the spatial non-adjacent position is determined based on a pre-established first mapping relationship and a second mapping relationship. The first mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a search distance (such as the distance between the spatial non-adjacent position and the upper left corner of the current block), and the second mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a search direction (such as the distance between the spatial non-adjacent position and the upper left corner of the current block). For example, two one-dimensional lists may be used to store the mapping relationship between the index of the spatial non-adjacent position and the search distance, and the mapping relationship between the index of the spatial non-adjacent position and the search direction. In actual use, the coordinates of the spatial non-adjacent position may be derived according to the combination of the two one-dimensional lists, and then the spatial non-adjacent position may be determined according to the coordinates of the spatial non-adjacent position. The above text describes in detail the decoding method provided by the embodiment of the present application in conjunction with Figure 8. The following text describes in detail the encoding method provided by the embodiment of the present application in conjunction with Figure 10. FIG10 is a flow chart of a coding method provided by an embodiment of the present application. The method of FIG10 may also be referred to as an intra-frame prediction method, or a prediction method based on a DIMD fusion mode. The method of FIG10 may be applied to an encoder, for example, to an intra-frame prediction unit of an encoder. Referring to FIG. 10 , in step S1010 , a plurality of search positions around a current block are determined. The current block may also be referred to as a current coding block or a current coding unit. The current block may be, for example, a luminance block. The intra prediction mode used by the current block may be the DIMD fusion mode. In some implementations, the number of multiple search positions around the current block may be greater than 13. For example, the number of search positions around the current block may be greater than or equal to 16, 18, 21, 26, or 31. The number of search positions provided by the embodiment of the present application is greater than the number of search positions provided by the related art (the related art provides 13 search positions). Therefore, the embodiment of the present application is equivalent to searching for candidate blocks in a larger search area or more search positions, thereby helping to improve the accuracy of prediction. In some implementations, the multiple search positions around the current block (or the multiple search positions in the neighboring area of the current block) may include spatially adjacent positions (or adjacent reference points) and / or spatially non-adjacent positions (or non-adjacent reference points). For example, the search may be performed at X1 spatially adjacent positions and X2 spatially non-adjacent positions around the current block. The value of X1 may be, for example, less than or equal to 13. The value of X2 may be, for example, 3, 5, 8, 13, or 18. The embodiment of the present application expands the search area, which helps to obtain more available candidate blocks, thereby helping to improve the accuracy of the prediction. In some implementations, the search position around the current block includes a spatial non-adjacent position, which is determined based on a predefined position and / or a predefined size. The predefined size may, for example, include a predefined horizontal size (or horizontal step size) and / or a predefined vertical size (or vertical step size). In some implementations, the predefined positions or spatially non-adjacent positions mentioned above may be determined based on one or more of the following: The position of the current block (such as the upper left corner of the current block); The size of the current block (such as the width and / or height of the current block); The size of the neighboring blocks of the current block (such as the width and / or height of the neighboring blocks); Predefined horizontal dimensions; Predefined vertical dimensions. In some implementations, the predefined size mentioned above (such as a predefined horizontal size and / or a predefined vertical size) may be determined based on the size of the current block. For example, the predefined horizontal size is determined based on the width of the current block. For another example, the predefined vertical size is determined based on the height of the current block. As a more specific example, the predefined horizontal size is N times the width of the current block, and the predefined vertical size is N times the height of the current block, where N is a positive integer greater than or equal to 1. In some implementations, the predefined size mentioned above (such as a predefined horizontal size and / or a predefined vertical size) may be independent of the size of the current block. For example, the predefined horizontal size and / or the predefined vertical size may be fixed values, such as one or more of 4, 8, 16, 32, and 64. For example, the non-adjacent positions in the spatial domain to be searched around the current block may 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 position of the current block is equal to iDistHor+1 (hereinafter referred to as condition 1); The absolute value of the vertical offset between the non-adjacent position in the spatial domain and the upper left corner position of the current block is equal to iDistVer+1 (hereinafter referred to as condition 2); Among them, iDistHor is equal to the predefined horizontal size; iDistVer is equal to the predefined vertical size. In some implementations, the iDistHor may be a fixed value (e.g., one or more of 4, 8, 16, 32, and 64), or may be determined based on the size of the current block (e.g., the width of the current block). For example, the iDistHor may be N times the width of the current block, where N is a positive integer greater than or equal to 1. In some implementations, the iDistVer may be a fixed value (e.g., one or more of 4, 8, 16, 32, and 64), or may be determined based on the size of the current block (e.g., the height of the current block). For example, the iDistVer may be N times the height of the current block, where N is a positive integer greater than or equal to 1. iDistHor and iDistVer may represent the search distance. Determining iDistHor and / or iDistVer based on the size of the current block may enable the search distance to be adaptively adjusted based on the size of the current block, so that the searched gradient information is more accurate. Taking Figure 9 as an example, the non-adjacent positions in the spatial domain to be searched around the current block include search positions 14 to 16. As can be seen from Figure 9, search position 14 satisfies condition 1, search position 15 satisfies condition 2, and search position 16 satisfies both condition 1 and condition 2. In addition, the value of N corresponding to search positions 14 to 16 is 1, that is, iDistHor is equal to the width of the current block, and iDistVer is equal to the height of the current block. In other words, the position of the current block can be used as the starting position, and the search step length can be doubled to form a search area near the search area defined by the double step length. The search results in non-adjacent positions 14 to 16 in the spatial domain. Still taking Figure 9 as an example, the spatial non-adjacent positions of the current block include search positions 17 to 21. As can be seen from 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 condition 1 and condition 2. In addition, the value of N corresponding to search positions 17 to 21 is 2, that is, 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 position of the current block can be used as the starting position, and the double step length of the current block can be used as the search step length, and the spatial non-adjacent positions 17 to 21 can be searched near the search area defined by the double step length. Still taking Figure 9 as an example, the spatial non-adjacent positions of the current block include search positions 22 to 26. As can be seen from Figure 9, search position 22 meets condition 1, search position 23 meets condition 2, search position 24 meets condition 2, search position 25 meets condition 1, and search position 26 meets both condition 1 and condition 2. In addition, the value of N corresponding to search positions 22 to 26 is 3, that is, 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 position of the current block can be used as the starting position, and the three times step length of the current block can be used as the search step length. The spatial non-adjacent positions 22 to 26 can be searched near the search area defined by the three times step length. Still taking Figure 9 as an example, the spatial non-adjacent positions of the current block include search positions 27 to 31. As can be seen from 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 condition 1 and condition 2. In addition, the value of N corresponding to search positions 27 to 31 is 4, that is, 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 position of the current block can be used as the starting position, and the four times step length of the current block can be used as the search step length, and the spatial non-adjacent positions 27 to 31 can be searched near the search area defined by the four times step length. 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 upper adjacent block of the current block. In some implementations, the value of N mentioned above may be less than or equal to 4. For example, the value of N includes 1, 2, 3, and 4. Of course, the value of N may also be greater than 4, for example, N is 5, 6, or 7. Setting the value of N to be less than or equal to 4 can minimize the implementation complexity of the search process while obtaining sufficient gradient information. In some implementations, the non-adjacent spatial locations to be searched around the current block satisfy: xNb=xTL+offsetX, and yNb=yTL+offsetY; Wherein, 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; Among them, 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 position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block. The above-mentioned spatial non-adjacent positions provided in the embodiment of the present application are evenly distributed around the current block, so that as much available gradient information as possible can be searched using as few search positions as possible. Taking Figure 9 as an example, assuming that N=1, iDistHor is equal to the width of the current block, and iDistVer is equal to the height of the current block. Further, if offsetX=uiWidth+iDistHor-1, and offsetY=-iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 15 in Figure 9; if offsetX=uiWidth>>1, and offsetY=-iDistVer-1, the spatial non-adjacent position (xNb, yNB) is located directly above the current block and has the same horizontal position as the search position 15 (Figure 9 does not number the search position); if offsetX=-iDistHor-1, and offsetY=-iDistVer-1, the spatial non-adjacent position (xNb, yNB) is located directly above the current block and has the same horizontal position as the search position 15 (Figure 9 does not number the search position); stVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 16 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, the spatial non-adjacent position (xNb, yNB) is located to the left of the current block and has the same vertical position as the search position 16 (the search position is not numbered in Figure 9); if offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 16 in Figure 9. Further, 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. Still taking FIG. 9 as an example, when N=1, the spatial non-adjacent position (xNb, yNB) may include the search positions 14 to 16 in FIG. 9. Taking FIG. 9 as an example, assuming that N=2, 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 spatial non-adjacent position (xNb, yNB) refers to the search position 18 in Figure 9; if offsetX=uiWidth>>1, and offsetY=-iDistVer-1, then the spatial non-adjacent position (xNb, yNB) refers to the search position 19 in Figure 9; if offsetX=-iDistHor-1, and offsetY=-iDistVer-1, then the spatial non-adjacent position (xNb, yNB) refers to the search position 21 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, then the spatial non-adjacent position (xNb, yNB) refers to the search position 20 in Figure 9; if offsetX=-iDistHor-1, and offsetY =uiHeigth+iDistVer-1, then the spatial non-adjacent position (xNb,yNB) refers to the search position 17 in Figure 9. Taking Figure 9 as an example, assuming N = 3, 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, the spatial non-adjacent position (xNb, yNB) refers to the search position 23 in Figure 9; if offsetX = uiWidth>>1, and offsetY = -iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 24 in Figure 9; if offsetX = -iDistHor-1, and offsetY = -iDistVer-1, stVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 26 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, the spatial non-adjacent position (xNb, yNB) refers to the search position 25 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 22 in Figure 9. Taking Figure 9 as an example, assuming N = 4, 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, the spatial non-adjacent position (xNb, yNB) refers to the search position 28 in Figure 9; if offsetX = uiWidth>>1, and offsetY = -iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 29 in Figure 9; if offsetX = -iDistHor-1, and offsetY = -iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 29 in Figure 9; stVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 31 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth>>1, the spatial non-adjacent position (xNb, yNB) refers to the search position 30 in Figure 9; if offsetX=-iDistHor-1, and offsetY=uiHeigth+iDistVer-1, the spatial non-adjacent position (xNb, yNB) refers to the search position 27 in Figure 9. In some implementations, the spatial non-adjacent position around the current block satisfies 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, and located at the lower left of the current block. If the direction of the horizontal coordinate is used as a reference, the spatial non-adjacent position around the current block satisfies at least one of the following: located at the 45° direction of the current block, located at the 90° direction of the current block, located at the 135° direction of the current block, located at the 180° direction of the current block, and located at the 225° direction of the current block. The above direction can be referred to as the search direction of the spatial non-adjacent position around the current block, that is, the search operation can be performed along the above direction based on the position of the current block to determine the spatial non-adjacent position of the current block. The search step size in each search direction can be determined based on the N (or iDistHor and iDistVer) mentioned above. The above-mentioned spatial non-adjacent positions provided in the embodiment of the present application are evenly distributed around the current block, so that as much available gradient information as possible can be searched using as few search positions as possible. In some implementations, the number of search positions and / or the size of the search range may be adaptively adjusted. For example, the number of search positions and / or the size of the search range may be determined based on the size of the current block. By adaptively adjusting the number of search positions and / or the size of the search range according to the size of the current block, the gradient information searched is more accurate. As an example, the value range of N (or iDistHor and iDistVer) mentioned above can be determined according to the size of the current block. For example, if the size of the current block is the first size, the value range of N is the first value range; if the size of the current block is the second size, the value range of N is the second value range. Further, in some implementations, if the first size is smaller than the second size, the first value range is smaller than the second value range. That is, if the current block is a small block, the search range of the spatial non-adjacent positions of the current block is reduced; if the current block is a large block, the search range of the spatial non-adjacent positions of the current block is expanded, so that the prediction process is more flexible. For example, if the size of the current block is the first size, the value range of N is 1 to 3; if the size of the current block is the second size (larger than the first size), the value range of N is 1 to 4. As another example, if the size of the current block is smaller than a preset size (such as 16×16), the spatial neighboring position of the current block may not include at least one of the following positions: The first position corresponds to the position 1 / 4 of the height of the current block (see search position 10 in FIG. 6 ); The second position corresponds to the position of 1 / 4 of the width of the current block (see the search position 11 in FIG. 6 ); The third position corresponds to the 3 / 4 position of the height of the current block (see the search position 12 in FIG. 6 ); The fourth position corresponds to the 3 / 4 position of the width of the current block (see search position 13 in FIG. 6 ); The fifth position corresponds to the position 1 / 2 of the height of the current block (see search position 8 in FIG. 6 ); The sixth position corresponds to the 1 / 2 position of the width of the current block (see search position 9 in FIG. 6 ). As another example, the above two examples can be combined together. For example, if the size of the current block is smaller than the preset size (such as 16×16), the value range of N can be limited to the second value range (such as 1 to 3), thereby reducing the number of non-adjacent positions in the spatial domain to be searched. Furthermore, one or more positions from the first position to the sixth position mentioned above can be removed at the same time (such as removing the first position to the fourth position at the same time), thereby reducing the number of adjacent positions in the spatial domain to be searched. In step S1020, gradient information to be fused is determined according to a plurality of search positions around the current block. In some implementations, step S1020 may include: determining a candidate block set (such as a candidate list) based on multiple search positions around the current block; and determining gradient information to be fused based on the candidate block set. Determining the candidate block set based on multiple search positions around the current block may include: adding 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 candidate blocks with the highest sorting as the gradient information to be fused. The embodiment of the present 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 may also be referred to as or replaced by angle mode HoG information. In other implementations, the gradient information may include a group of IPMs and their corresponding amplitudes. The group of IPMs may, for example, be a group of IPMs with the highest corresponding amplitudes in the gradient histogram. The group of IPMs may include 3 IPMs, 5 IPMs, or other numbers of IPMs. In some implementations, the gradient information to be fused may be the gradient information corresponding to K candidate blocks, where K is a positive integer greater than 3. For example, the value of K may be 5. For another example, the value of K may be greater than 5, such as K may be 6, 7 or 8. The K candidate blocks mentioned here may be determined based on multiple search positions around the current block. For example, a candidate block set (such as a candidate list, which may be used to store the coding block information corresponding to the search position) may be determined based on multiple search positions around the current block, and the K candidate blocks may be determined from the candidate block set. The method of determining the K candidate blocks from the candidate block set may include, for example, sorting the candidate blocks in the candidate block set (such as sorting according to the distance between the upper left corner position of the candidate block and the upper left corner position of the current block), and then determining the gradient information corresponding to the first K candidate blocks after sorting 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 may be the gradient information corresponding to all available candidate blocks. By increasing the number of candidate blocks for providing gradient information (in the related art, K=3), the accuracy of the fused gradient information can be improved, thereby improving the accuracy of the prediction. In some implementations, the gradient information to be fused is K gradient histograms, where K is a positive integer greater than 3. For example, the value of K may be 5; or, the value of K may be greater than 5, such as K may be 6, 7 or 8. In some implementations, the gradient information to be fused is the amplitude corresponding to K groups of IPMs, where K is a positive integer greater than 3. For example, the value of K may be 5; or, the value of K may be greater than 5, such as K may be 6, 7 or 8. Each group of IPMs may include 3, 5 or more IPMs. In some implementations, the gradient information to be fused is determined based on a candidate block set. The candidate block set can be determined based on multiple search positions around the current block. The candidate block set may or may not contain repeated candidate blocks. For example, a candidate block set (such as a candidate list, which can be used to store the coding block information corresponding to the search position) can be determined based on multiple search positions around the current block; then, the candidate blocks in the candidate block set can be checked for repeatability; if the candidate block set contains repeated candidate blocks, only one candidate block is retained. The introduction of repeatability check can avoid redundant gradient information, thereby improving the accuracy of prediction. 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 may be determined based on multiple search positions around the current block. The candidate block set may 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. Sorting the M candidate blocks according to the distance between the candidate blocks and the current block helps to preferentially search for the gradient information corresponding to the search position with a closer distance. There are many ways to define the distance between the M candidate blocks and the current block. For example, the distance between the upper left corners of the M candidate blocks and the upper left corner of the current block can be used as the distance between the M candidate blocks and the current block. For another example, the distance between the center positions of the M candidate blocks and the center position of the current block can be used as the distance between the M candidate blocks and the current block. As an example, the M candidate blocks include a first candidate block (which can be any candidate block among the M candidate blocks). The distance between the first candidate block and the current block is determined based on the difference between the first distance and the second distance. The first distance represents the horizontal distance between the upper left corner position of the first candidate block and the upper left corner position of the current block, and the second distance represents the vertical distance between the upper left corner position of the first candidate block and the upper left corner position 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))); wherein xTL represents the horizontal coordinate of the upper left corner position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, xNeiTL represents the horizontal coordinate of the upper left corner position of the first candidate block, yNeiTL represents the vertical coordinate of the upper left corner position of the first candidate block, and abs represents the absolute value operation. The distance determined by the above distance determination method is close to the Euclidean distance between the two positions, and therefore is more accurate. In the specific implementation process, deltaX=abs(xTL-xNeiTL), deltaY=abs(yTL-yNeiTL) can be calculated first, and then (deltaX+deltaY+abs(deltaX-deltaY)) can be calculated to avoid unnecessary repeated operations. As another example, the M candidate blocks include a second candidate block (which can be any candidate block among the M candidate blocks). The distance between the second candidate block and the current block satisfies: (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)); wherein 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, xNeiTL represents the horizontal coordinate of the upper left corner of the second candidate block, yNeiTL represents the vertical coordinate of the upper left corner of the second candidate block, and abs represents an absolute value operation. The above distance determination method is compatible with the distance determination method provided by the related art. In some implementations, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located on the left side of the current block among the two candidate blocks may be higher than the ranking of the candidate block located on the upper side of the current block among the two candidate blocks. For example, the priority of the candidate block located on the left side of the current block among the two candidate blocks is higher than the priority of the candidate block located on the upper side of the current block among the two candidate blocks. Alternatively, the value of the index of the candidate block located on the left side of the current block among the two candidate blocks is smaller than the value of the index of the candidate block located on the upper side of the current block among the two candidate blocks. In some implementations, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located above the current block among the two candidate blocks may be higher than the ranking of the candidate block located to the left of the current block among the two candidate blocks. For example, the priority of the candidate block located above the current block among the two candidate blocks is higher than the priority of the candidate block located to the left of the current block among the two candidate blocks. Alternatively, the value of the index of the candidate block located above the current block among the two candidate blocks is smaller than the value of the index of the candidate block located on the left side of the current block among the two candidate blocks. In step S1030, a prediction value of the current block is determined according to the gradient information to be fused. In some implementations, step S1030 may include: determining target gradient information according to the gradient information to be fused; and determining a prediction value of the current block according to the target gradient information. The target gradient information may be, for example, gradient information corresponding to the current block. In some implementations, determining the target gradient information according to the gradient information to be fused may include: performing arithmetic averaging on the gradient information to be fused to determine the target gradient information. In some implementations, determining the prediction value of the current block according to the target gradient information may include: determining one or more IPMs according to the target gradient information; performing intra-frame prediction on the current block according to the one or more IPMs to determine one or more prediction values; and determining the prediction value of the current block according to the one or more prediction values. For detailed description, please refer to S1.2 in the above text. In some implementations, the gradient information to be fused may be the gradient information corresponding to at least one candidate block. The at least one candidate block may be determined from a candidate block set, and the candidate block set may be determined based on a plurality of search positions around the current block. Further, in some implementations, the gradient information corresponding to the at least one candidate block may be normalized according to the size (or block size) of the at least one candidate block to determine the gradient information to be fused. For example, at least one gradient histogram corresponding to the at least one candidate block may be determined first, and then, according to the size of the at least one candidate block, the amplitude (or intensity) corresponding to each IPM in the at least one gradient histogram may be normalized, and the normalized gradient histogram may be used as the gradient information to be fused. Normalizing the gradient information corresponding to the candidate block according to the size of the candidate block helps to improve the accuracy of gradient information fusion. In some implementations, the gradient information to be fused may be arithmetic averaged or weighted averaged to determine the target gradient information; and the prediction value of the current block may be determined based on the target gradient information. For example, if the gradient information to be fused includes one or more gradient histograms, the one or more gradient histograms may be weighted to obtain the gradient histogram corresponding to the current block (i.e., the target gradient information); then, the prediction value of the current block may be determined based on the gradient histogram corresponding to the current block. Weighted averaging of different gradient information to be fused helps to improve the accuracy of gradient information fusion. The embodiment of the present application does not specifically limit the method for determining the weight of the gradient information to be fused. For example, as mentioned above, the gradient information to be fused may be the gradient information corresponding to at least one candidate block in the candidate set. Therefore, in some implementations, the weight of the gradient information to be fused may be determined based on the at least one candidate block. As an example, the weight of the gradient information to be fused may be determined according to the distance between the at least one candidate block and the current block. For example, a higher weight may be set for the gradient information corresponding to the candidate block that is closer to the current block among the at least one candidate block, and a lower weight may be set for the gradient information corresponding to the candidate block that is farther from the current block among the at least one candidate block. As another example, the weight of the gradient information to be fused may be determined according to the size of the at least one candidate block. For example, a higher weight may be assigned to a larger block in the at least one candidate block, and a lower weight may be assigned to a smaller block. As another example, the weight of the gradient information to be fused may be determined according to the number of target pixels corresponding to the at least one candidate block. The target pixel is a pixel required for determining the gradient information in the DIMD mode. The target pixel corresponding to the at least one candidate block may be determined based on the size and / or position of the at least one candidate block. For example, a higher weight may be assigned to a block with more corresponding target pixels in the at least one candidate block, and a lower weight may be assigned to a block with fewer corresponding target pixels. As another example, the initial weight of the gradient information to be fused may be determined based on the number of target pixels corresponding to the at least one candidate block, and then the initial weight may be adjusted based on the distance between the at least one candidate block and the current block to determine the target weight of the gradient information corresponding to the at least one candidate block. The basic manner of adjusting the initial weight may be to make the block with a closer distance between the at least one candidate block and the current block have a higher weight. As mentioned above, multiple search positions are set around the current block, and the embodiment of the present application does not specifically limit the search order of the multiple search positions. Some possible implementations are given below. In some implementations, the multiple search positions may be searched in a search order from near to far relative to the current block. For example, as mentioned above, in some implementations, the spatial non-adjacent positions around the current block may 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 position 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 position of the current block is equal to iDistVer+1; Among them, 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 the spatial non-adjacent position that meets the above conditions, if the value of N corresponding to the spatial non-adjacent position is smaller, it means that the spatial non-adjacent position is closer to the current block, so the search order of the spatial non-adjacent block can be earlier. Taking Figure 9 as an example, spatial non-adjacent positions 14 to 16 meet the above conditions, and the value of N corresponding to spatial non-adjacent positions 14 to 16 is 1. Therefore, the search order of spatial non-adjacent positions 14 to 16 is relatively early (after searching the spatial adjacent positions, spatial non-adjacent positions 14 to 16 can be searched). Spatial non-adjacent positions 17 to 21 meet the above conditions, and the value of N corresponding to spatial non-adjacent positions 17 to 21 is 2. Therefore, the search order of spatial non-adjacent positions 17 to 21 can be arranged after spatial non-adjacent positions 14 to 16. Spatial non-adjacent positions 22 to 26 meet the above conditions, and the value of N corresponding to spatial non-adjacent positions 22 to 26 is 3. Therefore, the search order of spatial non-adjacent positions 22 to 26 is arranged after spatial non-adjacent positions 14 to 16. The search order can be arranged after the spatial non-adjacent positions 17 to 21. Spatial non-adjacent positions 27 to 31 meet the above conditions, and the value of N corresponding to the spatial non-adjacent positions 27 to 31 is 4. Therefore, the search order of spatial non-adjacent positions 27 to 31 can be arranged after the spatial non-adjacent positions 22 to 26. If the N values corresponding to multiple spatial non-adjacent positions are the same, the order between the multiple spatial non-adjacent positions can be set randomly or determined according to certain rules. For example, the search order of the search position located on the left side of the current block is prioritized, the search order of the search position located on the upper side of the current block is second, and the search order of the search position located at the upper left corner of the current block is third. For another example, the search order of the search position located on the upper side of the current block is prioritized, the search order of the search position located on the left side of the current block is second, and the search order of the search position located at the upper left corner of the current block is third. In some implementations, the search order between multiple search positions can be determined based on the distance between the multiple search positions and the current block (which can refer to the absolute distance, that is, the absolute value between the distances). The embodiment of the present application does not specifically limit the definition of the distance between the search position and the current block. For example, it can be determined based on the distance between the search position and the upper left corner position of the current block. As another example, it can be determined based on the distance between the search position and the center position of the current block. As another example, it can be determined based on the distance between the search position and the upper right corner position of the current block. For example, the search order between multiple search positions can be based on the distance between the multiple search positions and the current block, and sorted in order from small to large distances. The closer the distance between the search position and the current block, the more similar the gradient information corresponding to the search position is to the gradient information of the current block. Prioritizing the search of such search positions helps to obtain useful reference information faster. Further, in some implementations, if the distances between two search positions among the multiple search positions and the current block are the same, the search order between the two search positions may be randomly determined. Alternatively, if two of the multiple search positions are at the same distance from the current block, the search position located on the left side of the current block is searched first, and then the search position located on the upper side of the current block is searched. Alternatively, if two of the multiple search positions are at the same distance from the current block, the search position located above the current block among the two search positions is searched first, and then the search position located on the left side of the current block is searched. In some implementations, gradient information (such as gradient histogram) may be stored in units of coding blocks. In some implementations, gradient information (such as a gradient histogram) can be stored in units of fixed-size image blocks (or fixed-size storage units). The fixed-size image blocks can be larger-size image blocks such as 32*32 or 64*64. If the gradient information is stored in units of 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 the storage coordinates can be searched in the memory based on the storage coordinates. This storage method of gradient information can save memory overhead and is conducive to hardware implementation. The specific size of the image block (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 block (or storage unit) can be selected, and if the resolution of the current frame is large, a larger image block (or storage unit) can be selected. As mentioned above, in some implementations, the candidate blocks in the candidate block set may be checked for duplication. Whether two candidate blocks in the candidate block set are repeated may be determined based on at least one of the following: whether the two candidate blocks correspond to the same coding block; and whether the difference between the gradient information corresponding to the two candidate blocks meets a preset condition. For example, if two candidate blocks in the candidate block set correspond to the same coding block, it can be determined that the two candidate blocks are repeated. In this case, only one candidate block can be retained. For another example, if the difference between the gradient information corresponding to two candidate blocks in the candidate block set meets the preset condition, it can be determined that the two candidate blocks are repeated. 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 the two candidate blocks. In other words, if the gradient information corresponding to the two candidate blocks is similar (or the HoG characteristics are consistent), it can be determined that the two candidate blocks are repeated. By introducing the repeatability judgment condition, it is helpful to remove redundant gradient information, thereby making the fusion result of the gradient information more accurate. There are multiple ways to determine whether two candidate blocks in a candidate block set are similar. Taking two candidate blocks corresponding to two gradient histograms as an example, whether the two candidate blocks are similar can be directly determined based on the similarity of the two gradient histograms. Alternatively, in some implementations, two groups of IPMs can be determined based on the amplitudes corresponding to the IPMs in the two gradient histograms, and the determination can be made based on the similarity between the two groups of IPMs. Exemplarily, the two candidate blocks in the candidate block set 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 amplitude in the first gradient histogram form a first set (i.e., the amplitude of the gradient corresponding to the S IPMs in the first gradient histogram is the highest, 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 amplitude in the second gradient histogram form a second set (i.e., the amplitude of the gradient corresponding to the S IPMs in the second gradient histogram is the highest). Whether the gradient information corresponding to the two candidate blocks is similar (or whether the two candidate blocks are repeated) can be determined based on whether the first set and the second set are similar. In some implementations, whether two candidate blocks are repeated may be determined based on the number of identical IPMs included in the first set and the second set. 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 sets may be determined to be In other words, if the values of the IPMs in the first set and the second set are highly overlapped, it can be determined that the two candidate blocks are repeated. For another example, 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 value (such as 0.5), the two candidate blocks are repeated. Specifically, the similarity between the first set and the second set can be determined by calculating the ratio of the intersection to the union of the first set and the second set according to the Jaccard similarity criterion. The value of the Jaccard similarity index is between 0 and 1, where 1 indicates that the two sets are completely consistent and 0 indicates that the two sets have no common elements. If the ratio of the intersection to the union of the first set and the second set is greater than 0.5, the first set and the second set are considered to be similar, and the two candidate blocks can be determined to be repeated. In some implementations, whether two candidate blocks are repeated can be determined based on the difference between a first IPM in the first set and a 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. In other words, the first IPM and the second IPM are IPMs that are different between the first set and the second set. For example, if the difference (or the maximum difference) between the first IPM and the second IPM is less than or equal to a second threshold, then it can be determined that the two candidate blocks are repeated. The second threshold can be 3, 4 or 5, for example. In some implementations, at least one of the following may be determined based on the size of the current block: the number of candidate blocks in the candidate block set; the number of gradient information to be fused (such as the number of gradient histograms to be fused); the number of IPMs used to determine the prediction value (the number may be used to indicate how many IPMs are needed to perform weighted blending to determine the prediction value of the current block). That is, one or more of the number of candidate blocks in the candidate block set, the number of gradient information to be fused, and the number of IPMs used to determine the prediction value may be adaptively adjusted according to the size of the current block. For example, for a block smaller than or equal to 16x16, the number of candidate blocks in the candidate block set may be reduced. Exemplarily, for a block smaller than or equal to 16x16, the candidate block set may include only 7 or 9 candidate blocks. For another example, for a block larger than 16x16, the number of candidate blocks in the candidate block set may be increased. For another example, for a block smaller than or equal to 16x16, the number of gradient histograms to be fused may be reduced. For example, for a block smaller than or equal to 16x16, only three gradient histograms may be used for arithmetic averaging to determine the gradient histogram corresponding to the current block. For another example, for blocks larger than 16x16, the number of gradient histograms to be fused can be increased. For another example, for a block smaller than or equal to 16x16, when performing weighted fusion of prediction values of multiple IPMs to generate a prediction value of the current block, a smaller number of IPMs may be used. For example, only prediction values of 2 IPMs may be weighted fused to generate a prediction value of the current block. For another example, for a block larger than 16x16, a greater number of IPMs may be used when performing weighted fusion of prediction values of multiple IPMs to generate a prediction value of the current block. The aforementioned non-adjacent positions in the spatial domain around the current block can be determined based on a certain search strategy. For example, the search distance and search direction can be determined first, and then a two-dimensional search is performed around the current block based on the search step size and search direction with the position of the current block as a reference to determine the non-adjacent positions in the spatial domain around the current block. Alternatively, in some implementations, the spatial non-adjacent positions around the current block may be determined based on a pre-established first mapping relationship, where the first mapping relationship is a mapping relationship between an index and a coordinate of the spatial non-adjacent position. For example, a one-dimensional list may be used to sequentially store the mapping relationship between the index and the coordinate of the spatial non-adjacent position to be searched for the current block, and in actual use, the spatial non-adjacent position may be directly searched based on the one-dimensional list. Alternatively, in some implementations, the spatial non-adjacent position is determined based on a pre-established first mapping relationship and a second mapping relationship. The first mapping relationship is a mapping relationship between the index of the spatial non-adjacent position and the search distance (such as the distance between the spatial non-adjacent position and the upper left corner position of the current block), and the second mapping relationship is a mapping relationship between the index of the spatial non-adjacent position and the search direction (such as the direction of the spatial non-adjacent position relative to the current block). For example, two one-dimensional lists can be used to store the mapping relationship between the index of the spatial non-adjacent position and the search distance, and the mapping relationship between the index of the spatial non-adjacent position and the search direction. In actual use, the coordinates of the spatial non-adjacent position can be derived based on the combination of the two one-dimensional lists, and then the spatial non-adjacent position is determined based on the coordinates of the spatial non-adjacent position. In some implementations, the first identification information (such as the DIMD fusion identification) may be written into the bitstream. The first identification information is used to indicate that the current block uses the DIMD fusion mode. The first identification information may include, for example, a first value and a second value. The first value may be 1 or true. The first value may be used to indicate that the current block uses the DIMD fusion mode. The second value may be 0 or false. The second value may 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, the current block may be predicted based on the DIMD mode. The following is a more detailed description of the embodiments of the present application in conjunction with specific examples. It should be noted that the following examples are only intended to help those skilled in the art understand the embodiments of the present application, rather than limiting the embodiments of the present application to the specific numerical values or specific scenarios illustrated. It is apparent that those skilled in the art can make various equivalent modifications or changes based on the examples given, and such modifications or changes also fall within the scope of the embodiments of the present application. In the process of deriving the intra prediction mode based on DIMD fusion, coding blocks at spatially non-adjacent positions in a larger search area may be added to the candidate list. S1: DIMD mode The implementation method of S1 can be found above and will not be repeated here. S2.1DIMD fusion intra-mode derivation The input to step S2.1 may include the following information: - The upper left position of the current luminance block (xTL, yTL), the lower left position of the current luminance block (xLB, yLB), and the upper right position of the current luminance block (xRT, yRT); -The width uiWidth of the current brightness block, the height uiHeigth of the current brightness block; - The current luminance block neighboring position (xNb[idx], yNb[idx]), idx = 1, ..., 31; - The CU corresponding to the neighboring position (xNb[idx], yNb[idx]) is denoted as cuNeibor[idx], idx=1,…,31; The output of step S2.1 has different contents in different scenarios: in the DIMD intra-frame prediction value acquisition scenario, it is histogram information; in other application scenarios, it can be the traditional intra-frame prediction mode IntraPredModeD, where the value of IntraPredModeD is between [0,66]. The following describes in detail the process of deriving the traditional intra-frame prediction mode by performing gradient analysis after DIMD fusion and expansion of the search area. Step a: Search for the cuNeibor[idx] corresponding to the neighboring position of the current block, and add the corresponding coding block to the candidate list in the search order. When adding cuNeibor[idx] to the candidate list, check whether cuNeibor[idx] exists, whether it is repeated, and whether it is DIMD or DIMD fusion mode. The searched neighboring position and the search order of the neighboring position are shown in Figure 9. If there is a duplicate cuNeibor[idx] in the candidate list, only one candidate block is retained. After obtaining cuNeibor[idx] corresponding to the adjacent position, the coding blocks corresponding to the 13 spatial adjacent positions and 18 spatial non-adjacent spatial positions of the current block are taken as candidates in the candidate list. i. For cuNeibor[idx] corresponding to adjacent positions in the spatial domain, the selection method can refer to the relevant technology; ii. For cuNeibor[idx] corresponding to non-adjacent positions in the spatial domain, the search distance can be determined based on the width (uiWidth) and height (uiHeight) of the current block. The search positions are the positions corresponding to 14-31 in Figure 9, and the search order can be determined based on the principle of from near to far. The specific search process is as follows: Search is performed in different directions of the current block. The search directions may include 45°, vertical 90°, 135°, horizontal 180°, and 225° directions. The search step size is based on the width and height of the current block, and the search range is extended to an area 4 times the step size base. In addition, in the horizontal 180° and vertical 90° directions, the search of 1 times the step size base is not performed. Define five directions angle[5]={0,1,2,3,4}, corresponding to 45°, vertical 90°, 135°, horizontal 180° and 225° respectively; define the number of directions to be searched for different search steps numAng[4]={3,5,5,5}; the specific search direction is 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}} represents the direction to be searched for each search step. The search steps are as follows: Step size 1, search directions angle[0], angle[2], and angle[4]; Step size 2, search directions angle[0], angle[1], angle[2], angle[3], and angle[4]; Step size 3, search directions angle[0], angle[1], angle[2], angle[3], and angle[4]; Step size 4, search directions angle[0], angle[1], angle[2], angle[3], and angle[4]; Then perform the corresponding search operation. The search process can be implemented using the following code: The coordinates of different search positions (xNb, yNb) are obtained according to the coordinate offset value of each search position, where xNb=xTL+offsetX, yNb=yTL+offsetY, and the corresponding coding block information at the adjacent position (xNb[idx], yNb[idx]) is stored in the candidate list. Step b: Sort the available candidate blocks in the candidate list according to the position distance. Let the upper left corner position of the available cuNeibor[idx] in the candidate list be (xNeiTL, yNeiTL), then the distance between the current block and the candidate block cuNeibor[idx] is dist[idx] = (abs(xTL-xNeiTL)+abs(yTL-yNeiTL)), and sort from small to large according to the value of dist[idx]. When dist[idx] are equal, sort in search order. Step c: Read the gradient histograms of the first five sorted cuNeibor[idx], denoted as HoGN[nei], where nei = 0..4. When the number of available candidate cuNeibor is less than 5, take as many HoGN[nei] corresponding to the available candidate cuNeibor[idx] as possible. Step d: Perform arithmetic averaging on the obtained gradient histogram HoGN[nei] to calculate the gradient histogram HoGM. Step e: Save the gradient histogram HoGM in units of coding blocks. Step f: Obtain the intra prediction mode of the current block according to the gradient histogram HoGM. In the DIMD prediction scenario, all or part of the information of the gradient histogram will be stored for subsequent calculations. For detailed description, see S2.2 below. In other application scenarios, a directional mode IntraPredModeD can be obtained based on the information in the gradient histogram. For example, if HoG has no non-zero amplitude, set IntraPredModeD to PLANAR. Otherwise, set IntraPredModeD 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 the scenario of obtaining the predicted value based on DIMD. S2.2DIMD fusion to obtain predicted values The implementation method of S2.2 can refer to the previous description and will not be repeated here. This example proposes a DIMD fusion technology solution based on a larger search area, which can effectively use the direction of the adjacent position coding block to guide the current block, and improve the accuracy of generating prediction values based on the derived intra-frame prediction mode. This method is tested on ECM10.0 with a 48-frame interval under All Intra conditions, and can obtain a -0.10% BD-rate change (i.e., the average bit rate change under the same psnr) on the Y component. The method embodiment of the present application is described in detail above in conjunction with Figures 1 to 10, and the device embodiment of the present application is described in detail below in conjunction with Figures 11 to 14. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the part not described in detail can refer to the previous method embodiment. FIG11 is a schematic diagram of the structure of a decoder provided by an embodiment of the present application. The decoder 1100 of FIG11 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 the first identification information, wherein the first identification information 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 according to the first identification information, wherein the multiple search positions include non-adjacent positions in the spatial domain of the current block. The second determining unit 1130 is configured to determine the gradient information to be fused according to the multiple search positions. The third determining unit 1140 is configured to determine the prediction value of the current block according to the gradient information to be fused. In some implementations, the spatially non-adjacent positions are determined based on predefined positions. In some implementations, the predefined location is determined based on at least one of the following: The size of the current block; Predefined horizontal dimensions; Predefined vertical dimensions. In some implementations, the predefined horizontal size and / or the predefined vertical size is determined based on a size of the current block. In some implementations, the number of the plurality of search positions is greater than thirteen. In some implementations, the number of the plurality of search positions is greater than or equal to thirty-one. In some implementations, the non-adjacent positions in the spatial domain satisfy at least one of the following: The absolute value of the horizontal offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistHor+1; The absolute value of the vertical offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistVer+1; Among them, iDistHor is equal to the predefined horizontal size, and iDistVer is equal to the predefined vertical size. In some implementations, the predefined horizontal size is equal to N times the width of the current block; and / or the predefined vertical size is equal to N times the height of the current block. In some implementations, the value of N is less than or equal to 4. In some implementations, the value of N includes 1, 2, 3, and 4. In some implementations, the non-adjacent locations in the spatial domain satisfy: xNb=xTL+offsetX, and yNb=yTL+offsetY; Wherein, 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; Among them, 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 position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block. 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. In some implementations, the non-adjacent positions in the spatial domain 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; Located at the lower left of the current block. In some implementations, the gradient information to be fused is gradient information corresponding to K candidate blocks, the K candidate blocks are determined based on the multiple search positions, and K is a positive integer greater than 3. In some implementations, the value of K is greater than or equal to 5. In some implementations, the gradient information to be fused is determined based on a candidate block set determined according to the multiple search positions, and the candidate block set does not include repeated candidate blocks. In some implementations, the prediction value is determined based on target gradient information, and the target gradient information is determined based on an arithmetic average or a weighted average of the gradient information to be fused. In some implementations, the gradient information to be fused is gradient information corresponding to at least one candidate block, and the weight of the gradient information corresponding to the at least one candidate block is determined based on at least one of the following: A 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, where the target pixels are pixels required when determining gradient information in DIMD mode. In some implementations, the number of target pixels corresponding to the at least one candidate block is used to determine an 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. In some implementations, the gradient information corresponding to each candidate block in the at least one candidate block includes an amplitude corresponding to the IPM, and the amplitude corresponding to the IPM is an amplitude normalized based on the size of each candidate block. In some implementations, the value range of N is determined based on the size of the current block. In some implementations, if the size of the current block is a first size, the value range of N is a first value range; if the size of the current block is a second size, 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. In some implementations, the multiple search positions further include spatially adjacent positions of the current block; if the size of the current block is smaller than a preset size, the spatially adjacent positions do not include at least one of the following positions: A first position, corresponding to a position of 1 / 4 of the height of the current block; The second position corresponds to a position of 1 / 4 of the width of the current block; A third position, corresponding to a position of 3 / 4 of the height of the current block; A fourth position, corresponding to a position of 3 / 4 of the width of the current block; A fifth position, corresponding to a position of 1 / 2 of the height of the current block; The sixth position corresponds to a position that is 1 / 2 of the width of the current block. In some implementations, a search order among the multiple search positions is determined based on distances between the multiple search positions and the current block. In some implementations, the distances between the multiple search positions and the current block are determined based on the distances between the multiple search positions and an upper left corner position of the current block. In some implementations, the search order of the multiple search positions is based on the distances between the multiple search positions and the current block, and is sorted in order from small to large distances. In some implementations, if two of the multiple search positions have the same distance from the current block, Search the search position located on the left side of the current block among the two search positions, and then search the search position located on the upper side of the current block among the two search positions; or, if the distance between two search positions among the multiple search positions and the current block is the same, first search the search position located on the upper side of the current block among the two search positions, and then search the search position located on the left side of the current block among the two search positions. In some implementations, the gradient information to be fused is gradient information corresponding to at least one candidate block in a 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, and M is a positive integer greater than or equal to 1. In some implementations, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located on the left side of the current block among the two candidate blocks is higher than the ranking of the candidate block located above the current block among the two candidate blocks; or, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located above the current block among the two candidate blocks is higher than the ranking of the candidate block located on the left side of the current block among the two candidate blocks. 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, wherein the first distance represents the horizontal distance between the upper left corner position of the first candidate block and the upper left corner position of the current block, and the second distance represents the vertical distance between the upper left corner position of the first candidate block and the upper left corner position of the current block. 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))); Among them, xTL represents the horizontal coordinate of the upper left corner position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, xNeiTL represents the horizontal coordinate of the upper left corner position of the first candidate block, yNeiTL represents the vertical coordinate of the upper left corner position of the first candidate block, and abs represents the absolute value operation. In some implementations, the gradient information is stored in units of coding blocks, or the gradient information is stored in units of image blocks of a fixed size in the current frame. In some implementations, the size of the image block is determined based on a resolution of the current frame. In some implementations, the gradient information to be fused is 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 repeated is 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. 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, the second candidate block corresponds to a second gradient histogram, the S IPMs with the highest amplitudes in the first gradient histogram form a first set, the S IPMs with the highest amplitudes 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, and S is a positive integer greater than or equal to 1. In some implementations, the difference between the first set and the second set is determined based on at least one of: the number of identical IPMs included in the first set and the second set; A difference between a first IPM in the first set and a 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. In some implementations, if the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold, the two candidate blocks are repeated; and / or, if the difference between the first IPM and the second IPM is less than or equal to a second threshold, the two candidate blocks are repeated; and / or, if the ratio of the intersection and union of the first set and the second set is greater than or equal to a third threshold, the two candidate blocks are repeated. In some implementations, at least one of the following is determined based on the size of the current block: a number of candidate blocks in a candidate block set, the candidate block set being determined based on the plurality of search positions; The amount of gradient information to be fused; The number of IPMs used to determine the predicted value. In some implementations, the spatial non-adjacent positions are determined based on a pre-established first mapping relationship, wherein the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent positions and a coordinate of the spatial non-adjacent positions; or, the spatial non-adjacent positions are determined based on a pre-established first mapping relationship and a second mapping relationship, wherein the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent positions and a search distance, and the second mapping relationship is a mapping relationship between an index of the spatial non-adjacent positions and a search direction. In some implementations, the search distance is the distance between the spatial non-adjacent position and the upper left corner position of the current block; and / or the search direction is the direction of the spatial non-adjacent position relative to the current block. In some implementations, the gradient information is: a set of IPMs and their corresponding amplitudes; or gradient histogram information. It is understandable that in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course, it may be a module, or it may be non-modular. Moreover, the components in the present embodiment may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module. If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes. Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the decoder 1100. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the decoding method in any of the aforementioned embodiments is implemented. Based on the composition of the above-mentioned decoder 1100 and the computer-readable storage medium, refer to Figure 12, which shows a specific hardware structure diagram of the decoder 1100 provided in an embodiment of the present application. As shown in Figure 12, the decoder 1200 may include: a communication interface 1210, a memory 1220 and a processor 1230; each component is coupled together through a bus system 1240. It can be understood that the bus system 1240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1240 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 1240 in Figure 12. Among them, The communication interface 1210 is used to receive and send signals during the process of sending and receiving information with other external network elements; A memory 1220, used for storing computer programs; The processor 1230 is configured to, when running the computer program, execute: Parse the bitstream to determine first identification information, where the first identification information is used to indicate that the current block uses the DIMD fusion mode; Determine, according to the first identification information, a plurality of search positions around a current block, wherein the plurality of search positions include non-adjacent positions in a spatial domain of the current block; Determining gradient information to be fused according to the multiple search positions; Determine a prediction value of the current block according to the gradient information to be fused. It can be understood that the memory 1220 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a 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 dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM). The memory 1220 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory. The processor 1230 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1230. The above-mentioned processor 1230 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1220, and the processor 1230 reads the information in the memory 1220 and completes the steps of the above method in combination with its hardware. It is understood that the embodiments described in the present application can be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application or other electronic units or other electronic units for performing the functions described in the present application. For software implementation, the technology described in this application can be implemented by a module (such as a process, function, etc.) that performs the functions described in this application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor. Optionally, as another embodiment, the processor 1230 is further configured to execute the decoding method described in the above embodiment when running the computer program. FIG13 is a schematic diagram of the structure of an encoder provided by an embodiment of the present application. The encoder 1300 shown in FIG13 includes a first determination unit 1310, a second determination unit 1320, and a third determination unit 1330. The first determination unit 1310 is configured to determine a plurality of search positions around a current block, wherein the plurality of search positions include non-adjacent positions in the spatial domain of the current block. The second determination unit 1320 is configured to determine the gradient information to be fused based on the plurality of search positions. The third determination unit 1330 is configured to determine the prediction value of the current block based on the gradient information to be fused. In some implementations, the spatial non-adjacent position is determined based on a size of the current block. In some implementations, the number of the plurality of search positions is greater than thirteen. In some implementations, the number of the plurality of search positions is greater than or equal to thirty-one. In some implementations, the non-adjacent positions in the spatial domain satisfy at least one of the following: The absolute value of the horizontal offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistHor+1; The absolute value of the vertical offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistVer+1; Wherein, 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. In some implementations, the value of N is less than or equal to 4. In some implementations, the value of N includes 1, 2, 3, and 4. In some implementations, the non-adjacent locations in the spatial domain satisfy: xNb=xTL+offsetX, and yNb=yTL+offsetY; Wherein, 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; Among them, 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 position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block. 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. In some implementations, the non-adjacent positions in the spatial domain 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; Located at the lower left of the current block. In some implementations, the gradient information to be fused is gradient information corresponding to K candidate blocks, the K candidate blocks are determined based on the multiple search positions, and K is a positive integer greater than 3. In some implementations, the value of K is greater than or equal to 5. In some implementations, the gradient information to be fused is determined based on a candidate block set, and the candidate block set does not include repeated candidate blocks. In some implementations, the prediction value is determined based on target gradient information, and the target gradient information is determined based on an arithmetic average or a weighted average of the gradient information to be fused. In some implementations, the gradient information to be fused is gradient information corresponding to at least one candidate block, and the weight of the gradient information corresponding to the at least one candidate block is determined based on at least one of the following: A 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, where the target pixels are pixels required for determining gradient information in a DIMD mode derived in an intra-frame mode at a decoding end. In some implementations, the number of target pixels corresponding to the at least one candidate block is used to determine an 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. In some implementations, the gradient information corresponding to each candidate block in the at least one candidate block includes an amplitude corresponding to the IPM, and the amplitude corresponding to the IPM is an amplitude normalized based on the size of each candidate block. In some implementations, the value range of N is determined based on the size of the current block. In some implementations, if the size of the current block is a first size, the value range of N is a first value range; if the size of the current block is a second size, 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. In some implementations, the multiple search positions further include spatially adjacent positions of the current block; if the size of the current block is smaller than a preset size, the spatially adjacent positions do not include at least one of the following positions: A first position, corresponding to a position of 1 / 4 of the height of the current block; The second position corresponds to a position of 1 / 4 of the width of the current block; A third position, corresponding to a position of 3 / 4 of the height of the current block; A fourth position, corresponding to a position of 3 / 4 of the width of the current block; A fifth position, corresponding to a position of 1 / 2 of the height of the current block; The sixth position corresponds to a position that is 1 / 2 of the width of the current block. In some implementations, a search order among the multiple search positions is determined based on distances between the multiple search positions and the current block. In some implementations, the distances between the multiple search positions and the current block are determined based on the distances between the multiple search positions and an upper left corner position of the current block. In some implementations, the search order of the multiple search positions is based on the distances between the multiple search positions and the current block, and is sorted in order from small to large distances. In some implementations, if the distance between two of the multiple search positions and the current block is the same, the search position of the two search positions located on the left side of the current block is searched first, and then the search position of the two search positions located above the current block is searched; or, if the distance between two of the multiple search positions and the current block is the same, the search position of the two search positions located above the current block is searched first, and then the search position of the two search positions located on the left side of the current block is searched. In some implementations, the gradient information to be fused is gradient information corresponding to at least one candidate block in a 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, and M is a positive integer greater than or equal to 1. In some implementations, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located on the left side of the current block among the two candidate blocks is higher than the ranking of the candidate block located above the current block among the two candidate blocks; or, if the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located above the current block among the two candidate blocks is higher than the ranking of the candidate block located on the left side of the current block among the two candidate blocks. 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, wherein the first distance represents the horizontal distance between the upper left corner position of the first candidate block and the upper left corner position of the current block, and the second distance represents the vertical distance between the upper left corner position of the first candidate block and the upper left corner position of the current block. 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))); Among them, xTL represents the horizontal coordinate of the upper left corner position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, xNeiTL represents the horizontal coordinate of the upper left corner position of the first candidate block, yNeiTL represents the vertical coordinate of the upper left corner position of the first candidate block, and abs represents the absolute value operation. In some implementations, the gradient information is stored in units of coding blocks, or the gradient information is stored in units of image blocks of a fixed size in the current frame. In some implementations, the size of the image block is determined based on a resolution of the current frame. In some implementations, the gradient information to be fused is 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 repeated is 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. 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, the second candidate block corresponds to a second gradient histogram, the S IPMs with the highest amplitudes in the first gradient histogram form a first set, the S IPMs with the highest amplitudes 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, and S is a positive integer greater than or equal to 1. In some implementations, the difference between the first set and the second set is determined based on at least one of: the number of identical IPMs included in the first set and the second set; A difference between a first IPM in the first set and a 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. In some implementations, if the number of identical IPMs contained in the first set and the second set is greater than or equal to a first threshold, the two candidate blocks are repeated; and / or, if the difference between the first IPM and the second IPM is less than or equal to a second threshold, the two candidate blocks are repeated; and / or, if the ratio of the intersection and union of the first set and the second set is greater than or equal to a third threshold, the two candidate blocks are repeated. In some implementations, at least one of the following is determined based on the size of the current block: a number of candidate blocks in a candidate block set, the candidate block set being determined based on the plurality of search positions; The amount of gradient information to be fused; The number of IPMs used to determine the predicted value. In some implementations, the spatial non-adjacent positions are determined based on a pre-established first mapping relationship, wherein the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent positions and a coordinate of the spatial non-adjacent positions; or, the spatial non-adjacent positions are determined based on a pre-established first mapping relationship and a second mapping relationship, wherein the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent positions and a search distance, and the second mapping relationship is a mapping relationship between an index of the spatial non-adjacent positions and a search direction. In some implementations, the search distance is the distance between the spatial non-adjacent position and the upper left corner position of the current block; and / or the search direction is the direction of the spatial non-adjacent position relative to the current block. In some implementations, the gradient information is: a set of IPMs and their corresponding amplitudes; or gradient histogram information. It is understandable that in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course, it may be a module, or it may be non-modular. Moreover, the components in the present embodiment may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module. If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes. Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 1300. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the encoding method described in any one of the aforementioned embodiments. Based on the composition of the above-mentioned encoder 1300 and the computer-readable storage medium, refer to Figure 14, which shows a specific hardware structure diagram of the encoder 1400 provided in an embodiment of the present application. As shown in Figure 14, the encoder 1400 may include: a communication interface 1410, a memory 1420 and a processor 1430; each component is coupled together through a bus system 1440. It can be understood that the bus system 1440 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as bus system 1440 in Figure 14. Among them, The communication interface 1410 is used to receive and send signals during the process of sending and receiving information with other external network elements; Memory 1420, used for storing computer programs; The processor 1430 is configured to, when running the computer program, execute: Determining a plurality of search positions around a current block, the plurality of search positions including spatially non-adjacent positions of the current block; Determining gradient information to be fused according to the multiple search positions; Determine a prediction value of the current block according to the gradient information to be fused. It can be understood that the memory 1420 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access Random Access Memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1420 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory. The processor 1430 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1430. The above-mentioned processor 1430 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1420, and the processor 1430 reads the information in the memory 1420 and completes the steps of the above method in combination with its hardware. It is to be understood that these embodiments described in the present application can be implemented with 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 (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units or combinations thereof for performing functions described in the present application. For software implementation, the technology described in the present application can be implemented by the module (such as process, function, etc.) performing the functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in a processor or outside a processor. Optionally, as another embodiment, the processor 1430 is further configured to execute the encoding method in the aforementioned embodiment when running the computer program. An embodiment of the present application also provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium for storing a bit stream. The bit stream can be generated by an encoding method using an encoder, or the bit stream can be decoded by a decoding method using a decoder, wherein 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. It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments. The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments. The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments. The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A decoding method, applied to a decoder, comprising: Parse the bitstream to determine first identification information, where the first identification information is used to indicate that the current block uses the decoding-side intra-frame mode to derive the DIMD fusion mode; Determine, according to the first identification information, a plurality of search positions around a current block, wherein the plurality of search positions include non-adjacent positions in a spatial domain of the current block; Determining gradient information to be fused according to the multiple search positions; Determine the prediction value of the current block according to the gradient information to be fused.
2. The method according to claim 1, wherein: The spatial non-adjacent positions are determined based on predefined positions.
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 dimensions.
4. The method according to claim 3, wherein: The predefined horizontal size and / or the predefined vertical size are determined based on a size of the current block.
5. The method according to claim 1, wherein: The number of the plurality of search positions is greater than 13.
6. The method according to claim 1, wherein: The number of the plurality of search positions is greater than or equal to 31.
7. The method according to claim 1, wherein: The non-adjacent positions in the airspace satisfy at least one of the following: The absolute value of the horizontal offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistHor+1; The absolute value of the vertical offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistVer+1; Among them, iDistHor is equal to the predefined horizontal size, and iDistVer is equal to the predefined vertical size.
8. The method according to claim 7, wherein: The predefined horizontal size is equal to N times the width of the current block; and / or The predefined vertical size 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 positions in the airspace satisfy: xNb=xTL+offsetX, and yNb=yTL+offsetY; Wherein, 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; Among them, 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 position of the current block, yTL represents the vertical coordinate of the upper left corner position 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 positions 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; Located at the lower left of the current block.
14. The method according to claim 1, wherein: The gradient information to be fused is gradient information corresponding to K candidate blocks, the K candidate blocks are determined based on the multiple search positions, and 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 candidate block set determined according to the multiple search positions, and the candidate block set does not include repeated candidate blocks.
17. The method according to claim 1, wherein: The predicted value is determined based on target gradient information, and the target gradient information is determined based on an arithmetic average or a 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 weight of the gradient information corresponding to the at least one candidate block is determined based on at least one of the following: A 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, where the target pixels are pixels required when determining 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 an 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 a 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 an amplitude corresponding to an intra prediction mode IPM, and the amplitude corresponding to the IPM is an amplitude normalized based on the size of each candidate block.
21. The method according to claim 8, wherein: The value range of N is determined based on the size of the current block.
22. The method of claim 21, wherein: If the size of the current block is the first size, the value range of N is the first value range; If the size of the current block is the second size, the value range of N is the second value range; The first size is smaller than the second size, and the first value range is smaller than the second value range.
23. The method of claim 1, wherein: The multiple search positions also include spatially adjacent positions of the current block; If the size of the current block is smaller than a preset size, the spatially adjacent position does not include at least one of the following positions: A first position, corresponding to a position of 1 / 4 of the height of the current block; The second position corresponds to a position of 1 / 4 of the width of the current block; A third position, corresponding to a position of 3 / 4 of the height of the current block; A fourth position, corresponding to a position of 3 / 4 of the width of the current block; A fifth position, corresponding to a position of 1 / 2 of the height of the current block; The sixth position corresponds to a position that is 1 / 2 of the width of the current block.
24. The method according to claim 1, wherein: A search order among the plurality of search positions is determined based on distances between the plurality of search positions and the current block.
25. The method according to claim 24, wherein: The distances between the multiple search positions and the current block are determined based on the distances between the multiple search positions and an upper left corner position of the current block.
26. The method according to claim 24 or 25, wherein: The search order of the multiple search positions is based on the distances between the multiple search positions and the current block, and is sorted in order from small to large distances.
27. The method of claim 26, wherein: If the distances between two of the multiple search positions and the current block are the same, first search the search position located on the left side of the current block among the two search positions, and then search the search position located on the upper side of the current block among the two search positions; or, If the distance between two search positions among the multiple search positions and the current block is the same, the search position located above the current block among the two search positions is searched first, and then the search position located on the left side of the current block among the two search positions is searched.
28. The method of claim 1, wherein: The gradient information to be fused is gradient information corresponding to at least one candidate block in a 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, and M is a positive integer greater than or equal to 1.
29. The method of claim 28, wherein: If the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located on the left side of the current block among the two candidate blocks is higher than the ranking of the candidate block located on the upper side of the current block among the two candidate blocks; or, If the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located above the current block among the two candidate blocks is higher than the ranking of the candidate block located on the left side of the current block among the two candidate blocks.
30. The method of claim 28, wherein: 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, wherein the first distance represents the horizontal distance between the upper left corner position of the first candidate block and the upper left corner position of the current block, and the second distance represents the vertical distance between the upper left corner position of the first candidate block and the upper left corner position 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))); Among them, xTL represents the horizontal coordinate of the upper left corner position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, xNeiTL represents the horizontal coordinate of the upper left corner position of the first candidate block, yNeiTL represents the vertical coordinate of the upper left corner position of the first candidate block, and abs represents the absolute value operation.
32. The method of claim 1, wherein: The gradient information is stored in units of coding blocks, or the gradient information is stored in units of image blocks of a fixed size in the current frame.
33. The method of claim 32, wherein: The size of the image block is determined based on the resolution of the current frame.
34. The method of claim 16, wherein: Whether two candidate blocks in the candidate block set are repeated is 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.
35. The method of 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, the second candidate block corresponds to a second gradient histogram, the S IPMs with the highest amplitudes in the first gradient histogram form a first set, the S IPMs with the highest amplitudes 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, and S is a positive integer greater than or equal to 1.
36. The method of claim 35, wherein: The difference between the first set and the second set is determined based on at least one of: the number of identical IPMs included in the first set and the second set; A difference between a first IPM in the first set and a 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, the two candidate blocks are repeated; and / or If the difference between the first IPM and the second IPM is less than or equal to a second threshold, the two candidate blocks are repeated; and / or If the ratio of the intersection and union of the first set and the second set is greater than or equal to a third threshold, the two candidate blocks are repeated.
38. The method of claim 1, wherein: At least one of the following is determined based on the size of the current block: a number of candidate blocks in a candidate block set, the candidate block set being determined based on the plurality of search positions; The amount of gradient information to be fused; The number of IPMs used to determine the predicted value.
39. The method of claim 1, wherein: The spatial non-adjacent positions are determined based on a pre-established first mapping relationship, where the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a coordinate of the spatial non-adjacent position; or, The spatial non-adjacent position is determined based on a pre-established first mapping relationship and a second mapping relationship, wherein the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a search distance, and the second mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a search direction.
40. The method of claim 39, wherein: The search distance is the distance between the spatial non-adjacent position and the upper left corner position of the current block; and / or The search direction is the direction of the spatial non-adjacent position relative to the current block.
41. The method of claim 1, wherein: The gradient information is: A set of IPMs and their corresponding amplitudes; or, Gradient histogram information.
42. A coding method, applied to an encoder, comprising: Determining a plurality of search positions around a current block, the plurality of search positions including spatially non-adjacent positions of the current block; Determining gradient information to be fused according to the multiple search positions; Determine the prediction value of the current block according to the gradient information to be fused.
43. The method of claim 42, wherein: The spatial non-adjacent positions are determined based on predefined positions.
44. The method of 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 dimensions.
45. The method of claim 44, wherein: The predefined horizontal size and / or the predefined vertical size are determined based on a size of the current block.
46. The method of claim 42, wherein: The number of the plurality of search positions is greater than 13.
47. The method of claim 42, wherein: The number of the plurality of search positions is greater than or equal to 31.
48. The method of claim 42, wherein: The non-adjacent positions in the airspace satisfy at least one of the following: The absolute value of the horizontal offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistHor+1; The absolute value of the vertical offset between the spatial non-adjacent position and the upper left corner position of the current block is equal to iDistVer+1; Among them, iDistHor is equal to the predefined horizontal size, and iDistVer is equal to the predefined vertical size.
49. The method of claim 48, wherein: The predefined horizontal size is equal to N times the width of the current block; and / or The predefined vertical size is equal to N times the height of the current block.
50. The method of claim 49, wherein: The value of N is less than or equal to 4.
51. The method of 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 positions in the airspace satisfy: xNb=xTL+offsetX, and yNb=yTL+offsetY; Wherein, 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; Among them, 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 position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, uiWidth represents the width of the current block, and uiHeigth represents the height of the current block.
53. The method of 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 positions 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; Located at the lower left of the current block.
55. The method of claim 42, wherein: The gradient information to be fused is gradient information corresponding to K candidate blocks, the K candidate blocks are determined based on the multiple search positions, and K is a positive integer greater than 3.
56. The method of claim 55, wherein: The value of K is greater than or equal to 5.
57. The method of claim 42, wherein: The gradient information to be fused is determined based on a candidate block set, and the candidate block set does not include repeated candidate blocks.
58. The method of claim 42, wherein: The predicted value is determined based on target gradient information, and the target gradient information is determined based on an arithmetic average or a weighted average of the gradient information to be fused.
59. The method of claim 58, wherein: The gradient information to be fused is the gradient information corresponding to at least one candidate block, and the weight of the gradient information corresponding to the at least one candidate block is determined based on at least one of the following: A 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, where the target pixels are pixels required for determining gradient information in a DIMD mode derived in an intra-frame mode at a decoding end.
60. The method of claim 59, wherein: The number of target pixels corresponding to the at least one candidate block is used to determine an 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 a target weight of the gradient information corresponding to the at least one candidate block.
61. The method of claim 59 or 60, wherein: The gradient information corresponding to each candidate block in the at least one candidate block includes an amplitude corresponding to an intra prediction mode IPM, and the amplitude corresponding to the IPM is an amplitude normalized based on the size of each candidate block.
62. The method of claim 49, wherein: The value range of N is determined based on the size of the current block.
63. The method of claim 62, wherein: If the size of the current block is the first size, the value range of N is the first value range; If the size of the current block is the second size, the value range of N is the second value range; The first size is smaller than the second size, and the first value range is smaller than the second value range.
64. The method of claim 42, wherein: The multiple search positions also include spatially adjacent positions of the current block; If the size of the current block is smaller than a preset size, the spatially adjacent position does not include at least one of the following positions: A first position, corresponding to a position of 1 / 4 of the height of the current block; The second position corresponds to a position of 1 / 4 of the width of the current block; A third position, corresponding to a position of 3 / 4 of the height of the current block; A fourth position, corresponding to a position of 3 / 4 of the width of the current block; A fifth position, corresponding to a position of 1 / 2 of the height of the current block; The sixth position corresponds to a position that is 1 / 2 of the width of the current block.
65. The method of claim 42, wherein: A search order among the plurality of search positions is determined based on distances between the plurality of search positions and the current block.
66. The method of claim 65, wherein: The distances between the multiple search positions and the current block are determined based on the distances between the multiple search positions and an upper left corner position of the current block.
67. The method of claim 65 or 66, wherein: The search order of the multiple search positions is based on the distances between the multiple search positions and the current block, and is sorted in order from small to large distances.
68. The method of claim 67, wherein: If the distances between two of the multiple search positions and the current block are the same, first search the search position located on the left side of the current block among the two search positions, and then search the search position located on the upper side of the current block among the two search positions; or, If the distance between two search positions among the multiple search positions and the current block is the same, the search position located above the current block among the two search positions is searched first, and then the search position located on the left side of the current block among the two search positions is searched.
69. The method of claim 42, wherein: The gradient information to be fused is gradient information corresponding to at least one candidate block in a 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, and M is a positive integer greater than or equal to 1.
70. The method of claim 69, wherein: If the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located on the left side of the current block among the two candidate blocks is higher than the ranking of the candidate block located on the upper side of the current block among the two candidate blocks; or, If the distances between two candidate blocks among the M candidate blocks and the current block are equal, the ranking of the candidate block located above the current block among the two candidate blocks is higher than the ranking of the candidate block located on the left side of the current block among the two candidate blocks.
71. The method of claim 69, wherein: 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, wherein the first distance represents the horizontal distance between the upper left corner position of the first candidate block and the upper left corner position of the current block, and the second distance represents the vertical distance between the upper left corner position of the first candidate block and the upper left corner position of the current block.
72. The method of 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))); Among them, xTL represents the horizontal coordinate of the upper left corner position of the current block, yTL represents the vertical coordinate of the upper left corner position of the current block, xNeiTL represents the horizontal coordinate of the upper left corner position of the first candidate block, yNeiTL represents the vertical coordinate of the upper left corner position of the first candidate block, and abs represents the absolute value operation.
73. The method of claim 42, wherein: The gradient information is stored in units of coding blocks, or the gradient information is stored in units of image blocks of a fixed size in the current frame.
74. The method of claim 73, wherein: The size of the image block is determined based on the resolution of the current frame.
75. The method of claim 57, wherein: Whether two candidate blocks in the candidate block set are repeated is 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.
76. The method of 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, the second candidate block corresponds to a second gradient histogram, the S IPMs with the highest amplitudes in the first gradient histogram form a first set, the S IPMs with the highest amplitudes 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, and S is a positive integer greater than or equal to 1.
77. The method of claim 76, wherein: The difference between the first set and the second set is determined based on at least one of: the number of identical IPMs included in the first set and the second set; A difference between a first IPM in the first set and a 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 of 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, the two candidate blocks are repeated; and / or If the difference between the first IPM and the second IPM is less than or equal to a second threshold, the two candidate blocks are repeated; and / or If the ratio of the intersection and union of the first set and the second set is greater than or equal to a third threshold, the two candidate blocks are repeated.
79. The method of claim 42, wherein: At least one of the following is determined based on the size of the current block: a number of candidate blocks in a candidate block set, the candidate block set being determined based on the plurality of search positions; The amount of gradient information to be fused; The number of IPMs used to determine the predicted value.
80. The method of claim 42, wherein: The spatial non-adjacent positions are determined based on a pre-established first mapping relationship, where the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a coordinate of the spatial non-adjacent position; or, The spatial non-adjacent position is determined based on a pre-established first mapping relationship and a second mapping relationship, wherein the first mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a search distance, and the second mapping relationship is a mapping relationship between an index of the spatial non-adjacent position and a search direction.
81. The method of claim 80, wherein: The search distance is the distance between the spatial non-adjacent position and the upper left corner position of the current block; and / or The search direction is the direction of the spatial non-adjacent position relative to the current block.
82. The method of claim 42, wherein: The gradient information is: A set of IPMs and their corresponding amplitudes; or, Gradient histogram information.
83. A decoder comprising: A parsing unit configured to parse the bitstream and determine first identification information, where the first identification information is used to indicate that the current block uses a decoding-side intra-frame mode to derive a DIMD fusion mode; A first determining unit is configured to determine a plurality of search positions around a current block according to the first identification information, wherein the plurality of search positions include non-adjacent positions in a spatial domain of the current block; A second determining unit is configured to determine the gradient information to be fused according to the multiple search positions; The third determining unit is configured to determine the prediction value of the current block according to the gradient information to be fused.
84. A decoder, the decoder comprising: Memory for storing computer programs; A processor, configured to execute the method according to any one of claims 1 to 41 when running the computer program.
85. An encoder comprising: A first determining unit is configured to determine a plurality of search positions around a current block, wherein the plurality of search positions include spatial non-adjacent positions of the current block; A second determining unit is configured to determine the gradient information to be fused according to the multiple search positions; The third determining unit is configured to determine the prediction value of the current block according to the gradient information to be fused.
86. An encoder, comprising: Memory for storing computer programs; A processor for executing the method as claimed 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, and when the computer program is executed, the method according to any one of claims 1 to 41 or the method according to any one of claims 42 to 82 is implemented.
88. A non-volatile computer-readable storage medium storing a bit stream, wherein the bit stream is generated by an encoding method using an encoder, or the bit stream is decoded by a decoding method using a decoder, wherein: The decoding method is the method according to any one of claims 1 to 41, and the encoding method is the method according to any one of claims 42 to 82.
Citation Information
Patent Citations
Template matching based advanced motion vector predictor (AMVP) candidate list construction with non-adjacent candidates and AMVP index signaling
US20220312030A1
Intra-frame prediction method and apparatus, encoding method and apparatus, decoding method and apparatus, and encoder, decoder, device and medium
WO2023023914A1
Method, apparatus, and medium for video processing
WO2023040968A1
Decoder-side intra prediction mode derivation with extended angular modes
WO2023055840A1