Video coding method and system, and video encoder and video decoder

CN116962684BActive Publication Date: 2026-08-11GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-03
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]在对当前块进行预测时,通常分别是对该当前块的亮度分量和色度分量进行预测,分别获得对应的亮度预测块和/或色度预测块,没有较好的利用二者之间的关联,不能简单高效地对色度分量进行预测

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116962684B_ABST
    Figure CN116962684B_ABST
Patent Text Reader

Abstract

This application provides a video encoding and decoding method and system, as well as a video encoder and a video decoder. When it is determined that the initial intra-prediction mode of the current block under the first component is the derived mode, at least two intra-prediction modes used by the second component corresponding to the current block during intra-prediction are obtained; based on the at least two intra-prediction modes under the second component, the intra-prediction mode of the current block under the first component is determined; using the intra-prediction mode, the first component intra-prediction is performed on the current block, thereby achieving a simple and efficient determination of the intra-prediction mode of the current block under the first component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video encoding and decoding technology, and in particular to a video encoding and decoding method and system, as well as a video encoder and a video decoder. Background Technology

[0002] Digital video technology can be integrated into various video devices, such as digital televisions, smartphones, computers, e-readers, and video players. With the development of video technology, the amount of data contained in video data has become increasingly large. To facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.

[0003] Currently, spatial or temporal prediction is used to reduce or eliminate redundant information in video data to achieve video data compression. Prediction methods include inter-frame prediction and intra-frame prediction, where intra-frame prediction predicts the current block based on neighboring blocks that have already been decoded in the same frame.

[0004] When predicting the current block, the luminance component and chrominance component of the current block are usually predicted separately to obtain the corresponding luminance prediction block and / or chrominance prediction block, respectively. However, the correlation between the two is not well utilized, and the chrominance component cannot be predicted simply and efficiently. Summary of the Invention

[0005] This application provides a video encoding and decoding method and system, as well as a video encoder and a video decoder, which enables the simple and efficient determination of the intra-prediction mode of the current block in the first component based on the two intra-prediction modes in the second component when the second component of the current block includes two intra-prediction modes.

[0006] In a first aspect, this application provides a video coding method, including:

[0007] Obtain the current block, which includes the first component;

[0008] Determine the initial intra-frame prediction mode of the current block in the first component;

[0009] When the initial intra-prediction mode is determined to be the derived mode, at least two intra-prediction modes under the second component corresponding to the current block are obtained.

[0010] Based on at least two intra-prediction modes under the second component, determine the intra-prediction mode of the current block under the first component;

[0011] Using the intra-prediction mode of the current block under the first component, perform intra-prediction of the current block under the first component to obtain the final predicted block of the current block under the first component.

[0012] Secondly, embodiments of this application provide a video decoding method, including:

[0013] Parse the bitstream to obtain the current block and at least two intra-prediction modes under the second component corresponding to the current block. The current block includes the first component.

[0014] Determine the initial intra-frame prediction mode of the current block in the first component;

[0015] When the initial intra-prediction mode is the derived mode, the intra-prediction mode of the current block under the first component is determined based on at least two intra-prediction modes under the second component.

[0016] Using the intra-prediction mode of the current block under the first component, perform intra-prediction of the current block under the first component to obtain the final predicted block of the current block under the first component.

[0017] Thirdly, this application provides a video encoder for performing the methods described in the first aspect or its various implementations. Specifically, the encoder includes functional units for performing the methods described in the first aspect or its various implementations.

[0018] Fourthly, this application provides a video decoder for performing the methods described in the second aspect or its implementations. Specifically, the decoder includes functional units for performing the methods described in the second aspect or its implementations.

[0019] Fifthly, a video encoder is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the methods in the first aspect or its implementations described above.

[0020] In a sixth aspect, a video decoder is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the methods in the second aspect or its implementations described above.

[0021] In a seventh aspect, a video encoding and decoding system is provided, including a video encoder and a video decoder. The video encoder is used to execute the methods in the first aspect or its implementations described above, and the video decoder is used to execute the methods in the second aspect or its implementations described above.

[0022] Eighthly, a chip is provided for implementing the methods of any one of the first to second aspects or their respective implementations. Specifically, the chip includes a processor for calling and running a computer program from a memory, causing a device on which the chip is mounted to perform the methods of any one of the first to second aspects or their respective implementations.

[0023] Ninthly, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the methods of any one of the first to second aspects or their respective implementations.

[0024] In a tenth aspect, a computer program product is provided, including computer program instructions that cause a computer to perform the methods of any one of the first to second aspects or their respective implementations.

[0025] Eleventhly, a computer program is provided that, when run on a computer, causes the computer to perform the methods of any one of the first to second aspects or their respective implementations.

[0026] Based on the above technical solutions, in the intra-frame prediction process of video encoding and decoding, when the initial intra-frame prediction mode of the current block in the first component is determined to be the derived mode, the intra-frame prediction mode of the current block in the first component is determined by using at least two intra-frame prediction modes in the second component. This allows for a simple and efficient determination of the intra-frame prediction mode of the current block in the first component. For example, directly using at least two intra-frame prediction modes in the second component as the intra-frame prediction mode of the current block in the first component not only achieves a simple and efficient determination of the intra-frame prediction of the current block in the first component, but also enables accurate prediction of complex textures when using at least two intra-frame prediction modes to predict the first component of the current block, thereby improving the quality of intra-frame prediction and compression performance. Furthermore, deriving the intra-frame prediction mode of the current block in the first component based on the intra-frame prediction mode in the second component can utilize the correlation between channels, thereby reducing the transmission of mode information of the first component in the bitstream and effectively improving coding efficiency. Attached Figure Description

[0027] Figure 1 This is a schematic block diagram of a video encoding and decoding system 100 according to an embodiment of this application;

[0028] Figure 2 This is a schematic block diagram of the video encoder 200 provided in the embodiments of this application;

[0029] Figure 3 This is a schematic block diagram of the decoding framework 300 provided in an embodiment of this application;

[0030] Figure 4A It is a weighted graph of GPM for 64 modes on a square block;

[0031] Figure 4B It is a weighted graph of 56 patterns of AWP on a square block;

[0032] Figure 5 This is a schematic diagram of reference pixels involved in an embodiment of this application;

[0033] Figure 6 This is a schematic diagram of the multi-reference line intra-frame prediction method involved in the embodiments of this application;

[0034] Figure 7 This is a schematic diagram of the nine intra-frame prediction modes of H.264;

[0035] Figure 8 This is a schematic diagram of the 35 intra-frame prediction modes of HEVC;

[0036] Figure 9 This is a schematic diagram of the 67 intra-frame prediction modes of VVC;

[0037] Figure 10 This is a schematic diagram of the 66 intra-frame prediction modes of AVS3;

[0038] Figure 11A This is a schematic diagram illustrating the principle of intra-frame prediction of luminance blocks in an embodiment of this application;

[0039] Figure 11B This is a schematic diagram of a storage method for the intra-frame prediction mode involved in an embodiment of this application;

[0040] Figure 12 This is a schematic flowchart of a video encoding method 400 provided in an embodiment of this application;

[0041] Figure 13 This is a schematic diagram illustrating the division of the first component and the second component in an embodiment of this application;

[0042] Figure 14 This is another flowchart illustrating the video encoding method 500 provided in the embodiments of this application;

[0043] Figure 15 This is another flowchart illustrating the video encoding method 600 provided in the embodiments of this application;

[0044] Figure 16 This is a schematic flowchart of a video decoding method 700 provided in an embodiment of this application;

[0045] Figure 17 This is a schematic flowchart of a video decoding method 800 provided in an embodiment of this application;

[0046] Figure 18 This is a schematic flowchart of a video decoding method 900 provided in an embodiment of this application;

[0047] Figure 19 This is a schematic block diagram of the video encoder 10 provided in the embodiments of this application;

[0048] Figure 20 This is a schematic block diagram of the video decoder 20 provided in an embodiment of this application;

[0049] Figure 21 This is a schematic block diagram of the electronic device 30 provided in the embodiments of this application;

[0050] Figure 22 This is a schematic block diagram of the video encoding and decoding system 40 provided in the embodiments of this application. Detailed Implementation

[0051] This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, and real-time video encoding and decoding. For example, the solution of this application can be combined with audio video coding standards (AVS), such as H.264 / Audio Video Coding (AVC) standard, H.265 / High Efficiency Video Coding (HEVC) standard, and H.266 / Versatile Video Coding (VVC) standard. Alternatively, the solution of this application can be combined with other proprietary or industry standards, including ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262 or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO / IEC MPEG-4 AVC), which include Scalable Video Coding (SVC) and Multi-View Video Coding (MVC) extensions. It should be understood that the technology in this application is not limited to any particular codec standard or technology.

[0052] To facilitate understanding, let's first combine... Figure 1 The video encoding and decoding system involved in the embodiments of this application will be described.

[0053] Figure 1 This is a schematic block diagram of a video encoding / decoding system 100 according to an embodiment of this application. It should be noted that... Figure 1 This is merely an example; the video encoding and decoding system in this application includes, but is not limited to, [other systems]. Figure 1 As shown. Figure 1As shown, the video encoding / decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device encodes (can be understood as compressing) video data to generate a bitstream and transmits the bitstream to the decoding device. The decoding device decodes the bitstream generated by the encoding device to obtain the decoded video data.

[0054] The encoding device 110 in this application embodiment can be understood as a device with video encoding function, and the decoding device 120 can be understood as a device with video decoding function. That is, the encoding device 110 and the decoding device 120 in this application embodiment include a wider range of devices, such as smartphones, desktop computers, mobile computing devices, laptops (e.g., laptop computers), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, etc.

[0055] In some embodiments, encoding device 110 may transmit encoded video data (such as a bitstream) to decoding device 120 via channel 130. Channel 130 may include one or more media and / or means capable of transmitting encoded video data from encoding device 110 to decoding device 120.

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

[0057] In another example, channel 130 includes a storage medium that can store video data encoded by encoding device 110. The storage medium includes various local access data storage media, such as optical discs, DVDs, flash memory, etc. In this example, decoding device 120 can retrieve the encoded video data from the storage medium.

[0058] In another example, channel 130 may include a storage server that can store the video data encoded by encoding device 110. In this example, decoding device 120 can download the stored encoded video data from the storage server. Optionally, the storage server can store and transmit the encoded video data to decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.

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

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

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

[0062] Video encoder 112 encodes video data from video source 111 to generate a bitstream. The video data may include one or more pictures or a sequence of pictures. The bitstream contains the encoding information of the pictures or picture sequences in the form of a bitstream. The encoding information may include encoded image data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures. The SPS may contain parameters applied to one or more sequences. The PPS may contain parameters applied to one or more pictures. A syntax structure refers to a set of zero or more syntax elements arranged in a specified order within the bitstream.

[0063] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored on a storage medium or a storage server for subsequent retrieval by the decoding device 120.

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

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

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

[0067] The video decoder 122 is used to decode the encoded video data to obtain the decoded video data, and transmit the decoded video data to the display device 123.

[0068] Display device 123 displays the decoded video data. Display device 123 may be integrated with decoding device 120 or external to decoding device 120. Display device 123 may include various display devices, such as liquid crystal display (LCD), plasma display, organic light-emitting diode (OLED) display, or other types of display devices.

[0069] also, Figure 1 This is merely an example; the technical solutions in the embodiments of this application are not limited to... Figure 1 For example, the technology of this application can also be applied to one-sided video encoding or one-sided video decoding.

[0070] The video coding framework involved in the embodiments of this application is described below.

[0071] Figure 2 This is a schematic block diagram of the video encoder 200 provided in an embodiment of this application. It should be understood that the video encoder 200 can be used for lossy compression of images or lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression.

[0072] This video encoder 200 can be applied to image data in luminance / chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) per 4 pixels; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).

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

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

[0075] In some embodiments, such as Figure 2 As shown, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filtering unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may contain more, fewer, or different functional components.

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

[0077] In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame estimation unit 212. Because there is a strong correlation between adjacent pixels in a frame of a video, intra-frame prediction is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in a video, inter-frame prediction is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.

[0078] Inter-frame prediction unit 211 can be used for inter-frame prediction. Inter-frame prediction can refer to image information from different frames. Inter-frame prediction uses motion information to find reference blocks from reference frames and generates prediction blocks based on the reference blocks to eliminate temporal redundancy. The frames used for inter-frame prediction can be P-frames and / or B-frames. P-frames refer to forward prediction frames, and B-frames refer to bidirectional prediction frames. Motion information includes a list of reference frames, the reference frame index, and motion vectors. Motion vectors can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering needs to be used in the reference frame to create the required fractional-pixel blocks. Here, the integer-pixel or fractional-pixel blocks in the reference frame found based on the motion vectors are called reference blocks. Some techniques directly use the reference blocks as prediction blocks, while others process the reference blocks to generate prediction blocks. Processing the reference blocks to generate prediction blocks can also be understood as using the reference blocks as prediction blocks and then processing them to generate new prediction blocks.

[0079] The most commonly used inter-frame prediction methods currently include geometric partitioning mode (GPM) in the VVC video codec standard and angular weighted prediction (AWP) in the AVS3 video codec standard. These two intra-frame prediction modes share common principles.

[0080] Traditional unidirectional prediction uses only one reference block of the same size as the current block. Traditional bidirectional prediction uses two reference blocks of the same size as the current block, and the pixel value of each point in the prediction block is the average of the corresponding positions in the two reference blocks, meaning all points in each reference block account for 50%. Bidirectional weighted prediction allows the proportions of the two reference blocks to differ; for example, all points in the first reference block may account for 75%, and all points in the second reference block may account for 25%. However, all points within the same reference block have the same proportion. GPM or AWP also uses two reference blocks of the same size as the current block, but some pixel positions use 100% of the pixel values ​​from the corresponding positions in the first reference block, and some pixel positions use 100% of the pixel values ​​from the corresponding positions in the second reference block. In the boundary region, the pixel values ​​from the corresponding positions in the two reference blocks are used in a certain proportion. The specific allocation of these weights is determined by the GPM or AWP mode. Alternatively, GPM or AWP can be considered to use two reference blocks of different sizes than the current block, that is, taking a portion of each as the reference block. That is, the portion with a non-zero weight is used as the reference block, while the portion with a zero weight is discarded.

[0081] Figure 4A This is a weight map of 64 patterns of GPM on a square block. Black represents a weight of 0% for the corresponding position of the first reference block, white represents a weight of 100% for the corresponding position of the first reference block, and gray areas, depending on their shade, represent a weight value greater than 0% and less than 100% for the corresponding position of the first reference block. The weight value for the corresponding position of the second reference block is 100% minus the weight value for the corresponding position of the first reference block.

[0082] Figure 4B This is a weight map of 56 patterns of AWP on a square block. Black represents a weight of 0% for the position corresponding to the first reference block, white represents a weight of 100% for the position corresponding to the first reference block, and gray areas represent weight values ​​greater than 0% and less than 100% for the position corresponding to the first reference block, depending on the shade of the color. The weight value for the position corresponding to the second reference block is 100% minus the weight value for the position corresponding to the first reference block.

[0083] GPM and AWP use different methods to derive weights. GPM determines the angle and offset for each mode and then calculates the weight matrix for each mode. AWP first draws a one-dimensional weight line and then uses a method similar to intra-frame angle prediction to fill the entire matrix with the one-dimensional weight line.

[0084] Early encoding and decoding technologies only used rectangular partitioning, whether for CU, PU, ​​or TU. GPM and AWP, however, achieved non-rectangular partitioning for prediction without such partitioning. GPM and AWP use a weighted mask of two reference blocks, as shown in the weight map above. This mask determines the weights of the two reference blocks when generating the prediction block. Simply put, part of the prediction block's location comes from the first reference block, and part comes from the second. The blending area is obtained by weighting the corresponding positions of the two reference blocks, resulting in a smoother transition. Since GPM and AWP do not divide the current block into two CUs or PUs according to the dividing line, the residual transformations, quantizations, inverse transforms, and inverse quantizations after prediction are all processed as a single unit.

[0085] Intra-frame estimation unit 212 refers only to information from the same frame image to predict pixel information within the current code image block, thus eliminating spatial redundancy. The frame used for intra-frame prediction can be an I-frame. For example... Figure 5 As shown, the white 4x4 block is the current block. The gray pixels in the left row and top column of the current block are the reference pixels for the current block. Intra-frame prediction uses these reference pixels to predict the current block. These reference pixels may all be available, meaning they have all been encoded and decoded. Alternatively, some may be unavailable. For example, if the current block is the leftmost part of the frame, then the reference pixels to the left of the current block are unavailable. Or, if the lower left portion of the current block has not yet been encoded and decoded, then the lower left reference pixels are also unavailable. In cases where reference pixels are unavailable, they can be filled using available reference pixels, certain values, or certain methods, or no filling may be performed.

[0086] In some embodiments, the intra-frame prediction method further includes a multiple reference line (MRL) intra-frame prediction method. Figure 6 As shown, MRL can use more reference pixels to improve coding efficiency.

[0087] Intra-frame prediction has multiple prediction modes, such as Figure 7 The image shows nine modes for intra-frame prediction of a 4×4 block in H.264. Mode 0 copies the pixels above the current block vertically as the prediction value; Mode 1 copies the reference pixels on the left horizontally as the prediction value; Mode 2 (DC) uses the average of points A-D and I-L as the prediction value for all points; and Modes 3 to 8 copy the reference pixels to their corresponding positions in the current block at a specific angle. Because some positions in the current block may not correspond exactly to the reference pixels, a weighted average of the reference pixels, or interpolated sub-pixels of the reference pixels, may be needed.

[0088] like Figure 8 As shown, HEVC uses 35 prediction modes in total, including Planar, DC, and 33 angle modes.

[0089] like Figure 9 As shown, VVC uses Planar, DC, and 65 angle modes, for a total of 67 prediction modes.

[0090] like Figure 10 As shown, AVS3 uses intra-frame modes including DC, Plane, Bilinear, and 63 angle modes, for a total of 66 prediction modes.

[0091] In some embodiments, the intra-prediction mode also includes improved modes, such as improved sub-pixel interpolation of the reference pixel and filtering of the predicted pixels. For example, the multiple intraprediction filter (MIPF) in AVS3 can use different filters to generate predicted values ​​for different block sizes. Specifically, for pixels at different locations within the same block, one filter is used to generate predicted values ​​for pixels closer to the reference pixel, and another filter is used for pixels farther from the reference pixel. Another example is the intraprediction filter (IPF) in AVS3, which can use the reference pixel to filter the predicted values.

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

[0093] The residual unit 220 can generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, the residual unit 220 can generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the PU of the CU.

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

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

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

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

[0098] In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit and a sample adaptive compensation / adaptive loop filtering (SAO / ALF) unit, wherein the deblocking filtering unit is used to remove block effects and the SAO / ALF unit is used to remove ringing effects.

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

[0100] Entropy coding unit 280 can receive quantized transform coefficients from transform / quantization unit 230. Entropy coding unit 280 can perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data.

[0101] Figure 3 This is a schematic block diagram of the decoding framework 300 provided in the embodiments of this application.

[0102] like Figure 3 As shown, the video decoder 300 includes: a header information decoding unit 310, a prediction unit 320, an inverse quantization transformation unit 330, a reconstruction unit 340, a loop filtering unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may contain more, fewer, or different functional components.

[0103] The video decoder 300 can receive a bitstream. The header information decoding unit 310 can parse the bitstream to extract syntax elements from it. As part of parsing the bitstream, the header information decoding unit 310 can parse 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 the video data based on the syntax elements extracted from the bitstream, i.e., generate the decoded video data.

[0104] In some embodiments, the prediction unit 320 includes an intra-frame estimation unit 322 and an inter-frame prediction unit 321.

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

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

[0107] The inverse quantization transform unit 330 reversibly quantizes (i.e., dequantizes) the transform coefficients associated with the TU. The inverse quantization transform unit 330 can use the QP value associated with the CU of the TU to determine the degree of quantization.

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

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

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

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

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

[0113] At the decoding end, the header information decoding unit 310 can parse the bitstream to obtain the prediction information and quantization coefficient matrix of the current block. The prediction unit 320 uses intra-frame prediction or inter-frame prediction to generate the prediction block of the current block based on the prediction information. The inverse quantization transform unit 330 uses the quantization coefficient matrix obtained from the bitstream to perform inverse quantization and inverse transform on the quantization coefficient matrix to obtain the residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain the reconstructed block. The reconstructed blocks form the reconstructed image. The loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain the decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. This decoded image can also be called the reconstructed image, and the reconstructed image can be used as a reference frame for inter-frame prediction in subsequent frames.

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

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

[0116] The foregoing section introduced the video coding system, video encoder, video decoder, and intra-frame prediction mode involved in the embodiments of this application. Based on this, the technical solutions provided by the embodiments of this application will be described in detail below with reference to specific examples.

[0117] The video encoder of this application embodiment can be used for image blocks of different formats, such as YUV, YcbCr, and RGB formats. Each of these image blocks includes a first component and a second component. For example, in a YUV format image block, the second component can be the Y component (luminance component), and the first component can be the U and V components (chrominance components). The second component is more important than the first component; for example, the human eye is more sensitive to luminance than chrominance, therefore video encoding and decoding pay more attention to the Y component than the U and V components. For instance, in some commonly used YUV formats, the YUV ratio is 4:2:0, where the number of pixels in the U and V components is less than that in the Y component. In a YUV 4:2:0 block, the pixel ratio of Y, U, and V is 4:1:1. Therefore, the decision-making for some encoding and decoding modes under the chrominance component of the image block can be based on the information of the encoding and decoding modes under the luminance component.

[0118] For image blocks of other formats, such as RGB format, the decision on some encoding / decoding modes of the image block in the first component can also be based on the information of the encoding / decoding mode of the image block in the second component. This application mainly uses the YUV format as an example, but this application is not limited to any particular format.

[0119] When performing intra-frame prediction on the second component of an image block, this application employs at least two intra-frame prediction modes for the image block under the second component to achieve accurate prediction of complex textures. For example, if the second component is a luminance component, this application employs at least two intra-frame prediction modes to predict blocks of complex luminance textures to achieve accurate prediction of complex luminance texture blocks.

[0120] The image patch has at least two intra-prediction modes in the second component, including but not limited to the intra-prediction modes mentioned above such as DC, Planar, Plane, Bilinear and angle prediction modes, as well as improved prediction modes such as MIPF and IPF.

[0121] The process of intra-predicting the second component using at least two intra-prediction modes for the image patch in the second component involves predicting the second component using each of the at least two intra-prediction modes to obtain a prediction block corresponding to each intra-prediction mode. Then, the prediction blocks corresponding to each intra-prediction mode are processed to obtain the final prediction block of the image patch in the second component. For example, the prediction blocks corresponding to each intra-prediction mode can be added together, and the average value can be taken as the final prediction block of the image patch in the second component. For example, a weight matrix, namely the second weight matrix, can be determined, and the prediction blocks corresponding to each intra-prediction mode can be weighted according to the second weight matrix to obtain the final prediction block of the image patch in the second component. For example, assuming the second component is the luminance component, such as... Figure 11A As shown, for a luma block including at least two intra-frame prediction modes, namely a first intra-frame prediction mode and a second intra-frame prediction mode, the luma block is intra-frame predicted using the first intra-frame prediction mode to obtain a first prediction block, and the luma block is intra-frame predicted using the second intra-frame prediction mode to obtain a second prediction block. The first prediction block and the second prediction block are weighted using a second weight matrix to obtain the final prediction block of the luma block.

[0122] In one example, this application can also perform predictions for each pixel in the second component using different intra-frame prediction modes to obtain predicted values ​​for each pixel under different intra-frame prediction modes. Then, based on the weight values ​​corresponding to each pixel in the second weight matrix, the predicted values ​​of each pixel under different intra-frame prediction modes are weighted to obtain the final predicted value of each pixel in the second component. The final predicted value of each pixel in the second component constitutes the final predicted block of the image block in the second component. This eliminates the need to wait until each prediction block is obtained before weighting, thus eliminating the need for additional storage space to store the first and second prediction blocks, saving storage resources for the video encoder.

[0123] As can be seen from the above, the decision of some encoding and decoding modes for the same image block in the first component can be based on the information of the encoding and decoding modes of the same image block in the second component. That is to say, in some cases, the decision of the intra-frame coding mode of the image block in the first component can be based on the information of the intra-frame prediction mode of the image block in the second component.

[0124] Based on this, the following is combined with Figure 12 The encoding end will be introduced.

[0125] Figure 12 This is a flowchart illustrating a video encoding method 400 provided in an embodiment of this application. This embodiment of the application is applied to... Figure 1 and Figure 2 The video encoder shown. Figure 12As shown, the method in this application embodiment includes:

[0126] S401. Obtain the current block, which includes the first component.

[0127] During video encoding, the video encoder receives a video stream consisting of a series of image frames. Video encoding is performed on each frame in the video stream. For ease of description, this application denotes the current frame to be encoded as the target image frame. The video encoder divides the target image frame into blocks to obtain the current block.

[0128] In traditional block partitioning, the resulting blocks contain both the first component (e.g., chroma component) and the second component (e.g., luma component) at the current block location. Dual tree techniques, however, can partition blocks into individual component blocks, such as separate luma blocks and separate chroma blocks. Figure 13 As shown, the luminance blocks at the same position in the current block (also called the current image block) are divided into four luminance coding units, while the chrominance blocks are not divided. A luminance block can be understood as containing only the luminance component at the current block position, and a chrominance block can be understood as containing only the chrominance component at the current block position. This allows luminance and chrominance components at the same position to belong to different blocks, providing greater flexibility in partitioning. If the split tree is used in CU partitioning, some CUs will contain both the first and second components, some CUs will contain only the first component, and some CUs will contain only the second component.

[0129] In some embodiments of this application, the current block only includes the first component, such as only the chroma component, which can be understood as a chroma block.

[0130] In some embodiments, the current block includes both a first component and a second component, for example, both a chroma component and a luminance component.

[0131] S402. Determine the initial intra-frame prediction mode of the current block under the first component.

[0132] Taking the first component as the chromaticity component and the second component as the luminance component as an example.

[0133] For intra-frame prediction modes of chroma, the chroma intra-frame prediction mode can be selected individually, or it can be derived based on the luma intra-frame prediction mode of the same block, the same position, or adjacent blocks. Taking AVS3's intra-frame chroma prediction modes as an example, Table 1 shows the various modes shown in AVS3's "Lumina Prediction Block Intra-Frame Prediction Modes," and Table 2 shows the various modes shown in AVS3's "Chroma Prediction Block Intra-Frame Prediction Modes."

[0134] Table 1

[0135] 0 Intra_Luma_DC 1 Intra_Luma_Plane 2 Intra_Luma_Bilinear 3~11 Intra_Luma_Angular 12 Intra_Luma_Vertical 13~23 Intra_Luma_Angular 24 Intra_Luma_Horizontal 25~32 Intra_Luma_Angular 33 Intra_Luma_PCM 34~65 Intra_Luma_Angular

[0136] Wherein, IntraLumaPredMode is the mode number for intra-frame prediction of the luma component, Intra_Luma_DC is the DC mode for intra-frame luma prediction, Intra_Luma_Plane is the Plane mode for intra-frame luma prediction, Intra_Luma_Bilinear is the Bilinear mode for intra-frame luma prediction, Intra_Luma_Vertical is the vertical mode for intra-frame luma prediction, Intra_Luma_Horizontal is the horizontal mode for intra-frame luma prediction, Intra_Luma_PCM is the PCM mode for intra-frame luma prediction, and Intra_Luma_Angular is the angular mode for intra-frame luma prediction.

[0137] Table 2

[0138]

[0139]

[0140] In this context, `IntraChromaPredMode` is the mode number for intra-frame prediction of the chroma component, and `Intra_Chroma_DM` is the DM mode for intra-frame chroma prediction. The DM mode is a derived mode; that is, when the intra-frame chroma prediction mode uses the DM mode, the corresponding intra-frame luma prediction mode is used as the intra-frame chroma prediction mode. For example, if the corresponding intra-frame luma prediction mode is the angle mode, then the intra-frame chroma prediction mode is also the angle mode. Besides the DM mode, other intra-frame chroma prediction modes include DC mode (`Intra_Chroma_DC`), horizontal mode (`Intra_Chroma_Horizontal`), vertical mode (`Intra_Chroma_Vertical`), bilinear mode, PCM mode, and cross-component prediction modes, etc.

[0141] The DC, Bilinear, Horizontal, and Vertical modes corresponding to the chroma components are the same as those corresponding to the luma components. This mode design allows intra-frame prediction of chroma to use the same prediction modes as intra-frame prediction of luma. Here, an IntraLumaPredMode value of 33 indicates that the corresponding luma prediction block uses PCM mode. If the luma prediction block uses PCM mode and IntraChromaPredMode is 0, then the chroma components also use PCM mode during intra-frame prediction.

[0142] When performing intra-frame prediction on the chroma components, the video encoder attempts various possible intra-frame prediction modes listed in Table 2, such as DM mode, DC mode (Intra_Chroma_DC), Intra_Chroma_Horizontal mode, Intra_Chroma_Vertical mode, Bilinear mode, PCM mode, and cross-component prediction modes (TSCPM, PMC, and CCLM in VVC). The video encoder selects the intra-frame prediction mode with the lowest distortion cost as the initial intra-frame prediction mode for the current block in the chroma components.

[0143] If the video encoder determines that the initial intra-prediction mode of the current block in the chroma component is not DM mode, such as DC mode or vertical mode, the video encoder writes the mode information of the determined initial intra-coding mode into the bitstream, and the decoder decodes the mode information of the chroma intra-prediction to determine the mode of the chroma intra-prediction.

[0144] If the video encoder determines that the initial intra-frame prediction mode of the current block in the chroma component is DM mode, then the following step S403 is executed.

[0145] S403. When the initial intra-frame prediction mode is the derived mode, obtain at least two intra-frame prediction modes under the second component corresponding to the current block.

[0146] This derived mode is used to indicate that the intra-prediction mode of the current block in the first component is derived from the intra-prediction mode of the corresponding second component of the current block. For example, the current block uses the same prediction mode in the first component as the intra-prediction mode in the second component, or the intra-prediction mode of the current block in the first component is determined according to the intra-prediction mode in the second component.

[0147] The second component corresponding to the current block described in this application embodiment includes the following two cases: the first case is that the current block includes both the first component and the second component. In this case, the second component corresponding to the current block is the second component included in the current block; the second case is that the current block only includes the first component and does not include the second component. For example, if the first component is a chroma component, then the current block can be understood as a chroma block. The current block corresponds to one or more pixels in the original image frame to be encoded, and the second component corresponding to the one or more pixels is the second component corresponding to the current block.

[0148] If the current block includes both the first component and the second component, since the intra prediction mode of the second component in the same block can be directly obtained from the mode information of the current block, and the intra prediction mode of the second component in the current block has been determined and stored in the mode information of the current block, at least two intra prediction modes used by the current block when performing intra prediction of the second component can be directly obtained from the mode information of the current block.

[0149] Because the encoder stores the mode information of at least two intra-prediction modes used in the encoding of the second component when encoding the second component corresponding to the current block, the encoder can obtain at least two intra-prediction modes under the stored second component even if the current block only includes the first component and does not include the second component.

[0150] Among them, the intra-prediction modes in at least two intra-prediction modes under the second component are all different.

[0151] The second component uses at least two intra-prediction modes during intra-frame prediction, including but not limited to the intra-prediction modes mentioned above such as DC, Planar, Plane, Bilinear, and angular modes, as well as improved intra-prediction modes such as MIPF and IPF. For ease of description, this application refers to intra-prediction modes such as DC, Planar, Plane, Bilinear, and angular modes as basic intra-prediction modes, and MIPF and IPF as improved intra-prediction modes. A basic intra-prediction mode is an intra-prediction mode that can independently generate prediction blocks without relying on other intra-prediction modes; that is, given a reference pixel and a basic intra-prediction mode, the prediction block can be determined. Improved intra-prediction modes, however, cannot independently generate prediction blocks; they depend on a basic intra-prediction mode to determine the prediction block. For example, an angular prediction mode can determine the generation of prediction blocks based on a reference pixel, while MIPF can generate or determine prediction blocks by applying different filters to pixels at different positions based on this angular prediction mode.

[0152] In one implementation, at least two intra-prediction modes under the second component are basic intra-prediction modes. That is, the second component of this application uses two different basic intra-prediction modes, such as a first intra-prediction mode and a second intra-prediction mode. Optionally, an improved intra-prediction mode may be combined with the first intra-prediction mode and the second intra-prediction mode, respectively. Optionally, after obtaining the final prediction block under the second component using at least two basic intra-prediction modes, the final prediction block can be further improved using the improved intra-prediction mode to obtain an updated final prediction block.

[0153] In one implementation, at least two intra-prediction modes under the second component are a combination of a basic intra-prediction mode and an improved intra-prediction mode. For example, the at least two intra-prediction modes under the second component are a first intra-prediction mode and a second intra-prediction mode, where the first intra-prediction mode is an angle intra-prediction mode and the second intra-prediction mode is an improved intra-prediction mode, such as IPF. Alternatively, both the first and second intra-prediction modes use the same angle prediction mode, but the first intra-prediction mode uses a selection of a certain improved intra-prediction mode, while the second intra-prediction mode uses another selection of this improved intra-prediction mode. Optionally, after obtaining the final prediction block under the second component using the first and second intra-prediction modes, the final prediction block can be further improved using the improved intra-prediction mode to obtain an updated final prediction block.

[0154] In one implementation, at least two intra-prediction modes under the second component are combinations of improved intra-prediction modes.

[0155] S404. Determine the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component.

[0156] S405. Using the intra-prediction mode of the current block in the first component, perform intra-prediction of the current block in the first component to obtain the final predicted block of the current block in the first component.

[0157] In some embodiments of this application, the intra-prediction mode of the current block in the first component includes at least two intra-prediction modes. In this case, the method for determining the intra-prediction mode of the current block in the first component based on the at least two intra-prediction modes in the second component in S404 above includes, but is not limited to, the following:

[0158] Method 1: Use at least two intra-prediction modes under the second component as the intra-prediction modes of the current block under the first component. For example, if the at least two intra-prediction modes under the second component include a first intra-prediction mode and a second intra-prediction mode, then use the first intra-prediction mode and the second intra-prediction mode as the intra-prediction modes of the current block under the first component.

[0159] Method 2: Based on at least two intra-prediction modes under the second component, derive the intra-prediction mode of the current block under the first component. For example, if the first component uses an angle with a larger gap than the second component, several intra-prediction modes under the second component may derive the same intra-prediction mode under the first component. For instance, a near-horizontal mode under the second component (such as the intra-prediction mode corresponding to mode number 11 in AVS3) can derive a horizontal mode under the first component. Based on this, derive at least two intra-prediction modes of the current block under the first component based on at least two intra-prediction modes under the second component. For example, the first intra-prediction mode under the second component derives the third intra-prediction mode of the current block under the first component, and the second intra-prediction mode under the second component derives the fourth intra-prediction mode of the current block under the first component.

[0160] When the intra-prediction mode of the current block in the first component includes at least two intra-prediction modes, then the above-mentioned S405 includes:

[0161] S405-A1. Perform first component intra-prediction on the current block using at least two intra-prediction modes in the first component, and obtain the prediction block corresponding to each intra-prediction mode.

[0162] S405-A2: Based on the prediction block corresponding to each intra-frame prediction mode, obtain the final prediction block of the current block under the first component.

[0163] The current block has at least two intra-prediction modes in the first component, including two intra-prediction modes, such as the first intra-prediction mode and the second intra-prediction mode.

[0164] In one implementation, a first intra-frame prediction mode is used to perform first-component intra-frame prediction on the current block, resulting in a first predicted block of the current block in the first component. A second intra-frame prediction mode is then used to perform first-component intra-frame prediction on the current block, resulting in a second predicted block of the current block in the first component. Following a preset calculation rule, the first and second predicted blocks are processed to obtain the final predicted block of the current block in the first component. For example, a 1:1 ratio is used, where the average of the first and second predicted blocks is taken as the final predicted block of the current block in the first component.

[0165] In one implementation, for each pixel in the first component, a first intra-frame prediction mode is used to predict the pixel, obtaining a first predicted value for that pixel in the first component. A second intra-frame prediction mode is then used to predict the pixel, obtaining a second predicted value for that pixel in the first component. Following a preset calculation rule, the first and second predicted values ​​are processed to obtain the final predicted value for that pixel in the first component. For example, the average of the first and second predicted values ​​is used as the final predicted value for that pixel in the first component. Using the same method, the final predicted value for each pixel in the first component can be obtained, thus forming the final predicted block for the current block in the first component.

[0166] In one implementation, S405-A2 includes S405-A21 and S405-A22:

[0167] S405-A21, Determine the first weight matrix;

[0168] S405-A22. Based on the first weight matrix, perform weighted operations on the prediction blocks corresponding to each intra-frame prediction mode to obtain the final prediction block of the current block under the first component.

[0169] In this implementation, a first weight matrix is ​​determined, and based on this first weight matrix, a weighted operation is performed on the prediction blocks corresponding to each intra-prediction mode to obtain the final prediction block of the current block under the first component. For example, continuing with the example of at least two intra-prediction modes for the current block under the first component being the first intra-prediction mode and the second intra-prediction mode, the first intra-prediction mode is used to perform first component intra-prediction on the current block to obtain the first prediction block, and the second intra-prediction mode is used to perform first component intra-prediction on the current block to obtain the second prediction block. For each pixel in the first component, the first predicted value corresponding to that pixel in the first prediction block, the second predicted value corresponding to that pixel in the second prediction block, and the corresponding weight value in the first weight matrix are obtained. The weight value is used to perform a weighted operation on the first and second predicted values ​​to obtain the final predicted value of that pixel. Using the same method, the final predicted value of each pixel in the first component can be obtained, thereby obtaining the final prediction block of the current block under the first component.

[0170] In one possible implementation, each weight value in the first weight matrix is ​​a preset value, for example, all of them are 1, indicating that the weight value corresponding to each intra-frame prediction mode is 1.

[0171] In one possible implementation, a first weight matrix is ​​derived based on the weight matrix derivation mode. The weight matrix derivation mode can be understood as the pattern for deriving the weight matrix. Each weight matrix derivation mode can derive one weight matrix for a block with a given height and width, and different weight matrix derivation modes can derive different weight matrices for blocks of the same size. For example, AVS3's AWP has 56 weight matrix derivation modes, and VVC's GPM has 64. In this example, the process of deriving the first weight matrix based on the weight matrix derivation mode is basically the same as the process of deriving the second weight matrix. For example, if the second component is the luma component, the process of deriving the second weight matrix under the luma component can be referred to the description in S905 below, which will not be repeated here. It should be noted that when deriving the first weight matrix according to the method in S905, the relevant parameters in S905 can be modified according to the encoding information of the first component to derive the first weight matrix.

[0172] In one possible implementation, the first weight matrix is ​​derived from the weight matrix of the second component (i.e., the second weight matrix), in which case S405-A21 above includes:

[0173] S405-A211, Obtain the second weight matrix of the current block under the second component;

[0174] S405-A212, Obtain the first weight matrix based on the second weight matrix.

[0175] In one example, the second weight matrix includes at least two distinct weight values. For instance, if the minimum weight value is 0 and the maximum weight value is 8, then some points in the second weight matrix have a weight value of 0, some have a weight value of 8, and some have a weight value of any value between 0 and 8, such as 2.

[0176] In one example, all weight values ​​in the second weight matrix are identical. For instance, if the minimum weight value is 0 and the maximum weight value is 8, then the weight value for all points in the second weight matrix is ​​a value between the minimum and maximum weight values, such as 4.

[0177] In one example, the predicted value of the pixel corresponding to each weight value in the second weight matrix under the second component is obtained by at least two intra-prediction modes under the second component. For example, the second component includes two intra-prediction modes, and a minimum and maximum weight value limit is set for the second weight matrix, such as setting the minimum weight value to 0 and the maximum weight value to 8, with 9 levels, i.e., 0 to 8. Here, 0 means that the predicted value of the pixel in the current block under the second component is completely obtained from the predicted value derived from one intra-prediction mode, and 8 means that the predicted value of the pixel in the current block under the second component is completely obtained from the predicted value derived from another intra-prediction mode. Each weight value in the second weight matrix is ​​greater than 0 and less than 8, for example, setting the minimum weight value in the second weight matrix to 1 and the maximum weight value to 7. Optionally, at least two weight values ​​in the second weight matrix are different.

[0178] In one example, the at least two intra-prediction modes under the second component include N intra-prediction modes, where N is a positive integer greater than or equal to 2. The second weight matrix includes N different weight values, where the i-th weight value indicates that the predicted value of the pixel corresponding to the i-th weight value under the second component is completely obtained by the i-th intra-prediction mode, where i is a positive integer greater than or equal to 2 and less than or equal to N. For example, if N is 2, meaning the second component uses two intra-prediction modes for prediction (assuming a first intra-prediction mode and a second intra-prediction mode), then the second weight matrix includes two weight values. One weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the first intra-prediction mode, and the other weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the second intra-prediction mode. Optionally, the two weight values ​​are 0 and 1, respectively.

[0179] In one example, the at least two intra-prediction modes under the second component include a first intra-prediction mode and a second intra-prediction mode. The second weight matrix includes a maximum weight value (e.g., 8), a minimum weight value (e.g., 0), and at least one intermediate weight value. The maximum weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the first intra-prediction mode; the minimum weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the second intra-prediction mode; and the intermediate weight value indicates that the predicted value of the corresponding pixel under the second component is predicted by both the first and second intra-prediction modes. Optionally, the region consisting of the maximum or minimum weight value can be called a blending area.

[0180] In one example, the second weight matrix includes multiple weight values, and the positions where the weight values ​​change form a straight line or curve. For example, if the second weight matrix has only two weight values, the positions where the weight values ​​change form a straight line or curve; or if the second weight matrix has three or more weight values, the positions in the transition region where the weight values ​​are the same form a straight line or curve. Optionally, the lines formed above are all horizontal or vertical lines; alternatively, the lines formed above are not all horizontal or vertical lines.

[0181] In one example, the second weight matrix is ​​the weight matrix corresponding to either AWP mode or GPM mode. Even if the encoding / decoding standard or codec used in this application uses either GPM or AWP, this application can determine the second weight matrix based on the same logic used to determine the weight matrix for GPM or AWP. For example, if AWP is used for inter-frame prediction in AVS3, and this application is applied to AVS3, this application can use the same method as for determining the weight matrix for AWP to determine the second weight matrix. Optionally, this application can reuse the weight matrix of AWP. For example, there are 56 types of weight matrices for AWP. Assuming that this application uses 64 types of weight matrices for intra-frame prediction, 56 of these 64 weight matrices are the same as the weight matrices of AWP. For instance, the first 56 weight matrices are the same as the weight matrices of AWP, and the remaining 8 weight matrices each have only one weight value, which is 1, 2, ..., 7, 8. For these 8 weight matrices, the total weight value is 16, that is, a weight value of 1 represents a 1:15 weighting, and a weight value of 2 represents a 2:14 weighting. Thus, when binarizing the mode numbers of the 64 weight matrices, all can use 6-bit codewords. Based on this, the second weight matrix in this embodiment may be the weight matrix corresponding to the AWP mode. Optionally, if this application is applied to AVS3, and AVS3 inter-frame prediction uses GPM, then the weight matrix of GPM can be reused in this embodiment. In this case, the aforementioned second weight matrix may be the weight matrix corresponding to GPM.

[0182] Furthermore, since intra-frame prediction utilizes spatial correlation, it uses reconstructed pixels surrounding the current block as reference pixels. The closer the spatial distance, the stronger the correlation; the farther the distance, the weaker the correlation. Therefore, when reusing the weight matrix corresponding to GPM mode or AWP mode, if a certain weight matrix results in a predicted block having a pixel position far from the reference pixel, this application may not use that weight matrix.

[0183] It should be noted that the second weight matrix can be obtained by other methods besides the method described above, and this application embodiment does not limit this method.

[0184] After obtaining the second weight matrix, the above steps S405-A212 are performed to obtain the first weight matrix based on the second weight matrix. The methods for obtaining the first weight matrix based on the second weight matrix in this application include, but are not limited to, the following:

[0185] Method 1: If the total number of pixels included in the current block under the second component is the same as the total number of pixels included in the current block under the first component, then the second weight matrix is ​​used as the first weight matrix.

[0186] Method 2: If the total number of pixels included in the current block under the first component is less than the number of pixels included in the current block under the second component, then the second weight matrix is ​​downsampled to obtain the first weight matrix. For example, based on the total number of pixels included in the current block under the first component and the number of pixels included in the current block under the second component, the second weight matrix is ​​downsampled to obtain the first weight matrix.

[0187] After obtaining the first weight matrix according to the above method, execute S405-A22 to perform weighted operations on the prediction blocks corresponding to each intra-frame prediction mode according to the first weight matrix, and obtain the final prediction block of the current block under the first component.

[0188] In one example, assuming the current block includes a first intra-frame prediction mode and a second intra-frame prediction mode in the first component, the final predicted block of the current block in the first component is obtained according to the following formula (1):

[0189]

[0190] Where C represents the first component, predMatrixSawpC[x][y] is the final predicted value of pixel [x][y] in the first component, predMatrixC0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block in the first component, predMatrixC1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block in the first component, and AwpWeightArrayC[x][y] is the weight value corresponding to predMatrixC0[x][y] in the first weight matrix. n The sum of the preset weights is n, which is a positive integer. The first prediction block is obtained by using the first intra-frame prediction mode, and the second prediction block is obtained by using the second intra-frame prediction mode.

[0191] In one embodiment, the first component includes a first sub-component and a second sub-component.

[0192] For the first sub-component, step S405-A1 includes: performing first sub-component intra-prediction on the current block using each of at least two intra-prediction modes in the first sub-component, to obtain the predicted block of the current block in the first sub-component for each intra-prediction mode. Correspondingly, step S405-A22 includes: performing a weighted operation on the predicted blocks of the current block in the first sub-component for each intra-prediction mode according to the first weight matrix, to obtain the final predicted block of the current block in the first sub-component.

[0193] For example, the first intra-frame prediction mode is used to perform intra-frame prediction of the first sub-component of the current block, resulting in a first predicted block of the current block under the first sub-component. Then, the second intra-frame prediction mode is used to perform intra-frame prediction of the first sub-component of the current block, resulting in a second predicted block of the current block under the first sub-component. Next, according to the first weight matrix, the first and second predicted blocks of the current block under the first sub-component are weighted to obtain the final predicted block of the current block under the first sub-component.

[0194] In a specific example, the final predicted block of the current block under the first sub-component is obtained according to the following formula (2):

[0195]

[0196] Where A is the first sub-component, predMatrixSawpA[x][y] is the final predicted value of pixel [x][y] in the first sub-component, predMatrixA0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block in the first sub-component, predMatrixA1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block in the first sub-component, and AwpWeightArrayAB[x][y] is the weight value of predMatrixA0[x][y] in the first weight matrix AwpWeightArrayAB. n This is the sum of preset weights, where n is a positive integer. For example, n = 1, 2, 3, etc.

[0197] For the second sub-component, step S405-A1 includes: performing intra-prediction of the current block for the second sub-component using each of at least two intra-prediction modes in the first component, to obtain the predicted block of the current block for each intra-prediction mode in the second sub-component. Correspondingly, step S405-A22 includes: performing a weighted operation on the predicted blocks of the current block for each intra-prediction mode in the second sub-component according to the first weight matrix, to obtain the final predicted block of the current block in the second sub-component.

[0198] For example, the first intra-frame prediction mode is used to perform intra-frame prediction of the second sub-component of the current block, resulting in a first predicted block of the current block in the second sub-component. Then, the second intra-frame prediction mode is used to perform intra-frame prediction of the second sub-component of the current block, resulting in a second predicted block of the current block in the second sub-component. Next, according to the first weight matrix, the first and second predicted blocks of the current block in the second sub-component are weighted to obtain the final predicted block of the current block in the second sub-component.

[0199] In a specific example, the final predicted block of the current block under the second sub-component is obtained according to the following formula (3):

[0200]

[0201] Where B is the second sub-component, predMatrixSawpB[x][y] is the final predicted value of pixel [x][y] in the second sub-component, predMatrixB0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block in the second sub-component, predMatrixB1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block in the second sub-component, and AwpWeightArrayAB[x][y] is the weight value of predMatrixB0[x][y] in the first weight matrix. n The sum of the preset weights, where n is a positive integer.

[0202] When the second component corresponding to the current block is predicted using at least two intra-prediction modes, this application, after determining that the initial intra-prediction mode of the current block in the first component is an derived mode, adopts the method described in the above embodiments. Based on the at least two intra-prediction modes in the second component, at least two intra-prediction modes of the current block in the first component are obtained, and intra-prediction of the current block in the first component is performed using the at least two intra-prediction modes of the current block in the first component. This not only achieves simple and efficient determination of the intra-prediction mode of the current block in the first component, but also enables accurate prediction of complex textures, thereby improving the efficiency of video coding. In addition, since the at least two intra-prediction modes of the current block in the first component are derived from the at least two intra-prediction modes in the second component, the mode information of the at least two intra-prediction modes of the current block in the first component does not need to be carried in the subsequent bitstream, thereby reducing overhead.

[0203] This application uses at least two intra-frame prediction modes to generate at least two prediction blocks, and then weights them according to a weight matrix to obtain the final prediction block. Compared to the traditional method of generating one prediction block based on one intra-frame prediction mode, the complexity increases. To reduce the impact of complexity on the overall system, and considering the trade-off between compression performance and complexity, this application can restrict the use of blocks of certain sizes; that is, the size of the current block in this application meets a preset condition:

[0204] The preset conditions include any one or more of the following:

[0205] Condition 1: The width of the current block is greater than or equal to the first preset width TH1, and the height of the current block is greater than or equal to the first preset height TH2. For example, TH1 and TH2 can be 8, 16, 32, etc. Optionally, TH1 can be equal to TH2. For example, the height of the current block is set to be greater than or equal to 8, and the width is greater than or equal to 8.

[0206] Condition 2: The number of pixels in the current block is greater than or equal to the first preset number TH3; the value of TH3 can be 8, 16, 32, etc.

[0207] Condition 3: The width of the current block is less than or equal to the second preset width TH4, and the height of the current block is greater than or equal to the second preset height TH5; the values ​​of TH4 and TH5 can be 8, 16, 32, etc., and TH4 can be equal to TH5.

[0208] Condition 4: The aspect ratio of the current block is a first preset ratio; for example, the first preset ratio is any one of the following: 1:1, 1:2, 2:1, 4:1, 1:4.

[0209] Condition 5: The size of the current block is not the second preset value; for example, the second preset value is any one of the following: 16×32, 32×32, 16×64 and 64×16.

[0210] Condition 6: The height of the current block is greater than or equal to the third preset height, the width of the current block is greater than or equal to the third preset width, and the ratio of the width to the height of the current block is less than or equal to the third preset value. For example, the height of the current block is greater than or equal to 8, the width is greater than or equal to 8, the ratio of the height to the width is less than or equal to 4, and the ratio of the width to the height is less than or equal to 4.

[0211] The method of this application embodiment has a more obvious prediction effect when predicting square blocks or near-square blocks, such as blocks with a 1:1 or 1:2 aspect ratio. However, the prediction effect is not obvious when predicting elongated blocks, such as blocks with an aspect ratio of 16:1 or 32:1. Therefore, in order to reduce the impact of complexity on the entire system and to consider the trade-off between compression performance and complexity, this application mainly focuses on intra-frame prediction for square blocks or near-square blocks that meet the above-mentioned preset conditions.

[0212] In some embodiments, the intra-prediction mode of the current block under the first component in this application embodiment may further include an intra-prediction mode. In this case, the above-mentioned S404 includes, but is not limited to, the following methods:

[0213] Method 1: Use one of the at least two intra-prediction modes under the second component as the intra-prediction mode of the current block under the first component. For example, if the second component includes a first intra-prediction mode and a second intra-prediction mode, then the first intra-prediction mode is fixed as the intra-prediction mode of the current block under the first component, or the second intra-prediction mode is fixed as the intra-prediction mode of the current block under the first component.

[0214] Method 2: Derive an intra-prediction mode based on at least two intra-prediction modes under the second component, and use this derived intra-prediction mode as the intra-prediction mode for the current block under the first component. For example, the first component uses an angle with a larger gap than the second component, meaning that several luma intra-prediction modes may derive the same chroma intra-prediction mode.

[0215] Method 3: Determine the intra-prediction mode of the current block in the first component based on the intra-prediction mode of the second component corresponding to the position of the first pixel of the current block. The position of the first pixel is, for example, the position of a point in the lower right corner or a point in the middle of the current block.

[0216] One possible approach for method three is that if the predicted block in the second component corresponding to the first pixel position is completely predicted by an intra-prediction mode, then the intra-prediction mode is used as the intra-prediction mode for the current block in the first component.

[0217] One possible approach for Method 3 is that if the predicted block in the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the intra-prediction mode with the largest weight value among the multiple intra-prediction modes is taken as the intra-prediction mode of the current block in the first component.

[0218] One possible approach for Method 3 is to use the intra-prediction mode under the second component stored in the smallest unit corresponding to the first pixel position as the intra-prediction mode of the current block under the first component. Specifically, if the predicted block under the second component corresponding to the first pixel position is entirely predicted by one intra-prediction mode, then the smallest unit stores the mode information of that one intra-prediction mode. If the predicted block under the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the smallest unit stores the mode information of the intra-prediction mode with the largest corresponding weight value among the multiple intra-prediction modes.

[0219] In other words, the intra-prediction mechanism in this application can also store information such as intra-prediction modes for reference by subsequent encoded / decoded blocks. Subsequent encoded / decoded blocks of the current frame can use the intra-prediction modes of previously encoded / decoded blocks based on adjacent positional relationships, such as the intra-prediction modes of adjacent blocks. Chroma blocks (coding units) can use the intra-prediction modes of previously encoded / decoded luma blocks (coding units) based on their position. Note that this stored information is for reference by subsequent encoded / decoded blocks because the coding mode information within the same block (coding unit) can be directly obtained, but the coding mode information within different blocks (coding units) cannot be directly obtained, so it needs to be stored. Subsequent encoded / decoded blocks read this information based on their position. The storage method for the intra-prediction modes used by each block of the current frame typically uses a fixed-size matrix, such as a 4x4 matrix, as a minimum unit, with each minimum unit storing an intra-prediction mode separately. In this way, for each encoded / decoded block, the minimum units corresponding to its position can store the intra-prediction modes of that block. Figure 11B As shown, if a 16x16 block uses intra-prediction mode 5, then all the corresponding 4x4 smallest units of this block will store intra-prediction mode 5. For YUV format, generally only the luminance intra-prediction mode is stored.

[0220] For example, if at least two intra-prediction modes under the second component include a first intra-prediction mode and a second intra-prediction mode, then the methods for storing intra-prediction modes in the smallest unit include:

[0221] One approach is to select some minimum units to save the first intra-prediction mode and others to save the second intra-prediction mode. A specific implementation uses a method similar to GPM or AWP. If the codec standard or codec using the technology of this application uses either GPM or AWP, then this application can use logic similar to GPM or AWP, and can reuse some of the same logic. For example, if AVS3 inter-frame prediction uses AWP, then in AVS3, logic similar to AWP's use of saving two different motion information can be used to save two different intra-prediction modes under the second component. That is, if the position corresponding to a minimum unit only uses the first intra-prediction mode to determine the prediction block, then this minimum unit saves the first intra-prediction mode; if the position corresponding to a minimum unit only uses the second intra-prediction mode to determine the prediction block, then this minimum unit saves the second intra-prediction mode; if the position corresponding to a minimum unit uses both the first and second intra-prediction modes to determine the prediction block, then one of them is selected for saving according to a certain judgment method, for example, saving the one with the greater weight between the first and second intra-prediction modes.

[0222] Another approach is to save only the same intra-prediction mode for all the smallest units corresponding to the entire current block. For example, the derivation mode of the second weight matrix determines whether to save the first or second intra-prediction mode for all the smallest units of the current block. Assume that the derivation mode of the second weight matrix in this application is the same as the weight matrix derivation mode of AWP, where AWP includes 56 weight matrix derivation modes, as detailed in [reference needed]. Figure 4B As shown in Table 3 below, if the mode number of the derived mode of the second weight matrix is ​​0, it means that all the smallest units of the current block save the first intra-frame prediction mode; if the mode number of the derived mode of the matrix is ​​1, it means that all the smallest units of the current block save the second intra-frame prediction mode.

[0223] Table 3

[0224]

[0225]

[0226] Based on the above description, the intra-prediction mode under the second component of this application is stored in the corresponding smallest unit according to the position. In this way, when determining the intra-prediction mode of the current block under the first component, the intra-prediction mode under the second component stored in the smallest unit corresponding to the position of the first pixel can be used as the intra-prediction mode of the current block under the first component.

[0227] In some embodiments, if the current block of this application includes only the first component and not the second component, for example, only the chroma component and not the luma component, i.e., the current block of this application is a chroma block, the intra-prediction mode of the current block under the first component can be determined in the following way: for example, the intra-prediction mode of the current block under the first component can be determined according to existing methods, such as finding the intra-prediction mode under the second component based on a location, and using the found intra-prediction mode under the second component as the intra-prediction mode of the current block under the first component. The intra-prediction mode of the current block under the first component includes an intra-prediction mode.

[0228] Figure 14 This is another flowchart illustrating the video coding method 500 provided in this application embodiment. This application embodiment uses an example where the first component includes at least two intra-frame prediction modes. For example... Figure 14 As shown, it includes:

[0229] S501. Obtain the current block, which includes a first component and a second component. For example, obtain a target image frame and divide the target image frame into blocks to obtain the current block. Optionally, the current block also includes a second component.

[0230] S502, determine at least two intra-frame prediction modes for the current block under the second component, and the second weight matrix.

[0231] At the encoding end, when the encoder determines at least two intra-prediction modes and a second weight matrix for the current block in the second component, it will try all or part of the different intra-prediction modes and different weight matrices. Based on the encoding cost of each combination, the encoder will take the at least two intra-prediction modes corresponding to the combination with the smallest encoding cost as the at least two intra-prediction modes for the current block in the second component, and take the weight matrix corresponding to the combination as the second weight matrix.

[0232] Taking the example of at least two intra-prediction modes for the current block in the second component, including the first intra-prediction mode and the second intra-prediction mode. All possible cases include combinations of all possible modes of the first intra-prediction mode, all possible modes of the second intra-prediction mode, and all possible modes of the weight matrix derived mode. Assuming there are 66 available intra-prediction modes in this application, with 66 possible first intra-prediction modes, and 65 possible second intra-prediction modes since the second intra-prediction mode differs from the first. Assuming there are 56 weight matrix derived modes (taking AWP as an example), then this application can use any two different intra-prediction modes and any weight matrix derived mode in combination, resulting in a total of 66 × 65 × 56 possible combinations.

[0233] In one possible approach, rate distortion optimization (RDO) is performed on all possible combinations to determine the combination with the minimum cost. The two intra-prediction modes corresponding to this combination are then identified as the first intra-prediction mode and the second intra-prediction mode, and the weight matrix corresponding to this combination is used as the second weight matrix.

[0234] In another possible approach, an initial selection is performed on all the above possible combinations. This can be done using methods such as the sum of absolute differences (SAD) and the sum of absolute transformed differences (SATD) as approximate costs. This initial selection determines a set number of candidate combinations of first-frame intra-prediction modes, second-frame intra-prediction modes, and weight matrix derived modes. Then, a refined selection using RDO is performed to determine the combination of first-frame intra-prediction modes, second-frame intra-prediction modes, and weight matrix derived modes with the lowest cost. Fast algorithms can be used during the initial selection to reduce the number of attempts. For example, if an intra-frame angle prediction mode incurs a high cost, several adjacent intra-frame prediction modes can be excluded from the search.

[0235] During the initial and refined selection processes described above, the first prediction block is determined based on the first intra-frame prediction mode, the second prediction block is determined based on the second intra-frame prediction mode, the weight matrix is ​​derived based on the weight matrix derivation mode, and the final prediction block is determined based on the first prediction block, the second prediction block, and the weight matrix. The initial selection of SAD and SATD uses the current block and the prediction block to determine SAD and SATD.

[0236] Optionally, the encoder can first analyze the texture of the current block, for example, using gradient analysis. The analyzed data aids in initial selection. For instance, if the texture in a certain direction is stronger, the encoder will try more intra-prediction modes in that similar direction during the initial selection. Conversely, if the texture in a certain direction is weaker, the encoder will try fewer or no intra-prediction modes in that similar direction during the initial selection.

[0237] The aforementioned encoding costs include the cost of codewords occupied by the first intra-frame prediction mode, the second intra-frame prediction mode, and the weight matrix derivation mode in the bitstream; the cost of various flags and quantization coefficients to be transmitted in the bitstream, such as transform quantization entropy encoding of the prediction residual; and the cost of distortion of the reconstructed block, etc.

[0238] Furthermore, the encoder writes the information of the first intra-frame prediction mode, the second intra-frame prediction mode, and the second weight matrix derived mode of the current block under the second component into the bitstream according to the syntax.

[0239] S503. Perform intra-frame prediction of the current block in the second component using at least two intra-frame prediction modes of the current block in the second component, and obtain the prediction block corresponding to each intra-frame prediction mode of the current block in the second component.

[0240] S504. Based on the second weight matrix, perform weighted processing on the prediction blocks corresponding to each intra-frame prediction mode of the current block under the second component to obtain the final prediction block of the current block under the second component.

[0241] S505. Determine the initial intra-frame prediction mode of the current block under the first component.

[0242] S506. When determining that the initial intra-prediction mode of the current block in the first component is the derived mode, at least two intra-prediction modes of the current block in the second component are obtained.

[0243] S507. Based on at least two intra-prediction modes of the current block in the second component, determine at least two intra-prediction modes of the current block in the first component. For example, directly use the at least two intra-prediction modes of the current block in the second component as the at least two intra-prediction modes of the current block in the first component.

[0244] S508. Obtain the first weight matrix based on the second weight matrix. For example, if the total number of pixels included in the current block under the second component is the same as the total number of pixels included in the current block under the first component, then the second weight matrix is ​​used as the first weight matrix. If the total number of pixels included in the current block under the first component is less than the number of pixels included in the current block under the second component, then the second weight matrix is ​​downsampled to obtain the first weight matrix. Alternatively, the first weight matrix is ​​derived according to the weight matrix derivation mode.

[0245] It should be noted that the execution order of S507 and S508 is not sequential.

[0246] S509. Perform first-component intra-prediction on the current block using at least two intra-prediction modes of the current block in the first component, and obtain the prediction block corresponding to each intra-prediction mode of the current block in the first component.

[0247] S510. Based on the first weight matrix, perform weighted processing on the prediction blocks corresponding to each intra-frame prediction mode of the current block under the first component to obtain the final prediction block of the current block under the first component.

[0248] S511. Generate a bitstream, wherein the bitstream carries a weighted prediction identifier, which is used to indicate whether the prediction block under the second component adopts the at least two intra-frame prediction modes for prediction.

[0249] Optionally, the bitstream also carries mode information for at least two intra-frame prediction modes of the current block in the second component.

[0250] Optionally, the bitstream also carries pattern information of the derived pattern of the second weight matrix.

[0251] Optionally, the mode information of the exported mode of the current block under the first component can be carried in the bitstream.

[0252] Optionally, if the first weight matrix is ​​determined based on the weight matrix derivation mode, the bitstream may carry the mode information of the derivation mode of the first weight matrix.

[0253] In some embodiments, when the at least two intra-prediction modes are used for prediction when the current block is determined to be performing a second component, the initial intra-prediction mode of the current block in the first component is determined to be an derived mode, such as the DM mode. In this case, when the intra-prediction mode of the current block in the first component is determined to be the derived mode, the mode information of the derived mode is not carried in the bitstream.

[0254] After the encoder obtains the final prediction block of the current block, it performs subsequent processing, including decoding of quantization coefficients, inverse transform, inverse quantization to determine the residual block, combining the residual block and the prediction block into a reconstruction block, and subsequent loop filtering, etc.

[0255] This application allows for prediction of both the first and second components using at least two intra-frame prediction modes, resulting in more complex prediction blocks and thus improving the quality of intra-frame prediction and compression performance. Compared to existing technologies, it can predict complex textures and utilizes inter-channel correlation to reduce the transmission of pattern information in the bitstream, effectively improving coding efficiency.

[0256] Figure 15 This is another flowchart illustrating the video encoding method 600 provided in this application embodiment. In this embodiment, the first component is the chroma component, the second component is the luma component, and the current block has at least two intra-frame prediction modes under the luma component, including the first intra-frame prediction mode and the second intra-frame prediction mode. The chroma component includes two intra-frame prediction modes. For example... Figure 15 As shown, it includes:

[0257] S601. Obtain the current block, which includes the chroma component and the luminance component.

[0258] S602. Determine the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the luma component, as well as the second weight matrix.

[0259] S603. Use the first intra-frame prediction mode to perform intra-frame prediction of the luma component of the current block to obtain the first predicted block of the current block under the luma component. Use the second intra-frame prediction mode to perform intra-frame prediction of the luma component of the current block to obtain the second predicted block of the current block under the luma component.

[0260] S604. Based on the second weight matrix, perform a weighted operation on the first and second prediction blocks of the current block under the luminance component to obtain the final prediction block of the current block under the luminance component.

[0261] S605. Determine the initial intra-frame prediction mode of the current block under the chroma component.

[0262] S606. When the initial intra-frame prediction mode of the current block under the chromaticity component is determined to be the derived mode, the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the luma component are obtained.

[0263] S607. Determine the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the luma component as the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the chroma component.

[0264] S608. Obtain the first weight matrix of the current block under the chromaticity component based on the second weight matrix of the current block under the luminance component.

[0265] S609. Perform chroma component intra-prediction on the current block using the first intra-prediction mode to obtain the first predicted block of the current block under the chroma component. Perform chroma component intra-prediction on the current block using the second intra-prediction mode to obtain the second predicted block of the current block under the chroma component.

[0266] S610. Based on the first weight matrix, perform a weighted operation on the first and second prediction blocks of the current block under the chromaticity components to obtain the final prediction block of the current block under the chromaticity components.

[0267] S611. Generate a bitstream, wherein the bitstream carries a weighted prediction identifier, the weighted prediction identifier being used to indicate whether the current block's prediction block under the luminance component uses the at least two intra-frame prediction modes for prediction.

[0268] Optionally, the bitstream also carries mode information for at least two intra-frame prediction modes of the current block in the luminance component.

[0269] Optionally, the mode information of the current block's exported mode in the chroma component can be carried in the bitstream.

[0270] In some embodiments, when it is determined that the luminance component of the current block is predicted using the at least two intra-prediction modes, the intra-prediction mode of the current block under the chrominance component is determined to be the derived mode.

[0271] At this time, when the intra-frame prediction mode of the current block under the chroma component is determined to be the derived mode, the mode information of the derived mode is not carried in the bitstream.

[0272] After the encoder obtains the final prediction block of the current block, it performs subsequent processing, including decoding of quantization coefficients, inverse transform, inverse quantization to determine the residual block, combining the residual block and the prediction block into a reconstruction block, and subsequent loop filtering, etc.

[0273] The video encoding method involved in the embodiments of this application has been described above. Based on this, the video decoding method involved in this application will be described below for the decoding end.

[0274] Figure 16 This is a schematic flowchart of a video decoding method 700 provided in an embodiment of this application, as shown below. Figure 16 As shown, the method in this application embodiment includes:

[0275] S701. Parse the bitstream to obtain the current block and at least two intra-frame prediction modes under the second component corresponding to the current block. The current block includes the first component.

[0276] The bitstream of this application carries mode information of at least two intra-prediction modes used in intra-prediction under the second component corresponding to the current block. By parsing the bitstream, the mode information of at least two intra-prediction modes under the second component corresponding to the current block can be obtained, thereby obtaining at least two intra-prediction modes used in intra-prediction under the second component corresponding to the current block.

[0277] In some embodiments, the size of the current block in this application meets a preset condition:

[0278] The preset conditions include any of the following:

[0279] Condition 1: The width of the current block is greater than or equal to the first preset width TH1, and the height of the current block is greater than or equal to the first preset height TH2. For example, TH1 and TH2 can be 8, 16, 32, etc. Optionally, TH1 can be equal to TH2. For example, the height of the current block is set to be greater than or equal to 8, and the width is greater than or equal to 8.

[0280] Condition 2: The number of pixels in the current block is greater than or equal to the first preset number TH3; the value of TH3 can be 8, 16, 32, etc.

[0281] Condition 3: The width of the current block is less than or equal to the second preset width TH4, and the height of the current block is greater than or equal to the second preset height TH5; the values ​​of TH4 and TH5 can be 8, 16, 32, etc., and TH4 can be equal to TH5.

[0282] Condition 4: The aspect ratio of the current block is a first preset ratio; for example, the first preset ratio is any one of the following: 1:1, 1:2, 2:1, 4:1, 1:4.

[0283] Condition 5: The size of the current block is the second preset value; for example, the second preset value is any one of the following: 16×32, 32×32, 16×64 and 64×16.

[0284] Condition 6: The height of the current block is greater than or equal to the third preset height, the width of the current block is greater than or equal to the third preset width, and the ratio of the width to the height of the current block is less than or equal to the third preset value. For example, the height of the current block is greater than or equal to 8, the width is greater than or equal to 8, the ratio of the height to the width is less than or equal to 4, and the ratio of the width to the height is less than or equal to 4.

[0285] S702. Determine the initial intra-frame prediction mode of the current block under the first component.

[0286] Specifically, if the initial intra-prediction mode of the current block in the first component carried in the bitstream is not the derived mode, then the initial intra-prediction mode carried in the bitstream is used to perform intra-prediction of the current block in the first component. If the initial intra-prediction mode of the current block in the first component carried in the bitstream is the derived mode, then S703 is executed. If the bitstream does not carry mode information for the initial intra-prediction mode of the current block in the first component, then the initial intra-prediction mode of the current block in the first component is assumed to be the derived mode, and S703 is executed.

[0287] S703. When the initial intra-prediction mode is the derived mode, determine the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component corresponding to the current block.

[0288] In some embodiments, the intra-prediction mode of the current block under the first component includes at least two intra-prediction modes. In this case, the above-mentioned S703 includes, but is not limited to, the following:

[0289] Method 1: Use at least two intra-prediction modes under the second component as the intra-prediction modes of the current block under the first component. Method 2: Derive the intra-prediction modes of the current block under the first component based on at least two intra-prediction modes under the second component.

[0290] In some embodiments, the intra-prediction mode of the current block under the first component may further include an intra-prediction mode. In this case, the above-mentioned S404 includes, but is not limited to, the following methods:

[0291] Method 1: Use one of the at least two intra-prediction modes under the second component as the intra-prediction mode of the current block under the first component. For example, if the second component includes a first intra-prediction mode and a second intra-prediction mode, then the first intra-prediction mode is fixed as the intra-prediction mode of the current block under the first component, or the second intra-prediction mode is fixed as the intra-prediction mode of the current block under the first component.

[0292] Method 2: Derive an intra-prediction mode based on at least two intra-prediction modes under the second component, and use this derived intra-prediction mode as the intra-prediction mode for the current block under the first component. For example, the first component uses an angle with a larger gap than the second component, meaning that several luma intra-prediction modes may derive the same chroma intra-prediction mode.

[0293] Method 3: Determine the intra-prediction mode of the current block in the first component based on the intra-prediction mode of the second component corresponding to the position of the first pixel of the current block.

[0294] One possible approach for Method 3 is that if the prediction block in the second component corresponding to the first pixel position is completely predicted by an intra-prediction mode, then that intra-prediction mode is used as the intra-prediction mode of the current block in the first component.

[0295] One possible approach for Method 3 is that if the predicted block in the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the intra-prediction mode with the largest weight value among the multiple intra-prediction modes is taken as the intra-prediction mode of the current block in the first component.

[0296] One possible approach for Method 3 is to use the intra-prediction mode under the second component stored in the smallest unit corresponding to the first pixel position as the intra-prediction mode of the current block under the first component. Specifically, if the predicted block under the second component corresponding to the first pixel position is entirely predicted by one intra-prediction mode, then the smallest unit stores the mode information of that intra-prediction mode. If the predicted block under the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the smallest unit stores the mode information of the intra-prediction mode with the largest corresponding weight value among the multiple intra-prediction modes.

[0297] S704. Using the intra-prediction mode of the current block in the first component, perform intra-prediction of the current block in the first component to obtain the final predicted block of the current block in the first component.

[0298] When the intra-prediction mode of the current block in the first component includes at least two intra-prediction modes, then the above-mentioned S704 includes:

[0299] S704-A1. Perform first component intra-prediction on the current block using at least two intra-prediction modes in the first component, and obtain the prediction block corresponding to each intra-prediction mode.

[0300] S704-A2: Determine the final prediction block of the current block under the first component based on the prediction block corresponding to each intra-frame prediction mode.

[0301] In one implementation, S704-A2 includes S704-A21 and S704-A22:

[0302] S704-A21, Determine the first weight matrix;

[0303] S704-A22. Based on the first weight matrix, perform weighted operations on the prediction blocks corresponding to each intra-frame prediction mode to obtain the final prediction block of the current block under the first component.

[0304] In one possible implementation, the first weight matrix is ​​derived according to the weight matrix derivation pattern.

[0305] In one possible implementation, the first weight matrix is ​​derived from the weight matrix under the second component (i.e., the second weight matrix), in which case S704-A21 above includes:

[0306] S704-A211, Obtain the second weight matrix of the current block under the second component;

[0307] S704-A212. Obtain the first weight matrix based on the second weight matrix.

[0308] In one example, the second weight matrix includes at least two distinct weight values. For instance, if the minimum weight value is 0 and the maximum weight value is 8, then some points in the second weight matrix have a weight value of 0, some have a weight value of 8, and some have a weight value of any value between 0 and 8, such as 2.

[0309] In one example, all weight values ​​in the second weight matrix are identical. For instance, if the minimum weight value is 0 and the maximum weight value is 8, then the weight value for all points in the second weight matrix is ​​a value between the minimum and maximum weight values, such as 4.

[0310] In one example, the predicted value of the pixel corresponding to each weight value in the second weight matrix under the second component is predicted by at least two intra-frame prediction modes under the second component.

[0311] In one example, the at least two intra-prediction modes under the second component include N intra-prediction modes, where N is a positive integer greater than or equal to 2, and the second weight matrix includes N different weight values, where the i-th weight value indicates that the prediction value of the pixel corresponding to the i-th weight value under the second component is completely obtained by the i-th intra-prediction mode, where i is a positive integer greater than or equal to 2 and less than or equal to N.

[0312] In one example, the at least two intra-prediction modes under the second component include a first intra-prediction mode and a second intra-prediction mode. The second weight matrix includes a maximum weight value (e.g., 8), a minimum weight value (e.g., 0), and at least one intermediate weight value. The maximum weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the first intra-prediction mode; the minimum weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the second intra-prediction mode; and the intermediate weight value indicates that the predicted value of the corresponding pixel under the second component is predicted by both the first and second intra-prediction modes. Optionally, the region consisting of the maximum or minimum weight value can be called a blending area.

[0313] In one example, the second weight matrix includes multiple weight values, and the positions where the weight values ​​change form a straight line or curve.

[0314] In one example, the second weight matrix is ​​the weight matrix corresponding to either the AWP mode or the GPM mode.

[0315] After obtaining the second weight matrix, the above steps S704-A212 are performed to obtain the first weight matrix based on the second weight matrix. The methods for obtaining the first weight matrix based on the second weight matrix in this application include, but are not limited to, the following:

[0316] Method 1: If the total number of pixels included in the current block under the second component is the same as the total number of pixels included in the current block under the first component, then the second weight matrix is ​​used as the first weight matrix.

[0317] Method 2: If the total number of pixels included in the current block under the first component is less than the number of pixels included in the current block under the second component, then the second weight matrix is ​​downsampled to obtain the first weight matrix. For example, the second weight matrix is ​​downsampled based on the total number of pixels included in the current block under the first component and the number of pixels included in the current block under the second component to obtain the first weight matrix.

[0318] In one embodiment, the first component includes a first sub-component and a second sub-component.

[0319] For the first sub-component, step S704-A1 includes: performing first sub-component intra-prediction on the current block using each of at least two intra-prediction modes in the first sub-component, to obtain the predicted block of the current block in the first sub-component for each intra-prediction mode. Correspondingly, step S704-A22 includes: performing a weighted operation on the predicted blocks of the current block in the first sub-component for each intra-prediction mode according to the first weight matrix, to obtain the final predicted block of the current block in the first sub-component.

[0320] For example, the first intra-frame prediction mode is used to perform intra-frame prediction of the first sub-component of the current block, resulting in a first predicted block of the current block in the first sub-component. Then, the second intra-frame prediction mode is used to perform intra-frame prediction of the first sub-component of the current block, resulting in a second predicted block of the current block in the first sub-component. Next, according to the first weight matrix, the first and second predicted blocks of the current block in the first sub-component are weighted to obtain the final predicted block of the current block in the first sub-component.

[0321] In a specific example, the final predicted block of the current block under the first sub-component is obtained according to the above formula (2):

[0322] For the second sub-component, step S704-A1 includes: performing intra-prediction of the current block for the second sub-component using each of at least two intra-prediction modes in the first component, to obtain the predicted block of the current block for each intra-prediction mode in the second sub-component. Correspondingly, step S704-A22 includes: performing a weighted operation on the predicted blocks of the current block for each intra-prediction mode in the second sub-component according to the first weight matrix, to obtain the final predicted block of the current block in the second sub-component.

[0323] For example, the first intra-frame prediction mode is used to perform intra-frame prediction of the second sub-component of the current block, resulting in a first predicted block of the current block in the second sub-component. Then, the second intra-frame prediction mode is used to perform intra-frame prediction of the second sub-component of the current block, resulting in a second predicted block of the current block in the second sub-component. Next, according to the first weight matrix, the first and second predicted blocks of the current block in the second sub-component are weighted to obtain the final predicted block of the current block in the second sub-component.

[0324] In a specific example, the final predicted block of the current block under the second sub-component is obtained according to the above formula (3).

[0325] Some steps on the decoding end are the same as those on the encoding end, and will not be repeated here, referring to the description of the encoding end.

[0326] After the decoder obtains the final prediction block of the current block, it performs subsequent processing, including decoding of quantization coefficients, inverse transform, inverse quantization to determine the residual block, combining the residual block and the prediction block into a reconstructed block, and subsequent loop filtering, etc.

[0327] Figure 17 This is a schematic flowchart of a video decoding method 800 provided in an embodiment of this application, as shown below. Figure 17 As shown, the method in this application embodiment includes:

[0328] S801. Parse the bitstream and determine whether intra-frame prediction is performed on the current block. The current block includes the first component and the second component.

[0329] S802. If it is determined that the current block is to be predicted intra-frame, then the weighted prediction identifier is parsed, wherein the weighted prediction identifier is used to indicate whether the prediction block under the second component is predicted using the at least two intra-frame prediction modes.

[0330] S803. If the weighted prediction identifier is used to indicate that the prediction block under the second component is predicted using at least two intra-prediction modes, then parse the information of the at least two intra-prediction modes and the derived mode of the second weight matrix used when the current block performs intra-prediction of the second component.

[0331] S804. Use at least two intra-frame prediction modes of the current block under the second component to perform second component prediction on the current block, and obtain the prediction block corresponding to each intra-frame prediction mode of the current block under the second component.

[0332] S805. Obtain the second weight matrix based on the derived mode information of the second weight matrix.

[0333] It should be noted that the execution order of S804 and S805 is not sequential.

[0334] S806. Based on the second weight matrix, perform weighted processing on the prediction blocks corresponding to each intra-frame prediction mode of the current block under the second component to obtain the final prediction block of the current block under the second component.

[0335] S807. Determine the initial intra-frame prediction mode of the current block in the first component. Specifically, if the initial intra-frame prediction mode of the current block in the first component carried in the bitstream is not the derived mode, then the initial intra-frame prediction mode of the current block in the first component carried in the bitstream is used to perform intra-frame prediction on the first component. If the initial intra-frame prediction mode of the current block in the first component carried in the bitstream is the derived mode, execute S808. If the bitstream does not carry mode information for the initial intra-frame prediction mode of the current block in the first component, then the default initial intra-frame prediction mode of the current block in the first component is the derived mode, and execute S808.

[0336] S808. When the initial intra-prediction mode is the derived mode, determine at least two intra-prediction modes for the current block in the first component based on at least two intra-prediction modes for the current block in the second component. For example, directly use the at least two intra-prediction modes in the second component as the at least two intra-prediction modes for the current block in the first component.

[0337] S809. Determine the first weight matrix based on the second weight matrix. For example, if the total number of pixels included in the current block under the second component is the same as the total number of pixels included in the current block under the first component, then the second weight matrix is ​​used as the first weight matrix. If the total number of pixels included in the current block under the first component is less than the number of pixels included in the current block under the second component, then the second weight matrix is ​​downsampled to obtain the first weight matrix.

[0338] It should be noted that the execution order of S808 and S809 is not sequential.

[0339] S810. Perform first-component intra-prediction on the current block using at least two intra-prediction modes of the current block in the first component, and obtain the prediction block corresponding to each intra-prediction mode of the current block in the first component.

[0340] S811. Based on the first weight matrix, perform weighted processing on the prediction blocks corresponding to each intra-frame prediction mode of the current block under the first component to obtain the final prediction block of the current block under the first component.

[0341] Figure 18 This is a flowchart illustrating a video decoding method 900 provided in an embodiment of this application. In this embodiment, the first component is the chroma component, the second component is the luma component, and the luma component includes at least two intra-frame prediction modes, including a first intra-frame prediction mode and a second intra-frame prediction mode. The chroma component includes two intra-frame prediction modes. Figure 18 As shown, the method in this application embodiment includes:

[0342] S901. Parse the bitstream and determine whether intra-frame prediction is performed on the current block. The current block includes the luminance component and the chrominance component.

[0343] S902. If it is determined that the current block is to perform intra-frame prediction, then the weighted prediction identifier is parsed, where the weighted prediction identifier is used to indicate whether the prediction block corresponding to the luminance component uses two intra-frame prediction modes for prediction.

[0344] In one example, the technique used in this application is called SAWP (Spatial Angular Weighted Prediction), which can carry a sequence-level flag in the bitstream to determine whether the current block uses the SAWP technique. For example, the sequence header definition is shown in Table 4.

[0345] Table 4

[0346]

[0347] Here, `sawp_enable_flag` is a binary variable that enables spatial angle-weighted prediction. A value of '1' indicates that spatial angle-weighted prediction can be used; a value of '0' indicates that spatial angle-weighted prediction should not be used. The value of `SawpEnableFlag` is equal to `sawp_enable_flag`. If `sawp_enable_flag` is not present in the bitstream, the value of `SawpEnableFlag` is 0.

[0348] Optionally, a frame-level flag can be used to determine whether the current frame to be decoded uses the SAWP technique. For example, it can be configured that intra-frames (such as I-frames) use SAWP, while inter-frames (such as B-frames and P-frames) do not. Alternatively, it can be configured that intra-frames do not use SAWP, while inter-frames do. Or, it can be configured that some inter-frames use SAWP, while others do not.

[0349] Optionally, a flag at the frame level or above the CU level (such as tile, slice, patch, LCU, etc.) can be used to determine whether this area uses the SAWP technology.

[0350] For example, the decoder executes the following program:

[0351]

[0352] In this context, `intra_cu_flag` is the intra-prediction flag, and `sawp_flag` is the weighted prediction flag. Both are binary variables; a value of '1' indicates that spatial angle-weighted prediction should be performed, meaning the luminance component includes at least two intra-prediction modes; a value of '0' indicates that spatial angle-weighted prediction should not be performed, meaning the luminance component does not include at least two intra-prediction modes. The value of `SawpFlag` is equal to the value of `sawp_flag`. If `sawp_flag` is not present in the bitstream, its value is 0.

[0353] Specifically, the decoder decodes the current block. If it determines that the current block uses intra-frame prediction, it decodes the SAPP usage flag (i.e., the value of `sawp_flag`) for the current block. Otherwise, it does not need to decode the SAPP usage flag. Optionally, if the current block uses SAPP, then it is not necessary to process DT and IPF-related information, as they are mutually exclusive with SAPP.

[0354] S903. If the weighted prediction flag is used to indicate that the luminance component is predicted using two intra-frame prediction modes, then parse the first intra-frame prediction mode, the second intra-frame prediction mode, and the derived mode information of the second weight matrix used when the current block performs intra-frame prediction of the luminance component.

[0355] If the weighted prediction flag is used to indicate that the luminance component is predicted using two intra-frame prediction modes, then the decoder parses the first intra-frame prediction mode, the second intra-frame prediction mode, and the derived mode information of the second weight matrix used when the current block performs intra-frame prediction of the luminance component.

[0356] In some embodiments, the decoder executes the following procedure to obtain the mode information of the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the luma component:

[0357]

[0358] Here, `sawp_idx` represents the derived mode information of the second weight matrix, and the value of `SawpIdx` is equal to the value of `sawp_idx`. If `sawp_idx` does not exist in the bitstream, the value of `SawpIdx` is equal to 0. `intra_luma_pred_mode0` represents the mode information of the first intra-frame prediction mode of the current block under the luma component, and `intra_luma_pred_mode1` represents the mode information of the second intra-frame prediction mode of the current block under the luma component.

[0359] In this step, the `sawp_idx` parsing method is the same as `awp_idx`. The parsing method for `intra_luma_pred_mode0` is the same as `intra_luma_pred_mode`, and the parsing method for `intra_luma_pred_mode1` is the same as `intra_luma_pred_mode`. Optionally, since AVS3 only has two MPMs, if both `intra_luma_pred_mode0` and `intra_luma_pred_mode1` use an MPM, and if `intra_luma_pred_mode0` uses one of them, then `intra_luma_pred_mode1` does not need to further parse whether it's the first or second MPM mode; `intra_luma_pred_mode1` will default to using the other one.

[0360] In some embodiments, the decoder executes the following procedure to obtain the mode information of the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the luma component, and the derived mode information of the second weight matrix:

[0361]

[0362] Specifically, the decoder decodes the current block. If the current block uses intra-prediction, it decodes the DT and IPF usage flags of the current block, as well as the unique luma prediction mode `intra_luma_pred_mode` for each prediction unit in the current method. If the current block does not use DT or IPF, it decodes the SAWP usage flag of the current block. If the current block uses SAWP, it needs to decode the derived mode of the second weight matrix and `intra_luma_pred_mode1`. `intra_luma_pred_mode` is used as the mode information of the first intra-prediction mode of the current block under the luma component, and `intra_luma_pred_mode1` is used as the mode information of the second intra-prediction mode of the current block under the luma component.

[0363] IntraLumaPredMode0 and IntraLumaPredMode1 are determined based on intra_luma_pred_mode0 and intra_luma_pred_mode1, respectively. The first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the luma component can be obtained by referring to Table 1.

[0364] It should be noted that the first version of AVS3 only supports 34 intra-frame prediction modes, for example... Figure 8 As shown, if the index starts from 0, then the 34th mode is the PCM mode. The second version of AVS3 added more intra-prediction modes, expanding to 66 intra-prediction modes, such as... Figure 10 As shown. In order to be compatible with the first version, the second version did not change the original decoding method of intra_luma_pred_mode. Instead, if intra_luma_pred_mode is greater than 1, an additional flag bit, namely eipm_pu_flag, needs to be added.

[0365]

[0366] The `eipm_pu_flag` is an intra-frame luminance prediction mode extension flag, a binary variable. A value of '1' indicates that the intra-frame luminance prediction extension mode should be used; a value of '0' indicates that the intra-frame luminance prediction extension mode should not be used. The value of `EipmPuFlag` is equal to the value of `eipm_pu_flag`. If `eipm_pu_flag` does not exist in the bitstream, the value of `EipmPuFlag` is equal to 0.

[0367] Therefore, if it corresponds to the text description of AVS3 version 2, the syntax above, including intra_luma_pred_mode, intra_luma_pred_mode0, and intra_luma_pred_mode1, should all include the descriptions eipm_pu_flag, eipm_pu_flag0, and eipm_pu_flag1. IntraLumaPredMode0 is determined based on intra_luma_pred_mode0 and eipm_pu_flag0, while IntraLumaPredMode1 is determined based on intra_luma_pred_mode1 and eipm_pu_flag1.

[0368] S904. Use the first intra-frame prediction mode to perform intra-frame prediction of the luma component of the current block to obtain the first prediction block of the current block under the luma component. Use the second intra-frame prediction mode to perform intra-frame prediction of the luma component of the current block to obtain the second prediction block of the current block under the luma component.

[0369] S905. Obtain the second weight matrix based on the derived mode information of the second weight matrix.

[0370] For example, the decoder executes the following procedure to obtain the second weight matrix of the current block under the luma component:

[0371]

[0372]

[0373] Where M and N are the width and height of the current block, AwpWeightArrayY is the second weight matrix of the luminance component Y, and the reference weights ReferenceWeights[x] can be obtained according to the following procedure:

[0374]

[0375]

[0376] It should be noted that the execution order of S904 and S905 is not sequential.

[0377] S906. Based on the second weight matrix, perform a weighted operation on the first and second prediction blocks of the current block under the luminance component to obtain the final prediction block of the current block under the luminance component.

[0378] In one example, the final predicted block for the current block in the luminance component is obtained according to the following formula (4):

[0379]

[0380] Where Y is the luminance component, predMatrixSawpY[x][y] is the final predicted value of pixel [x][y] in the luminance component, predMatrixY0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block in the luminance component, predMatrixY1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block in the luminance component, and AwpWeightArrayY[x][y] is the weight value of predMatrixY0[x][y] in the second weight matrix AwpWeightArrayY.

[0381] S907. Determine the initial intra-frame prediction mode of the current block under the chroma component. Specifically, if the initial intra-frame prediction mode of the current block under the chroma component carried in the bitstream is not the derived mode, then use the initial intra-frame prediction mode of the current block under the chroma component carried in the bitstream to perform intra-frame prediction of the chroma component for the current block. If the initial intra-frame prediction mode of the current block under the chroma component carried in the bitstream is the derived mode, execute S908.

[0382] If the bitstream does not carry mode information for the initial intra-prediction mode of the current block in the chroma component, the default initial intra-prediction mode of the current block in the chroma component is the derived mode, and S908 is executed.

[0383] In some embodiments, when determining the IntraChromaPredMode of the intra-prediction mode of the current block in the chroma component, this application performs the following procedure:

[0384] 1) If the current block's SawpFlag is 1 (i.e., the current block uses the technical solution of this application), isRedundant equals 0. Skip to step 3). Otherwise, proceed to step 2).

[0385] 2) If the brightness prediction mode IntraLumaPredMode of the prediction block with a PredBlockOrder value of 0 in the current block is equal to 0, 2, 12 or 24, then isRedundant is equal to 1; otherwise isRedundant is equal to 0.

[0386] 3) If the value of tscpm_enable_flag is equal to '1' or the value of pmc_enable_flag is equal to '1', and the value of intra_chroma_pred_mode is equal to 1, then IntraChromaPredMode is equal to (5 + IntraChromaEnhancedMode + 3 * IntraChromaPmcFlag);

[0387] 4) Otherwise,

[0388] • If the value of tscpm_enable_flag is equal to '1' and the value of intra_chroma_pred_mode is not equal to 0, then the value of intra_chroma_pred_mode is decremented by 1;

[0389] • If isRedundant equals 0, IntraChromaPredMode equals intra_chroma_pred_mode; otherwise, perform the following operations in sequence:

[0390] If IntraLumaPredMode equals 0, then predIntraChromaPredMode equals 1; if IntraLumaPredMode equals 2, then predIntraChromaPredMode equals 4; if IntraLumaPredMode equals 12, then predIntraChromaPredMode equals 3; if IntraLumaPredMode equals 24, then predIntraChromaPredMode equals 2.

[0391] If the value of intra_chroma_pred_mode is equal to 0, then IntraChromaPredMode is equal to 0; otherwise, if the value of intra_chroma_pred_mode is less than predIntraChromaPredMode, then IntraChromaPredMode is equal to intra_chroma_pred_mode; otherwise, IntraChromaPredMode is equal to intra_chroma_pred_mode plus 1.

[0392] a) Based on the value of IntraChromaPredMode, look up Table 2 to obtain the intra-prediction mode of the current block in the chroma component.

[0393] If the current block's SawpFlag is 1 and IntraChromaPredMode is 0, the intra-prediction mode for the current block in the chroma component is Intra_Chroma_DM, not PCM.

[0394] In this application, if the current block uses at least two intra-prediction modes to determine the prediction block under the first component, then the intra-prediction modes of the subsequent current block under the first component will no longer have redundant modes. When binarizing the intra-chroma prediction mode, it is not necessary to check and remove redundant modes, that is, it is not necessary to perform step 2) above.

[0395] S908. When the initial intra-frame prediction mode of the current block under the chroma component is determined to be the derived mode, the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the luma component are determined as the first intra-frame prediction mode and the second intra-frame prediction mode of the current block under the chroma component.

[0396] S909. Determine the first weight matrix based on the second weight matrix.

[0397] For example, if the current block has the same total number of pixels in the luminance component as it does in the chrominance component, then the second weight matrix is ​​used as the first weight matrix.

[0398] If the total number of pixels in the current block under the chromaticity component is less than the number of pixels in the current block under the luminance component, then the second weight matrix is ​​downsampled to obtain the first weight matrix.

[0399] For example, for YUV4:2:0, the decoder executes the following procedure to obtain the first weight matrix:

[0400]

[0401] Where AwpWeightArrayUV is the first weight matrix and AwpWeightArrayY is the second weight matrix.

[0402] It should be noted that there is no specific order in which S908 is executed.

[0403] S910. Perform chroma component intra-prediction on the current block using the first intra-prediction mode to obtain the first predicted block of the current block under the chroma component. Perform chroma component intra-prediction on the current block using the second intra-prediction mode to obtain the second predicted block of the current block under the chroma component.

[0404] S911. Based on the first weight matrix, perform a weighted operation on the first and second prediction blocks of the current block under the chromaticity component to obtain the final prediction block of the current block under the chromaticity component.

[0405] For example, if the chromaticity components include U and V components, the final prediction block of the current block under the U component can be determined according to the following formula (5):

[0406]

[0407] Wherein, predMatrixSawpU[x][y] is the final predicted value of pixel [x][y] in the U component, predMatrixU0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the U component under the current block, predMatrixU1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the U component under the current block, and AwpWeightArrayUV[x][y] is the weight value of predMatrixU0[x][y] in the first weight matrix AwpWeightArrayUV.

[0408] The final prediction block for the current block under the V component is determined according to the following formula (6):

[0409]

[0410] Wherein, predMatrixSawpV[x][y] is the final predicted value of pixel [x][y] in the V component, predMatrixV0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block in the V component, predMatrixV1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block in the V component, and AwpWeightArrayUV[x][y] is the weight value of predMatrixV0[x][y] in the first weight matrix AwpWeightArrayUV.

[0411] Finally, the decoder performs subsequent processing, including decoding of quantization coefficients, inverse transform, inverse quantization to determine residual blocks, combining residual blocks and prediction blocks into reconstruction blocks, and subsequent loop filtering.

[0412] It should be understood that Figure 12 , Figures 14 to 18 This is merely an example of what is being done and should not be construed as limiting the scope of this application.

[0413] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.

[0414] It should also be understood that, in the various method embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. Specifically, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0415] The above text combined Figures 14 to 18 The method embodiments of this application are described in detail below, in conjunction with... Figures 19 to 21 The following describes in detail the device embodiments of this application.

[0416] Figure 19 This is a schematic block diagram of the video encoder 10 provided in the embodiments of this application.

[0417] like Figure 19 As shown, the video encoder 10 includes:

[0418] The first acquisition unit 11 is used to acquire the current block, wherein the current block includes a first component;

[0419] The first determining unit 12 is used to determine the initial intra-frame prediction mode of the current block under the first component;

[0420] The second acquisition unit 13 is used to obtain at least two intra-prediction modes under the second component corresponding to the current block when the initial intra-prediction mode is the derived mode.

[0421] The second determining unit 14 is used to determine the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component.

[0422] Prediction unit 15 is used to perform intra-frame prediction of the current block in the first component using the intra-frame prediction mode of the current block in the first component, so as to obtain the final predicted block of the current block in the first component.

[0423] In some embodiments, the intra-prediction mode of the current block under the first component includes at least two intra-prediction modes.

[0424] In one example, the second determining unit 14 is specifically used to take at least two intra-prediction modes under the second component as the intra-prediction modes of the current block under the first component.

[0425] In one example, the second determining unit 14 is specifically used to derive the intra-prediction mode of the current block under the first component based on at least two intra-prediction modes under the second component.

[0426] At this time, the prediction unit 15 is specifically used to perform first component intra-prediction on the current block using each of the at least two intra-prediction modes of the current block under the first component, to obtain the prediction block corresponding to each intra-prediction mode; and to obtain the final prediction block of the current block under the first component based on the prediction block corresponding to each intra-prediction mode.

[0427] In some embodiments, the prediction unit 15 is specifically used to determine a first weight matrix; and to perform a weighted operation on the prediction blocks corresponding to each intra-frame prediction mode according to the first weight matrix to obtain the final prediction block of the current block under the first component.

[0428] In some embodiments, the prediction unit 15 is specifically used to derive a first weight matrix according to the weight matrix derivation pattern.

[0429] In some embodiments, the prediction unit 15 is specifically used to obtain a second weight matrix of the current block under the second component: if the total number of pixels included in the current block under the second component is the same as the total number of pixels included in the current block under the first component, then the second weight matrix is ​​used as the first weight matrix; if the total number of pixels included in the current block under the first component is less than the number of pixels included in the current block under the second component, then the second weight matrix is ​​downsampled to obtain a first weight matrix.

[0430] In some embodiments, the prediction unit 15 is specifically configured to downsample the second weight matrix based on the total number of pixels included in the current block under the first component and the number of pixels included in the current block under the second component, to obtain the first weight matrix.

[0431] Optionally, the second weight matrix includes at least two different weight values.

[0432] Optionally, all weight values ​​in the second weight matrix are identical.

[0433] Optionally, the predicted value of the pixel corresponding to each weight value in the second weight matrix under the second component is obtained by at least two intra-frame prediction modes under the second component.

[0434] Optionally, the at least two intra-prediction modes under the second component include N intra-prediction modes, where N is a positive integer greater than or equal to 2, and the second weight matrix includes N different weight values. The i-th weight value indicates that the predicted value of the pixel corresponding to the i-th weight value under the second component is completely obtained by the i-th intra-prediction mode, where i is a positive integer greater than or equal to 2 and less than or equal to N.

[0435] Optional,

[0436] The second component includes at least two intra-frame prediction modes, namely a first intra-frame prediction mode and a second intra-frame prediction mode. The second weight matrix includes a maximum weight value, a minimum weight value, and at least one intermediate weight value.

[0437] The maximum weight value is used to indicate that the predicted value of the corresponding pixel in the second component is completely predicted by the first intra-frame prediction mode; the minimum weight value is used to indicate that the predicted value of the corresponding pixel in the second component is completely predicted by the second intra-frame prediction mode; the intermediate weight value is used to indicate that the predicted value of the corresponding pixel in the second component is predicted by both the first intra-frame prediction mode and the second intra-frame prediction mode.

[0438] Optionally, the second weight matrix includes multiple weight values, and the positions where the weight values ​​change form a straight line or curve.

[0439] Optionally, the second weight matrix is ​​the weight matrix corresponding to the AWP mode or the GPM mode.

[0440] In some embodiments, the intra-prediction mode of the current block under the first component includes an intra-prediction mode.

[0441] In one example, the second determining unit 14 is specifically used to select one of the at least two intra-prediction modes under the second component as the intra-prediction mode of the current block under the first component.

[0442] In one example, the second determining unit 14 is specifically used to determine the intra-prediction mode of the current block under the first component based on the intra-prediction mode of the second component corresponding to the position of the first pixel of the current block.

[0443] In one example, the second determining unit 14 is specifically configured to: if the predicted value of the second component corresponding to the first pixel position is completely predicted by an intra-prediction mode, then use the intra-prediction mode as the intra-prediction mode of the current block in the first component; if the predicted value of the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then use the intra-prediction mode with the largest weight value among the multiple intra-prediction modes as the intra-prediction mode of the current block in the first component.

[0444] In one example, the second determining unit 14 is specifically used to take the intra-prediction mode of the second component stored in the smallest unit corresponding to the first pixel position as the intra-prediction mode of the current block in the first component.

[0445] Optionally, if the predicted value of the second component corresponding to the first pixel position is completely predicted by one intra-prediction mode, then the minimum unit stores the mode information of the one intra-prediction mode; if the predicted value of the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the minimum unit stores the mode information of the intra-prediction mode with the largest weight value among the multiple intra-prediction modes.

[0446] In some embodiments, the first component includes a first sub-component and a second sub-component. In this case, the prediction unit 15 is specifically configured to perform intra-prediction of the first sub-component on the current block using each of the at least two intra-prediction modes of the current block under the first component, to obtain a predicted block of the current block under the first sub-component with respect to each of the intra-prediction modes; and to perform prediction of the second sub-component on the current block using each of the at least two intra-prediction modes of the current block under the first component, to obtain a predicted block of the current block under the second sub-component with respect to each of the intra-prediction modes.

[0447] In one example, prediction unit 15 is specifically configured to perform a weighted operation on the prediction blocks of the current block under the first sub-component with respect to each of the intra-prediction modes according to the first weight matrix, to obtain the final prediction block of the current block under the first sub-component; and to perform a weighted operation on the prediction blocks of the current block under the second sub-component with respect to each of the intra-prediction modes according to the first weight matrix, to obtain the final prediction block of the current block under the second sub-component.

[0448] In one example, prediction unit 15 is specifically used to obtain the final predicted block of the current block under the first sub-component according to the following formula:

[0449] predMatrixSawpA[x][y]=(predMatrixA0[x][y]*AwpWeightArrayAB[x][y]+predMatrixA1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1 )>>n;

[0450] Wherein, A is the first sub-component, predMatrixSawpA[x][y] is the final predicted value of pixel [x][y] in the first sub-component under the first sub-component, predMatrixA0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block under the first sub-component, predMatrixA1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block under the first sub-component, and AwpWeightArrayAB[x][y] is the weight value of predMatrixA0[x][y] in the first weight matrix AwpWeightArrayAB. n The sum of the preset weights, where n is a positive integer.

[0451] In one example, prediction unit 15 is specifically used for

[0452] The final predicted block of the current block under the second sub-component is obtained according to the following formula:

[0453] predMatrixSawpB[x][y]=(predMatrixB0[x][y]*AwpWeightArrayAB[x][y]+predMatrixB1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1 )>>n;

[0454] Wherein, B is the second sub-component, predMatrixSawpB[x][y] is the final predicted value of pixel [x][y] in the second sub-component under the second sub-component, predMatrixB0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block under the second sub-component, predMatrixB1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block under the second sub-component, and AwpWeightArrayAB[x][y] is the weight value of predMatrixB0[x][y] in the first weight matrix AwpWeightArrayAB. n The sum of the preset weights, where n is a positive integer.

[0455] In one example, prediction unit 15 is also used to generate a bitstream carrying a weighted prediction identifier, which is used to indicate whether the prediction block under the second component is predicted using the at least two intra-frame prediction modes.

[0456] In some embodiments, the first determining unit 12 is specifically configured to determine the initial intra-prediction mode of the current block under the first component as the derived mode when it is determined that the prediction block under the second component uses the at least two intra-prediction modes for prediction.

[0457] In some embodiments, the bitstream also carries mode information for at least two intra-frame prediction modes under the second component.

[0458] In some embodiments, the bitstream also carries the derived mode information of the second weight matrix.

[0459] In some embodiments, the size of the current block satisfies a preset condition.

[0460] The preset conditions include any one or more of the following:

[0461] Condition 1: The width of the current block is greater than or equal to the first preset width TH1, and the height of the current block is greater than or equal to the first preset height TH2;

[0462] Condition 2: The number of pixels in the current block is greater than or equal to the first preset number TH3;

[0463] Condition 3: The width of the current block is less than or equal to the second preset width TH4, and the height of the current block is greater than or equal to the second preset height TH5;

[0464] Condition 4: The aspect ratio of the current block is a first preset ratio.

[0465] Condition 5: The size of the current block is a second preset value;

[0466] Condition 6: The height of the current block is greater than or equal to the third preset height, the width of the current block is greater than or equal to the third preset width, and the ratio of the width to the height of the current block is less than or equal to the third preset value.

[0467] Optionally, the first preset ratio can be any one of the following: 1:1, 2:1, 1:2, 1:4, or 4:1.

[0468] Optionally, the second preset value can be any one of the following: 16×32, 32×32, 16×64, and 64×16.

[0469] Optionally, the first component is a chromaticity component, and the second component is a luminance component.

[0470] Optionally, the chromaticity component is a UV component, the first sub-component is a U component, and the second sub-component is a V component.

[0471] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 19 The video encoder 10 shown can execute the methods of the embodiments of this application, and the foregoing and other operations and / or functions of each unit in the video encoder 10 are respectively to implement the corresponding processes in methods 400, 500 and 600, etc. For the sake of brevity, they will not be described in detail here.

[0472] Figure 20 This is a schematic block diagram of the video decoder 20 provided in the embodiments of this application.

[0473] like Figure 20 As shown, the video decoder 20 may include:

[0474] The parsing unit 21 is used to parse the bitstream to obtain the current block and at least two intra-frame prediction modes under the second component corresponding to the current block, wherein the current block includes the first component;

[0475] The first determining unit 22 is used to determine the initial intra-frame prediction mode of the current block under the first component;

[0476] The second determining unit 23 is used to determine the intra-prediction mode of the current block under the first component based on at least two intra-prediction modes under the second component when the initial intra-prediction mode is determined to be the derived mode.

[0477] Prediction unit 24 is used to perform intra-frame prediction of the current block in the first component using the intra-frame prediction mode of the current block in the first component, so as to obtain the final predicted block of the current block in the first component.

[0478] In some embodiments, the bitstream carries a weighted prediction identifier, which is used to indicate whether the prediction block under the second component uses the at least two intra-frame prediction modes for prediction.

[0479] Optionally, the bitstream carries mode information of the initial intra-frame prediction mode of the current block under the first component.

[0480] The first determining unit 22 is specifically used to determine the initial intra-frame prediction mode of the current block under the first component as the derived mode when the weighted prediction identifier is carried in the bitstream but the mode information of the initial intra-frame prediction mode of the current block under the first component is not carried.

[0481] In some embodiments, the intra-prediction mode of the current block under the first component includes at least two intra-prediction modes.

[0482] In one example, the second determining unit 23 is specifically used to take at least two intra-prediction modes under the second component as the intra-prediction modes of the current block under the first component.

[0483] In one example, the second determining unit 23 is specifically used to derive the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component.

[0484] At this time, the prediction unit 24 is specifically used to perform intra-prediction of the current block in the first component using each of the at least two intra-prediction modes of the current block in the first component, to obtain the prediction block corresponding to each intra-prediction mode; and to determine the final prediction block of the current block in the first component based on the prediction block corresponding to each intra-prediction mode.

[0485] In some embodiments, the prediction unit 24 is specifically used to determine a first weight matrix; and to perform a weighted operation on the prediction blocks corresponding to each intra-frame prediction mode according to the first weight matrix to obtain the final prediction block of the current block under the first component.

[0486] In some embodiments, prediction unit 24 is specifically used to determine a first weight matrix based on a weight matrix derivation pattern.

[0487] In some embodiments, the prediction unit 24 is specifically used to obtain a second weight matrix of the current block under the second component; if the total number of pixels included in the current block under the second component is the same as the total number of pixels included in the current block under the first component, then the second weight matrix is ​​used as the first weight matrix; if the total number of pixels included in the current block under the first component is less than the number of pixels included in the current block under the second component, then the second weight matrix is ​​downsampled to obtain the first weight matrix.

[0488] In some embodiments, the prediction unit 24 is specifically used to obtain the derived mode information of the second weight matrix from the bitstream; and to obtain the second weight matrix based on the derived mode information of the second weight matrix.

[0489] In some embodiments, the prediction unit 24 is specifically configured to downsample the second weight matrix based on the total number of pixels included in the current block under the first component and the number of pixels included in the current block under the second component, to obtain the first weight matrix.

[0490] Optionally, the second weight matrix includes at least two different weight values.

[0491] Optionally, all weight values ​​in the second weight matrix are identical.

[0492] Optionally, the predicted value of the pixel corresponding to each weight value in the second weight matrix under the second component is obtained by at least two intra-frame prediction modes under the second component.

[0493] Optionally, the at least two intra-prediction modes under the second component include N intra-prediction modes, where N is a positive integer greater than or equal to 2, and the second weight matrix includes N different weight values. The i-th weight value indicates that the predicted value of the pixel corresponding to the i-th weight value under the second component is completely obtained by the i-th intra-prediction mode, where i is a positive integer greater than or equal to 2 and less than or equal to N.

[0494] Optionally, the at least two intra-prediction modes under the second component include a first intra-prediction mode and a second intra-prediction mode. The second weight matrix includes a maximum weight value, a minimum weight value, and at least one intermediate weight value. The maximum weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the first intra-prediction mode. The minimum weight value indicates that the predicted value of the corresponding pixel under the second component is completely predicted by the second intra-prediction mode. The intermediate weight value indicates that the predicted value of the corresponding pixel under the second component is predicted by both the first intra-prediction mode and the second intra-prediction mode.

[0495] Optionally, the second weight matrix includes multiple weight values, and the positions where the weight values ​​change form a straight line or curve.

[0496] Optionally, the second weight matrix is ​​the weight matrix corresponding to the AWP mode or the GPM mode.

[0497] In some embodiments, the intra-prediction mode of the current block under the first component includes an intra-prediction mode.

[0498] In one example, the second determining unit 23 is specifically used to select one of the at least two intra-prediction modes under the second component as the intra-prediction mode of the current block under the first component.

[0499] In one example, the second determining unit 23 is specifically used to determine the intra-prediction mode of the current block under the first component based on the intra-prediction mode under the second component corresponding to the position of the first pixel of the current block.

[0500] In one example, the second determining unit 23 is specifically configured to: if the predicted value of the second component corresponding to the position of the first pixel is completely predicted by an intra-prediction mode, then use the intra-prediction mode as the intra-prediction mode of the current block in the first component; if the predicted value of the second component corresponding to the position of the first pixel is predicted by multiple intra-prediction modes, then use the intra-prediction mode with the largest weight value among the multiple intra-prediction modes as the intra-prediction mode of the current block in the first component.

[0501] In one example, the second determining unit 23 is specifically used to take the intra-prediction mode of the second component stored in the smallest unit corresponding to the first pixel position as the intra-prediction mode of the current block in the first component.

[0502] Optionally, if the predicted value of the second component corresponding to the first pixel position is completely predicted by one intra-prediction mode, then the minimum unit stores the mode information of the one intra-prediction mode; if the predicted value of the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the minimum unit stores the mode information of the intra-prediction mode with the largest weight value among the multiple intra-prediction modes.

[0503] In some embodiments, the first component includes a first sub-component and a second sub-component. The prediction unit 24 is specifically configured to perform first sub-component intra-prediction on the current block using each of at least two intra-prediction modes under the first component to obtain a predicted block of the current block under the first sub-component with respect to each of the intra-prediction modes; and to perform second sub-component intra-prediction on the current block using each of at least two intra-prediction modes under the first component to obtain a predicted block of the current block under the second sub-component with respect to each of the intra-prediction modes.

[0504] In some embodiments, the prediction unit 24 is specifically configured to perform a weighted operation on the prediction blocks of the current block under the first sub-component with respect to each intra-prediction mode according to the first weight matrix, to obtain the final prediction block of the current block under the first sub-component; and to perform a weighted operation on the prediction blocks of the second sub-component with respect to each intra-prediction mode according to the first weight matrix, to obtain the final prediction block of the current block under the second sub-component.

[0505] In some embodiments, the prediction unit 24 is specifically configured to obtain the final predicted block of the current block under the first sub-component according to the following formula:

[0506] predMatrixSawpA[x][y]=(predMatrixA0[x][y]*AwpWeightArrayAB[x][y]+predMatrixA1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1 )>>n;

[0507] Wherein, A is the first sub-component, predMatrixSawpA[x][y] is the final predicted value of pixel [x][y] in the first sub-component under the first sub-component, predMatrixA0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block under the first sub-component, predMatrixA1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block under the first sub-component, and AwpWeightArrayAB[x][y] is the weight value of predMatrixA0[x][y] in the first weight matrix AwpWeightArrayAB. n The sum of the preset weights, where n is a positive integer.

[0508] In some embodiments, the prediction unit 24 is specifically configured to obtain the final predicted block of the current block under the second sub-component according to the following formula:

[0509] predMatrixSawpB[x][y]=(predMatrixB0[x][y]*AwpWeightArrayAB[x][y]+predMatrixB1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1 )>>n;

[0510] Wherein, B is the second sub-component, predMatrixSawpB[x][y] is the final predicted value of pixel [x][y] in the second sub-component under the second sub-component, predMatrixB0[x][y] is the first predicted value of pixel [x][y] in the first prediction block of the current block under the second sub-component, predMatrixB1[x][y] is the second predicted value of pixel [x][y] in the second prediction block of the current block under the second sub-component, and AwpWeightArrayAB[x][y] is the weight value of predMatrixB0[x][y] in the first weight matrix AwpWeightArrayAB. n The sum of the preset weights, where n is a positive integer.

[0511] In some embodiments, the size of the current block satisfies a preset condition.

[0512] The preset conditions include any one or more of the following:

[0513] Condition 1: The width of the current block is greater than or equal to the first preset width TH1, and the height of the current block is greater than or equal to the first preset height TH2;

[0514] Condition 2: The number of pixels in the current block is greater than or equal to the first preset number TH3;

[0515] Condition 3: The width of the current block is less than or equal to the second preset width TH4, and the height of the current block is greater than or equal to the second preset height TH5;

[0516] Condition 4: The aspect ratio of the current block is a first preset ratio.

[0517] Condition 5: The size of the current block is a second preset value;

[0518] Condition 6: The height of the current block is greater than or equal to the third preset height, the width of the current block is greater than or equal to the third preset width, and the ratio of the width to the height of the current block is less than or equal to the third preset value.

[0519] Optionally, the first preset ratio can be any one of the following: 1:1, 2:1, 1:2, 1:4, or 4:1.

[0520] Optionally, the second preset value can be any one of the following: 16×32, 32×32, 16×64, and 64×16.

[0521] Optionally, the first component is a chromaticity component, and the second component is a luminance component.

[0522] Optionally, the chromaticity component is a UV component, the first sub-component is a U component, and the second sub-component is a V component.

[0523] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 20 The video decoder 20 shown can correspond to the corresponding subject in performing the method 700, 800 or 900 of the embodiments of this application, and the foregoing and other operations and / or functions of each unit in the video decoder 20 are respectively to implement the corresponding process in each method such as method 700 or 800 or 900. For the sake of brevity, they will not be described in detail here.

[0524] The apparatus and system of the embodiments of this application have been described above from the perspective of functional units in conjunction with the accompanying drawings. It should be understood that these functional units can be implemented in hardware, in software instructions, or in a combination of hardware and software units. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the methods disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software units in the decoding processor. Optionally, the software unit can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0525] Figure 21 This is a schematic block diagram of the electronic device 30 provided in the embodiments of this application.

[0526] like Figure 21As shown, the electronic device 30 can be the video encoder or video decoder described in the embodiments of this application, and the electronic device 30 may include:

[0527] The system includes a memory 31 and a processor 32. The memory 31 stores a computer program 34 and transfers the program code 34 to the processor 32. In other words, the processor 32 can retrieve and run the computer program 34 from the memory 31 to implement the methods described in the embodiments of this application.

[0528] For example, the processor 32 can be used to execute the steps in the method 200 described above according to the instructions in the computer program 34.

[0529] In some embodiments of this application, the processor 32 may include, but is not limited to:

[0530] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0531] In some embodiments of this application, the memory 31 includes, but is not limited to:

[0532] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0533] In some embodiments of this application, the computer program 34 may be divided into one or more units, which are stored in the memory 31 and executed by the processor 32 to perform the method provided in this application. The one or more units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 34 in the electronic device 30.

[0534] like Figure 21 As shown, the electronic device 30 may further include:

[0535] Transceiver 33, which can be connected to processor 32 or memory 31.

[0536] The processor 32 can control the transceiver 33 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include antennas, and the number of antennas may be one or more.

[0537] It should be understood that the various components in the electronic device 30 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.

[0538] Figure 22 This is a schematic block diagram of the video encoding and decoding system 40 provided in the embodiments of this application.

[0539] like Figure 22 As shown, the video encoding and decoding system 40 may include a video encoder 41 and a video decoder 42, wherein the video encoder 41 is used to execute the video encoding method involved in the embodiments of this application, and the video decoder 42 is used to execute the video decoding method involved in the embodiments of this application.

[0540] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0541] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0542] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0543] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0544] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional units in the various embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

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

Claims

1. A video encoding method, characterized in that, include: Obtain the current block, which includes a first component; Determine the initial intra-frame prediction mode of the current block under the first component; When the initial intra-prediction mode is the derived mode, at least two intra-prediction modes under the second component corresponding to the current block are obtained; The intra-prediction mode of the current block under the first component is determined based on at least two intra-prediction modes under the second component. Using the intra-prediction mode of the current block under the first component, perform intra-prediction of the current block under the first component to obtain the final predicted block of the current block under the first component.

2. The method according to claim 1, characterized in that, The intra-prediction mode of the current block under the first component includes at least two intra-prediction modes. Determining the intra-prediction mode of the current block under the first component based on the at least two intra-prediction modes under the second component includes: Use at least two intra-prediction modes under the second component as the intra-prediction modes of the current block under the first component, or Based on at least two intra-prediction modes under the second component, derive the intra-prediction mode of the current block under the first component.

3. The method according to claim 2, characterized in that, The step of using the intra-prediction mode of the current block under the first component to perform intra-prediction on the current block under the first component to obtain the final predicted block of the current block under the first component includes: Using each of the at least two intra-prediction modes of the current block under the first component, perform first component intra-prediction on the current block to obtain the prediction block corresponding to each intra-prediction mode. Based on the prediction blocks corresponding to each intra-frame prediction mode, the final prediction block of the current block under the first component is obtained. Wherein, obtaining the final prediction block of the current block under the first component based on the prediction block corresponding to each intra-frame prediction mode includes: Determine the first weight matrix; Based on the first weight matrix, a weighted operation is performed on the prediction blocks corresponding to each intra-frame prediction mode to obtain the final prediction block of the current block under the first component.

4. The method according to claim 1, characterized in that, The intra-prediction mode of the current block under the first component includes an intra-prediction mode.

5. The method according to claim 4, characterized in that, Determining the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component includes: Use one of the at least two intra-prediction modes under the second component as the intra-prediction mode of the current block under the first component, or The intra-prediction mode of the current block under the first component is determined based on the intra-prediction mode of the second component corresponding to the position of the first pixel of the current block.

6. The method according to claim 5, characterized in that, Determining the intra-prediction mode of the current block in the first component based on the intra-prediction mode in the second component corresponding to the first pixel position of the current block includes: If the predicted value of the second component corresponding to the position of the first pixel is completely predicted by an intra-prediction mode, then the intra-prediction mode is taken as the intra-prediction mode of the current block in the first component. If the predicted value of the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the intra-prediction mode with the largest weight value among the multiple intra-prediction modes is taken as the intra-prediction mode of the current block under the first component.

7. The method according to claim 5, characterized in that, Determining the intra-prediction mode of the current block in the first component based on the intra-prediction mode in the second component corresponding to the first pixel position of the current block includes: The intra-prediction mode of the second component stored in the smallest unit corresponding to the first pixel position is taken as the intra-prediction mode of the current block under the first component.

8. A video decoding method, characterized in that, include: The bitstream is parsed to obtain the current block and at least two intra-frame prediction modes under the second component corresponding to the current block, wherein the current block includes the first component; Determine the initial intra-frame prediction mode of the current block under the first component; When the initial intra-prediction mode is determined to be the derived mode, the intra-prediction mode of the current block under the first component is determined based on at least two intra-prediction modes under the second component. Using the intra-prediction mode of the current block under the first component, perform intra-prediction of the current block under the first component to obtain the final predicted block of the current block under the first component.

9. The method according to claim 8, characterized in that, The bitstream carries a weighted prediction identifier, which is used to indicate whether the prediction block under the second component uses the at least two intra-frame prediction modes for prediction.

10. The method according to claim 9, characterized in that, The bitstream carries mode information of the initial intra-frame prediction mode of the current block under the first component.

11. The method according to claim 9, characterized in that, Determining the initial intra-frame prediction mode of the current block under the first component includes: If the bitstream carries the weighted prediction identifier but does not carry the mode information of the initial intra-frame prediction mode of the current block under the first component, then the initial intra-frame prediction mode of the current block under the first component is determined to be the derived mode.

12. The method according to claim 8, characterized in that, The intra-prediction mode of the current block under the first component includes at least two intra-prediction modes.

13. The method according to claim 12, characterized in that, Determining the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component includes: Use at least two intra-prediction modes under the second component as the intra-prediction modes of the current block under the first component, or Based on at least two intra-prediction modes under the second component, derive the intra-prediction mode of the current block under the first component.

14. The method according to claim 12, characterized in that, The step of using the intra-prediction mode of the current block under the first component to perform intra-prediction of the current block under the first component includes: Using each of the at least two intra-prediction modes of the current block under the first component, perform intra-prediction of the current block in the first component to obtain the prediction block corresponding to each intra-prediction mode. Based on the prediction blocks corresponding to each intra-frame prediction mode, determine the final prediction block of the current block under the first component. Wherein, determining the final prediction block of the current block under the first component based on the prediction block corresponding to each intra-frame prediction mode includes: Determine the first weight matrix; Based on the first weight matrix, a weighted operation is performed on the prediction blocks corresponding to each intra-frame prediction mode to obtain the final prediction block of the current block under the first component.

15. The method according to claim 8, characterized in that, The intra-prediction mode of the current block under the first component includes an intra-prediction mode.

16. The method according to claim 15, characterized in that, Determining the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component includes: One of the at least two intra-prediction modes under the second component is used as the intra-prediction mode of the current block under the first component.

17. The method according to claim 15, characterized in that, Determining the intra-prediction mode of the current block in the first component based on at least two intra-prediction modes in the second component includes: The intra-prediction mode of the current block under the first component is determined based on the intra-prediction mode of the second component corresponding to the position of the first pixel of the current block.

18. The method according to claim 17, characterized in that, Determining the intra-prediction mode of the current block in the first component based on the intra-prediction mode in the second component corresponding to the first pixel position of the current block includes: If the predicted value of the second component corresponding to the position of the first pixel is completely predicted by an intra-prediction mode, then the intra-prediction mode is taken as the intra-prediction mode of the current block in the first component. If the predicted value of the second component corresponding to the first pixel position is predicted by multiple intra-prediction modes, then the intra-prediction mode with the largest weight value among the multiple intra-prediction modes is taken as the intra-prediction mode of the current block under the first component.

19. The method according to claim 18, characterized in that, Determining the intra-prediction mode of the current block in the first component based on the intra-prediction mode in the second component corresponding to the first pixel position of the current block includes: The intra-prediction mode of the second component stored in the smallest unit corresponding to the first pixel position is taken as the intra-prediction mode of the current block under the first component.

20. A video decoder, characterized in that, include: A parsing unit is used to parse the bitstream to obtain the current block and at least two intra-frame prediction modes under the second component corresponding to the current block, wherein the current block includes the first component; The first determining unit is used to determine the initial intra-frame prediction mode of the current block under the first component; The second determining unit is used to determine the intra-prediction mode of the current block under the first component based on at least two intra-prediction modes under the second component when the initial intra-prediction mode is determined to be the derived mode. The prediction unit is configured to perform intra-frame prediction of the current block in the first component using the intra-frame prediction mode of the current block in the first component, so as to obtain the final prediction block of the current block in the first component.

Citation Information

Patent Citations

  • Video encoding method and device involving intra prediction, and video decoding method and device

    CN106031176A

  • Chroma intra-frame prediction method and device

    CN110324627A