Video coding and decoding method, device, equipment, system and storage medium

CN119096545APending Publication Date: 2024-12-06GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280094788.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-04-12
Filing Date
2022-06-09
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When existing video encoding and decoding technology uses multiple prediction modes for video block prediction, a large amount of information needs to be transmitted in the code stream, resulting in increased encoding costs and increased syntax complexity, which affects encoding efficiency.

Method used

The weight derivation mode and K prediction modes are used as a combination, and the mode used by the current block is indicated in the code stream in the form of combination. The mode in the combination is determined by the decoding index for prediction, simplifying the syntax and saving code words.

Benefits of technology

It reduces the coding cost, improves the coding efficiency, simplifies the grammatical structure, and reduces the complexity of the encoding and decoding ends.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119096545A_ABST
    Figure CN119096545A_ABST
Patent Text Reader

Abstract

The invention provides a video encoding and decoding method, device, equipment, system and storage medium, a weight export mode and K prediction modes are used as a combination, so that the weight export mode and the K prediction modes used by a current block are indicated in a code stream in a combination form, at the moment, a decoding end obtains a first index by decoding the code stream, and the first index is used for decoding the current block. The first index is used for indicating a first combination composed of a weight derivation mode and K prediction modes, determining a first weight derivation mode and K first prediction modes included in the first combination according to the first index, and predicting the current block according to the first weight derivation mode and the K first prediction modes, according to the method, the first weight export mode and the K first prediction modes corresponding to the current block are indicated in a combined mode, so that grammar becomes simpler, code words are saved, judgment of various conditions is not needed, and then the coding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding and decoding methods, devices, equipment, systems, and storage media Technical Field This application relates to the field of video encoding and decoding technology, and in particular to a video encoding and decoding method, apparatus, device, system, and storage medium. Background Technology Digital video technology can be integrated into various video devices, such as digital televisions, smartphones, computers, e-readers, and video players. With the development of video technology, the amount of data contained in video data has become increasingly large. To facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data. Because video contains temporal or spatial redundancy, prediction can eliminate or reduce this redundancy, improving compression efficiency. Currently, to improve prediction performance, multiple prediction modes can be used to predict the current block. However, using multiple prediction modes for the current block requires transmitting more information in the bitstream, thus increasing encoding costs. Summary of the Invention This application provides a video encoding / decoding method, apparatus, device, system, and storage medium that can reduce encoding costs. In a first aspect, this application provides a video decoding method applied to a decoder, comprising: Decode the bitstream to obtain a first index, which is used to indicate a first combination, the first combination including a weighted derived mode and K prediction modes, where K is a positive integer greater than 1; Based on the first index, determine the first weighted derived pattern and K first prediction patterns included in the first combination; The current block is predicted based on the first weighted derivation pattern and the K first prediction patterns to obtain the predicted value of the current block. Secondly, embodiments of this application provide a video encoding method, including: Determine a first combination, which includes a first weighted derived pattern and K first prediction patterns; The current block is predicted based on the first weighted derivation mode and the K first prediction modes to obtain the predicted value of the current block; A bitstream is obtained based on the predicted value of the current block, and the bitstream includes a first index, which is used to indicate the first combination. Thirdly, this application provides a video decoding apparatus for performing the methods described in the first aspect or its various implementations. Specifically, the apparatus includes functional units for performing the methods described in the first aspect or its various implementations. Fourthly, this application provides a video encoding apparatus for performing the methods described in the second aspect or its various implementations. Specifically, the apparatus includes functional units for performing the methods described in the second aspect or its various implementations. Fifthly, a video decoder is provided, including a processor and a memory. 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 perform the methods in the first aspect or its implementations described above. In a sixth aspect, a video encoder is provided, including a processor and a memory. 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 perform the methods in the second aspect or its implementations described above. In a seventh aspect, a video encoding and decoding system is provided, including a video encoder and a video decoder. The video decoder is used to execute the methods in the first aspect or its implementations described above, and the video encoder is used to execute the methods in the second aspect or its implementations described above. Eighthly, a chip is provided for implementing the methods of 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, causing a device on which the chip is mounted to perform the methods of any one of the first to second aspects or their respective implementations. Ninthly, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the methods of any one of the first to second aspects or their respective implementations. In a tenth aspect, a computer program product is provided, including computer program instructions that cause a computer to perform the methods of any one of the first to second aspects or their respective implementations. Eleventhly, a computer program is provided that, when run on a computer, causes the computer to perform the methods of any one of the first to second aspects or their respective implementations. In the twelfth aspect, a bitstream is provided, which is generated based on the method of the second aspect above. Optionally, the bitstream includes a first index, which indicates a first combination consisting of a weighted derived mode and K prediction modes, where K is a positive integer greater than 1. Based on the above technical solutions, this application combines the weighted derived mode and K prediction modes as a single combination. This combination indicates the weighted derived mode and K prediction modes used by the current block in the bitstream. The decoding end obtains a first index by decoding the bitstream. This first index indicates a first combination consisting of one weighted derived mode and K prediction modes. Based on this first index, the first weighted derived mode and K first prediction modes included in the first combination are determined. The current block is then predicted based on the first weighted derived mode and K first prediction modes to obtain the predicted value of the current block. This application uses a combination to indicate the first weighted derived mode and K first prediction modes corresponding to the current block, simplifying the syntax, saving codewords, and eliminating the need for various case judgments, thereby improving encoding efficiency. Attached Figure Description Figure 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of this application; Figure 2 is a schematic block diagram of a video encoder involved in an embodiment of this application; Figure 3 is a schematic block diagram of a video decoder involved in an embodiment of this application; Figure 4 is a schematic diagram of weight allocation; Figure 5 is a schematic diagram of weight allocation; Figure 6A is a schematic diagram of inter-frame prediction; Figure 6B is a schematic diagram of weighted inter-frame prediction; Figure 7A is a schematic diagram of intra-frame prediction; Figure 7B is a schematic diagram of intra-frame prediction; Figures 8A-8I are schematic diagrams of intra-frame prediction; Figure 9 is a schematic diagram of the intra-frame prediction mode; Figure 10 is a schematic diagram of the intra-frame prediction mode; Figure 11 is a schematic diagram of the intra-frame prediction mode; Figure 12 is a schematic diagram of MIP; Figure 13 is a schematic diagram of weighted prediction; Figure 14 is a schematic diagram of template matching; Figure 15 is a schematic flowchart of a video decoding method provided in an embodiment of this application; Figure 16A is a schematic diagram of a weight allocation; Figure 16B is a schematic diagram of another weight allocation; Figure 17 is a schematic diagram of the derivation of template weights; Figure 18 is a schematic diagram of a template; Figure 19 is a schematic diagram of the video coding method provided in an embodiment of this application; Figure 20 is a schematic block diagram of a video decoding apparatus provided in an embodiment of this application; Figure 21 is a schematic block diagram of a video encoding apparatus provided in an embodiment of this application; Figure 22 is a schematic block diagram of an electronic device provided in an embodiment of this application; Figure 23 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of this application. Detailed Implementation This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, and real-time video encoding and decoding. For example, the solution of this application can be combined with audio video coding standards (AVS), such as H.264 / Audio Video Coding (AVC) standard, H.265 / High Efficiency Video Coding (HEVC) standard, and H.266 / Versatile Video Coding (VVC) standard. Alternatively, the solution of this application can be combined with other proprietary or industry standards, including ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262 or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO / IEC MPEG-4 AVC), which include Scalable Video Coding (SVC) and Multi-View Video Coding (MVC) extensions. It should be understood that the technology in this application is not limited to any particular codec standard or technology. For ease of understanding, the video encoding and decoding system involved in the embodiments of this application will be introduced first with reference to Figure 1. Figure 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of this application. It should be noted that Figure 1 is only an example, and the video encoding and decoding system of this application includes, but is not limited to, the one shown in Figure 1. As shown in Figure 1, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is used to encode (can be understood as compressing) video data to generate a bitstream, and transmits the bitstream to the decoding device. The decoding device decodes the bitstream generated by the encoding device to obtain decoded video data. The encoding device 110 in this application embodiment can be understood as a device with video encoding function, and the decoding device 120 can be understood as a device with video decoding function. That is, the encoding device 110 and the decoding device 120 in this application embodiment include a wider range of devices, such as smartphones, desktop computers, mobile computing devices, laptops (e.g., laptop computers), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, etc. In some embodiments, encoding device 110 may transmit encoded video data (such as a bitstream) to decoding device 120 via channel 130. Channel 130 may include one or more media and / or means capable of transmitting encoded video data from encoding device 110 to decoding device 120. In one example, channel 130 includes one or more communication media that enable encoding device 110 to transmit encoded video data directly to decoding device 120 in real time. In this example, encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding device 120. The communication media includes wireless communication media, such as radio frequency spectrum; optionally, the communication media may also include wired communication media, such as one or more physical transmission lines. In another example, channel 130 includes a storage medium that can store video data encoded by encoding device 110. The storage medium includes various local access data storage media, such as optical discs, DVDs, flash memory, etc. In this example, decoding device 120 can retrieve the encoded video data from the storage medium. In another example, channel 130 may include a storage server that can store the video data encoded by encoding device 110. In this example, decoding device 120 can download the stored encoded video data from the storage server. Optionally, the storage server can store and transmit the encoded video data to 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 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 capture device (e.g., 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. Video encoder 112 encodes video data from video source 111 to generate a bitstream. The video data may include one or more pictures or a sequence of pictures. The bitstream contains the encoding information of the pictures or picture sequences in the form of a bitstream. The encoding information may include encoded picture data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), 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. A syntax structure refers to a set of zero or more syntax elements arranged in a specified order within the bitstream. The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored on a storage medium or a storage server for subsequent retrieval 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, in addition to the input interface 121 and the video decoder 122, the decoding device 120 may also include a display device 123. The input interface 121 includes a receiver and / or a modem. The input interface 121 can receive encoded video data through channel 130. The video decoder 122 is used to decode the encoded video data to obtain the decoded video data, and transmit the decoded video data to the display device 123. Display device 123 displays the decoded video data. Display device 123 may be integrated with decoding device 120 or external to decoding device 120. Display device 123 may include various display devices, such as liquid crystal display (LCD), plasma display, organic light-emitting diode (OLED) display, or other types of display devices. Furthermore, Figure 1 is merely an example, and the technical solutions of this application are not limited to Figure 1. For example, the technology of this application can also be applied to one-sided video encoding or one-sided video decoding. The video coding framework involved in the embodiments of this application is described below. Figure 2 is a schematic block diagram of a video encoder according to an embodiment of this application. It should be understood that the video encoder 200 can be used for lossy compression of images or lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression. This video encoder 200 can be applied to image data in luminance / chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) per 4 pixels; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr). For example, the video encoder 200 reads video data and divides each frame into several coding tree units (CTUs). In some examples, CTUs may be called "tree blocks," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU can be associated with a pixel block of equal size within the image. Each pixel can correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU can be further divided into several coding units (CUs) for encoding. CUs can be rectangular or square blocks. The CU can be further divided into prediction units (PUs) and transform units (TUs), thus separating encoding, prediction, and transformation for more flexible processing. In one example, the CTU is divided into CUs using a quadtree structure, and the CUs are further divided into TUs and PUs using a quadtree structure. The video encoder and decoder support various PU sizes. Assuming a specific CU size of 2N×2N, the video encoder and decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and also support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and decoder can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction. 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 filtering 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 this application, the current block can be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block can also be referred to as the predicted image block or the image prediction block, and the reconstructed image block can also be referred to as the reconstruction block or the image reconstruction block. In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Because there is a strong correlation between adjacent pixels in a frame of a video, intra-frame prediction is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in a video, inter-frame prediction is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency. Inter-frame prediction unit 211 can be used for inter-frame prediction, which can include motion estimation and motion compensation. It can reference image information from different frames. Inter-frame prediction uses motion information to find a reference block from the reference frame and generates a prediction block based on the reference block to eliminate temporal redundancy. The frames used for inter-frame prediction can be P-frames and / or B-frames, where P-frames refer to forward prediction frames and B-frames refer to bidirectional prediction frames. The motion information includes a list of reference frames, the reference frame index, and motion vectors. Motion vectors can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering needs to be used in the reference frame to create the required fractional-pixel blocks. Here, the integer-pixel or fractional-pixel blocks in the reference frame found based on the motion vectors are called reference blocks. Some techniques directly use the reference block as the prediction block, while others process the reference block further to generate the prediction block. Processing the reference block further to generate the prediction block can also be understood as using the reference block as the prediction block and then processing it to generate a new prediction block. Intra-prediction unit 212 refers only to information from the same frame image to predict pixel information within the current code image block, thereby eliminating spatial redundancy. The frame used for intra-prediction can be an I-frame. Intra-frame prediction has multiple prediction modes. Taking the international digital video coding standards H-series as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angular prediction mode, while H.265 / HEVC extends this to 33 angular prediction modes and 2 non-angular prediction modes. HEVC uses Planar, DC, and 33 angular modes for a total of 35 intra-frame prediction modes. VVC uses Planar, DC, and 65 angular modes for a total of 67 intra-frame prediction modes. It should be noted that with the increase in angle modes, intra-frame prediction will be more accurate and better meet the needs of the development of high-definition and ultra-high-definition digital video. The residual unit 220 can generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, the residual unit 220 can generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the PU of the CU. Transform / quantization unit 230 can quantize transform coefficients. Transform / quantization unit 230 can quantize transform coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. Video encoder 200 can 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 can apply inverse quantization and inverse transform to the quantized transform coefficients to reconstruct the residual block from the quantized transform coefficients. The reconstruction unit 250 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by the prediction unit 210 to produce a reconstructed image block associated with the TU. By reconstructing the sampled blocks of each TU of the CU in this way, the video encoder 200 can reconstruct the pixel blocks of the CU. The loop filtering unit 260 is used to process the pixels after inverse transformation and inverse quantization to compensate for the distortion information and provide a better reference for subsequent encoded pixels. For example, it can perform deblocking filtering to reduce the block effect of pixel blocks associated with the CU. In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit and a sample adaptive compensation / adaptive loop filtering (SAO / ALF) unit, wherein the deblocking filtering unit is used to remove block effects and the SAO / ALF unit is used to remove ringing effects. The decoded image buffer 270 can store reconstructed pixel blocks. The inter-frame prediction unit 211 can use a reference image containing the reconstructed pixel blocks to perform inter-frame prediction on PUs of other images. In addition, the intra-frame prediction unit 212 can use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra-frame prediction on other PUs in the same image as the CU. Entropy coding unit 280 can receive quantized transform coefficients from transform / quantization unit 230. Entropy coding unit 280 can perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data. Figure 3 is a schematic block diagram of the video decoder involved in the embodiments of this application. As shown in Figure 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 filtering unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may contain more, fewer, or different functional components. The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can parse the bitstream to extract syntax elements from it. As part of parsing the bitstream, the entropy decoding unit 310 can parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / transform unit 330, the reconstruction unit 340, and the loop filtering unit 350 can decode the video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data. In some embodiments, the prediction unit 320 includes an intra-frame prediction unit 322 and an inter-frame prediction unit 321. Intra-prediction unit 322 can perform intra-prediction to generate prediction blocks for the PU. Intra-prediction unit 322 can use an intra-prediction mode to generate prediction blocks for the PU based on pixel blocks of spatially adjacent PUs. Intra-prediction unit 322 can also determine the intra-prediction mode of the PU based on one or more syntax elements parsed from the bitstream. Inter-frame prediction unit 321 can construct a first reference image list (list 0) and a second reference image list (list 1) based on the syntax elements parsed from the bitstream. Furthermore, if the PU uses inter-frame prediction coding, the entropy decoding unit 310 can parse the motion information of the PU. Inter-frame prediction unit 321 can determine one or more reference blocks of the PU based on the motion information of the PU. Inter-frame prediction unit 321 can generate prediction blocks for the PU based on one or more reference blocks of the PU. The dequantization / transformation unit 330 reversibly quantizes (i.e., dequantizes) the transform coefficients associated with the TU. The dequantization / transformation unit 330 can use the QP value associated with the CU of the TU to determine the degree of quantization. After the inverse quantization transform coefficients, the inverse quantization / transformation unit 330 can apply one or more inverse transforms to the inverse quantization transform coefficients 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 can add the sample of the residual block to the corresponding sample of the prediction block to reconstruct the pixel block of the CU, thereby obtaining the reconstructed image block. The loop filter unit 350 can perform deblocking filtering operations to reduce the block effect of pixel blocks associated with the CU. The video decoder 300 can store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 can 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 image is divided into blocks. For the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. The residual unit 220 can calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block. This residual block can also be called residual information. This residual block is transformed and quantized by the transform / quantization unit 230, which can remove information that is not sensitive to the human eye to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization unit 230 can be called a temporal residual block, and the temporal residual block after transformation and quantization by the transform / 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 coefficients output by the change quantization unit 230, and can perform entropy coding on the quantized change coefficients to output a bitstream. For example, the entropy coding unit 280 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream. At the decoding end, the entropy decoding unit 310 can parse the bitstream to obtain the prediction information and quantization coefficient matrix of the current block. The prediction unit 320 uses intra-frame prediction or inter-frame prediction to generate the prediction block of the current block based on the prediction information. The dequantization / transform unit 330 uses the quantization coefficient matrix obtained from the bitstream to perform dequantization and inverse transform on the quantization coefficient matrix to obtain the residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain the reconstructed block. The reconstructed blocks form the reconstructed image. The loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain the decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. This decoded image can also be called the reconstructed image, which can be used as a reference frame for inter-frame prediction in subsequent frames. It should be noted that the block partitioning information determined at the encoding end, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, are carried in the bitstream when necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding end by parsing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The above describes the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. This application is applicable to the basic flow of a video codec under this block-based hybrid coding framework, but is not limited to this framework and flow. In some embodiments, the current block can be the current coding unit (CU) or the current prediction unit (PU), etc. Due to the need for parallel processing, an image can be divided into slices, etc. Slices within the same image can be processed in parallel, meaning they have no data dependency on each other. A "frame" is a commonly used term, generally understood as an image. In this application, "frame" can also be replaced with "image" or "slice," etc. The Versatile Video Coding (VVC) standard, currently under development, includes an inter-frame prediction mode called Geometric Partitioning Mode (GPM). The Audio Video Coding Standard (AVS) standard, also under development, includes an inter-frame prediction mode called Angular Weighted Prediction (AWP). Although these two modes differ in name and specific implementation, they share common principles. It's important to note that traditional unidirectional prediction uses only one reference block of the same size as the current block, while traditional bidirectional prediction uses two reference blocks of the same size. The pixel value of each point in the predicted block is the average of the corresponding positions in the two reference blocks; that is, all points in each reference block occupy a 50% proportion. Bidirectional weighted prediction allows the proportions of the two reference blocks to differ, such as all points in the first reference block occupying a 75% proportion and all points in the second reference block occupying a 25% proportion. However, the proportions of all points within the same reference block are always the same. Other optimization techniques, such as Decoder Side Motion Vector Refinement (DMVR) and Bidirectional Optical Flow (BIO), may cause some changes in the reference or predicted pixels, but these are unrelated to the principles described above. BIO can also be abbreviated as BDOF. GPM or AWP also uses two reference blocks of the same size as the current block. However, some pixel locations use 100% of the pixel values ​​from the first reference block, and some pixel locations use 100% of the pixel values ​​from the second reference block. In the boundary or transition region, the pixel values ​​from both reference blocks are used in proportion. The weights in the boundary region also gradually transition. How these weights are specifically allocated is determined by the GPM or AWP mode. The weight of each pixel location is determined according to the GPM or AWP mode. Of course, in some cases, such as when the block size is very small, some GPM or AWP modes may not guarantee that some pixel locations will use 100% of the pixel values ​​from the first reference block, and some pixel locations will use 100% of the pixel values ​​from the second reference block. Alternatively, GPM or AWP can be considered to use two reference blocks of different sizes from the current block, that is, taking a portion of each as the reference block. That is, the part with a weight of non-zero is used as the reference block, while the part with a weight of zero is discarded. This is an implementation issue and not the focus of this invention. For example, Figure 4 is a schematic diagram of weight allocation. As shown in Figure 4, it illustrates the weight allocation of a GPM on a 64×64 current block using multiple partitioning modes, provided in an embodiment of this application. The GPM has 64 partitioning modes. Figure 5 is a schematic diagram of weight allocation. As shown in Figure 5, it illustrates the weight allocation of an AWP on a 64×64 current block using multiple partitioning modes, provided in an embodiment of this application. The AWP has 56 partitioning modes. In both Figure 4 and Figure 5, under each partitioning mode, the black area represents the weight value of the position corresponding to the first reference block as 0%, the white area represents the weight value of the position corresponding to the first reference block as 100%, and the gray area, according to its color intensity, represents a weight value greater than 0% and less than 100% for the position corresponding to the first reference block. The weight value of the position corresponding to the second reference block is 100% minus the weight value of the position corresponding to the first reference block. GPM and AWP use different methods to derive weights. GPM determines the angle and offset for each mode and then calculates the weight matrix for each mode. AWP first draws 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 early encoding and decoding technologies only used rectangular partitioning, whether for CUs, PUs, or Transform Units (TUs). GPM and AWP, however, achieved non-rectangular partitioning for prediction without such partitioning. GPM and AWP use a weighted mask of two reference blocks, i.e., the weight map mentioned above. This mask determines the weights of the two reference blocks when generating the prediction block. Simply put, part of the prediction block's location comes from the first reference block, and part comes from the second. The blending area is obtained by weighting the corresponding positions of the two reference blocks, resulting in a smoother transition. Since GPM and AWP do not divide the current block into two CUs or PUs along a dividing line, the residual transformation, quantization, inverse transformation, and inverse quantization after prediction are all processed as a single unit. GPM uses a weight matrix to simulate the partitioning of geometry, or more precisely, the partitioning of predictions. To implement GPM, in addition to the weight matrix, two prediction values ​​are needed, each determined by one unidirectional motion information. These two unidirectional motion information pieces come from a motion information candidate list, such as the merge motion information candidate list (mergeCandList). GPM uses two indices in the bitstream to determine the two unidirectional motion information pieces 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 motion vectors (MVs). A common bidirectional prediction method uses two reference blocks to predict the current block. These two reference blocks can be one forward reference block and one backward reference block. Optionally, both can be forward or both can be backward. Forward means the reference frame's time point is before the current frame, and backward means the reference frame's time point is after the current frame. Alternatively, forward means the reference frame's position in the video is before the current frame, and backward means the reference frame's position is after the current frame. Or, forward means the reference frame's picture order count (POC) is less than the current frame's POC, and backward means the reference frame's POC is greater than the current frame's POC. To use bidirectional prediction, two reference blocks are needed, requiring information from two sets of reference frames and motion vectors. Each set can be understood as a unidirectional motion information, and combining these two sets together forms a bidirectional motion information. In specific implementations, unidirectional and bidirectional motion information can use the same data structure, except that the information of both sets of reference frames and motion vectors are valid in bidirectional motion information, while the information of one set of reference frames and motion vectors is invalid in unidirectional motion information. In some embodiments, two reference frame lists are supported, denoted as RPL0 and RPL1, where RPL is short for Reference Picture List. In some embodiments, a P slice can only use RPL0, while a B slice can use both RPL0 and RPL1. For a slice, each reference frame list contains several reference frames, and the codec finds a specific reference frame using its reference frame index. In some embodiments, motion information is represented by reference frame indices and motion vectors. For example, for the bidirectional motion information mentioned above, the reference frame index refIdxL0 corresponding to reference frame list 0 and the motion vector mvL0 corresponding to reference frame list 0 are used; the reference frame index refIdxL1 corresponding to reference frame list 1 and the motion vector mvL0 corresponding to reference frame list 1 are used. The reference frame indices corresponding to reference frame list 0 and reference frame list 1 can be understood as the information of the reference frames mentioned above. In some embodiments, two flags are used to indicate whether the motion information corresponding to reference frame list 0 is used and whether the motion information corresponding to reference frame list 0 is used, denoted as predFlagL0 and predFlagL1, respectively. This can also be understood as predFlagL0 and predFlagL1 representing whether the aforementioned 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 is not used; instead, motion vectors are used. The reference frame index and the flag indicating whether to use the corresponding motion information can be considered as subordinate to the motion vector. For convenience, this application still uses "motion information," but it should be understood that "motion vector" can also be used. Motion information used in the current block can be saved. Subsequent blocks in the current frame can use the motion information of previously encoded blocks, such as adjacent blocks, based on their positional relationships. This utilizes spatial correlation, so this type of encoded motion information is called spatial motion information. Motion information used by each block in the current frame can also be saved. Subsequent frames can use the motion information of previously encoded frames based on their reference relationships. This utilizes temporal correlation, so this type of encoded frame motion information is called temporal motion information. The method for storing motion information used by each block in the current frame typically involves using a fixed-size matrix, such as a 4x4 matrix, as a minimum unit, with each minimum unit storing a separate set of motion information. In this way, for each encoded block, the minimum units corresponding to its position can store the motion information for that block. This allows for direct retrieval of the motion information at a given position when using spatial or temporal motion information. For example, if a 16x16 block uses traditional one-way prediction, then all 4x4 minimum units corresponding to this block store the motion information for that one-way prediction. If a block uses GPM or AWP, then the motion information stored in each of the block's smallest units is determined based on the GPM or AWP mode, the first motion information, the second motion information, and the position of each smallest unit. One approach is that if all 4x4 pixels of a smallest unit come from the first motion information, then that smallest unit stores the first motion information; if all 4x4 pixels come from the second motion information, then that smallest unit stores the second motion information. If the 4x4 pixels of a smallest unit come from both the first and second motion information, then AWP selects one motion information to store. GPM's approach is to combine two motion information sets into bidirectional motion information if the two sets point to different reference frame lists; otherwise, only the second motion information is stored. Optionally, the mergeCandList described above is constructed based on spatial motion information, temporal motion information, historical motion information, and other types of motion information. For example, mergeCandList uses positions 1 to 5 in Figure 6A to derive spatial motion information, and positions 6 or 7 in Figure 6A to derive temporal motion information. Historical motion information is added to a first-in-first-out (FIFO) list each time a block is encoded or decoded. This addition process may require checks, such as checking for duplicate motion information already in the list. This allows the historical motion information to be referenced when encoding or 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, then it uses GPM, which is the content shown in the syntax "if(!ciip_flag[x0][y0])" in Table 1. As shown in Table 1 above, GPM needs to transmit three pieces of information in the bitstream: merge_gpm_partition_idx, merge_gpm_idx0, and merge_gpm_idx1. x0 and y0 are used to determine the coordinates (x0, y0) of the current block's top-left luminance pixel relative to the top-left luminance pixel of the image. merge_gpm_partition_idx determines the partition shape of GPM; as mentioned above, it is a "simulated partition." merge_gpm_partition_idx is what this article refers to as the weight matrix derivation mode or the index of the weight matrix derivation mode, or simply the weight derivation mode or weight derivation mode index. merge_gpm_idx0 is the first merge candidate index, used to determine the first motion information, or the first merge candidate, based on mergeCandList. merge_gpm_idx1 is the second merge candidate index, used to determine the second motion information, or the second merge candidate, based on mergeCandList. If MaxNumGpmMergeCand > 2, meaning the candidate list length is greater than 2, then it is necessary to decode merge_gpm_idx1; otherwise, it can be determined directly. In some embodiments, the GPM decoding process includes the following steps: The information input to the decoding process includes: the coordinates (xCb, yCb) of the brightness position of the top-left corner of the current block relative to the top-left corner of the image, the width cbWidth of the brightness component of the current block, the height cbHeight of the brightness component of the current block, the brightness motion vectors mvA and mvB with 1 / 16 pixel precision, the chroma motion vectors mvCA and mvCB, the reference frame indices refIdxA and refIdxB, and the prediction list flags predListFlagA and predListFlagB. For example, motion information can be represented by combining motion vectors, reference frame indices, and prediction list flags. VVC supports two reference frame lists, each of which may contain multiple reference frames. Unidirectional prediction uses only one reference block from one reference frame in one of the reference frame lists as a reference, while bidirectional prediction uses one reference block from each of the two reference frame lists. GPM in VVC uses two unidirectional predictions. In the above examples of mvA and mvB, mvCA and mvCB, refIdxA and refIdxB, predListFlagA and predListFlagB, A can be understood as the first prediction mode, and B as the second prediction mode. We use X to represent A or B, predListFlagX to indicate whether X uses the first or second reference frame list, refIdxX to indicate the reference frame index in the reference frame list used by X, mvX to indicate the luma motion vector used by X, and mvCX to indicate the chroma motion vector used by X. To reiterate, in VVC, the motion vector, reference frame index, and prediction list flags can be considered as a combination to represent the motion information described herein. The information output during the decoding process includes: a luminance prediction sample matrix predSamplesL of (cbWidth) x (cbHeight); a prediction sample matrix of the Cb chromaticity component of (cbWidth / SubWidthC) x (cbHeight / SubHeightC), if needed; and a prediction sample matrix of the Cr chromaticity component of (cbWidth / SubWidthC) x (cbHeight / SubHeightC), if needed. For example, the following uses the luminance component as an example; the processing of the chrominance component is similar to that of the luminance component. Assume that the sizes of predSamplesLAL and predSamplesLBL are (cbWidth) x (cbHeight), representing the prediction sample matrices derived from two prediction modes. predSamplesL is derived as follows: predSamplesLAL and predSamplesLBL are determined based on the luminance motion vectors mvA and mvB, the chrominance motion vectors mvCA and mvCB, the reference frame indices refIdxA and refIdxB, and the prediction list flags predListFlagA and predListFlagB. That is, predictions are made based on the motion information of the two prediction modes; the detailed process is not elaborated here. Typically, GPM uses a merge mode, so both prediction modes of GPM can be considered merge modes. Based on 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, 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 since all three components (such as Y, Cb, and Cr) can use GPM, some standard texts package the process of generating the GPM prediction sample matrix for one component into a sub-process, namely the weighted sample prediction process for geometric partitioning mode (GPM). All three components will call this process, but with different parameters. Here, we only use the luminance component as an example. The prediction matrix predSamplesL[xL][yL] (where xL = 0..cbWidth–1, yL = 0..cbHeight–1) of the current luminance block is derived from the weighted prediction process of GPM. Here, nCbW is set to cbWidth, nCbH is set to cbHeight, and the prediction sample matrices predSamplesLAL and predSamplesLBL from the two prediction modes, along with angleIdx and distanceIdx, are used as input. In some embodiments, the weighted prediction derivation process for GPM includes the following steps: The inputs to this process are: the width nCbW and height nCbH of the current block; two (nCbW) x (nCbH) prediction sample matrices, predSamplesLA and predSamplesLB; the GPM's dividing angle index variable angleIdx; the GPM's distance index variable distanceIdx; and the component index variable cIdx. This example uses luminance, therefore cIdx is 0, representing the luminance component. The output of this process is: a GPM prediction sample matrix pbSamples of (nCbW)X(nCbH). For example, variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are exported 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 encoding and decoding; offset1 = 1 << (shift1 - 1), where "<<" indicates a 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 exported as follows: When the value of shiftHor is 0: offsetX = (-nW) >> 1, offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3)). When shiftHor is 1: offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3), offsetY = (-nH) >> 1. Variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*SubWidthC, yL=(cIdx==0)? y:y*SubHeightC, The variable wValue, which represents the weight of the predicted sample at the current position, is derived as follows: wValue is the weight of the predicted 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 predicted value predSamplesLB[x][y] of the prediction matrix of the first 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 in the current block, and then a GPM prediction value pbSamples[x][y] is calculated. Because in this method, the weight wValue does not need to be written in matrix form, but it can be understood that if the wValue of each position is stored in a matrix, then it is a weight matrix. The principle is the same whether the weights are calculated separately for each point and then weighted to obtain the GPM prediction value, or all weights are calculated and then weighted uniformly to obtain the GPM prediction sample matrix. The use of the term "weight matrix" in many descriptions in this application is for easier understanding and more intuitive visualization. In fact, it can also be described according to the weight of each position. For example, the weight matrix derivation mode can also be called the weight derivation mode. In some embodiments, as shown in Figure 6B, the GPM decoding process can be described as follows: Parse the bitstream to determine whether the current block uses GPM technology; if the current block uses GPM technology, determine the weight derivation mode (or partitioning mode or weight matrix derivation mode), and the first motion information and the second motion information. Determine the first prediction block based on the first motion information, determine the second prediction block based on the second motion information, determine the weight matrix based on the weight matrix derivation mode, and determine the prediction block of the current block based on the first prediction block, the second prediction block, and the weight matrix. Intra-frame prediction uses the reconstructed pixels that have already been encoded 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 current block size is 4x4. The pixels in the left row and the top column of the current block are the reference pixels for the current block. Intra-frame prediction uses these reference pixels to predict the current block. These reference pixels may all be available, i.e., all have been encoded and decoded. Some may also be unavailable. For example, if the current block is the leftmost part of the entire frame, then the reference pixels on the left side of the current block are unavailable. Or, if the lower left part of the current block has not yet been encoded and decoded, then the reference pixels in the lower left are also unavailable. In the case where reference pixels are unavailable, available reference pixels, certain values, or certain methods can be used to fill the gaps, or no filling can be performed. Figure 7B is a schematic diagram of intra-frame prediction. As shown in Figure 7B, the Multiple Reference Line (MRL) intra-frame prediction method can use more reference pixels to improve encoding and decoding efficiency. For example, four reference rows / columns can be used as reference pixels for the current block. Furthermore, intra-frame prediction has multiple prediction modes. Figures 8A-5I illustrate intra-frame prediction. As shown in Figures 8A-5I, intra-frame prediction of a 4x4 block in H.264 mainly includes nine modes. Among them, Mode 0, as shown in Figure 8A, copies the pixels above the current block vertically to the current block as the prediction value. Mode 1, as shown in Figure 8B, copies the reference pixel on the left horizontally to the current block as the prediction value. Mode 2, as shown in Figure 8C, uses the average value of points A-D and I-L as the prediction value for all points. Modes 3-8, as shown in Figures 8D-5I, copy the reference pixel to the corresponding position in the current block at a certain angle. Because some positions in the current block cannot correspond exactly to the reference pixel, it may be necessary to use the weighted average value of the reference pixels, or the interpolated reference pixel sub-pixels. In addition to these, there are Plane, Planar, and other modes. With technological advancements and increased block size, the number of angle prediction modes is also increasing. Figure 9 shows a schematic diagram of intra-frame prediction modes. As shown in Figure 9, HEVC uses 35 intra-frame prediction modes, including Planar, DC, and 33 angle modes. Figure 10 shows a schematic diagram of intra-frame prediction modes. As shown in Figure 10, VVC uses 67 intra-frame prediction modes, including Planar, DC, and 65 angle modes. Figure 11 shows a schematic diagram of intra-frame prediction modes. As shown in Figure 11, VS3 uses 66 prediction modes, including DC, Plane, Bilinear, PCM, and 62 angle modes. Other techniques improve prediction, such as improving the subpixel interpolation of the reference pixel and filtering the predicted pixels. For example, the multiple inraprediction filter (MIPF) in AVS3 uses different filters to generate predicted values ​​for different block sizes. Within the same block, pixels closer to the reference pixel are predicted using one filter, while pixels farther from the reference pixel are predicted using another. Techniques for filtering predicted pixels include the intraprediction filter (IPF) in AVS3, which can filter the predicted values ​​using the reference pixel. In intra-frame prediction, the Most Probable Modes List (MPM) intra-frame mode coding technique can be used to improve encoding and decoding efficiency. A mode list is constructed by utilizing the intra-frame prediction modes of surrounding already encoded blocks, as well as intra-frame prediction modes derived from the intra-frame prediction modes of surrounding already encoded blocks, such as adjacent modes, and some commonly used or frequently used intra-frame prediction modes, such as DC, Planar, and Bilinear modes. Referencing the intra-frame prediction modes of surrounding already encoded blocks utilizes spatial correlation, because textures have a certain degree of spatial continuity. MPM can be used as a prediction for intra-frame prediction modes, meaning that the probability of the current block using MPM is considered higher than the probability of not using MPM. Therefore, during binarization, fewer codewords are used for MPM, thus saving overhead and improving encoding and decoding efficiency. In some embodiments, matrix-based intra-prediction (MIP), sometimes also referred to as matrix-weighted intra-prediction, can be used for intra-prediction. As shown in Figure 12, to predict a block with width W and height H, MIP requires H reconstructed pixels from the left column of the current block and W reconstructed pixels from the top row of the current block as input. MIP generates the prediction block in three steps: reference pixel averaging, matrix vector multiplication, and interpolation. Matrix multiplication is the core of MIP. MIP can be considered as a process of generating a prediction block using input pixels (reference pixels) through matrix multiplication. MIP provides various matrices, and the different prediction methods are reflected in the different matrices. Using different matrices with the same input pixels will yield different results. The reference pixel averaging and interpolation processes are a trade-off between performance and complexity. For larger blocks, reference pixel averaging can achieve an approximate downsampling effect, allowing the input to be adapted to a smaller matrix, while interpolation achieves an upsampling effect. This eliminates the need to provide a MIP matrix for every block size; instead, only one or a few specific size matrices are required. As demands for compression performance increase, and as hardware capabilities improve, next-generation standards may feature even more complex MIPs. MIP is somewhat similar to planar, but MIP is clearly more complex and flexible than planar. GPM combines two inter-frame prediction blocks using a weight matrix. In fact, it can be extended to combine two arbitrary prediction blocks, such as two inter-frame prediction blocks, two intra-frame prediction blocks, one inter-frame prediction block, and one intra-frame prediction block. Even in screen content encoding, prediction blocks from IBC (intra-block copy) or palettes can be used as one or two of the prediction blocks. This application refers to intra-frame, inter-frame, IBC, and palette as different prediction methods. For ease of expression, we use the term "prediction mode" here. A prediction mode can be understood as the information that the codec can use to generate a prediction block for the current block. For example, in intra-frame prediction, the prediction mode can be a specific intra-frame prediction mode, such as DC, Planar, various intra-frame angle prediction modes, etc. It can also superimpose one or more auxiliary information, such as optimization methods for intra-frame reference pixels, or optimization methods (such as filtering) after generating the initial prediction block. For example, in inter-frame prediction, the prediction mode can be skip mode, merge mode, MMVD (merge with motion vector difference) mode, or AMVP (advanced motion vector prediction), and can be unidirectional, bidirectional, 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 based on that motion information, a prediction block can be determined. If the inter-frame prediction mode uses bidirectional prediction, a prediction mode must also be able to determine two motion information points, and the prediction block can be determined based on the two motion information points. Thus, the information required for GPM can be expressed as one weighted derivation pattern and two prediction patterns. The weighted derivation pattern is used to determine the weight matrix or weights, and the two prediction patterns each determine a prediction block or prediction value. The weighted derivation pattern is sometimes referred to as a partitioning pattern. However, because it is a simulated partitioning, this application refers to it as a weighted derivation pattern. The two prediction modes can come from the same or different prediction methods, including but not limited to intra-frame prediction, inter-frame prediction, IBC, and palette. Optionally, the two prediction modes can come from the same or different prediction methods, including but not limited to intra-frame prediction, inter-frame prediction, IBC, and palette. A concrete example is as follows: if the current block uses GPM. This example is used in inter-frame coded blocks, allowing the use of merge modes in intra-frame prediction and inter-frame prediction. As shown in Table 4, an additional syntax element `intra_mode_idx` indicates which prediction mode is the intra-frame prediction mode. For example, `intra_mode_idx` of 0 indicates that both prediction modes are inter-frame prediction modes, i.e., `mode0IsInter` is 1 and `mode0IsInter` is 1; `intra_mode_idx` of 1 indicates that the first prediction mode is the intra-frame prediction mode and the second prediction mode is the inter-frame prediction mode, i.e., `mode0IsInter` is 0 and `mode0IsInter` is 1; `intra_mode_idx` of 2 indicates that the first prediction mode is the inter-frame prediction mode and the second prediction mode is the intra-frame prediction mode, i.e., `mode0IsInter` is 1 and `mode0IsInter` is 0; `intra_mode_idx` of 3 indicates that both prediction modes are intra-frame prediction modes, i.e., `mode0IsInter` is 0 and `mode0IsInter` is 0. Table 4 In some embodiments, as shown in Figure 13, the GPM decoding process can be described as follows: Parse the bitstream to determine whether the current block uses GPM technology; if the current block uses GPM technology, determine the weight derivation mode (or partitioning mode or 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, 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. Template matching was first used in inter-frame prediction. It utilizes the correlation between adjacent pixels to use some regions surrounding the current block as templates. During the encoding and decoding of the current block, its left and top sides are already encoded and decoded according to the encoding order. However, in existing hardware decoder implementations, it's not guaranteed that the left and top sides are already decoded when the current block begins decoding. This applies to inter-frame blocks; for example, in HEVC, inter-coded blocks do not require surrounding reconstructed pixels when generating prediction blocks, allowing the prediction process for inter-frame blocks to run in parallel. However, intra-coded blocks always require reconstructed pixels from the left and top sides as reference pixels. Theoretically, the left and top sides are available, meaning that hardware design adjustments can be made to achieve this. Relatively speaking, the right and bottom sides are not available under current standards like VVC's encoding order. As shown in Figure 14, the rectangular regions on the left and top sides of the current block are set as templates. The height of the template on the left side is generally the same as the height of the current block, and the width of the template on the top side is generally the same as the width of the current block, although they can be different. The optimal 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 reference frame and searching within a certain range around it. Search rules, such as the search range and search step size, can be pre-defined. At each position, the matching degree between the template at that position and the templates surrounding the current block is calculated. The matching degree can be measured by some distortion costs, such as SAD (sum of absolute difference) and SATD (sum of absolute transformed difference). SATD typically uses the Hadamard transform and MSE (mean-square error). The smaller the values ​​of SAD, SATD, and MSE, the higher the matching degree. The cost is calculated using the predicted block of the template at that position and the reconstructed blocks of the templates surrounding the current block. Besides searching at integer pixel positions, pixel-level searches can also be performed. The motion information for the current block is determined based on the position with the highest matching degree. Utilizing the correlation between adjacent pixels, motion information suitable for the template may also be suitable for the current block. Of course, template matching may not be applicable to all blocks. Therefore, methods can be used to determine whether to use template matching for the current block, such as using a control switch within the current block to indicate whether template matching is used. One name for this template matching method is DMVD (decoder-side motion vector derivation). Both the encoder and decoder can use the template to search and derive motion information or find better motion information based on existing motion information. It does not require transmitting specific motion vectors or motion vector differences; instead, both the encoder and decoder perform the same search rules to ensure consistency between encoding and decoding. Template matching can improve compression performance, but it requires a "search" in the decoder as well, thus introducing some decoder complexity. The above describes the application of template matching between frames. Template matching can also be used intra-frame, for example, to determine intra-prediction modes using templates. For the current block, a certain range of regions above and to the left of the current block can be used as templates, such as the rectangular regions on the left and top as shown in the diagram above. 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-prediction modes for the current block, which constitutes a subset of all available intra-prediction modes. Of course, candidate intra-prediction modes could be the entire set of all available intra-prediction modes. This can be determined based on a trade-off between performance and complexity. The set of candidate intra-prediction modes can be determined based on MPM or rules such as equal-interval filtering. The cost of each candidate intra-prediction mode on the template is calculated, such as SAD, SATD, MSE, etc. Prediction is performed on the template using this mode to create a prediction block, and the cost is calculated using the prediction block and the reconstructed block of the template. Low-cost patterns may be better matched to the template. Leveraging the similarity between adjacent pixels, an intra-prediction pattern that performs well on the template is likely to perform well on the current block as well. One or more low-cost patterns are selected. Of course, the above two steps can be repeated. For example, after selecting one or more low-cost patterns, a new set of candidate intra-prediction patterns can be determined, and the cost can be recalculated for the newly determined set of candidate intra-prediction patterns. One or more low-cost patterns can then be selected. This can also be understood as coarse selection and fine selection. The final selected intra-prediction pattern is determined as the intra-prediction pattern for the current block, or the final selected intra-prediction patterns are used as candidates for the intra-prediction pattern for the current block. Alternatively, the template matching method can be used to sort the set of candidate intra-prediction patterns, such as sorting the MPM list. This involves creating prediction blocks for each pattern in the MPM list on the template, determining the cost, and sorting them in ascending order of cost. Generally, patterns that appear earlier in the MPM list have lower overhead in the bitstream, thus improving compression efficiency. Template matching can be used to determine the two prediction modes of GPM. If template matching is applied to GPM, a single control switch can be used to control whether template matching is used for the two prediction modes of the current block, or two separate control switches can be used to control whether template matching is used for each of the two prediction modes individually. On the other hand, there's the question of 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 the uppercase X is 0 or 1. For the Xth motion information, one approach is to optimize it using template matching based on the aforementioned motion information. That is, if a motion information is determined from `merge_gpm_idxX` in `mergeCandList`, and template matching is used for that motion information, then the template matching method is used to optimize it based on the aforementioned motion information. Another approach is not to use `merge_gpm_idxX` to determine a motion information from `mergeCandList`, but instead to directly search for a motion information based on a default motion information. If the Xth prediction mode is an intra-prediction mode, and the Xth prediction mode of the current block uses template matching, then an intra-prediction mode can be determined using template matching without indicating its index in the bitstream. Alternatively, a candidate set or MPM list can be determined using template matching, in which case the index of the intra-prediction mode needs to be indicated in the bitstream. As mentioned above, GPM has three elements: a weight matrix and two prediction modes. The advantage of GPM is its ability to achieve more autonomous combinations through the weight matrix. However, GPM requires more information, thus incurring greater overhead in the bitstream. Taking GPM in VVC as an example, it is used in merge mode. In the bitstream, `merge_gpm_partition_idx`, `merge_gpm_idx0`, and `merge_gpm_idx1` determine the weight matrix, the first prediction mode, and the second prediction mode, respectively. The weight matrix and the two prediction modes each have multiple possible choices; for example, the weight matrix in VVC has 64 possible choices. `merge_gpm_idx0` and `merge_gpm_idx1` are each allowed a maximum of 6 possible choices in VVC, of ​​course, VVC stipulates that `merge_gpm_idx0` and `merge_gpm_idx1` cannot be repeated. Therefore, GPM has 65 x 6 x 5 possible choices. If MMVD is used to optimize two motion information (prediction patterns), multiple possible options can be provided for each prediction pattern. This number is quite large. If GPM uses two intra-prediction modes, and each prediction mode can use one of the 67 common intra-prediction modes in VVC, even if the two intra-prediction modes are different, there are still 64 x 67 x 66 possible choices. Of course, to save overhead, each prediction mode can be restricted to using only a subset of all common intra-prediction modes, but this still leaves many possible choices. Currently, GPM's one weighted derivation mode and two prediction modes need to transmit necessary information in the bitstream according to their respective rules. For example, one weighted 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 certain situations, or certain optimization techniques can be used simultaneously for two prediction modes (this can also be understood as being used in the current block), but the three are relatively independent in terms of writing and parsing syntax elements, that is, more codewords are needed to indicate the weighted derivation mode and prediction mode, resulting in high encoding overhead. To address the aforementioned technical issues, this application combines the weighted derivation mode and the K prediction modes as a single unit. This combination indicates the weighted derivation mode and the K prediction modes used in the current block within the bitstream, thereby saving codewords and improving coding efficiency. The video decoding method provided in this application embodiment will be described below with reference to Figure 15, taking the decoding end as an example. Figure 15 is a schematic flowchart of a video decoding method according to an embodiment of this application. This embodiment is applied to the video decoders shown in Figures 1 and 3. As shown in Figure 15, the method of this embodiment includes: S101. Decode the bitstream to obtain the first index. The first index is used to indicate a first combination, which includes a weighted derived pattern and a first combination of K prediction patterns, where K is a positive integer greater than 1. As described above, a weighted derivation pattern and K prediction patterns together generate a prediction block. This prediction block acts on the current block; that is, the weight is determined according to the weighted derivation pattern, the K prediction patterns are used to predict the current block, resulting in K predicted values, and these K predicted values ​​are weighted according to the weight to obtain the predicted value for the current block. Therefore, the weighted derivation pattern and the K prediction patterns act as a combination on the current block, and they are related. It should be noted that the embodiments of this application do not limit the specific form of the weight derivation mode or the content it includes. The weight derivation mode is used to derive weights, such as the weights of predicted values ​​or the weights of templates. For example, suppose the current block contains the edges of K relatively moving objects; this is an ideal scenario for inter-frame GPM. Theoretically, this partitioning should occur at the object edges. However, in practice, there are a finite number of possible partitions, and it's impossible to cover all edges. Sometimes, a partition that is close to the object's edge is chosen. In such cases, there might be more than one such partition, and the choice depends on which partition, combined with the K prediction patterns, yields the optimal result. Similarly, the choice of prediction pattern sometimes depends on which combination yields the optimal result, because even in the part using that prediction pattern, it's difficult for this part to perfectly match the current block for natural video. Ultimately, the most efficient coding method might be chosen. Another common application of GPM is when the current block contains parts of an object with relative motion, such as the distorted or deformed areas caused by an arm swing. In such cases, the partitioning is even more ambiguous, and the final decision likely depends on which combination yields the optimal result. Another scenario is intra-frame prediction. It is known that the texture of some parts of a natural image is very complex, some parts have a gradient from one texture to another, and some parts may not be able to be described by a simple direction. Intra-frame GPM can provide more complex prediction blocks. Intra-frame coded blocks usually have larger residuals than inter-frame coded blocks under the same quantization. The choice of which prediction mode may ultimately depend on which combination of results is optimal. Based on the above description, a weighted derivation pattern and K prediction patterns can be used together as a combination on the current block. In order to save codewords and reduce encoding costs, this application embodiment combines the weighted derivation pattern and K prediction patterns corresponding to the current block into a first combination and uses a first index to indicate the first combination. Compared with indicating the weighted derivation pattern and K prediction patterns separately, this application embodiment uses fewer codewords, thereby reducing the encoding cost. Specifically, the encoder determines the first combination corresponding to the current block. This first combination consists of one weighted derived pattern and K prediction patterns. For ease of description, the weighted derived pattern included in the first combination is denoted as the first weighted derived pattern, and the K prediction patterns included in the first combination are denoted as the K first prediction patterns. The encoder uses the first weighted derived pattern and the K first prediction patterns to predict the current block, obtaining the predicted value of the current block. For example, the weight is derived using the first weighted derived pattern, and the K prediction patterns are used to predict the current block to obtain K predicted values. These K predicted values ​​are then weighted according to the derived weights to obtain the predicted value of the current block. Meanwhile, to maintain consistency between the encoding and decoding ends, the encoding end indicates the first combination to the decoding end through the first index, that is, the encoding end writes the first index into the bitstream. The decoding end obtains the first index by decoding the bitstream, and then determines the first combination corresponding to the current block based on the first index, so as to use the first weighted derived mode and K first prediction modes included in the first combination to predict the current block and obtain the predicted value of the current block. This application does not limit the specific syntax element form of the first index in its embodiments. In one possible implementation, if the current block is predicted using GPM technology, then gpm_cand_idx is used to represent the first index. Since the first index is used to indicate the first combination, in some embodiments, the first index may also be referred to as the first combination index or the index of the first combination. In one example, the syntax after adding the first index to the bitstream is shown in Table 5: Table 5 Among them, gpm_cand_idx is the first index. In some embodiments, before decoding the first index, the decoding end first needs to determine whether the current block uses K different prediction modes for weighted prediction processing. If the decoding end determines that the current block uses K different prediction modes for weighted prediction processing, then it executes the above-described S101 decoding of the bitstream to obtain the first index. If the decoding end determines that the current block does not use K different prediction modes for weighted prediction processing, then it skips the above-described S101 step. In one possible implementation, the decoder can 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 this application, the prediction mode parameter can 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 understood that, in the embodiments of this application, the prediction mode parameter can be understood as a flag indicating whether GPM mode or AWP mode is used. Specifically, the encoder can use a variable as the prediction mode parameter, and thus the prediction mode parameter can be set by setting the value of this variable. For example, in this application, if the current block uses GPM mode or AWP mode, the encoder can set the value of the prediction mode parameter to indicate that the current block uses GPM mode or AWP mode; specifically, the encoder can set the value of the variable to 1. For example, in this application, if the current block does not use GPM mode or AWP mode, the encoder can set the value of the prediction mode parameter to indicate that the current block does not use GPM mode or AWP mode; specifically, the encoder can set the value of the variable to 0. Further, in the embodiments of this application, after the encoder completes the setting of the prediction mode parameter, it 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 bitstream to obtain the prediction mode parameters, and then determines whether the current block uses GPM mode or AWP mode according to the prediction mode parameters. If the current block uses GPM mode or AWP mode, that is, when K different prediction modes are used for prediction processing, the weight derivation mode of the current block is determined. In some embodiments, as shown in Table 5, the embodiments of this application may 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 decoding end decodes the bit stream to obtain the first index. For example, when applying GPM mode or AWP mode, the size of the current block can be limited. It is understandable that, since the prediction method proposed in this application requires generating K predicted values ​​using K different prediction modes, and then weighting them according to weights to obtain the predicted value of the current block, in order to reduce complexity and consider the trade-off between compression performance and complexity, in the embodiments of this application, the GPM mode or AWP mode can be restricted from being used for blocks of certain sizes. Therefore, in this application, the decoder can first determine the size parameters of the current block, and then determine whether the current block uses the GPM mode or AWP mode based on the size parameters. In embodiments of this application, the size parameters of the current block may include the height and width of the current block. Therefore, the decoder can determine whether the current block uses GPM mode or AWP mode based on the height and width of the current block. For example, in this application, if the width is greater than a first threshold and the height is greater than a second threshold, then it is determined that the current block can use either GPM mode or AWP mode. It is evident that one possible limitation is to use GPM mode or AWP mode only when the block's width is greater than (or greater than or equal to) the first threshold and the block's height is greater than (or greater than or equal to) the second threshold. The values ​​of the first and second thresholds can be 4, 8, 16, 32, 128, 256, etc., and the first threshold can be equal to the second threshold. For example, in this application, if the width is less than a third threshold and the height is greater than a fourth threshold, then it is determined that the current block can use either GPM mode or AWP mode. It is evident that one possible limitation is to use GPM mode or AWP mode only when the block's width is less than (or less than or equal to) the third threshold and the block's height is greater than (or greater than or equal to) the fourth threshold. The values ​​of the third and fourth thresholds can be 4, 8, 16, 32, 128, 256, etc., and the third threshold can be equal to the fourth threshold. Furthermore, in the embodiments of this application, the size of the block that can use GPM mode or AWP mode can also be limited by restricting the pixel parameters. For example, in this application, the decoder can first determine the pixel parameters of the current block, and then further determine whether the current block can use GPM mode or AWP mode based on the pixel parameters and a fifth threshold. It is evident that a possible limitation is to use GPM mode or AWP mode only when the number of pixels in the block is greater than (or greater than or equal to) the fifth threshold. The value of the fifth threshold can be 4, 8, 16, 32, 128, 256, 1024, etc. In other words, in this application, the current block can only use GPM mode or AWP mode if the size parameters of the current block meet the size requirements. For example, in this application, a frame-level flag can be used to determine whether the current frame to be decoded uses this application. For instance, intra-frame frames (such as I-frames) can be configured to use this application, while inter-frame frames (such as B-frames and P-frames) cannot. Alternatively, intra-frame frames can be configured not to use this application, while inter-frame frames can use it. Or, some inter-frame frames can be configured to use this application, while others cannot. Inter-frame frames can also use intra-frame prediction, and therefore, inter-frame frames may also use this application. In some embodiments, a flag below the frame level and above the CU level (such as tile, slice, patch, LCU, etc.) may be used to determine whether this region is covered by this application. S102. Based on the first index, determine the first weighted derived pattern and K first prediction patterns included in the first combination. After decoding the bitstream and obtaining the first index, the decoding end determines the first weighted derived mode and K first prediction modes included in the first combination based on the first index. In this application, the weight derivation mode is used to determine the weights used in the current block. Specifically, the weight derivation mode can be a mode for deriving weights. For a block of a given length and width, each weight derivation mode can derive a weight matrix; for blocks of the same size, different weight derivation modes will derive different weight matrices. For example, in this application, AWP has 56 weight derivation modes and GPM has 64 weight derivation modes. The K different first prediction patterns included in the first combination mentioned above include the following examples: Example 1: All of the above K different first prediction modes are intra-prediction modes, such as the current block being an intra-coded block and not applicable to screen content encoding. Example 2: All of the above K different first prediction modes are inter-frame prediction modes, such as the current block being an inter-frame coded block. Example 3: Among the K different first prediction modes mentioned above, at least one is an intra-frame prediction mode and at least one is an inter-frame prediction mode. Example 4: Among the K different first prediction modes mentioned above, at least one is an intra-frame prediction mode, and at least one is a non-inter-frame and non-intra-frame prediction mode, such as an intra-block copy (IBC) prediction mode or a palette prediction mode. Example 5: Among the K different first prediction modes mentioned above, at least one is an inter-frame prediction mode, and at least one is a non-inter-frame and non-intra-frame prediction mode, such as an IBC prediction mode or a palette prediction mode. Example 6: None of the above K different first prediction modes are intra-frame prediction modes or inter-frame prediction modes. For example, one is an IBC prediction mode, and another is a palette prediction mode, etc. It should be noted that the embodiments of this application do not limit the specific types of the K different first prediction modes included in the first combination. In one embodiment of this application, the first combination includes a first weighted derivation mode and K first prediction modes, wherein the first weighted derivation mode does not include a blending parameter. In another embodiment, the first combination includes a first weighted derivation mode, K first prediction modes, and a second blending parameter. In yet another embodiment, the first combination includes a first weighted derivation mode and K first prediction modes, wherein the first weighted derivation mode includes a blending parameter. The blending parameter, together with the K first prediction modes, is used to determine the predicted value of the current block. The implementation process of S102 above will be explained below when the first combination includes different contents. Case 1: When the first combination includes the first weighted derived pattern and K first prediction patterns, the implementation methods of S102 above include, but are not limited to, the following: Method 1: The encoder and decoder determine the first combination corresponding to the first index from a set of preset first candidate combinations. For example, the preset set of first candidate combinations may include any number of first candidate combinations, such as 2, 3, 4, 5, 6, 7, 8, or 9. Let's assume there are 8 first candidate combinations. Each first candidate combination includes a weighted derived pattern and K prediction patterns, and these 8 first candidate combinations have different identifiers (or indices). After obtaining the first index, the decoder searches for the first candidate combination corresponding to the first index among these multiple first candidate combinations, determines the first candidate combination corresponding to the first index as the first combination, then determines the weighted derived pattern included in that first candidate combination as the first weighted derived pattern, and determines the K prediction patterns included in that first candidate combination as the K first prediction patterns. Method 2: Both the decoding and encoding ends determine a list containing multiple first candidate combinations; therefore, this list is also called the first candidate combination list. The first combination corresponding to the first index is determined from this first candidate combination list. In this case, S102 includes the following steps: S102-A, Determine the first candidate combination list; S102-B: Determine the weighted derived pattern and K prediction patterns included in the first candidate combination corresponding to the first index in the first candidate combination list as the first weighted derived pattern and K first prediction patterns. The aforementioned list of first candidate combinations includes multiple first candidate combinations, and any one of the multiple first candidate combinations includes a weighted derived pattern and K prediction patterns. For example, the first candidate combination list is shown in Table 6: Table 6 As shown in Table 6, the list of first candidate combinations includes multiple first candidate combinations. No two first candidate combinations are completely identical; that is, the weighted derived patterns and at least one of the K prediction patterns in any two first candidate combinations are different. For example, first candidate combination 1 and first candidate combination 2 may have different weighted derived patterns, or first candidate combination 1 and first candidate combination 2 may have the same weighted derived patterns but at least one of the K prediction patterns is different, or first candidate combination 1 and first candidate combination 2 may have different weighted derived patterns and at least one of the K prediction patterns is different. For example, Table 6 above uses the sorting of the first candidate combination in the first candidate combination list as the index. Optionally, the index of the first candidate combination in the first candidate combination list can also be represented in other ways, and this application embodiment does not limit this. In this method 2, the decoding end decodes the bitstream to obtain the first index and determines the first candidate combination list as shown in Table 6 above. Based on the first index, the first candidate combination list is queried to obtain the first weighted derived mode and K prediction modes included in the first combination indicated by the first index. For example, if the first index is index 1, in the first candidate combination list shown in Table 6, the first candidate combination corresponding to index 1 is first candidate combination 2. That is, the first combination indicated by the first index is first candidate combination 2. In this way, the decoder determines the weighted derived mode and K prediction modes included in the first candidate combination 1 as the first weighted derived mode and K first prediction modes included in the first combination, and uses the first weighted derived mode and K first prediction modes to predict the current block to obtain the predicted value of the current block. In this method 2, the encoder and decoder can each determine the same list of first candidate combinations. For example, both the encoder and decoder can determine a list containing N first candidate combinations, each including one weighted derived mode and K prediction modes. In the bitstream, the encoder only needs to write the finally selected first candidate combination, such as the first combination. The decoder parses the first combination finally selected by the encoder. Specifically, the decoder decodes the bitstream, obtains the first index, and determines the first combination from the list of first candidate combinations determined by the decoder using the first index. This application embodiment does not limit the specific method by which the decoding end determines the above-mentioned first candidate combination list. In some embodiments, the first candidate combination list is existing. After the decoding end obtains the first index from the decoded bitstream, it can obtain or read the first candidate combination list according to the first index, and then query the first candidate combination corresponding to the first index in the first candidate combination list according to the first index. In some embodiments, the first candidate combination list is sent from the encoder to the decoder, for example, the encoder sends it to the decoder before encoding the current block. In some embodiments, the first candidate combination list is uploaded to the cloud by the encoding end, and the decoding end reads the first candidate combination list from the cloud after decoding the bitstream and obtaining the first index. In some embodiments, the first candidate combination list is constructed by the decoding end. For example, after decoding the bitstream and obtaining the first index, the decoding end constructs the first candidate combination list in response to the first index. This application does not limit the method by which the decoding end constructs the first candidate combination list. For example, it can use information related to the current block to analyze the probability of each combination formed by different weighted derivation modes and different prediction modes, and construct the first candidate combination list based on the probability of each combination. Optionally, information related to the current block may include pattern information of surrounding blocks and reconstructed pixels of the current block. In some embodiments, the decoding end constructs a first candidate combination list through the following steps S102-A1: S102-A1: Based on the template of the current block, construct the first candidate combination list. Template matching utilizes the correlation between adjacent pixels to use regions surrounding the current block as templates. During encoding and decoding of the current block, its left and top sides are already encoded according to the encoding order. During inter-frame prediction, 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. During intra-frame prediction, the template is used to determine the intra-frame prediction mode of the current block. The template of the current block consists of the reconstructed area around the current block and is related to the current block. Based on this, the embodiments of this application construct a first candidate combination list based on the template of the current block. This application does not impose any restrictions on the specific shape of the template for the current block. In some embodiments, the template includes at least one of the above encoded region, the left encoded region, and the upper left encoded region of the current block. Optionally, the width of the upper encoded region is the same as the width of the current block, the height of the left encoded region is the same as the height of the current block, the width of the upper left encoded region is the same as the width of the left encoded region, and the height of the upper left encoded region is the same as the height of the upper encoded region. For example, for each combination, the template of the current block is predicted using that combination to obtain the predicted value of the template under each combination. Based on the predicted value of the template under each combination, a first candidate combination list is constructed. For example, for each combination, the template of the current block is predicted using that combination to obtain the predicted value of the template under each combination. For instance, the weights of the template are derived using the weighted derived patterns included in the combination, and the template is predicted using the K prediction patterns included in the combination to obtain K predicted values ​​of the template. Based on the derived template weights, the K predicted values ​​of the template are weighted to obtain the predicted value of the template under that combination. Finally, based on the predicted values ​​of the template under each combination, a first candidate combination list is constructed. It should be noted that the weights exported according to the weighted export mode described above can be understood as the weights corresponding to each pixel in the exported template, or as the weight matrix corresponding to the exported template. Specifically, when determining the predicted value of the template based on the weights, one can determine K predicted values ​​corresponding to each pixel in the template, and then determine the predicted value corresponding to each pixel based on the K predicted values ​​and their weights. The predicted values ​​corresponding to each pixel in the template constitute the predicted value of the template. Optionally, when determining the predicted value of the template based on the weights, it can also be performed in blocks. For example, to determine the predicted value of the template, the K predicted values ​​of the template can be weighted according to the template's weight matrix to obtain the predicted value of the template. In some embodiments, S102-A1 includes the following steps S102-A11 to S102-A13: S102-A11. Determine R second combinations. Each of the R second combinations includes a weighted derived pattern and K prediction patterns. The weighted derived pattern and K prediction patterns included in any two of the R second combinations are not completely the same. R is a positive integer greater than 1. S102-A12. For any of the R second combinations, use the weighted derivation mode and K prediction modes in the second combination to predict the template and obtain the template prediction value corresponding to the second combination. S102-A13. Construct a list of first candidate combinations based on the template prediction values ​​corresponding to each of the R second combinations. In this embodiment, when constructing the first candidate combination list, the decoding end first determines R second combinations. This application does not limit the specific value of the R second combinations, for example, 8, 16, 32, etc. Each of the R second combinations includes a weighted derived mode and K prediction modes, and the weighted derived mode and K prediction modes included in any two of the R second combinations are not completely identical. Next, for each of the R second combinations, the template of the current block is predicted using the weighted derived mode and K prediction modes included in that second combination, obtaining the predicted value of the template under that second combination. Finally, based on the template prediction value corresponding to each of the R second combinations, the first candidate combination list is constructed. The methods for constructing the first candidate combination list based on the template prediction values ​​corresponding to each of the R second combinations in S102-A13 above include, but are not limited to, the following: Method 1: Construct a list of first candidate combinations based on the magnitude of the template prediction value corresponding to each of the R second combinations. For example, based on the magnitude of the template prediction value corresponding to each of the R second combinations, the R second combinations are sorted, and the sorted R second combinations are determined as the first candidate combination list. At this time, the first candidate combination list includes R first candidate combinations. For example, based on the magnitude of the template prediction value corresponding to each of the R second combinations, the R second combinations are sorted, and N second combinations are selected from the sorted R second combinations to form a first candidate combination list. At this time, the first candidate combination list includes N first candidate combinations. Method 2, the above S102-A13 includes the following steps: S102-A13-1. Determine the cost corresponding to the second combination based on the template prediction value and the template reconstruction value corresponding to the second combination. S102-A13-2. Based on the cost corresponding to each of the R second combinations, construct a list of first candidate combinations. Since the template of the current block is a reconstructed region, the decoder can obtain the reconstructed value of the template. Therefore, for each of the R second combinations, the prediction distortion cost corresponding to that second combination can be determined based on the predicted value and the reconstructed value of the template. The methods for determining the cost corresponding to the second combination include, but are not limited to, SAD, SATD, and SEE. Next, based on the cost corresponding to each of the R second combinations, a first candidate combination list is constructed. In this embodiment of the application, the template prediction value corresponding to the second combination includes at least two cases: In the first case, the template prediction value corresponding to the second combination is a numerical value. That is, the decoder uses the K prediction modes included in the second combination to predict the template and obtains K prediction values. The template weight is determined according to the weight derivation mode included in the second combination. The K prediction values ​​are weighted by the template weight to obtain the weighted prediction value. The weighted prediction value is determined as the template prediction value corresponding to the second combination. The second scenario involves the template prediction value corresponding to the second combination, which includes the template prediction values ​​corresponding to the K prediction modes included in the second combination. In this case, S102-A13-1 includes the following steps: S102-A13-11. Based on the template prediction values ​​and template reconstruction values ​​corresponding to the K prediction modes in the second combination, determine the costs corresponding to the K prediction modes in the second combination. S102-A13-12. Determine the cost corresponding to the second combination based on 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 this embodiment, taking K=2 as an example, the weights on the template can be simplified to only two possibilities: 0 and 1. Therefore, for each pixel position, its pixel value comes only from the prediction block of the first prediction mode or the prediction block of the second prediction mode. Thus, for a prediction mode, its cost on the template when it is the first prediction mode of a certain weighted derived mode can be calculated. That is, only the cost of pixels with a weight of 1 when the prediction mode is the first prediction mode under that weighted derived mode is calculated on the template. An example is to denote this 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 weighted derived mode, and 0 represents the first prediction mode. And the cost on the template when the prediction mode is used as the second prediction mode of a certain weighted derived mode. That is, only the cost of the pixels with a weight of 1 when the prediction mode is used as the second prediction mode under the weighted derived mode is calculated on the template. An example is to denote this 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 derived mode, and 1 represents the second prediction mode. Therefore, when calculating the cost of a combination, the two costs mentioned above can be directly added together. For example, to find the cost of prediction modes pred_mode_idx0 and pred_mode_idx1 under the weighted derived mode gpm_idx, where pred_mode_idx0 is the first prediction mode and pred_mode_idx1 is the second prediction mode, let this cost be denoted as costTemp. Then costTemp = cost[pred_mode_idx0][gpm_idx][0] + cost[pred_mode_idx1][gpm_idx][1]. If we want to find the cost of prediction modes pred_mode_idx0 and pred_mode_idx1 under the weighted derived mode gpm_idx, where pred_mode_idx1 is the first prediction mode and pred_mode_idx0 is the second prediction mode... Let this cost be denoted as costTemp, then costTemp = cost[pred_mode_idx1][gpm_idx][0] + cost[pred_mode_idx0][gpm_idx][1]. One advantage of this approach is that it simplifies the process of first weighting and combining the data into a prediction block before calculating the cost to directly calculating the costs of the two parts and then adding them together to obtain the combined cost. Since a prediction pattern may be combined with multiple other prediction patterns, and for the same weighted derived pattern, the cost of that prediction pattern as a part of the first and second prediction patterns is fixed, these costs can be retained and reused, i.e., cost[pred_mode_idx][gpm_idx][0] and cost[pred_mode_idx][gpm_idx][1] in the example above, thereby reducing the computational load. Based on the above method, the cost corresponding to each of the R second combinations can be determined, and then S102-A13-2 is executed. In S102-A13-2, the methods for constructing the first candidate combination list based on the costs corresponding to each of the R second combinations include, but are not limited to, the following examples: Example 1: Sort the R second combinations according to the cost of each of the R second combinations; determine the sorted R second combinations as the first candidate combination list. The first candidate combination list generated in Example 1 includes R first candidate combinations. Optionally, the R first candidate combinations in the first candidate combination list are sorted in ascending order of cost, that is, the costs corresponding to the R first candidate combinations in the first candidate combination list increase sequentially according to the sorting. Specifically, sorting the R second combinations based on the cost of each of the R second combinations can be done by sorting the R second combinations in ascending order of cost. Example 2: Based on the cost corresponding to the second combination, select N second combinations from R second combinations, and determine the list of these N second combinations as the first candidate combination list. Optionally, the above N second combinations are the top N second combinations with the smallest cost among the R second combinations. For example, based on the cost corresponding to each of the R second combinations, the N second combinations with the smallest cost are selected from the R second combinations to form a first candidate combination list. In this case, the first candidate combination list includes N first candidate combinations. Optionally, the N first candidate combinations in the first candidate combination list are sorted in ascending order of cost, that is, the costs corresponding to the N first candidate combinations in the first candidate combination list increase sequentially according to the sorting. The process of determining R second combinations in S102-A11 above is described below. In some embodiments, the aforementioned R second combinations are preset. Each of the preset R second combinations is used to predict the template of the current block, obtaining a template prediction value corresponding to each second combination. Then, based on the template prediction value and the reconstructed template value, the cost corresponding to each second combination is determined. Based on the cost of each second combination, the R second combinations are sorted, and the sorted R second combinations are used as a first candidate combination list. Alternatively, the N second combinations with the lowest cost are selected from the sorted R second combinations to form the first candidate combination list. In some embodiments, S102-A11 includes the following steps: S102-A11-1. Determine P weighted derived patterns and Q prediction patterns, where P is a positive integer and Q is a positive integer greater than or equal to K; S102-A11-2. Based on P weighted derived patterns and Q prediction patterns, construct R second combinations. Any second combination among the R second combinations includes one weighted derived pattern from the P weighted derived patterns and K prediction patterns from the Q prediction patterns. P are all positive integers and Q are positive integers greater than or equal to K. In this embodiment, the decoding end first determines P weighted derived modes and Q prediction modes, and then constructs R second combinations based on the determined P weighted derived modes and Q prediction modes. For example, the second combination includes one weighted derived pattern and two prediction patterns. Suppose that there are P weighted derived patterns, namely weighted derived pattern 1 and weighted derived pattern 2, and Q prediction patterns, namely prediction pattern 1, prediction pattern 2 and prediction pattern 3. These two weighted derived patterns and three prediction patterns can be combined into 2 x 3 x 2, a total of 12 second combinations. The embodiments of this application do not limit the specific number of the above-mentioned P weighted derivation modes and Q prediction modes. In one possible implementation, assuming the current block is an intra-coded block, it is assumed that there are 64 possible weighted derivation modes and 67 possible intra-prediction modes for the GPM, which can be found in the VVC standard. However, this does not limit the possible weights of the GPM to only 64, or any specific 64. It should be noted that the reason VVC chooses 64 weights for its GPM is a trade-off between improved prediction performance and increased overhead in the bitstream. This application, however, does not use a fixed logic to encode the weighted derivation modes, so theoretically, this application can use a wider variety of weights and employ them more flexibly. Similarly, it does not limit the intra-prediction modes of the GPM to only 67, or any specific 67. Theoretically, all possible intra-prediction modes can be used in the GPM. For example, if the intra-angle prediction mode is made more refined, generating more intra-angle prediction modes, then the GPM can also use more intra-angle prediction modes. For example, VVC's MIP (matrix-based intra prediction) mode can also be used in this application, but considering that MIP has multiple sub-modes to choose from, MIP is not included in this embodiment for ease of understanding. There are also some wide-angle modes that can be used in this application, but they will not be described in this embodiment. Assuming K=2, the above K prediction modes include the first prediction mode and the second prediction mode. Assuming there are 67 available prediction modes (i.e., Q=67), the first prediction mode has 67 possibilities. Since the second prediction mode is different from the first prediction mode, there are 66 possibilities for the second prediction mode. Assuming there are 64 weighted derivation modes (i.e., P=64), then this application may use any two different prediction modes and any weighted derivation mode to form a second combination, for a total of 64*67*66 possible second combinations. In this implementation, the P weighted derived modes represent all possible weighted derived modes, such as the 64 weighted derived modes in GPM, and the Q prediction modes represent all possible prediction modes, such as the 67 intra-frame prediction modes in GPM. An exhaustive method is used to obtain all possible second combinations, for example, 64*67*66 possible second combinations. Each of these 64*67*66 possible second combinations is used to predict the template of the current block, and the distortion cost of each second combination is calculated. Then, based on the distortion cost of each second combination, the first candidate combination list corresponding to the current block is obtained. In some embodiments, in order to reduce the amount of data and improve the construction speed of the first candidate combination list, not every prediction mode is tried, but only some prediction modes are selected for trying. At this point, the methods for determining the Q prediction modes in S102-A11-1 above include, but are not limited to, the following: Method 1: Q prediction patterns are preset prediction patterns. Method 2: Determine at least one of the following: the first candidate prediction mode list for the current block, the first alternative prediction mode list corresponding to each of the K prediction modes, and the prediction mode corresponding to the weighted derivation mode. Based on the first candidate prediction mode list, the first alternative prediction mode list corresponding to each of the K prediction modes, and the prediction mode corresponding to the weighted derivation mode, determine Q prediction modes. The first candidate prediction mode list includes multiple first candidate prediction modes, and the first alternative prediction mode list corresponding to any one of the K prediction modes includes at least one first alternative prediction mode. For example, Q prediction patterns are determined based on the list of candidate prediction patterns for the current block. For example, based on the list of first alternative prediction modes corresponding to K prediction modes, Q prediction modes are determined. For example, based on the prediction patterns corresponding to the weighted patterns, Q prediction patterns are determined. For example, based on the first candidate prediction mode list of the current block and the first alternative prediction mode lists corresponding to the K prediction modes, Q prediction modes are determined. For example, based on the first candidate prediction mode list of the current block and the prediction mode corresponding to the weighted derived mode, Q prediction modes are determined. For example, based on the list of first alternative prediction modes corresponding to the K prediction modes and the prediction modes corresponding to the weighted derived modes, Q prediction modes are determined. For example, based on the first candidate prediction mode list, the first alternative prediction mode list corresponding to each of the K prediction modes, and the prediction mode corresponding to the weighted derived mode, Q prediction modes are determined. The process of determining the first candidate prediction mode list corresponding to each of the K prediction modes can be understood as assigning a first candidate prediction mode list to each of the K prediction modes. When constructing the second combination later, a prediction mode in the second combination is selected from the first candidate prediction mode list corresponding to that prediction mode. For example, if K=2, and the K prediction modes include a first prediction mode and a second prediction mode, the decoder constructs a first candidate prediction mode list 1 for the first prediction mode and a first candidate prediction mode list 2 for the second prediction mode. Thus, when constructing different second combinations later, a first candidate prediction mode is selected from first candidate prediction mode list 1 as the first prediction mode, and a first candidate prediction mode is selected from first candidate prediction mode list 2 as the second prediction mode. This weighted derived mode, along with the currently selected first and second prediction modes, forms a second combination. The embodiments of this application do not limit the method for determining the first alternative prediction mode list corresponding to each of the K prediction modes. In one possible implementation, for any prediction mode among K prediction modes, a first candidate prediction mode list corresponding to the prediction mode is determined, as well as at least one of the prediction modes corresponding to the weighted derivation mode; based on the first candidate prediction mode list and at least one of the prediction modes corresponding to the weighted derivation mode, a first alternative prediction mode list corresponding to the prediction mode is determined. In this embodiment of the application, the process of determining the first candidate prediction mode list corresponding to a certain prediction mode among K prediction modes is basically similar to the process of determining the first candidate prediction mode list corresponding to the current block, and can be referred to the following description for details. In some embodiments, the first candidate prediction mode list includes one or more inter-frame prediction modes, such as at least one of skip, merge, normal inter-frame prediction mode, one-way prediction, two-way prediction, and multiple hypothesis prediction. In some embodiments, the first candidate prediction mode list includes one or more intra-frame prediction modes, such as at least one of Direct Current (DC) mode, Planar mode, and angular mode. Optionally, the first candidate prediction mode list includes at least one intra-frame prediction mode from the MPM list. In some embodiments, the list of first candidate prediction modes may also include modes such as IBC and palette. This application does not impose any restrictions on the type or number of prediction modes included in the aforementioned first candidate prediction mode list. In some embodiments, the first candidate prediction mode list is determined by at least one of the following methods: Method 1: The aforementioned first candidate prediction mode list includes preset modes. Method 2: The aforementioned first candidate prediction pattern list includes patterns from the MPM list. In some embodiments, the first candidate intra-prediction mode list can be the MPM list of the current block. For example, in VVC, the current block can obtain an MPM list of length 6. Furthermore, in some subsequent technological evolutions, there is a secondary MPM scheme that may derive an MPM list of length 22. In other words, the combined length of the first and second MPM lists is 22. That is, embodiments of this application can use MPMs to filter intra-prediction modes. In some embodiments, if the preset mode is not included in the first candidate prediction mode list determined above, the preset mode is added to the candidate prediction mode list. In one example, the preset mode is a set of preset prediction modes. Optionally, the preset mode includes at least one of DC, horizontal mode, and vertical mode. In another example, the image type corresponding to the current block is determined, and a preset mode is determined based on the image type corresponding to the current block. Commonly used image types include I-images, B-images, and P-images, and common slice types include I-slices, B-slices, and P-slices. Taking slice types as an example, the same applies to image types. An I-slice can only contain intra-coded blocks, while B-slices and P-slices can contain both intra-coded and inter-coded blocks. That is, in an I-slice, the current block is surrounded by intra-coded blocks, while in B-slices and P-slices, the current block may be surrounded by either intra-coded or inter-coded blocks. Therefore, for some intra-frame GPM methods in this application, more relevant information, such as the intra-prediction mode of adjacent blocks, can be obtained in the I-slice. The relevant information obtained in B-slices and P-slices is relatively less. Thus, different rules can be set for different image types. For example, when constructing the first candidate prediction mode list, if the image type corresponding to the current block is type B or type P, more preset modes can be added. For instance, in addition to DC, horizontal, and vertical modes, other angle modes can be added, such as upper right (mode 2 in VVC), lower left (mode 66 in VVC), and upper left (mode 34 in VVC). Alternatively, different limits on the number of first candidate prediction modes can be applied to blocks of different image types. The method described above for determining the image type corresponding to the current block can be based on the image type of the current image to which the current block belongs or the image type of the current slice to which the current block belongs. For example, the image type of the current image to which the current block belongs or the image type of the current slice to which the current block belongs can be determined as the image type corresponding to the current block. Optionally, preset modes can be added under certain conditions. One example is adding a mode when the number of prediction modes in the candidate prediction modes is less than or equal to a threshold, such as 3, 4, 5, 6, etc. Method 3: The aforementioned list of first candidate prediction patterns includes a set of first candidate prediction patterns determined according to certain rules, such as equal interval filtering. Method 4: Determine a first candidate prediction mode list based on the prediction modes used by at least one block adjacent to the current block. For example, the prediction modes used by one or more blocks adjacent to the current block are added to the first candidate prediction mode list to obtain the first candidate prediction mode list for the current block, or the first candidate prediction mode list corresponding to the kth prediction mode among K prediction modes is obtained, where the kth prediction mode is any prediction mode among the K prediction modes. For example, the prediction mode corresponding to the k-th prediction mode among the prediction modes used by one or more blocks adjacent to the current block can be added to the first candidate prediction mode list corresponding to the k-th prediction mode. For instance, assuming K=2, the k-th prediction mode is the first prediction mode, and the two blocks adjacent to the current block also use two prediction modes for weighted prediction, where the two prediction modes used by the first adjacent block are prediction mode 1 and prediction mode 3, and the two prediction modes used by the second adjacent block are prediction mode 4 and prediction mode 5, then prediction mode 1 and prediction mode 4 can be added to the first candidate prediction mode list corresponding to the first prediction mode. Method 5: Determine the image type corresponding to the current block, and based on the image type, determine the first candidate prediction mode list. For example, if the image type corresponding to the current block is type B or type P, then at least one of DC, horizontal mode, vertical mode, and some angle modes can be added to the first candidate prediction mode list. As another example, if the image type corresponding to the current block is type I, then at least one of DC, horizontal mode, and vertical mode can be added to the first candidate prediction mode list. It should be noted that methods 1 to 5 above can be used individually or in any combination to determine the first candidate prediction pattern list. In some embodiments, the first candidate prediction mode list includes at least one of a candidate intra-frame prediction mode list and a candidate inter-frame prediction mode list. Specifically, the candidate intra-frame prediction mode list includes at least one candidate intra-frame prediction mode, and the candidate inter-frame prediction mode list includes at least one candidate inter-frame prediction mode. After obtaining the candidate prediction mode list for the current block using the above method, Q prediction modes are determined based on the first candidate prediction mode list. For example, all or part of the first candidate prediction modes included in the first candidate prediction mode list are determined as all or part of the Q prediction modes. The process of determining the prediction model corresponding to the weighted derivation model is described below. In this embodiment, the prediction mode corresponding to the weight derivation mode is a general term, such as a prediction mode corresponding to a preset weight derivation mode, or a prediction mode corresponding to several preset weight derivation modes. In some embodiments, the prediction mode corresponding to the weight derivation mode can also be understood as a list of prediction modes corresponding to the weight derivation mode, and the list of prediction modes includes at least one prediction mode. In some embodiments, the prediction mode corresponding to the weight derivation mode includes the prediction mode corresponding to at least one of the P weight derivation modes. In this case, determining the prediction mode corresponding to the weight derivation mode includes: for the p-th weight derivation mode among the P weight derivation modes, determining the prediction mode corresponding to the p-th weight derivation mode; and determining the prediction mode corresponding to the weight derivation mode based on the prediction mode corresponding to at least one of the P weight derivation modes, where p is a positive integer. In this embodiment of the application, the process of determining the prediction mode corresponding to each of the P weighted derivation modes is basically the same. For ease of description, the p-th weighted derivation mode among the P weighted derivation modes will be used as an example for the following explanation. The prediction mode corresponding to the p-th weighted derived mode can be determined in the following two ways: Method 1: If at least one of the prediction modes corresponding to the p-th weighted derived mode is an intra-prediction mode, determine the angle index according to the p-th weighted derived mode; determine the intra-prediction mode corresponding to the angle index as at least one of the prediction modes corresponding to the p-th weighted derived mode. The angle index is used to indicate the boundary angle index of the weights. In some embodiments, the angleIdx field represents the angle index. Table 2 above shows the correspondence between merge_gpm_partition_idx and angleIdx. Referring to Table 2 above, the angle index can be derived according to the p-th weight derivation mode. In this application, the angle index and the intra-frame prediction mode have a corresponding relationship, that is, different angle indices correspond to different intra-frame prediction modes. For example, the correspondence between angle index and intra-frame prediction mode is shown in Table 7: Table 7 angleIdx intra-frame prediction mode 050242338434530…… In this method, taking K=2 as an example, if the first or second prediction mode is an intra-prediction mode, the angle index is determined according to the p-th weighted derived mode. For example, according to Table 2 above, the angle index corresponding to the p-th weighted derived mode is derived. Then, in Table 7 above, the intra-prediction mode corresponding to the angle index is determined. For example, if the angle index is 2, its corresponding intra-prediction mode is 42, and then the intra-prediction mode 42 is determined as the first or second prediction mode. Method 2: If at least one of the prediction modes corresponding to the p-th weighted derivation mode is an intra-prediction mode, determine the intra-prediction mode corresponding to the p-th weighted derivation mode; determine at least one of the intra-prediction modes corresponding to the p-th weighted derivation mode as at least one of the prediction modes corresponding to the p-th weighted derivation mode. The intra-prediction mode corresponding to the p-th weight derivation mode includes at least one of the following: an intra-prediction mode in which the prediction direction is parallel to the weight boundary line, an intra-prediction mode in which the prediction direction is perpendicular to the boundary line, and a planar mode. It should be noted that intra-prediction modes with prediction directions parallel to the weight boundary include one or more intra-prediction modes with prediction directions parallel or approximately parallel to the weight boundary. Intra-prediction modes with prediction directions perpendicular to the weight boundary include one or more intra-prediction modes with prediction directions perpendicular or approximately perpendicular to the weight boundary. In this second method, taking K=2 as an example, if the first prediction mode and / or the second prediction mode are intra-frame prediction modes, the first prediction mode and / or the second prediction mode are determined from the intra-frame prediction modes corresponding to the weight-derived modes. For example, the first prediction mode and / or the second prediction mode can be intra-frame prediction modes that are on the same straight line or approximately on the same straight line as the weight dividing line (also called the boundary line). Alternatively, the first prediction mode and / or the second prediction mode can be intra-frame prediction modes whose prediction direction is perpendicular to or approximately perpendicular to the weight dividing line. For example, if the weight dividing line is horizontal, as shown in Figure 4 with GPM indices of 18, 19, 50, and 51, the first prediction mode and / or the second prediction mode is either the horizontal mode 18 or the vertical mode 50. Based on the above steps, the decoding end determines the prediction mode corresponding to at least one of the P weighted derived modes. Then, based on the prediction mode corresponding to at least one of the P weighted derived modes, it determines the prediction mode corresponding to the weighted derived mode. For example, all or part of the prediction modes corresponding to at least one of the P weighted derived modes are used as the prediction mode corresponding to the weighted derived mode. Furthermore, among the prediction modes corresponding to the P weighted derived modes, there may be duplicate prediction modes. In this case, the duplicate prediction modes are removed, and the remaining different prediction modes are determined as the prediction modes corresponding to the weighted derived modes. In this embodiment of the application, in order to reduce the number of R second combinations, the prediction patterns are screened, specifically by determining Q prediction patterns according to the above method. In some embodiments, in order to reduce the complexity of the decoding end, the number of the above Q prediction modes is limited. For example, Q is less than or equal to a first preset threshold. This application does not limit the specific value of the first preset threshold, which can be determined according to actual needs. For example, the first preset threshold is 6, that is, 6 prediction modes are selected to construct R second combinations to control the number of second combinations. In some embodiments, the size of Q is related to the size and / or shape of the current block, wherein the shape of the current block can be understood as being determined by the aspect ratio of the current block. During prediction, for smaller blocks, similar prediction patterns have little impact on the prediction results, while for larger blocks, the difference in impact becomes more pronounced. Therefore, embodiments of this application assign different Q values ​​to blocks of different sizes; that is, larger Q values ​​are assigned to larger blocks, and smaller Q values ​​are assigned to smaller blocks. At this point, when determining the Q value corresponding to the current block, it is set according to the size of the current block. For example, if the size of the current block is greater than the first value, then Q is greater than or equal to the second preset threshold. As another example, if the size of the current block is less than or equal to the first value, then Q is less than the third preset threshold. This application embodiment does not limit the specific sizes of the first value, the second prediction threshold, and the third preset threshold, wherein the third preset threshold is less than the second preset threshold. The process of determining P weight derivation modes in S102-A11-1 is described below. In this embodiment of the application, the methods for determining the P weight derivation modes include at least the following: Method 1: Select P weight export patterns from the preset M weight export patterns, where M is a positive integer greater than or equal to P. This application embodiment does not limit the above-mentioned preset M weight derivation modes. In some embodiments, GPM includes 64 weight derivation modes, and AWP includes 56 weight derivation modes. In this embodiment, the aforementioned preset M weight derivation modes include at least one of the 64 weight derivation modes included in GPM, or at least one of the 56 weight derivation modes included in AWP. In some embodiments, the M-weight derivation mode of this application can support more angleIdx values, or angleIdx values ​​different from VVC values. For example, the M-weight derivation mode of this application can support more distanceIdx values, or distanceIdx values ​​different from VVC values. In some embodiments, the aforementioned preset M weight derivation patterns can be derived by using preset weight derivation patterns. For example, in this embodiment of the application, the weight derivation pattern corresponding to AWP is used to determine M weight derivation patterns. Optionally, in this embodiment of the application, other methods may also be used to derive the M weight derivation patterns. In some embodiments, if M equals P, then the M weighted export patterns are determined as P weighted export patterns. In some embodiments, if M is greater than P, then in order to further reduce the number of R second combinations, the preset M weight derivation modes are filtered, and P weight derivation modes can be selected from the preset M weight derivation modes to construct R second combinations. In some embodiments, weight export patterns corresponding to preset division angles and / or preset offsets are removed from M weight export patterns to obtain P weight export patterns. Since the same division angle can correspond to multiple offsets in a weight export pattern, as shown in weight export patterns 10, 11, 12, and 13 in Figure 16A, they have the same division angle but different offsets. This allows for the removal of some weight export patterns corresponding to preset offsets, and / or some weight export patterns corresponding to preset division angles. This reduces the total number of possible second combinations and makes the differences between the various possible second combinations more obvious. In some embodiments, different blocks may have different filtering conditions. Thus, when determining the P weight export modes corresponding to the current block, the filtering conditions corresponding to the current block are first determined, and P weight export modes are selected from the M weight export modes based on the filtering conditions corresponding to the current block. In some embodiments, the filtering conditions corresponding to the current block include filtering conditions corresponding to the size of the current block and / or filtering conditions corresponding to the shape of the current block. During prediction, for smaller blocks, similar weight derivation patterns have little difference in impact on the prediction results, while for larger blocks, the difference in impact is more pronounced. Based on this, embodiments of this application assign different P values ​​to blocks of different sizes; that is, larger P values ​​are assigned to larger blocks, and smaller P values ​​are assigned to smaller blocks. In some embodiments, the above filtering conditions include an array containing M elements, each of which corresponds one-to-one with one of the M weighted export patterns. The element corresponding to each weighted export pattern is used to indicate whether the weighted export pattern is available. Whether a weighted export pattern is available can be understood as whether the weighted export pattern is used to form one of the P weighted export patterns for a subsequent second combination attempt. The array above can be a single-digit number or a two-digit number. For example, taking GPM as an example, there are M weight export patterns, which are 64. We set up an array containing 64 elements, where each element's value indicates whether its corresponding weight export pattern is available. Taking a single-digit value as an example, a specific example is as follows: setting up 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 }; In this case, a value of 1 for g_sgpm_splitDir[x] indicates that the weight export mode at index x is available, while a value of 0 indicates that the weight export mode at index x is not available. 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 export 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 export mode is available, then the weight export mode is determined to be one of P weight export 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 export mode is unavailable, then the weight export mode is determined not to constitute P weight export modes. In some embodiments, multiple arrays can be used to implement the filtering conditions corresponding to different block sizes and different block shapes. In some embodiments, filtering conditions corresponding to different block sizes and filtering conditions corresponding to different block shapes can be implemented using a two-dimensional array. That is, a two-dimensional array includes both filtering conditions corresponding to block size and filtering conditions corresponding to block shape. For example, the filtering criteria for a block of size A and shape B are shown below, and these criteria are represented by a two-dimensional 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,1), (0,1),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0),(0,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),(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) }; In this context, a value of 1 for all values ​​of g_sgpm_splitDir[x] indicates that the weight export mode at index x is available, while a value of 0 for any of the values ​​in g_sgpm_splitDir[x] indicates that the weight export mode at index x is not available. For example, g_sgpm_splitDir[4] = (1,0) means that weight export 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 export mode is not available. It should be noted that the above example uses GPM, which includes 64 weight derivation modes, but the weight derivation modes in this application embodiment include, but are not limited to, the 64 weight derivation modes included in GPM and the 56 weight derivation modes included in AMP. Following the steps described above, the decoder determines Q prediction patterns and P weighted derived patterns. Based on these Q prediction patterns and P weighted derived patterns, it forms R different second combinations. Next, based on the R second combinations, it determines a first candidate combination list, and then from this first candidate combination list, it determines the first weighted derived pattern and K first prediction patterns. In some embodiments, to further improve the construction speed of the first candidate combination list, the decoding end further filters the Q prediction modes and P weighted derivation modes determined above. At this time, the steps in S102-A11-21 to S102-A11-23 above, which form R second combinations based on the determined P weighted derivation modes and Q prediction modes, include the following steps: S102-A11-21. Select S weight derivation patterns from P weight derivation patterns, where S is a positive integer less than or equal to P. Specifically, from the P weight derivation patterns determined above, weight derivation patterns with low occurrence probability are removed to obtain S weight derivation patterns after filtering. Among them, the methods for selecting S weight derivation patterns from P weight derivation patterns in S102-A11-21 above include, but are not limited to, the following: Method 1: For the i-th weighted export pattern among P weighted export patterns, determine the weights of K second prediction patterns on the template based on the i-th weighted export pattern. The K second prediction patterns are any K prediction patterns among Q prediction patterns, where i is a positive integer from 1 to P. If the weight of any prediction pattern among the K prediction patterns on the template is less than the first preset value, then remove the i-th weighted export pattern from the P weighted export patterns to obtain S weighted export patterns. In Method 1, if a weighted derivation pattern derives template weights that result in a prediction pattern having little or no influence on the template, then that weighted derivation pattern is not used. For example, weighted derivation pattern 52 in Figure 4 (the square block) results in a small weight for the second prediction pattern on the template. Another example is weighted derivation pattern 54, which results in a weight of 0 for the second prediction pattern on the template. In other words, under weighted derivation pattern 54, the second prediction pattern has no influence on the template, and the predicted value of the template is entirely determined by the first prediction pattern. In this case, the second prediction pattern has no effect whatsoever, and such weighted derivation patterns need to be removed from the P weighted derivation patterns. It should be noted that the same weighted derivation pattern for blocks of different shapes may result in different effects for the two prediction patterns. Since the current block may be a square or a rectangle, its length may be greater than its width, or vice versa, and the ratio may be 1:2, 1:4, etc. Figures 16A and 16B show the weighted derivation patterns of GPM for 32x64 and 64x32 blocks. It can be seen that the intersection point of the boundary line of the same weighted derivation pattern with the block boundary is different under different shapes. This is because the block shape changes, but the angle of the boundary line does not change accordingly. As shown in Figure 16A, for the weighted derivation pattern with index 52 in a 32x64 block, when the boundary of the weighted derivation pattern with index 52 is extended towards the template area of ​​the current block, it intersects with the template area, making the weight of the second prediction pattern in the template no less than the preset value. This indicates that the second prediction pattern has an influence on the template. However, as shown in Figure 16B, the same weighted export pattern with index 52, when its interface is delayed to the template region of the current block in a 64x32 block, does not intersect with the template region, resulting in the second prediction pattern having a weight of 0 in the template. This means that the second prediction pattern has no effect in the template. In the above method 1, the weight export patterns that make the weight of any one of the K prediction patterns on the template less than the first preset value are removed from the P weight export patterns, resulting in S weight export patterns. The embodiments of this application do not limit the specific value of the first preset value, for example, it can be a smaller value that is greater than or equal to 0. Method 2: For the i-th weight export pattern among the P weight export patterns, determine the cost of using the i-th weight export pattern to predict the template, where i is a positive integer from 1 to P; based on the cost corresponding to the i-th weight export pattern, select S weight export patterns from the P weight export patterns. In this method 2, S weight export patterns are selected from the P weight export patterns by calculating the cost corresponding to each weight export pattern among the P weight export patterns. In this embodiment of the application, the weighted derivation mode and K prediction modes are combined as a group for cost calculation. Thus, for ease of calculation, based on the given K prediction modes, the cost of P weighted derivation modes is calculated. That is, the P weighted derivation modes are combined with the set K prediction modes to obtain P combinations. The cost corresponding to each of these P combinations is calculated to obtain the cost of the P weighted derivation modes. For example, suppose we have K prediction patterns, namely prediction pattern 1 and prediction pattern 2. For the i-th weighted derived pattern among P weighted derived patterns, the i-th weighted derived pattern forms a combination with prediction pattern 1 and prediction pattern 2, denoted as combination i. Using combination i, we predict the template of the current block, obtaining the predicted value of the template under combination i. Based on the predicted value and the reconstructed value of the template under combination i, we determine the prediction distortion cost corresponding to combination i. This prediction distortion cost corresponding to combination i is then determined as the cost corresponding to the i-th weighted derived pattern. In this way, we can determine the cost corresponding to any weighted derived pattern among the P weighted derived patterns. Based on the above method, after determining the cost corresponding to the i-th weight export pattern among the P weight export patterns, S weight export patterns are selected from the P weight export patterns according to the cost corresponding to the i-th weight export pattern. In this method 2, the decoding end selects S weight export modes from P weight export modes based on the cost corresponding to the i-th weight export mode, including the following methods: In the first approach, if the cost corresponding to the i-th weighted derivation pattern is less than the second preset value, then a weighted derivation pattern similar to the i-th weighted derivation pattern is selected from the P weighted derivation patterns. Based on the i-th weighted derivation pattern and its similar weighted derivation patterns, S weighted derivation patterns are determined. The similar weighted derivation patterns of the i-th weighted derivation pattern can be understood as weighted derivation patterns whose prediction results are similar to those of the i-th weighted derivation pattern. For example, similar weighted derivation patterns include weighted derivation patterns with a partition angle similar to that of the i-th weighted derivation pattern, and / or weighted derivation patterns with an offset similar to that of the i-th weighted derivation pattern. The offset of a weighted derivation pattern can also be understood as the intercept of the boundary line of that weighted derivation pattern on the edge of the current block. For example, the above-mentioned similar division angles can include the same division angle but different offsets, such as weight export mode 11 and weight export mode 13 in Figure 4. It can also include the same division angle and similar offsets, such as weight export mode 11 and weight export mode 12 in Figure 4. It can also include similar division angles but different offsets, such as weight export mode 9 and weight export mode 11 in Figure 4. It can also include similar division angles and similar offsets, such as weight export mode 9 and weight export mode 12 in Figure 4. For example, the above-mentioned similar offsets can include offsets that are similar and have the same division angle, such as weight export mode 29 and weight export mode 30 in Figure 4, and also include offsets that are the same or similar and have similar division angles, such as weight export mode 2 and weight export mode 38 in Figure 4. In some embodiments, a similar weight export pattern to the i-th weight export pattern can be understood as a weight export pattern whose index is close to that of the i-th weight export pattern. In this first approach, if the cost corresponding to the i-th weighted derivation pattern is less than the second preset value, it indicates that using the i-th weighted derivation pattern to predict the current block may achieve a better prediction effect. In this case, the i-th weighted derivation pattern is selected from the P weighted derivation patterns to construct the subsequent R second combinations. Furthermore, since weighted derivation patterns similar to the i-th weighted derivation pattern have similar characteristics, similar weighted derivation patterns are selected from the P weighted derivation patterns to construct the subsequent R second combinations. Next, from the remaining weighted derivation patterns among the P weighted derivation patterns, one weighted derivation pattern is selected as the new i-th weighted derivation pattern, and the above steps are repeated to obtain S weighted derivation patterns. The embodiments of this application do not limit the size of the second preset value, but determine it according to actual needs. In some embodiments, the decoding end can also select S weight export modes from P weight export modes according to the second method below. In the second approach, if the cost corresponding to the i-th weight export pattern is greater than the third preset value, then the i-th weight export pattern and its similar weight export patterns are removed from the P weight export patterns to obtain at least one weight export pattern after removal; based on the at least one weight export pattern after removal, S weight export patterns are determined. In this second approach, if the cost corresponding to the i-th weighted derived pattern is less than the third preset value, it indicates that using the i-th weighted derived pattern to predict the current block may not achieve a good prediction effect. In this case, the i-th weighted derived pattern is removed from the P weighted derived patterns. Furthermore, since weighted derived patterns similar to the i-th weighted derived pattern have similar characteristics, these similar weighted derived patterns are also removed from the P weighted derived patterns, resulting in a set of removed weighted derived patterns. Next, from this set, a weighted derived pattern is selected as the new i-th weighted derived pattern. The above steps are repeated until the final set of weighted derived patterns includes S weighted derived patterns. The embodiments of this application do not limit the size of the third preset value, but determine it according to actual needs. The third preset value is greater than the second preset value. Based on the above steps, after the decoding end selects S weight export modes from P weight export modes, it executes the following steps S102-A11-22. S102-A11-22. Select T prediction patterns from Q prediction patterns, where T is a positive integer less than or equal to Q. This application does not limit the method of selecting T prediction modes from Q prediction modes in the embodiments. In some embodiments, T preset prediction patterns are selected from Q prediction patterns. In some embodiments, for the i-th prediction mode among the Q prediction modes, the decoder determines the cost of using the i-th prediction mode to predict the template, where i is a positive integer from 1 to Q; and selects T prediction modes from the Q prediction modes based on the cost corresponding to the i-th prediction mode. In this embodiment of the application, the weighted derivation mode and K prediction modes are combined as a group for cost calculation. Thus, for ease of calculation, based on the given weighted derivation mode and other K-1 prediction modes, the cost of Q weighted derivation modes is calculated. That is, the Q prediction modes are combined with the set weighted derivation mode and K-1 prediction modes respectively to obtain Q combinations. The cost corresponding to each of these Q combinations is calculated to obtain the cost of the Q prediction modes. For example, suppose we have K-1 prediction patterns, designated as prediction pattern 1, and a weighted derived pattern, designated as weighted derived pattern 1. For the i-th prediction pattern among the Q prediction patterns, weighted derived pattern 1, along with the i-th prediction pattern and prediction pattern 1, forms a combination, denoted as combination i. Using combination i, we predict the template of the current block, obtaining the predicted value of the template under combination i. Based on the predicted value and the reconstructed value of the template under combination i, we determine the prediction distortion cost corresponding to combination i. This prediction distortion cost corresponding to combination i is then used as the cost corresponding to the i-th prediction pattern. This allows us to determine the cost corresponding to any one of the Q prediction patterns. Based on the above method, after determining the cost corresponding to the i-th prediction mode among the Q prediction modes, T prediction modes are selected from the Q prediction modes according to the cost corresponding to the i-th prediction mode. The decoding end selects T prediction modes from Q prediction modes based on the cost corresponding to the i-th prediction mode, including the following methods: In the first approach, if the cost corresponding to the i-th prediction mode is less than the fourth preset value, then a prediction mode similar to the i-th prediction mode is selected from the Q prediction modes. Based on the i-th prediction mode and the similar prediction modes of the i-th prediction mode, T prediction modes are determined. Here, a prediction mode similar to the i-th prediction mode can be understood as a prediction mode whose prediction result is similar (or close) to the prediction reception of the i-th prediction mode. For example, a prediction mode whose prediction direction (or angle) is close to the prediction direction (or angle) of the i-th prediction mode, or a prediction mode whose prediction mode index is close to the index of the i-th prediction mode. For example, a prediction mode whose index is 1 or 2 larger than the index of the i-th prediction mode, or a prediction mode whose index is 1 or 2 smaller than the index of the i-th prediction mode. In this first approach, if the cost corresponding to the i-th prediction mode is less than the fourth preset value, it indicates that using the i-th prediction mode to predict the current block may achieve a better prediction effect. In this case, the i-th prediction mode is selected from the Q prediction modes to construct the subsequent R second combinations. Furthermore, since prediction modes similar to the i-th prediction mode have similar characteristics, similar prediction modes are selected from the Q prediction modes to construct the subsequent R second combinations. Next, from the remaining prediction modes of the Q prediction modes, one prediction mode is selected as the new i-th prediction mode, and the above steps are repeated to obtain T prediction modes. The embodiments of this application do not limit the size of the fourth preset value mentioned above, and the specific value is determined according to actual needs. The second approach is to remove the i-th prediction mode and its similar prediction modes from the Q prediction modes to obtain at least one prediction mode after removal; and to determine T prediction modes based on the at least one prediction mode after removal. In this second approach, if the cost corresponding to the i-th prediction mode is greater than the fifth preset value, it indicates that using the i-th prediction mode to predict the current block may not achieve a satisfactory prediction effect. In this case, the i-th prediction mode is removed from the Q prediction modes. Furthermore, since prediction modes similar to the i-th prediction mode have similar characteristics, these similar prediction modes are also removed from the Q prediction modes, resulting in a set of removed prediction modes. Next, from this set of removed prediction modes, one prediction mode is selected as the new i-th prediction mode. The above steps are repeated until the final set of prediction modes includes T prediction modes. The embodiments of this application do not limit the size of the fifth preset value mentioned above, but determine it according to actual needs. The fifth preset value is greater than the fourth preset value mentioned above. Based on the above steps, select S weighted export patterns from P weighted export patterns, select T prediction patterns from Q prediction patterns, and then execute S102-A11-23 as follows. S102-A11-23. Based on S weighted derived patterns and T prediction patterns, R second combinations are formed. Specifically, select one weighted derived pattern from S weighted derived patterns, and select K prediction patterns from T prediction patterns. This weighted derived pattern and the K prediction patterns form a second combination. Repeat this step to obtain R second combinations. As can be seen from the above, a second combination includes a weighted derivation pattern and K prediction patterns. In this way, when selecting prediction patterns, the possible selection of another element can be restricted when the K elements in a combination are fixed. For example, when K=2, the possible selection of the other element can be restricted when it is used in combination with two of the elements. The following section uses the process of selecting another prediction mode when the weighted derivation mode and one prediction mode are fixed as an example to introduce one implementation process of the above S102-A11-2. In some embodiments, S102-A11-2 includes: for the i-th weighted derivation mode among P weighted derivation modes, determining the cost of using the i-th weighted derivation mode and the j-th prediction mode among Q prediction modes to predict the template; if the cost corresponding to the combination of the i-th weighted derivation mode and the j-th prediction mode is greater than a sixth preset value, then removing the j-th prediction mode and similar prediction modes of the j-th prediction mode from the Q prediction modes to obtain at least one prediction mode after removal; and constructing R second combinations based on the i-th weighted derivation mode and the at least one prediction mode after removal. In this embodiment, when the weighted derivation mode and one prediction mode are fixed, the other prediction mode is selected. For example, if under a certain weighted derivation mode, a certain intra-prediction mode cannot achieve a relatively low cost as the first prediction mode, then the case where an intra-prediction mode similar to that intra-prediction mode under the same weighted derivation mode is no longer tried as the first prediction mode. Specifically, for the i-th weight-derived pattern among P weight-derived patterns, assuming K=2, this combination includes the i-th weight-derived pattern, the first prediction pattern, and the second prediction pattern. Assume the second prediction pattern is set as prediction pattern 1. This prediction pattern 1 can be one of the Q prediction patterns or another prediction pattern outside the Q prediction patterns. The possible selection of the first prediction pattern from the Q prediction patterns is determined by taking the j-th prediction pattern from the Q prediction patterns as the first prediction pattern. Then, when the combination j (composed of the i-th weight-derived pattern, the j-th prediction pattern, and prediction pattern 1) predicts the template, the predicted value of the template is determined. Based on this predicted value, the cost corresponding to combination j is determined, and the cost corresponding to combination j is set as the cost corresponding to the j-th prediction pattern. Next, it is determined whether the cost corresponding to the j-th prediction mode is greater than the sixth preset value. If the cost corresponding to the j-th prediction mode is greater than the sixth preset value, it means that the combination of the j-th prediction mode, the ith weighted derived mode, and prediction mode 1 cannot achieve accurate template prediction. In this case, the j-th prediction mode is removed from the Q prediction modes. Since prediction modes similar to the j-th prediction mode have similar characteristics, similar prediction modes are removed from the Q prediction modes, resulting in a set of removed prediction modes. From the set of removed prediction modes, a new prediction mode is selected as the new j-th prediction mode, and the above steps are repeated to obtain the final set of removed prediction modes corresponding to the ith weighted derived mode. Based on the above steps, we can determine the set of predicted modes after final elimination for each of the P weighted derived modes. Then, based on the P weighted derived modes and their respective sets of predicted modes after final elimination, we can construct R second combinations. It should be noted that the above embodiments illustrate a method of filtering prediction modes in a combination. Optionally, either the weighted derivation mode or the prediction mode can be filtered in a combination to finally construct R second combinations. After determining R second combinations based on the methods described above, the decoder uses the weighted derived mode and K prediction modes in the second combination to predict the template and obtain the template prediction value corresponding to the second combination. The following describes the process of using any second combination to predict the template of the current block and obtaining the predicted value of the template. First, the weights of the template are determined using the weight derivation patterns included in the second combination. Currently, as shown in Figure 13 above, the template for the current block is either the coded area above the current block, or the coded area to the left of the current block, or the coded areas to the left and above the current block. In some embodiments, the weight matrix can be directly extended towards the template region, for example, extending left and upward, covering the template with the weight matrix to determine the template's weights. For example, as shown in Figure 17, a small rectangular region on the upper left side of the current block can be added to the template, combining the template and the current block to form a rectangle. Alternatively, only the left and upper parts can be used as the template. As shown in Figure 17, taking the addition of the upper left region as an example, the regions within the inverted L-shaped frames on the left, upper left, and top sides are the template region, and the rectangular region on the lower right is the current block. Then, the weight matrix extended to the upper left becomes the template's weight matrix. In some embodiments, the process of deriving template weights and predicted value weights according to the weight derivation mode is combined, for example, simultaneously deriving template weights and predicted value weights. The weight of the predicted value can be understood as the weight corresponding to the predicted value. For example, a first predicted value is obtained using a first prediction mode, a second predicted value is obtained using a second prediction mode, a first weight of the first predicted value is determined according to the weight derivation mode, a second weight of the second predicted value is determined according to the weight derivation mode, and the sum of the product of the first predicted value and the first weight, and the product of the second predicted value and the second weight, is determined as the predicted value of the current block. In order to distinguish them from template weights, this application refers to the first and second weights as the weights of the predicted values. In some embodiments, determining template weights based on the weight derivation mode includes the following steps: Step 1: Determine the angle index and distance index based on the weighted export mode; Step 2: Determine the template weight based on the angle index, distance index, and template size. This application can derive template weights in the same way as deriving the weights of the predicted values. For example, firstly, based on the weight deriving mode, the angle index and distance index are determined, where the angle index can be understood as the boundary angle index of each weight derived by the weight deriving mode. For instance, according to Table 2 above, the angle index and distance index corresponding to the weight deriving mode can be determined; for example, if the weight deriving mode is 27, then the corresponding angle index is 12 and the distance index is 3. Next, the template weights are determined based on the angle index, distance index, and the size of the template. In step 2 above, the methods for determining the template weight based on the angle index, distance index, and template size include, but are not limited to, the following: Method 1: Determine the template weight directly based on the angle index, distance index, and template size. In this case, step 2 above includes steps 21 to 23 as follows: Step 21: Determine the first parameter of the pixels in the template based on the angle index, distance index, and template size; Step 22: Determine the weight of the pixels in the template based on the first parameter of the pixels in the template; Step 23: Determine the template weight based on the weight of each pixel in the template. In this implementation, the weights of pixels in the template are determined based on the angle index, distance index, template size, and current block size. Then, the weight matrix composed of the weights of each point in the template is determined as the template weight. The first parameter of this application is used to determine the weight. In some embodiments, the first parameter is also referred to as the weight index. In one possible implementation, the offset and the first parameter can be determined as follows: The inputs for the template weight derivation process are as follows: as shown in Figure 17, the width nCbW of the current block, the height nCbH of the current block; the width nTmW of the left template, the height nTmH of the upper template; the "division" angle index variable angleId of GPM; the distance index variable distanceIdx of GPM; and the component index variable cIdx. For example, this application takes the luminance component as an example, so cIdx is 0, which represents the luminance component. The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are exported 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 encoding / decoding process. 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 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., 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 cases where x and y are both greater than or equal to 0) is derived as follows, with the top-left corner of the current block as (0, 0): – Variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*SubWidthC yL=(cIdx==0)? y:y*SubHeightC disLut is determined according to Table 3 above. 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 using the above method, the weight at the midpoint (x, y) of the template is determined based on weightIdx. In this application, the methods for determining the weight of pixels in the template based on the first parameter of the pixels in the template in step 22 above include, but are not limited to, the following: Method 1: Determine the second parameter of the pixel in the template based on the first parameter of the pixel in the template; determine the weight of the pixel in the template based on the second parameter of the pixel in the template. The second parameter is also used to determine the weight. In some embodiments, the second parameter is also referred to as the weight index under the first component, which can be a luminance component, a chrominance component, etc. For example, the weights of pixels in the template are determined according to the formula: weightIdxL=partFlip? 32+weightIdx:32-weightIdx wTemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3) Where wTemplateValue[x][y] is the weight of the template midpoint (x, y), weightIdxL is the second parameter of the template midpoint (x, y), also known as the weight index under the first component (e.g., the luminance component), and partFlip is an intermediate variable determined according to the angle index angleIdx, for example, as mentioned 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, and when partFlip is 1, weightIdxL is 32 + weightIdx. It should be noted that 32 here is just an example, and this application is not limited to this. Method 2: Determine the weight of the pixels in the template based on the first parameter, the first threshold, and the second threshold of the pixels in the template. To reduce the computational complexity of template weights, Method 2 limits the weights of pixels in the template to either a first threshold or a second threshold. In other words, the weights of pixels in the template are either the first threshold or the second threshold, thereby reducing the computational complexity of template weights. This application does not impose any restrictions on the specific values ​​of the first threshold and the second threshold. Optionally, the first threshold is 1. Optionally, the second threshold is 0. In one example, the weights of pixels in the template can be determined using the following formula: wTemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0 Where wTemplateValue[x][y] is the weight of the midpoint (x, y) of the template, and the 1 in the above "1:0" is the first threshold and the 0 is the second threshold. In the first method described above, the weight of each point in the template is determined by the weight derivation mode, and the weight matrix composed of the weights of each point in the template is used as the template weight. Method 2 involves determining the weights of the current block and the template based on the weight export mode. In other words, in this method, the merged region consisting of the current block and the template is treated as a whole, and the weights of the pixels within the merged region are exported according to the weight export mode. Therefore, step 2 above includes the following steps 2-1 and 2-2: Step 2-1: Determine the weights of pixels in the merged region composed of the current block and the template based on the angle index, distance index, template size, and current block size; Step 2-2: Determine the template weight based on the size of the template and the weight of the pixels in the merged region. In this second method, the current block and the template are treated as a whole. The weights of the pixels in the merged region composed of the current block and the template are determined based on the angle index, distance index, size of the template, and size of the current block. Then, based on the size of the template, the weights corresponding to the template in the merged region are determined as template weights. For example, as shown in Figure 17, the weights corresponding to the L-shaped template region in the merged region are determined as template weights. In this second method, not only the template weights are determined in one weight determination process, but also the weights of the predicted values. That is, after removing the template weights from the weights corresponding to the merged regions, the remaining weights are the weights of the predicted values. Then, the subsequent prediction process can be executed based on the weights of the predicted values ​​without having to redetermine the weights of the predicted values, thereby reducing the prediction steps and improving prediction efficiency. This application does not limit the specific implementation of determining the weights of pixels in the merged region composed of the current block and the template based on the angle index, distance index, template size, and current block size. In some embodiments, determining the weights of pixels in the merged region in step 2-1 above includes the following steps 2-11 to 2-12: Step 2-11: Determine the first parameter of the pixels in the merged region based on the angle index, distance index, and size of the merged region; Step 2-12: Determine the weight of the pixels in the merged region based on the first parameter of the pixels in the merged region. In this implementation, the weights of pixels in the merged region are determined based on the angle index, distance index, and size of the merged region, forming a weight matrix composed of the weights of each point in the merged region. In one possible implementation, the offset and the first parameter can be determined as follows: The inputs for the merged region weight derivation process are as follows: as shown in Figure 17, 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 angleId of GPM; the distance index variable distanceIdx of GPM; and the component index variable cIdx. For example, this application takes the luminance component as an example, so cIdx is 0, indicating the luminance component. The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are exported 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 encoding / decoding process. 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 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., shiftHor is 1): offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3) offsetY = (-nH) >> 1 The weight matrix wValueMatrix[x][y] of the pixels in the merged region (where x = -nTmW..nCbW–1, y = -nTmH..nCbH-1) is derived as follows, with the top-left corner of the current block as (0, 0): – Variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*SubWidthC yL=(cIdx==0)? y:y*SubHeightC disLut is determined according to Table 3. The first parameter, weightIdx, is derived as follows: weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+ (((yL+offsetY)<<1)+1)*disLut[displacementY] Based on the above method, after determining the first parameter weightIdx, the weight at point (x, y) in the merged region is determined according to weightIdx. In this application, the methods for determining the weights of pixels in the merged region based on the first parameter of the pixels in the merged region in steps 2-12 above include, but are not limited to, the following: Method 1: Determine the second parameter of the pixels in the merged region based on the first parameter of the pixels in the merged region; determine the weight of the pixels in the merged region based on the second parameter of the pixels in the merged region. For example, the weights of pixels in the merged region are determined according to the formula: weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+ (((yL+offsetY)<<1)+1)*disLut[displacementY] weightIdxL=partFlip? 32+weightIdx:32-weightIdx wValueMatrix[x][y]=Clip3(0,8,(weightIdxL+4)>>3) Where wValueMatrix[x][y] is the weight of the point (x, y) in the merged region, weightIdxL is the second parameter of the point (x, y) in the merged region, and wTemplateValue[x][y] is the weight of the point (x, y) in the merged region. Method 2: Determine the weight of pixels in the merged region based on the first parameter, first threshold and second threshold of the pixels in the merged region. For example, the weight of pixels in the merged region is either a first threshold or a second threshold. To reduce the computational complexity of the weights in the merged region, Method 2 limits the weights of pixels in the merged region to either a first threshold or a second threshold. In other words, the weights of pixels in the merged region are either the first threshold or the second threshold, thereby reducing the computational complexity of the weights in the merged region. This application does not impose any restrictions on the specific values ​​of the first threshold and the second threshold. Optionally, the first threshold is 1. Optionally, the second threshold is 0. In one example, the weights of pixels in the merged region can be determined using the following formula: wTemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0 Where wValueMatrix[x][y] represents the weight of the point (x, y) in the merged region, and the 1 in the above "1:0" represents the first threshold and the 0 represents the second threshold. In the second method described above, the weight of each point in the merged region composed of the current block and the template is determined by the weight derivation mode. Then, based on the size of the template, the weight corresponding to the template in the merged region is determined as the template weight. In this second method, the weight of the predicted value is determined at the same time, eliminating the need to perform the subsequent steps of determining the weight of the predicted value, thus reducing the prediction steps and improving the prediction efficiency. According to the above method, after determining the template weights corresponding to the weighted derivation modes included in the second combination, the K prediction modes in the second combination are used to predict the template to obtain K prediction values. The K prediction values ​​are then weighted according to the template weights to obtain the predicted values ​​of the template. The predicted value of the template can be understood as a matrix composed of the predicted values ​​of the pixels in the template. In some embodiments, the above-mentioned predicted values ​​are also referred to as predicted samples. Next, the cost of the second combination is determined based on the predicted and reconstructed values ​​of the template. The methods for determining the cost of the second combination mentioned above include, but are not limited to, the following: Method 1: Determine the cost of the second combination using a matrix approach. Specifically, based on the predicted and reconstructed values ​​of the template, determine a loss, which is denoted as the first loss. Since the predicted and reconstructed values ​​of the template are matrices, the first loss is also a matrix. For example, the absolute value of the difference between the predicted and reconstructed values ​​of the template can be determined as the first loss, and this first loss can be used as the cost of the second combination. Method 2: Use point-by-point calculation to determine the cost of the second combination. Specifically, for the i-th pixel in the template, when determining the prediction of each of the K prediction modes in the second combination at the i-th pixel, the template weight corresponding to the i-th pixel in the template weight is determined. Based on the template weight of the i-th pixel and the K prediction values ​​of the i-th pixel, the prediction value of the i-th pixel is obtained. Based on the prediction value and the reconstructed value of the i-th pixel, the cost of the second combination at the i-th pixel is obtained. According to this method, the prediction distortion cost of the second combination at each pixel in the template can be determined. Finally, the sum of the prediction distortion costs of the second combination at each pixel in the template is determined as the cost of the second combination. Based on the above method, the cost of each of the R second combinations can be determined. Next, based on the cost of each of the R second combinations, a list of first candidate combinations is constructed. For example, based on the cost of the second combination, the R second combinations are sorted in ascending order, and the sorted R second combinations are determined as the first candidate combination list. For example, based on the cost of the second combination, select the N second combinations with the smallest cost from the R second combinations to form the first candidate combination list. Optionally, N can be 8, 16, or 32, etc. Based on the above method, a first candidate combination list is determined. Each first candidate combination in the first candidate combination list is sorted in ascending order of cost. For example, the first candidate combination list is shown in Table 6 above. In this way, the decoding end queries the first candidate combination corresponding to the first index in the first candidate combination list shown in Table 6 according to the first index, and determines the first candidate combination corresponding to the first index as the first combination, that is, the weight derivation mode included in the first candidate combination is determined as the first weight derivation mode, and the K prediction modes included in the first candidate combination are determined as K first prediction modes. In the above case 1, taking the first combination including the first weighted derived mode and K first prediction modes as an example, the implementation process of the above S102 will be introduced. Case 2: The first combination includes a first weighted derived pattern, K first prediction patterns, and a second transition parameter. As shown in Figures 4 and 5 above, there is a transition region near the weight division line, i.e., the gray area in Figures 4 and 5. This transition region corresponds to a transition parameter; that is, the transition parameter is used to represent the transition region in the weight graph. In some cases, this transition parameter can influence the weights. Therefore, in this embodiment, the predicted value of the current block is determined based on the second transition parameter, the first weight derivation mode, and K first prediction modes. In this case, the first combination in this embodiment includes the first weight derivation mode, the K first prediction modes, and the second transition parameter. In this case 2, the implementation methods of S102 above include, but are not limited to, the following: Method 1: The encoder and decoder determine the first combination corresponding to the first index from a set of preset second candidate combinations. For example, the preset set of second candidate combinations may include any number of second candidate combinations, such as 2, 3, 4, 5, 6, 7, 8, or 9. Assuming there are 8 second candidate combinations, each second candidate combination includes a weighted derived mode, K prediction modes, and a transition parameter, and these 8 second candidate combinations have different identifiers (or indices). Thus, after obtaining the first index, the decoder searches for the second candidate combination corresponding to the first index among these multiple second candidate combinations, determines the second candidate combination corresponding to the first index as the first combination, then determines the weighted derived mode included in that second candidate combination as the first weighted derived mode, the K prediction modes included in that second candidate combination as the K first prediction modes, and the transition parameter included in that second candidate combination as the second transition parameter. Method 2: Both the decoding and encoding ends determine a list containing multiple second candidate combinations; therefore, this list is also called the second candidate combination list. The first combination corresponding to the first index is determined from this second candidate combination list. In this case, S102 includes the following steps: S102-C, Determine the list of second candidate combinations; S102-D. The weighted derived mode, K prediction modes and transition parameters included in the second candidate combination corresponding to the first index in the second candidate combination list are determined as the first weighted derived mode, K first prediction modes and second transition parameters. The aforementioned list of second candidate combinations includes multiple second candidate combinations. Each of these multiple second candidate combinations includes a weighted derived mode, K prediction modes, and a transition parameter. For example, the list of second candidate combinations is shown in Table 8: Table 8 As shown in Table 8, the list of second candidate combinations includes multiple second candidate combinations. No two second candidate combinations are completely identical, that is, at least one of the weighted derivation mode, K prediction modes and transition parameters included in any two second candidate combinations is different. For example, Table 8 above uses the sorting of the second candidate combination in the second candidate combination list as the index. Optionally, the index of the second candidate combination in the second candidate combination list can also be represented in other ways, and this application embodiment does not limit this. In this method 2, the decoding end decodes the bitstream to obtain the first index and determines the second candidate combination list as shown in Table 8 above. Based on the first index, it queries the second candidate combination list to obtain the first weighted derived mode, K prediction modes and transition parameters included in the first combination indicated by the first index. For example, if the first index is index 1, then in the second candidate combination list shown in Table 8, the second candidate combination corresponding to index 1 is second candidate combination 2. That is, the first combination indicated by the first index is second candidate combination 2. Thus, the decoder determines the weighted derived mode, K prediction modes, and transition parameters included in second candidate combination 2 as the first weighted derived mode, K first prediction modes, and second transition parameters included in the first combination, and uses these first weighted derived mode, second transition parameters, and K first prediction modes to predict the current block, obtaining the predicted value of the current block. In this method 2, the encoder and decoder can each determine the same list of second candidate combinations. For example, both the encoder and decoder determine a list containing L second candidate combinations, each including one weighted derived mode, K prediction modes, and one transition parameter. In the bitstream, the encoder only needs to write the final selected second candidate combination, such as the first combination. The decoder parses the first combination finally selected by the encoder. Specifically, the decoder decodes the bitstream, obtains the first index, and determines the first combination from the list of second candidate combinations determined by the decoder using the first index. This application embodiment does not limit the specific method by which the decoding end determines the above-mentioned second candidate combination list. In some embodiments, the second candidate combination list is existing. After the decoding end obtains the first index from the decoded bitstream, it can obtain or read the second candidate combination list according to the first index, and then query the second candidate combination corresponding to the first index in the second candidate combination list according to the first index. In some embodiments, the second candidate combination list is sent from the encoder to the decoder, for example, before the encoder encodes the current block. In some embodiments, the second candidate combination list is uploaded to the cloud by the encoding end, and the decoding end reads the second candidate combination list from the cloud after decoding the bitstream and obtaining the first index. In some embodiments, the second candidate combination list is constructed by the decoding end. For example, after decoding the bitstream and obtaining the first index, the decoding end constructs the second candidate combination list in response to the first index. This application does not limit the method by which the decoding end constructs the second candidate combination list. For example, it can use information related to the current block to analyze the probability of each combination consisting of different weighted derivation modes, different prediction modes, and different transition parameters, and construct the second candidate combination list based on the probability of each combination. Optionally, information related to the current block may include pattern information of surrounding blocks and reconstructed pixels of the current block. In some embodiments, the decoding end constructs a second candidate combination list through the following steps S102-C1: S102-C1: Based on the template of the current block, construct a second candidate combination list. Template matching utilizes the correlation between adjacent pixels to use regions surrounding the current block as templates. During encoding and decoding of the current block, its left and top sides are already encoded according to the encoding order. During inter-frame prediction, 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. During intra-frame prediction, the template is used to determine the intra-frame prediction mode of the current block. The template of the current block consists of the reconstructed area around the current block and is related to the current block. Based on this, the embodiments of this application construct a second candidate combination list based on the template of the current block. This application does not impose any restrictions on the specific shape of the template for the current block. In some embodiments, the template includes at least one of the above encoded region, the left encoded region, and the upper left encoded region of the current block. Optionally, the width of the upper encoded region is the same as the width of the current block, the height of the left encoded region is the same as the height of the current block, the width of the upper left encoded region is the same as the width of the left encoded region, and the height of the upper left encoded region is the same as the height of the upper encoded region. For example, for each combination, the template of the current block is predicted using that combination to obtain the predicted value of the template under each combination. Based on the predicted value of the template under each combination, a second candidate combination list is constructed. For each combination, the template of the current block is predicted using that combination to obtain the cost corresponding to each combination. Then, based on the cost of each combination, a second candidate combination list is constructed. For example, the template is predicted based on the weighted derived modes, transition parameters, and K prediction modes included in the combination to obtain the template prediction value corresponding to that combination. For instance, the weights of the template are derived using the weighted derived modes included in the combination, and the template weights are adjusted using the transition parameters in the combination to obtain the adjusted template weights. The template is then predicted using the K prediction modes included in the combination to obtain the K predicted values ​​of the template. Based on the adjusted template weights, the K predicted values ​​of the template are weighted to obtain the predicted value of the template under that combination. Finally, the cost corresponding to that combination is determined based on the predicted value of the template under that combination and the reconstructed value of the template. It should be noted that the weights exported according to the weight export mode mentioned above can be understood as the weights corresponding to each pixel in the exported template, or as the weight matrix corresponding to the exported template. Adjusting the template weights using transition parameters can be understood as adjusting the weights corresponding to each pixel in the template, or adjusting the template's weight matrix. Specifically, when determining the predicted value of the template based on the adjusted template weights, one can determine K predicted values ​​corresponding to each pixel in the template, and then determine the predicted value corresponding to each pixel based on the K predicted values ​​and the adjusted weights. The predicted values ​​corresponding to each pixel in the template constitute the predicted value of the template. Optionally, when determining the predicted value of the template based on the adjusted weights, it can also be executed in blocks. For example, to determine the predicted value of the template, the K predicted values ​​of the template are weighted according to the adjusted weight matrix of the template to obtain the predicted value of the template. In some embodiments, S102-C1 includes the following steps S102-C11 to S102-C13: S102-C11. Determine H third combinations. Each of the H third combinations includes a weighted derived mode, K prediction modes and a transition parameter. The weighted derived mode, K prediction modes and transition parameter included in any two of the H third combinations are not completely the same. H is a positive integer greater than 1. S102-C12. For any of the H third combinations, determine the cost corresponding to the third combination when using the weighted derived mode, K prediction modes and transition parameters in the third combination to predict the template. S102-C13. Based on the cost corresponding to each of the H third combinations, construct a list of second candidate combinations. In this embodiment, when constructing the second candidate combination list, the decoding end first determines H third combinations. This application does not limit the specific value of the H third combinations, for example, 8, 16, 32, etc. Each of the H third combinations includes a weighted derived mode, K prediction modes, and a transition parameter, and the weighted derived mode, K prediction modes, and transition parameter included in any two of the H third combinations are not completely identical. Next, for each of the H third combinations, the cost corresponding to that third combination is determined when using the weighted derived mode, K prediction modes, and transition parameter included in that third combination to predict the template of the current block. Finally, based on the cost corresponding to each of the H third combinations, the second candidate combination list is constructed. In some embodiments, when determining in S102-C12 above to use the weighted derived mode, K prediction modes, and transition parameters in the third combination to predict the template, the cost corresponding to the third combination includes at least the following: Method 1, S102-C12 includes the following S102-C12-11 to S102-C12-14: S102-C12-11. Determine the weights of the template based on the weight derivation mode and transition parameters included in the third combination. S102-C12-12. Based on the K prediction patterns in the third combination, predict the template to obtain the K predicted values ​​of the template. S102-C12-13. The K predicted values ​​of the template are weighted according to the template weights to obtain the template predicted value corresponding to the third combination. S102-C12-14. Determine the cost corresponding to the third combination based on the template prediction value and the template reconstruction value corresponding to the third combination. In this embodiment of the application, the process of determining the cost corresponding to each of the H third combinations is the same. For ease of description, we will use one of the H third combinations as an example for illustration. In this embodiment, the third combination includes a weighted derivation mode, a transition parameter, and K prediction modes. When using this third combination to predict the template, the template weight is determined based on the weighted derivation mode and transition parameter included in the third combination. The template is then predicted based on the K prediction modes included in the third combination to obtain K predicted values ​​for the template. Next, the K predicted values ​​of the template are weighted using the template weight to obtain the template prediction value corresponding to the third combination. Finally, the cost corresponding to the third combination is determined based on the template prediction value corresponding to the third combination and the reconstructed value of the template. In this embodiment, the transition parameter is used to adjust the weights derived by the weight derivation mode. Therefore, in this embodiment, in S102-C12-11 above, the implementation method of determining the template weights based on the weight derivation mode and transition parameter included in the third combination can be at least the following: Example 1: When exporting template weights using the first weight export mode, multiple intermediate variables need to be determined. Transition parameters can be used to adjust one or more of these intermediate variables, and then the adjusted variables can be used to export the template weights. For example, transition parameters can be used to adjust one or more of the variables such as displacementX, displacementY, partFlip, shiftHoroffsetX, offsetY, xL, and yL to obtain the template weights. Example 2: Based on the weight derivation mode and template in the third combination, determine the third weight corresponding to the template, adjust the third weight using the transition parameters in the third combination, and obtain the adjusted third weight; determine the weight of the template based on the adjusted third weight. For example, based on the weight derivation mode and template in the third combination, the third weight corresponding to the template is determined as weightIdx. Then, the transition parameter is used to adjust weightIdx to obtain the adjusted weightIdx. Then, based on the adjusted weightIdx, the weight wVemplateValue of the template is determined. In one example, weightIdx can be adjusted using transition parameters according to the following formula to obtain the adjusted weightIdx: weightIdx=weightIdx*blendingCoeff Here, blendingCoeff is the transition parameter included in the third combination. For example, based on the weight derivation mode and template in the third combination, the third weight corresponding to the template is determined to be wVemplateValue. Then, the transition parameter is used to adjust wVemplateValue to obtain the adjusted wVemplateValue. The adjusted wVemplateValue is then used to determine the weight of the template. In one example, the adjusted wVemplateValue can be obtained by adjusting the transition parameters according to the following formula: wVemplateValue=wVemplateValue*blendingCoeff Based on the above method, the template weight corresponding to each of the H third combinations can be determined. Next, for each third combination, the template is predicted using the K prediction modes included in that third combination, resulting in K predicted values ​​for the template. Using the template weights corresponding to that third combination, the K predicted values ​​are weighted to obtain the template prediction value for that third combination. Based on the template prediction value and the reconstructed value of the template, the cost corresponding to that third combination is determined. The methods for determining the cost of the third combination include, but are not limited to, SAD, SATD, and SEE. Referring to this method, the template prediction value corresponding to each of the H third combinations can be determined. Then, based on the template prediction values ​​corresponding to each of the H third combinations, a second candidate combination list is constructed. Method 2, S102-C12 includes the following S102-C12-11 to S102-C12-14: S102-C12-21. Based on the weighted derivation mode and transition parameters in the third combination, determine the template prediction values ​​corresponding to the K prediction modes in the third combination. S102-C12-22. Based on the template prediction values ​​and template reconstruction values ​​corresponding to the K prediction modes in the third combination, determine the costs corresponding to the K prediction modes in the third combination. S102-C12-23. Determine the cost of the third combination based on the costs corresponding to the K prediction modes in the third combination. For example, the sum of the costs corresponding to the K prediction modes in the third combination is determined as the cost of the third combination. For example, assuming K=2, the two prediction modes included in the third combination are denoted as prediction mode 1 and prediction mode 2. First, based on the weighted derived modes and transition parameters included in the third combination, the template weight and predicted value corresponding to prediction mode 1 are determined. The predicted value corresponding to prediction mode 1 is then processed using the template weight. For example, for each pixel in the template corresponding to prediction mode 1, the predicted value of that pixel is multiplied by the template weight corresponding to that pixel to obtain the predicted value of that pixel. In this way, the template predicted value corresponding to prediction mode 1 can be determined. Next, based on the template predicted value and the template reconstruction value corresponding to prediction mode 1, the cost corresponding to prediction mode 1 is determined. The methods for determining the cost corresponding to prediction mode 1 include, but are not limited to, SAD, SATD, SEE, etc. Similarly, the cost corresponding to prediction mode 2 can be determined. Then, based on the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2, the cost corresponding to the third combination is determined. For example, the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2 are added together to determine the cost corresponding to the third combination. The methods for constructing the second candidate combination list based on the cost of each of the H third combinations in S102-C13 above include, but are not limited to, the following: Example 1: Sort the H third combinations according to the cost of each of the H third combinations; determine the sorted H third combinations as the second candidate combination list. The list of second candidate combinations generated in Example 1 includes H second candidate combinations. Optionally, the H second candidate combinations in the second candidate combination list are sorted in ascending order of cost, that is, the costs corresponding to the H second candidate combinations in the second candidate combination list increase sequentially according to the sorting. Specifically, sorting the H third combinations based on the cost of each of the H third combinations can be done by sorting the H third combinations in ascending order of cost. Example 2: Based on the cost corresponding to the third combination, select L third combinations from H third combinations, and determine the list of these L third combinations as the second candidate combination list. Optionally, the above L third combinations are the L third combinations with the smallest cost among the H third combinations. For example, based on the cost corresponding to each of the H third combinations, the L third combinations with the smallest cost are selected from the H third combinations to form a second candidate combination list. In this case, the second candidate combination list includes L second candidate combinations. Optionally, the L second candidate combinations in the second candidate combination list are sorted in ascending order of cost, that is, the costs corresponding to the L second candidate combinations in the second candidate combination list increase sequentially according to the sorting. The process of determining H third combinations in S102-C11 above is described below. In some embodiments, the aforementioned H third combinations are preset. Each of the preset H third combinations is used to predict the template of the current block, obtaining a template prediction value corresponding to each third combination. Then, based on the template prediction value and the reconstructed template value, the cost corresponding to each third combination is determined. Based on the cost of each third combination, the H third combinations are sorted, and the sorted H third combinations are used as a second candidate combination list. Alternatively, the L third combinations with the lowest costs are selected from the sorted H third combinations to form a second candidate combination list. In some embodiments, S102-C11 includes the following steps: S102-C11-1. Determine F weighted derived modes, J prediction modes, and W transition parameters, where F and W are both positive integers, and J is a positive integer greater than or equal to K. S102-C11-2. Based on F weighted derived modes, J prediction modes and W transition parameters, construct H third combinations. Any of the H third combinations includes one weighted derived mode from the F weighted derived modes, K prediction modes from the J prediction modes and one transition parameter from the W transition parameters. In this embodiment, the decoding end first determines F weighted derivation modes, J prediction modes, and W transition parameters. Then, based on the determined F weighted derivation modes, J prediction modes, and W transition parameters, it constructs H third combinations. The embodiments of this application do not limit the specific number of the above-mentioned F weighted derivation modes, J prediction modes and W transition parameters. Assuming K=2, the above K prediction modes include the first prediction mode and the second prediction mode. Assuming there are J types of all available prediction modes, the first prediction mode has J possibilities. Since the second prediction mode is different from the first prediction mode, there are J-1 possibilities for the second prediction mode. Assuming there are F types of weight derivation modes and W types of overgradient coefficients, this application may use any two different prediction modes, any weight derivation mode, and any overgradient coefficient to form a third combination, for a total of F*J*(J-1)*W possible third combinations. In this implementation, F weighted derived modes represent all possible weighted derived modes, J prediction modes represent all possible prediction modes, and W transition parameters represent all possible transition parameters. An exhaustive approach is used to obtain all possible third combinations. Each of these third combinations is used to predict the template of the current block, and the distortion cost of each third combination is calculated. Based on the distortion cost of each third combination, a list of second candidate combinations corresponding to the current block is obtained. In some embodiments, in order to reduce the amount of data and improve the construction speed of the second candidate combination list, not every prediction mode is tried, but only some prediction modes are selected for trying. At this point, the methods for determining the J prediction modes in S102-C11-1 above include, but are not limited to, the following: Method 1: J prediction patterns are preset prediction patterns. Method 2: Determine at least one of the following: a list of second candidate prediction modes for the current block, a list of second alternative prediction modes corresponding to the K prediction modes, and a prediction mode corresponding to the weight-derived mode. The list of second candidate prediction modes includes multiple second candidate prediction modes, and the list of second alternative prediction modes corresponding to any of the K prediction modes includes at least one second alternative prediction mode. Based on the list of second candidate prediction modes, the list of second alternative prediction modes corresponding to the K prediction modes, and at least one prediction mode corresponding to the weight-derived mode, determine J prediction modes. The methods for determining the list of second candidate prediction modes for the current block include at least the following examples: Example 1: Determine a list of second candidate prediction modes based on the prediction modes used by at least one block adjacent to the current block. Example 2: If the preset mode is not included in the second candidate prediction mode list, then determine the preset mode corresponding to the current block; add the preset mode to the second candidate prediction mode list. In one example, the aforementioned preset mode is a set of preset prediction modes. In another example, the image type corresponding to the current block is determined, and a preset mode is determined based on the image type corresponding to the current block. For example, if the image type corresponding to the current block is B type or P type, the preset mode includes at least one of DC, horizontal mode, vertical mode and angle mode. Example 3: Determine the image type corresponding to the current block, and based on the image type, determine the second candidate prediction mode list. For example, if the image type corresponding to the current block is type B or type P, then at least one of DC (horizontal mode), vertical mode, and some angle modes can be added to the second candidate prediction mode list. As another example, if the image type corresponding to the current block is type I, then at least one of DC (horizontal mode) and vertical mode can be added to the second candidate prediction mode list. In this embodiment of the application, the specific implementation of the second method is described in the specific description of method two in S102-A11-1 above, and will not be repeated here. The process of determining the F weight derivation modes in S102-C11-1 is described below. In this embodiment of the application, the methods for determining the F weight derivation modes include at least the following: In some embodiments, the above F weight export modes are preset weight export modes. In some embodiments, F weight derivation patterns are selected from Z preset weight derivation patterns, where Z is a positive integer greater than or equal to F. This application embodiment does not limit the above-mentioned preset Z weight derivation modes. In some embodiments, if Z equals F, then the Z weighted export patterns are determined as F weighted export patterns. In some embodiments, if Z is greater than F, then in order to further reduce the number of H third combinations, the preset Z weight derivation modes are filtered, and F weight derivation modes can be selected from the preset Z weight derivation modes to construct H third combinations. The process of determining the F weight derivation patterns in S102-C11-1 above is basically the same as the process of determining the P weight derivation patterns in S102-A11-1 above. Referring to the specific description of determining the P weight derivation patterns above, it will not be repeated here. The process of determining the W transition gradient coefficients in S102-C11-1 is described below. In some embodiments, the above W transition parameters are preset transition parameters, such as 1 / 4, 1 / 2, 1, 2, 4, etc. In some embodiments, W transition parameters are determined based on the size of the current block. For example, if the size of the current block is less than a preset value, then the W transition parameters fall within the value range 1 of the transition parameters. As another example, if the size of the current block is less than a preset value, then the W transition parameters fall within the value range 2 of the transition parameters. The value ranges 1 and 2 of the transition parameters may or may not intersect. In some embodiments, W transition parameters are determined from a plurality of preset transition parameters. In one example, W transition parameters are determined from a set of preset transition parameters based on the image information of the current block. This application does not limit the specific content of the image information of the current block, such as blurriness, clarity, sharpness, etc. In some embodiments, if the image information of the current block includes the sharpness of the image edges, then W transition parameters are determined from a plurality of preset transition parameters based on the image information of the current block, including two examples: Example 1: If the image edge sharpness of the current block is less than a preset value, then at least one of the first type of transition parameters among the multiple preset transition parameters will be determined as W transition parameters. Among them, the first type of transition parameter can be understood as a transition parameter that can form a relatively wide transition region, such as 1 / 4, 1 / 2, etc. Example 2: If the image edge sharpness of the current block is greater than or equal to the preset value, then at least one second-type transition parameter among multiple preset transition parameters is determined as W transition parameters, and the second-type transition parameter is greater than the first-type transition parameter. Among them, the second type of transition parameter can be understood as a transition parameter that can form a narrower transition region, such as 2, 4, etc. In this embodiment of the application, the method for determining the image information of the current block may include at least two methods: Method 1: Obtain the image information of the current block by decoding the bitstream. For example, the encoding end encodes the image information of the current block into the bitstream, and the decoding end obtains the image information of the current block by decoding the bitstream. Method 2: Determine the template image information of the current block; based on the template image information of the current block, determine the image information of the current block. Since the template of the current block has been decoded, the template image information of the current block is available. For example, the reconstructed values ​​of the template of the current block can be analyzed to obtain the template image information of the current block. Then, based on the template image information of the current block, obtain the image information of the current block. For example, the template image information of the current block can be used as the image information of the current block, or the template image information of the current block can be processed to obtain the image information of the current block. Following the steps outlined above, the decoder determines J prediction modes, F weighted derived modes, and W transition parameters. Based on these J prediction modes, F weighted derived modes, and W transition parameters, it then forms H different third combinations. Next, based on these H third combinations, a second candidate combination list is determined. From this second candidate combination list, the first weighted derived mode, K first prediction modes, and the second transition parameters are then determined. In some embodiments, to further improve the construction speed of the second candidate combination list, the decoding end further filters the J prediction modes, F weighted derived modes, and W transition parameters determined above. At this time, the steps in S102-C11-2 above, which form H third combinations based on the determined F weighted derived modes, J prediction modes, and W transition parameters, include the following steps S102-C11-21 to S102-C11-24: S102-C11-21. Select E weight derivation patterns from F weight derivation patterns, where E is a positive integer less than or equal to F. Specifically, from the F weight derivation patterns determined above, weight derivation patterns with low occurrence probability are removed to obtain E weight derivation patterns after filtering. Among them, the methods for selecting E weight derivation patterns from F weight derivation patterns in S102-C11-21 above include, but are not limited to, the following: Method 1: For the i-th weighted derived mode among the F weighted derived modes, determine the weights of the K second prediction modes on the template based on the i-th weighted derived mode and the third transition parameter. The third transition parameter is any transition parameter among the W transition gradients, and the K second prediction modes are any K prediction modes among the J prediction modes, where i is a positive integer from 1 to F. If the weight of any prediction mode among the K prediction modes on the template is less than the first preset value, then remove the i-th weighted derived mode from the F weighted derived modes to obtain E weighted derived modes. In this method 1, the method of determining the weights of the K second prediction modes on the template based on the i-th weighted derived mode and the third transition parameter includes at least the following examples: Example 1: When using the i-th weight export mode to export template weights, multiple intermediate variables need to be determined. A third transition parameter can be used to adjust one or more of these intermediate variables, and then the adjusted variables can be used to export the template weights. Example 2: Based on the i-th weight, derive the pattern and template, and determine the fourth weight corresponding to the template; use the third transition parameter to adjust the fourth weight to obtain the adjusted fourth weight; based on the adjusted fourth weight, determine the weights of the K second prediction patterns on the template. For example, based on the i-th weight derived pattern and template, the fourth weight corresponding to the template is determined as weightIdx. Then, the third transition parameter is used to adjust weightIdx to obtain the adjusted weightIdx. Then, based on the adjusted weightIdx, the weight wVemplateValue of the template is determined. In one example, weightIdx can be adjusted using the third transition parameter according to the following formula to obtain the adjusted weightIdx: weightIdx=weightIdx*blendingCoeff3 Among them, blendingCoeff3 is the third transition parameter. For example, based on the i-th weight derived pattern and template, the fourth weight corresponding to the template is determined to be wVemplateValue. Then, the third transition parameter is used to adjust wVemplateValue to obtain the adjusted wVemplateValue, and the adjusted wVemplateValue is determined as the weight of the template. In one example, wVemplateValue can be adjusted using the third transition parameter according to the following formula to obtain the adjusted wVemplateValue: wVemplateValue=wVemplateValue*blendingCoeff3 Based on the above method, the weights of the K second prediction modes on the template are derived from the i-th weight mode. Method 2: For the i-th weight export mode among the F weight export modes, determine the cost of using the i-th weight export mode to predict the template, where i is a positive integer from 1 to F; based on the cost corresponding to the i-th weight export mode, select E weight export modes from the F weight export modes. In some embodiments, when determining the cost corresponding to the i-th weight derivation mode, the influence of transition parameters on the weights is not considered. In some embodiments, determining the cost corresponding to the i-th weighted derivation pattern includes the influence of transition parameters on the weights. That is, the template weights are determined based on the i-th weighted derivation pattern and the transition parameters. Then, the template prediction value is determined based on the template weights and the K predicted values ​​of the template. Finally, the cost corresponding to the i-th weighted derivation pattern is determined based on the template prediction value and the reconstructed value. The specific process of determining the template weights based on the i-th weighted derivation pattern and the transition parameters can be referred to the description in the above embodiments, and will not be repeated here. In some embodiments, the method of selecting S weight derivation modes from P weight derivation modes as described in S102-A11-21 above, and the method of selecting E weight derivation modes from F weight derivation modes, can also be referred to. For details, please refer to the description of the above embodiments, and will not be repeated here. Based on the above steps, after the decoding end selects E weight export modes from F weight export modes, it executes the following steps S102-C11-22. S102-C11-22. Select V prediction patterns from J prediction patterns, where V is a positive integer less than or equal to J. The embodiments of this application do not limit the method of selecting V prediction modes from J prediction modes. In some embodiments, V preset prediction modes are selected from J prediction modes. In some embodiments, for the i-th prediction mode among the J prediction modes, the decoder determines the cost of using the i-th prediction mode to predict the template, where i is a positive integer from 1 to J; based on the cost corresponding to the i-th prediction mode, V prediction modes are selected from the J prediction modes. In this embodiment, the weighted derivation mode, K prediction modes, and transition parameters are combined as a single unit for cost calculation. Thus, for ease of calculation, given the weighted derivation mode, the other K-1 prediction modes, and transition parameters, the cost of J weighted derivation modes is calculated. That is, the J prediction modes are combined with the set weighted derivation mode, K-1 prediction modes, and transition parameters respectively to obtain J combinations. The cost corresponding to each of these J combinations is calculated to obtain the cost of the J prediction modes. Based on the above method, after determining the cost corresponding to the i-th prediction mode among the J prediction modes, V prediction modes are selected from the J prediction modes according to the cost corresponding to the i-th prediction mode. The decoding end selects V prediction modes from J prediction modes based on the cost corresponding to the i-th prediction mode, including the following methods: In the first approach, if the cost corresponding to the i-th prediction mode is less than the fourth preset value, then a prediction mode similar to the i-th prediction mode is selected from the J prediction modes. Based on the i-th prediction mode and the similar prediction modes of the i-th prediction mode, V prediction modes are determined. Here, a prediction mode similar to the i-th prediction mode can be understood as a prediction mode whose prediction result is similar (or close) to the prediction reception of the i-th prediction mode. For example, a prediction mode whose prediction direction (or angle) is close to the prediction direction (or angle) of the i-th prediction mode, or a prediction mode whose prediction mode index is close to the index of the i-th prediction mode. For example, a prediction mode whose index is 1 or 2 larger than the index of the i-th prediction mode, or a prediction mode whose index is 1 or 2 smaller than the index of the i-th prediction mode. In the second approach, if the cost corresponding to the i-th prediction mode is greater than the fifth preset value, then the i-th prediction mode and its similar prediction modes are removed from the J prediction modes to obtain at least one prediction mode after removal; based on the at least one prediction mode after removal, V prediction modes are determined. Based on the above steps, select E weighted export patterns from F weighted export patterns, select V prediction patterns from J prediction patterns, and then execute S102-C11-23 as follows. S102-C11-23. Select O transition parameters from W transition parameters, where O is a positive integer less than or equal to W. In some embodiments, if O equals W, then the W transition parameters are determined to be O transition parameters. In some embodiments, if W is greater than 0, then the W transition parameters are filtered to obtain O transition parameters. Among them, the methods to filter W transition parameters to obtain O transition parameters include at least the following: Example 1: Determine the cost of each of the W transition parameters, and select the top O transition parameters with the lowest costs from the W transition parameters. For example, for the i-th transition parameter among W transition parameters, the i-th transition parameter is combined with weighted derivation mode 1, prediction mode 1, and prediction mode 2 to form a combination. This combination is used to predict the template of the current block, obtaining the predicted value of the template. For instance, a weight is determined based on weighted derivation mode 1, and this weight is adjusted using the i-th transition parameter to obtain the adjusted weight. Prediction mode 1 and prediction mode 2 are used to predict the template respectively, obtaining two predicted values ​​for the template. These two predicted values ​​are then weighted using the adjusted weight to obtain the template predicted value corresponding to the i-th transition parameter. Next, based on the reconstructed value of the template and the template predicted value corresponding to the i-th transition parameter, the cost corresponding to the i-th transition parameter is determined. Referring to the above method, the cost corresponding to each of the W transition parameters and the combination formed by weighted derivation mode 1, prediction mode 1, and prediction mode 2 can be determined. Then, based on the cost, O transition parameters are selected from the W transition parameters. For example, the O transition parameters with the lowest cost among the W transition parameters are selected. Example 2: If the above W transition parameters are not determined by the image information of the current block, then this embodiment of the application can also determine the image information of the current block; based on the image information of the current block, determine O transition parameters from the W transition parameters. This application does not limit the specific content of the image information of the current block, such as blurriness, clarity, sharpness, etc. In some embodiments, if the image information of the current block includes the sharpness of the image edges, then based on the image information of the current block, O transition parameters are determined from W transition parameters, including two examples: In one example, if the sharpness of the image edge of the current block is less than a preset value, then at least one of the W transition parameters of the first type is determined as O transition parameters. In another example, if the sharpness of the image edge of the current block is greater than or equal to the preset value, then at least one of the second type of transition parameters among the W transition parameters is determined as O transition parameters. In some embodiments, the O transition parameters are selected from W transition parameters based on the size of the current block. In one possible implementation, based on the size of the current block, the transition parameters that are greater than or equal to the third value among the W transition parameters are taken as O transition parameters. For example, if the size of the current block is less than the second set threshold, then the transition parameter with the third value among the W transition parameters will be used as one of the O transition parameters. For example, if the size of the current block is greater than or equal to the second set threshold, then the transition parameters less than or equal to the fourth value among the W transition parameters are taken as O transition parameters, where the fourth value is less than the third value. The embodiments of this application do not impose restrictions on the specific values ​​of the second set threshold, the third value, and the fourth value. Optional, the third value is 1, and the fourth value is 1 / 2. Optionally, if the size of the current block is represented by the number of pixels in the current block, then the second threshold setting is 256, etc. In another possible implementation, based on the size of the current block, the O transition parameters are determined to be at least one of the W transition parameters that falls within a certain value range. For example, if the size of the current block is less than the second set threshold, then the O transition parameters are determined to be one or more transition parameters that fall within the range of the third transition parameter among the W transition parameters. For example, if the size of the current block is greater than or equal to the second set threshold, then the O transition parameters are determined to be one or more transition parameters within the range of the fourth transition parameter among the W transition parameters, wherein the minimum value of the range of the fourth transition parameter is less than the minimum value of the range of the third transition parameter. In this embodiment of the application, there are no restrictions on the specific values ​​of the third transition parameter and the fourth transition parameter. Optionally, the values ​​of the third transition parameter and the fourth transition parameter intersect, or alternatively, they do not intersect. After selecting E weighted derivation modes from F weighted derivation modes, V prediction modes from J prediction modes, and O transition parameters from W transition parameters, execute the following S102-C11-24. S102-C11-24. Based on E weighted derived modes, V prediction modes, and O transition parameters, H third combinations are formed. Specifically, select one weighted derived pattern from E weighted derived patterns, select K prediction patterns from V prediction patterns, and finally select one transition parameter from O transition parameters. This weighted derived pattern, K prediction patterns, and one transition parameter form a third combination. Repeat this step to obtain H third combinations. As can be seen from the above, a third combination includes a weighted derivation pattern, K prediction patterns and a transition parameter, that is, a third combination includes K+2 elements. In this way, when selecting an element, the other elements in a combination can be fixed while the possible selection of another element is limited. The following section uses the process of selecting another prediction mode when the weighted derivation mode, transition parameters, and one prediction mode are fixed as an example to introduce one implementation process of the above S102-C11-2. In some embodiments, S102-C11-2 includes: for the f-th weight-derived mode among F weight-derived modes and the o-th transition parameter among O transition parameters, determining the cost of using the f-th weight-derived mode, the o-th transition parameter, and the j-th prediction mode among J prediction modes to predict the template, where f is a positive integer less than or equal to F, o is a positive integer less than or equal to O, and j is a positive integer less than or equal to J; if the cost corresponding to the combination of the f-th weight-derived mode, the o-th transition parameter, and the j-th prediction mode is greater than a sixth preset value, then removing the j-th prediction mode and similar prediction modes of the j-th prediction mode from the J prediction modes to obtain at least one prediction mode after removal; and constructing H third combinations based on the f-th weight-derived mode, the o-th transition parameter, and at least one prediction mode after removal. In this embodiment, when the weighted derivation mode, transition parameters, and one prediction mode are fixed, another prediction mode is selected. For example, if under a certain weighted derivation mode and transition parameters, a certain intra-prediction mode cannot achieve a relatively low cost as the first prediction mode, then the case where an intra-prediction mode similar to that intra-prediction mode under that weighted derivation mode and transition parameters is no longer tried as the first prediction mode. Specifically, assuming K=2, consider the f-th weight derivation mode out of F weight derivation modes and the o-th transition gradient parameter out of O transition parameters. Assume the second prediction mode is set as prediction mode 1, which can be one of the J prediction modes or another prediction mode outside the J prediction modes. The possible selection of the first prediction mode from the J prediction modes is determined by taking the j-th prediction mode as the first prediction mode. Then, when the combination j (f-th weight derivation mode, o-th transition gradient parameter, j-th prediction mode, and prediction mode 1) is used to predict the template, the predicted value of the template is determined. Based on this predicted value, the cost corresponding to combination j is determined, and the cost corresponding to combination j is set as the cost corresponding to the j-th prediction mode. Next, it is determined whether the cost corresponding to the j-th prediction mode is greater than the sixth preset value. If the cost corresponding to the j-th prediction mode is greater than the sixth preset value, it means that the combination of the j-th prediction mode with the f-th weight derivation mode, the o-th transition gradient parameter, and prediction mode 1 cannot achieve accurate template prediction. In this case, the j-th prediction mode is removed from the J prediction modes. Since prediction modes similar to the j-th prediction mode have similar characteristics, similar prediction modes are removed from the J prediction modes, resulting in a set of removed prediction modes. From the set of removed prediction modes, a new prediction mode is selected as the new j-th prediction mode, and the above steps are repeated to obtain the final set of removed prediction modes corresponding to the f-th weight derivation mode and the o-th transition parameter. Based on the above steps, the set of predicted modes after final elimination for each weighted derived mode and the transition parameter can be determined among the F weighted derived modes. Thus, based on the F weighted derived modes and their respective sets of predicted modes after final elimination, H third combinations can be constructed. It should be noted that the above embodiments illustrate a method of filtering prediction modes in a combination. Optionally, any one of the weighted derived modes and transition parameters can also be filtered in a combination to finally construct H third combinations. After determining H third combinations using the methods described above, the decoder uses the weighted derived mode, transition parameters, and K prediction modes in any of the H third combinations to predict the template and obtain the template prediction value corresponding to the third combination. The following describes an implementation process in one embodiment of this application, in which any third combination is used to predict the template of the current block to obtain the predicted value of the template. In this embodiment of the application, for any third combination, the template is predicted according to the weighted derivation mode, transition parameters and K prediction modes included in the third combination, so as to obtain the template prediction value corresponding to the third combination. This application does not limit the specific implementation of predicting the template based on the weighted derivation mode, transition parameters, and K prediction modes included in the third combination to obtain the template prediction value corresponding to the third combination. For example, firstly, a prediction value of the template is determined based on the weighted derivation mode and K prediction modes included in the third combination, and then the template prediction value corresponding to the third combination is obtained based on the transition parameters and the determined template prediction value. In some embodiments, the weights of the template can be determined using the weighted derivation modes and transition parameters included in the third combination. Then, K template prediction values ​​are determined based on the K prediction modes included in the third combination. Based on the template weights and the K template prediction values, the template prediction value corresponding to the third combination is determined. In some embodiments, determining template weights based on the weight derivation mode includes the following steps: Step 1: Determine the angle index and distance index based on the weighted export mode; Step 2: Determine the template weight based on the angle index, distance index, transition parameters, and template size. This application can derive template weights in the same way as deriving the weights of the predicted values. For example, firstly, based on the weight deriving mode, the angle index and distance index are determined, where the angle index can be understood as the boundary angle index of each weight derived by the weight deriving mode. For instance, according to Table 2 above, the angle index and distance index corresponding to the weight deriving mode can be determined; for example, if the weight deriving mode is 27, then the corresponding angle index is 12 and the distance index is 3. Next, the template weights are determined based on the angle index, distance index, and the size of the template. In step 2 above, the methods for determining the template weight based on the angle index, distance index, and template size include, but are not limited to, the following: Method 1: Determine the template weight based on the angle index, distance index, transition parameters, and template size. In this case, step 2 above includes steps 21 to 23 as follows: Step 21: Determine the first parameter of the pixels in the template based on the angle index, distance index, and template size; Step 22: Determine the weight of the pixels in the template based on the first parameter and transition parameter of the pixels in the template; Step 23: Determine the template weight based on the weight of each pixel in the template. In this implementation, the weights of pixels in the template are determined based on the angle index, distance index, template size, and current block size. Then, the weight matrix composed of the weights of each point in the template is determined as the template weight. The first parameter of this application is used to determine the weight. In some embodiments, the first parameter is also referred to as the weight index. In some embodiments, the first parameter can be understood as the third weight and the fourth weight corresponding to the template in the above embodiments. In one possible implementation, the offset and the first parameter can be determined as follows: The inputs for the template weight derivation process are as follows: as shown in Figure 17, the width nCbW of the current block, the height nCbH of the current block; the width nVmW of the left template, the height nVmH of the upper template; the angleId of the GFM "division" angle index variable; the distanceIdx of the GFM distance index variable; and the cIdx of the component index variable. For example, this application takes the luminance component as an example, so cIdx is 0, which represents the luminance component. The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are exported 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 encoding / decoding process. 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 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., 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 cases where x and y are both greater than or equal to 0) is derived as follows, with the top-left corner of the current block as (0, 0): – Variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*EubWidthC yL=(cIdx==0)? y:y*EubHeightC disLut is determined according to Table 3 above. The first parameter, weightIdx, is derived as follows: weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+ (((yL+offsetY)<<1)+1)*disLut[displacementY] In some embodiments, after determining the first parameter weightIdx according to the above method, the first parameter is then adjusted using a transition parameter to obtain the adjusted first parameter. In one example, the first parameter is adjusted using the following formula: weightIdx=weightIdx*blendingCoeff Here, blendingCoeff is a transition parameter. Next, based on the adjusted first parameter, the methods for determining the weights of pixels in the template include, but are not limited to, the following: Method 1: Determine the second parameter of the pixel in the template based on the adjusted first parameter of the pixel in the template; determine the weight of the pixel in the template based on the second parameter of the pixel in the template. The second parameter is also used to determine the weight. In some embodiments, the second parameter is also referred to as the weight index under the first component, which can be a luminance component, a chrominance component, etc. For example, the weights of pixels in the template are determined according to the formula: weightIdxL=partFlip? 32+weightIdx:32-weightIdx wVemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3) Where wVemplateValue[x][y] is the weight of the template midpoint (x, y), weightIdxL is the second parameter of the template midpoint (x, y), also known as the weight index under the first component (e.g., the luminance component), and partFlip is an intermediate variable determined according to the angle index angleIdx, for example, as mentioned 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, and when partFlip is 1, weightIdxL is 32 + weightIdx. It should be noted that 32 here is just an example, and this application is not limited to this. Method 2: Determine the weight of the pixels in the template based on the adjusted first parameter, first threshold and second threshold of the pixels in the template. To reduce the computational complexity of template weights, Method 2 limits the weights of pixels in the template to either a first threshold or a second threshold. In other words, the weights of pixels in the template are either the first threshold or the second threshold, thereby reducing the computational complexity of template weights. This application does not impose any restrictions on the specific values ​​of the first threshold and the second threshold. Optionally, the first threshold is 1. Optionally, the second threshold is 0. In one example, the weights of pixels in the template can be determined using the following formula: wVemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0 Where wVemplateValue[x][y] is the weight of the midpoint (x, y) of the template, and the 1 in the above "1:0" is the first threshold and the 0 is the second threshold. In the first method described above, the weight of each point in the template is determined by the weight derivation mode, and the weight matrix composed of the weights of each point in the template is used as the template weight. Method 2 involves determining the weights of the current block and the template based on the weight export mode. In other words, in this method, the merged region consisting of the current block and the template is treated as a whole, and the weights of the pixels within the merged region are exported according to the weight export mode. Therefore, step 2 above includes the following steps 2-1 and 2-2: Step 2-1: Determine the weights of pixels in the merged region composed of the current block and the template based on the angle index, distance index, transition parameters, template size, and current block size; Step 2-2: Determine the template weight based on the size of the template and the weight of the pixels in the merged region. In this second method, the current block and the template are treated as a whole. The weights of the pixels in the merged region composed of the current block and the template are determined based on the angle index, distance index, transition parameters, and the size of the template and the current block. Then, based on the size of the template, the weights corresponding to the template in the merged region are determined as template weights. For example, as shown in Figure 17, the weights corresponding to the L-shaped template region in the merged region are determined as template weights. This application does not limit the specific implementation of determining the weights of pixels in the merged region composed of the current block and the template based on the angle index, distance index, transition parameters, template size, and current block size. In some embodiments, determining the weights of pixels in the merged region in step 2-1 above includes the following steps 2-11 to 2-12: Step 2-11: Determine the first parameter of the pixels in the merged region based on the angle index, distance index, and size of the merged region; Step 2-12: Determine the weight of the pixels in the merged region based on the first parameter and transition parameter of the pixels in the merged region. In this implementation, the weights of pixels in the merged region are determined based on the angle index, distance index, transition parameters, and the size of the merged region, forming a weight matrix composed of the weights of each point in the merged region. In one possible implementation, the offset and the first parameter can be determined as follows: The inputs for the merged region weight derivation process are as follows: as shown in Figure 17, the width nCbW of the current block, the height nCbH of the current block; the width nVmW of the left template, the height nVmH of the upper template; the angleId of the GFM "division" angle index variable; the distanceIdx of the GFM distance index variable; and the cIdx of the component index variable. For example, this application takes the luminance component as an example, so cIdx is 0, which represents the luminance component. The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are exported 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 encoding / decoding process. 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 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., shiftHor is 1): offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3) offsetY = (-nH) >> 1 The weight matrix wValueMatrix[x][y] of the pixels in the merged region (where x = -nVmW..nCbW–1, y = -nVmH..nCbH–1) is derived as follows, with the top-left corner of the current block as (0, 0): – Variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*EubWidthC yL=(cIdx==0)? y:y*EubHeightC disLut is determined according to Table 3. The first parameter, weightIdx, is derived as follows: weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+ (((yL+offsetY)<<1)+1)*disLut[displacementY] In some embodiments, after determining the first parameter weightIdx according to the above method, the first parameter is then adjusted using a transition parameter to obtain the adjusted first parameter. In one example, the first parameter is adjusted using the following formula: weightIdx=weightIdx*blendingCoeff Here, blendingCoeff is a transition parameter. Next, the weight at the center (x, y) in the merged region is determined based on the adjusted weightIdx. In this application, the methods for determining the weights of pixels in the merged region based on the adjusted first parameter of the pixels in the merged region in steps 2-12 above include, but are not limited to, the following: Method 1: Determine the second parameter of the pixels in the merged region based on the adjusted first parameter of the pixels in the merged region; determine the weight of the pixels in the merged region based on the second parameter of the pixels in the merged region. For example, the weights of pixels in the merged region are determined according to the formula: weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+ (((yL+offsetY)<<1)+1)*disLut[displacementY] weightIdxL=partFlip? 32+weightIdx:32-weightIdx wValueMatrix[x][y]=Clip3(0,8,(weightIdxL+4)>>3) Where wValueMatrix[x][y] is the weight of the point (x, y) in the merged region, weightIdxL is the second parameter of the point (x, y) in the merged region, and wVemplateValue[x][y] is the weight of the point (x, y) in the merged region. Method 2: Determine the weight of pixels in the merged region based on the adjusted first parameter, first threshold, and second threshold of the pixels in the merged region. For example, the weight of pixels in the merged region is either a first threshold or a second threshold. To reduce the computational complexity of the weights in the merged region, Method 2 limits the weights of pixels in the merged region to either a first threshold or a second threshold. In other words, the weights of pixels in the merged region are either the first threshold or the second threshold, thereby reducing the computational complexity of the weights in the merged region. This application does not impose any restrictions on the specific values ​​of the first threshold and the second threshold. Optionally, the first threshold is 1. Optionally, the second threshold is 0. In one example, the weights of pixels in the merged region can be determined using the following formula: wVemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0 Where wValueMatrix[x][y] represents the weight of the point (x, y) in the merged region, and the 1 in the above "1:0" represents the first threshold and the 0 represents the second threshold. In the second method described above, the weight of each point in the merged region composed of the current block and the template is determined by the weight derivation mode. Then, based on the size of the template, the weight corresponding to the template in the merged region is determined as the template weight. In this second method, the weight of the predicted value is determined at the same time, eliminating the need to perform the subsequent steps of determining the weight of the predicted value, thus reducing the prediction steps and improving the prediction efficiency. According to the above method, after determining the template weights corresponding to the weighted derivation modes included in the third combination, the K prediction modes in the third combination are used to predict the template to obtain K prediction values. The K prediction values ​​are then weighted according to the template weights to obtain the predicted values ​​of the template. The predicted value of the template can be understood as a matrix composed of the predicted values ​​of the pixels in the template. In some embodiments, the above-mentioned predicted values ​​are also referred to as predicted samples. Next, the cost of the third combination is determined based on the predicted and reconstructed values ​​of the template. The methods for determining the cost of the third combination mentioned above include, but are not limited to, the following: Method 1: Determine the cost of the third combination using a matrix approach. Specifically, based on the predicted and reconstructed values ​​of the template, determine a loss, which is denoted as the first loss. Since the predicted and reconstructed values ​​of the template are matrices, the first loss is also a matrix. For example, the absolute value of the difference between the predicted and reconstructed values ​​of the template can be determined as the first loss, and this first loss can be used as the cost of the third combination. Method 2: Use point-by-point calculation to determine the cost of the third combination. Specifically, for the i-th pixel in the template, when determining the prediction of each of the K prediction modes in the third combination at the i-th pixel, the template weight corresponding to the i-th pixel in the template weight is determined. Based on the template weight of the i-th pixel and the K prediction values ​​of the i-th pixel, the prediction value of the i-th pixel is obtained. Based on the prediction value and the reconstructed value of the i-th pixel, the cost of the third combination at the i-th pixel is obtained. According to this method, the prediction distortion cost of the third combination at each pixel in the template can be determined. Finally, the sum of the prediction distortion costs of the third combination at each pixel in the template is determined as the cost of the third combination. Based on the above method, the cost of each of the H third combinations can be determined. Next, based on the cost of each of the H third combinations, a list of second candidate combinations is constructed. For example, based on the cost of the third combination, the H third combinations are sorted in ascending order, and the sorted H third combinations are determined as the second candidate combination list. For example, based on the cost of the third combination, select the L third combinations with the smallest cost from the H third combinations to form a second candidate combination list. Optional, L can be 8, 16, or 32, etc. Based on the above method, a second candidate combination list is determined. Each second candidate combination in the second candidate combination list is sorted in ascending order of cost. For example, the second candidate combination list is shown in Table 8 above. In this way, the decoding end queries the second candidate combination corresponding to the first index in the second candidate combination list shown in Table 8 according to the first index, and determines the second candidate combination corresponding to the first index as the first combination. That is, the weight derivation mode included in the second candidate combination is determined as the first weight derivation mode, the K prediction modes included in the second candidate combination are determined as K first prediction modes, and the transition parameters included in the second candidate combination are determined as the second transition parameters. In case 2 above, taking the first combination including the first weighted derived mode, K first prediction modes and the second transition parameter as an example, the implementation process of S102 above will be introduced. Case 3: The first combination includes a first weighted derivation pattern and K first prediction patterns. The first weighted derivation pattern includes a fourth transition parameter, which is used to determine the weights, such as the weights for determining the predicted values ​​or the weights for the template. In case 3, the implementation methods of S102 above include, but are not limited to, the following: Method 1: The encoder and decoder determine the first combination corresponding to the first index from a set of preset third candidate combinations. For example, the preset set of third candidate combinations may include any number of third candidate combinations, such as 2, 3, 4, 5, 6, 7, 8, or 9. Assuming there are 8 third candidate combinations, each third candidate combination includes a weighted derived pattern and K prediction patterns. The weighted derived pattern includes a transition parameter, and these 8 third candidate combinations have different identifiers (or indices). Thus, after obtaining the first index, the decoder queries the set of third candidate combinations for the third candidate combination corresponding to the first index, determines the third candidate combination corresponding to the first index as the first combination, determines the weighted derived pattern included in that third candidate combination as the first weighted derived pattern, and determines the K prediction patterns included in that third candidate combination as the K first prediction patterns. Method 2: Both the decoding and encoding ends determine a list containing multiple third candidate combinations; therefore, this list is also called the third candidate combination list. The first combination corresponding to the first index is determined from this third candidate combination list. In this case, S102 above includes the following steps: S102-E, Determine the list of third candidate combinations; S102-F: Determine the weighted derived pattern and K prediction patterns included in the third candidate combination corresponding to the first index in the third candidate combination list as the first weighted derived pattern and K first prediction patterns. The aforementioned list of third candidate combinations includes multiple third candidate combinations. Each of the multiple third candidate combinations includes a weighted derivation mode and K prediction modes, wherein the weighted derivation mode includes a transition parameter. For example, the list of third candidate combinations is shown in Table 9: Table 9 As shown in Table 9, the list of third candidate combinations includes multiple third candidate combinations. No two third candidate combinations are completely identical, that is, at least one of the weighted derivation patterns and K prediction patterns included in any two third candidate combinations is different. For example, Table 9 above uses the order of the third candidate combination in the list of third candidate combinations as the index. Optionally, the index of the third candidate combination in the list of third candidate combinations can also be represented in other ways, and this application embodiment does not limit this. In this method 2, the decoding end decodes the bitstream to obtain the first index and determines the third candidate combination list as shown in Table 9 above. Based on the first index, the third candidate combination list is queried to obtain the first weighted derived mode and K prediction modes included in the first combination indicated by the first index. For example, if the first index is index 1, in the list of third candidate combinations shown in Table 9, the third candidate combination corresponding to index 1 is third candidate combination 2. That is, the first combination indicated by the first index is third candidate combination 2. In this way, the decoder determines the weighted derived mode and K prediction modes included in the third candidate combination 2 as the first weighted derived mode and K first prediction modes included in the first combination, and uses the fourth transition parameter included in the first weighted derived mode and K first prediction modes to predict the current block, thereby obtaining the predicted value of the current block. In this method 2, the encoder and decoder can each determine the same list of second candidate combinations. For example, both the encoder and decoder can determine a list containing multiple third candidate combinations, each of which includes one weighted derived mode and K prediction modes. In the bitstream, the encoder only needs to write the finally selected third candidate combination, such as the first combination. The decoder parses the first combination finally selected by the encoder. Specifically, the decoder decodes the bitstream, obtains the first index, and determines the first combination from the list of third candidate combinations determined by the decoder using the first index. This application does not limit the specific method by which the decoding end determines the above-mentioned third candidate combination list. In some embodiments, the aforementioned third candidate combination list is existing. After the decoding end obtains the first index from the decoded bitstream, it can obtain or read the third candidate combination list based on the first index, and then query the third candidate combination corresponding to the first index in the third candidate combination list based on the first index. In some embodiments, the aforementioned third candidate combination list is sent by the encoder to the decoder, for example, the encoder sends it to the decoder before encoding the current block. In some embodiments, the aforementioned third candidate combination list is uploaded to the cloud by the encoding end, and the decoding end reads the third candidate combination list from the cloud after decoding the bitstream and obtaining the first index. In some embodiments, the third candidate combination list is constructed by the decoding end. For example, after decoding the bitstream and obtaining the first index, the decoding end constructs the third candidate combination list in response to the first index. This application does not limit the method by which the decoding end constructs the third candidate combination list. For example, it can use information related to the current block to analyze the probability of each combination consisting of different prediction modes and different transition parameters, and construct the third candidate combination list based on the probability of each combination. Optionally, information related to the current block may include pattern information of surrounding blocks and reconstructed pixels of the current block. In some embodiments, the decoding end constructs a third candidate combination list through the following steps S102-E1: S102-E1: Based on the template of the current block, construct a third candidate combination list. The template of the current block consists of the reconstructed area around the current block and is related to the current block. Based on this, the embodiments of this application construct a third candidate combination list based on the template of the current block. For example, for each combination, the template of the current block is predicted using that combination to obtain the cost corresponding to each combination. Based on the cost corresponding to each combination, a third candidate combination list is constructed. For each combination, the template of the current block is predicted using that combination to obtain the cost corresponding to each combination. Then, based on the cost corresponding to each combination, a third candidate combination list is constructed. In some embodiments, S102-E1 includes the following steps S102-E11 to S102-E13: S102-E11. Determine A fourth combinations. Each of the A fourth combinations includes a weighted derived pattern and K prediction patterns. Furthermore, the weighted derived pattern and K prediction patterns included in any two of the A fourth combinations are not completely identical. A is a positive integer greater than 1. S102-E12. For any of the A fourth combinations, determine the weighted derivation mode and K prediction modes in the fourth combination to predict the template, and the cost corresponding to the fourth combination. S102-E13. Based on the cost corresponding to each of the A fourth combinations, construct a list of third candidate combinations. In this embodiment, when constructing the third candidate combination list, the decoding end first determines A fourth combinations. This application does not limit the specific value of the A fourth combinations, for example, 8, 16, 32, etc. Each of the A fourth combinations includes a weighted derived mode and K prediction modes. The weighted derived mode includes a transition parameter, and the weighted derived mode and K prediction modes included in any two of the A fourth combinations are not completely identical. Next, for each of the A fourth combinations, the cost corresponding to that fourth combination is determined when using the weighted derived mode and K prediction modes included in that fourth combination to predict the template of the current block. Finally, based on the cost corresponding to each of the A fourth combinations, the third candidate combination list is constructed. In some embodiments, when determining in S102-E12 above to use the weighted derived mode and K prediction modes in the fourth combination to predict the template, the cost corresponding to the fourth combination includes at least the following: Method 1, S102-E12 includes the following S102-E12-11 to S102-E12-14: S102-E12-11. Determine the weights of the template based on the weight derivation patterns included in the fourth combination. S102-E12-12. Based on the K prediction patterns in the fourth combination, the template is predicted to obtain the K predicted values ​​of the template. S102-E12-13. The K predicted values ​​of the template are weighted according to the template weights to obtain the template predicted value corresponding to the fourth combination. S102-E12-14. Determine the cost corresponding to the fourth combination based on the template prediction value and the template reconstruction value corresponding to the fourth combination. In this embodiment of the application, the process of determining the cost corresponding to each of the A fourth combinations is the same. For ease of description, we will use one of the A fourth combinations as an example for illustration. In this embodiment, the fourth combination includes a weighted derivation mode and K prediction modes. When using this fourth combination to predict a template, for example, the decoder can determine the template weights based on the weighted derivation mode included in the fourth combination, predict the template using the K prediction modes included in the fourth combination to obtain K predicted values ​​for the template, and then weight the K predicted values ​​using the template weights to obtain the template prediction value corresponding to the fourth combination. Finally, the cost corresponding to the fourth combination is determined based on the template prediction value corresponding to the fourth combination and the reconstructed template value. This application embodiment does not limit the specific method by which the template weights are determined according to the weight derivation mode included in the fourth combination in S102-E12-11 above. For example, the weight derivation mode in the fourth combination includes a transition parameter, therefore, the template weights can be determined according to this transition parameter. Method 2, S102-E12 includes the following S102-E12-11 to S102-E12-14: S102-E12-21. Based on the weighted derivation mode in the fourth combination, determine the template prediction values ​​corresponding to the K prediction modes in the fourth combination. S102-E12-22. Based on the template prediction values ​​and template reconstruction values ​​corresponding to the K prediction modes in the fourth combination, determine the costs corresponding to the K prediction modes in the fourth combination. S102-E12-23. Determine the cost of the fourth combination based on the costs corresponding to the K prediction modes in the fourth combination. For example, the sum of the costs corresponding to the K prediction modes in the fourth combination is determined as the cost of the fourth combination. For example, assuming K=2, the two prediction modes included in the fourth combination are denoted as prediction mode 1 and prediction mode 2. First, based on the weighted derivation modes included in the fourth combination, the template weight and predicted value corresponding to prediction mode 1 are determined. The predicted value corresponding to prediction mode 1 is then processed using the template weight. For example, for each pixel in the template corresponding to prediction mode 1, the predicted value of that pixel is multiplied by the template weight corresponding to that pixel to obtain the predicted value of that pixel. In this way, the template predicted value corresponding to prediction mode 1 can be determined. Next, based on the template predicted value and the template reconstruction value corresponding to prediction mode 1, the cost corresponding to prediction mode 1 is determined. The methods for determining the cost corresponding to prediction mode 1 include, but are not limited to, SAD, SATD, SEE, etc. Similarly, the cost corresponding to prediction mode 2 can be determined. Then, based on the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2, the cost corresponding to the fourth combination is determined. For example, the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2 are added together to determine the cost corresponding to the fourth combination. The methods for constructing the third candidate combination list based on the costs corresponding to each of the A fourth combinations in S102-E13 above include, but are not limited to, the following: Example 1: Sort the A fourth combinations according to the costs of each of the A fourth combinations; determine the A fourth combinations as the third candidate combination list. The second candidate combination list generated in Example 1 includes A third candidate combinations. Optionally, the A second candidate combinations in the third candidate combination list are sorted in ascending order of cost, that is, the costs corresponding to the A third candidate combinations in the third candidate combination list increase sequentially according to the sorting. Specifically, sorting the A fourth combinations based on the costs corresponding to each of the A fourth combinations can be done by sorting the A fourth combinations in ascending order of cost. Example 2: Based on the cost corresponding to the fourth combination, select B fourth combinations from A fourth combinations, and determine the list of these B fourth combinations as the third candidate combination list. Optionally, the above B fourth combinations are the top B fourth combinations with the lowest cost among the A fourth combinations. Optionally, the B third candidate combinations in the third candidate combination list are sorted in ascending order of cost, that is, the costs corresponding to the B third candidate combinations in the third candidate combination list increase sequentially according to the sorting. The process of determining A fourth combinations in S102-E11 above is described below. In some embodiments, the aforementioned A fourth combinations are preset. Each of the preset A fourth combinations is used to predict the template of the current block, obtaining a template prediction value corresponding to each fourth combination. Then, based on the template prediction value and the reconstructed template value, the cost corresponding to each fourth combination is determined. Based on the cost of each fourth combination, the A fourth combinations are sorted, and the sorted A fourth combinations are used as a third candidate combination list. Alternatively, B fourth combinations with the lowest costs are selected from the sorted A fourth combinations to form a third candidate combination list. In some embodiments, S102-E11 includes the following steps: S102-E11-1. Determine C weighted derived patterns and D prediction patterns, where C is a positive integer and D is a positive integer greater than or equal to K; S102-E11-2. Based on C weighted derived patterns and D prediction patterns, construct A fourth combinations. Any of the A fourth combinations includes one weighted derived pattern from the C weighted derived patterns and K prediction patterns from the D prediction patterns. In this embodiment, the decoding end first determines C weighted derivation modes and D prediction modes, and then constructs A fourth combination based on the determined C weighted derivation modes and D prediction modes. The embodiments of this application do not limit the specific number of the above-mentioned C weighted derivation modes and D prediction modes. Assuming K=2, the above K prediction modes include the first prediction mode and the second prediction mode. Assuming there are D possible prediction modes in total, the first prediction mode has D possible prediction modes. Since the second prediction mode is different from the first prediction mode, the second prediction mode has D-1 possible prediction modes. Assuming there are C possible weight derivation modes, this application may use any two different prediction modes, any weight derivation mode, and any transition gradient coefficient to form a fourth combination, for a total of C*D*(D-1) possible fourth combinations. In this implementation, the C weighted derived modes represent all possible weighted derived modes, each including transition parameters. In other words, the C weighted derived modes encompass all possible transition parameters. The D prediction modes represent all possible prediction modes, obtained through an exhaustive method to determine all possible fourth combinations. Each of these fourth combinations is used to predict the template for the current block, calculating the distortion cost for each fourth combination. Based on the distortion cost of each fourth combination, a list of third candidate combinations corresponding to the current block is obtained. In some embodiments, in order to reduce the amount of data and improve the construction speed of the second candidate combination list, not every prediction mode is tried, but only some prediction modes are selected for trying. At this point, the methods for determining the D prediction modes in S102-E11-1 above include, but are not limited to, the following: Method 1: The D prediction models are preset prediction models. Method 2: Determine at least one of the following for the current block: a list of third candidate prediction modes, a list of third alternative prediction modes corresponding to the K prediction modes, and a prediction mode corresponding to the weight-derived mode. The list of third candidate prediction modes includes multiple third candidate prediction modes, and the list of third alternative prediction modes corresponding to any of the K prediction modes includes at least one third alternative prediction mode. Based on the list of third candidate prediction modes, the list of third alternative prediction modes corresponding to the K prediction modes, and at least one prediction mode corresponding to the weight-derived mode, determine D prediction modes. The methods for determining the list of third candidate prediction modes for the current block include at least the following examples: Example 1: Determine a list of third candidate prediction modes based on the prediction modes used by at least one block adjacent to the current block. Example 2: If the preset mode is not included in the third candidate prediction mode list, then determine the preset mode corresponding to the current block; add the preset mode to the third candidate prediction mode list. In one example, the aforementioned preset mode is a set of preset prediction modes. In another example, the image type corresponding to the current block is determined, and a preset mode is determined based on the image type corresponding to the current block. For example, if the image type corresponding to the current block is B type or P type, the preset mode includes at least one of DC, horizontal mode, vertical mode and angle mode. Example 3: Determine the image type corresponding to the current block, and based on the image type, determine the third candidate prediction mode list. For example, if the image type corresponding to the current block is type B or type P, then at least one of DC (horizontal mode), vertical mode, and some angle modes can be added to the third candidate prediction mode list. As another example, if the image type corresponding to the current block is type I, then at least one of DC (horizontal mode) and vertical mode can be added to the third candidate prediction mode list. In this embodiment of the application, the specific implementation of the second method is described in the specific description of method two in S102-A11-1 above, and will not be repeated here. The process of determining the C weight derivation modes in S102-E11-1 is described below. In some embodiments, the above C weight derivation modes are preset. In some embodiments, the aforementioned C weighted export modes are selected from a preset plurality of weighted export modes, for example, based on information such as the size of the current block and / or the image type corresponding to the current block, to obtain C weighted export modes. Optionally, C weighted export modes with lower costs can also be selected from the preset plurality of weighted export modes based on the cost. In some embodiments, X transition parameters are determined, and C weighted derivation modes are determined based on the X transition parameters. This application does not limit the relationship between X and C. In this embodiment, since each of the C weight derivation patterns includes a transition parameter, the C weight derivation patterns can be determined based on X transition parameters. For example, if a weight derivation pattern includes other parameters besides the transition parameter, then at least one or two of the C weight derivation patterns may include the same or different transition parameters. Therefore, the C weight derivation patterns can be determined based on the X transition parameters. For instance, by using multiple different weight derivation patterns composed of X transition parameters, the cost corresponding to each of these multiple different weight derivation patterns can be determined, and then the C weight derivation patterns with the lowest cost can be selected. The embodiments of this application do not limit the specific method of determining the X transition parameters as described above. In some embodiments, the above X transition parameters are preset transition parameters, such as 1 / 4, 1 / 2, 1, 2, 4, etc. In some embodiments, X transition parameters are determined based on the current block size. For example, if the size of the current block is less than the third set threshold, then at least one preset transition parameter that is greater than or equal to the fifth value will be used as X transition parameters. For example, if the size of the current block is greater than or equal to the third set threshold, then at least one transition parameter less than or equal to the sixth value is used as X transition parameters, where the sixth value is less than the fifth value. For example, if the size of the current block is greater than or equal to the third set threshold, then at least one transition parameter less than or equal to the sixth value is used as X transition parameters, where the sixth value is less than the fifth value. For example, if the size of the current block is less than the third set threshold, then X transition parameters are determined to be at least one preset transition parameter that is within the range of the fifth transition parameter. For example, if the size of the current block is greater than or equal to the third set threshold, then X transition parameters are determined to be one or more transition parameters that are at least one transition parameter within the range of the sixth transition parameter, and the minimum value of the range of the sixth transition parameter is less than the minimum value of the range of the fifth transition parameter. The embodiments of this application do not impose restrictions on the specific values ​​of the third set threshold, the fifth value, the sixth value, the range of the fifth transition parameter, and the range of the sixth transition parameter. Optionally, if the size of the current block is represented by the number of pixels included in the current block, then the third threshold is set to 256. Optional, the fifth value is 1. Optional, the sixth value is 1 / 2. In some embodiments, image information of the current block is determined; based on the image information of the current block, X transition parameters are determined. Example 1: If the image edge sharpness of the current block is less than the preset value, then at least one of the preset Y transition parameters of the third type will be determined as X transition parameters, where Y is a positive integer greater than X. Among them, the third type of transition parameter can be understood as a transition parameter that can form a wider transition region, such as 1 / 4, 1 / 2, etc. Example 2: If the image edge sharpness of the current block is greater than or equal to a preset value, then at least one of the Y transition parameters of the fourth type is determined as X transition parameters, and the fourth type of transition parameter is greater than the third type of transition parameter. Among them, the fourth type of transition parameter can be understood as a transition parameter that can form a narrower transition region, such as 2, 4, etc. Following the steps outlined above, the decoder determines D prediction modes, C weighted derived modes, and W transition parameters. Based on these D prediction modes and C weighted derived modes, it forms A different fourth combinations. Next, based on these A fourth combinations, a third candidate combination list is determined, and from this third candidate combination list, the first weighted derived mode and K first prediction modes are determined. In some embodiments, to further improve the construction speed of the third candidate combination list, the decoding end filters the D prediction modes and C weighted derivation modes determined above. At this time, the steps in S102-E11-2 above, which form A fourth combinations based on the determined C weighted derivation modes and D prediction modes, include the following steps S102-E11-21 to S102-E11-24: S102-E11-21. Select C1 weight derivation patterns from the C weight derivation patterns, where C1 is a positive integer less than or equal to C. The specific implementation process of S102-E11-21 can be referred to the description of S102-A11-21 above, and will not be repeated here. Based on the above steps, after the decoding end selects C1 weight export modes from C weight export modes, it executes the following steps S102-E11-22. S102-E11-22. Select D1 prediction patterns from D prediction patterns, where D1 is a positive integer less than or equal to D. The specific implementation process of S102-E11-22 can be referred to the description of S102-A11-22 above, and will not be repeated here. Based on the above steps, select C1 weighted export patterns from C weighted export patterns and D1 prediction patterns from D prediction patterns. Then, execute the following S102-E11-23. S102-C11-23. Based on C1 weighted derivation patterns and D1 prediction patterns, form A fourth combinations. The specific implementation process of S102-E11-23 can be referred to the description of S102-A11-23 above, and will not be repeated here. The following describes an implementation process in one embodiment of this application, in which any fourth combination is used to predict the template of the current block to obtain the predicted value of the template. First, the weights of the template are determined using the weight derivation pattern included in the fourth combination. In some embodiments, determining template weights based on the weight derivation mode includes the following steps: Step 3: Determine the angle index, distance index, and transition parameters based on the weighted export mode; Step 4: Determine the template weight based on the angle index, distance index, transition parameters, and template size. This application can derive template weights in the same way as deriving the weights of the predicted values. For example, first, parameters such as angle index, distance index, and transition parameters are determined according to the weight deriving mode. In step 2 above, the methods for determining the template weight based on the angle index, distance index, transition parameters, and template size include, but are not limited to, the following: Method 1: Determine the template weight based on the angle index, distance index, transition parameters, and template size. In this case, step 4 above includes steps 41 to 43 as follows: Step 41: Determine the first parameter of the pixels in the template based on the angle index, distance index, and template size; Step 42: Determine the weight of the pixels in the template based on the first parameter and transition parameter of the pixels in the template; Step 43: Determine the template weight based on the weight of each pixel in the template. In this implementation, the weights of pixels in the template are determined based on the angle index, distance index, template size, and transition parameters. Then, the weight matrix composed of the weights of each point in the template is determined as the template weight. The first parameter of this application is used to determine the weight. In some embodiments, the first parameter is also referred to as the weight index. In one possible implementation, the offset and the first parameter can be determined as follows: The inputs for the template weight derivation process are as follows: as shown in Figure 17, the width nCbW of the current block, the height nCbH of the current block; the width nVmW of the left template, the height nVmH of the upper template; the angleId of the GFM "division" angle index variable; the distanceIdx of the GFM distance index variable; and the cIdx of the component index variable. For example, this application takes the luminance component as an example, so cIdx is 0, which represents the luminance component. The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are exported 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 encoding / decoding process. 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 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., 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 cases where x and y are both greater than or equal to 0) is derived as follows, with the top-left corner of the current block as (0, 0): – Variables xL and yL are derived as follows: xL=(cIdx==0)? x:x*EubWidthC yL=(cIdx==0)? y:y*EubHeightC disLut is determined...

Claims

1. A video decoding method, characterized in that... In, including : Decode the bitstream to obtain a first index, which indicates a first combination. The first combination includes a weighted derived mode and K prediction modes, where K is a positive integer greater than 1. ; Based on the first index, determine the first weighted derived pattern and K first prediction patterns included in the first combination. ; The current block is predicted based on the first weighted derivation mode and the K first prediction modes to obtain the predicted value of the current block. 。 2. The method according to claim 1, wherein its features The feature is that, based on the first index, determining the first weighted derived pattern and K first prediction patterns included in the first combination includes: Determine a first candidate combination list, which includes multiple first candidate combinations, and any one of the multiple first candidate combinations includes a weighted derived pattern and K prediction patterns; The weighted derivation mode and K prediction modes included in the first candidate combination corresponding to the first index in the first candidate combination list are determined as the first weighted derivation mode and the K first prediction modes. model.

3. The method according to claim 1 or 2, The feature is that the step of predicting the current block based on the first weighted derivation mode and the K first prediction modes to obtain the predicted value of the current block includes: Determine the first transition parameter; The current block is predicted based on the first transition parameter, the first weighted derivation mode, and the K first prediction modes to obtain the current block. The predicted value.

4. The method according to claim 3 The method, characterized in that, the step of predicting the current block based on the first transition parameter, the first weighted derivation mode, and the K first prediction modes to obtain the predicted value of the current block includes: The weights of the predicted values ​​are determined based on the first transition parameters and the first weight derivation mode. Based on the K first prediction patterns, the current block is predicted to obtain K prediction values; The K predicted values ​​are weighted according to their respective weights to obtain the current value. The predicted value of the previous block.

5. According to claim 3 The method, characterized in that determining the first transition parameter includes: Decode the bitstream to obtain a second index, which is used to indicate the first transition parameter; Based on the second index, determine The first transition parameter.

6. According to the rights The method for finding 5 is characterized in that determining the first transition parameter based on the second index includes: Determine the list of candidate transition parameters; The candidate transition parameter corresponding to the second index in the candidate transition parameter list is determined. It is defined as the first transition parameter.

7. According to the rights The method of claim 4, characterized in that determining the first transition parameter includes: Determine G alternative transition parameters, where G is a positive integer; From the G alternative transition parameters In this process, the first transition parameter is determined.

8. Root The method according to claim 7, characterized in that determining the first transition parameter from the G candidate transition parameters comprises: For the g-th candidate transition parameter among the G candidate transition parameters, determine the cost corresponding to the g-th candidate transition parameter, where g is a positive integer from 1 to G; Based on the costs corresponding to the G candidate transition parameters, transition from the G candidate transition parameters... Among the parameters, the first transition parameter is determined. 9 According to the method of claim 8, the cost of determining the cost corresponding to the g-th alternative transition parameter includes: The weight of the template of the current block is determined based on the first weighting mode and the g-th alternative transition parameter; The template is predicted based on the K first prediction patterns to obtain K predicted values ​​for the template; The K predicted values ​​of the template are weighted according to the weight of the template to obtain the predicted value of the template; Based on the predicted value of the template, determine The cost corresponding to the g-th alternative transition parameter. 1 0. The method according to claim 9, characterized in that, determining the weight of the template of the current block based on the first weighting mode and the g-th alternative transition parameter includes: Based on the first weight export mode and the template, determine the first weight corresponding to the template; The first weight is adjusted using the g-th alternative transition parameter to obtain the adjusted first weight; According to The adjusted first weight is used to determine the template. Weights.

11. The method according to claim 8, wherein determining the first transition parameter from the G candidate transition parameters based on the costs corresponding to the G candidate transition parameters comprises: Substitute the G candidate transition parameters The candidate transition parameter with the lowest cost is determined as the first transition parameter. Ferry parameters.

12. The method according to claim 7, wherein determining the G alternative transition parameters comprises: Determine the image information of the current block; Based on the image information of the current block, from Among the preset multiple alternative transition parameters, the G is determined. One alternative transition parameter.

13. The method according to claim 12, wherein the image information includes the sharpness of image edges, and the step of determining the G alternative transition parameters from a plurality of preset alternative transition parameters based on the image information of the current block includes: If the image edge sharpness of the current block is less than a preset value, then at least one of the preset multiple alternative transition parameters is determined as the G alternative transition parameters. If the image edge sharpness of the current block is greater than or equal to the preset value, then at least one of the preset multiple alternative transition parameters is determined as one of the G alternative transition parameters. Select a transition parameter, wherein the second alternative transition parameter is greater than the selected transition parameter. The first alternative transition parameter is described.

14. The method according to claim 7, characterized in that, in determining G candidate samples... The parameters include: Based on the size of the current block Determine the G alternative transition parameters.

15. The method according to claim 3, characterized in that, the Determine the first transition parameters, including: According to the current block The value of is used to determine the first transition parameter.

16. The method according to claim 15, wherein determining the first transition parameter based on the size of the current block comprises: If the size of the current block is less than a first preset threshold, then the first transition parameter is determined to be a first value; or, If the size of the current block is greater than or equal to When the first set threshold is reached, the first transition parameter is determined. The second value is less than the first value.

17. The method according to claim 15, wherein determining the first transition parameter based on the size of the current block comprises: If the size of the current block is less than a first preset threshold, then the first transition parameter is determined to be within the range of the first transition parameter value; or, If the size of the current block is greater than or equal to the first set threshold, then the first transition parameter is determined to be located at the second transition parameter. Within the range of values, the range of values ​​for the second transition parameter is... The minimum value is less than the minimum value in the range of the first transition parameter.

18. According to the rights The method described in claim 2 is characterized in that, in determining the first The list of candidate combinations includes: Construct the first candidate combination list.

19. The method according to claim 18, wherein the feature is... The feature is that the construction of the first candidate combination list includes include: Based on the template of the current block, construct the first candidate combination list.

20. The method according to claim 19, wherein constructing the first candidate combination list based on the template of the current block includes: Determine R second combinations, each of the R second combinations including a weighted derived pattern and K prediction patterns, and the weighted derived pattern and K prediction patterns included in any two of the R second combinations are not completely the same, where R is a positive integer greater than 1; For any one of the R second combinations, determine the weighted derived mode and K prediction modes from the second combination to predict the template. The template prediction value corresponding to the second combination; According to the R The candidate combination list is constructed by using the template prediction values ​​corresponding to each second combination in the second combination.

21. The method according to claim 20, wherein constructing the candidate combination list based on the template prediction values ​​corresponding to each of the R second combinations comprises: Based on the template prediction value corresponding to the second combination and the template The reconstructed value is used to determine the cost corresponding to the second combination; Based on the cost corresponding to each of the R second combinations, construct the candidate combination list.

22. The method according to claim 21, characterized in that, if the template prediction value corresponding to the second combination includes the template prediction values ​​corresponding to the K prediction modes in the second combination, then determining the cost corresponding to the second combination based on the template prediction value corresponding to the second combination and the reconstructed value of the template includes: Based on the template prediction values ​​and template reconstruction values ​​corresponding to the K prediction modes in the second combination, determine the second group. The costs corresponding to the K prediction patterns in the combination; according to The costs corresponding to the K prediction modes in the second combination are used to determine the cost of the second combination.

23. The method according to claim 21, characterized in that the cost corresponding to each of the K prediction modes in the second combination is... Determine the cost corresponding to the second combination, including: Will 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.

24. The method according to claim 20, wherein determining R second combinations comprises: Determine P weighted derived patterns and Q prediction patterns, where P is a positive integer and Q is a positive integer greater than or equal to K; Based on the P weighted derived patterns and the Q prediction patterns, construct the... R second combinations, any one of the R second combinations The two combinations include one weighted derivation pattern from the P weighted derivation patterns and K prediction patterns from the Q prediction patterns.

25. The method according to claim 24, characterized in that determining Q prediction patterns includes: Determine at least one of the following: a first candidate prediction mode list for the current block, a first alternative prediction mode list corresponding to each of the K prediction modes, and a prediction mode corresponding to the weighted derivation mode. The first candidate prediction mode list includes multiple first candidate prediction modes, and the first alternative prediction mode list corresponding to any one of the K prediction modes includes at least one first alternative prediction mode. According to the first candidate The list of prediction modes, and the K prediction modes corresponding to the first prediction mode, respectively. The Q prediction modes are determined by selecting from a list of alternative prediction modes and at least one prediction mode corresponding to the weighted derivation mode.

26. The method according to claim 25, characterized in that... The step of determining the first candidate prediction model corresponding to the current block The list of formulas includes: The first candidate prediction pattern list is determined based on the prediction pattern used by at least one block adjacent to the current block.

27. The method according to claim 25, characterized in that, the The method also includes: If the first candidate prediction mode list If the preset mode is not included, then the preset mode corresponding to the current block is determined; Add the preset mode to the first candidate prediction mode list.

28. The method according to claim 25, characterized in that... The step of determining the first candidate prediction mode list corresponding to the current block includes... include: Determine the image type corresponding to the current block; The first candidate prediction mode list is determined based on the image type corresponding to the current block.

29. The method according to any one of claims 4-14, characterized in that determining the weight of the predicted value based on the first transition parameter and the first weight derivation mode comprises: Based on the first weighted derivation mode and the current... The block is used to determine the second weight corresponding to the current block. make The second weight is adjusted using the first transition parameter to obtain the adjusted second weight; The weights of the predicted values ​​are determined based on the adjusted second weights.

30. The method according to claim 1, wherein the first combination further comprises a second transition parameter, and the derivation of the mode based on the first weight and the K first prediction modes... Make a prediction for the current block to obtain the predicted value of the current block. ,include: The current block is predicted based on the second transition parameter, the first weighted derivation mode, and the K first prediction modes to obtain the predicted value of the current block.

31. The method according to claim 30, wherein determining the predicted value of the current block based on the second transition parameter, the first weighted derivation mode, and the K first prediction modes comprises: Derived from the first weight The pattern and the second transition parameter determine the weights of the predicted values. ; Based on the K first prediction patterns, determine the K predicted values; The K predicted values ​​are weighted according to their respective weights to obtain the predicted value for the current block.

32. The method according to claim 31, wherein determining the weight of the predicted value based on the first weight derivation mode and the second transition parameter comprises: According to the first weight The export mode and the current block are used to determine the corresponding current block. The fourth weight; The fourth weight is adjusted using the second transition parameter to obtain the adjusted fourth weight; The weights of the predicted values ​​are determined based on the adjusted fourth weights.

33. The method according to claim 30, wherein determining the first weighted derived pattern and K first prediction patterns included in the first combination based on the first index comprises: A second candidate combination list is determined, which includes multiple second candidate combinations. Each of the multiple second candidate combinations includes a weighted derived pattern, K prediction patterns, and a transition pattern. Ferry parameters; The second candidate combination list includes the first The second candidate combination corresponding to an index includes the weighted derived pattern, K prediction patterns, and over... The parameters are determined to be the first weight derivation mode, and the... K first prediction modes and the second transition parameters.

34. The method according to claim 33, characterized in that, the The second candidate combination list is determined, including: Construct the first List of two candidate combinations.

35. The method according to claim 34, wherein constructing the second candidate combination list comprises: Based on the template of the current block, construct the second candidate combination list.

36. The method according to claim 35, wherein constructing the second candidate combination list based on the template of the current block includes: H third combinations are determined. Each of the H third combinations includes a weighted derived mode, K prediction modes and a transition parameter. The weighted derived mode, K prediction modes and a transition parameter included in any two of the H third combinations are not completely the same. H is a positive integer greater than 2. For the H third combinations Any third combination, determine the use of the third combination. The cost corresponding to the third combination when predicting the template is a weighted derivation mode, K prediction modes and transition parameters; Based on the cost corresponding to each of the H third combinations, construct the second candidate combination list.

37. The method according to claim 36, characterized in that, in determining to use the weighted derived mode, K prediction modes, and transition parameters in the third combination to predict the template, the cost corresponding to the third combination includes: The weights of the template are determined based on the weight derivation mode and transition parameters included in the third combination. The template is processed according to the K prediction patterns in the third combination. The prediction is performed to obtain K predicted values ​​for the template; according to The template weights are applied to the K predicted values ​​of the template to obtain the template predicted value corresponding to the third combination; The cost corresponding to the third combination is determined based on the template prediction value and the reconstructed value of the template.

38. The method according to claim 37, characterized in that, in determining the weights of the template based on the weight derivation mode and transition parameters included in the third combination. ,include: Derive the model based on the weights in the third combination. Based on the formula and the template, determine the third weight corresponding to the template; The third weight is adjusted using the transition parameters in the third combination to obtain the adjusted third weight; The weight of the template is determined based on the adjusted third weight.

39. The method according to claim 36, wherein the step of determining to use the weighted derived mode, K prediction modes, and transition parameters in the third combination to predict the template, the cost corresponding to the third combination includes: Based on the weight derivation mode and the transition parameters in the third combination, determine the K predictions in the third combination. The template prediction values ​​corresponding to each pattern; According to the third The template prediction values ​​and template reconstruction values ​​corresponding to the K prediction modes in the combination are used to determine the costs corresponding to the K prediction modes in the third combination. Based on the costs corresponding to the K prediction modes in the third combination, determine the cost corresponding to the third combination. cost.

40. The method according to claim 39 The feature is that, based on the costs corresponding to the K prediction modes in the third combination, determining the cost corresponding to the third combination includes: The sum of the costs corresponding to the K prediction modes in the third combination is determined as the cost corresponding to the third combination.

41. The method according to claim 36 The characteristic is that, according to the H third combinations The cost corresponding to each third combination is used to construct the second candidate combination list, including: Based on the cost corresponding to each of the H third combinations, sort the H third combinations; Sort all The H third combinations are determined as the second candidate combination column. surface.

42. The method according to claim 41, characterized in that, sorting the H third combinations according to the cost corresponding to each of the H third combinations includes: The H third combinations are sorted in ascending order of cost.

43. According to the rights The method described in claim 41 is characterized in that the step of... The costs corresponding to each of the H third combinations are described, and a second candidate combination list is constructed, including... : Based on the cost corresponding to the third combination, from the H Select L third combinations from the L third combinations; The list consisting of the L third combinations is determined as the second candidate combination list.

44. The method according to claim 43, wherein the L third combinations are the L third combinations with the lowest cost among the H third combinations.

45. According to rights The method described in claim 36, characterized in that the determination H third combinations, including: Determine F weighted derivation modes, J prediction modes, and W transition parameters, where F and W are both positive integers, and Q is a positive integer greater than or equal to K; Based on the F weighted derivation modes, the J prediction modes, and the W transition parameters, the H third combinations are constructed.

46. ​​The method according to claim 45, characterized in that determining J prediction modes includes: Determine at least one of the following: a second candidate prediction mode list for the current block, a second alternative prediction mode list corresponding to each of the K prediction modes, and a prediction mode corresponding to the weighted derived mode. The second candidate prediction mode list includes... Multiple second candidate prediction modes, of which the K prediction modes The list of second alternative prediction modes corresponding to any prediction mode includes at least one second alternative prediction mode; Based on the second candidate prediction mode list and the second alternative prediction modes corresponding to the K prediction modes respectively The pattern list, and the predictions corresponding to the weighted derived patterns. At least one of the patterns, determine the J prediction patterns.

47. The method according to claim 46, wherein determining the second candidate prediction mode list comprises: According to the current block The prediction pattern used by at least one neighboring block determines the The list of second candidate prediction modes corresponding to the current block.

48. The method according to claim 46, characterized in that the method further comprises: If the preset mode is not included in the second candidate prediction mode list, then Determine the preset mode corresponding to the current block; The pre The pattern is added to the second candidate prediction pattern list.

49. The method according to claim 46, characterized in that, the step of determining the second candidate corresponding to the current block... The list of prediction patterns includes: Determine the current block corresponding to Image type; The second candidate prediction mode list is determined based on the image type corresponding to the current block. 。 50. The method according to claim 45, wherein The characteristic is that determining the F weight derivation patterns includes: From the preset Z weight derivation modes, select the F weight derivation modes, where Z is a positive integer greater than or equal to F.

51. The method according to claim 45, wherein the W transition parameters include: The W transition parameters are determined based on the size of the current block.

52. The method according to claim 45, characterized in that, constructing the H third combinations based on the F weighted derived models, the J prediction modes, and the W transition parameters comprises: From the F Select E weight export modes from the weight export modes, the E is a positive integer less than or equal to F; Select V prediction patterns from the J prediction patterns, where V is a positive integer less than or equal to J; Select O transition parameters from the W transition parameters, where O is a positive integer less than or equal to W; The H third combinations are formed based on the E weighted derived modes, the V prediction modes, and the O transition parameters.

53. The method according to claim 52, wherein selecting E weight derivation patterns from the F weight derivation patterns comprises: For the i-th weighted derivation pattern among the F weighted derivation patterns, K second prediction patterns are determined on the template based on the i-th weighted derivation pattern and the third transition parameter. The weights, the third transition parameter being the weights of the W transition ladders. Any transition parameter in the degree, the K second prediction modes are any K prediction modes among the J prediction modes, and i is a positive integer from 1 to F; If the weight of any of the K prediction modes on the template is less than the first preset value, then the i-th weighted export mode is removed from the F weighted export modes to obtain the E weighted export modes.

54. The method according to claim 53, characterized in that... Therefore, the mode derived based on the i-th weight and the third weight... Transition parameters, which determine the weights of the K second prediction modes on the template, include: Based on the first weight derivation mode and the template, determine the fourth weight corresponding to the template; Using the third transition parameter, for the The fourth weight is adjusted to obtain the adjusted fourth weight. Heavy; The weights of the K second prediction modes on the template are determined based on the adjusted fourth weight.

55. The method according to claim 52, characterized in that selecting O transition parameters from the W transition parameters includes: Determine the image information of the current block; Based on the image information of the current block, the O transition parameters are determined from the W transition parameters.

56. The method according to claim 55, wherein the image information includes the sharpness of image edges, and the step of selecting from the W transition parameters based on the image information of the current block... The O transition parameters are determined, including: If the above If the sharpness of the image edge of the current block is less than a preset value, then at least one of the first type of transition parameters among the W transition parameters will be determined as the O transition parameters; If the above The sharpness of the image edges of the current block is greater than or equal to the pre-defined threshold. If a value is set, then at least one of the second type of transition parameters among the W transition parameters is determined as one of the O transition parameters, wherein the second type of transition parameter is greater than the first type of transition parameter.

57. The method according to claim 52, wherein selecting O transition parameters from the W transition parameters comprises: Based on the size of the current block, select the O transition parameters from the W transition parameters.

58. The method according to claim 57, characterized in that, the Based on the size of the current block, from the W transition parameters The O transition parameters are selected from the following: If the size of the current block is less than the second preset threshold, then the transition parameter among the W transition parameters that is greater than or equal to the third value is taken as the O transition parameters; or, If the size of the current block is greater than or equal to the second set threshold, then the transition parameter less than or equal to the fourth value among the W transition parameters is taken as the O transition parameters, where the fourth value is less than the third value.

59. The method according to claim 58, wherein selecting the O transition parameters from the W transition parameters based on the size of the current block comprises: If the above If the size of the current block is less than the second set threshold, then determine. The O transition parameters are one or more transition parameters that fall within the value range of the third transition parameter from among the W transition parameters; or, If the size of the current block is greater than or equal to the second set threshold, then the O transition parameters are determined to be one or more transition parameters among the W transition parameters that fall within the value range of the fourth transition parameter. The minimum value of the fourth transition parameter is less than the first... The minimum value of the three transition parameters.

60. The method according to claim 1, wherein the first weight derivation mode includes a fourth transition parameter, and the step of predicting the current block according to the first weight derivation mode and the K first prediction modes to obtain the predicted value of the current block includes: Based on the fourth transition parameter and the K first prediction modes, the current block is... Make a prediction to obtain the predicted value of the current block. 61 The method according to claim 60, characterized in that, the step of predicting the current block based on the fourth transition parameter and the K first prediction modes to obtain the predicted value of the current block includes: The weights of the predicted values ​​are determined based on the fourth transition parameter. Based on the K first prediction patterns, determine the K predicted values; The K predicted values ​​are weighted according to their respective weights to obtain the predicted value for the current block.

62. The method according to claim 60, wherein the step of determining the first weight derived from the first combination based on the first index is... The pattern and the K first prediction patterns, including: Determine the third The candidate combination list, wherein the third candidate combination list includes multiple third candidate combinations, the multiple Any third candidate combination among the three third candidate combinations includes one One weighted derivation mode and K prediction modes, wherein one weighted derivation mode includes a transition parameter; The third candidate combination The third candidate combination corresponding to the first index in the list The weighted derivation mode and K prediction modes are determined as the first weighted derivation mode and the K first prediction modes.

63. The method according to claim 61, wherein determining the third candidate combination list comprises: Construct the third candidate combination list.

64. The method according to claim 63, wherein constructing the third candidate combination list comprises: Based on the template of the current block, construct the third candidate combination list.

65. The method according to claim 64, wherein constructing the third candidate combination list based on the template of the current block comprises: Determine A fourth combinations, wherein any one of the A fourth combinations includes a weight. Re-derived mode and K prediction modes, the weighted derived mode The formula includes a transition parameter, and the weighted derived modes and K prediction modes included in any two of the A fourth combinations are not completely the same, where A is a positive integer greater than 1; For any of the A fourth combinations, determine the weighted derivation mode and K prediction modes in the fourth combination to predict the template, and the cost corresponding to the fourth combination; Based on the cost corresponding to each of the A fourth combinations, construct the third candidate combination list.

66. The method according to claim 65, characterized in that the determination The weighted derivation pattern and K values ​​in the fourth combination are used. The prediction mode predicts the template, and the cost corresponding to the fourth combination includes: Based on the weighted derivation mode in the fourth combination, determine the template prediction values ​​corresponding to the K prediction modes in the fourth combination respectively; According to the fourth combination The template prediction values ​​and template weights corresponding to the K prediction modes are respectively... Establish values ​​and determine the costs corresponding to the K prediction modes in the fourth combination; The cost corresponding to the fourth combination is determined based on the costs corresponding to the K prediction modes in the fourth combination.

67. The method according to claim 66, characterized in that, according to the K prediction modes in the fourth combination respectively The corresponding cost is used to determine the cost corresponding to the fourth combination. include: The sum of the costs corresponding to the K prediction modes in the fourth combination is determined as the cost corresponding to the fourth combination.

68. The method according to claim 65, wherein the root According to the cost corresponding to each of the A fourth combinations. Constructing the third candidate combination list includes: Sort the A fourth combinations according to the cost corresponding to each of the A fourth combinations; The sorted A fourth combinations are determined as the third candidate combination list.

69. The method according to claim 65, characterized in that... Therefore, according to each of the A fourth combinations The corresponding costs, when sorting the A fourth combinations, include: According to the cost from smallest to largest The order in which the A fourth combinations are sorted is determined. 7 0. The method according to claim 69, characterized in that, constructing the third candidate combination list based on the cost corresponding to each of the A fourth combinations includes: Based on the cost corresponding to the fourth combination, select B from the A fourth combinations. Fourth combination; The list composed of the B fourth combinations This is determined to be the third candidate combination list.

71. The method according to claim 70, wherein the B fourth combinations are the B fourth combinations with the lowest cost among the A fourth combinations.

72. The method according to claim 65, wherein determining A fourth combinations comprises: Determine C weighted derivation patterns and D prediction patterns, where C is a positive integer and D is a positive integer greater than or equal to K; Based on the C weighted derivation patterns and the D prediction patterns, construct the A fourth combination.

73. The method according to claim 72, characterized in that determining D prediction patterns includes... : Determine the third candidate prediction mode list for the current block. The list of third candidate prediction modes corresponding to the K prediction modes, and at least one of the prediction modes corresponding to the weighted derivation mode, wherein the list of third candidate prediction modes includes multiple third candidate prediction modes. Test mode, any one of the K prediction modes is a prediction mode pair The corresponding third alternative prediction model list includes at least one third alternative prediction model; Based on the third candidate prediction mode list, the third alternative prediction mode lists corresponding to the K prediction modes, and the weights, the following is derived: At least one of the prediction modes corresponding to the pattern, determine the D prediction patterns.

74. The method according to claim 73, wherein determining the third candidate prediction mode list comprises: Based on the prediction used by at least one block adjacent to the current block. The pattern determines the third candidate prediction pattern corresponding to the current block. List of formulas.

75. The method according to claim 73, characterized in that the method further comprises: If the preset pattern is not included in the list of third candidate prediction patterns Then determine the preset mode corresponding to the current block; The The preset mode is added to the list of third candidate prediction modes.

76. The method according to claim 73, characterized in that, the determination of the when The list of third candidate prediction modes corresponding to the previous block includes : Determine the image type corresponding to the current block; The third candidate prediction mode list is determined based on the image type corresponding to the current block.

77. The method according to claim 72, wherein determining the C weight derivation patterns comprises: Determine X transition parameters, where X is a positive integer; Based on the X transition parameters, determine the C weight derivation modes.

78. The method according to claim 77, wherein determining the X transition parameters comprises: Determine the image information of the current block; Based on the image information of the current block, determine X transitions. parameter.

79. The method according to claim 78, wherein The feature is that the image information includes the sharpness of the image edges, and the determination based on the image information of the current block... Define X transition parameters, including: If the current block's graph If the edge sharpness is less than a preset value, then at least one of the preset Y transition parameters of the third type is determined as the X transition parameters, where Y is a positive integer greater than X; or, If the image edge sharpness of the current block is greater than or equal to the preset value, then at least one of the Y transition parameters of the fourth type is determined as the X transition parameters, and the fourth type of transition parameter is greater than the third type of transition parameter.

80. According to claim 77 The method described above is characterized in that determining X transition parameters... Numbers, including: The X transition parameters are determined based on the size of the current block.

81. The method according to claim 80, wherein determining the X transition parameters based on the size of the current block comprises: If the size of the current block is less than the third preset threshold, then at least one preset transition parameter that is greater than or equal to the fifth value will be used as the X transition parameters; or, If the size of the current block is greater than or equal to the third set threshold, then the transition parameter less than or equal to the sixth value among the at least one transition parameter is taken as the X transition parameters, the sixth... The value is less than the fifth value.

82. The method according to claim 80, characterized in that, the Based on the size of the current block, the X transition parameters are determined, including: If the size of the current block is less than the third preset threshold, then the X transition parameters are determined to be one or more transition parameters that fall within the value range of the fifth transition parameter from at least one preset transition parameter; or, If the size of the current block is greater than or equal to When the third threshold is set, the X transition parameters are determined. One or more transition parameters among the at least one transition parameter that fall within the value range of the sixth transition parameter, wherein the sixth transition parameter is... The minimum value in the value range is less than the value range of the fifth transition parameter. The minimum value of the enclosure.

83. The method according to any one of claims 1-2, 4-28, and 30-82, characterized in that the method further comprises: Decode the bitstream to obtain at least one flag, the at least one flag The flag is used to indicate whether to use the first combination for decoding; The decoded bitstream, to obtain the first index, includes: If the at least one flag indicates that the first combination is used for decoding, the bitstream is decoded to obtain the first index.

84. The claim 83 The method is characterized in that the at least one flag includes a sequence-level flag and an image-level flag. At least one of the following: sign, slice-level sign, unit-level sign, and block-level sign.

85. The method according to claim 84, wherein if the at least one flag includes a block-level flag, then the Decoding the bitstream yields at least one flag, including: When it is determined that the size of the current block meets the preset conditions, the bitstream is decoded to determine the block-level label. Will.

86. According to claims 1-2, 4-28 The method described in any one of 30-82, characterized in that, the decoding of the bitstream to obtain the first index includes: If it is determined that the current block is not decoded using the first technique, then the bitstream is decoded to obtain the first index. 。 87. According to claims 27 and 4 8、75 The method described in any one of the following methods is characterized in that determining the preset mode corresponding to the current block includes: : Determine the image type corresponding to the current block; Based on the image type corresponding to the current block, determine the preset corresponding to the current block. model.

88. The method according to claim 87, wherein the preset mode includes DC, horizontal mode, and vertical mode. At least one of the following: angle mode, , and angle mode.

89. According to the right The method described in claim 87, characterized in that determining the image type corresponding to the current block includes: The image type corresponding to the current block is determined based on the image type of the current image to which the current block belongs, or the image type of the current slice to which the current block belongs.

90. A video coding method, characterized in that... ,include: Determine a first combination, the first combination including a first right Re-derived patterns and K first prediction patterns; The current block is predicted based on the first weighted derivation mode and the K first prediction modes to obtain the predicted value of the current block; A bitstream is obtained based on the predicted value of the current block, and the bitstream includes a first index, which is used to indicate the first combination.

91. According to the rights The method described in Request 90 is characterized in that, in determining the first A combination, including: Determine a first candidate combination list, which includes multiple first candidate combinations. Each of the multiple first candidate combinations includes a weighted derived pattern and K prediction patterns. The first combination is determined from the first candidate combination list.

92. The method according to claim 90 or 91, characterized in that, the step of performing the current block according to the first weighted derivation mode and the K first prediction modes... Prediction, obtaining the predicted value of the current block, includes: Determine the first transition parameter; The current block is predicted based on the first transition parameter, the first weighted derivation mode, and the K first prediction modes to obtain the prediction of the current block. value.

93. The method according to claim 92 The method, characterized in that, the step of predicting the current block based on the first transition parameter, the first weighted derivation mode, and the K first prediction modes to obtain the predicted value of the current block includes: The weights of the predicted values ​​are determined based on the first transition parameters and the first weight derivation mode. Based on the K first prediction patterns, the current block is predicted to obtain K prediction values; According to the prediction The weights of the values ​​are used to weight the K predicted values ​​to obtain The predicted value for the current block.

94. The method according to claim 92, wherein determining the first transition parameter comprises: Determine the list of candidate transition parameters; One of the candidate transition parameters in the candidate transition parameter list is selected as the first transition parameter.

95. The method according to claim 94, characterized in that determining one of the candidate transition parameters in the candidate transition parameter list as the first transition parameter includes: For the candidates Determine a candidate transition parameter from the transition parameter list. The cost corresponding to the candidate transition parameters; Based on the cost corresponding to each candidate transition parameter in the candidate transition parameter list, a candidate transition parameter is selected from the candidate transition parameter list as the first transition parameter.

96. The method according to claim 95, characterized in that the determination The costs corresponding to the candidate transition parameters include: The weight of the template for the current block is determined based on the candidate transition parameters and the first weight derivation mode. The template is predicted based on the K first prediction patterns to obtain K predicted values ​​for the template; The K predicted values ​​of the template are weighted according to the weights of the template to obtain the template. The predicted value of the board; Based on the predicted and reconstructed values ​​of the template, determine The cost corresponding to the candidate transition parameters.

97. The method according to claim 96, characterized in that the step according to the... Candidate transition parameters and the first weight derivation mode, Determining the weight of the template for the current block includes: Determine the first template weight based on the first weight export mode; Using the candidate transition parameters, the weights of the first template are adjusted. The weights of the template are obtained by adjusting the lines.

98. Root The method according to claim 95, characterized in that, selecting a candidate transition parameter from the candidate transition parameter list as the first transition parameter based on the cost corresponding to each candidate transition parameter in the candidate transition parameter list, comprises: The candidate transition parameter with the lowest cost in the candidate transition parameter list is determined as the first transition parameter.

99. According to claim 9 The method of any one of 2-98, characterized in that, the The method also includes: A second index is written into the bitstream, the second index being used to indicate the first transition parameter.

100. The method according to claim 92, wherein determining the first transition parameter comprises: Determine G alternative transition parameters, where G is a positive integer; The first transition parameter is determined from the G candidate transition parameters.

101. The method according to claim 100, characterized in that, in the step of determining the first from the G alternative transition parameters... One transition parameter, including: For the G alternative transition parameters The g-th alternative transition parameter in the number is used to determine the cost corresponding to the g-th alternative transition parameter, where g is a positive integer from 1 to G; Based on the costs corresponding to the G candidate transition parameters, the first transition parameter is determined from the G candidate transition parameters.

102. The method according to claim 101, wherein the cost of determining the cost corresponding to the g-th alternative transition parameter includes: root According to the first weighting pattern and the g-th alternative transition Parameters determine the weight of the template for the current block; The template is predicted based on the K first prediction patterns to obtain K predicted values ​​for the template; The K predicted values ​​of the template are weighted according to the weights of the template to obtain the template. The predicted value; Based on the predicted value of the template, determine the... The cost corresponding to the g-th alternative transition parameter.

103. The method according to claim 102, characterized in that, the step of determining the current [weighting mode] based on the first weighting mode and the g-th alternative transition parameter... The weights of the block's template include: According to the first right Re-export the mode and the template, and determine the first weight corresponding to the template; The first weight is adjusted using the g-th alternative transition parameter to obtain the adjusted first weight; The weight of the template is determined based on the adjusted first weight.

104. The method according to claim 101, characterized in that, determining the first transition parameter from the G candidate transition parameters based on the costs corresponding to the G candidate transition parameters comprises: The candidate transition parameter with the lowest cost among the G candidate transition parameters is determined as the first transition parameter.

105. The method according to claim 100, characterized in that the determination Define G alternative transition parameters, including: Determine the current block Image information; Based on the image information of the current block, G alternative transition parameters are determined from a set of preset alternative transition parameters. Transition parameters.

106. The claim 105 The method is characterized in that the image information includes the sharpness of image edges, and the image based on the current block... Information, determined from a plurality of preset alternative transition parameters, indicates that... G alternative transition parameters, including: If the image edge sharpness of the current block is less than a preset value, then at least one of the preset multiple alternative transition parameters is determined as the G alternative transition parameters. If the image edge sharpness of the current block is greater than or equal to the preset value, then the preset multiple candidate transitions will be... At least one of the second alternative transition parameters is determined as the desired parameter. There are G alternative transition parameters, wherein the second alternative transition parameter is greater than the first alternative transition parameter.

107. The method according to claim 100, wherein determining the G alternative transition parameters comprises: Based on the size of the current block, determine the G alternative transition parameters.

108. The method according to claim 92, wherein determining the first transition parameter comprises: The first transition is determined based on the size of the current block. parameter.

109. The claim 108 The method is characterized in that, the first transition parameter is determined based on the size of the current block. Numbers, including: If the size of the current block is smaller than the first preset value When the threshold is reached, the first transition parameter is determined to be the first value; or, If the size of the current block is greater than or equal to the first preset threshold When the first transition parameter is determined to be the second value, the second transition parameter is then determined to be the second value. The second value is less than the first value.

110. The method according to claim 109, wherein determining the first transition parameter based on the size of the current block comprises: If the size of the current block is less than a first preset threshold, then the first transition parameter is determined to be within the range of the first transition parameter value; or, If the size of the current block is greater than or equal to the first set threshold, then the first transition parameter is determined to be within the range of the second transition parameter, and the minimum value of the range of the second transition parameter is less than the minimum value of the range of the first transition parameter.

111. The method according to claim 91, characterized in that, in determining the first candidate combination list, include: Construct the first candidate combination list. 112 According to the method of claim 111, the step of constructing the first candidate combination list includes: Based on the template of the current block, construct the first candidate combination list.

113. The method according to claim 112, characterized in that, the first candidate combination list is constructed based on the template of the current block. include: Determine R second combinations, the R second combinations Any second combination in the R includes a weighted derivation pattern and K prediction patterns, and the weighted derivation pattern and K prediction patterns included in any two combinations of the R second combinations are not completely the same, where R is a positive integer greater than 1; For any of the R second combinations, determine the template prediction using the weighted derivation mode and K prediction modes in the second combination, and the template prediction value corresponding to the second combination; The candidate combination list is constructed based on the template prediction values ​​corresponding to each of the R second combinations. 1 14. The method according to claim 113, characterized in that... The step of constructing the candidate combination list based on the template prediction values ​​corresponding to each of the R second combinations includes: The cost corresponding to the second combination is determined based on the template prediction value and the reconstructed value of the template. According to the code corresponding to each of the R second combinations Price, and construct the candidate combination list.

115. The method according to claim 113, characterized in that, if the template prediction value corresponding to the second combination includes the template prediction values ​​corresponding to the K prediction modes in the second combination, then determining the cost corresponding to the second combination based on the template prediction value corresponding to the second combination and the reconstructed value of the template includes: According to the K prediction modes in the second combination respectively The corresponding template prediction value and template reconstruction value determine the second The costs corresponding to the K prediction patterns in the combination; The cost corresponding to the second combination is determined based on the costs corresponding to the K prediction modes in the second combination.

116. The method according to claim 115, wherein determining the cost corresponding to the second combination based on the costs corresponding to the K prediction modes in the second combination includes: 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.

117. The method according to claim 113, wherein determining R second combinations comprises: Determine P weighted export patterns and Q weighted export patterns. Prediction mode, where P is a positive integer and Q is greater than or equal to... A positive integer greater than or equal to K; Based on the P weighted derived patterns and the Q prediction patterns, the R second combinations are constructed, where any one of the R second combinations includes the P weighted derived patterns. The weighted derived mode and the Q prediction modes in the formula K prediction patterns.

118. The method according to claim 117, characterized in that determining Q prediction modes includes: Determine the first candidate prediction mode list for the current block, and the K prediction mode classifications. The corresponding first alternative prediction mode list and weight derivation At least one of the prediction modes corresponding to the pattern, the first candidate prediction mode list includes multiple first candidate prediction modes, and the first alternative prediction mode list corresponding to any one of the K prediction modes includes at least one... First alternative forecasting model; According to the first candidate prediction mode list, the The Q prediction modes are determined by taking at least one of the first candidate prediction mode list corresponding to the K prediction modes and the prediction mode corresponding to the weighted derivation mode.

119. The method according to claim 118, wherein determining the first candidate prediction mode list corresponding to the current block includes: Based on the prediction used by at least one block adjacent to the current block. The pattern is used to determine the first candidate prediction pattern list. 1 20. The method according to claim 119, characterized in that the method further comprises: If the preset mode is not included in the first candidate prediction mode list, then the preset mode corresponding to the current block is determined; Add the preset mode to the first candidate prediction mode list.

121. The method according to claim 118, characterized in that... The first candidate prediction mode corresponding to the current block is determined. The list includes: Determine the image type corresponding to the current block; The first candidate prediction mode list is determined based on the image type corresponding to the current block.

122. The method according to any one of claims 93-121, characterized in that, determining the weight of the predicted value based on the first transition parameter and the first weight derivation mode includes: Based on the first weighted export mode and the current block, determine the... The second weight corresponding to the current block; Using the first transition parameter The second weight is adjusted using the number of values ​​to obtain the adjusted second weight; The weights of the predicted values ​​are determined based on the adjusted second weights.

123. The method according to claim 90, wherein the first combination further comprises a second transition parameter, and the current block is predicted according to the first weighted derivation mode and the K first prediction modes to obtain the current block. The predicted values ​​include: According to the second transition parameter, The first weighted derivation mode and the K first prediction modes are used to predict the current block to obtain the predicted value of the current block.

124. The method according to claim 123, characterized in that, in determining the predicted value of the current block based on the second transition parameter, the first weighted derivation mode, and the K first prediction modes, include: Based on the first weighted derivation mode and the second Transition parameters determine the weights of the predicted values; Based on the K first prediction patterns, determine the... Describe the K predicted values; Based on the weights of the K predicted values The K predicted values ​​are weighted to obtain the predicted value for the current block.

125. The method according to claim 124, The characteristic is that the step of deriving the mode based on the first weight and The second transition parameter, which determines the weights of the predicted values, includes: Based on the first weight derivation mode and the current block, determine the fourth weight corresponding to the current block; The fourth weight is adjusted using the second transition parameter to obtain the adjusted fourth weight; The weights of the predicted values ​​are determined based on the adjusted fourth weights.

126. The method according to claim 123, wherein determining the first combination comprises: Determine a second candidate combination list, which includes multiple second candidate combinations. Each of the multiple second candidate combinations includes a weighted derived mode, K prediction modes, and a transition parameter. From the second candidate combination list, confirm Determine the first combination.

127. According to claim 1 The method described in 26, characterized in that determining the second candidate combination list includes: Construct the second candidate combination list.

128. The method according to claim 127, wherein constructing the second candidate combination list comprises: Based on the template of the current block, construct the second candidate combination list.

129. The method according to claim 128, wherein constructing the second candidate combination list based on the template of the current block includes: H third combinations are determined, each of the H third combinations comprising a weighted derived mode, K prediction modes, and a transition parameter. And the weights included in any two of the H third combinations The re-derived mode, K prediction modes and a transition parameter are not completely the same, where H is a positive integer greater than 2; For any of the H third combinations, determine the cost corresponding to the third combination when using the weighted derived mode, K prediction modes and transition parameters in the third combination to predict the template; Based on the cost corresponding to each of the H third combinations, construct the second... List of candidate combinations.

130. According to claim 129 The method is characterized in that, in determining the use of the weighted derived mode, K prediction modes, and transition parameters in the third combination to predict the template, the cost corresponding to the third combination includes: The weights of the template are determined based on the weight derivation mode and transition parameters included in the third combination. The template is predicted based on the K prediction patterns in the third combination to obtain K predicted values ​​for the template; The K predicted values ​​of the template are weighted according to the weight of the template to obtain the template predicted value corresponding to the third combination; Prediction based on the template corresponding to the third combination The value and the reconstructed value of the template are used to determine the third combination corresponding to... The cost.

131. The method according to claim 130, wherein determining the weights of the template based on the weight derivation mode and transition parameters included in the third combination comprises: Derived from the weights in the third combination Based on the pattern and the template, determine the third weight corresponding to the template. ; The third weight is adjusted using the transition parameters in the third combination to obtain the adjusted third weight; The weight of the template is determined based on the adjusted third weight.

132. The method according to claim 129, characterized in that the determination of using the weights in the third combination... Output mode, K prediction modes, and transition parameters for the template The cost of making the prediction, corresponding to the third combination, includes: Based on the weighted derivation mode in the third combination and the transition parameter, determine the template prediction values ​​corresponding to the K prediction modes in the third combination. According to the K prediction modes in the third combination, respectively The template prediction value and the template reconstruction value are used to determine the cost corresponding to each of the K prediction modes in the third combination; The cost corresponding to the third combination is determined based on the costs corresponding to the K prediction modes in the third combination.

133. The method according to claim 132, characterized in that, the step according to the... The costs corresponding to the K prediction modes in the third combination are determined. The cost corresponding to the third combination includes: The K prediction modes in the third combination are respectively... The sum of the corresponding costs is determined as the cost corresponding to the third combination. 。 134. The method according to claim 129, characterized in that, constructing the second candidate combination list based on the cost corresponding to each of the H third combinations includes: Based on the cost corresponding to each of the H third combinations, sort the H third combinations; Sort The H third combinations are determined as the second candidate combination column. surface.

135. The method according to claim 134, characterized in that, sorting the H third combinations according to the cost corresponding to each of the H third combinations includes: The H third combinations are sorted in ascending order of cost.

136. The method according to claim 129, characterized in that, constructing the second candidate combination list based on the cost corresponding to each of the H third combinations includes: Based on the cost corresponding to the third combination, select L third combinations from the H third combinations; The list composed of the L third combinations is determined as the second... List of candidate combinations.

137. According to claim 136 The method is characterized in that the L third combinations are the L third combinations with the lowest cost among the H third combinations.

138. The method according to claim 129, characterized in that... The determination of the H third combinations includes: Determine F The system comprises one weighted derived mode, J prediction modes, and W transition parameters, wherein F and W are both positive integers, and Q is a positive integer greater than or equal to K; Based on the F weights, the J prediction modes, and the W... A transition parameter is used to construct the H third combinations. 139 The method according to claim 138, characterized in that determining J prediction modes includes: Determine the second candidate prediction mode list for the current block, and the second alternative prediction modes corresponding to the K prediction modes respectively. The formula list, and the prediction model corresponding to the weighted derivation mode. At least one, the second candidate prediction mode list includes multiple second candidate prediction modes, and the second alternative prediction mode list corresponding to any one of the K prediction modes is included in the list of K prediction modes. There is one less second alternative prediction model; According to the second candidate The prediction mode list, the second alternative prediction mode list corresponding to each of the K prediction modes, and the weights Determine at least one of the prediction modes corresponding to the re-derived mode. The J prediction patterns.

140. The method according to claim 139, wherein determining the second candidate prediction mode list comprises: A second candidate prediction mode list corresponding to the current block is determined based on the prediction mode used by at least one block adjacent to the current block.

141. The method according to claim 139, characterized in that the method further comprises: If the preset mode is not included in the second candidate prediction mode list, then the preset mode corresponding to the current block is determined; Add the preset mode to the second candidate prediction mode column. In the table.

142. The method according to claim 139 The method, characterized in that determining the second candidate prediction mode list corresponding to the current block includes: Determine the image type corresponding to the current block; The second candidate prediction mode list is determined based on the image type corresponding to the current block.

143. The method according to claim 138, wherein determining the F weight derivation patterns includes: From the preset Z weight derivation modes, select the F weight derivation modes, where Z is a positive integer greater than or equal to F.

144. The method according to claim 138, wherein the W transition parameters include: The W transition parameters are determined based on the size of the current block.

145. According to claim 13 The method described in 8, characterized in that, according to the F... The weighted derived modulus, the J prediction modes, and the W transition parameters are used to construct the H third combinations, including: Select E weight derivation patterns from the F weight derivation patterns, where E is a positive integer less than or equal to F; Select V prediction patterns from the J prediction patterns, where V is a positive integer less than or equal to J; Select O transition parameters from the W transition parameters, where O is a positive integer less than or equal to W; According to the above E weighted derivation patterns, the V prediction patterns, and the O The transition parameters form the H third combinations.

146. The method according to claim 145, wherein selecting E weight derivation patterns from the F weight derivation patterns comprises: Regarding the above The i-th weight export pattern among F weight export patterns Based on the i-th weighted derived mode and the third transition parameter, the weights of K second prediction modes on the template are determined. The third transition parameter is any one of the W transition gradients, and the K second prediction modes are any K prediction modes among the J prediction modes. i is a positive integer from 1 to F. If the weight of any of the K prediction modes on the template is less than the first preset value, then the i-th weighted export mode is removed from the F weighted export modes to obtain the E weighted export modes.

147. According to claim 146 The method, characterized in that, according to the i-th The weighted derived modes and third transition parameters determine the weights of K second prediction modes on the template, including: Based on the first weighted export mode and the template, determine The fourth weight corresponding to the template; Using the third transition The parameters are used to adjust the fourth weight, resulting in the adjusted fourth weight; The weights of the K second prediction modes on the template are determined based on the adjusted fourth weight.

148. The method according to claim 145, wherein selecting O transition parameters from the W transition parameters comprises: Determine the image information of the current block; Based on the image information of the current block, the O transition parameters are determined from the W transition parameters.

149. The method according to claim 148, characterized in that, the Image information includes the sharpness of image edges. The step of determining the O transition parameters from the W transition parameters based on the image information of the current block includes: If the image edge sharpness of the current block is less than a preset value, then at least one of the W transition parameters of the first type is determined as the O transition parameters; If the image edge sharpness of the current block is greater than or equal to the preset value, then at least one of the W transition parameters of the second type is determined as the O transition parameters, wherein the second type of transition parameter is greater than the first type of transition parameter.

150. According to the rights The method described in claim 145 is characterized in that the step from O transition parameters are selected from the W transition parameters, including: Based on the size of the current block, select the O transition parameters from the W transition parameters.

151. The method according to claim 150, characterized in that, in the step of selecting the O transition parameters from the W transition parameters according to the size of the current block, include: If the size of the current block is less than the second preset threshold In this case, the transition parameter among the W transition parameters that is greater than or equal to the third value is taken as the O transition parameters; or, If the size of the current block is greater than or equal to the second set threshold, then the transition parameter less than or equal to the fourth value among the W transition parameters is taken as the O transition parameters, where the fourth value is less than the third value.

152. The method according to claim 150, wherein The feature is that, based on the size of the current block, from the... The O transition parameters are selected from the W transition parameters, including: If the size of the current block is less than the second preset threshold, then the O transition parameters are determined to be one or more transition parameters among the W transition parameters that fall within the value range of the third transition parameter; or, If the size of the current block is greater than or equal to the second set threshold, then the O transition parameters are determined to be one or more transition parameters within the range of the fourth transition parameter among the W transition parameters, and the minimum value of the range of the fourth transition parameter is less than the minimum value of the range of the third transition parameter.

153. The method according to claim 90 The method, characterized in that the first weight derivation mode includes The fourth transition parameter is the mode derived based on the first weight and the K first prediction modes. The formula is used to predict the current block, and the predicted value of the current block is obtained. ,include: The current block is predicted based on the fourth transition parameter and the K first prediction modes to obtain the current block. The predicted value.

154. As described in claim 153 The method, characterized in that, the step of predicting the current block based on the fourth transition parameter and the K first prediction modes to obtain the predicted value of the current block includes: The weights of the predicted values ​​are determined based on the fourth transition parameter. Based on the K first prediction patterns, determine the K predicted values; The K predicted values ​​are weighted according to their respective weights to obtain the predicted value for the current block.

155. The method according to claim 153, wherein determining the first weighted derived mode and K first prediction modes included in the first combination based on the first index comprises: A third candidate combination list is determined, which includes multiple third candidate combinations. Any third candidate combination among the plurality of third candidate combinations It includes a weighted derivation pattern and K prediction patterns, wherein the weighted derivation pattern includes a transition parameter; The weighted derivation mode and K prediction modes included in the third candidate combination corresponding to the first index in the third candidate combination list are determined as the first weighted derivation mode and the K first prediction modes.

156. The method according to claim 155, wherein determining the third candidate combination list comprises: Construct the third candidate combination list.

157. The method according to claim 156, characterized in that the structure The third candidate combination list includes: Based on the above The template of the previous block is used to construct the third candidate combination list.

158. The method according to claim 157, wherein constructing the third candidate combination list based on the template of the current block includes: Determine A fourth combinations, Each of the A fourth combinations includes a weight. The weighted derived mode includes a transition parameter, and the weighted derived mode and the K prediction modes included in any two of the A fourth combinations are not completely the same. A is a positive integer greater than 1. For any of the A fourth combinations, determine to use the first... The weighted derived pattern and K prediction patterns in the four-combination, for the... The template is used for prediction, and the cost corresponding to the fourth combination is determined. Based on the cost corresponding to each of the A fourth combinations, construct the third candidate combination list.

159. According to claim 158 The method described above is characterized in that the determination uses the fourth... The weighted derived pattern and K prediction patterns in the combination are used to predict the template. The cost corresponding to the fourth combination includes: Based on the weighted derivation mode in the fourth combination, determine the template prediction values ​​corresponding to the K prediction modes in the fourth combination respectively; According to the K prediction modes in the fourth combination respectively The corresponding template prediction value and template reconstruction value are used to determine the fourth The costs corresponding to the K prediction modes in the combination; Based on the K prediction modes in the fourth combination The corresponding cost is determined for the fourth combination.

160. The method according to claim 159, wherein determining the cost corresponding to the fourth combination based on the costs corresponding to the K prediction modes in the fourth combination includes: The costs corresponding to the K prediction modes in the fourth combination are respectively The sum of these is determined as the cost corresponding to the fourth combination. 16 1. The method according to claim 158, characterized in that, constructing the third candidate combination list based on the cost corresponding to each of the A fourth combinations includes: Sort the A fourth combinations according to the cost corresponding to each of the A fourth combinations; The sorted A fourth combinations are determined as the third candidate combination list.

162. The method according to claim 158, characterized in that, sorting the A fourth combinations according to the cost corresponding to each of the A fourth combinations includes: According to the order of the costs from smallest to largest, process the A fourth combinations. Sort by row.

163. The claim 158 The method, characterized in that, constructing the third candidate combination list based on the cost corresponding to each of the A fourth combinations, includes: Based on the cost corresponding to the fourth combination, from A Choose B fourth combinations from the four fourth combinations; The B The list of the fourth combination is determined as the third candidate combination list.

164. The method according to claim 163, wherein the B fourth combinations are the ones with the lowest cost among the A fourth combinations. The first B fourth combinations.

165. According to claim 1 The method described in 58 is characterized in that determining A fourth combinations includes: Determine C weighted derivation patterns and D prediction patterns, where C is a positive integer and D is a positive integer greater than or equal to K; According to The C weighted derivation patterns and the D prediction patterns are used to construct... The fourth combination of A.

166. The method according to claim 165, characterized in that determining D prediction patterns includes: Determine the third candidate of the current block The list of prediction patterns, and the K prediction patterns corresponding to the first K prediction patterns. The list of three alternative prediction modes and at least one of the prediction modes corresponding to the weighted derivation mode, wherein the list of third candidate prediction modes includes multiple third candidates. Prediction mode, any one of the K prediction modes The corresponding third alternative prediction mode list includes at least one third alternative prediction mode. The D prediction modes are determined based on at least one of the third candidate prediction mode list, the third alternative prediction mode list corresponding to the K prediction modes, and the prediction mode corresponding to the weighted derivation mode.

167. The method according to claim 166, wherein determining the third candidate prediction mode list comprises: A third candidate prediction mode list corresponding to the current block is determined based on the prediction mode used by at least one block adjacent to the current block.

168. According to The method of claim 166, characterized in that, the The method also includes: If the preset pattern is not included in the third candidate prediction pattern list, then the current block is determined. The corresponding preset mode; Add the preset mode to the The third candidate prediction pattern list.

169. The method according to claim 166, wherein determining the third candidate prediction mode list corresponding to the current block includes: Determine the image type corresponding to the current block; The third candidate prediction mode list is determined based on the image type corresponding to the current block.

170. The method according to claim 165, wherein determining C weight derivation modes comprises: Determine X transition parameters X is a positive integer; Based on the X transition parameters Determine the C weight derivation modes.

171. The method according to claim 170, wherein determining X transition parameters comprises: Determine the image information of the current block; Based on the image information of the current block, determine X transition parameters.

172. The method according to claim 171, wherein the image information includes the sharpness of image edges, and determining X transition parameters based on the image information of the current block includes: If the image edge sharpness of the current block is less than a preset value, then at least one of the preset Y transition parameters will be a third type of transition parameter. The X transition parameters are determined, where Y is a positive integer greater than X; or, If the image edge sharpness of the current block is greater than or equal to If the preset value is met, then at least one of the fourth type of transition parameters among the Y transition parameters is determined as the X transition parameters, and the fourth type of transition parameter is greater than the third type of transition parameter.

173. The method according to claim 170, characterized in that... The following describes the determination of X transition parameters, including: According to the current block The size of the parameters determines the X transition parameters.

174. The method according to claim 173, characterized in that, according to The size of the current block determines the X transition parameters, including... include: If the size of the current block is less than the third preset threshold, then at least one preset transition parameter that is greater than or equal to the fifth value will be used as the X transition parameters; or those, If the size of the current block is greater than or equal to the third set threshold, then the transition parameter less than or equal to the sixth value among the at least one transition parameters will be... The transition parameter is one of the X transition parameters, and the sixth value is less than the fifth value.

175. The method according to claim 173 The method is characterized in that, the step of determining the X transition parameters based on the size of the current block, include: If the size of the current block is less than the third preset threshold, then the X transition parameters are determined to be one or more transition parameters that fall within the range of the fifth transition parameter among at least one preset transition parameter. Parameters; or, If the size of the current block is greater than or equal to When setting the third threshold, the X transition parameters are determined to be the ones located at the first or second threshold among the at least one transition parameter. One or more transition parameters within the range of six transition parameter values. The minimum value of the sixth transition parameter is less than the minimum value of the fifth transition parameter.

176. The claim 90-91, 93-98, 100-121, 123-175 The method, characterized in that the method The law also includes : Determine at least one flag, the at least one flag being used to indicate whether a first combination is used for encoding; Determining the first combination includes: If the at least one flag indicates that the first combination is used for coding When the code is obtained, the first combination is determined.

177. The method according to claim 176, characterized in that the at least one marker packet Includes at least one of sequence-level flags, image-level flags, slice-level flags, unit-level flags, and block-level flags.

178. The claim 177 The method is characterized in that, if the at least one A logo package When including block-level flags, the determination of the first combination includes: When it is determined that the size of the current block meets the preset conditions, then Determine the first combination.

179. The claim 90-91, 93-98, 100-121, 123-175 The method, characterized in that determining the first combination includes: If it is determined that the current block is not encoded using the first technique, then the first combination is determined.

180. According to claim 11 The method described in any one of 9, 141, and 168, characterized in that determining the preset mode corresponding to the current block includes: Determine the image type corresponding to the current block; Based on the image type corresponding to the current block, determine the current block pair. The corresponding preset mode.

181. According to the rights Requirement 1 The method described in 80 is characterized in that The preset modes include at least one of DC, horizontal mode, vertical mode, and angle mode. indivual.

182. The method according to claim 180, characterized in that, the determination of the The image type corresponding to the current block includes: According to The image type corresponding to the current block is determined by describing the image type of the current image to which the current block belongs, or the image type of the current slice to which the current block belongs. 1 83. A video decoding device Its features include: A decoding unit is used to decode the bitstream to obtain a first index, which indicates a first combination, the first combination including a weight. The derived pattern and K prediction patterns, where K is a positive integer greater than 1; The determining unit is configured to determine, based on the first index, the first weighted derived pattern and K first prediction patterns included in the first combination; The prediction unit is used to predict the current block based on the first weighted derivation mode and the K first prediction modes to obtain the predicted value of the current block.

184. A video encoding apparatus, characterized in that it comprises: A determining unit is used to determine a first combination, the first combination including a first weighted derived pattern and K first prediction patterns; A prediction unit is used to predict the current block based on the first weighted derivation mode and the K first prediction modes to obtain the predicted value of the current block. An encoding unit is configured to obtain a bitstream based on the prediction value of the current block, the bitstream including a first index, the first index being used to indicate the first combination.

185. An electronic device, characterized in that it includes 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 89 or 90 to 182.

186. A video encoding and decoding system, characterized in that it comprises: a video encoder and a video decoder; The video decoder is used to implement the method described in any one of claims 1 to 89; The video encoder is used to implement the method described in any one of claims 90 to 182.

187. A computer-readable storage medium, characterized in that it is used for storing a computer program; The computer program causes the computer to perform the method as described in any one of claims 1 to 89 or 90 to 182.

188. A bitstream, characterized in that the bitstream includes a first index, the first index being used to indicate a first combination consisting of a weighted derived mode and K prediction modes, wherein K is a positive integer greater than 1.