Video Coding Method and Apparatus, Device, System, and Storage Medium

By combining a weight derivation mode with multiple prediction modes in video coding, the method reduces coding cost and maintains accurate prediction, addressing the inefficiencies of existing methods that transmit extensive syntax for each mode.

JP2025521724APending Publication Date: 2025-07-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024576787
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-07-04
Publication Date
2025-07-10

AI Technical Summary

Technical Problem

Current video coding methods require a large amount of information to be transmitted in the bitstream when using multiple prediction modes, leading to increased coding cost.

Method used

A video coding method that combines a first weight derivation mode with K first prediction modes, allowing these modes to be represented as a single combination, reducing the need to transmit syntax for each mode separately.

Benefits of technology

This approach reduces coding cost by minimizing the number of codewords needed in the bitstream while ensuring accurate prediction of video blocks, even when different prediction modes are used for multiple component coding units.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025521724000001_ABST
    Figure 2025521724000001_ABST
Patent Text Reader

Abstract

The present application provides a video coding method and apparatus, a device, a system, and a storage medium. In the present application, the first weight derivation mode and K first prediction modes are taken as one combination, and the first weight derivation mode and the K first prediction modes are represented in the form of a combination. In this way, it is not necessary to separately transmit the syntax corresponding to each of the K first prediction modes and the first weight derivation mode to the bitstream, saving the codeword and improving the coding efficiency. Further, in the present application, even when the current component block corresponds to a plurality of first component coding units (CUs) and the prediction modes of the plurality of first component CUs are not completely the same, the first weight derivation mode and the K first prediction modes included in the first combination can be accurately determined, and furthermore, the current component block can be accurately predicted using the first weight derivation mode and the K first prediction modes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of video coding, and in particular to a video coding method and apparatus, device, system, and storage medium.

Background Art

[0002] Digital video technology can be incorporated into various video devices such as digital TVs, smartphones, computers, e-readers, or video players. With the development of video technology, the amount of video data has been increasing. To facilitate the transmission of video data, video devices utilize video compression technology so that video data can be transmitted or stored more effectively.

[0003] Since there is temporal or spatial redundancy in video, the redundancy in video can be removed or reduced by prediction, thereby improving the compression efficiency. Currently, to improve the prediction effect, multiple prediction modes can be used to predict the current block. However, when using multiple prediction modes to predict the current block, a relatively large amount of information needs to be transmitted in the bitstream, resulting in an increase in coding cost.

Summary of the Invention

[0004] Embodiments of this application provide a video coding method and apparatus, device, system, and storage medium. Thereby, the coding cost can be reduced.

[0005] In a first aspect, the present application provides a video decoding method applied to a decoder. The method includes the following. Decode a bitstream to determine a first combination. The first combination includes a first weight derivation mode and K first prediction modes, where K is a positive integer greater than 1. Predict a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block. The current component block includes a second component block or a third component block.

[0006] In a second aspect, an embodiment of the present application provides a video encoding method. The method includes the following. Determine a first combination. The first combination includes a first weight derivation mode and K first prediction modes, where K is a positive integer greater than 1. Predict a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block. The current component block includes a second component block or a third component block.

[0007] In a third aspect, the present application provides a video decoding device. The device is configured to execute the method in the first aspect or each of its embodiments. Specifically, the device includes a functional unit configured to execute the method in the first aspect or each of its embodiments.

[0008] In a fourth aspect, the present application provides a video encoding device. The device is configured to execute the method in the second aspect or each of its embodiments. Specifically, the device includes a functional unit configured to execute the method in the second aspect or each of its embodiments.

[0009] In a fifth aspect, a video decoder is provided. The video decoder includes a processor and a memory. The memory is configured to store a computer program. The processor is configured to execute the method in the first aspect or each of its embodiments by calling and executing the computer program stored in the memory.

[0010] In a sixth aspect, a video encoder is provided. The video encoder includes a processor and a memory. The memory is configured to store a computer program. The processor is configured to execute the method in the second aspect or each of its embodiments by calling and executing the computer program stored in the memory.

[0011] In a seventh aspect, a video coding system is provided. The video coding system includes a video encoder and a video decoder. The video decoder is configured to execute the method in the first aspect or each of its embodiments. The video encoder is configured to execute the method in the second aspect or each of its embodiments.

[0012] In an eighth aspect, a chip is provided. The chip is configured to execute the method in the first aspect or the second aspect, or each of the embodiments of the first aspect or the second aspect. Specifically, the chip includes a processor, and the processor is configured to cause the device on which the chip is mounted to execute the method in the first aspect or the second aspect, or each of the embodiments of the first aspect or the second aspect by calling and executing a computer program from a memory.

[0013] In a ninth aspect, a computer-readable storage medium is provided. The computer-readable storage medium is configured to store a computer program, and the computer program causes a computer to execute the method in the first aspect or the second aspect, or in each embodiment of the first aspect or the second aspect.

[0014] In a tenth aspect, a computer program product is provided. The computer program product includes computer program instructions configured to cause a computer to execute the method in the first aspect or the second aspect, or in each embodiment of the first aspect or the second aspect.

[0015] In an eleventh aspect, a computer program is provided. When the computer program is executed by a computer, it is configured to cause the computer to execute the method in the first aspect or the second aspect, or in each embodiment of the first aspect or the second aspect.

[0016] In a twelfth aspect, a bitstream is provided. The bitstream is generated based on the method of the second aspect. Optionally, the bitstream includes a first index. The first index is used to indicate a first combination consisting of one weight derivation mode and K prediction modes, where K is a positive integer greater than 1.

[0017] Based on the above technical solution, in this application, the first weight derivation mode and K first prediction modes are regarded as a combination, and the first weight derivation mode and K first prediction modes are represented in the form of a combination. In this way, it is not necessary to separately transmit the syntax corresponding to each of the K first prediction modes and the first weight derivation mode in the bitstream, saving the codewords and improving the coding efficiency. Also, in the embodiments of this application, even when the current-component block corresponds to a plurality of first component coding units (CUs) and the prediction modes of the plurality of first component CUs are not completely the same, the first weight derivation mode and the K first prediction modes included in the first combination can be accurately determined. Furthermore, the current-component block can be accurately predicted using the first weight derivation mode and the K first prediction modes.

Brief Description of the Drawings

[0018]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6A

Figure 6B

Figure 7A

Figure 7B

Figure 8A

Figure 8B

Figure 8C

Figure 8D

Figure 8E

Figure 8F

Figure 8G

Figure 8H

Figure 8I

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17A

Figure 17B

Figure 17C

Figure 17D

Figure 17E

Figure 17F

Figure 18

Figure 19A

Figure 19B

Figure 20

Figure 21

Figure 22

Figure 23

Figure 24

DETAILED DESCRIPTION OF THE INVENTION

[0019] This application is applicable to the fields of image coding, video coding, hardware video coding, dedicated circuit video coding, real-time video coding, etc. For example, the technical solution of this application can be combined with the audio video coding standard (AVS). Examples of AVS include the H.264 / audio video coding (AVC) standard, the H.265 / high efficiency video coding (HEVC) standard, and the H.266 / versatile video coding (VVC) standard. Or, the technical solution of this application can be combined with other dedicated standards or industry standards, which include ITU-T H.261, ISO / IEC MPEG-1 Visual, ITU-T H.262 or ISO / IEC MPEG-2 Visual, ITU-T H.263, ISO / IEC MPEG-4 Visual, ITU-T H.264 (also known as ISO / IEC MPEG-4 AVC), including scalable video coding (SVC) and multi-view video coding (MVC) extensions. Note that the technology of this application is not limited to a specific coding standard or technology.

[0020] For ease of understanding, first, a video coding system according to an embodiment of this application will be introduced with reference to FIG. 1.

[0021] FIG. 1 is a block diagram showing a video coding system according to an embodiment of the present application. FIG. 1 is merely an example, and the video coding system according to the embodiment of the present application includes, but is not limited to, what is shown in FIG. 1. As shown in FIG. 1, the video coding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is configured to encode (which may be understood as compressing) video data to generate a bitstream and transmit the bitstream to the decoding device. The decoding device is configured to decode the bitstream generated by the encoding device to obtain the decoded video data.

[0022] The encoding device 110 according to the embodiment of the present application can be understood as a device having a video encoding function, and the decoding device 120 can be understood as a device having a video decoding function. That is, the encoding device 110 and the decoding device 120 according to the embodiment of the present application include a wider range of devices, for example, smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set top boxes (STBs), televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and the like.

[0023] In some embodiments, the encoding device 110 can transmit the encoded video data (e.g., a bitstream) to the decoding device 120 via the channel 130. The channel 130 can include one or more media and / or devices capable of transmitting the encoded video data from the encoding device 110 to the decoding device 120.

[0024] In one example, channel 130 includes one or more communication media that enable the video data encoded by encoding device 110 to be directly transmitted to decoding device 120 in real time. In this example, encoding device 110 can modulate the video data encoded according to the communication standard and transmit the modulated video data to decoding device 120. The communication media include wireless communication media such as radio frequency spectrum. Optionally, the communication media can also include wired communication media such as one or more physical transmission lines.

[0025] In another example, channel 130 includes a storage medium. The storage medium can store the video data encoded by encoding device 110. The storage medium includes various locally accessible data storage media, for example, optical discs, digital versatile discs (DVDs), flash memories, and the like. In this example, decoding device 120 can obtain the video data encoded from the storage medium.

[0026] In another example, channel 130 can include a storage server that can store the video data encoded by encoding device 110. In this example, decoding device 120 can download the encoded video data stored in the storage server from the storage server. Optionally, the storage server can store the encoded video data and transmit the encoded video data to decoding device 120. Examples of the storage server include web servers (for example, for websites), file transfer protocol (FTP) servers, and the like.

[0027] In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113. The output interface 113 can include a modulator / demodulator (modem) and / or a transmitter.

[0028] In some embodiments, in addition to the video encoder 112 and the output interface 113, the encoding device 110 can further include a video source 111.

[0029] The video source 111 can include at least one of a video collection device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system. The video input interface is configured to receive video data from a video content provider, and the computer graphics system is configured to generate video data.

[0030] The video encoder 112 generates a bitstream by encoding the video data from the video source 111. The video data can include one or more pictures or a sequence of pictures. The bitstream includes encoding information of the picture or the sequence of pictures. The encoding information can include encoded image data and related data. The related data can include a sequence parameter set (abbreviated as SPS), a picture parameter set (abbreviated as PPS), and other syntax structures. The SPS can include parameters applied to one or more sequences, and the PPS can include parameters applied to one or more pictures. The syntax structure is a set of zero or more syntax elements arranged in a specified order in the bitstream.

[0031] 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 in a storage medium or a storage server so as to be subsequently read by the decoding device 120.

[0032] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122.

[0033] In some embodiments, the decoding device 120 can further include a display device 123 in addition to the input interface 121 and the video decoder 122.

[0034] The input interface 121 includes a receiver and / or a modem. The input interface 121 can receive the encoded video data via the channel 130.

[0035] The video decoder 122 is configured to obtain the decoded video data by decoding the encoded video data and transmit the decoded video data to the display device 123.

[0036] The display device 123 displays the decoded video data. The display device 123 may be built into the decoding device 120 or provided outside the decoding device 120. The display device 123 can include various types of display devices, for example, a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.

[0037] Also, FIG. 1 is merely an example, and the technical solution of the embodiment of the present application is not limited to FIG. 1. For example, the technology of the present application is also applicable to single-sided video encoding or single-sided video decoding.

[0038] Hereinafter, the video encoding framework according to the embodiment of the present application will be described.

[0039] FIG. 2 is a block diagram showing a video encoder according to an embodiment of the present application. The video encoder 200 can be configured to perform lossy compression or lossless compression on an image. The lossless compression may be visually lossless compression or mathematically lossless compression.

[0040] The video encoder 200 is applicable to image data in a luminance-chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4. Y represents luma, Cb (U) represents blue chroma, Cr (V) represents red chroma, and U, V represent chroma for describing color and saturation. For example, in the color format, 4:2:0 indicates having four luminance components and two chroma components (YYYYCbCr) for every four pixels, 4:2:2 indicates having four luminance components and four chroma components (YYYYCbCrCbCr) for every four pixels, and 4:4:4 indicates full pixel representation (YYYYCbCrCbCrCbCrCbCr).

[0041] For example, the video encoder 200 reads video data and divides each image in the video data into several coding tree units (CTUs). In some examples, a CTU can be referred to as a "tree block", a "largest coding unit (LCU)", or a "coding tree block (CTB)". Each CTU can be associated with a pixel block having the same size as the CTU within the image, and each pixel can correspond to one luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of the CTU is, for example, 128×128, 64×64, 32×32, etc. The CTU can be further divided into several coding units (CUs) to be encoded. The CU can be a rectangular block or a square block. The CU can be further divided into a prediction unit (abbreviated as PU) and a transform unit (abbreviated as TU), so that encoding, prediction, and transformation are separated, and the processing can be made flexible. In one example, the CTU is divided into CUs in a quadtree manner, and the CU is divided into TUs and PUs in a quadtree manner.

[0042] Video encoders and video decoders can support various PU sizes. Assuming that the size of a specific CU is 2N×2N, video encoders and video decoders can support a PU size of 2N×2N or N×N for intra prediction, and can also support symmetric PUs having sizes of 2N×2N, 2N×N, N×2N, N×N, or similar for inter prediction. Video encoders and video decoders can further support asymmetric PUs having sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.

[0043] In some embodiments, as shown in FIG. 2, 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 picture buffer 270, and an entropy encoding unit 280. Note that the video encoder 200 may include more, fewer, or different functional units.

[0044] Optionally, in the present application, the current block may also be referred to as the current CU or the current PU, etc. The prediction block may also be referred to as the predicted picture block or the picture prediction block. The reconstructed picture block may also be referred to as the reconstruction block or the picture reconstruction block.

[0045] In some embodiments, the prediction unit 210 includes an inter prediction unit 211 and an intra prediction unit 212. Since there is a strong correlation between adjacent samples in a video picture, in video coding technology, the intra prediction method is used to eliminate the spatial redundancy between adjacent samples. Since there is a strong similarity between adjacent pictures in a video, in video coding technology, the inter prediction method is used to eliminate the temporal redundancy between adjacent pictures and improve the coding efficiency.

[0046] The inter prediction unit 211 can be used for inter prediction. Inter prediction may include motion estimation and motion compensation. In inter prediction, image information of different images can be referred to, and motion information is used to find a reference block from a reference image, and a prediction block is generated based on the reference block to eliminate temporal redundancy. The images used for inter prediction can be P-frames and / or B-frames. A P-frame refers to a forward prediction image, and a B-frame refers to a bidirectional prediction image. In inter prediction, motion information is used to find a reference block from a reference image, and a prediction block is generated based on the reference block. The motion information includes a reference image list including a reference image, a reference image index, and a motion vector. The motion vector can be an integer-sample motion vector or a fractional-sample motion vector. When the motion vector is a fractional-sample motion vector, it is necessary to use an interpolation filter for the reference image to generate a necessary fractional-sample block. An integer-sample block or a fractional-sample block in the reference image found based on the motion vector is called a reference block. There is a technique of using the reference block as the prediction block directly, and there is also a technique of generating a prediction block by processing based on the reference block. Generating a prediction block by processing based on the reference block can also be understood as using the reference block as the prediction block and then generating a new prediction block by processing based on the prediction block.

[0047] The intra prediction unit 212 predicts sample information in the current image block by referring only to information of the same image in order to eliminate spatial redundancy. The image used for intra prediction may be an I-frame.

[0048] Intra prediction includes various prediction modes. Taking the international digital video coding standard H series as an example, the H.264 / AVC standard includes 8 angular prediction modes and 1 non-angular prediction mode, and H.265 / HEVC is extended to 33 angular prediction modes and 2 non-angular prediction modes. The intra prediction modes used in HEVC include the Planar mode, DC (Direct Current), and 33 angular modes, a total of 35 prediction modes. The intra modes used in VVC include Planar, DC, and 65 angular modes, a total of 67 prediction modes.

[0049] Note that with the increase in the number of angular modes, intra prediction becomes more accurate and better meets the needs of the development of high-resolution and ultra-high-resolution digital videos.

[0050] The residual unit 220 can generate a residual block of the CU based on the sample 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 is equal to the difference between the sample in the sample block of the CU and the corresponding sample in the prediction block of the PU of the CU.

[0051] The transform / quantization unit 230 can quantize the transform coefficients. The transform / quantization unit 230 can quantize the transform coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. The 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.

[0052] The inverse transform / quantization unit 240 can reconstruct the residual block from the quantized transform coefficients by applying inverse quantization and inverse transform to the quantized transform coefficients respectively.

[0053] The reconstruction unit 250 can generate a reconstructed image block associated with the TU by adding the samples in the reconstructed residual block to the corresponding samples in one or more prediction blocks generated by the prediction unit 210. In this way, by reconstructing the sample blocks of each TU of the CU, the video encoder 200 can reconstruct the sample blocks of the CU.

[0054] The loop filtering unit 260 processes the inverse-transformed and inverse-quantized samples to compensate for distortion information and provide a better reference for the encoding of subsequent samples. For example, the loop filtering unit 260 can perform deblocking filtering processing to reduce the blocking artifacts of the sample blocks associated with the CU.

[0055] In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit and a sample adaptive offset (SAO) / adaptive loop filtering (ALF) unit. The deblocking filtering unit is used for deblocking, and the SAO / ALF unit is used for removing the ringing effect.

[0056] The decoding image buffer 270 can store the reconstructed sample blocks. The inter prediction unit 211 can perform inter prediction on the PUs of other images using the reference image including the reconstructed sample blocks. Also, the intra prediction unit 212 can perform intra prediction on the PUs of other images in the same image as the CU using the reconstructed sample blocks in the decoding image buffer 270.

[0057] The entropy encoding unit 280 can receive the quantized transform coefficients from the transform / quantization unit 230. The entropy encoding unit 280 can generate entropy-encoded data by performing one or more entropy encoding processes on the quantized transform coefficients.

[0058] FIG. 3 is a block diagram showing a video decoder according to an embodiment of the present application.

[0059] As shown in FIG. 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. Note that the video decoder 300 may include more, fewer, or different functional units.

[0060] The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can extract syntax elements from the bitstream by analyzing the bitstream. As part of the analysis of the bitstream, the entropy decoding unit 310 can analyze the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / transformation unit 330, the reconstruction unit 340, and the loop filtering unit 350 can decode video data based on the syntax elements extracted from the bitstream, that is, generate decoded video data.

[0061] In some embodiments, the prediction unit 320 includes an intra prediction unit 322 and an inter prediction unit 321.

[0062] The intra prediction unit 322 can generate a prediction block of a PU by performing intra prediction. The intra prediction unit 322 can generate a prediction block of a PU based on sample blocks of spatially adjacent PUs using an intra prediction mode. The intra prediction unit 322 can further determine the intra prediction mode of the PU based on one or more syntax elements parsed from the bitstream.

[0063] The inter prediction unit 321 can construct a first reference picture list (list 0) and a second reference picture list (list 1) based on syntax elements parsed from the bitstream. Also, when a PU is encoded using inter prediction, the entropy decoding unit 310 can analyze the motion information of the PU. The inter prediction unit 321 can determine one or more reference blocks of the PU based on the motion information of the PU. The inter prediction unit 321 can generate a prediction block of the PU based on one or more reference blocks of the PU.

[0064] The inverse quantization / transformation unit 330 can inverse quantize (i.e., dequantize) the transformation coefficients associated with the TU. The inverse quantization / transformation unit 330 can determine the degree of quantization using the QP value associated with the CU of the TU.

[0065] After inverse quantizing the transformation coefficients, the inverse quantization / transformation unit 330 can generate a residual block associated with the TU by applying one or more inverse transformations to the inverse quantized transformation coefficients.

[0066] The reconstruction unit 340 reconstructs the sample block of the CU using the residual block associated with the TU of the CU and the prediction block of the PU of the CU. For example, the reconstruction unit 340 can reconstruct the sample block of the CU and obtain a reconstructed image block by adding the samples in the residual block to the corresponding samples in the prediction block.

[0067] The loop filtering unit 350 can perform deblocking filtering processing so as to reduce block artifacts of a sample block associated with the CU.

[0068] 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 can transmit the reconstructed image to a display device for display.

[0069] The basic process of video coding is as follows. On the encoding side, one image (frame) is divided into blocks. For the current block, the prediction unit 210 performs intra prediction or inter prediction to generate a predicted block of the current block. The residual unit 220 can calculate a residual block based on the difference between the predicted block and the original block of the current block, that is, the difference between the predicted block and the original block of the current block. The residual block is also called residual information. The residual block is converted and quantized by the conversion / quantization unit 230, so that information that is not sensitive to the human eye can be removed and visual redundancy can be eliminated. Optionally, the residual block before being converted and quantized by the conversion / quantization unit 230 can be called a time-domain residual block, and the time-domain residual block after being converted and quantized by the conversion / quantization unit 230 can be called a frequency residual block or a frequency-domain residual block. The entropy encoding unit 280 receives the quantized transform coefficients output by the conversion / quantization unit 230, and can output a bitstream by entropy encoding the quantized transform coefficients. For example, the entropy encoding unit 280 can remove character redundancy based on the target context model and the probability information of the binary bitstream.

[0070] On the decoding side, the entropy decoding unit 310 can obtain the prediction information of the current block, the quantized coefficient matrix, etc. by analyzing the bitstream. The prediction unit 320 generates a predicted block of the current block by performing intra prediction or inter prediction on the current block based on the prediction information. The inverse quantization / transformation unit 330 uses the quantized coefficient matrix obtained from the bitstream to inverse quantize and inverse transform the quantized coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the predicted block and the residual block to obtain a reconstructed block. The reconstructed block forms a reconstructed image. The loop filtering unit 350 loop filters the reconstructed image based on the image or block to obtain a decoded image. On the encoding side as well, processing similar to that on the decoding side is required to obtain the decoded image. The decoded image may be referred to as the reconstructed image, and the reconstructed image can be a reference image for inter prediction of subsequent images.

[0071] Note that the block partitioning information determined on the encoding side, and mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc. are carried in the bitstream as necessary. The decoding side analyzes the bitstream and determines the same block partitioning information, mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc. as the encoding side by analyzing the existing information. Thereby, it is ensured that the decoded image obtained on the encoding side is the same as the decoded image obtained on the decoding side.

[0072] The above is the basic process of video coding in a block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. This application is applicable to the basic process of video coding in the block-based hybrid coding framework, but is not limited to the framework or process.

[0073] In some embodiments, the current block may be, for example, the current coding unit (CU) or the current prediction unit (PU). Due to the need for parallel processing, an image can be divided into slices, etc., and the slices within the same image can be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, and generally, one frame can be understood as one image. Also, the frame in this application can be replaced with an image or a slice, etc.

[0074] The current video coding standard, the Versatile Video Coding (VVC) being developed, has an inter prediction mode called the geometric partitioning mode (GPM). The current video coding standard, the Audio Video Coding Standard (AVS) being developed, has an inter prediction mode called the angular weighted prediction (AWP). Although these two modes differ in name and specific implementation forms, they have something in common in principle.

[0075] In the conventional unidirectional prediction, only one reference block having the same size as the current block is used. However, in the conventional bidirectional prediction, two reference blocks having the same size as the current block are used, and the value of each sample in the prediction block is the average value of the samples at the corresponding positions of the two reference blocks, that is, all samples in each reference block account for 50%. In the bidirectional weighted prediction, the ratios of the two reference blocks may be different. For example, all samples in the first reference block account for 75%, and all samples in the second reference block account for 25%. However, all samples in the same reference block have the same ratio. However, all samples in the same reference block have the same ratio. Although some other optimization methods, such as decoder side motion vector refinement (DMVR) technology, bi-directional optical flow (BIO), etc., cause some changes in the reference samples or predicted samples, they have nothing to do with the above principle. BIO may also be referred to as BDOF. Also, in GPM or AWP, two reference blocks having the same size as the current block are used. However, at some sample positions, the sample value at the corresponding position of the first reference block is used 100%, and at some other sample positions, the sample value at the corresponding position of the second reference block is used 100%. In the intersection region (or also referred to as the transition region), the sample values at the corresponding positions of these two reference blocks are used at a certain ratio. The weight of the intersection region also gradually transitions. How these weights are specifically assigned is determined by the mode of GPM or AWP. The weight of each sample position is determined based on the mode of GPM or AWP.Of course, in some cases, for example, when the block size is very small, in some GPM or AWP modes, at some sample positions, it cannot be ensured that the sample values at the corresponding positions of the first reference block are 100% utilized, and at some other sample positions, it cannot be ensured that the sample values at the corresponding positions of the second reference block are 100% utilized. In GPM or AWP, two reference blocks with sizes different from the size of the current block are utilized. That is, it is considered that the necessary part of each reference block is used as the reference block. That is, the part with a non-zero weight is used as the reference block, and the part with a weight of 0 is removed. This is a specific implementation and not the focus of the discussion of the present invention.

[0076] Exemplarily, FIG. 4 is a schematic diagram showing the weight assignment. As shown in FIG. 4, a schematic diagram of the weight assignment of a plurality of splitting modes of GPM in a 64×64 current block according to an embodiment of the present application is shown. There are 64 splitting modes in GPM. FIG. 5 is a schematic diagram showing the weight assignment. As shown in FIG. 5, a schematic diagram of the weight assignment of a plurality of splitting modes of AWP in a 64×64 current block according to an embodiment of the present application is shown. There are 56 splitting modes in AWP. In either of FIG. 4 and FIG. 5, in various splitting modes, the black area indicates that the weight value at the corresponding position of the first reference block is 0%, the white area indicates that the weight value at the corresponding position of the first reference block is 100%, and the gray area indicates that the weight value at the corresponding position of the first reference block is any weight value greater than 0% and less than 100% due to the difference in color shade. The weight value at the corresponding position of the second reference block is the value obtained by subtracting the weight value at the corresponding position of the first reference block from 100%.

[0077] The method for deriving weights in GPM is different from that in AWP. In GPM, the angle and offset are determined based on various modes, and then the weight matrices for various modes are calculated. In AWP, first a one-dimensional weight line is generated, and then the entire matrix is filled with the one-dimensional weight line using a method similar to intra-angle prediction.

[0078] In early coding techniques, regardless of the division of CU, PU, and transform unit (TU), there is only a rectangular division method. In GPM and AWP, when not divided, the non-rectangular division effect of prediction is realized. In GPM and AWP, the mask of the weights of two reference blocks, that is, the weight map, is used. From this mask, the weights of the two reference blocks for generating the prediction block are determined. Or, it can be simply understood as follows. Some positions of the prediction block are derived from the first reference block, some positions of the prediction block are derived from the second reference block, and the blending area is obtained by weighting the corresponding positions of the two reference blocks, and the transition can be made smoother. In GPM and AWP, since the current block is not divided into two CUs or PUs by a dividing line, operations such as transformation, quantization, inverse transformation, and inverse quantization of the residual after prediction are performed on the entire current block.

[0079] In GPM, the weight matrix simulates the geometric division, or more precisely, simulates the prediction division. To implement GPM, in addition to the weight matrix, two prediction values are required, and each prediction value is determined by one single-direction motion information. These two single-direction motion information are from one motion information candidate list, for example, from the merge candidate list (mergeCandList). In GPM, two indexes in the bitstream are used to determine two single-direction motion information from mergeCandList.

[0080] In inter prediction, motion information is used to represent "motion". The basic motion information includes reference frame (also called reference picture) information and motion vector (MV) information. In general bidirectional prediction, two reference blocks are used to predict the current block. As the two reference blocks, one forward reference block and one backward reference block can be used. Optionally, both of the two reference blocks can be forward reference blocks, or both can be backward reference blocks. Forward means that the time corresponding to the reference picture is before the current picture, and backward means that the time corresponding to the reference picture is after the current picture. In other words, forward means that the position of the reference picture in the video is before the current picture, and backward means that the position of the reference picture in the video is after the current picture. In other words, forward means that the POC (picture order count) of the reference picture is smaller than that of the current picture, and backward means that the POC of the reference picture is larger than that of the current picture. To be able to use bidirectional prediction, of course, it is necessary to find two reference blocks. Therefore, two sets of reference picture information and motion vector information are required. Understanding each set as one set of unidirectional motion information, combining these two sets results in one set of bidirectional motion information. When specifically implemented, the unidirectional motion information and the bidirectional motion information can use the same data structure. In the bidirectional motion information, both sets of reference picture information and motion vector information are valid, and in the unidirectional motion information, one set of the two sets of reference picture information and motion vector information is invalid.

[0081] In some embodiments, two reference picture lists are supported, denoted as RPL0 and RPL1, where RPL is an abbreviation for Reference Picture List. In some embodiments, a P slice can utilize only RPL0, while a B slice can utilize both RPL0 and RPL1. For each slice, each reference picture list has several reference pictures, and the encoder and decoder use the reference picture index to find a certain reference picture. In some embodiments, the motion information is represented by a reference picture index and a motion vector. For example, for the above bidirectional motion information, the reference picture index refIdxL0 corresponding to RPL0, the motion vector mvL0 corresponding to RPL0, and the reference picture index refIdxL1 corresponding to RPL1, and the motion vector mvL0 corresponding to RPL1 are used. The reference picture index corresponding to RPL0 and the reference picture index corresponding to RPL1 can be understood as the above reference picture information. In some embodiments, two flags are used to indicate whether the motion information corresponding to RPL0 is utilized and whether the motion information corresponding to RPL1 is utilized, respectively, and each of the two flags is denoted as predFlagL0 and predFlagL1. Also, predFlagL0 and predFlagL1 can be understood as indicating whether the above unidirectional motion information is "valid or not". Although the data structure of the motion information is not explicitly defined, the reference picture index, motion vector, and the flag of "valid or not" corresponding to each reference picture list together represent the motion information. In some standard texts, the motion information does not appear, and only the motion vector is used. The reference picture index and the flag indicating whether to utilize the corresponding motion information can be considered as appendages to the motion vector. In this application, for the sake of convenience of explanation, the term "motion information" is used, but it should be understood that it is also possible to explain using the "motion vector".

[0082] The motion information currently used for a block can be stored. Based on the adjacent position relationship, the motion information of a previously coded block (including both encoding and decoding, e.g., an adjacent block) can be used for a subsequent block to be coded in the current image. Since it utilizes spatial correlation, such coded motion information is called spatial motion information. The motion information used for each block of the current image can be stored. Based on the reference relationship, the motion information of a previously coded image can be used for a subsequent image to be coded. Since it utilizes temporal correlation, such coded motion information of the image is called temporal motion information. In the method of storing the motion information used for each block of the current image, a matrix with a fixed size such as a 4×4 matrix is used as the minimum unit, and one set of motion information is stored independently for each minimum unit. In this way, every time a block is coded, those minimum units corresponding to the position of that block can store the motion information of that block. In this way, when utilizing spatial motion information or temporal motion information, based on the position, the motion information corresponding to that position can be directly found. For example, when conventional unidirectional prediction is used for a 16×16 block, all of the 4×4 minimum units corresponding to that block store the motion information of this unidirectional prediction. When GPM or AWP is used for a block, all of the minimum units corresponding to that block determine the motion information stored in each minimum unit based on the GPM or AWP mode, the first motion information, the second motion information, and the position of each minimum unit. As one method, if all of the 4×4 samples corresponding to one minimum unit are derived from the first motion information, this minimum unit stores the first motion information. If all of the 4×4 samples corresponding to one minimum unit are derived from the second motion information, this minimum unit stores the second motion information.When a 4×4 sample corresponding to one minimum unit is derived from both the first motion information and the second motion information, in AWP, one of the two is selected and stored, and in GPM, when the two motion information indicates different reference picture lists, the two motion information are combined and stored as bidirectional motion information, and otherwise, only the second motion information is stored.

[0083] Optionally, the mergeCandList is constructed based on spatial motion information, temporal motion information, history-based motion information, and several other motion information. Exemplarily, in the mergeCandList, positions 1 to 5 in FIG. 6A are used to derive spatial motion information, and positions 6 or 7 in FIG. 6A are used to derive temporal motion information. For history-based motion information, each time a block is coded, the motion information of this block is added to a First-In First-Out (FIFO) list, and during the addition, several checks are required, such as whether it duplicates the existing motion information in the list. In this way, when coding the current block, the motion information in the history-based list can be referred to.

[0084] In some embodiments, the syntax description of GPM seems to be as shown in Table 1.

[0085]

Table 1

[0086] As shown in Table 1, in the merge mode, when the regular_merge_flag is not 1, CIIP (combined inter-intra prediction) or GPM can be used for the current block. When CIIP is not used for the current block, GPM is used for the current block, that is, the content shown in the syntax "if( !ciip_flag[x0][y0] )" in Table 1.

[0087] As shown in Table 1 above, in GPM, it is necessary to transmit three pieces of information, namely merge_gpm_partition_idx, merge_gpm_idx0, and merge_gpm_idx1, in the bitstream. x0 and y0 are used to determine the coordinates (x0, y0) of the top-left luminance sample of the current block with respect to the top-left luminance sample of the image. merge_gpm_partition_idx is used to determine the partitioning shape of GPM, which is "simulated partitioning" as described above. merge_gpm_partition_idx is the index of the weight matrix derivation mode or the weight matrix derivation mode described in this specification, or the index of the weight derivation mode or the weight derivation mode. merge_gpm_idx0 is the first merge candidate index, and the first merge candidate index is used to determine the first motion information or the first merge candidate based on mergeCandList. merge_gpm_idx1 is the second merge candidate index, and the second merge candidate index is used to determine the second motion information or the second merge candidate based on mergeCandList. It is necessary to decode merge_gpm_idx1 only when MaxNumGpmMergeCand > 2, that is, when the length of the candidate list is greater than 2. Otherwise, merge_gpm_idx1 can be directly determined.

[0088] In some embodiments, the GPM decoding process includes the following steps.

[0089] The input information in the decoding process includes the coordinates (xCb, yCb) of the top-left luminance position of the current block with respect to the top-left luminance position of the image, the width cbWidth of the luminance component of the current block, the height cbHeight of the luminance component of the current block, the luminance motion vectors mvA and mvB with 1 / 16 fractional sample accuracy, the chroma motion vectors mvCA and mvCB, the reference image indices refIdxA and refIdxB, and the prediction list flags predListFlagA and predListFlagB.

[0090] Exemplarily, motion information can be represented by a combination of a motion vector, a reference picture index, and a prediction list flag. In VVC, two reference picture lists are supported, and each reference picture list may have a plurality of reference pictures. In uni - directional prediction, only one reference block in one reference picture in one reference picture list is used as a reference, and in bi - directional prediction, one reference block in one reference picture in one reference picture list and one reference block in one reference picture in another reference picture list are used as references. In GPM in VVC, two uni - directional predictions are used. A in the above mvA and mvB, mvCA and mvCB, refIdxA and refIdxB, predListFlagA and predListFlagB can be understood as the first prediction mode, and B can be understood as the second prediction mode. Let X represent A or B, predListFlagX indicates whether the first reference picture list or the second reference picture list is used for X, refIdxX indicates the reference picture index in the reference picture list used for X, mvX indicates the luminance motion vector used for X, and mvCX indicates the chrominance motion vector used for X. Note that in VVC, motion information described in this specification can be represented by a combination of a motion vector, a reference picture index, and a prediction list flag.

[0091] The output information in the decoding process includes the (cbWidth)×(cbHeight) matrix predSamplesL of luminance prediction samples, and optionally, the (cbWidth / SubWidthC)×(cbHeight / SubHeightC) matrix of prediction samples of the Cb chrominance component, and optionally, the (cbWidth / SubWidthC)×(cbHeight / SubHeightC) matrix of prediction samples of the Cr chrominance component.

[0092] Exemplarily, the luminance component is described as an example. The processing of the chrominance component is similar to that of the luminance component.

[0093] Assume that the sizes of both predSamplesLAL and predSamplesLBL are (cbWidth) Χ (cbHeight), and they are matrices of prediction samples obtained based on two prediction modes. predSamplesL is derived based on the following method. Determine predSamplesLAL based on the luminance motion vector mvA, the chrominance motion vector mvCA, the reference image index refIdxA, and the prediction list flag predListFlagA, and determine predSamplesLBL based on the luminance motion vector mvB, the chrominance motion vector mvCB, the reference image index refIdxB, and the prediction list flag predListFlagB. That is, perform predictions based on the motion information of each of the two prediction modes, and the detailed process will not be elaborated. Usually, GPM is in the merge mode, and it can be considered that both of the two prediction modes of GPM are in the merge mode.

[0094] Based on merge_gpm_partition_idx[ xCb ][ yCb ], use Table 2 to determine the split angle index variable angleIdx and the distance index variable distanceIdx of GPM.

[0095]

Table 2

[0096] Note that since GPM can be used for any of the three components (for example, Y, Cb, Cr), in the text of some standards, the process of generating a GPM prediction sample matrix for one component is included in a sub - process called the Weighted sample prediction process for GPM. This sub - process is called for each of the three components, but only the called parameters are different. Here, only the luminance component is taken as an example. The prediction matrix predSamplesL[xL][yL] (xL = 0..cbWidth - 1, yL = 0..cbHeight - 1) of the current luminance block is derived from the weighted sample prediction process for GPM. nCbW is set to cbWidth, nCbH is set to cbHeight, and the prediction sample matrices predSamplesLAL and predSamplesLBL, angleIdx, and distanceIdx generated in two prediction modes are input.

[0097] In some embodiments, the weighted sample prediction and derivation process of GPM includes the following steps.

[0098] The inputs to this process include the width nCbW of the current block, the height nCbH of the current block, two (nCbW)×(nCbH) prediction sample matrices predSamplesLA and predSamplesLB, the GPM split - angle index variable angleIdx, the GPM distance index variable distanceIdx, and the component index variable cIdx. In this example, luminance is taken as an example. That cIdx is 0 indicates the luminance component.

[0099] The output of this process includes the prediction sample values of the (nCbW)×(nCbH) matrix pbSamples of GPM.

[0100] Exemplarily, the variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are derived based on the following method. nW = (cIdx == 0)? nCbW : nCbW * SubWidthC, nH = (cIdx == 0)? nCbH : nCbH * SubHeightC, shift1 = Max(5, 17 - BitDepth), where BitDepth is the coding bit depth. offset1 = 1 << (shift1 - 1), where "<<" means left shift. displacementX = angleIdx, displacementY = (angleIdx + 8) % 32, partFlip = (angleIdx >= 13 && angleIdx <= 27)? 0 : 1, shiftHor = (angleIdx % 16 == 8 || (angleIdx % 16!= 0 && nH >= nW))? 0 : 1.

[0101] The variables offsetX and offsetY are derived based on the following method. When the value of shiftHor is 0, offsetX = (-nW) >> 1, offsetY = ((-nH) >> 1) + (angleIdx < 16? (distanceIdx * nH) >> 3 : -((distanceIdx * nH) >> 3)). When the value of shiftHor is 1, offsetX = ( ( -nW ) >> 1 ) + ( angleIdx < 16? ( distanceIdx * nW ) >> 3 : -( ( distanceIdx * nW ) >> 3 ) ) offsetY = ( - nH ) >> 1。

[0102] The variables xL and yL are derived based on the following method. xL = ( cIdx == 0)? x : x * SubWidthC、 yL = ( cIdx == 0)? y : y * SubHeightC。

[0103] The variable wValue indicating the weight of the predicted sample at the current position is derived based on the following method. wValue is the weight of the value predSamplesLA[x][y] of the predicted sample in the prediction matrix of the first prediction mode at (x,y), and (8 - wValue) is the weight of the value predSamplesLB[x][y] of the predicted sample in the prediction matrix of the first prediction mode at (x,y).

[0104] The distance matrix disLut is determined based on Table 3.

[0105]

Table 3

[0106] 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 ).

[0107] The value of the prediction sample pbSamples[x][y] is derived based on the following method. pbSamples[x][y] = Clip3(0, (1 << BitDepth) - 1, (predSamplesLA[x][y] * wValue + predSamplesLB[x][y] * (8 - wValue) + offset1) >> shift1).

[0108] Note that for each position in the current block, one weight value is derived and one GPM prediction value pbSamples[x][y] is calculated. In this method, it is not necessary to describe the weight wValue in the form of a matrix, but if the wValue of each position is saved in a single matrix, then that matrix can be understood as the weight matrix. The principle of calculating the weight for each sample, weighting, and calculating the GPM prediction value is the same as the principle of calculating all the weights first and then uniformly weighting to calculate the GPM prediction sample matrix. The reason for using the term "weight matrix" in many descriptions of this application is to make the expression easier to understand. The figure drawn with the weight matrix is more intuitive, but actually, it can also be explained with the weights of each position. For example, the weight matrix derivation mode can also be expressed as the weight derivation mode.

[0109] In some embodiments, as shown in FIG. 6B, the GPM decoding process can be expressed as follows. Analyze the bitstream to determine whether the GPM technology is used for the current block. If the GPM technology is used for the current block, determine the weight derivation mode (or split mode, or weight matrix derivation mode), 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.

[0110] In the intra prediction method, the currently coded reconstruction samples around the current block are used as reference samples to predict the current block. FIG. 7A is a schematic diagram showing intra prediction. As shown in FIG. 7A, the size of the current block is 4×4, and the samples in the leftmost column and the uppermost row of the current block are the reference samples of the current block. In intra prediction, these reference samples are used to predict the current block. All of these reference samples may be available, that is, they may all be coded. Optionally, some of these reference samples may be unavailable. For example, the current block is at the leftmost of the entire image, and the reference sample to the left of the current block is unavailable. Or, when coding the current block, since the bottom left sample of the current block has not yet been coded, the bottom left reference sample is also unavailable. When the reference sample is unavailable, it may or may not be replenished by using the available reference samples or by using some value or some method.

[0111] FIG. 7B is a schematic diagram showing intra prediction. As shown in FIG. 7B, in the multiple reference line (MRL) intra prediction method, coding efficiency can be improved by using more reference samples. For example, four reference rows / columns are used as the reference samples of the current block.

[0112] Furthermore, there are multiple types of prediction modes for intra prediction. FIGS. 8A to 8I are schematic diagrams showing intra prediction. As shown in FIGS. 8A to 8I, in H.264, when performing intra prediction on a 4×4 block, nine modes can be included. In mode 0 shown in FIG. 8A, the samples above the current block are copied along the vertical direction to the current block as the predicted value. In mode 1 shown in FIG. 8B, the reference samples to the left of the current block are copied along the horizontal direction to the current block as the predicted value. In mode 2 (DC) shown in FIG. 8C, the average value of eight samples A to D and I to L is used as the predicted value for all samples. In modes 3 to 8 shown in FIGS. 8D to 8I, the reference samples are copied to the corresponding positions of the current block along a certain angle. Since some positions of the current block cannot exactly correspond to the reference samples, it is necessary to use the weighted average value of the reference samples or the interpolated fractional sample of the reference samples.

[0113] There are also other modes such as the Plane mode or the Planar mode. With the development of technology and the increase in block size, the number of angle prediction modes is also increasing. FIG. 9 is a schematic diagram showing the intra prediction mode. As shown in FIG. 9, for example, the intra prediction mode used in HEVC includes a Planar mode, a DC mode, and 33 angle modes, for a total of 35 prediction modes. FIG. 10 is a schematic diagram showing the intra prediction mode. As shown in FIG. 10, the intra mode used in VVC includes a Planar mode, a DC mode, and 65 angle modes, for a total of 67 prediction modes. FIG. 11 is a schematic diagram showing the intra prediction mode. As shown in FIG. 11, the intra mode used in AVS3 includes a DC mode, a Plane mode, a Bilinear mode, PCM, and 62 angle modes, for a total of 66 prediction modes.

[0114] There are also techniques to improve prediction, such as improving fractional sample interpolation of reference samples, filtering prediction samples, etc. For example, in the multiple intra prediction filter (MIPF) in AVS3, different filters are used to generate prediction values for blocks with different sizes. For samples at different positions within the same block, one type of filter is used to generate prediction values for samples close to the reference samples, and another filter is used to generate prediction values for samples far from the reference samples. In techniques for filtering prediction samples, such as the intra prediction filter (IPF) in AVS3, prediction values can be filtered using reference samples.

[0115] In intra prediction, the coding efficiency can be improved by using the intra mode coding technique that utilizes the MostprobableModes (MPM) list. An intra prediction mode of the coded neighboring blocks, an intra prediction mode derived based on the intra prediction mode of the coded neighboring blocks (e.g., adjacent modes), and general or highly probable intra prediction modes (e.g., DC, Planar, Bilinear modes, etc.) are used to form one mode list. Since the texture has spatial continuity, referring to the intra prediction mode of the coded neighboring blocks utilizes the spatial correlation. The MPM can be used for predicting the intra prediction mode. That is, the probability that the MPM is used for the current block is considered to be higher than the probability that the MPM is not used for the current block. Therefore, during binarization, fewer codewords are used for the MPM, so overhead can be saved and the coding efficiency can be improved.

[0116] In some embodiments, matrix-based intra prediction (MIP) (sometimes referred to as matrix weighted intra prediction) can be used for intra prediction. As shown in FIG. 12, to predict a block with width W and height H, in MIP, it is necessary to input R reconstructed samples in one column on the left side of the current block and W reconstructed samples in one row above the current block. In MIP, a predicted block is generated based on three steps: averaging of reference samples, matrix vector multiplication, and interpolation. Matrix vector multiplication is the core of MIP. MIP can be considered as a process of generating a predicted block by using input samples (reference samples) in a matrix vector multiplication manner. Various matrices are provided for MIP, and the difference in prediction methods is reflected in the difference in matrices. When the input samples are the same, different results can be obtained by using different matrices. Also, the processes of averaging and interpolation of reference samples are designed considering the trade-off between performance and complexity. For a block with a large size, the effect of approximating downsampling can be realized by averaging the reference samples, so the input can be adapted to a relatively small matrix. The effect of upsampling can be obtained by interpolation. In this way, it is not necessary to provide an MIP matrix for each block size, and instead, only one or several matrices with specific sizes need to be provided. As the need for compression performance increases and the performance of hardware improves, more complex MIPs may appear in the next-generation standards.

[0117] The MIP mode is somewhat similar to Planar, but obviously, the MIP mode is more complex and flexible than Planar.

[0118] In GPM, two inter-prediction blocks are combined using a weight matrix. In practice, the use of the weight matrix can be extended to combine any two prediction blocks. For example, two inter-prediction blocks, two intra-prediction blocks, one inter-prediction block and one intra-prediction block, etc. can be mentioned. Further, in screen content coding (SCC), it is possible to use an intra block copy (IBC) or a palette prediction block as one or two prediction blocks.

[0119] In this application, intra-prediction, inter-prediction, IBC prediction, and palette prediction are referred to as different prediction methods. For the sake of simplicity, they are collectively referred to as prediction modes here. The prediction mode can be understood as information based on which a coder (including both an encoder and a decoder) can generate a prediction block for the current block. For example, in intra-prediction, the prediction mode can be a certain intra-prediction mode such as DC, Planar, various intra-angle prediction modes, etc. Of course, some other auxiliary information can also be overlaid, such as the optimization method of intra-reference samples, the optimization method after the generation of the initial prediction block (such as filtering). For example, in inter-prediction, the prediction mode can be a skip mode, a merge mode, or an MMVD (merge with motion vector difference) mode, or an AMVP (advanced motion vector predition), and it can be a unidirectional prediction, or a bidirectional prediction or a multi-hypothesis predition. When unidirectional prediction is used in the inter-prediction mode, it is necessary to determine one motion information with one prediction mode, and the prediction block can be determined based on one motion information. When bidirectional prediction is used in the inter-prediction mode, it is necessary to determine two motion information with one prediction mode, and the prediction block can be determined based on two motion information.

[0120] Thus, the information that needs to be determined for GPM can be expressed as one weight derivation mode and two prediction modes. The weight derivation mode is used to determine the weight matrix or weights, and the two prediction modes are used to determine one prediction block or prediction value respectively. The weight derivation mode is sometimes called the division mode, but since it is a simulation division, it is called the weight derivation mode in this application.

[0121] The two prediction modes can be from the same or different prediction methods, and the prediction methods include, but are not limited to, intra prediction, inter prediction, IBC, and palette.

[0122] Optionally, the two prediction modes can be from the same or different prediction methods, and the prediction methods include, but are not limited to, intra prediction, inter prediction, IBC, and palette.

[0123] One specific example is as follows. GPM is currently used for the block, and this example is used for the inter-coded block and can utilize the merge modes in both intra prediction and inter prediction. As shown in Table 4, the addition of one syntax element intra_mode_idx indicates which prediction mode is the intra prediction mode. For example, intra_mode_idx being 0 indicates that both of the two prediction modes are inter prediction modes, that is, mode0IsInter is 1 and mode1IsInter is 1. Intra_mode_idx being 1 indicates that the first prediction mode is the intra prediction mode and the second prediction mode is the inter prediction mode, that is, mode0IsInter is 0 and mode1IsInter is 1. Intra_mode_idx being 2 indicates that the first prediction mode is the inter prediction mode and the second prediction mode is the intra prediction mode, that is, mode0IsInter is 1 and mode1IsInter is 0. Intra_mode_idx being 3 indicates that both of the two prediction modes are intra prediction modes, that is, mode0IsInter is 0 and mode1IsInter is 0.

[0124]

Table 4

[0125] In some embodiments, as shown in FIG. 13, the GPM decoding process can be expressed as follows. Analyze the bitstream to determine whether the GPM technique is used in the current block. If the GPM technique is used in the current block, determine the weight derivation mode (or split mode, or weight matrix derivation mode), the first prediction mode, and the second prediction mode. Determine the first prediction block based on the first prediction mode, determine the second prediction block based on the second prediction mode, 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.

[0126] The template matching method is first used for inter prediction. In template matching, several regions around the current block are used as templates by utilizing the correlation between adjacent samples. Before coding the current block, the blocks on its left and above have already been coded in the coding order. Of course, in the implementation of an existing hardware decoder, it is not always ensured that the blocks on the left and above of the current block have already been decoded before decoding the current block. Of course, what is mentioned here is an inter-block. For example, in HEVC, when generating a prediction block for an inter-coding block, no peripheral reconstructed samples are required, and the inter-block prediction process can be executed in parallel. However, for an intra-coded block, it is necessary to use the reconstructed samples on the left and above as reference samples. Theoretically, the samples on the left and above are available, that is, it can be realized by making corresponding adjustments to the hardware design. In contrast, the samples on the right and below are not available in the coding order of existing standards such as VVC.

[0127] As shown in FIG. 14, the left and upper rectangular regions of the current block are set as templates. Generally, the height of the left template is the same as the height of the current block, and the width of the upper template is the same as the width of the current block. The template may have a height or width different from that of the current block. Find the optimal matching position of the template in the reference image to determine the motion information or motion vector of the current block. This process can be described as follows. In a certain reference image, a search is performed within a certain range around a starting position. Search rules such as the search range and search step size can be set in advance. Each time it moves to a certain position, calculate the degree of matching between the template corresponding to that position and the template around the current block. The so-called degree of matching can be measured by several distortion costs such as the sum of absolute difference (SAD) and the sum of absolute transformed difference (SATD). Generally, the transformations used for SATD are the Hadamard transform, the mean-square error (MSE), etc. The smaller the values of SAD, SATD, MSE, etc., the higher the degree of matching. Calculate the cost using the predicted block of the template corresponding to that position and the reconstructed block of the template around the current block. In addition to searching for integer sample positions, it is also possible to search for fractional sample positions. Based on the position with the highest degree of matching found by the search, the motion information of the current block can be determined. Utilizing the correlation between adjacent samples, the motion information suitable for the template may be the motion information suitable for the current block. Of course, since the template matching method is not necessarily effective for all blocks, several methods can be used to determine whether the above template matching method is used for the current block. For example, a control switch is used for the current block to indicate whether the template matching method is used.One name for such a template matching method is decoder side motion vector derivation (DMVD). Both the encoder and the decoder can perform a search using a template to derive motion information, or find better motion information based on the original motion information. There is no need to transmit specific motion vectors or differences in motion vectors, and by having both the encoder and the decoder perform the search according to the same rules, the consistency of encoding and decoding is ensured. Although the compression performance can be improved by the template matching method, the decoder also needs to perform a "search", which brings a certain degree of complexity to the decoder.

[0128] The method of applying template matching to inter prediction has been described above. However, the template matching method can also be used for intra prediction. For example, a template is used to determine the intra prediction mode. Similarly for the current block, regions within a certain range above and to the left of the current block can be used as templates. For example, the left rectangular region and the upper rectangular region still shown in FIG. 14 can be cited. When coding the current block, the reconstructed samples in the template are available. This process can be described as follows. For the current block, a set of candidate intra prediction modes is determined. The candidate intra prediction modes constitute a subset of one of all available intra prediction modes. Of course, the candidate intra prediction modes may be the universal set of all available intra prediction modes. It can be determined based on the trade-off between performance and complexity. The set of candidate intra prediction modes can be determined according to MPM or some rules (e.g., equidistant screening). Calculate the cost in the template for each candidate intra prediction mode, such as SAD, SATD, MSE, etc. Use that mode to make a prediction in the template to obtain a predicted block, and calculate the cost using the predicted block and the reconstructed block of the template. The mode with a small cost may be matched by the template, and by utilizing the similarity between adjacent samples, the intra prediction mode that shows good performance in the template may be the intra prediction mode that shows good performance in the current block. Select one or more modes with a small cost. Of course, the above two steps may be repeated. For example, after selecting one or more modes with a small cost, the set of candidate intra prediction modes is determined again, the cost is calculated again for the newly determined set of candidate intra prediction modes, and one or more modes with a small cost are selected. It can also be understood as rough selection and refined selection.Determine the finally selected one intra prediction mode as the intra prediction mode of the current block, or use the finally selected multiple intra prediction modes as candidates for the intra prediction mode of the current block. Of course, it is also possible to sort the set of candidate intra prediction modes only by the template matching method. For example, sort the MPM list, that is, for each mode in the MPM list, obtain a prediction block for the template to determine the cost, and sort those modes in ascending order of cost. Generally, in the MPM list, the more forward a mode is located, the less overhead there is in the bitstream. Thereby, the compression efficiency can be improved.

[0129] The template matching method can be used to determine two prediction modes of GPM. When the template matching method is used for GPM, for the current block, one control switch can be used to control whether template matching is used for the two prediction modes of the current block, or two control switches can be used to control respectively whether template matching is used for each of the two prediction modes.

[0130] Another aspect is how to utilize template matching. For example, when GPM is used in the merge mode, in GPM in VVC for instance, one motion information is determined from the mergeCandList using merge_gpm_idxX, where X is 0 or 1. For the X-th motion information, one method is to optimize it by using the template matching method based on the above-mentioned motion information. That is, one motion information is determined from the mergeCandList based on merge_gpm_idxX, and when template matching is used for the said motion information, it is optimized based on the above-mentioned motion information by using the template matching method. Another method is not to determine one motion information from the mergeCandList using merge_gpm_idxX, but to directly perform a search based on the default motion information to determine one motion information.

[0131] When the X-th prediction mode is the intra prediction mode and the template matching method is used for the X-th prediction mode of the current block, it is not necessary to indicate the index of the intra prediction mode in the bitstream, and the intra prediction mode can be determined by using the template matching method. Or, the candidate set or the MPM list is determined by using the template matching method, and it is necessary to indicate the index of the intra prediction mode in the bitstream.

[0132] As can be seen from the above, GPM has three elements: one weight matrix and two prediction modes. The advantage of GPM is that it enables a more autonomous combination by the weight matrix. On the other hand, since more information needs to be determined in GPM, more overhead is required by the bitstream. Taking GPM in VVC as an example, GPM in VVC is used in the merge mode. In the bitstream, the weight matrix is determined by merge_gpm_partition_idx, the first prediction mode is determined by merge_gpm_idx0, and the second prediction mode is determined by merge_gpm_idx1. There are multiple possible options for each of the weight matrix and the two prediction modes. For example, there are 64 possible options for the weight matrix in VVC. In VVC, there are up to 6 possible options for each of merge_gpm_idx0 and merge_gpm_idx1. In VVC, it is stipulated that merge_gpm_idx0 and merge_gpm_idx1 are different. Accordingly, there are 65×6×5 possible options for GPM. Also, when MMVD is used for the optimization of two motion information (prediction modes), multiple possible options can be provided for each prediction mode. As a result, the number becomes quite large.

[0133] Two intra prediction modes are used in GPM, and 67 ordinary intra prediction modes in VVC are applicable to each prediction mode. When the two intra prediction modes are different, there are 64×67×66 possible options. Of course, in order to save overhead, it can be restricted that only a subset of all ordinary intra prediction modes is applicable to each prediction mode, but there are still a large number of possible options.

[0134] Currently, for one weight derivation mode and two prediction modes in GPM, according to their respective rules, it is necessary to separately transmit the required information into the bitstream. For example, one weight derivation mode has its own one or more syntax elements, the first prediction mode has its own one or more syntax elements, and the second prediction mode has its own one or more syntax elements. Of course, in the standard, it can be restricted that, in some cases, the second prediction mode and the first prediction mode must not be the same, or some optimization methods can be used for both of the two prediction modes (which can also be understood as being used for the current block). However, the three are independent in terms of the signaling (i.e., writing) and parsing of syntax elements. That is, many codewords are required to indicate the weight derivation mode and the prediction mode, resulting in a large coding overhead.

[0135] Furthermore, since there is a strong correlation between different components in the same space, in video coding technology, this correlation can be utilized to improve the compression efficiency. In some cases, in the same space, first the first component is coded, and then the second component and the third component are coded, so that some information of the first component can be used for the second component and the third component. A typical example is the cross-component linear model (CCLM) prediction. In the same CU, the samples of the chroma component can be predicted using the reconstructed samples of the luminance component. Specifically, it is as shown in the following formula. JPEG2025521724000006.jpg14127 represents the predicted value of the chroma sample at position (i, j), JPEG2025521724000008.jpg7150 represents the reconstructed value of the downsampled chroma sample at position (i, j). The parameters (α and β) of CCLM are derived based on the adjacent downsampled luminance samples and chroma samples of the current CU.

[0136] In one example, as shown in FIG. 15, the basic principle is to derive a linear model using the luminance samples and chrominance samples adjacent to the current CU, use this linear model for the current CU, and determine the predicted value of chrominance based on the reconstructed value of luminance and this linear model.

[0137] However, in some cases, since one chrominance CU may correspond to multiple luminance CUs and the prediction modes of different luminance CUs may be different, in this case, the CCLM cannot accurately predict the chrominance block with complex texture.

[0138] To solve the above technical problem, in the embodiments of the present application, the first weight derivation mode corresponding to the current component block and K first prediction modes are taken as one combination, and the first weight derivation mode and K first prediction modes are shown in the form of the combination. In this way, it is not necessary to separately transmit the syntax corresponding to each of the K first prediction modes and the first weight derivation mode to the bitstream, saving the codewords and improving the coding efficiency. Also, in the embodiments of the present application, even when the current component block corresponds to multiple first component coding units (CUs) and the prediction modes of the multiple first component CUs are not exactly the same, the first weight derivation mode and the K first prediction modes included in the first combination can be accurately determined, and further, the current component block can be accurately predicted using the first weight derivation mode and the K first prediction modes.

[0139] Hereinafter, with reference to FIG. 16, taking the decoding side as an example, the video decoding method according to the embodiments of the present application will be described.

[0140] FIG. 16 is a flowchart showing the video decoding method according to the embodiments of the present application. The embodiments of the present application are applied to the video decoder shown in FIGS. 1 and 3. As shown in FIG. 16, the method of the embodiments of the present application includes the following content.

[0141] S101: Decode the bitstream to determine the first combination.

[0142] The first combination includes a first weight derivation mode and K first prediction modes, where K is a positive integer greater than 1.

[0143] Image formats include YUV, YCrCb, RGB, etc. In the YUV format, Y represents the luminance component, and U and V each represent the chrominance components. Y is also called the first component, U is also called the second component, and V is also called the third component. In the YCrCb format, Y represents the luminance component, and Cr and Cb each represent the chrominance components. Y is also called the first component, Cr is also called the second component, and Cb is also called the third component. In some embodiments, in the RGB format, G is called the first component, B is called the second component, and R is called the third component.

[0144] In some embodiments, during coding, the first component of the CTU can be divided into at least one first component block, the second component of the CTU can be divided into at least one second component block, and the third component of the CTU can be divided into at least one third component block.

[0145] In the embodiments of the present application, the current component block is predicted using K different prediction modes. The current component block includes a second component block or a third component block.

[0146] As can be seen from the above, a prediction block is generated based on both one weight derivation mode and K prediction modes, and the prediction block is used for the current component block. That is, the weight is determined based on the first weight derivation mode, the current component block is predicted based on the K first prediction modes to obtain K prediction values, the K prediction values are weighted based on the weight to obtain the prediction value of the current component block. Thus, it can be seen that the first weight derivation mode and the K first prediction modes included in this first combination are both used for the current component block and are related to each other.

[0147] In this application, the first weight derivation mode is used to determine the weights used for the current component block. Specifically, the first weight derivation mode can be a mode for deriving weights. For a block having a predetermined length and width, one weight matrix can be derived for each weight derivation mode. For blocks having the same size, the weight matrices derived by different weight derivation modes are different.

[0148] For example, in this application, there are 56 weight derivation modes for AWP and 64 weight derivation modes for GPM.

[0149] The K different first prediction modes included in the first combination include the following examples.

[0150] Example 1: All of the K different first prediction modes are intra prediction modes. For example, the current component block is an intra-coding block and screen content coding is not applied.

[0151] Example 2: All of the K different first prediction modes are inter prediction modes. For example, the current component block is an inter-coding block.

[0152] Example 3: Among the K different first prediction modes, at least one is an intra prediction mode and at least one is an inter prediction mode.

[0153] Example 4: Among the K different first prediction modes, at least one is an intra prediction mode and at least one is a non-inter and non-intra prediction mode, such as an intra block copy (IBC) prediction mode or a palette prediction mode.

[0154] Example 5: Among the above K different first prediction modes, at least one is an inter prediction mode, and at least one is a non-inter prediction mode and a non-intra prediction mode, for example, an IBC prediction mode or a palette prediction mode, etc.

[0155] Example 6: None of the above K different first prediction modes is an intra prediction mode or an inter prediction mode. For example, one of the first prediction modes is an IBC prediction mode, and one of the first prediction modes is a palette prediction mode.

[0156] Note that the embodiments of the present application do not limit the specific types of the K different first prediction modes included in the first combination.

[0157] In some embodiments, before determining the first combination, first, it is necessary to determine whether to use K different prediction modes for the current component block to perform weighted prediction. When the decoding side determines to use K different prediction modes for the current component block to perform weighted prediction, the above S101 is executed, that is, the bitstream is decoded to determine the first combination. When the decoding side determines not to use K different prediction modes for the current component block to perform weighted prediction, the above step S101 is skipped.

[0158] In one possible embodiment, the decoding side can determine whether to use K different prediction modes for the current component block to perform weighted prediction by determining the prediction mode parameter of the current component block.

[0159] Optionally, in the embodiments of the present application, the prediction mode parameter can indicate whether the GPM mode or the AWP mode can be used for the current component block, that is, it can indicate whether K different prediction modes can be used for the current component block for prediction.

[0160] In addition, in the embodiments of the present application, the prediction mode parameter can be understood as a flag indicating whether the GPM mode or the AWP mode is used. Specifically, the encoder can use one variable as the prediction mode parameter, and thereby, the setting of the prediction mode parameter can be realized by setting the value of the variable. Exemplarily, in the present application, when the GPM mode or the AWP mode is used in the current component block, the encoder can set the value of the prediction mode parameter to indicate that the GPM mode or the AWP mode is used in the current component block. Specifically, the encoder can set the value of the variable to 1. Exemplarily, in the present application, when the GPM mode or the AWP mode is not used in the current component block, the encoder can set the value of the prediction mode parameter to indicate that the GPM mode or the AWP mode is not used in the current component block. Specifically, the encoder can set the value of the variable to 0. Further, in the embodiments of the present application, after completing the setting of the prediction mode parameter, the encoder can signal the prediction mode parameter to the bit stream and transmit it to the decoder. Thereby, after analyzing the bit stream, the decoder can obtain the prediction mode parameter.

[0161] Based on the above, the decoding side decodes the bit stream to obtain the prediction mode parameter, and further determines whether to use the GPM mode or the AWP mode in the current component block based on the prediction mode parameter. When the GPM mode or the AWP mode flag is used in the current component block, that is, when prediction is performed using K different prediction modes, the weight derivation mode of the current component block is determined.

[0162] In some embodiments, as shown in Table 5, in the embodiments of the present application, conditions can also be imposed on the use of the GPM mode or the AWP mode in the current component block. That is, when it is determined that the current component block meets the preset conditions, it is determined to use K prediction modes in the current component block for weighted prediction. Further, the decoding side decodes the bitstream to determine the first combination.

[0163] Exemplarily, when using the GPM mode or the AWP mode, the size of the current component block can be restricted.

[0164] In addition, in the prediction method according to the embodiments of the present application, it is necessary to generate K prediction values using each of the K different prediction modes, weight the K prediction values based on weights, and obtain the prediction value of the current component block. In order to reduce complexity and considering the trade-off between compression performance and complexity, in the embodiments of the present application, it is possible to restrict the use of the GPM mode or the AWP mode for blocks having a certain specific size. Therefore, in the present application, the decoder can first determine the size parameter of the current component block, and then determine whether to use the GPM mode or the AWP mode for the current component block according to the size parameter.

[0165] In the embodiments of the present application, the size parameter of the current component block can include the height and width of the current component block. Therefore, the decoder can determine whether to use the GPM mode or the AWP mode for the current component block based on the height and width of the current component block.

[0166] Exemplarily, in the present application, when the width is greater than the first threshold and the height is greater than the second threshold, it is determined that the GPM mode or the AWP mode can be used for the current component block. As can be seen from the above, one possible limitation is that the GPM mode or the AWP mode can be used only when the width of the block is greater than the first threshold (or equal to or greater than the first threshold) and the height of the block is greater than the second threshold (or equal to or greater than the second threshold). The values of the first threshold and the second threshold may be, for example, 4, 8, 16, 32, 128, 256, etc., and the first threshold may be equal to the second threshold.

[0167] Exemplarily, in the present application, when the width is less than the third threshold and the height is greater than the fourth threshold, it is determined that the GPM mode or the AWP mode can be used for the current component block. As can be seen from the above, one possible limitation is that the GPM mode or the AWP mode can be used only when the width of the block is less than the third threshold (or equal to or less than the third threshold) and the height of the block is greater than the fourth threshold (or equal to or greater than the fourth threshold). The values of the third threshold and the fourth threshold may be, for example, 4, 8, 16, 32, 128, 256, etc., and the third threshold may be equal to the fourth threshold.

[0168] Furthermore, in the embodiments of the present application, by restricting the sample parameters, the size of the block for which the GPM mode or the AWP mode can be used can be restricted.

[0169] Exemplarily, in the present application, the decoder can first determine the sample parameters of the current component block, and then determine whether the GPM mode or the AWP mode can be used for the current component block based on the sample parameters and the fifth threshold. As can be seen from the above, one possible limitation is that the GPM mode or the AWP mode can be used only when the number of samples in the block is greater than the fifth threshold (or equal to or greater than the fifth threshold). The value of the fifth threshold may be, for example, 4, 8, 16, 32, 128, 256, 1024, etc.

[0170] That is, in the present application, the GPM mode or the AWP mode can be used for the current component block only under the condition that the size parameter of the current component block meets the size requirement.

[0171] Exemplarily, in the present application, there may be an image-level flag for determining whether the present application is used for the current image to be decoded. For example, the present application can be configured to be used for an intra-frame (e.g., I-frame) and not used for an inter-frame (e.g., B-frame, P-frame). Or, the present application can be configured not to be used for an intra-frame and to be used for an inter-frame. Or, the present application can be configured to be used for a part of an inter-frame and not used for another part of the inter-frame. Since intra prediction can be used for an inter-frame, the present application may also be used for an inter-frame.

[0172] In some embodiments, there may also be a flag below the image level and above the CU level (e.g., tile, slice, patch, LCU, etc.) for determining whether to use the present application in this region.

[0173] The embodiments of the present application do not limit the specific method for decoding the bitstream in S101 above to determine the first combination.

[0174] In some embodiments, the first combination is a preset combination. That is, the decoding side decodes the bitstream. When it is determined to perform prediction using the first combination for the current component block, the preset combination is determined as the first combination, and the current component block is predicted using the first weight derivation mode and the K first prediction modes included in the first combination.

[0175] In some embodiments, a first combination is determined from a plurality of preset combinations. For example, the plurality of preset combinations include any number of combinations such as two, three, four, five, six, seven, eight, nine, etc. Assuming that there are eight combinations, each combination includes one weight derivation mode and K prediction modes, and the eight combinations have different flags (or indexes), the decoding side can decode the bitstream to obtain a first index used to indicate the first combination. Next, query the combination corresponding to the first index from these plurality of preset combinations, and determine the combination corresponding to the first index as the first combination.

[0176] In some embodiments, both the decoding side and the encoding side determine a list. Since the list includes a plurality of candidate combinations, it is also called a list of candidate combinations. From this list of candidate combinations, a first combination corresponding to the first index is determined. In this case, S101 includes the following steps.

[0177] S101-A: Decode the bitstream to determine a list of candidate combinations. The list of candidate combinations includes at least one candidate combination, and any one of the at least one candidate combination includes one weight derivation mode and K prediction modes.

[0178] S101-B: Determine the first combination based on the list of candidate combinations.

[0179] The above list of candidate combinations includes at least one candidate combination, and any one of the at least one candidate combination includes one weight derivation mode and K prediction modes.

[0180] Exemplarily, the list of candidate combinations is shown in Table 5.

[0181]

Table 5

[0182] As shown in Table 5, the list of candidate combinations includes at least one candidate combination, and it is not the case that any two candidate combinations among the at least one candidate combination are exactly the same. That is, for any two candidate combinations, at least one of the weight derivation mode and the K prediction modes is different. For example, the weight derivation mode in candidate combination 1 is different from the weight derivation mode in candidate combination 2. Or, the weight derivation mode in candidate combination 1 is the same as the weight derivation mode in candidate combination 2, but at least one of the K prediction modes in candidate combination 1 and the K prediction modes in candidate combination 2 is different. Or, the weight derivation mode in candidate combination 1 is different from the weight derivation mode in candidate combination 2, and at least one of the K prediction modes in candidate combination 1 and the K prediction modes in candidate combination 2 is different.

[0183] Exemplarily, in Table 5 above, the order of the candidate combinations in the list of candidate combinations is used as the index of the candidate combination. Optionally, the index of the candidate combination in the list of candidate combinations may be represented in other ways. In the embodiments of the present application, it is not limited thereto.

[0184] In this embodiment, the methods by which the decoding side determines the first combination based on the list of candidate combinations include, but are not limited to, the following several methods.

[0185] Method 1: The list of candidate combinations includes one candidate combination. In this case, the candidate combination included in the list of candidate combinations is determined as the first combination.

[0186] Method 2: The list of candidate combinations includes a plurality of candidate combinations. In this case, the bitstream is decoded to obtain a first index. The first index is used to indicate the first combination. The candidate combination corresponding to the first index in the list of candidate combinations is determined as the first combination.

[0187] In this method 2, on the decoding side, the bitstream is decoded to obtain a first index, the list of candidate combinations shown in Table 5 above is determined, and queried from the list of candidate combinations based on the first index to obtain the first combination indicated by the first index.

[0188] For example, the first index is index 1. In the list of candidate combinations shown in Table 5, the candidate combination corresponding to index 1 is candidate combination 2. That is, the first combination indicated by the first index is candidate combination 2. In this way, on the decoding side, the weight derivation mode and K prediction modes included in candidate combination 1 are determined as the first weight derivation mode and K first prediction modes included in the first combination, and the current component block is predicted using the first weight derivation mode and K first prediction modes to obtain the predicted value of the current component block.

[0189] In the embodiments of the present application, the encoding side and the decoding side may each determine the same list of candidate combinations. For example, both the encoding side and the decoding side determine a list including N candidate combinations. Each candidate combination includes one weight derivation mode and K prediction modes. When N is greater than 1, the encoding side only needs to signal in the bitstream the only one candidate combination (for example, the first combination) finally selected. The decoding side analyzes the first combination finally selected by the encoding side. Specifically, the decoding side decodes the bitstream to obtain the first index, and determines the first combination from the list of candidate combinations determined by the decoding side based on the first index.

[0190] The embodiments of the present application do not limit the form of the specific syntax elements of the first index.

[0191] In one possible embodiment, when predicting the current component block using the GPM technology, the first index is indicated by gpm_cand_idx.

[0192] 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.

[0193] In one example, Table 6 shows the syntax after adding the first index to the bitstream.

[0194] [Table 6]

[0195] gpm_cand_idx is the first index.

[0196] In the embodiments of the present application, in order to save codewords and reduce the coding cost, the first weight derivation mode corresponding to the current component block and K first prediction modes are taken as one combination, that is, the first combination, and the first index is used to indicate the first combination. Compared with the case of respectively indicating the first weight derivation mode and the K first prediction modes, in the embodiments of the present application, since the number of codewords used is reduced, the coding cost is reduced.

[0197] Hereinafter, a specific processor for determining the list of candidate combinations in S101-A will be described.

[0198] In some embodiments, the list of candidate combinations is preset.

[0199] In some embodiments, the list of candidate combinations is transmitted from the encoding side to the decoding side. For example, before encoding the current component block, the encoding side transmits the list of candidate combinations to the decoding side.

[0200] In some embodiments, the list of candidate combinations is uploaded from the encoding side to the cloud, and the decoding side can read the list of candidate combinations from the cloud.

[0201] In some embodiments, the list of candidate combinations is constructed by the decoding side.

[0202] The embodiments of the present application do not limit the manner in which the decoding side constructs the list of candidate combinations. For example, using the information related to the current component block, analyze the probabilities of each combination consisting of different weight derivation modes and different prediction modes, and construct the list of candidate combinations according to the probabilities of each combination.

[0203] Optionally, the information related to the current component block includes the mode information of the adjacent blocks of the current component block, the reconstructed samples of the first component block corresponding to the current component block, etc.

[0204] In some embodiments, the decoding side constructs the list of candidate combinations according to the following steps of S101-A1.

[0205] S101-A1: Decode the bitstream to determine the first component block corresponding to the current component block.

[0206] S101-A2: Construct the list of candidate combinations based on the first component block.

[0207] Currently, in video coding, an image is divided into blocks for processing. For example, in VVC, an image is divided into CTUs. The allowed size of a CTU in VVC is 128×128. A CTU can be further divided into more flexible CUs. VVC supports binary tree partitioning, ternary tree partitioning, and quadtree partitioning. For example, FIGS. 17A to 17D are schematic diagrams showing vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning, respectively.

[0208] FIG. 17E is a schematic diagram showing CTU partitioning. Quadtree partitioning is used for the blocks with thick frame lines, and binary tree partitioning and ternary tree partitioning are used for the blocks with thin frame lines. As can be seen from the figure, some of the divided blocks can be further divided. Of course, some limitations are provided considering the trade-off between performance and complexity. The embodiments of the present application are not limited thereto.

[0209] Currently, in video coding, the YUV4:2:0 format is most commonly supported. Y represents the luminance component, and U and V each represent the chrominance components. In the YUV4:2:0 format, taking advantage of the characteristic that the human eye is sensitive to luminance but not to chrominance, the sampling rate of chrominance is reduced compared to luminance. That is, in both the horizontal and vertical directions, for every two samples of the luminance component, there corresponds one sample of the chrominance component U or one sample of the chrominance component V. This helps improve the compression efficiency. Since the human eye is sensitive to luminance but not to chrominance, the luminance component is considered more important. Therefore, in general video coding standards, the luminance component is encoded first, and then the chrominance components are encoded.

[0210] Regarding block partitioning, in some embodiments, the same block partitioning method is used for the luminance component and the chrominance components.

[0211] However, since the sampling rate of chroma is low and the quality requirement for chroma is usually not as high as that for luminance, in some embodiments, the block division of the chroma component may be different from the block division of the luminance component. For example, as shown in FIG. 17F, the block division of the luminance component on the left is finer than the block division of the chroma component on the right.

[0212] In video coding, not only the YUV4:2:0 format but also other formats such as YUV4:4:4, YUV4:2:1, and RGB are supported.

[0213] As shown in FIG. 17F, assume that the current component block is the gray component block on the right, and the first component block in the same space as the gray component block is the gray area on the left in FIG. 17F, and there are 10 first component CUs in the left gray area.

[0214] As can be seen from FIG. 17F above, the first component block in the same space as the current component block refers to the first component block that is in the same spatial position as the current component block and has the same spatial size. Taking the case where the current component block is a chroma block and the first component block is a luminance block as an example, due to different video formats, the size of the chroma block and the size of the luminance block may be different. For example, in the case of a video in the YUV4:4:4 format, the size of the chroma block and the size of the luminance block are the same. In the case of a video in the YUV4:2:0 format, the size of the luminance block is 4 times the size of the chroma block.

[0215] Since the size of the chroma block and the size of the luminance block may be different, the chroma block and the luminance block that are at the same spatial position and have the same spatial size may not have the same coordinates. For example, in the video format YUV4:2:0, the chroma block is a block determined based on the coordinates (x0, y0) of the upper left corner, the width width, and the height height, and the luminance block in the same space can be a block determined based on the coordinates (x0*2, y0*2) of the upper left corner, the width width*2, and the height height*2. As another example, in the video format YUV4:4:4, the chroma block is a block determined based on the coordinates (x0, y0) of the upper left corner, the width width, and the height height, and the luminance block in the same space can be a block determined based on the coordinates (x0, y0) of the upper left corner, the width width, and the height height.

[0216] Furthermore, in some embodiments, since independent block splitting is used for each of the chroma block and the luminance block, the luminance block corresponding to the chroma decoding block does not match the decoding block obtained by splitting the luminance component, and may be a luminance region corresponding to the chroma decoding block in terms of spatial position and spatial size. That is, in the embodiments of the present application, the first component block corresponding to the current component block can be understood as a first component block having the same spatial range as the current component block.

[0217] In the case of decoding, usually, the luminance component is first decoded, and then the chroma component is decoded. Therefore, in the embodiments of the present application, when decoding the current component block, first decode the bitstream, decode the first component block corresponding to the current component block to obtain the reconstructed value of the first component block. Then, use the first component block as a template for the current component block and decode the current component block.

[0218] Since the first component block corresponds to the current component block and is related to the current component block, in the embodiments of the present application, a list of candidate combinations of the current component block is constructed based on the first component block.

[0219] For example, for each combination, the first component block is predicted using that combination to obtain a predicted value of the first component block corresponding to each combination, and a list of candidate combinations is constructed based on the predicted value of the first component block corresponding to each combination. For example, for each combination, the weight of the first component block is derived using the weight derivation mode included in the combination, the first component block is predicted using each of the K prediction modes included in the combination to obtain K predicted values of the first component block, the K predicted values of the first component block are weighted based on the derived weight of the first component block to obtain a predicted value of the first component block corresponding to the combination. Finally, a list of candidate combinations is constructed based on the predicted value of the first component block corresponding to each combination.

[0220] Note that the above weight derived based on the weight derivation mode can be understood as the weight corresponding to each sample in the first component block or the weight matrix corresponding to the first component block. When determining the predicted value of the first component block based on the weight, K predicted values corresponding to each sample in the first component block are determined, and the predicted value corresponding to each sample can be determined based on the K predicted values and the weight corresponding to each sample. The predicted values corresponding to each sample in the first component block constitute the predicted value of the first component block. Optionally, determining the predicted value of the first component block based on the weight can be performed based on the block. For example, the predicted value of the first component block can be determined, and the K predicted values of the first component block can be weighted based on the weight matrix of the first component block to obtain the predicted value of the first component block.

[0221] In some embodiments, S101 - A2 includes the following steps S101 - A21 to S101 - A23.

[0222] S101 - A21: Determine R second combinations. Any one of the R second combinations includes one weight derivation mode and K prediction modes, and R is a positive integer greater than 1.

[0223] S101 - A22: For any one of the R second combinations, determine the cost corresponding to that second combination when predicting the first component block using that second combination.

[0224] S101 - A23: Construct a list of candidate combinations based on the costs corresponding to each of the R second combinations.

[0225] In this embodiment, when constructing the list of candidate combinations, the decoding side first determines R second combinations. In this application, the specific number of the R second combinations is not limited. For example, it can be 8, 16, 32, etc. Each of the R second combinations includes one weight derivation mode and K prediction modes. Next, for each of the R second combinations, determine the cost corresponding to that second combination when predicting the first component block using that second combination. Finally, construct a list of candidate combinations based on the costs corresponding to each of the R second combinations.

[0226] Since the first component block corresponding to the current component block is in the reconstructed area, the decoding side can obtain the reconstructed value of the first component block. Thereby, for each of the R second combinations, based on the predicted value and the reconstructed value of the first component block corresponding to that second combination, the prediction distortion cost corresponding to that second combination can be determined. The method for determining the cost corresponding to the second combination includes, but is not limited to, SAD, SATD, SEE, etc. Next, construct a list of candidate combinations based on the costs corresponding to each of the R second combinations.

[0227] In an embodiment of the present application, determining the cost corresponding to the second combination when predicting the first component block using the second combination in S101-A22 includes at least the following two methods.

[0228] In the first method, based on the weight derivation mode included in the second combination, the weight of the first component block is determined. Predict the first component block based on the K prediction modes in the second combination to obtain K predicted values of the first component block. Based on the weight of the first component block, weight the K predicted values of the first component block to obtain the predicted value of the first component block corresponding to the second combination. Based on the predicted value of the first component block corresponding to the second combination and the reconstruction value of the first component block, determine the cost corresponding to the second combination.

[0229] In the second method, based on the weight derivation mode in the second combination, determine the predicted value of the first component block corresponding to each of the K prediction modes in the second combination. Based on the predicted value of the first component block corresponding to each of the K prediction modes in the second combination and the reconstruction value of the first component block, determine the cost corresponding to each of the K prediction modes in the second combination. Based on the cost corresponding to each of the K prediction modes in the second combination, determine the cost corresponding to the second combination.

[0230] In the second method, taking K = 2 as an example, the weights of the first component block can be simplified to have only two possibilities, 0 and 1. For each sample position, the sample value is from only the prediction block corresponding to the first prediction mode or the prediction block corresponding to the second prediction mode. Therefore, for one prediction mode, calculate the cost of the first component block when setting that prediction mode as the first prediction mode in a certain weight derivation mode, that is, calculate only the cost of some samples where the weight in the first component block is 1 when setting that prediction mode as the first prediction mode in that weight derivation mode. In one example, the cost is denoted as cost[pred_mode_idx][gpm_idx][0], where pred_mode_idx represents the index of that prediction mode, gpm_idx represents the index of that weight derivation mode, and 0 represents setting that prediction mode as the first prediction mode.

[0231] Then, calculate the cost of the first component block when setting that prediction mode as the second prediction mode in a certain weight derivation mode, that is, calculate only the cost of some samples where the weight in the first component block is 1 when setting that prediction mode as the second prediction mode in that weight derivation mode. In one example, the cost is denoted as cost[pred_mode_idx][gpm_idx][1], where pred_mode_idx represents the index of that prediction mode, gpm_idx represents the index of that weight derivation mode, and 1 represents setting that prediction mode as the second prediction mode.

[0232] When calculating the cost corresponding to a combination, the above two corresponding costs can be directly added. As an example, when calculating the costs corresponding to prediction modes pred_mode_idx0 and pred_mode_idx1 in weight derivation mode gpm_idx (pred_mode_idx0 is the first prediction mode, pred_mode_idx1 is the second prediction mode, and the cost is denoted as costTemp), costTemp = cost[pred_mode_idx0][gpm_idx][0] + cost[pred_mode_idx1][gpm_idx][1]. When calculating the costs corresponding to prediction modes pred_mode_idx0 and pred_mode_idx1 in weight derivation mode gpm_idx (pred_mode_idx1 is the first prediction mode, pred_mode_idx0 is the second prediction mode, and the cost is denoted as costTemp), costTemp = cost[pred_mode_idx1][gpm_idx][0] + cost[pred_mode_idx0][gpm_idx][1].

[0233] One advantage of doing this is that calculating the cost after obtaining the prediction block by weighting is simplified to directly calculating two costs and then adding the two costs to obtain the cost corresponding to the combination. Since one prediction mode may be combined with multiple other prediction modes, and the costs when considering that prediction mode as the first prediction mode and as the second prediction mode for the same weight derivation mode are fixed, by reusing these costs, i.e., cost[pred_mode_idx][gpm_idx][0] and cost[pred_mode_idx][gpm_idx][1] in the above example, the computational complexity can be reduced.

[0234] Based on the above method, the cost corresponding to each of the R second combinations can be determined, and then S101 - A23 is executed.

[0235] The method of constructing a list of candidate combinations based on the cost corresponding to each of the R second combinations in S101-A23 includes, but is not limited to, the following examples.

[0236] In Example 1, based on the cost corresponding to each of the R second combinations, the R second combinations are sorted. The sorted R second combinations are determined as the list of candidate combinations.

[0237] The list of candidate combinations generated in this Example 1 includes R candidate combinations.

[0238] Optionally, the R candidate combinations in the list of candidate combinations are sorted in ascending order of cost. That is, the costs corresponding to the R candidate combinations in the list of candidate combinations gradually increase according to the sorting order.

[0239] Sorting the R second combinations based on the cost corresponding to each of the R second combinations may be sorting the R second combinations in ascending order of cost.

[0240] In Example 2, based on the cost corresponding to the second combination, N second combinations are selected from the R second combinations, and the list consisting of these N second combinations is determined as the list of candidate combinations.

[0241] Optionally, the above N second combinations are the first N second combinations with the smallest costs among the R second combinations. For example, based on the cost corresponding to each of the R second combinations, N second combinations with the smallest costs are selected from the R second combinations, and the list of candidate combinations is constituted by these N second combinations. In this case, the list of candidate combinations includes N candidate combinations.

[0242] Optionally, the N candidate combinations in the list of candidate combinations are sorted in ascending order of cost. That is, the costs corresponding to the N candidate combinations in the list of candidate combinations gradually increase according to the sorting order.

[0243] Next, the process of determining the R second combinations in the above S101-A21 will be described.

[0244] In some embodiments, the R second combinations are preset. In this way, each of the R preset second combinations is used to predict the first component block to obtain the predicted value of the first component block corresponding to each second combination. Next, based on the predicted value of the first component block corresponding to each second combination and the reconstructed value of the first component block, the cost corresponding to each second combination is determined. Based on the cost corresponding to each second combination, the R second combinations are sorted, and the sorted R second combinations are used as a list of candidate combinations, or N second combinations with the smallest cost are selected from the sorted R second combinations to form a list of candidate combinations.

[0245] In some embodiments, S101-A21 includes the following steps.

[0246] S101-A21-1: Determine P weight derivation modes and Q prediction modes. P is a positive integer, and Q is a positive integer greater than or equal to K.

[0247] S101-A21-2: Based on the P weight derivation modes and Q prediction modes, construct R second combinations. Any one of the R second combinations includes one of the P weight derivation modes and K of the Q prediction modes. P is a positive integer, and Q is a positive integer greater than or equal to K.

[0248] In this embodiment, on the decoding side, first, P weight derivation modes and Q prediction modes are determined, and then, based on the determined P weight derivation modes and Q prediction modes, R second combinations are constructed.

[0249] As an example, the second combination includes one weight derivation mode and two prediction modes. Assuming that the P weight derivation modes are weight derivation mode 1 and weight derivation mode 2, and the Q prediction modes are prediction mode 1, prediction mode 2, and prediction mode 3, these two weight derivation modes and three prediction modes can form 2×3×2, that is, 12 second combinations.

[0250] In the embodiments of the present application, the specific numbers of the above-mentioned P weight derivation modes and Q prediction modes are not limited.

[0251] In one possible embodiment, assume that the current component block is an intra coding block, there are 64 possible weight derivation modes in the GPM, and there are 67 possible intra prediction modes in the GPM. These can be found from the VVC standard. However, it is not limited to only 64 possible weights in the GPM, nor is it limited to specific 64 types. The selection of 64 types of GPM in VVC takes into account the trade-off between improving the prediction effect and reducing the overhead of the bitstream. Also, in the present application, since fixed logic is no longer used to encode the weight derivation mode, theoretically, more diverse weights can be used in the present application and can be used more flexibly. Similarly, it is not limited to only 67 intra prediction modes in the GPM, nor is it limited to specific 67 types. Theoretically, all possible intra prediction modes can be used in the GPM. For example, if the intra angle prediction mode is made finer and more intra angle prediction modes are generated, more intra angle prediction modes can also be used in the GPM. For example, the MIP mode in VVC can also be used in the present application, but considering that there are multiple sub-modes in MIP and they are selectable, MIP is not added to this embodiment here for ease of understanding. There is also a wide-angle mode, which can also be used in the present application, but the description is omitted in this embodiment.

[0252] Assume K = 2, and the above K prediction modes include the first prediction mode and the second prediction mode. Assume that there are 67 available prediction modes in total (i.e., Q = 67). There are 67 possibilities for the first prediction mode. Since the second prediction mode is different from the first prediction mode, there are 66 possibilities for the second prediction mode. Assume that there are 64 weight derivation modes (i.e., P = 64). In this application, one second combination can be constructed using any two different prediction modes and any one weight derivation mode, and there are a total of 64 * 67 * 66 possible second combinations.

[0253] In this embodiment, the P weight derivation modes are all possible weight derivation modes, for example, 64 weight derivation modes in GPM. The Q prediction modes are all possible prediction modes, for example, 67 intra prediction modes in GPM. Using exhaustive enumeration, all possible second combinations are obtained, for example, 64 * 67 * 66 possible second combinations. Each of these 64 * 67 * 66 possible second combinations is used to predict the first component block, calculate the distortion cost of each second combination, and obtain a list of candidate combinations corresponding to the current component block based on the distortion cost of each second combination.

[0254] In some embodiments, in order to reduce the data volume and increase the construction speed of the candidate combination list, instead of trying all prediction modes, some prediction modes can be selected for testing.

[0255] In this case, the embodiments for determining the Q prediction modes in S101 - A21 - 1 include, but are not limited to, the following several methods.

[0256] Method 1: The Q prediction modes are pre - set prediction modes.

[0257] Method 2: Determine at least one of a candidate prediction mode list of the current component block, a list of alternative prediction modes corresponding to each of the K first prediction modes, a prediction mode corresponding to a weight derivation mode, and a preset mode. Determine Q prediction modes based on at least one of a candidate prediction mode list of the current component block, a list of alternative prediction modes corresponding to each of the K first prediction modes, a prediction mode corresponding to a weight derivation mode, and a preset mode.

[0258] The list of candidate prediction modes includes a plurality of candidate prediction modes, and the list of alternative prediction modes corresponding to any one of the K prediction modes includes at least one alternative prediction mode.

[0259] For example, the Q prediction modes are determined based on the list of candidate prediction modes of the current component block.

[0260] As another example, the Q prediction modes are determined based on the list of alternative prediction modes corresponding to each of the K first prediction modes.

[0261] As another example, the Q prediction modes are determined based on the prediction mode corresponding to the weight derivation mode.

[0262] As another example, the Q prediction modes are determined based on the preset mode.

[0263] As another example, the Q prediction modes are determined based on the list of candidate prediction modes of the current component block and the list of alternative prediction modes corresponding to each of the K first prediction modes.

[0264] As another example, the Q prediction modes are determined based on the list of candidate prediction modes of the current component block and the prediction mode corresponding to the weight derivation mode.

[0265] As another example, the Q prediction modes are determined based on a list of preliminary prediction modes corresponding to each of the K first prediction modes, and a prediction mode corresponding to a weight derivation mode.

[0266] As another example, the Q prediction modes are determined based on a list of candidate prediction modes, a list of preliminary prediction modes corresponding to each of the K first prediction modes, and a prediction mode corresponding to a weight derivation mode.

[0267] As another example, the Q prediction modes are determined based on a list of candidate prediction modes, a list of preliminary prediction modes corresponding to each of the K first prediction modes, a prediction mode corresponding to a weight derivation mode, and a preset mode.

[0268] Determining the list of preliminary prediction modes corresponding to each of the K first prediction modes can be understood as follows. For each of the K first prediction modes, one list of preliminary prediction modes is determined. Then, when constructing the second combination, a certain prediction mode in the second combination is selected from the list of preliminary prediction modes corresponding to that prediction mode. For example, when K = 2, the K first prediction modes include the first prediction mode and the second prediction mode. The decoding side constructs a list of preliminary prediction modes 1 for the first prediction mode and a list of preliminary prediction modes 2 for the second prediction mode. In this way, when constructing different second combinations at a later stage, one preliminary prediction mode is selected from the list of preliminary prediction modes 1 as the first prediction mode, and one preliminary prediction mode is selected from the list of preliminary prediction modes 2 as the second prediction mode. In this way, one weight derivation mode, the currently selected first prediction mode, and the second prediction mode are used to construct one second combination.

[0269] Embodiments of the present application do not limit the method for determining the list of preliminary prediction modes corresponding to each of the K first prediction modes.

[0270] In one possible embodiment, for any one of the K first prediction modes, a list of candidate prediction modes corresponding to the prediction mode and at least one of the prediction modes corresponding to the weight derivation mode are determined. Based on the list of candidate prediction modes and at least one of the prediction modes corresponding to the weight derivation mode, a list of preliminary prediction modes corresponding to the prediction mode is determined.

[0271] In the embodiments of the present application, the process of determining the list of candidate prediction modes corresponding to a certain prediction mode among the K first prediction modes is basically similar to the process of determining the list of candidate prediction modes corresponding to the current component block. Specifically, the following description can be referred to.

[0272] In some embodiments, the list of candidate prediction modes includes one or more inter prediction modes, for example, includes at least one of skip, merge, normal inter prediction mode, uni-directional prediction, bi-directional prediction, multi-hypothesis prediction, etc.

[0273] In some embodiments, the list of candidate prediction modes includes one or more intra prediction modes, for example, includes at least one of DC mode, Planar mode, angular mode, etc. Optionally, the list of candidate prediction modes includes at least one intra prediction mode within the MPM list.

[0274] In some embodiments, the list of candidate prediction modes further includes modes such as IBC, palette, etc.

[0275] The present application does not limit the types and numbers of prediction modes included in the list of candidate prediction modes.

[0276] In some embodiments, the list of candidate prediction modes is determined based on at least one of the following methods.

[0277] Method 1: The list of the candidate prediction modes includes pre-set modes.

[0278] Method 2: The list of the candidate prediction modes includes the modes in the MPM list.

[0279] In some embodiments, the list of the first candidate intra prediction modes may be the MPM list of the current component block. For example, in VVC, for the current component block, an MPM list with a length of 6 can be obtained. Also, in some subsequent technological evolutions, there is a secondary MPM solution, and an MPM list with a length of 22 can be derived, that is, the sum of the length of the first MPM list and the length of the second MPM list is 22. In other words, in the embodiments of the present application, the MPM can be used to screen the intra prediction modes.

[0280] In some embodiments, if the determined list of the first candidate prediction modes does not include the pre-set modes, the pre-set modes are added to the list of the candidate prediction modes.

[0281]

[0282] In another example, the image type corresponding to the current component block is determined, and the pre-set mode is determined based on the image type corresponding to the current component block.

[0283] Currently, the commonly used image types include I pictures, B pictures, and P pictures, and the commonly used slice types include I slices, B slices, and P slices. Hereinafter, taking the slice type as an example (also applicable to the image type), an I slice can only have intra-coded blocks, while B slices and P slices can have both intra-coded blocks and inter-coded blocks. That is, in an I slice, all adjacent blocks to the current component block are intra-coded blocks. In B slices and P slices, the adjacent blocks to the current component block may be intra-coded blocks or inter-coded blocks. Therefore, in some intra methods of GPM in this application, more relevant information can be obtained in an I slice, for example, the intra prediction mode of adjacent blocks and the like. In B slices and P slices, relatively less relevant information is obtained. Therefore, different rules can be set according to different image types.

[0284] For example, when constructing a list of candidate prediction modes, if the image type corresponding to the current component block is of B type or P type, more pre-set modes are added. For example, to DC mode, horizontal mode, and vertical mode, other angular modes such as the upper right direction (mode 2 in VVC), the lower left direction (mode 66 in VVC), and the upper left direction (mode 34 in VVC) are added. Or, restrictions are added so that different numbers of lists of candidate prediction modes are provided for blocks with different image types.

[0285] The method for determining the image type corresponding to the current component block may be to determine the image type corresponding to the current component block based on the image type of the current image to which the current component block belongs or the image type of the current slice to which the current component block belongs. For example, the image type of the current image to which the current component block belongs or the image type of the current slice to which the current component block belongs is determined as the image type corresponding to the current component block.

[0286] Optionally, a preset mode can be added under some conditions. As an example, when the number of prediction modes in the list of candidate prediction modes is less than or equal to a threshold, a preset mode is added. This threshold may be 3, 4, 5, 6, etc.

[0287] Method 3: The list of candidate prediction modes includes a set of candidate prediction modes determined according to rules such as equally spaced screening (also referred to as equally spaced filtering).

[0288] Method 4: The list of candidate prediction modes is determined based on the prediction modes used for at least one block adjacent to the current component block.

[0289] For example, by adding the prediction modes used for one or more blocks adjacent to the current component block to the list of candidate prediction modes, a list of candidate prediction modes for the current component block is obtained, or a list of candidate prediction modes corresponding to the k-th prediction mode among K prediction modes is obtained. The k-th prediction mode is any one of the K prediction modes.

[0290] As another example, the prediction mode corresponding to the k-th prediction mode among the prediction modes used for one or more blocks adjacent to the current component block is added to the list of candidate prediction modes corresponding to that k-th prediction mode. As an example, assume K = 2 and the k-th prediction mode is the first prediction mode, and assume that weighted prediction is performed using two prediction modes for two blocks adjacent to the current component block (the two prediction modes used for the first adjacent block are prediction mode 1 and prediction mode 3 respectively, and the two prediction modes used for the second adjacent block are prediction mode 4 and prediction mode 5 respectively). Then, prediction mode 1 and prediction mode 4 can be added to the list of candidate prediction modes corresponding to the first prediction mode.

[0291] Method 5: The image type corresponding to the current component block is determined, and the list of candidate prediction modes is determined based on the image type corresponding to the current component block. For example, when the image type corresponding to the current component block is B type or P type, at least one of the DC mode, horizontal mode, vertical mode, and several angle modes can be added to the list of first candidate prediction modes. As another example, when the image type corresponding to the current component block is I type, at least one of the DC mode, horizontal mode, and vertical mode can be added to the list of candidate prediction modes.

[0292] Mode 6: At least one of the second prediction mode, the third prediction mode, the fourth prediction mode, and the fifth prediction mode is determined. The second prediction mode is used for at least one of the first component block, the second component block, and the third component block (e.g., the chroma block and / or the luminance block) at a preset position. The third prediction mode is used for at least one of the first component block, the second component block, and the third component block (e.g., the luminance block and / or the chroma block) that is adjacent to the current component block and has been decoded. The fourth prediction mode is used for the first component block (e.g., the luminance block) corresponding to a preset area inside the current component block. The fifth prediction mode is related to the first component block corresponding to the current component block. Based on at least one of the second prediction mode, the third prediction mode, the fourth prediction mode, and the fifth prediction mode, a list of candidate prediction modes for the current component block is determined.

[0293] In some embodiments, in Mode 6, at least one of the first component block, the second component block, and the third component block that is adjacent to the current component block and has been decoded includes at least one of the first component block, the second component block, and the third component block corresponding to the decoded area above and / or to the left of the current component block. For example, as shown in FIG. 18, the prediction mode used for Blocks 0 to 5 is selected as the second prediction mode, and / or the prediction mode used for at least one block represented by the ellipsis between Blocks 2 and 3 is selected as the second prediction mode, and / or the prediction mode used for at least one block represented by the ellipsis between Blocks 1 and 5 is selected as the second prediction mode. In one example, the first component block in this embodiment may be a luminance CU, and the second component block and / or the third component block may be chroma CUs. In this case, the prediction mode used for the luminance CU and / or the chroma CU that is adjacent to the current component block and has been decoded is determined as the second prediction mode.

[0294] In some embodiments, in the above method 6, the preset area inside the current component block may be any area inside the current component block. The first component block corresponding to the internal area of the current component block can be understood as the first component block in the same space as the internal area of the current component block. Optionally, the first component block may be a luminance CU. For example, based on the coordinates of the vertex at the upper left corner of the internal area of the current component block, the luminance CU corresponding to the coordinates is obtained by mapping, and further, the prediction mode used for the luminance CU is determined as the fourth prediction mode.

[0295] In some embodiments, in the above method 6, the method for determining the fifth prediction mode related to the first component block corresponding to the current component block includes at least some of the following examples.

[0296] In Example 1, since the first component block corresponding to the current component block is decoded, the prediction mode used for the first component block is determined as the fifth prediction mode. In one example, the first component block may include a plurality of first component CUs, and the prediction modes used for these plurality of first component CUs may be the same or different. In the embodiments of the present application, the prediction mode used for at least one of the plurality of first component CUs included in the first component block may be determined as the fifth prediction mode.

[0297] In Example 2, the fifth prediction mode is determined based on the texture of the first component block corresponding to the current component block. Exemplarily, the texture direction of the first component block is determined, and the fifth prediction mode is determined based on the texture direction.

[0298] The embodiments of the present application do not limit the specific method for determining the texture direction of the first component block corresponding to the current component block.

[0299] In one possible embodiment, the texture directions of some samples in the first component block corresponding to the current component block are determined, and based on the texture directions of those samples, the texture direction of the first component block is determined. In some embodiments, for ease of explanation, the samples in the first component block for which the texture direction needs to be determined are denoted as texture samples. These texture samples may be default ones. For example, the encoding side and the decoding side default to taking some samples in the first component block as texture samples and calculating their texture directions. In some embodiments, the above texture samples are selected based on a preset method. For example, the decoding side selects a plurality of texture samples from this first component block based on a preset method for texture sample selection.

[0300] For each of these multiple texture samples, the gradient of each texture sample is determined. For example, the horizontal gradient and the vertical gradient of each texture sample are determined. Further, based on the horizontal gradient and the vertical gradient of each texture sample, the texture direction of each texture sample is determined.

[0301] Next, based on the texture directions of each texture sample, the texture direction of the first component block is determined.

[0302] Exemplarily, one or more of the texture directions corresponding to each of the multiple texture samples are determined as the texture direction of the first component block.

[0303] For example, any one or more of the texture directions corresponding to each of the multiple texture samples are determined as the texture direction of the first component block.

[0304] As another example, one or more of the texture directions that appear most frequently among the texture directions corresponding to each of the plurality of texture samples are determined as the texture direction of the first component block.

[0305] After the texture direction of the first component block corresponding to the current component block is determined based on the above, a fifth prediction mode is determined based on the texture direction.

[0306] In one example, a prediction mode having a prediction direction parallel to the texture direction is determined as the fifth prediction mode.

[0307] In one example, a prediction mode having a prediction direction perpendicular to the texture direction is determined as the fifth prediction mode.

[0308] In one example, a prediction mode having a prediction direction parallel to the texture direction and a prediction mode having a prediction direction perpendicular to the texture direction are determined as the fifth prediction mode.

[0309] Note that the prediction mode having a prediction direction parallel to the above texture direction includes a prediction mode having a prediction direction parallel and / or approximately parallel to the texture direction. The prediction mode having a prediction direction perpendicular to the texture direction includes a prediction mode having a prediction direction perpendicular and / or approximately perpendicular to the texture direction.

[0310] Note that the above Method 1 to Method 6 may be used alone or arbitrarily combined as a method for determining a list of candidate prediction modes.

[0311] In some embodiments, the list of candidate prediction modes includes at least one of a list of candidate intra prediction modes and a list of candidate inter prediction modes. The list of candidate intra prediction modes includes at least one candidate intra prediction mode, and the list of candidate inter prediction modes includes at least one candidate inter prediction mode.

[0312] Based on the above method, after obtaining the list of candidate prediction modes of the current component block, Q prediction modes are determined based on the list of candidate prediction modes. For example, all or part of the candidate prediction modes included in the list of candidate prediction modes are determined as all or part of the Q prediction modes.

[0313] Hereinafter, a process of determining a prediction mode corresponding to a weight derivation mode will be described.

[0314] In the embodiments of the present application, the prediction mode corresponding to the weight derivation mode is a generic term. For example, it may be a prediction mode corresponding to one preset weight derivation mode, or may be a prediction mode corresponding to a plurality of preset weight derivation modes. In some embodiments, the prediction mode corresponding to the weight derivation mode may 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.

[0315] In some embodiments, the prediction mode corresponding to the weight derivation mode includes a 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 the following. For the p-th weight derivation mode among the P weight derivation modes, determine the prediction mode corresponding to the p-th weight derivation mode, and based on the prediction mode corresponding to at least one of the P weight derivation modes, determine the prediction mode corresponding to the weight derivation mode. p is a positive integer.

[0316] In the embodiments of the present application, the process of determining the prediction mode corresponding to each of the P weight derivation modes is basically the same. For the sake of easy explanation, the p-th weight derivation mode among the P weight derivation modes will be taken as an example and described below.

[0317] Determining the prediction mode corresponding to the p-th weight derivation mode includes the following two methods.

[0318] Method 1: When at least one of the prediction modes corresponding to the p-th weight derivation mode is an intra prediction mode, determine an angle index based on the p-th weight derivation mode. Determine the intra prediction mode corresponding to the angle index as at least one of the prediction modes corresponding to the p-th weight derivation mode.

[0319] The angle index is used to indicate the angle index of the boundary line of the weight.

[0320] In some embodiments, the angle index is represented by the field angleIdx.

[0321] Table 2 above shows the correspondence between merge_gpm_partition_idx and angleIdx. By referring to Table 2 above, the angle index can be derived based on this p-th weight derivation mode.

[0322] In the present application, there is a correspondence between the angle index and the intra prediction mode. That is, different angle indices correspond to different intra prediction modes.

[0323] For example, the correspondence between the angle index and the intra prediction mode is shown in Table 7.

[0324]

Table 7

[0325] In this method 1, taking K = 2 as an example, when the first prediction mode or the second prediction mode is an intra prediction mode, the angular index is determined based on the p-th weight derivation mode. For example, based on Table 2 above, the angular index corresponding to the p-th weight derivation mode is derived. Next, in Table 7 above, the intra prediction mode corresponding to the angular index is determined. For example, the angular index is 2, and the intra prediction mode corresponding to the angular index is 42. Accordingly, the intra prediction mode 42 is determined as the first prediction mode or the second prediction mode.

[0326] Method 2: When at least one of the prediction modes corresponding to the p-th weight derivation mode is an intra prediction mode, determine the intra prediction mode corresponding to the p-th weight derivation mode. Determine at least one of the intra prediction modes corresponding to the p-th weight derivation mode as at least one of the prediction modes corresponding to the p-th weight derivation mode.

[0327] The intra prediction mode corresponding to the p-th weight derivation mode includes at least one of an intra prediction mode having a prediction direction parallel to the weight boundary line, an intra prediction mode having a prediction direction perpendicular to the boundary line, and a planar mode.

[0328] Note that the intra prediction mode having a prediction direction parallel to the weight boundary line includes one or more intra prediction modes having a prediction direction parallel or substantially parallel to the weight boundary line. The intra prediction mode having a prediction direction perpendicular to the weight boundary line includes one or more intra prediction modes having a prediction direction perpendicular or substantially perpendicular to the weight boundary line.

[0329] In this method 2, taking K = 2 as an example, when the first prediction mode and / or the second prediction mode is an intra prediction mode, the first prediction mode and / or the second prediction mode is determined from the intra prediction mode corresponding to the weight derivation mode. For example, the first prediction mode and / or the second prediction mode may be an intra prediction mode that is on the same straight line or substantially on the same straight line as the weight division line (also referred to as the boundary line). Alternatively, the first prediction mode and / or the second prediction mode may be an intra prediction mode having a prediction direction perpendicular or substantially perpendicular to the boundary line of the weight. For example, the boundary line of the weight is in the horizontal direction. For example, modes having GPM indexes 18, 19, 50, or 51 in FIG. 4 are listed, and the first prediction mode and / or the second prediction mode is the horizontal mode 18 or the vertical mode 50.

[0330] Based on the above steps, the decoding side determines the prediction mode corresponding to at least one weight derivation mode among the P weight derivation modes, and then determines the prediction mode corresponding to the weight derivation mode based on the prediction mode corresponding to at least one weight derivation mode among the P weight derivation modes. For example, all or part of the prediction modes corresponding to at least one weight derivation mode among the P weight derivation modes are used as the prediction mode corresponding to the weight derivation mode.

[0331] Furthermore, there may be overlapping prediction modes among the prediction modes corresponding to the P weight derivation modes. In this case, the overlapping prediction modes are removed, and the remaining different prediction modes are determined as the prediction modes corresponding to the weight derivation modes.

[0332] In the embodiments of the present application, in order to reduce the number of the R second combinations, the prediction modes are screened, and specifically, Q prediction modes are determined based on the above method.

[0333] In some embodiments, in order to reduce the complexity on the decoding side, the number of the Q prediction modes is limited. For example, Q is less than or equal to a first preset threshold. In this application, the specific value of the first preset threshold is not limited and 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, thereby controlling the number of the second combinations.

[0334] In some embodiments, the value of Q is related to the size and / or shape of the current component block, and it can be understood that the shape of the current component block is determined by the length-to-width ratio of the current component block.

[0335] During prediction, for relatively small blocks, the difference in the influence of similar prediction modes on the prediction result is not large. For relatively large blocks, the difference in the influence of similar prediction modes on the prediction result is more obvious. Based on this, in the embodiments of this application, different Q values are set for blocks of different sizes, that is, a relatively large Q value is set for relatively large blocks, and a relatively small Q value is set for relatively small blocks.

[0336] In this case, when determining the Q value corresponding to the current component block, the Q value is set according to the size of the current component block. For example, when the size of the current component block is larger than a first value, Q is greater than or equal to a second preset threshold. Further, for example, when the size of the current component block is less than or equal to the first value, Q is less than a third preset threshold. In the embodiments of this application, the specific values of the first value, the second preset threshold, and the third preset threshold are not limited, and the third preset threshold is smaller than the second preset threshold.

[0337] The process of determining the P weight derivation modes in S101-A21-1 will be described below.

[0338] In the embodiments of the present application, the method for determining P weight derivation modes includes at least some of the following methods.

[0339] Method 1: Select P weight derivation modes from M preset weight derivation modes. M is a positive integer greater than or equal to P.

[0340] The embodiments of the present application do not limit the above M preset weight derivation modes.

[0341] In some embodiments, there are 64 weight derivation modes in GPM and 56 weight derivation modes in AWP. In this embodiment, the above M preset weight derivation modes include at least one weight derivation mode among the 64 weight derivation modes in GPM, or include at least one weight derivation mode among the 56 weight derivation modes in AWP.

[0342] In some embodiments, the M weight derivation modes of the embodiments of the present application can support more angleIdx, or support angleIdx different from that in VVC. Also, for example, the M weight derivation modes of the embodiments of the present application can support more distanceIdx, or support distanceIdx different from that in VVC.

[0343] In some embodiments, the above M preset weight derivation modes may be derived by preset weight derivation modes.

[0344] For example, in the embodiments of the present application, the M weight derivation modes are determined using the weight derivation modes corresponding to AWP. Optionally, in the embodiments of the present application, other methods can also be used to derive the M weight derivation modes.

[0345] In some embodiments, when M is equal to P, the M weight derivation modes are determined as the P weight derivation modes.

[0346] In some embodiments, when M is greater than P, in order to further reduce the number of the R second combinations, screening is performed on the M preset weight derivation modes, P weight derivation modes are selected from the M preset weight derivation modes, and the R second combinations can be constructed.

[0347] In some embodiments, the weight derivation modes corresponding to the preset division angle and / or the preset offset are removed from the M weight derivation modes, and P weight derivation modes are obtained. The same division angle in the weight derivation mode can correspond to a plurality of offsets. For example, as shown in FIG. 19A, the weight derivation modes 10, 11, 12, and 13 have the same division angle but different offsets. Therefore, the weight derivation modes corresponding to some of the preset offsets and / or the weight derivation modes corresponding to some of the preset division angles can be removed. By doing so, the total number of possible second combinations can be reduced. And the difference between each possible second combination becomes more prominent.

[0348] In some embodiments, the screening conditions corresponding to different blocks may be different. Thus, when determining the P weight derivation modes corresponding to the current component block, first, the screening conditions corresponding to the current component block are determined, and based on the screening conditions corresponding to the current component block, P weight derivation modes are selected from the M weight derivation modes.

[0349] In some embodiments, the screening conditions corresponding to the current component block include screening conditions corresponding to the size of the current component block and / or screening conditions corresponding to the shape of the current component block. During prediction, in relatively small blocks, the difference in the influence of similar weight derivation modes on the prediction results is not large. In relatively large blocks, the difference in the influence of similar weight derivation modes on the prediction results is more obvious. Based on this, in the embodiments of the present application, different P-values are set for blocks of different sizes, that is, a relatively large P-value is set for relatively large blocks, and a relatively small P-value is set for relatively small blocks.

[0350] In some embodiments, the above screening conditions include an array. The array includes M elements, and the M elements and the M weight derivation modes correspond one-to-one. The element corresponding to each weight derivation mode is used to indicate whether the weight derivation mode is available. Whether the weight derivation mode is available can be understood as whether the weight derivation mode is used as one of the P weight derivation modes for the subsequent second combination trial.

[0351] The above array may be a one-dimensional array or a two-dimensional array.

[0352] Exemplarily, taking GPM as an example, there are 64 weight derivation modes, an array including 64 elements is set, and the value of each element indicates whether the weight derivation mode corresponding to the element is available. Taking a one-dimensional array as an example, a specific example is as follows. An array of g_sgpm_splitDir is set. g_sgpm_splitDir

[64] = { 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 }; The fact that the value of g_sgpm_splitDir[x] is 1 indicates that the weight derivation mode with index x is available, and the fact that the value of g_sgpm_splitDir[x] is 0 indicates that the weight derivation mode with index x is unavailable.

[0353] In some embodiments, when the screening conditions corresponding to the current component block include the screening conditions corresponding to the size of the current component block and the screening conditions corresponding to the shape of the current component block, and for the same weight derivation mode, both the screening conditions corresponding to the size of the current component block and the screening conditions corresponding to the shape of the current component block indicate that the weight derivation mode is available, the weight derivation mode is determined as one of the P weight derivation modes. When at least one of the screening conditions corresponding to the size of the current component block and the screening conditions corresponding to the shape of the current component block indicates that the weight derivation mode is unavailable, the weight derivation mode does not belong to the P weight derivation modes.

[0354] In some embodiments, the screening conditions corresponding to different block sizes and the screening conditions corresponding to different block shapes can be respectively realized using a plurality of arrays.

[0355] In some embodiments, the screening conditions corresponding to different block sizes and the screening conditions corresponding to different block shapes can be realized in a two-dimensional array. That is, the two-dimensional array includes both the screening conditions corresponding to the block size and the screening conditions corresponding to the block shape.

[0356] Exemplarily, the screening conditions corresponding to a block having size A and shape B are shown below. The screening conditions are represented in a two-dimensional array. g_sgpm_splitDir

[64] = { (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), (1,1),(0,0),(0,1),(1,0),(1,0),(1,0),(1,0),(0,0), (0,0),(0,0),(1,1),(0,0),(1,1),(1,1),(1,0),(0,1), (0,0),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0),(0,0), (1,0),(0,0),(1,1),(1,0),(1,0),(1,0),(0,0),(0,0), (1,1),(0,0),(1,1),(0,0),(0,0),(1,0),(1,1),(0,0) }; The fact that all values of g_sgpm_splitDir[x] are 1 indicates that the weight derivation mode with index x is available, and the fact that one of the values of g_sgpm_splitDir[x] is 0 indicates that the weight derivation mode with index x is unavailable. For example, g_sgpm_splitDir[4]=(1,0) indicates that the weight derivation mode 4 is available for blocks having size A but unavailable for blocks having shape B. Therefore, when the size of the block is A and the shape of the block is B, the weight derivation mode is unavailable.

[0357] Note that the above is an example of 64 weight derivation modes in GPM. However, the weight derivation mode of the embodiment of the present application includes, but is not limited to, the 64 weight derivation modes in GPM and the 56 weight derivation modes in AMP.

[0358] On the decoding side, based on the above steps, after Q prediction modes and P weight derivation modes are determined, R different second combinations are formed based on these Q prediction modes and P weight derivation modes. Next, based on the R second combinations, a list of candidate combinations is determined, and from this list of candidate combinations, a first weight derivation mode and K first prediction modes are determined.

[0359] In some embodiments, in order to further improve the construction speed of the list of candidate combinations, the decoding side screens the determined Q prediction modes and P weight derivation modes again. In this case, constructing R second combinations based on the determined P weight derivation modes and Q prediction modes in S101 - A21 - 2 includes the following steps from S101 - A21 - 21 to S101 - A21 - 23.

[0360] S101 - A11 - 21: S weight derivation modes are selected from P weight derivation modes. S is a positive integer less than or equal to P.

[0361] Specifically, from the determined P weight derivation modes, weight derivation modes with a low appearance probability are removed to obtain the screened S weight derivation modes.

[0362] The method of selecting S weight derivation modes from the P weight derivation modes in S101 - A11 - 21 includes, but is not limited to, the following several methods.

[0363] Method 1: For the i-th weight derivation mode among the P weight derivation modes, based on the i-th weight derivation mode, the weights of the K second prediction modes in the first component block are determined. The K second prediction modes are any K prediction modes among the Q prediction modes, and i is a positive integer from 1 to P. If the weight of any one of the K prediction modes in the first component block is smaller than the first preset value, the i-th weight derivation mode is removed from the P weight derivation modes, and S weight derivation modes are obtained.

[0364] In this Method 1, if the influence (contribution) of a certain prediction mode on the first component block is small or non-existent according to the weight of the first component block derived based on one weight derivation mode, this weight derivation mode is not used. For example, according to the weight derivation mode 52 in FIG. 4 (square block), the weight of the second prediction mode in the first component block is small. Further, for example, according to the weight derivation mode 54, the weight of the second prediction mode in the first component block becomes 0, that is, in the weight derivation mode 54, the influence of the second prediction mode on the first component block is non-existent, and it can be considered that the predicted value of the first component block is completely determined by the first prediction mode. In this case, since the second prediction mode has no influence, such a weight derivation mode needs to be removed from the P weight derivation modes.

[0365] Even if the same weight derivation mode is used for blocks of different shapes, the effects of the two prediction modes may be different. The current component block may be square, rectangular, with the length greater than the width, the width greater than the length, and the ratio between the two may be 1:2 or 1:4. FIG. 19A shows the weight derivation mode of the GPM within a 32×64 block, and FIG. 19B shows the weight derivation mode of the GPM within a 64×32 block. As can be seen from the figures, for blocks of different shapes, the intersections of the boundary lines of the same weight derivation mode and the block boundaries are different. This is because although the shape of the block changes, the angle of the boundary line does not change with the shape of the block. As shown in FIG. 19A, for the weight derivation mode with an index of 52, in a 32×64 block, when the boundary line of the weight derivation mode with an index of 52 extends towards the region of the first component block corresponding to the current component block, it intersects the region of the first component block. Therefore, the weight of the second prediction mode in the first component block becomes greater than or equal to the preset value, that is, it is shown that the second prediction mode has an impact on the first component block. However, as shown in FIG. 19B, for the weight derivation mode with an index of 52, in a 64×32 block, when the boundary line of the weight derivation mode with an index of 52 extends towards the region of the first component block corresponding to the current component block, it does not intersect the region of the first component block. Therefore, the weight of the second prediction mode in the first component block becomes 0, that is, it is shown that the second prediction mode has no impact on the first component block.

[0366] In the above method 1, a weight derivation mode that makes the weight of any one of the K prediction modes in the first component block smaller than the first preset value is removed from the P weight derivation modes, and S weight derivation modes are obtained.

[0367] In the embodiments of the present application, the specific value of the above first preset value is not limited. For example, it is a relatively small value greater than or equal to 0.

[0368] Method 2: For the i-th weight derivation mode among the P weight derivation modes, when predicting the first component block using the i-th weight derivation mode, the cost is determined. i is a positive integer from 1 to P. Based on the cost corresponding to the i-th weight derivation mode, S weight derivation modes are selected from the P weight derivation modes.

[0369] In this Method 2, by calculating the cost corresponding to each of the P weight derivation modes, S weight derivation modes are selected from the P weight derivation modes.

[0370] In an embodiment of the present application, one weight derivation mode and K prediction modes are taken as one combination to calculate the cost. In this way, in order to facilitate the calculation, based on the given K prediction modes, the costs of the P weight derivation modes are calculated. That is, each of the P weight derivation modes is combined with the given K prediction modes to obtain P combinations, the cost corresponding to each of these P combinations is calculated, and further, the costs of the P weight derivation modes are obtained.

[0371] As an example, assume that the given K prediction modes are prediction mode 1 and prediction mode 2. For the i-th weight derivation mode among the P weight derivation modes, the i-th weight derivation mode, prediction mode 1, and prediction mode 2 form one combination, which is denoted as combination i. Use combination i to predict the first component block corresponding to the current component block to obtain the predicted value of the first component block corresponding to combination i. Based on the predicted value of the first component block corresponding to combination i and the reconstruction value of the first component block, determine the prediction distortion cost corresponding to combination i. Determine the prediction distortion cost corresponding to combination i as the cost corresponding to the i-th weight derivation mode. In this way, the cost corresponding to any one of the P weight derivation modes can be determined.

[0372] Based on the above method, after determining the cost corresponding to the i-th weight derivation mode among the P weight derivation modes, S weight derivation modes are selected from the P weight derivation modes based on the cost corresponding to the i-th weight derivation mode.

[0373] In this second method, on the decoding side, selecting S weight derivation modes from the P weight derivation modes based on the cost corresponding to the i-th weight derivation mode includes the following methods.

[0374] In the first method, when the cost corresponding to the i-th weight derivation mode is less than a second preset value, a weight derivation mode similar to the i-th weight derivation mode is selected from the P weight derivation modes, and based on the i-th weight derivation mode and the weight derivation mode similar to the i-th weight derivation mode, S weight derivation modes are determined. The weight derivation mode similar to the i-th weight derivation mode can be understood as a weight derivation mode whose prediction result is similar to the prediction result of the i-th weight derivation mode. For example, the weight derivation mode similar to the i-th weight derivation mode includes a weight derivation mode whose splitting angle is similar to the splitting angle of the i-th weight derivation mode, and / or a weight derivation mode whose offset is similar to the offset of the i-th weight derivation mode. The offset of the weight derivation mode can also be understood as the intercept on the edge of the current component block of the boundary line of the weight derivation mode.

[0375] Exemplarily, the above-mentioned similar splitting angles may include the case where the splitting angles are the same and the offsets are different. For example, weight derivation mode 11 and weight derivation mode 13 in FIG. 4 can be cited. Also, the above-mentioned similar splitting angles may include the case where the splitting angles are the same and the offset tos are similar. For example, weight derivation mode 11 and weight derivation mode 12 in FIG. 4 can be cited. Further, the above-mentioned similar splitting angles may include the case where the splitting angles are similar and the offsets are different. For example, weight derivation mode 9 and weight derivation mode 11 in FIG. 4 can be cited. The above-mentioned similar splitting angles may include the case where the splitting angles are similar and the offsets are similar. For example, weight derivation mode 9 and weight derivation mode 12 in FIG. 4 can be cited.

[0376] Exemplarily, the above-mentioned similar offsets may include the case where the offsets are similar and the splitting angles are the same. For example, weight derivation mode 29 and weight derivation mode 30 in FIG. 4 can be cited. Also, the above-mentioned similar offsets may include the case where the offsets are the same or similar and the splitting angles are similar. For example, weight derivation mode 2 and weight derivation mode 38 in FIG. 4 can be cited.

[0377] In some embodiments, the weight derivation mode similar to the i-th weight derivation mode can be understood as the weight derivation mode whose index is close to the index of the i-th weight derivation mode.

[0378] In this first method, when the cost corresponding to the i-th weight derivation mode is smaller than a second preset value, it is shown that an excellent prediction effect may be obtained when predicting the current component block using the i-th weight derivation mode. In this case, the i-th weight derivation mode is selected from P weight derivation modes and used to construct subsequent R second combinations. Furthermore, since the weight derivation mode similar to the i-th weight derivation mode has characteristics similar to those of the i-th weight derivation mode, the weight derivation mode similar to the i-th weight derivation mode is selected from P weight derivation modes and used to construct subsequent R second combinations. Next, one weight derivation mode is selected from the remaining weight derivation modes among the P weight derivation modes to be the new i-th weight derivation mode, and by repeating the above steps, S weight derivation modes are obtained.

[0379] In the embodiments of the present application, the specific value of the above second preset value is not limited and is determined according to actual needs.

[0380] In some embodiments, the decoding side can also select S weight derivation modes from P weight derivation modes based on the following second method.

[0381] In the second method, when the cost corresponding to the i-th weight derivation mode is greater than a third preset value, the i-th weight derivation mode and the weight derivation mode similar to the i-th weight derivation mode are removed from the P weight derivation modes, at least one weight derivation mode after removal is obtained, and based on at least one weight derivation mode after removal, S weight derivation modes are determined.

[0382] In this second method, if the cost corresponding to the i-th weight derivation mode is less than a third preset value, it is shown that there may be no excellent prediction effect when predicting the current component block using the i-th weight derivation mode. In this case, the i-th weight derivation mode is removed from the P weight derivation modes. Furthermore, since the weight derivation modes similar to the i-th weight derivation mode have characteristics similar to those of the i-th weight derivation mode, the weight derivation modes similar to the i-th weight derivation mode are also removed from the P weight derivation modes, and a set of weight derivation modes after removal is obtained. Next, one weight derivation mode is selected from the set of weight derivation modes after removal to be the new i-th weight derivation mode, and by repeating the above steps, the weight derivation modes included in the finally obtained set of weight derivation modes are determined as S weight derivation modes.

[0383] In the embodiments of the present application, the specific value of the above third preset value is not limited and is determined according to actual needs. The third preset value is greater than the second preset value.

[0384] On the decoding side, based on the above steps, after selecting S weight derivation modes from the P weight derivation modes, the following steps S101-A21-22 are executed.

[0385] S101-A21-22: Select T prediction modes from Q prediction modes. T is a positive integer not exceeding Q.

[0386] The embodiments of the present application do not limit the method of selecting T prediction modes from Q prediction modes.

[0387] In some embodiments, T preset prediction modes are selected from the Q prediction modes.

[0388] In some embodiments, for the i-th prediction mode among the Q prediction modes, the decoding side determines the cost when predicting the first component block using the i-th prediction mode. i is a positive integer from 1 to Q. Based on the cost corresponding to the i-th prediction mode, T prediction modes are selected from the Q prediction modes.

[0389] In the embodiments of the present application, the cost is calculated with one weight derivation mode and K prediction modes as one combination. Thus, to facilitate the calculation, based on the given weight derivation mode and the given K - 1 prediction modes, the costs of the Q weight derivation modes are calculated. That is, each of the Q prediction modes is combined with the given weight derivation mode and the K - 1 prediction modes to obtain Q combinations, the cost corresponding to each of these Q combinations is calculated, and further, the costs of the Q prediction modes are obtained.

[0390] As an example, assume that the given K - 1 prediction modes are prediction mode 1 and the given weight derivation mode is weight derivation mode 1. For the i-th prediction mode among the Q prediction modes, weight derivation mode 1, the i-th prediction mode, and prediction mode 1 form one combination, which is denoted as combination i. The first component block is predicted using combination i to obtain the predicted value of the first component block corresponding to combination i. Based on the predicted value of the first component block corresponding to combination i and the reconstructed value of the first component block, the prediction distortion cost corresponding to combination i is determined. The prediction distortion cost corresponding to combination i is determined as the cost corresponding to the i-th prediction mode. In this way, the cost corresponding to any one of the Q prediction modes can be determined.

[0391] After determining the cost corresponding to the i-th prediction mode among the Q prediction modes based on the above method, T prediction modes are selected from the Q prediction modes based on the cost corresponding to the i-th prediction mode.

[0392] On the decoding side, selecting T prediction modes from Q prediction modes based on the cost corresponding to the i-th prediction mode includes the following method.

[0393] In the first method, when the cost corresponding to the i-th prediction mode is smaller than the fourth preset value, a prediction mode similar to the i-th prediction mode is selected from the Q prediction modes, and based on the i-th prediction mode and the prediction mode similar to the i-th prediction mode, T prediction modes are determined. The prediction mode similar to the i-th prediction mode can be understood as a prediction mode whose prediction result is similar to (or close to) the prediction result 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 index is close to the index of the i-th prediction mode can be mentioned. 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 can be mentioned.

[0394] In this first method, when the cost corresponding to the i-th prediction mode is smaller than the fourth preset value, it is shown that there is a possibility of obtaining an excellent prediction effect when predicting the current component block using the i-th prediction mode. In this case, the i-th prediction mode is selected from the Q prediction modes and used to construct the subsequent R second combinations. Furthermore, since the prediction mode similar to the i-th prediction mode has characteristics similar to those of the i-th prediction mode, the prediction mode similar to the i-th prediction mode is selected from the Q prediction modes and used to construct the subsequent R second combinations. Next, one prediction mode is selected from the remaining prediction modes among the Q prediction modes and used as the new i-th prediction mode, and by repeating the above steps, T prediction modes are obtained.

[0395] In the embodiment of the present application, the specific value of the above fourth preset value is not limited and is determined according to actual needs.

[0396] In the second method, when the cost corresponding to the i-th prediction mode is greater than the fifth preset value, from the Q prediction modes, the i-th prediction mode and the prediction modes similar to the i-th prediction mode are removed, at least one prediction mode after removal is obtained, and based on at least one prediction mode after removal, T prediction modes are determined.

[0397] In this second method, when the cost corresponding to the i-th prediction mode is greater than the fifth preset value, it is shown that there may be no excellent prediction effect when predicting the current component block using the i-th prediction mode. In this case, the i-th prediction mode is removed from the Q prediction modes. Furthermore, since the prediction modes similar to the i-th prediction mode have characteristics similar to the i-th prediction mode, the prediction modes similar to the i-th prediction mode are also removed from the Q prediction modes, and a set of prediction modes after removal is obtained. Next, one prediction mode is selected from the set of prediction modes after removal and used as the new i-th prediction mode, and by repeating the above steps, the prediction modes included in the finally obtained set of prediction modes are determined as T prediction modes.

[0398] In the embodiments of the present application, the specific value of the above fifth preset value is not limited and is determined according to actual needs. The fifth preset value is greater than the fourth preset value.

[0399] Based on the above steps, after S weight derivation modes are selected from P weight derivation modes and T prediction modes are selected from Q prediction modes, the following S101-A21-23 is executed.

[0400] S101-A21-23: Based on S weight derivation modes and T prediction modes, R second combinations are formed.

[0401] Specifically, one weight derivation mode is selected from S weight derivation modes, K prediction modes are selected from T prediction modes, and one second combination is constituted by this one weight derivation mode and K prediction modes. By repeating this step, R second combinations can be obtained.

[0402] As can be seen from the above, one second combination includes one weight derivation mode and K prediction modes. Thus, when screening the prediction modes, when the K elements in one combination are fixed, the selectability of another element can be restricted. For example, when K = 2, the selectability of another element when used in combination with two elements can be restricted.

[0403] Hereinafter, taking the screening process of another prediction mode when the weight derivation mode and one prediction mode are fixed as an example, the implementation process of S101 - A21 - 2 will be introduced.

[0404] In some embodiments, the above S101 - A21 - 2 includes the following content. For the i-th weight derivation mode among P weight derivation modes, when predicting the first component block using the i-th weight derivation mode and the j-th prediction mode among Q prediction modes, the cost is determined. When the cost corresponding to the combination of the i-th weight derivation mode and the j-th prediction mode is greater than the sixth preset value, the j-th prediction mode and the prediction modes similar to the j-th prediction mode are removed from the Q prediction modes to obtain at least one prediction mode after removal. Based on the i-th weight derivation mode and at least one prediction mode after removal, R second combinations are constructed.

[0405] In this embodiment, when a weight derivation mode and one prediction mode are fixed, another prediction mode is screened. For example, in a certain weight derivation mode, if a relatively small cost cannot be obtained by setting a certain intra prediction mode as the first prediction mode, in that weight derivation mode, a situation where an intra prediction mode similar to that intra prediction mode is set as the first prediction mode is not tried.

[0406] Specifically, assuming K = 2 for the i-th weight derivation mode among P weight derivation modes, the combination includes the i-th weight derivation mode, the first prediction mode, and the second prediction mode. Assuming that the second prediction mode is set to prediction mode 1, the prediction mode 1 may be one of the Q prediction modes or another prediction mode other than the Q prediction modes. Determine the possible options for the first prediction mode from the Q prediction modes. Specifically, set the j-th prediction mode among the Q prediction modes as the first prediction mode. In this case, when predicting the first component block in combination j consisting of the i-th weight derivation mode, the j-th prediction mode, and prediction mode 1, the predicted value of the first component block is determined, and based on that predicted value, the cost corresponding to combination j is determined. The cost corresponding to combination j is determined 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 a sixth preset value. If the cost corresponding to the j-th prediction mode is greater than the sixth preset value, it is shown that the first component block cannot be accurately predicted using the combination consisting of the j-th prediction mode, the i-th weight derivation mode, and prediction mode 1. In this case, the j-th prediction mode is removed from the Q prediction modes. Since the prediction modes similar to the j-th prediction mode have characteristics similar to those of the j-th prediction mode, the prediction modes similar to the j-th prediction mode are removed from the Q prediction modes, and a set of prediction modes after removal is obtained. One prediction mode is selected from the set of prediction modes after removal and set as the new j-th prediction mode, and by repeating the above steps, a final set of prediction modes after removal corresponding to the i-th weight derivation mode is obtained.

[0407] Based on the above steps, a set of final prediction modes after removal corresponding to each of the P weight derivation modes can be determined. In this way, based on the P weight derivation modes and the sets of final prediction modes after removal corresponding to each of the P weight derivation modes, R second combinations are constructed.

[0408] Note that in the above embodiment, a method of screening prediction modes in the form of combinations is shown. Optionally, either one of the weight derivation mode and the prediction mode can be screened in the form of combinations to finally construct R second combinations.

[0409] After determining the R second combinations based on the above methods, on any one of the R second combinations, the first component block is predicted using the weight derivation mode and the K prediction modes in the second combination, and a predicted value of the first component block corresponding to the second combination is obtained.

[0410] Hereinafter, a process of predicting the first component block using any one of the second combinations to obtain a predicted value of the first component block will be described.

[0411] First, the weight of the first component block is determined using the weight derivation mode included in this second combination. The weight of the first component block can be understood as the weight of the predicted value corresponding to the first component block. That is, based on the weight derivation mode included in this second combination, the weight of the first component block is determined, based on the K prediction modes included in this second combination, the K predicted values of the first component block are determined, and the K predicted values of the first component block are weighted using the weight of the first component block to obtain the predicted value of the first component block.

[0412] In some embodiments, determining the weight of the first component block based on the weight derivation mode includes the following steps.

[0413] Step 1: Determine an angle index and a distance index based on a weight derivation mode.

[0414] Step 2: Determine the weight of the first component block based on the angle index, the distance index, and the size of the first component block.

[0415] In this application, the weight of the first component block can be derived in the same way as the way to derive the weight of the predicted value. For example, first, determine an angle index and a distance index based on a weight derivation mode. The angle index can be understood as the angle index of the boundary line of each weight derived by the weight derivation mode. For example, according to Table 2 above, the angle index and the distance index corresponding to the weight derivation mode can be determined. For example, when the weight derivation mode is 27, the corresponding angle index is 12, and the corresponding distance index is 3. Next, determine the weight of the first component block based on the angle index, the distance index, and the size of the first component block.

[0416] The method for determining the weight of the first component block based on the angle index, the distance index, and the size of the first component block in Step 2 above includes, but is not limited to, the following several methods.

[0417] Method 1: Determine the weight of the first component block directly based on the angle index, the distance index, and the size of the first component block. In this case, Step 2 above includes the following Steps 21 to 23.

[0418] Step 21: Determine the first parameter of the samples in the first component block based on the angle index, the distance index, and the size of the first component block.

[0419] Step 22: Determine the weight of the samples in the first component block based on the first parameter of the samples in the first component block.

[0420] Step 23: Determine the weight of the first component block based on the weights of the samples within the first component block.

[0421] In this embodiment, based on the angle index, distance index, and the size of the first component block, the weights of the samples within the first component block are determined, and further, a weight matrix consisting of the weights of each sample within the first component block is determined as the weight of the first component block.

[0422] The first parameter of this application is used to determine the weight. In some embodiments, the first parameter is also called the weight index.

[0423] In a possible embodiment, the offset and the first parameter can be determined as follows.

[0424] The input of the weight derivation process of the first component block includes the width nCbW of the first component block, the height nCbH of the current component block, the "partition" angle index variable angleId of the GPM, the distance index variable distanceIdx of the GPM, and the component index variable cIdx. Here, the weight of the first component block is determined. That cIdx is 0 indicates the luminance component.

[0425] The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are derived based on the following methods. nW = (cIdx == 0)? nCbW : nCbW * SubWidthC nH = (cIdx == 0)? nCbH : nCbH * SubHeightC shift1 = Max(5, 17 - BitDepth), where BitDepth is the coding bit depth. 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

[0426] The offsets offsetX and offsetY are derived based on the following method. - When the value of shiftHor is 0, offsetX = ( -nW ) >> 1 offsetY = ( ( -nH ) >> 1 ) + ( angleIdx < 16? ( distanceIdx * nH ) >> 3 : -( ( distanceIdx * nH ) >> 3 ) ) - Otherwise (that is, when the value of shiftHor is 1) offsetX = ( ( -nW ) >> 1 ) + ( angleIdx < 16? ( distanceIdx * nW ) >> 3 : -( ( distanceIdx * nW ) >> 3 ) offsetY = ( - nH ) >> 1

[0427] The weight matrix wTemplateValue[x][y] of the first component block (where x = -nTmW..nCbW - 1, y = -nTmH..nCbH - 1, excluding the case where both x and y are 0 or more) is derived based on the following method (in this example, the coordinates of the upper left corner of the first component block are set to (0,0)). - The variables xL and yL are derived based on the following method. xL = ( cIdx == 0 )? x : x * SubWidthC yL = (cIdx == 0)? y : y * SubHeightC The disLut is determined according to Table 3 above. The first parameter weightIdx is derived based on the following method. weightIdx = (((xL + offsetX) << 1) + 1) * disLut[displacementX] + (((yL + offsetY) << 1) + 1) * disLut[displacementY]

[0428] Based on the above method, after determining the first parameter weightIdx, the weight of the sample (x, y) in the first component block is determined based on weightIdx.

[0429] In this application, based on the first parameter of the sample in the first component block in step 22 above, the method for determining the weight of the sample in the first component block includes, but is not limited to, the following several methods.

[0430] Method 1: Determine the second parameter of the sample in the first component block based on the first parameter of the sample in the first component block, and determine the weight of the sample in the first component block based on the second parameter of the sample in the first component block.

[0431] The second parameter is also used to determine the weight. In some embodiments, the second parameter is also called the weight index in the first component, and the first component may be a luminance component or the like.

[0432] For example, the weight of the sample in the first component block is determined based on the following formula. weightIdxL = partFlip? 32 + weightIdx : 32 - weightIdx wTemplateValue[x][y] = Clip3( 0, 8, ( weightIdxL + 4 ) >> 3 ) wTemplateValue[x][y] is the weight of sample (x,y) in the first component block. weightIdxL is the second parameter of sample (x,y) in the first component block, and is also called the weight index in the first component (e.g., the luminance component). wTemplateValue[x][y] is the weight of sample (x,y) in the first component block. partFlip is an intermediate variable and is determined based on the angle index angleIdx. For example, as described above, partFlip = ( angleIdx >= 13 && angleIdx <= 27 )? 0 : 1. That is, the value of partFlip is either 1 or 0. When the value of partFlip is 0, weightIdxL becomes 32 - weightIdx. When the value of partFlip is 1, weightIdxL becomes 32 + weightIdx. The 32 here is only an example and is not limited thereto in this application.

[0433] Method 2: Determine the weight of the sample in the first component block based on the first parameter, the first threshold, and the second threshold of the sample in the first component block.

[0434] To reduce the computational complexity of the weight of the first component block, in Method 2, the weight of the sample in the first component block is limited to the first threshold or the second threshold. That is, by setting the weight of the sample in the first component block to either the first threshold or the second threshold, the computational complexity of the weight of the first component block is reduced.

[0435] This application does not limit the specific values of the first threshold and the second threshold.

[0436] Optionally, the first threshold is 1.

[0437] Optionally, the second threshold is 0.

[0438] In one example, the weights of the samples in the first component block can be determined based on the following formula. wTemplateValue[x][y] = (partFlip? weightIdx: - weightIdx) > 0? 1 : 0 wTemplateValue[x][y] is the weight of the sample (x, y) in the first component block. In the above "1 : 0", 1 is the first threshold and 0 is the second threshold.

[0439] In the above method 1, the weights of each sample in the first component block are determined based on the weight derivation mode. The weight matrix composed of the weights of each sample in the first component block is regarded as the weight of the first component block.

[0440] Based on the above method, after the weight of the first component block corresponding to the weight derivation mode included in this second combination is determined, the first component block is predicted using the K prediction modes included in this second combination, and K predicted values are obtained. Based on the weight of the first component block, the K predicted values are weighted to obtain the predicted value of the first component block.

[0441] The predicted value of the first component block can be understood as a matrix composed of the predicted values of the samples in the first component block.

[0442] In some embodiments, the above predicted value is also called a predicted sample.

[0443] Next, based on the predicted value and the reconstructed value of the first component block, the cost of this second combination is determined.

[0444] The method for determining the cost of the above second combination includes but is not limited to the following several methods.

[0445] Method 1: Determine the cost of the second combination based on rows and columns. Specifically, determine the loss based on the predicted value and the reconstructed value of the first component block. Denote this loss as the first loss. Since the predicted value and the reconstructed value of the first component block are matrices, the obtained first loss is also a matrix. For example, determine the absolute value of the difference between the predicted value and the reconstructed value of the first component block as the first loss, and determine this first loss as the cost of its second combination.

[0446] Method 2: Determine the cost of the second combination by calculating for each sample.

[0447] Specifically, for the i-th sample in the first component block, determine the predicted value of the i-th sample for each of the K prediction modes in the second combination, determine the weight of the first component block corresponding to the i-th sample in the weight of the first component block, and obtain the predicted value of the i-th sample based on the weight of the first component block corresponding to the i-th sample and the K predicted values of the i-th sample. Based on the predicted value and the reconstructed value of the i-th sample, obtain the cost of the second combination for the i-th sample. Based on this method, the prediction distortion cost of the second combination for each sample in the first component block can be determined, and finally, the sum of the prediction distortion costs of the second combination for each sample in the first component block is determined as the cost of its second combination.

[0448] Based on the above method, the cost of each of the R second combinations can be determined.

[0449] Next, construct a list of candidate combinations based on the cost of each of the R second combinations.

[0450] For example, based on the cost of the second combination, sort the R second combinations in ascending order of cost, and determine the sorted R second combinations as the list of candidate combinations.

[0451] As another example, based on the costs of the second combinations, select N second combinations with the smallest costs from the R second combinations to form a list of candidate combinations.

[0452] Optionally, N is 8 or 16 or 32, etc.

[0453] Based on the above method, a list of candidate combinations is determined. Each candidate combination in the list of candidate combinations is sorted in ascending order of cost. Exemplarily, the list of candidate combinations is shown in Table 6 above.

[0454] In this way, the decoding side queries the candidate combination corresponding to the first index from the list of candidate combinations shown in Table 6 based on the first index, determines the candidate combination corresponding to the first index as the first combination, that is, determines the weight derivation mode included in the candidate combination as the first weight derivation mode, and determines the K prediction modes included in the candidate combination as K first prediction modes.

[0455] In the above embodiment, taking the example that the first combination includes the first weight derivation mode and K first prediction modes, the method of constructing the list of candidate combinations is described.

[0456] In the embodiments of the present application, in situation 1, the first combination includes the first weight derivation mode and K first prediction modes, and the first weight derivation mode does not include a blending parameter. In situation 2, the first combination includes the first weight derivation mode, K first prediction modes, and a second blending parameter. In situation 3, the first combination includes the first weight derivation mode and K first prediction modes, and the first weight derivation mode includes a blending parameter. The blending parameter is used to determine the predicted value of the current component block together with the K first prediction modes.

[0457] In situation 1, when the first combination includes the first weight derivation mode and K first prediction modes, and the first weight derivation mode does not include blending parameters, the list of candidate combinations corresponding to the current component block is constructed as described in the above embodiment.

[0458] In situation 2, the first combination includes the first weight derivation mode, K first prediction modes, and a second blending parameter.

[0459] As shown in FIGS. 4 and 5 above, there is a blending region (transition region), i.e., the gray region in FIGS. 4 and 5, near the weight dividing line. The blending region corresponds to the blending parameter, that is, the blending region in the weight map is represented by the blending parameter. In some cases, the blending parameter can affect the weight. Therefore, in the embodiments of the present application, based on the second blending parameter, the first weight derivation mode, and K first prediction modes, the predicted value of the current component block is determined. In this case, the first combination in the embodiments of the present application includes the first weight derivation mode, K first prediction modes, and a second blending parameter.

[0460] In this situation 2, determining the first combination in S101 includes the following steps.

[0461] S101-C: Decode the bitstream to determine the list of candidate combinations. The list of candidate combinations includes at least one candidate combination, and any one of the at least one candidate combination includes one weight derivation mode, K prediction modes, and one blending parameter.

[0462] S101-D: Determine the first combination based on the list of candidate combinations.

[0463] Exemplarily, the list of candidate combinations is shown in Table 8.

[0464]

Table 8

[0465] As shown in Table 8, the list of candidate combinations includes at least one candidate combination, and any two candidate combinations among the at least one candidate combination are not exactly the same. That is, for any two candidate combinations, at least one of the weight derivation mode, the K prediction modes, and the blending parameters is different.

[0466] Exemplarily, in Table 8 above, the order of the candidate combinations in the list of candidate combinations is taken as the index of the candidate combination. Optionally, the index of the candidate combination in the list of candidate combinations may be represented in other ways. In the embodiments of the present application, it is not limited thereto.

[0467] In this embodiment, the method by which the decoding side determines the first combination based on the list of candidate combinations includes, but is not limited to, the following several methods.

[0468] Method 1: The list of candidate combinations includes one candidate combination. In this case, the candidate combination included in the list of candidate combinations is determined as the first combination.

[0469] Method 2: The list of candidate combinations includes a plurality of candidate combinations. In this case, the bitstream is decoded to obtain a first index. The first index is used to indicate the first combination. The candidate combination corresponding to the first index in the list of candidate combinations is determined as the first combination.

[0470] In this Method 2, the decoding side decodes the bitstream to obtain a first index, determines the list of candidate combinations shown in Table 8 above, queries from the list of candidate combinations based on the first index, and obtains the first combination indicated by the first index.

[0471] For example, the first index is index 1. In the list of candidate combinations shown in Table 8, the candidate combination corresponding to index 1 is candidate combination 2. That is, the first combination indicated by the first index is candidate combination 2. In this way, on the decoding side, the weight derivation mode, K prediction modes, and blending parameter included in candidate combination 2 are determined as the first weight derivation mode, K first prediction modes, and second blending parameter included in the first combination, and the first weight derivation mode, the second blending parameter, and K first prediction modes are used to predict the current component block to obtain the predicted value of the current component block.

[0472] In the second method, the encoding side and the decoding side may each determine the same list of candidate combinations. For example, both the encoding side and the decoding side determine a list including L candidate combinations. Each candidate combination includes one weight derivation mode, K prediction modes, and one blending parameter. The encoding side only needs to signal in the bitstream the one finally selected candidate combination (for example, the first combination). The decoding side analyzes the first combination finally selected by the encoding side. Specifically, the decoding side decodes the bitstream to obtain the first index, and based on the first index, determines the first combination from the list of candidate combinations determined by the decoding side.

[0473] Hereinafter, a specific process for determining the list of candidate combinations in S101-C will be described.

[0474] In some embodiments, the list of candidate combinations already exists. After the decoding side decodes the bitstream to obtain the first index, it obtains or reads the list of candidate combinations based on the first index, and further, based on the first index, can query the candidate combination corresponding to the first index from the list of candidate combinations.

[0475] In some embodiments, the list of candidate combinations is transmitted from the encoding side to the decoding side. For example, before encoding the current component block, the encoding side transmits the list of candidate combinations to the decoding side.

[0476] In some embodiments, the list of candidate combinations is uploaded from the encoding side to the cloud, and the decoding side can read the list of candidate combinations from the cloud.

[0477] In some embodiments, the list of candidate combinations is constructed by the decoding side.

[0478] Embodiments of the present application do not limit the manner in which the decoding side constructs the list of candidate combinations. For example, using the information related to the current component block, analyze the probabilities of each combination consisting of different weight derivation modes, different prediction modes, and different blending parameters, and construct a list of candidate combinations according to the probabilities of each combination.

[0479] Optionally, the information related to the current component block includes mode information of adjacent blocks of the current component block, reconstruction samples of the first component block corresponding to the current component block, and the like.

[0480] In some embodiments, the decoding side constructs a list of candidate combinations according to the following steps S101-C1 and S101-C2.

[0481] S101-C1: Decode the bitstream to determine the first component block corresponding to the current component block.

[0482] S101-C2: Construct a list of candidate combinations based on the first component block.

[0483] For the specific implementation process of S101-C1, refer to the description of S101-A1 above and will not be repeated here.

[0484] Since the first component block corresponding to the current component block has a relationship with the current component block, in the embodiments of the present application, a list of candidate combinations of the current component block is constructed based on the first component block.

[0485] For example, for each combination, the first component block is predicted using the combination to obtain the predicted value of the first component block corresponding to each combination, and a list of candidate combinations is constructed based on the predicted value of the first component block corresponding to each combination. For example, for each combination, the weight of the first component block is derived using the weight derivation mode included in the combination, the first component block is predicted using each of the K prediction modes included in the combination to obtain K predicted values of the first component block, the K predicted values of the first component block are weighted based on the derived weight of the first component block to obtain the predicted value of the first component block corresponding to the combination. Finally, a list of candidate combinations is constructed based on the predicted value of the first component block corresponding to each combination.

[0486] Note that the weight derived based on the weight derivation mode can be understood as the weight corresponding to each sample in the first component block or the weight matrix corresponding to the first component block. Adjusting the weight of the first component block using the blending parameter can be understood as adjusting the weight corresponding to each sample in the first component block or adjusting the weight matrix of the first component block. When determining the predicted value of the first component block based on the adjusted weight of the first component block, K predicted values corresponding to each sample in the first component block are determined, and the predicted value corresponding to each sample can be determined based on the K predicted values corresponding to each sample and the adjusted weight. The predicted values corresponding to each sample in the first component block constitute the predicted value of the first component block. Optionally, determining the predicted value of the first component block based on the adjusted weight can be performed based on the block. For example, the predicted value of the first component block is determined, and the K predicted values of the first component block are weighted based on the adjusted weight matrix of the first component block to obtain the predicted value of the first component block.

[0487] In some embodiments, S101-C2 includes the following steps S101-C21 to S101-C23.

[0488] S101-C21: Determine R second combinations. Any one of the R second combinations includes one weight derivation mode, K prediction modes, and one blending parameter, and the weight derivation mode, K prediction modes, and blending parameter included in any two of the R second combinations are not completely the same. R is a positive integer greater than 1.

[0489] S101-C22: For any one of the R second combinations, determine the cost corresponding to the second combination when predicting the first component block using the weight derivation mode, K prediction modes, and blending parameter in the second combination.

[0490] S101-C23: Construct a list of candidate combinations based on the costs corresponding to each of the R second combinations.

[0491] In this embodiment, when constructing a list of candidate combinations, the decoding side first determines R second combinations. In this application, the specific number of the R second combinations is not limited. For example, it can be 8, 16, 32, etc. Each of the R second combinations includes one weight derivation mode, K prediction modes, and one blending parameter. The weight derivation modes, K prediction modes, and blending parameters included in any two of the R second combinations are not completely the same. Next, for each of the R second combinations, determine the cost corresponding to that second combination when predicting the first component block using the weight derivation mode, K prediction modes, and blending parameter included in that second combination. Finally, construct a list of candidate combinations based on the costs corresponding to each of the R second combinations.

[0492] In some embodiments, determining the cost corresponding to a second combination when predicting the first component block using the weight derivation mode, K prediction modes, and blending parameter in the second combination in S101-C22 includes at least the following methods.

[0493] Method 1: S101-C22 includes S101-C22-11 to S101-C22-14 below.

[0494] S101-C22-11: Determine the weight of the first component block based on the weight derivation mode and blending parameter included in the second combination.

[0495] S101-C22-12: Predict the first component block based on the K prediction modes in the second combination to obtain K predicted values of the first component block.

[0496] S101-C22-13: Based on the weights of the first component blocks, weight the K predicted values of the first component blocks to obtain the predicted value of the first component block corresponding to the second combination.

[0497] S101-C22-14: Determine the cost corresponding to the second combination based on the predicted value of the first component block corresponding to the second combination and the reconstruction value of the first component block.

[0498] In the embodiments of the present application, the process of determining the cost corresponding to each of the R second combinations is the same. For ease of explanation, one of the R second combinations is taken as an example here for explanation.

[0499] In the embodiments of the present application, the second combination includes one weight derivation mode, one blending parameter, and K prediction modes. When predicting the first component block using the second combination, based on the weight derivation mode and the blending parameter included in the second combination, determine the weight of the first component block. Predict the first component block based on the K prediction modes included in the second combination to obtain K predicted values of the first component block. Next, based on the weights of the first component blocks, weight the K predicted values of the first component blocks to obtain the predicted value of the first component block corresponding to the second combination. Next, determine the cost corresponding to the second combination based on the predicted value of the first component block corresponding to the second combination and the reconstruction value of the first component block.

[0500] In the embodiments of the present application, the blending parameter is used to adjust the weights derived by the weight derivation mode. Therefore, in the embodiments of the present application, the embodiments of determining the weights of the first component blocks based on the weight derivation mode and the blending parameter included in the second combination in S101-C22-11 above include at least the following several examples.

[0501] In Example 1, when deriving the weights of the first component block using the first weight derivation mode, it is necessary to determine a plurality of intermediate variables. Using the blending parameters, one or more of these plurality of intermediate variables can be adjusted, and the adjusted variables can be used to derive the weights of the first component block. For example, using the blending parameters, one or more of the variables such as displacementX, displacementY, partFlip, shiftHor, offsetX, offsetY, xL, yL, etc. are adjusted to obtain the weights of the first component block.

[0502] In Example 2, based on the weight derivation mode in the second combination and the first component block, a third weight corresponding to the first component block is determined, the third weight is adjusted using the blending parameters in the second combination, an adjusted third weight is obtained, and based on the adjusted third weight, the weights of the first component block are determined.

[0503] For example, based on the weight derivation mode in the second combination and the first component block, a third weight corresponding to the first component block is determined as weightIdx, then weightIdx is adjusted using the blending parameters, an adjusted weightIdx is obtained, and then based on the adjusted weightIdx, the weight wVemplateValue of the first component block is determined.

[0504] In one example, according to the following formula, the blending parameters are used to adjust weightIdx to obtain an adjusted weightIdx. weightIdx = weightIdx * blendingCoeff Here, blendingCoeff is the blending parameter included in the second combination.

[0505] As another example, based on the weight derivation mode in the second combination and the first component block, the third weight corresponding to the first component block is determined as wVemplateValue. Next, wVemplateValue is adjusted using the blending parameter to obtain the adjusted wVemplateValue, and the adjusted wVemplateValue is determined as the weight of the first component block.

[0506] In one example, according to the following formula, the blending parameter is used to adjust wVemplateValue to obtain the adjusted wVemplateValue. wVemplateValue = wVemplateValue * blendingCoeff

[0507] Based on the above method, the weights of the first component blocks corresponding to each of the R second combinations can be determined. Next, for each second combination, the first component block is predicted using the K prediction modes included in the second combination to obtain K predicted values of the first component block. Based on the weight of the first component block corresponding to the second combination, the K predicted values of the first component block corresponding to the second combination are weighted to obtain the predicted value of the first component block corresponding to the second combination. Based on the predicted value of the first component block corresponding to the second combination and the reconstruction value of the first component block, the cost corresponding to the second combination is determined. The method for determining the cost corresponding to the second combination includes, but is not limited to, SAD, SATD, SEE, etc. Based on this method, the costs corresponding to each of the R second combinations can be determined. Next, based on the costs corresponding to each of the R second combinations, a list of candidate combinations is constructed.

[0508] Method 2: S101-C22 includes the following S101-C22-11 to S101-C22-14.

[0509] S101-C22-21: Determine the predicted values of the first component blocks corresponding to each of the K prediction modes in the second combination based on the weight derivation mode and blending parameters in the second combination.

[0510] S101-C22-22: Determine the cost corresponding to each of the K prediction modes in the second combination based on the predicted values of the first component blocks corresponding to each of the K prediction modes in the second combination and the reconstruction value of the first component block.

[0511] S101-C22-23: Determine the cost corresponding to the second combination based on the costs corresponding to each of the K prediction modes in the second combination. For example, determine the sum of the costs corresponding to each of the K prediction modes in the second combination as the cost corresponding to the second combination.

[0512] For example, assuming K = 2, the two prediction modes included in the second combination are denoted as prediction mode 1 and prediction mode 2 respectively. First, based on the weight derivation mode and blending parameters included in this second combination, the weight and predicted value of the first component block corresponding to prediction mode 1 are determined, and the predicted value corresponding to prediction mode 1 is processed using the weight of the first component block corresponding to prediction mode 1. For example, for each sample in the first component block corresponding to prediction mode 1, the predicted value of the sample in the first component block corresponding to prediction mode 1 is multiplied by the weight of the first component block corresponding to that sample to obtain the predicted value of that sample. In this way, the predicted value of the first component block corresponding to prediction mode 1 can be determined. Next, based on the predicted value of the first component block corresponding to prediction mode 1 and the reconstructed value of the first component block, the cost corresponding to prediction mode 1 can be determined. The method for determining the cost corresponding to prediction mode 1 includes, but is not limited to, SAD, SATD, SEE, etc. Similarly, the cost corresponding to prediction mode 2 can be determined. Further, based on the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2, the cost corresponding to the second combination is determined. For example, the sum of the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2 is determined as the cost corresponding to the second combination.

[0513] Regarding the method of constructing a list of candidate combinations based on the cost corresponding to each of the R second combinations in S101-C23 above, reference can be made to the description of S101-A23 above and will not be repeated here.

[0514] Hereinafter, the process of determining the R second combinations in S101-C21 above will be described.

[0515] In some embodiments, the R second combinations are preset.

[0516] In some embodiments, S101-C21 includes the following steps.

[0517] S101-C21-1: Determine F weight derivation modes, J prediction modes, and W blending parameters. Both F and W are positive integers, and J is a positive integer greater than or equal to K.

[0518] S101-C21-2: Based on the F weight derivation modes, J prediction modes, and W blending parameters, construct R second combinations. Any one of the R second combinations includes one of the F weight derivation modes, K of the J prediction modes, and one of the W blending parameters.

[0519] In this embodiment, on the decoding side, first determine F weight derivation modes, J prediction modes, and W blending parameters, and then construct R second combinations based on the determined F weight derivation modes, J prediction modes, and W blending parameters.

[0520] In the embodiments of the present application, the specific numbers of the above F weight derivation modes, J prediction modes, and W blending parameters are not limited.

[0521] Assume K = 2, and the above K prediction modes include the first prediction mode and the second prediction mode. Assume that there are J types of all available prediction modes. There are J possibilities for the first prediction mode, and since the second prediction mode is different from the first prediction mode, there are J - 1 possibilities for the second prediction mode. Assume that there are F types of weight derivation modes and W types of blending gradient coefficients. In the present application, one second combination can be constructed using any two different prediction modes, any one weight derivation mode, and any one blending gradient coefficient, and there are a total of F * J * (J - 1) * W possible second combinations.

[0522] In this embodiment, the F weight derivation modes are all possible weight derivation modes, the J prediction modes are all possible prediction modes, and the W blending parameters are all possible blending parameters. Using an exhaustive enumeration, all possible second combinations are obtained. Using each of all possible second combinations, a first component block corresponding to the current component block is predicted, the distortion cost of each second combination is calculated, and further, based on the distortion cost of each second combination, a list of candidate combinations corresponding to the current component block is obtained.

[0523] In some embodiments, in order to reduce the amount of data and increase the construction speed of the list of candidate combinations, instead of trying all prediction modes, some prediction modes can be selected and tried.

[0524] In this case, the embodiments for determining the J prediction modes in S101-C21-1 include but are not limited to the following several methods.

[0525] Method 1: The J prediction modes are preset prediction modes.

[0526] Method 2: Determine at least one of a list of candidate prediction modes of the current component block, a list of preliminary prediction modes corresponding to each of the K first prediction modes, a prediction mode corresponding to the weight derivation mode, and a preset mode. Based on at least one of the list of candidate prediction modes, the list of preliminary prediction modes corresponding to each of the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode, the J prediction modes are determined.

[0527] The methods for determining the list of candidate prediction modes of the current component block include at least the following several examples.

[0528] In Example 1, the list of candidate prediction modes is determined based on the prediction modes used for at least one block adjacent to the current component block.

[0529] In Example 2, when the list of candidate prediction modes does not include the preset mode, the preset mode corresponding to the current component block is determined, and the preset mode is added to the list of candidate prediction modes.

[0530] In one example, the preset modes are a plurality of preset prediction modes.

[0531] In another example, the image type corresponding to the current component block is determined, and the preset mode is determined based on the image type corresponding to the current component block.

[0532] For example, when the image type corresponding to the current component block is type B or type P, the preset mode includes at least one of a DC mode, a horizontal mode, a vertical mode, and an angle mode.

[0533] In Example 3, the image type corresponding to the current component block is determined, and the list of candidate prediction modes is determined based on the image type corresponding to the current component block. For example, when the image type corresponding to the current component block is type B or type P, at least one of a DC mode, a horizontal mode, a vertical mode, and some angle modes can be added to the list of second candidate prediction modes. As another example, when the image type corresponding to the current component block is type I, at least one of a DC mode, a horizontal mode, and a vertical mode can be added to the list of candidate prediction modes.

[0534] In Example 4, at least one of the second prediction mode, the third prediction mode, the fourth prediction mode, and the fifth prediction mode is determined. The second prediction mode is used for at least one of the first component block, the second component block, and the third component block (e.g., the chroma block and / or the luminance block) at a preset position. The third prediction mode is used for at least one of the first component block, the second component block, and the third component block (e.g., the luminance block and / or the chroma block) that is adjacent to the current component block and has been decoded. The fourth prediction mode is used for the first component block (e.g., the luminance block) corresponding to a preset area inside the current component block. The fifth prediction mode is related to the first component block corresponding to the current component block. Based on at least one of the second prediction mode, the third prediction mode, the fourth prediction mode, and the fifth prediction mode, a list of candidate prediction modes for the current component block is determined.

[0535] In the embodiments of the present application, for the specific embodiments of determining the above J prediction modes, reference can be made to the specific description of determining the Q prediction modes in S101-A21-1, which will not be repeated here. In some embodiments, the above J is equal to Q.

[0536] Hereinafter, the process of determining the F weight derivation modes in S101-C21-1 will be described.

[0537] In the embodiments of the present application, the method of determining the F weight derivation modes includes at least some of the following methods.

[0538] In some embodiments, the above F weight derivation modes are preset weight derivation modes.

[0539] In some embodiments, F weight derivation modes are selected from Z preset weight derivation modes. Z is a positive integer greater than or equal to F.

[0540] Embodiments of this application do not limit the above Z preset weight derivation modes.

[0541] In some embodiments, when Z is equal to F, the Z weight derivation modes are determined as F weight derivation modes.

[0542] In some embodiments, when Z is greater than F, in order to further reduce the number of R second combinations, screening is performed on the Z preset weight derivation modes, and F weight derivation modes are selected from the Z preset weight derivation modes to construct R second combinations.

[0543] The process of determining the F weight derivation modes in S101-C21-1 is substantially the same as the process of determining the P weight derivation modes in S101-A21-1. Refer to the specific description of determining the P weight derivation modes, and it will not be repeated here.

[0544] Hereinafter, the process of determining the W blending gradient coefficients in S101-C21-1 will be introduced.

[0545] In some embodiments, the W blending parameters are preset blending parameters, for example, 1 / 4, 1 / 2, 1, 2, 4, etc.

[0546] In some embodiments, the W blending parameters are determined based on the size of the current component block. For example, when the size of the current component block is smaller than a preset value, the W blending parameters are within numerical range 1 of the blending parameters. As a further example, when the size of the current component block is smaller than a preset value, the W blending parameters are within numerical range 2 of the blending parameters. Numerical range 1 of the blending parameters and numerical range 2 of the blending parameters may or may not overlap.

[0547] In some embodiments, W blending parameters are determined from a plurality of preset blending parameters.

[0548] In one example, based on the image information of the current component block, W blending parameters are determined from a plurality of preset blending parameters.

[0549] Embodiments of the present application do not limit the specific content of the image information of the current component block. The specific content of the image information is, for example, defocus, sharpness, acutance, etc.

[0550] In some embodiments, when the image information of the current component block includes the sharpness of the image edge, determining W blending parameters from a plurality of preset blending parameters based on the image information of the current component block includes the following two examples.

[0551] In Example 1, when the sharpness of the image edge of the current component block is less than a preset value, at least one first type of blending parameter among the plurality of preset blending parameters is determined as the W blending parameters.

[0552] The first type of blending parameter can be understood as a blending parameter that can form a relatively wide blending area. For example, 1 / 4, 1 / 2, etc. can be mentioned.

[0553] In Example 2, when the sharpness of the image edge of the current component block is greater than or equal to a preset value, at least one second type of blending parameter among the plurality of preset blending parameters is determined as the W blending parameters. The second type of blending parameter is larger than the first type of blending parameter.

[0554] The second type of blending parameter can be understood as a blending parameter that can form a relatively narrow blending region, and examples thereof include 2, 4, etc.

[0555] In the embodiments of the present application, the method for determining the image information of the current component block can include at least two methods.

[0556] Method 1: By decoding the bitstream, the image information of the current component block can be obtained. For example, the encoding side encodes the image information of the current component block into the bitstream. In this way, the decoding side obtains the image information of the current component block by decoding the bitstream.

[0557] Method 2: The image information of the first component block is determined, and based on the image information of the first component block, the image information of the current component block is determined. Since the first component block has been decoded, the image information of the first component block is available. For example, the image information of the first component block can be obtained by analyzing the reconstruction value of the first component block. Next, based on the image information of the first component block, the image information of the current component block is obtained. For example, the image information of the first component block is determined as the image information of the current component block, or the image information of the current component block is obtained by processing the image information of the first component block.

[0558] After the decoding side determines J prediction modes, F weight derivation modes, and W blending parameters based on the above steps, R different second combinations are constructed based on these J prediction modes, F weight derivation modes, and W blending parameters. Next, based on the R second combinations, a list of candidate combinations is determined, and further, from this list of candidate combinations, a first weight derivation mode, K first prediction modes, and a second blending parameter are determined.

[0559] In some embodiments, in order to further improve the construction speed of the list of candidate combinations, the decoding side re-screens the above-determined J prediction modes, F weight derivation modes, and W blending parameters. In this case, constructing R second combinations based on the above-determined F weight derivation modes, J prediction modes, and W blending parameters in S101-C21-2 includes the following steps from S101-C21-21 to S101-C21-24.

[0560] S101-C21-21: E weight derivation modes are selected from the F weight derivation modes. E is a positive integer less than or equal to F.

[0561] Specifically, from the above-determined F weight derivation modes, the weight derivation modes with low appearance probability are removed, and the screened E weight derivation modes are obtained.

[0562] The method of selecting E weight derivation modes from the F weight derivation modes in S101-C21-21 includes, but is not limited to, the following several methods.

[0563] Method 1: For the i-th weight derivation mode among the F weight derivation modes, based on the i-th weight derivation mode and the fourth blending parameter, the weights of K second prediction modes in the first component block are determined. The fourth blending parameter is any one of the W blending gradients. 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 one of the K prediction modes in the first component block is less than the first preset value, the i-th weight derivation mode is removed from the F weight derivation modes, and the E weight derivation modes are obtained.

[0564] In this method 1, the method for determining the weights of K second prediction modes in the first component block based on the i-th weight derivation mode and the fourth blending parameter includes at least the methods shown in the following several examples.

[0565] In Example 1, when deriving the weights of the first component block using the i-th weight derivation mode, it is necessary to determine a plurality of intermediate variables. Using the fourth blending parameter, one or more of these intermediate variables can be adjusted, and the adjusted variables can be used to derive the weights of the first component block.

[0566] In Example 2, based on the i-th weight derivation mode and the first component block, the fourth weight corresponding to the first component block is determined, the fourth weight is adjusted using the fourth blending parameter to obtain the adjusted fourth weight, and based on the adjusted fourth weight, the weights of K second prediction modes in the first component block are determined.

[0567] For example, based on the i-th weight derivation mode and the first component block, the fourth weight corresponding to the first component block is determined as weightIdx. Next, weightIdx is adjusted using the fourth blending parameter to obtain the adjusted weightIdx. Then, based on the adjusted weightIdx, the weight wVemplateValue of the first component block is determined.

[0568] In one example, according to the following formula, the fourth blending parameter can be used to adjust weightIdx to obtain the adjusted weightIdx. weightIdx = weightIdx * blendingCoeff3 Here, blendingCoeff3 is the fourth blending parameter.

[0569] As another example, based on the i-th weight derivation mode and the first component block, the fourth weight corresponding to the first component block is determined as wVemplateValue. Next, wVemplateValue is adjusted using the fourth blending parameter to obtain the adjusted wVemplateValue, and the adjusted wVemplateValue is determined as the weight of the first component block.

[0570] In one example, according to the following formula, the fourth blending parameter is used to adjust wVemplateValue to obtain the adjusted wVemplateValue. wVemplateValue = wVemplateValue * blendingCoeff3

[0571] By the above method, based on the i-th weight derivation mode, the weights of the K second prediction modes in the first component block are determined.

[0572] Method 2: For the i-th weight derivation mode among the F weight derivation modes, the cost when predicting the first component block using the i-th weight derivation mode is determined. i is a positive integer from 1 to F. Based on the cost corresponding to the i-th weight derivation mode, E weight derivation modes are selected from the F weight derivation modes.

[0573] In some embodiments, when determining the cost corresponding to the i-th weight derivation mode, the influence of the blending parameter on the weight is not considered.

[0574] In some embodiments, when determining the cost corresponding to the i-th weight derivation mode, the influence of the blending parameter on the weight is considered. That is, the weight of the first component block is determined based on the i-th weight derivation mode and the blending parameter. Next, the predicted value of the first component block is determined based on the weight of the first component block and the K predicted values of the first component block. Further, based on the predicted value and the reconstructed value of the first component block, the cost corresponding to the i-th weight derivation mode is determined. For the specific process of determining the weight of the first component block based on the i-th weight derivation mode and the blending parameter, reference can be made to the description of the above embodiments, which will not be repeated here.

[0575] In some embodiments, referring to the method of selecting S weight derivation modes from P weight derivation modes in S101-A11-21 above, it is also possible to select E weight derivation modes from F weight derivation modes. For the specific details, reference can be made to the description of the above embodiments, which will not be repeated here.

[0576] Based on the above steps, after selecting E weight derivation modes from F weight derivation modes, the decoding side executes the following steps of S101-C21-22.

[0577] S101-C21-22: Select V prediction modes from J prediction modes. V is a positive integer less than or equal to J.

[0578] The embodiments of the present application do not limit the method of selecting V prediction modes from J prediction modes.

[0579] In some embodiments, V preset prediction modes are selected from J prediction modes.

[0580] In some embodiments, for the i-th prediction mode among the J prediction modes, the decoding side determines the cost when predicting the first component block using the i-th prediction mode. 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.

[0581] In the embodiments of the present application, the cost is calculated with the weight derivation mode, K prediction modes, and blending parameters as one combination. Thus, to facilitate the calculation, based on the given weight derivation mode, the given K - 1 prediction modes, and the given blending parameters, the costs of the J weight derivation modes are calculated. That is, each of the J prediction modes is combined with the given weight derivation mode, K - 1 prediction modes, and blending parameters to obtain J combinations, the cost corresponding to each of these J combinations is calculated, and further, the costs of the J prediction modes are obtained.

[0582] After determining the cost corresponding to the i-th prediction mode among the J prediction modes based on the above method, V prediction modes are selected from the J prediction modes based on the cost corresponding to the i-th prediction mode.

[0583] On the decoding side, selecting V prediction modes from the J prediction modes based on the cost corresponding to the i-th prediction mode includes the following method.

[0584] In the first method, when the cost corresponding to the i-th prediction mode is less than a fourth preset value, a prediction mode similar to the i-th prediction mode is selected from the J prediction modes, and based on the i-th prediction mode and the prediction mode similar to the i-th prediction mode, V prediction modes are determined. The prediction mode similar to the i-th prediction mode can be understood as a prediction mode whose prediction result is similar to (or close to) the prediction result 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 index is close to the index of the i-th prediction mode can be mentioned. For example, a prediction mode whose index is 1 or 2 greater than the index of the i-th prediction mode, or a prediction mode whose index is 1 or 2 less than the index of the i-th prediction mode can be mentioned.

[0585] In the second method, when the cost corresponding to the i-th prediction mode is greater than a fifth preset value, the i-th prediction mode and the prediction mode similar to the i-th prediction mode are removed from the J prediction modes, at least one prediction mode after removal is obtained, and based on the at least one prediction mode after removal, V prediction modes are determined.

[0586] Based on the above steps, after E weight derivation modes are selected from the F weight derivation modes and V prediction modes are selected from the J prediction modes, the following S101-C21-23 is executed.

[0587] S101-C21-23: O blending parameters are selected from the W blending parameters, where O is a positive integer less than or equal to W.

[0588] In some embodiments, when O is equal to W, the W blending parameters are determined as the O blending parameters.

[0589] In some embodiments, when W is greater than O, screening is performed on W blending parameters to obtain O blending parameters.

[0590] The method of obtaining O blending parameters by screening W blending parameters includes at least some of the following.

[0591] In Example 1, the cost of each of the W blending parameters is determined, and the first O blending parameters among the W blending parameters with the smallest cost are selected.

[0592] For example, for the i-th blending parameter among the W blending parameters, a combination is formed by the i-th blending parameter, weight derivation mode 1, prediction mode 1, and prediction mode 2, and the combination is used to predict the first component block to obtain the predicted value of the first component block. Exemplarily, the weight is determined based on weight derivation mode 1, the weight is adjusted using the i-th blending parameter to obtain the adjusted weight. The first component block is predicted using each of prediction mode 1 and prediction mode 2 to obtain two predicted values of the first component block, and the two predicted values are weighted using the adjusted weight to obtain the predicted value of the first component block corresponding to the i-th blending parameter. Next, based on the reconstructed value of the first component block and the predicted value of the first component block corresponding to the i-th blending parameter, the cost corresponding to the i-th blending parameter is determined. Based on the above method, the cost corresponding to each of the W blending parameters and the combination consisting of weight derivation mode 1, prediction mode 1, and prediction mode 2 can be determined, and further, based on the cost, O blending parameters can be selected from the W blending parameters. For example, select the O blending parameters with the smallest cost among the W blending parameters.

[0593] In Example 2, when the above W blending parameters are not determined based on the image information of the current component block, in the embodiments of the present application, the image information of the current component block can be determined, and based on the image information of the current component block, O blending parameters can be determined from the W blending parameters.

[0594] The embodiments of the present application do not limit the specific content of the image information of the current component block. The specific content of the image information is, for example, blurriness, sharpness, acuteness, etc.

[0595] In some embodiments, when the image information of the current component block includes the sharpness of the image edge, determining O blending parameters from the W blending parameters based on the image information of the current component block includes two examples.

[0596] In one example, when the sharpness of the image edge of the current component block is smaller than a preset value, at least one first type of blending parameter among the W blending parameters is determined as the O blending parameters.

[0597] In another example, when the sharpness of the image edge of the current component block is greater than or equal to a preset value, at least one second type of blending parameter among the W blending parameters is determined as the O blending parameters.

[0598] In some embodiments, based on the size of the current component block, O blending parameters are selected from the W blending parameters.

[0599] In one possible embodiment, according to the size of the current component block, the blending parameters among the W blending parameters that are greater than or equal to a third value are used as the O blending parameters.

[0600] For example, when the size of the current component block is smaller than the second set threshold value, a blending parameter having a third value among the W blending parameters is set as one of the O blending parameters.

[0601] Further, for example, when the size of the current component block is greater than or equal to the second set threshold value, the blending parameters among the W blending parameters that are less than or equal to a fourth value are set as the O blending parameters. The fourth value is smaller than the third value.

[0602] Embodiments of the present application do not limit the specific values of the second set threshold value, the third value, and the fourth value.

[0603] Optionally, the third value is 1 and the fourth value is 1 / 2.

[0604] Optionally, when the size of the current component block is represented by the number of samples of the current component block, the second set threshold value is 256 or the like.

[0605] In another possible embodiment, based on the size of the current component block, the O blending parameters are determined as at least one blending parameter within a certain numerical range among the W blending parameters.

[0606] For example, when the size of the current component block is smaller than the second set threshold value, the O blending parameters are determined as one or more blending parameters within the numerical range of the fourth blending parameter among the W blending parameters.

[0607] Further, for example, when the size of the current component block is equal to or greater than a second set threshold value, O blending parameters are determined to be one or more blending parameters within the numerical range of the third blending parameter among the W blending parameters. The minimum value of the numerical range of the third blending parameter is smaller than the minimum value of the numerical range of the fourth blending parameter.

[0608] Embodiments of the present application do not limit the specific values of the numerical range of the fourth blending parameter and the numerical range of the third blending parameter. Optionally, the numerical range of the fourth blending parameter and the numerical range of the third blending parameter overlap. Optionally, the numerical range of the fourth blending parameter and the numerical range of the third blending parameter do not overlap.

[0609] After E weight derivation modes are selected from F weight derivation modes, V prediction modes are selected from J prediction modes, and O blending parameters are selected from W blending parameters, the following S101-C21-24 is executed.

[0610] S101-C21-24: Based on the E weight derivation modes, the V prediction modes, and the O blending parameters, R second combinations are configured.

[0611] Specifically, one weight derivation mode is selected from the E weight derivation modes, K prediction modes are selected from the V prediction modes, one blending parameter is selected from the O blending parameters, and one second combination is configured with this one weight derivation mode, the K prediction modes, and one blending parameter. By repeating this step, R second combinations can be obtained.

[0612] As can be seen from the above, one second combination includes one weight derivation mode, K prediction modes, and one blending parameter. That is, one second combination includes K + 2 elements. Thus, when screening one element, if the other elements in one combination are fixed, the selectability of that one element can be restricted.

[0613] Hereinafter, taking the screening process of another prediction mode when the weight derivation mode, the blending parameter, and one prediction mode are fixed as an example, the realization process of S101-C21-2 will be introduced.

[0614] In some embodiments, S101-C21-2 includes the following content. For the f-th weight derivation mode among the F weight derivation modes and the o-th blending parameter among the O blending parameters, determine the cost when predicting the first component block using the f-th weight derivation mode, the o-th blending parameter, and the j-th prediction mode among the J prediction modes. f is a positive integer not exceeding F, o is a positive integer not exceeding O, and j is a positive integer not exceeding J. When the cost corresponding to the combination of the f-th weight derivation mode, the o-th blending parameter, and the j-th prediction mode is greater than the sixth preset value, remove the j-th prediction mode and the prediction modes similar to the j-th prediction mode from the J prediction modes to obtain at least one prediction mode after removal. Based on the f-th weight derivation mode, the o-th blending parameter, and at least one prediction mode after removal, construct R second combinations.

[0615] In this embodiment, when a weight derivation mode, blending parameters, and one prediction mode are fixed, another prediction mode is screened. For example, in a certain weight derivation mode and blending parameters, if a relatively small cost cannot be obtained by setting a certain intra prediction mode as the first prediction mode, then in that weight derivation mode and blending parameters, a situation where an intra prediction mode similar to that intra prediction mode is set as the first prediction mode is not tried.

[0616] Specifically, assuming K = 2, for the f-th weight derivation mode among F weight derivation modes and the o-th blending gradient parameter among O blending parameters, assuming that the second prediction mode is set to prediction mode 1, the prediction mode 1 may be one of the J prediction modes or may be a prediction mode other than the J prediction modes. Determine the possible options for the first prediction mode from the J prediction modes. Specifically, set the j-th prediction mode among the J prediction modes as the first prediction mode. In this case, when predicting the first component block in combination j consisting of the f-th weight derivation mode, the o-th blending gradient parameter, the j-th prediction mode, and prediction mode 1, the predicted value of the first component block is determined, and based on the predicted value, the cost corresponding to combination j is determined. The cost corresponding to combination j is determined 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 is shown that the first component block cannot be accurately predicted using the combination consisting of the j-th prediction mode, the f-th weight derivation mode, the o-th blending gradient parameter, and prediction mode 1. In this case, the j-th prediction mode is removed from the J prediction modes. Since the prediction modes similar to the j-th prediction mode have characteristics similar to those of the j-th prediction mode, the prediction modes similar to the j-th prediction mode are removed from the J prediction modes, and a set of prediction modes after removal is obtained. One prediction mode is selected from the set of prediction modes after removal and set as the new j-th prediction mode, and by repeating the above steps, a final set of prediction modes after removal corresponding to the f-th weight derivation mode and the o-th blending parameter is obtained.

[0617] Based on the above steps, a set of final prediction modes after removal corresponding to each of the F weight derivation modes and the blending parameters can be determined. Thus, based on the F weight derivation modes and the set of final prediction modes after removal corresponding to each of the F weight derivation modes, R second combinations are constructed.

[0618] Note that in the above embodiment, a method of screening prediction modes in the form of combinations is shown. Optionally, either one of the weight derivation mode and the blending parameter can be screened in the form of combinations to finally construct R second combinations.

[0619] After the decoding side determines the R second combinations based on the above methods, for any one of the R second combinations, the first component block is predicted using the weight derivation mode, the blending parameter, and the K prediction modes in the second combination to obtain the predicted value of the first component block corresponding to the second combination.

[0620] Hereinafter, a realization process of predicting the first component block corresponding to the current component block using any one of the second combinations in an embodiment of the present application to obtain the predicted value of the first component block will be described.

[0621] In the embodiment of the present application, for any one of the second combinations, the first component block is predicted based on the weight derivation mode, the blending parameter, and the K prediction modes included in the second combination to obtain the predicted value of the first component block corresponding to the second combination.

[0622] In an embodiment of the present application, specific embodiments for predicting a first component block based on the weight derivation mode, blending parameter, and K prediction modes included in the second combination to obtain a predicted value of the first component block corresponding to the second combination are not limited. For example, first, based on the weight derivation mode and the K prediction modes included in the second combination, a predicted value of the first component block is determined. Next, based on the blending parameter and the determined predicted value of the first component block, a predicted value of the first component block corresponding to the second combination is obtained.

[0623] In some embodiments, the weight of the first component block is determined using the weight derivation mode and the blending parameter included in the second combination. Next, based on the K prediction modes included in the second combination, K predicted values of the first component block are determined, and based on the weight of the first component block and the K predicted values of the first component block, a predicted value of the first component block corresponding to the second combination can be determined.

[0624] In some embodiments, determining the weight of the first component block based on the weight derivation mode includes the following steps.

[0625] Step 1: Based on the weight derivation mode, determine an angle index and a distance index.

[0626] Step 2: Based on the angle index, distance index, blending parameter, and the size of the first component block, determine the weight of the first component block.

[0627] In this application, the weight of the first component block can be derived in the same way as the way to derive the weight of the predicted value. For example, first, based on the weight derivation mode, the angle index and the distance index are determined. The angle index can be understood as the angle index of the boundary line of each weight derived by the weight derivation mode. For example, according to Table 2 above, the angle index and the distance index corresponding to the weight derivation mode can be determined. For example, when the weight derivation mode is 27, the corresponding angle index is 12, and the corresponding distance index is 3. Next, based on the angle index, the distance index, and the size of the first component block, the weight of the first component block is determined.

[0628] The method for determining the weight of the first component block based on the angle index, the distance index, and the size of the first component block in step 2 above includes, but is not limited to, the following several methods.

[0629] Method 1: Determine the weight of the first component block based on the angle index, the distance index, the blending parameter, and the size of the first component block. In this case, step 2 above includes the following steps 21 to 23.

[0630] Step 21: Determine the first parameter of the sample in the first component block based on the angle index, the distance index, and the size of the first component block.

[0631] Step 22: Determine the weight of the sample in the first component block based on the first parameter of the sample in the first component block and the blending parameter.

[0632] Step 23: Determine the weight of the first component block based on the weight of the sample in the first component block.

[0633] In this embodiment, based on the angle index, distance index, size of the first component block, and size of the current component block, the weights of the samples in the first component block are determined, and further, a weight matrix composed of the weights of each sample in the first component block is determined as the weight of the first component block.

[0634] The first parameter of this application is used to determine the weights.

[0635] In some embodiments, the first parameter is also called the weight index.

[0636] In some embodiments, the first parameter can be understood as the third weight corresponding to the first component block and the fourth weight corresponding to the first component block in the above embodiment.

[0637] In a possible embodiment, the offset and the first parameter can be determined as follows.

[0638] The input of the derivation process of the weight of the first component block includes the width nCbW of the first component block, the height nCbH of the first component block, the "division" angle index variable angleId of the GFM, the distance index variable distanceIdx of the GFM, and the component index variable cIdx. Here, for the purpose of taking the first component block as an example, cIdx being 0 indicates the luminance component.

[0639] The variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor are derived based on the following method. nW = ( cIdx == 0 )? nCbW : nCbW * EubWidthC nH = ( cIdx == 0 )? nCbH : nCbH * EubHeightC shift1 = Max( 5, 17 - BitDepth ), where BitDepth is the coding bit depth. 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

[0640] The offsets offsetX and offsetY are derived based on the following method. - When the value of shiftHor is 0, offsetX = ( -nW ) >> 1 offsetY = ( ( -nH ) >> 1 ) + ( angleIdx < 16? ( distanceIdx * nH ) >> 3 : -( ( distanceIdx * nH ) >> 3 ) ) - Otherwise (i.e., when the value of shiftHor is 1) offsetX = ( ( -nW ) >> 1 ) + ( angleIdx < 16? ( distanceIdx * nW ) >> 3 : -( ( distanceIdx * nW ) >> 3 ) offsetY = ( - nH ) >> 1

[0641] The weight matrix wVemplateValue[x][y] of the first component block (x = -nVmW..nCbW - 1, y = -nVmH..nCbH - 1, the case where x and y are both 0 or more is removed) is derived based on the following method (in this example, the coordinates of the upper left corner of the first component block are set to (0,0)). - The variables xL and yL are derived based on the following method. xL = (cIdx == 0)? x : x * EubWidthC yL = (cIdx == 0)? y : y * EubHeightC The disLut is determined according to Table 3 above. The first parameter weightIdx is derived based on the following method. weightIdx = (((xL + offsetX) << 1) + 1) * disLut[displacementX] + (((yL + offsetY) << 1) + 1) * disLut[displacementY]

[0642] In some embodiments, based on the above method, after determining the first parameter weightIdx, the first parameter is adjusted using the blending parameter to obtain the adjusted first parameter.

[0643] In one example, the first parameter is adjusted based on the following formula. weightIdx = weightIdx * blendingCoeff blendingCoeff is the blending parameter.

[0644] Next, based on the adjusted first parameter, the method for determining the weights of the samples in the first component block includes, but is not limited to, the following several methods.

[0645] Method 1: Based on the adjusted first parameter of the samples in the first component block, determine the second parameter of the samples in the first component block, and determine the weights of the samples in the first component block based on the second parameter of the samples in the first component block.

[0646] The second parameter is also used to determine the weight. In some embodiments, the second parameter is also referred to as the weight index in the first component, and the first component may be a luminance component, a chroma component, or the like.

[0647] For example, the weight of the samples in the first component block is determined based on the following formula. weightIdxL = partFlip? 32 + weightIdx : 32 - weightIdx wVemplateValue[x][y] = Clip3( 0, 8, ( weightIdxL + 4 ) >> 3 ) wVemplateValue[x][y] is the weight of the sample (x, y) in the first component block. weightIdxL is the second parameter of the sample (x, y) in the first component block, and is also referred to as the weight index in the first component (for example, the luminance component). wVemplateValue[x][y] is the weight of the sample (x, y) in the first component block. partFlip is an intermediate variable and is determined based on the angle index angleIdx. For example, as described above, partFlip = ( angleIdx >= 13 && angleIdx <= 27 )? 0 : 1. That is, the value of partFlip is 1 or 0. When the value of partFlip is 0, weightIdxL is 32 - weightIdx. When the value of partFlip is 1, weightIdxL is 32 + weightIdx. The 32 here is only an example and is not limited thereto in this application.

[0648] Method 2: Determine the weight of the samples in the first component block based on the adjusted first parameter, the first threshold, and the second threshold of the samples in the first component block.

[0649] To reduce the computational complexity of calculating the weights of the first component blocks, in Method 2, the weights of the samples in the first component blocks are limited to a first threshold value or a second threshold value. That is, by setting the weights of the samples in the first component blocks to either the first threshold value or the second threshold value, the computational complexity of calculating the weights of the first component blocks is reduced.

[0650] This application does not limit the specific values of the first threshold value and the second threshold value.

[0651] Optionally, the first threshold value is 1.

[0652] Optionally, the second threshold value is 0.

[0653] In one example, the weights of the samples in the first component blocks can be determined based on the following formula. wVemplateValue[x][y] = (partFlip? weightIdx: - weightIdx) > 0? 1 : 0 wVemplateValue[x][y] is the weight of the sample (x, y) in the first component block. In the above "1:0", 1 is the first threshold value and 0 is the second threshold value.

[0654] In the above Method 1, the weights of each sample in the first component block are determined based on the weight derivation mode. The weight matrix consisting of the weights of each sample in the first component block is used as the weight of the first component block.

[0655] Based on the above method, after the weight of the first component block corresponding to the weight derivation mode included in this second combination is determined, the first component block is predicted using the K prediction modes included in this second combination, and K prediction values are obtained. Based on the weight of the first component block, the K prediction values are weighted to obtain the prediction value of the first component block.

[0656] Next, based on the prediction value and the reconstruction value of the first component block, the cost of this second combination is determined.

[0657] 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 candidate combinations shown in Table 8 is constructed.

[0658] In this way, the decoding side queries, based on the first index, the candidate combination corresponding to the first index from the list of candidate combinations shown in Table 8, determines the candidate combination corresponding to the first index as the first combination, that is, determines the weight derivation mode included in the candidate combination as the first weight derivation mode, determines the K prediction modes included in the candidate combination as K first prediction modes, and determines the blending parameter included in the candidate combination as the second blending parameter.

[0659] In the above situation 2, taking the first combination including the first weight derivation mode, K first prediction modes, and the second blending parameter as an example, the implementation process of S101 is described.

[0660] Situation 3: The first combination includes the first weight derivation mode and K first prediction modes, the first weight derivation mode includes the third blending parameter, and the third blending parameter is used to determine the weight.

[0661] In that situation 3, the first weight derivation mode can be understood as a data set, and the data set includes a plurality of parameters, for example, includes the third blending parameter. These plurality of parameters are all used to determine the weight.

[0662] In this situation 3, determining the first combination in S101 includes the following steps.

[0663] S101-E: Decode the bitstream to determine a list of candidate combinations. The list of candidate combinations includes at least one candidate combination, and any one of the at least one candidate combination includes one weight derivation mode and K prediction modes, and the weight derivation mode includes one blending parameter.

[0664] S101-F: Determine a first combination based on the list of candidate combinations.

[0665] Exemplarily, the list of candidate combinations is shown in Table 9.

[0666] [Table 9]

[0667] As shown in Table 9, the list of candidate combinations includes at least one candidate combination, and it is not the case that any two candidate combinations among the at least one candidate combination are exactly the same, that is, for any two candidate combinations, at least one of the weight derivation mode and the K prediction modes is different.

[0668] Exemplarily, in Table 9 above, the order of the candidate combinations in the list of candidate combinations is used as the index of the candidate combination. Optionally, the index of the candidate combination in the list of candidate combinations may be represented in other ways. In the embodiments of the present application, it is not limited thereto.

[0669] In this embodiment, the methods for the decoding side to determine the first combination based on the list of candidate combinations include, but are not limited to, the following several methods.

[0670] Method 1: The list of candidate combinations includes one candidate combination. In this case, the candidate combination included in the list of candidate combinations is determined as the first combination.

[0671] Method 2: The list of candidate combinations includes a plurality of candidate combinations. In this case, the bitstream is decoded to obtain a first index. The first index is used to indicate a first combination. The candidate combination corresponding to the first index in the list of candidate combinations is determined as the first combination.

[0672] In this Method 2, the decoding side decodes the bitstream to obtain a first index, determines the list of candidate combinations shown in Table 9 above, queries from the list of candidate combinations based on the first index, and obtains the first combination indicated by the first index.

[0673] For example, the first index is Index 1. In the list of candidate combinations shown in Table 9, the candidate combination corresponding to Index 1 is Candidate Combination 2. That is, the first combination indicated by the first index is Candidate Combination 2. In this way, the decoding side determines the weight derivation mode and K prediction modes included in Candidate Combination 2 as the first weight derivation mode and K first prediction modes included in the first combination, and uses the third blending parameter included in the first weight derivation mode and the K first prediction modes to predict the current component block to obtain a predicted value of the current component block.

[0674] Hereinafter, a specific process for determining the list of candidate combinations in S101-E above will be described.

[0675] In some embodiments, the list of candidate combinations already exists. After the decoding side decodes the bitstream to obtain a first index, it obtains or reads the list of candidate combinations based on the first index, and further, based on the first index, can query the candidate combination corresponding to the first index from the list of candidate combinations.

[0676] In some embodiments, the list of candidate combinations is transmitted from the encoding side to the decoding side. For example, before encoding the current component block, the encoding side transmits the list of candidate combinations to the decoding side.

[0677] In some embodiments, the list of candidate combinations is uploaded from the encoding side to the cloud, and the decoding side can read the list of candidate combinations from the cloud.

[0678] In some embodiments, the list of candidate combinations is constructed by the decoding side.

[0679] The embodiments of the present application do not limit the manner in which the decoding side constructs the list of candidate combinations. For example, using the information related to the current component block, analyze the probability of each combination consisting of different prediction modes and different blending parameters, and construct the list of candidate combinations according to the probability of each combination.

[0680] Optionally, the information related to the current component block includes the mode information of the adjacent blocks of the current component block, the reconstruction samples of the first component block corresponding to the current component block, and the like.

[0681] In some embodiments, the decoding side constructs the list of candidate combinations according to the following steps S101-E1 and S101-E2.

[0682] S101-E1: Decode the bitstream to determine the first component block corresponding to the current component block.

[0683] S101-E2: Construct the list of candidate combinations based on the first component block.

[0684] For the specific implementation process of S101-E1, refer to the description of S101-A1 above, and it will not be repeated here.

[0685] Since the first component block corresponds to the current component block and has a relationship with the current component block, in the embodiments of the present application, a list of candidate combinations of the current component block is constructed based on the first component block.

[0686] For example, for each combination, the first component block is predicted using that combination to obtain a predicted value of the first component block corresponding to each combination, and a list of candidate combinations is constructed based on the predicted values of the first component blocks corresponding to each combination. For example, for each combination, the weight of the first component block is derived using the weight derivation mode included in the combination, the first component block is predicted using each of the K prediction modes included in the combination to obtain K predicted values of the first component block, the K predicted values of the first component block are weighted based on the derived weight of the first component block to obtain a predicted value of the first component block corresponding to the combination. Finally, a list of candidate combinations is constructed based on the predicted values of the first component blocks corresponding to each combination.

[0687] Note that the weight derived based on the weight derivation mode can be understood as the weight corresponding to each sample in the first component block or the weight matrix corresponding to the first component block. Adjusting the weight of the first component block using the blending parameter can be understood as adjusting the weight corresponding to each sample in the first component block or adjusting the weight matrix of the first component block. When determining the predicted value of the first component block based on the adjusted weight of the first component block, K predicted values corresponding to each sample in the first component block can be determined, and the predicted value corresponding to each sample can be determined based on the K predicted values corresponding to each sample and the adjusted weight. The predicted values corresponding to each sample in the first component block constitute the predicted value of the first component block. Optionally, determining the predicted value of the first component block based on the adjusted weight can be performed based on the block. For example, the predicted value of the first component block can be determined, and the K predicted values of the first component block can be weighted based on the adjusted weight matrix of the first component block to obtain the predicted value of the first component block.

[0688] In some embodiments, S101-E2 includes the following steps S101-E21 to S101-E23.

[0689] S101-E21: Determine R second combinations. Any one of the R second combinations includes one weight derivation mode and K prediction modes. The weight derivation mode includes one blending parameter, and the weight derivation modes and K prediction modes included in any two of the R second combinations are not exactly the same. R is a positive integer greater than 1.

[0690] S101-E22: For any one of the R second combinations, determine the cost corresponding to the second combination when predicting the first component block using the weight derivation mode and K prediction modes in the second combination.

[0691] S101-E23: Construct a list of candidate combinations based on the cost corresponding to each of the R second combinations.

[0692] In this embodiment, when constructing a list of candidate combinations, the decoding side first determines R second combinations. In this application, the specific number of the R second combinations is not limited. For example, it can be 8, 16, 32, etc. Each of the R second combinations includes one weight derivation mode and K prediction modes. The weight derivation mode includes one blending parameter. It is not the case that the weight derivation mode and the K prediction modes included in any two of the R second combinations are exactly the same. Next, for each of the R second combinations, determine the cost corresponding to that second combination when predicting the first component block using the weight derivation mode and the K prediction modes included in that second combination. Finally, construct a list of candidate combinations based on the cost corresponding to each of the R second combinations.

[0693] In some embodiments, determining the cost corresponding to a second combination when predicting the first component block using the weight derivation mode and the K prediction modes in the second combination in S101-E22 includes at least the following methods.

[0694] Method 1: S101-E22 includes S101-E22-11 to S101-E22-14 below.

[0695] S101-E22-11: Determine the weight of the first component block based on the weight derivation mode included in the second combination.

[0696] S101-E22-12: Predict the first component block based on the K prediction modes in the second combination to obtain K predicted values of the first component block.

[0697] S101-E22-13: Weight the K predicted values of the first component block based on the weight of the first component block to obtain the predicted value of the first component block corresponding to the second combination.

[0698] S101-E22-14: Determine the cost corresponding to the second combination based on the predicted value of the first component block corresponding to the second combination and the reconstructed value of the first component block.

[0699] In the embodiments of the present application, the process of determining the cost corresponding to each of the R second combinations is the same. For the sake of easy explanation, one of the R second combinations is taken as an example for explanation here.

[0700] In the embodiments of the present application, the second combination includes one weight derivation mode and K prediction modes. When predicting the first component block using the second combination, illustratively, on the decoding side, the weight of the first component block is determined based on the weight derivation mode included in the second combination. The first component block is predicted based on the K prediction modes included in the second combination to obtain K predicted values of the first component block. Next, based on the weight of the first component block, the K predicted values of the first component block are weighted to obtain the predicted value of the first component block corresponding to the second combination. Next, the cost corresponding to the second combination is determined based on the predicted value of the first component block corresponding to the second combination and the reconstructed value of the first component block.

[0701] In the embodiments of the present application, the specific manner of determining the weight of the first component block based on the weight derivation mode included in the second combination in S101-E22-11 above is not limited. For example, the weight derivation mode in the second combination includes blending parameters, and thus, the weight of the first component block can be determined based on the blending parameters.

[0702] Method 2: S101-E22 includes the following S101-E22-11 to S101-E22-14.

[0703] S101-E22-21: Determine the predicted values of the first component blocks corresponding to each of the K prediction modes in the second combination based on the weight derivation mode in the second combination.

[0704] S101-E22-22: Determine the costs corresponding to each of the K prediction modes in the second combination based on the predicted values of the first component blocks corresponding to each of the K prediction modes in the second combination and the reconstruction values of the first component blocks.

[0705] S101-E22-23: Determine the cost corresponding to the second combination based on the costs corresponding to each of the K prediction modes in the second combination. For example, determine the sum of the costs corresponding to each of the K prediction modes in the second combination as the cost corresponding to the second combination.

[0706] For example, assuming K = 2, the two prediction modes included in the second combination are denoted as prediction mode 1 and prediction mode 2 respectively. First, based on the weight derivation mode included in this second combination, the weight and predicted value of the first component block corresponding to prediction mode 1 are determined, and the predicted value corresponding to prediction mode 1 is processed using the weight of the first component block corresponding to prediction mode 1. For example, for each sample in the first component block corresponding to prediction mode 1, the predicted value of the sample in the first component block corresponding to prediction mode 1 is multiplied by the weight of the first component block corresponding to that sample to obtain the predicted value of that sample. In this way, the predicted value of the first component block corresponding to prediction mode 1 can be determined. Next, based on the predicted value of the first component block corresponding to prediction mode 1 and the reconstruction value of the first component block, the cost corresponding to prediction mode 1 can be determined. The method for determining the cost corresponding to prediction mode 1 includes, but is not limited to, SAD, SATD, SEE, etc. Similarly, the cost corresponding to prediction mode 2 can be determined. Further, based on the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2, the cost corresponding to the second combination is determined. For example, the sum of the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2 is determined as the cost corresponding to the second combination.

[0707] Regarding the method of constructing a list of candidate combinations based on the cost corresponding to each of the R second combinations in S101 - E23 above, reference can be made to the description of S101 - A23 above, and it will not be repeated here.

[0708] Hereinafter, the process of determining the R second combinations in S101 - E21 above will be described.

[0709] In some embodiments, the R second combinations are preset.

[0710] In some embodiments, S101 - E21 includes the following steps.

[0711] S101-E21-1: Determine C weight derivation modes and D prediction modes. C is a positive integer, and D is a positive integer greater than or equal to K.

[0712] S101-E21-2: Based on the C weight derivation modes and D prediction modes, construct R second combinations. Any one of the R second combinations includes one of the C weight derivation modes and K of the D prediction modes.

[0713] In this embodiment, on the decoding side, first, determine C weight derivation modes and D prediction modes, and then, based on the determined C weight derivation modes and D prediction modes, construct R second combinations.

[0714] In the embodiments of the present application, the specific numbers of the above C weight derivation modes and D prediction modes are not limited.

[0715] Assume K = 2, and the above K prediction modes include the first prediction mode and the second prediction mode. Assume there are D available prediction modes in total. There are D possibilities for the first prediction mode, and since the second prediction mode is different from the first prediction mode, there are D - 1 possibilities for the second prediction mode. Assume there are C weight derivation modes. In the present application, one second combination can be constructed using any two different prediction modes, any one weight derivation mode, and any one blending gradient coefficient, and there are a total of C * D * (D - 1) possible second combinations.

[0716] In this embodiment, the C weight derivation modes are all possible weight derivation modes. The weight derivation mode includes blending parameters, that is, the C weight derivation modes include all possible blending parameters, and the D prediction modes are all possible prediction modes. Using exhaustive enumeration, all possible second combinations are obtained. Using each of all possible second combinations, the first component block is predicted to calculate the distortion cost of each second combination, and further, based on the distortion cost of each second combination, a list of candidate combinations corresponding to the current component block is obtained.

[0717] In some embodiments, in order to reduce the data volume and increase the construction speed of the list of candidate combinations, instead of trying all prediction modes, some prediction modes can be selected and tried.

[0718] In this case, the embodiments for determining the D prediction modes in S101-E21-1 include but are not limited to the following several methods.

[0719] Method 1: The D prediction modes are pr...

Claims

1. A video decoding method, comprising: decoding a bitstream to determine a first combination, wherein the first combination includes a first weight derivation mode and K first prediction modes, and K is a positive integer greater than 1; predicting a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block, wherein the current component block includes a second component block or a third component block; and a video decoding method characterized by the above.

2. The step of decoding the bitstream to determine a first combination includes: decoding the bitstream to determine a list of candidate combinations, wherein the list of candidate combinations includes at least one candidate combination, and any one of the at least one candidate combination includes one weight derivation mode and K prediction modes; determining the first combination based on the list of candidate combinations; and the method according to claim 1, characterized by the above.

3. The list of candidate combinations includes one candidate combination, and the step of determining the first combination based on the list of candidate combinations includes: determining the candidate combination included in the list of candidate combinations as the first combination. the method according to claim 2, characterized by the above.

4. The list of candidate combinations includes a plurality of candidate combinations, and the step of determining the first combination based on the list of candidate combinations includes: decoding the bitstream to obtain a first index, wherein the first index is used to indicate the first combination; determining the candidate combination corresponding to the first index in the list of candidate combinations as the first combination; and the method according to claim 2, characterized by the above.

5. The step of decoding the bitstream to determine a list of candidate combinations includes: decoding the bitstream to determine a first component block corresponding to the current component block; constructing the list of candidate combinations based on the first component block; and the method according to any one of claims 2 to 4, characterized by the above.

6. The first component block is a first component block in the same space in the current image as the current component block. The method according to claim 5, characterized in that. **Claim 7** Constructing the list of candidate combinations based on the first component block includes: Determining R second combinations, where any one of the R second combinations includes one weight derivation mode and K prediction modes, and R is a positive integer greater than 1; For any one of the R second combinations, determining the cost corresponding to the second combination when predicting the first component block using the second combination; Constructing the list of candidate combinations based on the costs corresponding to each of the R second combinations; including The method according to claim 5, characterized in that. **Claim 8** Determining the cost corresponding to the second combination when predicting the first component block using the second combination includes: Determining the weight of the first component block based on the weight derivation mode included in the second combination; Predicting the first component block based on the K prediction modes in the second combination to obtain K prediction values of the first component block; Weighting the K prediction values of the first component block based on the weight of the first component block to obtain a prediction value of the first component block corresponding to the second combination; Determining the cost corresponding to the second combination based on the prediction value of the first component block corresponding to the second combination and the reconstruction value of the first component block; including The method according to claim 7, characterized in that. **Claim 9** Determining the cost corresponding to the second combination when predicting the first component block using the second combination includes: Determining the prediction value of the first component block corresponding to each of the K prediction modes in the second combination based on the weight derivation mode in the second combination; Determining the cost corresponding to each of the K prediction modes in the second combination based on the prediction value of the first component block corresponding to each of the K prediction modes in the second combination and the reconstruction value of the first component block; Determining the cost corresponding to the second combination based on the costs corresponding to each of the K prediction modes in the second combination; including The method according to claim 7, characterized in that

10. Determining the cost corresponding to the second combination based on the cost corresponding to each of the K prediction modes in the second combination comprises determining the sum of the costs corresponding to each of the K prediction modes in the second combination as the cost corresponding to the second combination. The method according to claim 9, characterized in that

11. Determining the R second combinations comprises determining P weight derivation modes and Q prediction modes, where P is a positive integer and Q is a positive integer greater than or equal to K, and constructing the R second combinations based on the P weight derivation modes and the Q prediction modes, wherein any one of the R second combinations includes one of the P weight derivation modes and K of the Q prediction modes. including The method according to any one of claims 7 to 10, characterized in that

12. Determining the Q prediction modes comprises determining at least one of the list of candidate prediction modes of the current component block, the list of preliminary prediction modes corresponding to each of the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and a preset mode, wherein the list of candidate prediction modes includes a plurality of candidate prediction modes, and the list of preliminary prediction modes corresponding to any one of the K prediction modes includes at least one preliminary prediction mode, and determining the Q prediction modes based on at least one of the list of candidate prediction modes, the list of preliminary prediction modes corresponding to each of the K prediction modes, and the prediction mode corresponding to the weight derivation mode. including The method according to claim 11, characterized in that

13. Determining the list of candidate prediction modes of the current component block comprises Determining at least one of a second prediction mode, a third prediction mode, a fourth prediction mode, and a fifth prediction mode, wherein the second prediction mode is used for at least one of a first component block, a second component block, and a third component block at a preset position, the third prediction mode is used for at least one of a first component block, a second component block, and a third component block that is adjacent to and decoded from the current component block, the fourth prediction mode is used for a first component block corresponding to a preset region inside the current component block, and the fifth prediction mode is related to a first component block corresponding to the current component block; Determining a list of candidate prediction modes for the current component block based on at least one of the second prediction mode, the third prediction mode, the fourth prediction mode, and the fifth prediction mode; including; The method according to claim 11, characterized by the above.

14. Determining the fifth prediction mode related to the first component block corresponding to the current component block includes: Determining the texture direction of the first component block corresponding to the current component block; Determining the fifth prediction mode based on the texture direction; including; The method according to claim 13, characterized by the above.

15. Determining the fifth prediction mode based on the texture direction includes: Determining, as the fifth prediction mode, a prediction mode having a prediction direction parallel to the texture direction, and / or Determining, as the fifth prediction mode, a prediction mode having a prediction direction perpendicular to the texture direction; including; The method according to claim 14, characterized by the above.

16. Determining the texture direction of the first component block corresponding to the current component block includes: Selecting a plurality of texture samples from the first component block based on a preset method of texture sample selection; Determining the texture direction corresponding to each of the plurality of texture samples; Determining one or more of the texture directions corresponding to each of the plurality of texture samples as the texture direction of the first component block; including; The method according to claim 14, characterized by the above.

17. Determining one or more of the texture directions corresponding to each of the plurality of texture samples as the texture direction of the first component block is including determining one or more of the texture directions that most frequently appear among the texture directions corresponding to each of the plurality of texture samples as the texture direction of the first component block, The method according to claim 16, characterized in that.

18. Determining the P weight derivation modes is including selecting the P weight derivation modes from M preset weight derivation modes, where M is a positive integer greater than or equal to P, The method according to claim 10, characterized in that.

19. Predicting the current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block is determining a first blending parameter; predicting the current component block based on the first blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block; including The method according to any one of claims 1 to 4, 6 to 10, 12 to 18, characterized in that.

20. Predicting the current component block based on the first blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block is determining the weights of the predicted values based on the first blending parameter and the first weight derivation mode; predicting the current component block based on the K first prediction modes to obtain K predicted values; weighting the K predicted values based on the weights of the predicted values to obtain a predicted value of the current component block; including The method according to claim 19, characterized in that.

21. The first combination includes a second blending parameter, and predicting the current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block is Predicting the current component block based on the second blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block; including; The method according to any one of claims 1 to 4, 6 to 10, 12 to 18, characterized by this.

22. Predicting the current component block based on the second blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block is determining the weight of the predicted value based on the second blending parameter and the first weight derivation mode; predicting the current component block based on the K first prediction modes to obtain K predicted values; weighting the K predicted values based on the weight of the predicted value to obtain a predicted value of the current component block; including; The method according to claim 21, characterized by this.

23. The first weight derivation mode includes a third blending parameter, and predicting the current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block is predicting the current component block based on the third blending parameter and the K first prediction modes to obtain a predicted value of the current component block; including; The method according to any one of claims 1 to 4, 6 to 10, 12 to 18, characterized by this.

24. Predicting the current component block based on the third blending parameter and the K first prediction modes to obtain a predicted value of the current component block is determining the weight of the predicted value based on the third blending parameter; predicting the current component block based on the K first prediction modes to obtain K predicted values; weighting the K predicted values based on the weight of the predicted value to obtain a predicted value of the current component block; including; The method according to claim 23, characterized by this.

25. The method is further comprising decoding the bitstream to obtain at least one flag, wherein the at least one flag is used to indicate whether to use a first combination for decoding the current component block, decoding the bitstream to determine a first combination, when the at least one flag indicates using the first combination for decoding the current component block, further comprising decoding the bitstream to determine the first combination, The method according to any one of claims 1 to 4, 6 to 10, 12 to 18, characterized in that.

26. The at least one flag includes at least one of a sequence level flag, an image level flag, a slice level flag, a unit level flag, and a block level flag. The method according to claim 25, characterized in that.

27. A video encoding method, determining a first combination, wherein the first combination includes a first weight derivation mode and K first prediction modes, and K is a positive integer greater than 1, predicting a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block, wherein the current component block includes a second component block or a third component block, including A video encoding method, characterized in that.

28. Determining the first combination determining a list of candidate combinations, wherein the list of candidate combinations includes at least one candidate combination, and any one of the at least one candidate combination includes one weight derivation mode and K prediction modes, determining the first combination based on the list of candidate combinations, including The method according to claim 27, characterized in that.

29. The method further comprising skipping signaling a first index in the bitstream when the list of candidate combinations includes one candidate combination, wherein the first index is used to indicate the first combination, The method according to claim 28, characterized in that.

30. The method If the list of candidate combinations includes a plurality of candidate combinations, it further includes signaling a first index in the bitstream, and the first index is used to indicate the first combination. The method according to claim 28, characterized in that.

31. Determining the list of candidate combinations includes: Determining a first component block corresponding to the current component block; Constructing a list of candidate combinations based on the first component block; including; The method according to any one of claims 28 to 30, characterized in that.

32. The first component block is a first component block in the same space as the current component block within the current image. The method according to claim 31, characterized in that.

33. Constructing the list of candidate combinations based on the first component block includes: Determining R second combinations, any one of the R second combinations including one weight derivation mode and K prediction modes, and R being a positive integer greater than 1; For any one of the R second combinations, determining the cost corresponding to the second combination when predicting the first component block using the second combination; Constructing the list of candidate combinations based on the cost corresponding to each of the R second combinations; including; The method according to claim 31, characterized in that.

34. Determining the cost corresponding to the second combination when predicting the first component block using the second combination includes: Determining the weight of the first component block based on the weight derivation mode included in the second combination; Predicting the first component block based on the K prediction modes in the second combination to obtain K prediction values of the first component block; Weighting the K prediction values of the first component block based on the weight of the first component block to obtain a prediction value of the first component block corresponding to the second combination; Determining the cost corresponding to the second combination based on the prediction value of the first component block corresponding to the second combination and the reconstruction value of the first component block; including; The method according to claim 33, characterized in that.

35. When predicting the first component block using the second combination, determining the cost corresponding to the second combination includes: Based on the weight derivation mode in the second combination, determining the predicted value of the first component block corresponding to each of the K prediction modes in the second combination; Based on the predicted value of the first component block corresponding to each of the K prediction modes in the second combination and the reconstruction value of the first component block, determining the cost corresponding to each of the K prediction modes in the second combination; Based on the cost corresponding to each of the K prediction modes in the second combination, determining the cost corresponding to the second combination; including: The method according to claim 33, characterized in that.

36. Based on the cost corresponding to each of the K prediction modes in the second combination, determining the cost corresponding to the second combination includes: Determining the sum of the costs corresponding to each of the K prediction modes in the second combination as the cost corresponding to the second combination, including: The method according to claim 35, characterized in that.

37. Determining the R second combinations includes: Determining P weight derivation modes and Q prediction modes, where P is a positive integer and Q is a positive integer greater than or equal to K; Based on the P weight derivation modes and the Q prediction modes, constructing the R second combinations, where any one of the R second combinations includes one of the P weight derivation modes and K of the Q prediction modes; including: The method according to any one of claims 33 to 36, characterized in that.

38. Determining the Q prediction modes includes: Determining at least one of the list of candidate prediction modes of the current component block, the list of preliminary prediction modes corresponding to each of the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode, where the list of candidate prediction modes includes a plurality of candidate prediction modes, and the list of preliminary prediction modes corresponding to any one of the K prediction modes includes at least one preliminary prediction mode; Determining the Q prediction modes based on at least one of the list of the candidate prediction modes, the list of preliminary prediction modes corresponding to each of the K prediction modes, and the prediction mode corresponding to the weight derivation mode; including; The method according to claim 37, characterized in that.

39. Determining the list of candidate prediction modes of the current component block is determining at least one of a second prediction mode, a third prediction mode, a fourth prediction mode, and a fifth prediction mode, wherein the second prediction mode is used for at least one of a first component block, a second component block, and a third component block at a preset position, the third prediction mode is used for at least one of a first component block, a second component block, and a third component block that is adjacent to and encoded with the current component block, the fourth prediction mode is used for a first component block corresponding to a preset area inside the current component block, and the fifth prediction mode is related to the first component block corresponding to the current component block; determining the list of candidate prediction modes of the current component block based on at least one of the second prediction mode, the third prediction mode, the fourth prediction mode, and the fifth prediction mode; including; The method according to claim 11, characterized in that.

40. Determining the fifth prediction mode related to the first component block corresponding to the current component block is determining the texture direction of the first component block corresponding to the current component block; determining the fifth prediction mode based on the texture direction; including; The method according to claim 39, characterized in that.

41. Determining the fifth prediction mode based on the texture direction is determining a prediction mode parallel to the angle of the texture direction as the fifth prediction mode, and / or determining a prediction mode perpendicular to the angle of the texture direction as the fifth prediction mode; including; The method according to claim 40, characterized in that.

42. Determining the texture direction of the first component block corresponding to the current component block is Selecting a plurality of texture samples from the first component block based on a preset method for texture sample selection; Determining a texture direction corresponding to each of the plurality of texture samples; Determining one or more of the texture directions corresponding to each of the plurality of texture samples as the texture direction of the first component block; comprising The method according to claim 40, characterized in that.

43. Determining one or more of the texture directions corresponding to each of the plurality of texture samples as the texture direction of the first component block, includes determining, as the texture direction of the first component block, one or more of the texture directions that appear most frequently among the texture directions corresponding to each of the plurality of texture samples. The method according to claim 42, characterized in that.

44. Determining the P weight derivation modes includes selecting the P weight derivation modes from M preset weight derivation modes, where M is a positive integer greater than or equal to P. The method according to claim 37, characterized in that.

45. Predicting the current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block, determining a first blending parameter; predicting the current component block based on the first blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block; comprising The method according to any one of claims 27 to 30, 32 to 36, 38 to 44, characterized in that.

46. Predicting the current component block based on the first blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block, determining weights of predicted values based on the first blending parameter and the first weight derivation mode; predicting the current component block based on the K first prediction modes to obtain K predicted values; weighting the K predicted values based on the weights of the predicted values to obtain a predicted value of the current component block; comprising The method according to claim 45, characterized in that **Claim 47** wherein the first combination includes a second blending parameter, and predicting a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block is predicting the current component block based on the second blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block, comprising The method according to any one of claims 27 to 30, 32 to 36, 38 to 44, characterized in that **Claim 48** Predicting the current component block based on the second blending parameter, the first weight derivation mode, and the K first prediction modes to obtain a predicted value of the current component block is determining weights of predicted values based on the second blending parameter and the first weight derivation mode; predicting the current component block based on the K first prediction modes to obtain K predicted values; weighting the K predicted values based on the weights of the predicted values to obtain a predicted value of the current component block, comprising The method according to claim 47, characterized in that **Claim 49** wherein the first weight derivation mode includes a third blending parameter, and predicting a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block is predicting the current component block based on the third blending parameter and the K first prediction modes to obtain a predicted value of the current component block, comprising The method according to any one of claims 27 to 30, 32 to 36, 38 to 44, characterized in that **Claim 50** Predicting the current component block based on the third blending parameter and the K first prediction modes to obtain a predicted value of the current component block is determining weights of predicted values based on the third blending parameter; predicting the current component block based on the K first prediction modes to obtain K predicted values; performing weighting on the K predicted values based on the weights of the predicted values to obtain a predicted value of the current component block; including; The method according to claim 49, characterized in that.

51. The method further includes; determining at least one flag, the at least one flag being used to indicate whether to use a first combination to decode the current component block, determining the first combination includes; when the at least one flag indicates using the first combination to decode the current component block, determining the first combination. The method according to any one of claims 27 to 30, 32 to 36, and 38 to 44, characterized in that.

52. The at least one flag includes at least one of a sequence level flag, an image level flag, a slice level flag, a unit level flag, and a block level flag; The method according to claim 51, characterized in that.

53. A video decoding apparatus, comprising: a decoding unit and a prediction unit; the decoding unit is configured to decode a bitstream to determine a first combination, the first combination including a first weight derivation mode and K first prediction modes, where K is a positive integer greater than 1; the prediction unit is configured to predict a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block. A video decoding apparatus, characterized in that.

54. A video encoding apparatus, comprising: a determination unit and a prediction unit; the determination unit is configured to determine a first combination, the first combination including a first weight derivation mode and K first prediction modes, where K is a positive integer greater than 1; the prediction unit is configured to predict a current component block based on the first weight derivation mode and the K first prediction modes to obtain a predicted value of the current component block. A video encoding apparatus, characterized in that.

55. An electronic device comprising a processor and a memory, the memory is configured to store a computer program, The processor is configured to call and execute the computer program stored in the memory, so as to implement the method according to any one of claims 1 to 26 or the method according to any one of claims 27 to 52. An electronic device characterized by the above.

56. A video coding system, including a video encoder and a video decoder, wherein the video decoder is configured to implement the method according to any one of claims 1 to 26, and the video encoder is configured to implement the method according to any one of claims 27 to 52. A video coding system characterized by the above.

57. A computer-readable storage medium, wherein the computer-readable storage medium is configured to store a computer program, and the computer program causes a computer to execute the method according to any one of claims 1 to 26 or the method according to any one of claims 27 to 52. A computer-readable storage medium characterized by the above.

58. Generated based on the method according to any one of claims 27 to 52, A bitstream characterized by the above.

Citation Information

Patent Citations

  • Intra-frame prediction methods, encoder, decoder and storage medium

    WO2022116317A1