Video coding and decoding method, device, equipment, system and storage medium
Patent Information
- Application Number
- CN202280101897.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2025-07-01
AI Technical Summary
In existing video encoding and decoding technology, the list of candidate prediction modes is not accurate enough, resulting in a decrease in prediction accuracy of the current block, which in turn affects encoding and decoding performance.
By determining N candidate weight derivation modes and attribute information of the current block, at least one candidate prediction mode is determined, and based on these modes, the first weight derivation mode and K first prediction modes of the current block are determined, and then prediction is performed to improve candidate prediction. Determination accuracy of the pattern.
It improves the prediction accuracy of the current block, improves the encoding and decoding performance, and enhances the compression efficiency of video data.
Smart Images

Figure CN120239967A_ABST
Abstract
Description
Video encoding and decoding method, device, equipment, system, and storage medium Technical Field The present application relates to the field of video coding and decoding technology, and in particular to a video coding and decoding method, device, equipment, system, and storage medium. Background Art Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smart phones, computers, e-readers or video players, etc. With the development of video technology, the amount of data included in video data is large. In order to facilitate the transmission of video data, video devices implement video compression technology to make video data more efficiently transmitted or stored. Since there is temporal or spatial redundancy in the video, prediction can eliminate or reduce the redundancy in the video and improve compression efficiency. Currently, in order to improve the prediction effect, multiple prediction modes can be used to predict the current block, for example, a candidate prediction mode list is constructed, and multiple prediction modes are selected from the candidate prediction mode list to predict the current block. However, the candidate prediction mode list currently constructed is not accurate enough, thereby reducing the prediction accuracy of the current block. Summary of the invention The embodiments of the present application provide a video encoding and decoding method, apparatus, device, system, and storage medium, which can improve the accuracy of constructing a candidate prediction mode list, improve the prediction accuracy of the current block, and thus improve the encoding and decoding performance. In a first aspect, the present application provides a video decoding method, applied to a decoder, comprising: Determine N candidate weight derivation modes, where N is a positive integer; Determine at least one candidate prediction mode based on the N candidate weight derivation modes and attribute information of the current block; Based on the N candidate weight derivation modes and the at least one candidate prediction mode, determine a first weight derivation mode and K first prediction modes corresponding to the current block, where K is a positive integer greater than 1; The current block is predicted based on the first weight derivation mode and the K first prediction modes to obtain a prediction value of the current block. In a second aspect, an embodiment of the present application provides a video encoding method, including: Determine N candidate weight derivation modes, where N is a positive integer; Determine at least one candidate prediction mode based on the N candidate weight derivation modes and attribute information of the current block; Based on the N candidate weight derivation modes and the at least one candidate prediction mode, determine a first weight derivation mode and K first prediction modes corresponding to the current block, where K is a positive integer greater than 1; The current block is predicted based on the first weight derivation mode and the K first prediction modes to obtain a prediction value of the current block. In a third aspect, the present application provides a video decoding device, which is used to execute the method in the first aspect or its respective implementations. Specifically, the device includes a functional unit for executing the method in the first aspect or its respective implementations. In a fourth aspect, the present application provides a video encoding device, which is used to execute the method in the second aspect or its respective implementations. Specifically, the device includes a functional unit for executing the method in the second aspect or its respective implementations. In a fifth aspect, a video decoder is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its implementations. In a sixth aspect, a video encoder is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the second aspect or its implementations. In a seventh aspect, a video coding and decoding system is provided, including a video encoder and a video decoder. The video decoder is used to execute the method in the first aspect or its respective implementations, and the video encoder is used to execute the method in the second aspect or its respective implementations. In an eighth aspect, a chip is provided for implementing the method in any one of the first to second aspects or their respective implementations. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the method in any one of the first to second aspects or their respective implementations. In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method of any one of the first to second aspects or any of their implementations. In a tenth aspect, a computer program product is provided, comprising computer program instructions, which enable a computer to execute the method in any one of the first to second aspects or their respective implementations. In an eleventh aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method in any one of the first to second aspects or in each of their implementations. In the twelfth aspect, a code stream is provided, which is generated based on the method of the second aspect. Optionally, the code stream includes a first index, which is used to indicate a first combination consisting of a weight derivation mode and K prediction modes, where K is a positive integer greater than 1. Based on the above technical solution, when encoding and decoding the current block, N candidate weight derivation modes are determined, and then based on the N candidate weight derivation modes and the attribute information of the current block, at least one candidate prediction mode is determined, and then based on the N candidate weight derivation modes and at least one candidate prediction mode, the first weight derivation mode and K first prediction modes corresponding to the current block are determined, and then the first weight derivation mode and K first prediction modes are used to predict the current block to obtain the prediction value of the current block. That is to say, in an embodiment of the present application, when determining at least one candidate prediction mode, the codec takes into account the weight derivation mode and the attribute information of the current block, thereby improving the accuracy of determining the candidate prediction mode, and when predicting the current block based on the accurately determined candidate prediction mode list, the prediction accuracy of the current block can be improved, and the encoding and decoding performance can be improved. BRIEF DESCRIPTION OF THE DRAWINGS FIG1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application; FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application; FIG3 is a schematic block diagram of a video decoder according to an embodiment of the present application; Figure 4 is a schematic diagram of weight allocation; Figure 5 is a schematic diagram of weight allocation; FIG6A is a schematic diagram of inter-frame prediction; FIG6B is a schematic diagram of weighted inter-frame prediction; FIG7A is a schematic diagram of intra-frame prediction; FIG7B is a schematic diagram of intra-frame prediction; 8A-8I are schematic diagrams of intra-frame prediction; FIG9 is a schematic diagram of an intra-frame prediction mode; FIG10 is a schematic diagram of an intra-frame prediction mode; FIG11 is a schematic diagram of an intra-frame prediction mode; FIG12 is a schematic diagram of a MIP; FIG13 is a schematic diagram of TIMD prediction; FIG14A is a bar graph corresponding to DIMD; FIG14B is a schematic diagram of DIMD prediction; FIG15 is a schematic diagram of a combined prediction; FIG16 is a schematic diagram of a template; FIG17A is a schematic diagram of an inter-frame plus intra-frame prediction; FIG17B is a schematic diagram of another inter-frame plus intra-frame prediction; FIG18 is a schematic diagram of adjacent blocks; FIG19 is a schematic diagram of a video decoding method flow chart provided by an embodiment of the present application; FIG20A is a schematic diagram of weight allocation; FIG20B is a schematic diagram of weight allocation; FIG21A is a schematic diagram of a template; FIG21B is a schematic diagram of deriving a template weight; FIG22A is a schematic diagram of a transition region; FIG22B is another schematic diagram of a transition region; FIG23 is a schematic diagram of a video encoding method flow chart provided in an embodiment of the present application; FIG24 is a schematic block diagram of a video decoding device provided by an embodiment of the present application; FIG25 is a schematic block diagram of a video encoding device provided by an embodiment of the present application; FIG26 is a schematic block diagram of an electronic device provided in an embodiment of the present application; Figure 27 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION The present application can be applied to the field of image coding and decoding, the field of video coding and decoding, the field of hardware video coding and decoding, the field of dedicated circuit video coding and decoding, the field of real-time video coding and decoding, etc. For example, the scheme of the present application can be combined with an audio and video coding standard (AVS), such as the H.264 / audio video coding (AVC) standard, the H.265 / high efficiency video coding (HEVC) standard, and the H.266 / versatile video coding (VVC) standard. Alternatively, the scheme of the present application can be combined with other proprietary or industry standards and operate, and the standards include ITU-TH.261, ISO / IECMPEG-1Visual, ITU-TH.262 or ISO / IECMPEG-2Visual, ITU-TH.263, ISO / IECMPEG-4Visual, ITU-TH.264 (also known as ISO / IECMPEG-4AVC), including scalable video coding (SVC) and multi-view video coding (MVC) extensions. It should be understood that the technology of the present application is not limited to any specific coding standard or technology. For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced in conjunction with Figure 1. FIG1 is a schematic block diagram of a video encoding and decoding system involved in an embodiment of the present application. It should be noted that FIG1 is only an example, and the video encoding and decoding system of the embodiment of the present application includes but is not limited to that shown in FIG1. As shown in FIG1, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is used to encode (which can be understood as compression) the video data to generate a code stream, and transmit the code stream to the decoding device. The decoding device decodes the code stream generated by the encoding device to obtain decoded video data. The encoding device 110 of the embodiment of the present application can be understood as a device with a video encoding function, and the decoding device 120 can be understood as a device with a video decoding function, that is, the embodiment of the present application includes a wider range of devices for the encoding device 110 and the decoding device 120, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle-mounted computers, etc. In some embodiments, the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via the channel 130. The channel 130 may include one or more media and / or devices capable of transmitting the encoded video data from the encoding device 110 to the decoding device 120. In one example, the channel 130 includes one or more communication media that enable the encoding device 110 to transmit the encoded video data directly to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data according to the communication standard and transmit the modulated video data to the decoding device 120. The communication medium includes a wireless communication medium, such as a radio frequency spectrum, and optionally, the communication medium may also include a wired communication medium, such as one or more physical transmission lines. In another example, the channel 130 includes a storage medium, which can store the video data encoded by the encoding device 110. The storage medium includes a variety of locally accessible data storage media, such as optical disks, DVDs, flash memories, etc. In this example, the decoding device 120 can obtain the encoded video data from the storage medium. In another example, the channel 130 may include a storage server that can store the video data encoded by the encoding device 110. In this example, the decoding device 120 can download the stored encoded video data from the storage server. Alternatively, the storage server can store the encoded video data and transmit the encoded video data to the decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc. In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113. The output interface 113 may include a modulator / demodulator (modem) and / or a transmitter. In some embodiments, the encoding device 110 may further include a video source 111 in addition to the video encoder 112 and the input interface 113 . The video source 111 may include at least one of a video acquisition device (eg, a video camera), a video archive, a video input interface, and a computer graphics system, wherein the video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data. The video encoder 112 encodes the video data from the video source 111 to generate a code stream. The video data may include one or more pictures or a sequence of pictures. The code stream contains the coding information of the picture or the sequence of pictures in the form of a bit stream. The coding information may include the coded picture data and associated data. The associated data may include a sequence parameter set (SPS for short), a picture parameter set (PPS for short) and other syntax structures. The SPS may contain parameters applied to one or more sequences. The PPS may contain parameters applied to one or more pictures. The syntax structure refers to a set of zero or more syntax elements arranged in a specified order in the code stream. The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data may also be stored in a storage medium or a storage server for subsequent reading by the decoding device 120. In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122 . In some embodiments, the decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 . The input interface 121 includes a receiver and / or a modem. The input interface 121 can receive the encoded video data through the channel 130 . The video decoder 122 is used to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123 . The display device 123 displays the decoded video data. The display device 123 may be integrated with the decoding device 120 or external to the decoding device 120. The display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices. In addition, FIG1 is only an example, and the technical solution of the embodiment of the present application is not limited to FIG1 . For example, the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding. The following is an introduction to the video encoding framework involved in the embodiments of the present application. Fig. 2 is a schematic block diagram of a video encoder involved in an embodiment of the present application. It should be understood that the video encoder 200 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 200 can be applied to image data in 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 200 reads video data, and for each frame of the video data, divides the frame into a number of coding tree units (CTUs). In some examples, CTB may be referred to as a "tree block", "largest coding unit" (LCU) or "coding tree block" (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 FIG2 , the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 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 prediction image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block. In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Since there is a strong correlation between adjacent pixels in a frame of a video, the intra-frame prediction method is used in the video coding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in a video, the inter-frame prediction method is used in the video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving the coding efficiency. The inter-frame prediction unit 211 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 frames. Inter-frame prediction uses motion information to find reference blocks from reference frames and generates prediction blocks based on the reference blocks to eliminate temporal redundancy. The frames used for inter-frame prediction can be P frames and / or B frames. P frames refer to forward prediction frames and B frames refer to bidirectional prediction frames. Inter-frame prediction uses motion information to find reference blocks from reference frames and generates prediction blocks based on the reference blocks. Motion information includes a reference frame list where the reference frame is located, a reference frame 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 interpolation filtering in the reference frame to make the required sub-pixel block. Here, the integer pixel or sub-pixel block in the reference frame found according to the motion vector is called a reference block. Some technologies will directly use the reference block as a prediction block, while some technologies will generate a prediction block based on the reference block. Reprocessing the prediction block based on the reference 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 212 only refers to the information of the same frame image to predict the pixel information in the current code image block to eliminate spatial redundancy. The frame used for intra-frame prediction can be an I frame. 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-frame prediction modes used by HEVC are Planar, DC, and 33 angle modes, for a total of 35 prediction modes. The intra-frame modes used by VVC are 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. The residual unit 220 may generate a residual block of the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate a residual block of the 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 230 may quantize the transform coefficients. The transform / quantization unit 230 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 200 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 240 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 250 may add the samples of the reconstructed residual block to the corresponding samples of one or more prediction blocks generated by the prediction unit 210 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 200 may reconstruct the pixel blocks of the CU. The loop filter unit 260 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 the pixel blocks associated with the CU. In some embodiments, the loop filter unit 260 includes a deblocking filter unit and a sample adaptive offset / adaptive loop filter (SAO / ALF) unit, wherein the deblocking filter unit is used to remove the block effect, and the SAO / ALF unit is used to remove the ringing effect. The decoded image buffer 270 may store the reconstructed pixel blocks. The inter prediction unit 211 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 212 may use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra prediction on other PUs in the same image as the CU. The entropy encoding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy-encoded data. FIG. 3 is a schematic block diagram of a video decoder according to an embodiment of the present application. 3 , the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transformation unit 330, a reconstruction unit 340, a loop filter unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components. The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the syntax elements in the bitstream that have been entropy encoded. The prediction unit 320, the inverse quantization / transformation unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data according to the syntax elements extracted from the bitstream, that is, generate decoded video data. In some embodiments, the prediction unit 320 includes an intra prediction unit 322 and an inter prediction unit 321 . The intra prediction unit 322 may perform intra prediction to generate a prediction block for the PU. The intra prediction unit 322 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 322 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 321 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 310 may parse the motion information of the PU. The inter prediction unit 321 may determine one or more reference blocks of the PU according to the motion information of the PU. The inter prediction unit 321 may generate a prediction block of the PU according to one or more reference blocks of the PU. The inverse quantization / transform unit 330 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization. After inverse quantizing the transform coefficients, the inverse quantization / transform unit 330 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 340 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 340 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 350 may perform a deblocking filtering operation to reduce blocking effects of pixel blocks associated with a CU. The video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 may use the reconstructed image in the decoded image buffer 360 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, a frame of image is divided into blocks, and for the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block. The residual unit 220 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, and 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 230 to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transformation / quantization unit 230 can be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 280 receives the quantized change coefficient output by the change quantization unit 230, and can entropy encode the quantized change coefficient and output a bit stream. For example, the entropy coding unit 280 can eliminate character redundancy according to the target context model and the probability information of the binary bit stream. At the decoding end, the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction unit 320 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 330 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 340 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 350 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 frame for inter-frame prediction for subsequent frames. 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. In the embodiment of the present application, the current block may be a current coding unit (CU) or a current prediction unit (PU), etc. Due to the need for parallel processing, an image may be divided into slices, etc., and slices in the same image may be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, and it can generally be understood that a frame is an image. In the application, the frame may also be replaced by an image or a slice, etc. The Versatile Video Coding (VVC) video codec standard currently under development has an inter-frame prediction mode called Geometric partitioning mode (GPM). The Audio Video coding Standard (AVS) video codec standard currently under development has an inter-frame prediction mode called Angular Weighted prediction (AWP). Although these two modes have different names and specific implementation forms, they have something in common in principle. It should be noted that the traditional unidirectional prediction only finds a reference block with the same size as the current block, and the traditional bidirectional prediction uses two reference blocks with the same size as the current block, and the pixel value of each point in the prediction block is the average of the corresponding positions of the two reference blocks, that is, all points in each reference block account for 50%. Bidirectional weighted prediction allows the proportions of the two reference blocks to be different, such as all points in the first reference block account for 75%, and all points in the second reference block account for 25%. But the proportions of all points in the same reference block are the same. But the proportions of all points in the same reference block are the same. Some other optimization methods, such as the use of decoder side motion vector refinement (DMVR) technology, bidirectional optical flow (BIO), etc., will cause some changes in reference pixels or predicted pixels, but have nothing to do with the principles mentioned above. BIO can also be abbreviated as BDOF. GPM or AWP also uses two reference blocks with the same size as the current block, but some pixel positions use 100% of the pixel values of the corresponding positions of the first reference block, and some pixel positions use 100% of the pixel values of the corresponding positions of the second reference block. In the boundary area or transition area, the pixel values of the corresponding positions of the two reference blocks are used in a certain proportion. The weight of the boundary area is also gradually transitioned. How these weights are specifically distributed is determined by the mode of GPM or AWP. The weight of each pixel position is determined according to the mode of GPM or AWP. Of course, in some cases, such as when the block size is very small, it may be impossible to guarantee that some pixel positions use 100% of the pixel values of the corresponding positions of the first reference block and some pixel positions use 100% of the pixel values of the corresponding positions of the second reference block in some GPM or AWP modes. It can also be considered that GPM or AWP uses two reference blocks of different sizes from the current block, that is, each takes a required part as a reference block. That is, the part with a weight not equal to 0 is used as a reference block, and the part with a weight equal to 0 is eliminated. This is an implementation problem and is not the focus of the present invention. Exemplarily, FIG4 is a weight allocation diagram, as shown in FIG4, which shows a weight allocation diagram of a GPM provided in an embodiment of the present application on a 64×64 current block of multiple partition modes, wherein GPM has 64 partition modes. FIG5 is a weight allocation diagram, as shown in FIG5, which shows a weight allocation diagram of an AWP provided in an embodiment of the present application on a 64×64 current block of multiple partition modes, wherein AWP has 56 partition modes. Regardless of FIG4 or FIG5, in each partition mode, the black area indicates that the weight value of the corresponding position of the first reference block is 0%, the white area indicates that the weight value of the corresponding position of the first reference block is 100%, and the gray area indicates that the weight value of the corresponding position of the first reference block is a certain weight value greater than 0% and less than 100% according to the different shades of color, and the weight value of the corresponding position of the second reference block is 100% minus the weight value of the corresponding position of the first reference block. GPM and AWP have different weight derivation methods. GPM determines the angle and offset for each mode, and then calculates the weight matrix for each mode. AWP first makes a one-dimensional weight line, and then uses a method similar to intra-frame angle prediction to fill the entire matrix with the one-dimensional weight line. It should be understood that in the early coding and decoding technologies, there were only rectangular division methods, whether it was the division of CU, PU or transform unit (TU). However, GPM or AWP achieved the predicted non-rectangular division effect without division. GPM and AWP use a mask of the weights of two reference blocks, that is, the weight map mentioned above. This mask determines the weights of the two reference blocks when generating the prediction block, or it can be simply understood that part of the position of the prediction block comes from the first reference block and part of the position comes from the second reference block, and the transition area (blending area) is weighted by the corresponding positions of the two reference blocks, so that the transition is smoother. GPM and AWP do not divide the current block into two CUs or PUs according to the dividing line, so the transformation, quantization, inverse transformation, inverse quantization, etc. of the residual after prediction also treat the current block as a whole. GPM uses a weight matrix to simulate the division of geometric shapes, or more precisely, the division of predictions. To implement GPM, in addition to the weight matrix, two prediction values are required, each of which is determined by one unidirectional motion information. These two unidirectional motion information come from a motion information candidate list, such as a merge motion information candidate list (mergeCandList). GPM uses two indexes in the bitstream to determine the two unidirectional motion information from the mergeCandList. Inter-frame prediction uses motion information to represent "motion". Basic motion information includes information about the reference frame (or reference picture) and information about the motion vector (MV). Commonly used bidirectional prediction uses two reference blocks to predict the current block. The two reference blocks can use a forward reference block and a backward reference block. Optionally, both are forward or both are backward. The so-called forward refers to the time corresponding to the reference frame before the current frame, and the backward refers to the time corresponding to the reference frame after the current frame. In other words, forward means that the position of the reference frame in the video is before the current frame, and backward means that the position of the reference frame in the video is after the current frame. In other words, forward means that the POC (picture order count) of the reference frame is less than the POC of the current frame, and backward means that the POC of the reference frame is greater than the POC of the current frame. In order to use bidirectional prediction, it is naturally necessary to find two reference blocks, so two sets of reference frame information and motion vector information are required. Each of these groups can be understood as a unidirectional motion information, and the two groups are combined to form a bidirectional motion information. In specific implementation, the unidirectional motion information and the bidirectional motion information can use the same data structure, but the two groups of reference frame information and motion vector information of the bidirectional motion information are both valid, while one group of reference frame information and motion vector information of the unidirectional motion information is invalid. In some embodiments, two reference frame lists are supported, denoted as RPL0 and RPL1, where RPL is the abbreviation of Reference Picture List. In some embodiments, P slice can only use RPL0, and B slice can use RPL0 and RPL1. For a slice, there are several reference frames in each reference frame list, and the codec finds a reference frame through the reference frame index. In some embodiments, the motion information is represented by the reference frame index and the motion vector. For example, for the above-mentioned bidirectional motion information, the reference frame index refIdxL0 corresponding to the reference frame list 0 and the motion vector mvL0 corresponding to the reference frame list 0, the reference frame index refIdxL1 corresponding to the reference frame list 1, and the motion vector mvL0 corresponding to the reference frame list 1 are used. Here, the reference frame index corresponding to the reference frame list 0 and the reference frame index corresponding to the reference frame list 1 can be understood as the above-mentioned reference frame information. In some embodiments, two flag bits are used to respectively indicate whether the motion information corresponding to the reference frame list 0 and the motion information corresponding to the reference frame list 0 are used, which are respectively denoted as predFlagL0 and predFlagL1. It can also be understood that predFlagL0 and predFlagL1 indicate whether the above-mentioned unidirectional motion information is "valid". Although the data structure of motion information is not explicitly mentioned, it uses the reference frame index corresponding to each reference frame list, the motion vector and the "valid" flag to represent the motion information. In some standard texts, motion information does not appear, but motion vectors are used. It can also be considered that the reference frame index and the flag of whether to use the corresponding motion information are attached to the motion vector. In this application, "motion information" is still used for the convenience of description, but it should be understood that "motion vector" can also be used to describe it. The motion information used by the current block can be saved. The subsequent coded blocks of the current frame can use the motion information of the previously coded blocks, such as adjacent blocks, according to the adjacent position relationship. This utilizes the correlation in the spatial domain, so this coded motion information is called motion information in the spatial domain. The motion information used by each block of the current frame can be saved. The subsequent coded frames can use the motion information of the previously coded frames according to the reference relationship. This utilizes the correlation in the temporal domain, so the motion information of the coded frames is called motion information in the temporal domain. The storage method of the motion information used by each block of the current frame usually uses a matrix of a fixed size, such as a 4x4 matrix, as a minimum unit, and each minimum unit stores a set of motion information separately. In this way, each time a block is coded and decoded, the minimum units corresponding to its position can store the motion information of this block. In this way, when using the motion information in the spatial domain or the motion information in the temporal domain, the motion information corresponding to the position can be directly found according to the position. If a 16x16 block uses traditional unidirectional prediction, then all 4x4 minimum units corresponding to this block store the motion information of this unidirectional prediction. If a block uses GPM or AWP, then all the minimum units corresponding to this block will determine the motion information stored in each minimum unit based on the GPM or AWP mode, the first motion information, the second motion information, and the position of each minimum unit. One method is that if the 4x4 pixels corresponding to a minimum unit all come from the first motion information, then this minimum unit stores the first motion information; if the 4x4 pixels corresponding to a minimum unit all come from the second motion information, then this minimum unit stores the second motion information. If the 4x4 pixels corresponding to a minimum unit come from both the first motion information and the second motion information, then AWP will select one of the motion information to store; GPM's approach is that if the two motion information point to different reference frame lists, then they are combined into bidirectional motion information for storage, otherwise only the second motion information is stored. Optionally, the above mergeCandList is constructed based on spatial motion information, temporal motion information, historical motion information, and some other motion information. Exemplarily, mergeCandList uses positions 1 to 5 in Figure 6A to derive spatial motion information, and uses positions 6 or 7 in Figure 6A to derive temporal motion information. Historical motion information is to add the motion information of this block to a first-in-first-out list every time a block is encoded or decoded. The adding process may require some checks, such as whether it is repeated with the existing motion information in the list. In this way, the motion information in this history-based list can be referred to when encoding and decoding the current block. In some embodiments, the syntax description of GPM is shown in Table 1: Table 1 As shown in Table 1, in merge mode, if regular_merge_flag is not 1, the current block may use CIIP or GPM. If the current block does not use CIIP, it uses GPM, which is the content shown in the syntax "if (!ciip_flag [x0] [y0])" in Table 1. As can be seen from Table 1 above, GPM needs to transmit three pieces of information in the bitstream, namely merge_gpm_partition_idx, merge_gpm_idx0, merge_gpm_idx1. x0, y0 are used to determine the coordinates (x0, y0) of the upper left corner brightness pixel of the current block relative to the upper left corner brightness pixel of the image. merge_gpm_partition_idx determines the division shape of GPM. As mentioned above, it is "simulated division". merge_gpm_partition_idx is what is referred to in this article as the weight matrix derivation mode or the index of the weight matrix derivation mode, or the weight derivation mode or the index of the weight derivation mode. merge_gpm_idx0 is the first merge candidate index. The first merge candidate index is used to determine the first motion information or the first merge candidate according to mergeCandList. merge_gpm_idx1 is the second merge candidate index. The second merge candidate index is used to determine the second motion information or the second merge candidate according to mergeCandList. If MaxNumGpmMergeCand>2, that is, the length of the candidate list is greater than 2, merge_gpm_idx1 needs to be decoded, otherwise it can be determined directly. In some embodiments, the decoding process of the GPM includes the following steps: The information input to the decoding process includes: the coordinates (xCb, yCb) of the luminance position of the upper left corner of the current block relative to the upper left corner of the image, the width cbWidth of the luminance component of the current block, the height cbHeight of the luminance component of the current block, the luminance motion vectors mvA and mvB with 1 / 16 pixel accuracy, the chrominance motion vectors mvCA and mvCB, the reference frame indexes refIdxA and refIdxB, and the prediction list flags predListFlagA and predListFlagB. Exemplarily, motion information can be represented by combining motion vector, reference frame index and prediction list flag. VVC supports 2 reference frame lists, each of which may have multiple reference frames. Unidirectional prediction uses only one reference block of one reference frame in one of the reference frame lists as a reference, and bidirectional prediction uses one reference block of each reference frame in each of the two reference frame lists as a reference. GPM in VVC uses 2 unidirectional predictions. A in the above mvA and mvB, mvCA and mvCB, refIdxA and refIdxB, predListFlagA and predListFlagB can be understood as the first prediction mode, and B can be understood as the second prediction mode. We use X to represent A or B, predListFlagX to indicate whether X uses the first reference frame list or the second reference frame list, refIdxX to indicate the reference frame index in the reference frame list used by X, mvX to indicate the luminance motion vector used by X, and mvCX to indicate the chrominance motion vector used by X. To reiterate, it can be considered that in VVC, motion vector, reference frame index and prediction list flag are combined to represent the motion information described in this article. The information output by the decoding process includes: the luminance prediction sample matrix predSamplesL of (cbWidth)X(cbHeight); the prediction sample matrix of the Cb chrominance component of (cbWidth / SubWidthC)X(cbHeight / SubHeightC), if necessary; and the prediction sample matrix of the Cr chrominance component of (cbWidth / SubWidthC)X(cbHeight / SubHeightC), if necessary. Exemplarily, the following takes the brightness component as an example, and the processing of the chrominance component is similar to that of the brightness component. Assume that the size of predSamplesLAL and predSamplesLBL is (cbWidth)X(cbHeight), which is the prediction sample matrix made according to the two prediction modes. predSamplesL is derived as follows: predSamplesLAL and predSamplesLBL are determined according to the luminance motion vectors mvA and mvB, the chrominance motion vectors mvCA and mvCB, the reference frame indexes refIdxA and refIdxB, and the prediction list flags predListFlagA and predListFlagB. That is, predictions are made according to the motion information of the two prediction modes respectively, and the detailed process will not be repeated. Usually GPM is merge mode, and it can be considered that the two prediction modes of GPM are merge modes. According to merge_gpm_partition_idx[xCb][yCb], use Table 2 to determine the GPM partition angle index variable angleIdx and distance index variable distanceIdx. Table 2 – Correspondence between angleIdx and distanceIdx and merge_gpm_partition_idx merge_gpm_partition_idx0123456789101112131415angleIdx0022223333444455distanceIdx1301230123012301merge_gpm_partitio n_idx16171819202122232425262728293031angleIdx5588111111111212121213131313distanceIdx2313012301230123merge_gpm_parti tion_idx32333435363738394041424344454647angleIdx14141414161618181819191920202021distanceIdx0123131231231231merge_g pm_partition_idx48495051525354555657585960616263angleIdx21212424272727282828292929303030distanceIdx2313123123123123 It should be noted that because all three components (such as Y, Cb, Cr) can use GPM, some standard texts divide the process of generating the prediction sample matrix of GPM from one component into a sub-process, namely the weighted prediction process of GPM (Weighted sample prediction process for geometric partitioning mode). All three components will call this process, but the parameters of the call are different. Here, only the brightness component is used as an example. The prediction matrix predSamplesL[xL][yL] of the current brightness block (where xL = 0..cbWidth–1, yL = 0..cbHeight-1) is derived from the weighted prediction process of GPM. Among them, nCbW is set to cbWidth, nCbH is set to cbHeight, and the prediction sample matrices predSamplesLAL and predSamplesLBL made by the two prediction modes, as well as angleIdx and distanceIdx are used as input. In some embodiments, the weighted prediction derivation process of the GPM includes the following steps: The inputs of this process are: the width of the current block nCbW, the height of the current block nCbH; 2 (nCbW)X(nCbH) prediction sample matrices predSamplesLA and predSamplesLB; GPM division angle index variable angleIdx; GPM distance index variable distanceIdx; component index variable cIdx. This example takes brightness as an example, so the above cIdx is 0, indicating the brightness component. The output of this process is: (nCbW)X(nCbH) GPM prediction sample matrix pbSamples. For example, the variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip and shiftHor are derived as follows: nW=(cIdx==0)? nCbW:nCbW*SubWidthC; nH=(cIdx==0)? nCbH:nCbH*SubHeightC; shift1 = Max(5,17-BitDepth), where BitDepth is the bit depth of the codec; offset1=1<<(shift1-1), where “<<” means left shift; displacementX = angleIdx; displacementY=(angleIdx+8)%32; partFlip=(angleIdx>=13&&angleIdx<=27)? 0:1; shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))? 0:1. The variables offsetX and offsetY are derived as follows: When the value of shiftHor is 0: offsetX=(-nW)>>1, offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3)). When the value of shiftHor is 1: offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3), offsetY=(-nH)>>1. The variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*SubWidthC, yL=(cIdx==0)? y:y*SubHeightC, The variable wValue representing the weight of the prediction sample at the current position is derived as follows: wValue is the weight of the prediction value predSamplesLA[x][y] of the prediction matrix of the first prediction mode at point (x, y), and (8-wValue) is the weight of the prediction value predSamplesLB[x][y] of the prediction matrix of the second prediction mode at point (x, y). The distance matrix disLut is determined according to Table 3: Table 3 idx02345681011121314disLut[idx]8884420-2-4-4-8-8idx161819202122242627282930disLut[idx]-8-8-8-4-4-2024488 weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY], weightIdxL=partFlip? 32+weightIdx:32–weightIdx, wValue=Clip3(0,8,(weightIdxL+4)>>3), The predicted sample values pbSamples[x][y] are derived as follows: pbSamples[x][y]=Clip3(0,(1<<BitDepth)-1,(predSamplesLA[x][y]*wValue+predSamplesLB[x][y]*(8-wValue)+offset1)> >shift1). It should be noted that a weight value is derived for each position of the current block, and then a predicted value pbSamples[x][y] of GPM is calculated. Because of this method, the weight wValue does not have to be written in the form of a matrix, but it can be understood that if the wValue of each position is saved in a matrix, it is a weight matrix. The principle is the same for calculating the weight of each point separately and weighting it to obtain the predicted value of GPM, or calculating all the weights and then uniformly weighting them to obtain the predicted sample matrix of GPM. The term weight matrix is used in many descriptions of this application to make the expression easier to understand, and it is more intuitive to draw pictures with weight matrices. In fact, it can also be described according to the weight of each position. For example, the weight matrix export mode can also be referred to as the weight export mode. In some embodiments, as shown in FIG6B , the decoding process of GPM can be described as follows: parsing the bitstream, determining whether the current block uses the GPM technology; if the current block uses the GPM technology, determining the weight derivation mode (or the division mode or the weight matrix derivation mode), and the first motion information and the second motion information. Determine the first prediction block according to the first motion information, determine the second prediction block according to the second motion information, determine the weight matrix according to the weight matrix derivation mode, and determine the prediction block of the current block according to the first prediction block, the second prediction block and the weight matrix. The intra-frame prediction method uses the reconstructed pixels that have been coded and decoded around the current block as reference pixels to predict the current block. Figure 7A is a schematic diagram of intra-frame prediction. As shown in Figure 7A, the size of the current block is 4x4, and the pixels in one row to the left and one column above the current block are the reference pixels of the current block. Intra-frame prediction uses these reference pixels to predict the current block. These reference pixels may all be available, that is, all have been coded and decoded. Some may also be unavailable, for example, the current block is the leftmost of the entire frame, then the reference pixels on the left of the current block are unavailable. Or when encoding and decoding the current block, the lower left part of the current block has not been coded and decoded, then the reference pixels on the lower left are also unavailable. For the case where reference pixels are unavailable, available reference pixels or certain values or certain methods can be used for filling, or no filling can be performed. FIG7B is a schematic diagram of intra prediction. As shown in FIG7B , the multiple reference line intra prediction method (MRL) can use more reference pixels to improve encoding and decoding efficiency, for example, using 4 reference rows / columns as reference pixels of the current block. Furthermore, there are multiple prediction modes for intra-frame prediction. FIG8A-5I is a schematic diagram of intra-frame prediction. As shown in FIG8A-5I, intra-frame prediction for 4x4 blocks in H.264 can mainly include 9 modes. Among them, mode 0 as shown in FIG8A copies the pixels above the current block to the current block in a vertical direction as a prediction value, mode 1 as shown in FIG8B copies the reference pixels on the left to the current block in a horizontal direction as a prediction value, mode 2 DC as shown in FIG8C uses the average value of the eight points A to D and I to L as the prediction value of all points, and modes 3 to 8 as shown in FIG8D-5I copy the reference pixels to the corresponding positions of the current block at a certain angle, because some positions of the current block cannot correspond exactly to the reference pixels, and may need to use the weighted average value of the reference pixels, or the sub-pixels of the interpolated reference pixels. In addition, there are Plane, Planar and other modes, and with the development of technology and the expansion of blocks, there are more and more angle prediction modes. Figure 9 is a schematic diagram of the intra-frame prediction mode. As shown in Figure 9, the intra-frame prediction modes used by HEVC include Planar, DC and 33 angle modes, a total of 35 prediction modes. Figure 10 is a schematic diagram of the intra-frame prediction mode. As shown in Figure 10, the intra-frame modes used by VVC include Planar, DC and 65 angle modes, a total of 67 prediction modes. Figure 11 is a schematic diagram of the intra-frame prediction mode. As shown in Figure 11, VS3 uses DC, Plane, Bilinear, PCM and 62 angle modes, a total of 66 prediction modes. There are also some technologies to improve the prediction, such as improving the pixel-by-pixel interpolation of reference pixels and filtering the predicted pixels. For example, the multiple intra prediction filter (MIPF) in AVS3 uses different filters to generate prediction values for different block sizes. For pixels at different positions in the same block, one filter is used to generate prediction values for pixels closer to the reference pixel, and another filter is used to generate prediction values for pixels farther from the reference pixel. Technologies for filtering predicted pixels, such as the intra prediction filter (IPF) in AVS3, can use reference pixels to filter the predicted values. In intra-frame prediction, the intra-frame mode coding technology of the Most Probable Modes List (MPM) can be used to improve the coding efficiency. A mode list is formed by using the intra-frame prediction modes of the surrounding coded blocks, and the intra-frame prediction modes derived from the intra-frame prediction modes of the surrounding coded blocks, such as adjacent modes, and some commonly used or highly probable intra-frame prediction modes, such as DC, Planar, Bilinear modes, etc. The intra-frame prediction modes of the surrounding coded blocks are referenced to utilize spatial correlation. Because the texture has a certain degree of continuity in space. MPM can be used as a prediction of the intra-frame prediction mode. That is, it is considered that the probability of using MPM for the current block is higher than the probability of not using MPM. Therefore, when binarizing, fewer codewords will be used for MPM, thereby saving overhead to improve coding efficiency. In some embodiments, matrix-based intra prediction (MIP), sometimes also written as Matrix weighted intra prediction, can be used for intra prediction. As shown in FIG. 12 , in order to predict a block with a width of W and a height of H, MIP requires H reconstructed pixels in a column on the left side of the current block and W reconstructed pixels in a row on the upper side of the current block as input. MIP generates a prediction block in the following three steps: reference pixel averaging, matrix multiplication, and interpolation. Among them, matrix multiplication is the core of MIP. MIP can be considered as a process of generating a prediction block using input pixels (reference pixels) in a matrix multiplication manner. MIP provides a variety of matrices, and the difference in prediction methods is reflected in the difference in matrices. The same input pixel will get different results using different matrices. The process of reference pixel averaging and interpolation is a design that compromises performance and complexity. For blocks of larger size, an effect similar to downsampling can be achieved by averaging reference pixels, so that the input can be adapted to a relatively small matrix, while interpolation achieves an upsampling effect. In this way, there is no need to provide a MIP matrix for each block size, but only one or several matrices of specific sizes are provided. With the increasing demand for compression performance and the improvement of hardware capabilities, more complex MIPs may appear in the next generation of standards. MIP is somewhat similar to planar, but it is obviously more complex and more flexible than planar. In some embodiments, the intra prediction technology of Template-based Intra Mode Derivation (TIMD) can be used. Exemplarily, as shown in FIG13, for the current block, an area on its left and upper side is used as a template. Except for the boundary case, when encoding and decoding the current block, the left and upper sides of the current block can theoretically obtain the reconstructed value. This is also the basis of many template adaptation methods. TIMD uses the left and upper areas of the current block shown in FIG13 as templates, and the pixels in the left and upper areas of the template are used as reference pixels of the template. The decoder can use a certain intra prediction mode to predict on the template, and compare the predicted value with the reconstructed value to obtain the cost of the intra prediction mode on the template. For example, SAD, SATD, SSE, etc. Since the template and the current block are adjacent and they are correlated, the performance of a prediction mode on the template can be used to estimate its performance on the current block. TIMD predicts some candidate intra prediction modes on the template, obtains their costs on the template, and replaces one or two intra prediction modes with the lowest cost as the intra prediction value of the current block. Research has found that if the cost difference between two intra-frame prediction modes on the template is not large, weighted averaging of the prediction values of the two intra-frame prediction modes can improve compression performance. The weights of the prediction values of the two prediction modes are related to the above-mentioned cost. In some embodiments, the weight is inversely proportional to the cost. In general, TIMD uses the prediction effect of the intra-frame prediction mode on the template to select the intra-frame prediction mode, and can weight the two intra-frame prediction modes according to the cost on the template. The advantage of TIMD is that if the current block selects the TIMD mode, it does not need to indicate which specific intra-frame prediction mode is used, but is derived by the decoder itself through the above process, which saves overhead to a certain extent. In some embodiments, the intra prediction technology of decoder-side Intra Mode Derivation (DIMD) can be used. DIMD also uses the reconstructed pixels on the left and top sides of the current block to derive the prediction mode, but it does not predict on the template, but analyzes the gradient of the reconstructed pixels. As shown in Figure 14A, DIMD analyzes the gradient of the center point of the window, adapts an intra prediction mode according to its gradient, and analyzes all the points that need to be checked to obtain a result similar to the bar graph in Figure 14A. Of course, the so-called bar graph is just to help understanding, and it can be implemented in a variety of simple forms. In some embodiments, DIMD selects the two highest intra prediction modes in the bar graph, plus the planar mode, and the prediction values of the three intra prediction modes are weighted, and the weights are related to the results of the analysis. In one example, the prediction process of DIMD is shown in FIG14B , where the two highest intra-frame prediction modes in the bar graph are selected, namely, the intra-frame prediction modes corresponding to M1 and M2, respectively, plus the planar mode, for a total of three intra-frame prediction modes. The weights ω1, ω2, and ω3 corresponding to the three intra-frame prediction modes are determined, and the prediction values Pred1, Pred2, and Pred3 corresponding to the three intra-frame prediction modes are determined. Based on the weights corresponding to the three intra-frame prediction modes, the prediction values corresponding to the three intra-frame prediction modes are weighted to obtain the final prediction block. As can be seen from the above, DIMD uses the gradient analysis of reconstructed pixels to select intra prediction modes, and can weight two intra prediction modes plus planar according to the analysis results. The advantage of DIMD is that if the current block selects the DIMD mode, it does not need to indicate which intra prediction mode is used, but is derived by the decoder itself through the above process, which saves overhead to a certain extent. TIMD and DIMD have many similarities, and even in some embodiments, their names are reversed. They both support weighting of prediction values of 2 or more intra-frame prediction modes. GPM combines two inter prediction blocks using a weight matrix. In fact, it can be extended to combine two arbitrary prediction blocks, such as two inter prediction blocks, two intra prediction blocks, one inter prediction block and one intra prediction block. Even in screen content coding, you can use IBC (intra block copy) or palette prediction blocks as one or two prediction blocks. This application refers to intra-frame, inter-frame, IBC, and palette as different prediction methods. For the sake of convenience, a term called prediction mode is used here. The prediction mode can be understood as the information based on which the codec can generate a prediction block of the current block. For example, in intra-frame prediction, the prediction mode can be a certain intra-frame prediction mode, such as DC, Planar, various intra-frame angle prediction modes, etc. Of course, one or some auxiliary information can also be superimposed, such as the optimization method of intra-frame reference pixels, the optimization method after generating the preliminary prediction block (such as filtering), etc. For example, in inter-frame prediction, the prediction mode can be skip mode, merge mode or MMVD (merge with motion vector difference) mode, or AMVP (advanced motion vector predition), which can be unidirectional prediction, bidirectional prediction, or multi-hypothesis prediction. If the inter-frame prediction mode uses unidirectional prediction, a prediction mode must also be able to determine a motion information, and the prediction block can be determined based on the motion information. If the inter-frame prediction mode uses bidirectional prediction, a prediction mode must also be able to determine two pieces of motion information, and the prediction block can be determined based on the two pieces of motion information. The information that GPM needs to determine can be expressed as 1 weight derivation mode and 2 prediction modes. The weight derivation mode is used to determine the weight matrix or weight, and the 2 prediction modes respectively determine a prediction block or prediction value. The weight derivation mode is also called the partition mode in some places. But because it is a simulated partition, this application calls it the weight derivation mode. Optionally, the two prediction modes may come from the same or different prediction methods, where the prediction methods include but are not limited to intra-frame prediction, inter-frame prediction, IBC, and palette. A specific example is as follows: If the current block uses GPM. This example is used in inter-coded blocks, allowing the use of merge mode in intra-frame prediction and inter-frame prediction. As shown in Table 4, a syntax element intra_mode_idx is added to indicate which prediction mode is the intra-frame prediction mode. For example, intra_mode_idx is 0, indicating that both prediction modes are inter-frame prediction modes, that is, mode0IsInter is 1 and mode0IsInter is 1; intra_mode_idx is 1, indicating that the first prediction mode is the intra-frame prediction mode and the second prediction mode is the inter-frame prediction mode, that is, mode0IsInter is 0 and mode0IsInter is 1; intra_mode_idx is 2, indicating that the first prediction mode is the inter-frame prediction mode and the second prediction mode is the intra-frame prediction mode, that is, mode0IsInter is 1 and mode0IsInter is 0; intra_mode_idx is 3, indicating that both prediction modes are intra-frame prediction modes, that is, mode0IsInter is 0 and mode0IsInter is 0. Table 4 In some embodiments, as shown in FIG15 , the decoding process of GPM can be described as follows: parsing the bitstream to determine whether the current block uses the GPM technology; if the current block uses the GPM technology, determining the weight derivation mode (or the partitioning mode or the weight matrix derivation mode), and the first prediction mode and the second prediction mode. Determine the first prediction block according to the first prediction mode, determine the second prediction block according to the second prediction mode, determine the weight matrix according to the weight matrix derivation mode, and determine the prediction block of the current block according to the first prediction block, the second prediction block and the weight matrix. The template matching method was first used in inter-frame prediction. It uses the correlation between adjacent pixels and takes some areas around the current block as templates. When the current block is encoded and decoded, its left and upper sides have been encoded and decoded according to the encoding order. Of course, when the existing hardware decoder is implemented, it is not necessarily guaranteed that when the current block starts to be decoded, its left and upper sides have been decoded. Of course, this refers to inter-frame blocks. For example, in HEVC, when the inter-frame coded block generates a prediction block, the surrounding reconstructed pixels are not required, so the prediction process of the inter-frame block can be carried out in parallel. However, the intra-frame coded block must use the reconstructed pixels on the left and upper sides as reference pixels. Theoretically, the left and upper sides are available, which means that the hardware design can be adjusted accordingly. Relatively speaking, the right and lower sides are not available under the current standard such as VVC encoding order. As shown in FIG16 , the rectangular areas on the left and upper sides of the current block are set as templates. The height of the template on the left is generally the same as the height of the current block, and the width of the template on the upper side is generally the same as the width of the current block, but they can also be different. The best matching position of the template is found in the reference frame to determine the motion information or motion vector of the current block. This process can be roughly described as starting from a starting position in a certain reference frame and searching within a certain range around. The search rules can be pre-set, such as the search range and search step length. Each time a position is moved to, the matching degree between the template corresponding to the position and the template around the current block is calculated. The so-called matching degree can be measured by some distortion costs, such as SAD (sum of absolute difference), SATD (sum of absolute transformed difference). Generally, the transformation used by SATD is Hadamard transformation, MSE (mean-square error), etc. The smaller the value of SAD, SATD, MSE, etc., the higher the matching degree. The cost is calculated using the prediction block of the template corresponding to the position and the reconstructed block of the template around the current block. In addition to searching at the integer pixel position, the sub-pixel position can also be searched, and the motion information of the current block is determined based on the position with the highest degree of matching. By using the correlation between adjacent pixels, the motion information suitable for the template may also be the appropriate motion information for the current block. Of course, the template matching method may not necessarily be applicable to all blocks, so some methods can be used to determine whether the current block uses the above template matching method, such as using a control switch in the current block to indicate whether the template matching method is used. This template matching method is called DMVD (decoder side motion vector derivation). Both the encoder and the decoder can use the template to search to derive motion information or find better motion information based on the original motion information. It does not need to transmit specific motion vectors or motion vector differences, but the encoder and decoder both perform the same regular search to ensure the consistency of encoding and decoding. The template matching method can improve compression performance, but it also requires "searching" in the decoder, which brings a certain degree of decoder complexity. The above is a method for applying template matching between frames. The template matching method can also be used within a frame, for example, using a template to determine an intra-frame prediction mode. For the current block, the area within a certain range on the upper and left sides of the current block can also be used as a template, such as the rectangular area on the left and the rectangular area on the upper side as shown in the above figure. When encoding and decoding the current block, the reconstructed pixels in the template are available. This process can be roughly described as determining a set of candidate intra-frame prediction modes for the current block, and the candidate intra-frame prediction modes constitute a subset of all available intra-frame prediction modes. Of course, the candidate intra-frame prediction mode can be the full set of all available intra-frame prediction modes. This can be determined based on the trade-off between performance and complexity. The set of candidate intra-frame prediction modes can be determined based on MPM or some rules, such as equal-interval screening. Calculate the cost of each candidate intra-frame prediction mode on the template, such as SAD, SATD, MSE, etc. Use the mode to predict on the template to make a prediction block, and calculate the cost using the prediction block and the reconstructed block of the template. A mode with a low cost may be more compatible with the template. By using the similarity between adjacent pixels, an intra-frame prediction mode that performs well on the template may also be an intra-frame prediction mode that performs well on the current block. Select one or several modes with a low cost. Of course, the above two steps can be repeated. For example, after selecting one or several modes with a low cost, the set of candidate intra-frame prediction modes is determined again, and the cost of the newly determined candidate intra-frame prediction mode set is calculated again, and one or several modes with a low cost are selected. This can also be understood as rough selection and fine selection. The final selected intra-frame prediction mode is determined as the intra-frame prediction mode of the current block, or the final selected intra-frame prediction modes are used as candidates for the intra-frame prediction mode of the current block. Of course, the candidate intra-frame prediction mode set can also be sorted by the template matching method alone, such as sorting the MPM list, that is, the modes in the MPM list are predicted on the template and the cost is determined, and sorted from small to large cost. Generally, the mode at the front of the MPM list has a smaller overhead in the bitstream, which can also achieve the purpose of improving compression efficiency. The template matching method can be used to determine the two prediction modes of GPM. If the template matching method is used for GPM, one control switch can be used to control whether the two prediction modes of the current block use template matching, or two control switches can be used to control whether the two prediction modes use template matching respectively. Another aspect is how to use template matching. For example, if GPM is used in merge mode, such as GPM in VVC, it uses merge_gpm_idxX to determine a motion information from mergeCandList, where uppercase X is 0 or 1. For the Xth motion information, one method is to optimize it based on the above motion information using the template matching method. That is, according to merge_gpm_idxX, a motion information is determined from mergeCandList. If template matching is used for the motion information, then the template matching method is used to optimize it based on the above motion information. Another method is not to use merge_gpm_idxX to determine a motion information from mergeCandList, but to directly search based on a default motion information to determine a motion information. If the Xth prediction mode is an intra prediction mode, and the Xth prediction mode of the current block uses the template matching method, then the template matching method can be used to determine an intra prediction mode, and there is no need to indicate the index of the intra prediction mode in the bitstream. Alternatively, the template matching method is used to determine a candidate set or MPM list, and the index of the intra prediction mode needs to be indicated in the bitstream. In a GPM intra-frame plus inter-frame prediction method, the prediction value of GPM is obtained by weighting an intra-frame prediction value and an inter-frame prediction value with the weight of the GPM mode. The prediction mode information (motion information) of the inter-frame prediction is similar to the derivation method in the VVC standard, and the prediction mode of the intra-frame prediction needs to construct an intra-frame prediction mode candidate list for the corresponding part of the GPM mode, and the list can also be called an MPM list. The encoder writes the intra-frame prediction mode index selected by the current block into the bitstream, and the decoder uses the same method to construct the MPM list for the GPM mode during decoding, and determines the intra-frame prediction mode according to the intra-frame prediction mode index obtained by decoding. Exemplarily, the corresponding part of the GPM mode can be understood as the white part or the black part in the division diagram of Figure 4 or Figure 5, and can be referred to as the first part and the second part for convenience of expression. An example is that the first part is the white part and the second part is the black part. The first part corresponds to the first prediction mode, and the second part corresponds to the second prediction mode. The first part and the second part are more intuitive and convenient to understand, but in fact they may not appear in the specific algorithm. When constructing the MPM list of the intra-frame prediction mode corresponding to the GPM mode, the following types of intra-frame prediction modes are added to the MPM list in order until the list length reaches 3: 1. Intra-frame prediction mode parallel to the GPM dividing line; 2. Intra-frame prediction mode derived from DIMD; 3. Intra-frame prediction mode derived from TIMD; 4. Intra-frame prediction mode of adjacent blocks; 5. Intra-frame prediction mode perpendicular to the GPM dividing line; 6.PLANAR mode. Among them, the intra-frame prediction mode parallel to the GPM dividing line is shown in FIG. 17A, and the intra-frame prediction mode perpendicular to the GPM dividing line is shown in FIG. 17B. The current specific implementation is to determine the angle index angleIdx of the GPM division according to the GPM mode, construct a lookup table corresponding to angleIdx and the intra-frame prediction mode, and determine the intra-frame prediction mode parallel to the GPM dividing line from the lookup table according to angleIdx. The perpendicular intra-frame prediction mode is calculated using the parallel intra-frame prediction mode. In some embodiments, when the intra prediction mode of the adjacent blocks is used, the intra prediction modes of up to 5 adjacent blocks are used, and the positions of the 5 adjacent blocks are shown in Figure 18. Let the coordinates of the upper left corner of the current block be (x0, y0), the width of the current block be width, and the height of the current block be height. The 5 adjacent blocks are adjacent block AL determined by the coordinates (x0-1, y0-1), adjacent block A determined by (x0+width-1, y0-1), adjacent block AR determined by (x0+width, y0-1), adjacent block L determined by (x0-1, y0+height-1), and adjacent block BL determined by (x0-1, y0+height). According to whether the intra prediction mode corresponds to the first part or the second part, and the angle index angleIdx corresponding to the GPM mode, the range of the available adjacent blocks is determined by looking up Table 5 below: Table 5 Angle index 02345811121314 First part AAAAL+AL+AL+AL+AAA Second part L+AL+AL+ALLLLL+AL+AL+A Angle index 16181920212427282930 First part AAAAL+AL+AL+AL+AAA Second part L+AL+AL+ALLLLL+AL+AL+A In Table 5, A can be understood as the neighboring block on the upper side of the current block, and L can be understood as the neighboring block on the left side of the current block. If A is obtained by looking up Table 5, the intra-frame prediction mode of the neighboring block A and the intra-frame prediction mode of the neighboring block AR can be used. If L is obtained by looking up the table, the intra-frame prediction mode of the neighboring block L and the intra-frame prediction mode of the neighboring block BL can be used. If L+A is obtained by looking up the table, the intra-frame prediction mode of the neighboring blocks A, AR, L, and BL can be used. The prediction mode of the neighboring block AL is always available. The order of checking neighboring blocks is L->A->BL->AR->AL. As can be seen from the above, GPM has three elements, a weight matrix and two prediction modes. The advantage of GPM is that it can achieve more autonomous combinations through the weight matrix. On the other hand, GPM needs to determine more information, so it needs to pay a greater overhead in the bitstream. Taking GPM as an example, GPM is optionally used in merge mode. In the bitstream, merge_gpm_partition_idx, merge_gpm_idx0, merge_gpm_idx1 are used to determine the weight matrix, the first prediction mode and the second prediction mode. The weight matrix and the two prediction modes each have multiple possible choices. For example, the weight matrix in VVC has 64 possible choices. And merge_gpm_idx0 and merge_gpm_idx1 each allow a maximum of 6 possible choices in VVC. Of course, VVC stipulates that merge_gpm_idx0 and merge_gpm_idx1 are not repeated. Then such a GPM has 65x6x5 possible choices. If MMVD is used to optimize two motion information (prediction modes), multiple possible choices can be provided for each prediction mode. This number is quite large. On the other hand, it can be found that the template matching method can also be used to optimize two motion information (prediction modes), which also provides more possible choices. Even this method of optimizing two motion information (prediction modes) by template matching, according to the current status of technological evolution, requires a block-level switch to indicate whether to use it for the current block. If GPM uses two intra prediction modes, each of which can use 67 common intra prediction modes in VVC, and the two intra prediction modes are different, there are also 64X67X66 possible choices. Of course, in order to save costs, each prediction mode can be limited to only a subset of all common intra prediction modes, but this still has many possible choices. If GPM uses 1 intra prediction mode and 1 inter prediction mode, the situation can be deduced based on the above intra prediction mode and inter prediction mode cases. In some embodiments, the indications of 1 weight derivation mode and 2 prediction modes of GPM are written into the bitstream and parsed using respective syntax elements. That is, 1 weight derivation mode has its own one or more syntax elements, the first prediction mode has its own one or more syntax elements, and the second prediction mode has its own one or more syntax elements. Of course, the standard can restrict that the second prediction mode cannot be the same as the first prediction mode in some cases, or certain optimization methods can be used in 2 prediction modes at the same time (this can also be understood as being used in the current block), but the three are relatively independent in the writing and parsing of syntax elements. The so-called relative independence can also be understood as having a certain correlation, but other possible choices after removing the restrictions are still independent. For events with equal probability, it is more appropriate to use fixed-length coding. For situations where the probability is obviously high and low, using short codes for high-probability events and long codes for low-probability events can improve coding efficiency. For the two different dimensional modes of weight derivation mode and prediction mode, their probability estimates are separated from each other. Since a weight derivation mode and two prediction modes jointly generate a prediction block, this prediction block acts on the current block. They are related to each other. For example, the current block contains the edges of two objects in relative motion, which is an ideal scenario for inter-frame GPM. In theory, this "division" should occur at the edge of the object, but in reality, there are limited possibilities for "division" and it is impossible to cover any edge. Sometimes similar "divisions" are selected, so there may be more than one similar "division". The selection depends on which "division" is the best result when combined with the two prediction modes. Similarly, the selection of which prediction mode sometimes also depends on which combination is the best, because even in the part where the prediction mode is used, for natural video, this part is difficult to completely match the current block, and the final selection may be the one with the highest coding efficiency. Another place where GPM is used more is when the current block contains a part of an object with relative motion. For example, in places where the swing of an arm causes distortion and deformation, such "division" is more vague, and it may ultimately depend on which combination is the best result. Another scenario is intra-frame prediction. Since the texture of some parts of natural images is very complex, some parts have a gradient from one texture to another, and some parts may not be able to be described in a simple direction, intra-frame GPM can provide more complex prediction blocks, and intra-frame encoded blocks usually have larger residuals than inter-frame encoded blocks under the same quantization. The choice of which prediction mode may ultimately depend on which combination produces the best result. The word "combination" has been mentioned many times above, which means that the weight derivation mode and prediction mode can be selected not by two or three dimensions, but by combining them and selecting a combination of the weight derivation mode and the prediction mode. This is reflected in the syntax element, that is, a "combination" syntax element is used, and based on this combination, the weight derivation mode and two prediction modes can be determined. That is to say, the encoder and decoder can generate the same N candidate combinations respectively. For example, the encoder and decoder can construct a list of N candidate combinations, and each candidate combination can derive a combination of 1 weight derivation mode and 2 prediction modes. In the bitstream, the encoder only needs to write which candidate combination is finally selected, and the decoder parses which candidate combination the encoder finally selected. In this application, this list is called the GPM combination candidate list or candidate combination list. In one example, the GPM combination candidate list is roughly arranged from large to small according to the probability of this combination being selected. Then, for the candidate combinations ranked in the front, a shorter codeword can be used than the existing method. On the other hand, for some combinations with a very low probability of being selected, a longer codeword is used. This improves the overall coding efficiency. Since the existing method is divided into three parts, in theory, the method of this scheme can achieve greater flexibility and it is easier to approximate the most effective probability and the correspondence of the codeword. Of course, as mentioned earlier, in some cases, the number of possible combinations of GPM is quite large. In order to represent a large number of candidates, longer codewords are required. However, if some combinations with a low probability of occurrence can be excluded in advance, the cost of combinations with a high probability of occurrence can be reduced. Of course, the existing method can also exclude situations with a low probability of occurrence according to each part, but the combination method is more flexible. For example, if the existing method excludes a "partition", then all possibilities of this "partition" are excluded. Another benefit is that this can make the grammar simpler. There is no need to judge various situations during parsing. As for how to encode gpm_cand_idx, it is mentioned above that this is related to their probabilities. An example is to use Exponential-Golomb coding. If the number of candidates is relatively small, it can be understood that only a few modes with the highest probability can be selected. Fixed-length codes can also be used. For example, if there are only 16 candidates, the 16 candidates are uniformly coded with bit lengths. For blocks of different sizes, different numbers of candidate combinations can be set. For example, for smaller blocks, similar weight derivation modes or prediction modes have little effect on the prediction results, while for larger blocks, similar weight derivation modes or prediction modes have a more obvious effect on the prediction results. So one method is to set a smaller number of candidate combinations for smaller blocks and a larger number of candidate combinations for larger blocks. The size of a block can be determined based on the width and height of the block or the number of pixels in the block. An example is to set the number of candidates to 8 for blocks with less than (or less than or equal to) 256 pixels, and to set the number of candidates to 16 for blocks with greater than or equal to (or greater than) 256 pixels. The following is an introduction to the process of constructing the GPM combination candidate list. In some embodiments, more relevant information may be used to analyze the probability of occurrence of various combinations, such as using pattern information of surrounding blocks to reconstruct pixels. One approach is to use a template to build a candidate list of GPM combinations. In general, the height of the upper template and the width of the left template are consistent, and this value can be 1, 2, 4, etc. An example is that when using templates to construct a GPM combination candidate list, using an upper template with a height of 1 and / or a left template with a width of 1 can appropriately reduce the computational responsibility. It should be noted that the height of the upper template here is 1, which can be understood as the upper template of the current block includes a row of decoded or encoded pixels on the upper side of the current block, and the width of the left template is 1, which can be understood as the left template of the current block includes the decoded or encoded pixels on the left side of the current block. When using a template, the current block can use more relevant information, that is, the reconstructed information around the current block, and the correlation between the above three elements can be better utilized. In other words, the reconstructed information around the current block can be used to estimate some situations of the current block. One method is to use the GPM method to predict the template for each combination, and obtain the prediction block of the template for this combination. Since the template has obtained the reconstruction value, this combination can be used to calculate the prediction distortion cost of the prediction block of the template and the reconstruction block of the template, such as calculating SAD, SATD, SSE, etc. Sort various combinations according to the prediction distortion cost, or build a list that only maintains the top N combinations with the smallest prediction distortion cost. Then, a GPM combination candidate list can be constructed. The above method, for a certain combination, is to use the first prediction mode to generate the first prediction value of the template, use the second prediction mode to generate the second prediction value of the template, use the weight derivation mode to derive the weight of the pixel position on the template, and determine the prediction value of the template based on the first prediction value, the second prediction value and the weight. Both the encoder and the decoder should use the same method to build the GPM combination candidate list to ensure the consistency of encoding and decoding. As mentioned earlier, the number of all possible GPM combinations may be quite large. The above method is an exhaustive method. In specific implementation, a fast algorithm can be used to build the GPM combination candidate list, but the algorithm used by the encoder and decoder must be the same. For example, various combinations can be screened in layers, or some combinations with a higher probability inferred based on known information can be checked first, and some early termination conditions can be set. In some embodiments, this embodiment is used in blocks that are encoded within a frame and are not suitable for screen content encoding. This does not mean that this solution cannot be used in blocks that are encoded with screen content, but is just to illustrate this solution with the simplest example, because in blocks that are encoded within a frame and do not require screen content encoding, only the intra-frame prediction mode needs to be considered, and there is no need to consider screen content encoding modes such as IBC, palette, and various inter-frame modes. This solution can be used in any situation where GPM is available, which has been described above. Here, it is assumed that there are 64 possible weight derivation modes for GPM and 67 possible intra-frame prediction modes for GPM, which can be found in the VVC standard. However, it does not limit the possible weights of GPM to only 64, or which 64, and on the other hand, we should know that the reason why VVC's GPM chooses 64 is also a trade-off between improving the prediction effect and increasing the overhead in the code stream. This scheme no longer uses a fixed logic to encode the weight derivation mode, so in theory, this scheme can use more diverse weights and use them more flexibly. Similarly, it does not limit the intra-frame prediction mode of GPM to only 67, or which 67. In theory, all possible intra-frame prediction modes can be used in GPM. For example, the intra-frame angle prediction mode is made more detailed and generates more intra-frame angle prediction modes, so GPM can also use more intra-frame angle prediction modes. For example, the MIP (matrix-based intra prediction) mode of VVC can also be used in this scheme, but considering that MIP has multiple sub-modes to choose from, MIP is not added to this embodiment for ease of understanding. There are also some wide-angle modes that can also be used in this solution, which will not be described in this embodiment. If two intra-frame prediction modes are not allowed to be the same, there are a total of 64*67*66 possible combinations in this embodiment. If an exhaustive method is used, all these possible combinations are predicted for the template to calculate the distortion cost of this combination. We can also not try every intra-frame prediction mode, because we can get the MPM list of the current block according to the prediction mode of the surrounding blocks. For example, in VVC, the current block can get an MPM list of length 6. In addition, in some subsequent technical evolutions, there is a secondary MPM solution, which may derive an MPM list of length 22, or it can be said that the length of the first MPM list and the second MPM list is 22. In this scheme, MPM may be used to screen the intra-frame prediction mode. Of course, we can also construct an MPM list suitable for the GPM mode of the current block, such as adding the prediction modes used by all blocks adjacent to the current block to the MPM list. For example, if the MPM list does not contain special prediction modes such as DC, horizontal prediction mode or vertical prediction mode, then add one or more of them to the candidate intra-frame prediction mode of this scheme. For example, the intra-frame prediction mode related to the weighted dividing line is added to the candidate intra-frame prediction modes of this scheme. One example is one or several intra-frame angle prediction modes that are parallel or approximately parallel to the dividing line, and another example is one or several intra-frame angle prediction modes that are perpendicular or approximately perpendicular to the dividing line. Alternatively, the intra-frame prediction mode candidates of this scheme can be determined according to the weighted derivation mode. Alternatively, the intra-frame prediction mode candidates of this scheme can be determined separately for the two intra-frame prediction modes. In short, at least one GPM intra-frame prediction mode candidate set / list can be obtained. Of course, the total number of available prediction modes can also be limited to ensure the complexity of the decoding end, such as limiting the number of available prediction modes to a maximum of 6. All of the above methods can be used alone or in any combination. As can be seen from the above, using intra-frame prediction mode in GPM requires building an MPM list or screening out a list or set of candidate prediction modes. This helps to reduce overhead or reduce complexity. An example of reducing complexity is in the above GPM combination coding, by screening intra-frame prediction modes to reduce the number of possible combinations that need to be tried, reducing the amount of calculation and thus reducing complexity. The difference between the current GPM prediction and the prediction of the whole block is that it divides a block into two parts. It is understandable that each part has a strong correlation with the adjacent blocks or reference pixels, and a weak correlation with the non-adjacent reference pixels. For example, in the mode with a GPM index of 0 in VVC, the current block is divided into two parts in the vertical direction, which are called the left part and the right part. Then the left part has a strong correlation with the adjacent blocks or reference pixels on the left, while the right part has a weak correlation with the adjacent blocks or reference pixels on the left because they are not adjacent. However, when determining the list of candidate prediction modes, the adjacent blocks are simply divided into two categories, the upper side and the left side, which is not precise enough, and thus the determined candidate prediction mode is not accurate enough. When the prediction of the current block based on the candidate prediction mode is derived, the prediction accuracy is poor. In order to solve the above technical problems, when encoding and decoding the current block, the present application first determines N candidate weight derivation modes, and then determines at least one candidate prediction mode based on the N candidate weight derivation modes and the attribute information of the current block, and then determines the first weight derivation mode and K first prediction modes corresponding to the current block based on the N candidate weight derivation modes and at least one candidate prediction mode, and then uses the first weight derivation mode and the K first prediction modes to predict the current block to obtain the prediction value of the current block. That is to say, in an embodiment of the present application, when determining at least one candidate prediction mode, the weight derivation mode and the attribute information of the current block are taken into consideration, thereby improving the accuracy of determining the candidate prediction mode, and when predicting the current block based on the accurately determined candidate prediction mode, the prediction accuracy of the current block can be improved, and the encoding and decoding performance can be improved. In conjunction with Figure 19, the video decoding method provided in an embodiment of the present application is introduced by taking the decoding end as an example. FIG19 is a schematic flow chart of a video decoding method provided by an embodiment of the present application, and the embodiment of the present application is applied to the video decoders shown in FIG1 and FIG3. As shown in FIG19, the method of the embodiment of the present application includes: S101. Determine N candidate weight derivation modes. Wherein, N is a positive integer. Optionally, the above N is a preset value or a default value. Optionally, the encoding end indicates the above N to the decoding end, for example, the encoding end determines N candidate weight derivation modes, and then writes N into the bitstream, so that the decoding end obtains N by decoding the bitstream. Optionally, N can also be determined by the decoding end in other ways, and the embodiments of the present application are not limited to this. From the above, it can be seen that in the embodiment of the present application, a weight derivation mode and K prediction modes jointly generate a prediction block, and this prediction block acts on the current block, that is, the weight is determined according to the weight derivation mode, and the current block is predicted according to the K prediction modes to obtain K prediction values, and the K prediction values are weighted according to the weights to obtain the prediction value of the current block. That is to say, when decoding the current block, the decoding end needs to determine N candidate weight derivation modes and multiple candidate prediction modes, and then select one weight derivation mode from the N candidate weight derivation modes, and select K prediction modes from multiple candidate prediction modes, and then use the selected weight derivation mode and K prediction modes to predict the current block to obtain the prediction value of the current block. The embodiment of the present application does not limit the specific method for the decoding end to determine N candidate weight derivation modes. In a possible implementation, AWP has 56 weight derivation modes and GPM has 64 weight derivation modes. The N candidate weight derivation modes include at least one weight derivation mode among the 56 weight derivation modes in AWP, or include at least one weight derivation mode among the 64 weight derivation modes in GPM. In a possible implementation, some weight derivation modes in AWP or GPM can be screened out as N candidate weight derivation modes. That is, the N candidate weight derivation modes in the embodiment of the present application are a subset of all weight derivation modes of AWP or GPM. For example, the same "division" angle in the weight derivation mode can correspond to multiple offsets, such as modes 10, 11, 12, and 13 in Figure 4 or Figure 5. They have the same "division" angle, but different offsets. Some modes corresponding to the offsets can be removed in the embodiment of the present application. Of course, some modes corresponding to the "division" angles can also be removed. Doing so can reduce the total number of possible combinations. And make the differences between each possible combination more obvious. Of course, different screening methods can be set for different block sizes. For example, use fewer weight derivation modes for smaller blocks and more weight derivation modes for larger blocks. Different screening methods can also be set for different block shapes. One explanation is that block shape refers to the ratio of width to height. In this implementation, the encoding end and the decoding end screen and obtain N candidate weight derivation modes in the same manner. In one example, the method of screening and obtaining N candidate weight derivation modes is the default method at both the encoding and decoding ends. In another example, the encoding end can indicate the method of screening and obtaining N candidate weight derivation modes to the decoding end, so that the decoding end uses the same method to screen and obtain the same N candidate weight derivation modes as the encoding end. In some embodiments, the weight derivation modes corresponding to the preset division angles and / or preset offsets are eliminated from the preset M weight derivation modes to obtain N weight derivation modes. Since the same division angle in the weight derivation mode can correspond to multiple offsets, as shown in FIG4 , weight derivation modes 10, 11, 12, and 13 have the same division angles but different offsets, some weight derivation modes corresponding to the preset offsets can be removed, and / or some weight derivation modes corresponding to the preset division angles can also be removed. In some embodiments, the filtering conditions corresponding to different blocks may be different. Therefore, when determining the N weight export modes corresponding to the current block, the filtering conditions corresponding to the current block are first determined, and based on the filtering conditions corresponding to the current block, N weight export modes are selected from the preset M weight export modes. In some embodiments, the filtering condition corresponding to the current block includes a filtering condition corresponding to the size of the current block and / or a filtering condition corresponding to the shape of the current block. When predicting, for smaller blocks, similar weight derivation modes have little effect on the prediction results, while for larger blocks, similar weight derivation modes have a more obvious effect on the prediction results. Based on this, the embodiment of the present application sets different N values for blocks of different sizes, that is, a larger N value is set for larger blocks, and a smaller N value is set for smaller blocks. In one possible implementation, N candidate weight derivation modes are indicated to a decoding end. In some embodiments, the above-mentioned filtering condition includes an array, which includes N elements, and the N elements correspond one-to-one to N weight derivation modes. The element corresponding to each weight derivation mode is used to indicate whether the weight derivation mode is available. The above array can be a single-digit value or a two-digit value. For example, taking GPM as an example, there are a total of 64 possible weight derivation modes. The encoder sets a lookup table containing 64 elements, and the value of each element indicates whether to use its corresponding weight derivation mode. In one example, taking a single-digit value as an example, a specific example is as follows, setting an array of g_sgpm_splitDir: g_sgpm_splitDir
[0064] ={ 1,1,1,0,1,0,1,0, 1,0,1,0,1,0,1,0, 1,0,1,1,1,0,1,0, 1,0,1,0,1,0,1,0, 0,0,0,0,1,1,0,1, 0,0,1,0,0,1,0,0, 1,0,1,1,0,1,0,0, 1,0,0,1,0,0,1,0 }; Among them, the value of g_sgpm_splitDir[x] is 1, which means that the weight derivation mode with index x can be used, otherwise it means that the weight derivation mode with index x cannot be used. In this example, the decoder determines 26 candidate weight derivation modes through the array. In another example, an array can be used to indicate N candidate weight derivation modes, and the array only contains the index of the usable weight derivation mode. For example, an array g_sgpm_splitDir
[0026] ={0,1,6,8,10,12,14,16,18,19,20,22,24,26,28,30,36,37,42,45,48,50,51,53,56,59} with a length of 26 is used to indicate 26 candidate weight derivation modes. Based on the index of the weight derivation mode included in the numerical value, the decoding end determines the weight derivation mode corresponding to the index as the candidate weight derivation mode, and obtains 26 candidate weight derivation modes. In some embodiments, if the filtering conditions corresponding to the current block include filtering conditions corresponding to the size of the current block and filtering conditions corresponding to the shape of the current block, and for the same weight derivation mode, if the filtering conditions corresponding to the size of the current block and the filtering conditions corresponding to the shape of the current block indicate that the weight derivation mode is available, then the weight derivation mode is determined to be one of the N weight derivation modes; if at least one of the filtering conditions corresponding to the size of the current block and the filtering conditions corresponding to the shape of the current block indicates that the weight derivation mode is unavailable, then it is determined that the weight derivation mode does not constitute N weight derivation modes. In some embodiments, the filtering conditions corresponding to different block sizes and the filtering conditions corresponding to different block shapes can be implemented using multiple arrays respectively. In some embodiments, filtering conditions corresponding to different block sizes and filtering conditions corresponding to different block shapes can be implemented using a two-bit array, that is, a two-bit array includes both filtering conditions corresponding to block sizes and filtering conditions corresponding to block shapes. For example, the filtering condition corresponding to a block of size A and shape B is as follows, and the filtering condition is represented by a two-bit array: g_sgpm_splitDir
[0064] = { (1,1),(1,1),(1,1),(1,0),(1,0),(0,0),(1,0,(1,1), (1,1),(0,0),(1,1),(1,0),(1,0),(0,0),(1,0),(1,0),(1,1), (0,1),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0,(0,0), (1,1),(0,0),(0,1),(1,0),(1,0),(1,0),(1,0),(0,0), (0,0),(0,0),(1,1),(0,0),(1,1),(1,1),(1,0,(0,1), (0,0),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0,(0,0), (1,0),(0,0),(1,1),(1,0),(1,0),(1,0),(0,0),(0,0), (1,1),(0,0),(1,1),(0,0),(0,0),(1,0),(1,1),(0,0) }; Among them, the values of g_sgpm_splitDir[x] are all 1, indicating that the weight derivation mode with index x is available, and one of the values of g_sgpm_splitDir[x] is 0, indicating that the weight derivation mode with index x is not available. For example, g_sgpm_splitDir[4] = (1, 0), indicating that weight derivation mode 4 is available for blocks of size A, but not for blocks of shape B. Therefore, if the block size is A and the shape is B, the weight derivation mode is not available. It should be noted that the above example takes GPM including 64 weight derivation modes, but the weight derivation modes of the embodiments of the present application include but are not limited to the 64 weight derivation modes included in GPM and the 56 weight derivation modes included in AMP. In some embodiments, before determining the N candidate weight derivation modes, the decoder first needs to determine whether the current block uses K different prediction modes for weighted prediction processing. If the decoder determines that the current block uses K different prediction modes for weighted prediction processing, the above S101 is executed to determine the N candidate weight derivation modes. If the decoder determines that the current block does not use K different prediction modes for weighted prediction processing, the above S101 step is skipped. In a possible implementation, the decoding end may determine whether the current block uses K different prediction modes for weighted prediction processing by determining the prediction mode parameters of the current block. Optionally, in the implementation of the present application, the prediction mode parameter may indicate whether the current block can use the GPM mode or the AWP mode, that is, whether the current block can use K different prediction modes for prediction processing. It is understandable that, in the embodiment of the present application, the prediction mode parameter can be understood as a flag indicating whether the GPM mode or the AWP mode is used. Specifically, the encoder can use a variable as the prediction mode parameter, so that the setting of the prediction mode parameter can be achieved by setting the value of the variable. Exemplarily, in the present application, if the current block uses the GPM mode or the AWP mode, the encoder can set the value of the prediction mode parameter to indicate that the current block uses the GPM mode or the AWP mode, and specifically, the encoder can set the value of the variable to 1. Exemplarily, in the present application, if the current block does not use the GPM mode or the AWP mode, the encoder can set the value of the prediction mode parameter to indicate that the current block does not use the GPM mode or the AWP mode, and specifically, the encoder can set the variable value to 0. Further, in the embodiment of the present application, after completing the setting of the prediction mode parameter, the encoder can write the prediction mode parameter into the bitstream and transmit it to the decoder, so that the decoder can obtain the prediction mode parameter after parsing the bitstream. Based on this, the decoding end decodes the bit stream to obtain the prediction mode parameters, and then determines whether the current block uses the GPM mode or the AWP mode according to the prediction mode parameters. If the current block uses the GPM mode or the AWP mode, that is, when K different prediction modes are used for prediction processing, the N candidate weight derivation modes corresponding to the current block are determined. In some embodiments, the embodiments of the present application can also conditionally limit the use of GPM mode or AWP mode for the current block, that is, when it is determined that the current block meets the preset conditions, it is determined that the current block uses K prediction modes for weighted prediction, and then the N candidate weight derivation modes corresponding to the current block are determined. Exemplarily, when the GPM mode or the AWP mode is applied, the size of the current block may be limited. It is understandable that, since the prediction method proposed in the embodiment of the present application needs to use K different prediction modes to generate K prediction values, and then weight them according to the weights to obtain the prediction value of the current block, in order to reduce the complexity and consider the trade-off between compression performance and complexity, in the embodiment of the present application, it is possible to limit the use of the GPM mode or AWP mode for blocks of certain sizes. Therefore, in the present application, the decoder can first determine the size parameter of the current block, and then determine whether the current block uses the GPM mode or the AWP mode according to the size parameter. In an embodiment of the present application, the size parameter of the current block may include the height and width of the current block. Therefore, the decoder may determine whether the current block uses the GPM mode or the AWP mode according to the height and width of the current block. Exemplarily, in the present application, if the width is greater than threshold 1 and the height is greater than threshold 2, it is determined that the current block can use the GPM mode or the AWP mode. It can be seen that a possible restriction is to use the GPM mode or the AWP mode only when the width of the block is greater than (or greater than or equal to) threshold 1 and the height of the block is greater than (or greater than or equal to) threshold 2. The values of threshold 1 and threshold 2 can be 4, 8, 16, 32, 128, 256, etc., and threshold 1 can be equal to threshold 2. Exemplarily, in the present application, if the width is less than threshold 3 and the height is greater than threshold 4, it is determined that the current block can use the GPM mode or the AWP mode. It can be seen that a possible restriction is to use the GPM mode or the AWP mode only when the width of the block is less than (or less than or equal to) threshold 3 and the height of the block is greater than (or greater than or equal to) threshold 4. The values of threshold 3 and threshold 4 can be 4, 8, 16, 32, 128, 256, etc., and threshold 3 can be equal to threshold 4. Furthermore, in the embodiments of the present application, the size of the block that can use the GPM mode or the AWP mode can be limited by limiting the pixel parameters. Exemplarily, in the present application, the decoder may first determine the pixel parameters of the current block, and then further determine whether the current block can use the GPM mode or the AWP mode according to the pixel parameters and the threshold 5. It can be seen that one possible restriction is to use the GPM mode or the AWP mode only when the number of pixels of the block is greater than (or greater than or equal to) the threshold 5. The value of the threshold 5 may be 4, 8, 16, 32, 128, 256, 1024, etc. That is to say, in the present application, the current block can use the GPM mode or the AWP mode only when the size parameter of the current block meets the size requirement. Exemplarily, in the present application, there may be a frame-level flag to determine whether the current frame to be decoded uses the present application. For example, intra-frames (such as I-frames) may be configured to use the present application, while inter-frames (such as B-frames and P-frames) may not use the present application. Alternatively, intra-frames may be configured not to use the present application, while inter-frames may use the present application. Alternatively, some inter-frames may be configured to use the present application, while some inter-frames may not use the present application. Inter-frames may also use intra-frame prediction, and thus inter-frames may also use the present application. In some embodiments, there may also be a flag below the frame level to determine whether the current block uses this application. After the decoding end determines N candidate weight derivation modes, it executes the following step S102. S102. Determine at least one candidate prediction mode based on N candidate weight derivation modes and attribute information of the current block. At present, for example, in the GPM intra-frame plus inter-frame prediction method, the adjacent blocks are divided into two categories, the upper side and the left side, according to the angle of the dividing line, and then at least one candidate prediction mode of the current block is determined based on the prediction modes of the upper and left adjacent blocks. However, this division is not accurate enough. For example, the weight derivation mode with index 0 divides the current block into two parts, the left part and the right part, in a vertical manner. As shown in Table 5 above, it can be determined that the adjacent block corresponding to the second part (i.e., the second prediction mode) is L+A, that is, when constructing the candidate prediction mode list corresponding to the second prediction mode, the intra-frame prediction modes of the adjacent blocks A, AR, AL, L and BL can be used. However, as shown in Figures 4 and 18, the second part of the current block, i.e., the black part corresponding to the second prediction mode, is not adjacent to the upper adjacent block A and the upper right corner adjacent block AR, and has a weak correlation with the adjacent blocks A and the adjacent blocks AR. Therefore, when the candidate prediction mode list of the second prediction mode of the current block is determined directly based on the intra-frame prediction modes of the adjacent blocks A, AR, AL, L and BL, there may be a problem that the determined candidate prediction mode list is inaccurate. In addition, as shown in FIG20A and FIG20B, the same weight derivation matrix of blocks of different shapes may have different effects on two prediction modes. For example, in the mode of GPM index 13 in VVC, in a block with an aspect ratio of 1:2, the white part does not reach the upper left corner of the current block, while in a block with an aspect ratio of 2:1, the white part reaches the upper left corner of the current block. In other words, the attribute information of the current block also responds to the correlation between the adjacent block and the first part and the second part of the current block. Based on the above description, when determining at least one candidate prediction mode, the embodiment of the present application not only considers the impact of the candidate weight derivation mode on the candidate prediction mode, but also considers the impact of the attribute information of the current block on the candidate prediction mode, thereby improving the accuracy of determining the candidate prediction mode. The embodiment of the present application does not limit the specific content of the attribute information of the current block. In some embodiments, the attribute information of the current block includes size information of the current block, wherein the size information of the current block includes the length and width of the current block, the aspect ratio of the current block, or the number of pixels included in the current block. In some embodiments, the attribute information of the current block also includes shape information of the current block, for example, the shape of the current block is a square, or the shape of the current block is a rectangle, or the shape of the current block is a preset shape such as a polygon or a circle. In the embodiment of the present application, determining at least one candidate prediction mode based on N candidate weight derivation modes and attribute information of the current block can be understood as determining, based on the N candidate weight derivation modes and attribute information of the current block, which neighboring blocks of the current block have prediction modes that can be used to determine the candidate prediction mode. For example, based on the candidate weight derivation mode and attribute information of the current block, the weights of the neighboring blocks are determined, and based on the weights of the neighboring blocks, it is determined which neighboring blocks' prediction modes are selected for determining the candidate prediction mode. In the embodiment of the present application, the prediction mode of the adjacent block refers to the prediction mode used when decoding the adjacent block. For example, if in a certain GPM weight derivation mode, for a certain prediction mode (the first prediction mode or the second prediction mode), the weight of the adjacent block is greater than (or greater than or equal to) a certain threshold, then it means that the adjacent block has a strong correlation with the area occupied by the current prediction mode; otherwise, it means that the adjacent block has a weak correlation with the area occupied by the current prediction mode. In some embodiments, the decoding end can determine at least one candidate prediction mode based on N candidate weight derivation modes and the attribute information of the current block, and the at least one candidate prediction mode constitutes a candidate prediction mode list. That is to say, in this embodiment, N candidate weight derivation modes correspond to one candidate prediction mode list. For example, if the dividing line angles and offsets of the N candidate weight derivation modes are not much different, in order to reduce the amount of calculation and improve the decoding efficiency, the decoding end determines to determine a candidate weight derivation mode A from the N candidate weight derivation modes, and determines a candidate prediction mode list based on the candidate weight derivation mode and the attribute information of the current block. In one example, the above-mentioned candidate weight derivation mode A can be a default candidate weight derivation mode among the N candidate weight derivation modes. In another example, the encoding end can indicate the index of the candidate weight derivation mode A to the decoding end, so that the decoding end decodes the code stream and obtains the index of the candidate weight derivation mode A. In some embodiments, at least one of the N candidate weight derivation modes corresponds to a candidate prediction mode list. For example, the decoding end determines a candidate prediction mode list for each of the N candidate weight derivation modes. In this case, the above S102 includes the following S102-A step: S102-A. For the ith candidate weight derivation mode among N candidate weight derivation modes, determine the candidate prediction mode list corresponding to the ith candidate weight derivation mode based on the ith candidate weight derivation mode and attribute information of the current block. In this embodiment, the method of determining the candidate prediction mode list corresponding to each of the N candidate weight derivation modes is the same. For ease of description, the i-th candidate weight derivation mode among the N candidate weight derivation modes is used as an example for explanation. The i-th candidate weight derivation mode can be understood as any candidate weight derivation mode among the N candidate weight derivation modes. The embodiment of the present application does not limit the specific method of determining the candidate prediction mode list corresponding to the i-th candidate weight derivation mode based on the i-th candidate weight derivation mode and the attribute information of the current block. In some embodiments, the ith candidate weight derivation mode corresponds to a candidate prediction mode list, that is, based on the ith candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list corresponding to the ith candidate prediction mode is determined. In this way, when predicting the current block, K prediction modes are determined from the candidate prediction mode list corresponding to the ith candidate weight derivation mode, and then the ith candidate weight derivation mode and the K prediction modes are used to predict the current block to obtain the predicted value of the current block. For example, based on the ith candidate weight derivation mode, the weight is determined, the current block is predicted using the K prediction modes to obtain K predicted values, and the K prediction values are weighted using the weights to obtain the predicted value of the current block under the ith candidate weight derivation mode. In an example of this embodiment, based on the i-th candidate weight derivation mode and the attribute information of the current block, a method for determining a candidate prediction mode list corresponding to the i-th candidate weight derivation mode may be: determining a dividing line corresponding to the i-th candidate weight derivation mode based on the i-th candidate weight derivation mode, and determining the dividing line to divide the current block based on the attribute information of the current block to obtain a first part and a second part, wherein the first part can be understood as a part corresponding to the first prediction mode, and the second part can be understood as a part corresponding to the second prediction mode. In this way, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode can be determined based on the prediction modes of adjacent blocks in the adjacent blocks of the current block that are adjacent to the first part of the current block. In another example of this embodiment, based on the i-th candidate weight derivation mode and the attribute information of the current block, the method of determining the candidate prediction mode list corresponding to the i-th candidate weight derivation mode can be: based on the i-th candidate weight derivation mode and the attribute information of the current block, the weight of each adjacent block of the current block is determined, and then based on the weight of the adjacent blocks, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode is determined. For example, based on the prediction mode of the adjacent block with a larger weight of the adjacent block, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode is determined. In some embodiments, the K prediction modes corresponding to the i-th candidate weight derivation mode, the above S102-A includes the following step S102-A1: S102-A1. Based on the i-th candidate weight derivation mode and the attribute information of the current block, determine a candidate prediction mode list of at least one prediction mode among K prediction modes corresponding to the i-th candidate weight derivation mode. In this embodiment, the decoding end determines a candidate prediction mode list of at least one prediction mode among K prediction modes corresponding to the i-th candidate derivation mode. For example, K=2, then the decoding end may determine a candidate prediction mode list for the first prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, but not determine a candidate prediction mode list for the second candidate prediction mode. Optionally, a candidate prediction mode list may be determined for the second prediction mode, but not for the first candidate prediction mode. Optionally, a candidate prediction mode list may be determined for the first prediction mode, and a candidate prediction mode list may be determined for the second candidate prediction mode. Optionally, a common candidate prediction mode list may be determined for the first prediction mode and the second prediction mode. In an embodiment of the present application, a candidate prediction mode list is determined for at least one prediction mode corresponding to the i-th candidate weight derivation mode, and then at least one prediction mode corresponding to the i-th candidate weight derivation mode is accurately determined from the constructed candidate prediction mode list. In some embodiments, if the at least one prediction mode corresponds to a candidate prediction mode list, the above S102-A1 includes the following steps S102-A1-11 and S102-A1-12: S102-A1-11. For a j-th prediction mode in at least one prediction mode, determine a candidate prediction mode list of the j-th prediction mode based on the i-th candidate weight derivation mode and attribute information of the current block, where j is a positive integer. S102-A1-12. Based on the candidate prediction mode list of the j-th prediction mode, determine a candidate prediction mode list of at least one prediction mode. In this embodiment, at least one prediction mode corresponding to the i-th candidate weight derivation mode corresponds to one candidate prediction mode list, that is, the candidate prediction mode lists corresponding to the at least one prediction mode are the same, which is one candidate prediction mode list, so that the complexity of determining the candidate prediction mode list can be reduced and the decoding efficiency can be improved. At this time, the decoding end determines one candidate prediction mode list for the at least one prediction mode. Specifically, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode in the at least one prediction mode is determined. Optionally, the j-th prediction mode is any one of the at least one prediction mode. Then, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode is determined. The specific methods for determining the candidate prediction mode list of the at least one prediction mode based on the candidate prediction mode list of the j-th prediction mode in S102-A1-12 include but are not limited to the following: Method 1: directly determine the candidate prediction mode list of the j-th prediction mode as the candidate prediction mode list of the at least one prediction mode. Method 2: Determine whether the candidate prediction mode list of the j-th prediction mode includes the preset prediction mode. If the candidate prediction mode list of the j-th prediction mode includes the preset prediction mode, determine the candidate prediction mode list of the j-th prediction mode as the candidate prediction mode list of at least one prediction mode. If the candidate prediction mode list of the j-th prediction mode does not include the preset prediction mode, add the preset prediction mode to the candidate prediction mode list of the j-th prediction mode to obtain the candidate prediction mode list of at least one prediction mode. The embodiment of the present application does not limit the preset prediction mode in the above-mentioned method 2, and it is determined according to actual needs. This embodiment introduces a specific process of determining the candidate prediction mode list of the at least one prediction mode if the at least one prediction mode corresponds to a candidate prediction mode list. In some embodiments, if each prediction mode in the at least one prediction mode corresponds to a candidate prediction mode list, the above S102-A1 includes the following step S102-A1-21: S102-A1-21. For the j-th prediction mode in the at least one prediction mode mentioned above, determine a candidate prediction mode list of the j-th prediction mode based on the ith candidate weight derivation mode and attribute information of the current block, where j is a positive integer. In this embodiment, each prediction mode in the above-mentioned at least one prediction mode corresponds to a candidate prediction mode list, so the decoding end determines a candidate prediction mode list for each prediction mode in the at least one prediction mode corresponding to the i-th candidate weight derivation mode for the i-th candidate weight derivation mode. For example, the above-mentioned at least one prediction mode includes the first prediction mode and the second prediction mode corresponding to the i-th candidate weight derivation mode, and then the decoding end determines a candidate prediction mode list for the first prediction mode and determines a candidate prediction mode for the second prediction mode. In this embodiment, the process of determining a candidate prediction mode list corresponding to each prediction mode in the above-mentioned at least one prediction mode is the same. For the convenience of description, the embodiment of the present application is explained by taking the candidate prediction mode list for determining the j-th prediction mode in the above-mentioned at least one prediction mode as an example. The following is an introduction to the process of determining the candidate prediction mode list of the jth prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block in the above S102-A1-11 and the above S102-A1-21. In the embodiment of the present application, the specific implementation method of determining the candidate prediction mode list of the jth prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block includes at least the following two methods: Method 1: The decoding end determines a candidate prediction mode list of the j-th prediction mode through the following steps 11 to 13: Step 11: determine a first lookup table, where the first lookup table includes different block attribute information and adjacent blocks corresponding to different prediction modes under different weight derivation modes; Step 12: Based on the attribute information of the current block and the i-th candidate weight derivation mode, determine the adjacent block corresponding to the j-th prediction mode in the first lookup table; Step 13: Determine a candidate prediction mode list for the j-th prediction mode based on the prediction modes of the adjacent blocks corresponding to the j-th prediction mode. In the first method, a first lookup table is determined based on different block attribute information. The first lookup table includes different block attribute information and adjacent blocks corresponding to different prediction modes under different weight derivation modes. In this way, the adjacent blocks corresponding to the j-th prediction mode can be obtained directly by searching the first lookup table, and then based on the prediction mode of the adjacent blocks corresponding to the j-th prediction mode, the candidate prediction mode list of the j-th prediction mode can be determined. The embodiment of the present application does not limit the specific form of the first lookup table. In one possible implementation, the first lookup table includes P different sub-lookup tables, wherein the P sub-lookup tables are lookup tables corresponding to P blocks of attribute information, respectively, and the lookup tables include adjacent blocks corresponding to different prediction modes under different weight derivation modes. In this way, the decoding end can determine the first sub-lookup table corresponding to the current block in the P sub-lookup tables based on the attribute information of the current block, and the first sub-lookup table includes adjacent blocks corresponding to different prediction modes under different weight derivation modes; then, based on the i-th candidate weight derivation mode, determine the adjacent blocks corresponding to the j-th prediction mode in the first sub-lookup table; and then determine the candidate prediction mode list of the j-th prediction mode based on the prediction mode of the adjacent blocks corresponding to the j-th prediction mode. In an embodiment of the present application, different sub-lookup tables are determined based on different block attribute information, wherein the lookup table includes adjacent blocks corresponding to different prediction modes under different weight derivation modes. In one example, it is assumed that the property information of the block includes the aspect ratio of the block. It is assumed that the P sub-lookup tables include a lookup table corresponding to a block with an aspect ratio of 1:2, a lookup table corresponding to a block with an aspect ratio of 1:1, and a lookup table corresponding to a block with an aspect ratio of 2:1. Exemplarily, the sub-lookup table corresponding to the block with an aspect ratio of 1:2 is shown in Table 6: Table 6 In this way, when decoding the current block, based on the size information of the current block, if it is determined that the aspect ratio of the current block is 1:2, the first sub-error check table shown in Table 6 is obtained from the P sub-error check tables. Next, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Specifically, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Assuming K=2, the j-th prediction mode is the first prediction mode, and the first prediction mode corresponds to the first part of the above Table 6. In this way, the i-th candidate weight derivation mode can be used to determine the adjacent block corresponding to the i-th prediction mode in the adjacent blocks corresponding to the first part. For example, the ith candidate weight derivation mode is a4, and the first part of the adjacent blocks corresponding to a4 is A, so the upper left adjacent block, the upper side adjacent block, and the upper right adjacent block of the current block can be determined as the adjacent blocks corresponding to the ith prediction mode, and then based on the prediction modes of the upper left adjacent block, the upper side adjacent block, and the upper right adjacent block of the current block, the candidate prediction mode list of the jth prediction mode is determined. For example, the prediction modes of the upper left adjacent block, the upper side adjacent block, and the upper right adjacent block of the current block are added to the candidate prediction mode list of the jth prediction mode in a preset order. Exemplarily, the sub-lookup table corresponding to the block with an aspect ratio of 1:1 is shown in Table 7: Table 7 In this way, when decoding the current block, based on the size information of the current block, if it is determined that the aspect ratio of the current block is 1:1, the first sub-error check table shown in Table 7 is obtained from the P sub-error check tables. Next, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first lookup table. Specifically, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Assuming K=2, the j-th prediction mode is the first prediction mode, and the first prediction mode corresponds to the first part of the above Table 7. In this way, the i-th candidate weight derivation mode can be used to determine the adjacent block corresponding to the i-th prediction mode in the adjacent blocks corresponding to the first part. For example, the ith candidate weight derivation mode is a2, and the first part of the adjacent blocks corresponding to a2 is L+A, so the left adjacent block, the lower left adjacent block, the upper left adjacent block, the upper adjacent block, and the upper right adjacent block of the current block can be determined as the adjacent blocks corresponding to the ith prediction mode, and then based on the prediction modes of the left adjacent block, the lower left adjacent block, the upper left adjacent block, the upper adjacent block, and the upper right adjacent block of the current block, the candidate prediction mode list of the jth prediction mode is determined. For example, the prediction modes of the left adjacent block, the lower left adjacent block, the upper left adjacent block, the upper adjacent block, and the upper right adjacent block of the current block are added to the candidate prediction mode list of the jth prediction mode in a preset order. Exemplarily, the sub-lookup table corresponding to the block with an aspect ratio of 2:1 is shown in Table 8: Table 8 In this way, when decoding the current block, based on the size information of the current block, if it is determined that the aspect ratio of the current block is 2:1, the first sub-error check table shown in Table 8 is obtained from the P sub-error check tables. Next, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Specifically, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Assuming K=2, the j-th prediction mode is the first prediction mode, and the first prediction mode corresponds to the first part of the above Table 8. In this way, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the i-th prediction mode can be determined in the adjacent blocks corresponding to the first part. For example, the ith candidate weight derivation mode is a1, and the first part of the adjacent blocks corresponding to a1 is L, so the left adjacent block, the lower left adjacent block, and the upper left adjacent block of the current block can be determined as the adjacent blocks corresponding to the ith prediction mode, and then based on the prediction modes of the left adjacent block, the lower left adjacent block, and the upper left adjacent block of the current block, the candidate prediction mode list of the jth prediction mode is determined. For example, the prediction modes of the left adjacent block, the lower left adjacent block, and the upper left adjacent block of the current block are added to the candidate prediction mode list of the jth prediction mode in a preset order. It should be noted that the above Tables 6, 7 and 8 are only examples and are not limitations on the embodiments of the present application. The contents of the sub-error checking tables corresponding to blocks of different attribute information in the embodiments of the present application are determined based on actual conditions. Tables 7 and 8 above show neighboring blocks corresponding to different prediction modes (ie, different parts) under different candidate weight derivation modes, wherein the candidate weight derivation mode can be understood as the index of the candidate weight derivation mode. In some embodiments, the angle index can be used to replace the candidate weight derivation mode, that is, the above sub-error lookup table includes adjacent blocks corresponding to different prediction modes under different angle indexes. In this way, when searching for adjacent blocks, firstly, based on the attribute information of the current block, the first sub-error lookup table is determined from the P lookup tables, and then the angle index corresponding to the i-th candidate prediction mode is determined, and then based on the angle index, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. In some embodiments, the aspect ratio of the current block can be replaced by the shape index of the current block, for example, a shape index of 0 represents a length:width ratio of 1:1, a shape index of 1 represents a length:width ratio of 2:1, a shape index of 2 represents a length:width ratio of 1:2, etc. In the embodiment of the present application, each shape index constructs a sub-lookup table, and thus has P lookup tables. The embodiment of the present application does not limit the specific manner in which the decoding end determines the P sub-lookup tables. In a possible implementation, the encoder sends the P sub-lookup tables to the decoder. Since the P sub-lookup tables do not include image information, in one example, the encoder can send the P sub-lookup tables to the decoder by transmitting other data. In another example, the encoder writes the P sub-lookup tables into a bitstream and sends it to the decoder. In another possible implementation, the decoding end obtains P sub-lookup tables from other storage devices. In yet another possible implementation, P sub-lookup tables are stored in the decoding end. In another possible implementation, the decoding end may construct P sub-lookup tables. For example, for each of the N candidate weight derivation modes, based on the candidate weight derivation mode and the attribute information of the block, a first adjacent block with a strong correlation with the first part of the block and a second adjacent block with a strong correlation with the second part of the block are determined, and then based on the first adjacent block and the second adjacent block, a sub-lookup table as shown in Tables 6 to 8 above is constructed. In some embodiments, the first lookup table is a table including different block attribute information and adjacent blocks corresponding to different prediction modes under different weight derivation modes. That is, the sub-lookup tables shown in Tables 6 to 7 are combined into one lookup table. Table 9 In this way, the decoding end can determine the adjacent block corresponding to the j-th prediction mode in the first lookup table shown in Table 9 based on the attribute information of the current block and the i-th candidate weight export mode, and determine the candidate prediction mode list of the j-th prediction mode based on the prediction mode of the adjacent block corresponding to the j-th prediction mode. The above-mentioned method 1 shows that based on the i-th candidate weight derivation mode and the attribute information of the current block, the candidate prediction mode list of the j-th prediction mode is determined by looking up a table. In some embodiments, the candidate prediction mode list of the j-th prediction mode may also be determined by the following method 2. In the second method, the decoding end determines the candidate prediction mode list of the j-th prediction mode through the following steps 21 and 22: Step 21: based on the i-th candidate weight derivation mode and the attribute information of the current block, determine the weight of the neighboring blocks of the current block with respect to the j-th prediction mode; Step 22: Determine a candidate prediction mode list for the jth prediction mode based on the weights of the neighboring blocks with respect to the jth prediction mode. In the second method, by determining the weight of each neighboring block of the current block with respect to the j-th prediction mode, it is determined which neighboring blocks of the current block are to be selected for prediction modes, so as to construct a candidate prediction mode list for the j-th prediction mode. The following introduces a specific process of determining the weights of neighboring blocks of the current block with respect to the jth prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block. In the above step 21, the methods for determining the weights of the neighboring blocks of the current block with respect to the j-th prediction mode include but are not limited to the following: Method 1: For any neighboring block of the current block, based on the i-th candidate weight derivation mode and the attribute information of the current block, determine the weight of each point in the neighboring block with respect to the j-th prediction mode; based on the weight of each point in the neighboring block with respect to the j-th prediction mode, determine the weight of the neighboring block with respect to the j-th prediction mode. In an example, the average value of the weight of each point in the neighboring block with respect to the j-th prediction mode is determined as the weight of the neighboring block with respect to the j-th prediction mode. In another example, the weighted average of the weights of each point in the adjacent block with respect to the j-th prediction mode is determined as the weight of the adjacent block with respect to the j-th prediction mode. Optionally, when determining the weighted average, a larger weight is assigned to the pixel points in the adjacent block that are adjacent to the current block, and a smaller weight is assigned to the pixel points in the adjacent block that are farther from the current block. In yet another example, the sum of the weights of each point in the neighboring block with respect to the j-th prediction mode is determined as the weight of the neighboring block with respect to the j-th prediction mode. In another example, the weighted sum of the weights of each point in the adjacent block with respect to the j-th prediction mode is determined as the weight of the adjacent block with respect to the j-th prediction mode. Optionally, when determining the weighted sum, a larger weight is assigned to a pixel point in the adjacent block that is adjacent to the current block, and a smaller weight is assigned to a pixel point in the adjacent block that is farther from the current block. In the method 1, based on the i-th candidate weight derivation mode and the attribute information of the current block, the weight of each point in the adjacent block with respect to the j-th prediction mode is determined in the same manner. In some embodiments, the adjacent blocks of the current block are located in the template of the current block, so after determining the weight of the template of the current block, the weight of each point in the adjacent block can be determined. For example, based on the i-th weight derivation mode, the attribute information of the current block and the template of the current block, the template weight of the current block is determined. For point 1 in the adjacent block, the weight corresponding to point 1 in the template weight of the current block is determined as the weight of point 1 with respect to the j-th prediction mode. Referring to this method, the weight of each point in the adjacent block with respect to the j-th prediction mode can be determined. Mode 2, the weight of a certain point in the adjacent block is determined as the weight of the adjacent block with respect to the j-th prediction mode. In this case, the above step 21 includes the following steps: Step 21-A, determining the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block; Step 21-B: determine the weight of the first point as the weight of the adjacent block with respect to the j-th prediction mode. In this method 2, the decoding end determines the weight of the adjacent block with respect to the j-th prediction mode by determining the weight of the first point in the adjacent block with respect to the j-th prediction mode, which can reduce the amount of calculation for determining the weight of the adjacent block and thus improve decoding efficiency. The embodiment of the present application does not limit the specific position of the first point in the adjacent block. In a possible implementation manner, the first point is any point in an adjacent block. In another possible implementation manner, the first point is a point in an adjacent block that is adjacent to the current block. In the second method, the specific method of determining the weight of the first point in the adjacent block includes at least the following methods: The first method is to directly determine the weight of the first point in the adjacent block. In this case, the above step 21-A includes the following steps: Step 21-A11, determine the weight of the first point based on the i-th candidate weight derivation mode, the attribute information of the current block and the template of the current block. In the embodiment of the present application, the adjacent block is located in the template area of the current block. Therefore, the first point in the adjacent block is located in the template area of the current block. Therefore, the weight of the first point can be determined by referring to the method of determining the weight of the template of the current block, for example, including the following examples: Example 1: If the weight of each point in the template is determined, and then the matrix composed of the weight of each point is determined as the weight of the template, the decoding end can directly determine the weight of the first point based on the i-th candidate weight export mode, the attribute information of the current block and the template of the current block, and the position information (x, y) of the first point in the template. Specifically, determine the angle index and distance index corresponding to the i-th candidate weight derivation mode, and determine the first parameter of the first point in the template based on the angle index, distance index and the size of the template, as well as the position information (x, y) of the first point. In some embodiments, the first parameter is also called the weight index weightIdx; determine the weight of the first point in the template based on the first parameter of the first point in the template. In a possible implementation, the weight of the first point in the template may be determined as follows: The inputs of the weight derivation process of the first point in the template are: the width of the current block nCbW, the height of the current block nCbH; the width of the left template nVmW, the height of the upper template nVmH; the "division" angle index variable angleId of the i-th candidate weight derivation mode; the distance index variable distanceIdx of the i-th candidate weight derivation mode; the component index variable cIdx. For example, this application takes the brightness component as an example, so cIdx is 0, indicating the brightness component. Among them, the variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip and shiftHor are derived as follows: nW=(cIdx==0)? nCbW:nCbW*EubWidthC nH=(cIdx==0)? nCbH:nCbH*EubHeightC shift1 = Max(5,17-BitDepth) where BitDepth is the bit depth of the codec offset1=1<<(shift1-1) displacementX=angleIdx displacementY=(angleIdx+8)%32 partFlip=(angleIdx>=13&&angleIdx<=27)? 0:1 shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))? 0:1 Among them, the offsets offsetX and offsetY are derived as follows: – If the value of shiftHor is 0: offsetX=(-nW)>>1 offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3)) – Otherwise (i.e. the value of shiftHor is 1): offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3) offsetY=(-nH)>>1 The template weight matrix wVemplateValue[x][y] (where x = -nVmW..nCbW–1, y = -nVmH..nCbH-1, excluding the case where x and y are both greater than or equal to 0) Note that in this example, the coordinates of the upper left corner of the current block are (0, 0) and are derived as follows: – The variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*EubWidthC yL=(cIdx==0)? y:y*EubHeightC Where disLut is determined according to Table 3 above Among them, the first parameter weightIdx is derived as follows: weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+ (((yL+offsetY)<<1)+1)*disLut[displacementY] After determining the first parameter weightIdx corresponding to the first point based on the above method, the weight of the first point can be determined in at least two ways as follows: One possible way is to determine the weight of the first point in the template according to the following formula: weightIdxL=partFlip? 32+weightIdx:32-weightIdx wVemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3) Wherein, wVemplateValue[x][y] is the weight of the first point (x, y) in the template, weightIdxL is the weight index under the first component (for example, the brightness component), wVemplateValue[x][y] is the weight of the first point (x, y) in the template, and partFlip is an intermediate variable, which is determined according to the angle index angleIdx, for example, as described above: partFlip=(angleIdx>=13&&angleIdx<=27)? 0:1, that is, the value of partFlip is 1 or 0, when partFlip is 0, weightIdxL is 32-weightIdx, when partFlip is 1, weightIdxL is 32+weightIdx, it should be noted that 32 here is only an example, and the present application is not limited to this. Another possible way is to determine the weight of the first point according to the first parameter weightIdx corresponding to the first point in the template, the first threshold and the second threshold. In order to reduce the computational complexity of the first point weight, in the second method, the weight of the pixel point in the template is limited to the first threshold or the second threshold, that is, the weight of the first point is either the first threshold or the second threshold, thereby reducing the computational complexity of the first point weight. This application does not limit the specific values of the first threshold and the second threshold. Optional, the first threshold is 1. Optionally, the second threshold is 0. In one example, the weight of the first point can be determined by the following formula: wVemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0 Among them, wVemplateValue[x][y] is the weight of the point (x, y) in the template, and the 1 in the above "1:0" is the first threshold and 0 is the second threshold. It should be noted that the above is explained with the jth prediction mode as the first prediction mode as an example, that is, the above determination is the weight of the first point with respect to the first prediction mode. If the jth prediction mode is the second prediction mode, the weight of the first point with respect to the second prediction mode is 8-wVemplateValue[x][y], where 8 is only an example and can be other values, which are not limited in the embodiments of the present application. In the above example 1, the weight of the first point in the adjacent image is determined by referring to the method of determining the weight of the pixel points in the template. The whole process is simple, and the weight of the first point determined is more accurate. Example 2: As can be seen from the above, the first point is a point in the template, so the weight of the entire template can be determined, and then the weight of the first point can be determined based on the weight of the template. At this time, the above step 21-A11 includes: determining the weight of the template based on the i-th candidate weight derivation mode, the attribute information of the current block and the template of the current block; and determining the weight corresponding to the first point in the weight of the template as the weight of the first point. Specifically, determine the angle index and distance index corresponding to the i-th candidate weight derivation mode, determine the size of the current block based on the attribute information of the current block, and determine the first parameter of each pixel in the template according to the angle index, distance index, the size of the current block, and the size of the template. In some embodiments, the first parameter is also called the weight index weightIdx; determine the weight of the template according to the first parameter of each pixel in the template. In a possible implementation, the template weight may be determined in the following manner: The inputs of the template weight derivation process are: the width of the current block nCbW, the height of the current block nCbH; the width of the left template nVmW, the height of the upper template nVmH; the "division" angle index variable angleId of GPM; the distance index variable distanceIdx of GPM; the component index variable cIdx. For example, this application takes the brightness component as an example, so cIdx is 0, indicating the brightness component. Among them, the variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip and shiftHor are derived as follows: nW=(cIdx==0)? nCbW:nCbW*EubWidthC nH=(cIdx==0)? nCbH:nCbH*EubHeightC shift1 = Max(5,17-BitDepth) where BitDepth is the bit depth of the codec offset1=1<<(shift1-1) displacementX=angleIdx displacementY=(angleIdx+8)%32 partFlip=(angleIdx>=13&&angleIdx<=27)? 0:1 shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))? 0:1 Among them, the offsets offsetX and offsetY are derived as follows: – If the value of shiftHor is 0: offsetX=(-nW)>>1 offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3)) – Otherwise (i.e. the value of shiftHor is 1): offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3) offsetY=(-nH)>>1 The template weight matrix wVemplateValue[x][y] (where x = -nVmW..nCbW–1, y = -nVmH..nCbH-1, excluding the case where x and y are both greater than or equal to 0) Note that in this example, the coordinates of the upper left corner of the current block are (0, 0) and are derived as follows: – The variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*EubWidthC yL=(cIdx==0)? y:y*EubHeightC Where disLut is determined according to Table 3 above Among them, the first parameter weightIdx is derived as follows: weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY] In some embodiments, according to the above method, after determining the first parameter weightIdx, the weight of the pixel in the template is determined according to the following formula: weightIdxL=partFlip? 32+weightIdx:32-weightIdx wVemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3) Wherein, wVemplateValue[x][y] is the weight of the template midpoint (x, y), weightIdxL is the weight index under the first component (for example, the brightness component), wVemplateValue[x][y] is the weight of the template midpoint (x, y), and partFlip is an intermediate variable, which is determined according to the angle index angleIdx, for example, as described above: partFlip=(angleIdx>=13&&angleIdx<=27)? 0:1, that is, the value of partFlip is 1 or 0, when partFlip is 0, weightIdxL is 32-weightIdx, when partFlip is 1, weightIdxL is 32+weightIdx, it should be noted that 32 here is only an example, and the present application is not limited to this. In some embodiments, according to the above method, after the first parameter weightIdx is determined, the weight of the pixel in the template is determined according to the first parameter weightIdx of the pixel in the template, the first threshold and the second threshold. In order to reduce the computational complexity of template weights, in this embodiment, the weights of pixels in the template are limited to the first threshold or the second threshold, that is, the weights of pixels in the template are either the first threshold or the second threshold, thereby reducing the computational complexity of template weights. In one example, the weight of the pixel in the template can be determined by the following formula: wVemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0 Among them, wVemplateValue[x][y] is the weight of the point (x, y) in the template, and the 1 in the above "1:0" is the first threshold and 0 is the second threshold. In the above implementation, the weight of each point in the template is determined through the weight derivation mode, and the weight matrix composed of the weight of each point in the template is used as the template weight. In another possible implementation, the merged area consisting of the current block and the template is taken as a whole, the weights of the pixels in the merged area are derived according to the weight derivation mode, and then the weight of the template is determined based on the weight of the merged area. Exemplarily, the decoding end determines the weights of the pixels in the merged area consisting of the current block and the template based on the angle index, the distance index, the size of the template and the size of the current block; and determines the template weight based on the size of the template and the weights of the pixels in the merged area. In this implementation, the current block and the template are taken as a whole, and the weights of the pixels in the merged area composed of the current block and the template are determined based on the angle index, the distance index, the size of the template and the size of the current block. Then, based on the size of the template, the weight corresponding to the template in the merged area is determined as the template weight. For example, as shown in Figures 21A and 21B, the weight corresponding to the L-shaped template area in the merged area is determined as the template weight. In one example, in this implementation, the process of deriving the template weight is: The inputs of this process are: the width of the current block nCbW, the height of the current block nCbH, the width of the left template nTmW, the height of the upper template nTmH, the "division" angle index variable angleIdx of GPM, the distance index variable distanceIdx of GPM, and the component index variable cIdx. Because this example only takes brightness as an example, cIdx is 0 in this example, indicating the brightness component. The output of this process is the template weight matrix wTemplateValue. The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip and shiftHor are derived as follows: nW=(cIdx==0)? nCbW:nCbW*SubWidthC nH=(cIdx==0)? nCbH:nCbH*SubHeightC shift1 = Max(5,17-BitDepth) where BitDepth is the bit depth of the codec offset1=1<<(shift1-1) displacementX=angleIdx displacementY=(angleIdx+8)%32 partFlip=(angleIdx>=13&&angleIdx<=27)? 0:1 shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))? 0:1 The variables offsetX and offsetY are derived as follows: – If the value of shiftHor is 0: offsetX=(-nW)>>1 offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3)) – Otherwise (i.e. the value of shiftHor is 1): offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3) offsetY=(-nH)>>1 The template weight matrix wTemplateValue[x][y] (where x = -nTmW..nCbW–1, y = -nTmH..nCbH-1, excluding the case where x and y are both greater than or equal to 0) Note that in this example, the coordinates of the upper left corner of the current block are (0, 0) and are derived as follows: – The variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*SubWidthC yL=(cIdx==0)? y:y*SubHeightC Where disLut is determined according to Table 3. weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY] weightIdxL=partFlip? 32+weightIdx:32-weightIdx wTemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3) In some embodiments, for ease of calculation, the template weight may be set to only two possible values, such as 0 and 1. In one example, the weight of the pixel in the template can be determined by the following formula: wVemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0. It should be noted that the above is explained with the j-th prediction mode as the first prediction mode as an example, that is, the above determination is the weight of the template with respect to the first prediction mode. If the j-th prediction mode is the second prediction mode, the weight of the template with respect to the second prediction mode is 8-wVemplateValue[x][y], where 8 is only an example and can be other values, which are not limited in the embodiments of the present application. The above example 2 can determine the weight of the template with respect to the jth prediction mode in the i-th candidate weight derivation mode, and then determine the weight of the first point in the weight of the template with respect to the j-th prediction mode as the weight of the first point in the adjacent block with respect to the j-th prediction mode. In the above method 1, the weight of the first point in the adjacent block is directly determined by referring to the method for determining the template weight, so that the weight of the first point can be accurately determined. In this way, based on the weight of the first point, the weight of the adjacent block with respect to the jth prediction mode can be accurately determined. Mode 2: Based on the weight of the second point in the current block, the weight of the first point in the adjacent block is determined. In this case, the above step 21-A includes the following steps: Step 21-A-21, determining the second point corresponding to the first point in the current block; Step 21-A-22, determining the weight of the second point based on the i-th candidate weight derivation mode and the attribute information of the current block; Step 21-A-23: Determine the weight of the first point based on the weight of the second point. In this method 2, it can be seen from the above that when the weight of the first point in the adjacent block is directly determined, the relevant information of the template needs to be considered, thereby increasing the complexity of determining the weight of the first point. In this method 2, the weight of the first point in the adjacent block is determined by the weight of the second point in the current block. When determining the weight of the second point, it is not necessary to consider the relevant information of the template, thereby reducing the complexity of determining the weight of the first point. The embodiment of the present application does not limit the specific position of the second point corresponding to the first point in the current block. In some embodiments, the second point is a point in the current block that is closest to the first point. In one example, the second point is a point in the current block that is adjacent to the first point. For example, as shown in FIG18 , the first point is a point at (x0-1, y0-1) in the adjacent block, and the second point may be a point at (x0, y0) in the current block. For another example, as shown in FIG18 , the first point is a point at (x0-1, y0+height-1) in the adjacent block, and the second point may be a point at (x0, y0+height-1) in the current block. In this method 2, based on the i-th candidate weight derivation mode and the attribute information of the current block, the specific process of determining the weight of the second point can be, based on the i-th candidate weight derivation mode, determining the division angle index variable angleIdx and the distance index variable distanceIdx corresponding to the i-th candidate weight derivation mode, and based on the attribute information of the current block, determining the size of the current block (nCbW)X(nCbH). Referring to the above method for determining the weight of the prediction value, the weight of the second point in the current block is determined. It should be noted that the above is explained with the j-th prediction mode as the first prediction mode as an example, that is, the above determination is the weight of the second point with respect to the first prediction mode. If the j-th prediction mode is the second prediction mode, the weight of the second point with respect to the second prediction mode is 8-wVemplateValue[x][y], where 8 is only an example and can also be other values, which are not limited in the embodiments of the present application. After the decoding end determines the weight of the second point in the current block with respect to the j-th prediction mode, the weight of the first point in the adjacent block is determined based on the weight of the second point. For example, if the second point is adjacent to the first point, the weight of the second point can be directly determined as the weight of the first point. For another example, if the second point is not adjacent to the first point, the weight of the second point can be corrected to obtain the weight of the first point. The embodiment of the present application does not limit the correction method, for example, a preset value is added or subtracted based on the weight of the second point to obtain the weight of the first point. It should be noted that, in the process of determining the weight of the first point shown in the above method 1 and determining the weight of the second point shown in the above method 2, the influence of the weight gradient parameter is not considered. In some embodiments, if the influence of the weight gradient parameter is considered in the above process of determining the weight of the first point, the decoding end also needs to determine the weight gradient parameter, and then determine the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode, the attribute information of the current block and the weight gradient parameter. The variable weight gradient can adjust the gradient of the weight change, so that GPM can obtain transition areas of different widths when the dividing line angle and the dividing line offset are the same. Exemplarily, as shown in FIG. 22A and FIG. 22B , FIG. 22A is a schematic diagram of a blending area of a GPM in a VVC, and FIG. 22B is an example of a variable weight gradient of a GPM. The value of blendingCoeff can be 1 / 4, 1 / 2, 1, 2, 4, etc. Exemplarily, the value of blendingCoeff may be derived from the weight gradient index gpm_blending_idx. In some embodiments, the weight gradient index is also referred to as a transition gradient parameter or a transition parameter. In the embodiment of the present application, the methods for determining the weight gradient parameters include at least the following: Mode 1, decode the code stream to obtain the second index, the second index is used to indicate the weight gradient parameter, and the weight gradient parameter is determined according to the second index. Specifically, after the encoding end determines the weight gradient parameter, the second index corresponding to the weight gradient parameter is written into the code stream. Then, the decoding end obtains the second index by decoding the code stream, and then determines the weight gradient parameter according to the second index. In some embodiments, the second index is also referred to as a weight gradient index. In the embodiment of the present application, there is no limitation on the specific method of determining the weight gradient parameter according to the second index. In some embodiments, the decoding end determines a candidate transition parameter list, which includes multiple candidate transition parameters, and determines the candidate transition parameter corresponding to the second index in the candidate transition parameter list as the weight gradient parameter. The embodiment of the present application does not limit the method for determining the candidate transition parameter list. In one example, the candidate transition parameters in the candidate transition parameter list are preset. In another example, the decoding end selects at least one transition parameter from a plurality of preset transition parameters according to the characteristic information of the current block to form a candidate transition parameter list. For example, according to the image information of the current block, a transition parameter that matches the image information of the current block is selected from a plurality of preset transition parameters to form a candidate transition parameter list. For example, assuming that the image information includes the clarity of the image edge, if the clarity of the image edge of the current block is less than a preset value, at least one first-category weight gradient parameter from the preset multiple weight gradient parameters, such as 1 / 4, 1 / 2, etc., is selected to form a candidate weight gradient parameter list; if the clarity of the image edge of the current block is greater than or equal to the preset value, at least one second-category weight gradient parameter from the preset multiple weight gradient parameters, such as 2, 4, etc., is selected to form a candidate weight gradient parameter list. Exemplarily, the candidate weight gradient parameter list of the embodiment of the present application is shown in Table 10: Table 10 Index Candidate weight gradient parameter 0 Candidate weight gradient parameter 01 Candidate weight gradient parameter 1 …………i Candidate weight gradient parameter i ………… As shown in Table 10, the candidate weight gradient parameter list includes multiple candidate weight gradient parameters, and each candidate weight gradient parameter corresponds to an index. Exemplarily, in the above Table 10, the ranking of the candidate weight gradient parameters in the candidate weight gradient parameter list is used as the index. Optionally, the index of the candidate weight gradient parameters in the candidate weight gradient parameter list can also be reflected in other ways, and the embodiments of the present application are not limited to this. Based on the above Table 10, the decoding end determines the candidate weight gradient parameter corresponding to the second index in Table 10 as the weight gradient parameter according to the second index. The decoding end decodes the bit stream through the above-mentioned method 1 to obtain the second index, and then determines the weight gradient parameter according to the second index. Alternatively, the weight gradient parameter can be determined according to the following method 2. In some embodiments, the weight gradient index may not be transmitted in the bitstream, but a weight gradient index gpm_blending_idx or blendingCoeff may be directly derived according to the block size, etc. The decoding end may also determine the weight gradient parameter by the following method 2. In method 2, the decoding end determines multiple candidate weight gradient parameters, where G is a positive integer; and determines the weight gradient parameter from the multiple candidate weight gradient parameters. In this method 2, the decoder determines the weight gradient parameter by itself, thereby avoiding the encoder from including the second index in the bitstream, thereby saving codewords. Specifically, the decoder first determines multiple candidate weight gradient parameters, and then determines one candidate weight gradient parameter from the multiple candidate weight gradient parameters as the weight gradient parameter. The embodiment of the present application does not limit the specific manner in which the decoding end determines multiple candidate weight gradient parameters. In a possible implementation, the above-mentioned multiple candidate weight gradient parameters are preset, that is, the decoding end and the encoding end agree to determine several preset weight gradient parameters as G candidate weight gradient parameters. In another possible implementation, the multiple candidate weight gradient parameters may be indicated by the encoding end, for example, the encoding end indicates that multiple weight gradient parameters among the preset multiple weight gradient parameters are used as multiple candidate weight gradient parameters. In another possible implementation, a plurality of candidate weight gradient parameters may be determined according to the size of the current block. In another possible implementation, image information of the current block is determined; and multiple candidate weight gradient parameters are determined from multiple preset candidate weight gradient parameters according to the image information of the current block. After the decoding end determines a plurality of candidate weight gradient parameters, it determines a weight gradient parameter from the plurality of candidate weight gradient parameters. The embodiment of the present application does not limit the specific method of determining the weight gradient parameter from these multiple candidate weight gradient parameters. In some embodiments, any candidate weight gradient parameter among a plurality of candidate weight gradient parameters is determined as the weight gradient parameter. In some embodiments, a cost corresponding to each of a plurality of candidate weight gradient parameters is determined, and a weight gradient parameter is determined from the plurality of candidate weight gradient parameters according to the cost. For example, the weight gradient parameter with the smallest cost is determined as the gradient parameter corresponding to the current block. Method 3: Determine the weight gradient parameter according to the size of the current block. It can be seen from the above that there is a certain correlation between the weight gradient parameter and the size of the block. Therefore, the embodiment of the present application can also determine the weight gradient parameter according to the size of the current block. In a possible implementation, a fixed weight gradient parameter is determined as the weight gradient parameter according to the size of the current block. For example, if the size of the current block is smaller than a first set threshold, the weight gradient parameter is determined to be a first value. For another example, if the size of the current block is greater than or equal to a first set threshold, the weight gradient parameter is determined to be a second value, wherein the second value is smaller than the first value. The embodiment of the present application does not limit the specific values of the first value, the second value and the first set threshold. Exemplarily, the first value is 1 and the second value is 1 / 2. For example, if the size of the current block is represented by the number of pixels (or sampling points) of the current block, the first set threshold may be 256 or the like. In another possible implementation, the value range of the weight gradient parameter is determined according to the size of the current block, and then the weight gradient parameter is determined to be a value within the value range. For example, if the size of the current block is less than the first set threshold, it is determined that the weight gradient parameter is within the weight gradient parameter value range. For example, the weight gradient parameter is any weight gradient parameter such as the minimum weight gradient parameter, the maximum weight gradient parameter, or the intermediate weight gradient parameter within the weight gradient parameter value range. For another example, the weight gradient parameter is the weight gradient parameter with the lowest cost within the weight gradient parameter value range. Among them, the method for determining the weight gradient parameter cost can refer to the description of other embodiments of the present application, and will not be repeated here. For another example, if the size of the current block is greater than or equal to the first set threshold, it is determined that the weight gradient parameter is within the second weight gradient parameter value range. For example, the weight gradient parameter is any weight gradient parameter such as the minimum weight gradient parameter, the maximum weight gradient parameter, or the intermediate weight gradient parameter within the second weight gradient parameter value range. For another example, the weight gradient parameter is the weight gradient parameter with the lowest cost within the second weight gradient parameter value range. Among them, the minimum value of the second weight gradient parameter value range is less than the minimum value of the weight gradient parameter value range, and the weight gradient parameter value range may or may not intersect with the second weight gradient parameter value range, and the embodiment of the present application does not limit this. After the decoder determines the weight gradient parameters according to the above steps, it determines the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode, the attribute information of the current block and the weight gradient parameters. In one example, the decoding end determines the weight index weightIdx based on the i-th candidate weight derivation mode and the attribute information of the current block, such as the weight index weightIdx corresponding to the first point in the adjacent block or the weight index weightIdx corresponding to the second point in the current block. Then, the weight index weightIdx is processed using the weight gradient parameter determined above to obtain the processed weight index weightIdx; based on the processed weightIdx, the weight wVemplateValue of the first point or the second point is determined. In one example, the weight wVemplateValue of the first point or the second point may be determined using the weight gradient parameter in the following manner: … weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY] weightIdx=weightIdx*blendingCoeff weightIdxL=partFlip? 32+weightIdx:32-weightIdx wValue=Clip3(0,8,(weightIdxL+4)>>3) Among them, blendingCoeff1 is the weight gradient parameter. The above embodiment introduces the specific process of determining the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block in the above step 21-A. Then, the weight of the first point is determined as the weight of the adjacent block with respect to the j-th prediction mode. In the above-mentioned method 2, after the decoding end determines the weights of each adjacent block of the current block with respect to the j-th prediction mode through the above-mentioned steps, the above-mentioned step 22 is executed, that is, based on the weights of the adjacent blocks with respect to the j-th prediction mode, a candidate prediction mode list of the j-th prediction mode is determined. The implementation process of the above step 22 includes but is not limited to the following: Mode 1, the above step 22 includes the following steps: Step 22-A1: if the weight of the neighboring block with respect to the j-th prediction mode is greater than or equal to a preset threshold, obtain the prediction mode of the neighboring block; Step 22-A2: Determine a candidate prediction mode list for the j-th prediction mode based on the prediction modes of the adjacent blocks. In the method 1, the decoding end determines the weight of each adjacent block of the current block with respect to the jth prediction mode based on the above steps in the i-th candidate weight derivation mode. Then, the weight corresponding to each adjacent block is compared with the preset threshold. If the weight corresponding to the adjacent block is greater than or equal to the preset threshold, it means that the adjacent block has a strong correlation with the j-th prediction mode, and then the candidate prediction mode list of the j-th prediction mode can be determined based on the prediction mode of the adjacent block. For example, the prediction mode of the adjacent block is added to the candidate prediction mode list of the j-th prediction mode. In some embodiments, if the weight ranges from 0 to n, the above preset threshold is n / 2, where n is a positive number. In some embodiments, if the value of the weight is the first value or the second value, for example, the value of the weight is set to 0 or 1, the above step 22 includes the following steps: Step 22-B1, if the weight of the neighboring block with respect to the j-th prediction mode is equal to a first value, obtaining the prediction mode of the neighboring block, wherein the first value is greater than the second value; Step 22-B2: Based on the prediction modes of the adjacent blocks, determine a candidate prediction mode list for the j-th prediction mode. In this embodiment, if the weight of the adjacent block with respect to the j-th prediction mode is either the first value or the second value, when it is determined that the weight of the adjacent block with respect to the j-th prediction mode is equal to the first value, it means that the adjacent block has a strong correlation with the j-th prediction mode, and then based on the prediction mode of the adjacent block, a candidate prediction mode list for the j-th prediction mode can be determined. The embodiment of the present application does not limit the specific values of the first value and the second value. Optionally, the first value is 1. Optionally, the second value is 0. In some embodiments, if the weight corresponding to the adjacent block is less than a preset threshold, or the weight corresponding to the adjacent block is equal to a second value, it means that the correlation between the adjacent block and the j-th prediction mode is weak, and thus the candidate prediction mode list of the j-th prediction mode is not determined based on the prediction mode of the adjacent block. For example, obtaining the prediction mode of the adjacent block is skipped, thereby improving the accuracy of determining the candidate prediction mode list. In the embodiment of the present application, there is no limitation on the number of adjacent blocks included in the current block and the specific positions of the adjacent blocks. In some embodiments, if the length of the candidate prediction mode list for the j-th prediction mode is not restricted, the weights of each adjacent block of the current block with respect to the j-th prediction mode can be compared with a preset threshold or a first value in a random manner to obtain the prediction mode of the adjacent blocks whose weights are greater than or equal to the preset threshold or equal to the first value. In some embodiments, if the length of the candidate prediction mode list of the j-th prediction mode is limited, obtaining the prediction mode of the adjacent block in the above step 22-A1 includes: according to a preset inspection order, obtaining in turn the prediction mode of the adjacent blocks of the current block whose weights for the j-th prediction mode are greater than or equal to a preset threshold or equal to a first value. The embodiment of the present application does not limit the above-mentioned preset inspection order. In some embodiments, if the neighboring blocks included in the current block are as shown in FIG. 18 , if the neighboring blocks of the current block include the left neighboring block L, the upper neighboring block A, the lower left neighboring block BL, the upper right neighboring block AR and the upper left neighboring block AL, then the preset inspection order is the left neighboring block, the upper neighboring block, the lower left neighboring block, the upper right neighboring block and the upper left neighboring block, that is, L->A->BL->AR->AL. That is to say, the weight of the left neighboring block of the current block with respect to the j-th prediction mode is first compared with the preset threshold or the first value, if the weight corresponding to the left neighboring block is greater than or equal to the preset threshold or equal to the first value, then the prediction mode of the left neighboring block is obtained, and if the weight corresponding to the left neighboring block is less than the preset threshold or equal to the second value, then the prediction mode of the left neighboring block is skipped. Next, the weight of the upper neighboring block of the current block with respect to the jth prediction mode is compared with a preset threshold or a first value. If the weight corresponding to the upper neighboring block is greater than or equal to the preset threshold or equal to the first value, the prediction mode of the upper neighboring block is obtained. If the weight corresponding to the upper neighboring block is less than the preset threshold or equal to the second value, the prediction mode of the upper neighboring block is skipped. Next, the weight of the lower left neighboring block of the current block with respect to the jth prediction mode is compared with a preset threshold or a first value. If the weight corresponding to the lower left neighboring block is greater than or equal to the preset threshold or equal to the first value, the prediction mode of the lower left neighboring block is obtained. If the weight corresponding to the lower left neighboring block is less than the preset threshold or equal to the second value, the prediction mode of the lower left neighboring block is skipped. Next, the weight of the upper right neighboring block of the current block with respect to the jth prediction mode is compared with a preset threshold or a first value. If the weight corresponding to the upper right neighboring block is greater than or equal to the preset threshold or equal to the first value, the prediction mode of the upper right neighboring block is obtained. If the weight corresponding to the upper right neighboring block is less than the preset threshold or equal to the second value, the prediction mode of the upper right neighboring block is skipped. Finally, the weight of the upper left neighboring block of the current block with respect to the jth prediction mode is compared with a preset threshold or a first value. If the weight corresponding to the upper left neighboring block is greater than or equal to the preset threshold or equal to the first value, the prediction mode of the upper left neighboring block is obtained. If the weight corresponding to the upper left neighboring block is less than the preset threshold or equal to the second value, the prediction mode of the upper left neighboring block is skipped. According to the above inspection order, the above inspection is performed on the adjacent blocks L->A->BL->AR->AL in sequence until the length of the candidate prediction mode list corresponding to the jth prediction mode reaches the upper limit or all the above adjacent blocks are checked. In some embodiments, the decoding end does not restrict the order in which the prediction modes of adjacent blocks are filled into the candidate prediction mode list corresponding to the j-th prediction mode. In some embodiments, the decoding end adds the prediction modes of the acquired adjacent blocks to the candidate prediction mode list of the j-th prediction mode in sequence according to the inspection order. For example, the decoding end first determines whether the weight of the adjacent block L with respect to the j-th prediction mode is less than or equal to the preset threshold, or is equal to the first value. If the weight of the adjacent block L with respect to the j-th prediction mode is less than or equal to the preset threshold, or is equal to the first value, then the prediction mode of the adjacent block L is added to the candidate prediction mode list corresponding to the j-th prediction mode. Next, it is determined whether the weight of the adjacent block A with respect to the j-th prediction mode is less than or equal to the preset threshold, or is equal to the first value. If the weight of the adjacent block A with respect to the j-th prediction mode is less than or equal to the preset threshold, or is equal to the first value, then the prediction mode of the adjacent block A is added to the candidate prediction mode list corresponding to the j-th prediction mode, and so on, until the length of the candidate prediction mode list corresponding to the j-th prediction mode reaches the upper limit or all the above adjacent blocks are checked. In some embodiments, if the candidate prediction mode list does not include a repeated candidate prediction mode, before adding the prediction mode of the adjacent block whose weight is greater than or equal to the preset threshold or equal to the first value to the candidate prediction mode list, first determine whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block, and if the candidate prediction mode list of the j-th prediction mode does not include the prediction mode of the adjacent block, add the prediction mode of the adjacent block to the candidate prediction mode list of the j-th prediction mode. If the candidate prediction mode list of the j-th prediction mode already includes the prediction mode of the adjacent block, skip adding the prediction mode of the adjacent block to the candidate prediction mode list of the j-th prediction mode. In method 1, the prediction modes of the adjacent blocks whose weights with respect to the j-th prediction mode are greater than or equal to a preset threshold or equal to a first value in each adjacent block are added to the candidate prediction mode list of the j-th prediction mode, thereby improving the accuracy of determining the candidate prediction mode list. In some embodiments, the decoding end may also determine the candidate prediction mode list of the j-th prediction mode by the following method 2. Mode 2: If the current block includes M adjacent blocks, where M is a positive integer, then the above step 22 includes the following step 22-C1: Step 22-C1: Determine a candidate prediction mode list for the jth prediction mode based on the weights of the M neighboring blocks with respect to the jth prediction mode and the prediction modes of the M neighboring blocks. For example, based on the weights of the M adjacent blocks respectively with respect to the jth prediction mode, several adjacent blocks whose weights are within a preset range are selected from the M adjacent blocks, and the prediction modes of these adjacent blocks are added to the candidate prediction mode list of the jth prediction mode. For another example, based on the weights of the M adjacent blocks with respect to the jth prediction mode, the prediction modes of the M adjacent blocks are added to the candidate prediction mode list until the length of the candidate prediction mode list reaches a preset length. For example, the adjacent blocks with larger weights have a greater probability of being added to the candidate prediction mode list, but the adjacent blocks with smaller weights also have a chance to be added to the candidate prediction mode list, but the probability is smaller. The embodiment of the present application does not limit the specific number and positions of the M adjacent blocks. In some embodiments, the M neighboring blocks include at least one of a left neighboring block, an upper neighboring block, a lower left neighboring block, an upper right neighboring block, and an upper left neighboring block of the current block. From the above, it can be seen that when determining the candidate prediction mode list of the j-th prediction mode under the i-th candidate weight derivation mode, the above steps determine the candidate prediction mode list of the j-th prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, for example, by determining the weights of the neighboring blocks of the current block with respect to the j-th prediction mode, and based on the weights, determine whether to add the prediction mode of the neighboring blocks to the candidate prediction mode list of the j-th prediction mode. Based on this, in an embodiment of the present application, before the decoding end determines the candidate prediction mode list of the jth prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, it is first necessary to determine whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block. If it is determined that the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block, the candidate prediction mode list of the j-th prediction mode is determined based on the i-th candidate weight derivation mode and the attribute information of the current block. The embodiment of the present application does not limit the specific manner in which the decoding end determines whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block. In the first example, the encoder and the decoder assume that the candidate prediction mode list corresponding to the current block includes the prediction mode of the adjacent block, based on which the decoder can determine that the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block. Alternatively, the encoder and the decoder assume that the candidate prediction mode list corresponding to the current block does not include the prediction mode of the adjacent block, based on which the decoder can determine that the candidate prediction mode list of the j-th prediction mode does not include the prediction mode of the adjacent block. In the second example, the decoding end decodes the code stream to obtain first information, where the first information is used to indicate whether the candidate prediction mode list includes the prediction mode of the adjacent block; based on the first information, it is determined whether the candidate prediction mode list of the jth prediction mode includes the prediction mode of the adjacent block. Optionally, the first information may be frame-level information, that is, indicating whether the candidate prediction mode list corresponding to the current frame includes the prediction mode of the adjacent block. Optionally, the first information may be block-level information, that is, indicating whether the candidate prediction mode list corresponding to the current block includes the prediction mode of the adjacent block. Optionally, the first information may also be indication information of other levels, which is not limited in the embodiments of the present application, as long as the decoding end can determine through the first information whether the candidate prediction mode list of the jth prediction mode corresponding to the current block includes the prediction mode of the adjacent block. In the third example, after the decoding end adds each prediction mode located before the prediction mode of the adjacent block in the preset order to the candidate prediction mode list in a preset order, when the length of the candidate prediction mode list does not reach the preset length, it is determined that the candidate prediction mode list of the jth prediction mode includes the prediction mode of the adjacent block. In this example, the candidate prediction mode list of the j-th prediction mode also includes other prediction modes. When determining the candidate prediction mode list of the j-th prediction mode, the decoding end first adds prediction modes to the candidate prediction mode list of the j-th prediction mode in sequence according to a preset order, and determines whether the length of the candidate prediction mode list reaches a preset length after each prediction mode located before the prediction mode of the adjacent block in the preset order is added to the candidate prediction mode list. If the length of the candidate prediction mode list does not reach the preset length after each prediction mode located before the prediction mode of the adjacent block in the preset order is added to the candidate prediction mode list, it is determined that the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block. If the length of the candidate prediction mode list reaches the preset length after each prediction mode located before the prediction mode of the adjacent block in the preset order is added to the candidate prediction mode list, it is determined that the candidate prediction mode list of the j-th prediction mode does not include the prediction mode of the adjacent block. In some embodiments, the decoding end adds, in a preset order, a prediction mode whose prediction angle is parallel to the dividing line of the i-th candidate weight derivation mode, a candidate prediction mode derived based on a template of the current block, a candidate prediction mode derived based on reconstructed pixels around the current block, a prediction mode of an adjacent block, a prediction mode whose prediction angle is perpendicular to the dividing line of the i-th candidate weight derivation mode, and a preset mode to the candidate prediction mode list of the j-th prediction mode until the length of the list reaches a preset length. The embodiment of the present application does not limit the preset order. In one example, the preset order includes: a prediction mode whose prediction angle is parallel to the dividing line of the i-th candidate weight derivation mode, a candidate prediction mode derived based on the template of the current block, a candidate prediction mode derived based on the surrounding reconstructed pixels of the current block, a prediction mode of an adjacent block, a prediction mode whose prediction angle is perpendicular to the dividing line of the i-th candidate weight derivation mode, and a preset mode. In some embodiments, the candidate prediction mode derived based on the template of the current block can be understood as a prediction mode derived by TIMD. In some embodiments, the candidate prediction mode derived based on surrounding reconstructed pixels of the current block may be understood as a prediction mode derived by DIMD. In some embodiments, the preset mode includes a PLANAR mode. In one example, when constructing a candidate prediction mode list for the j-th prediction mode, the following types of prediction modes are added to the candidate prediction mode list in order until the list length reaches a preset length (for example, 3): 1. A prediction mode whose prediction angle is parallel to the dividing line of the i-th candidate weight derivation mode; 2. Prediction model derived from TIMD; 3. Prediction model derived from DIMD; 4. Prediction mode of neighboring blocks of the current block; 5. A prediction mode whose prediction angle is perpendicular to the dividing line of the i-th candidate weight derivation mode; 6.PLANAR mode. The above embodiment introduces the specific process of determining the candidate prediction mode list at the decoding end. After the decoding end determines the candidate prediction mode list based on the above steps, it executes the following step S103. S103. Determine a first weight derivation mode and K first prediction modes corresponding to the current block based on N candidate weight derivation modes and at least one candidate prediction mode. The decoding end determines N candidate weight derivation modes based on the above step S101, determines at least one candidate prediction mode based on the above step S102, and then selects one candidate weight derivation mode from the N candidate weight derivation modes as the first weight derivation mode corresponding to the current block, and determines at least one first prediction mode from the at least one candidate prediction mode included in the at least one candidate prediction mode. Finally, the current block is predicted using the determined first weight derivation mode and the K first prediction modes to obtain a predicted value of the current block. It should be noted that the above-mentioned first weight derivation mode and the K first prediction modes are used together to determine the prediction value of the current block. In some embodiments, the above-mentioned first weight derivation mode is also referred to as the weight derivation mode of the current block or the weight derivation mode corresponding to the current block. In some embodiments, the K first prediction modes are also referred to as the K prediction modes of the current block or the K prediction modes corresponding to the current block. In one example, if K=2, the above-mentioned K first prediction modes include the first prediction mode and the second prediction mode corresponding to the current block. In some embodiments, the first prediction mode is referred to as the first prediction mode, and the second prediction mode is referred to as the second prediction mode. The embodiment of the present application does not limit the specific manner in which the decoding end determines the first weight derivation mode and K first prediction modes based on N candidate weight derivation modes and at least one candidate prediction mode. In some embodiments, in the intra-frame and inter-frame prediction of GPM, as shown in FIG17A , N=1, that is, N candidate weight derivation modes are the first weight derivation mode, assuming that the first prediction mode is the inter-frame prediction mode and the second prediction mode is the intra-frame prediction mode. As shown in S102 above, the decoding end determines a candidate prediction mode list of the second prediction mode based on the first weight derivation mode and the attribute information of the current block, and then selects a candidate prediction mode from the candidate prediction mode list of the second prediction mode as the second prediction mode, for example, the candidate prediction mode with the lowest cost in the candidate prediction mode list is determined as the second prediction mode. Next, the current block is predicted based on the first weight derivation mode, the first prediction mode and the second prediction mode to obtain a predicted value of the current block. In some embodiments, if at least one candidate prediction mode is a candidate prediction mode list corresponding to K first prediction modes, that is, the K first prediction modes are all selected from the candidate prediction mode list, at this time, the decoding end combines the N candidate weight derivation modes with the candidate prediction modes included in the candidate prediction mode list. For example, each candidate weight derivation mode in the N candidate weight derivation modes is combined with any K candidate prediction modes in the candidate prediction mode list to obtain multiple combinations, each of which includes a candidate weight derivation mode and K candidate prediction modes. Then, the template of the current block is predicted using the candidate weight derivation mode and the K candidate prediction modes included in each combination, and the cost of each combination is determined, and then based on the cost, a combination is determined from multiple combinations, for example, a combination with the minimum cost is selected from multiple combinations, and the candidate weight derivation mode included in the combination with the minimum cost is determined as the first weight derivation mode, and the K prediction modes included in the combination with the minimum cost are determined as the K first prediction modes. In some embodiments, if at least one candidate prediction mode is a candidate prediction mode list of a first prediction mode among K first prediction modes, for example, K=2, the above candidate prediction mode is a candidate prediction mode list of the first prediction mode, at this time, the decoding end determines the optional prediction mode set corresponding to the second prediction mode. Next, for each candidate weight derivation mode among the N candidate weight derivation modes, the decoding end selects a candidate prediction mode from the candidate prediction mode list of the first prediction mode as a possibility of the first prediction mode, and selects a prediction mode from the optional prediction mode set corresponding to the second prediction mode as a possibility of the second prediction mode, and obtains a combination of the candidate weight derivation mode, a possibility of the first prediction mode, and a possibility of the second prediction mode, so that multiple combinations can be obtained. Each combination includes a candidate weight derivation mode and 2 candidate prediction modes. Next, the template of the current block is predicted using the candidate weight derivation modes and two candidate prediction modes included in each combination to determine the cost of each combination, and then based on the cost, a combination is determined from multiple combinations, for example, a combination with the smallest cost is selected from multiple combinations, the candidate weight derivation mode included in the combination with the smallest cost is determined as the first weight derivation mode, and the K prediction modes included in the combination with the smallest cost are determined as K first prediction modes. In some embodiments, if the at least one candidate prediction mode includes a candidate prediction mode list corresponding to each of the K first prediction modes, that is, the decoding end determines K candidate prediction modes based on the above step S102. For example, assuming K=2, the decoding end determines the candidate prediction mode list of the first prediction mode and the candidate prediction mode of the second prediction mode. In this way, the decoding end selects a candidate weight derivation mode from the N candidate weight derivation modes, selects a candidate prediction mode from the candidate prediction mode list of the first prediction mode, and selects a candidate prediction mode from the candidate prediction mode list of the second prediction mode. At this time, the selected candidate weight derivation mode and the two candidate prediction modes form a combination. Referring to the above method, multiple combinations can be obtained. Each combination includes a candidate weight derivation mode and two candidate prediction modes. Next, the template of the current block is predicted using the candidate weight derivation modes and two candidate prediction modes included in each combination to determine the cost of each combination, and then based on the cost, a combination is determined from multiple combinations, for example, a combination with the smallest cost is selected from multiple combinations, the candidate weight derivation mode included in the combination with the smallest cost is determined as the first weight derivation mode, and the K prediction modes included in the combination with the smallest cost are determined as K first prediction modes. Based on the above description, a weight derivation mode and K prediction modes can act together on the current block as a combination. In order to save codewords and reduce encoding costs, in some embodiments, the weight derivation mode and K prediction modes corresponding to the current block are used as a combination, i.e., a first combination. The first index is used to indicate the first combination. Compared with indicating the weight derivation mode and K prediction modes separately, the embodiments of the present application use fewer codewords, thereby reducing the encoding cost. Based on this, the above S103 includes the following steps S103-A to S103-C: S103-A, decoding the bitstream to obtain a first index, where the first index is used to indicate a first combination, where the first combination includes a first weight derivation mode and K first prediction modes; S103-B, determining a candidate combination list based on the N candidate weight derivation modes and at least one candidate prediction mode, the candidate combination list including at least one candidate combination, the candidate combination including a weight derivation mode and K prediction modes; S103-C. Based on the first index, determine a first combination from the candidate combination list. The embodiment of the present application does not limit the specific syntax element form of the first index. In a possible implementation, if the current block is predicted using the GPM technology, gpm_cand_idx is used to represent the first index. Since the above-mentioned first index is used to indicate the first combination, in some embodiments, the first index may also be referred to as a first combination index or an index of the first combination. In one example, the syntax after adding the first index in the code stream is as shown in Table 11: Table 11 Among them, gpm_cand_idx is the first index. Exemplarily, the candidate combination list is shown in Table 12: Table 12 Index candidate combination 0 candidate combination 1 (including one weight derivation mode and K prediction modes) 1 candidate combination 2 (including one weight derivation mode and K prediction modes) ………… i-1 candidate combination i (including one weight derivation mode and K prediction modes) ………… As shown in Table 12, the candidate combination list includes multiple candidate combinations, and any two of the multiple candidate combinations are not completely the same, that is, the weight derivation mode included in any two candidate combinations is different from at least one of the K prediction modes. For example, the weight derivation mode in candidate combination 1 is different from that in candidate combination 2, or the weight derivation mode in candidate combination 1 is the same as that in candidate combination 2, and at least one of the K prediction modes is different, or the weight derivation mode in candidate combination 1 is different from that in candidate combination 2, and at least one of the K prediction modes is different, or the weight derivation mode in candidate combination 1 is different from that in candidate combination 2, and at least one of the K prediction modes is different. Illustratively, in the above Table 12, the ranking of the candidate combinations in the candidate combination list is used as the index. Optionally, the index of the candidate combination in the candidate combination list may also be reflected in other ways, which is not limited in the embodiment of the present application. In this embodiment, the decoding end decodes the bit stream, obtains the first index, and determines a candidate combination list as shown in Table 12 above, and searches the candidate combination list according to the first index to obtain the first weight derivation mode and K prediction modes included in the first combination indicated by the first index. For example, the first index is index 1, and in the candidate combination list shown in Table 12, the candidate combination corresponding to index 1 is candidate combination 2, that is, the first combination indicated by the first index is candidate combination 2. In this way, the decoding end determines the weight derivation mode and K prediction modes included in candidate combination 2 as the first weight derivation mode and K first prediction modes included in the first combination, and uses the first weight derivation mode and K first prediction modes to predict the current block to obtain a prediction value of the current block. In this mode 2, the encoder and the decoder can respectively determine the same candidate combination list, for example, the encoder and the decoder both determine a list including X candidate combinations, each candidate combination including 1 weight derivation mode and K prediction modes. In the bitstream, the encoder only needs to write a candidate combination finally selected, for example, the first combination, and the decoder parses the first combination finally selected by the encoder, specifically, the decoder decodes the bitstream to obtain the first index, and determines the first combination in the candidate combination list determined by the decoder through the first index. The specific process of determining the candidate combination list based on N candidate weight derivation modes and at least one candidate prediction mode in the above S103-B is introduced below. The embodiment of the present application does not limit the specific method of determining the candidate combination list based on N candidate weight derivation modes and at least one candidate prediction mode in the above S103-B. In some embodiments, N candidate weight derivation modes are arbitrarily combined with multiple candidate prediction modes included in at least one candidate prediction mode, and each combination includes a weight derivation mode and two prediction modes. In this way, multiple combinations can be obtained, and the probability of occurrence of different combinations is analyzed using information related to the current block, and a candidate combination list is constructed according to the probability of occurrence of each combination. Optionally, the information related to the current block includes mode information of surrounding blocks of the current block, reconstructed pixels of the current block, etc. In some embodiments, the above S103-B includes the following steps S103-B1 and S103-B2: S103-B1, obtaining T second combinations based on N candidate weight derivation modes and at least one candidate prediction mode; S103-B2. Based on the T second combinations, obtain a candidate combination list. Wherein, any second combination of the T second combinations includes a weight derivation mode and K prediction modes, and the weight derivation mode and the K prediction modes included in any two combinations of the T second combinations are not completely the same, and T is a positive integer greater than 1 In this embodiment, the decoding end determines T second combinations based on N candidate weight derivation modes and at least one candidate prediction mode. The present application does not limit the specific values of the T second combinations, such as 8, 16, 32, etc. Each of the T second combinations includes a weight derivation mode and K prediction modes, and the weight derivation modes and K prediction modes included in any two of the T second combinations are not exactly the same. The embodiment of the present application does not limit the specific method of obtaining T second combinations based on N candidate weight derivation modes and at least one candidate prediction mode in the above S103-B1. In some embodiments, if the at least one candidate prediction mode is a candidate prediction mode list corresponding to K first prediction modes, that is, the K first prediction modes are all selected from the candidate prediction mode list. At this time, the decoding end combines the N candidate weight derivation modes with the candidate prediction modes included in the candidate prediction mode list. For example, each of the N candidate weight derivation modes is combined with any K candidate prediction modes in the candidate prediction mode list to obtain T second combinations, each of which includes a candidate weight derivation mode and K candidate prediction modes. In some embodiments, if the at least one candidate prediction mode is a candidate prediction mode list of a first prediction mode among the K first prediction modes, for example, K=2, the candidate prediction mode is a candidate prediction mode list of the first prediction mode, at this time, the decoding end determines the optional prediction mode set corresponding to the second prediction mode. Next, for each candidate weight derivation mode among the N candidate weight derivation modes, the decoding end selects a candidate prediction mode from the candidate prediction mode list of the first prediction mode as a possibility of the first prediction mode, and selects a prediction mode from the optional prediction mode set corresponding to the second prediction mode as a possibility of the second prediction mode, and obtains a second combination of the candidate weight derivation mode, a possibility of the first prediction mode, and a possibility of the second prediction mode. In this way, there can be T second combinations, each of which includes a candidate weight derivation mode and 2 candidate prediction modes. In some embodiments, if the at least one candidate prediction mode includes a candidate prediction mode list corresponding to each of the K first prediction modes, that is, the decoding end determines K candidate prediction modes based on the above step S102. For example, assuming K=2, the decoding end determines the candidate prediction mode list of the first prediction mode and the candidate prediction mode of the second prediction mode. In this way, the decoding end selects a candidate weight derivation mode from the N candidate weight derivation modes, selects a candidate prediction mode from the candidate prediction mode list of the first prediction mode, and selects a candidate prediction mode from the candidate prediction mode list of the second prediction mode. At this time, the selected candidate weight derivation mode and the two candidate prediction modes form a second combination. Referring to the above method, T second combinations can be obtained, each of which includes a candidate weight derivation mode and two candidate prediction modes. The implementation methods of obtaining the candidate combination list based on the T second combinations in the above S103-B2 include but are not limited to the following methods: Method 1: sort the T second combinations according to a preset rule to obtain a candidate combination list. Mode 2, the above S103-B2 includes the following steps: S103-B21, for any second combination among the T second combinations, determining a cost corresponding to the second combination when the weight derivation mode and the K prediction modes in the second combination are used to predict the template of the current block; S103-B22. Determine a candidate combination list according to the cost corresponding to each second combination in the T second combinations. In the method 2, for each of the T second combinations, the weight derivation mode and K prediction modes included in the second combination are used to predict the template of the current block to obtain a prediction value of the template corresponding to the second combination. Specifically, for each of the T second combinations, the template of the current block is predicted using the K prediction modes in the second combination to obtain K prediction values. Next, based on the weight derivation mode in the second combination, the template weight corresponding to the second combination is determined. In some embodiments, determining the template weight according to the weight derivation mode includes the following steps: determining the angle index, distance index and transition parameter according to the weight derivation mode; determining the template weight according to the angle index, distance index, transition parameter and the size of the template. The present application may derive the template weights in the same manner as the weights of the predicted values, for example, first determining the angle index and the distance index according to the weight derivation mode. The methods for determining the template weight according to the angle index, distance index and template size include but are not limited to the following methods: Method 1: Determine the first parameter of the pixel in the template according to the angle index, the distance index and the size of the template. In some embodiments, the first parameter is also called the weight index weightIdx; determine the weight of the pixel in the template according to the first parameter of the pixel in the template; determine the template weight according to the weight of the pixel in the template. The specific process can refer to the process of determining the template weight in S102 above, which will not be repeated here. Method 2 is to determine the weights of the current block and the template according to the weight derivation mode. That is to say, in method 2, the merged area composed of the current block and the template is taken as a whole, and the weights of the pixels in the merged area are derived according to the weight derivation mode. Exemplarily, the decoding end determines the weight of the pixel points in the merged area composed of the current block and the template according to the angle index, the distance index, the size of the template and the size of the current block; and determines the template weight according to the size of the template and the weight of the pixel points in the merged area. The specific process can refer to the process of determining the template weight in S102 above, which will not be repeated here. The above method is used to determine the template weight and K template prediction values corresponding to a second combination, and the K template prediction values are weighted using the template weight to obtain the template prediction value under the second combination. Since the template of the current block is a reconstructed area, the decoding end can obtain the reconstructed value of the template, so for each of the T second combinations, the cost corresponding to the second combination can be determined according to the predicted value of the template under the second combination and the reconstructed value of the template. The method of determining the cost corresponding to the second combination includes but is not limited to SAD, SATD, SEE, etc. Then, according to the cost corresponding to each of the T second combinations, a candidate combination list is constructed. In the embodiment of the present application, the template prediction value corresponding to the second combination includes at least the following methods: The first method is that the template prediction value corresponding to the second combination is a numerical value, that is, the decoding end uses the K prediction modes included in the second combination to predict the template to obtain K prediction values, determines the template weight according to the weight derivation mode included in the second combination, weights the K prediction values by the template weight, obtains the weighted prediction value, and determines the weighted prediction value as the template prediction value corresponding to the second combination. The second way is that in some embodiments, some hierarchical screening ideas can also be used. For example, if a weight derivation mode can get a relatively small cost, then continue to try the weight derivation mode similar to it. On the contrary, if a weight derivation mode cannot get a relatively small cost, then do not continue to try the weight derivation mode similar to it. For example, if an intra-frame prediction mode can get a relatively small cost, then continue to try the intra-frame mode similar to it. On the contrary, if an intra-frame prediction mode cannot get a relatively small cost, then do not continue to try the intra-frame prediction mode similar to it. Of course, these screening methods can also be limited to the case of being used in combination with another two elements. For example, under a certain weight derivation mode, if a certain intra-frame prediction mode cannot get a relatively small cost as the first prediction mode, then the situation where the intra-frame prediction mode similar to the intra-frame prediction mode is the first prediction mode under the weight derivation mode will no longer be tried. The third way is to use a fast cost calculation method to determine the cost corresponding to each second combination. As can be seen from the above, the template prediction value corresponding to the second combination includes the template prediction values corresponding to the K prediction modes included in the second combination. At this time, the costs corresponding to the K prediction modes in the second combination can be determined according to the template prediction values and template reconstruction values corresponding to the K prediction modes in the second combination; the cost corresponding to the second combination can be determined according to the costs corresponding to the K prediction modes in the second combination. For example, the sum of the costs corresponding to the K prediction modes in the second combination is determined as the cost corresponding to the second combination. In the embodiment of the present application, taking K=2 as an example, the weights on the template can be simplified to only two possibilities, 0 and 1. Then, for each pixel position, its pixel value only comes from the prediction block of the first prediction mode or the prediction block of the second prediction mode. Therefore, for a prediction mode, its cost on the template when it is the first prediction mode of a certain weight derivation mode can be calculated, that is, only the cost generated on the template by some pixels with a weight of 1 when the prediction mode is the first prediction mode under the weight derivation mode is calculated. An example is to record the cost as cost[pred_mode_idx][gpm_idx][0], where pred_mode_idx represents the index of the prediction mode, gpm_idx represents the index of the weight derivation mode, and 0 represents the first prediction mode. And the cost of the prediction mode on the template when it is used as the second prediction mode of a certain weighted derivation mode, that is, only the cost of some pixels with a weight of 1 on the template when the prediction mode is used as the second prediction mode under the weighted derivation mode is calculated. An example is to record the cost as cost[pred_mode_idx][gpm_idx][1], where pred_mode_idx represents the index of the prediction mode, gpm_idx represents the index of the weighted derivation mode, and 1 represents the second prediction mode. Then when calculating the cost of a combination, the corresponding two costs can be directly added. For example, the cost of the prediction modes pred_mode_idx0 and pred_mode_idx1 in the weighted derivation mode gpm_idx is required, where pred_mode_idx0 is the first prediction mode and pred_mode_idx1 is the second prediction mode. The cost is recorded as costTemp, then costTemp = cost[pred_mode_idx0][gpm_idx][0] + cost[pred_mode_idx1][gpm_idx][1]. If the cost of the prediction modes pred_mode_idx0 and pred_mode_idx1 in the weighted derivation mode gpm_idx is required, where pred_mode_idx1 is the first prediction mode and pred_mode_idx0 is the second prediction mode. The cost is recorded as costTemp, then costTemp=cost[pred_mode_idx1][gpm_idx][0]+cost[pred_mode_idx0][gpm_idx][1]. One benefit of this is that the weighted combination into a prediction block before calculating the cost is simplified to directly calculating the cost of the two parts, and then adding the costs to get the combined cost. Since a prediction mode may be combined with multiple other prediction modes, and for the same weight derivation mode, the cost of the prediction mode as part of the first prediction mode and the second prediction mode is fixed, these costs can be retained, that is, cost[pred_mode_idx][gpm_idx][0] and cost[pred_mode_idx][gpm_idx][1] in the above example, and reused, thereby reducing the amount of calculation. According to the above method, the cost corresponding to each second combination in the T second combinations can be determined, and then a candidate combination list is constructed according to the cost corresponding to each second combination in the T second combinations. In the embodiment of the present application, the method of determining the candidate combination list according to the cost corresponding to each second combination in the T second combinations in S103-B22 includes but is not limited to the following examples: Example 1: sort the T second combinations according to the cost corresponding to each second combination in the T second combinations; and determine the sorted T second combinations as a candidate combination list. The candidate combination list generated in this Example 1 includes T first candidate combinations. Optionally, the T first candidate combinations in the candidate combination list are sorted in ascending order according to the size of the cost, that is, the costs corresponding to the T first candidate combinations in the candidate combination list increase in sequence according to the sorting. According to the cost corresponding to each second combination in the T second combinations, sorting the T second combinations may be to sort the T second combinations in ascending order of cost. Example 2: According to the costs corresponding to the second combinations, C second combinations are selected from the T second combinations, and the list consisting of the C second combinations is determined as the candidate combination list. Optionally, the above-mentioned C second combinations are the first C second combinations with the smallest costs among the T second combinations. For example, according to the cost corresponding to each second combination among the T second combinations, C second combinations with the smallest costs are selected from the T second combinations to form a candidate combination list. In this case, the candidate combination list includes C candidate combinations. Optionally, the C candidate combinations in the candidate combination list are sorted in ascending order according to the size of the costs, that is, the costs corresponding to the C candidate combinations in the candidate combination list increase in sequence according to the sorting. Based on the above steps, the decoding end determines a candidate combination list, selects a first combination corresponding to the first index from the candidate combination list, and determines the weight derivation mode included in the first combination as the first weight derivation mode, and determines the K prediction modes included in the first combination as K first prediction modes. Based on the above steps, the decoding end determines the first weight derivation mode and K first prediction modes, and then executes the following step S104. S104 . Predict the current block according to the first weight derivation mode and the K first prediction modes to obtain a prediction value of the current block. In an embodiment of the present application, when the decoding end decodes the current block, N candidate weight derivation modes are determined, and then at least one candidate prediction mode is determined based on the N candidate weight derivation modes and the attribute information of the current block, and then the first weight derivation mode and K first prediction modes corresponding to the current block are determined based on the N candidate weight derivation modes and at least one candidate prediction mode, and then the first weight derivation mode and K first prediction modes are used to predict the current block to obtain the prediction value of the current block. That is to say, in an embodiment of the present application, when determining the candidate prediction mode list, the weight derivation mode and the attribute information of the current block are taken into consideration, thereby improving the accuracy of determining the candidate prediction mode list, and when predicting the current block based on the accurately determined candidate prediction mode list, the prediction accuracy of the current block can be improved, and the decoding performance can be improved. The embodiment of the present application does not limit the specific process of predicting the current block according to the first weight derivation mode and the K first prediction modes in the above S104 to obtain the predicted value of the current block. In case 1, when determining the prediction value weight, without considering the weight gradient parameter (also called transition parameter), the prediction value weight of the current block is determined based on the first weight derivation mode, the current block is predicted according to the K first prediction modes, K prediction values of the current block are obtained, and the K prediction values of the current block are weighted using the prediction value weight of the current block to obtain the prediction value of the current block. The process of deriving the prediction value weight of the current block according to the first weight derivation mode can refer to the process of deriving the prediction value weight of the current block in the above embodiment, which will not be repeated here. Case 2: When determining the predicted value weight, the weight gradient parameter is considered. In this case, the above S104 includes the following steps: S104-A1, determining weight gradient parameters; S104-A2, predicting the current block according to the weight gradient parameter, the first weight derivation mode and K first prediction modes to obtain a prediction value of the current block. The process of determining the weight gradient parameters in S104-A1 is basically the same as the process of determining the weight gradient parameters in S102 above. Please refer to the description of S102 above and will not be repeated here. The embodiment of the present application does not limit the specific implementation process of the above S104-A2. For example, the first weight derivation mode and K first prediction modes predict the current block to obtain a prediction value, and then determine the prediction value of the current block based on the weight gradient parameter and the prediction value. In some embodiments, the above S104-A2 includes the following steps: S104-A21, determining the weight of the predicted value according to the weight gradient parameter and the first weight derivation mode; S104-A22, predicting the current block according to the K first prediction modes to obtain K prediction values; S104-A23. Weight the K prediction values according to the weights of the prediction values to obtain the prediction value of the current block. There is no order of execution between S104-A22 and S104-A21, that is, S104-A22 can be executed before S104-A21, or after S104-A21, or in parallel with S104-A21. In this case 2, the decoding end determines the weight gradient parameter, and determines the weight of the prediction value according to the weight gradient parameter and the first weight derivation mode. Then, the current block is predicted according to the K first prediction modes to obtain K prediction values of the current block. Then, the K prediction values of the current block are weighted using the weight of the prediction value to obtain the prediction value of the current block. In the embodiment of the present application, the method of determining the weight of the predicted value according to the weight gradient parameter and the first weight derivation mode includes at least the following methods as shown in the examples: Example 1: When using the first weight derivation mode to derive the weight of the predicted value, multiple intermediate variables need to be determined. The weight gradient parameters can be used to adjust one or several of the multiple intermediate variables, and then the adjusted variables are used to derive the weight of the predicted value. Example 2, according to the first weight derivation mode and the current block, determine the weight index weightIdx corresponding to the current block; use the weight gradient parameter to process the weight index weightIdx to obtain the processed weight index weightIdx; according to the processed weightIdx, determine the weight wVemplateValue of the predicted value. In one example, the weight wVemplateValue of the predicted value may be determined using the weight gradient parameter in the following manner: … weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY] weightIdx=weightIdx*blendingCoeff weightIdxL=partFlip? 32+weightIdx:32-weightIdx wValue=Clip3(0,8,(weightIdxL+4)>>3) Among them, blendingCoeff1 is the weight gradient parameter. Next, the current block is predicted according to the K first prediction modes to obtain K prediction values; the K prediction values are weighted according to the weights of the prediction values to obtain the prediction value of the current block. The above embodiment can be understood as the template weight and the prediction value weight are two independent processes and do not interfere with each other. Through the above method, the prediction value weight can be determined separately. In some embodiments, when the weight of the template is determined by combining the merged area formed by the template area and the current block, and determining the weight of the merged area, since the merged area includes the current block, the weight corresponding to the current block in the weight of the merged area is determined as the weight of the predicted value. It should be noted that when determining the weight of the merged area, the influence of the weight gradient parameter on the weight is also taken into account, and the specific description is made with reference to the description of the above embodiment, which will not be repeated here. In some embodiments, the above prediction process is performed in units of pixels, and the corresponding weight of the above prediction value is also the weight corresponding to the pixel. At this time, when predicting the current block, each prediction mode in the K first prediction modes is used to predict a certain pixel point A in the current block, and K prediction values of the K first prediction modes about the pixel point A are obtained. The weight of the prediction value of the pixel point A is determined according to the first weight derivation mode and the weight gradient parameter. Then, the K prediction values are weighted using the weight of the prediction value of the pixel point A to obtain the prediction value of the pixel point A. The above steps are performed on each pixel point in the current block to obtain the prediction value of each pixel point in the current block, and the prediction value of each pixel point in the current block constitutes the prediction value of the current block. Taking K=2 as an example, the first prediction mode is used to predict a certain pixel point A in the current block to obtain the first prediction value of the pixel point A, and the second prediction mode is used to predict the pixel point A to obtain the second prediction value of the pixel point A. According to the prediction value weight corresponding to the pixel point A, the first prediction value and the second prediction value are weighted to obtain the prediction value of the pixel point A. In one example, taking K=2 as an example, if both the first prediction mode and the second prediction mode are intra-frame prediction modes, the first intra-frame prediction mode is used for prediction to obtain a first prediction value, the second intra-frame prediction mode is used for prediction to obtain a second prediction value, and the first prediction value and the second prediction value are weighted according to the weight of the prediction value to obtain the prediction value of the current block. For example, the first intra-frame prediction mode is used to predict pixel point A to obtain a first prediction value of pixel point A, the second intra-frame prediction mode is used to predict pixel point A to obtain a second prediction value of pixel point A, and the first prediction value and the second prediction value are weighted according to the weight of the prediction value corresponding to pixel point A to obtain the prediction value of pixel point A. In some embodiments, if K is greater than 2, the weights of the predicted values corresponding to two prediction modes in the K first prediction modes can be determined according to the first weight derivation mode, and the weights of the predicted values corresponding to the other prediction modes in the K first prediction modes can be preset values. For example, K=3, the first weights of the predicted values corresponding to the first prediction mode and the second prediction mode are derived according to the weight derivation mode, and the weight of the predicted value corresponding to the third prediction mode is a preset value. In some embodiments, if the weight of the total predicted value corresponding to the K first prediction modes is certain, for example, 8, the weights of the predicted values corresponding to each of the K first prediction modes can be determined according to the preset weight ratio. Assuming that the weight of the predicted value corresponding to the third prediction mode accounts for 1 / 4 of the weight of the entire predicted value, the weight of the predicted value of the third prediction mode can be determined to be 2, and the remaining 3 / 4 of the total predicted value weight is allocated to the first prediction mode and the second prediction mode. Exemplarily, if the weight of the predicted value corresponding to the first prediction mode is 3, the weight of the predicted value corresponding to the first prediction mode is determined to be (3 / 4)*3, and the weight of the predicted value corresponding to the second prediction mode is the weight of the predicted value of the first prediction mode is (3 / 4)*5. According to the above method, the prediction value of the current block is determined. At the same time, the code stream is decoded to obtain the quantization coefficient of the current block, the quantization coefficient of the current block is dequantized and inversely transformed to obtain the residual value of the current block, and the prediction value and the residual value of the current block are added to obtain the reconstructed value of the current block. In the video decoding method provided in the embodiment of the present application, when the decoding end decodes the current block, N candidate weight derivation modes are determined, and then at least one candidate prediction mode is determined based on the N candidate weight derivation modes and the attribute information of the current block, and then the first weight derivation mode and K first prediction modes corresponding to the current block are determined based on the N candidate weight derivation modes and at least one candidate prediction mode, and then the first weight derivation mode and K first prediction modes are used to predict the current block to obtain the prediction value of the current block. That is to say, in the embodiment of the present application, when determining at least one candidate prediction mode, the decoding end considers the attribute information of the weight derivation mode and the current block, thereby improving the accuracy of determining the candidate prediction mode, and when predicting the current block based on the accurately determined candidate prediction mode, the prediction accuracy of the current block can be improved, and the decoding performance can be improved. The above describes the video decoding method of the present application by taking the decoding end as an example, and the following describes it by taking the encoding end as an example. FIG23 is a schematic diagram of a video encoding method flow chart provided by an embodiment of the present application, and the embodiment of the present application is applied to the video encoders shown in FIG1 and FIG2. As shown in FIG24, the method of the embodiment of the present application includes: S201. Determine N candidate weight derivation modes. Wherein, N is a positive integer. Optionally, the above N is a preset value or a default value. Optionally, N can also be determined by the encoding end in other ways, and the embodiment of the present application does not limit this. From the above, it can be seen that in the embodiment of the present application, a weight derivation mode and K prediction modes jointly generate a prediction block, and this prediction block acts on the current block, that is, the weight is determined according to the weight derivation mode, and the current block is predicted according to the K prediction modes to obtain K prediction values, and the K prediction values are weighted according to the weights to obtain the prediction value of the current block. That is to say, when encoding the current block, the encoder needs to determine N candidate weight derivation modes and multiple candidate prediction modes, and then select one weight derivation mode from the N candidate weight derivation modes, and select K prediction modes from multiple candidate prediction modes, and then use the selected weight derivation mode and K prediction modes to predict the current block to obtain the prediction value of the current block. The embodiment of the present application does not limit the specific method for the decoding end to determine N candidate weight derivation modes. In a possible implementation, AWP has 56 weight derivation modes and GPM has 64 weight derivation modes. The N candidate weight derivation modes include at least one weight derivation mode among the 56 weight derivation modes in AWP, or include at least one weight derivation mode among the 64 weight derivation modes in GPM. In a possible implementation, some weight derivation modes in AWP or GPM can be screened out as N candidate weight derivation modes. That is, the N candidate weight derivation modes in the embodiment of the present application are a subset of all weight derivation modes of AWP or GPM. For example, the same "division" angle in the weight derivation mode can correspond to multiple offsets, such as modes 10, 11, 12, and 13 in Figure 4 or Figure 5. They have the same "division" angle, but different offsets. Some modes corresponding to the offsets can be removed in the embodiment of the present application. Of course, some modes corresponding to the "division" angles can also be removed. Doing so can reduce the total number of possible combinations. And make the differences between each possible combination more obvious. Of course, different screening methods can be set for different block sizes. For example, use fewer weight derivation modes for smaller blocks and more weight derivation modes for larger blocks. Different screening methods can also be set for different block shapes. One explanation is that block shape refers to the ratio of width to height. In this implementation, the encoding end and the decoding end screen and obtain N candidate weight derivation modes in the same manner. In one example, the method of screening and obtaining N candidate weight derivation modes is the default method at both the encoding and decoding ends. In another example, the encoding end can indicate the method of screening and obtaining N candidate weight derivation modes to the encoding end, so that the decoding end adopts the same method to screen and obtain the same N candidate weight derivation modes as the encoding end. In some embodiments, the weight derivation modes corresponding to the preset division angles and / or preset offsets are eliminated from the preset M weight derivation modes to obtain N weight derivation modes. Since the same division angle in the weight derivation mode can correspond to multiple offsets, as shown in FIG4 , weight derivation modes 10, 11, 12, and 13 have the same division angles but different offsets, some weight derivation modes corresponding to the preset offsets can be removed, and / or some weight derivation modes corresponding to the preset division angles can also be removed. In some embodiments, the filtering conditions corresponding to different blocks may be different. Therefore, when determining the N weight export modes corresponding to the current block, the filtering conditions corresponding to the current block are first determined, and based on the filtering conditions corresponding to the current block, N weight export modes are selected from the preset M weight export modes. In some embodiments, the filtering condition corresponding to the current block includes a filtering condition corresponding to the size of the current block and / or a filtering condition corresponding to the shape of the current block. When predicting, for smaller blocks, similar weight derivation modes have little effect on the prediction results, while for larger blocks, similar weight derivation modes have a more obvious effect on the prediction results. Based on this, the embodiment of the present application sets different N values for blocks of different sizes, that is, a larger N value is set for larger blocks, and a smaller N value is set for smaller blocks. In a possible implementation, the encoder indicates N candidate weight derivation modes to the decoder. In some embodiments, the above-mentioned filtering condition includes an array, which includes N elements, and the N elements correspond one-to-one to N weight derivation modes. The element corresponding to each weight derivation mode is used to indicate whether the weight derivation mode is available. The above array can be either a unary value or a binary value. For example, taking GPM as an example, there are a total of 64 possible weight derivation modes. The encoder sets a lookup table containing 64 elements, and the value of each element indicates whether to use its corresponding weight derivation mode. In one example, taking a unary value as an example, a specific example is as follows, setting an array of g_sgpm_splitDir: g_sgpm_splitDir
[0064] = { 1,1,1,0,1,0,1,0, 1,0,1,0,1,0,1,0, 1,0,1,1,1,0,1,0, 1,0,1,0,1,0,1,0, 0,0,0,0,1,1,0,1, 0,0,1,0,0,1,0,0, 1,0,1,1,0,1,0,0, 1,0,0,1,0,0,1,0 }; Among them, if the value of g_sgpm_splitDir[x] is 1, it means that the weight derivation mode with index x can be used, otherwise it means that the weight derivation mode with index x cannot be used. In this example, the encoder determines 26 candidate weight derivation modes through the array. In another example, an array can be used to indicate N candidate weight derivation modes, and the array only contains the indexes of the usable weight derivation modes. For example, an array g_sgpm_splitDir
[0026] ={0,1,6,8,10,12,14,16,18,19,20,22,24,26,28,30,36,37,42,45,48,50,51,53,56,59} with a length of 26 is used to indicate 26 candidate weight derivation modes. Based on the index of the weight derivation mode included in the numerical value, the encoder determines the weight derivation mode corresponding to the index as the candidate weight derivation mode, and obtains 26 candidate weight derivation modes. In some embodiments, if the filtering conditions corresponding to the current block include filtering conditions corresponding to the size of the current block and filtering conditions corresponding to the shape of the current block, and for the same weight derivation mode, if the filtering conditions corresponding to the size of the current block and the filtering conditions corresponding to the shape of the current block indicate that the weight derivation mode is available, then the weight derivation mode is determined to be one of the N weight derivation modes; if at least one of the filtering conditions corresponding to the size of the current block and the filtering conditions corresponding to the shape of the current block indicates that the weight derivation mode is unavailable, then it is determined that the weight derivation mode does not constitute N weight derivation modes. In some embodiments, the filtering conditions corresponding to different block sizes and the filtering conditions corresponding to different block shapes can be implemented using multiple arrays respectively. In some embodiments, filtering conditions corresponding to different block sizes and filtering conditions corresponding to different block shapes can be implemented using a two-bit array, that is, a two-bit array includes both filtering conditions corresponding to block sizes and filtering conditions corresponding to block shapes. For example, the filtering condition corresponding to a block of size A and shape B is as follows, and the filtering condition is represented by a binary array: g_sgpm_splitDir
[0064] = { (1,1),(1,1),(1,1),(1,0),(1,0),(0,0),(1,0,(1,1), (1,1),(0,0),(1,1),(1,0),(1,0),(0,0),(1,0),(1,0),(1,1), (0,1),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0,(0,0), (1,1),(0,0),(0,1),(1,0),(1,0),(1,0),(1,0),(0,0), (0,0),(0,0),(1,1),(0,0),(1,1),(1,1),(1,0,(0,1), (0,0),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0,(0,0), (1,0),(0,0),(1,1),(1,0),(1,0),(1,0),(0,0),(0,0), (1,1),(0,0),(1,1),(0,0),(0,0),(1,0),(1,1),(0,0) }; Among them, the values of g_sgpm_splitDir[x] are all 1, indicating that the weight derivation mode with index x is available, and one of the values of g_sgpm_splitDir[x] is 0, indicating that the weight derivation mode with index x is not available. For example, g_sgpm_splitDir[4] = (1, 0), indicating that weight derivation mode 4 is available for blocks of size A, but not for blocks of shape B. Therefore, if the block size is A and the shape is B, the weight derivation mode is not available. It should be noted that the above example takes GPM including 64 weight derivation modes, but the weight derivation modes of the embodiments of the present application include but are not limited to the 64 weight derivation modes included in GPM and the 56 weight derivation modes included in AMP. In some embodiments, before determining the N candidate weight derivation modes, the encoder first needs to determine whether the current block uses K different prediction modes for weighted prediction processing. If the encoder determines that the current block uses K different prediction modes for weighted prediction processing, the above S101 is executed to determine the N candidate weight derivation modes. If the encoder determines that the current block does not use K different prediction modes for weighted prediction processing, the above S101 step is skipped. In a possible implementation, the encoder may determine whether the current block uses K different prediction modes for weighted prediction processing by determining a prediction mode parameter of the current block. Optionally, in the implementation of the present application, the prediction mode parameter may indicate whether the current block can use the GPM mode or the AWP mode, that is, whether the current block can use K different prediction modes for prediction processing. It is understandable that, in the embodiment of the present application, the prediction mode parameter can be understood as a flag indicating whether the GPM mode or the AWP mode is used. Specifically, the encoder can use a variable as the prediction mode parameter, so that the setting of the prediction mode parameter can be achieved by setting the value of the variable. Exemplarily, in the present application, if the current block uses the GPM mode or the AWP mode, the encoder can set the value of the prediction mode parameter to indicate that the current block uses the GPM mode or the AWP mode, and specifically, the encoder can set the value of the variable to 1. Exemplarily, in the present application, if the current block does not use the GPM mode or the AWP mode, the encoder can set the value of the prediction mode parameter to indicate that the current block does not use the GPM mode or the AWP mode, and specifically, the encoder can set the variable value to 0. Further, in the embodiment of the present application, after completing the setting of the prediction mode parameter, the encoder can write the prediction mode parameter into the bitstream and transmit it to the decoder, so that the decoder can obtain the prediction mode parameter after parsing the bitstream. In some embodiments, the embodiments of the present application can also conditionally limit the use of GPM mode or AWP mode for the current block, that is, when it is determined that the current block meets the preset conditions, it is determined that the current block uses K prediction modes for weighted prediction, and then the N candidate weight derivation modes corresponding to the current block are determined. Exemplarily, when the GPM mode or the AWP mode is applied, the size of the current block may be limited. It is understandable that, since the video encoding method proposed in the embodiment of the present application needs to use K different prediction modes to generate K prediction values respectively, and then weight them according to the weights to obtain the prediction value of the current block, in order to reduce the complexity, while considering the trade-off between compression performance and complexity, in the embodiment of the present application, it is possible to limit the use of the GPM mode or AWP mode for blocks of certain sizes. Therefore, in the present application, the encoder can first determine the size parameters of the current block, and then determine whether the current block uses the GPM mode or the AWP mode according to the size parameters. In an embodiment of the present application, the size parameter of the current block may include the height and width of the current block. Therefore, the encoder may determine whether the current block uses the GPM mode or the AWP mode according to the height and width of the current block. Exemplarily, in the present application, if the width is greater than threshold 1 and the height is greater than threshold 2, it is determined that the current block can use the GPM mode or the AWP mode. It can be seen that a possible restriction is to use the GPM mode or the AWP mode only when the width of the block is greater than (or greater than or equal to) threshold 1 and the height of the block is greater than (or greater than or equal to) threshold 2. The values of threshold 1 and threshold 2 can be 4, 8, 16, 32, 128, 256, etc., and threshold 1 can be equal to threshold 2. Exemplarily, in the present application, if the width is less than threshold 3 and the height is greater than threshold 4, it is determined that the current block can use the GPM mode or the AWP mode. It can be seen that a possible restriction is to use the GPM mode or the AWP mode only when the width of the block is less than (or less than or equal to) threshold 3 and the height of the block is greater than (or greater than or equal to) threshold 4. The values of threshold 3 and threshold 4 can be 4, 8, 16, 32, 128, 256, etc., and threshold 3 can be equal to threshold 4. Furthermore, in the embodiments of the present application, the size of the block that can use the GPM mode or the AWP mode can be limited by limiting the pixel parameters. Exemplarily, in the present application, the encoder may first determine the pixel parameters of the current block, and then further determine whether the current block can use the GPM mode or the AWP mode according to the pixel parameters and the threshold 5. It can be seen that one possible restriction is to use the GPM mode or the AWP mode only when the number of pixels of the block is greater than (or greater than or equal to) the threshold 5. The value of the threshold 5 may be 4, 8, 16, 32, 128, 256, 1024, etc. That is to say, in the present application, the current block can use the GPM mode or the AWP mode only when the size parameter of the current block meets the size requirement. Exemplarily, in the present application, there may be a frame-level flag to determine whether the current frame to be encoded uses the present application. For example, intra-frames (such as I-frames) may be configured to use the present application, while inter-frames (such as B-frames and P-frames) may not use the present application. Alternatively, intra-frames may be configured not to use the present application, while inter-frames may use the present application. Alternatively, some inter-frames may be configured to use the present application, while some inter-frames may not use the present application. Inter-frames may also use intra-frame prediction, and thus inter-frames may also use the present application. In some embodiments, there may also be a flag below the frame level to determine whether the current block uses this application. S202. Determine at least one candidate prediction mode based on N candidate weight derivation modes and attribute information of the current block. When determining at least one candidate prediction mode, the embodiment of the present application not only considers the impact of the candidate weight derivation mode on the candidate prediction mode, but also considers the impact of the attribute information of the current block on the candidate prediction mode, thereby improving the accuracy of determining the candidate prediction mode. The embodiment of the present application does not limit the specific content of the attribute information of the current block. In some embodiments, the attribute information of the current block includes size information of the current block, wherein the size information of the current block includes the length and width of the current block, the aspect ratio of the current block, or the number of pixels included in the current block. In some embodiments, the attribute information of the current block also includes shape information of the current block, for example, the shape of the current block is a square, or the shape of the current block is a rectangle, or the shape of the current block is a preset shape such as a polygon or a circle. In the embodiment of the present application, determining at least one candidate prediction mode based on N candidate weight derivation modes and attribute information of the current block can be understood as determining, based on the N candidate weight derivation modes and attribute information of the current block, which neighboring blocks of the current block have prediction modes that can be used to determine the candidate prediction mode. For example, based on the candidate weight derivation mode and attribute information of the current block, the weights of the neighboring blocks are determined, and based on the weights of the neighboring blocks, it is determined which neighboring blocks' prediction modes are selected for determining the candidate prediction mode. For example, if in a certain GPM weight derivation mode, for a certain prediction mode (the first prediction mode or the second prediction mode), the weight of the adjacent block is greater than (or greater than or equal to) a certain threshold, then it means that the adjacent block has a strong correlation with the area occupied by the current prediction mode; otherwise, it means that the adjacent block has a weak correlation with the area occupied by the current prediction mode. In some embodiments, the encoding end may determine a candidate prediction mode list based on N candidate weight derivation modes and the attribute information of the current block, that is, in this embodiment, the N candidate weight derivation modes correspond to one candidate prediction mode list. For example, if the dividing line angles and offsets of the N candidate weight derivation modes are not much different, in order to reduce the amount of calculation and improve the coding efficiency, the encoding end determines to determine a candidate weight derivation mode A from the N candidate weight derivation modes, and determines a candidate prediction mode list based on the candidate weight derivation mode and the attribute information of the current block. In one example, the above-mentioned candidate weight derivation mode A may be a default candidate weight derivation mode among the N candidate weight derivation modes. Exemplarily, the encoding end may indicate the index of the candidate weight derivation mode A to the decoding end, so that the decoding end decodes the bitstream and obtains the index of the candidate weight derivation mode A. In some embodiments, at least one of the N candidate weight derivation modes corresponds to a candidate prediction mode list. That is, the encoder determines a candidate prediction mode list for each of the N candidate weight derivation modes. In this case, the above S202 includes the following S202-A step: S202-A. For the ith candidate weight derivation mode among N candidate weight derivation modes, determine a candidate prediction mode list corresponding to the ith candidate weight derivation mode based on the ith candidate weight derivation mode and attribute information of the current block. In this embodiment, the method of determining the candidate prediction mode list corresponding to each of the N candidate weight derivation modes is the same. For ease of description, the i-th candidate weight derivation mode among the N candidate weight derivation modes is used as an example for explanation. The i-th candidate weight derivation mode can be understood as any candidate weight derivation mode among the N candidate weight derivation modes. The embodiment of the present application does not limit the specific method of determining the candidate prediction mode list corresponding to the i-th candidate weight derivation mode based on the i-th candidate weight derivation mode and the attribute information of the current block. In some embodiments, the ith candidate weight derivation mode corresponds to a candidate prediction mode list, that is, based on the ith candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list corresponding to the ith candidate prediction mode is determined. In this way, when predicting the current block, K prediction modes are determined from the candidate prediction mode list corresponding to the ith candidate weight derivation mode, and then the ith candidate weight derivation mode and the K prediction modes are used to predict the current block to obtain the predicted value of the current block. For example, based on the ith candidate weight derivation mode, the weight is determined, the current block is predicted using the K prediction modes to obtain K predicted values, and the K prediction values are weighted using the weights to obtain the predicted value of the current block under the ith candidate weight derivation mode. In an example of this embodiment, based on the i-th candidate weight derivation mode and the attribute information of the current block, a method for determining a candidate prediction mode list corresponding to the i-th candidate weight derivation mode may be: determining a dividing line corresponding to the i-th candidate weight derivation mode based on the i-th candidate weight derivation mode, and determining the dividing line to divide the current block based on the attribute information of the current block to obtain a first part and a second part, wherein the first part can be understood as a part corresponding to the first prediction mode, and the second part can be understood as a part corresponding to the second prediction mode. In this way, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode can be determined based on the prediction modes of adjacent blocks in the adjacent blocks of the current block that are adjacent to the first part of the current block. In another example of this embodiment, based on the i-th candidate weight derivation mode and the attribute information of the current block, the method of determining the candidate prediction mode list corresponding to the i-th candidate weight derivation mode can be: based on the i-th candidate weight derivation mode and the attribute information of the current block, the weight of each adjacent block of the current block is determined, and then based on the weight of the adjacent blocks, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode is determined. For example, based on the prediction mode of the adjacent block with a larger weight of the adjacent block, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode is determined. In some embodiments, the K prediction modes corresponding to the i-th candidate weight derivation mode, the above S202-A includes the following step S202-A1: S202-A1. Based on the i-th candidate weight derivation mode and the attribute information of the current block, determine a candidate prediction mode list of at least one prediction mode among K prediction modes corresponding to the i-th candidate weight derivation mode. In this embodiment, the encoding end determines a candidate prediction mode list of at least one prediction mode list among K prediction modes corresponding to the i-th candidate derivation mode. For example, K=2, then the encoder can determine a candidate prediction mode list for the first prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, but not determine a candidate prediction mode list for the second candidate prediction mode. Optionally, a candidate prediction mode list can be determined for the second prediction mode, but not for the first candidate prediction mode. Optionally, a candidate prediction mode list can be determined for the first prediction mode, and a candidate prediction mode list can be determined for the second candidate prediction mode. Optionally, a common candidate prediction mode list is determined for the first prediction mode and the second prediction mode. In an embodiment of the present application, a candidate prediction mode list is determined for at least one prediction mode corresponding to the i-th candidate weight derivation mode, and then at least one prediction mode corresponding to the i-th candidate weight derivation mode is accurately determined from the constructed candidate prediction mode list. In some embodiments, if the at least one prediction mode corresponds to a candidate prediction mode list, the above S202-A1 includes the following steps S202-A1-11 and S202-A1-12: S202-A1-11. For a j-th prediction mode in at least one prediction mode, determine a candidate prediction mode list of the j-th prediction mode based on the i-th candidate weight derivation mode and attribute information of the current block, where j is a positive integer. S202-A1-12. Based on the candidate prediction mode list of the j-th prediction mode, determine a candidate prediction mode list of at least one prediction mode. In this embodiment, at least one prediction mode corresponding to the i-th candidate weight derivation mode corresponds to one candidate prediction mode list, that is, the candidate prediction mode lists corresponding to the at least one prediction mode are the same, which is one candidate prediction mode list, so that the complexity of determining the candidate prediction mode list can be reduced and the coding efficiency can be improved. At this time, the encoding end determines one candidate prediction mode list for the at least one prediction mode. Specifically, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode in the at least one prediction mode is determined. Optionally, the j-th prediction mode is any one of the at least one prediction mode. Then, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode is determined. The specific methods for determining the candidate prediction mode list of the at least one prediction mode based on the candidate prediction mode list of the j-th prediction mode in S202-A1-12 include but are not limited to the following: Method 1: directly determine the candidate prediction mode list of the j-th prediction mode as the candidate prediction mode list of the at least one prediction mode. Method 2: Determine whether the candidate prediction mode list of the j-th prediction mode includes the preset prediction mode. If the candidate prediction mode list of the j-th prediction mode includes the preset prediction mode, determine the candidate prediction mode list of the j-th prediction mode as the candidate prediction mode list of at least one prediction mode. If the candidate prediction mode list of the j-th prediction mode does not include the preset prediction mode, add the preset prediction mode to the candidate prediction mode list of the j-th prediction mode to obtain the candidate prediction mode list of at least one prediction mode. The embodiment of the present application does not limit the preset prediction mode in the above-mentioned method 2, and it is determined according to actual needs. This embodiment introduces a specific process of determining the candidate prediction mode list of the at least one prediction mode if the at least one prediction mode corresponds to a candidate prediction mode list. In some embodiments, if each prediction mode in the at least one prediction mode corresponds to a candidate prediction mode list, the above S202-A1 includes the following step S202-A1-21: S202-A1-21. For the j-th prediction mode in the at least one prediction mode mentioned above, determine a candidate prediction mode list of the j-th prediction mode based on the ith candidate weight derivation mode and attribute information of the current block, where j is a positive integer. In this embodiment, each prediction mode in the above-mentioned at least one prediction mode corresponds to a candidate prediction mode list, so the encoding end determines a candidate prediction mode list for each prediction mode in the at least one prediction mode corresponding to the i-th candidate weight derivation mode for the i-th candidate weight derivation mode. For example, the above-mentioned at least one prediction mode includes the first prediction mode and the second prediction mode corresponding to the i-th candidate weight derivation mode, and then the encoding end determines a candidate prediction mode list for the first prediction mode and determines a candidate prediction mode for the second prediction mode. In this embodiment, the process of determining a candidate prediction mode list corresponding to each prediction mode in the above-mentioned at least one prediction mode is the same. For the convenience of description, the embodiment of the present application is explained by taking the candidate prediction mode list for determining the j-th prediction mode in the above-mentioned at least one prediction mode as an example. The following is an introduction to the process of determining the candidate prediction mode list of the jth prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block in the above S202-A1-11 and the above S202-A1-21. In the embodiment of the present application, based on the i-th candidate weight derivation mode and the attribute information of the current block, a specific implementation method for determining the candidate prediction mode list of the j-th prediction mode includes at least the following two methods: In method 1, the encoder determines a candidate prediction mode sublist of the j-th prediction mode through the following steps 31 to 33: Step 31, determining a first lookup table, the first lookup table including different block attribute information and adjacent blocks corresponding to different prediction modes under different weight derivation modes; Step 32: Based on the attribute information of the current block and the i-th candidate weight derivation mode, determine the adjacent block corresponding to the j-th prediction mode in the first lookup table; Step 33: Determine a candidate prediction mode list for the jth prediction mode based on the prediction modes of the adjacent blocks corresponding to the jth prediction mode. In the first method, a first lookup table is determined based on different block attribute information. The first lookup table includes different block attribute information and adjacent blocks corresponding to different prediction modes under different weight derivation modes. In this way, the adjacent blocks corresponding to the j-th prediction mode can be obtained directly by searching the first lookup table, and then based on the prediction mode of the adjacent blocks corresponding to the j-th prediction mode, the candidate prediction mode list of the j-th prediction mode can be determined. The embodiment of the present application does not limit the specific form of the first lookup table. In one possible implementation, the first lookup table includes P different sub-lookup tables, wherein the P sub-lookup tables are lookup tables corresponding to P blocks of attribute information, respectively, and the lookup tables include adjacent blocks corresponding to different prediction modes under different weight derivation modes. In this way, the encoding end can determine the first sub-lookup table corresponding to the current block in the P sub-lookup tables based on the attribute information of the current block, and the first sub-lookup table includes adjacent blocks corresponding to different prediction modes under different weight derivation modes; then, based on the i-th candidate weight derivation mode, determine the adjacent blocks corresponding to the j-th prediction mode in the first sub-lookup table; and then determine the candidate prediction mode list of the j-th prediction mode based on the prediction mode of the adjacent blocks corresponding to the j-th prediction mode. In an embodiment of the present application, different sub-lookup tables are determined based on different block attribute information, wherein the lookup table includes adjacent blocks corresponding to different prediction modes under different weight derivation modes. In one example, it is assumed that the property information of the block includes the aspect ratio of the block. It is assumed that the P sub-lookup tables include a lookup table corresponding to a block with an aspect ratio of 1:2, a lookup table corresponding to a block with an aspect ratio of 1:1, and a lookup table corresponding to a block with an aspect ratio of 2:1. Exemplarily, the lookup table corresponding to the block with an aspect ratio of 1:2 is shown in Table 6 above. In this way, when encoding the current block, based on the size information of the current block, if it is determined that the aspect ratio of the current block is 1:2, the first sub-error lookup table as shown in Table 6 is obtained from the P sub-error lookup tables. Next, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Specifically, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Assuming K=2, the j-th prediction mode is the first prediction mode, and the first prediction mode corresponds to the first part of the above Table 6. In this way, the i-th candidate weight derivation mode can be used to determine the adjacent block corresponding to the i-th prediction mode in the adjacent blocks corresponding to the first part. For example, the ith candidate weight derivation mode is a4, and the first part of the adjacent blocks corresponding to a4 is A, so the upper left adjacent block, the upper side adjacent block, and the upper right adjacent block of the current block can be determined as the adjacent blocks corresponding to the ith prediction mode, and then based on the prediction modes of the upper left adjacent block, the upper side adjacent block, and the upper right adjacent block of the current block, the candidate prediction mode list of the jth prediction mode is determined. For example, the prediction modes of the upper left adjacent block, the upper side adjacent block, and the upper right adjacent block of the current block are added to the candidate prediction mode list of the jth prediction mode in a preset order. Exemplarily, the sub-lookup table corresponding to the block with an aspect ratio of 1:1 is shown in Table 7. In this way, when encoding the current block, based on the size information of the current block, if it is determined that the aspect ratio of the current block is 1:1, the first sub-error check table shown in Table 7 is obtained from the P sub-error check tables. Next, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first lookup table. Specifically, based on the i-th candidate weight derivation mode, the adjacent block corresponding to the j-th prediction mode is determined in the first sub-lookup table. Assuming K=2, the j-th prediction mode is the first prediction mode, and the first prediction mode corresponds to the first part of the above Table 7. In this way, the i-th candidate weight derivation mode can be used to determine the adjacent block corresponding to the i-th prediction mode in the adjacent blocks corresponding to the first part. For example, the ith candidate weight derivation mode is a2, and the first part of the adjacent blocks corresponding to a2 is...
Claims
1. A video decoding method, characterized in that: include: Determine N candidate weight derivation modes, where N is a positive integer; Determine at least one candidate prediction mode based on the N candidate weight derivation modes and attribute information of the current block; Based on the N candidate weight derivation modes and the at least one candidate prediction mode, determine a first weight derivation mode and K first prediction modes corresponding to the current block, where K is a positive integer greater than 1; The current block is predicted based on the first weight derivation mode and the K first prediction modes to obtain a prediction value of the current block.
2. The method according to claim 1, characterized in that The determining at least one candidate prediction mode based on the N candidate weight derivation modes and the attribute information of the current block includes: For the i-th candidate weight derivation mode among the N candidate weight derivation modes, based on the i-th candidate weight derivation mode and the attribute information of the current block, determine the candidate prediction mode list corresponding to the i-th candidate weight derivation mode, where i is a positive integer less than or equal to N.
3. The method according to claim 2, characterized in that The step of determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode comprises: Based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of at least one prediction mode among K prediction modes corresponding to the i-th candidate weight derivation mode is determined.
4. The method according to claim 3, characterized in that If the at least one prediction mode corresponds to a candidate prediction mode list, determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of at least one prediction mode among the K prediction modes corresponding to the i-th candidate weight derivation mode includes: For a j-th prediction mode among the at least one prediction mode, determining a candidate prediction mode list of the j-th prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, where j is a positive integer; Based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode is determined.
5. The method according to claim 4, characterized in that The determining, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode comprises: The candidate prediction mode list of the j-th prediction mode is determined as the candidate prediction mode list of the at least one prediction mode.
6. The method according to claim 4, characterized in that The determining, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode comprises: If the candidate prediction mode list of the j-th prediction mode includes a preset prediction mode, the candidate prediction mode list of the j-th prediction mode is determined as the candidate prediction mode list of the at least one prediction mode.
7. The method according to claim 4, characterized in that The determining, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode comprises: If the candidate prediction mode list of the j-th prediction mode does not include the preset prediction mode, the preset prediction mode is added to the candidate prediction mode list of the j-th prediction mode to obtain the candidate prediction mode list of the at least one prediction mode.
8. The method according to claim 3, characterized in that If each prediction mode in the at least one prediction mode corresponds to a candidate prediction mode list, then determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of at least one prediction mode in the K prediction modes corresponding to the i-th candidate weight derivation mode includes: For the jth prediction mode among the at least one prediction mode, a candidate prediction mode list of the jth prediction mode is determined based on the i-th candidate weight derivation mode and the attribute information of the current block, where j is a positive integer.
9. The method according to claim 4 or 8, characterized in that: The determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode comprises: Determine a first lookup table, wherein the first lookup table includes different block attribute information and neighboring blocks corresponding to different prediction modes under different weight derivation modes; Based on the attribute information of the current block and the i-th candidate weight derivation mode, determining, in the first lookup table, a neighboring block corresponding to the j-th prediction mode; Based on the prediction modes of the neighboring blocks corresponding to the j-th prediction mode, a candidate prediction mode list of the j-th prediction mode is determined.
10. The method according to claim 4 or 8, characterized in that: The determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode comprises: Determine, based on the i-th candidate weight derivation mode and the attribute information of the current block, the weight of the neighboring block of the current block with respect to the j-th prediction mode; Based on the weights of the neighboring blocks with respect to the j-th prediction mode, a candidate prediction mode list of the j-th prediction mode is determined.
11. The method according to claim 10, characterized in that The step of determining the weight of the neighboring blocks of the current block with respect to the j-th prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block comprises: Determine the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block; The weight of the first point is determined as the weight of the neighboring block with respect to the j-th prediction mode.
12. The method according to claim 11, characterized in that The step of determining the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block includes: The weight of the first point is determined based on the i-th candidate weight derivation mode, the attribute information of the current block and the template of the current block.
13. The method according to claim 12, characterized in that The determining the weight of the first point based on the i-th candidate weight derivation mode, the attribute information of the current block, and the template of the current block includes: Determining a weight of the template based on the i-th candidate weight derivation mode, the attribute information of the current block, and the template of the current block; The weight corresponding to the first point in the weight of the template is determined as the weight of the first point.
14. The method according to claim 11, characterized in that The step of determining the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block includes: Determine a second point corresponding to the first point in the current block; Determining the weight of the second point based on the i-th candidate weight derivation mode and the attribute information of the current block; Based on the weight of the second point, a weight of the first point is determined.
15. The method according to claim 14, characterized in that The second point is a point in the current block adjacent to the first point.
16. The method according to any one of claims 11 to 15, characterized in that: The first point is any point in the adjacent blocks.
17. The method according to any one of claims 11 to 15, characterized in that: The first point is a point in the neighboring blocks that is adjacent to the current block.
18. The method according to claim 10, characterized in that The determining, based on the weight of the neighboring blocks with respect to the j-th prediction mode, a candidate prediction mode list of the j-th prediction mode comprises: If the weight of the neighboring block with respect to the j-th prediction mode is greater than or equal to a preset threshold, obtaining the prediction mode of the neighboring block; Based on the prediction modes of the neighboring blocks, a candidate prediction mode list of the j-th prediction mode is determined.
19. The method according to claim 18, characterized in that If the value range of the weight is from 0 to n, the preset threshold is n / 2, and n is a positive number.
20. The method according to claim 10, characterized in that If the value of the weight is the first value or the second value, determining the candidate prediction mode list of the j-th prediction mode based on the weight of the neighboring block with respect to the j-th prediction mode includes: If the weight of the neighboring block with respect to the j-th prediction mode is equal to the first value, obtaining the prediction mode of the neighboring block, the first value being greater than the second value; Based on the prediction modes of the neighboring blocks, a candidate prediction mode list of the j-th prediction mode is determined.
21. The method according to claim 18 or 20, characterized in that The obtaining the prediction mode of the adjacent block includes: According to a preset checking order, prediction modes of neighboring blocks of the current block whose weights for the j-th prediction mode are greater than or equal to a preset threshold or a first value are obtained in sequence.
22. The method according to claim 21, characterized in that The step of determining a candidate prediction mode list of the j-th prediction mode based on the prediction mode of the adjacent block comprises: According to the checking order, the obtained prediction modes of the adjacent blocks are sequentially added to the candidate prediction mode list of the j-th prediction mode.
23. The method according to claim 21, characterized in that If the adjacent blocks of the current block include a left adjacent block, an upper adjacent block, a lower left adjacent block, an upper right adjacent block and an upper left adjacent block, the preset checking order is a left adjacent block, an upper adjacent block, a lower left adjacent block, an upper right adjacent block and an upper left adjacent block.
24. The method according to claim 18 or 20, characterized in that The step of determining a candidate prediction mode list of the j-th prediction mode based on the prediction mode of the adjacent block comprises: If the candidate prediction mode list of the j-th prediction mode does not include the prediction mode of the adjacent block, the prediction mode of the adjacent block is added to the candidate prediction mode list of the j-th prediction mode.
25. The method according to claim 18 or 20, characterized in that The method further comprises: If the weight of the neighboring block with respect to the j-th prediction mode is less than a preset threshold or equal to a second value, obtaining the prediction mode of the neighboring block is skipped.
26. The method according to claim 10, characterized in that If the current block includes M neighboring blocks, determining a candidate prediction mode list of the j-th prediction mode based on weights of the neighboring blocks with respect to the j-th prediction mode includes: Based on the weights of the M neighboring blocks respectively with respect to the j-th prediction mode and the prediction modes of the M neighboring blocks, a candidate prediction mode list of the j-th prediction mode is determined, where M is a positive integer.
27. The method according to claim 26, characterized in that The determining, based on the weights of the M adjacent blocks respectively with respect to the j-th prediction mode and the prediction modes of the M adjacent blocks, a candidate prediction mode list of the j-th prediction mode comprises: Based on the weights of the M neighboring blocks respectively with respect to the j-th prediction mode, the prediction modes of the M neighboring blocks are added to the candidate prediction mode list until the length of the candidate prediction mode list reaches a preset length.
28. The method according to claim 27, characterized in that The M neighboring blocks include at least one of a left neighboring block, an upper neighboring block, a lower left neighboring block, an upper right neighboring block, and an upper left neighboring block.
29. The method according to claim 4 or 8, characterized in that Before determining the candidate prediction mode list of the j-th prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, the method further includes: Determining whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block; The determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode comprises: If it is determined that the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block, the candidate prediction mode list of the j-th prediction mode is determined based on the i-th candidate weight derivation mode and the attribute information of the current block.
30. The method according to claim 29, characterized in that The determining whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block comprises: Decoding the bitstream to obtain first information, where the first information is used to indicate whether the candidate prediction mode list includes a prediction mode of an adjacent block; Based on the first information, it is determined whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the neighboring block.
31. The method according to claim 29, characterized in that The determining whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block comprises: After adding each prediction mode located before the prediction mode of the adjacent block in the preset order to the candidate prediction mode list in accordance with a preset order, when the length of the candidate prediction mode list does not reach the preset length, it is determined that the candidate prediction mode list of the jth prediction mode includes the prediction mode of the adjacent block.
32. The method according to claim 31, characterized in that The preset order includes: a prediction mode whose prediction angle is parallel to the dividing line of the i-th candidate weight derivation mode, a candidate prediction mode derived based on the template of the current block, a candidate prediction mode derived based on the surrounding reconstructed pixels of the current block, a prediction mode of the adjacent block, a prediction mode whose prediction angle is perpendicular to the dividing line of the i-th candidate weight derivation mode, and a preset mode.
33. The method according to claim 32, characterized in that The preset mode includes a PLANAR mode.
34. The method according to any one of claims 1 to 8, characterized in that The determining, based on the N candidate weight derivation modes and the at least one candidate prediction mode, a first weight derivation mode and K first prediction modes corresponding to the current block comprises: Decoding the bitstream to obtain a first index, where the first index is used to indicate a first combination, where the first combination includes the first weight derivation mode and the K first prediction modes; Determine a candidate combination list based on the N candidate weight derivation modes and the at least one candidate prediction mode, the candidate combination list comprising at least one candidate combination, the candidate combination comprising a weight derivation mode and K prediction modes; Based on the first index, the first combination is determined from the candidate combination list.
35. The method according to claim 34, characterized in that The determining, based on the N candidate weight derivation modes and the at least one candidate prediction mode, a candidate combination list comprises: Based on the N candidate weight derivation modes and the at least one candidate prediction mode, T second combinations are obtained, wherein any second combination of the T second combinations includes a weight derivation mode and K prediction modes, and the weight derivation mode and the K prediction modes included in any two combinations of the T second combinations are not completely the same, and T is a positive integer greater than 1; Based on the T second combinations, the candidate combination list is obtained.
36. The method according to claim 35, characterized in that The obtaining the candidate combination list based on the T second combinations includes: For any second combination among the T second combinations, determining a cost corresponding to the second combination when using the weight derivation mode and the K prediction modes in the second combination to predict the template of the current block; The candidate combination list is determined according to the cost corresponding to each second combination in the T second combinations.
37. The method according to any one of claims 1 to 8, characterized in that The height of the upper template of the current block is 1, and / or the width of the left template of the current block is 1.
38. The method according to any one of claims 1 to 8, characterized in that The attribute information of the current block includes size information of the current block.
39. A video encoding method, characterized in that: include: Determine N candidate weight derivation modes, where N is a positive integer; Determine at least one candidate prediction mode based on the N candidate weight derivation modes and attribute information of the current block; Based on the N candidate weight derivation modes and the at least one candidate prediction mode, determine a first weight derivation mode and K first prediction modes corresponding to the current block, where K is a positive integer greater than 1; The current block is predicted based on the first weight derivation mode and the K first prediction modes to obtain a prediction value of the current block.
40. The method according to claim 39, characterized in that The determining at least one candidate prediction mode based on the N candidate weight derivation modes and the attribute information of the current block includes: For the i-th candidate weight derivation mode among the N candidate weight derivation modes, based on the i-th candidate weight derivation mode and the attribute information of the current block, determine the candidate prediction mode list corresponding to the i-th candidate weight derivation mode, where i is a positive integer less than or equal to N.
41. The method according to claim 40, characterized in that The step of determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list corresponding to the i-th candidate weight derivation mode comprises: Based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of at least one prediction mode among K prediction modes corresponding to the i-th candidate weight derivation mode is determined.
42. The method according to claim 41, characterized in that If the at least one prediction mode corresponds to a candidate prediction mode list, determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of at least one prediction mode among the K prediction modes corresponding to the i-th candidate weight derivation mode includes: For a j-th prediction mode among the at least one prediction mode, determining a candidate prediction mode list of the j-th prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, where j is a positive integer; Based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode is determined.
43. The method according to claim 42, characterized in that The determining, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode comprises: The candidate prediction mode list of the j-th prediction mode is determined as the candidate prediction mode list of the at least one prediction mode.
44. The method according to claim 42, characterized in that The determining, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode comprises: If the candidate prediction mode list of the j-th prediction mode includes a preset prediction mode, the candidate prediction mode list of the j-th prediction mode is determined as the candidate prediction mode list of the at least one prediction mode.
45. The method according to claim 42, characterized in that The determining, based on the candidate prediction mode list of the j-th prediction mode, a candidate prediction mode list of the at least one prediction mode comprises: If the candidate prediction mode list of the j-th prediction mode does not include the preset prediction mode, the preset prediction mode is added to the candidate prediction mode list of the j-th prediction mode to obtain the candidate prediction mode list of the at least one prediction mode.
46. The method according to claim 41, characterized in that If each prediction mode in the at least one prediction mode corresponds to a candidate prediction mode list, then determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of at least one prediction mode in the K prediction modes corresponding to the i-th candidate weight derivation mode includes: For the jth prediction mode among the at least one prediction mode, a candidate prediction mode list of the jth prediction mode is determined based on the i-th candidate weight derivation mode and the attribute information of the current block, where j is a positive integer.
47. The method according to claim 42 or 46, characterized in that The determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode comprises: Determine a first lookup table, wherein the first lookup table includes different block attribute information and neighboring blocks corresponding to different prediction modes under different weight derivation modes; Based on the attribute information of the current block and the i-th candidate weight derivation mode, determining, in the first lookup table, a neighboring block corresponding to the j-th prediction mode; Based on the prediction modes of the neighboring blocks corresponding to the j-th prediction mode, a candidate prediction mode list of the j-th prediction mode is determined.
48. The method according to claim 42 or 46, characterized in that The determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode comprises: Determine, based on the i-th candidate weight derivation mode and the attribute information of the current block, the weight of the neighboring block of the current block with respect to the j-th prediction mode; Based on the weights of the neighboring blocks with respect to the j-th prediction mode, a candidate prediction mode list of the j-th prediction mode is determined.
49. The method according to claim 48, characterized in that The step of determining the weight of the neighboring blocks of the current block with respect to the j-th prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block comprises: Determine the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block; The weight of the first point is determined as the weight of the neighboring block with respect to the j-th prediction mode.
50. The method according to claim 49, characterized in that The step of determining the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block includes: The weight of the first point is determined based on the i-th candidate weight derivation mode, the attribute information of the current block and the template of the current block.
51. The method according to claim 50, characterized in that The determining the weight of the first point based on the i-th candidate weight derivation mode, the attribute information of the current block, and the template of the current block includes: Determining a weight of the template based on the i-th candidate weight derivation mode, the attribute information of the current block, and the template of the current block; The weight corresponding to the first point in the weight of the template is determined as the weight of the first point.
52. The method according to claim 49, characterized in that The step of determining the weight of the first point in the adjacent block based on the i-th candidate weight derivation mode and the attribute information of the current block includes: Determine a second point corresponding to the first point in the current block; Determining the weight of the second point based on the i-th candidate weight derivation mode and the attribute information of the current block; Based on the weight of the second point, a weight of the first point is determined.
53. The method according to claim 52, characterized in that The second point is a point in the current block adjacent to the first point.
54. The method according to any one of claims 49 to 53, characterized in that The first point is any point in the adjacent blocks.
55. The method according to any one of claims 49 to 53, characterized in that The first point is a point in the neighboring blocks that is adjacent to the current block.
56. The method of claim 48, wherein: The determining, based on the weight of the neighboring blocks with respect to the j-th prediction mode, a candidate prediction mode list of the j-th prediction mode comprises: If the weight of the neighboring block with respect to the j-th prediction mode is greater than or equal to a preset threshold, obtaining the prediction mode of the neighboring block; Based on the prediction modes of the neighboring blocks, a candidate prediction mode list of the j-th prediction mode is determined.
57. The method according to claim 56, characterized in that If the value range of the weight is from 0 to n, the preset threshold is n / 2, and n is a positive number.
58. The method of claim 48, wherein: If the value of the weight is the first value or the second value, determining the candidate prediction mode list of the j-th prediction mode based on the weight of the neighboring block with respect to the j-th prediction mode includes: If the weight of the neighboring block with respect to the j-th prediction mode is equal to the first value, obtaining the prediction mode of the neighboring block, the first value being greater than the second value; Based on the prediction modes of the neighboring blocks, a candidate prediction mode list of the j-th prediction mode is determined.
59. The method according to claim 56 or 58, characterized in that The obtaining the prediction mode of the adjacent block includes: According to a preset checking order, prediction modes of neighboring blocks of the current block whose weights for the j-th prediction mode are greater than or equal to a preset threshold or a first value are obtained in sequence.
60. The method according to claim 59, characterized in that The step of determining a candidate prediction mode list of the j-th prediction mode based on the prediction mode of the adjacent block comprises: According to the checking order, the obtained prediction modes of the adjacent blocks are sequentially added to the candidate prediction mode list of the j-th prediction mode.
61. The method according to claim 59, characterized in that If the adjacent blocks of the current block include a left adjacent block, an upper adjacent block, a lower left adjacent block, an upper right adjacent block and an upper left adjacent block, the preset checking order is a left adjacent block, an upper adjacent block, a lower left adjacent block, an upper right adjacent block and an upper left adjacent block.
62. The method according to claim 56 or 58, characterized in that The step of determining a candidate prediction mode list of the j-th prediction mode based on the prediction mode of the adjacent block comprises: If the candidate prediction mode list of the j-th prediction mode does not include the prediction mode of the adjacent block, the prediction mode of the adjacent block is added to the candidate prediction mode list of the j-th prediction mode.
63. The method according to claim 56 or 58, characterized in that The method further comprises: If the weight of the neighboring block with respect to the j-th prediction mode is less than a preset threshold or less than a second value, obtaining the prediction mode of the neighboring block is skipped.
64. The method according to claim 48, characterized in that If the current block includes M neighboring blocks, determining a candidate prediction mode list of the j-th prediction mode based on weights of the neighboring blocks with respect to the j-th prediction mode includes: Based on the weights of the M neighboring blocks respectively with respect to the j-th prediction mode and the prediction modes of the M neighboring blocks, a candidate prediction mode list of the j-th prediction mode is determined, where M is a positive integer.
65. The method according to claim 64, characterized in that The determining, based on the weights of the M adjacent blocks respectively with respect to the j-th prediction mode and the prediction modes of the M adjacent blocks, a candidate prediction mode list of the j-th prediction mode comprises: Based on the weights of the M neighboring blocks respectively with respect to the j-th prediction mode, the prediction modes of the M neighboring blocks are added to the candidate prediction mode list until the length of the candidate prediction mode list reaches a preset length.
66. The method according to claim 65, characterized in that The M neighboring blocks include at least one of a left neighboring block, an upper neighboring block, a lower left neighboring block, an upper right neighboring block, and an upper left neighboring block.
67. The method according to claim 42 or 46, characterized in that Before determining the candidate prediction mode list of the j-th prediction mode based on the i-th candidate weight derivation mode and the attribute information of the current block, the method further includes: Determining whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block; The determining, based on the i-th candidate weight derivation mode and the attribute information of the current block, a candidate prediction mode list of the j-th prediction mode comprises: If it is determined that the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block, the candidate prediction mode list of the j-th prediction mode is determined based on the i-th candidate weight derivation mode and the attribute information of the current block.
68. The method according to claim 67, characterized in that The determining whether the candidate prediction mode list of the j-th prediction mode includes the prediction mode of the adjacent block comprises: After adding each prediction mode located before the prediction mode of the adjacent block in the preset order to the candidate prediction mode list in accordance with a preset order, when the length of the candidate prediction mode list does not reach the preset length, it is determined that the candidate prediction mode list of the jth prediction mode includes the prediction mode of the adjacent block.
69. The method according to claim 68, characterized in that The preset order includes: a prediction mode whose prediction angle is parallel to the dividing line of the i-th candidate weight derivation mode, a candidate prediction mode derived based on the template of the current block, a candidate prediction mode derived based on the surrounding reconstructed pixels of the current block, a prediction mode of the adjacent block, a prediction mode whose prediction angle is perpendicular to the dividing line of the i-th candidate weight derivation mode, and a preset mode.
70. The method according to claim 69, characterized in that The preset mode includes a PLANAR mode.
71. The method of claim 68, wherein: The method further comprises: First information is written into the bitstream, where the first information is used to indicate whether the candidate prediction mode list includes the prediction mode of the adjacent block.
72. The method according to any one of claims 39 to 46, characterized in that The determining, based on the N candidate weight derivation modes and at least one of the candidate prediction modes, a first weight derivation mode and K first prediction modes corresponding to the current block comprises: Determine a candidate combination list based on the N candidate weight derivation modes and the at least one candidate prediction mode, the candidate combination list comprising at least one candidate combination, the candidate combination comprising a weight derivation mode and K prediction modes; A first combination is determined from the candidate combination list, where the first combination includes the first weight derivation mode and the K first prediction modes.
73. The method according to claim 72, characterized in that The determining, based on the N candidate weight derivation modes and the at least one candidate prediction mode, a candidate combination list comprises: Based on the N candidate weight derivation modes and the at least one candidate prediction mode, T second combinations are obtained, wherein any second combination of the T second combinations includes a weight derivation mode and K prediction modes, and the weight derivation mode and the K prediction modes included in any two combinations of the T second combinations are not completely the same, and T is a positive integer greater than 1; Based on the T second combinations, the candidate combination list is obtained.
74. The method according to claim 73, characterized in that The obtaining the candidate combination list based on the T second combinations includes: For any second combination among the T second combinations, determining a cost corresponding to the second combination when using the weight derivation mode and the K prediction modes in the second combination to predict the template of the current block; The candidate combination list is determined according to the cost corresponding to each second combination in the T second combinations.
75. The method of claim 72, wherein: The method further comprises: A first index is written into a bitstream, where the first index is used to indicate a first combination.
76. The method according to any one of claims 39 to 46, characterized in that The height of the upper template of the current block is 1, and / or the width of the left template of the current block is 1.
77. The method according to any one of claims 39 to 46, characterized in that The attribute information of the current block includes size information of the current block.
78. A frequency decoding device, characterized in that: include: A weight derivation mode determination unit, used to determine N candidate weight derivation modes, where N is a positive integer; A prediction list determining unit, configured to determine at least one candidate prediction mode based on the N candidate weight derivation modes and attribute information of the current block, wherein the candidate prediction mode list includes at least one candidate prediction mode; a processing unit, configured to determine, based on the N candidate weight derivation modes and the at least one candidate prediction mode, a first weight derivation mode and K first prediction modes corresponding to the current block, where K is a positive integer greater than 1; A prediction unit is used to predict the current block based on the first weight derivation mode and K first prediction modes to obtain a prediction value of the current block.
79. A frequency encoding device, characterized in that include: A weight derivation mode determination unit, used to determine N candidate weight derivation modes, where N is a positive integer; A prediction list determining unit, configured to determine at least one candidate prediction mode based on the N candidate weight derivation modes and attribute information of the current block, wherein the candidate prediction mode list includes at least one candidate prediction mode; a processing unit, configured to determine, based on the N candidate weight derivation modes and the at least one candidate prediction mode, a first weight derivation mode and K first prediction modes corresponding to the current block, where K is a positive integer greater than 1; A prediction unit is used to predict the current block based on the first weight derivation mode and K first prediction modes to obtain a prediction value of the current block.
80. An electronic device, characterized in that: including a processor and a memory; The memory shown is used to store computer programs; The processor is used to call and run the computer program stored in the memory to implement the method described in any one of claims 1 to 38 or 39 to 77 above.
81. A video encoding and decoding system, characterized in that: include: Video encoders and video decoders; The video decoder is used to implement the method described in any one of claims 1 to 38; The video encoder is used to implement the method described in any one of claims 39 to 77.
82. A computer-readable storage medium, characterized in that For storing computer programs; The computer program enables a computer to execute the method as described in any one of claims 1 to 38 or 39 to 77 above.