Chromablock prediction method and apparatus
By classifying luma and chroma values into sets and using simplified calculations for scaling and offset factors, the chroma block prediction efficiency is enhanced, addressing the complexity issues in existing methods.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-04-10
AI Technical Summary
The existing chroma block prediction methods in video coding, such as Cross-Component Linear Mode (CCLM), require complex calculations due to the determination of scaling and offset factors, leading to low prediction efficiency.
A method that classifies luma and chroma values into separate sets based on average values, determines a scaling factor and offset factor using these averages, and uses simplified multiplication to derive prediction information for chroma blocks.
This approach reduces computational complexity and improves chroma block prediction efficiency by minimizing the number of multiplications required.
Smart Images

Figure 2026062724000001_ABST
Abstract
Description
[Technical Field]
[0001] This application claims priority to Chinese Patent Application No. 201910005667.3, filed on January 3, 2019, entitled “Chromablock Prediction Method and Apparatus,” which is incorporated herein by reference in its entirety.
[0002] This application relates to the field of video coding and decoding technology, and more particularly to a chroma block prediction method and apparatus. [Background technology]
[0003] With the development of internet technology, the number of video application programs is increasing, and these applications are placing increasingly greater demands on high-definition video. However, because the data volume of high-definition video is relatively large, it is necessary to encode the video when it needs to be transmitted within a limited network bandwidth. Generally, encoding processes mainly include intra-prediction, inter-prediction, transformation, quantization, entropy coding, intra-loop filtering, and similar processes.
[0004] In related technologies, when intra-prediction is required, the prediction information for chroma blocks can be determined using Cross-Component Linear Mode (CCLM) (sometimes referred to as Cross-Component Prediction (CCP) mode, Cross-Component Intra Prediction (CCIP) mode, or simply Linear Mode (LM)). This is a chroma intra-prediction method that uses the correlation between luminance and chrominance. In this method, the prediction information for chroma blocks is derived according to a linear model using reconstructed luma components, which is given by the following equation:
number
number
[0005] Thus, for each chroma block in which CCLM is used, it is necessary to determine the scaling factor and offset factor. However, the above determination process requires a large amount of multiplication and is relatively complex. As a result, the chroma block prediction efficiency is relatively low. [Overview of the project]
[0006] To address problems in related technologies, embodiments of this application provide a chromablock prediction method and apparatus. The technical solution is as follows:
[0007] According to a first embodiment, a chromablock prediction method is provided. This method is The chroma value of a chroma sample at a preset position is obtained from adjacent samples of a chroma block, the luma value of a luma sample corresponding to the chroma sample at the preset position is obtained based on adjacent samples of a luma block corresponding to the chroma block, the obtained luma values are classified into a first luma set and a second luma set, the chroma values of chroma samples corresponding to luma samples related to luma values in the first luma set are grouped into the first chroma set, and the chroma values of chroma samples corresponding to luma samples related to luma values in the second luma set are grouped into the second chroma set. This includes determining a scaling factor in the linear model corresponding to the chroma block based on the average value of the luma values in the first luma set, the average value of the luma values in the second luma set, the average value of the chroma values in the first chroma set, and the average value of the chroma values in the second chroma set; determining an offset factor in the linear model corresponding to the chroma block based on the scaling factor; and determining prediction information for the chroma block based on the scaling factor, the offset factor, and the luma reconstruction information corresponding to the chroma block.
[0008] In the solution shown in this embodiment of the application, when it is currently necessary to perform intraprediction on a chroma block (hereinafter sometimes abbreviated as chroma block), the chroma value of a chroma sample at a preset position can be obtained from adjacent samples of the chroma block. Then, a luma block corresponding to the chroma block can be determined, and the luma value of a luma sample corresponding to the chroma sample at a preset position can be obtained based on adjacent samples of the luma block. The obtained luma values are classified into a first luma set and a second luma set. The chroma values are automatically classified into a first luma set and a second luma set based on the luma values. Then, based on the average value of the luma values in the first luma set, the average value of the luma values in the second luma set, the average value of the chroma values in the first chroma set, and the average value of the chroma values in the second chroma set, a scaling factor in the linear model corresponding to the chroma block is determined. Then, based on the scaling factor, an offset factor in the linear model corresponding to the chroma block is determined. Finally, based on the luma reconstruction information, scaling factor, and offset factor corresponding to the chroma block, predictive information for the chroma block is obtained, and the luma reconstruction information corresponding to the chroma block includes downsampling information for the luma reconstruction block corresponding to the chroma block.
[0009] Thus, since only a small amount of multiplication is required, the computational complexity can be reduced, and the chroma block prediction efficiency can be improved.
[0010] In one possible implementation, the method further includes acquiring instruction information, determining an intra-prediction mode corresponding to the chroma block based on the instruction information, the intra-prediction mode including at least one of linear mode LM, linear mode above (LMA), and linear mode left (LML), and determining the preset position based on the intra-prediction mode corresponding to the chroma block.
[0011] In the solution shown in this embodiment of this application, when encoding is performed, the encoder may encode instruction information into a bitstream and then send the bitstream to the decoder. The decoder may obtain instruction information from the received bitstream and determine an intra-prediction mode corresponding to a chroma block based on the instruction information. The decoder then determines a preset position based on the intra-prediction mode corresponding to the chroma block. Thus, the decoder may determine an intra-prediction mode to be used for a chroma block and then determine a preset position based on the intra-prediction mode.
[0012] In one possible implementation, obtaining the chroma value of a chroma sample at a preset position from adjacent samples of a chroma block includes obtaining the chroma value of the chroma sample at the preset position from adjacent samples of the chroma block based on a predetermined correspondence between an intra-prediction mode and a preset position, and the intra-prediction mode corresponding to the chroma block.
[0013] In the solution shown in this embodiment of the application, when decoding is performed, the decoder may obtain a predetermined correspondence between an intra-prediction mode and a position, and from this correspondence, determine a preset position corresponding to the intra-prediction mode of the chroma block. Then, based on the preset position, the decoder obtains the chroma value of the chroma sample at the preset position from the adjacent samples of the chroma block.
[0014] Thus, different preset positions can be selected for different intra-prediction modes, making the chromablock prediction results more accurate.
[0015] In one possible implementation, the position coordinates of the upper adjacent samples of the chroma block are (0,-1), (1,-1), ..., and (X-1,-1), the position coordinates of the left adjacent samples of the chroma block are (-1,0), (-1,1), ..., and (-1,Y-1), where X represents the width of the chroma block and Y represents the height of the chroma block. If the intra-prediction mode corresponding to the chroma block is the cross-component linear mode LM, then the position coordinates of the chroma samples at the preset positions are (0,-1), (X-1,-1), (-1,-0), and (-1,Y-1).
[0016] In the solution shown in this embodiment of the application, a rectangular planar coordinate system is correspondingly established with respect to the chroma block. The first chroma sample in the upper left corner of the chroma block is used as the coordinate origin, with the horizontal direction to the right being the positive x-axis and the vertical direction downwards being the positive y-axis. Thus, the position coordinates of the upper adjacent samples of the chroma block are (0,-1), (1,-1), ..., and (X-1,-1), and the position coordinates of the left adjacent samples of the chroma block are (-1,0), (-1,1), ..., and (-1,Y-1), where X represents the width of the chroma block (i.e., the number of samples in the width direction of the chroma block) and Y represents the height of the chroma block (i.e., the number of samples in the height direction of the chroma block). When the intra prediction mode is LM, the position coordinates of the chroma samples at the preset positions are (0,-1), (X-1,-1), (-1,-0), and (-1,Y-1).
[0017] In one possible implementation, the position coordinates of the upper adjacent samples of the chroma block are (0,-1), (1,-1), ..., and (X-1,-1), where X represents the width of the chroma block, and if the intra-prediction mode corresponding to the chroma block is LMA on cross-component linear mode, the position coordinates of the preset position are (0,-1), (X / 4,-1), (X-1-X / 4,-1), and (X-1,-1), or (0,-1), (X / 4,-1), (3×X / 4,-1), and (X-1,-1).
[0018] In the solution shown in this embodiment of the application, a rectangular planar coordinate system is correspondingly established with respect to the chroma block. The first chroma sample in the upper left corner of the chroma block is used as the coordinate origin, with the horizontal direction to the right being the positive x-axis and the vertical direction downwards being the positive y-axis. When the intra-prediction mode is LMA, the position coordinates of the preset positions are (0,-1), (X / 4,-1), (X-1-X / 4,-1), and (X-1,-1), or (0,-1), (X / 4,-1), (3×X / 4,-1), and (X-1,-1), where X represents the width of the chroma block (i.e., the number of samples in the width direction of the chroma block).
[0019] In one possible implementation, the position coordinates of the left adjacent sample of the chroma block are (-1,0), (-1,1), ..., and (-1,Y-1), where Y represents the height of the chroma block, and if the intra prediction mode corresponding to the chroma block is cross-component linear mode left LML, the position coordinates of the preset position are (-1,0), (-1,Y / 4), (-1,Y-1-Y / 4), and (-1,Y-1), or (-1,0), (-1,Y / 4), (-1,3×Y / 4), and (-1,Y-1).
[0020] In the solution shown in this embodiment of the application, a rectangular planar coordinate system is correspondingly established with respect to the chroma block. The first chroma sample in the upper left corner of the chroma block is used as the coordinate origin, with the horizontal direction to the right being the positive x-axis and the vertical direction downwards being the positive y-axis. When the intra-prediction mode is LML, the position coordinates of the preset positions are (-1,0), (-1,Y / 4), (-1,Y-1-Y / 4), and (-1,Y-1), or (-1,0), (-1,Y / 4), (-1,3×Y / 4), and (-1,Y-1), where Y represents the height of the chroma block (i.e., the number of samples in the height direction of the chroma block).
[0021] In one possible implementation, obtaining the luma value of the luma sample corresponding to the chroma sample at the preset position based on the adjacent samples of the luma block corresponding to the chroma block includes determining, from the adjacent samples of the luma block, that the position coordinates of the luma sample corresponding to the chroma sample at the i-th preset position within the preset position are (2×X i , 2×Y i ), where the position coordinates of the chroma sample at the i-th preset position are (X i , Y i ), and obtaining the luma value of the luma sample corresponding to the chroma sample at the preset position from the adjacent samples of the luma block corresponding to the chroma block based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, or determining, from the adjacent samples of the luma block, the position coordinates of a plurality of samples corresponding to the j-th preset position based on the position coordinates of the chroma sample at the j-th preset position within the preset position, determining the position coordinates of the luma sample corresponding to the chroma sample at the j-th preset position based on the position coordinates of the plurality of samples, and obtaining the luma value of the luma sample corresponding to the chroma sample at the preset position from the adjacent samples of the luma block corresponding to the chroma block based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position.
[0022] In the solution shown in this embodiment of this application, when the chroma block is decoded, it can be determined that the position coordinates of the chroma sample at the i-th preset position within the preset position are (X i , Y i ), and the position coordinates of the luma sample corresponding to the chroma sample at the i-th preset position are (2×X i , 2×Y i ) from the adjacent samples of the luma block. Thus, the position coordinates of the luma sample corresponding to the chroma sample at the preset position can be obtained.
[0023] Alternatively, when a chroma block is decoded, the position coordinates of the chroma sample at the j-th preset position within the preset positions are (X j ,Y j ) is the case. For the j-th preset position chroma sample, (X j ,Y j Multiple sample positions of adjacent samples in the corresponding luma block are determined, and then, based on the position coordinates of these multiple sample positions, the position coordinates of the luma sample corresponding to the chroma sample at the j-th preset position are obtained. For example, a weighting method may be used. The position coordinates of the multiple sample positions are (2 × X j ,2×Y j ), (2 × X j ,2×Y j (+1), (2×X j +1,2×Y j ), (2 × X j +1,2×Y j (+1), (2×X j +2, 2 × Y j ), and (2×X j +2, 2 × Y j It can be set to +1), and all these sample positions correspond to weight values of 2 / 8, 1 / 8, 1 / 8, 2 / 8, 1 / 8, and 1 / 8, respectively. After weighting, the position coordinates of the luma sample corresponding to the j-th preset position are (2 × X j ,2×Y j A value of +0.5) can be obtained. Furthermore, a weighting method does not have to be used. This is not limited to this embodiment of the application. Thus, the position coordinates of the luma sample corresponding to the chroma sample at the preset position can be obtained. Then, based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, the luma value can be obtained from the corresponding luma sample.
[0024] Thus, the luma value can be determined more quickly.
[0025] In one possible implementation, instruction information is obtained from the received bitstream.
[0026] In the solution shown in this embodiment of this application, when performing encoding, the encoder may encode instruction information pointing to an intra-predictive mode into a bitstream and then send the bitstream to the decoder. The decoder may obtain instruction information from the received bitstream.
[0027] Thus, the decoder can determine the intra-prediction mode to be used for the chroma block.
[0028] In one possible implementation, classifying the acquired luma values into a first luma set and a second luma set includes determining the average value of the luma values of the luma samples corresponding to the chroma samples at the preset positions, grouping the luma values among the luma values of the luma samples corresponding to the chroma samples at the preset positions that are less than or equal to the average value of the luma values into the first luma set, and grouping the luma values among the luma values of the luma samples corresponding to the chroma samples at the preset positions that are greater than the average value of the luma values into the second luma set.
[0029] In the solution shown in this embodiment of this application, among all the obtained luma values, luma values that are less than or equal to the average luma value are determined and these luma values are grouped into a first luma set. Furthermore, among all the obtained luma values, luma values that are greater than the average luma value can be determined and these luma values are grouped into a second luma set. Thus, the luma values in the first luma set are smaller than the luma values in the second luma set.
[0030] Thus, the chroma block prediction speed can be increased without degrading encoding performance.
[0031] In one possible implementation, classifying the acquired luma values into a first luma set and a second luma set includes obtaining a first luma value queue by sorting the luma values of the luma samples corresponding to the chroma samples at the preset positions in ascending order, and if the number of luma samples in the first luma value queue is even, grouping the luma values of the first half of the first luma value queue into the first luma set and grouping the luma values of the second half of the luma value queue into the second luma set; or obtaining a second luma value queue by sorting the luma values of the luma samples corresponding to the chroma samples at the preset positions in descending order, and if the number of luma samples in the second luma value queue is even, grouping the luma values of the second half of the second luma value queue into the first luma set and grouping the luma values of the first half of the luma value queue into the second luma set.
[0032] In the solution shown in this embodiment of the application, the acquired luma values are sorted in ascending order to obtain a first luma value queue. If the number of luma samples in the first luma value queue is even, the luma values of the first half of the first luma value queue can be determined and grouped into a first luma set, and further, the luma values of the second half of the first luma value queue can be determined and grouped into a second luma set. Alternatively, the acquired luma values are sorted in descending order to obtain a second luma value queue. If the number of luma samples in the second luma value queue is even, the luma values of the second half of the second luma value queue can be determined and grouped into a first luma set, and further, the luma values of the first half of the second luma value queue can be determined and grouped into a second luma set.
[0033] Thus, the chroma block prediction speed can be increased without degrading encoding performance.
[0034] In one possible implementation, determining the scaling coefficient in the linear model corresponding to the chroma block based on the average value of the chroma values in the first chroma set, the average value of the chroma values in the second chroma set, the average value of the chroma values in the first chroma set, and the average value of the chroma values in the second chroma set is α=(C Lmean -C Rmean ) / (L Lmean -L Rmean ) including the fact that, where α is the scaling coefficient in the linear model corresponding to the chroma block, C Lmean C is the average value of the chroma values in the first chroma set, Rmean L is the average value of the chroma values in the second chroma set, Lmean L is the average value of the luma values in the first luma set, Rmean This is the average value of the luma values in the second luma set.
[0035] In one possible implementation, determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient includes determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient, the mean value of the chroma values in the first chroma set, and the mean value of the luma values in the first luma set.
[0036] In the solution shown in this embodiment of the application, the mean value of chroma values in a first chroma set can be determined, as can the mean value of luma values in a first luma set. Then, based on the scaling factor, the mean value of chroma values in the first chroma set, and the mean value of luma values in the first luma set, an offset factor in the linear model corresponding to the chroma block is determined.
[0037] In one possible implementation, determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient, the average value of the chroma values in the first chroma set, and the average value of the luma values in the first luma set is β=C Lmean -α*L Lmean This includes the fact that, where α is the scaling coefficient, β is the offset factor in the linear model corresponding to the chroma block, and C Lmean L is the average value of the chroma values in the first chroma set, Lmean This is the average value of the luma values in the first luma set.
[0038] In one possible implementation, determining the offset factor in the linear model corresponding to the chroma block based on the scaling factor includes determining the offset factor in the linear model corresponding to the chroma block based on the scaling factor, the mean value of the chroma sample at the preset position, and the mean value of the luma sample corresponding to the chroma sample.
[0039] In the solution shown in this embodiment of the application, the average value of all acquired chroma values can be determined, as can the average value of all acquired luma values. Then, based on the scaling factor, the average value of all chroma values, and the average value of all luma values, the offset factor in the linear model corresponding to the chroma block is determined.
[0040] In one possible implementation, determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient, the average value of the chroma sample at the preset position, and the average value of the luma sample corresponding to the chroma sample is β=C mean -α*L meanThis includes the fact that, where α is the scaling coefficient, β is the offset factor in the linear model corresponding to the chroma block, and C mean L is the average value of the chroma values of the chroma samples at the preset position, mean This is the average value of the luma values of the luma samples corresponding to the chroma samples at the preset positions.
[0041] According to a second embodiment, a chromablock prediction device is provided. The prediction device includes a processor and a memory, the memory being configured to store processor-executable instructions, and the processor executing the chromablock prediction method provided in the first embodiment by executing the instructions.
[0042] According to a third aspect, a chromablock prediction device is provided, which includes one or more modules configured to implement the chromablock prediction method provided in the first aspect.
[0043] According to a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions, and when the computer-readable storage medium is executed on a computing device, the computing device is made capable of executing the chromablock prediction method provided in the first aspect.
[0044] According to a fifth aspect, a computer program product including instructions is provided. When the computer program product is executed on a computing device, the computing device is made capable of executing the chromablock prediction method provided in the first aspect.
[0045] The beneficial effects brought about by the technical solutions provided in the embodiments of this application include at least the following:
[0046] In embodiments of this application, during encoding or decoding, the chroma value of a chroma sample at a preset position may be obtained from adjacent samples of the chroma block. Then, the luma value of the luma sample corresponding to the chroma sample at the preset position is obtained from adjacent samples of the luma block corresponding to the chroma block, and the obtained luma values are classified into a first luma set and a second luma set, and based on the classification of luma values, the corresponding chroma values are classified into the first chroma set and the second chroma set. Next, a scaling factor in the linear model corresponding to the chroma block can be determined based on the average value of luma values in the first luma set, the average value of luma values in the second luma set, the average value of chroma values in the first chroma set, and the average value of chroma values in the second chroma set, and after the scaling factor has been determined, an offset factor in the linear model corresponding to the chroma block can be determined based on the scaling factor. Finally, prediction information for the chroma block is determined based on the scaling factor, the offset factor, and the luma reconstruction information corresponding to the chroma block. Thus, in encoding or decoding, a preset number of chroma values are selected and then classified into two chroma sets, and a preset number of luma values are selected and then classified into two luma sets. Based on the average value of the luma values in each luma set and the average value of the chroma values in each chroma set, a scaling factor in the linear model corresponding to the chroma block is determined, and furthermore, an offset factor is determined. Since only a small amount of multiplication is required, encoding and decoding times can be reduced. [Brief explanation of the drawing]
[0047] [Figure 1] This is a block diagram showing an example of a video encoding system that implements one embodiment of this application. [Figure 2] This is a block diagram of an example of a video coding system that includes one or two of the encoder 20 in Figure 3 and the decoder 30 in Figure 4. [Figure 3] This is a block diagram showing an example configuration of a video encoder implementing one embodiment of this application. [Figure 4] This is a block diagram showing an example configuration of a video decoder implementing one embodiment of this application. [Figure 5] A cabinet of examples of encoding or decoding devices. [Figure 6] This block shows an example of another encoding device or another decoding device. [Figure 7] This shows an example of a sampling grid in the YUV format. [Figure 8] This shows one embodiment of the cross-component prediction mode. [Figure 9] This is a schematic diagram of adjacent samples. [Figure 10] This is another schematic diagram of an adjacent sample. [Figure 11] This is a schematic flowchart of the chromablock prediction method. [Figure 12] This is a schematic diagram of the established rectangular coordinate system. [Figure 13] This is a schematic diagram of the chroma samples at the preset positions. [Figure 14(a)] Figures 14(a) and 14(b) are schematic diagrams of chroma samples at preset positions. [Figure 14(b)] Figures 14(a) and 14(b) are schematic diagrams of chroma samples at preset positions. [Figure 15(a)] Figures 15(a) and 15(b) are schematic diagrams of chroma samples at preset positions. [Figure 15(b)] Figures 15(a) and 15(b) are schematic diagrams of chroma samples at preset positions. [Figure 16(a)] Figures 16(a)-16(d) are schematic diagrams of chroma samples at preset positions. [Figure 16(b)] Figures 16(a)-16(d) are schematic diagrams of chroma samples at preset positions. [Figure 16(c)] Figures 16(a)-16(d) are schematic diagrams of chroma samples at preset positions. [Figure 16(d)]Figures 16(a)-16(d) are schematic diagrams of chroma samples at preset positions. [Figure 17] This is a schematic diagram of the chromablock prediction device. [Modes for carrying out the invention]
[0048] To further clarify the purpose, technical solution, and advantages of this application, the implementation of this application will be described in detail below with reference to the attached drawings.
[0049] To facilitate understanding of this application, the system architecture and the terminology used herein will first be explained below.
[0050] Video coding typically involves processing a series of pictures that form a video or video sequence. In the field of video coding, the terms “picture,” “frame,” and “image” may be used synonymously. As used in this application (or disclosure), video coding refers to video encoding or video decoding. Video encoding is performed on the source side and typically involves processing the original video pictures (e.g., through compression) to reduce the amount of data required to represent the video pictures (for more efficient storage and / or transmission). Video decoding is performed on the destination side and typically involves the reverse processing of the encoder to reconstruct the video pictures. In embodiments, “encoding” of video pictures should be understood as “encoding” or “decoding” with respect to a video sequence. The combination of encoding and decoding is also referred to as coding (encoding and decoding).
[0051] Each picture in a video sequence is typically divided into a set of non-overlapping blocks, and coding is usually performed at the block level. Specifically, on the encoder side, the video is typically processed, or encoded, at the block level (also referred to as picture blocks or video blocks). For example, a predicted block is generated through spatial (intra-picture) prediction and temporal (inter-picture) prediction, and this predicted block is subtracted from the current block (the block being processed or being processed) to obtain a residual block, which is then transformed and quantized in a transformation domain to reduce the amount of data that will be transmitted (compressed). On the decoder side, the current block is reconstructed for representation by applying the reverse process to the encoded or compressed block as applied to the encoder. Furthermore, the encoder replicates the decoder's processing loop so that the encoder and decoder produce the same predictions (e.g., intra-prediction and inter-prediction) and / or reconstruction to process, i.e., encode subsequent blocks.
[0052] The term “block” may refer to a part of a picture or frame. Key terms in this application are defined as follows:
[0053] Current Block: The current block is the block being processed. For example, in encoding, the current block is the block being encoded, and in decoding, the current block is the block being decoded. If the block being processed is a chroma component block, that block is called the current chroma block. The luma block corresponding to the current chroma block may be called the current luma block.
[0054] Reference Blocks: Reference blocks are blocks that provide reference signals to the current block. In the search process, multiple reference blocks may be considered to find the optimal reference block.
[0055] Prediction Blocks: Blocks that provide a prediction for the current block are called prediction blocks. For example, after considering several reference blocks, the optimal reference block is found. That optimal reference block provides a prediction for the current block, and that block is called a prediction block.
[0056] Picture block signal: A picture block signal is a sampled value, sampled value, or sampled signal within a picture block.
[0057] Prediction signal: The sampled value, sampled value, or sampled signal within the prediction block is called the prediction signal.
[0058] Hereinafter, embodiments of the encoder 20, decoder 30, and encoding system 10 will be described based on Figures 1 and 2 to 4.
[0059] Figure 1 is a conceptual or schematic block diagram showing an example of an encoding system 10, such as a video encoding system 10 that may use the technology of this application (this disclosure). The encoder 20 (e.g., video encoder 20) and decoder 30 (e.g., video decoder 30) in the video encoding system 10 represent example devices that may be configured to perform intra-prediction according to the various examples described in this application. As shown in Figure 1, the encoding system 10 includes a source device 12 configured to provide encoded data 13, such as an encoded picture 13, to a destination device 14 or the like for decoding the encoded data 13.
[0060] The source device 12 includes an encoder 20 and may additionally or optionally include a picture source 16, a pre-processing unit 18 such as a picture pre-processing unit 18, and a communication interface or communication unit 22.
[0061] The picture source 16 may include, or may be, any type of device that generates pictures or comments (for screen content encoding, where some text on the screen is also considered to be the picture to be encoded or part of the picture), such as any type of picture capture device configured to capture real-world pictures and / or computer graphics processing unit configured to generate computer animated pictures, for example, computer animated pictures, or any type of device configured to acquire and / or provide real-world pictures or computer animated pictures (e.g., screen content or virtual reality (VR) pictures) and / or any combination thereof (e.g., augmented reality (AR) pictures).
[0062] A picture can be considered a two-dimensional array or matrix of samples with luminance values. A sample within an array may also be called a pixel (a shortened form of picture element) or pel. The number of samples in the horizontal and vertical (or axis) directions of the array or picture determines the size and / or resolution of the picture. For color representation, typically three color components are used; that is, a picture can be represented as, or contain, three sample arrays. In the RGB format or color space, a picture contains corresponding red, green, and blue sample arrays. However, in image coding, each sample is typically represented in a luminance / chrominance format or color space; for example, an image in the YCbCr format contains a luminance component indicated by Y (sometimes indicated by L) and two chrominance components indicated by Cb and Cr. The luminance component Y represents brightness or gray level intensity (for example, these two are the same in a grayscale picture), while the two chrominance components Cb and Cr represent chromaticity or color information components. Therefore, a picture in YCbCr format contains a luminance sample array of luminance sample values (Y) and two chrominance sample arrays of chrominance values (Cb and Cr). A picture in RGB format can be converted to a picture in YCbCr format, and vice versa. This process is also called color transformation or color conversion. If a picture is monochrome, it may contain only luminance sample arrays.
[0063] The picture source 16 (e.g., video source 16) may be, for example, a camera configured to capture pictures, a memory such as a picture memory that contains or stores previously captured or generated pictures, and / or any type of (internal or external) interface for acquiring or receiving pictures. The camera may be, for example, a local camera or an integrated camera integrated with the source device, and the memory may be local memory or an integrated memory integrated with the source device. The interface may be, for example, an external interface for receiving pictures from an external video source. The external video source may be, for example, an external picture capture device such as a camera, external memory, or an external picture generation device. The external picture generation device may be, for example, an external computer graphics processing unit, a computer, or a server. The interface may be any type of interface according to any proprietary or standardized interface protocol, such as a wired or wireless interface or an optical interface. The interface for acquiring picture data 17 may be the same interface as the communication interface 22, or may be part of the communication interface 22.
[0064] Unlike the preprocessing unit 18 and the processing performed by the preprocessing unit 18, the picture 17 or picture data 17 (for example, video data 16) may also be referred to as the original picture 17 or original picture data 17.
[0065] The preprocessing unit 18 is configured to receive (original) picture data 17 and perform preprocessing on the picture data 17 to obtain a preprocessed picture 19 or preprocessed picture data 19. For example, the preprocessing performed by the preprocessing unit 18 may include cropping, color format conversion (e.g., RGB to YCbCr), color correction, or noise reduction. It should be understood that the preprocessing unit 18 may be an optional component.
[0066] The encoder 20 (for example, a video encoder 20) is configured to receive preprocessed picture data 19 and provide encoded picture data 21 (details will be described further below, for example, based on Figure 3 or Figure 5). In one example, the encoder 20 may be configured to perform the following embodiments 1 to 7.
[0067] The communication interface 22 of the source device 12 can be configured to receive encoded picture data 21 and transmit the encoded picture data 21 to another device, such as the destination device 14 or some other device, for storage or direct reconstruction, or it can be configured to process the encoded picture data 21 before storing and / or transmitting the encoded data 13 to the other device. The other device is, for example, the destination device 14 or any other device used for decoding or storage.
[0068] The destination device 14 includes a decoder 30 (for example, a video decoder 30) and may additionally or optionally include a communication interface or communication unit 28, a post-processing unit 32, and a display device 34.
[0069] For example, the communication interface 28 of the destination device 14 is configured to receive encoded picture data 21 or encoded data 13 directly from the source device 12 or any other source. Any other source is, for example, a storage device, and the storage device is, for example, an encoded picture data storage device.
[0070] Communication interfaces 22 and 28 may be configured to transmit or receive encoded picture data 21 or encoded data 13 over a direct communication link between the source device 12 and the destination device 14, or over any type of network. A direct communication link is, for example, a direct wired or wireless connection, and any type of network is, for example, a wired or wireless network or any combination thereof, or any type of private or public network or any combination thereof.
[0071] The communication interface 22 may be configured, for example, to encapsulate the encoded picture data 21 in an appropriate format, such as a packet, for transmission over a communication link or communication network.
[0072] The communication interface 28, as the corresponding part of the communication interface 22, may be configured to deencapsulate the encoded data 13 to obtain encoded picture data 21, and so on.
[0073] Both communication interfaces 22 and 28 may be configured as one-way communication interfaces, for example, an arrow pointing from source device 12 to destination device 14 is used for the encoded picture data 13 in Figure 1. Alternatively, they may be configured as two-way communication interfaces, for example, to send and receive messages to establish a connection, and to confirm and exchange communication links and / or other information related to data transmission, such as encoded picture data transmission.
[0074] The decoder 30 is configured to receive encoded picture data 21 and provide decoded picture data 31 or decoded picture 31 (details will be described further below, for example, based on Figure 4 or Figure 6). In one example, the decoder 30 may be configured to perform the following embodiments 1 to 7.
[0075] The post-processing unit 32 of the destination device 14 is configured to post-process decoded picture data 31 (also referred to as reconstructed picture data), such as decoded picture 131, to obtain post-processed picture data 33, such as a post-processed picture 33. The post-processing performed by the post-processing unit 32 may include, for example, color format conversion (e.g., YCbCr to RGB), color correction, cropping, resampling, or any other processing to prepare the decoded picture data 31 for display by the display device 34.
[0076] The display device 34 of the destination device 14 is configured to receive post-processed picture data 33 and display the picture to a user, viewer, or similar entity. The display device 34 can be, or may include, any type of display configured to present the reconstructed picture, such as an integrated or external display or monitor. For example, the display may include a liquid crystal display (LCD), an organic light-emitting diode (OLED) display, a plasma display, a projector, a microLED display, a liquid crystal on silicon (LCoS) display, a digital light processor (DLP), or any other type of display.
[0077] Although Figure 1 depicts the source device 12 and the destination device 14 as separate devices, the device embodiment may also include both the source device 12 and the destination device 14, or both the functions of the source device 12 and the functions of the destination device 14, i.e., both the source device 12 or its corresponding function and the destination device 14 or its corresponding function. In such embodiments, the source device 12 or its corresponding function and the destination device 14 or its corresponding function may be implemented using the same hardware and / or software, or using separate hardware and / or software, or using any combination thereof.
[0078] As will be readily apparent to those skilled in the art based on these descriptions, the presence and (exact) division of multiple / one functions or different unit functions of the source device 12 and / or destination device 14 shown in Figure 1 may vary depending on the actual device and application.
[0079] The encoder 20 (e.g., video encoder 20) and the decoder 30 (e.g., video decoder 30) may each be implemented as one of a variety of suitable circuits, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the technology is partially implemented in software, the device may implement the technology in this disclosure by storing software instructions in a suitable non-temporary computer-readable storage medium and executing those instructions in hardware using one or more processors. Any of the above (including hardware, software, combinations of hardware and software, and similar) may be considered as one or more processors. The video encoder 20 and the video decoder 30 may each be included in one or more encoders or decoders, and either of the encoders or decoders may be integrated as part of a combined encoder / decoder (codec) in the corresponding device.
[0080] Source device 12 may be referred to as a video encoding device or video encoding equipment. Destination device 14 may be referred to as a video decoding device or video decoding equipment. Source device 12 and destination device 14 may each be examples of video encoding devices or video decoding equipment.
[0081] The source device 12 and the destination device 14 may each include any one of a variety of devices, including any type of handheld or fixed device, such as a notebook or laptop computer, a mobile phone, a smartphone, a tablet or tablet computer, a video camera, a desktop computer, a set-top box, a television, a display device, a digital media player, a video game console, a video streaming transmission device (such as a content service server or content distribution server), a broadcast receiver, or a broadcast transmitter, and may or may not use any type of operating system.
[0082] In some cases, the source device 12 and destination device 14 may be provided for wireless communication. Therefore, the source device 12 and destination device 14 may be wireless communication devices.
[0083] In some cases, the video encoding system 10 shown in Figure 1 is merely an example, and the technology in this application may be applied to video encoding settings (e.g., video encoding or video decoding) that do not require any data communication between the encoding device and the decoding device. In other examples, data may be retrieved from local memory, streamed over a network, etc. The video encoding device can encode the data and store the data in memory, and / or the video decoding device can retrieve the data from memory and decode the data. In some examples, encoding and decoding are performed by devices that do not communicate with each other, but simply encode the data into memory and / or retrieve the data from memory and decode the data.
[0084] It should be understood that, for each of the above examples described with reference to the video encoder 20, the video decoder 30 may be configured to perform the reverse process. For signaling syntactic elements, the video decoder 30 may be configured to receive and parse the syntactic elements and decode the associated video data accordingly. In some examples, the video encoder 20 may entropically encode the syntactic elements into the encoded video bitstream. In such examples, the video decoder 30 may parse the syntactic elements and decode the associated video data accordingly.
[0085] Figure 2 shows an example of a video coding system 40, including the encoder 20 of Figure 3 and / or the decoder 30 of Figure 4, according to one embodiment. The system 40 may implement various combinations of the technologies of this application. In the illustrated implementation, the video coding system 40 may include an imaging device 41, a video encoder 20, a video decoder 30 (and / or a video decoder implemented by the logic circuit 47 of a processing unit 46), an antenna 42, one or more processors 43, one or more memories 44, and / or a display device 45.
[0086] As shown in Figure 2, the imaging device 41, antenna 42, processing unit 46, logic circuit 47, video encoder 20, video decoder 30, processor 43, memory 44, and / or display device 45 can communicate with each other. As described, the video coding system 40 is shown having both the video encoder 20 and the video decoder 30, but in different examples, the video coding system 40 may include only the video encoder 20 or only the video decoder 30.
[0087] In some examples, as shown in Figure 2, the video coding system 40 may include an antenna 42. For example, the antenna 42 may be configured to transmit or receive an encoded bitstream of video data. Furthermore, in some examples, the video coding system 40 may include a display device 45. The display device 45 may be configured to display video data. In some examples, as shown in Figure 2, the logic circuit 47 may be implemented by a processing unit 46. The processing unit 46 may include application-specific integrated circuit (ASIC) logic, a graphics processing unit, a general-purpose processor, or similar. The video coding system 40 may also include an optional processor 43. The optional processor 43 may similarly include application-specific integrated circuit logic, a graphics processing unit, a general-purpose processor, or similar. In some examples, the logic circuit 47 may be implemented by hardware such as dedicated video coding hardware, and the processor 43 may be implemented by universal software, an operating system, or similar. Furthermore, memory 44 can be any type of memory, such as volatile memory (e.g., static random access memory (SRAM) or dynamic random access memory (DRAM)) or non-volatile memory (e.g., flash memory). In one non-limiting example, memory 44 may be implemented by cache memory. In some examples, logic circuits 47 may access memory 44 (e.g., to implement a picture buffer). In other examples, logic circuits 47 and / or processing units 46 may include memory (e.g., a cache) for implementing a picture buffer or similar.
[0088] In some examples, the video encoder 20 implemented by logic circuits may include a picture buffer (e.g., implemented by a processing unit 46 or memory 44) and a graphics processing unit (e.g., implemented by a processing unit 46). The graphics processing unit may be communicatively coupled to the picture buffer. The graphics processing unit may include the video encoder 20 implemented by logic circuits 47 to implement various modules and / or any other encoder systems or subsystems described in this specification with reference to Figure 2. The logic circuits may be configured to perform various operations described in this specification.
[0089] The video decoder 30 may also be implemented by logic circuits 47 to implement various modules as described with reference to the decoder 30 in Figure 4 and / or any other decoder systems or subsystems as described in this specification. In some examples, the video decoder 30 implemented by logic circuits may include a picture buffer (implemented by a processing unit 46 or memory 44) and a graphics processing unit (for example, implemented by a processing unit 46). The graphics processing unit may be communicatively coupled to the picture buffer. The graphics processing unit may include the video decoder 30 implemented by logic circuits 47 to implement various modules as described with reference to Figure 4 and / or any other decoder systems or subsystems as described in this specification.
[0090] In some examples, the antenna 42 of the video coding system 40 may be configured to receive an encoded bitstream of video data. As described, the encoded bitstream may include data related to video frame coding as described in this specification, such as data related to encoding partitions (e.g., conversion coefficients or quantized conversion coefficients, optional indicators (described), and / or data defining encoding partitions), indicators, index values, mode selection data, or similar. The video coding system 40 may further include a video decoder 30 coupled to the antenna 42 and configured to decode the encoded bitstream. A display device 45 is configured to present video frames.
[0091] Encoder & Encoding Method Figure 3 is a schematic / conceptual block diagram of an example of a video encoder 20 configured to implement the technology described in this application (disclosure). In the example in Figure 3, the video encoder 20 includes a residual calculation unit 204, a transformation unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transformation unit 212, a reconstruction unit 214, a buffer 216, a loop filter unit 220, a decoded picture buffer (DPB) 230, a prediction unit 260, and an entropy coding unit 270. The prediction unit 260 may include an inter-prediction unit 244, an intra-prediction unit 254, and a mode selection unit 262. The inter-prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown in the figure). The video encoder 20 shown in Figure 3 may also be referred to as a hybrid video encoder or a hybrid video codec-based video encoder.
[0092] For example, the residual calculation unit 204, the transformation processing unit 206, the quantization unit 208, the prediction processing unit 260, and the entropy coding unit 270 form the forward signal path of the encoder 20, while the inverse quantization unit 210, the inverse transformation processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the decoded picture buffer 230, the prediction processing unit 260, etc., form the backward signal path of the encoder. The backward signal path of the encoder corresponds to the signal path of the decoder (see decoder 30 in Figure 4).
[0093] The encoder 20 receives a picture 201, or a block 203 of picture 201, such as a picture within a series of pictures forming a video or video sequence, by using an input 202 or similar. The picture block 203 may also be called the current picture block or the picture block to be encoded, and the picture 201 may also be called the current picture or the picture to be encoded (in particular, when the current picture is distinguished from other pictures in video coding, for example, other pictures that are in the same video sequence also include previously encoded and / or decoded pictures in the video sequence of the current picture).
[0094] division Embodiments of the encoder 20 may include a splitting unit (not shown in Figure 3) configured to divide a picture 201 into multiple non-overlapping blocks, such as block 203. The splitting unit may be configured to use the same block size and corresponding raster that defines the block size for all pictures in the video sequence, or it may be configured to vary the block size between pictures, subsets, or groups of pictures to divide each picture into a corresponding block.
[0095] In one example, the prediction processing unit 260 of the video encoder 20 may be configured to perform any combination of the division techniques described above.
[0096] For example, within picture 201, although the size of block 203 is smaller than the size of picture 201, block 203 can also be considered, or be regarded as, a two-dimensional array or matrix of samples having luminance values (sample values). In other words, block 203 may include, for example, one sample array (e.g., a luminance array in the case of monochrome picture 201), three sample arrays (e.g., one luminance array and two chrominance arrays in the case of a color picture), or any other number and / or type of arrays based on the color format used. The number of samples in the horizontal and vertical (or axis) directions of block 203 determines the size of block 203.
[0097] The encoder 20 shown in Figure 3 is configured to encode the picture 201 block by block, and is configured to perform encoding and prediction for each block 203, for example.
[0098] Residual calculation The residual calculation unit 204 is configured to calculate the residual block 205 based on the picture block 203 and the prediction block 265 (further details about the prediction block 265 will be provided later), and is configured to obtain the residual block 205 in the sample domain by subtracting the sample value of the prediction block 265 from the sample value of the picture block 203, for example (sample by sample).
[0099] conversion The transformation processing unit 206 is configured to apply a transformation, such as a discrete cosine transform (DCT) or a discrete sine transform (DST), to the sample values of the residual block 205 to obtain transformation coefficients 207 in the transformation domain. The transformation coefficients 207 are sometimes called residual transformation coefficients and represent the residual block 205 in the transformation domain.
[0100] The conversion processing unit 206 may be configured to apply an integer approximation of the DCT / DST, such as the conversion specified in HEVC / H.265. This integer approximation is typically scaled proportionally by a factor compared to the orthogonal DCT conversion. An additional scale factor is applied as part of the conversion process to maintain the norm of the residual block obtained through the forward and inverse conversions. This scale factor is typically selected based on some constraints, such as being a power of 2, the bit depth of the conversion coefficients, or a trade-off between the precision used in the shift operation and the implementation cost. For example, by using the inverse conversion processing unit 212, a specific scale factor may be specified for the inverse conversion on the decoder 30 side (and, correspondingly, for the inverse conversion on the encoder 20 side by using the inverse conversion processing unit 212, etc.), and correspondingly, by using the conversion processing unit 206, a corresponding scale factor may be specified for the forward conversion on the encoder 20 side.
[0101] Quantization The quantization unit 208 is configured to quantize the transformation coefficients 207 by applying scale quantization, vector quantization, or something similar to obtain quantized transformation coefficients 209. The quantized transformation coefficients 209 are sometimes called quantized residual coefficients 209. The quantization process can reduce the bit depth of some or all of the transformation coefficients 207. For example, if n is greater than m, an n-bit transformation coefficient may be truncated to an m-bit transformation coefficient during quantization. The degree of quantization can be changed by adjusting the quantization parameter (QP). For example, in scale quantization, multiple different scales may be applied to achieve finer or coarser quantization. Smaller quantization steps correspond to finer quantization, and larger quantization steps correspond to coarser quantization. The quantization parameter may indicate an appropriate quantization step. For example, the quantization parameter may be an index of a predetermined set of appropriate quantization steps. For example, smaller quantization parameters can correspond to finer quantization (smaller quantization steps), and larger quantization parameters can correspond to coarser quantization (larger quantization steps), and vice versa. Quantization may include division by the quantization step and inverse quantization performed by the corresponding quantization or inverse quantization unit 210, or it may include multiplication by the quantization step. In some standard-compliant embodiments, such as HEVC, the quantization step can be determined using the quantization parameter. Generally, the quantization step can be calculated based on the quantization parameter via a fixed-point approximation of an equation involving division. Further scale factors may be introduced into quantization and inverse quantization to restore the norm of the residual block, which may be modified for the scale used in the fixed-point approximation of the equations used for the quantization step and quantization parameter. In one implementation example, the scale of the inverse transform may be coupled with the scale of the inverse quantization. Alternatively, a customized quantization table may be used and signaled from encoder to decoder, for example, within a bitstream.Quantization is a lossy operation, and larger quantization steps result in greater losses.
[0102] The inverse quantization unit 210 is configured to obtain inversely quantized coefficients 211 by applying the inverse quantization of the quantization unit 208 to the quantized coefficients, for example, by applying the inverse quantization scheme of the quantization scheme applied by the quantization unit 208, based on or using the same quantization step as the quantization unit 208. The inversely quantized coefficients 211 are sometimes called inversely quantized residual coefficients 211 and may correspond to the conversion coefficients 207, but usually the losses resulting from quantization are different from those of the conversion coefficients.
[0103] The inverse transform processing unit 212 is configured to obtain an inverse transform block 213 in the sample domain by applying the inverse transform of the transform applied by the transform processing unit 206, such as the inverse discrete cosine transform or the inverse discrete sine transform. The inverse transform block 213 is sometimes called the inverse transform inverse quantization block 213 or the inverse transform residual block 213.
[0104] The reconstruction unit 214 (for example, the adder 214) is configured to add the inverse transform block 213 (i.e., the reconstruction residual block 213) to the prediction block 265 by adding the sample values of the reconstruction residual block 213 and the sample values of the prediction block 265, thereby obtaining the reconstruction block 215 in the sample domain.
[0105] Optionally, a buffer unit 216 (or simply “buffer” 216), such as a line buffer 216, is configured to buffer or store sample values, such as the reconstructed block 215 and the corresponding intra-prediction. In other embodiments, the encoder may be configured to use unfiltered reconstructed blocks and / or corresponding sample values stored in the buffer unit 216 for any type of estimation and / or prediction, such as intra-prediction.
[0106] For example, an embodiment of the encoder 20 may be configured such that the buffer unit 216 is configured not only to store the reconstructed block 215 for intra-prediction but also to store the filtered block 221 of the loop filter unit 220 (not shown in Figure 3), and / or the buffer unit 216 and the decoded picture buffer unit 230 form a single buffer. In other embodiments, blocks or samples (not shown in Figure 3) from the filtered block 221 and / or the decoded picture buffer 230 may be used as input or basis for intra-prediction.
[0107] The loop filter unit 220 (or simply “loop filter” 220) is configured to perform filtering on the reconstructed block 215 to ensure smooth sample conversion or improve image quality, thereby obtaining a filtered block 221. The loop filter unit 220 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters such as a bilateral filter, an adaptive loop filter (ALF), a sharpening or smoothing filter, or a cooperative filter. In Figure 3, the loop filter unit 220 is shown as an in-loop filter, but in other configurations, the loop filter unit 220 may be implemented as a post-loop filter. The filtered block 221 is sometimes referred to as the filtered reconstructed block 221. After the loop filter unit 220 has performed filtering on the reconstructed encoded block, the decoded picture buffer 230 may store the reconstructed encoded block.
[0108] Using an embodiment of the encoder 20 (correspondingly, the loop filter unit 220), loop filter parameters (e.g., sample adaptive offset information) can be output. For example, the loop filter parameters can be output directly, or the entropy coding unit 270 or some other entropy coding unit can output the loop filter parameters after performing entropy coding, thereby enabling the decoder 30 to receive the same loop filter parameters and apply them to decoding.
[0109] The decoded picture buffer 230 may be a reference picture memory that stores reference picture data for the video encoder 20 to encode video data. The DPB 230 may be any one of several types of memory, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), or resistive RAM (RRAM)) or other types of memory. The DPB 230 and buffer 216 may be provided by the same memory or by separate memories. In one example, the decoded picture buffer (DPB) 230 is configured to store filtered blocks 221. The decoded picture buffer 230 may also be configured to store other preceding filtered blocks, such as the preceding reconstructed block 221, of the same current picture or a different picture, such as a preceding reconstructed picture, and may also provide a preceding fully reconstructed i.e., decoded picture (and the corresponding reference block and corresponding sample) and / or a partially reconstructed current picture (and the corresponding reference block and corresponding sample) for interpretation or the like. In one example, if the reconstructed block 215 is reconstructed without in-loop filtering, the decoded picture buffer 230 is configured to store the reconstructed block 215.
[0110] The prediction processing unit 260, also referred to as the block prediction processing unit 260, is configured to receive or acquire a block 203 (the current block 203 of the current picture 201) and reconstructed picture data such as a reference sample from the same (current) picture in buffer 216 and / or reference picture data 231 from one or more preceding decoded pictures in the decoded picture buffer 230, and to process such data for prediction, i.e., to provide a prediction block 265 which may be an inter-prediction block 245 or an intra-prediction block 255.
[0111] The mode selection unit 262 may be configured to select a prediction mode (e.g., intra-prediction mode or inter-prediction mode) and / or the corresponding prediction block 245 or 255 as the prediction block 265 in order to calculate the residual block 205 and reconstruct the reconstruction block 215.
[0112] An embodiment of the mode selection unit 262 can be used to select a prediction mode (for example, from prediction modes supported by the prediction processing unit 260). The prediction mode provides the best match or the smallest residual (the smallest residual means better compression in transmission or storage), or the smallest signaling overhead (the smallest signaling overhead means better compression in transmission or storage), or it considers or balances both. The mode selection unit 262 may be configured to determine the prediction mode based on rate distortion optimization (RDO), i.e., to select a prediction mode that provides the smallest rate distortion optimization, or to select a prediction mode in which the associated rate distortion satisfies at least the prediction mode selection criteria.
[0113] The prediction processing (for example, by using the prediction processing unit 260) and mode selection (for example, by using the mode selection unit 262) performed by an example of the encoder 20 will be described in detail later.
[0114] As described above, the encoder 20 is configured to determine or select the best or most optimal prediction mode from a (predetermined) set of prediction modes. The set of prediction modes may include, for example, an intra-prediction mode and / or an inter-prediction mode.
[0115] The intra-prediction mode set may include 35 different intra-prediction modes, or 67 different intra-prediction modes, or it may include intra-prediction modes under development as defined in H.266.
[0116] The interprediction mode set depends on the available reference picture (e.g., at least a portion of the decoded picture stored in DBP230) and other interprediction parameters, for example, whether the entire reference picture is used, or only a portion of the reference picture is used, such as searching a search window region surrounding the current block for the best-matching reference block, and / or whether sample interpolation is applied, such as 1 / 2 sample and / or 1 / 4 sample interpolation.
[0117] In addition to the prediction mode described above, skip mode and / or direct mode may also be applied.
[0118] The prediction processing unit 260 may further divide block 203 into smaller block partitions or subblocks by repeatedly using, for example, quad-tree (QT) partitioning, binary-tree (BT) partitioning, triple-tree (TT) partitioning, or any combination thereof, and then perform predictions and similar operations for each of the block partitions or subblocks. Mode selection includes selecting the tree structure of the block 203 to be divided and selecting a prediction mode to be applied to each of the block partitions or subblocks.
[0119] The interpretation unit 244 may include a motion estimation (ME) unit (not shown in Figure 3) and a motion compensation (MC) unit (not shown in Figure 3). The motion estimation unit is configured to receive or acquire picture block 203 (the current picture block 203 of the current picture 201) and decoded picture 231, or at least one prior reconstructed block, such as one or more other reconstructed blocks different from the prior decoded picture 231, in order to perform motion estimation. For example, a video sequence may include the current picture and the prior decoded picture 31. In other words, the current picture and the prior decoded picture 31 may be part of a series of pictures that form a video sequence, i.e., a picture sequence.
[0120] For example, the encoder 20 may be configured to select a reference block from multiple reference blocks of the same picture among multiple other pictures or from multiple different pictures, and to provide the motion estimation unit (not shown in Figure 3) as an inter-prediction parameter an offset (spatial offset) between the position (XY coordinates) of the reference picture and / or reference block and the position of the current block. This offset is also called a motion vector (MV).
[0121] The motion compensation unit is configured to obtain inter-prediction parameters, for example by receiving them, and to perform inter-prediction based on or using the inter-prediction parameters to obtain inter-prediction blocks 245. Motion compensation performed by the motion compensation unit (not shown in Figure 3) may include fetching or generating predictive blocks based on motion / block vectors determined through motion estimation (and possibly performing interpolation with subsample accuracy). In interpolation filtering, additional samples may be generated from known samples, thereby potentially increasing the number of candidate predictive blocks that can be used to encode picture blocks. Upon receiving the motion vector currently used for the picture block's PU, the motion compensation unit 246 may locate the predictive block pointed to by the motion vector in the reference picture list. The motion compensation unit 246 may further generate syntactic elements related to blocks and video slices, which the video decoder 30 may use when decoding picture blocks of video slices.
[0122] The intra-prediction unit 254 is configured to perform intra-prediction by receiving, for example, the picture block 203 (current picture block) of the same picture and one or more preceding reconstructed blocks, such as reconstructed adjacent blocks. For example, the encoder 20 may be configured to select an intra-prediction mode from a plurality of intra-prediction modes.
[0123] Embodiments of the encoder 20 may be configured to select an intra-prediction mode based on optimization criteria, such as based on minimum residual (e.g., an intra-prediction mode that provides a prediction block 255 that is most similar to the current picture block 203) or minimum rate distortion.
[0124] The intra-prediction unit 254 is further configured to determine the intra-prediction block 255 based on the intra-prediction parameters of the selected intra-prediction mode. In any case, after selecting the intra-prediction mode to be used for the block, the intra-prediction unit 254 is further configured to provide the entropy coding unit 270 with intra-prediction parameters, i.e., information indicating the selected intra-prediction mode to be used for the block. In one example, the intra-prediction unit 254 may be configured to perform any combination of the following intra-prediction techniques.
[0125] The entropy coding unit 270 is configured to obtain coded picture data 21, for example in the form of a coded bitstream, which can be output using output 272, by applying an entropy coding algorithm or scheme (e.g., variable length coding scheme, context adaptive VLC (CAVLC) scheme, arithmetic coding scheme, context adaptive binary arithmetic coding (CABAC) scheme, syntax-based context-adaptive binary arithmetic coding (SBAC) scheme, probability interval partitioning entropy (PIPE) coding scheme, or other entropy coding method or technique) to one or more (or none) of the quantized residual coefficients 209, inter-prediction parameters, intra-prediction parameters, and / or loop filter parameters. The coded bitstream may be transmitted to the video decoder 30 or may be archived for later transmission or retrieval by the video decoder 30. The entropy coding unit 270 may also be configured to perform entropy coding on another syntactic element of the current video slice being coded.
[0126] A structurally slightly different video encoder 20 may be configured to encode the video stream. For example, a non-conversion-based encoder 20 may directly quantize the residual signal for some blocks or frames without using a conversion processing unit 206. In another implementation, the encoder 20 may have a quantization unit 208 and an inverse quantization unit 210 coupled into a single unit.
[0127] Figure 4 shows an example of a video decoder 30 configured to implement the technology of this application. The video decoder 30 is configured to receive encoded picture data (e.g., encoded bitstream) 21 encoded by an encoder 20 or similar device to obtain a decoded picture 31. In the decoding process, the video decoder 30 receives video data from the video encoder 20, such as an encoded video bitstream showing, for example, picture blocks of encoded video slices and associated syntactic elements.
[0128] In the example in Figure 4, the decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transformation unit 312, a reconstruction unit 314 (e.g., an adder 314), a buffer 316, a loop filter 320, a decoded picture buffer 330, and a prediction unit 360. The prediction unit 360 may include an inter-prediction unit 344, an intra-prediction unit 354, and a mode selection unit 362. In some examples, the video decoder 30 may perform a decoding calculation that is generally the inverse of the encoding calculation described with reference to the video encoder 20 in Figure 3.
[0129] The entropy decoding unit 304 is configured to perform entropy decoding on the encoded picture data 21 to obtain one or all of the following: quantized coefficients 309, decoded encoding parameters (not shown in Figure 4), and / or similar elements, such as inter-prediction parameters, intra-prediction parameters, loop filter parameters, and / or other (decoded) syntactic elements. The entropy decoding unit 304 is further configured to transfer the inter-prediction parameters, intra-prediction parameters, and / or other syntactic elements to the prediction processing unit 360. The video decoder 30 may receive syntactic elements at the video slice level and / or syntactic elements at the video block level.
[0130] The inverse quantization unit 310 can have the same function as the inverse quantization unit 110, the inverse transformation processing unit 312 can have the same function as the inverse transformation processing unit 212, the reconstruction unit 314 can have the same function as the reconstruction unit 214, the buffer 316 can have the same function as the buffer 216, the loop filter 320 can have the same function as the loop filter 220, and the decoding picture buffer 330 can have the same function as the decoding picture buffer 230.
[0131] The prediction processing unit 360 may include an inter-prediction unit 344 and an intra-prediction unit 354. The inter-prediction unit 344 may have functions similar to those of the inter-prediction unit 244, and the intra-prediction unit 354 may have functions similar to those of the intra-prediction unit 254. The prediction processing unit 360 is typically configured to perform block prediction and / or acquire prediction blocks 365 from encoded data 21, and to receive or acquire (explicitly or implicitly) information about prediction-related parameters and / or selected prediction modes from, for example, an entropy decoding unit 304.
[0132] Furthermore, when a video slice is encoded as an intra-coded (I) slice, the intra-prediction unit 354 of the prediction processing unit 360 is configured to generate a prediction block 365 to be used for the picture block of the current video slice, based on the signaled intra-prediction mode and data from the preceding decoded block of the current frame or picture. When a video frame is encoded as an inter-coded (i.e., B or P) slice, the inter-prediction unit 344 (e.g., motion compensation unit) of the prediction processing unit 360 is configured to generate a prediction block 365 to be used for the video block of the current video slice, based on the motion vector and other syntactic elements received from the entropy decoding unit 304. In inter-prediction, a prediction block may be generated from one of the reference pictures in a single reference picture list. The video decoder 30 may construct reference frame lists, List 0 and List 1, by using default construction techniques based on the reference pictures stored in the DPB 330.
[0133] The prediction processing unit 360 is configured to determine the prediction information to be used for the video block of the current video slice by analyzing motion vectors and other syntactic elements, and to generate a prediction block to be used for the current video block being decoded using this prediction information. For example, the prediction processing unit 360 uses some of the received syntactic elements to determine the prediction mode (e.g., intra-prediction or inter-prediction) used to encode the video block of the video slice, the inter-prediction slice type (e.g., B-slice, P-slice, or GPB-slice), the configuration information of one or more pictures in the reference picture list used for slicing, the motion vector of each inter-encoded video block used for slicing, the inter-prediction state of each inter-encoded video block used for slicing, and other information, and decodes the video block of the current video slice.
[0134] The inverse quantization unit 310 may be configured to perform inverse quantization (i.e., dequantization) on quantized transformation coefficients provided in the bitstream and decoded by the entropy decoding unit 304. The inverse quantization process may include determining the degree of quantization to be applied and the degree of inverse quantization to be applied, using quantization parameters calculated by the video encoder 20 for each video block in the video slice.
[0135] The inverse transformation processing unit 312 is configured to generate residual blocks in the sample domain by applying an inverse transformation (e.g., inverse DCT, inverse integer transformation, or a conceptually similar inverse transformation process) to the transformation coefficients.
[0136] The reconstruction unit 314 (for example, an adder 314) is configured to add the inverse transform block 313 (i.e., the reconstruction residual block 313) to the prediction block 365 by adding the sample values of the reconstruction residual block 313 to the sample values of the prediction block 365, thereby obtaining the reconstruction block 315 in the sample domain.
[0137] The loop filter unit 320 (either within or after the encoding loop) is configured to filter the reconstructed block 315 to enable smooth sample transformation or improve image quality, thereby obtaining a filtered block 321. In one example, the loop filter unit 320 may be configured to perform any combination of the following filtering techniques. The loop filter unit 320 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters such as a bilateral filter, an adaptive loop filter (ALF), a sharpening or smoothing filter, or a cooperative filter. Although the loop filter unit 320 is shown as an in-loop filter in Figure 4, the loop filter unit 320 may be implemented as a post-loop filter in other configurations.
[0138] The filtered block 321 within a given frame or picture is then stored in a decoded picture buffer 330 that stores a reference picture to be used for subsequent motion compensation.
[0139] The decoder 30 is configured to output the decoded picture 31 using output 332 and similar outputs in order to present the decoded picture 31 to the user or provide the decoded picture 31 for the user to view.
[0140] Another variation of the video decoder 30 may be configured to decode a compressed bitstream. For example, the decoder 30 may generate an output video stream without using the loop filter unit 320. For example, a non-transformation-based decoder 30 may directly dequantize the residual signal for some blocks or frames without using the inverse transformation unit 312. In another implementation, the video decoder 30 may have an inverse quantization unit 310 and an inverse transformation unit 312 coupled into a single unit.
[0141] Figure 5 is a schematic diagram of a video coding device 400 (e.g., a video encoding device 400 or a video decoding device 400) according to one embodiment of this application. The video coding device 400 is suitable for implementing one embodiment described in this specification. In one embodiment, the video coding device 400 may be a video decoder (e.g., the video decoder 30 in Figure 1) or a video encoder (e.g., the video encoder 20 in Figure 1). In another embodiment, the video coding device 400 may be one or more components of the video decoder 30 in Figure 1 or the video encoder 20 in Figure 1.
[0142] The video coding device 400 includes an inlet port 410 and a receiver unit (Rx) 420 configured to receive data, a processor, logic unit, or central processing unit (CPU) 430 configured to process data, a transmitter unit (Tx) 440 and an exit port 450 configured to transmit data, and a memory 460 configured to store data. The video coding device 400 may further include optical-to-electrical conversion components and electrical-to-optical (EO) conversion components coupled to the inlet port 410, receiver unit 420, transmitter unit 440, and exit port 450 to function as an exit or input for optical or electrical signals.
[0143] The processor 430 is implemented using hardware and software. The processor 430 may be implemented as one or more CPU chips, cores (e.g., a multi-core processor), FPGAs, ASICs, or DSPs. The processor 430 communicates with the inlet port 410, the receiver unit 420, the transmitter unit 440, the exit port 450, and the memory 460. The processor 430 includes a coding module 470 (e.g., an encoding module 470 or a decoding module 470). The encoding / decoding module 470 implements the embodiments disclosed above. For example, the encoding / decoding module 470 performs, processes, or provides various coding operations. Thus, the encoding / decoding module 470 substantially extends the functionality of the video coding device 400 and affects the conversion of the video coding device 400 to multiple different states. Alternatively, the encoding / decoding module 470 is implemented using instructions stored in the memory 460 and executed by the processor 430.
[0144] Memory 460 includes one or more disks, tape drives, and solid-state drives, and can be used as an overflow data storage device, configured to store programs when they are selectively executed, and to store instructions and data read during program execution. Memory 460 can be volatile and / or non-volatile, and may be read-only memory (ROM), random access memory (RAM), ternary content-addressable memory (TCAM), and / or static random access memory (SRAM).
[0145] Figure 6 is a simplified block diagram of a device 500 that can be used as either or both of the source device 12 and destination device 14 of Figure 1, according to one embodiment. The device 500 may implement the technology of this application. The device 500 configured to implement chromablock prediction may use the form of a computing system comprising multiple computing devices, or it may use the form of a single computing device such as a mobile phone, tablet computer, laptop computer, notebook computer, or desktop computer.
[0146] The processor 502 within the device 500 may be a central processing unit. Alternatively, the processor 502 may be one or more existing or future devices of any other type capable of controlling or processing information. As shown in Figure 6, the disclosed implementation may be carried out by using a single processor, such as processor 502, but advantages in speed and efficiency may be achieved by using two or more processors.
[0147] In one implementation, the memory 504 in the device 500 may be a read-only memory device or a random-access memory device. Any other suitable type of storage device may be used as memory 504. Memory 504 may include code and data 506 accessed by the processor 502 using the bus 512. Memory 504 may further include an operating system 508 and an application program 510. The application program 510 includes at least one program that enables the processor 502 to perform the method described in this specification. For example, the application program 510 may include applications 1 to N, and further, applications 1 to N include a video coding application for performing the method described in this specification. The device 500 may further include additional memory in the form of a secondary memory 514. The secondary memory 514 may be, for example, a memory card used with a mobile computing device. Since a video communication session may contain a large amount of information, the information may be stored entirely or partially in the secondary memory 514 and loaded into memory 504 for processing as needed.
[0148] The device 500 may further include one or more output devices, such as a display 518. In one example, the display 518 may be a touch-sensitive display combining a display with a touch-sensing element capable of operating to sense touch input. The display 518 may be coupled to the processor 502 by using a bus 512. In addition to the display 518, there may be further output devices that enable a user to program the device 500 or use the device 500 in other ways, or there may be other output devices instead of the display 518. If the output devices are displays or include displays, the displays can be implemented in various ways, for example, using liquid crystal displays, cathode-ray tube (CRT) displays, plasma displays, or light-emitting diode (LED) displays such as organic LED (OLED) displays.
[0149] The device 500 may further include, or be connected to, a picture sensing device 520. The picture sensing device 520 is, for example, a camera, or any other existing or future picture sensing device 520 capable of sensing a picture. The picture is, for example, a picture of the user operating the device 500. The picture sensing device 520 may be positioned directly facing the user operating the device 500. In one example, the position and optical axis of the picture sensing device 520 may be set such that its field of view includes an area adjacent to the display 518, and that the display 518 can be seen from that area.
[0150] The device 500 may further include a sound sensing device 522, or may be connected to a sound sensing device 522. The sound sensing device 522 may be, for example, a microphone, or any other existing or future sound sensing device capable of sensing sounds near the device 500. The sound sensing device 522 may be positioned directly facing the user operating the device 500, or it may be configured to receive sounds, such as voice or other sounds made by the user when the user operates the device 500.
[0151] The processor 502 and memory 504 of device 500 are integrated into a single unit as shown in Figure 6, but other configurations may be used. The execution of processor 502 may be distributed across multiple machines (each machine having one or more processors) that can be directly coupled, or it may be distributed within a local area or across a separate network. Memory 504 may be distributed across multiple machines, such as network-based memory and memory in multiple machines running device 500. Although a single bus is depicted here, there may be multiple buses 512 in device 500. Furthermore, secondary memory 514 may be directly coupled to other components of device 500, or it may be accessed via a network, and it may include a single integrated unit such as a memory card, or multiple units such as multiple memory cards. Thus, device 500 can be implemented in multiple configurations.
[0152] As described above in this application, a color image further includes a chroma component (U,V) in addition to the luma (Y) component. Therefore, in addition to the luma component, the chroma component also needs to be encoded. YUV4:4:4, YUV4:2:2, and YUV4:2:0 generally exist according to different methods for sampling the luma and chroma components of a color image. As shown in Figure 7, the × marks represent luma component samples, and the ○ marks represent chroma component samples.
[0153] 4:4:4 format: Chroma components are not downsampled.
[0154] 4:2:2 format: Horizontal downsampling of the chroma component is performed at a 2:1 ratio relative to the chroma component, but no vertical downsampling is performed. For every two U or V samples, each row contains four Y samples.
[0155] 4:2:0 format: Horizontal downsampling of 2:1 is performed on the chroma component relative to the luma component, and vertical downsampling of 2:1 is also performed.
[0156] YUV4:2:0 is the most common format. When a video picture is in the YUV4:2:0 sampling format, if the luma component of a picture block is a 2M×2N picture block, then the chroma component of the picture block is an M×N picture block. Therefore, the chroma component of a picture block is also referred to in this application as a chroma block or chroma component block. Although this application is described using YUV4:2:0 as an example, it is also applicable to other methods for sampling luma and chroma components.
[0157] In this application, a sample within a chroma picture is abbreviated as a chroma sample or chroma point, and a sample within a luma picture is abbreviated as a luma sample or luma point.
[0158] Similar to luma components, chroma intra-prediction also uses boundary samples of adjacent reconstructed blocks around the current chroma block as reference samples for the current block. These reference samples are mapped to samples within the current chroma block according to a specific prediction mode, acting as predictors for the samples within the current chroma block. The difference lies in the fact that the texture of chroma components is usually relatively simple, so the number of intra-prediction modes for chroma components is typically fewer than the number for luma components.
[0159] The cross-component prediction mode is also called the cross-component intra-prediction mode or CCLM prediction mode. The CCLM prediction mode is sometimes abbreviated as the linear model mode. The LM mode (abbreviated as linear model or linear mode) is a chroma intra-prediction method that uses the texture correlation between luminance and chrominance. In LM, the predictor of the current chroma block is derived using the reconstructed luminance components according to a linear model, which is given by:
number
[0160] Here, α and β are linear model coefficients, α is the scaling coefficient, β is the offset factor, and pred C (i,j) is the predictor of the chroma sample at position (i,j), and rec i L(i,j) is the luma reconstruction sample value at position (i,j) after the luma reconstruction block corresponding to the current chroma block (hereinafter abbreviated as the corresponding luma block) has been downsampled to the chroma component resolution. In YUV4:2:0 format video, the resolution of the luma component is four times that of the chroma component (the width and height of the luma component are twice those of the chroma component, respectively). To obtain a luma block with the same resolution as the chroma block, the luma component must be downsampled to the chroma resolution using the same downsampling method as for the chroma component.
[0161] The linear model coefficients α and β do not need to be encoded for transmission and are derived using edge samples of adjacent reconstructed blocks of the current chroma block and the corresponding luma samples. Figure 8 shows one embodiment of the cross-component prediction mode. In Figure 8, recL is the reconstructed luma block (the current chroma block corresponds to the reconstructed block and adjacent reference sample of the luma block), recL' is the downsampled luma block, and recC' is the adjacent reconstructed reference sample of the current chroma block. The size of the current chroma block is W×H, and by using the upper adjacent reconstructed sample and left adjacent reconstructed sample of the current chroma block as reference samples, the size of the corresponding luma block is 2W×2H. By downsampling the luma block and its reference sample to the chroma resolution, the sample block shown in Figure 8(b) is obtained. The adjacent reference samples in Figures 8(b) and 8(c) have a one-to-one correspondence.
[0162] For the sake of clarity, in this application, the upper adjacent samples and left adjacent samples used to calculate linear model coefficients are referred to as adjacent samples, with the sample above being the upper adjacent sample and the sample to the left being the left adjacent sample. Samples adjacent to a chroma block are referred to as adjacent samples (this includes the upper adjacent sample and the left adjacent sample), and samples adjacent to a luma block are also referred to as adjacent samples (this includes the upper adjacent sample and the left adjacent sample). A chroma sample has a one-to-one correspondence with a luma sample, and the sample values form value pairs.
[0163] In embodiments of this application, luma samples are typically obtained through downsampling (because the resolution of the chroma component differs from that of the luma component) and are denoted as Luma' samples. Chroma samples are typically the upper adjacent samples in one or two rows of the current chroma block and the left adjacent samples in one or two columns of the current chroma block. Figure 9 is a schematic diagram of using one row and one column, and Figure 10 is a schematic diagram of using two rows and two columns.
[0164] In LM mode, the correlation between the luminous and chroma components can be effectively utilized. Compared to the direction prediction mode, LM mode is more flexible and therefore provides a more accurate prediction signal for the chroma component.
[0165] Furthermore, there is also a Multiple Model Linear Model (MMLM) mode, and multiple α and β values exist. In one example of two linear models, there are two groups of linear model coefficients: α1 and β1, and α2 and β2.
[0166] This application provides a chromablock prediction method. The processing procedure shown in Figure 11 will be described in detail below with reference to a specific implementation. This process exists in both the encoding and decoding processes. In this embodiment of the application, the decoder side is used as an example of a solution description, and its contents may be as follows.
[0167] Step 1101: Obtain the chroma value of the chroma sample at the preset position from the adjacent samples of the chroma block.
[0168] The chroma block in question is the chroma block on which intra-prediction should now be performed. The number of chroma samples at a preset location (sometimes abbreviated as the preset number) can be preset. For example, the preset number can be 2, 4, 6, or 8. Adjacent samples of a chroma block are reconstructed samples adjacent to the chroma block; see Figures 9 and 10.
[0169] In a particular implementation, when it is necessary to perform intraprediction on a chroma block (hereinafter sometimes abbreviated as chroma block), the chroma value of the chroma sample at a preset position can be obtained from the adjacent samples of the chroma block and represented as a set φ, where φ = {C0, C1, ..., C M-1}, where M represents the number of presets, i.e., the number of chroma values to be obtained.
[0170] Optionally, if only one linear mode (sometimes called the intra-linear prediction mode) exists, in the coordinate system shown in Figure 12, the preset positions are typically (0,-1), (X-1,-1), (-1,0), and (-1,Y-1), and the chroma values of the chroma samples at the preset positions can be obtained from adjacent samples in the chroma block.
[0171] Optionally, the decoder may determine an intra-prediction mode corresponding to a chroma block based on instruction information in the bitstream, and determine a preset position based on that intra-prediction mode. The corresponding process is: This may include acquiring instruction information, determining an intra-prediction mode corresponding to a chroma block based on said instruction information, and determining a preset position based on the intra-prediction mode corresponding to the chroma block.
[0172] The intra-prediction mode corresponding to a chroma block may include at least one of LM, LMA, and LML. The indication information is used to point to the intra-prediction mode corresponding to the chroma block.
[0173] In a particular implementation, when encoding is performed, the encoder encodes the intra-prediction mode corresponding to the chroma block and then sends the intra-prediction mode to the decoder (this process will be described later).
[0174] The decoder can obtain instruction information from the received bitstream and determine the intra-prediction mode corresponding to the chroma block based on this instruction information. Then, the decoder determines the preset position based on the intra-prediction mode corresponding to the chroma block.
[0175] Optionally, instruction information can be set using a syntax table as shown in Table 1. [Table 1]
[0176] In Table 1, the syntax element CuPredMode[x0][y0] in the syntax table is used to indicate whether the current prediction mode of the chroma block is intra-prediction mode or inter-prediction mode. For example, if CuPredMode[x0][y0] is MODE_INTRA, it indicates that intra-prediction mode is currently being used for the chroma block, and if CuPredMode[x0][y0] is MODE_INTER, it indicates that inter-prediction mode is currently being used for the chroma block. Here, x0 and y0 represent the coordinates of the current chroma block in the video picture.
[0177] The syntax element intra_croma_pred_mode[x0][y0] is used to indicate the current intra-prediction mode information of the chroma block (i.e., the instruction information described above). For example, when intra_croma_pred_mode[x0][y0]=0, it indicates that LM0 mode is currently used for the block; when intra_croma_pred_mode[x0][y0]=1, it indicates that LM1 mode is currently used for the chroma block; when intra_croma_pred_mode[x0][y0]=2, it indicates that LM2 mode is currently used for the chroma block; and when intra_croma_pred_mode[x0][y0]=N-1, it indicates that LM(N-1) mode is currently used for the chroma block. Here, N represents N different LMs that can be selected by the encoder for the chroma block, where LM0, LM1, ..., and LM(N-1) represent different intra-prediction modes.
[0178] Optionally, if multiple linear modes exist, different preset positions exist for different linear modes, and the corresponding processing in step 1101 is as follows: This may include obtaining the chroma value of the chroma sample at the preset position from adjacent samples of the chroma block, based on a predetermined correspondence between the intra-prediction mode and the preset position, and the intra-prediction mode corresponding to the chroma block.
[0179] In a particular implementation, when decoding is performed, the decoder determines the intra-prediction mode corresponding to the chroma block, then obtains a predetermined correspondence between the intra-prediction mode and the preset position, and from this correspondence, can determine the preset position corresponding to the intra-prediction mode of the chroma block. The decoder then obtains the chroma value of the chroma sample at the preset position from the adjacent samples of the chroma block.
[0180] In the aforementioned correspondence, the recorded preset position may be the position coordinates of the preset position.
[0181] Optionally, to better illustrate the preset positions, in this embodiment of the application, a rectangular planar coordinate system is established correspondingly to the chroma block, as shown in Figure 12. The first chroma sample in the upper left corner of the chroma block is used as the coordinate origin, with the horizontal direction to the right being the positive x-axis and the vertical direction downwards being the positive y-axis. Thus, the position coordinates of the upper adjacent samples of the chroma block are (0,-1), (1,-1), ..., and (X-1,-1), and the position coordinates of the left adjacent samples of the chroma block are (-1,0), (-1,1), ..., and (-1,Y-1), where X represents the width of the chroma block (i.e., the number of samples in the width direction of the chroma block) and Y represents the height of the chroma block (i.e., the number of samples in the height direction of the chroma block).
[0182] When the intra prediction mode is LM0, the position coordinates of the preset positions in the correspondence can be (0,-1), (X-1,-1), (-1,0), and (-1,Y-1).
[0183] When the intra prediction mode is LM1, the position coordinates of the preset positions in the correspondence can be (0,-1), (X / 4,-1), (X-1-X / 4,-1), and (X-1,-1).
[0184] When the intra prediction mode is LM2, the position coordinates of the preset positions in the correspondence can be (-1,0), (-1,Y / 4), (-1,Y-1-Y / 4), and (-1,Y-1).
[0185] When the intra prediction mode is LM3, the position coordinates of the preset positions in the correspondence can be (X-2,-1), (X-1,-1), (-1,Y-2), and (-1,Y-1).
[0186] When the intra prediction mode is LM(N-1), the position coordinates of the preset positions in the correspondence can be (0,-1), (1,-1), (X-2,-1), and (X-1,-1).
[0187] What we can see is that if multiple linear modes exist, different linear modes may correspond to different preset positions.
[0188] Furthermore, when the linear mode is LM, LMA, and LML, the position coordinates of the preset positions are listed separately, and may be as follows:
[0189] When the intra prediction mode is LM, the position coordinates of the preset positions in the correspondence can be (0,-1), (X-1,-1), (-1,0), and (-1,Y-1), as shown by the shaded circles in Figure 13.
[0190] When the intra prediction mode is LMA, the position coordinates of the preset position in the correspondence can be (0,-1), (X / 4,-1), (X-1-X / 4,-1), and (X-1,-1), as shown by the circle filled with diagonal lines in Figure 14(a), or (0,-1), (X / 4,-1), (3×X / 4,-1), and (X-1,-1), as shown by the circle filled with diagonal lines in Figure 14(b).
[0191] When the intra prediction mode is LML, the position coordinates of the preset position in the correspondence can be (-1,0), (-1,Y / 4), (-1,Y-1-Y / 4), and (-1,Y-1), as shown by the circle filled with a diagonal line in Figure 15(a), or (-1,0), (-1,Y / 4), (-1,3×Y / 4), and (-1,Y-1), as shown by the circle filled with a diagonal line in Figure 15(b).
[0192] Note that the position coordinates of these preset locations are merely examples and are not limited to this embodiment of the application.
[0193] Furthermore, when the intra-prediction mode is LM, the number of presets may instead be 2, and the position coordinates of the preset positions may be (X-1,-1) and (-1,Y-1) as shown by the circle filled with diagonal lines in Figure 16(a), or (X / 2,-1) and (-1,Y / 2) as shown by the circle filled with diagonal lines in Figure 16(b), or (X / 2,-1) and (-1,Y-1) as shown by the circle filled with diagonal lines in Figure 16(c), or (X-1,-1) and (-1,Y / 2) as shown by the circle filled with diagonal lines in Figure 16(d). This is merely an example and is not limited to this embodiment of the application.
[0194] Note that X and Y are usually 4 or greater. In Figures 13 and 16(a) to 16(d), X and Y are 8 and 8, respectively; in Figure 14(a), X is 8; in Figure 14(b), X is 16; in Figure 15(a), Y is 8; and in Figure 15(b), Y is 16. The above values are merely one possible implementation. This is not limited to this embodiment of the application. Also, in Figures 12 to 16(d), the boxes represent chroma blocks.
[0195] Step 1102: Based on the adjacent samples of the luma block corresponding to the chroma block, obtain the luma value of the luma sample corresponding to the chroma sample at the preset position.
[0196] In a particular implementation, after the chroma value is obtained, the luma block corresponding to the chroma block can be determined, and the luma value of the luma sample corresponding to the chroma sample at the preset position can be obtained from the adjacent samples of the luma block and can be represented as a set Ψ, where Ψ = {L0, L1, ..., L M-1}, where M represents the number of presets, i.e., the number of Luma values to be obtained.
[0197] Optionally, in step 1102, the luma value can be selected using several methods. Two feasible processing methods are provided below.
[0198] Method 1: From adjacent samples in the luma block, the position coordinates of the luma sample corresponding to the i-th preset position chroma sample within the preset position are (2 × X i ,2×Y i ) is determined to be, and the position coordinates of the chroma sample at the i-th preset position are (X i ,Y i ), and based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, the luma value of the luma sample corresponding to the chroma sample at the preset position is obtained from adjacent samples of the luma block corresponding to the chroma block.
[0199] The i-th preset position is one of the preset positions.
[0200] In a particular implementation, when a chroma block is decoded, the position coordinates of the chroma sample at the i-th preset position within the preset positions are (X i ,Y i ) and (X i This is the horizontal coordinate of the i-th preset position in the coordinate system shown in Figure 12, and Y i(where is the vertical coordinate of the i-th preset position in the coordinate system shown in Figure 12), and the position coordinate of the luma sample corresponding to the chroma sample at the i-th preset position is (2 × X) from the adjacent samples of the luma block. i ,2×Y i It can be determined that ). Thus, the position coordinates of the luma sample corresponding to the chroma sample at the preset position can be obtained. Then, based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, the luma value can be obtained from the corresponding luma sample.
[0201] Method 2: Based on the position coordinates of the chroma sample at the j-th preset position within the preset position, the position coordinates of multiple samples corresponding to the j-th preset position are determined from adjacent samples of the luma block. Based on the position coordinates of these multiple samples, the position coordinates of the luma sample corresponding to the chroma sample at the j-th preset position are determined. Based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, the luma value of the luma sample corresponding to the chroma sample at the preset position is obtained from adjacent samples of the luma block corresponding to the chroma block.
[0202] The j-th preset position is one of the preset positions.
[0203] In a particular implementation, when a chroma block is decoded, the position coordinates of the chroma sample at the j-th preset position within the preset positions are (X j ,Y j ) is (X j This is the horizontal coordinate of the j-th preset position in the coordinate system shown in Figure 12, and Y j (where is the vertical coordinate of the j-th preset position in the coordinate system shown in Figure 12). For the chroma sample at the j-th preset position, based on the position coordinates of the chroma sample at the j-th preset position, (X j ,Y jMultiple sample positions of adjacent samples in the corresponding Luma Block can be determined, and then, based on the position coordinates of these multiple sample positions, the position coordinates of the Luma sample corresponding to the chroma sample at the j-th preset position can be obtained.
[0204] For example, a weighted method may be used. The position coordinates of multiple sample locations are (2 × X j ,2×Y j ), (2 × X j ,2×Y j (+1), (2×X j +1,2×Y j ), (2 × X j +1,2×Y j (+1), (2×X j +2, 2 × Y j ), and (2×X j +2, 2 × Y j It can be set to +1), and all of these sample positions correspond to weight values of 2 / 8, 1 / 8, 1 / 8, 2 / 8, 1 / 8, and 1 / 8, respectively. After weighting, the position coordinates of the luminance sample corresponding to the chroma sample at the j-th preset position are (2 × X j ,2×Y j A value of +0.5) can be obtained. Furthermore, a weighting method does not have to be used. This is not limited to this embodiment of the application. Thus, the position coordinates of the luma sample corresponding to the chroma sample at the preset position can be obtained. Then, based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, the luma value can be obtained from the corresponding luma sample.
[0205] Step 1103: Classify the acquired luma values into a first luma set and a second luma set.
[0206] In a particular implementation, after a luma value is obtained, the obtained luma value can be classified into a first luma set and a second luma set.
[0207] Optionally, these luma sets can be obtained in a plurality of ways. This embodiment of this application provides three possible ways.
[0208] Method 1: Determine the average value of the luma values of the luma samples corresponding to the chroma samples at the preset positions, group the luma values that are among the luma values of the luma samples corresponding to the chroma samples at the preset positions and are below the average value of the luma values into the first luma set, and group the luma values that are among the luma values of the luma samples corresponding to the chroma samples at the preset positions and are greater than the average value of the luma values into the second luma set.
[0209] In a specific implementation, the average value of the luma values obtained in step 1102 can be determined. Then, the luma values that are among the luma values obtained in step 1102 and are below the average value of the luma values are determined and grouped into the first luma set. Further, the luma values that are among the luma values obtained in step 1102 and are greater than the average value of the luma values are determined and grouped into the second luma set. Thus, the luma values in the first luma set are smaller than the luma values in the second luma set.
[0210] The following formula is used for representation: The average value of the luma values is
Number
[0211] Method 2: Arrange the luma values of the luma samples corresponding to the chroma samples at the preset positions in ascending order to obtain the first luma value queue. When the number of luma samples in the first luma value queue is even, group the luma values in the first half of the first luma value queue into the first luma set, and group the luma values in the second half of the luma value queue into the second luma set.
[0212] In a specific implementation, the luma values obtained in step 1102 can be sorted in ascending order to obtain the first luma value queue. When the number of luma samples in the first luma value queue is even, the luma values in the first half of the first luma value queue can be determined and grouped into the first luma set, and further, the luma values in the second half of the first luma value queue can be determined and grouped into the second luma set.
[0213] For example, in step 1102, four luma values, which are L1, L2, L3, and L4 in sequence, are obtained. When L4 < L2 < L1 < L3, the first luma value queue is L4, L2, L1, and L3. In this case, the first luma set is {L4, L2}, and the second luma set is {L1, L3}.
[0214] New line added here as per the original text's structure Method 3: Arrange the luma values of the luma samples corresponding to the chroma samples at the preset positions in descending order to obtain the second luma value queue. When the number of luma samples in the second luma value queue is even, group the luma values in the second half of the second luma value queue into the first luma set, and group the luma values in the first half of the luma value queue into the second luma set.
[0215] In a specific implementation, the luma values obtained in step 1102 may be sorted in descending order to obtain a second luma value queue. If the number of luma samples in the second luma value queue is even, the luma values in the second half of the second luma value queue may be determined and grouped into the first luma set, and further, the luma values in the first half of the second luma value queue may be determined and grouped into the second luma set.
[0216] For example, in step 1102, if four luma values, which are L1, L2, L3, and L4 in order, are obtained and L3 > L1 > L2 > L4, the second luma value queue is L3, L1, L2, and L4. In this case, the first luma set is {L4, L2}, and the second luma set is {L1, L3}.
[0217] Furthermore, when the number of luma samples in the first luma value queue in method 2 is odd, if the first luma value queue contains N luma values, the first (N - 1) / 2 luma values may be grouped into the first luma set, and the last (N + 1) / 2 luma values may be grouped into the second luma set, or alternatively, the first (N + 1) / 2 luma values may be grouped into the first luma set, and the last (N - 1) / 2 luma values may be grouped into the second luma set. Similarly, when the number of luma samples in the second luma value queue in method 3 is odd, if the second luma value queue contains N luma values, the first (N - 1) / 2 luma values may be grouped into the second luma set, and the last (N + 1) / 2 luma values may be grouped into the first luma set, or alternatively, the first (N + 1) / 2 luma values may be grouped into the second luma set, and the last (N - 1) / 2 luma values may be grouped into the first luma set.
[0218] Step 1104: Group the chroma values of the chroma samples corresponding to the luma samples related to the luma values in the first luma set into the first chroma set, and group the chroma values of the chroma samples corresponding to the luma samples related to the luma values in the second luma set into the second chroma set.
[0219] In a specific implementation, after the first luma set and the second luma set are obtained, the chroma values corresponding to all the luma values in the first luma set can be classified into the first chroma set, and the chroma values corresponding to all the luma values in the second luma set can be classified into the second chroma set. The following formula can be used for representation: The first chroma set is φ L ={C i0 ,C i1 ,…,C ij ,…,C iS}, and The obtained second chroma set is φ R ={C j0 ,C j1 ,…,C ji ,…,C jT}.
[0220] Note that in step 1101, the luma value is determined using the luma sample corresponding to the chroma sample. The chroma value corresponding to the luma value here is the chroma value of the chroma sample corresponding to the luma sample related to the luma value.
[0221] Step 1105: Determine the scaling coefficient in the linear model corresponding to the chroma block based on the average value of the luma values in the first luma set, the average value of the luma values in the second luma set, the average value of the chroma values in the first chroma set, and the average value of the chroma values in the second chroma set.
[0222] In a specific implementation, after the first luma set, the second luma set, the first chroma set, and the second chroma set are determined, the average value of the luma values in the first luma set and the average value of the luma values in the second luma set can be determined, and the average value of the chroma values in the first chroma set and the average value of the chroma values in the second chroma set can be determined. Corresponding to Method 1, the following formula is used for representation: The average value of the luma values in the first luma set is
Number
number
number
number
[0223] Next, the scaling coefficient in the linear model corresponding to the chroma block is determined based on the average value of the luma values in the first luma set, the average value of the luma values in the second luma set, the average value of the chroma values in the first chroma set, and the average value of the chroma values in the second chroma set.
[0224] Optionally, the scaling factor can be determined by using an equation, and the corresponding process may be as follows:
number
[0225] In a specific implementation, a predetermined calculation formula for the scaling coefficient can be obtained, and by substituting C Lmean -C Rmean ) / (L Lmean -L Rmean ) for C Lmean , C Rmean , L Lmean , and L Rmean into the formula for the scaling coefficient α = (C
[0226] Step 1106: Determine the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient.
[0227] In a specific implementation, after the scaling coefficient is determined, the offset factor in the linear model corresponding to the chroma block can be determined based on the scaling coefficient. The offset factor can be determined by multiple methods. This embodiment of this application provides two feasible methods.
[0228] Method 1: Determine the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient, the average value of the chroma values in the first chroma set, and the average value of the luma values in the first luma set.
[0229] In a specific implementation, the average value of the chroma values in the first chroma set:
Number
Number
[0230] Then, based on the scaling coefficient, the average value of the chroma values in the first chroma set, and the average value of the luma values in the first luma set, the offset factor in the linear model corresponding to the chroma block is determined.
[0231] Optionally, the offset factor can be determined using the following formula, and the corresponding processing may be as follows: β=C Lmean -α*L Lmean Here, α is the scaling factor, β is the offset factor in the linear model corresponding to the chroma block, and C Lmean L is the average value of the chroma values in the first chroma set. Lmean This is the average value of the luma values in the first luma set.
[0232] In a specific implementation, a predetermined formula for calculating the offset factor can be obtained, and the formula for calculating the offset factor is β = C Lmean -α*L Lmean Next, the scaling coefficient C obtained in step 1105 Lmean and L Lmean By substituting this, we can obtain the offset factor in the linear model corresponding to the chroma block.
[0233] Method 2: Determine the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient, the average chroma value of the chroma sample at the preset position, and the average lumen value of the lumen sample corresponding to the chroma sample.
[0234] In a specific implementation, the average chroma value of the chroma sample at a preset position:
number
number
[0235] And the scaling coefficient C mean and L mean By using this method, the offset factor corresponding to the chroma block is determined.
[0236] Optionally, the offset factor can be determined using the following formula, and the corresponding processing may be as follows: β=C mean -α*L mean Here, α is the scaling factor, β is the offset factor in the linear model corresponding to the chroma block, and C mean This is the average value of the chroma samples at the preset position, L mean This is the average of the luma values of the luma samples corresponding to the chroma samples at the preset positions.
[0237] In a specific implementation, a predetermined formula for calculating the offset factor can be obtained, and the scaling coefficient C obtained in step 1105 can be added to the formula for calculating the offset factor. mean and L mean By substituting this, we can obtain the offset factor in the linear model corresponding to the chroma block.
[0238] Step 1107: Determine the predictive information for the chroma block based on the scaling factor, offset factor, and chroma reconstruction information corresponding to the chroma block.
[0239] Luma reconstruction information corresponding to a chroma block includes downsampling information for the luma reconstruction block corresponding to the chroma block.
[0240] In a particular implementation, after obtaining the scaling coefficient and offset factor corresponding to the chroma block, prediction information for the chroma block can be obtained using the chroma reconstruction information, scaling coefficient, and offset factor corresponding to the chroma block.
[0241] Optionally, to obtain predictive information for chroma blocks, use the formula:
number
[0242] When this embodiment of the application is applied to the encoder side, the only difference is the method for determining the intra-prediction mode. On the encoder side, if it is determined that an intra-prediction method is to be used for a chroma block, the chroma block is encoded using each intra-prediction mode. Then, the intra-prediction mode with the best encoding effect is determined using a rate-distortion optimization (RDO) criterion, and that intra-prediction mode is written to the syntax table described above, and then added to the bitstream. Thus, the decoder side can determine the intra-prediction mode to be used for decoding directly from the bitstream.
[0243] Optionally, the method for determining the intra-prediction mode by using the RDO criterion is as follows:
[0244] Prediction information for the chroma block is determined by the methods in steps 1101 to 1107. Residual information is obtained by subtracting the prediction information from the original information of the chroma block. A transformation process is performed on the residual information to obtain transformation coefficients. A quantization process is performed on the transformation coefficients to obtain quantization coefficients. An entropy coding process is then performed on the quantization coefficients to obtain a bitstream. Reconstruction information is obtained by performing inverse entropy coding, inverse quantization, and inverse transformation processes sequentially on the bitstream to perform intra-prediction. The reconstruction information is compared with the original information, and the intra-prediction mode with the smallest difference between the reconstruction information and the original information is determined as the intra-prediction mode to be used, i.e., the intra-prediction mode to be written to the syntax table described above.
[0245] The encoder side can be an encoder that uses H.263, H.264, MPEG-2, MPEG-4, VP8, or VP9, and correspondingly, the decoder side can be a decoder that uses H.263, H.264, MPEG-2, MPEG-4, VP8, or VP9.
[0246] Furthermore, this embodiment of the application is described using only one row of adjacent samples as an example. This embodiment of the application can also be applied to the scenario of two rows of adjacent samples shown in Figure 10, where the processing method is the same as that for one row of samples, but the position coordinates of the preset number of position points are different.
[0247] In embodiments of this application, during encoding or decoding, the chroma value of a chroma sample at a preset position may be obtained from adjacent samples of the chroma block. Then, the luma value of the luma sample corresponding to the chroma sample at the preset position is obtained from adjacent samples of the luma block corresponding to the chroma block, and the obtained luma values are classified into a first luma set and a second luma set, and based on the classification of luma values, the corresponding chroma values are classified into the first chroma set and the second chroma set. Next, a scaling factor in the linear model corresponding to the chroma block can be determined based on the average value of luma values in the first luma set, the average value of luma values in the second luma set, the average value of chroma values in the first chroma set, and the average value of chroma values in the second chroma set, and after the scaling factor has been determined, an offset factor in the linear model corresponding to the chroma block can be determined based on the scaling factor. Finally, prediction information for the chroma block is determined based on the scaling factor, the offset factor, and the luma reconstruction information corresponding to the chroma block. Thus, in encoding or decoding, a preset number of chroma values are selected and then classified into two chroma sets, and a preset number of luma values are selected and then classified into two luma sets. Based on the average value of the luma values in each luma set and the average value of the chroma values in each chroma set, a scaling factor in the linear model corresponding to the chroma block is determined, and furthermore, an offset factor is determined. Since only a small amount of multiplication is required, encoding and decoding times can be reduced.
[0248] Figure 17 is a diagram of the configuration of a chromablock prediction device according to one embodiment of this application. The device may be implemented as part of or as a whole by using software, hardware, or a combination thereof. The device provided in this embodiment of this application may implement the procedure shown in Figures 11 to 16(d) in the embodiment of this application. The device includes an acquisition module 1710, a classification module 1720, and a determination module 1730.
[0249] The acquisition module 1710 is configured to acquire the chroma value of a chroma sample at a preset position from adjacent samples of a chroma block, and to acquire the luma value of a luma sample corresponding to the chroma sample at a preset position based on adjacent samples of a luma block corresponding to the chroma block, and in particular, it may be configured to implement the acquisition function and the implicit steps included in Figure 11.
[0250] The classification module 1720 is configured to classify the acquired luma values into a first luma set and a second luma set, to group the chroma values of chroma samples corresponding to luma samples related to luma values in the first luma set into the first chroma set, and to group the chroma values of chroma samples corresponding to luma samples related to luma values in the second luma set into the second chroma set. In particular, it may be configured to implement the classification function and the implicit steps included in Figure 11.
[0251] The decision module 1730 is configured to determine a scaling factor in the linear model corresponding to a chroma block based on the average value of chroma values in a first chroma set, the average value of chroma values in a second chroma set, the average value of chroma values in a first chroma set, and the average value of chroma values in a second chroma set; to determine an offset factor in the linear model corresponding to a chroma block based on the scaling factor; and to determine prediction information for a chroma block based on the scaling factor, the offset factor, and the chroma reconstruction information corresponding to a chroma block, wherein the chroma reconstruction information corresponding to a chroma block includes downsampling information for the chroma reconstruction block corresponding to the chroma block. In particular, it can be configured to implement the decision function and implicit steps included in Figure 11.
[0252] Optionally, acquisition module 1710 further, Instruction information is acquired, and based on the instruction information, an intra-prediction mode corresponding to the chroma block is determined, and the intra-prediction mode includes at least one of linear mode LM, linear mode upper LMA, and linear mode left LML. The preset position is determined based on the intra-predictive mode corresponding to the chroma block. It is configured in this way.
[0253] Optionally, acquisition module 1710 is, Based on a predetermined correspondence between the intra-prediction mode and the preset position, and the intra-prediction mode corresponding to the chroma block, the chroma value of the chroma sample at the preset position is obtained from the adjacent samples of the chroma block. It is configured in this way.
[0254] Optionally, the position coordinates of the upper adjacent samples in the chroma block are (0,-1), (1,-1), ..., and (X-1,-1), and the position coordinates of the left adjacent samples in the chroma block are (-1,0), (-1,1), ..., and (-1,Y-1). If the intra-prediction mode corresponding to the chroma block is the cross-component linear mode LM, the position coordinates of the chroma samples at the preset positions are (0,-1), (X-1,-1), (-1,-0), and (-1,Y-1).
[0255] Optionally, the position coordinates of the upper adjacent samples in the chroma block are (0,-1), (1,-1), ..., and (X-1,-1). If the intra-prediction mode corresponding to the chroma block is LMA on the cross-component linear mode, the position coordinates of the preset position are (0,-1), (X / 4,-1), (X-1-X / 4,-1), and (X-1,-1), or (0,-1), (X / 4,-1), (3×X / 4,-1), and (X-1,-1).
[0256] Optionally, the position coordinates of the left adjacent samples of the chroma block are (-1,0), (-1,1), ..., and (-1,Y-1). If the intra prediction mode corresponding to the chroma block is cross-component linear mode left LML, the position coordinates of the preset position are (-1,0), (-1,Y / 4), (-1,Y-1-Y / 4), and (-1,Y-1), or (-1,0), (-1,Y / 4), (-1,3×Y / 4), and (-1,Y-1).
[0257] Optionally, acquisition module 1710 is, From adjacent samples in the Lumablock, the position coordinates of the Lumasample corresponding to the chromasample at the i-th preset position within the preset position are (2×X i ,2×Y i ) is determined to be, and the position coordinates of the chroma sample at the i-th preset position are (X i ,Y i ) and, based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, the luma value of the luma sample corresponding to the chroma sample at the preset position is obtained from adjacent samples of the luma block corresponding to the chroma block, or, Based on the position coordinates of the chroma sample at the j-th preset position within the preset positions, the position coordinates of multiple samples corresponding to the j-th preset position are determined from adjacent samples in the luma block; based on the position coordinates of these multiple samples, the position coordinates of the luma sample corresponding to the chroma sample at the j-th preset position are determined; and based on the position coordinates of the luma sample corresponding to the chroma sample at the preset position, the luma value of the luma sample corresponding to the chroma sample at the preset position is obtained from adjacent samples in the luma block corresponding to the chroma block. It is configured in this way.
[0258] Optionally, the classification module 1720 is, Determine the average luma value of the luma sample corresponding to the chroma sample at the preset position. Luma values in the luma samples corresponding to the chroma samples at the preset positions that are less than or equal to the average luma value are grouped into a first luma set, and luma values in the luma samples corresponding to the chroma samples at the preset positions that are greater than the average luma value are grouped into a second luma set. It is configured in this way.
[0259] Optionally, the classification module 1720 is, The first luma value queue is obtained by sorting the luma values of the luma samples corresponding to the chroma samples at the preset positions in ascending order, and if the number of luma samples in the first luma value queue is even, the luma values of the first half of the first luma value queue are grouped into a first luma set, and the luma values of the second half of the luma value queue are grouped into a second luma set, or A second luma value queue is obtained by sorting the luma values of the luma samples corresponding to the chroma samples at the preset positions in descending order, and if the number of luma samples in the second luma value queue is even, the luma values of the latter half of the second luma value queue are grouped into a first luma set, and the luma values of the first half of the luma value queue are grouped into a second luma set. It is configured in this way.
[0260] Optionally, the decision module 1730 is, α=(C Lmean -C Rmean ) / (L Lmean -L Rmean ) is constructed such that, where α is the scaling factor in the linear model corresponding to the chroma block, and C Lmean This is the average value of the chroma values in the first chroma set, C Rmean L is the average value of the chroma values in the second chroma set. Lmean L is the average value of the luma values in the first luma set, Rmean This is the average value of the luma values in the second luma set.
[0261] Optionally, the decision module 1730 is, Based on the scaling factor, the mean value of the chroma values in the first chroma set, and the mean value of the luma values in the first luma set, the offset factor in the linear model corresponding to the chroma block is determined. It is configured in this way.
[0262] Optionally, the decision module 1730 is, β=C Lmean -α*L Lmean It is constructed such that α is the scaling factor, β is the offset factor in the linear model corresponding to the chroma block, and C Lmean L is the average value of the chroma values in the first chroma set. Lmean This is the average value of the luma values in the first luma set.
[0263] Optionally, the decision module 1730 is, Based on the scaling factor, the average chroma value of the chroma sample at the preset position, and the average lumen value of the luma sample corresponding to the chroma sample, the offset factor in the linear model corresponding to the chroma block is determined. It is configured in this way.
[0264] Optionally, the decision module 1730 is, β=C mean -α*L mean It is constructed such that α is the scaling factor, β is the offset factor in the linear model corresponding to the chroma block, and C mean This is the average value of the chroma samples at the preset position, L mean This is the average of the luma values of the luma samples corresponding to the chroma samples at the preset positions.
[0265] In embodiments of this application, during encoding or decoding, the chroma value of a chroma sample at a preset position may be obtained from adjacent samples of the chroma block. Then, the luma value of the luma sample corresponding to the chroma sample at the preset position is obtained from adjacent samples of the luma block corresponding to the chroma block, and the obtained luma values are classified into a first luma set and a second luma set, and based on the classification of luma values, the corresponding chroma values are classified into the first chroma set and the second chroma set. Next, a scaling factor in the linear model corresponding to the chroma block can be determined based on the average value of luma values in the first luma set, the average value of luma values in the second luma set, the average value of chroma values in the first chroma set, and the average value of chroma values in the second chroma set, and after the scaling factor has been determined, an offset factor in the linear model corresponding to the chroma block can be determined based on the scaling factor. Finally, prediction information for the chroma block is determined based on the scaling factor, the offset factor, and the luma reconstruction information corresponding to the chroma block. Thus, in encoding or decoding, a preset number of chroma values are selected and then classified into two chroma sets, and a preset number of luma values are selected and then classified into two luma sets. Based on the average value of the luma values in each luma set and the average value of the chroma values in each chroma set, a scaling factor in the linear model corresponding to the chroma block is determined, and furthermore, an offset factor is determined. Since only a small amount of multiplication is required, encoding and decoding times can be reduced.
[0266] Furthermore, when the chromablock prediction device provided in the above-described embodiment determines chromablock prediction information, the division of the functional modules described above is used merely as an example for illustrative purposes. In actual applications, the functions described above may be assigned to different functional modules as needed. In other words, the internal structure of the device is divided into multiple different functional modules so as to complete all or part of the functions described. Also, the chromablock prediction device provided in the above-described embodiment has the same concepts as the embodiment of the chromablock prediction method. For details regarding the specific implementation process of the chromablock prediction device, please refer to the method embodiment. Details will not be described again here.
[0267] This application further provides a computer-readable storage medium that stores instructions, and when the computer-readable storage medium is executed on a computing device, the computing device is enabled to execute a chromablock prediction method.
[0268] This application further provides a computer program product including instructions. When the computer program product is executed on a computing device, the computing device is enabled to perform a chromablock prediction method.
[0269] All or part of the embodiments described above may be implemented using software, hardware, firmware, or any combination thereof. When software is used for implementation, all or part of the embodiments may be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded onto a server or terminal and executed, all or part of the procedures or functions according to the embodiments of this application are generated. The computer instructions may be stored in a computer-readable storage medium or sent from one computer-readable storage medium to another. For example, computer instructions may be sent from a website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial optical cable, optical fiber, or digital subscriber line) or wireless (e.g., infrared, radio, or microwave) method. The computer-readable storage medium may be any available medium accessible by the server or terminal, or it may be a data storage device, such as a server or data center, that integrates one or more available media. The usable media may be magnetic media (e.g., floppy disks, hard disks, and magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state drives).
[0270] The above description is merely a specific implementation of this application and is not intended to limit this application. Any modification, equivalent substitution, or improvement made without departing from the spirit and principles of this application should be within the scope of protection of this application.
Claims
1. A decoding method, The bitstream is analyzed for instruction information and residual information, and the instruction information is used to indicate an intra-prediction mode for a chroma block, the intra-prediction mode having one of the following: linear mode (LM), linear mode on (LMA), and linear mode left (LML). Based on the intra prediction mode for the chroma block, a preset position is determined. The four chroma values of the chroma sample at the preset position are obtained from the adjacent samples of the chroma block. Based on the adjacent samples of the luma block corresponding to the chroma block, the four luma values of the luma samples corresponding to the four chroma samples at the preset position are obtained. The four Ruma values mentioned above are classified into two smaller Ruma values and two larger Ruma values. The two smaller luma values are grouped into a first luma set, and the two larger luma values are grouped into a second luma set. The chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the first chromatic set are grouped into the first chromatic set, and the chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the second chromatic set are grouped into the second chromatic set. Based on the two luma values in the first luma set, the two luma values in the second luma set, the two chroma values in the first chroma set, and the two chroma values in the second chroma set, the scaling coefficient in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor, and the chroma reconstruction block associated with the chroma block, the predicted block of the chroma block is determined. Based on the residual information and the prediction block of the chroma block, the reconstruction block of the chroma block is obtained. A method having the following characteristics.
2. Obtaining the four chroma values of the chroma sample at the preset position from adjacent samples in the chroma block is as follows: Based on a predetermined correspondence between the intra-prediction mode and the preset position, and the intra-prediction mode for the chroma block, the four chroma values of the chroma sample at the preset position are obtained from the adjacent samples of the chroma block. The method according to claim 1, wherein the method is as follows:
3. The above classification of the four luma values into two smaller luma values and two larger luma values is, A first luma value queue is obtained by sorting the four luma values of the luma sample corresponding to the chroma sample at the preset position in ascending order, and the first half of the first luma value queue has the two smaller luma values of the first luma value queue, and the second half of the first luma value queue has the two larger luma values of the first luma value queue, or A second luma value queue is obtained by sorting the four luma values of the luma sample corresponding to the chroma sample at the preset position in descending order, the first half of the second luma value queue having the two larger luma values of the second luma value queue, and the second half of the second luma value queue having the two smaller luma values of the second luma value queue. The method according to claim 1 or 2, wherein the method is as follows:
4. Determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient is: Based on the scaling coefficient, the two chroma values in the first chroma set, and the two luma values in the first luma set, the offset factor in the linear model corresponding to the chroma block is determined. The method according to any one of claims 1 to 3, wherein the method is characterized by having the following:
5. Determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient, the two chroma values in the first chroma set, and the two luma values in the first luma set is: β = C Lmean -α*L Lmean The property is such that, where α is the scaling coefficient, β is the offset factor in the linear model corresponding to the chroma block, and C Lmean L is the average value of the two chroma values in the first chroma set, Lmean This is the average value of the two luma values in the first luma set. The method according to claim 4.
6. A decoding device having a processing circuit configured to perform the decoding method described in any one of claims 1 to 5.
7. A computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computing device, the computing device is enabled to execute the decoding method described in any one of claims 1 to 5.
8. A computer program having instructions, wherein when the instructions are executed on a computing device, the computing device is enabled to execute the decoding method described in any one of claims 1 to 5.
9. An encoding method, The preset position is determined based on the intra-prediction mode for the chroma block. The four chroma values of the chroma sample at the preset position are obtained from the adjacent samples of the chroma block. Based on the adjacent samples of the luma block corresponding to the chroma block, the four luma values of the luma samples corresponding to the four chroma samples at the preset position are obtained. The four Ruma values mentioned above are classified into two smaller Ruma values and two larger Ruma values. The two smaller luma values are grouped into a first luma set, and the two larger luma values are grouped into a second luma set. The chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the first chromatic set are grouped into the first chromatic set, and the chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the second chromatic set are grouped into the second chromatic set. Based on the two luma values in the first luma set, the two luma values in the second luma set, the two chroma values in the first chroma set, and the two chroma values in the second chroma set, the scaling coefficient in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor, and the chroma reconstruction block associated with the chroma block, the predicted block of the chroma block is determined. Based on the prediction block of the chroma block and the chroma block, residual information is obtained. Instruction information and residual information are encoded into a bitstream, the instruction information being used to indicate the intra-prediction mode for the chroma block, the intra-prediction mode having one of linear mode (LM), linear mode on (LMA), and linear mode left (LML). A method having the following characteristics.
10. Obtaining the four chroma values of the chroma sample at the preset position from adjacent samples in the chroma block is as follows: Based on a predetermined correspondence between the intra-prediction mode and the preset position, and the intra-prediction mode for the chroma block, the four chroma values of the chroma sample at the preset position are obtained from the adjacent samples of the chroma block. The method according to claim 9, wherein the method is as follows:
11. The above classification of the four luma values into two smaller luma values and two larger luma values is, A first luma value queue is obtained by sorting the four luma values of the luma sample corresponding to the chroma sample at the preset position in ascending order, and the first half of the first luma value queue has the two smaller luma values of the first luma value queue, and the second half of the first luma value queue has the two larger luma values of the first luma value queue, or A second luma value queue is obtained by sorting the four luma values of the luma sample corresponding to the chroma sample at the preset position in descending order, the first half of the second luma value queue having the two larger luma values of the second luma value queue, and the second half of the second luma value queue having the two smaller luma values of the second luma value queue. The method according to claim 9 or 10, wherein the method is as follows:
12. Determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient is: Based on the scaling coefficient, the two chroma values in the first chroma set, and the two luma values in the first luma set, the offset factor in the linear model corresponding to the chroma block is determined. The method according to any one of claims 9 to 11, wherein the method is as follows:
13. Determining the offset factor in the linear model corresponding to the chroma block based on the scaling coefficient, the two chroma values in the first chroma set, and the two luma values in the first luma set is: β = C Lmean -α*L Lmean The property is such that, where α is the scaling coefficient, β is the offset factor in the linear model corresponding to the chroma block, and C Lmean L is the average value of the two chroma values in the first chroma set, Lmean This is the average value of the two luma values in the first luma set. The method according to claim 12.
14. An encoding device having a processing circuit, The processing circuit is configured to perform the encoding method described in any one of claims 9 to 13. Encoding device.
15. A computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computing device, the computing device is enabled to execute the encoding method described in any one of claims 9 to 13.
16. A computer program having instructions, wherein when the instructions are executed on a computing device, the computing device is enabled to execute the encoding method described in any one of claims 9 to 13.
17. A method for storing a bitstream, Receiving or transmitting a bitstream via a communication interface, The bitstream is stored in one or more storage media, the bitstream is obtained by performing an encoding process on video data, the bitstream has encoded video data, instruction information and residual information, the instruction information is used to indicate an intra-prediction mode for a chroma block, the intra-prediction mode has one of linear mode (LM), linear mode on (LMA), and linear mode left (LML), and the encoding process is, The preset position is determined based on the intra-prediction mode for the chroma block. The four chroma values of the chroma sample at the preset position are obtained from the adjacent samples of the chroma block. Based on the adjacent samples of the luma block corresponding to the chroma block, the four luma values of the luma samples corresponding to the four chroma samples at the preset position are obtained. The four Ruma values mentioned above are classified into two smaller Ruma values and two larger Ruma values. The two smaller luma values are grouped into a first luma set, and the two larger luma values are grouped into a second luma set. The chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the first chromatic set are grouped into the first chromatic set, and the chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the second chromatic set are grouped into the second chromatic set. Based on the two luma values in the first luma set, the two luma values in the second luma set, the two chroma values in the first chroma set, and the two chroma values in the second chroma set, the scaling coefficient in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor, and the chroma reconstruction block associated with the chroma block, the predicted block of the chroma block is determined. Based on the prediction block of the chroma block and the chroma block, residual information is obtained. The instruction information and the residual information are encoded into the bitstream. Having, method.
18. A device for storing a bitstream, having one or more storage media, The one or more storage mediums are configured to store one or more bitstreams, the bitstreams are obtained by performing an encoding process on video data, the bitstreams have encoded video data, instruction information and residual information, the instruction information is used to indicate an intra-prediction mode for a chroma block, the intra-prediction mode has one of linear mode (LM), linear mode on (LMA), and linear mode left (LML), and the encoding process is The preset position is determined based on the intra-prediction mode for the chroma block. The four chroma values of the chroma sample at the preset position are obtained from the adjacent samples of the chroma block. Based on the adjacent samples of the luma block corresponding to the chroma block, the four luma values of the luma samples corresponding to the four chroma samples at the preset position are obtained. The four Ruma values mentioned above are classified into two smaller Ruma values and two larger Ruma values. The two smaller luma values are grouped into a first luma set, and the two larger luma values are grouped into a second luma set. The chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the first chromatic set are grouped into the first chromatic set, and the chromatic values of chromatic samples corresponding to chromatic samples related to chromatic values in the second chromatic set are grouped into the second chromatic set. Based on the two luma values in the first luma set, the two luma values in the second luma set, the two chroma values in the first chroma set, and the two chroma values in the second chroma set, the scaling coefficient in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor in the linear model corresponding to the chroma block is determined. Based on the scaling coefficient, the offset factor, and the chroma reconstruction block associated with the chroma block, the predicted block of the chroma block is determined. Based on the prediction block of the chroma block and the chroma block, residual information is obtained. The instruction information and the residual information are encoded into the bitstream. Having, Device.