Encoding and decoding method, code stream, encoder, decoder and storage medium
Patent Information
- Application Number
- CN202380099892.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2026-02-13
AI Technical Summary
The existing DM mode and IntraDBV mode have functional redundancy in the H.266/VVC encoding standard, resulting in low encoding and decoding efficiency.
By obtaining the prediction mode reference information of the chroma block and the identifier of the decoding or encoding syntax element, it is determined whether the current chroma block uses the first intra-frame prediction mode or the second intra-frame prediction mode, skipping unnecessary encoding or decoding, and using the identifier of the third syntax element to enable the intra-frame prediction mode, thereby reducing the number of codewords to be encoded and decoded.
It improves the encoding and decoding compression efficiency of chroma components, reduces redundant coding, and enhances coding efficiency.
Smart Images

Figure CN121533018A_ABST
Abstract
Description
Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field
[0001] The present application relates to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art
[0002] The DM mode is a chroma intra-frame prediction mode in which the chroma depends on the luminance. For example, when the chroma block selects the DM mode, the chroma block will find the luminance block at the corresponding position, and the chroma block determines its own prediction mode based on the intra-frame prediction mode of the found luminance block.
[0003] The exploratory ECM model for the next-generation H.266 / VVC coding standard adds the intraDBV mode for chroma prediction within a frame. This mode is also a chroma intra-frame prediction mode where chroma depends on luma. It determines the block vector (BV) of the chroma block based on the luma block at the corresponding position, thereby determining the reference block for the chroma block.
[0004] However, due to the functional redundancy between the DM mode and the IntraDBV mode, the encoding and decoding efficiency of the existing DM mode and the IntraDBV mode is low.
[0005] Summary of the Invention
[0006] The present application provides a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium.
[0007] The technical solution of this application can be implemented as follows:
[0008] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:
[0009] Get the prediction mode reference information of the current chroma block;
[0010] If the prediction mode reference information satisfies a usage condition of the first intra prediction mode, decoding a first syntax element identifier;
[0011] Determining, according to the first syntax element identifier, whether the current chroma block uses the first intra prediction mode;
[0012] If the prediction mode reference information does not satisfy the usage condition of the first intra prediction mode, decoding a second syntax element identifier;
[0013] Determine whether the current chroma block uses the second intra prediction mode according to the second syntax element identifier.
[0014] In a second aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:
[0015] Decoding the third syntax element identifier of the current chroma block;
[0016] When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode, obtaining prediction mode reference information of the current chroma block;
[0017] When the prediction mode reference information satisfies a use condition of the first intra prediction mode, determining that the current chroma block uses the first intra prediction mode;
[0018] In a case where the prediction mode reference information does not satisfy a use condition of the first intra prediction mode, it is determined that the current chroma block uses the second intra prediction mode.
[0019] In a third aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:
[0020] Get the prediction mode reference information of the current chroma block;
[0021] If the prediction mode reference information satisfies a usage condition of the first intra prediction mode, encoding a first syntax element identifier;
[0022] Determining, according to the first syntax element identifier, whether the current chroma block uses the first intra prediction mode;
[0023] If the prediction mode reference information does not satisfy the usage condition of the first intra prediction mode, encoding a second syntax element identifier;
[0024] According to the second syntax element identifier, it is determined whether the current chroma block uses the second intra prediction mode.
[0025] In a fourth aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:
[0026] Encode the third syntax element identifier of the current chroma block;
[0027] When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode, obtaining prediction mode reference information of the current chroma block;
[0028] When the prediction mode reference information satisfies a use condition of the first intra prediction mode, determining that the current chroma block uses the first intra prediction mode;
[0029] In a case where the prediction mode reference information does not satisfy a use condition of the first intra prediction mode, it is determined that the current chroma block uses the second intra prediction mode.
[0030] In a fifth aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:
[0031] A first syntax element identifier for indicating whether to use the first intra-frame prediction mode, a second syntax element identifier for indicating whether to use the second intra-frame prediction mode, a third syntax element identifier for indicating whether the first intra-frame prediction mode and the second intra-frame prediction mode are allowed, a syntax element identifier for indicating a weighted prediction mode, other syntax element identifiers for indicating other intra-frame prediction modes, and a syntax element identifier for indicating a cross-component intra-frame prediction mode.
[0032] In a sixth aspect, an embodiment of the present application provides an encoder, comprising a first acquiring unit, an encoding unit, and a first determining unit; wherein,
[0033] The first acquiring unit is configured to acquire prediction mode reference information of the current chroma block;
[0034] The encoding unit is configured as a first determining unit, configured to encode a first syntax element identifier when the prediction mode reference information meets a usage condition of the first intra prediction mode;
[0035] The first determining unit is configured to determine whether the current chroma block uses the first intra prediction mode according to the first syntax element identifier;
[0036] The encoding unit is further configured to encode a second syntax element identifier if the prediction mode reference information does not satisfy a usage condition of the first intra prediction mode;
[0037] The first determining unit is further configured to determine whether the current chroma block uses the second intra prediction mode according to the second syntax element identifier.
[0038] In a seventh aspect, an embodiment of the present application provides an encoder, comprising a first acquiring unit, an encoding unit, and a first determining unit; wherein,
[0039] The encoding unit is configured to encode a third syntax element identifier of the current chroma block;
[0040] The first acquiring unit is configured to acquire prediction mode reference information of the current chroma block when it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra prediction mode and the second intra prediction mode;
[0041] The first determining unit is configured to determine that the current chroma block uses the first intra prediction mode if the prediction mode reference information satisfies a use condition of the first intra prediction mode;
[0042] The first determining unit is further configured to determine that the current chroma block uses the second intra prediction mode when the prediction mode reference information does not meet the use condition of the first intra prediction mode.
[0043] In an eighth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein:
[0044] a first memory for storing a computer program capable of running on the first processor;
[0045] The first processor is configured to execute the method described in the third aspect and the fourth aspect when running a computer program.
[0046] In a ninth aspect, an embodiment of the present application provides a decoder, including:
[0047] A second acquiring unit configured to acquire prediction mode reference information of a current chroma block;
[0048] A decoding unit configured to decode a first syntax element identifier if the prediction mode reference information satisfies a usage condition of the first intra prediction mode;
[0049] a second determining unit configured to determine, according to the first syntax element identifier, whether the current chroma block uses the first intra prediction mode;
[0050] The decoding unit is further configured to decode a second syntax element identifier if the prediction mode reference information does not satisfy a usage condition of the first intra prediction mode;
[0051] The second determining unit is further configured to determine whether the current chroma block uses the second intra prediction mode according to the second syntax element identifier.
[0052] In a tenth aspect, an embodiment of the present application provides a decoder, including:
[0053] A decoding unit configured to decode a third syntax element identifier of a current chroma block;
[0054] a second acquiring unit configured to acquire prediction mode reference information of the current chroma block when determining, according to the third syntax element identifier, that the current chroma block allows the use of the first intra prediction mode and the second intra prediction mode;
[0055] a second determining unit, configured to determine that the current chroma block uses the first intra prediction mode if the prediction mode reference information satisfies a use condition of the first intra prediction mode;
[0056] The second determining unit is further configured to determine that the current chroma block uses the second intra prediction mode if the prediction mode reference information does not meet the use condition of the first intra prediction mode.
[0057] In an eleventh aspect, an embodiment of the present application provides a decoder, comprising a second memory and a second processor; wherein:
[0058] a second memory for storing a computer program capable of running on the second processor;
[0059] The second processor is configured to execute the method described in the first aspect and the second aspect when running a computer program.
[0060] In a twelfth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the methods described in aspects 1 to 4.
[0061] The embodiment of the present application provides a coding and decoding method, a code stream, an encoder, a decoder and a storage medium. When coding and decoding chroma components, taking into account the functional redundancy of some intra-frame prediction modes, when the prediction mode reference information meets the use conditions of the first intra-frame prediction mode, only the first syntax element identifier is encoded / decoded, and according to the first syntax element identifier, it is determined whether the current chroma block uses the first intra-frame prediction mode, and the encoding / decoding of the syntax element identifier related to the second intra-frame prediction mode is skipped, that is, the current chroma block does not use the second intra-frame prediction mode. When it is not satisfied, only the second syntax element identifier is encoded / decoded, and according to the second syntax element identifier, it is determined whether the current chroma block uses the second intra-frame prediction mode; the encoding / decoding of the syntax element identifier related to the first intra-frame prediction mode is skipped, that is, the current chroma block does not use the first intra-frame prediction mode. In this way, when coding and decoding chroma components, the encoding and decoding codewords of the two intra-frame prediction modes are reduced, thereby improving compression efficiency.
[0062] In addition, a third syntax element identifier can be used to simultaneously indicate whether the first intra-frame prediction mode and the second intra-frame prediction mode are allowed to be used. When allowed, it is then determined whether the prediction mode reference information meets the use conditions of the first intra-frame prediction mode. When it meets the conditions, it can be directly determined that the current chroma block uses the first intra-frame prediction mode. When it does not meet the conditions, it is determined that the current chroma block uses the second intra-frame prediction mode. In this way, when encoding and decoding the chroma component, the third syntax element identifier can be used to enable these two intra-frame prediction modes. Furthermore, the same syntax element can be used to identify the same or similar prediction information in different intra-frame prediction modes, which can also reduce the encoding and decoding codewords of the chroma prediction mode and improve compression efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] FIG1 is a schematic diagram of a reference region of an Intra TMP;
[0064] Figure 2 is a schematic diagram of a template type;
[0065] FIG3 is a schematic diagram of a chroma and luminance dual tree partitioning tree structure;
[0066] FIG4A is a schematic block diagram of an encoder provided in an embodiment of the present application;
[0067] FIG4B is a schematic block diagram of a decoder according to an embodiment of the present application;
[0068] FIG5 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;
[0069] FIG6 is a flowchart diagram 1 of a decoding method provided in an embodiment of the present application;
[0070] FIG7 is a second flow chart of a decoding method provided in an embodiment of the present application;
[0071] FIG8 is a flowchart diagram 1 of an encoding method provided in an embodiment of the present application;
[0072] FIG9 is a second flow chart of an encoding method provided in an embodiment of the present application;
[0073] FIG10 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;
[0074] FIG11 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;
[0075] FIG12 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;
[0076] FIG13 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;
[0077] FIG14 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0080] In the following description, reference is made to "some embodiments," which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first, second, and third" in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0081] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0082] Coding Block (CB);
[0083] Block Matching (BM);
[0084] Coding Unit (CU);
[0085] Block Vector (BV);
[0086] Sum of Absolute Difference (SAD);
[0087] Sum of Absolute Transformed Difference (SATD);
[0088] Mean Square Error (MSE);
[0089] Sum of Squared Differences (SSD);
[0090] Mean Absolute Deviation (MAD);
[0091] Mean Square Differences (MSD);
[0092] Rate–distortion optimization (RDO);
[0093] Normalized Correlation Coefficient (NCC);
[0094] Peak Signal to Noise Ratio (PSNR);
[0095] Single tree structure (ST);
[0096] Dual tree (DT)
[0097] Chroma direct prediction mode (Direct Mode, DM);
[0098] Chroma direct derived block vector prediction mode (Intra Direct Block Vector, intra DBV);
[0099] H.265 / High Efficiency Video Coding (HEVC);
[0100] H.265 / HEVC Screen Content Coding (SCC);
[0101] Essential Video Coding (EVC);
[0102] H.266 / Versatile Video Coding (VVC);
[0103] VVC Test Model (VTM), a reference software testing platform for VVC;
[0104] Intra Block Copy (IBC);
[0105] Intra Template Matching Prediction (Intra TMP);
[0106] Cross Component Linear Model (CCLM);
[0107] Cross-component patterns of multilinear models (Multi-models CCLM, MMLM);
[0108] Convolutional Cross-Component intra prediction Model (CCCM);
[0109] Beyond VVC's reference software testing platform (Enhanced Compression Model, ECM).
[0110] It can be understood that in a video image, a first color component, a second color component, and a third color component are generally used to represent a coding block. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V. Thus, a video image can be represented in either the YCbCr format or the YUV format.
[0111] Single tree is a tree structure that uses the same partitioning structure for luminance and chrominance components when encoding a frame intra-frame. Specifically, the luminance block and chrominance block in a CTU can be divided into the same tree structure.
[0112] Dual tree is a tree structure that allows different divisions of luminance and chrominance components when intra-coding frames. Since the luminance component and chrominance component have fundamentally different levels of detail, the luminance component has richer details and needs to be divided into smaller blocks for more refined prediction, while the chrominance component is relatively flat and does not need to be divided into small blocks for fine prediction. VVC introduces a technology that uses different divisions for luminance and chrominance components. Dual Tree is enabled in the Coding Tree Unit and is only allowed to be enabled in intra-coded frames. In inter-coded frames, luminance and chrominance still use a single division tree structure (Single tree). Due to the introduction of dual tree technology, both luminance and chrominance components can achieve better coding effects.
[0113] IBC technology has been adopted since the HEVC expansion stage. It is a significant tool for screen content coding. IBC technology searches for the most suitable reference block for current block prediction from the allowed reference area, and uses the most suitable reference block copy to predict the current block. The coordinate position difference of the reference block relative to the current block is called the block vector. The block vector consists of horizontal and vertical directions. BV is expressed as: BV = (iHor, iVer)
[0114] Among them, iHor is the coordinate difference in the horizontal direction, and iVer is the coordinate difference in the vertical direction.
[0115] The block vector is written into the bitstream through a binary symbol for transmission, which is used to instruct the decoder to find the reference block when using the IBC technology for prediction. Each coding unit has its own type. In VVC and ECM, these types include Intra, Inter, and IBC. In the Dual tree partitioning mode, there can be a chroma coding unit of Intra type, and the luminance coding unit at the corresponding position is of IBC type. Under the Single tree, since the luminance and chroma are divided in the same way, a coding unit includes both luminance and chroma components. Therefore, when the coding unit type is IBC type, both luminance and chroma are of IBC type. At this time, the block vector used for prediction in the chroma prediction mode is directly derived from the block vector of the luminance block.
[0116] For example, the process of deriving chrominance BV based on luma BV is as follows:
[0117] Input: bvL of luminance (1 / 16 pixel accuracy)
[0118] Output: bvC (Block Vector Chroma) of chroma (1 / 32 pixel accuracy)
[0119] The derivation process can be directly scaled, or refined using TM after scaling. Examples of scaling operations are as follows:
[0120] bvC[0]=((bvL[0]>>(3+SubWidthC))*32)
[0121] bvC[1]=((bvL[1]>>(3+SubHeightC))*32)
[0122] The variables SubWidthC and SubHeightC depend on the chroma format sampling structure specified by the syntax element sps_chroma_format_idc, and the specific correspondence is as follows:
[0123] Table 1-1 Correspondence between sps_chroma_format_idc and chroma format sampling structure
[0124] The detailed operation example can be as follows:
[0125] TM is used for refinement, that is, after obtaining the luminance BV, the position of the chrominance block and BV are used to find the offset position, and a template is used to perform a fine search near the offset position, and the optimal BV is obtained with the minimum TMcost as the standard.
[0126] IBC technology is used as a key tool for screen video coding in coding standards such as H.265 / HEVC SCC, H.266 / VVC, and AV1, AVS3, and EVC. The exploratory model ECM for the next-generation H.266 / VVC coding standard also continues to use IBC technology as a screen video coding tool, expanding it into a tool set with multiple modes. It has also been introduced to the coding of general natural video, making it a more versatile video coding tool.
[0127] In addition, ECM also includes Dual Tree technology, intraTMP technology, DM technology and intraDBV technology.
[0128] Intra TMP technology is a special intra-frame prediction mode. Both the encoder and decoder use the reconstructed area around the coding block as a template, find the best matching template in a predefined reconstructed area, and use the reconstructed value of the block corresponding to the best matching template as the current block prediction value.
[0129] IntraTMP works similarly to IBC: for the current prediction block, a reference block is found and copied to the current block's location as the prediction value. Unlike IBC, however, the block vector is not represented in the bitstream via binarization. Instead, it is found from a predefined region through template matching.
[0130] As shown in Figure 1, R1, R2, R3, and R4 are the reference regions used for searching the current block. The L-shaped reconstructed region surrounding the current block is the current block template. A search is performed using a preset cost function to find one or more L-shaped regions within the reference region that best match the current block template. The found L-shaped reconstructed blocks are used as prediction blocks for the current block. When IntraTMP is used for luma, the luma coding block type is Intra.
[0131] In an embodiment of the present application, the preset cost function can be the sum of absolute error SAD, the sum of absolute transformation difference SATD, the mean square error MSE, the sum of squared errors SSD, the mean absolute difference MAD, the mean sum of squared errors MSD, rate-distortion optimization RDO, the normalized correlation coefficient NCC, etc., which are not specifically limited here.
[0132] For example, taking absolute error and SAD as examples, the cost function at this time is as follows:
[0133] Among them, T i is the template in the search process, and M represents the number of pixels in the template.
[0134] The following is a detailed introduction to the prediction process of the Intra TMP technology in the related art.
[0135] The input of the IntraTMP technology: the position of the current block (xTbCmp, yTbCmp), the width of the current block nTbW, and the height of the current block nTbH.
[0136] Output of the IntraTMP technology: predicted value predSamples[x][y] of the current block, where x = 0..nTbW-1, y = 0..nTbH–1.
[0137] Specifically, the IntraTMP prediction process can be divided into four steps: determining the current template type, obtaining the reconstructed pixels of the current template, determining the block vector within a predefined search range, and generating the predicted value. This process yields the predicted value for the current block. It's important to note that the IntraTMP technique can be used to predict both luma and chroma components, and this is not specifically limited here.
[0138] In the embodiments of this application, there are many places involving the use of templates and template matching costs, which are explained here in a unified manner. The template type can be represented by refTemplateType, and the template types include but are not limited to the six types shown in Figure 2. Figure 2 shows a schematic diagram of a template type. As shown in Figure 2, the block filled with the grid is the current block, and the adjacent area of the current block is the template T. Six template types are shown here, which can be valid at the same time and selected for use by the syntax elements, or they can be used separately (for example, only type (a) in Figure 2 is used).
[0139] For example, the six template types are as follows:
[0140] When the upper left reference pixel, the upper reference pixel, and the left reference pixel are all available, the value of refTemplateType is 1, and the template shape is shown in (a) of Figure 2;
[0141] When only the left reference pixel is available, the value of refTemplateType is 2, and the template shape is shown in (b) in Figure 2;
[0142] When only the upper reference pixel is available, the value of refTemplateType is 3, and the template shape is shown in (c) in Figure 2;
[0143] When only the left reference pixel and the upper left reference pixel are available, the value of refTemplateType is 4, and the template shape is shown in (d) in Figure 2;
[0144] When only the left reference pixel and the lower left reference pixel are available, the value of refTemplateType is 5, and the template shape is shown in (e) in Figure 2;
[0145] When only the upper reference pixel and the upper right reference pixel are available, the value of refTemplateType is 6, and the template shape is shown in (f) in Figure 2.
[0146] It should be noted that the template can be composed of reconstructed pixels from one or more areas of the top, upper right, left, lower left, or upper left of the current block. In addition, the template size can be pre-set. For example, when obtaining the left template, the template width templateW_size can be set to 4, and when obtaining the top template, the template height templateH_size can be set to 4.
[0147] It should also be noted that the portion of the reconstructed pixels to be obtained can be determined by the value of refTemplateType. For example, when the value of refTemplateType is 1, the reconstructed pixels of the left, upper-left, and upper sides of the current block are obtained; or, when the value of refTemplateType is 2, only the reconstructed pixels of the four left columns of the current block are obtained; or, when the value of refTemplateType is 3, only the reconstructed pixels of the four upper rows of the current block are obtained.
[0148] The DM mode is a chroma intra-frame prediction mode in which the chroma depends on the luminance. For example, when the chroma block selects the DM mode, the chroma block will find the luminance block at the corresponding position (the specific method of finding the luminance block at the corresponding position is to use the center position of the chroma block to find the corresponding luminance position, and the luminance block to which the position belongs is the luminance block at the corresponding position. For example, in a YUV420 video sequence, the coordinates of the center position of a chroma block in the current frame are (x, y), then its corresponding luminance position is (2x, 2y), and the corresponding luminance block is the luminance block to which the position (2x, 2y) belongs). The chroma block directly uses the intra-frame prediction mode of the found luminance block, which are Planar, DC or angular prediction modes, also known as traditional intra-frame prediction modes.
[0149] In ECM, the above-mentioned IBC technology and intraTMP technology have no corresponding traditional intra-frame prediction mode, so the corresponding method of the DM mode in the existing situation is:
[0150] 1. When the current coding tree unit is divided into Dual tree: if the chroma intra prediction block uses the DM mode and the corresponding luminance block uses the IBC mode, the DC prediction mode is used to predict the current chroma block;
[0151] 2. When the current coding tree unit is divided into Dual tree: If the chroma intra prediction block uses the DM mode and the luminance block at the corresponding position uses the intraTMP mode, the Planar prediction mode is used to predict the current chroma block.
[0152] 3. When the current coding tree unit is divided into Single tree: If the chroma intra prediction block uses the DM mode and the luminance block at the corresponding position uses the intraTMP mode, the Planar prediction mode is used to predict the current chroma block.
[0153] It should be noted that when the current coding tree unit is divided into Single tree, when the luminance coding unit selects the IBC mode, the chrominance block type is also set to the IBC type coding unit, the DM mode is the intra-frame prediction mode, and there is no IBC type coding unit, that is, the IBC type coding unit has no DM mode.
[0154] In ECM, for the dual tree case, the intraDBV mode is added to the chrominance prediction of the intra-frame coding type.
[0155] As shown in Figure 3, under the dual tree partitioning, the chroma coding unit finds the corresponding luma area and sequentially checks whether at least one luma block at the following five pixel positions (C->TL->TR->BL->BR) uses the IBC or intraTMP mode. When at least one luma block at these five pixel positions uses IBC or intraTMP, the first block vector found in sequence is used as the block vector for chroma block prediction. The reconstructed block at the position pointed to by the chroma block vector is used to predict the current chroma block.
[0156] On the basis of the above-obtained prediction values, weighted prediction with other intra-frame prediction methods can also be implemented, and the result after weighted prediction is used as the final prediction result.
[0157] In chroma prediction, non-cross-component prediction mode and cross-component mode are allowed to be weighted to generate the final prediction result, thereby improving the prediction accuracy. The weighted mode in ECM allows DM mode, DIMD mode and traditional intra prediction mode to be weighted with cross-component prediction mode. The cross-component model mode used for weighting is divided into three types according to the mode type and weighting weight, as shown in Table 1-2.
[0158] Table 1-2. Three chroma weighting modes allowed in the ECM reference software
[0159] In addition to the weighting modes in the above ECM, it should also be possible to expand to other cross-component models, as well as weighting modes using other weights and non-cross-component models.
[0160] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0161] Referring to FIG4A , which shows a block diagram of an encoder provided in an embodiment of the present application. As shown in FIG4A , the encoder (specifically, a “video encoder”) 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image cache unit 110, etc., wherein the filtering unit 108 may implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 may implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding on the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is the process of generating a motion vector, which can estimate the motion of the video coding block. The motion compensation unit 104 then calculates the motion vector based on the motion vector determined by the motion estimation unit 105. After determining the intra-frame prediction mode, the intra-frame prediction unit 103 is further configured to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109. In addition, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block and reconstruct a residual block in the pixel domain. The reconstructed residual block is subjected to the filter control analysis unit 107 and the filtering unit 108 to remove the block effect artifacts. The reconstructed residual block is then added to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video coding block. The encoding unit 109 is configured to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode, and output the code stream of the video signal. The decoded image buffer unit 110 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .
[0162] Referring to FIG4B , which shows a block diagram of a decoder provided in an embodiment of the present application, as shown in FIG4B , the decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is encoded as shown in FIG4A , a code stream of the video signal is output; the code stream is input to the decoder 200 and first passes through the decoding unit 201 to obtain decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from the previously decoded block of the current frame or picture; the motion compensation unit 204 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.
[0163] Furthermore, an embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein FIG5 shows a schematic diagram of a network architecture of a coding and decoding system provided by an embodiment of the present application. As shown in FIG5 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video coding and decoding functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., which are not specifically limited here. In addition, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.
[0164] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in Figure 4A and the intra-frame prediction unit 203 shown in Figure 4B. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited thereto.
[0165] It should also be noted that, when applied to the intra-frame prediction unit 103, the "current block" specifically refers to the luminance coding block or chrominance coding block currently to be intra-frame predicted; when applied to the intra-frame prediction unit 203, the "current block" specifically refers to the luminance decoding block or chrominance decoding block currently to be intra-frame predicted.
[0166] To facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application. The embodiments of the present application include at least part of the following contents. The present application provides a coding and decoding method, and more specifically provides a coding and decoding technology for intra-frame chroma blocks.
[0167] In one embodiment of the present application, referring to FIG6 , a flowchart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG6 , the method may include:
[0168] Step 601: Obtain prediction mode reference information of the current chroma block;
[0169] It should be noted that the prediction mode reference information is used to determine the intra prediction mode of the current chroma block.
[0170] In some embodiments, the prediction mode reference information includes relevant information of the luminance block corresponding to the current chrominance block. Exemplarily, the prediction mode reference information may be intra-frame prediction mode information of the luminance block corresponding to the current chrominance block.
[0171] In some embodiments, the prediction mode reference information may further include a partitioning mode of the image unit in which the current chroma block is located. Exemplarily, the image unit in which the current chroma block is located may be the current coding tree unit (CTU), the current frame, or other coding units. The partitioning mode is used to indicate the partitioning tree structure used for the luminance block and the chroma block when encoding the frame intra-frame. The partitioning tree structure may be a single tree structure or a dual tree structure.
[0172] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a single tree structure, and obtaining the prediction mode of the first luminance block corresponding to the current chroma block; when the prediction mode of the first luminance block is the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the first luminance block is not the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0173] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a dual-tree structure, and searching for luminance blocks at multiple positions in a first order in the luminance area corresponding to the current chroma block; when the prediction mode of the first luminance block is searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the luminance block is not searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0174] In some embodiments, the prediction mode reference information may further include the size of the current chroma block and related syntax elements of the current chroma block.
[0175] Step 602: Decode a first syntax element identifier when the prediction mode reference information satisfies a usage condition of the first intra prediction mode;
[0176] It should be noted that the usage condition of the first intra-frame prediction mode is used to determine whether the first intra-frame prediction mode can be used for the current chroma block. Exemplarily, the first intra-frame prediction mode can be any chroma intra-frame prediction mode. For example, the first intra-frame prediction mode can be a chroma direct derived block vector prediction mode (IntraDBV mode) or a chroma direct derived prediction mode (DM mode).
[0177] In some embodiments, when the intra-frame prediction mode information of the luma block corresponding to the current chroma block is used, the use condition may include: the luma block corresponding to the current chroma block uses the third intra-frame prediction mode. In other words, when the intra-frame prediction mode of the luma block corresponding to the current chroma block is the third intra-frame prediction mode, it is determined that the current chroma block can use the first intra-frame prediction mode; otherwise, it is determined that the current chroma block cannot use the first intra-frame prediction mode.
[0178] Exemplarily, the first intra prediction mode is the IntraDBV mode, and the third intra prediction mode may be the intra block copy prediction mode (IBC mode) or the intra template matching prediction mode (IntraTMP mode).
[0179] Exemplarily, the first intra-frame prediction mode is a DM mode, and the third intra-frame prediction mode may be a traditional intra-frame prediction mode, such as a Planar mode, a DC mode, or an angular prediction mode.
[0180] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the use condition further includes: a division mode of the image unit where the current chroma block is located is a dual-tree structure.
[0181] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the usage condition further includes: a division mode of the image unit where the current chroma block is located is a single tree structure.
[0182] It should be noted that when the prediction mode reference information does not include the division mode of the image unit where the current chroma block is located, the usage condition does not restrict the division mode, that is, the first intra prediction mode is applicable to any division mode.
[0183] Step 603: Determine whether the current chroma block uses the first intra prediction mode according to the first syntax element identifier;
[0184] It should be noted that the first syntax element identifier is used to indicate whether the current chroma block uses the first intra-frame prediction mode. Exemplarily, when the first syntax element identifier is a first value, it is determined that the current chroma block does not use the first intra-frame prediction mode; when the first syntax element identifier is a second value, it is determined that the current chroma block uses the first intra-frame prediction mode.
[0185] Further, in some embodiments, the first intra-frame prediction mode is a chroma direct derived block vector prediction mode (intraDBV), and the method further includes: when determining that the current chroma block uses the first intra-frame prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; determining a block vector of the current chroma block based on the block vector of the first luminance block; and determining a first prediction block of the current chroma block based on the block vector of the current chroma block.
[0186] Exemplarily, when the current chroma block is predicted using intraDBV, as shown in Figure 3, under the dual tree partitioning, the chroma block finds the corresponding luminance area, and checks whether there is at least one luminance block at the following five positions (C->TL->TR->BL->BR) in the first order using IBC or intraTMP mode. When at least one luminance block at these five positions uses IBC or intraTMP, the first block vector found in the first order (C->TL->TR->BL->BR) is used to derive a chroma block vector, and the reconstructed block at the position pointed to by the chroma block vector is used to predict the current chroma block.
[0187] More specifically, determining the block vector of the current chroma block based on the block vector of the first luminance block includes: downsampling the block vector of the first luminance block to determine the downsampled block vector; and performing a fine search based on the downsampled block vector to determine the block vector of the current chroma block. Exemplarily, a fine search based on template matching is performed based on the downsampled block vector to determine the optimal block vector for the current chroma block.
[0188] It should be noted that, when it is determined that the current chroma block uses the first intra prediction mode, other syntax elements related to the first intra prediction mode may also be decoded to further determine other sub-modes of the current chroma block.
[0189] In some embodiments, the method further includes: when determining that the current chroma block uses the first intra-frame prediction mode, decoding the syntax element identifier of the weighted prediction mode of the current chroma block; determining the fourth intra-frame prediction mode used for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining the second prediction block obtained by the current chroma block under the fourth intra-frame prediction mode; performing a weighted operation based on the first prediction block and the second prediction block to obtain the final prediction block of the current chroma block.
[0190] Exemplarily, the syntax element identifier of the weighted prediction mode may be used to indicate at least one of the following: whether to use the weighted prediction mode, and the type of the weighted prediction mode when the weighted prediction mode is used.
[0191] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0192] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0193] Step 604: If the prediction mode reference information does not satisfy the usage condition of the first intra prediction mode, decode the second syntax element identifier;
[0194] Step 605: Determine whether the current chroma block uses the second intra prediction mode according to the second syntax element identifier.
[0195] It should be noted that the second syntax element identifier is used to indicate whether the current chroma block uses the second intra-frame prediction mode. Exemplarily, when the second syntax element identifier is a first value, it is determined that the current chroma block does not use the second intra-frame prediction mode; when the second syntax element identifier is a second value, it is determined that the current chroma block uses the second intra-frame prediction mode.
[0196] Further, in some embodiments, the second intra-frame prediction mode is a chroma direct derived prediction mode (DM), and the method also includes: when determining that the current chroma block uses the second intra-frame prediction mode, obtaining the intra-frame prediction mode of the luminance block corresponding to the current chroma block; using the intra-frame prediction mode of the luminance block as the intra-frame prediction mode of the current chroma block; and determining the first prediction block of the current chroma block based on the intra-frame prediction mode of the current chroma block.
[0197] It should be noted that when the DM mode is determined for the current chroma block, the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode. That is, there is no available BV for the luminance block corresponding to the current chroma block, and the intra-frame prediction mode of the luminance block can be directly used as the intra-frame prediction mode of the current chroma block. These modes can be traditional intra-frame prediction modes such as Planar mode, DC mode, or angular prediction mode.
[0198] It should be noted that, when it is determined that the current chroma block uses the second intra prediction mode, other syntax elements related to the second intra prediction mode may also be decoded to further determine other sub-modes of the current chroma block.
[0199] In some embodiments, the method further includes: when determining that the current chroma block uses the second intra-frame prediction mode, decoding the syntax element identifier of the weighted prediction mode of the current chroma block; determining the fourth intra-frame prediction mode used for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining the second prediction block obtained by the current chroma block under the fourth intra-frame prediction mode; and performing a weighted operation based on the first prediction block and the second prediction block to obtain the final prediction block of the current chroma block.
[0200] Exemplarily, the syntax element identifier of the weighted prediction mode can be used to indicate at least one of the following: whether to use the weighted prediction mode, and the weighted prediction mode type when using the weighted prediction mode; wherein the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra-frame prediction mode.
[0201] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0202] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0203] In some embodiments, the method further includes: decoding the syntax element identifier of the cross-component intra-frame prediction mode; determining whether the current chroma block uses the cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and decoding the cross-component intra-frame prediction mode information; determining whether the current chroma block uses the cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and judging whether the prediction mode reference information meets the usage conditions of the first intra-frame prediction mode.
[0204] That is to say, before decoding the first syntax element identifier and the second syntax element identifier, first decode the syntax element identifier of the cross-component intra-frame prediction mode of the current chroma block, and first determine whether the current chroma block uses the cross-component intra-frame prediction mode based on the syntax element identifier. If not, further determine whether to decode the first syntax element identifier or the second syntax element identifier based on the prediction mode reference information.
[0205] In some embodiments, the method further includes: if the prediction mode reference information satisfies a usage condition of the first intra-frame prediction mode, determining the second syntax element identifier as a preset value for indicating that the current chroma block does not use the second intra-frame prediction mode. If the prediction mode reference information does not satisfy a usage condition of the first intra-frame prediction mode, determining the first syntax element identifier as a preset value for indicating that the current chroma block does not use the first intra-frame prediction mode.
[0206] In some embodiments, the method may further include: when it is determined based on the first syntax element identifier that the current chroma block does not use the first intra-frame prediction mode, and when it is determined based on the second syntax element identifier that the current chroma block does not use the second intra-frame prediction mode, decoding other syntax element identifiers of the current chroma block; and determining other intra-frame prediction modes of the current chroma block based on the other syntax element identifiers.
[0207] That is, when the intra prediction mode of the current chroma block cannot be determined according to the first syntax element identifier and the second syntax element identifier, other intra prediction modes are further decoded. Exemplarily, the other intra prediction modes may be DIMD mode, Planar mode, DC mode, or angular prediction mode.
[0208] For example, the description of the relevant syntax elements of an intra-frame coded chroma coding unit is shown in Table 2-1.
[0209] Table 2-1
[0210] It should be noted that the conditions for using the IntraDBV mode in Table 2-1 are as follows:
[0211] 1. The current frame is divided into dual tree (dual tree is only allowed to be turned on in intra-frame coding frames)
[0212] 2. The chroma block corresponds to the luminance blocks at five positions in the luminance area, and there is at least one available BV, that is, at least one luminance block uses the intraTMP mode or the IBC mode.
[0213] When the conditions for using the intraDBV mode are met, the DM mode is skipped. When the conditions for using the intraDBV mode are not met, the intraDBV mode is skipped. That is, the intraDBV mode is used for chroma blocks that can use the intraDBV mode, and other intra-frame prediction modes are used for chroma blocks that cannot use the intraDBV mode.
[0214] In the ECM reference software, for intra-coded chroma coding units, the intra-frame prediction modes used when predicting the chroma coding units need to be encoded and decoded in a certain order. The encoding and decoding order of these modes can be:
[0215] 1. If cross-component prediction mode is allowed, decode the cross-component intra prediction mode that uses luma to predict chroma;
[0216] 2. If the inter-component prediction mode is not used, determine whether the conditions for using the IntraDBV mode are met. If so, decode the DBV flag (corresponding to the first syntax element identifier). If DBV flag = 1, it is determined that the DBV mode is used, that is, the BV found in the luma region corresponding to the current chroma coding unit is used to determine a chroma BV to predict the chroma mode;
[0217] 3. If not satisfied, decode DMflag (corresponding to the second syntax element identifier). DMflag = 1 determines the use of DM mode, and uses the traditional intra-frame mode selected by the luma coding unit corresponding to the current chroma coding unit to predict the chroma coding unit;
[0218] 4. If it is not DM mode and not DBV mode, it decodes in DIMD mode. The decoder analyzes the gradient of the reconstructed part around the current block and converts the gradient into an angle in the angle mode. The angle mode is used to predict the current block.
[0219] 5. None of the above intra prediction modes are used, and other traditional prediction modes are decoded, including traditional prediction modes not used in the above 2 to 4.
[0220] For example, the description of the relevant syntax elements of an intra-frame coded chroma coding unit is shown in Table 2-2.
[0221] Table 2-2
[0222] It should be noted that the conditions for using the IntraDBV mode in Table 2-2 are as follows:
[0223] 1. At least one luminance block corresponding to the chrominance block has an available BV, that is, the luminance block uses intraTMP mode or IBC mode.
[0224] In other words, the use conditions of the IntraDBV mode do not restrict the partition tree structure. When the partition tree is a Single tree, each partitioned luminance block and chrominance block has a one-to-one correspondence, and there will not be a situation where multiple luminance blocks exist in the area corresponding to a chrominance block. Under the Single tree, when the luminance block selects the IBC mode or IntraTMP, the chrominance block uses the IntraDBV mode, so that the chrominance can be predicted by deriving the block vector of the chrominance using the block vector found by the luminance. Under the dual tree, when at least one luminance block at the five positions of the chrominance area corresponding to the chrominance block selects the IBC mode or IntraTMP, the chrominance block uses the IntraDBV mode, so that the chrominance can be predicted by deriving the block vector of the chrominance using the block vector found by the luminance.
[0225] In another embodiment of the present application, referring to FIG7 , a flowchart of another decoding method provided by an embodiment of the present application is shown. As shown in FIG7 , the method may include:
[0226] Step 701: Decode the third syntax element identifier of the current chroma block;
[0227] It should be noted that the third syntax element identifier is used to indicate whether the first intra-frame prediction mode and the second intra-frame prediction mode are allowed to be used. In other words, the embodiment of the present application can use a syntax element identifier to simultaneously indicate the use of the first intra-frame prediction mode and the second intra-frame prediction mode, or to indicate that the first intra-frame prediction mode and the second intra-frame prediction mode are not used.
[0228] Exemplarily, when the third syntax element is identified as a first value, it is determined that the current chroma block does not use the first intra-frame prediction mode and the second intra-frame prediction mode; when the third syntax element is identified as a second value, it is determined that the current chroma block uses the first intra-frame prediction mode and the second intra-frame prediction mode.
[0229] Exemplarily, the third syntax element may be an existing syntax element, that is, the usage of the first intra prediction mode and the second intra prediction mode is indicated by extending the meaning of the existing syntax element. For example, the third syntax element identifier may be a DM flag for enabling the DM mode.
[0230] Exemplarily, the third syntax element may also be a newly added syntax element.
[0231] When the third syntax element indicates that both the first and second intra-frame prediction modes are permitted, the prediction mode reference information is then determined to determine whether it satisfies the conditions for using the first intra-frame prediction mode. If so, the first intra-frame prediction mode is directly determined to be used for the current chroma block. If not, the second intra-frame prediction mode is determined to be used for the current chroma block. Thus, when encoding and decoding the chroma component, the third syntax element is used to enable both intra-frame prediction modes, reducing encoding and decoding bits.
[0232] Step 702: When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra prediction mode and the second intra prediction mode, obtain prediction mode reference information of the current chroma block;
[0233] It should be noted that the prediction mode reference information is used to determine the intra prediction mode of the current chroma block.
[0234] In some embodiments, the prediction mode reference information includes relevant information of the luminance block corresponding to the current chrominance block. Exemplarily, the prediction mode reference information may be intra-frame prediction mode information of the luminance block corresponding to the current chrominance block.
[0235] In some embodiments, the prediction mode reference information may further include a partitioning mode of the image unit in which the current chroma block is located. Exemplarily, the image unit in which the current chroma block is located may be the current coding tree unit (CTU), the current frame, or other coding units. The partitioning mode is used to indicate the partitioning tree structure used for the luminance block and the chroma block when encoding the frame intra-frame. The partitioning tree structure may be a single tree structure or a dual tree structure.
[0236] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a single tree structure, and obtaining the prediction mode of the first luminance block corresponding to the current chroma block; when the prediction mode of the first luminance block is the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the first luminance block is not the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0237] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a dual-tree structure, and searching for luminance blocks at multiple positions in a first order in the luminance area corresponding to the current chroma block; when the prediction mode of the first luminance block is searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the luminance block is not searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0238] In some embodiments, the prediction mode reference information may further include the size of the current chroma block and related syntax elements of the current chroma block.
[0239] Step 703: If the prediction mode reference information satisfies the use condition of the first intra prediction mode, determine that the current chroma block uses the first intra prediction mode;
[0240] It should be noted that the usage condition of the first intra-frame prediction mode is used to determine whether the first intra-frame prediction mode can be used for the current chroma block. Exemplarily, the first intra-frame prediction mode can be any chroma intra-frame prediction mode. For example, the first intra-frame prediction mode can be a chroma direct derived block vector prediction mode (IntraDBV mode) or a chroma direct derived prediction mode (DM mode).
[0241] In some embodiments, when the intra-frame prediction mode information of the luma block corresponding to the current chroma block is used, the use condition may include: the luma block corresponding to the current chroma block uses the third intra-frame prediction mode. In other words, when the intra-frame prediction mode of the luma block corresponding to the current chroma block is the third intra-frame prediction mode, it is determined that the current chroma block can use the first intra-frame prediction mode; otherwise, it is determined that the current chroma block cannot use the first intra-frame prediction mode.
[0242] Exemplarily, the first intra prediction mode is the IntraDBV mode, and the third intra prediction mode may be the intra block copy prediction mode (IBC mode) or the intra template matching prediction mode (IntraTMP mode).
[0243] Exemplarily, the first intra-frame prediction mode is a DM mode, and the third intra-frame prediction mode may be a traditional intra-frame prediction mode, such as a Planar mode, a DC mode, or an angular prediction mode.
[0244] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the use condition further includes: a division mode of the image unit where the current chroma block is located is a dual-tree structure.
[0245] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the usage condition further includes: a division mode of the image unit where the current chroma block is located is a single tree structure.
[0246] It should be noted that when the prediction mode reference information does not include the division mode of the image unit where the current chroma block is located, the usage condition does not restrict the division mode, that is, the first intra prediction mode is applicable to any division mode.
[0247] Further, in some embodiments, the first intra-frame prediction mode is a chroma direct derived block vector prediction mode (intraDBV), and the method further includes: when determining that the current chroma block uses the first intra-frame prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; determining a block vector of the current chroma block based on the block vector of the first luminance block; and determining a first prediction block of the current chroma block based on the block vector of the current chroma block.
[0248] Exemplarily, when the current chroma block is predicted using intraDBV, as shown in Figure 3, under the dual tree partitioning, the chroma block finds the corresponding luminance area, and checks whether there is at least one luminance block at the following five positions (C->TL->TR->BL->BR) in the first order using IBC or intraTMP mode. When at least one luminance block at these five positions uses IBC or intraTMP, the first block vector found in the first order (C->TL->TR->BL->BR) is used to derive a chroma block vector, and the reconstructed block at the position pointed to by the chroma block vector is used to predict the current chroma block.
[0249] More specifically, determining the block vector of the current chroma block based on the block vector of the first luminance block includes: downsampling the block vector of the first luminance block to determine the downsampled block vector; and performing a fine search based on the downsampled block vector to determine the block vector of the current chroma block. Exemplarily, a fine search based on template matching is performed based on the downsampled block vector to determine the optimal block vector for the current chroma block.
[0250] It should be noted that, when it is determined that the current chroma block uses the first intra prediction mode, other syntax elements related to the first intra prediction mode may also be decoded to further determine other sub-modes of the current chroma block.
[0251] In some embodiments, the method further includes: when determining that the current chroma block uses the first intra-frame prediction mode, decoding the syntax element identifier of the weighted prediction mode of the current chroma block; determining the fourth intra-frame prediction mode used for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining the second prediction block obtained by the current chroma block under the fourth intra-frame prediction mode; performing a weighted operation based on the first prediction block and the second prediction block to obtain the final prediction block of the current chroma block.
[0252] Exemplarily, the syntax element identifier of the weighted prediction mode can be used to indicate at least one of the following: whether to use the weighted prediction mode, and the weighted prediction mode type when using the weighted prediction mode; wherein the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra-frame prediction mode.
[0253] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0254] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0255] Step 704: If the prediction mode reference information does not meet the use condition of the first intra prediction mode, determine that the current chroma block uses the second intra prediction mode.
[0256] Furthermore, in some embodiments, the second intra prediction mode is a chroma direct derived prediction mode (DM), and the method further includes: when determining that the current chroma block uses the second intra prediction mode, obtaining the intra prediction mode of the luma block corresponding to the current chroma block; using the intra prediction mode of the luma block as the intra prediction mode of the current chroma block; and determining a first prediction block for the current chroma block based on the intra prediction mode of the current chroma block. These modes can be traditional intra prediction modes such as a planar mode, a DC mode, or an angular prediction mode.
[0257] It should be noted that, when it is determined that the current chroma block uses the second intra prediction mode, other syntax elements related to the second intra prediction mode may also be decoded to further determine other sub-modes of the current chroma block.
[0258] In some embodiments, the method further includes: when determining that the current chroma block uses the second intra-frame prediction mode, decoding the syntax element identifier of the weighted prediction mode of the current chroma block; determining the fourth intra-frame prediction mode used for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining the second prediction block obtained by the current chroma block under the fourth intra-frame prediction mode; and performing a weighted operation based on the first prediction block and the second prediction block to obtain the final prediction block of the current chroma block.
[0259] Exemplarily, the syntax element identifier of the weighted prediction mode can be used to indicate at least one of the following: whether to use the weighted prediction mode, and the weighted prediction mode type when using the weighted prediction mode; wherein the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra-frame prediction mode.
[0260] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0261] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0262] In some embodiments, the method further includes: decoding a syntax element identifier of a cross-component intra-frame prediction mode; determining whether the current chroma block uses a cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and decoding the cross-component intra-frame prediction mode information; determining whether the current chroma block uses a cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and decoding a third syntax element identifier.
[0263] That is to say, before decoding the third syntax element identifier, first decode the syntax element identifier of the cross-component intra-frame prediction mode of the current chroma block, and determine whether the current chroma block uses the cross-component intra-frame prediction mode based on the syntax element identifier. If not, further decode the third syntax element identifier.
[0264] In some embodiments, the method further includes: determining that the current chroma block uses the cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and determining the third syntax element identifier as a preset value for indicating that the current chroma block does not use the first intra-frame prediction mode and the second intra-frame prediction mode.
[0265] In some embodiments, the method may further include: decoding other syntax element identifiers of the current chroma block when determining, based on the third syntax element identifier, that the current chroma block does not allow the use of the first intra-frame prediction mode and the second intra-frame prediction mode; and determining, based on the other syntax element identifiers, other intra-frame prediction modes of the current chroma block.
[0266] That is, when it is determined according to the third syntax element that the current chroma block does not use the first intra prediction mode and the second intra prediction mode, other intra prediction modes are further decoded. Exemplarily, the other intra prediction modes may be DIMD mode, Planar mode, DC mode, or angular prediction mode.
[0267] For example, the description of the relevant syntax elements of an intra-frame coded chroma coding unit is shown in Table 2-3.
[0268] Table 2-3
[0269] In the ECM reference software, for intra-coded chroma coding units, the intra-frame prediction modes used when predicting the chroma coding units need to be encoded and decoded in a certain order. The encoding and decoding order of these modes can be:
[0270] 1. If cross-component prediction mode is allowed, decode the cross-component intra prediction mode that uses luma to predict chroma;
[0271] 2. If the cross-component prediction mode is not used, decode the DM flag (corresponding to the third syntax element identifier). If DM flag = 1, it is determined that the DM mode is used. It is determined whether the conditions for using the IntraDBV mode are met. If so, it is determined to use the DBV mode, that is, the BV found in the luma area corresponding to the current chroma coding unit is used to determine a chroma BV to predict the chroma mode.
[0272] 3. If not, determine to use DM mode and use the traditional intra mode selected by the luma coding unit corresponding to the current chroma coding unit to predict the chroma coding unit;
[0273] Specifically, if the current frame uses dual tree partitioning, and there is more than or equal to one usable block vector in the five positions of the luminance area corresponding to the chroma block, then this block vector will be downsampled and optimized with sub-pixel accuracy for prediction of the current chroma block.
[0274] If the current frame uses Single tree partitioning, and the luminance block corresponding to the current chrominance block is predicted using intraTMP mode, the block vector found by intraTMP will be downsampled and optimized for sub-pixel accuracy for prediction of the current chrominance block.
[0275] If there is no block vector using luminance at the corresponding position of the current chrominance block (i.e., in the dual tree, there is no block using IBC or intraTMP mode in the luminance area, or in the single tree, the corresponding luminance block does not use intraTMP), it is determined to use the DM mode, that is, the intra-frame prediction mode of the chrominance block is determined according to the intra-frame prediction mode of the corresponding luminance block.
[0276] 4. If DMflag = 0, it is determined that it is not DM mode and not DBV mode, decoding DIMD mode, the decoder analyzes the gradient of the reconstructed part through the reconstructed part around the current block, and converts the gradient into an angle in the angle mode, and uses this angle mode to predict the current block.
[0277] 5. None of the above intra prediction modes are used, and other traditional prediction modes are decoded, including traditional prediction modes not used in the above 2 to 4.
[0278] The beneficial effects of adopting the above technical solution include:
[0279] (1) When there is a luminance block using IBC or IntraTMP in the luminance area corresponding to the chrominance block under Dual tree partitioning, when a block vector found in a predefined order is used, the use of DM technology is skipped because IntraDBV technology is allowed at this time.
[0280] (2) Extend the IntraDBV technology to the use of Single Tree. In Single Tree, if the luminance area at the corresponding position of the chrominance block uses IntraTMP and has a usable block vector, IntraDBV can use its block vector to derive the block vector of the chrominance prediction and use it for prediction.
[0281] (3) Since the chroma DM prediction mode and the IntraDBV mode have certain functional redundancy, the DMflag flag can be used to represent the enablement of IntraDBV at the same time, and the IntraDBV flag can be cancelled.
[0282] In one embodiment of the present application, referring to FIG8 , a schematic flow chart of an encoding method provided by an embodiment of the present application is shown. As shown in FIG8 , the method may include:
[0283] Step 801: Obtain prediction mode reference information of the current chroma block;
[0284] It should be noted that the prediction mode reference information is used to determine the intra prediction mode of the current chroma block.
[0285] In some embodiments, the prediction mode reference information includes relevant information of the luminance block corresponding to the current chrominance block. Exemplarily, the prediction mode reference information may be intra-frame prediction mode information of the luminance block corresponding to the current chrominance block.
[0286] In some embodiments, the prediction mode reference information may further include a partitioning mode of the image unit in which the current chroma block is located. Exemplarily, the image unit in which the current chroma block is located may be the current coding tree unit (CTU), the current frame, or other coding units. The partitioning mode is used to indicate the partitioning tree structure used for the luminance block and the chroma block when encoding the frame intra-frame. The partitioning tree structure may be a single tree structure or a dual tree structure.
[0287] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a single tree structure, and obtaining the prediction mode of the first luminance block corresponding to the current chroma block; when the prediction mode of the first luminance block is the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the first luminance block is not the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0288] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a dual-tree structure, and searching for luminance blocks at multiple positions in a first order in the luminance area corresponding to the current chroma block; when the prediction mode of the first luminance block is searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the luminance block is not searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0289] In some embodiments, the prediction mode reference information may further include the size of the current chroma block and related syntax elements of the current chroma block.
[0290] Step 802: When the prediction mode reference information satisfies the usage condition of the first intra prediction mode, encode a first syntax element identifier;
[0291] It should be noted that the use condition of the first intra-frame prediction mode is used to determine whether the first intra-frame prediction mode can be used for the current chroma block. Exemplarily, the first intra-frame prediction mode can be any chroma intra-frame prediction mode. For example, the first intra-frame prediction mode can be a chroma direct derived block vector prediction mode (IntraDBV mode) or a chroma direct derived prediction mode (DM mode).
[0292] In some embodiments, when the intra-frame prediction mode information of the luma block corresponding to the current chroma block is used, the use condition may include: the luma block corresponding to the current chroma block uses the third intra-frame prediction mode. In other words, when the intra-frame prediction mode of the luma block corresponding to the current chroma block is the third intra-frame prediction mode, it is determined that the current chroma block can use the first intra-frame prediction mode; otherwise, it is determined that the current chroma block cannot use the first intra-frame prediction mode.
[0293] Exemplarily, the first intra prediction mode is the IntraDBV mode, and the third intra prediction mode may be the intra block copy prediction mode (IBC mode) or the intra template matching prediction mode (IntraTMP mode).
[0294] Exemplarily, the first intra-frame prediction mode is a DM mode, and the third intra-frame prediction mode may be a traditional intra-frame prediction mode, such as a Planar mode, a DC mode, or an angular prediction mode.
[0295] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the use condition further includes: a division mode of the image unit where the current chroma block is located is a dual-tree structure.
[0296] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the usage condition further includes: a division mode of the image unit where the current chroma block is located is a single tree structure.
[0297] It should be noted that when the prediction mode reference information does not include the division mode of the image unit where the current chroma block is located, the usage condition does not restrict the division mode, that is, the first intra prediction mode is applicable to any division mode.
[0298] Step 803: Determine whether the current chroma block uses the first intra prediction mode according to the first syntax element identifier;
[0299] It should be noted that the first syntax element identifier is used to indicate whether the current chroma block uses the first intra-frame prediction mode. Exemplarily, when the first syntax element identifier is a first value, it is determined that the current chroma block does not use the first intra-frame prediction mode; when the first syntax element identifier is a second value, it is determined that the current chroma block uses the first intra-frame prediction mode.
[0300] Further, in some embodiments, the first intra-frame prediction mode is a chroma direct derived block vector prediction mode (intraDBV), and the method further includes: when determining that the current chroma block uses the first intra-frame prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; determining a block vector of the current chroma block based on the block vector of the first luminance block; and determining a first prediction block of the current chroma block based on the block vector of the current chroma block.
[0301] Exemplarily, when the current chroma block is predicted using intraDBV, as shown in Figure 3, under the dual tree partitioning, the chroma block finds the corresponding luminance area, and checks whether there is at least one luminance block at the following five positions (C->TL->TR->BL->BR) in the first order using IBC or intraTMP mode. When at least one luminance block at these five positions uses IBC or intraTMP, the first block vector found in the first order (C->TL->TR->BL->BR) is used to derive a chroma block vector, and the reconstructed block at the position pointed to by the chroma block vector is used to predict the current chroma block.
[0302] More specifically, determining the block vector of the current chroma block based on the block vector of the first luminance block includes: downsampling the block vector of the first luminance block to determine the downsampled block vector; and performing a fine search based on the downsampled block vector to determine the block vector of the current chroma block. Exemplarily, a fine search based on template matching is performed based on the downsampled block vector to determine the optimal block vector for the current chroma block.
[0303] It should be noted that, when it is determined that the current chroma block uses the first intra prediction mode, other syntax elements related to the first intra prediction mode may also be encoded to further determine other sub-modes of the current chroma block.
[0304] In some embodiments, the method further includes: determining a syntax element identifier for encoding a weighted prediction mode of the current chroma block when the current chroma block uses a first intra-frame prediction mode; determining a fourth intra-frame prediction mode for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining a second prediction block obtained under the fourth intra-frame prediction mode for the current chroma block; and performing a weighted operation based on the first prediction block and the second prediction block to obtain a final prediction block for the current chroma block.
[0305] Exemplarily, the syntax element identifier of the weighted prediction mode can be used to indicate at least one of the following: whether to use the weighted prediction mode, and the weighted prediction mode type when using the weighted prediction mode; wherein the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra-frame prediction mode.
[0306] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0307] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0308] Step 804: if the prediction mode reference information does not satisfy the usage condition of the first intra prediction mode, encode a second syntax element identifier;
[0309] Step 805: Determine whether the current chroma block uses the second intra prediction mode according to the second syntax element identifier.
[0310] It should be noted that the second syntax element identifier is used to indicate whether the current chroma block uses the second intra-frame prediction mode. Exemplarily, when the second syntax element identifier is a first value, it is determined that the current chroma block does not use the second intra-frame prediction mode; when the second syntax element identifier is a second value, it is determined that the current chroma block uses the second intra-frame prediction mode.
[0311] Further, in some embodiments, the second intra-frame prediction mode is a chroma direct derived prediction mode (DM), and the method also includes: when determining that the current chroma block uses the second intra-frame prediction mode, obtaining the intra-frame prediction mode of the luminance block corresponding to the current chroma block; using the intra-frame prediction mode of the luminance block as the intra-frame prediction mode of the current chroma block; and determining the first prediction block of the current chroma block based on the intra-frame prediction mode of the current chroma block.
[0312] It should be noted that when the DM mode is determined for the current chroma block, the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode. That is, there is no available BV for the luminance block corresponding to the current chroma block, and the intra-frame prediction mode of the luminance block can be directly used as the intra-frame prediction mode of the current chroma block. These modes can be traditional intra-frame prediction modes such as Planar mode, DC mode, or angular prediction mode.
[0313] It should be noted that, when it is determined that the current chroma block uses the second intra prediction mode, other syntax elements related to the second intra prediction mode may also be encoded to further determine other sub-modes of the current chroma block.
[0314] In some embodiments, the method further includes: determining that when the current chroma block uses the second intra-frame prediction mode, encoding the syntax element identifier of the weighted prediction mode of the current chroma block; determining the fourth intra-frame prediction mode used for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining the second prediction block obtained by the current chroma block under the fourth intra-frame prediction mode; performing a weighted operation based on the first prediction block and the second prediction block to obtain the final prediction block of the current chroma block.
[0315] Exemplarily, the syntax element identifier of the weighted prediction mode can be used to indicate at least one of the following: whether to use the weighted prediction mode, and the weighted prediction mode type when using the weighted prediction mode; wherein the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra-frame prediction mode.
[0316] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0317] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0318] In some embodiments, the method further includes: encoding a syntax element identifier of a cross-component intra-frame prediction mode; determining whether the current chroma block uses a cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and encoding the cross-component intra-frame prediction mode information; determining whether the current chroma block uses a cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and judging whether the prediction mode reference information meets the usage conditions of the first intra-frame prediction mode.
[0319] That is to say, before encoding the first syntax element identifier and the second syntax element identifier, the syntax element identifier of the cross-component intra-frame prediction mode of the current chroma block is first encoded. According to the syntax element identifier, it is first determined whether the current chroma block uses the cross-component intra-frame prediction mode. If not, it is further determined whether to encode the first syntax element identifier or the second syntax element identifier based on the prediction mode reference information.
[0320] In some embodiments, the method further includes: if the prediction mode reference information satisfies a usage condition of the first intra-frame prediction mode, determining the second syntax element identifier as a preset value for indicating that the current chroma block does not use the second intra-frame prediction mode. If the prediction mode reference information does not satisfy a usage condition of the first intra-frame prediction mode, determining the first syntax element identifier as a preset value for indicating that the current chroma block does not use the first intra-frame prediction mode.
[0321] In some embodiments, the method may further include: when it is determined based on the first syntax element identifier that the current chroma block does not use the first intra-frame prediction mode, and when it is determined based on the second syntax element identifier that the current chroma block does not use the second intra-frame prediction mode, encoding other syntax element identifiers of the current chroma block; and determining other intra-frame prediction modes of the current chroma block based on the other syntax element identifiers.
[0322] That is, when the intra prediction mode of the current chroma block cannot be determined according to the first syntax element identifier and the second syntax element identifier, other intra prediction modes are further encoded. Exemplarily, the other intra prediction modes may be DIMD mode, Planar mode, DC mode, or angular prediction mode.
[0323] For example, the description of the relevant syntax elements of an intra-frame coded chroma coding unit is shown in Table 2-1 and Table 2-2.
[0324] In another embodiment of the present application, referring to FIG9 , a flow chart of another encoding method provided by an embodiment of the present application is shown. As shown in FIG9 , the method may include:
[0325] Step 901: Encode the third syntax element identifier of the current chroma block;
[0326] It should be noted that the third syntax element identifier is used to indicate whether the first intra-frame prediction mode and the second intra-frame prediction mode are allowed to be used. In other words, the embodiment of the present application can use a syntax element identifier to simultaneously indicate the use of the first intra-frame prediction mode and the second intra-frame prediction mode, or to indicate that the first intra-frame prediction mode and the second intra-frame prediction mode are not used.
[0327] Exemplarily, when the third syntax element is identified as a first value, it is determined that the current chroma block does not use the first intra-frame prediction mode and the second intra-frame prediction mode; when the third syntax element is identified as a second value, it is determined that the current chroma block uses the first intra-frame prediction mode and the second intra-frame prediction mode.
[0328] Exemplarily, the third syntax element may be an existing syntax element, that is, the usage of the first intra prediction mode and the second intra prediction mode is indicated by extending the meaning of the existing syntax element. For example, the third syntax element identifier may be a DM flag for enabling the DM mode.
[0329] Exemplarily, the third syntax element may also be a newly added syntax element.
[0330] When the third syntax element indicates that both the first and second intra-frame prediction modes are permitted, the prediction mode reference information is then determined to determine whether it satisfies the conditions for using the first intra-frame prediction mode. If so, the first intra-frame prediction mode is directly determined to be used for the current chroma block. If not, the second intra-frame prediction mode is determined to be used for the current chroma block. Thus, when encoding and decoding the chroma component, the third syntax element is used to enable both intra-frame prediction modes, reducing encoding and decoding bits.
[0331] Step 902: When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra prediction mode and the second intra prediction mode, obtain prediction mode reference information of the current chroma block;
[0332] It should be noted that the prediction mode reference information is used to determine the intra prediction mode of the current chroma block.
[0333] In some embodiments, the prediction mode reference information includes relevant information of the luminance block corresponding to the current chrominance block. Exemplarily, the prediction mode reference information may be intra-frame prediction mode information of the luminance block corresponding to the current chrominance block.
[0334] In some embodiments, the prediction mode reference information may further include a partitioning mode of the image unit in which the current chroma block is located. Exemplarily, the image unit in which the current chroma block is located may be the current coding tree unit (CTU), the current frame, or other coding units. The partitioning mode is used to indicate the partitioning tree structure used for the luminance block and the chroma block when encoding the frame intra-frame. The partitioning tree structure may be a single tree structure or a dual tree structure.
[0335] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a single tree structure, and obtaining the prediction mode of the first luminance block corresponding to the current chroma block; when the prediction mode of the first luminance block is the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the first luminance block is not the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0336] In some embodiments, obtaining prediction mode reference information of the current chroma block includes: dividing the image unit where the current chroma block is located into luminance blocks and chroma blocks using a dual-tree structure, and searching for luminance blocks at multiple positions in a first order in the luminance area corresponding to the current chroma block; when the prediction mode of the first luminance block is searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block uses the third intra-frame prediction mode; when the prediction mode of the luminance block is not searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chroma block does not use the third intra-frame prediction mode.
[0337] In some embodiments, the prediction mode reference information may further include the size of the current chroma block and related syntax elements of the current chroma block.
[0338] Step 903: If the prediction mode reference information satisfies the use condition of the first intra prediction mode, determine that the current chroma block uses the first intra prediction mode;
[0339] It should be noted that the use condition of the first intra-frame prediction mode is used to determine whether the first intra-frame prediction mode can be used for the current chroma block. Exemplarily, the first intra-frame prediction mode can be any chroma intra-frame prediction mode. For example, the first intra-frame prediction mode can be a chroma direct derived block vector prediction mode (IntraDBV mode) or a chroma direct derived prediction mode (DM mode).
[0340] In some embodiments, when the intra-frame prediction mode information of the luma block corresponding to the current chroma block is used, the use condition may include: the luma block corresponding to the current chroma block uses the third intra-frame prediction mode. In other words, when the intra-frame prediction mode of the luma block corresponding to the current chroma block is the third intra-frame prediction mode, it is determined that the current chroma block can use the first intra-frame prediction mode; otherwise, it is determined that the current chroma block cannot use the first intra-frame prediction mode.
[0341] Exemplarily, the first intra prediction mode is the IntraDBV mode, and the third intra prediction mode may be the intra block copy prediction mode (IBC mode) or the intra template matching prediction mode (IntraTMP mode).
[0342] Exemplarily, the first intra-frame prediction mode is a DM mode, and the third intra-frame prediction mode may be a traditional intra-frame prediction mode, such as a Planar mode, a DC mode, or an angular prediction mode.
[0343] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the use condition further includes: a division mode of the image unit where the current chroma block is located is a dual-tree structure.
[0344] In some embodiments, the prediction mode reference information includes: a division mode of the image unit where the current chroma block is located; and the usage condition further includes: a division mode of the image unit where the current chroma block is located is a single tree structure.
[0345] It should be noted that when the prediction mode reference information does not include the division mode of the image unit where the current chroma block is located, the usage condition does not restrict the division mode, that is, the first intra prediction mode is applicable to any division mode.
[0346] Further, in some embodiments, the first intra-frame prediction mode is a chroma direct derived block vector prediction mode (intraDBV), and the method further includes: when determining that the current chroma block uses the first intra-frame prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; determining a block vector of the current chroma block based on the block vector of the first luminance block; and determining a first prediction block of the current chroma block based on the block vector of the current chroma block.
[0347] Exemplarily, when the current chroma block is predicted using intraDBV, as shown in Figure 3, under the dual tree partitioning, the chroma block finds the corresponding luminance area, and checks whether there is at least one luminance block at the following five positions (C->TL->TR->BL->BR) in the first order using IBC or intraTMP mode. When at least one luminance block at these five positions uses IBC or intraTMP, the first block vector found in the first order (C->TL->TR->BL->BR) is used to derive a chroma block vector, and the reconstructed block at the position pointed to by the chroma block vector is used to predict the current chroma block.
[0348] More specifically, determining the block vector of the current chroma block based on the block vector of the first luminance block includes: downsampling the block vector of the first luminance block to determine the downsampled block vector; and performing a fine search based on the downsampled block vector to determine the block vector of the current chroma block. Exemplarily, a fine search based on template matching is performed based on the downsampled block vector to determine the optimal block vector for the current chroma block.
[0349] It should be noted that, when it is determined that the current chroma block uses the first intra prediction mode, other syntax elements related to the first intra prediction mode may also be encoded to further determine other sub-modes of the current chroma block.
[0350] In some embodiments, the method further includes: determining a syntax element identifier for encoding a weighted prediction mode of the current chroma block when the current chroma block uses a first intra-frame prediction mode; determining a fourth intra-frame prediction mode for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining a second prediction block obtained under the fourth intra-frame prediction mode for the current chroma block; and performing a weighted operation based on the first prediction block and the second prediction block to obtain a final prediction block for the current chroma block.
[0351] Exemplarily, the syntax element identifier of the weighted prediction mode can be used to indicate at least one of the following: whether to use the weighted prediction mode, and the weighted prediction mode type when using the weighted prediction mode; wherein the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra-frame prediction mode.
[0352] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0353] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0354] Step 904: When the prediction mode reference information does not satisfy the use condition of the first intra prediction mode, determine that the current chroma block uses the second intra prediction mode.
[0355] Furthermore, in some embodiments, the second intra prediction mode is a chroma direct derived prediction mode (DM), and the method further includes: when determining that the current chroma block uses the second intra prediction mode, obtaining the intra prediction mode of the luma block corresponding to the current chroma block; using the intra prediction mode of the luma block as the intra prediction mode of the current chroma block; and determining a first prediction block for the current chroma block based on the intra prediction mode of the current chroma block. These modes can be traditional intra prediction modes such as a planar mode, a DC mode, or an angular prediction mode.
[0356] It should be noted that, when it is determined that the current chroma block uses the second intra prediction mode, other syntax elements related to the second intra prediction mode may also be encoded to further determine other sub-modes of the current chroma block.
[0357] In some embodiments, the method further includes: determining that when the current chroma block uses the second intra-frame prediction mode, encoding the syntax element identifier of the weighted prediction mode of the current chroma block; determining the fourth intra-frame prediction mode used for weighted prediction of the current chroma block based on the syntax element identifier of the weighted prediction mode; determining the second prediction block obtained by the current chroma block under the fourth intra-frame prediction mode; performing a weighted operation based on the first prediction block and the second prediction block to obtain the final prediction block of the current chroma block.
[0358] Exemplarily, the syntax element identifier of the weighted prediction mode can be used to indicate at least one of the following: whether to use the weighted prediction mode, and the weighted prediction mode type when using the weighted prediction mode; wherein the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra-frame prediction mode.
[0359] In some embodiments, the weighted prediction mode type is specifically used to indicate the weighted weight and the fourth intra prediction mode. Exemplarily, the weighted prediction mode type may include: not using the prediction result of the cross-component mode for weighting, weighting with the prediction result of the MMLM mode, using a set of adaptive weights and the luma reconstruction value for weighting, and using two sets of adaptive weights and the luma reconstruction value for weighting.
[0360] In some embodiments, the weighted prediction mode type may further include: weighting with the prediction result of the CCLM mode, weighting with the prediction result of the CCCM mode, and weighting with the prediction results of multiple CCCM modes. In other words, the fourth intra-frame prediction mode may be a cross-component intra-frame prediction mode. For example, the fourth intra-frame prediction mode may be a CCLM mode, an MMLM mode, or a CCCM mode. The fourth intra-frame prediction mode may also be a prediction mode that uses a luma reconstruction value for weighting.
[0361] In some embodiments, the method further includes: encoding a syntax element identifier of a cross-component intra-frame prediction mode; determining whether the current chroma block uses a cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and encoding cross-component intra-frame prediction mode information; determining whether the current chroma block uses a cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and encoding a third syntax element identifier.
[0362] That is to say, before encoding the third syntax element identifier, first encode the syntax element identifier of the cross-component intra-frame prediction mode of the current chroma block, and based on the syntax element identifier, first determine whether the current chroma block uses the cross-component intra-frame prediction mode. If not, further encode the third syntax element identifier.
[0363] In some embodiments, the method further includes: determining that the current chroma block uses the cross-component intra-frame prediction mode based on the syntax element identifier of the cross-component intra-frame prediction mode, and determining the third syntax element identifier as a preset value for indicating that the current chroma block does not use the first intra-frame prediction mode and the second intra-frame prediction mode.
[0364] In some embodiments, the method may further include: encoding other syntax element identifiers of the current chroma block when determining based on the third syntax element identifier that the current chroma block does not allow the use of the first intra-frame prediction mode and the second intra-frame prediction mode; and determining other intra-frame prediction modes of the current chroma block based on the other syntax element identifiers.
[0365] That is, when it is determined according to the third syntax element that the current chroma block does not use the first intra prediction mode and the second intra prediction mode, other intra prediction modes are further encoded. Exemplarily, the other intra prediction modes may be DIMD mode, Planar mode, DC mode, or angular prediction mode.
[0366] For example, the description of the relevant syntax elements of an intra-frame coded chroma coding unit is shown in Table 2-3.
[0367] In yet another embodiment of the present application, a code stream is further provided, wherein the code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:
[0368] A first syntax element identifier for indicating whether to use the first intra-frame prediction mode, a second syntax element identifier for indicating whether to use the second intra-frame prediction mode, a third syntax element identifier for indicating whether the first intra-frame prediction mode and the second intra-frame prediction mode are allowed, a syntax element identifier for indicating a weighted prediction mode, other syntax element identifiers for indicating other intra-frame prediction modes, and a syntax element identifier for indicating a cross-component intra-frame prediction mode.
[0369] It should be noted that the code stream only includes one of the first syntax element identifier or the second syntax element identifier.
[0370] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see Figure 10, which shows a schematic diagram of the composition structure of an encoder provided by an embodiment of the present application. As shown in Figure 10, the encoder 110 may include: a first acquisition unit 111, an encoding unit 112 and a first determination unit 113; wherein,
[0371] In some embodiments, the first acquiring unit 111 is configured to acquire prediction mode reference information of the current chroma block;
[0372] The encoding unit 112 is configured as a first determining unit, configured to encode a first syntax element identifier when the prediction mode reference information satisfies a usage condition of the first intra prediction mode;
[0373] A first determining unit 113 is configured to determine whether the current chroma block uses a first intra prediction mode according to a first syntax element identifier;
[0374] The encoding unit 112 is further configured to encode a second syntax element identifier if the prediction mode reference information does not satisfy the usage condition of the first intra prediction mode;
[0375] The first determining unit 113 is further configured to determine whether the current chroma block uses the second intra prediction mode according to the second syntax element identifier.
[0376] In some embodiments, the encoding unit 112 is configured to encode a third syntax element identifier of the current chroma block;
[0377] The first acquiring unit 111 is configured to acquire prediction mode reference information of the current chroma block when it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra prediction mode and the second intra prediction mode;
[0378] The first determining unit 113 is configured to determine that the current chroma block uses the first intra prediction mode when the prediction mode reference information satisfies a use condition of the first intra prediction mode;
[0379] The first determining unit 113 is further configured to determine that the current chroma block uses the second intra prediction mode when the prediction mode reference information does not meet the use condition of the first intra prediction mode.
[0380] It can be understood that each functional unit of the encoder also executes the encoding method described in any one of the aforementioned embodiments, which will not be described in detail here.
[0381] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.
[0382] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0383] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 110. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the encoding method described in any one of the aforementioned embodiments.
[0384] Based on the composition of the encoder 110 and the computer-readable storage medium, refer to Figure 11, which shows a specific hardware structure diagram of the encoder 110 provided in an embodiment of the present application. As shown in Figure 11, the encoder 110 may include: a first memory 115 and a first processor 116, a first communication interface 117 and a first bus system 118. The first memory 115, the first processor 116, and the first communication interface 117 are coupled together through the first bus system 118. It can be understood that the first bus system 118 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 118 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 118 in Figure 20. Among them,
[0385] The first communication interface 117 is used to receive and send signals when sending and receiving information with other external network elements;
[0386] A first memory 115, configured to store computer programs that can be run on the first processor;
[0387] In some embodiments, the first processor 116 is configured to, when running a computer program, execute:
[0388] Get the prediction mode reference information of the current chroma block;
[0389] When the prediction mode reference information satisfies a usage condition of the first intra prediction mode, encoding a first syntax element identifier;
[0390] Determining, according to the first syntax element identifier, whether the current chroma block uses a first intra prediction mode;
[0391] If the prediction mode reference information does not satisfy the usage condition of the first intra prediction mode, encoding a second syntax element identifier;
[0392] Determine, according to the second syntax element identifier, whether the current chroma block uses the second intra prediction mode.
[0393] In some embodiments, the first processor 116 is configured to, when running a computer program, execute:
[0394] Encode the third syntax element identifier of the current chroma block;
[0395] When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode, obtaining prediction mode reference information of the current chroma block;
[0396] When the prediction mode reference information satisfies a use condition of the first intra prediction mode, determining that the current chroma block uses the first intra prediction mode;
[0397] In a case where the prediction mode reference information does not satisfy the use condition of the first intra prediction mode, it is determined that the current chroma block uses the second intra prediction mode.
[0398] It is understood that the first memory 115 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 115 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0399] The first processor 116 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 116. The above-mentioned first processor 116 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 115 , and the first processor 116 reads the information in the first memory 115 and completes the steps of the above method in combination with its hardware.
[0400] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0401] Optionally, as another embodiment, the first processor 116 is further configured to execute the encoding method described in any one of the aforementioned embodiments when running the computer program.
[0402] This embodiment provides an encoder that, during the search for a reconstruction region, fully utilizes reconstructed block information from different matching templates, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost, thereby improving prediction accuracy and coding efficiency. Furthermore, the encoder fully utilizes the matching template information to adaptively assign weights to reference blocks, taking into account the varying importance of different reconstructed block information for the prediction of the current block, further improving prediction accuracy and coding efficiency.
[0403] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see FIG12 , which shows a schematic diagram of the structure of a decoder 120 provided in an embodiment of the present application. As shown in FIG12 , the decoder 120 may include: a second acquisition unit 121, a decoding unit 122, and a second determination unit 123; wherein,
[0404] In some embodiments, the second obtaining unit 121 is configured to obtain prediction mode reference information of the current chroma block;
[0405] The decoding unit 122 is configured to decode a first syntax element identifier when the prediction mode reference information satisfies a usage condition of the first intra prediction mode;
[0406] The second determining unit 123 is configured to determine whether the current chroma block uses the first intra prediction mode according to the first syntax element identifier;
[0407] The decoding unit 122 is further configured to decode a second syntax element identifier if the prediction mode reference information does not satisfy a usage condition of the first intra prediction mode;
[0408] The second determining unit 123 is further configured to determine whether the current chroma block uses the second intra prediction mode according to the second syntax element identifier.
[0409] In some embodiments, the decoding unit 122 is configured to decode a third syntax element identifier of the current chroma block;
[0410] The second acquiring unit 121 is configured to acquire prediction mode reference information of the current chroma block when it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra prediction mode and the second intra prediction mode;
[0411] The second determining unit 123 is configured to determine that the current chroma block uses the first intra prediction mode when the prediction mode reference information meets the use condition of the first intra prediction mode;
[0412] The second determining unit 123 is further configured to determine that the current chroma block uses the second intra prediction mode when the prediction mode reference information does not meet the use condition of the first intra prediction mode.
[0413] It can be understood that each functional unit of the decoder also performs the decoding method described in any one of the aforementioned embodiments, which will not be described in detail here.
[0414] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.
[0415] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium for use in decoder 120. The computer-readable storage medium stores a computer program that, when executed by a second processor, implements any of the decoding methods described in the aforementioned embodiments.
[0416] Based on the composition of the decoder 120 and the computer-readable storage medium, refer to Figure 13, which shows a specific hardware structure diagram of the decoder 120 provided in an embodiment of the present application. As shown in Figure 13, the decoder 120 may include: a second memory 127 and a second processor 124, a second communication interface 125 and a second bus system 126. The second memory 127 and the second processor 124, and the second communication interface 125 are coupled together through the second bus system 126. It can be understood that the second bus system 126 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 126 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 126 in Figure 22. Among them,
[0417] The second communication interface 125 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0418] The second memory 127 is used to store computer programs that can be run on the second processor;
[0419] In some embodiments, the second processor 124 is configured to, when running the computer program, execute:
[0420] Get the prediction mode reference information of the current chroma block;
[0421] If the prediction mode reference information satisfies a usage condition of the first intra prediction mode, decoding a first syntax element identifier;
[0422] Determining, according to the first syntax element identifier, whether the current chroma block uses a first intra prediction mode;
[0423] If the prediction mode reference information does not satisfy the usage condition of the first intra prediction mode, decoding a second syntax element identifier;
[0424] Determine, according to the second syntax element identifier, whether the current chroma block uses the second intra prediction mode.
[0425] In some embodiments, the second processor 124 is configured to, when running the computer program, execute:
[0426] Decoding the third syntax element identifier of the current chroma block;
[0427] When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode, obtaining prediction mode reference information of the current chroma block;
[0428] When the prediction mode reference information satisfies a use condition of the first intra prediction mode, determining that the current chroma block uses the first intra prediction mode;
[0429] In a case where the prediction mode reference information does not satisfy the use condition of the first intra prediction mode, it is determined that the current chroma block uses the second intra prediction mode.
[0430] Optionally, as another embodiment, the second processor 124 is further configured to execute the decoding method described in any one of the aforementioned embodiments when running the computer program.
[0431] It can be understood that the hardware functions of the second memory 127 and the first memory 115 are similar, and the hardware functions of the second processor 124 and the first processor 116 are similar; they are not described in detail here.
[0432] This embodiment provides a decoder that fully utilizes the reconstructed block information of different matching templates during the reconstruction region search process, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost, thereby improving prediction accuracy and decoding efficiency. Furthermore, the decoder fully utilizes the matching template information to adaptively assign weights to reference blocks, taking into account the varying importance of different reconstructed block information for the prediction of the current block, further improving prediction accuracy and decoding efficiency.
[0433] In yet another embodiment of the present application, referring to FIG14 , a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application is shown. As shown in FIG14 , the coding and decoding system 140 may include an encoder 1401 and a decoder 1402 .
[0434] In the embodiment of the present application, the encoder 1401 may be the encoder described in any one of the aforementioned embodiments, and the decoder 1402 may be the decoder described in any one of the aforementioned embodiments.
[0435] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0436] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0437] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0438] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0439] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0440] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability
[0441] The embodiment of the present application provides a coding and decoding method, a code stream, an encoder, a decoder and a storage medium. When coding and decoding chroma components, taking into account the functional redundancy of some intra-frame prediction modes, when the prediction mode reference information meets the use conditions of the first intra-frame prediction mode, only the first syntax element identifier is encoded / decoded, and according to the first syntax element identifier, it is determined whether the current chroma block uses the first intra-frame prediction mode, and the encoding / decoding of the syntax element identifier related to the second intra-frame prediction mode is skipped, that is, the current chroma block does not use the second intra-frame prediction mode. When it is not satisfied, only the second syntax element identifier is encoded / decoded, and according to the second syntax element identifier, it is determined whether the current chroma block uses the second intra-frame prediction mode; the encoding / decoding of the syntax element identifier related to the first intra-frame prediction mode is skipped, that is, the current chroma block does not use the first intra-frame prediction mode. In this way, when coding and decoding chroma components, the encoding and decoding codewords of the two intra-frame prediction modes are reduced, thereby improving compression efficiency.
[0442] In addition, a third syntax element identifier can be used to simultaneously indicate whether the first intra-frame prediction mode and the second intra-frame prediction mode are allowed to be used. When allowed, it is then determined whether the prediction mode reference information meets the use conditions of the first intra-frame prediction mode. When it meets the conditions, it can be directly determined that the current chroma block uses the first intra-frame prediction mode. When it does not meet the conditions, it is determined that the current chroma block uses the second intra-frame prediction mode. In this way, when encoding and decoding the chroma component, the third syntax element identifier can be used to enable these two intra-frame prediction modes. Furthermore, the same syntax element can be used to identify the same or similar prediction information in different intra-frame prediction modes, which can also reduce the encoding and decoding codewords of the chroma prediction mode and improve compression efficiency.
Claims
1. A decoding method, applied to a decoder, the method comprising: Get the prediction mode reference information of the current chroma block; In a case where the prediction mode reference information satisfies a use condition of the first intra prediction mode, decoding a first syntax element identifier; Determine, according to the first syntax element identifier, whether the current chroma block uses the first intra prediction mode; If the prediction mode reference information does not satisfy the use condition of the first intra prediction mode, decoding a second syntax element identifier; According to the second syntax element identifier, determine whether the current chroma block uses the second intra-frame prediction mode.
2. The method according to claim 1, wherein: The prediction mode reference information includes: intra-frame prediction mode information of the luminance block corresponding to the current chrominance block; The use condition includes: the luminance block corresponding to the current chrominance block uses the third intra-frame prediction mode.
3. The method according to claim 2, wherein: The prediction mode reference information includes: a division mode of the image unit where the current chrominance block is located; The use condition also includes: the division mode of the image unit where the current chrominance block is located is a dual-tree structure.
4. The method according to claim 2, wherein: The obtaining of the prediction mode reference information of the current chrominance block includes: The image unit where the current chrominance block is located uses a dual-tree structure to divide the luminance block and the chrominance block, and searches for luminance blocks at multiple positions in a first order in the luminance area corresponding to the current chrominance block; When the prediction mode of the first luminance block is searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chrominance block uses the third intra-frame prediction mode; When the prediction mode of the luminance block is not searched to be the third intra-frame prediction mode, it is determined that the luminance block corresponding to the current chrominance block does not use the third intra-frame prediction mode.
5. The method according to any one of claims 1 to 4, wherein: The first intra-frame prediction mode is a chroma direct derived block vector prediction mode, and the method further includes: When determining that the current chroma block uses the first intra prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; Determining a block vector of a current chrominance block according to the block vector of the first luminance block; According to the block vector of the current chroma block, a first prediction block of the current chroma block is determined.
6. The method according to claim 5, wherein: The step of determining the block vector of the current chrominance block according to the block vector of the first luminance block comprises: Downsampling the block vector of the first luminance block to determine a downsampled block vector; A fine search is performed according to the downsampled block vector to determine the block vector of the current chroma block.
7. The method according to claim 5, wherein: The method further comprises: When determining that the current chroma block uses the first intra-frame prediction mode, decoding a syntax element identifier of a weighted prediction mode of the current chroma block; Determining, according to the syntax element identifier of the weighted prediction mode, a fourth intra-frame prediction mode used for weighted prediction of the current chroma block; Determine a second prediction block obtained under the fourth intra prediction mode for the current chroma block; A weighted operation is performed according to the first prediction block and the second prediction block to obtain a final prediction block of the current chrominance block.
8. The method according to any one of claims 1 to 4, wherein: The second intra-frame prediction mode is a chroma direct derivation prediction mode, and the method further includes: When determining that the current chrominance block uses the second intra-frame prediction mode, obtaining the intra-frame prediction mode of the luminance block corresponding to the current chrominance block; Using the intra prediction mode of the luminance block as the intra prediction mode of the current chrominance block; According to the intra prediction mode of the current chroma block, a first prediction block of the current chroma block is determined.
9. The method according to claim 8, wherein: The method further comprises: When determining that the current chroma block uses the second intra-frame prediction mode, decoding a syntax element identifier of a weighted prediction mode of the current chroma block; Determining, according to the syntax element identifier of the weighted prediction mode, a fourth intra-frame prediction mode used for weighted prediction of the current chroma block; Determine a second prediction block obtained under the fourth intra prediction mode for the current chroma block; A weighted operation is performed according to the first prediction block and the second prediction block to obtain a final prediction block of the current chrominance block.
10. The method according to any one of claims 2 to 4, wherein: The third intra prediction mode is an intra block copy prediction mode or an intra template matching prediction mode.
11. The method according to claim 1, wherein: The method further comprises: When it is determined according to the first syntax element identifier that the current chroma block does not use the first intra-frame prediction mode, and when it is determined according to the second syntax element identifier that the current chroma block does not use the second intra-frame prediction mode, decoding other syntax element identifiers of the current chroma block; According to the other syntax element identifiers, other intra-frame prediction modes of the current chroma block are determined.
12. The method according to claim 1, wherein: The method further comprises: Decoding a syntax element identification of a cross-component intra prediction mode; Determine, according to the syntax element identifier of the cross-component intra-frame prediction mode, that the current chroma block uses the cross-component intra-frame prediction mode, and decode the cross-component intra-frame prediction mode information; Determine whether the current chroma block uses the cross-component intra-frame prediction mode according to the syntax element identifier of the cross-component intra-frame prediction mode, and judge whether the prediction mode reference information meets the use condition of the first intra-frame prediction mode.
13. A decoding method, applied to a decoder, the method comprising: Decoding a third syntax element identifier of a current chroma block; When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode, obtaining prediction mode reference information of the current chroma block; In a case where the prediction mode reference information satisfies a use condition of the first intra-frame prediction mode, determining that the current chroma block uses the first intra-frame prediction mode; In a case where the prediction mode reference information does not satisfy a use condition of the first intra prediction mode, it is determined that the current chroma block uses the second intra prediction mode.
14. The method according to claim 13, wherein: The prediction mode reference information includes: intra-frame prediction mode information of the luminance block corresponding to the current chrominance block; The use condition includes: the luminance block corresponding to the current chrominance block uses the third intra-frame prediction mode.
15. The method according to claim 14, wherein: The prediction mode reference information includes: a division mode of the image unit where the current chrominance block is located; The use condition also includes: the division mode of the image unit where the current chrominance block is located is a dual-tree structure.
16. The method according to claim 13, wherein: The obtaining of the prediction mode reference information of the current chrominance block includes: The image unit where the current chrominance block is located uses a dual-tree structure to divide the luminance block and the chrominance block, and searches for luminance blocks at multiple positions in a first order in the luminance area corresponding to the current chrominance block; When the prediction mode of the first luminance block is searched to be the third intra-frame prediction mode, determining that the luminance block corresponding to the current chrominance block uses the third intra-frame prediction mode; When the prediction mode of the luminance block is not searched to be the third intra-frame prediction mode, it is determined that the luminance block corresponding to the current chrominance block does not use the third intra-frame prediction mode.
17. The method according to any one of claims 13 to 16, wherein: The first intra-frame prediction mode is a chroma direct derived block vector prediction mode, and the method further includes: When determining that the current chroma block uses the first intra prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; Determining a block vector of a current chrominance block according to the block vector of the first luminance block; According to the block vector of the current chroma block, a first prediction block of the current chroma block is determined.
18. The method according to claim 17, wherein: The step of determining the block vector of the current chrominance block according to the block vector of the first luminance block comprises: Downsampling the block vector of the first luminance block to determine a downsampled block vector; A fine search is performed according to the downsampled block vector to determine the block vector of the current chroma block.
19. The method according to any one of claims 13 to 16, wherein: The second intra-frame prediction mode is a chroma direct derivation prediction mode, and the method further includes: When determining that the current chrominance block uses the second intra-frame prediction mode, obtaining the intra-frame prediction mode of the luminance block corresponding to the current chrominance block; Using the intra prediction mode of the luminance block as the intra prediction mode of the current chrominance block; According to the intra prediction mode of the current chroma block, a first prediction block of the current chroma block is determined.
20. The method according to any one of claims 13 to 19, wherein: The method further comprises: When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode, decoding the syntax element identifier of the weighted prediction mode of the current chroma block; Determining, according to the syntax element identifier of the weighted prediction mode, a fourth intra-frame prediction mode used for weighted prediction of the current chroma block; Determine a second prediction block obtained under the fourth intra prediction mode for the current chroma block; A weighted operation is performed according to the first prediction block and the second prediction block to obtain a final prediction block of the current chrominance block.
21. The method according to any one of claims 14 to 16, wherein: The third intra prediction mode is an intra block copy prediction mode or an intra template matching prediction mode.
22. The method according to claim 13, wherein: The method further comprises: Determine, according to the third syntax element identifier, that the current chrominance block is not allowed to use the first intra-frame prediction mode and the second intra-frame prediction mode In the case of detection mode, decode other syntax element identifiers of the current chrominance block; According to the other syntax element identifiers, other intra-frame prediction modes of the current chroma block are determined.
23. The method according to claim 13, wherein: The method further comprises: Decoding a syntax element identification of a cross-component intra prediction mode; Determine, according to the syntax element identifier of the cross-component intra-frame prediction mode, that the current chroma block uses the cross-component intra-frame prediction mode, and decode the cross-component intra-frame prediction mode information; Determine whether the current chroma block uses the cross-component intra-frame prediction mode according to the syntax element identifier of the cross-component intra-frame prediction mode, and decode the third syntax element identifier.
24. A coding method, applied to an encoder, the method comprising: Get the prediction mode reference information of the current chroma block; In a case where the prediction mode reference information satisfies a use condition of the first intra prediction mode, encoding a first syntax element identifier; Determine, according to the first syntax element identifier, whether the current chroma block uses the first intra prediction mode; If the prediction mode reference information does not satisfy the use condition of the first intra prediction mode, encoding a second syntax element identifier; According to the second syntax element identifier, determine whether the current chroma block uses the second intra-frame prediction mode.
25. The method according to claim 24, wherein: The prediction mode reference information includes: intra-frame prediction mode information of the luminance block corresponding to the current chrominance block; The use condition includes: the luminance block corresponding to the current chrominance block uses the third intra-frame prediction mode.
26. The method according to claim 25, wherein: The prediction mode reference information includes: a division mode of the image unit where the current chrominance block is located; The use condition also includes: the division mode of the image unit where the current chrominance block is located is a dual-tree structure.
27. The method according to any one of claims 24 to 26, wherein: The first intra-frame prediction mode is a chroma direct derived block vector prediction mode, and the method further includes: When determining that the current chroma block uses the first intra prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; Determining a block vector of a current chrominance block according to the block vector of the first luminance block; According to the block vector of the current chroma block, a first prediction block of the current chroma block is determined.
28. The method according to claim 27, wherein: The step of determining the block vector of the current chrominance block according to the block vector of the first luminance block comprises: Downsampling the block vector of the first luminance block to determine a downsampled block vector; A fine search is performed according to the downsampled block vector to determine the block vector of the current chroma block.
29. The method according to claim 27, wherein: The method further comprises: When determining that the current chroma block uses the first intra-frame prediction mode, encoding a syntax element identifier of a weighted prediction mode of the current chroma block; Determining, according to the syntax element identifier of the weighted prediction mode, a fourth intra-frame prediction mode used for weighted prediction of the current chroma block; Determine a second prediction block obtained under the fourth intra prediction mode for the current chroma block; A weighted operation is performed according to the first prediction block and the second prediction block to obtain a final prediction block of the current chrominance block.
30. The method according to any one of claims 24 to 26, wherein: The second intra-frame prediction mode is a chroma direct derivation prediction mode, and the method further includes: When determining that the current chrominance block uses the second intra-frame prediction mode, obtaining the intra-frame prediction mode of the luminance block corresponding to the current chrominance block; Using the intra prediction mode of the luminance block as the intra prediction mode of the current chrominance block; According to the intra prediction mode of the current chroma block, a first prediction block of the current chroma block is determined.
31. The method according to claim 30, wherein: The method further comprises: When determining that the current chroma block uses the first intra-frame prediction mode, encoding a syntax element identifier of a weighted prediction mode of the current chroma block; Determining, according to the syntax element identifier of the weighted prediction mode, a fourth intra-frame prediction mode used for weighted prediction of the current chroma block; Determine a second prediction block obtained under the fourth intra prediction mode for the current chroma block; A weighted operation is performed according to the first prediction block and the second prediction block to obtain a final prediction block of the current chrominance block.
32. The method of claim 25, wherein: The third intra prediction mode is an intra block copy prediction mode or an intra template matching prediction mode.
33. The method of claim 24, wherein: The method further comprises: When it is determined according to the first syntax element identifier that the current chroma block does not use the first intra-frame prediction mode, and when it is determined according to the second syntax element identifier that the current chroma block does not use the second intra-frame prediction mode, encoding other syntax element identifiers of the current chroma block; According to the other syntax element identifiers, other intra-frame prediction modes of the current chroma block are determined.
34. The method of claim 24, wherein: The method further comprises: encoding a syntax element identification of a cross-component intra prediction mode; Determine, according to the syntax element identifier of the cross-component intra-frame prediction mode, that the current chroma block uses the cross-component intra-frame prediction mode, and encode the cross-component intra-frame prediction mode information; Determine whether the current chroma block uses the cross-component intra-frame prediction mode according to the syntax element identifier of the cross-component intra-frame prediction mode, and judge whether the prediction mode reference information meets the use condition of the first intra-frame prediction mode.
35. A coding method, applied to an encoder, the method comprising: Encode the third syntax element identifier of the current chrominance block; When it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode, obtaining prediction mode reference information of the current chroma block; In a case where the prediction mode reference information satisfies a use condition of the first intra-frame prediction mode, determining that the current chroma block uses the first intra-frame prediction mode; In a case where the prediction mode reference information does not satisfy a use condition of the first intra prediction mode, it is determined that the current chroma block uses the second intra prediction mode.
36. The method of claim 35, wherein: The prediction mode reference information includes: intra-frame prediction mode information of the luminance block corresponding to the current chrominance block; The use condition includes: the luminance block corresponding to the current chrominance block uses the third intra-frame prediction mode.
37. The method of claim 36, wherein: The prediction mode reference information includes: a division mode of the image unit where the current chrominance block is located; The use condition also includes: the division mode of the image unit where the current chrominance block is located is a dual-tree structure.
38. The method according to any one of claims 34 to 37, wherein: The first intra-frame prediction mode is a chroma direct derived block vector prediction mode, and the method further includes: When determining that the current chroma block uses the first intra prediction mode, obtaining a block vector of a first luminance block corresponding to the current chroma block; Determining a block vector of a current chrominance block according to the block vector of the first luminance block; According to the block vector of the current chroma block, a first prediction block of the current chroma block is determined.
39. The method of claim 38, wherein: The step of determining the block vector of the current chrominance block according to the block vector of the first luminance block comprises: Downsampling the block vector of the first luminance block to determine a downsampled block vector; A fine search is performed according to the downsampled block vector to determine the block vector of the current chroma block.
40. The method according to any one of claims 34 to 37, wherein: The second intra-frame prediction mode is a chroma direct derivation prediction mode, and the method further includes: When determining that the current chrominance block uses the second intra-frame prediction mode, obtaining the intra-frame prediction mode of the luminance block corresponding to the current chrominance block; Using the intra prediction mode of the luminance block as the intra prediction mode of the current chrominance block; According to the intra prediction mode of the current chroma block, a first prediction block of the current chroma block is determined.
41. The method according to any one of claims 34 to 40, wherein: The method further comprises: When determining, according to the third syntax element identifier, that the current chroma block is allowed to use the first intra-frame prediction mode and the second intra-frame prediction mode, encoding a syntax element identifier of a weighted prediction mode of the current chroma block; Determining, according to the syntax element identifier of the weighted prediction mode, a fourth intra-frame prediction mode used for weighted prediction of the current chroma block; Determine a second prediction block obtained under the fourth intra prediction mode for the current chroma block; A weighted operation is performed according to the first prediction block and the second prediction block to obtain a final prediction block of the current chrominance block.
42. The method of claim 36, wherein: The third intra prediction mode is an intra block copy prediction mode or an intra template matching prediction mode.
43. The method of claim 35, wherein: The method further comprises: When it is determined according to the third syntax element identifier that the current chroma block is not allowed to use the first intra-frame prediction mode and the second intra-frame prediction mode, encoding other syntax element identifiers of the current chroma block; According to the other syntax element identifiers, other intra-frame prediction modes of the current chroma block are determined.
44. The method of claim 35, wherein: The method further comprises: encoding a syntax element identification of a cross-component intra prediction mode; Determine, according to the syntax element identifier of the cross-component intra-frame prediction mode, that the current chroma block uses the cross-component intra-frame prediction mode, and encode the cross-component intra-frame prediction mode information; Determine whether the current chroma block uses the cross-component intra-frame prediction mode according to the syntax element identifier of the cross-component intra-frame prediction mode, and encode the third syntax element identifier.
45. A code stream, wherein The code stream is generated by bit encoding according to the information to be encoded; wherein the information to be encoded includes at least one of the following: A first syntax element identifier for indicating whether to use the first intra-frame prediction mode, a second syntax element identifier for indicating whether to use the second intra-frame prediction mode, a third syntax element identifier for indicating whether the first intra-frame prediction mode and the second intra-frame prediction mode are allowed, a syntax element identifier for indicating a weighted prediction mode, other syntax element identifiers for indicating other intra-frame prediction modes, and a syntax element identifier for indicating a cross-component intra-frame prediction mode.
46. An encoder comprising: A first acquisition unit, configured to acquire prediction mode reference information of a current chroma block; an encoding unit, configured as a first determining unit, configured to encode a first syntax element identifier when the prediction mode reference information satisfies a use condition of a first intra prediction mode; A first determining unit, configured to determine whether the current chroma block uses the first intra prediction mode according to the first syntax element identifier; The encoding unit is further configured to encode a second syntax element identifier if the prediction mode reference information does not satisfy a use condition of the first intra prediction mode; The first determination unit is further configured to determine whether the current chroma block uses a second intra-frame prediction mode according to the second syntax element identifier.
47. An encoder comprising: A coding unit configured to encode a third syntax element identifier of a current chroma block; A first acquisition unit is configured to acquire prediction mode reference information of the current chroma block when it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode; A first determining unit, configured to determine that the current chroma block uses the first intra prediction mode if the prediction mode reference information satisfies a use condition of the first intra prediction mode; The first determining unit is further configured to determine that the current chroma block uses the second intra prediction mode when the prediction mode reference information does not satisfy a use condition of the first intra prediction mode.
48. An encoder comprising a first memory and a first processor; wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 24 to 44 when running the computer program.
49. A decoder comprising: A second acquisition unit, configured to acquire prediction mode reference information of a current chroma block; A decoding unit, configured to decode a first syntax element identifier when the prediction mode reference information satisfies a usage condition of a first intra prediction mode; A second determining unit is configured to determine whether the current chroma block uses the first intra prediction mode according to the first syntax element identifier; The decoding unit is further configured to decode a second syntax element identifier if the prediction mode reference information does not satisfy a usage condition of the first intra prediction mode; The second determination unit is further configured to determine whether the current chroma block uses a second intra-frame prediction mode according to the second syntax element identifier.
50. A decoder comprising: A decoding unit, configured to decode a third syntax element identifier of a current chroma block; A second acquisition unit is configured to acquire prediction mode reference information of the current chroma block when it is determined according to the third syntax element identifier that the current chroma block allows the use of the first intra-frame prediction mode and the second intra-frame prediction mode; A second determining unit, configured to determine that the current chroma block uses the first intra prediction mode if the prediction mode reference information satisfies a use condition of the first intra prediction mode; The second determining unit is further configured to determine that the current chroma block uses the second intra prediction mode when the prediction mode reference information does not satisfy a use condition of the first intra prediction mode.
51. A decoder comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 23 when running the computer program.
52. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 23 is implemented, or the method according to any one of claims 24 to 44 is implemented.