Video encoding / decoding method and system, video encoder, and video decoder
By deriving the intra prediction mode of the first component from the two intra prediction modes of the second component, the method addresses the inefficiencies in predicting the chroma component, resulting in improved prediction quality and compression performance.
Patent Information
- Application Number
- JP2023533962
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-12-03
- Publication Date
- 2025-04-07
- Estimated Expiration
- 2040-12-03
AI Technical Summary
Current video encoding and decoding technologies struggle to efficiently predict the chroma component during intra prediction, as they do not effectively utilize the relationship between the luminance and chroma components.
The proposed method identifies the intra prediction mode of the first component of a current block based on the two intra prediction modes of the second component, allowing for efficient derivation of the intra prediction mode and improved prediction accuracy, especially for complex textures.
This approach enhances the quality of intra prediction and improves compression performance by accurately predicting complex textures and reducing the transmission of mode information in the bitstream, thereby improving coding efficiency.
Smart Images

Figure 0007657931000020 
Figure 0007657931000021 
Figure 0007657931000022
Abstract
Description
[Technical field]
[0001] The present application relates to the field of video encoding and decoding technology, and in particular to a video encoding and decoding method and system, a video encoder and a video decoder. [Background technology]
[0002] Digital video technology can be incorporated into various video devices, such as digital televisions, smartphones, computers, e-readers, or video players. With the development of video technology, the amount of video data is increasing. To facilitate the transmission of video data, video devices utilize video compression technology so that the video data can be transmitted or stored more efficiently.
[0003] Currently, spatial prediction or temporal prediction is used to reduce or remove redundant information in video data, thereby achieving compression of video data. Prediction methods include inter prediction and intra prediction. In intra prediction, a current block is predicted based on neighboring blocks decoded within the same image.
[0004] When predicting a current block, in general, the luma component and the chroma component of the current block are predicted respectively to obtain a corresponding luma prediction block and / or a chroma prediction block, but the relationship between the luma component and the chroma component is not well utilized, and the chroma component cannot be predicted simply and efficiently. Summary of the Invention
[0005] In an embodiment of the present application, a video encoding and decoding method and system, a video encoder and a video decoder are provided, which realizes, when two intra prediction modes are used for a second component corresponding to a current block, simply and efficiently determining the intra prediction mode of a first component of a current block based on two intra prediction modes of the second component.
[0006] In a first aspect, the present application provides a video encoding method, which includes: obtaining a current block including a first component; determining an initial intra prediction mode of the first component of the current block; if determining that the initial intra prediction mode is a derived mode, obtaining at least two intra prediction modes of a second component corresponding to the current block; determining an intra prediction mode of the first component of the current block based on the at least two intra prediction modes of the second component; and performing intra prediction on the first component of the current block using the intra prediction mode of the first component of the current block, thereby obtaining a final prediction of the first component of the current block. block Get the.
[0007] In a second aspect, an embodiment of the present application provides a video decoding method, which includes: obtaining a current block including a first component and at least two intra prediction modes of a second component corresponding to the current block by analyzing a bitstream; determining an initial intra prediction mode of the first component of the current block; if the initial intra prediction mode is a derived mode, determining an intra prediction mode of the first component of the current block according to the at least two intra prediction modes of the second component; performing intra prediction on the first component of the current block using the intra prediction mode of the first component of the current block to obtain a final prediction of the first component of the current block. block Get the.
[0008] In a third aspect, the present application provides a video encoder configured to perform the method of the first aspect or any embodiment thereof, in particular the encoder comprises functional units configured to perform the method of the first aspect or any embodiment thereof.
[0009] In a fourth aspect, the present application provides a video decoder, configured to perform the method of the second aspect or any of its embodiments, in particular the decoder comprises functional units configured to perform the method of the second aspect or any of its embodiments.
[0010] In a fifth aspect, there is provided a video encoder comprising a processor and a memory configured to store a computer program, the processor being configured to perform the method of the first aspect or any embodiment thereof by calling and executing the computer program stored in the memory.
[0011] In a sixth aspect, there is provided a video decoder comprising a processor and a memory configured to store a computer program, the processor being configured to perform the method of the second aspect or any embodiment thereof by invoking and executing the computer program stored in the memory.
[0012] In a seventh aspect, there is provided a video encoding and decoding system, comprising a video encoder and a video decoder, the video encoder configured to perform the method of the first aspect or any embodiment thereof, and the video decoder configured to perform the method of the second aspect or any embodiment thereof.
[0013] In an eighth aspect, there is provided a chip configured to perform the method of the first or second aspect, or each embodiment of the first or second aspect. Specifically, the chip includes a processor configured to call up and execute a computer program from a memory, thereby causing a device to which the chip is attached to perform the method of the first or second aspect, or each embodiment of the first or second aspect.
[0014] In a ninth aspect, there is provided a computer readable storage medium configured to store a computer program, the computer program being configured to cause a computer to perform the method of the first or second aspect or an embodiment of the first or second aspect.
[0015] In a tenth aspect, there is provided a computer program product, the computer program product comprising computer program instructions configured to cause a computer to carry out a method according to the first or second aspect above, or a respective embodiment of the first or second aspect.
[0016] In an eleventh aspect, there is provided a computer program which, when executed on a computer, is configured to cause the computer to carry out the method of the first or second aspect or a respective embodiment of the first or second aspect.
[0017] Based on the above technical proposal, during intra prediction in video encoding / decoding, when it is determined that the initial intra prediction mode of the first component of the current block is a derived mode, the intra prediction mode of the first component of the current block is determined based on at least two intra prediction modes of the second component. This makes it possible to easily and efficiently determine the intra prediction mode of the first component of the current block. For example, by directly using at least two intra prediction modes of the second component as the intra prediction mode of the first component of the current block, not only can the intra prediction mode of the first component of the current block be easily and efficiently determined, but also, when prediction is performed on the first component of the current block using at least two intra prediction modes, complex textures can be accurately predicted, and the quality of intra prediction and compression performance can be improved. In addition, by deriving the intra prediction mode of the first component of the current block based on the intra prediction mode of the second component, it is possible to utilize the correlation between channels, and thus it is possible to reduce the transmission of mode information of the first component in the bitstream and effectively improve the coding efficiency. [Brief description of the drawings]
[0018] [Figure 1] FIG. 1 is a block diagram illustrating a video encoding and decoding system 100 according to an embodiment of the present application. [Diagram 2] FIG. 2 is a block diagram illustrating a video encoder 200 according to an embodiment of the present application. [Diagram 3] FIG. 3 is a block diagram illustrating a decoding framework 300 according to an embodiment of the present application. [Figure 4A] FIG. 4A is a weight map of 64 modes in a square block geometric partitioning mode (GPM). [Figure 4B]Figure 4B shows weight maps of 56 modes in square block angular weighted prediction (AWP). [Diagram 5] FIG. 5 is a schematic diagram showing a reference pixel according to an embodiment of the present application. [Figure 6] FIG. 6 is a schematic diagram illustrating a multiple-reference-line (MRL) intra prediction method according to an embodiment of the present application. [Figure 7] FIG. 7 is a schematic diagram showing nine intra-prediction modes in H.264. [Figure 8] FIG. 8 is a schematic diagram showing 35 intra prediction modes in HEVC. [Figure 9] FIG. 9 is a schematic diagram showing 67 intra prediction modes in VVC. [Figure 10] FIG. 10 is a schematic diagram showing 66 intra prediction modes in AVS3. [Figure 11A] FIG. 11A is a schematic diagram illustrating the principle of intra prediction of a luminance block according to an embodiment of the present application. [Figure 11B] FIG. 11B is a schematic diagram illustrating a method for storing intra-prediction modes according to an embodiment of the present application. [Figure 12] FIG. 12 is a flow chart illustrating a video encoding method 400 according to an embodiment of the present application. [Figure 13] FIG. 13 is a schematic diagram illustrating division of a first component and a second component according to an embodiment of the present application. [Figure 14] FIG. 14 is another flow chart illustrating a video encoding method 500 according to an embodiment of the present application. [Figure 15] FIG. 15 is another flow chart illustrating a video encoding method 600 according to an embodiment of the present application. [Figure 16] FIG. 16 is a flow chart illustrating a video decoding method 700 according to an embodiment of the present application. [Figure 17]FIG. 17 is a flow chart illustrating a video decoding method 800 according to an embodiment of the present application. [Figure 18] FIG. 18 is a flow chart illustrating a video decoding method 900 according to an embodiment of the present application. [Figure 19] FIG. 19 is a block diagram illustrating a video encoder 10 according to an embodiment of the present application. [Figure 20] FIG. 20 is a block diagram illustrating a video decoder 20 according to an embodiment of the present application. [Figure 21] FIG. 21 is a block diagram showing an electronic device 30 according to an embodiment of the present application. [Figure 22] FIG. 22 is a block diagram illustrating a video encoding / decoding system 40 according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0019] The present application is applicable to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, real-time video encoding and decoding, etc. For example, the technical solution of the present application can be combined with an audio video coding standard (AVS), and examples of AVS include the H.264 / audio video coding (AVC) standard, the H.265 / high efficiency video coding (HEVC) standard, and the H.266 / versatile video coding (VVC) standard. Alternatively, the technical solution of the present application may 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), including scalable video coding and decoding (SVC) and multi-view video coding and decoding (MVC) extensions. Note that the technology of the present application is not limited to any particular coding and decoding standard or technology.
[0020] For ease of understanding, a video encoding / decoding system according to an embodiment of the present application will first be introduced with reference to FIG.
[0021] FIG. 1 is a block diagram showing a video encoding / decoding system 100 according to an embodiment of the present application. FIG. 1 is merely an example, and the video encoding / decoding system according to the embodiment of the present application includes, but is not limited to, that shown in FIG. 1. As shown in FIG. 1, the video encoding / decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is configured to encode (may be understood as compressing) video data to generate a bitstream, and transmit the bitstream to a decoding device. The decoding device is configured to decode the bitstream generated by the encoding device to obtain decoded video data.
[0022] The encoding device 110 according to the embodiment of the present application can be understood as a device having a video encoding function, and the decoding device 120 can be understood as a device having a video decoding function. That is, the encoding device 110 and the decoding device 120 according to the embodiment of the present application include a wider range of devices, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set top boxes (STBs), televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, etc.
[0023] In some embodiments, encoding device 110 may transmit encoded video data (e.g., a bitstream) to decoding device 120 over channel 130. Channel 130 may include one or more media and / or devices that may transmit encoded video data from encoding device 110 to decoding device 120.
[0024] In one example, the channel 130 includes one or more communication media that enable the encoding device 110 to transmit encoded video data directly to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to the decoding device 120. The communication medium includes a wireless communication medium, such as a radio frequency spectrum. Alternatively, the communication medium can also include a wired communication medium, such as one or more physical transmission lines.
[0025] In another example, the channel 130 includes a storage medium that can store the video data encoded by the encoding device 110. The storage medium can include various locally accessible data storage media, such as optical disks, digital versatile discs (DVDs), flash memories, etc. In this example, the decoding device 120 can retrieve the encoded video data from the storage medium.
[0026] In another example, the channel 130 may include a storage server, which may store the video data encoded by the encoding device 110. In this example, the decoding device 120 may download the encoded video data stored in the storage server from the storage server. Alternatively, the storage server may store the encoded video data and transmit the encoded video data to the decoding device 120, examples of which include a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.
[0027] In some embodiments, encoding device 110 includes a video encoder 112 and an output interface 113. Output interface 113 may include a modulator / demodulator (modem) and / or a transmitter.
[0028] In some embodiments, encoding device 110 may include a video source 111 in addition to a video encoder 112 and an output interface 113 .
[0029] Video source 111 may include at least one of a video acquisition device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system, the video input interface configured to receive video data from a video content provider, and the computer graphics system configured to generate the video data.
[0030] The video encoder 112 generates a bitstream by encoding video data from the video source 111. The video data may include one or more pictures or a sequence of pictures. The bitstream includes coding information for the pictures or sequence of pictures. The coding information may include coded image data and associated data. The associated data may include sequence parameter sets (SPS for short), picture parameter sets (PPS for short), and other syntax structures. An SPS may include parameters that apply to one or more sequences, and a PPS may include parameters that apply to one or more pictures. A syntax structure is a collection of zero or more syntax elements arranged in a specified order in the bitstream.
[0031] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored in a storage medium or a storage server for subsequent reading by the decoding device 120.
[0032] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122 .
[0033] In some embodiments, the decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 .
[0034] The input interface 121 includes a receiver and / or a modem and is capable of receiving encoded video data via a channel 130.
[0035] The video decoder 122 is configured to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to a display device 123 .
[0036] The display device 123 displays the decoded video data and may be built into the decoding device 120 or may be external to the decoding device 120. The display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
[0037] In addition, FIG. 1 is only an example, and the technical solution of the embodiment of the present application is not limited to FIG. 1. For example, the technology of the present application can also be applied to one-sided video encoding or one-sided video decoding.
[0038] In the following, a video encoding framework according to an embodiment of the present application will be described.
[0039] 2 is a block diagram illustrating a video encoder 200 according to an embodiment of the present application, which may be configured to perform lossy or lossless compression on images, which may be visually lossless or mathematically lossless compression.
[0040] The video encoder 200 is applicable to image data in luma-chroma (YCbCr, YUV) format. For example, the ratio of YUV can be 4:2:0, 4:2:2, or 4:4:4, where Y indicates luma, Cb (U) indicates blue chroma, Cr (V) indicates red chroma, and U, V indicate chroma to describe color and saturation. For example, in color format, 4:2:0 indicates that every four pixels have four luma components and two chroma components (YYYYCbCr), 4:2:2 indicates that every four pixels have four luma components and four chroma components (YYYYCbCrCbCr), and 4:4:4 indicates full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0041] For example, the video encoder 200 reads video data, and for each image in the video data, divides each image into several coding tree units (CTUs). In some examples, the CTUs can be called "tree blocks", "largest coding units (LCUs)", or "coding tree blocks (CTBs)". Each CTU can be associated with a pixel block having the same size as the CTU in the image, and each pixel can correspond to one luminance (or luma) sample and two chrominance (or chroma) samples. Thus, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of the CTU can be, for example, 128×128, 64×64, 32×32, etc. The CTU can be subsequently divided into several coding units (CUs) to be encoded. The CUs can be rectangular or square blocks. The CU can be further divided into a prediction unit (PU) and a transform unit (TU), so that coding, prediction and transformation are separated and processing can be flexible. In one example, the CTU is divided into CUs in a quadtree manner, and the CU is divided into TUs and PUs in a quadtree manner.
[0042] The video encoder and video decoder can support various PU sizes. Assuming that a particular CU size is 2N×2N, the video encoder and video decoder can support PU sizes of 2N×2N or N×N for intra prediction, and can support symmetric PUs with sizes of 2N×2N, 2N×N, N×2N, N×N, or similar for inter prediction. The video encoder and video decoder can also support asymmetric PUs with sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.
[0043] 2, the video encoder 200 may include a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filtering unit 260, a decoded image buffer 270, and an entropy coding unit 280. However, the video encoder 200 may include more, fewer, or different functional blocks.
[0044] Optionally, in this application, the current block may be referred to as the current CU or the current PU, etc. The prediction block may be referred to as the prediction image block or the image prediction block. The reconstructed image block may be referred to as the reconstruction block or the image reconstruction block.
[0045] In some embodiments, the prediction unit 210 includes an inter prediction unit 211 and an intra estimation unit 212. Because there is a strong correlation between adjacent pixels in a video picture, the video encoding and decoding technology uses the method of intra prediction to eliminate the spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent pictures in a video, the video encoding and decoding technology uses the method of inter prediction to eliminate the temporal redundancy between adjacent pictures, thereby improving the coding efficiency.
[0046] The inter prediction unit 211 can be used for inter prediction. In inter prediction, image information of different images can be referenced, and motion information is used to find a reference block from a reference image, and a prediction block is generated based on the reference block, thereby eliminating temporal redundancy. The image used for inter prediction can be a P frame and / or a B frame. A P frame refers to a forward prediction image, and a B frame refers to a bidirectional prediction image. The motion information includes a reference image list including reference images, a reference image index, and a motion vector. The motion vector can be a full pixel motion vector or a sub-pixel motion vector. If the motion vector is a sub-pixel motion vector, an interpolation filter needs to be applied to the reference image to generate the required sub-pixel block. The full pixel block or sub-pixel block in the reference image found based on the motion vector is called a reference block. There are techniques for using the reference block as a prediction block as it is, and there are also techniques for processing based on the reference block to generate a prediction block. Processing based on the reference block to generate a prediction block can also be understood as using the reference block as a prediction block, and then processing based on the prediction block to generate a new prediction block.
[0047] Currently, the most commonly used inter prediction methods include the geometric partitioning mode (GPM) in the VVC video encoding and decoding standard and the angular weighted prediction (AWP) in the AVS3 video encoding and decoding standard. These two intra prediction modes have something in common in principle.
[0048] In conventional unidirectional prediction, only one reference block having the same size as the current block is found. In conventional bidirectional prediction, two reference blocks having the same size as the current block are found, and the value of each pixel in the prediction block is the average value of the values at the corresponding positions in the two reference blocks, that is, the contribution rate of all pixels in each reference block to the prediction block is 50%. In bidirectional weighted prediction, the contribution rates of the two reference blocks may be different, for example, all pixels in the first reference block contribute 75%, and all pixels in the second reference block contribute 25%. All pixels in the same reference block have the same contribution rate. GPM or AWP also uses two reference blocks having the same size as the current block, but in some pixel positions, the pixel value at the corresponding position of the first reference block is used 100%, and in some other pixel positions, the pixel value at the corresponding position of the second reference block is used 100%, and in the transition region (intersection region), the pixel values at the corresponding positions of these two reference blocks are used at a constant rate. The specific way in which the weights of pixel values are assigned is determined by the mode of GPM or AWP. In GPM or AWP, two reference blocks having sizes different from the size of the current block are used, that is, a necessary part of each is taken as the reference block. That is, the part with a weight other than 0 is used as the reference block, and the part with a weight of 0 is excluded.
[0049] Figure 4A shows the weight map of 64 modes in the square block GPM. Black indicates that the weight value of the corresponding position in the first reference block is 0%, white indicates that the weight value of the corresponding position in the first reference block is 100%, and the gray area indicates that the weight value of the corresponding position in the first reference block is any weight value greater than 0% and less than 100% with different color shades. The weight value of the corresponding position in the second reference block is 100% minus the weight value of the corresponding position in the first reference block.
[0050] Figure 4B shows the weight map of 56 modes in the AWP of square blocks. Black indicates that the weight value of the corresponding position in the first reference block is 0%, white indicates that the weight value of the corresponding position in the first reference block is 100%, and the gray area indicates that the weight value of the corresponding position in the first reference block is any weight value greater than 0% and less than 100% with different shades of color. The weight value of the corresponding position in the second reference block is 100% minus the weight value of the corresponding position in the first reference block.
[0051] The method of deriving weights in GPM and AWP is different. In GPM, we identify angles and offsets based on different modes, and then calculate weighting matrices for different modes. In AWP, we first generate a one-dimensional weight line, and then tile the one-dimensional weight line over the entire matrix using a method similar to intra-angle prediction.
[0052] In the preceding coding and decoding technologies, there is only a rectangular partitioning method, regardless of partitioning into CU, PU, and TU. In GPM and AWP, the effect of non-rectangular partitioning of prediction is realized when no partitioning is performed. In GPM and AWP, a mask of the weights of two reference blocks, i.e., the weight map, is used. From this mask, the weights of the two reference blocks for generating a prediction block are identified. Or, it can be simply understood as follows: A part of the position of the prediction block comes from the first reference block, a part of the position of the prediction block comes from the second reference block, and a transition area (blending area) is obtained by weighting the corresponding positions of the two reference blocks, so that the transition can be made smoother. In GPM and AWP, since the current block is not divided into two CUs or PUs by a partition line, the transform, quantization, inverse transform, inverse quantization, etc. of the residual after prediction are performed on the entire current block.
[0053] The intra estimation unit 212 predicts pixel information in a current image block by referring only to information of the same image to eliminate spatial redundancy. The image used for intra prediction may be an I frame. For example, as shown in FIG. 5, a white 4×4 block is a current block, and gray pixels in one row to the left and one column above the current block are reference pixels of the current block, and in intra prediction, these reference pixels are used to predict the current block. All of these reference pixels may be available, that is, all may have been coded or decoded. Some of these reference pixels may be unavailable, for example, the current block is at the leftmost position of the entire image, and the reference pixels to the left of the current block are unavailable. Or, when coding or decoding the current block, the lower left part of the current block has not yet been coded or decoded, so the lower left reference pixels are also unavailable. When the reference pixels are unavailable, filling may be performed using the available reference pixels, or using some value or some method, or filling may not be performed.
[0054] In some embodiments, the intra prediction method further includes a multiple reference line (MRL) intra prediction method. As shown in FIG. 6, MRL can utilize more reference pixels to improve coding efficiency.
[0055] There are multiple prediction modes for intra prediction, and as shown in FIG. 7, there are nine modes for intra prediction for 4×4 blocks in H.264. In mode 0, the pixel above the current block is copied vertically to the current block as a predicted value. In mode 1, the reference pixel on the left is copied horizontally to the current block as a predicted value. In mode 2 (DC), the average value of eight pixels A to D and I to L is used as a predicted value for all pixels. In modes 3 to 8, the reference pixel is copied to the corresponding position of the current block along a certain angle. Since some positions of the current block cannot exactly correspond to the reference pixel, it is necessary to use a weighted average value of the reference pixel or an interpolated sub-pixel of the reference pixel.
[0056] As shown in FIG. 8, the intra prediction modes used in HEVC include a planar mode, DC, and 33 angle modes, for a total of 35 prediction modes.
[0057] As shown in FIG. 9, the intra modes used in VVC include Planar, DC, and 65 angle modes, for a total of 67 prediction modes.
[0058] As shown in FIG. 10, the intra modes used in AVS3 include DC, Plane, Bilinear, and 63 angle modes, for a total of 66 prediction modes.
[0059] In some implementations, the intra prediction mode further includes some improvement modes, such as improving sub-pixel interpolation of reference pixels, filtering predicted pixels, etc. For example, in a multiple intra prediction filter (MIPF) in AVS3, a predicted value can be generated using different filters for blocks having different sizes. Specifically, for pixels at different positions in the same block, a predicted value is generated using one filter for pixels close to the reference pixels, and a predicted value is generated using another filter for pixels far from the reference pixels. For example, in an intra prediction filter (IPF) in AVS3, a predicted value can be filtered using reference pixels.
[0060] Furthermore, with an increase in the number of angle modes, intra prediction becomes more accurate and better meets the needs of the development of high-definition and ultra-high-definition digital videos.
[0061] Residual unit 220 may generate a residual block of a CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, residual unit 220 may generate a residual block of a CU such that each sample in the residual block is equal to the difference between a sample in the pixel block of the CU and a corresponding sample in the prediction block of the PU of the CU.
[0062] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of a CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with a CU by adjusting the QP value associated with the CU.
[0063] The inverse transform / quantization unit 240 may reconstruct a residual block from the quantized transform coefficients by applying inverse quantization and inverse transform, respectively, to the quantized transform coefficients.
[0064] Reconstruction unit 250 may generate a reconstructed image block associated with a TU by adding samples in the reconstructed residual block to corresponding samples in one or more prediction blocks generated by prediction unit 210. In this manner, by reconstructing the sample blocks of each TU of a CU, video encoder 200 may reconstruct pixel blocks of the CU.
[0065] The loop filtering unit 260 may perform a deblocking filtering process to reduce blocking artifacts of pixel blocks associated with a CU.
[0066] In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit and a sample adaptive offset (SAO) / adaptive loop filtering (ALF) unit, where the deblocking filtering unit is used for deblocking and the SAO / ALF unit is used to remove ringing effects.
[0067] The decoded image buffer 270 can store the reconstructed pixel block. The inter prediction unit 211 can perform inter prediction on the PU of another image using the reference image including the reconstructed pixel block. Also, the intra estimation unit 212 can perform intra prediction on the other PU in the same image as the CU using the reconstructed pixel block in the decoded image buffer 270.
[0068] The entropy encoding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy coded data.
[0069] FIG. 3 is a block diagram illustrating a decoding framework 300 according to an embodiment of the present application.
[0070] 3, the video decoder 300 includes a header information decoding unit 310, a prediction unit 320, an inverse quantization and transform 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 include more, fewer, or different functional blocks.
[0071] The video decoder 300 may receive a bitstream. The header information decoding unit 310 may extract syntax elements from the bitstream by parsing the bitstream. As part of parsing the bitstream, the header information decoding unit 310 may parse entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization and transformation unit 330, the reconstruction unit 340, and the loop filtering unit 350 may decode the video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.
[0072] In some embodiments, the prediction unit 320 includes an intra estimation unit 322 and an inter prediction unit 321 .
[0073] The intra estimation unit 322 may generate a prediction block of the PU by performing intra prediction. The intra estimation unit 322 may generate a prediction block of the PU based on pixel blocks of spatially neighboring PUs using an intra prediction mode. The intra estimation unit 322 may further determine an intra prediction mode of the PU based on one or more syntax elements parsed from the bitstream.
[0074] The inter 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. In addition, if the PU is coded by inter prediction, the header information decoding unit 310 can analyze the motion information of the PU. 321 The inter prediction unit 321 may identify one or more reference blocks for the PU based on the motion information of the PU. The inter prediction unit 321 may generate a prediction block for the PU based on the one or more reference blocks for the PU.
[0075] The inverse quantization and transform unit 330 may inverse quantize (i.e., dequantize) the transform coefficients associated with the TU. The inverse quantization and transform unit 330 may determine the degree of quantization using a QP value associated with the CU of the TU.
[0076] After inverse quantizing the transform coefficients, the inverse quantization and transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.
[0077] The reconstruction unit 340 reconstructs a pixel block of the CU using a residual block associated with the TU of the CU and a prediction block of a PU of the CU. For example, the reconstruction unit 340 can reconstruct the pixel block of the CU by adding a sample in the residual block to a corresponding sample in the prediction block to obtain a reconstructed image block.
[0078] The loop filtering unit 350 may perform a deblocking filtering process to reduce block artifacts of pixel blocks associated with a CU.
[0079] The video decoder 300 may store the reconstructed image of the CU in a decoded image buffer 360. The video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or may transmit the reconstructed image to a display device for display.
[0080] The basic flow of video encoding and decoding is as follows. On the encoding side, an image (frame) is divided into blocks, and for a current block, a prediction unit 210 performs intra prediction or inter prediction to generate a prediction block of the current block. A residual unit 220 can calculate a residual block based on a prediction block and an original block of the current block, i.e., a difference between the prediction block and the original block of the current block, and the residual block is also called residual information. The residual block is transformed and quantized by a transform / quantization unit 230, so that information that is not sensitive to human eyes can be removed and visual redundancy can be eliminated. Alternatively, the residual block before being transformed and quantized by the transform / quantization unit 230 can be called a time-domain residual block, and the time-domain residual block after being transformed and quantized by the transform / quantization unit 230 can be called a frequency residual block or a frequency-domain residual block. The entropy coding unit 280 may receive the quantized transformation coefficients output by the transform / quantization unit 230 and output a bitstream by entropy coding the quantized transformation coefficients. For example, the entropy coding unit 280 may remove character redundancies based on a target context model and probability information of the binary bitstream.
[0081] On the decoding side, the header information decoding unit 310 can obtain prediction information, a quantization coefficient matrix, etc. of the current block by analyzing the bitstream, and the prediction unit 320 generates a prediction block of the current block by performing intra prediction or inter prediction on the current block based on the prediction information. The inverse quantization and transformation unit 330 uses the quantization coefficient matrix obtained from the bitstream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed block forms a reconstructed image. The loop filtering unit 350 loop filters the reconstructed image based on an image or block to obtain a decoded image. The encoding side also requires a similar process to the decoding side to obtain a decoded image. The decoded image may be called a reconstructed image, and the reconstructed image can be a reference image for inter prediction of a subsequent image.
[0082] In addition, the block division information specified on the encoding side, and mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc. are carried in the bit stream as necessary. The decoding side analyzes the bit stream and analyzes it from existing information to identify the same block division information, mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc. as the encoding side. This ensures that the decoded image obtained on the encoding side is the same as the decoded image obtained on the decoding side.
[0083] The above is a basic flow of video encoding and decoding in a block-based mixed coding framework. As technology develops, some modules or steps of the framework or flow may be optimized. This application applies to the basic flow of video encoding and decoding in a block-based mixed coding framework, but is not limited to the framework or flow.
[0084] Based on the above description of the video encoding system, video encoder, video decoding, and intra prediction mode according to the embodiments of the present application, the technical solutions according to the embodiments of the present application are described in detail below together with specific embodiments.
[0085] The video encoder of the embodiment of the present application can be applied to image blocks having different formats, such as YUV format, YcbCr format, RGB format, etc. Any image block having the above formats includes a first component and a second component. For example, the second component of an image block having a YUV format can be a Y component, i.e., a luminance component, and the first component can be a U and / or V component, i.e., a chroma component. The second component is more important than the first component. For example, human eyes are more sensitive to luminance than chroma, so in video encoding and decoding, the Y component receives more attention than the U and V components. For example, in a normal YUV format, the ratio of YUV is 4:2:0, and the number of samples in the U component or the V component is less than the number of samples in the Y component. The sample ratio of Y, U, and V in a YUV4:2:0 block is 4:1:1. In this case, some encoding and decoding modes of the chroma components of the image block can be identified based on the information of the encoding and decoding modes of the luminance component.
[0086] For an image block having another format (such as RGB format), some encoding-decoding modes of the first component of the image block can be identified based on the information of the encoding-decoding mode of the second component of the image block. In the embodiment of the present application, the YUV format is mainly taken as an example, but the present application is not limited to a specific format.
[0087] In the present application, when performing intra prediction on the second component of the image block, at least two intra prediction modes of the second component of the image block are used to perform prediction, thereby realizing accurate prediction of complex texture. For example, the second component is a luminance component, and in the present application, at least two intra prediction modes are used to perform prediction on the block having complex luminance texture, thereby realizing accurate prediction of the block having complex luminance texture.
[0088] The at least two intra prediction modes of the second component of the image block include, but are not limited to, intra prediction modes such as the above-mentioned DC, Planar, Plane, Bilinear, and angle prediction modes, and further include improved prediction modes such as MIPF and IPF.
[0089] The process of performing intra prediction on the second component of an image block using at least two intra prediction modes of the second component is as follows: Prediction is performed on the second component using each of at least two intra prediction modes to obtain prediction blocks corresponding to various intra prediction modes. Then, the prediction blocks corresponding to various intra prediction modes are processed to obtain a final prediction block of the second component of the image block. For example, the prediction blocks corresponding to various intra prediction modes can be added and the average value can be taken as the final prediction block of the second component of the image block. For example, a weighting matrix (i.e., a second weighting matrix) is identified, and a weighting operation is performed on the prediction blocks corresponding to various intra prediction modes according to the second weighting matrix to obtain a final prediction block of the second component of the image block. For example, assuming that the second component is a luminance component, as shown in FIG. 11A, the at least two intra prediction modes of the luminance block are a first intra prediction mode and a second intra prediction mode. A first intra prediction mode is used to perform intra prediction on the luminance block to obtain a first predicted block, and a second intra prediction mode is used to perform intra prediction on the luminance block to obtain a second predicted block, and a second weighting matrix is used to perform a weighting operation on the first predicted block and the second predicted block to obtain a final predicted block of the luminance block.
[0090] In one embodiment of the present application, prediction is performed for each sample in the second component using different intra-prediction modes to obtain a predicted value for each sample corresponding to the different intra-prediction modes. Then, a weighting operation is performed on the predicted value for each sample corresponding to the different intra-prediction modes based on the weight value corresponding to each sample in the second weighting matrix to obtain a final predicted value for each sample in the second component. The final predicted value for each sample in the second component forms a final predicted block of the second component for the image block. In this way, weighting can be performed without waiting for all predicted blocks to be obtained, and additional storage space is not required to store the first predicted block and the second predicted block, thereby saving storage resources of the video encoder.
[0091] As can be seen from the above, some coding / decoding modes of a first component of the same image block can be determined based on information of the coding / decoding modes of a second component of the image block, i.e., in some cases, the intra coding mode of a first component of an image block can be determined based on information of the intra prediction mode of a second component of the image block.
[0092] Based on the above, the encoding side will now be described with reference to FIG.
[0093] Figure 12 is a flowchart showing a video encoding method 400 according to an embodiment of the present application. The embodiment of the present application is applied to the video encoder shown in Figure 1 and Figure 2. As shown in Figure 12, the method according to the embodiment of the present application includes the following contents:
[0094] S401: The current block including the first component is obtained.
[0095] During video encoding, a video encoder receives a video stream consisting of a sequence of images. For each image in the video stream, the encoder performs video encoding. For convenience, the current image to be encoded is referred to as a target image in this application. The video encoder obtains a current block by dividing the target image into blocks.
[0096] In the block division, a block divided in the conventional method includes a first component (e.g., chroma component) at the position of the current block and a second component (e.g., luma component) at the position of the current block. In contrast, in the separation tree technique (e.g., dual tree), a single component block can be obtained, for example, a single luma block and a single chroma block are obtained. As shown in FIG. 13, the luma block at the same position as the current block (also called the current image block) is divided into four luma coding units, but the chroma block is not divided. The luma block can be understood to include only the luma component at the position of the current block. The chroma block can be understood to include only the chroma component at the position of the current block. In this way, the luma component and the chroma component at the same position can belong to different blocks, which makes the division more flexible. When the separation tree is used for CU division, some CUs include both the first component and the second component, some CUs include only the first component, and some CUs include only the second component.
[0097] In some implementations, the current block of the embodiments of the present application includes only the first component, for example, the current block includes only a chroma component, in which case the current block can be understood to be a chroma block.
[0098] In some implementations, the current block includes both the first component and the second component, for example, the current block includes both a chroma component and a luma component.
[0099] S402: Identify an initial intra-prediction mode of a first component of a current block.
[0100] As an example, the first component is a chroma component and the second component is a luma component.
[0101] The chroma intra prediction mode may be selected independently or may be derived based on the luma intra prediction mode of the same block or the same or adjacent block. Taking the chroma intra prediction mode in AVS3 as an example, Table 1 shows multiple modes in the "intra prediction mode of luma prediction block" in AVS3, and Table 2 shows multiple modes in the "intra prediction mode of chroma prediction block" in AVS3.
[0102] [Table 1]
[0103] In Table 1, IntraLumaPredMode represents the mode number of intra prediction of the luma component, Intra_Luma_DC represents the DC mode of intra luma prediction, Intra_Luma_Plane represents the Plane mode of intra luma prediction, Intra_Luma_Bilinear represents the bilinear mode of intra luma prediction, Intra_Luma_Vertical represents the vertical mode of intra luma prediction, Intra_Luma_Horizontal represents the horizontal mode of intra luma prediction, Intra_Luma_PCM represents the PCM mode of intra luma prediction, and Intra_Luma_Angular represents the angular mode of intra luma prediction.
[0104] [Table 2]
[0105] In Table 2, IntraChromaPredMode represents the mode number of intra prediction of chroma component, Intra_Chroma_DM represents the DM mode of intra chroma prediction, and the DM mode is a derived mode, that is, when the DM mode is used as the intra chroma prediction mode, the corresponding intra luma prediction mode is the intra chroma prediction mode. For example, if the corresponding intra luma prediction mode is an angle mode, the intra chroma prediction mode is also the angle mode. In addition to the DM mode, the intra chroma prediction mode further includes a DC mode (Intra_Chroma_DC), a horizontal mode (Intra_Chroma_Horizontal), a vertical mode (Intra_Chroma_Vertical), a bilinear mode, a PCM mode, and a cross-component prediction mode.
[0106] The DC mode, bilinear mode, horizontal mode, and vertical mode corresponding to the chroma component are respectively similar to the DC mode, bilinear mode, horizontal mode, and vertical mode corresponding to the luma component. With such mode design, the same prediction mode can be used for both chroma intra prediction and luma intra prediction. A value of IntraLumaPredMode equal to 33 means that the PCM mode is used for the corresponding luma prediction block. If the PCM mode is used for the luma prediction block and IntraChromaPredMode is 0, the PCM mode is also used for the intra prediction of the chroma component.
[0107] When performing intra prediction on the chroma component, the video encoder tries each possible intra prediction mode in Table 2, such as DM mode, DC mode (Intra_Chroma_DC), horizontal mode (Intra_Chroma_Horizontal), vertical mode (Intra_Chroma_Vertical), bilinear mode, PCM mode, and cross-component prediction mode (two-step cross-component prediction mode (TSCPM), prediction from multiple cross-components (PMC), cross-component linear model (CCLM) in VVC), etc. The video encoder selects the intra prediction mode with the smallest distortion cost as the initial intra prediction mode for the chroma component of the current block.
[0108] If the video encoder determines that the initial intra-prediction mode of the chroma component of the current block is not the DM mode, for example, the DC mode or the vertical mode, the video encoder writes mode information of the determined initial intra-prediction mode into the bitstream. The decoder analyzes the mode information of the chroma intra prediction to determine the chroma intra-prediction mode.
[0109] If the video encoder determines that the initial intra-prediction mode of the chroma component of the current block is the DM mode, it performs the following step S403.
[0110] S403: If the initial intra-prediction mode is a derived mode, obtain at least two intra-prediction modes of the second component corresponding to the current block.
[0111] The derivation mode is used to indicate that the intra-prediction mode of the first component of the current block is derived based on the intra-prediction mode of the second component corresponding to the current block, for example, the intra-prediction mode of the first component of the current block is the same as or is determined based on the intra-prediction mode of the second component.
[0112] The second component corresponding to the current block described in the embodiment of the present application includes the following two cases: In the first case, the current block includes both the first component and the second component, in which case the second component corresponding to the current block is the second component included in the current block; In the second case, the current block does not include the second component and only includes the first component, for example, if the first component is a chroma component, the current block can be understood as a chroma block; In this case, the current block corresponds to one or more pixels in the original image to be encoded, and the second component corresponding to the one or more pixels is the second component corresponding to the current block.
[0113] When the current block includes both a first component and a second component, the intra-prediction mode of the second component of the same block can be directly obtained from the mode information of the current block. When the intra-prediction mode of the second component corresponding to the current block has already been identified and already stored in the mode information of the current block, the at least two intra-prediction modes used for the intra-prediction mode of the second component corresponding to the current block can be directly obtained from the mode information of the current block.
[0114] When the encoder encodes the second component corresponding to the current block, the mode information of at least two kinds of intra prediction modes used for encoding the second component is stored. Therefore, when the current block does not include the second component but only includes the first component, the encoder can obtain the at least two kinds of intra prediction modes of the stored second component.
[0115] Each of the at least two intra prediction modes of the second component is different.
[0116] The at least two intra prediction modes used for intra prediction of the second component include, but are not limited to, intra prediction modes such as the above DC, Planar, Plane, Bilinear, and angle modes, and further include improved prediction modes such as MIPF and IPF. For convenience of explanation, in this application, intra prediction modes such as DC, Planar, Plane, Bilinear, and angle modes are referred to as basic intra prediction modes, and MIPF, IPF, and the like are referred to as improved intra prediction modes. Using the basic intra prediction mode, a prediction block can be generated independently without depending on other intra prediction modes, that is, if a reference sample and a basic intra prediction mode are identified, a prediction block can be identified. In contrast, using the improved intra prediction mode, a prediction block cannot be generated independently, and it is necessary to rely on the basic intra prediction mode to identify a prediction block. For example, a prediction block can be identified or generated based on a reference sample using a certain angular prediction mode, but in MIPF, a prediction block can be generated or identified using different filters for samples at different positions based on this angular prediction mode.
[0117] In one embodiment, the at least two intra prediction modes of the second component are both basic intra prediction modes. That is, two different basic intra prediction modes, such as a first intra prediction mode and a second intra prediction mode, are used in the second component of the present application. Optionally, an improved intra prediction mode can be combined with each of the first intra prediction mode and the second intra prediction mode. Optionally, after using the at least two basic intra prediction modes to obtain a final prediction block of the second component, the improved intra prediction mode can be further used to improve the final prediction block and obtain an updated final prediction block.
[0118] In one embodiment, the at least two intra prediction modes of 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 of the second component are a first intra prediction mode and a second intra prediction mode. The first intra prediction mode is an angular intra prediction mode, and the second intra prediction mode is an improved intra prediction mode, such as IPF. Optionally, the first intra prediction mode and the second intra prediction mode are based on the same angular prediction mode, but the first intra prediction mode is one selection of an improved intra prediction mode, and the second intra prediction mode is another selection of the improved intra prediction mode. Optionally, after obtaining the final prediction block of the second component using the first intra prediction mode and the second intra prediction mode, the improved intra prediction mode can be further used to improve the final prediction block and obtain an updated final prediction block.
[0119] In one embodiment, the at least two intra prediction modes of the second component are a combination of refinement intra prediction modes.
[0120] S404: Identify an intra-prediction mode of a first component of a current block based on at least two intra-prediction modes of a second component.
[0121] S405: Intra prediction mode of the first component of the current block , and performing intra prediction on the first component of the current block using the vector 1, to obtain a final predicted block of the first component of the current block.
[0122] In some embodiments of the present application, Intra prediction mode of the first component of the current block The at least two intra-prediction modes of the second component are included in the current block. In this case, the at least two intra-prediction modes of the first component of the current block are calculated based on the at least two intra-prediction modes of the second component. stomach The above S404 for identifying the intra-prediction mode includes, but is not limited to, several methods as follows.
[0123] In the method 1, at least two intra prediction modes of the second component are: Intra prediction mode of the first component of the current block For example, when the at least two types of intra prediction modes of the second component include a first intra prediction mode and a second intra prediction mode, the first intra prediction mode and the second intra prediction mode are defined as Intra prediction mode of the first component of the current block Let us assume that.
[0124] In the second method, based on at least two intra prediction modes of the second component, Intra prediction mode of the first component of the current blockFor example, compared with the angle used for the second component, the angle used for the first component has a larger gap, that is, the same intra prediction mode of the first component can be derived using some intra prediction modes of the second component. For example, the horizontal mode of the first component can be derived using a near-horizontal mode of the second component (e.g., an intra prediction mode corresponding to mode number 11 in AVS3). Based on this, at least two intra prediction modes of the first component of the current block can be derived based on at least two intra prediction modes of the second component. For example, a third intra prediction mode of the first component of the current block is derived from the first intra prediction mode of the second component, and a fourth intra prediction mode of the first component of the current block is derived from the second intra prediction mode of the second component.
[0125] Intra prediction mode of the first component of the current block If includes at least two intra prediction modes, the above S405 includes the following content:
[0126] S405-A1: Obtain prediction blocks corresponding to the various intra prediction modes by performing intra prediction on the first component of the current block using each of at least two intra prediction modes of the first component of the current block.
[0127] S405-A2: Obtain a final predicted block of a first component of a current block according to predicted blocks corresponding to various intra-prediction modes.
[0128] For example, the at least two intra prediction modes of the first component of the current block include two intra prediction modes, such as a first intra prediction mode and a second intra prediction mode.
[0129] In one embodiment, a first intra prediction mode is used to perform intra prediction on a first component of a current block to obtain a first predicted block of the first component of the current block, and a second intra prediction mode is used to perform intra prediction on the first component of the current block to obtain a second predicted block of the first component of the current block. The first predicted block and the second predicted block are calculated according to a preset calculation rule to obtain a final predicted block of the first component of the current block. For example, according to a 1:1 ratio, that is, the average value of the first predicted block and the second predicted block is taken as the final predicted block of the first component of the current block.
[0130] In one embodiment, for each sample in the first component, the first intra prediction mode is used to predict the sample to obtain a first predicted value of the sample in the first component, and the second intra prediction mode is used to predict the sample to obtain a second predicted value of the sample in the first component. The first predicted value and the second predicted value are calculated according to a preset calculation rule to obtain a final predicted value of the sample in the first component. For example, the average value of the first predicted value and the second predicted value is the final predicted value of the sample in the first component. In a similar manner, the final predicted value of each sample in the first component can be obtained, and the final predicted block of the first component of the current block can be formed.
[0131] In one embodiment, the S405-A2 includes S405-A21 and S405-A22.
[0132] S405-A21: Identify a first weighting matrix.
[0133] S405-A22: Obtain a final predicted block of the first component of the current block by performing a weighting operation on the predicted blocks corresponding to different intra-prediction modes according to the first weighting matrix.
[0134] In this embodiment, a first weighting matrix is determined, and a weighting operation is performed on the prediction block corresponding to various intra prediction modes according to the first weighting matrix to obtain a final prediction block of the first component of the current block. For example, the at least two intra prediction modes of the first component of the current block are a first intra prediction mode and a second intra prediction mode. The first intra prediction mode is used to perform intra prediction on the first component of the current block to obtain a first prediction block, and the second intra prediction mode is used to perform intra prediction on the first component of the current block to obtain a second prediction block. For each sample in the first component, a first prediction value of the sample in the first prediction block, a second prediction value of the sample in the second prediction block, and a weight value of the sample in the first weighting matrix are obtained, and the weight value is used to perform a weighting operation on the first prediction value and the second prediction value to obtain a final prediction value of the sample. In a similar manner, the final prediction value of each sample in the first component can be obtained, and the final prediction block of the first component of the current block can be obtained.
[0135] In one possible embodiment, each weight value in the first weighting matrix is a preset value, for example, all of the weight values are 1, which indicates that the weight values corresponding to various intra prediction modes are all 1.
[0136] In one possible embodiment, the first weighting matrix is derived based on a weighting matrix derivation mode. The weighting matrix derivation mode can be understood as a mode for deriving a weighting matrix, and various weighting matrix derivation modes include a predetermined heightand a weighting matrix of a block having a width is derived. Different weighting matrix derivation modes can derive different weighting matrices of blocks having the same size. For example, there are 56 weighting matrix derivation modes in the AWP of AVS3, and 64 weighting matrix derivation modes in the GPM of VVC. In this example, the process of deriving the first weighting matrix and the process of deriving the second weighting matrix based on the weighting matrix derivation mode are almost the same. For example, the second weighting matrix is a luminance component, and the process of deriving the second weighting matrix of the luminance component can refer to the description of S905 below, and the description will be omitted. Note that, when deriving the first weighting matrix with reference to the method in S905, the related parameters in S905 can be modified based on the coding information of the first component, and the first weighting matrix can be further derived.
[0137] In one possible embodiment, the first weighting matrix is derived from the weighting matrix of the second component (i.e., the second weighting matrix). In this case, the above S405-A21 includes the following:
[0138] S405-A211: Obtain a second weighting matrix of a second component corresponding to the current block.
[0139] S405-A212: Obtain a first weighting matrix based on the second weighting matrix.
[0140] In one example, the second weighting matrix includes at least two different weight values, for example, when the minimum weight value is 0 and the maximum weight value is 8, in the second weighting matrix, some samples have weight values of 0, some samples have weight values of 8, and some samples have weight values between 0 and 8, for example, 2.
[0141] In one example, all weight values in the second weight matrix are the same, for example, if the minimum weight value is 0 and the maximum weight value is 8, the weight values of all samples in the second weight matrix are between the minimum weight value and the maximum weight value, for example, 4.
[0142] In one example, the predicted value of a sample corresponding to each weight value in the second weighting matrix in the second component is obtained by performing prediction in at least two intra prediction modes of the second component. For example, two intra prediction modes are used in the second component. A minimum weight value and a maximum weight value limit are set for the second weighting matrix, for example, the minimum weight value is set to 0, the maximum weight value is set to 8, and nine levels from 0 to 8 are set. 0 indicates that the predicted value of a sample in the second component corresponding to the current block is obtained completely from a predicted value derived from one intra prediction mode, and 8 indicates that the predicted value of a sample in the second component corresponding to the current block is obtained completely from a predicted value derived from another intra prediction mode. Each weight value in the second weighting matrix is greater than 0 and less than 8, for example, the minimum weight value in the second weighting matrix is set to 1, and the maximum weight value is set to 7. Optionally, the second weighting matrix includes at least two different weight values.
[0143] In one example, the at least two intra prediction modes of the second component include N intra prediction modes, where N is a positive integer equal to or greater than 2. The second weighting matrix includes N different weight values, where the i-th weight value indicates that the predicted value of the sample corresponding to the i-th weight value in the second component is obtained entirely in the i-th intra prediction mode, where i is a positive integer equal to or greater than 2 and equal to or less than N. For example, assuming that N is 2, that is, two intra prediction modes are used to perform prediction for the second component, and the two intra prediction modes are a first intra prediction mode and a second intra prediction mode, the second weighting matrix includes two weight values, where one weight value indicates that the predicted value of the corresponding sample in the second component is obtained entirely by performing prediction in the first intra prediction mode, and the other weight value indicates that the predicted value of the corresponding sample in the second component is obtained entirely by performing prediction in the second intra prediction mode. Optionally, the two weight values are 0 and 1, respectively.
[0144] In one example, the at least two intra prediction modes of the second component include a first intra prediction mode and a second intra prediction mode. The second weighting 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 is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode. The minimum weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the second intra prediction mode. The intermediate weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode and the second intra prediction mode. Optionally, the region formed by the maximum weight value or the minimum weight value can be referred to as a transition region.
[0145] In one example, the second weighting matrix includes multiple weight values, and the positions where the weight values change form a straight line or a curve. For example, if the second weighting matrix includes only two weight values, the positions where the weight values change form a straight line or a curve. Or, if the second weighting matrix includes three or more weight values, the positions where the weight values are the same in the transition region form a straight line or a curve. Optionally, the formed straight lines are all horizontal straight lines or vertical straight lines, and optionally, the formed straight lines are not all horizontal straight lines or vertical straight lines.
[0146] In one example, the second weighting matrix is a weighting matrix corresponding to the AWP mode or the GPM mode. That is, when one of GPM or AWP is used in a video encoding / decoding standard or an encoder / decoder to which the solution of the present application is applied, the second weighting matrix may be determined in the present application based on a logic similar to that for determining the weighting matrix of GPM or AWP. For example, when AWP is used for inter prediction in AVS3 and the solution of the present application is applied to AVS3, the second weighting matrix may be determined in the present application using a method similar to that for determining the weighting matrix of AWP. Optionally, the weighting matrix of AWP may be reused in the present application. For example, assuming that there are 56 weighting matrices for AWP and 64 weighting matrices are used for intra prediction in the present application, 56 of these 64 weighting matrices are the same as the weighting matrix of AWP. For example, the first 56 are the same as the weighting matrix of AWP, and each of the remaining 8 weighting matrices has only one weight value, which is 1, 2, ...., 7, 8. For these 8 weighting matrices, the total weight value is 16, that is, a weight value of 1 indicates a weight of 1:15, and a weight value of 2 indicates a weight of 2:14. In this way, a 6-bit codeword can be used to binarize the mode numbers of the 64 weighting matrices. Based on this, the second weighting matrix of the embodiment of the present application may be a weighting matrix corresponding to the AWP mode. Optionally, when the present application is applied to AVS3 and GPM is used for inter prediction in AVS3, the weighting matrix of GPM can be reused in the embodiment of the present application. In this case, the second weighting matrix may be a weighting matrix corresponding to GPM.
[0147] In addition, since intra prediction utilizes the correlation in the spatial domain, the reconstructed samples around the current block are used as reference samples. In the spatial domain, the closer the distance, the stronger the correlation, and the farther the distance, the worse the correlation. Therefore, when the weighting matrix corresponding to the GPM mode or the weighting matrix corresponding to the AWP mode is reused, if the use of a certain weighting matrix for one prediction block makes the sample position of the prediction block farther away from the reference sample, the weighting matrix may not be used in the present application.
[0148] In addition, the second weighting matrix may be obtained by other methods in addition to the above method, and the embodiment of the present application is not limited thereto.
[0149] After obtaining the second weighting matrix, execute the above S405-A212 of obtaining the first weighting matrix based on the second weighting matrix. In this application, the manner of obtaining the first weighting matrix based on the second weighting matrix includes, but is not limited to, the following several:
[0150] In method 1, if the total number of samples included in the second component corresponding to the current block is the same as the total number of samples included in the first component of the current block, the second weighting matrix is taken as the first weighting matrix.
[0151] In the second method, when the total number of samples included in the first component of the current block is less than the total number of samples included in the second component corresponding to the current block, the first weighting matrix is obtained by downsampling the second weighting matrix. For example, the first weighting matrix is obtained by downsampling the second weighting matrix according to the total number of samples included in the first component of the current block and the total number of samples included in the second component corresponding to the current block.
[0152] After obtaining the first weighting matrix through the above method, execute S405-A22 to obtain the final predicted block of the first component of the current block by performing weighting operations on the predicted blocks corresponding to various intra-prediction modes based on the first weighting matrix.
[0153] In one example, assuming that the first intra prediction mode and the second intra prediction mode are used for the first component of the current block, the final prediction block of the first component of the current block is obtained according to the following Equation 1:
number
[0154] In one embodiment, the first component includes a first subcomponent and a second subcomponent.
[0155] For the first sub-component, the above step S405-A1 includes: Obtain a predicted block corresponding to each intra prediction mode of the first sub-component of the current block by using at least two intra prediction modes of the first component of the current block to perform intra prediction on the first sub-component of the current block. Accordingly, the above step S405-A22 includes: Obtain a final predicted block of the first sub-component of the current block by performing a weighting operation on the predicted block corresponding to each intra prediction mode of the first sub-component of the current block according to a first weighting matrix.
[0156] For example, a first predicted block of the first subcomponent of the current block is obtained by performing intra prediction on the first subcomponent of the current block using a first intra prediction mode, a second predicted block of the first subcomponent of the current block is obtained by performing intra prediction on the first subcomponent of the current block using a second intra prediction mode, and then a weighting operation is performed on the first predicted block and the second predicted block of the first subcomponent of the current block based on a first weighting matrix to obtain a final predicted block of the first subcomponent of the current block.
[0157] In a specific example, the final predicted block of the first sub-component of the current block is obtained according to Equation 2 below:
number
[0158] For the second sub-component, the above step S405-A1 includes: Obtain a predicted block corresponding to each intra prediction mode of the second sub-component of the current block by using at least two intra prediction modes of the first component of the current block to perform intra prediction on the second sub-component of the current block. Accordingly, the above step S405-A22 includes: Obtain a final predicted block of the second sub-component of the current block by performing a weighting operation on the predicted block corresponding to each intra prediction mode of the second sub-component of the current block according to the first weighting matrix.
[0159] For example, a first predicted block of the second subcomponent of the current block is obtained by performing intra prediction on the second subcomponent of the current block using a first intra prediction mode, a second predicted block of the second subcomponent of the current block is obtained by performing intra prediction on the second subcomponent of the current block using a second intra prediction mode, and then a weighting operation is performed on the first predicted block and the second predicted block of the second subcomponent of the current block based on a first weighting matrix to obtain a final predicted block of the second subcomponent of the current block.
[0160] In a specific example, the final predicted block of the second sub-component of the current block is obtained according to Equation 3 below:
number
[0161] In the present application, when at least two intra prediction modes are used for predicting the second component corresponding to the current block, and the initial intra prediction mode of the first component of the current block is determined to be a derived mode, the method described in the above embodiment is used to obtain at least two intra prediction modes of the first component of the current block based on the at least two intra prediction modes of the second component, and perform intra prediction on the first component of the current block using the at least two intra prediction modes of the first component of the current block. This not only makes it possible to easily and efficiently determine the intra prediction mode of the first component of the current block, but also realizes accurate prediction of complex textures, and further improves the efficiency of video encoding. In addition, in the present application, since the at least two intra prediction modes of the first component of the current block are derived from the at least two intra prediction modes of the second component, it is not necessary to carry mode information of the at least two intra prediction modes of the first component of the current block in the subsequent bitstream, and overhead can be reduced.
[0162] In the present application, at least two intra-prediction modes are used to generate at least two prediction blocks, and then weighting is performed on at least two prediction blocks according to a weighting matrix to obtain a final prediction block.Compared with the traditional method of generating one prediction block according to one intra-prediction mode, the above-mentioned complexity is increased.In order to reduce the impact of the complexity on the whole system, at the same time, taking into account the balance between compression performance and complexity, a restriction can be set that the present application is not applicable to blocks with some specific sizes, that is, the size of the current block of the present application meets a preset condition.
[0163] The preset conditions include any one or more of the following:
[0164] Condition 1: The width of the current block is equal to or greater than a first preset width TH1, and the height of the current block is equal to or greater than a first preset height TH2. For example, TH1 and TH2 may be 8, 16, 32, etc. Alternatively, TH1 may be equal to TH2. For example, the height of the current block is set to be equal to or greater than 8, and the width of the current block is set to be equal to or greater than 8.
[0165] Condition 2: The number of samples in the current block is equal to or greater than a first preset number TH3, where the value of TH3 can be 8, 16, 32, etc.
[0166] Condition 3: The width of the current block is less than or equal to a second preset width TH4, and the height of the current block is greater than or equal to a second preset height TH5. The values of TH4 and TH5 may be 8, 16, 32, etc., and TH4 may be equal to TH5.
[0167] Condition 4: For the width of the current block height The ratio is the first preset ratio. For example, the first preset ratio is one of 1:1, 1:2, 2:1, 4:1, and 1:4.
[0168] Condition 5: The size of the current block is the second preset value is For example, the second preset value may be any one of 16×32, 32×32, 16×64, and 64×16.
[0169] Condition 6: the height of the current block is equal to or greater than the third preset height, the width of the current block is equal to or greater than the third preset width, the ratio of the width to the height of the current block is equal to or less than the third preset value, and the ratio of the height to the width of the current block is equal to or less than the third preset value. For example, the height of the current block is equal to or greater than 8, the width is equal to or greater than 8, the ratio of the height to the width is equal to or less than 4, and the ratio of the width to the height is equal to or less than 4.
[0170] The method of the embodiment of the present application has a remarkable prediction effect when performing prediction on a square block or a nearly square block, for example, a 1:1 or 1:2 block, but the prediction effect is not so great ... height The prediction effect is not significant when predicting elongated blocks with a ratio of 16:1 or 32:1. Therefore, in order to reduce the impact of complexity on the entire system, and at the same time, taking into account the balance between compression performance and complexity, this application mainly performs intra prediction on square blocks or nearly square blocks that meet the above-mentioned preset conditions.
[0171] In some embodiments of the present application, the first component of the current block stomach The intra prediction mode may include one kind of intra prediction mode, in which case, S404 may include, but is not limited to, the following several ways:
[0172] In the method 1, one of the at least two intra prediction modes of the second component is Intra prediction mode of the first component of the current block For example, when a first intra prediction mode and a second intra prediction mode are used for the second component, the first intra prediction mode is always set as Intra prediction mode of the first component of the current block or the second intra prediction mode is always Intra prediction mode of the first component of the current block Let us assume that.
[0173] In the second method, an intra prediction mode is derived based on at least two intra prediction modes of the second component, and the derived intra prediction mode is Intra prediction mode of the first component of the current block For example, compared to the angles used for the second component, the angles used for the first component have a larger gap, i.e., the same chroma intra prediction mode may be derived from several different luma intra prediction modes.
[0174] In the third method, based on the intra prediction mode of the second component corresponding to the first sample position of the current block, Intra prediction mode of the first component of the current blockThe first sample position is, for example, the position of a sample in the bottom right corner or in the middle of the current block.
[0175] One possibility for method 3 is to predict the second component corresponding to the first sample position. value is obtained by performing prediction entirely in one intra prediction mode, the one intra prediction mode is Intra prediction mode of the first component of the current block Let us assume that.
[0176] One possibility for method 3 is to predict the second component corresponding to the first sample position. value When the vector is obtained by performing prediction in a plurality of intra prediction modes, the intra prediction mode with the largest weight value among the plurality of intra prediction modes is selected. , the intra prediction mode of the first component of the current block Let us assume that.
[0177] As one possibility of the method 3, the intra prediction mode of the second component stored in the smallest unit corresponding to the first sample position is Intra prediction mode of the first component of the current block Prediction of the second component corresponding to the first sample position value is obtained by performing prediction in one intra prediction mode, the mode information of the one intra prediction mode is stored in the smallest unit. value is obtained by performing prediction in a plurality of intra prediction modes, mode information of the intra prediction mode with the largest weighting value among the plurality of intra prediction modes is stored in the smallest unit.
[0178] That is, in the intra prediction of the present application, information such as an intra prediction mode can be stored so as to be referenced by a subsequent encoding / decoding block. Based on the adjacent positional relationship, the intra prediction mode of a previously encoded / decoded block (e.g., an adjacent block) can be used for a subsequent encoding / decoding block of the current image. Based on the position, the intra prediction mode of a previously encoded / decoded luminance block (encoding unit) can be used for a chroma block (encoding unit). The stored information is for reference by a subsequent encoding / decoding block. The encoding mode information in the same block (encoding unit) can be directly obtained, but the encoding mode information in a different block (encoding unit) cannot be directly obtained and therefore needs to be stored. The information is read for a subsequent encoding / decoding block based on the position. The method of storing the intra prediction mode used for each block of the current image is that a fixed size matrix such as a 4×4 matrix is used as the minimum unit, and one type of intra prediction mode is stored independently in each minimum unit. In this way, each time a block is coded or decoded, the smallest units corresponding to the position of the block can store the intra prediction mode of the block. As shown in Fig. 11B, when intra prediction mode 5 is used for one 16x16 block, the intra prediction modes stored in all 4x4 smallest units corresponding to the block are all intra prediction mode 5. In the YUV format, generally, only the luma intra prediction mode is stored.
[0179] For example, when the at least two intra prediction modes of the second component include a first intra prediction mode and a second intra prediction mode, the intra prediction modes may be stored in the smallest unit in the following manner.
[0180] In one method, some of the minimum units store the first intra prediction mode, and some of the minimum units store the second intra prediction mode. A specific implementation method is similar to GPM or AWP. When one of GPM or AWP is used in a video encoding / decoding standard or an encoder / decoder to which the technology of the present application is applied, the present application can use logic similar to GPM or AWP, or reuse part of the same logic. For example, when AWP is used for inter prediction in AVS3, two different intra prediction modes of the second component can be stored in AVS3 using logic similar to that storing two different motion information for AWP. That is, when a prediction block is identified using only the first intra prediction mode at a position corresponding to one minimum unit, the minimum unit stores the first intra prediction mode. When a prediction block is identified using only the second intra prediction mode at a position corresponding to one minimum unit, the minimum unit stores the second intra prediction mode. At a position corresponding to one smallest unit, when a prediction block is identified using both a first intra prediction mode and a second intra prediction mode, one of them is stored according to a certain determination method, for example, the one with the greater weight between the first intra prediction mode and the second intra prediction mode is selected and stored.
[0181] In another method, all the smallest units corresponding to the entire current block select and store only the same intra prediction mode. For example, it is determined whether all the smallest units of the current block store the first intra prediction mode or the second intra prediction mode according to the derivation mode of the second weighting matrix. Assume that the derivation mode of the second weighting matrix of the present application is the same as the weighting matrix derivation mode of the AWP, which includes 56 weighting matrix derivation modes (see FIG. 4B in detail). As shown in Table 3 below, if the mode number of the derivation mode of the second weighting matrix corresponds to 0, all the smallest units of the current block store the first intra prediction mode, and if the mode number of the matrix derivation mode corresponds to 1, all the smallest units of the current block store the second intra prediction mode.
[0182] [Table 3]
[0183] Based on the above description, in the present application, the intra prediction mode of the second component is stored in the corresponding smallest unit based on the position. In this way, when identifying the intra prediction mode of the first component of the current block, the intra prediction mode of the second component stored in the smallest unit corresponding to the first sample position can be the intra prediction mode of the first component of the current block.
[0184] In some embodiments, when the current block of the present application does not include the second component and only includes the first component, for example, does not include the luma component and only includes the chroma component (i.e., the current block of the present application is a chroma block), the intra prediction mode of the first component of the current block can be determined in the following manner. For example, the intra prediction mode of the first component of the current block is determined based on an existing manner. For example, the intra prediction mode of the second component is found based on a position, and the found intra prediction mode of the second component is the intra prediction mode of the first component of the current block. The intra prediction mode of the first component of the current block includes one kind of intra prediction mode.
[0185] 14 is another flowchart showing a video encoding method 500 according to an embodiment of the present application. In the embodiment of the present application, at least two intra prediction modes are used for the first component as an example. As shown in FIG. 14, the method includes the following contents:
[0186] S501: Obtain a current block including a first component and a second component. For example, obtain a target image, and divide the target image into blocks to obtain a current block. Optionally, the current block includes the second component.
[0187] S502: Identifying at least two intra prediction modes and a second weighting matrix of a second component corresponding to the current block.
[0188] At the encoding side, when identifying the at least two intra prediction modes and the second weighting matrix of the second component corresponding to the current block, the encoder tries to combine all or some different intra prediction modes with different weighting matrices, and based on the encoding cost of each combination, the encoder sets the at least two intra prediction modes corresponding to the combination with the smallest encoding cost as the at least two intra prediction modes of the second component corresponding to the current block, and sets the weighting matrix corresponding to the combination as the second weighting matrix.
[0189] For example, the at least two intra prediction modes of the second component corresponding to the current block include a first intra prediction mode and a second intra prediction mode. The above all possible combinations 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 weighting matrix derivation mode. In this application, it is assumed that there are 66 total available intra prediction modes, there are 66 first intra prediction modes, and there are 65 second intra prediction modes because the second intra prediction mode is different from the first intra prediction mode. It is assumed that there are 56 weighting matrix derivation modes (AWP is taken as an example), and any two different intra prediction modes can be combined with any weighting matrix derivation mode, and there are a total of 66×65×56 possible combinations.
[0190] In one possible scheme, a rate distortion optimization (RDO) is performed on all possible combinations to identify one combination with the smallest cost, two intra prediction modes corresponding to the combination are identified as a first intra prediction mode and a second intra prediction mode, and a weighting matrix corresponding to the combination is identified as a second weighting matrix.
[0191] In another possible manner, a first selection is made for all the possible combinations, and a preset number of candidate combinations of the first intra prediction mode, the second intra prediction mode, and the weighting matrix derivation mode are identified by making the first selection using an approximate cost such as sum of absolute difference (SAD) or sum of absolute transformed difference (SATD). Then, a refinement is made in the RDO to identify a combination of the first intra prediction mode, the second intra prediction mode, and the weighting matrix derivation mode with the smallest cost. Some fast algorithms can be used for the first selection to reduce the number of attempts. For example, if one intra angular prediction mode causes a high cost, multiple intra prediction modes adjacent to the intra angular prediction mode are not tried.
[0192] During the initial selection and refinement, a first prediction block is identified based on a first intra prediction mode, a second prediction block is identified based on a second intra prediction mode, and a weighting matrix is derived based on a weighting matrix derivation mode. A final prediction block is identified based on the first prediction block, the second prediction block, and the weighting matrix. During the initial selection using SAD and SATD, the current block and the prediction block are used to identify the SAD and SATD.
[0193] Alternatively, the encoder may first analyze the texture of the current block, for example using gradients, and the analyzed data may be useful for the initial selection. For example, if the texture of the current block is strong in a certain direction, then intra prediction modes in a direction close to that direction may be selected more frequently during the initial selection. If the texture of the current block is weak in a certain direction, then intra prediction modes in a direction close to that direction may be selected less frequently or not at all during the initial selection.
[0194] The coding cost includes the cost of codewords occupied in the bitstream by the first intra prediction mode, the second intra prediction mode, and the weighting matrix derivation mode, the cost of various flags and quantization coefficients transmitted in the bitstream for transforming, quantizing, entropy coding, etc. of prediction residuals, the cost of distortion of reconstructed blocks, etc.
[0195] Furthermore, the encoder writes information on the identified first intra prediction mode, second intra prediction mode, and second weighting matrix derivation mode of the second component corresponding to the current block into a bitstream based on a syntax.
[0196] S503: Using at least two intra prediction modes of the second component corresponding to the current block, perform intra prediction on the second component corresponding to the current block to obtain a predicted block corresponding to various intra prediction modes of the second component corresponding to the current block.
[0197] S504: Obtain a final predicted block of the second component corresponding to the current block by performing weighting on the predicted blocks corresponding to various intra-prediction modes of the second component corresponding to the current block based on the second weighting matrix.
[0198] S505: Identify an initial intra-prediction mode of a first component of the current block.
[0199] S506: When determining that the initial intra prediction mode of the first component of the current block is a derived mode, obtain at least two intra prediction modes of the second component corresponding to the current block.
[0200] S507: Determine at least two intra prediction modes of the first component of the current block according to at least two intra prediction modes of the second component corresponding to the current block. For example, directly set the at least two intra prediction modes of the second component corresponding to the current block as the at least two intra prediction modes of the first component of the current block.
[0201] S508: Obtain a first weighting matrix based on the second weighting matrix. For example, if the total number of samples included in the second component corresponding to the current block is the same as the total number of samples included in the first component of the current block, the second weighting matrix is taken as the first weighting matrix. If the total number of samples included in the first component of the current block is less than the total number of samples included in the second component corresponding to the current block, obtain the first weighting matrix by downsampling the second weighting matrix. Or, derive the first weighting matrix based on a weighting matrix derivation mode.
[0202] It should be noted that the operation in S507 and the operation in S508 may be executed in any order.
[0203] S509: Using at least two intra prediction modes of the first component of the current block, perform intra prediction on the first component of the current block to obtain a predicted block corresponding to the various intra prediction modes of the first component of the current block.
[0204] S510: Obtain a final predicted block of the first component of the current block by performing weighting on the predicted blocks corresponding to various intra-prediction modes of the first component of the current block according to a first weighting matrix.
[0205] S511: Generate a bitstream, the bitstream including a weighted prediction flag, the weighted prediction flag being used to indicate whether a prediction block of a second component is obtained by performing prediction in at least two intra prediction modes.
[0206] Optionally, the bitstream further carries mode information of at least two intra-prediction modes of the second component corresponding to the current block.
[0207] Optionally, the bitstream further carries mode information of a derivation mode of the second weighting matrix.
[0208] Optionally, the bitstream carries mode information of the derivation mode of the first component of the current block.
[0209] Optionally, when the first weighting matrix is specified based on a weighting matrix derivation mode, mode information of the derivation mode of the first weighting matrix may be carried in the bitstream.
[0210] In some embodiments, when at least two intra-prediction modes are identified to be used for predicting a second component corresponding to a current block, an initial intra-prediction mode of a first component of the current block is identified to be a derived mode, such as a DM mode, in which case, when the intra-prediction mode of the first component of the current block is identified to be a derived mode, no mode information of the derived mode is carried in the bitstream.
[0211] After obtaining the final prediction block of the current block, the encoder performs subsequent processing, including decoding the quantized coefficients, identifying a residual block by inverse transform and inverse quantization, combining the residual block with the prediction block to obtain a reconstructed block, and subsequent loop filtering.
[0212] In this application, both the first component and the second component can be predicted with at least two intra prediction modes, so that more complex prediction blocks can be obtained, and the quality of intra prediction can be improved to improve compression performance.Compared with the prior art, it enables prediction of complex textures, and utilizes the correlation between channels to reduce the transmission of mode information in the bitstream, effectively improving coding efficiency.
[0213] Figure 15 is another flowchart illustrating a video encoding method 600 according to an embodiment of the present application. In the embodiment of the present application, for example, the first component is a chroma component, the second component is a luma component, and the at least two intra prediction modes of the luma component of the current block include a first intra prediction mode and a second intra prediction mode, and two intra prediction modes are used for the chroma component. As shown in Figure 15, the method includes the following contents:
[0214] S601: Obtain a current block including a chroma component and a luma component.
[0215] S602: Identify a first intra prediction mode and a second intra prediction mode of a luma component of the current block, and identify a second weighting matrix.
[0216] S603: Obtain a first predicted block of the luma component of the current block by performing intra prediction on the luma component of the current block using a first intra prediction mode, and obtain a second predicted block of the luma component of the current block by performing intra prediction on the luma component of the current block using a second intra prediction mode.
[0217] S604: Obtain a final prediction block of the luminance component of the current block by performing a weighting operation on the first prediction block and the second prediction block of the luminance component of the current block based on the second weighting matrix.
[0218] S605: Identify an initial intra prediction mode for the chroma component of the current block.
[0219] S606: If it is determined that the initial intra prediction mode of the chroma component of the current block is a derived mode, obtain the first intra prediction mode and the second intra prediction mode of the luma component of the current block.
[0220] S607: Identify the first and second intra prediction modes of the luma component of the current block as the first and second intra prediction modes of the chroma component of the current block.
[0221] S608: Obtain a first weighting matrix of the chrominance component of the current block according to the second weighting matrix of the luminance component of the current block.
[0222] S609: Obtain a first predicted block of the chroma component of the current block by performing intra prediction on the chroma component of the current block using a first intra prediction mode, and obtain a second predicted block of the chroma component of the current block by performing intra prediction on the chroma component of the current block using a second intra prediction mode.
[0223] S610: Obtain a final prediction block of the chroma component of the current block by performing a weighting operation on the first prediction block and the second prediction block of the chroma component of the current block based on a first weighting matrix.
[0224] S611: Generate a bitstream, the bitstream including a weighted prediction flag, which is used to indicate whether a prediction block of a luminance component of a current block is obtained by performing prediction in at least two intra prediction modes.
[0225] Optionally, the bitstream further carries mode information of at least two intra-prediction modes of the luma component of the current block.
[0226] Optionally, the bitstream carries mode information of the derivation mode of the chroma components of the current block.
[0227] In some embodiments, if at least two intra prediction modes are identified for use in predicting the luma component of the current block, then the intra prediction mode of the chroma component of the current block is identified as the derived mode.
[0228] In this case, if the intra prediction mode of the chroma component of the current block is specified as a derived mode, mode information of the derived mode is not carried in the bitstream.
[0229] After obtaining the final prediction block of the current block, the encoder performs subsequent processing, including decoding the quantized coefficients, identifying a residual block by inverse transform and inverse quantization, combining the residual block with the prediction block to obtain a reconstructed block, and subsequent loop filtering.
[0230] Based on the above description of the video encoding method according to the embodiment of the present application, the video decoding method on the decoding side according to the present application will be described below.
[0231] 16 is a flowchart illustrating a video decoding method 700 according to an embodiment of the present application. As shown in FIG. 16, the method according to an embodiment of the present application includes the following contents:
[0232] S701: By parsing a bitstream, obtain at least two intra prediction modes of a current block including a first component and a second component corresponding to the current block.
[0233] Since the bitstream of the present application carries mode information of at least two intra prediction modes used during intra prediction of the second component corresponding to the current block, by analyzing the bitstream, it is possible to obtain mode information of at least two intra prediction modes of the second component corresponding to the current block, and further to obtain at least two intra prediction modes used during intra prediction of the second component corresponding to the current block.
[0234] In some embodiments, the size of the current block of the application satisfies a preset condition.
[0235] The preset conditions include any one of the following:
[0236] Condition 1: The width of the current block is equal to or greater than a first preset width TH1, and the height of the current block is equal to or greater than a first preset height TH2. For example, TH1 and TH2 may be 8, 16, 32, etc. Alternatively, TH1 may be equal to TH2. For example, the height of the current block is set to be equal to or greater than 8, and the width of the current block is set to be equal to or greater than 8.
[0237] Condition 2: The number of samples in the current block is equal to or greater than a first preset number TH3, where the value of TH3 can be 8, 16, 32, etc.
[0238] Condition 3: The width of the current block is less than or equal to a second preset width TH4, and the height of the current block is greater than or equal to a second preset height TH5. The values of TH4 and TH5 may be 8, 16, 32, etc., and TH4 may be equal to TH5.
[0239] Condition 4: For the width of the current block height The ratio is the first preset ratio. For example, the first preset ratio is any one of 1:1, 1:2, 2:1, 4:1, and 1:4.
[0240] Condition 5: The size of the current block is the second preset size. value For example, the second preset value is one of 16×32, 32×32, 16×64, and 64×16.
[0241] Condition 6: the height of the current block is equal to or greater than the third preset height, the width of the current block is equal to or greater than the third preset width, the ratio of the width to the height of the current block is equal to or less than the third preset value, and the ratio of the height to the width of the current block is equal to or less than the third preset value. For example, the height of the current block is equal to or greater than 8, the width is equal to or greater than 8, the ratio of the height to the width is equal to or less than 4, and the ratio of the width to the height is equal to or less than 4.
[0242] S702: Identify an initial intra-prediction mode of a first component of a current block.
[0243] Specifically, if the initial intra prediction mode of the first component of the current block carried in the bitstream is not a derived mode, intra prediction is performed on the first component of the current block using the initial intra prediction mode carried in the bitstream. If the initial intra prediction mode of the first component of the current block carried in the bitstream is a derived mode, S703 is executed. If mode information of the initial intra prediction mode of the first component of the current block is not carried in the bitstream, it defaults to the initial intra prediction mode of the first component of the current block being a derived mode, and S703 is executed.
[0244] S703: If the initial intra-prediction mode is a derived mode, determine an intra-prediction mode of a first component of the current block based on at least two intra-prediction modes of a second component corresponding to the current block.
[0245] In some embodiments, the intra prediction mode of the first component of the current block includes at least two intra prediction modes. In this case, the above S703 includes, but is not limited to, some of the following:
[0246] In the first manner, at least two intra prediction modes of the second component are the intra prediction modes of the first component of the current block.
[0247] In Manner 2, the intra prediction mode of the first component of the current block is derived based on at least two intra prediction modes of the second component.
[0248] In some embodiments, the intra prediction mode of the first component of the current block may include one intra prediction mode. In this case, the above S404 includes, but is not limited to, the following several ways:
[0249] In the first method, one of at least two intra prediction modes of the second component is set as the intra prediction mode of the first component of the current block. For example, when a first intra prediction mode and a second intra prediction mode are used for the second component, the first intra prediction mode is always set as the intra prediction mode of the first component of the current block, or the second intra prediction mode is always set as the intra prediction mode of the first component of the current block.
[0250] In the second method, an intra prediction mode is derived according to at least two intra prediction modes of the second component, and the derived intra prediction mode is the intra prediction mode of the first component of the current block. For example, compared with the angle used for the second component, the angle used for the first component has a larger gap, that is, the same chroma intra prediction mode may be derived from several different luma intra prediction modes.
[0251] In Manner 3, the intra prediction mode of the first component of the current block is determined based on the intra prediction mode of the second component corresponding to the first sample position of the current block.
[0252] One possibility for method 3 is to predict the second component corresponding to the first sample position. value is obtained by performing prediction completely in one intra prediction mode, the one intra prediction mode is the intra prediction mode of the first component of the current block.
[0253] One possibility for method 3 is to predict the second component corresponding to the first sample position. value is obtained by performing prediction in a plurality of intra prediction modes, the intra prediction mode with the largest weight value among the plurality of intra prediction modes is determined as the intra prediction mode of the first component of the current block.
[0254] As one possibility of the third method, the intra prediction mode of the second component stored in the smallest unit corresponding to the first sample position is set as the intra prediction mode of the first component of the current block. value is obtained by performing prediction in one intra prediction mode, the mode information of the one intra prediction mode is stored in the smallest unit. valueis obtained by performing prediction in a plurality of intra prediction modes, mode information of the intra prediction mode with the largest weighting value among the plurality of intra prediction modes is stored in the smallest unit.
[0255] S704: Obtain a final predicted block of the first component of the current block by performing intra prediction on the first component of the current block using the intra prediction mode of the first component of the current block.
[0256] If the intra prediction mode of the first component of the current block includes at least two intra prediction modes, the above S704 includes the following steps:
[0257] S704-A1: Obtain prediction blocks corresponding to the various intra prediction modes by performing intra prediction on the first component of the current block using each of at least two intra prediction modes of the first component of the current block.
[0258] S704-A2: Obtain a final predicted block of a first component of a current block according to the predicted blocks corresponding to different intra-prediction modes.
[0259] In one embodiment, the S704-A2 includes S704-A21 and S704-A22.
[0260] S704-A21: Identify the first weighting matrix.
[0261] S704-A22: Obtain a final predicted block of the first component of the current block by performing a weighting operation on the predicted blocks corresponding to different intra-prediction modes according to the first weighting matrix.
[0262] In one possible embodiment, the first weighting matrix is derived based on a weighting matrix derivation mode.
[0263] In one possible embodiment, the first weighting matrix is derived from the weighting matrix of the second component (ie, the second weighting matrix). In this case, the above S704-A21 includes the following content:
[0264] S704-A211: Obtain a second weighting matrix of a second component corresponding to the current block.
[0265] S704-A212: Obtain a first weighting matrix based on the second weighting matrix.
[0266] In one example, the second weighting matrix includes at least two different weight values, for example, when the minimum weight value is 0 and the maximum weight value is 8, in the second weighting matrix, some samples have weight values of 0, some samples have weight values of 8, and some samples have weight values between 0 and 8, for example, 2.
[0267] In one example, all weight values in the second weight matrix are the same, for example, if the minimum weight value is 0 and the maximum weight value is 8, the weight values of all samples in the second weight matrix are between the minimum weight value and the maximum weight value, for example, 4.
[0268] In one example, the predicted values of samples in the second component corresponding to each weight value in the second weighting matrix are obtained by performing prediction in at least two intra prediction modes of the second component.
[0269] In one example, the at least two intra prediction modes of the second component include N intra prediction modes, where N is a positive integer greater than or equal to 2. The second weighting matrix includes N different weight values, where an i-th weight value indicates that a predicted value of a sample corresponding to the i-th weight value in the second component is obtained entirely in 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.
[0270] In one example, the at least two intra prediction modes of the second component include a first intra prediction mode and a second intra prediction mode. The second weighting 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 is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode. The minimum weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the second intra prediction mode. The intermediate weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode and the second intra prediction mode. Optionally, the region formed by the maximum weight value or the minimum weight value can be referred to as a transition region.
[0271] In one example, the second weighting matrix includes a plurality of weight values, and the locations where the weight values change form a straight line or a curve.
[0272] In one example, the second weighting matrix is a weighting matrix corresponding to the AWP mode or the GPM mode.
[0273] After obtaining the second weighting matrix, execute the above S704-A212 of obtaining the first weighting matrix based on the second weighting matrix. In this application, the manner of obtaining the first weighting matrix based on the second weighting matrix includes, but is not limited to, the following several:
[0274] In method 1, if the total number of samples included in the second component corresponding to the current block is the same as the total number of samples included in the first component of the current block, the second weighting matrix is taken as the first weighting matrix.
[0275] In the second method, when the total number of samples included in the first component of the current block is less than the total number of samples included in the second component corresponding to the current block, the first weighting matrix is obtained by downsampling the second weighting matrix. For example, the first weighting matrix is obtained by downsampling the second weighting matrix according to the total number of samples included in the first component of the current block and the total number of samples included in the second component corresponding to the current block.
[0276] In one embodiment, the first component includes a first subcomponent and a second subcomponent.
[0277] For the first sub-component, the above step S704-A1 includes: Using at least two intra prediction modes of the first component of the current block, perform intra prediction on the first sub-component of the current block, to obtain predicted blocks corresponding to the various intra prediction modes of the first sub-component of the current block. Correspondingly, the above step S704-A22 includes: Obtain a final predicted block of the first sub-component of the current block by performing a weighting operation on the predicted blocks corresponding to the various intra prediction modes of the first sub-component of the current block according to a first weighting matrix.
[0278] For example, a first predicted block of the first subcomponent of the current block is obtained by performing intra prediction on the first subcomponent of the current block using a first intra prediction mode, a second predicted block of the first subcomponent of the current block is obtained by performing intra prediction on the first subcomponent of the current block using a second intra prediction mode, and then a weighting operation is performed on the first predicted block and the second predicted block of the first subcomponent of the current block based on a first weighting matrix to obtain a final predicted block of the first subcomponent of the current block.
[0279] In a specific example, the final predicted block of the first sub-component of the current block is obtained according to Equation 2 above.
[0280] For the second sub-component, the above step S704-A1 includes: Obtain a predicted block corresponding to the various intra prediction modes of the second sub-component of the current block by performing intra prediction on the second sub-component of the current block using at least two intra prediction modes of the first component of the current block respectively. Accordingly, the above step S704-A22 includes: Obtain a final predicted block of the second sub-component of the current block by performing a weighting operation on the predicted block corresponding to the various intra prediction modes of the second sub-component of the current block according to the first weighting matrix.
[0281] For example, a first predicted block of the second subcomponent of the current block is obtained by performing intra prediction on the second subcomponent of the current block using a first intra prediction mode, a second predicted block of the second subcomponent of the current block is obtained by performing intra prediction on the second subcomponent of the current block using a second intra prediction mode, and then a weighting operation is performed on the first predicted block and the second predicted block of the second subcomponent of the current block based on a first weighting matrix to obtain a final predicted block of the second subcomponent of the current block.
[0282] In a specific example, the final predicted block of the second sub-component of the current block is obtained according to Equation 3 above.
[0283] Some steps on the decoding side are similar to some steps on the encoding side, and for these, reference can be made to the relevant descriptions on the encoding side, and the descriptions will be omitted here.
[0284] After obtaining the final prediction block of the current block, the decoder performs subsequent processing, including decoding the quantized coefficients, identifying a residual block by inverse transform and inverse quantization, combining the residual block with the prediction block to obtain a reconstructed block, and subsequent loop filtering.
[0285] 17 is a flowchart illustrating a video decoding method 800 according to an embodiment of the present application. As shown in FIG. 17, the method of the embodiment of the present application includes the following contents:
[0286] S801: Analyze a bitstream to determine whether to perform intra prediction on a current block including a first component and a second component.
[0287] S802: If it is determined that intra prediction is performed on the current block, analyze a weighted prediction flag, which is used to indicate whether the prediction block of the second component is obtained by performing prediction in at least two intra prediction modes.
[0288] S803: When the weighted prediction flag is used to indicate that the prediction block of the second component is obtained by performing prediction in at least two intra prediction modes, analyze the at least two intra prediction modes used for the intra prediction of the second component corresponding to the current block and the derivation mode information of the second weighting matrix.
[0289] S804: Using at least two intra prediction modes of the second component corresponding to the current block, prediction is performed on the second component corresponding to the current block, thereby obtaining a predicted block corresponding to various intra prediction modes of the second component corresponding to the current block.
[0290] S805: Obtain a second weighting matrix based on the derivation mode information of the second weighting matrix.
[0291] It should be noted that the operations in S804 and S805 may be executed in any order.
[0292] S806: Obtain a final predicted block of the second component corresponding to the current block by performing weighting on the predicted blocks corresponding to various intra-prediction modes of the second component corresponding to the current block based on the second weighting matrix.
[0293] S807: Identify an initial intra prediction mode of the first component of the current block. Specifically, if the initial intra prediction mode of the first component of the current block carried in the bitstream is not a derived mode, intra prediction is performed on the first component using the initial intra prediction mode of the first component of the current block carried in the bitstream. If the initial intra prediction mode of the first component of the current block carried in the bitstream is a derived mode, S808 is executed. If mode information of the initial intra prediction mode of the first component of the current block is not carried in the bitstream, it defaults to the initial intra prediction mode of the first component of the current block being a derived mode, and S808 is executed.
[0294] S808: if the initial intra prediction mode is a derived mode, determine at least two intra prediction modes of the first component of the current block according to at least two intra prediction modes of the second component corresponding to the current block, for example, directly set the at least two intra prediction modes of the second component as the at least two intra prediction modes of the first component of the current block.
[0295] S809: Determine a first weighting matrix based on the second weighting matrix. For example, if the total number of samples included in the second component corresponding to the current block is the same as the total number of samples included in the first component of the current block, the second weighting matrix is the first weighting matrix. If the total number of samples included in the first component of the current block is less than the total number of samples included in the second component corresponding to the current block, obtain the first weighting matrix by downsampling the second weighting matrix.
[0296] It should be noted that the operations in S808 and S809 may be executed in any order.
[0297] S810: Using at least two intra prediction modes of the first component of the current block, perform intra prediction on the first component of the current block to obtain a predicted block corresponding to the various intra prediction modes of the first component of the current block.
[0298] S811: Obtain a final predicted block of the first component of the current block by performing weighting on the predicted blocks corresponding to various intra-prediction modes of the first component of the current block according to a first weighting matrix.
[0299] Figure 18 is a flowchart showing a video decoding method 900 according to an embodiment of the present application. In an embodiment of the present application, as an example, the first component is a chroma component, the second component is a luma component, and the at least two intra prediction modes of the luma component include a first intra prediction mode and a second intra prediction mode, and two intra prediction modes are used for the chroma component. As shown in Figure 18, the method according to an embodiment of the present application includes the following contents:
[0300] S901: Analyze a bitstream to determine whether to perform intra prediction on a current block including a luma component and a chroma component.
[0301] S902: If it is determined that intra prediction is performed on the current block, analyze a weighted prediction flag, which is used to indicate whether a prediction block corresponding to a luminance component is obtained by performing prediction in two intra prediction modes.
[0302] In one example, the technique of the present application is called spatial angular weighted prediction (SAWP). By carrying a sequence-level flag in the bitstream, it is possible to specify whether the SAWP technique is used for the current block. For example, the sequence header definition is shown in Table 4.
[0303] [Table 4]
[0304] In Table 4, sawp_enable_flag is a SAWP usage flag and is a binary variable. A value of sawp_enable_flag of "1" indicates that SAWP is available, and a value of sawp_enable_flag of "0" indicates that SAWP is not available. 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.
[0305] Alternatively, there may be a frame-level flag to specify whether the SAWP technique is used for the current image waiting to be decoded. For example, the SAWP technique may be configured to be used for intra frames (e.g., I frames) and not used for inter frames (e.g., B frames, P frames). Alternatively, the SAWP technique may be configured to be used for inter frames and not used for intra frames. Alternatively, the SAWP technique may be configured to be used for some inter frames and not used for some inter frames.
[0306] Optionally, there may be a flag below the frame level and above the CU level (eg, tile, slice, patch, LCU, etc.) that indicates whether the SAWP technique is used for the region corresponding to the flag.
[0307] For example, the decoder executes the following program: [Table 5]
[0308] The intra_cu_flag is an intra prediction flag, and the sawp_flag is a weighted prediction flag, which are binary variables. A value of "1" for sawp_flag indicates that SAWP should be performed, i.e., at least two intra prediction modes are used for the luma component. A value of "0" for sawp_flag indicates that SAWP should not be performed, i.e., only one intra prediction mode is used for the luma component. The value of SawpFlag is equal to the value of sawp_flag. If sawp_flag is not present in the bitstream, the value of SawpFlag is 0.
[0309] Specifically, the decoder decodes the current block. If it is determined that intra prediction is used for the current block, the decoder decodes the SAWP usage flag (i.e., the value of sawp_flag) of the current block. Otherwise, that is, if it is determined that intra prediction is not used for the current block, the decoder does not need to decode the SAWP usage flag of the current block. Alternatively, if the SAWP is used for the current block, the decoder does not need to process information about the DT and IPF, because the DT or IPF and the SAWP are mutually exclusive.
[0310] S903: If the weighted prediction flag indicates that two intra prediction modes are used to predict the luma component, analyze the derivation mode information of the first intra prediction mode, the second intra prediction mode, and the second weighting matrix used during the intra prediction of the luma component of the current block.
[0311] If the weighted prediction flag indicates that two intra prediction modes are used to predict the luma component, the decoder analyzes the derivation mode information of the first intra prediction mode, the second intra prediction mode, and the second weighting matrix used during intra prediction of the luma component of the current block.
[0312] In some embodiments, the decoder obtains mode information of the first intra-prediction mode and the second intra-prediction mode of the luma component of the current block by executing the following program. [Table 6]
[0313] sawp_idx is derivation mode information of the second weighting matrix, and the value of SawpIdx is equal to the value of sawp_idx. If sawp_idx is not present in the bitstream, the value of SawpIdx is 0. intra_luma_pred_mode0 is mode information of the first intra prediction mode of the luma component of the current block, and intra_luma_pred_mode1 is mode information of the second intra prediction mode of the luma component of the current block.
[0314] In this step, the analysis method of sawp_idx is the same as awp_idx, the analysis method of intra_luma_pred_mode0 is the same as intra_luma_pred_mode, and the analysis method of intra_luma_pred_mode1 is the same as intra_luma_pred_mode. Optionally, since there are only two MPMs in AVS3, when both intra_luma_pred_mode0 and intra_luma_pred_mode1 are used as MPMs and intra_luma_pred_mode0 is used as one MPM of the two MPMs, it defaults to intra_luma_pred_mode1 being used as the other MPM, so there is no need to analyze intra_luma_pred_mode1 to identify whether intra_luma_pred_mode1 is the first or second MPM of the two MPMs.
[0315] In some embodiments, the decoder performs the following steps to determine the first and second intra-prediction modes of the luma component of the current block: [Table 7]
[0316] Specifically, the decoder decodes the current block. If intra prediction is used for the current block, the decoder decodes the DT usage flag of the current block, the IPF usage flag, and the only luma prediction mode of each prediction unit in the current method, intra_luma_pred_mode. If neither DT nor IPF is used for the current block, the decoder decodes the SAWP usage flag of the current block. If SAWP is used for the current block, the decoder needs to decode the derivation mode of the second weighting matrix and intra_luma_pred_model. Let intra_luma_pred_mode be the mode information of the first intra prediction mode of the luma component of the current block, and intra_luma_pred_model be the mode information of the second intra prediction mode of the luma component of the current block.
[0317] Identify IntraLumaPredMode0 and IntraLumaPredModel according to intra_luma_pred_mode0 and intra_luma_pred_model, respectively. By searching Table 1, the first intra prediction mode and the second intra prediction mode of the luma component of the current block can be obtained.
[0318] Note that the first version of AVS3 only supports 34 intra prediction modes, so for example, as shown in FIG. 8, when the index starts from 0, the 34th mode is PCM mode. As shown in FIG. 10, more intra prediction modes are added in the second version of AVS3, and the intra prediction modes are extended to 66 intra prediction modes. In order to match the first version, the second version needs to further add one more flag (i.e., eipm_pu_flag) when intra_luma_pred_mode is greater than 1, without changing the original decoding method of intra_luma_pred_mode. [Table 8]
[0319] eipm_pu_flag is the intra-luminance prediction mode extension flag and is a binary variable. A value of "1" for eipm_pu_flag indicates that the intra-angle prediction extension mode should be used, and a value of "0" for eipm_pu_flag indicates that the intra-luminance prediction extension mode is not used. The value of EipmPuFlag is equal to the value of eipm_pu_flag. If eipm_pu_flag is not present in the bitstream, the value of EipmPuFlag is equal to 0.
[0320] Therefore, in a text description corresponding to the second version of AVS3, descriptions of eipm_pu_flag, eipm_pu_flag0, and eipm_pu_flag1 should be added to the above syntax elements intra_luma_pred_mode, intra_luma_pred_mode0, and intra_luma_pred_mode1. IntraLumaPredMode0 is specified based on intra_luma_pred_mode0 and eipm_pu_flag0, and IntraLumaPredMode1 is specified based on intra_luma_pred_mode1 and eipm_pu_flag1.
[0321] S904: Obtain a first predicted block of the luma component of the current block by performing intra prediction on the luma component of the current block using a first intra prediction mode, and obtain a second predicted block of the luma component of the current block by performing intra prediction on the luma component of the current block using a second intra prediction mode.
[0322] S905: Obtain a second weighting matrix based on the derivation mode information of the second weighting matrix.
[0323] For example, the decoder obtains the second weighting matrix for the luma component of the current block by executing the following program: [Table 9] TIFF0007657931000013.tif57170
[0324] M represents the width of the current block, N represents the height of the current block, and AwpWeightArrayY represents the second weighting matrix of the luminance component Y. The reference weights ReferenceWeights[x] can be obtained according to the following program: [Table 10] TIFF0007657931000015.tif201170
[0325] It should be noted that the operation of S904 and the operation of S905 may be executed in any order.
[0326] S906: Obtain a final prediction block of the luma component of the current block by performing a weighting operation on the first prediction block and the second prediction block of the luma component of the current block based on the second weighting matrix.
[0327] In one example, the final prediction block of the luminance component of the current block is obtained according to the following Equation 4:
number
[0328] S907: Identify an initial intra prediction mode of the chroma component of the current block. Specifically, if the initial intra prediction mode of the chroma component of the current block carried in the bitstream is not a derived mode, intra prediction is performed on the chroma component of the current block using the initial intra prediction mode of the chroma component of the current block carried in the bitstream. If the initial intra prediction mode of the chroma component of the current block carried in the bitstream is a derived mode, S908 is executed.
[0329] If the bitstream does not carry mode information of the initial intra-prediction mode of the chroma component of the current block, the initial intra-prediction mode of the chroma component of the current block is defaulted to be the derived mode, and step S908 is executed.
[0330] In some embodiments, the present application performs the following process when determining the intra prediction mode IntraChromaPredMode of the chroma component of the current block.
[0331] 1) If the SawpFlag of the current block is 1 (i.e., the technical solution of this application is used in the current block), then isRedundant is equal to 0, and proceed to step 3); otherwise, proceed to step 2).
[0332] 2) if the luma prediction mode IntraLumaPredMode of the predictive block of the current block, for which the value of PredBlockOrder is 0, is equal to 0, 2, 12, or 24, then isRedundant is equal to 1; otherwise, isRedundant is equal to 0.
[0333] 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).
[0334] 4) If not, If the value of tscpm_enable_flag is equal to “1” and the value of intra_chroma_pred_mode is not equal to 0, subtract 1 from the value of intra_chroma_pred_mode. If isRedundant is equal to 0, then IntraChromaPredMode is equal to intra_chroma_pred_mode. Otherwise, the following operations are performed in sequence: If IntraLumaPredMode is equal to 0, then predIntraChromaPredMode is equal to 1; if IntraLumaPredMode is equal to 2, then predIntraChromaPredMode is equal to 4; if IntraLumaPredMode is equal to 12, then predIntraChromaPredMode is equal to 3; and if IntraLumaPredMode is equal to 24, then predIntraChromaPredMode is equal to 2. 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 intra_chroma_pred_mode plus 1. a) Based on the value of IntraChromaPredMode, look up Table 2 to obtain the intra prediction mode of the chroma component of the current block.
[0335] If SawpFlag of the current block is 1 and IntraChromaPredMode is 0, the intra prediction mode of the chroma component of the current block is Intra_Chroma_DM instead of PCM.
[0336] In this application, when a prediction block is identified by using at least two intra prediction modes for the first component of a current block, the intra prediction modes of the first component of the following current block will have no redundant modes, and there is no need to check and remove redundant modes during binarization of the intra chroma prediction modes, i.e., there is no need to perform the above step 2).
[0337] S908: If the initial intra prediction mode of the chroma component of the current block is determined to be a derived mode, the first intra prediction mode and the second intra prediction mode of the luma component of the current block are determined as the first intra prediction mode and the second intra prediction mode of the chroma component of the current block.
[0338] S909: Identify a first weighting matrix based on the second weighting matrix.
[0339] For example, if the total number of samples in the luma component of the current block is the same as the total number of samples in the chroma component of the current block, the second weighting matrix is the first weighting matrix, and if the total number of samples in the chroma component of the current block is less than the total number of samples in the luma component of the current block, the first weighting matrix is obtained by downsampling the second weighting matrix.
[0340] For example, in the case of YUV4:2:0, the decoder obtains the first weighting matrix by executing the following program: [Table 11]
[0341] AwpWeightArrayUV is the first weighting matrix and AwpWeightArrayY is the second weighting matrix.
[0342] It should be noted that the operation of S908 and the operation of S909 may be executed in any order.
[0343] S910: Obtain a first predicted block of the chroma component of the current block by performing intra prediction on the chroma component of the current block using a first intra prediction mode, and obtain a second predicted block of the chroma component of the current block by performing intra prediction on the chroma component of the current block using a second intra prediction mode.
[0344] S911: Obtain a final prediction block of the chroma component of the current block by performing a weighting operation on the first prediction block and the second prediction block of the chroma component of the current block based on a first weighting matrix.
[0345] For example, the chroma component includes a U component and a V component. The final predicted block of the U component of the current block can be obtained according to Equation 5 below.
number
[0346] The final predicted block of the V component of the current block is obtained according to the following Equation 6:
number
[0347] Finally, the decoder performs subsequent processing, including decoding the quantized coefficients, identifying residual blocks by inverse transform and inverse quantization, combining the residual blocks with the prediction blocks to obtain reconstructed blocks, and subsequent loop filtering.
[0348] It should be understood that FIG. 12 and FIGS. 14 to 18 are merely examples of the present application and are not intended to limit the present application.
[0349] The above describes the preferred embodiments of the present application in detail with reference to the accompanying drawings, but the present application is not limited to the detailed contents of the above embodiments, and various simple modifications can be made to the technical solutions of the present application within the scope of the technical ideas of the present application, and all such simple modifications fall within the scope of protection of the present application. For example, the specific technical features described in the above specific embodiments may be combined by any suitable means if there is no contradiction, and various possible combinations are not described again in this application to avoid unnecessary duplication. In addition, for example, any combination between various different embodiments of the present application should be considered as disclosed in the present application as long as it does not contradict the ideas of the present application.
[0350] It should be understood that in various method embodiments of the present application, the magnitude of the sequence number of each of the above processes does not mean the order of execution. The order of execution of each process should be specified by its function and internal logic, and should not constitute any restriction on the implementation process of the embodiment of the present application. In addition, in the embodiment of the present application, the term "and / or" (and / or) simply describes the related relationship of related objects and indicates that there are three types of relationships. Specifically, in the case of A and / or B, it indicates three situations: only A exists, A and B exist simultaneously, and only B exists. In addition, in this specification, the sign " / " generally indicates that the related objects before and after are in an "or" relationship.
[0351] Method embodiments of the present application have been described above in detail with reference to Figures 14 to 18. Hereinafter, device embodiments of the present application will be described in detail with reference to Figures 19 to 21.
[0352] FIG. 19 is a block diagram illustrating a video encoder 10 according to an embodiment of the present application.
[0353] As shown in Fig. 19, the video encoder 10 includes a first acquisition unit 11, a first identification unit 12, a second acquisition unit 13, a second identification unit 14, and a prediction unit 15. The first acquisition unit 11 is configured to acquire a current block including a first component. The first identification unit 12 is configured to identify an initial intra-prediction mode of the first component of the current block. The second acquisition unit 13 is configured to acquire at least two intra-prediction modes of the second component corresponding to the current block if the initial intra-prediction mode is a derived mode. The second identification unit 14 is configured to determine an initial intra-prediction mode of the first component of the current block based on the at least two intra-prediction modes of the second component. stomach The prediction unit 15 is configured to determine an intra-prediction mode. Intra prediction mode of the first component of the current blockto perform intra prediction on the first component of the current block using the above-mentioned approximation to obtain a final predicted block of the first component of the current block.
[0354] In some embodiments, Intra prediction mode of the first component of the current block includes at least two intra prediction modes.
[0355] In one embodiment, the second identification unit 14 specifically identifies at least two intra prediction modes of the second component as stomach The prediction mode is configured to be an intra-prediction mode.
[0356] In one embodiment, the second identification unit 14 specifically identifies the first component of the current block according to at least two intra-prediction modes of the second component. stomach The method is configured to derive an intra-prediction mode.
[0357] In this case, the prediction unit 15 is specifically configured to perform intra prediction on the first component of the current block using each of at least two intra prediction modes of the first component of the current block to obtain prediction blocks corresponding to the various intra prediction modes, and obtain a final prediction block of the first component of the current block based on the prediction blocks corresponding to the various intra prediction modes.
[0358] In some embodiments, the prediction unit 15 is specifically configured to identify a first weighting matrix, and perform a weighting operation on the prediction blocks corresponding to various intra-prediction modes based on the first weighting matrix to obtain a final prediction block of the first component of the current block.
[0359] In some embodiments, prediction unit 15 is specifically configured to derive the first weighting matrix based on a weighting matrix derivation mode.
[0360] In some embodiments, the prediction unit 15 specifically obtains a second weighting matrix of a second component corresponding to the current block; If the total number of samples in the second component corresponding to the current block is equal to the total number of samples in the first component of the current block, the second weighting matrix is the first weighting matrix; If the total number of samples included in the first component of the current block is less than the total number of samples included in the second component corresponding to the current block, the first weighting matrix is obtained by downsampling the second weighting matrix.
[0361] In some embodiments, prediction unit 15 is specifically configured to obtain the first weighting matrix by downsampling the second weighting matrix based on the total number of samples included in the first component of the current block and the total number of samples included in the second component corresponding to the current block.
[0362] Optionally, the second weighting matrix includes at least two different weight values.
[0363] Optionally, all weight values in the second weighting matrix are the same.
[0364] Optionally, the predicted values of samples in the second component corresponding to each weight value in the second weighting matrix are obtained by performing prediction in at least two intra prediction modes of the second component.
[0365] Optionally, the at least two intra prediction modes of the second component include N intra prediction modes, where N is a positive integer greater than or equal to 2. The second weighting matrix includes N different weight values, where an i-th weight value indicates that a predicted value of a sample in the second component corresponding to the i-th weight value is obtained entirely in 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.
[0366] Optionally, the at least two intra prediction modes of the second component include a first intra prediction mode and a second intra prediction mode, and the second weighting matrix includes a maximum weight value, a minimum weight value, and at least one intermediate weight value, where the maximum weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode, the minimum weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the second intra prediction mode, and the intermediate weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode and the second intra prediction mode.
[0367] Optionally, the second weighting matrix includes a plurality of weight values, and the locations at which the weight values change form a straight line or a curve.
[0368] Optionally, the second weighting matrix is a weighting matrix corresponding to the AWP mode or the GPM mode.
[0369] In some embodiments, Intra prediction mode of the first component of the current block includes one intra prediction mode.
[0370] In one example, the second identification unit 14 specifically identifies one of the at least two intra prediction modes of the second component as: Intra prediction mode of the first component of the current block The present invention is configured to:
[0371] In one embodiment, the second identification unit 14 specifically determines based on the intra prediction mode of the second component corresponding to the first sample position of the current block: Intra prediction mode of the first component of the current block The method is configured to identify
[0372] In one example, the second identifying unit 14 specifically identifies the one intra prediction mode when the predicted value of the second component corresponding to the first sample position is obtained by completely performing prediction in one intra prediction mode. Intra prediction mode of the first component of the current block year, When the predicted value of the second component corresponding to the first sample position is obtained by performing prediction in a plurality of intra prediction modes, the intra prediction mode having the largest weight value among the plurality of intra prediction modes is selected. Intra prediction mode of the first component of the current block The present invention is configured to:
[0373] In one example, the second identification unit 14 specifically identifies the intra prediction mode of the second component stored in the smallest unit corresponding to the first sample position as follows: Intra prediction mode of the first component of the current block The present invention is configured to:
[0374] Alternatively, when the predicted value of the second component corresponding to the first sample position is obtained by performing prediction entirely in one intra prediction mode, mode information of the one intra prediction mode is stored in the smallest unit.When the predicted value of the second component corresponding to the first sample position is obtained by performing prediction in multiple intra prediction modes, mode information of the intra prediction mode with the largest weight value among the multiple intra prediction modes is stored in the smallest unit.
[0375] In some embodiments, the first component includes a first subcomponent and a second subcomponent. In this case, the prediction unit 15 specifically: performing intra prediction on a first subcomponent of the current block using at least two intra prediction modes of a first component of the current block, thereby obtaining a prediction block corresponding to the various intra prediction modes of the first subcomponent of the current block; The method is configured to perform intra prediction on a second subcomponent of the current block using each of at least two intra prediction modes of a first component of the current block to obtain a predicted block corresponding to the various intra prediction modes of the second subcomponent of the current block.
[0376] In one example, the prediction unit 15 specifically: Perform weighting operations on prediction blocks of the first sub-component of the current block corresponding to various intra-prediction modes according to the first weighting matrix to obtain a final prediction block of the first sub-component of the current block; The method is configured to obtain a final predicted block of the second sub-component of the current block by performing a weighting operation on the predicted blocks of the second sub-component of the current block corresponding to various intra-prediction modes based on the first weighting matrix.
[0377] In one example, the prediction unit 15 specifically calculates: predMatrixSawpA[x][y]=(predMatrixA0[x][y]*AwpWeightArrayAB[x][y]+predMatrixA1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1)>>n, where A is the first subcomponent, predMatrixSawpA[x][y] is the final predicted value of sample[x][y] in the first subcomponent, predMatrixA0[x][y] is the first predicted value of sample[x][y] in the first predicted block of the first subcomponent of the current block, predMatrixA1[x][y] is the second predicted value of sample[x][y] in the second predicted block of the first subcomponent of the current block, AwpWeightArrayAB[x][y] is the weight value of predMatrixA0[x][y] in the first weighting matrix AwpWeightArrayAB, and 2 n is the sum of the preset weights, and n is a positive integer.
[0378] In one example, the prediction unit 15 specifically calculates: predMatrixSawpB[x][y]=(predMatrixB0[x][y]*AwpWeightArrayAB[x][y]+predMatrixB1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1 )>>n to obtain a final predicted block of the second subcomponent of the current block, where B is the second subcomponent, predMatrixSawpB[x][y] is the final predicted value of sample[x][y] in the second subcomponent, predMatrixB0[x][y] is the first predicted value of sample[x][y] in the first predicted block of the second subcomponent of the current block, predMatrixB1[x][y] is the second predicted value of sample[x][y] in the second predicted block of the second subcomponent of the current block, AwpWeightArrayAB[x][y] is the weight value of predMatrixB0[x][y] in the first weighting matrix AwpWeightArrayAB, and 2 n is the sum of the preset weights, and n is a positive integer.
[0379] In one example, the prediction unit 15 is further configured to generate a bitstream, in which a weighted prediction flag is carried, and the weighted prediction flag is used to indicate whether the prediction block of the second component is obtained by performing prediction in at least two intra prediction modes.
[0380] In some embodiments, the first identification unit 12 is specifically configured to: identify an initial intra-prediction mode of the first component of the current block as a derived mode when it is identified that at least two intra-prediction modes are used for predicting the second component.
[0381] In some embodiments, the bitstream further carries mode information for at least two intra-prediction modes of the second component.
[0382] In some embodiments, the bitstream further carries derivation mode information of the second weighting matrix.
[0383] In some embodiments, the size of the current block meets a preset condition.
[0384] The preset conditions include any one or more of the following: Condition 1: The width of the current block is greater than or equal to a first preset width TH1, and the height of the current block is greater than or equal to a first preset height TH2. Condition 2: The number of samples in the current block is greater than or equal to a first preset number TH3. Condition 3: the width of the current block is equal to or smaller than the second preset width TH4, and the height of the current block is equal to or larger than the second preset height TH5. Condition 4: For the width of the current block height This ratio is a first preset ratio. Condition 5: The size of the current block is the second preset size. value It is. Condition 6: The height of the current block is equal to or greater than a third preset height, the width of the current block is equal to or greater than the third preset width, the ratio of the width to the height of the current block is equal to or less than the third preset value, and the ratio of the height to the width of the current block is equal to or less than the third preset value.
[0385] Optionally, the first preset ratio is any of 1:1, 2:1, 1:2, 1:4, and 4:1.
[0386] Optionally, the second preset value is any of 16x32, 32x32, 16x64, and 64x16.
[0387] Optionally, the first component is Saturation component, and the second component is brightness It is a component.
[0388] Optionally, the chroma component is a UV component, the first sub-component is a U component, and the second sub-component is a V component.
[0389] It should be noted that the apparatus embodiment and the method embodiment can correspond to each other, and the similar description of the apparatus embodiment can be referred to the method embodiment. In order to avoid repetition, the description is omitted here. Specifically, the video encoder 10 shown in FIG. 19 can execute the method in the embodiment of the present application, and the above and other operations and / or functions of each unit in the video encoder 10 are respectively used to realize the corresponding process in each of the methods 400, 500 and 600, etc. In order to be concise, the description is omitted here.
[0390] FIG. 20 is a block diagram illustrating a video decoder 20 according to an embodiment of the present application.
[0391] As shown in FIG. 20, the video decoder 20 includes an analysis unit 21, a first identification unit 22, a second identification unit 23, and a prediction unit 24. The analysis unit 21 is configured to obtain a current block including a first component and at least two intra prediction modes of a second component corresponding to the current block by analyzing a bitstream. The first identification unit 22 is configured to identify an initial intra prediction mode of the first component of the current block. The second identification unit 23 is configured to identify an intra prediction mode of the first component of the current block based on the at least two intra prediction modes of the second component when the initial intra prediction mode is identified as a derived mode. The prediction unit 24 is configured to obtain a final predicted block of the first component of the current block by performing intra prediction on the first component of the current block using the intra prediction mode of the first component of the current block.
[0392] In some embodiments, a weighted prediction flag is carried in the bitstream, and the weighted prediction flag is used to indicate whether a predictive block of the second component is obtained by performing prediction in at least two intra prediction modes.
[0393] Optionally, mode information of an initial intra-prediction mode of the first component of the current block is carried in the bitstream.
[0394] The first identification unit 22 is specifically configured to identify that the initial intra-prediction mode of the first component of the current block is a derived mode when a weighted prediction flag is carried in the bitstream and mode information of the initial intra-prediction mode of the first component of the current block is not carried.
[0395] In some embodiments, the intra prediction modes of the first component of the current block include at least two intra prediction modes.
[0396] In one example, the second identifying unit 23 is specifically configured to set at least two intra prediction modes of the second component as the intra prediction modes of the first component of the current block.
[0397] In one example, the second identification unit 23 is specifically configured to derive an intra prediction mode of the first component of the current block based on at least two intra prediction modes of the second component.
[0398] In this case, the prediction unit 24 is specifically configured to perform intra prediction on the first component of the current block using each of at least two intra prediction modes of the first component of the current block to obtain prediction blocks corresponding to the various intra prediction modes, and obtain a final prediction block of the first component of the current block based on the prediction blocks corresponding to the various intra prediction modes.
[0399] In some embodiments, prediction unit 24 is specifically configured to identify a first weighting matrix, and perform a weighting operation on the prediction blocks corresponding to various intra-prediction modes based on the first weighting matrix to obtain a final prediction block of the first component of the current block.
[0400] In some embodiments, prediction unit 24 is specifically configured to derive the first weighting matrix based on a weighting matrix derivation mode.
[0401] In some embodiments, prediction unit 24 specifically obtains a second weighting matrix for a second component corresponding to the current block: If the total number of samples in the second component corresponding to the current block is equal to the total number of samples in the first component of the current block, the second weighting matrix is the first weighting matrix; If the total number of samples included in the first component of the current block is less than the total number of samples included in the second component corresponding to the current block, the first weighting matrix is obtained by downsampling the second weighting matrix.
[0402] In some embodiments, prediction unit 24 is specifically configured to obtain derivation mode information of the second weighting matrix from the bitstream and obtain the second weighting matrix based on the derivation mode information of the second weighting matrix.
[0403] In some embodiments, prediction unit 24 is specifically configured to obtain the first weighting matrix by downsampling the second weighting matrix based on the total number of samples in the first component of the current block and the total number of samples in the second component corresponding to the current block.
[0404] Optionally, the second weighting matrix includes at least two different weight values.
[0405] Optionally, all weight values in the second weighting matrix are the same.
[0406] Optionally, the predicted values of samples in the second component corresponding to each weight value in the second weighting matrix are obtained by performing prediction in at least two intra prediction modes of the second component.
[0407] Optionally, the at least two intra prediction modes of the second component include N intra prediction modes, where N is a positive integer greater than or equal to 2. The second weighting matrix includes N different weight values, where an i-th weight value indicates that a predicted value of a sample in the second component corresponding to the i-th weight value is obtained entirely in 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.
[0408] Optionally, the at least two intra prediction modes of the second component include a first intra prediction mode and a second intra prediction mode, and the second weighting matrix includes a maximum weight value, a minimum weight value, and at least one intermediate weight value, where the maximum weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode, the minimum weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the second intra prediction mode, and the intermediate weight value is used to indicate that the prediction value of the corresponding sample in the second component is obtained by performing prediction entirely in the first intra prediction mode and the second intra prediction mode.
[0409] Optionally, the second weighting matrix includes a plurality of weight values, and the locations at which the weight values change form a straight line or a curve.
[0410] Optionally, the second weighting matrix is a weighting matrix corresponding to the AWP mode or the GPM mode.
[0411] In some embodiments, Intra prediction mode of the first component of the current block includes one intra prediction mode.
[0412] In one example, the second identification unit 23 specifically identifies one of the at least two intra prediction modes of the second component as: Intra prediction mode of the first component of the current block The present invention is configured to:
[0413] In one embodiment, the second identification unit 23 specifically determines based on the intra prediction mode of the second component corresponding to the first sample position of the current block: Intra prediction mode of the first component of the current block The method is configured to identify
[0414] In one example, the second identifying unit 23 specifically identifies that when the predicted value of the second component corresponding to the first sample position is obtained by completely performing prediction in one intra prediction mode, the one intra prediction mode is selected as the predicted value. Intra prediction mode of the first component of the current block year, When the predicted value of the second component corresponding to the first sample position is obtained by performing prediction in a plurality of intra prediction modes, the intra prediction mode having the largest weight value among the plurality of intra prediction modes is selected. , the intra prediction mode of the first component of the current block The present invention is configured to:
[0415] In one example, the second identification unit 23 specifically determines the intra prediction mode of the second component stored in the smallest unit corresponding to the first sample position as follows: Intra prediction mode of the first component of the current block The present invention is configured to:
[0416] Alternatively, when the predicted value of the second component corresponding to the first sample position is obtained by performing prediction entirely in one intra prediction mode, mode information of the one intra prediction mode is stored in the smallest unit.When the predicted value of the second component corresponding to the first sample position is obtained by performing prediction in multiple intra prediction modes, mode information of the intra prediction mode with the largest weight value among the multiple intra prediction modes is stored in the smallest unit.
[0417] In some embodiments, the first component includes a first subcomponent and a second subcomponent. Specifically, prediction unit 24: performing intra prediction on a first subcomponent of the current block using at least two intra prediction modes of a first component of the current block, thereby obtaining a prediction block corresponding to the various intra prediction modes of the first subcomponent of the current block; The method is configured to perform intra prediction on a second subcomponent of the current block using each of at least two intra prediction modes of a first component of the current block to obtain a predicted block corresponding to the various intra prediction modes of the second subcomponent of the current block.
[0418] In some embodiments, prediction unit 24 specifically: Perform weighting operations on prediction blocks of the first sub-component of the current block corresponding to various intra-prediction modes according to the first weighting matrix to obtain a final prediction block of the first sub-component of the current block; The method is configured to obtain a final predicted block of the second sub-component of the current block by performing a weighting operation on the predicted blocks of the second sub-component corresponding to various intra-prediction modes based on the first weighting matrix.
[0419] In some embodiments, the prediction unit 24 specifically performs the following: predMatrixSawpA[x][y]=(predMatrixA0[x][y]*AwpWeightArrayAB[x][y]+predMatrixA1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1 )>>n to obtain a final predicted block of the first sub-component of the current block. A is the first subcomponent, predMatrixSawpA[x][y] is the final predicted value of sample[x][y] in the first subcomponent, predMatrixA0[x][y] is the first predicted value of sample[x][y] in the first predicted block of the first subcomponent of the current block, predMatrixA1[x][y] is the second predicted value of sample[x][y] in the second predicted block of the first subcomponent of the current block, AwpWeightArrayAB[x][y] is the weight value of predMatrixA0[x][y] in the first weighting matrix AwpWeightArrayAB, 2 n is the sum of the preset weights, and n is a positive integer.
[0420] In some embodiments, prediction unit 24 specifically performs the following: predMatrixSawpB[x][y]=(predMatrixB0[x][y]*AwpWeightArrayAB[x][y]+predMatrixB1[x][y]*(2 n -AwpWeightArrayAB[x][y])+2 n-1 )>>n to obtain a final predicted block of the second subcomponent of the current block, where B is the second subcomponent, predMatrixSawpB[x][y] is the final predicted value of sample[x][y] in the second subcomponent, predMatrixB0[x][y] is the first predicted value of sample[x][y] in the first predicted block of the second subcomponent of the current block, predMatrixB1[x][y] is the second predicted value of sample[x][y] in the second predicted block of the second subcomponent of the current block, AwpWeightArrayAB[x][y] is the weight value of predMatrixB0[x][y] in the first weighting matrix AwpWeightArrayAB, and 2 n is the sum of the preset weights, and n is a positive integer.
[0421] In some embodiments, the size of the current block meets a preset condition.
[0422] The preset conditions include any one or more of the following: Condition 1: The width of the current block is greater than or equal to a first preset width TH1, and the height of the current block is greater than or equal to a first preset height TH2. Condition 2: The number of samples in the current block is greater than or equal to a first preset number TH3. Condition 3: the width of the current block is equal to or smaller than the second preset width TH4, and the height of the current block is equal to or larger than the second preset height TH5. Condition 4: For the width of the current block height This ratio is a first preset ratio. Condition 5: The size of the current block is the second preset size. value It is. Condition 6: The height of the current block is equal to or greater than a third preset height, the width of the current block is equal to or greater than the third preset width, the ratio of the width to the height of the current block is equal to or less than the third preset value, and the ratio of the height to the width of the current block is equal to or less than the third preset value.
[0423] Optionally, the first preset ratio is any of 1:1, 2:1, 1:2, 1:4, and 4:1.
[0424] Optionally, the second preset value is any of 16x32, 32x32, 16x64, and 64x16.
[0425] Optionally, the first component is Saturation component, and the second component is brightness It is a component.
[0426] Optionally, the chroma component is a UV component, the first sub-component is a U component, and the second sub-component is a V component.
[0427] It should be noted that the apparatus embodiment and the method embodiment may correspond to each other, and the similar description of the apparatus embodiment may refer to the method embodiment. In order to avoid repetition, the description is omitted here. Specifically, the video encoder 20 shown in FIG. 20 may correspond to an entity that performs the method 700, 800 or 900 in the embodiments of the present application. In addition, the above and other operations and / or functions of each unit in the video encoder 20 are respectively used to realize the corresponding process in each of the methods 700, 800 or 900, etc. In order to be concise, the description is omitted here.
[0428] The above describes the apparatus and system of the embodiments of the present application from the perspective of functional units with reference to the drawings. The functional units may be realized in a hardware form, in a software form, or in a combination of hardware and software modules. Specifically, each step of the method embodiment in the embodiments of the present application can be completed by a hardware integrated logic circuit in a processor or by a software form instruction. The steps of the method disclosed in the embodiments of the present application can be directly executed and completed by a hardware decoding processor, or can be executed and completed by a combination of hardware and software modules in a decoding processor. Alternatively, the software can be located in a mature storage medium in the technical field, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory. The processor reads the information in the memory and completes the steps of the method embodiment together with the hardware of the processor.
[0429] FIG. 21 is a block diagram showing an electronic device 30 according to an embodiment of the present application.
[0430] figure 21As shown in FIG. 1, the electronic device 30 may be a video encoder or a video decoder according to the embodiments of the present application. The electronic device 30 includes a memory 31 and a processor 32. 31 is used to store the computer program 34 and transmit the computer program 34 to the processor 32. In other words, the processor 32 includes a memory 31 The method according to the embodiment of the present application can be realized by calling and executing the computer program 34 from .
[0431] For example, the processor 32 may be used to execute the steps of the method 200 based on instructions in the computer program 34 .
[0432] In some embodiments of the present application, the processor 32 may include, but is not limited to, a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like.
[0433] In some embodiments of the present application, the memory 31The memory may include, but is not limited to, volatile and / or non-volatile memory. Non-volatile memory may 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 may be random access memory (RAM) that acts as an external high-speed cache. By way of illustrative, but non-limiting example, various RAMs are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch-link DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DRRAM).
[0434] In some embodiments of the present application, the computer program 34 may be divided into one or more units, which may be stored in the memory. 31 and executed by the processor 32 to complete the method of the present application. The one or more units may be a series of computer program instruction segments capable of performing a specific function, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30.
[0435] figure 21 As shown in FIG. 1, the electronic device 30 may further include a transceiver 33. The transceiver 33 may include a processor 32 or a memory 31 It is possible to connect to.
[0436] The processor 32 can control the transceiver 33 to communicate with other devices. Specifically, the transceiver 33 can transmit information or data to other devices, or receive information or data transmitted by other devices. The transceiver 33 can include a transmitter and a receiver. The transceiver 33 can further include an antenna. The number of antennas can be one or more.
[0437] Each component in the electronic device 30 is connected via a bus system. In addition to a data bus, the bus system further includes a power bus, a control bus, and a status signal bus.
[0438] FIG. 22 is a block diagram illustrating a video encoding / decoding system 40 according to an embodiment of the present application.
[0439] 22, the video encoding / decoding system 40 may include a video encoder 41 and a video decoder 42. The video encoder 41 is used to perform a video encoding method according to an embodiment of the present application, and the video decoder 42 is used to perform a video decoding method according to an embodiment of the present application.
[0440] In the present application, a computer storage medium is further provided. The computer storage medium has a computer program stored therein. The computer program, when executed by a computer, enables the computer to perform the method in the above method embodiment. Alternatively, in an embodiment of the present application, a computer program product is further provided, comprising instructions, when executed by a computer, causes the computer to perform the method in the above method embodiment.
[0441] When implemented by software, all or part of the above embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the process or function of the embodiments of the present application is 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 website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line (DSL), etc.) or wirelessly (e.g., infrared, radio, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer, or can be a data storage device integrated with one or more available media, such as a server, data center, etc. The available medium may be a magnetic medium (e.g. a floppy disk, hard disk or magnetic tape), an optical medium (e.g. a digital versatile disc (DVD)), or a semiconductor medium (e.g. a solid state disk (SSD)).
[0442] Those skilled in the art can be aware that the present application can be realized by electronic hardware or a combination of computer software and electronic hardware in combination with each exemplary unit and algorithm operation described in the embodiments disclosed herein. Whether these functions are performed by hardware or software is determined by the specific application of the technical solution and the design constraints. Those skilled in the art can realize the described functions using different methods for each specific application, but these realizations should not be considered as going beyond the scope of the present application.
[0443] In some embodiments of the present application, it should be understood that the disclosed system, device, and method may be realized in other forms. For example, the above device embodiment is merely exemplary. For example, the division of units is merely a division of logical functions, and may have other division forms when actually realized. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. Furthermore, the couplings, direct couplings, and communication connections between each other shown or discussed may be indirect couplings or communication connections by some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0444] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, i.e., they may be located in one place or may be arranged in multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the technical solution of the present embodiment. For example, each functional unit according to each embodiment of the present application may be integrated into one processing unit, each unit may be physically present alone, or two or more units may be integrated into one unit.
[0445] The above content is only a specific embodiment of the present application, and the protection scope of the present application is not limited thereto. Any modifications or replacements that a person skilled in the art can easily think of within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. 1. A video encoding method, comprising: Obtaining a current block that includes a first component; determining an initial intra-prediction mode of the first component of the current block; If the initial intra-prediction mode is a derived mode, obtaining at least two intra-prediction modes of a second component corresponding to the current block; The at least two intra prediction modes of the second component are intra prediction modes of the first component of the current block, where the intra prediction modes of the first component of the current block include at least two intra prediction modes; performing intra prediction on the first component of the current block using each of the at least two intra prediction modes of the first component of the current block to obtain a prediction block corresponding to each of the intra prediction modes; When a total number of samples in the first component of the current block is less than a total number of samples in the second component corresponding to the current block, downsampling a second weighting matrix of the second component corresponding to the current block to obtain a first weighting matrix; and performing a weighting operation on the prediction blocks corresponding to the various intra-prediction modes according to the first weighting matrix to obtain a final prediction block of the first component of the current block.
13. A video encoding method comprising:
2. 1. A video decoding method, comprising: Obtaining at least two intra prediction modes of a current block including a first component and a second component corresponding to the current block by parsing a bitstream; determining an initial intra-prediction mode of the first component of the current block; if the initial intra-prediction mode is identified as a derived mode, setting the at least two intra-prediction modes of the second component to intra-prediction modes of the first component of the current block, where the intra-prediction modes of the first component of the current block include at least two intra-prediction modes; performing intra prediction on the first component of the current block using each of the at least two intra prediction modes of the first component of the current block to obtain a prediction block corresponding to each of the intra prediction modes; When a total number of samples in the first component of the current block is less than a total number of samples in the second component corresponding to the current block, downsampling a second weighting matrix of the second component corresponding to the current block to obtain a first weighting matrix; and performing a weighting operation on the prediction blocks corresponding to the various intra-prediction modes according to the first weighting matrix to obtain a final prediction block of the first component of the current block.
13. A video decoding method comprising:
3. a weighted prediction flag is carried in the bitstream, the weighted prediction flag being used to indicate whether the prediction block of the second component is obtained by performing prediction in the at least two intra prediction modes; 3. The video decoding method of claim 2.
4. The bitstream carries mode information of the initial intra-prediction mode of the first component of the current block.
4. The video decoding method of claim 3.
5. Determining the initial intra-prediction mode of the first component of the current block includes: If the weighted prediction flag is carried in the bitstream and mode information of the initial intra-prediction mode of the first component of the current block is not carried, determining that the initial intra-prediction mode of the first component of the current block is the derived mode.
4. The video decoding method of claim 3.
6. 1. A video decoder comprising: a processor and a memory; A computer program is stored in the memory; The processor calls the computer program stored in the memory, Obtaining at least two intra prediction modes of a current block including a first component and a second component corresponding to the current block by parsing a bitstream; determining an initial intra-prediction mode of the first component of the current block; if the initial intra-prediction mode is identified as a derived mode, setting the at least two intra-prediction modes of the second component to intra-prediction modes of the first component of the current block, where the intra-prediction modes of the first component of the current block include at least two intra-prediction modes; performing intra prediction on the first component of the current block using each of the at least two intra prediction modes of the first component of the current block to obtain a prediction block corresponding to each of the intra prediction modes; When a total number of samples in the first component of the current block is less than a total number of samples in the second component corresponding to the current block, downsampling a second weighting matrix of the second component corresponding to the current block to obtain a first weighting matrix; Performing a weighting operation on the prediction block corresponding to the various intra prediction modes according to the first weighting matrix to obtain a final prediction block of the first component of the current block; is configured to run 13. A video decoder comprising:
Citation Information
Patent Citations
Intra video coding using a split tree structure
JP2019528025A
Intra prediction device, image encoding device, image decoding device and program
JP2020156087A
Image encoding / decoding method and device, and recording medium storing bitstream
US20200366900A1